From a0dfc94bbee77db881eebb11e1a5e5567ab373dd Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Mon, 14 Nov 2022 18:25:15 -0500 Subject: [PATCH] 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"). --- src/mthrowu.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mthrowu.c b/src/mthrowu.c index 780509528..831dd034c 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -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)) {