Fix: "a dry rattle comes from its throat"

"A dry rattle comes from its throat" would be printed whenever a
canceled monster tried to spit at you or another monster while not in
the hero's line of sight.  That seemed weird to me: you can't see the
monster and don't know what it is, but you can tell the sound is
definitely coming from "its throat".

Change the message if the monster isn't visible, and make sure it's
printed it only if the monster is nearby (within reasonable hearing
range for a "dry rattle").
This commit is contained in:
Michael Meyer
2022-11-14 18:25:15 -05:00
committed by PatR
parent 3278d7e0c1
commit a0dfc94bbe

View File

@@ -826,9 +826,14 @@ spitmm(struct monst* mtmp, struct attack* mattk, struct monst* mtarg)
struct obj *otmp;
if (mtmp->mcan) {
if (!Deaf)
pline("A dry rattle comes from %s throat.",
s_suffix(mon_nam(mtmp)));
if (!Deaf && distu(mtmp->mx, mtmp->my) < BOLT_LIM * BOLT_LIM) {
if (canspotmon(mtmp)) {
pline("A dry rattle comes from %s throat.",
s_suffix(mon_nam(mtmp)));
} else {
You_hear("a dry rattle nearby.");
}
}
return MM_MISS;
}
if (m_lined_up(mtarg, mtmp)) {