]> granicus.if.org Git - nethack/commitdiff
Magic traps can toggle intrinsic invisibility
authorPasi Kallinen <paxed@alt.org>
Sun, 6 Feb 2022 15:52:40 +0000 (17:52 +0200)
committerPasi Kallinen <paxed@alt.org>
Sun, 6 Feb 2022 15:54:09 +0000 (17:54 +0200)
Originally from Sporkhack by Derek Ray

doc/fixes3-7-0.txt
src/trap.c

index 6f7890927ef2969ee8c662d2acc24ab73f36cde8..7b891818c49b63f9d675651a2afa21d536c963ad 100644 (file)
@@ -768,9 +768,11 @@ have fake player monsters use verbalize instead of pline when reacting to chat
 fix mention_walls distinguishing unseen walls from solid stone
 don't push unknown boulders when moving
 in flush_screen, reorder the code slightly to complete the bot() and
-timebot() calls prior to the window port call to place the cursor on the hero
+       timebot() calls prior to the window port call to place the cursor
+        on the hero
+magic traps can toggle intrinsic invisibility
+
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
 ------------------------------------------------------------------
 fix compile when DLB isn't defined
index e342c5e14c1311aa5748a7a16243d2223a5c4ff2..4b513c07eba57b253895c899761226183709b20d 100644 (file)
@@ -3634,9 +3634,27 @@ domagictrap(void)
     } else {
         switch (fate) {
         case 10:
-        case 11:
             /* sometimes nothing happens */
             break;
+        case 11: /* toggle intrinsic invisibility */
+            You_hear("a low hum.");
+            if (!Invis) {
+                if (!Blind)
+                    self_invis_message();
+            } else if (!EInvis && !pm_invisible(g.youmonst.data)) {
+                if (!Blind) {
+                    if (!See_invisible)
+                        You("can see yourself again!");
+                    else
+                        You_cant("see through yourself anymore.");
+                }
+            } else {
+                /* If we're invisible from another source */
+                You_feel("a little more %s now.", HInvis ? "obvious" : "hidden");
+            }
+            HInvis = HInvis ? 0 : HInvis | FROMOUTSIDE;
+            newsym(u.ux, u.uy);
+            break;
         case 12: /* a flash of fire */
             dofiretrap((struct obj *) 0);
             break;