fix #H4521 - distant squeak
authorPatR <rankin@nethack.org>
Mon, 12 Sep 2016 07:24:14 +0000 (00:24 -0700)
committerPatR <rankin@nethack.org>
Mon, 12 Sep 2016 07:24:14 +0000 (00:24 -0700)
Vary the message about hearing a squeak when it is close.

doc/fixes36.1
src/trap.c

index d4f6e6bfe4ecf387b92b6b2fcf14dd9fe425eec7..71425d6e892c01051452cc0226816b4f153e6d8b 100644 (file)
@@ -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 <musical note> squeak" might actually be nearby
 
 
 Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
index 4eec29df094bfdb05ae5b867468b1e60f1c11968..9e5b2f500577ebeb4268242477fa1fa1093e2bc5 100644 (file)
@@ -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;