From cdbe3b1d394a98f53e63a1e24205adcd08ac8c6c Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Wed, 29 Oct 2003 13:03:23 +0000 Subject: [PATCH] U719: grayswandir and exploding black lights wrote: > When wielding greyswander and a black light explodes, the > message is still "You are freaked by a blast of kaleidoscopic > light!" giving no indication that you are immune to > hallucination. Maybe something like "You see a blast of color, > but seem unaffected" would be more appropriate? return the changed status back to the caller from make_hallucinated(). --- doc/fixes34.3 | 1 + include/extern.h | 2 +- src/apply.c | 4 ++-- src/artifact.c | 2 +- src/detect.c | 2 +- src/mhitu.c | 6 ++++-- src/potion.c | 11 ++++++----- src/pray.c | 2 +- src/timeout.c | 2 +- src/trap.c | 2 +- 10 files changed, 19 insertions(+), 15 deletions(-) diff --git a/doc/fixes34.3 b/doc/fixes34.3 index 6d54eec2e..8d65e1f21 100644 --- a/doc/fixes34.3 +++ b/doc/fixes34.3 @@ -82,6 +82,7 @@ allow Conflict-resistant monsters to respond to conflict attacks rather than sitting there and taking the attacks until they die prefer herbivorous stone-to-flesh message when hero is a vegitarian try even harder to avoid incorrect map display while changing levels +no "freaked" message by exploding black light, unless you really are Platform- and/or Interface-Specific Fixes diff --git a/include/extern.h b/include/extern.h index cf75f6a6b..2728b2f4e 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1560,7 +1560,7 @@ E void FDECL(make_blinded, (long,BOOLEAN_P)); E void FDECL(make_sick, (long, const char *, BOOLEAN_P,int)); E void FDECL(make_slimed, (long,const char*)); E void FDECL(make_vomiting, (long,BOOLEAN_P)); -E void FDECL(make_hallucinated, (long,BOOLEAN_P,long)); +E boolean FDECL(make_hallucinated, (long,BOOLEAN_P,long)); E int NDECL(dodrink); E int FDECL(dopotion, (struct obj *)); E int FDECL(peffects, (struct obj *)); diff --git a/src/apply.c b/src/apply.c index 569bc9236..95f5b2468 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1470,7 +1470,7 @@ struct obj *obj; break; case 4: (void) adjattrib(rn2(A_MAX), -1, FALSE); break; - case 5: make_hallucinated(HHallucination + lcount, TRUE, 0L); + case 5: (void) make_hallucinated(HHallucination + lcount, TRUE, 0L); break; } return; @@ -1550,7 +1550,7 @@ struct obj *obj; did_prop++; break; case prop2trbl(HALLUC): - make_hallucinated(0L, TRUE, 0L); + (void) make_hallucinated(0L, TRUE, 0L); did_prop++; break; case prop2trbl(VOMITING): diff --git a/src/artifact.c b/src/artifact.c index c00cb4396..a43bf1c7c 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -408,7 +408,7 @@ long wp_mask; * that can print a message--need to guard against being printed * when restoring a game */ - make_hallucinated((long)!on, restoring ? FALSE : TRUE, wp_mask); + (void) make_hallucinated((long)!on, restoring ? FALSE : TRUE, wp_mask); } if (spfx & SPFX_ESP) { if(on) ETelepat |= wp_mask; diff --git a/src/detect.c b/src/detect.c index 7ed39726a..6de5e3ad1 100644 --- a/src/detect.c +++ b/src/detect.c @@ -815,7 +815,7 @@ struct obj *obj; } break; case 4 : pline("%s your mind!", Tobjnam(obj, "zap")); - make_hallucinated(HHallucination + rnd(100),FALSE,0L); + (void) make_hallucinated(HHallucination + rnd(100),FALSE,0L); break; case 5 : pline("%s!", Tobjnam(obj, "explode")); useup(obj); diff --git a/src/mhitu.c b/src/mhitu.c index b490c931b..01077338e 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -1869,9 +1869,11 @@ common: u.umonnum == PM_VIOLET_FUNGUS || dmgtype(youmonst.data, AD_STUN)); if (!not_affected) { + boolean chg; if (!Hallucination) - You("are freaked by a blast of kaleidoscopic light!"); - make_hallucinated(HHallucination + (long)tmp,FALSE,0L); + You("are caught in a blast of kaleidoscopic light!"); + chg = make_hallucinated(HHallucination + (long)tmp,FALSE,0L); + You("%s.", chg ? "are freaked out" : "seem unaffected"); } break; diff --git a/src/potion.c b/src/potion.c index 788293a63..33e40190d 100644 --- a/src/potion.c +++ b/src/potion.c @@ -247,7 +247,7 @@ boolean talk; } } -void +boolean make_hallucinated(xtime, talk, mask) long xtime; /* nonzero if this is an attempt to turn on hallucination */ boolean talk; @@ -305,6 +305,7 @@ long mask; /* nonzero if resistance status should change by mask */ context.botl = 1; if (talk) pline(message, verb); } + return changed; } STATIC_OVL void @@ -450,7 +451,7 @@ peffects(otmp) break; case POT_HALLUCINATION: if (Hallucination || Halluc_resistance) nothing++; - make_hallucinated(itimeout_incr(HHallucination, + (void) make_hallucinated(itimeout_incr(HHallucination, rn1(200, 600 - 300 * bcsign(otmp))), TRUE, 0L); break; @@ -700,7 +701,7 @@ peffects(otmp) } if(Hallucination) { You("are shocked back to your senses!"); - make_hallucinated(0L,FALSE,0L); + (void) make_hallucinated(0L,FALSE,0L); } break; case POT_CONFUSION: @@ -805,7 +806,7 @@ peffects(otmp) healup(d(6 + 2 * bcsign(otmp), 8), otmp->blessed ? 5 : !otmp->cursed ? 2 : 0, !otmp->cursed, TRUE); - make_hallucinated(0L,TRUE,0L); + (void) make_hallucinated(0L,TRUE,0L); exercise(A_CON, TRUE); exercise(A_STR, TRUE); break; @@ -819,7 +820,7 @@ peffects(otmp) u.ulevelmax -= 1; pluslvl(FALSE); } - make_hallucinated(0L,TRUE,0L); + (void) make_hallucinated(0L,TRUE,0L); exercise(A_STR, TRUE); exercise(A_CON, TRUE); break; diff --git a/src/pray.c b/src/pray.c index 18456f574..e2c82d2d7 100644 --- a/src/pray.c +++ b/src/pray.c @@ -440,7 +440,7 @@ decurse: break; case TROUBLE_HALLUCINATION: pline ("Looks like you are back in Kansas."); - make_hallucinated(0L,FALSE,0L); + (void) make_hallucinated(0L,FALSE,0L); break; #ifdef STEED case TROUBLE_SADDLE: diff --git a/src/timeout.c b/src/timeout.c index 14009e67a..93c157377 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -304,7 +304,7 @@ nh_timeout() break; case HALLUC: HHallucination = 1; - make_hallucinated(0L, TRUE, 0L); + (void) make_hallucinated(0L, TRUE, 0L); stop_occupation(); break; case SLEEPING: diff --git a/src/trap.c b/src/trap.c index 7ce31349c..17d0c5a4f 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3734,7 +3734,7 @@ boolean disarm; stagger(youmonst.data, "stagger")); } make_stunned(HStun + rn1(7, 16),FALSE); - make_hallucinated(HHallucination + rn1(5, 16),FALSE,0L); + (void) make_hallucinated(HHallucination + rn1(5, 16),FALSE,0L); break; default: impossible("bad chest trap"); break; -- 2.40.0