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:
12
src/sounds.c
12
src/sounds.c
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user