From: nethack.rankin Date: Sun, 6 Aug 2006 05:16:23 +0000 (+0000) Subject: more #H166 - quest locate level message X-Git-Tag: MOVE2GIT~936 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96a0e8e6feff9d647b2611aa09f175275514f0ee;p=nethack more #H166 - quest locate level message More tweaking brought about by the report of falling through a trapdoor above the quest locate level and landing below it (which won't happen randomly any more, but can still be achieved via controlled level teleport). You don't get any message for the locate level when arriving from below, and giving the full initial message if you manage to make a return visit from above produces silly results. This adjusts the logic for delivering those messages; once you've been on the level, you won't get the full initial message later even if it wasn't given the first time. You will still get the shorter secondary message, up until the nemesis has been killed. (In some cases it might not make much sense since its wording is based on the assumption that you've already seen the full message.) The handling for these messages will never be completely correct unless the messages themselves are rewritten (and the result would probably end up with really wishy-washy phrasing so there's not much point). They assume that you'll be arriving via the stairs, even for the case where you do come from above rather than unexpectedly from below, and they can be misleading or confusing if you arrive someplace else. We could improve things by having alternate FIRSTLOCATE and NEXTLOCATE messages for use when not on--or next to, for the case where a pet displaces your arrival--the stairs. But I'm not going to attempt to compose those. --- diff --git a/src/quest.c b/src/quest.c index e261e75ef..ccb287429 100644 --- a/src/quest.c +++ b/src/quest.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)quest.c 3.5 2006/05/17 */ +/* SCCS Id: @(#)quest.c 3.5 2006/08/05 */ /* Copyright 1991, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -39,11 +39,21 @@ on_start() STATIC_OVL void on_locate() { - if(!Qstat(first_locate)) { - qt_pager(QT_FIRSTLOCATE); + /* the locate messages are phrased in a manner such that they only + make sense when arriving on the level from above */ + boolean from_above = (u.uz0.dlevel < u.uz.dlevel); + + if (Qstat(killed_nemesis)) { + return; + } else if (!Qstat(first_locate)) { + if (from_above) qt_pager(QT_FIRSTLOCATE); + /* if we've arrived from below this will be a lie, but there won't + be any point in delivering the message upon a return visit from + above later since the level has now been seen */ Qstat(first_locate) = TRUE; - } else if(u.uz0.dlevel < u.uz.dlevel && !Qstat(killed_nemesis)) - qt_pager(QT_NEXTLOCATE); + } else { + if (from_above) qt_pager(QT_NEXTLOCATE); + } } STATIC_OVL void @@ -67,7 +77,7 @@ onquest() if(!Is_special(&u.uz)) return; if(Is_qstart(&u.uz)) on_start(); - else if(Is_qlocate(&u.uz) && u.uz.dlevel > u.uz0.dlevel) on_locate(); + else if(Is_qlocate(&u.uz)) on_locate(); else if(Is_nemesis(&u.uz)) on_goal(); return; }