diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-08 04:20:10 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-08 04:20:10 +0000 |
commit | f2e0ffdb7384466cc5e96c9418b0f84afc9dbbf9 (patch) | |
tree | a4c8c36914324b1c724e5d87044a8d7a044c0b50 /crawl-ref/source/effects.cc | |
parent | 0b5382599bd2db156be48fb9e54d1477f3b11a05 (diff) | |
download | crawl-ref-f2e0ffdb7384466cc5e96c9418b0f84afc9dbbf9.tar.gz crawl-ref-f2e0ffdb7384466cc5e96c9418b0f84afc9dbbf9.zip |
Properly handle holy word when it kills a monster and the monster avoids
death.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8974 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r-- | crawl-ref/source/effects.cc | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 9c3dff2570..5794404b02 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -143,25 +143,30 @@ int holy_word_monsters(coord_def where, int pow, int caster, if (hploss) simple_monster_message(monster, " convulses!"); - monster->hurt(attacker, hploss); + monster->hurt(attacker, hploss, BEAM_MISSILE, false); if (hploss) { retval = 1; - // Holy word won't annoy, slow, or frighten its user. - if (monster->alive() && attacker != monster) + if (monster->alive()) { - // Currently, holy word annoys the monsters it affects - // because it can kill them, and because hostile monsters - // don't use it. - behaviour_event(monster, ME_ANNOY, MHITYOU); + // Holy word won't annoy, slow, or frighten its user. + if (attacker != monster) + { + // Currently, holy word annoys the monsters it affects + // because it can kill them, and because hostile + // monsters don't use it. + behaviour_event(monster, ME_ANNOY, MHITYOU); - if (monster->speed_increment >= 25) - monster->speed_increment -= 20; + if (monster->speed_increment >= 25) + monster->speed_increment -= 20; - monster->add_ench(ENCH_FEAR); + monster->add_ench(ENCH_FEAR); + } } + else + monster->hurt(attacker, INSTANT_DEATH); } return (retval); |