Dwarvish cloaks somewhat protect inventory from cold and fire
The change to Sokoban difficulty calculation introduced a balance issue: previously the Sokoban prize was obtainable before item- destruction attacks became common and would protect from them, whereas now they commonly appear in Sokoban itself, before the prize is accessible. This makes scrolls and potions much less usable as escape items, and potions of healing less usable for HP recovery, because they either get stashed or destroyed (and in either case aren't usable by the character in time-critical situations). This commit attempts to alleviate the problem by adding a way to protect items from cold and fire in the early game. It's a little unreliable, and requires equipping an item that has bad stats and generally isn't otherwise used, but which is generally easy to find early on. Not included in this commit, but probably necessary for a "finished" version of the feature: some way of letting players know the new mechanic. It shows up in enlightenment, but there should probably be at least rumors (and maybe even a major Oracle consultation) hinting at the mechanic. We might also want to change the unIDed description of the dwarvish cloak as a hint, although that would require, e.g., new database entries.
This commit is contained in:
12
src/zap.c
12
src/zap.c
@@ -5392,7 +5392,7 @@ adtyp_to_prop(int dmgtyp)
|
||||
}
|
||||
|
||||
/* Is hero wearing or wielding an object with resistance to attack
|
||||
damage type? Returns the percentage protectoin that the object
|
||||
damage type? Returns the percentage protection that the object
|
||||
gives. */
|
||||
int
|
||||
u_adtyp_resistance_obj(int dmgtyp)
|
||||
@@ -5402,8 +5402,16 @@ u_adtyp_resistance_obj(int dmgtyp)
|
||||
if (!prop)
|
||||
return 0;
|
||||
|
||||
/* Items that give an extrinsic resistance give 99% protection to
|
||||
your items */
|
||||
if ((u.uprops[prop].extrinsic & (W_ARMOR | W_ACCESSORY | W_WEP)) != 0)
|
||||
return 99; /* 99% protected */
|
||||
return 99;
|
||||
|
||||
/* Dwarvish cloaks give a 90% protection to items against heat and
|
||||
cold */
|
||||
if (uarmc && uarmc->otyp == DWARVISH_CLOAK &&
|
||||
(dmgtyp == AD_COLD || dmgtyp == AD_FIRE))
|
||||
return 90;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user