+ 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.
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.
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).
\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 \%
\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.
\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
*/
struct flag {
+ boolean acoustics; /* allow dungeon sound messages */
#ifdef AMIFLUSH
boolean altmeta; /* use ALT keys as META */
boolean amiflush; /* kill typeahead */
#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' */
* 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"
#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 */
#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)
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;
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");
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 */
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) &&
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);
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;
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
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;
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;
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);
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);
}
} 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);
(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
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...
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);
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;
}
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) ||
#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);
if(is_fainted()) {
- flags.soundok = 0;
+ !Deaf = 0;
nomul(-10+(u.uhunger/10));
nomovemsg = "You regain consciousness.";
afternmv = unfaint;
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;
str = "explosion";
generic = TRUE;
}
- if (flags.soundok) You_hear("a blast.");
+ if (!Deaf) You_hear("a blast.");
}
if (dam)
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;
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);
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.");
}
}
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);
}
{
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.",
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);
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));
}
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())) {
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);
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));
}
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 */
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) {
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");
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 */
register struct monst *mtmp;
{
if(mtmp->data->msound == MS_SHRIEK) {
- if(flags.soundok) {
+ if(!Deaf) {
pline("%s shrieks.", Monnam(mtmp));
stop_occupation();
}
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 */
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);
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);
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;
#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);
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;
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;
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))
if(mtmp->mcan) {
- if(flags.soundok)
+ if(!Deaf)
pline("A dry rattle comes from %s throat.",
s_suffix(mon_nam(mtmp)));
return 0;
if(lined_up(mtmp)) {
if(mtmp->mcan) {
- if(flags.soundok) {
+ if(!Deaf) {
if(canseemon(mtmp))
pline("%s coughs.", Monnam(mtmp));
else
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.");
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");
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 */
otmp->dknown = 1;
pline("%s drinks %s!", Monnam(mtmp), singular(otmp, doname));
} else
- if (flags.soundok)
+ if (!Deaf)
You_hear("a chugging sound.");
}
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;
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 */
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 {
(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])) &&
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)
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:
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
boolean *addr, initvalue;
int optflags;
} boolopt[] = {
+ {"acoustics", &flags.acoustics, TRUE, SET_IN_GAME},
#ifdef AMIGA
{"altmeta", &flags.altmeta, TRUE, DISP_IN_GAME},
#else
{"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*/
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)
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 "\"\"");
} /* 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.",
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;
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
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 {
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:");
if(!shkp) return;
- if (flags.soundok)
+ if (!Deaf)
pline("An alarm sounds!");
nokops = ((mvitals[PM_KEYSTONE_KOP].mvflags & G_GONE) &&
(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;
}
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)
* 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();
{
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");
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) {
#endif
struct monst *mtmp;
- if (!flags.soundok || u.uswallow || Underwater) return;
+ if (Deaf || !flags.acoustics || u.uswallow || Underwater) return;
hallu = Hallucination ? 1 : 0;
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 */
dotalk()
{
int result;
- boolean save_soundok = flags.soundok;
- flags.soundok = 1; /* always allow sounds while chatting */
+
result = dochat();
- flags.soundok = save_soundok;
return result;
}
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
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) {
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 */
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;
}
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);
} else {
if((mptr == &mons[PM_OWLBEAR]
|| mptr == &mons[PM_BUGBEAR])
- && flags.soundok)
+ && !Deaf)
You_hear("the roaring of an angry bear!");
}
}
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);
}
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;
}
}
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)
}
#else
umoney = money_cnt(invent);
- if (!umoney && !hidden_gold())
+ if (Deaf)
+ ;
+ else if (!umoney && !hidden_gold())
verbalize("Please follow me.");
else {
if (!umoney)
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
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);
g_monnam(grd));
return(-1);
} else {
- verbalize("Well, begone.");
+ if (!Deaf)
+ verbalize("Well, begone.");
wallify_vault(grd);
egrd->gddone = 1;
goto cleanup;
}
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);
}
} 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);
}
}
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 */
}
!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)) {
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);
+ }
}
}
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));
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) {
} 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();