]> granicus.if.org Git - nethack/commitdiff
more weapon shattering
authornethack.allison <nethack.allison>
Wed, 6 Mar 2002 01:58:07 +0000 (01:58 +0000)
committernethack.allison <nethack.allison>
Wed, 6 Mar 2002 01:58:07 +0000 (01:58 +0000)
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
src/uhitm.c

index 461426bfb61e27c3a5b4e9d595ef62ea3af6e3d5..5bcf9d0dca7a1d774c673002016547d30ced37cc 100644 (file)
@@ -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)
index c279011fefbf4358444e88bc100a8b4d714a5c2b..4cac38282457c3bddad48b05bb98241b992d1d5e 100644 (file)
@@ -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))) {
                        /*