From: nhmall Date: Wed, 26 Sep 2018 03:08:09 +0000 (-0400) Subject: don't impact player stats with wizard mode ^T X-Git-Tag: NetHack-3.6.2_Released~194^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=039ad51660dc8f1080b3ffa68e12e01fae30eb2c;p=nethack don't impact player stats with wizard mode ^T --- diff --git a/doc/fixes36.2 b/doc/fixes36.2 index ec4b0fb95..79656ce1f 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -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 ------------------------------------------------------------------ diff --git a/include/extern.h b/include/extern.h index bf3f801bd..345442345 100644 --- a/include/extern.h +++ b/include/extern.h @@ -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 *)); diff --git a/src/cmd.c b/src/cmd.c index 1c65ec71f..74ee87fec 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -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", diff --git a/src/dig.c b/src/dig.c index 0a1669813..a89b354be 100644 --- a/src/dig.c +++ b/src/dig.c @@ -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; diff --git a/src/teleport.c b/src/teleport.c index 5003ed82d..615292d5d 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -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; + } } } diff --git a/src/trap.c b/src/trap.c index 99554c326..b9252d18e 100644 --- a/src/trap.c +++ b/src/trap.c @@ -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