summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-08-16 17:24:46 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-08-16 17:24:46 +0000
commit614cdcf0426223561bf7a58ebb999e47c366fe82 (patch)
tree69233c1ad85d5781f959a4ad07161f791d2db4bb /crawl-ref/source/fight.cc
parent761776ba7396dc3132961bf0af5add4e58a94a9e (diff)
downloadcrawl-ref-614cdcf0426223561bf7a58ebb999e47c366fe82.tar.gz
crawl-ref-614cdcf0426223561bf7a58ebb999e47c366fe82.zip
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
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc22
1 files changed, 14 insertions, 8 deletions
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))
{