]> granicus.if.org Git - nethack/commitdiff
flying into pits
authornethack.rankin <nethack.rankin>
Thu, 14 Mar 2013 01:58:21 +0000 (01:58 +0000)
committernethack.rankin <nethack.rankin>
Thu, 14 Mar 2013 01:58:21 +0000 (01:58 +0000)
     In the newsgroup recently, someone mentioned that when polymorphed into
a flying monster, he couldn't retrieve items out of pits, even with the '>'
command.  I thought that we had fixed that, but the fix apparently only
covered walk-through-wall creatures (xorns and earth elementals), not flyers
and ceiling clingers.  Now those can also deliberately enter pits via '>'.

     The fixes entry is in the new features section in order to be next to
the xorn one.  '>' at pit locations is new, but it handles something which
was missing so feels more like a bug fix than a new feature to me....
[Keni, the bug page entry C343-12 about '>' (for xorns?) is general enough
to cover this fix, so we don't need to add a new one for flyers.]
I noticed an unrelated fixes35.0 entry mentioning '>' which was duplicated;
this removes one of the copies.

doc/fixes35.0
src/polyself.c
src/trap.c

index 1b15c59fe4af48cb567902216bf4006c9e321e11..44a8e7e3a776c09a8700cd3a929761ead02102ee 100644 (file)
@@ -344,7 +344,6 @@ better handling for Fort Ludios and endgame in wizard mode's `^V ?' menu
 no free lunch for gelatinous cubes eating scrolls of mail
 eating gold in front of the vault guard will make the guard angry
 calculate engulf time differently for non-digestion attacks than for digestion
-shattering a monster's weapon didn't work as intended for stack of N>1
 preform autopickup and/or report on objects at the spot when a failed #untrap
        attempt causes the hero to move onto a trap's location
 shattering a monster's weapon didn't work as intended for stack of N>1
@@ -921,6 +920,7 @@ build-from-source: dlb utility can handle arbitrary number of files
 General New Features
 --------------------
 when you're teetering on the edge of a pit you can use '>' to enter the pit
+when you're flying over a pit you can use '>' to enter the pit
 when asked for a direction, a response of '?' yields help and then asks again
 when adding an item to inventory, try to stack it with the quiver slot
        before trying against other carried objects
index 41f16548e77e93b7061debf75e366ebbd1150049..f40726696827661cd45da61271a62fa1931f1f2a 100644 (file)
@@ -1324,7 +1324,11 @@ dohide()
 {
        boolean ismimic = youmonst.data->mlet == S_MIMIC;
 
-       if ((u.utrap && u.utraptype != TT_PIT) || u.ustuck) {
+       if (u.ustuck ||
+               (u.utrap &&
+                   /* floor hiders (trapper) can hide while stuck in pits,
+                      ceiling hiders can't (after using '>' to get there) */
+                   (u.utraptype != TT_PIT || is_clinger(youmonst.data)))) {
                You_cant("hide while you're %s.",
                         !u.ustuck ? "trapped" :
                           !sticks(youmonst.data) ? "being held" :
index 2b9a9fe704e70a6e4d1a55ceb33fdb232ca144ad..e0e4b38af0c564cf9c4de6781811f5a11dcf0f5c 100644 (file)
@@ -714,7 +714,7 @@ unsigned trflags;
                  defsyms[trap_to_defsym(ttype)].explanation);
            /* then proceed to normal trap effect */
        } else if (already_seen && !forcetrap) {
-           if ((Levitation || Flying) &&
+           if ((Levitation || (Flying && !plunged)) &&
                    (ttype == PIT || ttype == SPIKED_PIT || ttype == HOLE ||
                    ttype == BEAR_TRAP)) {
                You("%s over %s %s.",
@@ -991,9 +991,9 @@ glovecheck:         (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst);
            case PIT:
            case SPIKED_PIT:
                /* KMH -- You can't escape the Sokoban level traps */
-               if (!Sokoban && (Levitation || Flying)) break;
+               if (!Sokoban && (Levitation || (Flying && !plunged))) break;
                feeltrap(trap);
-               if (!Sokoban && is_clinger(youmonst.data)) {
+               if (!Sokoban && is_clinger(youmonst.data) && !plunged) {
                    if(trap->tseen) {
                        You_see("%s %spit below you.", a_your[trap->madeby_u],
                            ttype == SPIKED_PIT ? "spiked " : "");
@@ -1022,7 +1022,8 @@ glovecheck:               (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst);
                    if (adj_pit) {
                        You("move into an adjacent pit.");
                    } else {
-                       Strcpy(verbbuf, plunged ? "plunge" : "fall");
+                       Strcpy(verbbuf, !plunged ? "fall" :
+                                               (Flying ? "dive" : "plunge"));
                        You("%s into %s pit!", verbbuf, a_your[trap->madeby_u]);
                    }
                }
@@ -1067,7 +1068,9 @@ glovecheck:               (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst);
                                    poison is limited to attrib loss */
                                 (u.umortality > oldumort) ? 0 : 8, FALSE);
                } else {
-                   if (!adj_pit)
+                   /* plunging flyers take spike damage but not pit damage */
+                   if (!adj_pit &&
+                         !(plunged && (Flying || is_clinger(youmonst.data))))
                        losehp(Maybe_Half_Phys(rnd(6)),
                                plunged ? "deliberately plunged into a pit" :
                                          "fell into a pit",
@@ -2818,9 +2821,10 @@ climb_pit()
            display_nhwindow(WIN_MESSAGE, FALSE);
            clear_nhwindow(WIN_MESSAGE);
            You("free your %s.", body_part(LEG));
-       } else if (Flying && !Sokoban) {
-           /* eg fell in pit, poly'd to a flying monster */
-           You("fly from the pit.");
+       } else if ((Flying || is_clinger(youmonst.data)) && !Sokoban) {
+           /* eg fell in pit, then poly'd to a flying monster;
+              or used '>' to deliberately enter it */
+           You("%s from the pit.", Flying ? "fly" : "climb");
            u.utrap = 0;
            fill_pit(u.ux, u.uy);
            vision_full_recalc = 1;     /* vision limits change */
@@ -2834,16 +2838,16 @@ climb_pit()
                "crawl");
            fill_pit(u.ux, u.uy);
            vision_full_recalc = 1;     /* vision limits change */
-       } else if (flags.verbose) {
+       } else if (u.dz || flags.verbose) {
 #ifdef STEED
            if (u.usteed)
                Norep("%s is still in a pit.",
                      upstart(y_monnam(u.usteed)));
            else
 #endif
-               Norep( (Hallucination && !rn2(5)) ?
-                      "You've fallen, and you can't get up." :
-                      "You are still in a pit." );
+               Norep((Hallucination && !rn2(5)) ?
+                       "You've fallen, and you can't get up." :
+                       "You are still in a pit.");
        }
 }