diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-18 21:59:41 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-18 21:59:41 +0000 |
commit | b0656caf08f04934c2012515fa6260be0e234e24 (patch) | |
tree | 442233856e8a9e744ec9a2126dc6fb31f15480a8 /crawl-ref/source/fight.cc | |
parent | f027a300ee6b50e10a1bc43e6c06129c4bc0c87a (diff) | |
download | crawl-ref-b0656caf08f04934c2012515fa6260be0e234e24.tar.gz crawl-ref-b0656caf08f04934c2012515fa6260be0e234e24.zip |
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
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r-- | crawl-ref/source/fight.cc | 6 |
1 files changed, 4 insertions, 2 deletions
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)) { |