des.region(selection.area(38,13,38,17), "unlit")
des.region(selection.area(40,13,41,14), "unlit")
des.region(selection.area(40,16,41,17), "unlit")
-des.region({ region={43,13, 50,15}, lit=0, type="temple", prefilled=0 })
+des.region({ region={43,13, 50,15}, lit=0, type="temple", filled=2 })
des.region(selection.area(52,13,52,15), "unlit")
-- Stairs
des.stair("up", 38,10)
]]);
-- Dungeon Description
des.region(selection.area(00,00,75,19), "lit")
-des.region({ region={25,04, 28,07}, lit=1, type="temple", prefilled=0 })
-des.region({ region={25,09, 28,11}, lit=0, type="temple", prefilled=0 })
-des.region({ region={25,13, 28,16}, lit=1, type="temple", prefilled=0 })
+des.region({ region={25,04, 28,07}, lit=1, type="temple", filled=2 })
+des.region({ region={25,09, 28,11}, lit=0, type="temple", filled=2 })
+des.region({ region={25,13, 28,16}, lit=1, type="temple", filled=2 })
des.region(selection.area(30,04,30,16), "lit")
des.region(selection.area(32,04,32,16), "unlit")
-des.region({ region={33,04, 53,04}, lit=0, type="ordinary", prefilled=0, irregular=1 })
+des.region({ region={33,04, 53,04}, lit=0, type="ordinary", irregular=1 })
des.region(selection.area(36,10,37,10), "unlit")
des.region(selection.area(39,09,39,11), "unlit")
-des.region({ region={36,06, 42,08}, lit=0, type="ordinary", prefilled=0, irregular=1 })
-des.region({ region={36,12, 42,14}, lit=0, type="ordinary", prefilled=0, irregular=1 })
+des.region({ region={36,06, 42,08}, lit=0, type="ordinary", irregular=1 })
+des.region({ region={36,12, 42,14}, lit=0, type="ordinary", irregular=1 })
des.region(selection.area(46,06,51,09), "unlit")
-des.region({ region={46,11, 49,11}, lit=0, type="ordinary", prefilled=0, irregular=1 })
+des.region({ region={46,11, 49,11}, lit=0, type="ordinary", irregular=1 })
des.region(selection.area(48,13,51,14), "unlit")
-- Doors
des.door("closed",31,04)
]]);
-- Dungeon Description
des.region(selection.area(00,00,75,19), "unlit")
-des.region({ region={52,06, 73,15}, lit=1, type="ordinary", prefilled=0, irregular=1 })
+des.region({ region={52,06, 73,15}, lit=1, type="ordinary", irregular=1 })
-- Doors
des.door("locked",28,11)
-- Stairs
]]);
-- Dungeon Description
des.region(selection.area(00,00,75,19), "unlit")
-des.region({ region={13,01, 40,05}, lit=1, type="temple", prefilled=0, irregular=1 })
+des.region({ region={13,01, 40,05}, lit=1, type="temple", filled=1, irregular=1 })
-- The occupied rooms.
-des.region({ region={02,01, 08,03}, lit=1, type="ordinary", prefilled=0, irregular=1 })
-des.region({ region={01,11, 06,14}, lit=1, type="ordinary", prefilled=0, irregular=1 })
-des.region({ region={13,08, 18,10}, lit=1, type="ordinary", prefilled=0, irregular=1 })
-des.region({ region={05,17, 14,18}, lit=1, type="ordinary", prefilled=0, irregular=1 })
-des.region({ region={17,16, 23,18}, lit=1, type="ordinary", prefilled=0, irregular=1 })
-des.region({ region={35,16, 44,18}, lit=1, type="ordinary", prefilled=0, irregular=1 })
+des.region({ region={02,01, 08,03}, lit=1, type="ordinary", irregular=1 })
+des.region({ region={01,11, 06,14}, lit=1, type="ordinary", irregular=1 })
+des.region({ region={13,08, 18,10}, lit=1, type="ordinary", irregular=1 })
+des.region({ region={05,17, 14,18}, lit=1, type="ordinary", irregular=1 })
+des.region({ region={17,16, 23,18}, lit=1, type="ordinary", irregular=1 })
+des.region({ region={35,16, 44,18}, lit=1, type="ordinary", irregular=1 })
-- Stairs
des.stair("down", 02,03)
-- Portal arrival point
-- Dungeon Description
des.region(selection.area(00,00,49,15), "lit")
des.region(selection.area(04,04,45,11), "unlit")
-des.region({ region={06,06,22,09}, lit=1, type="throne", prefilled=1 })
+des.region({ region={06,06,22,09}, lit=1, type="throne", filled=2 })
des.region(selection.area(27,06,43,09), "lit")
-- Portal arrival point
des.levregion({ region = {20,14,20,14}, type="branch" })
........................................
]]);
-- Dungeon Description
-des.region({ region={00,00, 09,13}, lit=0, type="morgue", prefilled=0 })
-des.region({ region={09,00, 30,01}, lit=0, type="morgue", prefilled=0 })
-des.region({ region={09,12, 30,13}, lit=0, type="morgue", prefilled=0 })
-des.region({ region={31,00, 39,13}, lit=0, type="morgue", prefilled=0 })
-des.region({ region={11,03, 29,10}, lit=1, type="temple", prefilled=0, irregular=1 })
+des.region({ region={00,00, 09,13}, lit=0, type="morgue", filled=1 })
+des.region({ region={09,00, 30,01}, lit=0, type="morgue", filled=1 })
+des.region({ region={09,12, 30,13}, lit=0, type="morgue", filled=1 })
+des.region({ region={31,00, 39,13}, lit=0, type="morgue", filled=1 })
+des.region({ region={11,03, 29,10}, lit=1, type="temple", filled=1, irregular=1 })
-- The altar inside the temple
des.altar({ x=20,y=07, align="noalign", type="shrine" })
des.monster({ id = "aligned priest", x=20, y=07, align="noalign", peaceful = 0 })
]]);
-- Dungeon Description
des.region(selection.area(00,00,75,19), "lit")
-des.region({ region={18,03, 26,07}, lit=1, type="throne", prefilled=1 })
+des.region({ region={18,03, 26,07}, lit=1, type="throne", filled=2 })
-- Portal arrival zone
des.levregion({ region = {62,12,70,17}, type="branch" })
-- Stairs
des.region(selection.area(00,00,75,19), "lit")
des.non_diggable(selection.area(00,00,75,19))
--
-des.region({ region={01,01, 04,05}, lit=0, type="morgue", prefilled = 0 })
-des.region({ region={15,03, 20,05}, lit=1, type="shop", prefilled = 0 })
-des.region({ region={62,03, 71,04}, lit=1, type="shop", prefilled = 0 })
-des.region({ region={01,17, 11,18}, lit=1, type="barracks", prefilled = 0 })
-des.region({ region={12,09, 20,10}, lit=1, type="barracks", prefilled = 0 })
-des.region({ region={53,11, 59,14}, lit=1, type="zoo", prefilled = 0 })
-des.region({ region={63,14, 72,16}, lit=1, type="barracks", prefilled = 0 })
-des.region({ region={32,14, 40,16}, lit=1, type="temple", prefilled = 0 })
+des.region({ region={01,01, 04,05}, lit=0, type="morgue", filled=1 })
+des.region({ region={15,03, 20,05}, lit=1, type="shop", filled=1 })
+des.region({ region={62,03, 71,04}, lit=1, type="shop", filled=1 })
+des.region({ region={01,17, 11,18}, lit=1, type="barracks", filled=1 })
+des.region({ region={12,09, 20,10}, lit=1, type="barracks", filled=1 })
+des.region({ region={53,11, 59,14}, lit=1, type="zoo", filled=1 })
+des.region({ region={63,14, 72,16}, lit=1, type="barracks", filled=1 })
+des.region({ region={32,14, 40,16}, lit=1, type="temple", filled=1 })
--
des.region({ region = {06,01,11,02}, type = "ordinary" })
des.region({ region = {24,01,29,02}, type = "ordinary" })
]]);
-- Dungeon Description
des.region(selection.area(00,00,75,19), "lit")
-des.region({ region={14,01, 20,03}, lit=0, type="morgue", prefilled=0 })
+des.region({ region={14,01, 20,03}, lit=0, type="morgue", filled=1 })
des.region(selection.area(07,10,11,12), "unlit")
des.region(selection.area(04,16,08,18), "unlit")
des.region(selection.area(17,16,21,18), "unlit")
-- Dungeon Description
des.region(selection.area(00,00,75,20), "lit")
-des.region({ region={37,04,65,16}, lit=0, type="ordinary", prefilled=1, irregular=1,
+des.region({ region={37,04,65,16}, lit=0, type="ordinary", irregular=1,
contents = function()
des.door({ state="secret", wall="random" })
end
})
-des.region({ region={39,06,63,14}, lit=0, type="ordinary", prefilled=1, irregular=1,
+des.region({ region={39,06,63,14}, lit=0, type="ordinary", irregular=1,
contents = function()
des.door({ state="secret", wall="random" })
end
})
-des.region({ region={41,08,46,12}, lit=1, type="ordinary", prefilled=1, irregular=1,
+des.region({ region={41,08,46,12}, lit=1, type="ordinary", irregular=1,
contents = function()
local walls = { "north", "south", "west" }
local widx = math.random(1, #walls)
end
})
-des.region({ region={56,08,61,12}, lit=1, type="ordinary", prefilled=1, irregular=1,
+des.region({ region={56,08,61,12}, lit=1, type="ordinary", irregular=1,
contents = function()
local walls = { "north", "south", "east" }
local widx = math.random(1, #walls)
des.region(selection.area(48,08,54,08), "unlit")
des.region(selection.area(48,12,54,12), "unlit")
-des.region({ region={48,10,54,10}, lit=0, type="ordinary", prefilled=1, irregular=1,
+des.region({ region={48,10,54,10}, lit=0, type="ordinary", irregular=1,
contents = function()
des.door({ state="secret", wall="random" })
end
des.region(selection.area(00,00,75,19), "lit")
des.region(selection.area(35,00,49,03), "unlit")
des.region(selection.area(43,12,49,16), "unlit")
-des.region({ region={19,11,33,15}, lit=0, type="ordinary", prefilled=0, irregular=1 })
+des.region({ region={19,11,33,15}, lit=0, type="ordinary", irregular=1 })
des.region(selection.area(30,10,31,10), "unlit")
-- Stairs
des.stair("down", 30,10)
-- Where the player will land on arrival
des.teleport_region({ region = {29,15,45,15}, exclude = {30,15,44,15} })
-- Lit courts
-des.region({ region={01,05,16,14},lit=1,type="ordinary",prefilled=1,irregular=1 })
-des.region({ region={31,01,44,10},lit=1,type="ordinary",prefilled=1,irregular=1 })
-des.region({ region={61,05,74,14},lit=1,type="ordinary",prefilled=1,irregular=1 })
+des.region({ region={01,05,16,14},lit=1,type="ordinary",irregular=1 })
+des.region({ region={31,01,44,10},lit=1,type="ordinary",irregular=1 })
+des.region({ region={61,05,74,14},lit=1,type="ordinary",irregular=1 })
-- A Sanctum for each alignment
-- The shrines' alignments are shuffled for
-- each game
des.region(selection.area(00,05,05,11),"lit")
des.region(selection.area(57,05,62,11),"lit")
-- Throne room
-des.region({ region={27,05, 37,11},lit=1,type="throne", prefilled=1 })
+des.region({ region={27,05, 37,11},lit=1,type="throne", filled=2 })
-- Antechamber
des.region(selection.area(07,05,14,11),"lit")
-- Storerooms
des.region(selection.area(02,13,06,14),"lit")
des.region(selection.area(56,13,60,14),"lit")
-- Barracks
-des.region({ region={16,05, 25,06},lit=1,type="barracks", prefilled=0 })
-des.region({ region={16,10, 25,11},lit=1,type="barracks", prefilled=0 })
+des.region({ region={16,05, 25,06},lit=1,type="barracks", filled=1 })
+des.region({ region={16,10, 25,11},lit=1,type="barracks", filled=1 })
-- Hallways
des.region(selection.area(08,03,54,03),"unlit")
des.region(selection.area(08,13,54,13),"unlit")
des.teleport_region({ region={01,00,79,20}, region_islev=1,exclude={2,2,6,6} })
des.levregion({ region={4,4,4,4}, type="portal", name="wizard3" })
des.mazewalk(08,05,"east")
-des.region({ region={04,03,06,06},lit=0,type="ordinary",prefilled=0,irregular=1 })
+des.region({ region={04,03,06,06},lit=0,type="ordinary",irregular=1,arrival_room=true })
des.monster("L",04,04)
des.monster("vampire lord",03,04)
des.monster("kraken",06,06)
des.levregion({ region={01,00,79,20}, region_islev=1, exclude={0,0,8,7}, type="branch" });
des.teleport_region({ region={01,00,79,20}, region_islev=1,exclude={2,2,6,6} })
des.mazewalk(08,05,"east")
-des.region({ region={04,03,06,06},lit=0,type="ordinary",prefilled=0,irregular=1 })
des.monster("L",04,04)
des.monster("vampire lord",03,04)
des.monster("kraken",06,06)
des.teleport_region({ region = {06,15,09,16}, dir="up" })
des.teleport_region({ region = {06,15,09,16}, dir="down" })
-- Throne room, with Croesus on the throne
-des.region({ x1=37,y1=08,x2=46,y2=11, lit=1, type="throne", prefilled=0 })
+des.region({ x1=37,y1=08,x2=46,y2=11, lit=1, type="throne", filled=1 })
-- 50% chance each to move throne and/or fort's entry secret door up one row
if percent(50) then
des.monster({ id = "Croesus", x=43, y=10, peaceful = 0 })
des.region(selection.area(19,13,21,13),"lit")
des.region(selection.area(46,13,48,13),"lit")
-- A welcoming committee
-des.region({ region={03,10,07,13},lit=1,type="zoo",prefilled=0,irregular=1 })
+des.region({ region={03,10,07,13},lit=1,type="zoo",filled=1,irregular=1 })
-- arrival chamber; needs to be a real room to control migrating monsters,
-- and `unfilled' is a kludge to force an ordinary room to remain a room
-des.region({ region={06,15,09,16},lit=0,type="ordinary",prefilled=0 })
+des.region({ region={06,15,09,16},lit=0,type="ordinary",arrival_room=true })
-- 3.6.2: Entering level carrying a lit candle would show the whole entry
-- chamber except for its top right corner even though some of the revealed
-- it is expected to work.)
-- Barracks
-des.region({ region={62,03,71,04},lit=1,type="barracks",prefilled=0,irregular=1 })
+des.region({ region={62,03,71,04},lit=1,type="barracks",filled=1,irregular=1 })
-- Doors
des.door("closed",06,14)
des.door("closed",09,03)
-- Dungeon Description
des.region(selection.area(00,00,74,19),"lit")
des.region(selection.area(31,07,45,07),"unlit")
--- (must maintain one room definition; `filled=0' forces its room to be kept)
-des.region({ region={35,09, 41,10}, lit = 0, type="ordinary", prefilled = 1 })
+-- make the downstairs room a real room to control arriving monsters
+des.region({ region={35,09, 41,10}, lit = 0, type="ordinary", arrival_room=true })
des.region(selection.area(31,12,45,12),"unlit")
-- Teleport: down to up stairs island, up to Medusa's island
des.teleport_region({ region = {01,01,05,17}, dir="down" })
-- Dungeon Description
des.region(selection.area(00,00,74,19),"lit")
des.region(selection.area(02,03,05,16),"unlit")
-des.region({ region={61,03, 72,16}, lit=0, type="ordinary", prefilled = 1,irregular = 1 })
+des.region({ region={61,03, 72,16}, lit=0, type="ordinary",irregular = 1 })
des.region(selection.area(71,08,72,11),"unlit")
-des.region(selection.area(67,08,69,11),"lit")
+-- make the downstairs area a real room to control arriving monsters
+des.region({ region={67,08,69,11}, lit=1, type="ordinary", arrival_room=true })
-- Teleport: down to up stairs island, up to Medusa's island
des.teleport_region({ region = {02,03,05,16}, dir="down" })
des.teleport_region({ region = {61,03,72,16}, dir="up" })
place:set(46,15);
des.region(selection.area(00,00,74,19),"lit")
-des.region({ region={49,14, 51,16}, lit=-1, type="ordinary", prefilled = 1 });
+des.region({ region={49,14, 51,16}, lit=-1, type="ordinary" });
des.region(selection.area(07,05,09,07),"unlit")
des.region(selection.area(65,04,67,06),"unlit")
des.region(selection.area(45,14,47,16),"unlit")
place:set(10,12);
--
des.region(selection.area(00,00,74,19),"lit")
-des.region({ region={13,03, 18,13}, lit=1, type="ordinary", prefilled=1 })
--
des.teleport_region({ region = {64,01,74,17}, dir="down" });
des.teleport_region({ region = {02,02,18,13}, dir="up" });
local place = { {08,16},{13,07},{21,08},{41,14},{50,04},{50,16},{66,01} }
shuffle(place)
-des.region({ region={26,01,32,01}, lit=0, type="ordinary",
- prefilled=0, irregular=1 })
+-- make the entry chamber a real room; it affects monster arrival
+des.region({ region={26,01,32,01}, lit=0, type="ordinary", irregular=1, arrival_room=true })
des.region(selection.area(20,08,21,08),"unlit")
des.region(selection.area(23,08,25,08),"unlit");
-- Secret doors
des.monster("dwarf")
-- The shops
-des.region({ region={25,17, 28,19}, lit=1, type="candle shop", prefilled=0 })
+des.region({ region={25,17, 28,19}, lit=1, type="candle shop", filled=1 })
des.door("closed",24,18)
-des.region({ region={59, 9, 67,10}, lit=1, type="shop", prefilled=0 })
+des.region({ region={59, 9, 67,10}, lit=1, type="shop", filled=1 })
des.door("closed",66,08)
-des.region({ region={57,13, 60,15}, lit=1, type="tool shop", prefilled=0 })
+des.region({ region={57,13, 60,15}, lit=1, type="tool shop", filled=1 })
des.door("closed",56,14)
-des.region({ region={05,09, 08,10}, lit=1, type=monkfoodshop(), prefilled=0 })
+des.region({ region={05,09, 08,10}, lit=1, type=monkfoodshop(), filled=1 })
des.door("closed",07,11)
-- Gnome homes
des.door("closed",04,14)
des.feature("fountain" ,22,07)
des.feature("fountain", 09,13)
des.region(selection.area(13,5,14,6),"unlit")
-des.region({ region={09,07, 11,09}, lit=1, type="candle shop", prefilled=0 })
-des.region({ region={16,04, 18,06}, lit=1, type="tool shop", prefilled=0 })
-des.region({ region={23,01, 25,03}, lit=1, type="shop", prefilled=0 })
-des.region({ region={22,12, 24,13}, lit=1, type=monkfoodshop(), prefilled=0 })
-des.region({ region={31,12, 36,14}, lit=1, type="temple", prefilled=0 })
+des.region({ region={09,07, 11,09}, lit=1, type="candle shop", filled=1 })
+des.region({ region={16,04, 18,06}, lit=1, type="tool shop", filled=1 })
+des.region({ region={23,01, 25,03}, lit=1, type="shop", filled=1 })
+des.region({ region={22,12, 24,13}, lit=1, type=monkfoodshop(), filled=1 })
+des.region({ region={31,12, 36,14}, lit=1, type="temple", filled=1 })
des.altar({ x=35,y=13,align=align[1],type="shrine"})
des.door("closed",5,2)
des.door("closed",06,15)
-- Special rooms
des.altar({ x=24,y=07,align="noalign",type="sanctum" })
-des.region({ region={22,12,25,16},lit=0,type="morgue", prefilled=0 })
-des.region({ region={32,09,37,12},lit=1,type="shop",prefilled=0 })
-des.region({ region={12,00,15,04},lit=1,type="shop",prefilled=0 })
+des.region({ region={22,12,25,16},lit=0,type="morgue",filled=1 })
+des.region({ region={32,09,37,12},lit=1,type="shop",filled=1 })
+des.region({ region={12,00,15,04},lit=1,type="shop",filled=1 })
-- Some traps.
des.trap("spiked pit")
des.trap("sleep gas")
des.door({ wall = "random", state = "secret" });
end })
des.altar({ x=18, y=08, align="noalign", type="sanctum" })
-des.region({ region={41,06, 48,11}, lit=0, type="morgue", prefilled=0, irregular=1 })
+des.region({ region={41,06, 48,11}, lit=0, type="morgue", filled=1, irregular=1 })
-- Non diggable walls
des.non_diggable(selection.area(00,00,75,19))
-- Invisible barrier separating the left & right halves of the level
des.door("closed", 17, 13);
des.door("closed", 17, 15);
-des.region({ region={18,10, 22,16}, lit = 1, type = "zoo",
- prefilled = 0, irregular = 1 });
+des.region({ region={18,10, 22,16}, lit = 1, type = "zoo", filled = 1, irregular = 1 });
px, py = selection.rndcoord(place);
if percent(75) then
des.door("closed",17,10)
des.door("closed",17,12)
des.door("closed",17,14)
-des.region({ region={18,09, 22,15}, lit = 1, type = "zoo",
- prefilled = 0, irregular = 1 });
+des.region({ region={18,09, 22,15}, lit = 1, type = "zoo", filled = 1, irregular = 1 });
px, py = selection.rndcoord(place);
if percent(25) then
-- core calls themerooms_generate() multiple times per level
-- to generate a single themed room.
-
themerooms = {
{
-- the "default" room
|......|
|......|
|......|
---------]], contents = function(m) des.region({ region={1,1,3,3}, type="ordinary", irregular=true, prefilled=true }); end });
+--------]], contents = function(m) des.region({ region={1,1,3,3}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- L-shaped, rot 1
|......|
|......|
|......|
---------]], contents = function(m) des.region({ region={5,1,5,3}, type="ordinary", irregular=true, prefilled=true }); end });
+--------]], contents = function(m) des.region({ region={5,1,5,3}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- L-shaped, rot 2
----...|
xxx|...|
xxx|...|
-xxx-----]], contents = function(m) des.region({ region={1,1,2,2}, type="ordinary", irregular=true, prefilled=true }); end });
+xxx-----]], contents = function(m) des.region({ region={1,1,2,2}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- L-shaped, rot 3
|...----
|...|xxx
|...|xxx
------xxx]], contents = function(m) des.region({ region={1,1,2,2}, type="ordinary", irregular=true, prefilled=true }); end });
+-----xxx]], contents = function(m) des.region({ region={1,1,2,2}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- Blocked center
shuffle(terr);
des.replace_terrain({ region = {1,1, 9,9}, fromterrain = "L", toterrain = terr[1] });
end
-des.region({ region={1,1,2,2}, type="ordinary", irregular=true, prefilled=true });
+des.region({ region={1,1,2,2}, type="ordinary", irregular=true, filled=1 });
end });
end,
|.....|
--...--
x--.--x
-xx---xx]], contents = function(m) des.region({ region={3,3,3,3}, type="ordinary", irregular=true, prefilled=true }); end });
+xx---xx]], contents = function(m) des.region({ region={3,3,3,3}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- Circular, medium
|.......|
--.....--
x--...--x
-xx-----xx]], contents = function(m) des.region({ region={4,4,4,4}, type="ordinary", irregular=true, prefilled=true }); end });
+xx-----xx]], contents = function(m) des.region({ region={4,4,4,4}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- Circular, big
--.......--
x-.......-x
x---...---x
-xxx-----xxx]], contents = function(m) des.region({ region={5,5,5,5}, type="ordinary", irregular=true, prefilled=true }); end });
+xxx-----xxx]], contents = function(m) des.region({ region={5,5,5,5}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- T-shaped
|.........|
|.........|
|.........|
------------]], contents = function(m) des.region({ region={5,5,5,5}, type="ordinary", irregular=true, prefilled=true }); end });
+-----------]], contents = function(m) des.region({ region={5,5,5,5}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- T-shaped, rot 1
|...----
|...|xxx
|...|xxx
------xxx]], contents = function(m) des.region({ region={2,2,2,2}, type="ordinary", irregular=true, prefilled=true }); end });
+-----xxx]], contents = function(m) des.region({ region={2,2,2,2}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- T-shaped, rot 2
----...----
xxx|...|xxx
xxx|...|xxx
-xxx-----xxx]], contents = function(m) des.region({ region={2,2,2,2}, type="ordinary", irregular=true, prefilled=true }); end });
+xxx-----xxx]], contents = function(m) des.region({ region={2,2,2,2}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- T-shaped, rot 3
----...|
xxx|...|
xxx|...|
-xxx-----]], contents = function(m) des.region({ region={5,5,5,5}, type="ordinary", irregular=true, prefilled=true }); end });
+xxx-----]], contents = function(m) des.region({ region={5,5,5,5}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- S-shaped
----...|
xxx|...|
xxx|...|
-xxx-----]], contents = function(m) des.region({ region={2,2,2,2}, type="ordinary", irregular=true, prefilled=true }); end });
+xxx-----]], contents = function(m) des.region({ region={2,2,2,2}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- S-shaped, rot 1
|......----
|......|xxx
|......|xxx
---------xxx]], contents = function(m) des.region({ region={5,5,5,5}, type="ordinary", irregular=true, prefilled=true }); end });
+--------xxx]], contents = function(m) des.region({ region={5,5,5,5}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- Z-shaped
|...----
|...|xxx
|...|xxx
------xxx]], contents = function(m) des.region({ region={5,5,5,5}, type="ordinary", irregular=true, prefilled=true }); end });
+-----xxx]], contents = function(m) des.region({ region={5,5,5,5}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- Z-shaped, rot 1
----......|
xxx|......|
xxx|......|
-xxx--------]], contents = function(m) des.region({ region={2,2,2,2}, type="ordinary", irregular=true, prefilled=true }); end });
+xxx--------]], contents = function(m) des.region({ region={2,2,2,2}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- Cross
----...----
xxx|...|xxx
xxx|...|xxx
-xxx-----xxx]], contents = function(m) des.region({ region={6,6,6,6}, type="ordinary", irregular=true, prefilled=true }); end });
+xxx-----xxx]], contents = function(m) des.region({ region={6,6,6,6}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- Four-leaf clover
|.........|
|...---...|
|...|x|...|
------x-----]], contents = function(m) des.region({ region={6,6,6,6}, type="ordinary", irregular=true, prefilled=true }); end });
+-----x-----]], contents = function(m) des.region({ region={6,6,6,6}, type="ordinary", irregular=true, filled=1 }); end });
end,
-- Water-surrounded vault
}|..|}
}|..|}
}----}
-}}}}}}]], contents = function(m) des.region({ region={3,3,3,3}, type="themed", irregular=true, prefilled=false, joined=false });
+}}}}}}]], contents = function(m) des.region({ region={3,3,3,3}, type="themed", irregular=true, filled=0, joined=false });
local nasty_undead = { "giant zombie", "ettin zombie", "vampire lord" };
des.object("chest", 2, 2);
des.object("chest", 3, 2);
-- The shrine to Moloch.
des.region({ region={01,06, 05,14},lit=1,type="temple" })
-- The Morgues
-des.region({ region={19,01, 24,08},lit=0,type="morgue",prefilled=0,irregular=1 })
-des.region({ region={09,14, 16,18},lit=0,type="morgue",prefilled=0,irregular=1 })
-des.region({ region={37,09, 43,14},lit=0,type="morgue",prefilled=0,irregular=1 })
+des.region({ region={19,01, 24,08},lit=0,type="morgue",filled=1,irregular=1 })
+des.region({ region={09,14, 16,18},lit=0,type="morgue",filled=1,irregular=1 })
+des.region({ region={37,09, 43,14},lit=0,type="morgue",filled=1,irregular=1 })
-- Stairs
des.stair("down", 01,01)
-- Branch location
des.levregion({ type="stair-down", region={01,00,79,20}, region_islev=1, exclude={0,0,28,12} })
des.levregion({ type="branch", region={01,00,79,20}, region_islev=1, exclude={0,0,28,12} })
des.teleport_region({ region={01,00,79,20}, region_islev=1, exclude={0,0,27,12} })
-des.region({ region={12,01, 20,09}, lit=0, type="morgue", prefilled=1, contents=function()
+des.region({ region={12,01, 20,09}, lit=0, type="morgue", filled=2, contents=function()
local sdwall = { "south", "west", "east" };
des.door({ wall = sdwall[math.random(1, #sdwall)], state = "secret" });
end })
-- another region to constrain monster arrival
-des.region({ region={01,01, 10,11}, lit=0, type="ordinary", prefilled=0 })
+des.region({ region={01,01, 10,11}, lit=0, type="ordinary", arrival_room=true })
des.mazewalk(28,05,"east")
des.ladder("down", 06,05)
-- Non diggable walls
des.levregion({ type="branch", region={01,00,79,20}, region_islev=1, exclude={0,0,28,12} })
des.teleport_region({ region={01,00,79,20}, region_islev=1, exclude={0,0,27,12} })
-- entire tower in a region, constrains monster migration
-des.region({ region={01,01, 26,11}, lit=0, type="ordinary", prefilled=1 })
-des.region({ region={09,03, 17,09}, lit=0, type="zoo", prefilled=0 })
+des.region({ region={01,01, 26,11}, lit=0, type="ordinary", arrival_room=true })
+des.region({ region={09,03, 17,09}, lit=0, type="zoo", filled=1 })
des.door("closed",15,02)
des.door("closed",11,10)
des.mazewalk(28,05,"east")
des.teleport_region({ region={01,00,79,20}, region_islev=1, exclude={0,0,27,12} })
des.levregion({ region={25,11,25,11}, type="portal", name="fakewiz1" });
des.mazewalk(28,09,"east")
-des.region({ region={07,03, 15,11}, lit=0 ,type="morgue",prefilled=1 })
+des.region({ region={07,03, 15,11}, lit=0 ,type="morgue", filled=2 })
des.region({ region={17,06, 18,11}, lit=0, type="beehive" })
--- make the entry chamber a real room; it affects monster arrival;
--- `unfilled' is a kludge to force an ordinary room to remain a room
-des.region({ region={20,06,26,11},lit=0,type="ordinary",prefilled=1,
+-- make the entry chamber a real room; it affects monster arrival
+des.region({ region={20,06,26,11},lit=0,type="ordinary",arrival_room=true,
contents = function()
local w = "north";
if percent(50) then w = "west" end
| nommap | Prevents magic mapping
| shortsighted | Prevents monsters from seeing the hero from far away
| arboreal | Notionally an outdoor map; replaces solid stone with trees
-| mazelevel |
+| mazelevel |
| shroud | Unseen locations on the level will not be remembered by the hero, instead of rendering as out-of-sight map, trap, and object glyphs like they normally do.
| graveyard | Treats the level as a graveyard level (causes graveyard sounds and undead have a reduced chance of leaving corpses).
| icedpools | Ice generated with the level will be treated as frozen pools instead of frozen moats.
-| corrmaze |
+| corrmaze |
| premapped | Map, including traps and boulders, is revealed on entrance.
-| solidify | Areas outside the specified level map are made undiggable and unphaseable.
+| solidify | Areas outside the specified level map are made undiggable and unphaseable.
| inaccessibles | If inaccessible areas are generated, generate ways for them to connect to the "accessible" area.
| noflip | Prevent flipping the level.
| noflipx | Prevent flipping the level horizontally.
Example:
des.region(selection, lit);
- des.region({ x1=NN, y1=NN, x2=NN, y2=NN, lit=BOOL, type=ROOMTYPE, joined=BOOL, irregular=BOOL, prefilled=BOOL [ , contents = FUNCTION ] });
+ des.region({ x1=NN, y1=NN, x2=NN, y2=NN, lit=BOOL, type=ROOMTYPE, joined=BOOL, irregular=BOOL, filled=NN [ , contents = FUNCTION ] });
des.region({ region={x1,y1, x2,y2}, type="ordinary" });
=== replace_terrain
XCHAR_P, XCHAR_P, XCHAR_P));
E void FDECL(create_secret_door, (struct mkroom *, XCHAR_P));
E boolean FDECL(dig_corridor, (coord *, coord *, BOOLEAN_P, SCHAR_P, SCHAR_P));
-E void FDECL(fill_special_room, (struct mkroom *, BOOLEAN_P));
+E void FDECL(fill_special_room, (struct mkroom *));
E boolean FDECL(load_special, (const char *));
E xchar FDECL(selection_getpoint, (int, int, struct selectionvar *));
E struct selectionvar *NDECL(selection_new);
#define ROOMOFFSET 3 /* (levl[x][y].roomno - ROOMOFFSET) gives g.rooms[] index,
* for inside-squares and non-shared boundaries */
+/* Values for needfill */
+#define FILL_NONE 0 /* do not fill this room with anything */
+#define FILL_NORMAL 1 /* fill the room normally (OROOM or THEMEROOM gets
+ fill_ordinary_room; any other room type gets stocked
+ with its usual monsters/objects/terrain) */
+#define FILL_LVFLAGS 2 /* special rooms only; set the room's rtype and level
+ flags as appropriate, but do not put anything in it */
+
#define IS_ROOM_PTR(x) ((x) >= g.rooms && (x) < g.rooms + MAXNROFROOMS)
#define IS_ROOM_INDEX(x) ((x) >= 0 && (x) < MAXNROFROOMS)
#define IS_SUBROOM_PTR(x) ((x) >= g.subrooms && (x) < g.subrooms + MAXNROFROOMS)
Str_or_Len parent;
xchar x, y, w, h;
xchar xalign, yalign;
- xchar rtype, chance, rlit, filled, joined;
+ xchar rtype, chance, rlit, needfill, joined;
} room;
struct mapfragment {
fill_ordinary_room(croom->sbrooms[x]);
}
- if (!croom->needfill)
+ if (croom->needfill != FILL_NORMAL)
return;
/* put a sleeping monster inside */
TRUE, VAULT, FALSE);
g.level.flags.has_vault = 1;
++room_threshold;
- fill_special_room(&g.rooms[g.nroom - 1], FALSE);
+ fill_special_room(&g.rooms[g.nroom - 1]);
mk_knox_portal(g.vault_x + w, g.vault_y + h);
if (!g.level.flags.noteleport && !rn2(3))
makevtele();
for (tmpi = 0; tmpi < g.nroom; tmpi++) {
if (g.rooms[tmpi].needfill)
- fill_special_room(&g.rooms[tmpi], (g.rooms[tmpi].needfill == 2));
+ fill_special_room(&g.rooms[tmpi]);
for (m = 0; m < g.rooms[tmpi].nsubrooms; m++)
if (g.rooms[tmpi].sbrooms[m]->needfill)
- fill_special_room(g.rooms[tmpi].sbrooms[m], FALSE);
+ fill_special_room(g.rooms[tmpi].sbrooms[m]);
}
}
* Fill a room (shop, zoo, etc...) with appropriate stuff.
*/
void
-fill_special_room(croom, prefilled)
+fill_special_room(croom)
struct mkroom *croom;
-boolean prefilled;
{
- if (!croom || croom->rtype == OROOM || croom->rtype == THEMEROOM)
+ if (!croom || croom->rtype == OROOM || croom->rtype == THEMEROOM
+ || croom->needfill == FILL_NONE)
return;
- if (!prefilled) {
+ if (croom->needfill == FILL_NORMAL) {
int x, y;
/* Shop ? */
#else
topologize(aroom); /* set roomno */
#endif
- aroom->needfill = r->filled;
+ aroom->needfill = r->needfill;
aroom->needjoining = r->joined;
return aroom;
}
tmproom.rtype = get_table_roomtype_opt(L, "type", OROOM);
tmproom.chance = get_table_int_opt(L, "chance", 100);
tmproom.rlit = get_table_int_opt(L, "lit", -1);
- tmproom.filled = get_table_int_opt(L, "filled", g.in_mk_themerooms ? 0 : 1);
+ /* theme rooms default to unfilled */
+ tmproom.needfill = get_table_int_opt(L, "filled", g.in_mk_themerooms ? 0 : 1);
tmproom.joined = get_table_int_opt(L, "joined", 1);
if (!g.coder->failed_room[g.coder->n_subroom - 1]) {
}
/* region(selection, lit); */
-/* region({ x1=NN, y1=NN, x2=NN, y2=NN, lit=BOOL, type=ROOMTYPE, joined=BOOL, irregular=BOOL, prefilled=BOOL [ , contents = FUNCTION ] }); */
+/* region({ x1=NN, y1=NN, x2=NN, y2=NN, lit=BOOL, type=ROOMTYPE, joined=BOOL, irregular=BOOL, filled=NN [ , contents = FUNCTION ] }); */
/* region({ region={x1,y1, x2,y2}, type="ordinary" }); */
int
lspo_region(L)
{
xchar dx1, dy1, dx2, dy2;
register struct mkroom *troom;
- boolean prefilled = FALSE, room_not_needed,
+ boolean do_arrival_room = FALSE, room_not_needed,
irregular = FALSE, joined = TRUE;
- int rtype = OROOM, rlit = 1;
+ int rtype = OROOM, rlit = 1, needfill = 0;
int argc = lua_gettop(L);
create_des_coder();
if (argc <= 1) {
lcheck_param_table(L);
- /* TODO: check the prefilled, what was the default in lev_comp? */
- /* "unfilled" == 0, "filled" == 1, missing = "filled" */
-
- /* TODO: "unfilled" ==> prefilled=1 */
- prefilled = get_table_boolean_opt(L, "prefilled", 0);
+ /* TODO: "unfilled" ==> filled=0, "filled" ==> filled=1, and
+ * "lvflags_only" ==> filled=2, probably in a get_table_needfill_opt */
+ needfill = get_table_int_opt(L, "filled", 0);
irregular = get_table_boolean_opt(L, "irregular", 0);
joined = get_table_boolean_opt(L, "joined", 1);
+ do_arrival_room = get_table_boolean_opt(L, "arrival_room", 0);
rtype = get_table_roomtype_opt(L, "type", OROOM);
rlit = get_table_int_opt(L, "lit", -1);
dx1 = get_table_int_opt(L, "x1", -1); /* TODO: area */
get_location(&dx1, &dy1, ANY_LOC, (struct mkroom *) 0);
get_location(&dx2, &dy2, ANY_LOC, (struct mkroom *) 0);
- /* for an ordinary room, `prefilled' is a flag to force
- an actual room to be created (such rooms are used to
- control placement of migrating monster arrivals) */
- room_not_needed = (rtype == OROOM && !irregular && !prefilled && !g.in_mk_themerooms);
+ /* Many regions are simple, rectangular areas that just need to set lighting
+ * in an area. In that case, we don't need to do anything complicated by
+ * creating a room. The exceptions are:
+ * - Special rooms (which usually need to be filled).
+ * - Irregular regions (more convenient to use the room-making code).
+ * - Themed room regions (which often have contents).
+ * - When a room is desired to constrain the arrival of migrating monsters
+ * (see the mon_arrive function for details).
+ */
+ room_not_needed = (rtype == OROOM && !irregular && !do_arrival_room && !g.in_mk_themerooms);
if (room_not_needed || g.nroom >= MAXNROFROOMS) {
region tmpregion;
if (!room_not_needed)
troom = &g.rooms[g.nroom];
/* mark rooms that must be filled, but do it later */
- if (rtype != OROOM)
- troom->needfill = (prefilled ? 2 : 1);
+ troom->needfill = needfill;
troom->needjoining = joined;
#endif
}
- if (g.in_mk_themerooms && prefilled)
- troom->needfill = 1;
-
if (!room_not_needed) {
if (g.coder->n_subroom > 1)
impossible("region as subroom");
function test_region()
des.region(selection.area(08,03,54,03),"unlit")
des.region(selection.area(56,02,60,03),"lit")
- des.region({ region={16,05, 25,06}, lit=1, type="barracks", prefilled=0 })
- des.region({ region={1,5, 3,7}, lit=1, irregular=true, prefilled=true, joined=false })
+ des.region({ region={16,05, 25,06}, lit=1, type="barracks", filled=0 })
+ des.region({ region={1,5, 3,7}, lit=1, irregular=true, filled=1, joined=false })
end
function test_door()