]> granicus.if.org Git - nethack/commitdiff
sound cleanup
authorkmhugo <kmhugo>
Sun, 28 Sep 2003 03:42:50 +0000 (03:42 +0000)
committerkmhugo <kmhugo>
Sun, 28 Sep 2003 03:42:50 +0000 (03:42 +0000)
+ Separate the two uses of flags.soundok.
+ Player-settable option is now called "acoustics".
+ Deafness is now handled as a full-fledged attribute.
+ Check for deafness in You_hear(), rather than caller.
+ Check for deafness in caller, rather than verbalize(),
  because gods can speak to characters in spite of deafness.
+ Since changes are being made to prop.h, reorder it to the
  same order as youprop.h and enlightenment.

There are still some extraneous checks and missing checks
for deafness, which will be followed up in a future patch.

Because of the size of this patch and its savefile incompatibilities,
it is only being applied to the trunk code.  Portions of this patch
were written by Michael Allison.

40 files changed:
doc/Guidebook.mn
doc/Guidebook.tex
include/flag.h
include/patchlevel.h
include/prop.h
include/youprop.h
src/apply.c
src/cmd.c
src/dbridge.c
src/detect.c
src/dig.c
src/do.c
src/dogmove.c
src/dokick.c
src/eat.c
src/explode.c
src/lock.c
src/mcastu.c
src/mhitm.c
src/mhitu.c
src/mon.c
src/monmove.c
src/mthrowu.c
src/muse.c
src/music.c
src/options.c
src/pline.c
src/pray.c
src/priest.c
src/read.c
src/shk.c
src/sit.c
src/sounds.c
src/timeout.c
src/trap.c
src/uhitm.c
src/vault.c
src/were.c
src/wizard.c
src/zap.c

index 6a4bd0833b9498deefaee63697f74322be23d930..36e729d460bb180bd71b17d1f8342d256a1cd139 100644 (file)
@@ -1620,6 +1620,9 @@ Customization options
 Here are explanations of what the various options do.
 Character strings that are too long may be truncated.
 Some of the options listed may be inactive in your dungeon.
+.lp acoustics
+Enable messages about what your character hears (default on).
+Note that this has nothing to do with your computer's audio capabilities.
 .lp align
 Your starting alignment (align:lawful, align:neutral,
 or align:chaotic).  You may specify just the first letter.
@@ -2033,11 +2036,6 @@ Show your approximate accumulated score on bottom line (default off).
 Suppress terminal beeps (default on).
 .lp sortpack
 Sort the pack contents by type when displaying inventory (default on).
-.lp sound
-Enable messages about what your character hears (default on).
-Note that this has nothing to do with your computer's audio capabilities.
-This option is only partly under player control.  The game toggles it
-off and on during and after sleep, for example.
 .lp sparkle
 Display a sparkly effect when a monster (including yourself) is hit by an
 attack to which it is resistant (default on).
index 528f802699e8a6619f2011007096576f9d60f473..e5071efa72bf9849028878a41328f30141e6ff99 100644 (file)
@@ -27,7 +27,7 @@
 \begin{document}
 %
 % input file: guidebook.mn
-% $Revision: 1.69 $ $Date: 2003/08/14 11:04:25 $
+% $Revision: 1.70 $ $Date: 2003/09/27 15:55:35 $
 %
 %.ds h0 "
 %.ds h1 %.ds h2 \%
@@ -2033,6 +2033,10 @@ Some of the options listed may be inactive in your dungeon.
 
 \blist{}
 %.lp
+\item[\ib{acoustics}]
+Enable messages about what your character hears (default on).
+Note that this has nothing to do with your computer's audio capabilities.
+%.lp
 \item[\ib{align}]
 Your starting alignment ({\tt align:lawful}, {\tt align:neutral},
 or {\tt align:chaotic}).  You may specify just the first letter.
@@ -2498,12 +2502,6 @@ Suppress terminal beeps (default on).
 \item[\ib{sortpack}]
 Sort the pack contents by type when displaying inventory (default on).
 %.lp
-\item[\ib{sound}]
-Enable messages about what your character hears (default on).
-Note that this has nothing to do with your computer's audio capabilities.
-This option is only partly under player control.  The game toggles it
-off and on during and after sleep, for example.
-%.lp
 \item[\ib{standout}]
 Boldface monsters and ``{\tt --More--}'' (default off).
 %.lp
index aac56d65f1deefad9ef549942cfd8b03694f03a5..3af261f62eb53ccdf90431ee4df7f9ed1df6f678 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 struct flag {
+       boolean  acoustics;     /* allow dungeon sound messages */
 #ifdef AMIFLUSH
        boolean  altmeta;       /* use ALT keys as META */
        boolean  amiflush;      /* kill typeahead */
@@ -66,7 +67,6 @@ struct flag {
 #endif
        boolean  silent;        /* whether the bell rings or not */
        boolean  sortpack;      /* sorted inventory */
-       boolean  soundok;       /* ok to tell about sounds heard */
        boolean  sparkle;       /* show "resisting" special FX (Scott Bigham) */
        boolean  standout;      /* use standout for --More-- */
        boolean  time;          /* display elapsed 'time' */
index cfcb4c21b49c7a53729a4523278210fd6630c49c..aedbd297537e198f3aba5b910d209175b8618e33 100644 (file)
@@ -13,7 +13,7 @@
  * Incrementing EDITLEVEL can be used to force invalidation of old bones
  * and save files.
  */
-#define EDITLEVEL      2
+#define EDITLEVEL      3
 
 #define COPYRIGHT_BANNER_A \
 "NetHack, Copyright 1985-2003"
index f2ce2748955f04b18612e6a46a15ecbb1d0ffe90..b627fa82fdf46bdb62c2a960e62b76bd6342cd47 100644 (file)
@@ -6,6 +6,7 @@
 #define PROP_H
 
 /*** What the properties are ***/
+/* Resistances to troubles */
 #define FIRE_RES                1
 #define COLD_RES                2
 #define SLEEP_RES               3
 #define ACID_RES                7
 #define STONE_RES               8
 /* note: for the first eight properties, MR_xxx == (1 << (xxx_RES - 1)) */
-#define ADORNED                         9
-#define REGENERATION           10
-#define SEARCHING              11
-#define SEE_INVIS              12
-#define INVIS                  13
-#define TELEPORT               14
-#define TELEPORT_CONTROL       15
-#define POLYMORPH              16
-#define POLYMORPH_CONTROL      17
-#define LEVITATION             18
-#define STEALTH                        19
-#define AGGRAVATE_MONSTER      20
-#define CONFLICT               21
-#define PROTECTION             22
-#define PROT_FROM_SHAPE_CHANGERS 23
-#define WARNING                        24
-#define TELEPAT                        25
-#define FAST                   26
-#define STUNNED                        27
-#define CONFUSION              28
-#define SICK                   29
-#define BLINDED                        30
-#define SLEEPING               31
-#define WOUNDED_LEGS           32
-#define STONED                 33
-#define STRANGLED              34
-#define HALLUC                 35
-#define HALLUC_RES             36
-#define FUMBLING               37
-#define JUMPING                        38
-#define WWALKING               39
-#define HUNGER                 40
-#define GLIB                   41
-#define REFLECTING             42
-#define LIFESAVED              43
-#define ANTIMAGIC              44
-#define DISPLACED              45
-#define CLAIRVOYANT            46
-#define VOMITING               47
-#define ENERGY_REGENERATION    48
-#define MAGICAL_BREATHING      49
-#define HALF_SPDAM             50
-#define HALF_PHDAM             51
-#define SICK_RES               52
-#define DRAIN_RES              53
-#define WARN_UNDEAD            54
-#define INVULNERABLE           55
-#define FREE_ACTION            56
-#define SWIMMING               57
-#define SLIMED                 58
-#define FIXED_ABIL             59
-#define FLYING                 60
-#define UNCHANGING             61
-#define PASSES_WALLS           62
-#define SLOW_DIGESTION         63
-#define INFRAVISION            64
-#define WARN_OF_MON            65
-#define DETECT_MONSTERS                66
-#define LAST_PROP              (DETECT_MONSTERS)
+#define DRAIN_RES               9
+#define SICK_RES               10
+#define INVULNERABLE           11
+#define ANTIMAGIC              12
+/* Troubles */
+#define STUNNED                        13
+#define CONFUSION              14
+#define BLINDED                        15
+#define DEAF                   16
+#define SICK                   17
+#define STONED                 18
+#define STRANGLED              19
+#define VOMITING               20
+#define GLIB                   21
+#define SLIMED                 22
+#define HALLUC                 23
+#define HALLUC_RES             24
+#define FUMBLING               25
+#define WOUNDED_LEGS           26
+#define SLEEPING               27
+#define HUNGER                 28
+/* Vision and senses */
+#define SEE_INVIS              29
+#define TELEPAT                        30
+#define WARNING                        31
+#define WARN_OF_MON            32
+#define WARN_UNDEAD            33
+#define SEARCHING              34
+#define CLAIRVOYANT            35
+#define INFRAVISION            36
+#define DETECT_MONSTERS                37
+/* Appearance and behavior */
+#define ADORNED                        38
+#define INVIS                  39
+#define DISPLACED              40
+#define STEALTH                        41
+#define AGGRAVATE_MONSTER      42
+#define CONFLICT               43
+/* Transportation */
+#define JUMPING                        44
+#define TELEPORT               45
+#define TELEPORT_CONTROL       46
+#define LEVITATION             47
+#define FLYING                 48
+#define WWALKING               49
+#define SWIMMING               50
+#define MAGICAL_BREATHING      51
+#define PASSES_WALLS           52
+/* Physical attributes */
+#define SLOW_DIGESTION         53
+#define HALF_SPDAM             54
+#define HALF_PHDAM             55
+#define REGENERATION           56
+#define ENERGY_REGENERATION    57
+#define PROTECTION             58
+#define PROT_FROM_SHAPE_CHANGERS 59
+#define POLYMORPH              60
+#define POLYMORPH_CONTROL      61
+#define UNCHANGING             62
+#define FAST                   63
+#define REFLECTING             64
+#define FREE_ACTION            65
+#define FIXED_ABIL             66
+#define LIFESAVED              67
+#define LAST_PROP              (LIFESAVED)
+
 
 /*** Where the properties come from ***/
 /* Definitions were moved here from obj.h and you.h */
index fb80f639244137877b215ab3eca9a0ee80f58f2c..f1db873a627fa162a160ec6577c8a34b5fc3ce28 100644 (file)
 #define Hallucination          (HHallucination && !Halluc_resistance)
 
 /* Timeout, plus a worn mask */
+#define HDeaf                  u.uprops[DEAF].intrinsic
+#define EDeaf                  u.uprops[DEAF].extrinsic
+#define Deaf                   (HDeaf || HDeaf)
+
 #define HFumbling              u.uprops[FUMBLING].intrinsic
 #define EFumbling              u.uprops[FUMBLING].extrinsic
 #define Fumbling               (HFumbling || EFumbling)
index 25ec4a60f1fecc6d5d082208a6c083ac1addb0ee..28b458f0c987a6b5d09003b98d0618c6dad92181 100644 (file)
@@ -209,9 +209,12 @@ use_stethoscope(obj)
        boolean interference = (u.uswallow && is_whirly(u.ustuck->data) &&
                                !rn2(Role_if(PM_HEALER) ? 10 : 3));
 
-       if (nohands(youmonst.data)) {   /* should also check for no ears and/or deaf */
+       if (nohands(youmonst.data)) {
                You("have no hands!");  /* not `body_part(HAND)' */
                return 0;
+       } else if (Deaf) {
+               You_cant("hear anything!");
+               return 0;
        } else if (!freehand()) {
                You("have no free %s.", body_part(HAND));
                return 0;
index 3c794b6272043f8bb95dd58929631523cf3b2241..19cc6a0fbea4745182324d8f060910449a3e4f16 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -884,6 +884,7 @@ int final;  /* 0 => still in progress; 1 => over, survived; 2 => dead */
                if (Stunned) you_are("stunned");
                if (Confusion) you_are("confused");
                if (Blinded) you_are("blinded");
+               if (Deaf) you_are("deaf");
                if (Sick) {
                        if (u.usick_type & SICK_VOMITABLE)
                                you_are("sick from food poisoning");
index 5ba076ffa524cfc46438d0d3846817cbeb010914..ae80abb2cf6839f3c43c03c9a8bda8310cef00b0 100644 (file)
@@ -563,7 +563,7 @@ struct entity *etmp;
                    if (e_inview)
                        pline("%s crushed by the falling portcullis!",
                              E_phrase(etmp, "are"));
-                   else if (flags.soundok)
+                   else if (!Deaf)
                        You_hear("a crushing sound.");
                    e_died(etmp, e_inview? 3 : 2, CRUSHING);
                    /* no corpse */
@@ -684,7 +684,7 @@ struct entity *etmp;
                pline("%s on drawbridge square", E_phrase(etmp, "are"));
 #endif
                if (is_pool(etmp->ex, etmp->ey) && !e_inview)
-                       if (flags.soundok)
+                       if (!Deaf)
                                You_hear("a splash.");
                if (e_survives_at(etmp, etmp->ex, etmp->ey)) {
                        if (e_inview && !is_flyer(etmp->edata) &&
@@ -759,7 +759,7 @@ int x,y;
        do_entity(&(occupants[0]));             /* Do set_entity after first */
        set_entity(x2, y2, &(occupants[1]));    /* do_entity for worm tail */
        do_entity(&(occupants[1]));
-       if(OBJ_AT(x,y) && flags.soundok)
+       if(OBJ_AT(x,y) && !Deaf)
            You_hear("smashing and crushing.");
        (void) revive_nasty(x,y,(char *)0);
        (void) revive_nasty(x2,y2,(char *)0);
@@ -838,13 +838,13 @@ int x,y;
                        if (cansee(x2,y2))
                            pline_The("portcullis of the drawbridge falls into the %s!",
                                  lava ? "lava" : "moat");
-                       else if (flags.soundok)
+                       else if (!Deaf)
                                You_hear("a loud *SPLASH*!");
                } else {
                        if (cansee(x,y))
                            pline_The("drawbridge collapses into the %s!",
                                  lava ? "lava" : "moat");
-                       else if (flags.soundok)
+                       else if (!Deaf)
                                You_hear("a loud *SPLASH*!");
                }
                lev1->typ = lava ? LAVAPOOL : MOAT;
@@ -901,7 +901,7 @@ int x,y;
                                pline("%s hit by a huge chunk of metal!",
                                      E_phrase(etmp1, "are"));
                        } else {
-                           if (flags.soundok && !is_u(etmp1) && !is_pool(x,y))
+                           if (!Deaf && !is_u(etmp1) && !is_pool(x,y))
                                You_hear("a crushing sound.");
 #ifdef D_DEBUG
                            else
index 693d4d64d044cfbf6ed4b53403914dc121a9bd82..350acd2c32d4e192c7372b50aa97d74a49050979 100644 (file)
@@ -1040,7 +1040,7 @@ genericptr_t num;
                    if(distu(zx, zy) < 3) b_trapped("door", 0);
                    else Norep("You %s an explosion!",
                                cansee(zx, zy) ? "see" :
-                                  (flags.soundok ? "hear" :
+                                  (!Deaf ? "hear" :
                                                "feel the shock of"));
                    wake_nearto(zx, zy, 11*11);
                    levl[zx][zy].doormask = D_NODOOR;
index 6311ec04d808d0fcda51cbcadf15982c5e23db5a..64a8e30cce1de61a7ffeb2e63fae2e9d2c608600 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -1040,7 +1040,7 @@ watch_dig(mtmp, x, y, zap)
            if (mtmp) {
                if(zap || context.digging.warned) {
                    verbalize("Halt, vandal!  You're under arrest!");
-                   (void) angry_guards(!(flags.soundok));
+                   (void) angry_guards(!!Deaf);
                } else {
                    const char *str;
 
@@ -1104,7 +1104,7 @@ register struct monst *mtmp;
 
        if (IS_WALL(here->typ)) {
            /* KMH -- Okay on arboreal levels (room walls are still stone) */
-           if (flags.soundok && flags.verbose && !rn2(5))
+           if (!Deaf && flags.verbose && !rn2(5))
                You_hear("crashing rock.");
            if (*in_rooms(mtmp->mx, mtmp->my, SHOPBASE))
                add_damage(mtmp->mx, mtmp->my, 0L);
index 017704de5c315b5bd39dfbb555c8c7b5935b82fd..3a0f937e11caa23fbd415b3d1d39b77b897b1f62 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -86,7 +86,7 @@ boolean pushing;
                        There("is a large splash as %s %s the %s.",
                              the(xname(otmp)), fills_up? "fills":"falls into",
                              what);
-                   } else if (flags.soundok)
+                   } else if (!Deaf)
                        You_hear("a%s splash.", lava ? " sizzling" : "");
                    wake_nearto(rx, ry, 40);
                }
@@ -184,7 +184,7 @@ const char *verb;
        } else if (is_pool(x, y)) {
                /* Reasonably bulky objects (arbitrary) splash when dropped.
                 * Stuff dropped near fountains always misses */
-               if (Blind && flags.soundok && ((x == u.ux) && (y == u.uy)) &&
+               if (Blind && !Deaf && ((x == u.ux) && (y == u.uy)) &&
                    weight(obj) > 9) {
                    pline("Splash!");
                    map_background(x, y, 0);
@@ -196,7 +196,7 @@ const char *verb;
                (t = t_at(x,y)) != 0 && t->tseen &&
                        (t->ttyp==PIT || t->ttyp==SPIKED_PIT)) {
                /* you escaped a pit and are standing on the precipice */
-               if (Blind && flags.soundok)
+               if (Blind && !Deaf)
                        You_hear("%s %s downwards.",
                                The(xname(obj)), otense(obj, "tumble"));
                else
index c4847c70e7ab7543d8322304320e894e9277f946..368d286ae815f2885504418e96b3a1610f1e4c63 100644 (file)
@@ -645,7 +645,7 @@ register int after; /* this is extra fast monster movement */
 
                    if ((info[i] & ALLOW_TRAPS) && (trap = t_at(nx,ny))) {
                        if (mtmp->mleashed) {
-                           if (flags.soundok) whimper(mtmp);
+                           if (!Deaf) whimper(mtmp);
                        } else
                            /* 1/40 chance of stepping on it anyway, in case
                             * it has to pass one to follow the player...
index 8739efcb784c2b028122bf7a3f0416e714f213f7..86dc7384f3e67736672ed72cfad24b07f0c29903 100644 (file)
@@ -941,7 +941,7 @@ dokick()
 
                    if(Levitation) goto dumb;
                    if(rn2(5)) {
-                       if(flags.soundok)
+                       if(!Deaf)
                            pline("Klunk!  The pipes vibrate noisily.");
                        else pline("Klunk!");
                        exercise(A_DEX, TRUE);
index 59f200c6f29745e9a15c78d4bcecc06bbd370996..8404f5b10bcb1c91dd927fb1810a632f0101a6db 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -1157,7 +1157,9 @@ no_opener:
 int
 Hear_again()           /* called when waking up after fainting */
 {
-       flags.soundok = 1;
+       /* Chance of deafness going away while fainted/sleepeing/etc. */
+       if (!rn2(2))
+           set_itimeout(&HDeaf, 0L);
        return 0;
 }
 
@@ -1177,6 +1179,8 @@ struct obj *obj;
                if (!Blind) Your(vision_clears);
        } else if(!rn2(3)) {
                const char *what, *where;
+               int duration = rnd(10);
+
                if (!Blind)
                    what = "goes",  where = "dark";
                else if (Levitation || Is_airlevel(&u.uz) ||
@@ -1189,8 +1193,8 @@ struct obj *obj;
 #endif
                           surface(u.ux,u.uy);
                pline_The("world spins and %s %s.", what, where);
-               flags.soundok = 0;
-               nomul(-rnd(10));
+               incr_itimeout(&HDeaf, duration);
+               nomul(-duration);
                nomovemsg = "You are conscious again.";
                afternmv = Hear_again;
                return(1);
@@ -2211,7 +2215,7 @@ sync_hunger()
 
        if(is_fainted()) {
 
-               flags.soundok = 0;
+               !Deaf = 0;
                nomul(-10+(u.uhunger/10));
                nomovemsg = "You regain consciousness.";
                afternmv = unfaint;
@@ -2273,11 +2277,13 @@ boolean incr;
                if(is_fainted()) newhs = FAINTED;
                if(u.uhs <= WEAK || rn2(20-u.uhunger/10) >= 19) {
                        if(!is_fainted() && multi >= 0 /* %% */) {
+                               int duration = 10-(u.uhunger/10);
+
                                /* stop what you're doing, then faint */
                                stop_occupation();
                                You("faint from lack of food.");
-                               flags.soundok = 0;
-                               nomul(-10+(u.uhunger/10));
+                               incr_itimeout(&HDeaf, duration);
+                               nomul(-duration);
                                nomovemsg = "You regain consciousness.";
                                afternmv = unfaint;
                                newhs = FAINTED;
index 68347f3a6bca2b2da4eedc72666439b26b41528a..f3c6f1f6cd1240c92c775c058142155221d50a9b 100644 (file)
@@ -220,7 +220,7 @@ int expltype;
                str = "explosion";
                generic = TRUE;
            }
-           if (flags.soundok) You_hear("a blast.");
+           if (!Deaf) You_hear("a blast.");
        }
 
     if (dam)
index ef47b3a5e386de3f564084df18657dda61110fea..4b4542e17bce39df6c8707e91786d68633cbd86d 100644 (file)
@@ -828,7 +828,7 @@ int x, y;
                    else if (flags.verbose) {
                        if (cansee(x,y))
                            pline("KABOOM!!  You see a door explode.");
-                       else if (flags.soundok)
+                       else if (!Deaf)
                            You_hear("a distant explosion.");
                    }
                    door->doormask = D_NODOOR;
@@ -841,7 +841,7 @@ int x, y;
                if (flags.verbose) {
                    if (cansee(x,y))
                        pline_The("door crashes open!");
-                   else if (flags.soundok)
+                   else if (!Deaf)
                        You_hear("a crashing sound.");
                }
                unblock_point(x,y);
index 2f698b1d8c5be1d835d23561ebf6d45eec8eae70..b48db5ac660d44025607d198a813eb607fc5b527 100644 (file)
@@ -65,7 +65,7 @@ boolean undirected;
 
            pline("%s points %s.", Monnam(mtmp), point_msg);
        } else if ((!(moves % 4) || !rn2(4))) {
-           if (flags.soundok) Norep("You hear a mumbled curse.");
+           if (!Deaf) Norep("You hear a mumbled curse.");
        }
 }
 
@@ -225,7 +225,7 @@ castmu(mtmp, mattk, thinks_it_foundyou, foundyou)
 
        nomul(0);
        if(rn2(ml*10) < (mtmp->mconf ? 100 : 20)) {     /* fumbled attack */
-           if (canseemon(mtmp) && flags.soundok)
+           if (canseemon(mtmp) && !Deaf)
                pline_The("air crackles around %s.", mon_nam(mtmp));
            return(0);
        }
index 60a1025c3e54b48e70f73f4bff3982b2eb94486e..717dec170129a3f8f615083924e58179b36d3fbe 100644 (file)
@@ -57,7 +57,7 @@ noises(magr, mattk)
 {
        boolean farq = (distu(magr->mx, magr->my) > 15);
 
-       if(flags.soundok && (farq != far_noise || moves-noisetime > 10)) {
+       if(!Deaf && (farq != far_noise || moves-noisetime > 10)) {
                far_noise = farq;
                noisetime = moves;
                You_hear("%s%s.",
@@ -621,7 +621,7 @@ mdamagem(magr, mdef, mattk)
                        You(brief_feeling, "queasy");
                    return MM_AGR_DIED;
                }
-               if(flags.verbose && flags.soundok) verbalize("Burrrrp!");
+               if(flags.verbose && !Deaf) verbalize("Burrrrp!");
                tmp = mdef->mhp;
                /* Use up amulet of life saving */
                if (!!(obj = mlifesaver(mdef))) m_useup(mdef, obj);
@@ -934,7 +934,7 @@ mdamagem(magr, mdef, mattk)
                            return (MM_DEF_DIED | (grow_up(magr,mdef) ?
                                                        0 : MM_AGR_DIED));
                    }
-                   if (flags.soundok) {
+                   if (!Deaf) {
                            if (!vis) You_hear("laughter.");
                            else pline("%s chuckles.", Monnam(magr));
                    }
index d5fb64bfc87eb4b4fcb7dfe7068e16b3d437b5e1..d7428db924622fa3c9dbba279e280d9c5c1ab73e 100644 (file)
@@ -1139,10 +1139,10 @@ dopois:
                hitmsg(mtmp, mattk);
                if(!rn2(3)) {
                    if (mtmp->mcan) {
-                       if (flags.soundok)
+                       if (!Deaf)
                            You_hear("a cough from %s!", mon_nam(mtmp));
                    } else {
-                       if (flags.soundok)
+                       if (!Deaf)
                            You_hear("%s hissing!", s_suffix(mon_nam(mtmp)));
                        if(!rn2(10) ||
                            (flags.moonphase == NEW_MOON && !have_lizard())) {
@@ -1375,7 +1375,7 @@ dopois:
                    dmg = 0;
                } else {
                    if (Role_if(PM_HEALER)) {
-                       if (flags.soundok && !(moves % 5))
+                       if (!Deaf && !(moves % 5))
                      verbalize("Doc, I can't help you unless you cooperate.");
                        dmg = 0;
                    } else hitmsg(mtmp, mattk);
@@ -1385,7 +1385,7 @@ dopois:
                hitmsg(mtmp, mattk);
                if(!night() && mdat == &mons[PM_GREMLIN]) break;
                if(!mtmp->mcan && !rn2(10)) {
-                   if (flags.soundok) {
+                   if (!Deaf) {
                        if (Blind) You_hear("laughter.");
                        else       pline("%s chuckles.", Monnam(mtmp));
                    }
index 9283fb56e91dfa49dc2b0ca8aec4658fdbd5cb2b..08fb1edfbee1a37acc84ec9c110b2ccc7054af24 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -673,7 +673,7 @@ meatmetal(mtmp)
                    if (cansee(mtmp->mx,mtmp->my) && flags.verbose)
                        pline("%s eats %s!", Monnam(mtmp),
                                distant_name(otmp,doname));
-                   else if (flags.soundok && flags.verbose)
+                   else if (!Deaf && flags.verbose)
                        You_hear("a crunching sound.");
                    mtmp->meating = otmp->owt/2 + 1;
                    /* Heal up to the object's weight in hp */
@@ -754,7 +754,7 @@ meatobj(mtmp)               /* for gelatinous cubes */
                if (cansee(mtmp->mx,mtmp->my) && flags.verbose)
                    pline("%s eats %s!", Monnam(mtmp),
                            distant_name(otmp, doname));
-               else if (flags.soundok && flags.verbose)
+               else if (!Deaf && flags.verbose)
                    You_hear("a slurping sound.");
                /* Heal up to the object's weight in hp */
                if (mtmp->mhp < mtmp->mhpmax) {
@@ -807,7 +807,7 @@ meatobj(mtmp)               /* for gelatinous cubes */
        if (ecount > 0) {
            if (cansee(mtmp->mx, mtmp->my) && flags.verbose && buf[0])
                pline("%s", buf);
-           else if (flags.soundok && flags.verbose)
+           else if (!Deaf && flags.verbose)
                You_hear("%s slurping sound%s.",
                        ecount == 1 ? "a" : "several",
                        ecount == 1 ? "" : "s");
@@ -1488,7 +1488,7 @@ boolean was_swallowed;                    /* digestion */
                        if (Half_physical_damage) tmp = (tmp+1) / 2;
                        losehp(tmp, killer_buf, KILLED_BY_AN);
                    } else {
-                       if (flags.soundok) You_hear("an explosion.");
+                       if (!Deaf) You_hear("an explosion.");
                        magr->mhp -= tmp;
                        if (magr->mhp < 1) mondied(magr);
                        if (magr->mhp < 1) { /* maybe lifesaved */
@@ -2033,7 +2033,7 @@ m_respond(mtmp)
 register struct monst *mtmp;
 {
     if(mtmp->data->msound == MS_SHRIEK) {
-       if(flags.soundok) {
+       if(!Deaf) {
            pline("%s shrieks.", Monnam(mtmp));
            stop_occupation();
        }
@@ -2072,7 +2072,7 @@ register struct monst *mtmp;
        if (couldsee(mtmp->mx, mtmp->my)) {
                if (humanoid(mtmp->data) || mtmp->isshk || mtmp->isgd)
                    pline("%s gets angry!", Monnam(mtmp));
-               else if (flags.verbose && flags.soundok) growl(mtmp);
+               else if (flags.verbose && !Deaf) growl(mtmp);
        }
 
        /* attacking your own quest leader will anger his or her guardians */
@@ -2726,7 +2726,7 @@ register boolean silent;
                        else if(!Blind)
                                You("see %sangry guard%s approaching!",
                                  sct == 1 ? "an " : "", sct > 1 ? "s" : "");
-               } else if(flags.soundok)
+               } else if(!Deaf)
                        You_hear("the shrill sound of a guard's whistle.");
            }
            return(TRUE);
index 4000e805d59d7c3719df1946670aa3d7f69fd2d7..c4f64b0b6a6458dcb6b7d2d2c70c07486e8d0db4 100644 (file)
@@ -21,7 +21,7 @@ register struct monst *mtmp;
        if (flags.verbose) {
            if (cansee(mtmp->mx, mtmp->my))
                pline("KABOOM!!  You see a door explode.");
-           else if (flags.soundok)
+           else if (!Deaf)
                You_hear("a distant explosion.");
        }
        wake_nearto(mtmp->mx, mtmp->my, 7*7);
@@ -54,7 +54,7 @@ register struct monst *mtmp;
                  pline("%s yells:", Amonnam(mtmp));
                  if(levl[x][y].looted & D_WARNED) {
                        verbalize("Halt, thief!  You're under arrest!");
-                       (void) angry_guards(!(flags.soundok));
+                       (void) angry_guards(!!Deaf);
                  } else {
                        verbalize("Hey, stop picking that lock!");
                        levl[x][y].looted |=  D_WARNED;
@@ -669,7 +669,7 @@ register int after;
 
 #ifdef MAIL
        if(ptr == &mons[PM_MAIL_DAEMON]) {
-           if(flags.soundok && canseemon(mtmp))
+           if(!Deaf && canseemon(mtmp))
                verbalize("I'm late!");
            mongone(mtmp);
            return(2);
@@ -1055,7 +1055,7 @@ postmov:
                            if (flags.verbose) {
                                if (canseeit)
                                   You("see a door unlock and open.");
-                               else if (flags.soundok)
+                               else if (!Deaf)
                                   You_hear("a door unlock and open.");
                            }
                            here->doormask = D_ISOPEN;
@@ -1072,7 +1072,7 @@ postmov:
                            if (flags.verbose) {
                                if (canseeit)
                                     You("see a door open.");
-                               else if (flags.soundok)
+                               else if (!Deaf)
                                     You_hear("a door open.");
                            }
                            here->doormask = D_ISOPEN;
@@ -1090,7 +1090,7 @@ postmov:
                            if (flags.verbose) {
                                if (canseeit)
                                    You("see a door crash open.");
-                               else if (flags.soundok)
+                               else if (!Deaf)
                                    You_hear("a door crash open.");
                            }
                            if (here->doormask & D_LOCKED && !rn2(2))
index f82235abf5207b32a1012a5309e04d4a8b03e97b..3d1ca76332a0cf9cddc85c9693eeac472afebad5 100644 (file)
@@ -605,7 +605,7 @@ register struct attack *mattk;
 
        if(mtmp->mcan) {
 
-           if(flags.soundok)
+           if(!Deaf)
                pline("A dry rattle comes from %s throat.",
                                      s_suffix(mon_nam(mtmp)));
            return 0;
@@ -646,7 +646,7 @@ breamu(mtmp, mattk)                 /* monster breathes at you (ranged) */
        if(lined_up(mtmp)) {
 
            if(mtmp->mcan) {
-               if(flags.soundok) {
+               if(!Deaf) {
                    if(canseemon(mtmp))
                        pline("%s coughs.", Monnam(mtmp));
                    else
index bfe18cc8012ceedb06bcda1cb1ada5e1bd7b9244..6dd1229002e7f8e9a62dc95c436e71bb7161a170 100644 (file)
@@ -126,7 +126,7 @@ struct obj *obj;
        if (obj->oclass == WAND_CLASS && obj->cursed && !rn2(100)) {
            int dam = d(obj->spe+2, 6);
 
-           if (flags.soundok) {
+           if (!Deaf) {
                if (vis) pline("%s zaps %s, which suddenly explodes!",
                        Monnam(mon), an(xname(obj)));
                else You_hear("a zap and an explosion in the distance.");
@@ -150,7 +150,7 @@ struct obj *otmp;
 boolean self;
 {
        if (!canseemon(mtmp)) {
-               if (flags.soundok)
+               if (!Deaf)
                        You_hear("a %s zap.",
                                        (distu(mtmp->mx,mtmp->my) <= (BOLT_LIM+1)*(BOLT_LIM+1)) ?
                                        "nearby" : "distant");
@@ -173,7 +173,7 @@ struct obj *otmp;
        short saverole;
        unsigned savebknown;
 
-       if (!vismon && !flags.soundok)
+       if (!vismon && Deaf)
            return;             /* no feedback */
 
        otmp->dknown = 1;  /* seeing or hearing it read reveals its label */
@@ -211,7 +211,7 @@ struct obj *otmp;
                otmp->dknown = 1;
                pline("%s drinks %s!", Monnam(mtmp), singular(otmp, doname));
        } else
-               if (flags.soundok)
+               if (!Deaf)
                        You_hear("a chugging sound.");
 }
 
@@ -561,7 +561,7 @@ struct monst *mtmp;
        case MUSE_BUGLE:
                if (vismon)
                        pline("%s plays %s!", Monnam(mtmp), doname(otmp));
-               else if (flags.soundok)
+               else if (!Deaf)
                        You_hear("a bugle playing reveille!");
                awaken_soldiers();
                return 2;
@@ -667,7 +667,7 @@ mon_tele:
                                surface(mtmp->mx, mtmp->my));
                    pline("%s %s through...", Monnam(mtmp),
                          is_flyer(mtmp->data) ? "dives" : "falls");
-               } else if (flags.soundok)
+               } else if (!Deaf)
                        You_hear("%s crash through the %s.", something,
                                surface(mtmp->mx, mtmp->my));
                /* we made sure that there is a level for mtmp to go to */
@@ -1376,7 +1376,7 @@ struct monst *mtmp;
                                    if(is_metallic(helmet)) {
                                        if (canspotmon(mtmp2))
                                            pline("Fortunately, %s is wearing a hard helmet.", mon_nam(mtmp2));
-                                       else if (flags.soundok)
+                                       else if (!Deaf)
                                            You_hear("a clanging sound.");
                                        if (mdmg > 2) mdmg = 2;
                                    } else {
@@ -2140,7 +2140,7 @@ boolean stoning;
                    (obj->otyp == POT_ACID) ? "quaff" : "eat",
                    distant_name(obj,doname));
        obj->quan = save_quan;
-    } else if (flags.soundok)
+    } else if (!Deaf)
        You_hear("%s.", (obj->otyp == POT_ACID) ? "drinking" : "chewing");
     m_useup(mon, obj);
     if (((obj->otyp == POT_ACID) || acidic(&mons[obj->corpsenm])) &&
index e7391d885b45646762c343f6a18236008dccda26..d9a5595601a8d7a10847c867e574560cb5aa88de 100644 (file)
@@ -300,7 +300,7 @@ do_pit:                 chasm = maketrap(x,y,PIT);
                            mtmp->mtrapped = 1;
                            if(cansee(x,y))
                                pline("%s falls into a chasm!", Monnam(mtmp));
-                           else if (flags.soundok && humanoid(mtmp->data))
+                           else if (!Deaf && humanoid(mtmp->data))
                                You_hear("a scream!");
                            mselftouch(mtmp, "Falling, ", TRUE);
                            if (mtmp->mhp > 0)
@@ -459,6 +459,7 @@ struct obj *instr;
        case LEATHER_DRUM:              /* Awaken monsters */
            You("beat a deafening row!");
            awaken_monsters(u.ulevel * 40);
+           incr_itimeout(&HDeaf, rn1(20,30));
            exercise(A_WIS, FALSE);
            break;
        default:
@@ -552,7 +553,7 @@ struct obj *instr;
                                open_drawbridge(x,y);
                            return 0;
                        }
-           } else if(flags.soundok) {
+           } else if(!Deaf) {
                if (u.uevent.uheard_tune < 1) u.uevent.uheard_tune = 1;
                /* Okay, it wasn't the right tune, but perhaps
                 * we can give the player some hints like in the
index 27624108ed0a0e1b2456c42fe51792546ec69447..1a52d7c3d194eaa33996a5102ea74c2e2b7de7a6 100644 (file)
@@ -39,6 +39,7 @@ static struct Bool_Opt
        boolean *addr, initvalue;
        int optflags;
 } boolopt[] = {
+       {"acoustics", &flags.acoustics, TRUE, SET_IN_GAME},
 #ifdef AMIGA
        {"altmeta", &flags.altmeta, TRUE, DISP_IN_GAME},
 #else
@@ -175,7 +176,6 @@ static struct Bool_Opt
        {"silent", &flags.silent, TRUE, SET_IN_GAME},
        {"softkeyboard", &iflags.wc2_softkeyboard, FALSE, SET_IN_FILE},
        {"sortpack", &flags.sortpack, TRUE, SET_IN_GAME},
-       {"sound", &flags.soundok, TRUE, SET_IN_GAME},
        {"sparkle", &flags.sparkle, TRUE, SET_IN_GAME},
        {"standout", &flags.standout, FALSE, SET_IN_GAME},
        {"splash_screen",     &iflags.wc_splash_screen, TRUE, DISP_IN_GAME},    /*WC*/
index 32ef3e5007f7adaa27dda8048be4f816d58a6504..6c2af6072b1f4953998e896e89427b5c59d5bb1e 100644 (file)
@@ -173,6 +173,8 @@ There VA_DECL(const char *,line)
 void
 You_hear VA_DECL(const char *,line)
        char *tmp;
+
+       if (Deaf || flags.acoustics) return;
        VA_START(line);
        VA_INIT(line, const char *);
        if (Underwater)
@@ -185,11 +187,15 @@ You_hear VA_DECL(const char *,line)
        VA_END();
 }
 
+/* Print a message inside double-quotes.
+ * The caller is responsible for checking deafness.
+ * Gods can speak directly to you in spite of deafness.
+ */
 /*VARARGS1*/
 void
 verbalize VA_DECL(const char *,line)
        char *tmp;
-       if (!flags.soundok) return;
+
        VA_START(line);
        VA_INIT(line, const char *);
        tmp = You_buf((int)strlen(line) + sizeof "\"\"");
index 1eeb7b3396bedd25e4e1ace79e248834244061cc..a733a0302f1a910cd894d534ab3da352371205b9 100644 (file)
@@ -1304,7 +1304,7 @@ verbalize("In return for thy service, I grant thee the gift of Immortality!");
     } /* real Amulet */
 
     if (otmp->otyp == FAKE_AMULET_OF_YENDOR) {
-           if (flags.soundok)
+           if (!Deaf)
                You_hear("a nearby thunderclap.");
            if (!otmp->known) {
                You("realize you have made a %s.",
@@ -1564,11 +1564,6 @@ dopray()
            return 0;
 
     u.uconduct.gnostic++;
-    /* Praying implies that the hero is conscious and since we have
-       no deafness attribute this implies that all verbalized messages
-       can be heard.  So, in case the player has used the 'O' command
-       to toggle this accessible flag off, force it to be on. */
-    flags.soundok = 1;
 
     /* set up p_type and p_alignment */
     if (!can_pray(TRUE)) return 0;
index 58d588efbffa526abf926735cf5280d6d80e1291..28e43b3948bcc697c9067b279a6d9c8fe815f834 100644 (file)
@@ -328,7 +328,7 @@ register int roomno;
                sanctum = (priest->data == &mons[PM_HIGH_PRIEST] &&
                           (Is_sanctum(&u.uz) || In_endgame(&u.uz)));
                can_speak = (priest->mcanmove && !priest->msleeping &&
-                            flags.soundok);
+                            !Deaf);
                if (can_speak) {
                    unsigned save_priest = priest->ispriest;
                    /* don't reveal the altar's owner upon temple entry in
index 78299e264364a3292935ae6f03bc1dd9d7ea8271..03fb3142a1c48122b5645178a64d0caf776574c6 100644 (file)
@@ -1211,7 +1211,7 @@ register struct obj       *sobj;
                                    if(is_metallic(helmet)) {
                                        if (canspotmon(mtmp))
                                            pline("Fortunately, %s is wearing a hard helmet.", mon_nam(mtmp));
-                                       else if (flags.soundok)
+                                       else if (!Deaf)
                                            You_hear("a clanging sound.");
                                        if (mdmg > 2) mdmg = 2;
                                    } else {
@@ -1661,7 +1661,7 @@ int how;
                if (is_demon(ptr)) adjalign(sgn(u.ualign.type));
 
                if(!(ptr->geno & G_GENO)) {
-                       if(flags.soundok) {
+                       if(!Deaf) {
        /* fixme: unconditional "caverns" will be silly in some circumstances */
                            if(flags.verbose)
                        pline("A thunderous voice booms through the caverns:");
index 4b56e2bd5ffaaf858e215c0c2852f75688042b57..ecaf783ba436a27001b70b6531ab2bf2db3177f6 100644 (file)
--- a/src/shk.c
+++ b/src/shk.c
@@ -321,7 +321,7 @@ register boolean nearshop;
 
        if(!shkp) return;
 
-       if (flags.soundok)
+       if (!Deaf)
            pline("An alarm sounds!");
 
        nokops = ((mvitals[PM_KEYSTONE_KOP].mvflags & G_GONE) &&
@@ -329,8 +329,8 @@ register boolean nearshop;
                  (mvitals[PM_KOP_LIEUTENANT].mvflags & G_GONE) &&
                  (mvitals[PM_KOP_KAPTAIN].mvflags & G_GONE));
 
-       if(!angry_guards(!flags.soundok) && nokops) {
-           if(flags.verbose && flags.soundok)
+       if(!angry_guards(!!Deaf) && nokops) {
+           if(flags.verbose && !Deaf)
                pline("But no one seems to respond to it.");
            return;
        }
@@ -2994,7 +2994,7 @@ register boolean croaked;
                pline("Suddenly, the trap is removed from the floor!");
            else if (inside_shop(u.ux, u.uy) == ESHK(shkp)->shoproom)
                You_feel("more claustrophobic than before.");
-           else if (flags.soundok && !rn2(10))
+           else if (!Deaf && !rn2(10))
                Norep("The dungeon acoustics noticeably change.");
        }
        if (stop_picking)
@@ -3482,7 +3482,7 @@ boolean cant_mollify;
             * yanked the hapless critter out of the way.
             */
            if (MON_AT(x, y)) {
-               if(flags.soundok) {
+               if(!Deaf) {
                    You_hear("an angry voice:");
                    verbalize("Out of my way, scum!");
                    wait_synch();
index 9c56bf8777029e7cf784bdb0808c19a0b9a5a930..bc06faa4ab4379355d558c3cdf6f8b8e12bb0f09 100644 (file)
--- a/src/sit.c
+++ b/src/sit.c
@@ -202,6 +202,7 @@ dosit()
                        {
                        register int cnt = rnd(10);
 
+                       /* Magical voice not affected by deafness */
                        pline("A voice echoes:");
                        verbalize("Thy audience hath been summoned, %s!",
                                  flags.female ? "Dame" : "Sire");
@@ -210,12 +211,14 @@ dosit()
                        break;
                        }
                    case 8:
+                       /* Magical voice not affected by deafness */
                        pline("A voice echoes:");
                        verbalize("By thy Imperious order, %s...",
                                  flags.female ? "Dame" : "Sire");
                        do_genocide(5); /* REALLY|ONTHRONE, see do_genocide() */
                        break;
                    case 9:
+                       /* Magical voice not affected by deafness */
                        pline("A voice echoes:");
        verbalize("A curse upon thee for sitting upon this most holy throne!");
                        if (Luck > 0)  {
index 36334f9ac14951395ebabdbad1b5ca16830977d7..8ae8db5506351c0bc29096ca61a4eba6ffa5ad75 100644 (file)
@@ -36,7 +36,7 @@ dosounds()
 #endif
     struct monst *mtmp;
 
-    if (!flags.soundok || u.uswallow || Underwater) return;
+    if (Deaf || !flags.acoustics || u.uswallow || Underwater) return;
 
     hallu = Hallucination ? 1 : 0;
 
@@ -423,7 +423,7 @@ register struct monst *mtmp;
     char verbuf[BUFSZ];
 
     /* presumably nearness and sleep checks have already been made */
-    if (!flags.soundok) return(0);
+    if (Deaf) return(0);
     if (is_silent(ptr)) return(0);
 
     /* Make sure its your role's quest quardian; adjust if not */
@@ -816,10 +816,8 @@ int
 dotalk()
 {
     int result;
-    boolean save_soundok = flags.soundok;
-    flags.soundok = 1; /* always allow sounds while chatting */
+
     result = dochat();
-    flags.soundok = save_soundok;
     return result;
 }
 
@@ -846,6 +844,10 @@ dochat()
        Your("speech is unintelligible underwater.");
        return(0);
     }
+    if (Deaf) {
+       pline("How can you hold a conversation when you cannot hear?");
+       return(0);
+    }
 
     if (!Blind && (otmp = shop_object(u.ux, u.uy)) != (struct obj *)0) {
        /* standing on something in a shop and chatting causes the shopkeeper
index bdd6211bad57305c93179d384c28b41e2fbdc374..1fca06a96f43cf4939e500246c6ee52e28f26f43 100644 (file)
@@ -275,6 +275,11 @@ nh_timeout()
                        make_blinded(0L, TRUE);
                        stop_occupation();
                        break;
+               case DEAF:
+                       if (!Deaf)
+                           You("can hear again.");
+                       stop_occupation();
+                       break;
                case INVIS:
                        newsym(u.ux,u.uy);
                        if (!Invis && !BInvis && !Blind) {
@@ -359,7 +364,7 @@ boolean wakeup_msg;
        if (wakeup_msg && multi == how_long) {
            /* caller can follow with a direct call to Hear_again() if
               there's a need to override this when wakeup_msg is true */
-           flags.soundok = 0;
+           incr_itimeout(&HDeaf, how_long);
            afternmv = Hear_again;      /* this won't give any messages */
        }
        /* early wakeup from combat won't be possible until next monster turn */
@@ -512,7 +517,7 @@ long timeout;
                            siblings ? "Their" : "Its",
                            flags.female ? "mommy" : "daddy",
                            egg->spe ? "." : "?");
-                   } else if (mon->data->mlet == S_DRAGON) {
+                   } else if (mon->data->mlet == S_DRAGON && !Deaf) {
                        verbalize("Gleep!");            /* Mything eggs :-) */
                    }
                    break;
@@ -1199,8 +1204,10 @@ do_storms()
     }
 
     if(levl[u.ux][u.uy].typ == CLOUD) {
-       /* inside a cloud during a thunder storm is deafening */
+       /* Inside a cloud during a thunder storm is deafening. */
+       /* Even if already deaf, we sense the thunder's vibrations. */
        pline("Kaboom!!!  Boom!!  Boom!!");
+       incr_itimeout(&HDeaf, rn1(20,30));
        if(!u.uinvulnerable) {
            stop_occupation();
            nomul(-3);
index 3521f685060eede0f6fd388f72decedeef047051..45c918795eecf8c9f1de39ebe1802668c7131839 100644 (file)
@@ -1769,7 +1769,7 @@ register struct monst *mtmp;
                            } else {
                                if((mptr == &mons[PM_OWLBEAR]
                                    || mptr == &mons[PM_BUGBEAR])
-                                  && flags.soundok)
+                                  && !Deaf)
                                    You_hear("the roaring of an angry bear!");
                            }
                        }
@@ -2460,8 +2460,10 @@ domagictrap()
                if (!Blind) Your(vision_clears);
          } else if (!Blind) {
                You("see a flash of light!");
-         }  else
+         } else if (!Deaf) {
                You_hear("a deafening roar!");
+         }
+         incr_itimeout(&HDeaf, rn1(20,30));
          while(cnt--)
                (void) makemon((struct permonst *) 0, u.ux, u.uy, NO_MM_FLAGS);
        }
index e80b9b8f62c005296f465ce8a758dd45b1cc5e2c..c982a08ce0c0412c0c99d89034156ea22e81f0b8 100644 (file)
@@ -521,7 +521,7 @@ int thrown;
                             mon->data == &mons[PM_WATCH_CAPTAIN]));
        result = hmon_hitmon(mon, obj, thrown);
        if (mon->ispriest && !rn2(2)) ghod_hitsu(mon);
-       if (anger_guards) (void)angry_guards(!flags.soundok);
+       if (anger_guards) (void)angry_guards(!!Deaf);
        return result;
 }
 
index ce5ce5b3a2ef13db0f44e8490ef4292ae8603f97..59843e072822769d325d32937399e8866bf83a6f 100644 (file)
@@ -289,7 +289,9 @@ fnd:
        }
        verbalize("I don't know you.");
 #ifndef GOLDOBJ
-       if (!u.ugold && !hidden_gold())
+       if (Deaf)
+           ;
+       else if (!u.ugold && !hidden_gold())
            verbalize("Please follow me.");
        else {
            if (!u.ugold)
@@ -299,7 +301,9 @@ fnd:
        }
 #else
         umoney = money_cnt(invent);
-       if (!umoney && !hidden_gold())
+       if (Deaf)
+           ;
+       else if (!umoney && !hidden_gold())
            verbalize("Please follow me.");
        else {
            if (!umoney)
@@ -476,7 +480,7 @@ register struct monst *grd;
        if(egrd->fcend == 1) {
            if(u_in_vault &&
                        (u_carry_gold || um_dist(grd->mx, grd->my, 1))) {
-               if(egrd->warncnt == 3)
+               if(egrd->warncnt == 3 && !Deaf)
                        verbalize("I repeat, %sfollow me!",
                                u_carry_gold ? (
 #ifndef GOLDOBJ
@@ -491,7 +495,8 @@ register struct monst *grd;
                if(egrd->warncnt == 7) {
                        m = grd->mx;
                        n = grd->my;
-                       verbalize("You've been warned, knave!");
+                       if (!Deaf)
+                           verbalize("You've been warned, knave!");
                        mnexto(grd);
                        levl[m][n].typ = egrd->fakecorr[0].ftyp;
                        newsym(m,n);
@@ -521,7 +526,8 @@ letknow:
                            g_monnam(grd));
                    return(-1);
                } else {
-                   verbalize("Well, begone.");
+                   if (!Deaf)
+                       verbalize("Well, begone.");
                    wallify_vault(grd);
                    egrd->gddone = 1;
                    goto cleanup;
@@ -548,10 +554,12 @@ letknow:
                }
                if(egrd->warncnt < 6) {
                        egrd->warncnt = 6;
-                       verbalize("Drop all your gold, scoundrel!");
+                       if (!Deaf)
+                           verbalize("Drop all your gold, scoundrel!");
                        return(0);
                } else {
-                       verbalize("So be it, rogue!");
+                       if (!Deaf)
+                           verbalize("So be it, rogue!");
                        grd->mpeaceful = 0;
                        return(-1);
                }
@@ -582,7 +590,8 @@ letknow:
                } else {
                    /* just for insurance... */
                    if (MON_AT(m, n) && m != grd->mx && n != grd->my) {
-                       verbalize("Out of my way, scum!");
+                       if (!Deaf)
+                           verbalize("Out of my way, scum!");
                        (void) rloc(m_at(m, n), FALSE);
                    }
                    remove_monster(grd->mx, grd->my);
@@ -606,7 +615,8 @@ letknow:
                }
        }
        if(um_dist(grd->mx, grd->my, 1) || egrd->gddone) {
-               if(!egrd->gddone && !rn2(10)) verbalize("Move along!");
+               if(!egrd->gddone && !rn2(10) && !Deaf)
+                   verbalize("Move along!");
                restfakecorr(grd);
                return(0);      /* didn't move */
        }
index 43d321f98b7c17662ff87c488a913cd0d479293f..14c994be0da3ccb6a5dda07405201d231e78728f 100644 (file)
@@ -16,7 +16,7 @@ register struct monst *mon;
                !rn2(night() ? (flags.moonphase == FULL_MOON ?  3 : 30)
                             : (flags.moonphase == FULL_MOON ? 10 : 50))) {
                new_were(mon);          /* change into animal form */
-               if (flags.soundok && !canseemon(mon)) {
+               if (!Deaf && !canseemon(mon)) {
                    const char *howler;
 
                    switch (monsndx(mon->data)) {
index 1729f964a89fdf23595c8a23276ae05cb56441b9..413c268aa66827285c9b1f80d4184986d43c6ea1 100644 (file)
@@ -503,8 +503,10 @@ resurrect()
        if (mtmp) {
                mtmp->msleeping = mtmp->mtame = mtmp->mpeaceful = 0;
                set_malign(mtmp);
-               pline("A voice booms out...");
-               verbalize("So thou thought thou couldst %s me, fool.", verb);
+               if (!Deaf) {
+                   pline("A voice booms out...");
+                   verbalize("So thou thought thou couldst %s me, fool.", verb);
+               }
        }
 
 }
@@ -594,6 +596,8 @@ void
 cuss(mtmp)
 register struct monst  *mtmp;
 {
+       if (Deaf)
+           return;
        if (mtmp->iswiz) {
            if (!rn2(5))  /* typical bad guy action */
                pline("%s laughs fiendishly.", Monnam(mtmp));
index cbc39826d87b56bbaf78920ee85fe2c413c89ba7..8e6dc1591e0ce5ab7d841bd24d1c9815acc4db0f 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -3590,7 +3590,7 @@ boolean *shopdamage;
                        else
                                Norep("The water freezes.");
                        newsym(x,y);
-                   } else if(flags.soundok && !lava)
+                   } else if(!Deaf && !lava)
                        You_hear("a crackling sound.");
 
                    if (x == u.ux && y == u.uy) {
@@ -3676,7 +3676,7 @@ boolean *shopdamage;
                    } else if (sense_txt) {
                        You(sense_txt);
                    } else if (hear_txt) {
-                       if (flags.soundok) You_hear(hear_txt);
+                       if (!Deaf) You_hear(hear_txt);
                    }
                    if (picking_at(x, y)) {
                        stop_occupation();