git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7619 c06c8d41-db1a-0410-9941-cceddc491573
DUFJKFM5KBCM4272ZKLBPGKHLMDLK6RABUNTDEWRZULTKDTHHSBAC local function monster_creator_fn(arg)local atyp = type(arg)if atyp == "string" thenlocal _, _, branch = string.find(arg, "^place:(%w+):")return function (x, y, nth)if branch thenset_floor_colour(dgn.br_floorcol(branch))endreturn dgn.create_monster(x, y, arg)endelseif atyp == "table" thenif arg.cond() thenreturn monster_creator_fn(arg.spec)endelsereturn argendend
local function set_floor_colour(colour)if not zig().level.floor_colour thenzig().level.floor_colour = colourdgn.change_floor_colour(colour, false)endendlocal function set_random_floor_colour()set_floor_colour( random_floor_colour() )end
local function monster_creator_fn(arg)local atyp = type(arg)if atyp == "string" thenlocal _, _, branch = string.find(arg, "^place:(%w+):")return function (x, y, nth)if branch thenset_floor_colour(dgn.br_floorcol(branch))endreturn dgn.create_monster(x, y, arg)endelseif atyp == "table" thenif arg.cond() thenreturn monster_creator_fn(arg.spec)endelsereturn argendend