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

@@ -192,6 +192,9 @@ extern NEARDATA struct objdescr obj_descr[NUM_OBJECTS + 1];
/* primary damage: fire/rust/--- */
/* is_flammable(otmp), is_rottable(otmp) in mkobj.c */
#define is_rustprone(otmp) (objects[otmp->otyp].oc_material == IRON)
#define is_crackable(otmp) \
(objects[(otmp)->otyp].oc_material == GLASS \
&& (otmp)->oclass == ARMOR_CLASS) /* erosion_matters() */
/* secondary damage: rot/acid/acid */
#define is_corrodeable(otmp) \
(objects[otmp->otyp].oc_material == COPPER \
@@ -199,6 +202,7 @@ extern NEARDATA struct objdescr obj_descr[NUM_OBJECTS + 1];
/* subject to any damage */
#define is_damageable(otmp) \
(is_rustprone(otmp) || is_flammable(otmp) \
|| is_rottable(otmp) || is_corrodeable(otmp))
|| is_rottable(otmp) || is_corrodeable(otmp) \
|| is_crackable(otmp))
#endif /* OBJCLASS_H */