]> granicus.if.org Git - nethack/commitdiff
B14014: soft hats and piercers
authorcohrs <cohrs>
Thu, 21 Nov 2002 18:05:48 +0000 (18:05 +0000)
committercohrs <cohrs>
Thu, 21 Nov 2002 18:05:48 +0000 (18:05 +0000)
Soft "helmets" don't protect against falling rocks, but did protect against
piercers.  Update the checks so only hard (metallic) helmets provide this
protection.  The same report quibbled about using the word "helmet" for
soft head coverings.  This patch does not address that quibble.

doc/fixes34.1
src/hack.c
src/mhitu.c

index 260d8f1d25682ed95cfb304ffaddd3ed7a6ce58a..10b88379d73fcee7a96bf0ef475823fc5a1b28dd 100644 (file)
@@ -311,6 +311,7 @@ use get_adjacent_loc() rather than getdir() directly for some things where
 minor experience calculation tweaks
 level telporting out of the dungeon while carrying unpaid shop goods would
        trigger "not on any bill" warnings during final inventory disclosure
+only hard helmets protect against falling piercers
 
 
 Platform- and/or Interface-Specific Fixes
index 6731ebe4ad7370f9f602608e85e8e5c202863a02..56a9e7d57854d3329822355bacc2ab74237a9f5f 100644 (file)
@@ -1493,7 +1493,7 @@ stillinwater:;
                              Amonnam(mtmp), ceiling(u.ux,u.uy));
                        if(mtmp->mtame) /* jumps to greet you, not attack */
                            ;
-                       else if(uarmh)
+                       else if(uarmh && is_metallic(uarmh))
                            pline("Its blow glances off your helmet.");
                        else if (u.uac + 3 <= rnd(20))
                            You("are almost hit by %s!",
index 88f8200c2bf84b387bc9a14e0b440f9d4c7334ca..d5ba16d6bdd4bdfaf616b9d48a098e44011a4411 100644 (file)
@@ -356,6 +356,7 @@ mattacku(mtmp)
                u.uundetected = 0;
                if (is_hider(youmonst.data)) {
                    coord cc; /* maybe we need a unexto() function? */
+                   struct obj *obj;
 
                    You("fall from the %s!", ceiling(u.ux,u.uy));
                    if (enexto(&cc, u.ux, u.uy, youmonst.data)) {
@@ -377,7 +378,8 @@ mattacku(mtmp)
                    if (youmonst.data->mlet != S_PIERCER)
                        return(0);      /* trappers don't attack */
 
-                   if (which_armor(mtmp, WORN_HELMET)) {
+                   obj = which_armor(mtmp, WORN_HELMET);
+                   if (obj && is_metallic(obj)) {
                        Your("blow glances off %s helmet.",
                                       s_suffix(mon_nam(mtmp)));
                    } else {