pull request #942 - shopkeeper chat changes

Pull request from entrez:  change some pline() messages to verbalize()
and re-enable some chat feedback given when a shopkeeper is poly'd
into some form that can't speak.

Closes #942
This commit is contained in:
PatR
2022-12-31 12:42:52 -08:00
2 changed files with 13 additions and 8 deletions
+5 -5
View File
@@ -4582,7 +4582,7 @@ shop_object(register coordxy x, register coordxy y)
break; break;
/* note: otmp might have ->no_charge set, but that's ok */ /* note: otmp might have ->no_charge set, but that's ok */
return (otmp && costly_spot(x, y) return (otmp && costly_spot(x, y)
&& NOTANGRY(shkp) && !helpless(shkp)) && NOTANGRY(shkp) && !muteshk(shkp))
? otmp ? otmp
: (struct obj *) 0; : (struct obj *) 0;
} }
@@ -4628,15 +4628,15 @@ price_quote(register struct obj* first_obj)
} else if (cnt == 1) { } else if (cnt == 1) {
if (!cost) { if (!cost) {
/* "<doname(obj)>, no charge" */ /* "<doname(obj)>, no charge" */
pline("%s!", upstart(buf)); /* buf still contains the string */ verbalize("%s!", upstart(buf)); /* buf contains the string */
} else { } else {
/* print cost in slightly different format, so can't reuse buf; /* print cost in slightly different format, so can't reuse buf;
cost and contentsonly are already set up */ cost and contentsonly are already set up */
Sprintf(buf, "%s%s", contentsonly ? the_contents_of : "", Sprintf(buf, "%s%s", contentsonly ? the_contents_of : "",
doname(first_obj)); doname(first_obj));
pline("%s, price %ld %s%s%s", upstart(buf), cost, currency(cost), verbalize("%s, price %ld %s%s%s", upstart(buf), cost,
(first_obj->quan > 1L) ? " each" : "", currency(cost), (first_obj->quan > 1L) ? " each" : "",
contentsonly ? "." : shk_embellish(first_obj, cost)); contentsonly ? "." : shk_embellish(first_obj, cost));
} }
} }
destroy_nhwindow(tmpwin); destroy_nhwindow(tmpwin);
+8 -3
View File
@@ -608,7 +608,9 @@ domonnoise(register struct monst* mtmp)
/* presumably nearness and sleep checks have already been made */ /* presumably nearness and sleep checks have already been made */
if (Deaf) if (Deaf)
return ECMD_OK; return ECMD_OK;
if (is_silent(ptr)) if (is_silent(ptr)
/* shk_chat can handle nonverbal monsters */
&& !mtmp->isshk)
return ECMD_OK; return ECMD_OK;
/* leader might be poly'd; if he can still speak, give leader speech */ /* leader might be poly'd; if he can still speak, give leader speech */
@@ -617,13 +619,16 @@ domonnoise(register struct monst* mtmp)
/* make sure it's your role's quest guardian; adjust if not */ /* make sure it's your role's quest guardian; adjust if not */
else if (msound == MS_GUARDIAN && ptr != &mons[gu.urole.guardnum]) else if (msound == MS_GUARDIAN && ptr != &mons[gu.urole.guardnum])
msound = mons[genus(monsndx(ptr), 1)].msound; msound = mons[genus(monsndx(ptr), 1)].msound;
/* even polymorphed, shopkeepers retain their minds and capitalist bent */
else if (mtmp->isshk)
msound = MS_SELL;
/* some normally non-speaking types can/will speak if hero is similar */ /* some normally non-speaking types can/will speak if hero is similar */
else if (msound == MS_ORC else if (msound == MS_ORC
&& ((same_race(ptr, gy.youmonst.data) /* current form, */ && ((same_race(ptr, gy.youmonst.data) /* current form, */
|| same_race(ptr, &mons[Race_switch])) /* unpoly'd form */ || same_race(ptr, &mons[Race_switch])) /* unpoly'd form */
|| Hallucination)) || Hallucination))
msound = MS_HUMANOID; msound = MS_HUMANOID;
/* silliness, with slight chance to interfere with shopping */ /* silliness; formerly had a slight chance to interfere with shopping */
else if (Hallucination && mon_is_gecko(mtmp)) else if (Hallucination && mon_is_gecko(mtmp))
msound = MS_SELL; msound = MS_SELL;
@@ -645,7 +650,7 @@ domonnoise(register struct monst* mtmp)
quest_chat(mtmp); quest_chat(mtmp);
break; break;
case MS_SELL: /* pitch, pay, total */ case MS_SELL: /* pitch, pay, total */
if (!Hallucination || (mtmp->isshk && !rn2(2))) { if (!Hallucination || is_silent(ptr) || (mtmp->isshk && !rn2(2))) {
shk_chat(mtmp); shk_chat(mtmp);
} else { } else {
/* approximation of GEICO's advertising slogan (it actually /* approximation of GEICO's advertising slogan (it actually