don't impact player stats with wizard mode ^T

This commit is contained in:
nhmall
2018-09-25 23:08:09 -04:00
parent 64ebb9ceba
commit 039ad51660
6 changed files with 25 additions and 13 deletions

View File

@@ -492,7 +492,14 @@ struct obj *scroll;
}
int
dotele()
dotelecmd()
{
return dotele((wizard) ? TRUE : FALSE);
}
int
dotele(break_the_rules)
boolean break_the_rules;
{
struct trap *trap;
boolean trap_once = FALSE;
@@ -529,7 +536,7 @@ dotele()
castit = TRUE;
break;
}
if (!wizard) {
if (!break_the_rules) {
if (!castit) {
if (!Teleportation)
You("don't know that spell.");
@@ -541,7 +548,7 @@ dotele()
}
if (u.uhunger <= 100 || ACURR(A_STR) < 6) {
if (!wizard) {
if (!break_the_rules) {
You("lack the strength %s.",
castit ? "for a teleport spell" : "to teleport");
return 1;
@@ -550,7 +557,7 @@ dotele()
energy = objects[SPE_TELEPORT_AWAY].oc_level * 7 / 2 - 2;
if (u.uen <= energy) {
if (wizard)
if (break_the_rules)
energy = u.uen;
else {
You("lack the energy %s.",
@@ -567,11 +574,13 @@ dotele()
exercise(A_WIS, TRUE);
if (spelleffects(sp_no, TRUE))
return 1;
else if (!wizard)
else if (!break_the_rules)
return 0;
} else {
u.uen -= energy;
context.botl = 1;
if (!break_the_rules) {
u.uen -= energy;
context.botl = 1;
}
}
}