]> granicus.if.org Git - nethack/commitdiff
\#wizintrinsic timeout values
authorPatR <rankin@nethack.org>
Sun, 24 Jan 2021 21:55:19 +0000 (13:55 -0800)
committerPatR <rankin@nethack.org>
Sun, 24 Jan 2021 21:55:19 +0000 (13:55 -0800)
Tell/remind wizard mode player how to specify timeout amounts
when using #wizintrinsic to set temporary timeouts.

doc/fixes37.0
src/cmd.c

index 810ad99fb5253107a338e6a33f634a9b2ef6dfe1..77642c8bce9003cc3c5c0c7468bcd62b8f788883 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.434 $ $NHDT-Date: 1611522041 2021/01/24 21:00:41 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.435 $ $NHDT-Date: 1611525309 2021/01/24 21:55:09 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -762,6 +762,7 @@ record number of encountered bones levels in xlogfile
 add bonesless to extended conducts field in xlogfile
 show bones levels information in enlightenment at end of game or in explore
        and wizmode
+for #wizintrinsic, use any counts entered during menu selection
 
 
 Platform- and/or Interface-Specific New Features
index f4233aa6aaf448b232abfe00c37329090f9b647a..c672d663265385c8133002687d7ecb2766e62006 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -1,4 +1,4 @@
-/* NetHack 3.7 cmd.c   $NHDT-Date: 1610138674 2021/01/08 20:44:34 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.445 $ */
+/* NetHack 3.7 cmd.c   $NHDT-Date: 1611525309 2021/01/24 21:55:09 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.448 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2013. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1571,6 +1571,15 @@ wiz_intrinsic(VOID_ARGS)
         any = cg.zeroany;
         win = create_nhwindow(NHW_MENU);
         start_menu(win, MENU_BEHAVE_STANDARD);
+        if (iflags.cmdassist) {
+            /* start menu with a subtitle */
+            Sprintf(buf,
+        "[Precede any selection with a count to increment by other than %d.]",
+                    DEFAULT_TIMEOUT_INCR);
+            any.a_int = 0;
+            add_menu(win, &nul_glyphinfo, &any, 0, 0, ATR_NONE, buf,
+                     MENU_ITEMFLAGS_NONE);
+        }
         for (i = 0; (propname = propertynames[i].prop_name) != 0; ++i) {
             p = propertynames[i].prop_num;
             if (p == HALLUC_RES) {
@@ -1607,7 +1616,10 @@ wiz_intrinsic(VOID_ARGS)
             oldtimeout = u.uprops[p].intrinsic & TIMEOUT;
             amt = (pick_list[j].count == -1L) ? DEFAULT_TIMEOUT_INCR
                                               : (int) pick_list[j].count;
+            if (amt <= 0) /* paranoia */
+                continue;
             newtimeout = oldtimeout + (long) amt;
+
             switch (p) {
             case SICK:
             case SLIMED: