]> granicus.if.org Git - nethack/commitdiff
Move movement tests
authorPasi Kallinen <paxed@alt.org>
Mon, 9 Aug 2021 13:13:09 +0000 (16:13 +0300)
committerPasi Kallinen <paxed@alt.org>
Mon, 9 Aug 2021 13:13:12 +0000 (16:13 +0300)
Rushing will go along a snaking corridor.

test/testmove.lua

index c5c3eee52750128930523f0f58f88321b17d4a6b..12d4a61ee060472dd0b5f235852986b97cb65470 100644 (file)
@@ -48,6 +48,18 @@ function setup3(param)
    des.replace_terrain({ region={01,01, 74,18}, fromterrain="C", toterrain=param, chance=100 });
 end
 
+function setup4(param)
+   local mapstr = [[
+------------
+|CCCC|CCC| |
+|---C|C|C|--
+|  |CCC|CCC|
+------------
+]];
+   des.map({ x = POS.x - 1, y = POS.y - 1, 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 },
@@ -122,6 +134,9 @@ local basicmoves = {
    { 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 = "#" },
 
+   { key = ctrl("l"), x = POS.x + 3, y = POS.y, number_pad = 0, setup = setup4, param = "." },
+   { key = ctrl("l"), x = POS.x + 9, y = POS.y + 2, number_pad = 0, setup = setup4, param = "#" },
+
 };