]> granicus.if.org Git - nethack/commitdiff
inconsistency going down a hole/trapdoor accidentally vs deliberately
authornhmall <nhmall@nethack.org>
Sun, 12 Aug 2018 12:40:55 +0000 (08:40 -0400)
committernhmall <nhmall@nethack.org>
Sun, 12 Aug 2018 12:40:55 +0000 (08:40 -0400)
Noted on rgrn, after being told that you don't fit upon discovery
of a hole or trap door you could then immediately use '>' to
proceed down.

The deliberate situation remains possible and has some
inherent risk.

doc/fixes36.2
src/do.c

index eea5882367ecec151b9e33d4128449ca9ada70d7..55cde42ad0bc05e7524f397118fef3713c072d29 100644 (file)
@@ -80,6 +80,7 @@ succubus/incubus seduction might result in loss of levitation which in turn
        could drop the hero onto a trap that transports him/her elsewhere;
        seduction was proceeding as if nothing unusual had happened
 #turn command which aggravated monsters did so without using a turn (not a pun)
+fix hole/trapdoor passage inconsistency when polymorphed into a giant
 
 
 Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
index 6bbd8c72b2403983b4f934863046607e36471251..53a89bc3752a3e8b7a8383aaff6989429d5d0e33 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -988,10 +988,29 @@ dodown()
         return 0;
     }
 
-    if (trap)
-        You("%s %s.", Flying ? "fly" : locomotion(youmonst.data, "jump"),
-            trap->ttyp == HOLE ? "down the hole" : "through the trap door");
-
+    if (trap) {
+        const char *down_or_thru = trap->ttyp == HOLE ? "down" : "through";
+        const char *actn = Flying ? "fly" : locomotion(youmonst.data, "jump");
+
+        if (youmonst.data->msize >= MZ_HUGE) {
+            char qbuf[QBUFSZ];
+
+            You("don't fit %s easily.", down_or_thru);
+            Sprintf(qbuf, "Try to squeeze %s?", down_or_thru);
+            if (yn(qbuf) == 'y') {
+                if (!rn2(3)) {
+                    actn = "manage to squeeze";
+                    losehp(Maybe_Half_Phys(rnd(4)),
+                           "contusion from a small passage", KILLED_BY);
+                } else {
+                    You("were unable to fit %s.", down_or_thru);
+                    return 0;
+                }
+            }
+        }
+        You("%s %s the %s.", actn, down_or_thru,
+            trap->ttyp == HOLE ? "hole" : "trap door");
+    }
     if (trap && Is_stronghold(&u.uz)) {
         goto_hell(FALSE, TRUE);
     } else {