summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/cloud.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/cloud.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/cloud.cc')
-rw-r--r--crawl-ref/source/cloud.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc
index bbbaca890a..6f045249a2 100644
--- a/crawl-ref/source/cloud.cc
+++ b/crawl-ref/source/cloud.cc
@@ -237,7 +237,7 @@ int steam_cloud_damage(const cloud_struct &cloud)
{
return steam_cloud_damage(cloud.decay);
}
-
+
int steam_cloud_damage(int decay)
{
decay = std::min(decay, 60);
@@ -433,6 +433,17 @@ beam_type cloud2beam(cloud_type flavour)
}
}
+// Returns by how much damage gets divided due to elemental resistances.
+// Damage is reduced to, level 1 -> 1/2, level 2 -> 1/3, level 3 -> 1/5, or
+// for "boolean" attacks (which use bonus_res = 1, sticky flame/electricity)
+// to level 1 -> 1/3, level 2 -> 1/4, or level 3 -> 1/6.
+// With the old formula (1 + resist * resist) this used to be
+// 1/2, 1/5, 1/10 (normal) and 1/3, 1/6, 1/11 (boolean), respectively.
+int resist_fraction(int resist, int bonus_res)
+{
+ return ((3*resist + 1)/2 + bonus_res);
+}
+
// NOTE: Keep in sync with in_a_cloud()
int max_cloud_damage(cloud_type cl_type, int power)
{
@@ -462,7 +473,7 @@ int max_cloud_damage(cloud_type cl_type, int power)
else
{
dam += 32 * speed / 10;
- dam /= (1 + resist * resist);
+ dam /= resist_fraction(resist);
}
break;
@@ -554,7 +565,7 @@ void in_a_cloud()
{
canned_msg(MSG_YOU_RESIST);
hurted += ((random2avg(23, 3) + 10) * you.time_taken) / 10;
- hurted /= (1 + resist * resist);
+ hurted /= resist_fraction(resist);
ouch(hurted, cl, KILLED_BY_CLOUD, "flame");
}
expose_player_to_element(BEAM_FIRE, 7);
@@ -602,7 +613,7 @@ void in_a_cloud()
{
canned_msg(MSG_YOU_RESIST);
hurted += ((random2avg(23, 3) + 10) * you.time_taken) / 10;
- hurted /= (1 + resist * resist);
+ hurted /= resist_fraction(resist);
ouch(hurted, cl, KILLED_BY_CLOUD, "freezing vapour");
}
expose_player_to_element(BEAM_COLD, 7);