From 67f77bb507d0f27b169f53258bcc94a24d7f8894 Mon Sep 17 00:00:00 2001 From: dolorous Date: Thu, 25 Sep 2008 16:41:51 +0000 Subject: 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 --- crawl-ref/source/fight.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/fight.cc') 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); -- cgit v1.2.3-54-g00ecf