Subject: Re: testing mode?

From: [email-masked] (Dylan O'Donnell)
Date: 18 Dec 2000 00:04:20 +0000

[email-masked] (VoceNoctum) writes:
[Attribution?]
> >This is probably a good time to post a pointer to the #poly wizmode
> >command I hacked into nethackbis a few months ago:
> >
> 
> is there a change for straight level gains as well, without having
> to wish for and quaff the potions?

No.

<hacks>

Yes.

(The line numbers on this diff will be somewhat out, since I've
manually edited away other patchery; patch(1) should be flexible
enough to cope, though, I think.)

--- nethack-3.3.1/src/cmd.c     Sat Jul 22 01:59:03 2000
+++ nethack-3.3.1bis/src/cmd.c  Mon Dec 18 00:00:48 2000
@@ -112,7 +112,9 @@
 STATIC_PTR int NDECL(wiz_genesis);
 STATIC_PTR int NDECL(wiz_where);
 STATIC_PTR int NDECL(wiz_detect);
 STATIC_PTR int NDECL(wiz_level_tele);
+STATIC_PTR int NDECL(wiz_level_gain);
 STATIC_PTR int NDECL(wiz_show_seenv);
 STATIC_PTR int NDECL(wiz_show_vision);
 STATIC_PTR int NDECL(wiz_show_wmodes);
@@ -549,6 +551,36 @@
 }
 
 STATIC_PTR int
+wiz_level_gain()
+{
+        char buf[BUFSZ];
+        int newlevel;
+
+        if (u.ulevel >= MAXULEV) {
+               You("are already as experienced as you can get.");
+               return 0;
+        }
+        getlin("To what experience level do you want to be raised?", buf);
+        (void) sscanf(buf, "%d", &newlevel);
+        if (newlevel <= 0) {
+               pline(Never_mind);
+        } else if (newlevel <= u.ulevel) {
+               You("are already that experienced.");
+        } else {
+               if (newlevel > MAXULEV) newlevel = MAXULEV;
+               while (u.ulevel < newlevel) pluslvl(FALSE);
+        }
+        return 0;
+}
+
+STATIC_PTR int
 wiz_show_seenv()
 {
        winid win;
@@ -1312,6 +1344,8 @@
        {(char *)0, (char *)0, donull, TRUE},
        {(char *)0, (char *)0, donull, TRUE},
        {(char *)0, (char *)0, donull, TRUE},
+       {(char *)0, (char *)0, donull, TRUE},
        {(char *)0, (char *)0, donull, TRUE},
        {(char *)0, (char *)0, donull, TRUE},
 #ifdef DEBUG
@@ -1325,6 +1359,8 @@
 #if defined(WIZARD)
 static const struct ext_func_tab debug_extcmdlist[] = {
        {"light sources", "show mobile light sources", wiz_light_sources, TRUE},
+       {"levelgain", "gain experience levels", wiz_level_gain, TRUE},
        {"seenv", "show seen vectors", wiz_show_seenv, TRUE},
        {"stats", "show memory statistics", wiz_show_stats, TRUE},
        {"timeout", "look at timeout queue", wiz_timeout_queue, TRUE},

-- 
:  Dylan O'Donnell                     http://www.spod-central.org/~psmith/  :
:          "The sun has gone. It must be brought. You have a rock."          :
:                      -- Dan Schmidt, "For a Change"                        :