]> granicus.if.org Git - nethack/commitdiff
More movement tests
authorPasi Kallinen <paxed@alt.org>
Sun, 8 Aug 2021 16:30:56 +0000 (19:30 +0300)
committerPasi Kallinen <paxed@alt.org>
Sun, 8 Aug 2021 16:30:59 +0000 (19:30 +0300)
Rush behaves different in ROOM vs CORR; in corridors, it'll
turn 90 degrees, but will not go in the opposite direction
from when it started.

test/testmove.lua

index ba1896c30577e377c2eb6d6bf35ee41ffe2d5d8a..c5c3eee52750128930523f0f58f88321b17d4a6b 100644 (file)
@@ -35,6 +35,19 @@ function setup2(param)
    des.terrain(POS.x + 15, POS.y, param);
 end
 
+function setup3(param)
+   local mapstr = [[
+-------
+|CCCCC|
+|C---C|
+|C---C|
+|CCCCC|
+-------
+]];
+   des.map({ x = POS.x - 1, y = POS.y - 4, map = mapstr });
+   des.replace_terrain({ region={01,01, 74,18}, fromterrain="C", toterrain=param, chance=100 });
+end
+
 local basicmoves = {
    -- move
    h = { dx = -1,  dy =  0, number_pad = 0 },
@@ -103,6 +116,12 @@ local basicmoves = {
    { key = "L", x = nhc.COLNO - 2, y = POS.y, number_pad = 0, setup = setup2, param = "#" },
    { key = "L", x = nhc.COLNO - 2, y = POS.y, number_pad = 0, setup = setup2, param = "C" },
 
+   -- rush behaves differently in corridors vs in rooms
+   { key = ctrl("l"), x = POS.x + 4, y = POS.y, number_pad = 0, setup = setup3, param = "." },
+   { key = ctrl("l"), x = POS.x + 4, y = POS.y - 3, number_pad = 0, setup = setup3, param = "#" },
+   { key = ctrl("k"), x = POS.x, y = POS.y - 3, number_pad = 0, setup = setup3, param = "." },
+   { key = ctrl("k"), x = POS.x + 4, y = POS.y - 3, number_pad = 0, setup = setup3, param = "#" },
+
 };