Skip to content

Commit

Permalink
Chargeable rings may get charged when hit with electricity
Browse files Browse the repository at this point in the history
... instead of being destroyed. Normal charging limits apply.
  • Loading branch information
paxed committed Feb 21, 2022
1 parent 5fa2576 commit ef6a88e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/fixes3-7-0.txt
Expand Up @@ -801,6 +801,7 @@ always give a message when monster changes form via polytrap if seen
illiterate hero receiving a spellbook from their deity gets the spell shoved
directly into their mind instead
adjust levels of sleep, confuse monster, and charm monster spells
chargeable rings have a chance of getting charged when hit with electricity


Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
Expand Down
8 changes: 7 additions & 1 deletion src/zap.c
Expand Up @@ -5070,6 +5070,7 @@ destroy_one_item(struct obj *obj, int osym, int dmgtyp)
int dmg, xresist, skip, dindx;
const char *mult;
boolean physical_damage;
boolean chargeit = FALSE;

physical_damage = FALSE;
xresist = skip = 0;
Expand Down Expand Up @@ -5137,6 +5138,9 @@ destroy_one_item(struct obj *obj, int osym, int dmgtyp)
|| obj->otyp == RIN_SHOCK_RESISTANCE) {
skip++;
break;
} else if (objects[obj->otyp].oc_charged && rn2(3)) {
chargeit = TRUE;
break;
}
dindx = 5;
dmg = 0;
Expand All @@ -5162,7 +5166,9 @@ destroy_one_item(struct obj *obj, int osym, int dmgtyp)
break;
}

if (!skip) {
if (chargeit)
recharge(obj, 0);
else if (!skip) {
if (obj->in_use)
--quan; /* one will be used up elsewhere */
for (i = cnt = 0L; i < quan; i++)
Expand Down

0 comments on commit ef6a88e

Please sign in to comment.