]> granicus.if.org Git - nethack/commitdiff
consistent level change messages
authornethack.rankin <nethack.rankin>
Sat, 3 Sep 2005 05:36:40 +0000 (05:36 +0000)
committernethack.rankin <nethack.rankin>
Sat, 3 Sep 2005 05:36:40 +0000 (05:36 +0000)
     From a bug report: #M30: 3.4.2 bugs and ideas); describe
flyers (poly'd hero or riding flying steed) as flying when they use ladders
or jump down holes.  This also gives feedback when using the stairs in the
ordinary up or down case, where no message was previously given.

doc/fixes34.4
src/do.c

index b221e48032030d80c9cc12df400230314797400c..7aeaf9c853507b95b02cd76e36b3726cae018ac1 100644 (file)
@@ -142,6 +142,7 @@ fix typo in tourist quest leader's greeting
 fix grammar for graveyard sounds when polymorphed
 avoid divide by zero crash if Luck drops below -1 while a prayer is in progress
 make hero inflicted with lycanthropy immune to level drain just like monsters
+describe locomotion method accurately when flyers traverse ladders or holes
 
 
 Platform- and/or Interface-Specific Fixes
index b38e5c05afbaa3082fdb000a3545d055cf0ec3ac..ce6752140e0f4795b333abdf06bc638e38f525fa 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)do.c       3.5     2005/06/22      */
+/*     SCCS Id: @(#)do.c       3.5     2005/09/02      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -835,7 +835,7 @@ dodown()
        }
 
        if (trap)
-           You("%s %s.", locomotion(youmonst.data, "jump"),
+           You("%s %s.", Flying ? "fly" : locomotion(youmonst.data, "jump"),
                trap->ttyp == HOLE ? "down the hole" : "through the trap door");
 
        if (trap && Is_stronghold(&u.uz)) {
@@ -1172,12 +1172,14 @@ boolean at_stairs, falling, portal;
                        } else u_on_sstairs();
                    } else u_on_dnstairs();
                }
-               /* Remove bug which crashes with levitation/punishment  KAA */
-               if (Punished && !Levitation) {
-                       pline("With great effort you climb the %s.",
-                               at_ladder ? "ladder" : "stairs");
-               } else if (at_ladder)
-                   You("climb up the ladder.");
+               /* you climb up the {stairs|ladder};
+                  fly up the stairs; fly up along the ladder */
+               pline("%s %s up%s the %s.",
+                     (Punished && !Levitation) ? "With great effort you" :
+                                                 "You",
+                     Flying ? "fly" : "climb",
+                     (Flying && at_ladder) ? " along" : "",
+                     at_ladder ? "ladder" : "stairs");
            } else {    /* down */
                if (at_ladder) {
                    u_on_newpos(xupladder, yupladder);
@@ -1185,11 +1187,14 @@ boolean at_stairs, falling, portal;
                    if (newdungeon) u_on_sstairs();
                    else u_on_upstairs();
                }
-               if (u.dz && Flying)
-                   You("fly down along the %s.",
-                       at_ladder ? "ladder" : "stairs");
-               else if (u.dz &&
-                   (near_capacity() > UNENCUMBERED || Punished || Fumbling)) {
+               if (!u.dz) {
+                   ;   /* stayed on same level? (no transit effects) */
+               } else if (Flying) {
+                   if (flags.verbose)
+                       You("fly down %s.",
+                           at_ladder ? "along the ladder" : "the stairs");
+               } else if (near_capacity() > UNENCUMBERED ||
+                       Punished || Fumbling) {
                    You("fall down the %s.", at_ladder ? "ladder" : "stairs");
                    if (Punished) {
                        drag_down();
@@ -1210,10 +1215,15 @@ boolean at_stairs, falling, portal;
                    else
 #endif
                        losehp(Maybe_Half_Phys(rnd(3)),
-                               "falling downstairs", KILLED_BY);
+                              at_ladder ? "falling off a ladder" :
+                                          "tumbling down a flight of stairs",
+                              KILLED_BY);
                    selftouch("Falling, you");
-               } else if (u.dz && at_ladder)
-                   You("climb down the ladder.");
+               } else {        /* ordinary descent */
+                   if (flags.verbose)
+                       You("%s.", at_ladder ? "climb down the ladder" :
+                                              "descend the stairs");
+               }
            }
        } else {        /* trap door or level_tele or In_endgame */
            if (was_in_W_tower && On_W_tower_level(&u.uz))