From e3f1716da9fd5635effa86bd2fe6c1fc291d3ce6 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 3 Sep 2005 05:36:40 +0000 Subject: [PATCH] consistent level change messages 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 | 1 + src/do.c | 42 ++++++++++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index b221e4803..7aeaf9c85 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -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 diff --git a/src/do.c b/src/do.c index b38e5c05a..ce6752140 100644 --- 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)) -- 2.50.1