summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.cc
diff options
context:
space:
mode:
authorChris Campbell <chriscampbell89@gmail.com>2014-05-28 03:46:31 +0100
committerChris Campbell <chriscampbell89@gmail.com>2014-05-28 04:43:17 +0100
commitcd548fe2d1827730c6ba5b5d28242e1d7aca1591 (patch)
treed047d1952a2a58d17509a5c38932f5b4c5e93540 /crawl-ref/source/ouch.cc
parenta5e4a985aef88b7de2b6e483643db4e78c2168f2 (diff)
downloadcrawl-ref-cd548fe2d1827730c6ba5b5d28242e1d7aca1591.tar.gz
crawl-ref-cd548fe2d1827730c6ba5b5d28242e1d7aca1591.zip
Reduce the base chance of applying corrosion, ignore item enchantment for resistance
With temporary corrosion being more abstracted than permanent corrosion, having items resist individually was a little strange since an artefact or +9 weapon could still be "corroded" by swapping from something else to it, or by having your armour be the target of the acid. Corrosion now just looks at equipped/empty slots to determine the chance of applying the debuff and how much damage to do with the acid splash, and is less likely to apply the debuff (compared to low-enchantment items). Item enchantment (or artefact status, or crystal plate armour-ness) no longer has an effect. The debuff also now can't be applied multiple times from one acid splash.
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r--crawl-ref/source/ouch.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index c8efa35023..98bafc98da 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -358,10 +358,22 @@ int check_your_resists(int hurted, beam_type flavour, string source,
return hurted;
}
-void splash_with_acid(int acid_strength, int death_source, bool corrode_items,
+/**
+ * Attempts to apply corrosion to the player and deals acid damage.
+ *
+ * Each full equipment slot gives a chance of applying the corrosion debuff,
+ * and each empty equipment slot increases the amount of acid damage taken.
+ *
+ * @param acid_strength The strength of the acid.
+ * @param death_source The monster index of the acid's source.
+ * @param allow_corrosion Whether to try and apply the corrosion debuff.
+ * @param hurt_msg A message to display when dealing damage.
+ */
+void splash_with_acid(int acid_strength, int death_source, bool allow_corrosion,
const char* hurt_msg)
{
int dam = 0;
+ bool do_corrosion = false;
const bool wearing_cloak = player_wearing_slot(EQ_CLOAK);
for (int slot = EQ_MIN_ARMOUR; slot <= EQ_MAX_ARMOUR; slot++)
@@ -375,11 +387,14 @@ void splash_with_acid(int acid_strength, int death_source, bool corrode_items,
if (!item && slot != EQ_SHIELD)
dam++;
- if (item && corrode_items && x_chance_in_y(acid_strength + 1, 20))
- corrode_item(*item, &you);
+ if (item && allow_corrosion && x_chance_in_y(acid_strength + 1, 30))
+ do_corrosion = true;
}
}
+ if (do_corrosion)
+ corrode_actor(&you);
+
// Covers head, hands and feet.
if (player_equip_unrand(UNRAND_LEAR))
dam = !wearing_cloak;