]> granicus.if.org Git - nethack/commitdiff
fix github issue #490 - rolling boulder traps
authorPatR <rankin@nethack.org>
Sun, 18 Apr 2021 21:02:57 +0000 (14:02 -0700)
committerPatR <rankin@nethack.org>
Sun, 18 Apr 2021 21:02:57 +0000 (14:02 -0700)
Don't include "Click!" in the feedback when a rolling boulder
trap is triggered if the hero is deaf.  Some feedback based on
being able to see a monster be hit by a rolling boulder should
also be reported if the location can be seen and an invisible
monster can be sensed there.  Change "you hear rumbling in the
distance" to "you hear rumbling nearby" when unseen activity is
close.  If the boulder itself is visible when it starts to roll,
report seeing that instead of hearing rumbling.

Fixes #490

doc/fixes37.0
src/trap.c

index bf067b45252eeb11be08e85828831287b5c494ca..1ab56a4699e79f93dbb485db4398bf882c92d542 100644 (file)
@@ -469,6 +469,7 @@ when swallowed or underwater, player could be told about events (such as a
        shapechanger taking on a new form) that the hero sensed but which
        were not shown on the screen; treat being swallowed or underwater as
        situations which block telepathy, extended monster detection, warning
+some rolling boulder trap feedback was inconsistent
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index 2894c298bb90f2204211324e268d05bb907371b2..3eb2e6118b36fb90f216424e5af82e7ca96d2525 100644 (file)
@@ -2241,7 +2241,8 @@ trapeffect_rolling_boulder_trap(
         int style = ROLL | (trap->tseen ? LAUNCH_KNOWN : 0);
 
         feeltrap(trap);
-        pline("Click!  You trigger a rolling boulder trap!");
+        pline("%sYou trigger a rolling boulder trap!",
+              !Deaf ? "Click!  " : "");
         if (!launch_obj(BOULDER, trap->launch.x, trap->launch.y,
                         trap->launch2.x, trap->launch2.y, style)) {
             deltrap(trap);
@@ -2252,13 +2253,16 @@ trapeffect_rolling_boulder_trap(
         struct permonst *mptr = mtmp->data;
 
         if (!is_flyer(mptr)) {
-            boolean in_sight = canseemon(mtmp) || (mtmp == u.usteed);
+            boolean in_sight = (mtmp == u.usteed
+                                || (cansee(mtmp->mx, mtmp->my)
+                                    && canspotmon(mtmp)));
             int style = ROLL | (in_sight ? 0 : LAUNCH_UNSEEN);
             boolean trapkilled = FALSE;
 
             newsym(mtmp->mx, mtmp->my);
             if (in_sight)
-                pline("Click!  %s triggers %s.", Monnam(mtmp),
+                pline("%s%s triggers %s.",
+                      !Deaf ? "Click!  " : "", Monnam(mtmp),
                       trap->tseen ? "a rolling boulder trap" : something);
             if (launch_obj(BOULDER, trap->launch.x, trap->launch.y,
                            trap->launch2.x, trap->launch2.y, style)) {
@@ -2699,8 +2703,15 @@ launch_obj(
     switch (style) {
     case ROLL | LAUNCH_UNSEEN:
         if (otyp == BOULDER) {
-            You_hear(Hallucination ? "someone bowling."
-                                   : "rumbling in the distance.");
+            if (cansee(x1, y1)) {
+                You_see("%s start to roll.", an(xname(singleobj)));
+            } else if (Hallucination) {
+                You_hear("someone bowling.");
+            } else {
+                You_hear("rumbling %s.", (distu(x1, y1) <= 4 * 4) ? "nearby"
+                                         : "in the distance");
+            }
+
         }
         style &= ~LAUNCH_UNSEEN;
         goto roll;