]> granicus.if.org Git - nethack/commitdiff
flying hero should be able to pass through a hole using '>'
authornhmall <nhmall@nethack.org>
Mon, 16 Dec 2019 05:25:20 +0000 (00:25 -0500)
committernhmall <nhmall@nethack.org>
Tue, 17 Dec 2019 16:32:25 +0000 (11:32 -0500)
include/extern.h
src/dokick.c
src/trap.c

index 26a82612beb65e2587f1b12bffd4736d74d01f22..a1b32f76af6d239dd775a98b0b39b09f62701989 100644 (file)
@@ -2508,7 +2508,7 @@ E boolean FDECL(burnarmor, (struct monst *));
 E int FDECL(erode_obj, (struct obj *, const char *, int, int));
 E boolean FDECL(grease_protect, (struct obj *, const char *, struct monst *));
 E struct trap *FDECL(maketrap, (int, int, int));
-E void FDECL(fall_through, (BOOLEAN_P));
+E void FDECL(fall_through, (BOOLEAN_P, unsigned));
 E struct monst *FDECL(animate_statue,
                       (struct obj *, XCHAR_P, XCHAR_P, int, int *));
 E struct monst *FDECL(activate_statue_trap,
index e86a313ec111231150bf14c8f1cb15d52ed00cc5..d9e275fbdca5407622f5ad23a9c694335e34d2f3 100644 (file)
@@ -1047,7 +1047,7 @@ dokick()
                 return 1;
             } else if (!rn2(4)) {
                 if (dunlev(&u.uz) < dunlevs_in_dungeon(&u.uz)) {
-                    fall_through(FALSE);
+                    fall_through(FALSE, 0);
                     return 1;
                 } else
                     goto ouch;
index 941025654c82d6012faab28161378a97ec35d6c4..9403358ec6b89e6762a65a5421f45a556898e2d0 100644 (file)
@@ -443,13 +443,15 @@ int x, y, typ;
 }
 
 void
-fall_through(td)
+fall_through(td, ftflags)
 boolean td; /* td == TRUE : trap door or hole */
+unsigned ftflags;
 {
     d_level dtmp;
     char msgbuf[BUFSZ];
     const char *dont_fall = 0;
     int newlevel, bottom;
+    struct trap *t = (struct trap *) 0;
 
     /* we'll fall even while levitating in Sokoban; otherwise, if we
        won't fall and won't be told that we aren't falling, give up now */
@@ -472,10 +474,9 @@ boolean td; /* td == TRUE : trap door or hole */
     } while (!rn2(4) && newlevel < bottom);
 
     if (td) {
-        struct trap *t = t_at(u.ux, u.uy);
-
+        t = t_at(u.ux, u.uy);
         feeltrap(t);
-        if (!Sokoban) {
+        if (!Sokoban && !(ftflags & TOOKPLUNGE)) {
             if (t->ttyp == TRAPDOOR)
                 pline("A trap door opens up under you!");
             else
@@ -487,8 +488,9 @@ boolean td; /* td == TRUE : trap door or hole */
     if (Sokoban && Can_fall_thru(&u.uz))
         ; /* KMH -- You can't escape the Sokoban level traps */
     else if (Levitation || u.ustuck
-             || (!Can_fall_thru(&u.uz) && !levl[u.ux][u.uy].candig) || Flying
-             || is_clinger(youmonst.data)
+             || (!Can_fall_thru(&u.uz) && !levl[u.ux][u.uy].candig)
+             || ((Flying || is_clinger(youmonst.data))
+                    && !(ftflags & TOOKPLUNGE))
              || (Inhell && !u.uevent.invoked && newlevel == bottom)) {
         dont_fall = "don't fall in.";
     } else if (youmonst.data->msize >= MZ_HUGE) {
@@ -506,6 +508,9 @@ boolean td; /* td == TRUE : trap door or hole */
         }
         return;
     }
+    if (Flying && (ftflags & TOOKPLUNGE) && td && t)
+        You("swoop down %s!", (t->ttyp == TRAPDOOR)
+            ? "through the trap door" : "into the gaping hole");
 
     if (*u.ushops)
         shopdig(1);
@@ -1286,7 +1291,7 @@ unsigned trflags;
                        defsyms[trap_to_defsym(ttype)].explanation);
             break; /* don't activate it after all */
         }
-        fall_through(TRUE);
+        fall_through(TRUE, (trflags & TOOKPLUNGE));
         break;
 
     case TELEP_TRAP: