summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.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/items.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/items.cc')
-rw-r--r--crawl-ref/source/items.cc79
1 files changed, 0 insertions, 79 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index fe4e72acb0..b51c36cc66 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -4122,85 +4122,6 @@ bool is_valid_mimic_item(const item_def &item)
return false;
}
-void corrode_item(item_def &item, actor *holder)
-{
- // Artefacts don't corrode.
- if (is_artefact(item))
- return;
-
- // Only weapons and armour can be corroded.
- if (item.base_type != OBJ_ARMOUR && item.base_type != OBJ_WEAPONS)
- return;
-
- // Don't corrode spectral weapons.
- if (holder && holder->is_monster()
- && mons_is_avatar(holder->as_monster()->type))
- {
- return;
- }
-
- // Anti-corrosion items protect against 90% of corrosion.
- if (holder && holder->res_corr() && !one_chance_in(10))
- {
- dprf("Amulet protects.");
- return;
- }
-
- int how_rusty = ((item.base_type == OBJ_WEAPONS) ? item.plus2 : item.plus);
- // Already very rusty.
- if (how_rusty < -5)
- return;
-
- // Corrosion-resistant items.
- if (item.base_type == OBJ_ARMOUR
- && item.sub_type == ARM_CRYSTAL_PLATE_ARMOUR
- && !one_chance_in(5))
- {
- return;
- }
-
- // determine chance of corrosion {dlb}:
- const int chance = abs(how_rusty);
-
- // The embedded equation may look funny, but it actually works well
- // to generate a pretty probability ramp {6%, 18%, 34%, 58%, 98%}
- // for values [0,4] which closely matches the original, ugly switch.
- // {dlb}
- if (chance < 0 || chance > 4
- || x_chance_in_y(2 + (4 << chance) + chance * 8, 100))
- {
- return;
- }
-
- if (holder && holder->is_player())
- {
- you.increase_duration(DUR_CORROSION, 10 + roll_dice(2, 4), 50,
- "The acid corrodes your equipment!");
- xom_is_stimulated(50);
- you.props["corrosion_amount"].get_int()++;
- you.redraw_armour_class = true;
- you.wield_change = true;
- }
- else if (holder && holder->type == MONS_PLAYER_SHADOW)
- return; // it's just a temp copy of the item
- else if (holder && you.see_cell(holder->pos()))
- {
- if (holder->type == MONS_DANCING_WEAPON)
- {
- mprf("The acid corrodes %s!",
- holder->name(DESC_THE).c_str());
- }
- else
- {
- mprf("The acid corrodes %s equipment!",
- apostrophise(holder->name(DESC_THE)).c_str());
- }
- }
-
- if (holder && holder->is_monster())
- holder->as_monster()->add_ench(mon_enchant(ENCH_CORROSION, 0));
-}
-
// If there is only one unidentified subtype left in the item's object type,
// automatically identify it.
bool maybe_identify_base_type(item_def &item)