git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7644 c06c8d41-db1a-0410-9941-cceddc491573
C3IXVWASG4ZZNG72FVRIT45VQHLBSP4YW5RE2JTJOQ3RAFRH5OUQC
function fill_special_room(mon, lord_mon, pack)
local level, tl_x, tl_y, br_x, br_y = dgn.get_special_room_info()
-- Return early if we're being called during map validation.
if not level then
return
end
if type(mon) == "table" then
local str = mon[1]
for i = 2, table.getn(mon) do
str = str .. " / " .. mon[i]
end
mon = str
end
local lord_x, los_y = -1, -1
if lord_mon then
lord_x = crawl.random_range(tl_x, br_x)
lord_y = crawl.random_range(tl_y, br_y)
end
for x = tl_x, br_x do
for y = tl_y, br_y do
if (pack or not crawl.one_chance_in(4))
and not (lord_x == x and lord_y == y)
then
dgn.create_monster(x, y, mon)
end
end
end
if lord_mon then
dgn.create_monster(lord_x, lord_y, lord_mon)
end
end
function sroom_kobold_lair()
local level = dgn.get_special_room_info()
-- Return early if we're being called during map validation.
if not level then
return
end
local level_mons = 3
if level < 4 then
level_mons = 0
elseif level < 6 then
level_mons = 1
elseif level < 9 then
level_mons = 2
end
local big_freq = 3 + level_mons
local small_freq = 10 - big_freq
local mon = "kobold w:" .. small_freq .. " / big kobold w:" .. big_freq
fill_special_room(mon, "big kobold")
end
function sroom_orc_lair()
local level = dgn.get_special_room_info()
function fill_special_room(mon)
-- Return early if we're being called during map validation.
if not level then
return
end
local mon
if level > 24 then
mon = "orc w:2 / orc warrior w:3 / orc knight w:2 / ogre w:2 / "
.. "troll w:1"
elseif level > 15 then
mon = "orc w:6 / orc knight w:1 / orc warrior w:2 / ogre w:1"
elseif level > 9 then
mon = "orc w:8 / orc warrior w:2"
else
mon = "orc w:9 / orc warrior w:1"
end
fill_special_room(mon)
end
function sroom_beehive()
local mons = {}
mons[1] = "ooze w:" .. (27 - math.floor(level / 5))
mons[2] = "jelly w:20"
mons[3] = "brown_ooze w:" .. (3 + level)
mons[4] = "death ooze w:" .. (2 + (2 * math.floor(level / 3)))
if level >= 12 then
mons[5] = "azure jelly w:" .. (1 + math.floor((level - 12)/3))
end
if level >= 15 then
mons[6] = "acid blob w:" .. (1 + math.floor((level - 15) / 4))
end
fill_special_room(mons, nil, true)
end