When a special level is created, there's a chance it gets flipped horizontally and/or vertically. Add new level flags "noflip", "noflipx", and "noflipy" to prevent flipping the level. Add a wiz-mode command #wizlevelflip to test the flipping on current level - although this doesn't flip everything, as level flipping is meant to happen during level creation.
58 lines
2.2 KiB
Lua
58 lines
2.2 KiB
Lua
|
|
des.level_init({ style = "solidfill", fg = " " });
|
|
des.level_flags("mazelevel", "noflip");
|
|
|
|
des.map([[
|
|
---------------------------------------------------------------------------
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
---------------------------------------------------------------------------
|
|
]]);
|
|
-- Dungeon Description
|
|
des.region(selection.area(01,01,73,16),"lit");
|
|
|
|
local choice = math.random(0, 3)
|
|
if choice == 0 then
|
|
des.region(selection.area(01,07,22,09),"unlit");
|
|
des.region(selection.area(24,01,50,05),"unlit");
|
|
des.region(selection.area(24,11,50,16),"unlit");
|
|
des.region(selection.area(52,07,73,09),"unlit");
|
|
elseif choice == 1 then
|
|
des.region(selection.area(24,01,50,16),"unlit");
|
|
elseif choice == 2 then
|
|
des.region(selection.area(01,01,22,16),"unlit");
|
|
des.region(selection.area(52,01,73,16),"unlit");
|
|
end
|
|
|
|
-- Stairs
|
|
des.stair("up");
|
|
des.stair("down");
|
|
-- Non diggable walls
|
|
des.non_diggable();
|
|
-- Objects
|
|
for i = 1,15 do
|
|
des.object();
|
|
end
|
|
-- Random traps
|
|
for i = 1,6 do
|
|
des.trap();
|
|
end
|
|
-- Random monsters.
|
|
for i = 1,28 do
|
|
des.monster();
|
|
end
|