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

@@ -146,7 +146,9 @@ poly'd hero and monsters could eat through iron bars in areas where walls
were flagged as non-diggable
Samurai seeing items at a distance could have them be described by their
ordinary names rather than by their Japanese names
wizard mode ^T shouldn't have been diminishing player power but it was
and hilite_status:power settings really drew attention to that
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
------------------------------------------------------------------

View File

@@ -2359,7 +2359,8 @@ E boolean FDECL(safe_teleds, (BOOLEAN_P));
E boolean FDECL(teleport_pet, (struct monst *, BOOLEAN_P));
E void NDECL(tele);
E boolean FDECL(scrolltele, (struct obj *));
E int NDECL(dotele);
E int NDECL(dotelecmd);
E int FDECL(dotele, (BOOLEAN_P));
E void NDECL(level_tele);
E void FDECL(domagicportal, (struct trap *));
E void FDECL(tele_trap, (struct trap *));

View File

@@ -116,7 +116,7 @@ extern int NDECL(dosit); /**/
extern int NDECL(dotalk); /**/
extern int NDECL(docast); /**/
extern int NDECL(dovspell); /**/
extern int NDECL(dotele); /**/
extern int NDECL(dotelecmd); /**/
extern int NDECL(dountrap); /**/
extern int NDECL(doversion); /**/
extern int NDECL(doextversion); /**/
@@ -3133,7 +3133,7 @@ struct ext_func_tab extcmdlist[] = {
{ 'x', "swap", "swap wielded and secondary weapons", doswapweapon },
{ 'T', "takeoff", "take off one piece of armor", dotakeoff },
{ 'A', "takeoffall", "remove all armor", doddoremarm },
{ C('t'), "teleport", "teleport around the level", dotele, IFBURIED },
{ C('t'), "teleport", "teleport around the level", dotelecmd, IFBURIED },
{ '\0', "terrain", "show map without obstructions",
doterrain, IFBURIED | AUTOCOMPLETE },
{ '\0', "therecmdmenu",

View File

@@ -2086,7 +2086,7 @@ escape_tomb()
if ((Teleportation || can_teleport(youmonst.data))
&& (Teleport_control || rn2(3) < Luck+2)) {
You("attempt a teleport spell.");
(void) dotele(); /* calls unearth_you() */
(void) dotele(FALSE); /* calls unearth_you() */
} else if (u.uburied) { /* still buried after 'port attempt */
boolean good;

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

View File

@@ -3693,7 +3693,7 @@ drown()
&& (Teleport_control || rn2(3) < Luck + 2)) {
You("attempt a teleport spell."); /* utcsri!carroll */
if (!level.flags.noteleport) {
(void) dotele();
(void) dotele(FALSE);
if (!is_pool(u.ux, u.uy))
return TRUE;
} else