summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-19 22:24:57 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-19 22:24:57 +0000
commit074a9dc0cdd2fc678746c5f9293584a5b9a0c2d3 (patch)
tree4437ffd6be0aaf4dfee41f9db17fb7fcd8f66205 /crawl-ref/source/effects.cc
parent943325b14f6de3cda8b458ba36061f2b789014f2 (diff)
downloadcrawl-ref-074a9dc0cdd2fc678746c5f9293584a5b9a0c2d3.tar.gz
crawl-ref-074a9dc0cdd2fc678746c5f9293584a5b9a0c2d3.zip
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
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;