From: arromdee Date: Thu, 17 Jan 2002 02:47:23 +0000 (+0000) Subject: wizard #poly and #levelgain X-Git-Tag: MOVE2GIT~3465 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f93521e95d72f333187c02e1bc64cbc1059b0ad0;p=nethack wizard #poly and #levelgain This adds the wizard #poly and #levelgain commands. --- diff --git a/doc/fixes33.2 b/doc/fixes33.2 index ae2eb08c2..fbe6e78bd 100644 --- a/doc/fixes33.2 +++ b/doc/fixes33.2 @@ -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 diff --git a/include/extern.h b/include/extern.h index 4a8970108..6508184c1 100644 --- a/include/extern.h +++ b/include/extern.h @@ -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); diff --git a/src/allmain.c b/src/allmain.c index d42e2658a..0d084ee73 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -243,7 +243,7 @@ moveloop() stop_occupation(); else nomul(0); - if (change == 1) polyself(); + if (change == 1) polyself(FALSE); else you_were(); change = 0; } diff --git a/src/cmd.c b/src/cmd.c index 3b1862a61..88340f929 100644 --- 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}, diff --git a/src/eat.c b/src/eat.c index e02a4c61c..001cd09e3 100644 --- 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: diff --git a/src/fountain.c b/src/fountain.c index b0563d263..1374f8eae 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -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 */ diff --git a/src/polyself.c b/src/polyself.c index 7f3bde088..6de1b469e 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -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); diff --git a/src/potion.c b/src/potion.c index e94b941f5..56bae213a 100644 --- a/src/potion.c +++ b/src/potion.c @@ -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) { diff --git a/src/trap.c b/src/trap.c index 11be76df3..44b0b552e 100644 --- a/src/trap.c +++ b/src/trap.c @@ -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; } diff --git a/src/zap.c b/src/zap.c index ee7afaf85..bac73350e 100644 --- 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: