From: Pasi Kallinen Date: Sun, 8 Aug 2021 16:30:56 +0000 (+0300) Subject: More movement tests X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5b617eaca4aa09b430019c81f3d7ae779235317;p=nethack More movement tests 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. --- diff --git a/test/testmove.lua b/test/testmove.lua index ba1896c30..c5c3eee52 100644 --- a/test/testmove.lua +++ b/test/testmove.lua @@ -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 = "#" }, + };