From: PatR Date: Mon, 12 Sep 2016 07:24:14 +0000 (-0700) Subject: fix #H4521 - distant squeak X-Git-Tag: NetHack-3.6.1_RC01~612 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b9a6f07c148be9b93592997814811d5711c26585;p=nethack fix #H4521 - distant squeak Vary the message about hearing a squeak when it is close. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index d4f6e6bfe..71425d6e8 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -338,6 +338,7 @@ change ing_suffix() to not double final 'w' when adding 'ing' ('t=' yielded "You mime throwwing something.") using 'D' to drop when not carrying anything finished (after doing nothing) without giving any feedback for menustyles "full" and "partial" +"you hear a distant squeak" might actually be nearby Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository diff --git a/src/trap.c b/src/trap.c index 4eec29df0..9e5b2f500 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 trap.c $NHDT-Date: 1464138044 2016/05/25 01:00:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.272 $ */ +/* NetHack 3.6 trap.c $NHDT-Date: 1473665044 2016/09/12 07:24:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.274 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2198,8 +2198,15 @@ register struct monst *mtmp; pline("%s stops momentarily and appears to cringe.", Monnam(mtmp)); } - } else - You_hear("a distant %s squeak.", trapnote(trap, 1)); + } else { + /* same near/far threshold as mzapmsg() */ + int range = couldsee(mtmp->mx, mtmp->my) /* 9 or 5 */ + ? (BOLT_LIM + 1) : (BOLT_LIM - 3); + + You_hear("a %s squeak %s.", trapnote(trap, 1), + (distu(mtmp->mx, mtmp->my) <= range * range) + ? "nearby" : "in the distance"); + } /* wake up nearby monsters */ wake_nearto(mtmp->mx, mtmp->my, 40); break;