diff options
author | Neil Moore <neil@s-z.org> | 2014-07-18 23:13:34 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2014-07-18 23:15:26 -0400 |
commit | 3000a8c17b790010a24a76b12d09f75646e0a443 (patch) | |
tree | ce63598db0c63fa9395c43478db9f0e5f0b54cb1 /crawl-ref/source/player.cc | |
parent | f27e6ab4a14487cedb8c3d1b6bd1dd87b5744187 (diff) | |
download | crawl-ref-3000a8c17b790010a24a76b12d09f75646e0a443.tar.gz crawl-ref-3000a8c17b790010a24a76b12d09f75646e0a443.zip |
Clear Engulf status when forcibly separated (#7437)
The status still doesn't end immediately when the engulfer dies etc.:
see bug #7394.
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 16fba24d55..9598fc0855 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5518,6 +5518,25 @@ static void _end_water_hold() you.props.erase("water_holder"); } +bool player::clear_far_engulf() +{ + if (!you.duration[DUR_WATER_HOLD]) + return false; + + monster * const mons = monster_by_mid(you.props["water_holder"].get_int()); + if (!mons || !adjacent(mons->pos(), you.pos())) + { + if (you.res_water_drowning()) + mpr("The water engulfing you falls away."); + else + mpr("You gasp with relief as air once again reaches your lungs."); + + _end_water_hold(); + return true; + } + return false; +} + void handle_player_drowning(int delay) { if (you.duration[DUR_WATER_HOLD] == 1) |