improve Deaf messaging for minetown watch and shops

Changes to be committed:
	modified:   doc/fixes36.1
	modified:   src/fountain.c
	modified:   src/monmove.c
	modified:   src/shk.c

Fix for H4242, bz352
This commit is contained in:
nhmall
2016-02-13 17:29:15 -05:00
parent 860e7ee9c6
commit 5bb3e01424
4 changed files with 230 additions and 77 deletions

View File

@@ -152,6 +152,7 @@ vortexes and other unsolid monsters need not avoid webs
barbarian and samurai can achieve basic in their special spell's skill
scalpel and tsurugi can now split puddings; bashing with darts or arrows can't
jumping while punished could leave ball and chain in the wrong place
improve Deaf message handling for the minetown watch and shops
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 fountain.c $NHDT-Date: 1444937416 2015/10/15 19:30:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.55 $ */
/* NetHack 3.6 fountain.c $NHDT-Date: 1455402364 2016/02/13 22:26:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.56 $ */
/* Copyright Scott R. Turner, srt@ucla, 10/27/86 */
/* NetHack may be freely redistributed. See license for details. */
@@ -180,8 +180,18 @@ boolean isyou;
continue;
if (is_watch(mtmp->data) && couldsee(mtmp->mx, mtmp->my)
&& mtmp->mpeaceful) {
pline("%s yells:", Amonnam(mtmp));
verbalize("Hey, stop using that fountain!");
if (!Deaf) {
pline("%s yells:", Amonnam(mtmp));
verbalize("Hey, stop using that fountain!");
} else {
pline("%s earnestly %s %s %s!",
Amonnam(mtmp),
nolimbs(mtmp->data) ? "shakes" : "waves",
mhis(mtmp),
nolimbs(mtmp->data)
? mbodypart(mtmp, HEAD)
: makeplural(mbodypart(mtmp, ARM)));
}
break;
}
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 monmove.c $NHDT-Date: 1453371163 2016/01/21 10:12:43 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.83 $ */
/* NetHack 3.6 monmove.c $NHDT-Date: 1455402384 2016/02/13 22:26:24 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.84 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -56,11 +56,24 @@ mon_yells(mon, shout)
struct monst *mon;
const char *shout;
{
if (canspotmon(mon))
pline("%s yells:", Amonnam(mon));
else
You_hear("someone yell:");
verbalize1(shout);
if (Deaf) {
if (canspotmon(mon))
/* Sidenote on "A watchman angrily waves her arms!"
* Female being called watchman is correct (career name).
*/
pline("%s angrily %s %s %s!",
Amonnam(mon),
nolimbs(mon->data) ? "shakes" : "waves",
mhis(mon),
nolimbs(mon->data) ? mbodypart(mon, HEAD)
: makeplural(mbodypart(mon, ARM)));
} else {
if (canspotmon(mon))
pline("%s yells:", Amonnam(mon));
else
You_hear("someone yell:");
verbalize1(shout);
}
}
STATIC_OVL void

265
src/shk.c
View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 shk.c $NHDT-Date: 1454485431 2016/02/03 07:43:51 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.122 $ */
/* NetHack 3.6 shk.c $NHDT-Date: 1455402387 2016/02/13 22:26:27 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.123 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -80,6 +80,8 @@ STATIC_DCL const char *FDECL(cad, (BOOLEAN_P));
obj->quan <= bp->bquan
*/
static const char *angrytexts[] = {"quite upset", "ticked off", "furious"};
/*
* Transfer money from inventory to monster when paying
* shopkeepers, priests, oracle, succubus, and other demons.
@@ -418,9 +420,15 @@ boolean newlev;
* Player just stepped onto shop-boundary (known from above logic).
* Try to intimidate him into paying his bill
*/
verbalize(NOTANGRY(shkp) ? "%s! Please pay before leaving."
if (!Deaf && !muteshk(shkp))
verbalize(NOTANGRY(shkp) ? "%s! Please pay before leaving."
: "%s! Don't you leave without paying!",
plname);
plname);
else
pline("%s %s that you need to pay before leaving%s",
Shknam(shkp),
NOTANGRY(shkp) ? "points out" : "makes it clear",
NOTANGRY(shkp) ? "." : "!");
return;
}
@@ -564,21 +572,42 @@ char *enterstring;
if (Invis) {
pline("%s senses your presence.", shkname(shkp));
verbalize("Invisible customers are not welcome!");
if (!Deaf && !muteshk(shkp))
verbalize("Invisible customers are not welcome!");
else
pline("%s stands firm as if he knows you are there.", Shknam(shkp));
return;
}
rt = rooms[*enterstring - ROOMOFFSET].rtype;
if (ANGRY(shkp)) {
verbalize("So, %s, you dare return to %s %s?!", plname,
if (!Deaf && !muteshk(shkp))
verbalize("So, %s, you dare return to %s %s?!", plname,
s_suffix(shkname(shkp)), shtypes[rt - SHOPBASE].name);
else
pline("%s seems %s over your return to %s %s!",
Shknam(shkp),
angrytexts[rn2(SIZE(angrytexts))],
mhis(shkp),
shtypes[rt - SHOPBASE].name);
} else if (eshkp->robbed) {
pline("%s mutters imprecations against shoplifters.", shkname(shkp));
if (!Deaf)
pline("%s mutters imprecations against shoplifters.", shkname(shkp));
else
pline("%s is combing through %s inventory list.",
Shknam(shkp),
mhis(shkp));
} else {
verbalize("%s, %s! Welcome%s to %s %s!", Hello(shkp), plname,
eshkp->visitct++ ? " again" : "", s_suffix(shkname(shkp)),
shtypes[rt - SHOPBASE].name);
if (!Deaf && !muteshk(shkp))
verbalize("%s, %s! Welcome%s to %s %s!", Hello(shkp), plname,
eshkp->visitct++ ? " again" : "", s_suffix(shkname(shkp)),
shtypes[rt - SHOPBASE].name);
else
You("enter %s %s%s!",
s_suffix(shkname(shkp)),
shtypes[rt - SHOPBASE].name,
eshkp->visitct++ ? " again" : "");
}
/* can't do anything about blocking if teleported in */
if (!inside_shop(u.ux, u.uy)) {
@@ -608,15 +637,27 @@ char *enterstring;
if (!Blind)
makeknown(DWARVISH_MATTOCK);
}
verbalize(NOTANGRY(shkp)
? "Will you please leave your %s%s outside?"
: "Leave the %s%s outside.",
tool, plur(cnt));
if (!Deaf && !muteshk(shkp))
verbalize(NOTANGRY(shkp)
? "Will you please leave your %s%s outside?"
: "Leave the %s%s outside.",
tool, plur(cnt));
else
pline("%s %s to let you in with a %s%s.",
Shknam(shkp),
NOTANGRY(shkp) ? "is hesitant" : "refuses",
tool, plur(cnt));
should_block = TRUE;
} else if (u.usteed) {
verbalize(NOTANGRY(shkp) ? "Will you please leave %s outside?"
if (!Deaf && !muteshk(shkp))
verbalize(NOTANGRY(shkp) ? "Will you please leave %s outside?"
: "Leave %s outside.",
y_monnam(u.usteed));
else
pline("%s %s to let you in while you're riding %s.",
Shknam(shkp),
NOTANGRY(shkp) ? "doesn't want" : "refuses",
y_monnam(u.usteed));
should_block = TRUE;
} else {
should_block =
@@ -639,14 +680,21 @@ struct obj *obj;
if (obj->unpaid || !is_pick(obj))
return;
shkp = shop_keeper(*u.ushops);
if (shkp && inhishop(shkp) && !muteshk(shkp)) {
if (shkp && inhishop(shkp)) {
static NEARDATA long pickmovetime = 0L;
/* if you bring a sack of N picks into a shop to sell,
don't repeat this N times when they're taken out */
if (moves != pickmovetime)
verbalize("You sneaky %s! Get out of here with that pick!",
if (moves != pickmovetime) {
if (!Deaf && !muteshk(shkp))
verbalize("You sneaky %s! Get out of here with that pick!",
cad(FALSE));
else
pline("%s %s your pick!",
Shknam(shkp),
haseyes(shkp->data) ? "glares at"
: "is dismayed because of");
}
pickmovetime = moves;
}
}
@@ -1475,9 +1523,16 @@ proceed:
if (!itemize)
update_inventory(); /* Done in dopayobj() if itemize. */
}
if (!ANGRY(shkp) && paid && !muteshk(shkp))
verbalize("Thank you for shopping in %s %s!", s_suffix(shkname(shkp)),
if (!ANGRY(shkp) && paid) {
if (!Deaf && !muteshk(shkp))
verbalize("Thank you for shopping in %s %s!", s_suffix(shkname(shkp)),
shtypes[eshkp->shoptype - SHOPBASE].name);
else
pline("%s nods appreciatively at you for shopping in %s %s!",
Shknam(shkp),
mhis(shkp),
shtypes[eshkp->shoptype - SHOPBASE].name);
}
return 1;
}
@@ -1539,10 +1594,18 @@ boolean itemize;
buy = PAY_SKIP; /* don't want to buy */
} else if (quan < bp->bquan && !consumed) { /* partly used goods */
obj->quan = bp->bquan - save_quan; /* used up amount */
verbalize("%s for the other %s before buying %s.",
if (!Deaf && !muteshk(shkp)) {
verbalize("%s for the other %s before buying %s.",
ANGRY(shkp) ? "Pay" : "Please pay",
simpleonames(obj), /* short name suffices */
save_quan > 1L ? "these" : "this one");
} else {
pline("%s %s%s your bill for the other %s first.",
Shknam(shkp),
ANGRY(shkp) ? "angrily " : "",
nolimbs(shkp->data) ? "motions to" : "points out",
simpleonames(obj));
}
buy = PAY_SKIP; /* shk won't sell */
}
}
@@ -2122,16 +2185,28 @@ boolean quietly;
&& obj->otyp == CANDELABRUM_OF_INVOCATION) {
if (!quietly) {
if (is_izchak(shkp, TRUE) && !u.uevent.invoked) {
verbalize("No thanks, I'd hang onto that if I were you.");
if (obj->spe < 7)
verbalize(
"You'll need %d%s candle%s to go along with it.",
(7 - obj->spe), (obj->spe > 0) ? " more" : "",
plur(7 - obj->spe));
/* [what if hero is already carrying enough candles?
should Izchak explain how to attach them instead?] */
if (Deaf || muteshk(shkp)) {
pline("%s seems %s that you want to sell that.",
Shknam(shkp),
(obj->spe < 7) ? "horrified" : "concerned");
} else {
verbalize("No thanks, I'd hang onto that if I were you.");
if (obj->spe < 7)
verbalize(
"You'll need %d%s candle%s to go along with it.",
(7 - obj->spe), (obj->spe > 0) ? " more" : "",
plur(7 - obj->spe));
/* [what if hero is already carrying enough candles?
should Izchak explain how to attach them instead?] */
}
} else {
verbalize("I won't stock that. Take it out of here!");
if (!Deaf && !muteshk(shkp))
verbalize("I won't stock that. Take it out of here!");
else
pline("%s shakes %s %s in refusal.",
Shknam(shkp),
mhis(shkp),
mbodypart(shkp, HEAD));
}
}
return TRUE;
@@ -2449,7 +2524,7 @@ boolean ininv, dummy, silent;
contentscount = 0;
}
if (!muteshk(shkp) && !silent) {
if (!Deaf && !muteshk(shkp) && !silent) {
char buf[BUFSZ];
if (!ltmp) {
@@ -2827,8 +2902,10 @@ xchar x, y;
eshkp = ESHK(shkp);
if (ANGRY(shkp)) { /* they become shop-objects, no pay */
if (!muteshk(shkp))
if (!Deaf && !muteshk(shkp))
verbalize("Thank you, scum!");
else
pline("%s smirks with satisfaction.", Shknam(shkp));
subfrombill(obj, shkp);
return;
}
@@ -2840,7 +2917,7 @@ xchar x, y;
offer += cgold;
if ((eshkp->robbed -= offer < 0L))
eshkp->robbed = 0L;
if (offer && !muteshk(shkp))
if (offer && !Deaf && !muteshk(shkp))
verbalize(
"Thank you for your contribution to restock this recently plundered shop.");
subfrombill(obj, shkp);
@@ -3171,7 +3248,7 @@ register xchar x, y;
&& dist2(shkp->mx, shkp->my, x, y) < 3
/* if it is the shk's pos, you hit and anger him */
&& (shkp->mx != x || shkp->my != y)) {
if (mnearto(shkp, x, y, TRUE) && !muteshk(shkp))
if (mnearto(shkp, x, y, TRUE) && !Deaf && !muteshk(shkp))
verbalize("Out of my way, scum!");
if (cansee(x, y)) {
pline("%s nimbly%s catches %s.", Shknam(shkp),
@@ -3440,7 +3517,7 @@ boolean catchup; /* restoring a level */
*
* Take the easy way out and put ball&chain under hero.
*/
if (!muteshk(shkp))
if (!Deaf && !muteshk(shkp))
verbalize("Get your junk out of my wall!");
unplacebc(); /* pick 'em up */
placebc(); /* put 'em down */
@@ -3518,16 +3595,21 @@ register struct monst *shkp;
}
if (eshkp->following) {
if (strncmp(eshkp->customer, plname, PL_NSIZ)) {
if (!muteshk(shkp))
if (!Deaf && !muteshk(shkp))
verbalize("%s, %s! I was looking for %s.", Hello(shkp),
plname, eshkp->customer);
eshkp->following = 0;
return 0;
}
if (moves > followmsg + 4) {
if (!muteshk(shkp))
if (!Deaf && !muteshk(shkp))
verbalize("%s, %s! Didn't you forget to pay?",
Hello(shkp), plname);
else
pline("%s holds out %s upturned %s.",
Shknam(shkp),
mhis(shkp),
mbodypart(shkp, HAND));
followmsg = moves;
if (!rn2(9)) {
pline("%s doesn't like customers who don't pay.",
@@ -3653,13 +3735,15 @@ register int fall;
if (!fall) {
if (lang == 2) {
if (u.utraptype == TT_PIT)
verbalize(
"Be careful, %s, or you might fall through the floor.",
flags.female ? "madam" : "sir");
else
verbalize("%s, do not damage the floor here!",
flags.female ? "Madam" : "Sir");
if (!Deaf && !muteshk(shkp)) {
if (u.utraptype == TT_PIT)
verbalize(
"Be careful, %s, or you might fall through the floor.",
flags.female ? "madam" : "sir");
else
verbalize("%s, do not damage the floor here!",
flags.female ? "Madam" : "Sir");
}
}
if (Role_if(PM_KNIGHT)) {
You_feel("like a common thief.");
@@ -3846,9 +3930,11 @@ boolean cant_mollify;
* yanked the hapless critter out of the way.
*/
if (MON_AT(x, y)) {
if (!Deaf && !animal) {
You_hear("an angry voice:");
verbalize("Out of my way, scum!");
if (!animal) {
if (!Deaf && !muteshk(shkp)) {
You_hear("an angry voice:");
verbalize("Out of my way, scum!");
}
wait_synch();
#if defined(UNIX) || defined(VMS)
#if defined(SYSV) || defined(ULTRIX) || defined(VMS)
@@ -3871,12 +3957,28 @@ boolean cant_mollify;
if (animal && shkp->mcanmove && !shkp->msleeping)
yelp(shkp);
} else if (pursue || uinshp || !um_dist(x, y, 1)) {
verbalize("How dare you %s my %s?", dmgstr,
if (!Deaf)
verbalize("How dare you %s my %s?", dmgstr,
dugwall ? "shop" : "door");
else
pline("%s is %s that you decided to %s %s %s!",
Shknam(shkp),
angrytexts[rn2(SIZE(angrytexts))],
dmgstr, mhis(shkp),
dugwall ? "shop" : "door");
} else {
pline("%s shouts:", shkname(shkp));
verbalize("Who dared %s my %s?", dmgstr,
dugwall ? "shop" : "door");
if (!Deaf) {
pline("%s shouts:", shkname(shkp));
verbalize("Who dared %s my %s?", dmgstr,
dugwall ? "shop" : "door");
} else {
pline("%s is %s that someone decided to %s %s %s!",
Shknam(shkp),
angrytexts[rn2(SIZE(angrytexts))],
dmgstr,
mhis(shkp),
dugwall ? "shop" : "door");
}
}
hot_pursuit(shkp);
return;
@@ -3896,9 +3998,16 @@ boolean cant_mollify;
home_shk(shkp, FALSE);
pacify_shk(shkp);
} else {
if (!animal)
verbalize("Oh, yes! You'll pay!");
else
if (!animal) {
if (!Deaf && !muteshk(shkp))
verbalize("Oh, yes! You'll pay!");
else
pline("%s lunges %s %s toward your %s!",
Shknam(shkp),
mhis(shkp),
mbodypart(shkp, HAND),
body_part(NECK));
} else
growl(shkp);
hot_pursuit(shkp);
adjalign(-sgn(u.ualign.type));
@@ -4074,38 +4183,58 @@ struct monst *shkp;
eshk = ESHK(shkp);
if (ANGRY(shkp)) {
pline("%s mentions how much %s dislikes %s customers.",
shkname(shkp), mhe(shkp), eshk->robbed ? "non-paying" : "rude");
pline("%s %s how much %s dislikes %s customers.",
shkname(shkp),
(!Deaf && !muteshk(shkp)) ? "mentions" : "indicates",
mhe(shkp), eshk->robbed ? "non-paying" : "rude");
} else if (eshk->following) {
if (strncmp(eshk->customer, plname, PL_NSIZ)) {
verbalize("%s %s! I was looking for %s.",
if (!Deaf && !muteshk(shkp))
verbalize("%s %s! I was looking for %s.",
Hello(shkp), plname, eshk->customer);
eshk->following = 0;
} else {
verbalize("%s %s! Didn't you forget to pay?",
Hello(shkp), plname);
if (!Deaf && !muteshk(shkp))
verbalize("%s %s! Didn't you forget to pay?",
Hello(shkp), plname);
else
pline("%s taps you on the %s.",
Shknam(shkp), body_part(ARM));
}
} else if (eshk->billct) {
register long total = addupbill(shkp) + eshk->debit;
pline("%s says that your bill comes to %ld %s.",
shkname(shkp), total, currency(total));
pline("%s %s that your bill comes to %ld %s.",
shkname(shkp),
(!Deaf && !muteshk(shkp)) ? "says" : "indicates",
total, currency(total));
} else if (eshk->debit) {
pline("%s reminds you that you owe %s %ld %s.",
shkname(shkp), mhim(shkp), eshk->debit, currency(eshk->debit));
pline("%s %s that you owe %s %ld %s.",
shkname(shkp),
(!Deaf && !muteshk(shkp)) ? "reminds you" : "indicates",
mhim(shkp), eshk->debit, currency(eshk->debit));
} else if (eshk->credit) {
pline("%s encourages you to use your %ld %s of credit.",
shkname(shkp), eshk->credit, currency(eshk->credit));
} else if (eshk->robbed) {
pline("%s complains about a recent robbery.", shkname(shkp));
pline("%s %s about a recent robbery.",
Shknam(shkp),
(!Deaf && !muteshk(shkp)) ? "complains" : "indicates concern");
} else if ((shkmoney = money_cnt(shkp->minvent)) < 50) {
pline("%s complains that business is bad.", shkname(shkp));
pline("%s %s that business is bad.",
shkname(shkp),
(!Deaf && !muteshk(shkp)) ? "complains" : "indicates");
} else if (shkmoney > 4000) {
pline("%s says that business is good.", shkname(shkp));
pline("%s %s that business is good.",
shkname(shkp),
(!Deaf && !muteshk(shkp)) ? "says" : "indicates");
} else if (is_izchak(shkp, FALSE)) {
pline(Izchak_speaks[rn2(SIZE(Izchak_speaks))], shkname(shkp));
if (!Deaf && !muteshk(shkp))
pline(Izchak_speaks[rn2(SIZE(Izchak_speaks))], shkname(shkp));
} else {
pline("%s talks about the problem of shoplifters.", shkname(shkp));
if (!Deaf && !muteshk(shkp))
pline("%s talks about the problem of shoplifters.", shkname(shkp));
}
}
@@ -4229,7 +4358,7 @@ boolean altusage;
arg2 = "Ahem. ";
}
if (!muteshk(shkp)) {
if (!Deaf && !muteshk(shkp)) {
verbalize(fmt, arg1, arg2, tmp, currency(tmp));
exercise(A_WIS, TRUE); /* you just got info */
}