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
+1
View 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) put prisoners in the Dark One's dungeon (Dylan O'Donnell)
add leather cloak so soldiers don't have elven cloaks add leather cloak so soldiers don't have elven cloaks
add Tom Friedetzky's BUC-patch (applies to full menustyle only) 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 Platform- and/or Interface-Specific New Features
+1 -1
View File
@@ -1450,7 +1450,7 @@ E void NDECL(self_invis_message);
E void NDECL(set_uasmon); E void NDECL(set_uasmon);
E void NDECL(change_sex); E void NDECL(change_sex);
E void NDECL(polyself); E void FDECL(polyself, (BOOLEAN_P));
E int FDECL(polymon, (int)); E int FDECL(polymon, (int));
E void NDECL(rehumanize); E void NDECL(rehumanize);
E int NDECL(dobreathe); E int NDECL(dobreathe);
+1 -1
View File
@@ -243,7 +243,7 @@ moveloop()
stop_occupation(); stop_occupation();
else else
nomul(0); nomul(0);
if (change == 1) polyself(); if (change == 1) polyself(FALSE);
else you_were(); else you_were();
change = 0; change = 0;
} }
+36
View File
@@ -115,7 +115,9 @@ STATIC_PTR int NDECL(wiz_map);
STATIC_PTR int NDECL(wiz_genesis); STATIC_PTR int NDECL(wiz_genesis);
STATIC_PTR int NDECL(wiz_where); STATIC_PTR int NDECL(wiz_where);
STATIC_PTR int NDECL(wiz_detect); 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_tele);
STATIC_PTR int NDECL(wiz_level_gain);
STATIC_PTR int NDECL(wiz_show_seenv); STATIC_PTR int NDECL(wiz_show_seenv);
STATIC_PTR int NDECL(wiz_show_vision); STATIC_PTR int NDECL(wiz_show_vision);
STATIC_PTR int NDECL(wiz_mon_polycontrol); STATIC_PTR int NDECL(wiz_mon_polycontrol);
@@ -562,6 +564,36 @@ wiz_mon_polycontrol()
return 0; 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 STATIC_PTR int
wiz_show_seenv() 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},
{(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 #ifdef DEBUG
{(char *)0, (char *)0, donull, TRUE}, {(char *)0, (char *)0, donull, TRUE},
@@ -1370,8 +1404,10 @@ struct ext_func_tab extcmdlist[] = {
#if defined(WIZARD) #if defined(WIZARD)
static const struct ext_func_tab debug_extcmdlist[] = { 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}, {"light sources", "show mobile light sources", wiz_light_sources, TRUE},
{"monpoly_control", "control monster polymorphs", wiz_mon_polycontrol, TRUE}, {"monpoly_control", "control monster polymorphs", wiz_mon_polycontrol, TRUE},
{"poly", "polymorph self", wiz_polyself, TRUE},
{"seenv", "show seen vectors", wiz_show_seenv, TRUE}, {"seenv", "show seen vectors", wiz_show_seenv, TRUE},
{"stats", "show memory statistics", wiz_show_stats, TRUE}, {"stats", "show memory statistics", wiz_show_stats, TRUE},
{"timeout", "look at timeout queue", wiz_timeout_queue, TRUE}, {"timeout", "look at timeout queue", wiz_timeout_queue, TRUE},
+1 -1
View File
@@ -857,7 +857,7 @@ register int pm;
/* case PM_SANDESTIN: */ /* case PM_SANDESTIN: */
if (!Unchanging) { if (!Unchanging) {
You_feel("a change coming over you."); You_feel("a change coming over you.");
polyself(); polyself(FALSE);
} }
break; break;
case PM_MIND_FLAYER: case PM_MIND_FLAYER:
+1 -1
View File
@@ -577,7 +577,7 @@ drinksink()
case 10: pline("This water contains toxic wastes!"); case 10: pline("This water contains toxic wastes!");
if (!Unchanging) { if (!Unchanging) {
You("undergo a freakish metamorphosis!"); You("undergo a freakish metamorphosis!");
polyself(); polyself(FALSE);
} }
break; break;
/* more odd messages --JJB */ /* more odd messages --JJB */
+4 -3
View File
@@ -210,7 +210,8 @@ dead: /* we come directly here if their experience level went to 0 or less */
} }
void void
polyself() polyself(forcecontrol)
boolean forcecontrol;
{ {
char buf[BUFSZ]; char buf[BUFSZ];
int old_light, new_light; int old_light, new_light;
@@ -222,7 +223,7 @@ polyself()
boolean iswere = (u.ulycn >= LOW_PM || is_were(youmonst.data)); boolean iswere = (u.ulycn >= LOW_PM || is_were(youmonst.data));
boolean isvamp = (youmonst.data->mlet == S_VAMPIRE || u.umonnum == PM_VAMPIRE_BAT); 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)) { if (rn2(20) > ACURR(A_CON)) {
You(shudder_for_moment); You(shudder_for_moment);
losehp(rnd(30), "system shock", KILLED_BY_AN); losehp(rnd(30), "system shock", KILLED_BY_AN);
@@ -232,7 +233,7 @@ polyself()
} }
old_light = Upolyd ? emits_light(youmonst.data) : 0; old_light = Upolyd ? emits_light(youmonst.data) : 0;
if (Polymorph_control) { if (Polymorph_control || forcecontrol) {
do { do {
getlin("Become what kind of monster? [type the name]", getlin("Become what kind of monster? [type the name]",
buf); buf);
+2 -2
View File
@@ -871,7 +871,7 @@ peffects(otmp)
break; break;
case POT_POLYMORPH: case POT_POLYMORPH:
You_feel("a little %s.", Hallucination ? "normal" : "strange"); You_feel("a little %s.", Hallucination ? "normal" : "strange");
if (!Unchanging) polyself(); if (!Unchanging) polyself(FALSE);
break; break;
default: default:
impossible("What a funny potion! (%u)", otmp->otyp); impossible("What a funny potion! (%u)", otmp->otyp);
@@ -979,7 +979,7 @@ boolean your_fault;
break; break;
case POT_POLYMORPH: case POT_POLYMORPH:
You_feel("a little %s.", Hallucination ? "normal" : "strange"); You_feel("a little %s.", Hallucination ? "normal" : "strange");
if (!Unchanging && !Antimagic) polyself(); if (!Unchanging && !Antimagic) polyself(FALSE);
break; break;
case POT_ACID: case POT_ACID:
if (!Acid_resistance) { if (!Acid_resistance) {
+1 -1
View File
@@ -957,7 +957,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst);
deltrap(trap); /* delete trap before polymorph */ deltrap(trap); /* delete trap before polymorph */
newsym(u.ux,u.uy); /* get rid of trap symbol */ newsym(u.ux,u.uy); /* get rid of trap symbol */
You_feel("a change coming over you."); You_feel("a change coming over you.");
polyself(); polyself(FALSE);
} }
break; break;
} }
+1 -1
View File
@@ -1913,7 +1913,7 @@ boolean ordinary;
makeknown(WAN_POLYMORPH); makeknown(WAN_POLYMORPH);
case SPE_POLYMORPH: case SPE_POLYMORPH:
if (!Unchanging) if (!Unchanging)
polyself(); polyself(FALSE);
break; break;
case WAN_CANCELLATION: case WAN_CANCELLATION: