]> granicus.if.org Git - nethack/commitdiff
U719: grayswandir and exploding black lights
authornethack.allison <nethack.allison>
Wed, 29 Oct 2003 13:03:23 +0000 (13:03 +0000)
committernethack.allison <nethack.allison>
Wed, 29 Oct 2003 13:03:23 +0000 (13:03 +0000)
<email deleted> 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
include/extern.h
src/apply.c
src/artifact.c
src/detect.c
src/mhitu.c
src/potion.c
src/pray.c
src/timeout.c
src/trap.c

index 6d54eec2e70ec8b242837e75f039ee68c69f5968..8d65e1f21752da610545a8ae842b81311a1c3b88 100644 (file)
@@ -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
index cf75f6a6b21096783a61afef30023373899309e1..2728b2f4e6c94412f4e3344aec585a11f11593e7 100644 (file)
@@ -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 *));
index 569bc92365df5ba6089107102a0d290df6d40815..95f5b246881f1f65016e08e090081dbe4551e2fa 100644 (file)
@@ -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):
index c00cb4396837ae78d1d80448d08217e384435fa9..a43bf1c7cd550cb7cb6e1561d06ab7ded93b1477 100644 (file)
@@ -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;
index 7ed39726a0d54a7cb36bdb837d70b6ba95b606e3..6de5e3ad1b23c8e022daf19c1a785623aeee410c 100644 (file)
@@ -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);
index b490c931b839a35c078d74be6d01c2340beff135..01077338e8d5379698963637e077fb3ae98fae34 100644 (file)
@@ -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;
 
index 788293a63f41206ef0959a9fdb725f476a7179a0..33e40190d6a418e80103200d7330b641753ef0ed 100644 (file)
@@ -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;
index 18456f574932b2276ef4df2f69e79ab87be6b6de..e2c82d2d78b2ebbb3c3f0995f78eacfe17d0e749 100644 (file)
@@ -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:
index 14009e67ad4aee0c59ce57a947d09dda98427f9d..93c15737723e0ff845e66f8eb146ad2f484d5045 100644 (file)
@@ -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:
index 7ce31349c828040d6109e223a50bd9760efeae03..17d0c5a4fe75b666f4f45893711ac8537f14b4b7 100644 (file)
@@ -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;