wizard #poly and #levelgain

This adds the wizard #poly and #levelgain commands.
This commit is contained in:
arromdee
2002-01-17 02:47:23 +00:00
parent 2c26f0ceea
commit f93521e95d
10 changed files with 49 additions and 11 deletions

View 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;
}

View File

@@ -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},

View File

@@ -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:

View 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 */

View 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);

View 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) {

View 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;
}

View File

@@ -1913,7 +1913,7 @@ boolean ordinary;
makeknown(WAN_POLYMORPH);
case SPE_POLYMORPH:
if (!Unchanging)
polyself();
polyself(FALSE);
break;
case WAN_CANCELLATION: