goto_level message reorg (trunk only)

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.)
This commit is contained in:
nethack.rankin
2007-02-04 05:31:24 +00:00
parent dc6a38fe32
commit 0f0f7190f3
+36 -32
View File
@@ -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. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1362,42 +1362,46 @@ boolean at_stairs, falling, portal;
if (mesg) pline(mesg); if (mesg) pline(mesg);
} }
#ifdef REINCARNATION /* special location arrival messages/events */
if (new && Is_rogue_level(&u.uz)) if (In_endgame(&u.uz)) {
You("enter what seems to be an older, more primitive world."); if (new && on_level(&u.uz, &astral_level))
#endif final_level(); /* guardian angel,&c */
/* Final confrontation */ else if (newdungeon && u.uhave.amulet)
if (In_endgame(&u.uz) && newdungeon && u.uhave.amulet) resurrect(); /* force confrontation with Wizard */
resurrect(); } else if (In_quest(&u.uz)) {
if (newdungeon && In_V_tower(&u.uz) && In_hell(&u.uz0)) 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."); pline_The("heat and smoke are gone.");
} else if (Is_knox(&u.uz)) {
/* the message from your quest leader */ /* alarm stops working once Croesus has died */
if (!In_quest(&u.uz0) && at_dgn_entrance("The Quest") && if (new || !mvitals[PM_CROESUS].died) {
!(u.uevent.qexpelled || u.uevent.qcompleted || quest_status.leader_is_dead)) { You("have penetrated a high security area!");
if (u.uevent.qcalled) {
com_pager(Role_if(PM_ROGUE) ? 4 : 3);
} else {
com_pager(2);
u.uevent.qcalled = TRUE;
}
}
/* 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!"); pline("An alarm sounds!");
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
if (!DEADMONSTER(mtmp) && mtmp->msleeping) mtmp->msleeping = 0; 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.");
#endif
/* 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);
}
}
} }
if (on_level(&u.uz, &astral_level))
final_level();
else
onquest();
assign_level(&u.uz0, &u.uz); /* reset u.uz0 */ assign_level(&u.uz0, &u.uz); /* reset u.uz0 */
#ifdef INSURANCE #ifdef INSURANCE
save_currentstate(); save_currentstate();
#endif #endif