]> granicus.if.org Git - nethack/commitdiff
wizard #poly and #levelgain
authorarromdee <arromdee>
Thu, 17 Jan 2002 02:47:23 +0000 (02:47 +0000)
committerarromdee <arromdee>
Thu, 17 Jan 2002 02:47:23 +0000 (02:47 +0000)
This adds the wizard #poly and #levelgain commands.

doc/fixes33.2
include/extern.h
src/allmain.c
src/cmd.c
src/eat.c
src/fountain.c
src/polyself.c
src/potion.c
src/trap.c
src/zap.c

index ae2eb08c2da524592e48cef8d3eb1ea4a7c54abf..fbe6e78bddf8feaa885e2bd43174061863aca600 100644 (file)
@@ -478,6 +478,7 @@ ninjas should get multishot bonus with yumi and ya (Dylan O'Donnell)
 put prisoners in the Dark One's dungeon (Dylan O'Donnell)
 add leather cloak so soldiers don't have elven cloaks
 add Tom Friedetzky's BUC-patch (applies to full menustyle only)
+add wizard #poly and #levelgain (Dylan O'Donnell)
 
 
 Platform- and/or Interface-Specific New Features
index 4a8970108d12cddc576ab46a08ad8d165fd62ac5..6508184c131ab94dc167be88a54b5fa5f63971d0 100644 (file)
@@ -1450,7 +1450,7 @@ E void NDECL(self_invis_message);
 
 E void NDECL(set_uasmon);
 E void NDECL(change_sex);
-E void NDECL(polyself);
+E void FDECL(polyself, (BOOLEAN_P));
 E int FDECL(polymon, (int));
 E void NDECL(rehumanize);
 E int NDECL(dobreathe);
index d42e2658a95ec0c9b31116e86c88acebdc9dd8b4..0d084ee7398d2d555b2955370b84f512ba035e0e 100644 (file)
@@ -243,7 +243,7 @@ moveloop()
                                    stop_occupation();
                                else
                                    nomul(0);
-                               if (change == 1) polyself();
+                               if (change == 1) polyself(FALSE);
                                else you_were();
                                change = 0;
                            }
index 3b1862a61adae8409491d955c465408b8863fe0d..88340f929b427d8f4d396c92cecbba8210d61e63 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -115,7 +115,9 @@ STATIC_PTR int NDECL(wiz_map);
 STATIC_PTR int NDECL(wiz_genesis);
 STATIC_PTR int NDECL(wiz_where);
 STATIC_PTR int NDECL(wiz_detect);
+STATIC_PTR int NDECL(wiz_polyself);
 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_mon_polycontrol);
@@ -562,6 +564,36 @@ wiz_mon_polycontrol()
        return 0;
 }
 
+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_polyself()
+{
+        polyself(TRUE);
+        return 0;
+}
+
 STATIC_PTR int
 wiz_show_seenv()
 {
@@ -1359,6 +1391,8 @@ struct ext_func_tab extcmdlist[] = {
        {(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
        {(char *)0, (char *)0, donull, TRUE},
@@ -1370,8 +1404,10 @@ struct ext_func_tab extcmdlist[] = {
 
 #if defined(WIZARD)
 static const struct ext_func_tab debug_extcmdlist[] = {
+        {"levelgain", "gain experience levels", wiz_level_gain, TRUE},
        {"light sources", "show mobile light sources", wiz_light_sources, TRUE},
        {"monpoly_control", "control monster polymorphs", wiz_mon_polycontrol, TRUE},
+        {"poly", "polymorph self", wiz_polyself, 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},
index e02a4c61c5646b81369249c95a96dc703b5c8285..001cd09e3c76bcbde237c36b5d93b11815fae450 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -857,7 +857,7 @@ register int pm;
         /* case PM_SANDESTIN: */
                if (!Unchanging) {
                    You_feel("a change coming over you.");
-                   polyself();
+                   polyself(FALSE);
                }
                break;
            case PM_MIND_FLAYER:
index b0563d263d80faf1719cc600538858208186050b..1374f8eae27b020a700382ef6e26dd40ab598d9e 100644 (file)
@@ -577,7 +577,7 @@ drinksink()
                case 10: pline("This water contains toxic wastes!");
                        if (!Unchanging) {
                                You("undergo a freakish metamorphosis!");
-                               polyself();
+                               polyself(FALSE);
                        }
                        break;
                /* more odd messages --JJB */
index 7f3bde088600d152e15f043740dfdfafae8e08ba..6de1b469e234cab7b1e86d9e08ebe4b21e1d0f99 100644 (file)
@@ -210,7 +210,8 @@ dead: /* we come directly here if their experience level went to 0 or less */
 }
 
 void
-polyself()
+polyself(forcecontrol)
+boolean forcecontrol;     
 {
        char buf[BUFSZ];
        int old_light, new_light;
@@ -222,7 +223,7 @@ polyself()
        boolean iswere = (u.ulycn >= LOW_PM || is_were(youmonst.data));
        boolean isvamp = (youmonst.data->mlet == S_VAMPIRE || u.umonnum == PM_VAMPIRE_BAT);
 
-       if(!Polymorph_control && !draconian && !iswere && !isvamp) {
+        if(!Polymorph_control && !forcecontrol && !draconian && !iswere && !isvamp) {
            if (rn2(20) > ACURR(A_CON)) {
                You(shudder_for_moment);
                losehp(rnd(30), "system shock", KILLED_BY_AN);
@@ -232,7 +233,7 @@ polyself()
        }
        old_light = Upolyd ? emits_light(youmonst.data) : 0;
 
-       if (Polymorph_control) {
+       if (Polymorph_control || forcecontrol) {
                do {
                        getlin("Become what kind of monster? [type the name]",
                                buf);
index e94b941f5479d275557d6682f83acd0e6a7bc31c..56bae213a34981b1d31f12eb5ab6dae0e7ae2686 100644 (file)
@@ -871,7 +871,7 @@ peffects(otmp)
                break;
        case POT_POLYMORPH:
                You_feel("a little %s.", Hallucination ? "normal" : "strange");
-               if (!Unchanging) polyself();
+               if (!Unchanging) polyself(FALSE);
                break;
        default:
                impossible("What a funny potion! (%u)", otmp->otyp);
@@ -979,7 +979,7 @@ boolean your_fault;
                break;
        case POT_POLYMORPH:
                You_feel("a little %s.", Hallucination ? "normal" : "strange");
-               if (!Unchanging && !Antimagic) polyself();
+               if (!Unchanging && !Antimagic) polyself(FALSE);
                break;
        case POT_ACID:
                if (!Acid_resistance) {
index 11be76df35997efe22bf3e99b7434435ceee95c9..44b0b552e71ab1f7bb5d54d93f849269be068425 100644 (file)
@@ -957,7 +957,7 @@ glovecheck:         (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst);
                    deltrap(trap);      /* delete trap before polymorph */
                    newsym(u.ux,u.uy);  /* get rid of trap symbol */
                    You_feel("a change coming over you.");
-                   polyself();
+                   polyself(FALSE);
                }
                break;
            }
index ee7afaf855ef883169350c387ae06d16eaa9fcff..bac73350e63b9203852bbb8a1053d3099705003e 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -1913,7 +1913,7 @@ boolean ordinary;
                        makeknown(WAN_POLYMORPH);
                case SPE_POLYMORPH:
                    if (!Unchanging)
-                       polyself();
+                       polyself(FALSE);
                    break;
 
                case WAN_CANCELLATION: