summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/traps.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-09 20:22:37 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-09 20:22:37 +0000
commit297b7ce16954e5144b7d11b3202a60b331a9a940 (patch)
treec0e0ab2bfbb514a6850ad33452e94e7787e9f555 /crawl-ref/source/traps.cc
parentd148c905a225bcf679e2c7e285eb15265e89fe5f (diff)
downloadcrawl-ref-297b7ce16954e5144b7d11b3202a60b331a9a940.tar.gz
crawl-ref-297b7ce16954e5144b7d11b3202a60b331a9a940.zip
So many files? That's probably some debugging messages included,
again... Anyway, I added a check to make sure that monsters that somehow end up in deep water (confusion!) can get out of it again if not aquatic. Monsters that can drown, will still do so, of course. I also removed the drowning conditional for zombies and skeletons. They'll now slog invisibly underwater and eventually reappear in shallow water or dry land. I think this is more interesting than making them drown. That, and they've seen a lot of nerfs lately. Oh, right, and I replaced some ENCH_SUBMERGED with mons_is_submerged(), that might explain the number of modified files... git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7427 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/traps.cc')
-rw-r--r--crawl-ref/source/traps.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc
index b03d2d0cb6..826448d22f 100644
--- a/crawl-ref/source/traps.cc
+++ b/crawl-ref/source/traps.cc
@@ -141,12 +141,13 @@ std::string trap_def::name(description_level_type desc) const
bool trap_def::is_known(const actor* act) const
{
- bool rc = false;
const bool player_knows = (grd(pos) != DNGN_UNDISCOVERED_TRAP);
if (act == NULL || act->atype() == ACT_PLAYER)
- rc = player_knows;
- else if (act->atype() == ACT_MONSTER)
+ return (player_knows);
+
+ bool rc = false;
+ if (act->atype() == ACT_MONSTER)
{
const monsters* monster = dynamic_cast<const monsters*>(act);
const bool mechanical = (this->category() == DNGN_TRAP_MECHANICAL);
@@ -162,8 +163,8 @@ bool trap_def::is_known(const actor* act) const
rc = (intel >= I_NORMAL && mechanical
&& (mons_is_native_in_branch(monster)
- || (mons_wont_attack(monster) && player_knows)
- || (intel >= I_HIGH && one_chance_in(3))));
+ || mons_wont_attack(monster) && player_knows
+ || intel >= I_HIGH && one_chance_in(3)));
}
return rc;
}
@@ -260,7 +261,7 @@ void monster_caught_in_net(monsters *mon, bolt &pbolt)
if (mon_flies)
{
simple_monster_message(mon, " falls like a stone!");
- mons_check_pool(mon, pbolt.killer(), pbolt.beam_source);
+ mons_check_pool(mon, mon->pos(), pbolt.killer(), pbolt.beam_source);
}
}
}