]> granicus.if.org Git - nethack/commitdiff
B04006 - Grayswandir and unicorn horns
authorcohrs <cohrs>
Thu, 22 Aug 2002 00:13:03 +0000 (00:13 +0000)
committercohrs <cohrs>
Thu, 22 Aug 2002 00:13:03 +0000 (00:13 +0000)
Implement a check in make_hallucinated similar to the check in make_blinded
to handle the case where your hallucination is cured but Grayswandir is
suppressing its effects anyway.

doc/fixes34.1
src/potion.c

index 4f25e63906a58ea935a7bf0b95438309666e7e58..1e018ac52a6fbe60e58d3f876c73c534caf9683f 100644 (file)
@@ -217,6 +217,7 @@ Breaking wand of digging near shop walls wouldn't anger the shopkeeper
 Shop walls wouldn't be restored if there were pits in the way.
 If there were a hole outside a shop, you could kick stuff out of the door
        into the hole without the shopkeeper noticing.
+curing hallucination while wielding Grayswandir should print a message
 
 
 Platform- and/or Interface-Specific Fixes
index a17bdb06cdf2cffd095f1a9bb84f2043278abd56..7895526eaeab70b008c4e288f7b5a1e951e8baa1 100644 (file)
@@ -157,6 +157,8 @@ boolean talk;
        set_itimeout(&Vomiting, xtime);
 }
 
+static const char vismsg[] = "vision seems to %s for a moment but is %s now.";
+static const char eyemsg[] = "%s momentarily %s.";
 
 void
 make_blinded(xtime, talk)
@@ -167,9 +169,6 @@ boolean talk;
        boolean u_could_see, can_see_now;
        int eyecnt;
        char buf[BUFSZ];
-       static const char
-               vismsg[] = "vision seems to %s for a moment but is %s now.",
-               eyemsg[] = "%s momentarily %s.";
 
        /* we need to probe ahead in case the Eyes of the Overworld
           are or will be overriding blindness */
@@ -245,6 +244,7 @@ long xtime; /* nonzero if this is an attempt to turn on hallucination */
 boolean talk;
 long mask;     /* nonzero if resistance status should change by mask */
 {
+       long old = HHallucination;
        boolean changed = 0;
        const char *message, *verb;
 
@@ -261,6 +261,22 @@ long mask; /* nonzero if resistance status should change by mask */
            if (!EHalluc_resistance && (!!HHallucination != !!xtime))
                changed = TRUE;
            set_itimeout(&HHallucination, xtime);
+
+           /* clearing temporary hallucination without toggling vision */
+           if (!changed && !HHallucination && old && talk) {
+               if (!haseyes(youmonst.data)) {
+                   strange_feeling((struct obj *)0, (char *)0);
+               } else if (Blind) {
+                   char buf[BUFSZ];
+                   int eyecnt = eyecount(youmonst.data);
+
+                   Strcpy(buf, body_part(EYE));
+                   Your(eyemsg, (eyecnt == 1) ? buf : makeplural(buf),
+                        (eyecnt == 1) ? "itches" : "itch");
+               } else {        /* Grayswandir */
+                   Your(vismsg, "flatten", "normal");
+               }
+           }
        }
 
        if (changed) {