RegisterSpawnFunction(0xffffeedd, "init")
RegisterSpawnFunction(0xff308446, "spawn_kobold")
RegisterSpawnFunction(0xffE55137, "spawn_fireplace")
RegisterSpawnFunction(0xff47402E, "spawn_gem")
RegisterSpawnFunction(0xff3F888F, "spawn_lantern")
RegisterSpawnFunction(0xff7D7F7D, "spawn_brewing_stand")
RegisterSpawnFunction(0xff4E5754, "spawn_goods")
RegisterSpawnFunction(0xff89AC76, "spawn_vine")
RegisterSpawnFunction(0xffCC0605, "spawn_")
RegisterSpawnFunction(0xff84C3BE, "spawn_")
RegisterSpawnFunction(0xff7D8471, "spawn_")
RegisterSpawnFunction(0xff474B4E, "spawn_")

function init(x, y, w, h)
	LoadPixelScene("mods/lewd_noita/files/kobold_lair/kobold_lair.png", "", x, y, "mods/lewd_noita/files/kobold_lair/kobold_lair_bg.png", true)
end

function spawn_kobold(x, y)
	EntityLoad("mods/lewd_noita/files/enemies/kobold.xml", x, y)
end

-- thanks to graham's things mod for fireplace
function spawn_fireplace(x, y)
	EntityLoad("mods/lewd_noita/files/kobold_lair/fireplace.xml", x, y)
end

function spawn_gem(x, y)
	SetRandomSeed(x, y)
	local rand = Random(1, 5)
	if rand == 1 then
		EntityLoad("data/entities/props/physics_stone_01.xml", x, y)
	elseif rand == 2 then
		EntityLoad("data/entities/props/physics_stone_02.xml", x, y)
	elseif rand == 3 then
		EntityLoad("data/entities/props/physics_stone_03.xml", x, y)
	elseif rand == 4 then
		EntityLoad("data/entities/props/physics_stone_04.xml", x, y)
	elseif rand == 5 then
		EntityLoad("data/entities/props/physics_gem.xml", x, y)
	end
end

function spawn_lantern(x, y)
	EntityLoad("data/entities/props/physics/temple_lantern.xml", x, y)
end

function spawn_brewing_stand(x, y)
	EntityLoad("data/entities/props/physics_brewing_stand.xml", x, y)
end

function spawn_goods(x, y)
	SetRandomSeed(x, y)
	local rand = Random(1, 7)
	if rand == 1 then
		EntityLoad("data/entities/props/physics_box_harmless.xml", x, y)
	elseif rand == 2 then
		EntityLoad("data/entities/props/physics_box_harmless_small.xml", x, y)
	elseif rand == 3 then
		EntityLoad("data/entities/props/physics_barrel_water.xml", x, y)
	elseif rand == 4 then
		EntityLoad("data/entities/props/physics_bottle_blue.xml", x, y)
	elseif rand == 5 then
		EntityLoad("data/entities/props/physics_bottle_green.xml", x, y)
	elseif rand == 6 then
		EntityLoad("data/entities/props/physics_bottle_red.xml", x, y)
	elseif rand == 7 then
		EntityLoad("data/entities/props/physics_bottle_yellow.xml", x, y)
	end
end

function spawn_vine(x, y)
	SetRandomSeed(x, y)
	local rand = Random(1, 4)
	if rand == 1 then
		EntityLoad("data/entities/verlet_chains/vines/verlet_vine.xml", x, y)
	elseif rand == 2 then
		EntityLoad("data/entities/verlet_chains/vines/verlet_vine_long.xml", x, y)
	elseif rand == 3 then
		EntityLoad("data/entities/verlet_chains/vines/verlet_vine_short.xml", x, y)
	elseif rand == 4 then
		EntityLoad("data/entities/verlet_chains/vines/verlet_vine_shorter.xml", x, y)
	end
end