local luaCutscenesUtils = require("#Celeste.Mod.MaxHelpingHand.Module.LuaCutscenesUtils")

function onTalk()
    disableMovement()
	coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CC_omori_librarydoor"))
	coroutine.yield(luaCutscenesUtils.ChoiceWithDifferentFont("OMORI_GAME", "CC_omori_librarydooryes", "CC_omori_librarydoorno"))
	if luaCutscenesUtils.GetChoice() == 1 then
		setMusicLayer(1,0)
		setMusicLayer(2,0)
		setMusicLayer(3,0)
		setMusicLayer(4,0)
		coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CC_omori_librarydoorEntering"))
		setFlag("blackout",true)
		wait(0.5)
		enableMovement()
		setFlag("deliveryQuestOngoing",false)
		setColorGrade("none",true)
		teleportTo(20728,-3080,"e-library-01")
	else
		coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CC_omori_librarydoorNoEntering"))
	end
end

function onEnd()
    enableMovement()
end