From psmithnews@spod-central.org Tue Dec 19 07:32:15 2000
Path: ulcc.ac.uk!server3.netnews.ja.net!newspeer.clara.net!news.clara.net!dispose.news.demon.net!demon!news.demon.co.uk!demon!curmudgeon.spod-central.org!not-for-mail
From: psmithnews@spod-central.org (Dylan O'Donnell)
Newsgroups: rec.games.roguelike.nethack
Subject: Re: testing mode?
Date: 18 Dec 2000 00:04:20 +0000
Organization: Spod Central
Sender: psmith@curmudgeon.spod-central.org
Message-ID: <m3y9xe7fy3.fsf@curmudgeon.spod-central.org>
References: <m33dfm921p.fsf@curmudgeon.spod-central.org> <20001217170950.01957.00010636@ng-ch1.aol.com>
Reply-To: psmith@spod-central.org
NNTP-Posting-Host: curmudgeon.spod-central.org
X-NNTP-Posting-Host: curmudgeon.spod-central.org:195.173.172.171
X-Trace: news.demon.co.uk 977097860 nnrp-13:5059 NO-IDENT curmudgeon.spod-central.org:195.173.172.171
X-Complaints-To: abuse@demon.net
User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Lines: 82
Xref: ulcc.ac.uk rec.games.roguelike.nethack:120678

vocenoctum@aol.com (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"                        :

