From 614cdcf0426223561bf7a58ebb999e47c366fe82 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 16 Aug 2009 17:24:46 +0000 Subject: As per FR 2795134, nerf damage reduction of elemental resistances. Damage is now reduced to 50% (level 1, unchanged), 33% (level 2, was 20%), and 20% (level 3, was 10%), respectively. This only applies to players, monster resists are unchanged. The purpose of this change is to make the mid and late game harder without unduly affecting the early game. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10554 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/fight.cc') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 2ced048a7c..af7c6e1979 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -2045,10 +2045,6 @@ int resist_adjust_damage(actor *defender, beam_type flavour, const bool monster = (defender->atype() == ACT_MONSTER); - // Check if this is a resist that pretends to be boolean for damage - // purposes. Only electricity and sticky flame (napalm) do this at - // the moment; raw poison damage uses the normal formula. - int res_base = (is_boolean_resist(flavour) ? 2 : 1); const int resistible_fraction = get_resistible_fraction(flavour); int resistible = rawdamage * resistible_fraction / 100; @@ -2059,7 +2055,19 @@ int resist_adjust_damage(actor *defender, beam_type flavour, if (monster && res >= 3) resistible = 0; else - resistible /= res_base + res * res; + { + // Check if this is a resist that pretends to be boolean for damage + // purposes. Only electricity and sticky flame (napalm) do this at + // the moment; raw poison damage uses the normal formula. + const int bonus_res = (is_boolean_resist(flavour) ? 1 : 0); + + // Use a new formula for players, but keep the old, more effective + // for monsters. + if (monster) + resistible /= 1 + bonus_res + res * res; + else + resistible /= resist_fraction(res, bonus_res); + } } else if (res < 0) resistible = resistible * (ranged? 15 : 20) / 10; @@ -3033,9 +3041,7 @@ bool melee_attack::apply_damage_brand() break; case SPWPN_ELECTROCUTION: - if (defender->airborne()) - break; - else if (defender->res_elec() > 0) + if (defender->airborne() || defender->res_elec() > 0) break; else if (one_chance_in(3)) { -- cgit v1.2.3-54-g00ecf