'm ^V' (aka 'm C-v')

Allow the 'm' prefix for wizard mode level teleport command.  Using
it skips the initial prompt for level destination and goes directly
to the menu of special level locations that you get when answering
'?' to that prompt.
This commit is contained in:
PatR
2018-04-09 13:48:43 -07:00
parent 8710c2c29a
commit 44eed82d41
3 changed files with 22 additions and 5 deletions

View File

@@ -827,6 +827,8 @@ a prayer result which results in uncursing some or all of the hero's items
wielded aklys behaves like Mjollnir when thrown--it usually returns; unlike
Mjollnir, it isn't limited to Valkyries or need gauntlets of power
(so far, hero-only; an aklys won't return if thrown by a monster)
allow 'm' prefix for wizard mode level teleport command (^V) to bypass prompt
for destination and use menu of special level locations
Platform- and/or Interface-Specific New Features

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 cmd.c $NHDT-Date: 1518861485 2018/02/17 09:58:05 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.278 $ */
/* NetHack 3.6 cmd.c $NHDT-Date: 1523306904 2018/04/09 20:48:24 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.281 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -4049,6 +4049,8 @@ int NDECL((*cmd_func));
|| cmd_func == doloot
/* travel: pop up a menu of interesting targets in view */
|| cmd_func == dotravel
/* wizard mode ^V */
|| cmd_func == wiz_level_tele
/* 'm' prefix allowed for some extended commands */
|| cmd_func == doextcmd || cmd_func == doextlist)
return TRUE;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 teleport.c $NHDT-Date: 1455140444 2016/02/10 21:40:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.66 $ */
/* NetHack 3.6 teleport.c $NHDT-Date: 1523306912 2018/04/09 20:48:32 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.73 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -595,7 +595,7 @@ level_tele()
register int newlev;
d_level newlevel;
const char *escape_by_flying = 0; /* when surviving dest of -N */
char buf[BUFSZ] = DUMMY;
char buf[BUFSZ];
boolean force_dest = FALSE;
if ((u.uhave.amulet || In_endgame(&u.uz) || In_sokoban(&u.uz))
@@ -609,12 +609,22 @@ level_tele()
Strcpy(qbuf, "To what level do you want to teleport?");
do {
if (iflags.menu_requested) {
/* wizard mode 'm ^V' skips prompting on first pass
(note: level Tport via menu won't have any second pass) */
iflags.menu_requested = FALSE;
if (wizard)
goto levTport_menu;
}
if (++trycnt == 2) {
if (wizard)
Strcat(qbuf, " [type a number, name, or ? for a menu]");
else
Strcat(qbuf, " [type a number or name]");
}
*buf = '\0'; /* EDIT_GETLIN: if we're on second or later pass,
the previous input was invalid so don't use it
as getlin()'s preloaded default answer */
getlin(qbuf, buf);
if (!strcmp(buf, "\033")) { /* cancelled */
if (Confusion && rnl(5)) {
@@ -629,9 +639,12 @@ level_tele()
goto random_levtport;
}
if (wizard && !strcmp(buf, "?")) {
schar destlev = 0;
xchar destdnum = 0;
schar destlev;
xchar destdnum;
levTport_menu:
destlev = 0;
destdnum = 0;
newlev = (int) print_dungeon(TRUE, &destlev, &destdnum);
if (!newlev)
return;