Allow coord in place of x and y in special level lua script
This commit is contained in:
@@ -148,6 +148,7 @@ end
|
||||
function test_engraving()
|
||||
des.engraving({02,04},"engrave","Trespassers will be persecuted!")
|
||||
des.engraving({ x = 1, y = 2, type = "burn", text = "Elbereth" });
|
||||
des.engraving({ coord = {1, 3}, type = "burn", text = "Elbereth" });
|
||||
des.engraving({ type = "dust", text = "X marks the spot." })
|
||||
des.engraving({ text = "Foobar" })
|
||||
des.engraving({ type = "mark", text = "X" })
|
||||
@@ -161,8 +162,10 @@ end
|
||||
|
||||
function test_grave()
|
||||
des.grave();
|
||||
des.grave(39,10, "Foo is here");
|
||||
des.grave({ text = "Lil Miss Marker" });
|
||||
des.grave({ x = 40, y = 11 });
|
||||
des.grave({ coord = {40, 12} });
|
||||
des.grave({ x = 41, y = 12, text = "Bongo" });
|
||||
des.grave({ x = 42, y = 13, text = "" });
|
||||
end
|
||||
@@ -194,6 +197,19 @@ FFF]] })
|
||||
check_loc_name(x, y, nam);
|
||||
end
|
||||
end
|
||||
des.map({ coord = {60, 5}, map = [[
|
||||
...
|
||||
.T.
|
||||
...]] })
|
||||
for x = 60, 62 do
|
||||
for y = 5, 7 do
|
||||
local nam = "room";
|
||||
if (x == 61 and y == 6) then
|
||||
nam = "tree";
|
||||
end
|
||||
check_loc_name(x, y, nam);
|
||||
end
|
||||
end
|
||||
des.map({ halign = "left", valign = "bottom", map = [[
|
||||
III
|
||||
.I.
|
||||
@@ -207,11 +223,14 @@ function test_feature()
|
||||
check_loc_name(41 + 1, 08, "sink");
|
||||
des.feature({ type = "pool", x = 42, y = 08 });
|
||||
check_loc_name(42 + 1, 08, "pool");
|
||||
des.feature({ type = "sink", coord = {43, 08} });
|
||||
check_loc_name(43 + 1, 08, "sink");
|
||||
end
|
||||
|
||||
function test_gold()
|
||||
des.gold({ amount = 999, x = 40, y = 07 });
|
||||
des.gold();
|
||||
des.gold({ amount = 999, x = 40, y = 07 });
|
||||
des.gold({ amount = 999, coord = {40, 08} });
|
||||
des.gold(666, 41,07);
|
||||
des.gold(123, {42,07});
|
||||
end
|
||||
@@ -265,6 +284,7 @@ end
|
||||
function test_door()
|
||||
des.door("nodoor", 12,12);
|
||||
des.door({ x = 13, y = 12, state = "open" });
|
||||
des.door({ coord = {14, 12}, state = "open" });
|
||||
des.room({ type = "graveyard", contents = function()
|
||||
des.door({ wall = "north", pos = 1 });
|
||||
des.door({ wall = "random", state = "locked" });
|
||||
@@ -280,6 +300,10 @@ function test_mazewalk()
|
||||
des.reset_level();
|
||||
des.level_init({ style = "mazegrid", bg ="-" });
|
||||
des.mazewalk({ x=2,y=10, dir="north", typ="L", stocked=true });
|
||||
|
||||
des.reset_level();
|
||||
des.level_init({ style = "mazegrid", bg ="-" });
|
||||
des.mazewalk({ coord={2,10}, dir="north", typ="L", stocked=true });
|
||||
end
|
||||
|
||||
function test_room()
|
||||
@@ -291,6 +315,7 @@ function test_room()
|
||||
des.room({ x=4, y=3, w=3,h=3 });
|
||||
end
|
||||
});
|
||||
des.room({ type=" ordinary", coord={3, 3}, w=3, h=3 });
|
||||
des.room();
|
||||
des.room({ contents = function()
|
||||
des.object();
|
||||
@@ -333,6 +358,9 @@ function test_terrain()
|
||||
des.terrain({ x = 5, y = 5, typ = "L" });
|
||||
is_map_at(5,5, "L");
|
||||
|
||||
des.terrain({ coord = {5, 5}, typ = "T" });
|
||||
is_map_at(5,5, "T");
|
||||
|
||||
-- TODO: allow lit = false
|
||||
-- des.terrain({ x = 5, y = 5, typ = ".", lit = false });
|
||||
-- is_map_at(5,5, ".", false);
|
||||
|
||||
Reference in New Issue
Block a user