]> granicus.if.org Git - nethack/commitdiff
B12004 polymorphing into minotaur
authornethack.allison <nethack.allison>
Sun, 22 Sep 2002 15:59:46 +0000 (15:59 +0000)
committernethack.allison <nethack.allison>
Sun, 22 Sep 2002 15:59:46 +0000 (15:59 +0000)
Polymorphing into creature with horns such as a minotaur,
will cause your helmet to fall off if it is made of a hard material.

Only minotaurs pass the has_horns() test in include/mondata.h
because the complaint specifically referred to them, but that
should perhaps be reviewed at some point by someone who is
certain which creatures have horns growing from their
head (some demons?)

doc/fixes34.1
include/mondata.h
src/polyself.c

index 6bf933db08275f3ac1db7cb49c4f2c9c8719be37..314757db014fce5b50236f836bebacde6bc43bfa 100644 (file)
@@ -253,6 +253,7 @@ stop running or travelling if the vibrating square message is triggered
 show correct gender in ^X display when polymorphed into non-humanoid form
 for wizard and explore modes, skip second screen of ^X output when first
        screen is cancelled by ESC
+polyself into minotaur causes hard headgear to fall off
 
 
 Platform- and/or Interface-Specific Fixes
index 457ccf5df18e70893d0eee869714d5c35a4ea77a..61bfbba98808bac88a2bfbcc11e75718f96cd23a 100644 (file)
@@ -40,6 +40,7 @@
 #define nolimbs(ptr)           (((ptr)->mflags1 & M1_NOLIMBS) == M1_NOLIMBS)
 #define notake(ptr)            (((ptr)->mflags1 & M1_NOTAKE) != 0L)
 #define has_head(ptr)          (((ptr)->mflags1 & M1_NOHEAD) == 0L)
+#define has_horns(ptr)         ((ptr) == &mons[PM_MINOTAUR])
 #define is_whirly(ptr)         ((ptr)->mlet == S_VORTEX || \
                                 (ptr) == &mons[PM_AIR_ELEMENTAL])
 #define is_silent(ptr)         ((ptr)->msound == MS_SILENT)
index ac5028954b781f8b8482d84c76cce58d4cddc5ba..12cdf053310333ce8068ece06703a060e0c38f73 100644 (file)
@@ -613,6 +613,21 @@ break_armor()
        }
 #endif
     }
+    if (has_horns(youmonst.data)) {
+       if ((otmp = uarmh) != 0) {
+               if (is_flimsy(otmp) && !donning(otmp)) {
+                       char yourbuf[BUFSZ];
+                       /* Future possiblities: This could damage/destroy helmet*/
+                       Your("horns pierce through %s %s.", shk_your(yourbuf, otmp),
+                               xname(otmp));
+               } else {
+                       if (donning(otmp)) cancel_don();
+                       Your("helmet falls to the %s!", surface(u.ux, u.uy));
+                       (void) Helmet_off();
+                       dropx(otmp);
+               }
+       }
+    }
     if (nohands(youmonst.data) || verysmall(youmonst.data)) {
        if ((otmp = uarmg) != 0) {
            if (donning(otmp)) cancel_don();