-- NOTES:

-- [play Quirrel anim frames 0-4, spawn particles, whiteout,
-- play Quirrel anim frame 5, spawn particles+MonomonFloating
-- play Quirrel anim frames 6-7  > trigger 2 flags
-- (one should allow for the Monomon dream nail cutscene)]

-- Xelk says...: "on interacing w the first quirrel npc dialog,
-- that's when the cutscene starts.
-- So it should be the dialog id that ends with a _A"

function onTalk()
	disableMovement()
	disableRetry()
	wait(0.1)
	say("CC_XELKHK_Q_TA_A")
	wait(0.2)
	setFlag("TA-04_FirstInteraction",true)-- QuirrelA
	setFlag("TA-04_FirstInteractionB",true)
	wait(0.4)
	setFlag("TA-04_FirstInteractionB",false)
	setFlag("TA-04_SecondInteraction",true) -- QuirrelD holding the mask

	-- TODO spawn particles
	setFlag("whiteFade",true)
	wait(0.217)
	setFlag("TA-04_ThirdInteraction",true)
	setFlag("TA-04_SecondInteraction",false)
	setFlag("TA-04_MonomonSpawned",true)
	setFlag("TA-04_MonomonParticles",true) -- 1.2 seconds later they disappear
	setFlag("whiteFade",false)
	wait(0.1)
	setFlag("TA-04_ThirdInteraction",false)
	setFlag("TA-04_FourthInteraction",true) -- QuirrelC on the ground
	wait(0.17)
	setFlag("TA-04_FourthInteraction",false)
	setFlag("TA-04_FifthInteraction",true) -- QuirrelE so he doesn't do squats
	wait(1)
	setFlag("TA-04_MonomonParticles",false)
	setFlag("TA-04_CanDreamNail",true)
	say("CC_XELKHK_Q_TA_B")
end

function onEnd()
	enableMovement()
	enableRetry()
	setFlag("whiteFade",false)
	setFlag("TA-04_FirstInteraction",true)
	setFlag("TA-04_FirstInteractionB",false)
	setFlag("TA-04_SecondInteraction",false)
	setFlag("TA-04_ThirdInteraction",false)
	setFlag("TA-04_FourthInteraction",false)
	setFlag("TA-04_FifthInteraction",true)
	setFlag("TA-04_MonomonParticles",false)
	setFlag("TA-04_CanDreamNail",true)
	setFlag("FCrQuirrel",true)
	setFlag("FCQuirrel", true)
	setFlag("FWQuirrel", true)
	setFlag("DQuirrel", true)
	setFlag("CoTQuirrel", true)
	setFlag("CPQuirrel", true)
	setFlag("Quirrel", true)
	setFlag("QuirrelRGA", true)
	setFlag("TA-04_Monomon_Cutscene_Talkable", true)
	setFlag("TA-04_Monomon_Cutscene_Seen",true)
end