diff options
author | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-07-10 19:47:25 -0700 |
---|---|---|
committer | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-07-10 19:56:57 -0700 |
commit | 2d02254e2a32210f89c273abe4282c7d6b6b1b23 (patch) | |
tree | 38fa80ed193cee8d9d8469be5ac102b684ebd009 /crawl-ref/source/mon-death.cc | |
parent | 277cf9511b001624e5295d70171bfc23cd96e5b3 (diff) | |
download | crawl-ref-2d02254e2a32210f89c273abe4282c7d6b6b1b23.tar.gz crawl-ref-2d02254e2a32210f89c273abe4282c7d6b6b1b23.zip |
Remove Davy Jones' Locker (let monster undead drown)
Previously they'd sink to the bottom of deep water & lurk
forever. Thematic, but extremely unintuitive and not really
accomplishing much. It'd be cool to let them move slowly through
deep water, maybe, but hiding at the bottom was clearly the wrong
answer.
Also touch up player drowning messages a little bit, and fix one
that would never show up.
Diffstat (limited to 'crawl-ref/source/mon-death.cc')
-rw-r--r-- | crawl-ref/source/mon-death.cc | 100 |
1 files changed, 49 insertions, 51 deletions
diff --git a/crawl-ref/source/mon-death.cc b/crawl-ref/source/mon-death.cc index 7bb75ee4a1..a67f6773a8 100644 --- a/crawl-ref/source/mon-death.cc +++ b/crawl-ref/source/mon-death.cc @@ -2705,6 +2705,14 @@ int mounted_kill(monster* daddy, monster_type mc, killer_type killer, return monster_die(&mon, killer, killer_index, false, false, true); } +/** + * Applies harmful environmental effects from the current tile to monsters. + * + * @param mons The monster to maybe drown/incinerate. + * @param oldpos Their previous tile, before landing up here. + * @param killer Who's responsible for killing them, if they die here. + * @param killnum Not sure; *probably* the mindex of the killer, if any? + */ void mons_check_pool(monster* mons, const coord_def &oldpos, killer_type killer, int killnum) { @@ -2713,64 +2721,54 @@ void mons_check_pool(monster* mons, const coord_def &oldpos, return; dungeon_feature_type grid = grd(mons->pos()); - if ((grid == DNGN_LAVA || grid == DNGN_DEEP_WATER) - && !monster_habitable_grid(mons, grid)) + if (grid != DNGN_LAVA && grid != DNGN_DEEP_WATER + || monster_habitable_grid(mons, grid)) { - const bool message = mons_near(mons); + return; + } - // Don't worry about invisibility. You should be able to see if - // something has fallen into the lava. - if (message && (oldpos == mons->pos() || grd(oldpos) != grid)) - { - mprf("%s falls into the %s!", - mons->name(DESC_THE).c_str(), - grid == DNGN_LAVA ? "lava" : "water"); - } - if (grid == DNGN_LAVA && mons->res_fire() >= 2) - grid = DNGN_DEEP_WATER; + // Don't worry about invisibility. You should be able to see if + // something has fallen into the lava. + if (mons_near(mons) && (oldpos == mons->pos() || grd(oldpos) != grid)) + { + mprf("%s falls into the %s!", + mons->name(DESC_THE).c_str(), + grid == DNGN_LAVA ? "lava" : "water"); + } - // Even fire resistant monsters perish in lava, but inanimate - // monsters can survive deep water. - if (grid == DNGN_LAVA || mons->can_drown()) - { - if (message) - { - if (grid == DNGN_LAVA) - { - simple_monster_message(mons, " is incinerated.", - MSGCH_MONSTER_DAMAGE, MDAM_DEAD); - } - else if (mons_genus(mons->type) == MONS_MUMMY) - { - simple_monster_message(mons, " falls apart.", - MSGCH_MONSTER_DAMAGE, MDAM_DEAD); - } - else - { - simple_monster_message(mons, " drowns.", - MSGCH_MONSTER_DAMAGE, MDAM_DEAD); - } - } - if (killer == KILL_NONE) - { - // Self-kill. - killer = KILL_MON; - killnum = mons->mindex(); - } + /* if (grid == DNGN_LAVA && mons->res_fire() >= 2) + grid = DNGN_DEEP_WATER;*/ - // Yredelemnul special, redux: It's the only one that can - // work on drowned monsters. - if (!_yred_enslave_soul(mons, killer)) - monster_die(mons, killer, killnum, true); - } - else - { - dprf("undrownable in Davy Jones' locker"); - mons->add_ench(ENCH_SUBMERGED); - } + // Even fire resistant monsters perish in lava. + if (grid == DNGN_LAVA && mons->res_fire() < 2) + { + simple_monster_message(mons, " is incinerated.", + MSGCH_MONSTER_DAMAGE, MDAM_DEAD); } + else if (mons->can_drown()) + { + simple_monster_message(mons, " drowns.", + MSGCH_MONSTER_DAMAGE, MDAM_DEAD); + } + else + { + simple_monster_message(mons, " falls apart.", + MSGCH_MONSTER_DAMAGE, MDAM_DEAD); + } + + if (killer == KILL_NONE) + { + // Self-kill. + killer = KILL_MON; + killnum = mons->mindex(); + } + + // Yredelemnul special, redux: It's the only one that can + // work on drowned monsters. + if (!_yred_enslave_soul(mons, killer)) + monster_die(mons, killer, killnum, true); } // Make all of the monster's original equipment disappear, unless it's a fixed |