From: nethack.rankin Date: Thu, 19 Dec 2002 02:24:13 +0000 (+0000) Subject: artifact invisibility fixes X-Git-Tag: MOVE2GIT~2289 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b2e205117681a04600902e2f0f258ffd340fb48;p=nethack artifact invisibility fixes 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. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 9645111ff..921b08b8c 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -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 diff --git a/src/artifact.c b/src/artifact.c index aa2378ff7..514e5ea4b 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -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; } }