Skip to content
Snippets Groups Projects
Commit eaec4264 authored by dg's avatar dg
Browse files

Slime Tunnels generator will not validate the level unless the 4 pedestals are present

git-svn-id: http://svn.net-core.org/repos/t-engine4@6419 51575b47-30f0-44d4-a5cc-537603b46e54
parent 5940474d
No related branches found
No related tags found
No related merge requests found
......@@ -49,4 +49,23 @@ return {
nb_object = {4, 10},
},
},
post_process = function(level, zone)
-- Make sure we have all pedestals
local dragon, undead, elements, destruction = nil, nil, nil, nil
for x = 0, level.map.w - 1 do for y = 0, level.map.h - 1 do
local g = level.map(x, y, level.map.TERRAIN)
if g then
if g.define_as == "ORB_DRAGON" then dragon = g
elseif g.define_as == "ORB_DESTRUCTION" then destruction = g
elseif g.define_as == "ORB_ELEMENTS" then elements = g
elseif g.define_as == "ORB_UNDEATH" then undead = g
end
end
end end
if not dragon or not undead or not elements or not destruction then
print("Slime Tunnels generated with too few pedestals!", dragon, undead, elements, destruction)
level.force_recreate = true
end
end,
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment