summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc16
1 files changed, 8 insertions, 8 deletions
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;