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

function onTalk()
    disableMovement()
	if not getFlag("disable_lightning") then
		coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CC_omori_sweetheartIntro"))
		playSound("event:/ashleybl/SYS_quest_get")
		endCutscene()
	else
		if not getFlag("SweetheartBerry") then
			coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CC_omori_sweetheart"))
			--coroutine.yield(luaCutscenesUtils.ChoiceWithDifferentFont("OMORI_GAME", "CC_omori_sweetheartAnswerA", "CC_omori_sweetheartAnswerB"))
			--if luaCutscenesUtils.GetChoice() == 1 then
			if choice("CC_omori_sweetheartAnswerA", "CC_omori_sweetheartAnswerB") == 1 then
				coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CC_omori_sweetheartConsequenceA"))
				playSound("event:/ashleybl/SYS_quest_complete")
				setFlag("SweetheartBerry",true)
				endCutscene()
			else
				playMusic("event:/none")
				coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CC_omori_sweetheartConsequenceB"))
				setFlag("Blackout",true)
				wait(3)
				setFlag("Blackout",false)
				playMusic("event:/ashleybl/citytheme",5)
				coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CC_omori_sweetheartConsequenceB2"))
				endCutscene()
			end
		else
			coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CC_omori_sweetheartGetLost"))
		end
	end
end

function onEnd()
    enableMovement()
end