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.
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).
+5 -7
View 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
+1 -1
View 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' */
+1 -1
View 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"
+67 -59
View 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
@@ -15,65 +16,72 @@
#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 */
+4
View File
@@ -116,6 +116,10 @@
#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)
+4 -1
View 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;
+1
View File
@@ -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");
+6 -6
View 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
+1 -1
View 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;
+2 -2
View File
@@ -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);
+3 -3
View File
@@ -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
+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 (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...
+1 -1
View 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);
+12 -6
View File
@@ -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;
+1 -1
View 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)
+2 -2
View 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);
+2 -2
View 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);
}
+3 -3
View 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));
}
+4 -4
View 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));
}
+7 -7
View File
@@ -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);
+6 -6
View 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))
+2 -2
View 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
+8 -8
View 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])) &&
+3 -2
View 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
+1 -1
View 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*/
+7 -1
View 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 "\"\"");
+1 -6
View 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;
+1 -1
View 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
+2 -2
View 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:");
+5 -5
View File
@@ -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();
+3
View File
@@ -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) {
+7 -5
View 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
+10 -3
View 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);
+4 -2
View 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);
}
+1 -1
View 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;
}
+19 -9
View 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 */
}
+1 -1
View 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)) {
+6 -2
View 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));
+2 -2
View File
@@ -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();