From 48d39b2ffdc6eefe86cd179a8f3e2415e207b64e Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 16 Dec 2020 03:07:55 -0800 Subject: [PATCH] allow #exploremode from wizard mode Allow changing form debug mode to explore mode without resorting to a debugger. The same caveat, "you won't be able to change back," applies as when in normal play. Character's name will remain "wizard" rather than reverting to whatever it would have been if not starting in wizard mode. --- src/cmd.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index f8a6fc428..275c71e46 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 cmd.c $NHDT-Date: 1608078812 2020/12/16 00:33:32 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.434 $ */ +/* NetHack 3.7 cmd.c $NHDT-Date: 1608116853 2020/12/16 11:07:33 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.435 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -750,30 +750,37 @@ domonability(VOID_ARGS) int enter_explore_mode(VOID_ARGS) { - if (wizard) { - You("are in debug mode."); - } else if (discover) { + if (discover) { You("are already in explore mode."); } else { + const char *oldmode = !wizard ? "normal game" : "debug mode"; + #ifdef SYSCF #if defined(UNIX) if (!sysopt.explorers || !sysopt.explorers[0] || !check_user_string(sysopt.explorers)) { - You("cannot access explore mode."); - return 0; + if (!wizard) { + You("cannot access explore mode."); + return 0; + } else { + pline( + "Note: normally you wouldn't be allowed into explore mode."); + /* keep going */ + } } #endif #endif - pline( - "Beware! From explore mode there will be no return to normal game."); + pline("Beware! From explore mode there will be no return to %s,", + oldmode); if (paranoid_query(ParanoidQuit, "Do you want to enter explore mode?")) { + discover = TRUE; + wizard = FALSE; clear_nhwindow(WIN_MESSAGE); You("are now in non-scoring explore mode."); - discover = TRUE; } else { clear_nhwindow(WIN_MESSAGE); - pline("Resuming normal game."); + pline("Continuing with %s.", oldmode); } } return 0; -- 2.50.1