local vector2 = require("#microsoft.xna.framework.vector2")
local coroutineEntity = monocle.Entity()

function onBegin()
    disableRetry()
    disableMovement()
	celeste.Audio.SetMusicParam("dialog", 1.0)
	engine.Scene:add(coroutineEntity)
	coroutineEntity:add(monocle.Coroutine(getLevel():ZoomTo(vector2(108, 94), 1.5, 0.01)))
	wait(1.0)
	say("SJ2021_SOLOIINI_LUXURYSUITE_A")
	coroutineEntity:add(monocle.Coroutine(getLevel():ZoomAcross(vector2(141, 92), 1.2, 0.9)))
	wait(0.9)
	say("SJ2021_SOLOIINI_LUXURYSUITE_B")
	walkTo(15444, false, 1.15, false)
	coroutineEntity:add(monocle.Coroutine(getLevel():ZoomAcross(vector2(205, 92), 1.4, 0.5)))
	wait(0.4)
	say("SJ2021_SOLOIINI_LUXURYSUITE_C")
	coroutineEntity:add(monocle.Coroutine(getLevel():ZoomAcross(vector2(225, 96), 1.8, 0.5)))
	wait(0.5)
	celeste.Audio.SetMusicParam("kick", 0.0)
	say("SJ2021_SOLOIINI_LUXURYSUITE_D")
	coroutineEntity:add(monocle.Coroutine(getLevel():ZoomAcross(vector2(205, 92), 1.4, 0.6)))
	wait(0.5)
	celeste.Audio.SetMusicParam("kick", 1.0)
	say("SJ2021_SOLOIINI_LUXURYSUITE_E")
	coroutine.yield(getLevel():ZoomBack(0.6))
    end

function onEnd(level, wasSkipped)
	getLevel():remove(coroutineEntity)
	celeste.Audio.SetMusicParam("dialog", 0.0)
	setFlag("luxurySuiteEnter", false)
	enableRetry()
    enableMovement()
	if wasSkipped then
		teleportTo(15444, 2192)
	end
end