diff options
author | Neil Moore <neil@s-z.org> | 2014-07-18 23:35:31 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2014-07-18 23:38:04 -0400 |
commit | b4cbbce6907c3fb076f0f0dddf6cc7aaaeec842e (patch) | |
tree | 1e24cc8a8fc4e33a6124a534bd198fcdbbd61955 | |
parent | 3000a8c17b790010a24a76b12d09f75646e0a443 (diff) | |
download | crawl-ref-b4cbbce6907c3fb076f0f0dddf6cc7aaaeec842e.tar.gz crawl-ref-b4cbbce6907c3fb076f0f0dddf6cc7aaaeec842e.zip |
Handle another engulf ender (#7437)
This time when your engulfer is trampled away. We don't handle the case
where a monster's engulfer is trampled away, sorry: if we want to do
that, we should generalise the constriction code and remove the engulf
enchantment/duration.
Make clear_far_engulf() public to support this change.
-rw-r--r-- | crawl-ref/source/actor.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/mon-ench.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/monster.h | 5 | ||||
-rw-r--r-- | crawl-ref/source/player.h | 4 |
4 files changed, 11 insertions, 6 deletions
diff --git a/crawl-ref/source/actor.h b/crawl-ref/source/actor.h index 87a6dbd03a..4e1a2c5a5f 100644 --- a/crawl-ref/source/actor.h +++ b/crawl-ref/source/actor.h @@ -433,6 +433,7 @@ public: int num_constricting() const; virtual bool has_usable_tentacle() const = 0; virtual int constriction_damage() const = 0; + virtual bool clear_far_engulf() = 0; // Be careful using this, as it doesn't keep the constrictor in sync. void clear_constricted(); @@ -442,7 +443,6 @@ public: protected: void end_constriction(constricting_t::iterator i, bool intentional, bool quiet); - virtual bool clear_far_engulf() = 0; }; bool actor_slime_wall_immune(const actor *actor); diff --git a/crawl-ref/source/mon-ench.cc b/crawl-ref/source/mon-ench.cc index 713828826b..adbbf5cfc6 100644 --- a/crawl-ref/source/mon-ench.cc +++ b/crawl-ref/source/mon-ench.cc @@ -1238,6 +1238,12 @@ bool monster::decay_enchantment(enchant_type en, bool decay_degree) bool monster::clear_far_engulf(void) { + if (you.duration[DUR_WATER_HOLD] + && (mid_t) you.props["water_holder"].get_int() == mid) + { + you.clear_far_engulf(); + } + const mon_enchant& me = get_ench(ENCH_WATER_HOLD); if (me.ench == ENCH_NONE) return false; diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h index 6dd951bb92..de1d221326 100644 --- a/crawl-ref/source/monster.h +++ b/crawl-ref/source/monster.h @@ -521,6 +521,8 @@ public: void align_avatars(bool force_friendly = false); void remove_avatars(); + bool clear_far_engulf(); + private: int hit_dice; @@ -551,9 +553,6 @@ private: bool check_set_valid_home(const coord_def &place, coord_def &chosen, int &nvalid) const; - -protected: - bool clear_far_engulf(); }; #endif diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 442eae462b..51899a5383 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -755,14 +755,14 @@ public: bool form_uses_xl() const; + bool clear_far_engulf(); + protected: void _removed_beholder(bool quiet = false); bool _possible_beholder(const monster* mon) const; void _removed_fearmonger(bool quiet = false); bool _possible_fearmonger(const monster* mon) const; - - bool clear_far_engulf(); }; #ifdef DEBUG_GLOBALS |