diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-10-18 00:48:01 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-10-18 00:48:01 +0200 |
commit | f923d3b75a2d9dc0e5b8953b0021832b76c65081 (patch) | |
tree | 18fce1bfb060f5b2666957585316c32d9d78ad43 /crawl-ref | |
parent | b715966689f7591c4fd180e86ec0994781bfa9df (diff) | |
download | crawl-ref-f923d3b75a2d9dc0e5b8953b0021832b76c65081.tar.gz crawl-ref-f923d3b75a2d9dc0e5b8953b0021832b76c65081.zip |
Keep krakens from submerging unless you're away from water.
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index a282e0c942..a4ff66ed08 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -3702,8 +3702,21 @@ bool monsters::swimming() const return (feat_is_watery(grid) && mons_primary_habitat(this) == HT_WATER); } +static bool _player_near_water() +{ + for(adjacent_iterator ai(you.pos()); ai; ++ai) + if (feat_is_water(grd(*ai))) + return true; + return false; +} + bool monsters::wants_submerge() const { + // Krakens never retreat when food (the player) is in range. + if (type == MONS_KRAKEN) + if (_player_near_water()) + return (false); + // If we're in distress, we usually want to submerge. if (env.cgrid(pos()) != EMPTY_CLOUD || (hit_points < max_hit_points / 2 |