]> granicus.if.org Git - nethack/commitdiff
goto_level message reorg (trunk only)
authornethack.rankin <nethack.rankin>
Sun, 4 Feb 2007 05:31:24 +0000 (05:31 +0000)
committernethack.rankin <nethack.rankin>
Sun, 4 Feb 2007 05:31:24 +0000 (05:31 +0000)
     Clean up the code at the end of goto_level().  The only change in
behavior, aside from eliminating a couple of wizard mode quirks, is that
if a hangup save occurs while staring at the quest entry message, it will
be flagged as seen and not show up again if you leave and return to the
quest after restore.  (For wizard mode, you'll no longer find the Wizard
waiting if you use the level teleport menu to jump directly to the Astral
Plane from outside the endgame, and level teleporting away from astral
level to one of the elemental planes then returning won't make more fake
players or another guardian angel.)

src/do.c

index 8adbfd5cc1420b0afe7bc963d6567a6e6c31ef71..6c0bbe291016a68d4418933177dceb804b736f23 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)do.c       3.5     2007/01/02      */
+/*     SCCS Id: @(#)do.c       3.5     2007/02/03      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1362,42 +1362,46 @@ boolean at_stairs, falling, portal;
            if (mesg) pline(mesg);
        }
 
+       /* special location arrival messages/events */
+       if (In_endgame(&u.uz)) {
+           if (new && on_level(&u.uz, &astral_level))
+               final_level();  /* guardian angel,&c */
+           else if (newdungeon && u.uhave.amulet)
+               resurrect();    /* force confrontation with Wizard */
+       } else if (In_quest(&u.uz)) {
+           onquest();          /* might be reaching locate|goal level */
+       } else if (In_V_tower(&u.uz)) {
+           if (newdungeon && In_hell(&u.uz0))
+               pline_The("heat and smoke are gone.");
+       } else if (Is_knox(&u.uz)) {
+           /* alarm stops working once Croesus has died */
+           if (new || !mvitals[PM_CROESUS].died) {
+               You("have penetrated a high security area!");
+               pline("An alarm sounds!");
+               for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
+                   if (DEADMONSTER(mtmp)) continue;
+                   mtmp->msleeping = 0;
+               }
+           }
+       } else {
 #ifdef REINCARNATION
-       if (new && Is_rogue_level(&u.uz))
-           You("enter what seems to be an older, more primitive world.");
+           if (new && Is_rogue_level(&u.uz))
+               You("enter what seems to be an older, more primitive world.");
 #endif
-       /* Final confrontation */
-       if (In_endgame(&u.uz) && newdungeon && u.uhave.amulet)
-               resurrect();
-       if (newdungeon && In_V_tower(&u.uz) && In_hell(&u.uz0))
-               pline_The("heat and smoke are gone.");
-
-       /* the message from your quest leader */
-       if (!In_quest(&u.uz0) && at_dgn_entrance("The Quest") &&
-               !(u.uevent.qexpelled || u.uevent.qcompleted || quest_status.leader_is_dead)) {
-
-               if (u.uevent.qcalled) {
-                       com_pager(Role_if(PM_ROGUE) ? 4 : 3);
-               } else {
-                       com_pager(2);
-                       u.uevent.qcalled = TRUE;
+           /* main dungeon message from your quest leader */
+           if (!In_quest(&u.uz0) && at_dgn_entrance("The Quest") &&
+                   !(u.uevent.qcompleted || u.uevent.qexpelled ||
+                     quest_status.leader_is_dead)) {
+               if (!u.uevent.qcalled) {
+                   u.uevent.qcalled = 1;
+                   com_pager(2);   /* main "leader needs help" message */
+               } else {            /* reminder message */
+                   com_pager(Role_if(PM_ROGUE) ? 4 : 3);
                }
+           }
        }
 
-       /* once Croesus is dead, his alarm doesn't work any more */
-       if (Is_knox(&u.uz) && (new || !mvitals[PM_CROESUS].died)) {
-               You("penetrated a high security area!");
-               pline("An alarm sounds!");
-               for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
-                   if (!DEADMONSTER(mtmp) && mtmp->msleeping) mtmp->msleeping = 0;
-       }
-
-       if (on_level(&u.uz, &astral_level))
-           final_level();
-       else
-           onquest();
        assign_level(&u.uz0, &u.uz); /* reset u.uz0 */
-
 #ifdef INSURANCE
        save_currentstate();
 #endif