sound cleanup

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