summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-25 16:41:51 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-25 16:41:51 +0000
commit67f77bb507d0f27b169f53258bcc94a24d7f8894 (patch)
tree849b5a021717cdda8dfbb2b0e6339f8a2a89bfe2 /crawl-ref/source/fight.cc
parent7da71d18a7403dcd95b2e57370dc26bf1274f436 (diff)
downloadcrawl-ref-67f77bb507d0f27b169f53258bcc94a24d7f8894.tar.gz
crawl-ref-67f77bb507d0f27b169f53258bcc94a24d7f8894.zip
Replace Yred's life saving with injury mirroring, based on the old "pain
mirror" FR with some suggestions from dploog. A monster affected by this will briefly flash blood-red, and each mirroring costs the square root of the damage in piety. It will not damage a monster if the damage kills you first, but that should only have an effect on gameplay in wizard mode if you use it to avoid death, in which case you don't really need it. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6983 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index e8e77072a4..a824eb64c5 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -3971,8 +3971,12 @@ void melee_attack::mons_perform_attack_rounds()
defender->hurt(attacker, damage_done + special_damage);
- if (!defender->alive() || attacker == defender)
+ // Yredelemnul's injury mirroring can kill the attacker.
+ if (!attacker->alive() || !defender->alive()
+ || attacker == defender)
+ {
return;
+ }
special_damage = 0;
special_damage_message.clear();
@@ -3983,6 +3987,10 @@ void melee_attack::mons_perform_attack_rounds()
if (special_damage > 0)
defender->hurt(attacker, special_damage);
+
+ // Yredelemnul's injury mirroring can kill the attacker.
+ if (!attacker->alive())
+ return;
}
item_def *weap = atk->mslot_item(MSLOT_WEAPON);