]> granicus.if.org Git - nethack/commitdiff
don't impact player stats with wizard mode ^T
authornhmall <nhmall@nethack.org>
Wed, 26 Sep 2018 03:08:09 +0000 (23:08 -0400)
committernhmall <nhmall@nethack.org>
Wed, 26 Sep 2018 03:08:09 +0000 (23:08 -0400)
doc/fixes36.2
include/extern.h
src/cmd.c
src/dig.c
src/teleport.c
src/trap.c

index ec4b0fb95f23d51aa6af66805fc04a65fca16ed5..79656ce1fd2e174b36c6712d26bbaf914aeb0255 100644 (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
 ------------------------------------------------------------------
index bf3f801bdbb894bc11554bfc398bba43046b73ce..34544234511b16cf8e8ff51c75d171ca45a67897 100644 (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 *));
index 1c65ec71f5797d92d5d56b9c690bf00a1efcae38..74ee87fec8cdc254e2a6a8f212b36bdfe94cc26e 100644 (file)
--- 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",
index 0a16698132ce1456a559daeeb0db382faff0d1b0..a89b354bef082701ce517e81cade6730721cbfa2 100644 (file)
--- 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;
 
index 5003ed82d856a2207a37258e49d08687fed53a2f..615292d5d7c5971d7edd2d66235c0b2873f75af5 100644 (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;
+            }
         }
     }
 
index 99554c326085a253e5c460e728b83419b0314af7..b9252d18ef4f8378e00ac1621b4f30dfc089bf8f 100644 (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