diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index c4d2a2403..91f050432 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -616,6 +616,7 @@ yet another fix for display problems during restore: if game is saved while being obfuscated by hallucination, but when displaying the hero there instead it would access steed pointer before that has been set up resistances gained from worn or wielded items also protect hero's inventory +dwarvish cloaks somewhat protect hero's inventory from cold and fire non-metallic gloves protect worn rings from shock message "Oops! food rations out of your grasp!" occurred due to perm_invent in mid-operation overwriting all of xname's/doname's obufs; fixed by diff --git a/src/zap.c b/src/zap.c index dd3f6d259..22c11e64d 100644 --- a/src/zap.c +++ b/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; }