]> granicus.if.org Git - nethack/commitdiff
Unify all special level filling options
authorcopperwater <aosdict@gmail.com>
Tue, 19 May 2020 04:13:41 +0000 (00:13 -0400)
committerPasi Kallinen <paxed@alt.org>
Sun, 27 Sep 2020 15:54:15 +0000 (18:54 +0300)
The existing system was a confusing mess of competing names (filled,
needfill, prefilled, etc) that had varying semantics, with prefilled
being the worst offender as it meant at least three different things in
various contexts. This commit unifies everything in the code under
"needfill", and everything in Lua under "filled", which defaults to 0
everywhere.

This also removes the second argument to fill_special_room; that
function now just checks the needfill of the room it's passed. As
before, a filled == 2 value is used for a special room to indicate that
the room should set the appropriate level flag, but shouldn't actually
be stocked with anything (for instance, King Arthur's throne room); the
difference is that this now comes directly from the lua script instead
of being manipulated within sp_lev.c.

The prefilled argument had one use case that is occasionally used in the
level files: if the level designer had specified an ordinary region with
prefilled = 1, it would become a room to control monster arrivals on a
level -- monsters that arrive within the bounds of a room are supposed
to stay there.
However, not all of the places where the comments indicated this was
being used were using it correctly; I tested this by letting a few
monsters fall through the knox portal (they're supposed to be
constrained to the entry room) and waiting a hundred turns, then going
through the portal; they were not constrained to the room and had
"wandered" through its walls.
Instead of trying to maintain this special case, I have added an
optional "arrival_room" boolean argument to des.region, which forces it
to create a room for the purposes of constraining monster arrival.

I have gone through and replaced occurrences of prefilled in lua files
with the appropriate filled option (or arrival, as needed). In some
cases, that resulted in questionable regions such as a filled ordinary
area in a non-themeroom (I just dropped the filled=1), or an area which
didn't do anything, not even lighting (which I deleted).

39 files changed:
dat/Arc-goal.lua
dat/Arc-loca.lua
dat/Cav-loca.lua
dat/Cav-strt.lua
dat/Kni-strt.lua
dat/Pri-loca.lua
dat/Sam-strt.lua
dat/Tou-loca.lua
dat/Tou-strt.lua
dat/Wiz-loca.lua
dat/Wiz-strt.lua
dat/astral.lua
dat/castle.lua
dat/fakewiz1.lua
dat/fakewiz2.lua
dat/knox.lua
dat/medusa-1.lua
dat/medusa-2.lua
dat/medusa-3.lua
dat/medusa-4.lua
dat/minend-1.lua
dat/minetn-5.lua
dat/minetn-6.lua
dat/orcus.lua
dat/sanctum.lua
dat/soko1-1.lua
dat/soko1-2.lua
dat/themerms.lua
dat/valley.lua
dat/wizard1.lua
dat/wizard2.lua
dat/wizard3.lua
doc/lua.adoc
include/extern.h
include/mkroom.h
include/sp_lev.h
src/mklev.c
src/sp_lev.c
test/test_des.lua

index ba3a005553fa0ebbbeef4a26eec088b91495c732..8cdf65e8c305fd7d5ef264334df4aa3186b8f222 100644 (file)
@@ -52,7 +52,7 @@ des.region(selection.area(35,16,36,17), "unlit")
 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)
index 31776ac528a8ff910477211d5ae88c9eb46e66ca..93ab61fee80fbc4f9914164fb353718cd0eb1875 100644 (file)
@@ -31,18 +31,18 @@ des.map([[
 ]]);
 -- 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)
index 8406a5dd6618409926c140e35e05ad35625aaf28..a9dfe1a0753f65fac25773d1c3a4c9fb3efaef25 100644 (file)
@@ -31,7 +31,7 @@ des.map([[
 ]]);
 -- 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
index 1dfe83628d3c1da606a9bc9041d507de6a1f9c5a..83c071d0c34f2a7b6eb089d0401248f9055cdcbf 100644 (file)
@@ -37,14 +37,14 @@ des.map([[
 ]]);
 -- 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
index 7d43f61c4a05c6158db6ec0a73bcd9edf97fe2c2..4442d93a765ee58bb2f2754b3d623e2d9746267e 100644 (file)
@@ -36,7 +36,7 @@ des.map([[
 -- 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" })
index 9ebd553009550168d88b1688e5a4f045005ace92..5583ac270a413051fc18e6d625fd086d67517251 100644 (file)
@@ -26,11 +26,11 @@ des.map([[
 ........................................
 ]]);
 -- 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 })
index ec865ab5d6ad627bf89cb91f92b6264647b77af2..8186c3cb43bd61dc741348860f832ba37bf10f2b 100644 (file)
@@ -37,7 +37,7 @@ des.map([[
 ]]);
 -- 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
index d32a7911f0947bfa048065850113c154e21c3bfa..808d45faaafea6707045e75c5ef8465c6d4a1a33 100644 (file)
@@ -32,14 +32,14 @@ des.map([[
 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" })
index 60891c8c4d4f7ea8d30a3c703d03779449859a6e..c5efa0d29d7f48f7eae6220fbb97427c6a4fa987 100644 (file)
@@ -36,7 +36,7 @@ des.map([[
 ]]);
 -- 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")
index 6acc15da6836b2097a0359c86171ee38bfc98911..7197f1856bfadab87835d0ccceb1edc95c6d737e 100644 (file)
@@ -36,18 +36,18 @@ des.replace_terrain({ region = {34, 1,68,19}, fromterrain="}", toterrain=".", ch
 
 -- 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)
@@ -55,7 +55,7 @@ des.region({ region={41,08,46,12}, lit=1, type="ordinary", prefilled=1, irregula
              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)
@@ -66,7 +66,7 @@ des.region({ region={56,08,61,12}, lit=1, type="ordinary", prefilled=1, irregula
 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
index fdc9ae53129bc3e29cf479a836c3dd574130b05c..715cb5744f867a0281de580fb5d42525942cddca 100644 (file)
@@ -44,7 +44,7 @@ des.replace_terrain({ region={13,5, 33,15}, fromterrain="C", toterrain=".", chan
 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)
index 7085eba7880e581cbb3d66aa7673e1b38b30d019..cfe22dd78c5808b4965e227e47f13b6504c77819 100644 (file)
@@ -76,9 +76,9 @@ place:set(51,9);
 -- 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
index 4c614f5507efeb2b331d88ce0bed81b2cded2704..c2f05f02fb48e77993ef9a615bebdcd3651de20c 100644 (file)
@@ -230,7 +230,7 @@ des.region(selection.area(00,00,62,16),"unlit")
 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
@@ -244,8 +244,8 @@ des.region(selection.area(56,02,60,03),"lit")
 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")
index 6576176e2e06e9d2018a3d468b0017643beef10b..906d7f97c48ceaa163c37440d47c7c40cd43013c 100644 (file)
@@ -23,7 +23,7 @@ des.levregion({ region={01,00,79,20}, region_islev=1, exclude={0,0,8,7}, type="b
 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)
index f34d00af014f0bc0b6c35b128b6dc321243206aa..ae14a696634b829c5943985ec5b6e8ab84ce0b14 100644 (file)
@@ -22,7 +22,6 @@ des.levregion({ region={01,00,79,20}, region_islev=1, exclude={0,0,8,7}, type="s
 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)
index c1b4c204bd17ef95c9c954331380a3d3019ba633..e9603e8667c069d989fc397a3a977299c4f2c251 100644 (file)
@@ -39,7 +39,7 @@ des.levregion({ region = {08,16,08,16}, type="branch" });
 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 })
@@ -80,10 +80,10 @@ des.region(selection.area(46,06,48,06),"lit")
 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
@@ -109,7 +109,7 @@ des.region(selection.area(05,14,09,14),"unlit")
 --   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)
index 63a471904d8b8d7777a885a5837aca0eb9ec49d0..f9710081151723bfe3724b282b729737a11c2c71 100644 (file)
@@ -36,8 +36,8 @@ des.map([[
 -- 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" })
index 4b03631e7a60e72ab8fb5a2344af5c42866648c7..017b9b4b34aaf3d55651e17ef4c82128e8cfacf9 100644 (file)
@@ -32,9 +32,10 @@ des.map([[
 -- 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" })
index 221cb8172d3d712637168a854ac23276a426f30c..56f37c1c793a1f62379d4d8122a887e4a21f66fd 100644 (file)
@@ -37,7 +37,7 @@ place:set(66,05);
 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")
index c5f8e206dfae43ce020ec5b62e3da9da8095abc8..7df55430c884a2ec53f4a3d410eafb932888c3af 100644 (file)
@@ -40,7 +40,6 @@ place:set(10,08);
 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" });
index 30e1a23d75dd0a8d870f136990902a9f6a765be6..f86140518b307bd9507660ad64d9ca8cca6ddd80 100644 (file)
@@ -35,8 +35,8 @@ des.map([[
 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
index 5faac05a1573f420167d53fb82bb95b636a49b3f..8160cef07fa1291f29db83bcd564bc4e41159aff 100644 (file)
@@ -95,13 +95,13 @@ des.monster("dwarf")
 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)
index 7e3c88131e9e295b6223e2dd2eb95d983c522e55..ba642c625d9c7f402381c3e338aef4a7a9a97b1e 100644 (file)
@@ -36,11 +36,11 @@ des.levregion({ type="stair-down", region={61,03,75,19}, region_islev=1, exclude
 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)
index b042474910337ce099ee3d8a78b641cf2fc55372..109053c3d8de0c85a772c313053f52ee8166d024 100644 (file)
@@ -77,9 +77,9 @@ des.door("open",26,14)
 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")
index c99eff81d0d97b59b4c7096c2235b54b69f86e9d..84f7f7f993e714c0d0bbc7a35499c0b84c65d8cc 100644 (file)
@@ -36,7 +36,7 @@ des.region({ region={15,07, 21,10}, lit=1, type="temple", contents = function()
                 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
index f3866796047c4dbf0cf77ecf6c798722599dfe6e..1d6b7c09b0bd4fdff134e09d851b3c3926a8452a 100644 (file)
@@ -94,8 +94,7 @@ des.door("closed", 17, 11);
 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
index 48305895e97eb99b311a2358b0d54fee086a7d95..3b54a231e9a38a6565214c2ae146825991ccaad0 100644 (file)
@@ -96,8 +96,7 @@ des.door("locked",23,12)
 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
index 4b3947fe4fa2f893b9cf387a518b5472253491bc..85c3e18f415a7e8f64c229fb6358015635fe4a10 100644 (file)
@@ -12,7 +12,6 @@
 -- core calls themerooms_generate() multiple times per level
 -- to generate a single themed room.
 
-
 themerooms = {
   {
      -- the "default" room
@@ -263,7 +262,7 @@ themerooms = {
 |......|
 |......|
 |......|
---------]], 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
@@ -276,7 +275,7 @@ xxx|...|
 |......|
 |......|
 |......|
---------]], 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
@@ -289,7 +288,7 @@ xxx|...|
 ----...|
 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
@@ -302,7 +301,7 @@ xxx-----]], contents = function(m) des.region({ region={1,1,2,2}, type="ordinary
 |...----
 |...|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
@@ -324,7 +323,7 @@ if (percent(30)) then
    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,
 
@@ -337,7 +336,7 @@ x--.--x
 |.....|
 --...--
 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
@@ -351,7 +350,7 @@ x--...--x
 |.......|
 --.....--
 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
@@ -367,7 +366,7 @@ x-.......-x
 --.......--
 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
@@ -380,7 +379,7 @@ xxx|...|xxx
 |.........|
 |.........|
 |.........|
------------]], 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
@@ -396,7 +395,7 @@ xxx|...|xxx
 |...----
 |...|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
@@ -409,7 +408,7 @@ xxx|...|xxx
 ----...----
 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
@@ -425,7 +424,7 @@ xxx|...|
 ----...|
 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
@@ -441,7 +440,7 @@ xxx-----]], contents = function(m) des.region({ region={5,5,5,5}, type="ordinary
 ----...|
 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
@@ -454,7 +453,7 @@ xxx|......|
 |......----
 |......|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
@@ -470,7 +469,7 @@ xxx|...|
 |...----
 |...|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
@@ -483,7 +482,7 @@ xxx|...|
 ----......|
 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
@@ -499,7 +498,7 @@ xxx|...|xxx
 ----...----
 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
@@ -515,7 +514,7 @@ xx|.....|xx
 |.........|
 |...---...|
 |...|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
@@ -526,7 +525,7 @@ xx|.....|xx
 }|..|}
 }|..|}
 }----}
-}}}}}}]], 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);
index f283cb4158bc718f2c459d6741ba10f90571e736..b030925f7e337738f0d48f382360b2feec1e54c9 100644 (file)
@@ -53,9 +53,9 @@ end
 -- 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
index 3a40d6ae987cd2f663ad0921916e5380b87c0365..2e4a0af7956601d7fda0a3bd9f106a25f4c434ee 100644 (file)
@@ -28,12 +28,12 @@ des.levregion({ type="stair-up", region={01,00,79,20}, region_islev=1, exclude={
 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
index d9fd181a0d0a157c290b949e93166c50b9d0a7f5..825f2f34296467a1a2169ea0f4ce48dadb30a79c 100644 (file)
@@ -26,8 +26,8 @@ des.levregion({ type="stair-down", region={01,00,79,20}, region_islev=1, exclude
 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")
index 60e9dd0141ca4bb274684402c73b268c94f1767e..4f0baf922d6c0e32156350e0dbc73ec7376fa7d4 100644 (file)
@@ -27,11 +27,10 @@ des.levregion({ type="branch", region={01,00,79,20}, region_islev=1, exclude={0,
 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
index 27da21ed9b7871bc5bda72c9d053d4980f0923af..cc4835d7bcec83ff6ee938845be77a3926a930d4 100644 (file)
@@ -304,13 +304,13 @@ Set flags for this level.
 | 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.
@@ -471,7 +471,7 @@ Example:
 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
index 79708ebfea3c4e607b6c58931250f9d871251ad1..60c44d2fdbb4d67225c5919f461a81457289d30b 100644 (file)
@@ -2467,7 +2467,7 @@ E boolean FDECL(create_room, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
                               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);
index e7bd874ea63d659a2dfc560347d5d947881a819e..e707aa69527c2b949961d9273e7b6198463622c1 100644 (file)
@@ -90,6 +90,14 @@ enum roomtype_types {
 #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)
index 8213599070cf960797a49b75970095a3d42c4699..cf86388e3b299344d82df8c3863378ce6bc06010 100644 (file)
@@ -185,7 +185,7 @@ typedef struct _room {
     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 {
index b4d7efe0737bed724637e4846cedd1d14c7f85a5..670f8760aca5d47dd91f3c437f72cd52a9be1429 100644 (file)
@@ -757,7 +757,7 @@ struct mkroom *croom;
         fill_ordinary_room(croom->sbrooms[x]);
     }
 
-    if (!croom->needfill)
+    if (croom->needfill != FILL_NORMAL)
         return;
 
     /* put a sleeping monster inside */
@@ -916,7 +916,7 @@ makelevel()
                      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();
index b3b369c73819dc684f2689267377f9efc822db2b..258fa8f66effda8c1333b4771b824dd2cac18c51 100755 (executable)
@@ -1042,10 +1042,10 @@ fill_special_rooms()
 
     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]);
     }
 }
 
@@ -2682,14 +2682,14 @@ corridor *c;
  * 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 ? */
@@ -2770,7 +2770,7 @@ struct mkroom *mkr;
 #else
         topologize(aroom); /* set roomno */
 #endif
-        aroom->needfill = r->filled;
+        aroom->needfill = r->needfill;
         aroom->needjoining = r->joined;
         return aroom;
     }
@@ -3831,7 +3831,8 @@ lua_State *L;
         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]) {
@@ -5599,7 +5600,7 @@ genericptr_t arg;
 }
 
 /* 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)
@@ -5607,9 +5608,9 @@ lua_State *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();
@@ -5617,13 +5618,12 @@ lua_State *L;
     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 */
@@ -5668,10 +5668,16 @@ lua_State *L;
     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)
@@ -5689,8 +5695,7 @@ lua_State *L;
     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;
 
@@ -5711,9 +5716,6 @@ lua_State *L;
 #endif
     }
 
-    if (g.in_mk_themerooms && prefilled)
-        troom->needfill = 1;
-
     if (!room_not_needed) {
         if (g.coder->n_subroom > 1)
             impossible("region as subroom");
index 8cb281bce3e3f0e72dff33a4b5ead24cd9eefce8..9275d801ab1fa3dd054c45e7df12434c908bbe7c 100644 (file)
@@ -324,8 +324,8 @@ end
 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()