From 233385401a3ca492f07e1b029d873ffc6873be06 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Wed, 6 Mar 2002 01:58:07 +0000 Subject: [PATCH] more weapon shattering The Kop Kaptain's rubber hose shatters from the force of your blow! Rubber hoses are an individual exception that would need to be dealt with explicitly, since the PLASTIC they're made of is floppy rather than rigid as for other PLASTIC items. --- include/obj.h | 5 +++++ src/uhitm.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/obj.h b/include/obj.h index 461426bfb..5bcf9d0dc 100644 --- a/include/obj.h +++ b/include/obj.h @@ -222,6 +222,11 @@ struct obj { (obj)->otyp == FLINT || \ (obj)->otyp == TOUCHSTONE) +/* misc */ +#define is_flimsy(otmp) (objects[(otmp)->otyp].oc_material <= LEATHER || \ + (otmp)->otyp == RUBBER_HOSE) + + /* helpers, simple enough to be macros */ #define is_plural(o) ((o)->quan > 1 || \ (o)->oartifact == ART_EYES_OF_THE_OVERWORLD) diff --git a/src/uhitm.c b/src/uhitm.c index c279011fe..4cac38282 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -575,7 +575,7 @@ int thrown; ((wtype = uwep_skill_type()) != P_NONE && P_SKILL(wtype) >= P_SKILLED) && ((monwep = MON_WEP(mon)) != 0 && - objects[monwep->otyp].oc_material >= WOOD && + !is_flimsy(monwep) && !obj_resists(monwep, 50 + 15 * greatest_erosion(obj), 100))) { /*