B04006 - Grayswandir and unicorn horns

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.
This commit is contained in:
cohrs
2002-08-22 00:13:03 +00:00
parent 2d2a20cdf0
commit 59a96452ff
2 changed files with 20 additions and 3 deletions
+1
View 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. 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 If there were a hole outside a shop, you could kick stuff out of the door
into the hole without the shopkeeper noticing. into the hole without the shopkeeper noticing.
curing hallucination while wielding Grayswandir should print a message
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
+19 -3
View File
@@ -157,6 +157,8 @@ boolean talk;
set_itimeout(&Vomiting, xtime); 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 void
make_blinded(xtime, talk) make_blinded(xtime, talk)
@@ -167,9 +169,6 @@ boolean talk;
boolean u_could_see, can_see_now; boolean u_could_see, can_see_now;
int eyecnt; int eyecnt;
char buf[BUFSZ]; 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 /* we need to probe ahead in case the Eyes of the Overworld
are or will be overriding blindness */ are or will be overriding blindness */
@@ -245,6 +244,7 @@ long xtime; /* nonzero if this is an attempt to turn on hallucination */
boolean talk; boolean talk;
long mask; /* nonzero if resistance status should change by mask */ long mask; /* nonzero if resistance status should change by mask */
{ {
long old = HHallucination;
boolean changed = 0; boolean changed = 0;
const char *message, *verb; const char *message, *verb;
@@ -261,6 +261,22 @@ long mask; /* nonzero if resistance status should change by mask */
if (!EHalluc_resistance && (!!HHallucination != !!xtime)) if (!EHalluc_resistance && (!!HHallucination != !!xtime))
changed = TRUE; changed = TRUE;
set_itimeout(&HHallucination, xtime); 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) { if (changed) {