Lua: coordinate tweaking

Make selection rndcoord return a table with x and y keys.
Allow (most) coordinate parameters accept such a table.
Fix selection and des lua tests broken by the above changes and
an earlier change, because selections tried to set terrain
at column 0, and it now causes a complaint.
This commit is contained in:
Pasi Kallinen
2022-03-22 09:16:15 +02:00
parent 6fb0c8a82e
commit 27898340b9
19 changed files with 240 additions and 173 deletions

View File

@@ -59,9 +59,9 @@ for i=1,2 do
end
-- extra monsters; was [6 + 3d4] when both wings were opened up at once
for i=1,3 + math.random(2 - 1,2*3) do
des.monster({ id="Angel", coord = { hall:rndcoord(1) }, align="noalign", peaceful=0 })
des.monster({ id="Angel", coord = hall:rndcoord(1), align="noalign", peaceful=0 })
if percent(50) then
des.monster({ coord = { hall:rndcoord(1) }, peaceful=0 })
des.monster({ coord = hall:rndcoord(1), peaceful=0 })
end
end
end
@@ -110,7 +110,7 @@ des.monster({ id = "aligned cleric",x=19,y=09,align="noalign", peaceful=0 })
des.monster({ id = "aligned cleric",x=19,y=10,align="noalign", peaceful=0 })
des.monster({ id = "Angel",x=20,y=09,align="noalign", peaceful=0 })
des.monster({ id = "Angel",x=20,y=10,align="noalign", peaceful=0 })
des.monster({ id = "Pestilence", coord = { place:rndcoord(1) }, peaceful=0 })
des.monster({ id = "Pestilence", coord = place:rndcoord(1), peaceful=0 })
-- South-central round room
des.monster({ id = "aligned cleric",x=36,y=12,align="noalign", peaceful=0 })
des.monster({ id = "aligned cleric",x=37,y=12,align="noalign", peaceful=0 })
@@ -118,7 +118,7 @@ des.monster({ id = "aligned cleric",x=38,y=12,align="noalign", peaceful=0 })
des.monster({ id = "aligned cleric",x=36,y=13,align="noalign", peaceful=0 })
des.monster({ id = "Angel",x=38,y=13,align="noalign", peaceful=0 })
des.monster({ id = "Angel",x=37,y=13,align="noalign", peaceful=0 })
des.monster({ id = "Death", coord = { place:rndcoord(1) }, peaceful=0 })
des.monster({ id = "Death", coord = place:rndcoord(1), peaceful=0 })
-- East round room
des.monster({ id = "aligned cleric",x=56,y=09,align="noalign", peaceful=0 })
des.monster({ id = "aligned cleric",x=55,y=08,align="noalign", peaceful=0 })
@@ -126,7 +126,7 @@ des.monster({ id = "aligned cleric",x=55,y=09,align="noalign", peaceful=0 })
des.monster({ id = "aligned cleric",x=55,y=10,align="noalign", peaceful=0 })
des.monster({ id = "Angel",x=54,y=09,align="noalign", peaceful=0 })
des.monster({ id = "Angel",x=54,y=10,align="noalign", peaceful=0 })
des.monster({ id = "Famine", coord = { place:rndcoord(1) }, peaceful=0 })
des.monster({ id = "Famine", coord = place:rndcoord(1), peaceful=0 })
--
-- The aligned horde
--