breaking crystal armor

Instead of a 5% chance for crystal plate mail or crystal helmet to
break each time it's subjected to breakage, switch to a 10% chance
but the damage is treated as erosion rather than break/don't-break.
'crystal foo' will need to go through four stages of damage before
breaking:  cracked crystal foo, very cracked crystal foo, thoroughly
cracked crystal foo, then gone.  Crackproof handling is included,
described as tempered crystal foo.

It mostly still applies to throwing and kicking the item.  Having
some hits trigger damage might be worthwhile but isn't implemented.

Object creation within lua code probably needs to be updated, and
when the Mitre of Holiness is created in the priest/priestess quest
it should start out as tempered (erodeproof).  Perhaps it ought to
be erodeproof regardless of where/how it's created.
This commit is contained in:
PatR
2023-06-14 15:54:04 -07:00
parent 450f060132
commit e9c58c2fe4
11 changed files with 105 additions and 63 deletions

View File

@@ -1715,7 +1715,7 @@ poly_obj(struct obj *obj, int id)
otmp->blessed = obj->blessed;
if (erosion_matters(otmp)) {
if (is_flammable(otmp) || is_rustprone(otmp))
if (is_flammable(otmp) || is_rustprone(otmp) || is_crackable(otmp))
otmp->oeroded = obj->oeroded;
if (is_corrodeable(otmp) || is_rottable(otmp))
otmp->oeroded2 = obj->oeroded2;
@@ -5144,7 +5144,9 @@ fracture_rock(struct obj *obj) /* no texts here! */
/* shop message says "you owe <shk> <$> for it!" so we need
to precede that with a message explaining what "it" is */
You("fracture %s %s.", s_suffix(shkname(shkp)), xname(obj));
breakobj(obj, x, y, TRUE, FALSE); /* charges for shop goods */
/* breakobj won't destroy fracturing statue or boulder but
will charge for shop goods */
(void) breakobj(obj, x, y, TRUE, FALSE);
}
}
if (by_you && obj->otyp == BOULDER)