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

function onTalk()
    disableRetry()
    disableMovement()
    walkTo(16620, false, 1.0, false)
	local luanet = _G.luanet    
    player.Facing = luanet.enum(luanet.import_type("Celeste.Facings"), "Right")
	celeste.Audio.SetMusicParam("dialog", 1.0)
	engine.Scene:add(coroutineEntity)
	coroutineEntity:add(monocle.Coroutine(getLevel():ZoomTo(vector2(172, 90), 1.25, 0.5)))
    say("SJ2021_SOLOIINI_COOLANT_A")
	coroutineEntity:add(monocle.Coroutine(getLevel():ZoomAcross(vector2(176, 90), 1.5, 0.5)))
	say("SJ2021_SOLOIINI_COOLANT_B")
	coroutineEntity:add(monocle.Coroutine(getLevel():ZoomAcross(vector2(172, 90), 1.25, 0.5)))
	say("SJ2021_SOLOIINI_COOLANT_C")
	coroutineEntity:add(monocle.Coroutine(celeste.CutsceneEntity.CameraTo(vector2(16396, -3185), 1.0)))
	wait(1.0)
	setFlag("solar_coolant_plotmoment", true)
	wait(1.0)
	coroutineEntity:add(monocle.Coroutine(celeste.CutsceneEntity.CameraTo(vector2(16456, -3025), 1.0)))
	wait(1.0)
	coroutine.yield(getLevel():ZoomBack(0.5))
    end

function onEnd()
	getLevel():remove(coroutineEntity)
	celeste.Audio.SetMusicParam("dialog", 0.0)
	setFlag("solar_coolant_plotmoment", true)
	setFlag("solar_coolant_block_path", false)
    enableRetry()
    enableMovement()
end