You_hear already checks deafness

This commit is contained in:
Pasi Kallinen
2015-03-17 18:47:16 +02:00
parent 7d8d8ad1f5
commit 7fa05c6311
7 changed files with 19 additions and 25 deletions
+1 -1
View File
@@ -1245,7 +1245,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 (!Deaf && flags.verbose && !rn2(5)) if (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);
+2 -2
View File
@@ -888,7 +888,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 (!Deaf) else
You_hear("a distant explosion."); You_hear("a distant explosion.");
} }
door->doormask = D_NODOOR; door->doormask = D_NODOOR;
@@ -901,7 +901,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 (!Deaf) else
You_hear("a crashing sound."); You_hear("a crashing sound.");
} }
unblock_point(x,y); unblock_point(x,y);
+5 -5
View File
@@ -638,7 +638,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 (!Deaf && flags.verbose) else if (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 */
@@ -758,7 +758,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 (!Deaf && flags.verbose) else if (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) {
@@ -803,7 +803,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])
pline1(buf); pline1(buf);
else if (!Deaf && flags.verbose) else if (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");
@@ -1642,7 +1642,7 @@ boolean was_swallowed; /* digestion */
s_suffix(mdat->mname)); s_suffix(mdat->mname));
losehp(Maybe_Half_Phys(tmp), killer.name, KILLED_BY_AN); losehp(Maybe_Half_Phys(tmp), killer.name, KILLED_BY_AN);
} else { } else {
if (!Deaf) You_hear("an explosion."); 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 */
@@ -3106,7 +3106,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(!Deaf) } else
You_hear("the shrill sound of a guard's whistle."); You_hear("the shrill sound of a guard's whistle.");
} }
return(TRUE); return(TRUE);
+1 -1
View File
@@ -334,7 +334,7 @@ do_pit: chasm = maketrap(x,y,PIT);
if (!m_already_trapped) { /* suppress messages */ if (!m_already_trapped) { /* suppress messages */
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 (!Deaf && humanoid(mtmp->data)) else if (humanoid(mtmp->data))
You_hear("a scream!"); You_hear("a scream!");
} }
/* Falling is okay for falling down /* Falling is okay for falling down
+1 -2
View File
@@ -1386,8 +1386,7 @@ verbalize("In return for thy service, I grant thee the gift of Immortality!");
if (otmp->otyp == FAKE_AMULET_OF_YENDOR) { if (otmp->otyp == FAKE_AMULET_OF_YENDOR) {
if (!highaltar && !otmp->known) goto too_soon; if (!highaltar && !otmp->known) goto too_soon;
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.",
Hallucination ? "boo-boo" : "mistake"); Hallucination ? "boo-boo" : "mistake");
+3 -6
View File
@@ -2062,10 +2062,9 @@ register struct monst *mtmp;
pline("%s stops momentarily and appears to cringe.", pline("%s stops momentarily and appears to cringe.",
Monnam(mtmp)); Monnam(mtmp));
} }
} else if (!Deaf) { } else
You_hear("a distant %s squeak.", You_hear("a distant %s squeak.",
trapnote(trap,1)); trapnote(trap,1));
}
/* wake up nearby monsters */ /* wake up nearby monsters */
wake_nearto(mtmp->mx, mtmp->my, 40); wake_nearto(mtmp->mx, mtmp->my, 40);
break; break;
@@ -2080,9 +2079,8 @@ register struct monst *mtmp;
Monnam(mtmp), a_your[trap->madeby_u]); Monnam(mtmp), a_your[trap->madeby_u]);
seetrap(trap); seetrap(trap);
} else { } else {
if((mptr == &mons[PM_OWLBEAR] if(mptr == &mons[PM_OWLBEAR]
|| mptr == &mons[PM_BUGBEAR]) || mptr == &mons[PM_BUGBEAR])
&& !Deaf)
You_hear("the roaring of an angry bear!"); You_hear("the roaring of an angry bear!");
} }
} else if (force_mintrap) { } else if (force_mintrap) {
@@ -2923,9 +2921,8 @@ domagictrap()
if (!Blind) Your1(vision_clears); if (!Blind) Your1(vision_clears);
} else if (!Blind) { } else if (!Blind) {
You_see("a flash of light!"); You_see("a flash of light!");
} else if (!Deaf) { } else
You_hear("a deafening roar!"); You_hear("a deafening roar!");
}
incr_itimeout(&HDeaf, rn1(20,30)); 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);
+6 -8
View File
@@ -1790,7 +1790,7 @@ struct obj *obj, *otmp;
if (obj->otyp == BOULDER) { if (obj->otyp == BOULDER) {
if (cansee(obj->ox, obj->oy)) if (cansee(obj->ox, obj->oy))
pline_The("boulder falls apart."); pline_The("boulder falls apart.");
else if (!Deaf) else
You_hear("a crumbling sound."); You_hear("a crumbling sound.");
fracture_rock(obj); fracture_rock(obj);
} }
@@ -1801,9 +1801,8 @@ struct obj *obj, *otmp;
pline_The("%s shatters.", rndmonnam()); pline_The("%s shatters.", rndmonnam());
else else
pline_The("statue shatters."); pline_The("statue shatters.");
} else if (!Deaf) { } else
You_hear("a crumbling sound."); You_hear("a crumbling sound.");
}
} }
} else { } else {
if (context.mon_moving ? if (context.mon_moving ?
@@ -3025,7 +3024,7 @@ struct obj **pobj; /* object tossed/used, set to NULL
if (!Blind) pline("%s %s%s.", Yname2(obj), if (!Blind) pline("%s %s%s.", Yname2(obj),
otense(obj, "skip"), otense(obj, "skip"),
skipcount ? " again" : ""); skipcount ? " again" : "");
else if (!Deaf) You_hear("%s skip.", yname(obj)); else You_hear("%s skip.", yname(obj));
skipcount++; skipcount++;
} else if (skiprange_start > skiprange_end + 1) { } else if (skiprange_start > skiprange_end + 1) {
--skiprange_start; --skiprange_start;
@@ -4047,7 +4046,7 @@ short exploding_wand_typ;
else else
Norep("The water freezes."); Norep("The water freezes.");
newsym(x,y); newsym(x,y);
} else if(!Deaf && !lava) } else if(!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) {
@@ -4214,9 +4213,8 @@ short exploding_wand_typ;
newsym(x, y); newsym(x, y);
} else if (sense_txt) { } else if (sense_txt) {
You1(sense_txt); You1(sense_txt);
} else if (hear_txt) { } else if (hear_txt)
if (!Deaf) You_hear1(hear_txt); You_hear1(hear_txt);
}
if (picking_at(x, y)) { if (picking_at(x, y)) {
stop_occupation(); stop_occupation();
reset_pick(); reset_pick();