]> granicus.if.org Git - nethack/commitdiff
Make ray bounceback depend on the wall type.
authorPasi Kallinen <paxed@alt.org>
Sat, 11 Jun 2016 19:26:22 +0000 (22:26 +0300)
committerPasi Kallinen <paxed@alt.org>
Sat, 11 Jun 2016 19:26:27 +0000 (22:26 +0300)
src/zap.c

index 10fa3bc3aba5bd0e6f6ca5a20aaa7cd5692211e5..dfd1ee72b3de4a942a8c2dfebab3fe377340d6cd 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -4071,11 +4071,14 @@ boolean say; /* Announce out of sight hit/miss events if true */
 
         if (!ZAP_POS(levl[sx][sy].typ)
             || (closed_door(sx, sy) && range >= 0)) {
-            int bounce;
+            int bounce, bchance;
             uchar rmn;
             boolean fireball;
 
         make_bounce:
+            bchance = (levl[sx][sy].typ == STONE) ? 10
+                : (In_mines(&u.uz) && IS_WALL(levl[sx][sy].typ)) ? 20
+                : 75;
             bounce = 0;
             fireball = (type == ZT_SPELL(ZT_FIRE));
             if ((--range > 0 && isok(lsx, lsy) && cansee(lsx, lsy))
@@ -4092,7 +4095,7 @@ boolean say; /* Announce out of sight hit/miss events if true */
                 } else
                     pline_The("%s bounces!", fltxt);
             }
-            if (!dx || !dy || !rn2(20)) {
+            if (!dx || !dy || !rn2(bchance)) {
                 dx = -dx;
                 dy = -dy;
             } else {