From 074a9dc0cdd2fc678746c5f9293584a5b9a0c2d3 Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 19 Jan 2009 22:24:57 +0000 Subject: Set the targets properly for player-caused cleansing flame and immolation (oops). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8601 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/effects.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index e35c802bfa..c206e0848d 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -69,10 +69,10 @@ int holy_word_player(int pow, int caster, actor *attacker) int hploss; // Holy word won't kill its user. - if (attacker != &you) - hploss = roll_dice(2, 15) + (random2(pow) / 3); - else + if (attacker == &you) hploss = std::max(0, you.hp / 2 - 1); + else + hploss = roll_dice(2, 15) + (random2(pow) / 3); if (!hploss) return 0; @@ -135,10 +135,10 @@ int holy_word_monsters(coord_def where, int pow, int caster, int hploss; // Holy word won't kill its user. - if (attacker != monster) - hploss = roll_dice(2, 15) + (random2(pow) / 3); - else + if (attacker == monster) hploss = std::max(0, monster->hit_points / 2 - 1); + else + hploss = roll_dice(2, 15) + (random2(pow) / 3); if (hploss) simple_monster_message(monster, " convulses!"); @@ -337,7 +337,7 @@ void immolation(int pow, int caster, coord_def where, bool known, beam.thrower = KILL_MISC; beam.beam_source = NON_MONSTER; } - else if (attacker == NULL) + else if (attacker == &you) { beam.thrower = KILL_YOU; beam.beam_source = NON_MONSTER; @@ -388,7 +388,7 @@ void cleansing_flame(int pow, int caster, coord_def where, beam.thrower = KILL_MISC; beam.beam_source = NON_MONSTER; } - else if (attacker == NULL) + else if (attacker == &you) { beam.thrower = KILL_YOU; beam.beam_source = NON_MONSTER; -- cgit v1.2.3-54-g00ecf