254 |
floorcell = cell{floor={face=floorface}} |
floorcell = cell{floor={face=floorface}} |
255 |
|
|
256 |
cells={} |
cells={} |
257 |
|
stonecells={} |
258 |
|
|
259 |
cells["!"] = cell{parent = {set_spacecell}} |
cells["!"] = cell{parent = {set_spacecell}} |
260 |
cells[" "] = floorcell |
cells[" "] = floorcell |
261 |
cells["_"] = floorcell |
cells["_"] = floorcell |
262 |
cells["x"] = floorcell |
cells["x"] = floorcell |
263 |
cells["#"] = cell{parent = floorcell, stone = {face = wallface}} |
cells["#"] = cell{parent = floorcell, stone = {face = wallface}} |
264 |
|
|
265 |
cells["o"] = cell{parent = floorcell, stone = {face = boxface}} |
-- cells["o"] = cell{parent = floorcell, stone = {face = boxface}} |
266 |
|
cells["o"] = floorcell |
267 |
cells["."] = cell{parent = {floorcell, set_soko_trigger}} |
cells["."] = cell{parent = {floorcell, set_soko_trigger}} |
268 |
cells["@"] = cell{parent = {floorcell, set_the_actor}} |
cells["@"] = cell{parent = {floorcell, set_the_actor}} |
269 |
|
|
270 |
cells["*"] = cell{parent = {cells["o"], set_soko_trigger}} |
-- cells["*"] = cell{parent = {cells["o"], set_soko_trigger}} |
271 |
|
cells["*"] = cells["."] |
272 |
cells["+"] = cell{parent = {floorcell, set_actor_on_trigger}} |
cells["+"] = cell{parent = {floorcell, set_actor_on_trigger}} |
273 |
|
|
274 |
|
stonecells["!"] = cell{} |
275 |
|
stonecells[" "] = cell{} |
276 |
|
stonecells["_"] = cell{} |
277 |
|
stonecells["x"] = cell{} |
278 |
|
stonecells["#"] = cell{} |
279 |
|
stonecells["o"] = cell{parent={floorcell},stone = {face = boxface}} |
280 |
|
stonecells["."] = cell{} |
281 |
|
stonecells["@"] = cell{} |
282 |
|
stonecells["*"] = stonecells["o"] |
283 |
|
stonecells["+"] = cell{} |
284 |
|
|
285 |
end |
end |
286 |
|
|
287 |
-- wether there's space outside the level |
-- wether there's space outside the level |
490 |
debug("maxoxyds="..maxoxyds.." want_remove="..want_remove); |
debug("maxoxyds="..maxoxyds.." want_remove="..want_remove); |
491 |
end |
end |
492 |
|
|
493 |
if (mod(positions-want_remove,2)==1) then want_remove = want_remove-1 end |
if (mod(positions-want_remove,2)==1) then want_remove = want_remove+1 end |
494 |
|
|
495 |
debug("positions="..positions.." want_remove="..want_remove); |
debug("positions="..positions.." want_remove="..want_remove); |
496 |
|
|
791 |
end |
end |
792 |
|
|
793 |
if (ok==0) then |
if (ok==0) then |
794 |
-- error("Sorry - couldn't correct door positions. Avoiding deadlock (try again)"); |
error("Sorry - couldn't correct door positions. Avoiding deadlock (try again)"); |
795 |
end |
end |
796 |
|
|
797 |
triggerstate = strrep("0",triggers) |
triggerstate = strrep("0",triggers) |
798 |
display.SetFollowMode(display.FOLLOW_SCROLLING) |
display.SetFollowMode(display.FOLLOW_SCROLLING) |
799 |
|
|
800 |
|
draw_map(xlo,ylo,level,stonecells) |
801 |
set_actor("ac-blackball",acx,acy,{player=0}) |
set_actor("ac-blackball",acx,acy,{player=0}) |
802 |
end |
end |
803 |
|
|