]> granicus.if.org Git - nethack/commitdiff
eggs and other breakables break falling down stairs
authorcohrs <cohrs>
Tue, 29 Jan 2002 06:35:17 +0000 (06:35 +0000)
committercohrs <cohrs>
Tue, 29 Jan 2002 06:35:17 +0000 (06:35 +0000)
<Someone> questioned why eggs and potions don't break when falling downstairs.
For that matter, other breakables should as well.

doc/fixes33.2
src/dokick.c

index 8782f59d3d1a49b0352783472ec8d7b6b25684ba..3693db6c380e00363ea904773877345264f7b552 100644 (file)
@@ -410,6 +410,7 @@ secret corridor detected out of vision range is still displayed (prevents bug
        where wand of secret door detection found nothing but still identified)
 getobj can now see user-specified count when using inventory to make selection
 scalpel is stainless steel (i.e. METAL) not regular steel (IRON)
+eggs, potions & other breakables may break when they fall down stairs
 
 
 Platform- and/or Interface-Specific Fixes
index 43673f33ef3433953d9214e9bf8e4696598f4cc8..46fd6963a65b84524d9dfd248fb5ef9774eaff49 100644 (file)
@@ -1280,6 +1280,29 @@ boolean shop_floor_obj;
        if (otmp == uquiver) setuqwep((struct obj *)0);
        if (otmp == uswapwep) setuswapwep((struct obj *)0);
 
+       /* some things break rather than ship */
+       if (breaktest(otmp)) {
+           char *result;
+           if (objects[otmp->otyp].oc_material == GLASS
+#ifdef TOURIST
+               || otmp->otyp == EXPENSIVE_CAMERA
+#endif
+               ) {
+               if (otmp->otyp == MIRROR)
+                   change_luck(-2);
+               result = "crash";
+           } else {
+               /* penalty for breaking eggs laid by you */
+               if (otmp->otyp == EGG && otmp->spe && otmp->corpsenm >= LOW_PM)
+                   change_luck((schar) -min(otmp->quan, 5L));
+               result = "splatt";
+           }
+           You_hear("a muffled %s.",result);
+           obj_extract_self(otmp);
+           obfree(otmp, (struct obj *) 0);
+           return TRUE;
+       }
+
        add_to_migration(otmp);
        otmp->ox = cc.x;
        otmp->oy = cc.y;