From b0656caf08f04934c2012515fa6260be0e234e24 Mon Sep 17 00:00:00 2001 From: dolorous Date: Sun, 18 Jan 2009 21:59:41 +0000 Subject: After some more thought, make draining and vampiric attacks (both weapons and monster attacks, not just the latter) take full negative energy resistance into account. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8556 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 58e4cfbcc5..1452c27c11 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -2052,7 +2052,7 @@ void melee_attack::drain_defender() { const int rn = defender->res_negative_energy(); - if (defender->atype() == ACT_MONSTER && (rn > 0 || one_chance_in(3))) + if (defender->atype() == ACT_MONSTER || one_chance_in(3)) return; if (defender->drain_exp(attacker)) @@ -2874,8 +2874,10 @@ bool melee_attack::apply_damage_brand() break; } + if (x_chance_in_y(defender->res_negative_energy(), 3)) + break; + if (defender->holiness() != MH_NATURAL || !weapon - || defender->res_negative_energy() > 0 || damage_done < 1 || attacker->stat_hp() == attacker->stat_maxhp() || one_chance_in(5)) { -- cgit v1.2.3-54-g00ecf