]> granicus.if.org Git - nethack/commitdiff
artifact invisibility fixes
authornethack.rankin <nethack.rankin>
Thu, 19 Dec 2002 02:24:13 +0000 (02:24 +0000)
committernethack.rankin <nethack.rankin>
Thu, 19 Dec 2002 02:24:13 +0000 (02:24 +0000)
     Invoking the archeologist's Orb of Detection gave "you feel a surge
of power, but nothing seems to happen" if you were able to see invisible,
but various other ways of toggling invisibility give fade/unfade messages
in that situation.  Also, you would get false reports of invisibility
changes if you invoked the artifact while temporarily invisible due to
potion or spell or while wearing a mummy wrapping.

doc/fixes34.1
src/artifact.c

index 9645111ffc6f91cc7709d66db748eca987d3628b..921b08b8ce9d95398706684eaa22825a8d9d3975 100644 (file)
@@ -337,6 +337,7 @@ can't successfully bribe a demon who happens to be carrying the Amulet
 while over water, killing a monster that had engulfed you does not result
        in the usual water effects
 removing a ring of levitation while engulfed should not invoke spoteffects
+feedback from invoking Orb of Detection was sometimes misleading or wrong
 
 
 Platform- and/or Interface-Specific Fixes
index aa2378ff71c1fe7d0a41d11f8058bb0f513db170..514e5ea4bd24d7be49da4b9b50450a551a5a1c75 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)artifact.c 3.4     2002/10/07      */
+/*     SCCS Id: @(#)artifact.c 3.4     2002/12/18      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1278,13 +1278,16 @@ arti_invoke(obj)
          }
        }
     } else {
-       long cprop = (u.uprops[oart->inv_prop].extrinsic ^= W_ARTI);
-       boolean on = (cprop & W_ARTI) != 0; /* true if invoked prop just set */
+       long eprop = (u.uprops[oart->inv_prop].extrinsic ^= W_ARTI),
+            iprop = u.uprops[oart->inv_prop].intrinsic;
+       boolean on = (eprop & W_ARTI) != 0; /* true if invoked prop just set */
 
        if(on && obj->age > monstermoves) {
            /* the artifact is tired :-) */
            u.uprops[oart->inv_prop].extrinsic ^= W_ARTI;
            You_feel("that %s is ignoring you.", the(xname(obj)));
+           /* can't just keep repeatedly trying */
+           obj->age += (long) d(3,10);
            return 1;
        } else if(!on) {
            /* when turning off property, determine downtime */
@@ -1292,7 +1295,7 @@ arti_invoke(obj)
            obj->age = monstermoves + rnz(100);
        }
 
-       if(cprop & ~W_ARTI) {
+       if ((eprop & ~W_ARTI) || iprop) {
 nothing_special:
            /* you had the property from some other source too */
            if (carried(obj))
@@ -1311,15 +1314,13 @@ nothing_special:
            } else (void) float_down(I_SPECIAL|TIMEOUT, W_ARTI);
            break;
        case INVIS:
-           if (!See_invisible && !Blind) {
-               newsym(u.ux,u.uy);
-               if (on) {
-                   Your("body takes on a %s transparency...",
-                        Hallucination ? "normal" : "strange");
-               } else {
-                   Your("body seems to unfade...");
-               }
-           } else goto nothing_special;
+           if (BInvis || Blind) goto nothing_special;
+           newsym(u.ux, u.uy);
+           if (on)
+               Your("body takes on a %s transparency...",
+                    Hallucination ? "normal" : "strange");
+           else
+               Your("body seems to unfade...");
            break;
        }
     }