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

function onTalk()
    disableMovement()
	
	if not getFlag("deliveryQuestOngoing") and getFlag("disable_lightning") then
		if not getFlag("foundAllBozos") then
			coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CC_omori_jawsum"))
			playSound("event:/ashleybl/SYS_quest_get")
			setFlag("deliveryQuestOngoing",true)
			if getFlag("map_Base") and not getFlag("HK_CantOpenMap") and not getFlag("Jawsum_Map_message") then
				coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CC_omori_jawsumMap"))
				setFlag("Jawsum_Map_message",true)
			end
		end
	else
		if not getFlag("disable_lightning") then
		coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CC_omori_jawsumIsMean"))
		end
	end
	if getFlag("foundAllBozos") then
		coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CC_omori_jawsumEndedQuest"))
	end
end

function onEnd()
    enableMovement()
end