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

function onBegin()
    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)
	celeste.Audio.SetMusicParam("kick", 0.0)
	engine.Scene:add(coroutineEntity)
	coroutineEntity:add(monocle.Coroutine(getLevel():ZoomTo(vector2(170, 90), 1.35, 0.5)))
    say("SJ2021_SOLOIINI_CONFRONTATION")
	celeste.Audio.SetMusicParam("kick", 1.0)
    say("SJ2021_SOLOIINI_CONFRONTATION_B")
	coroutineEntity:add(monocle.Coroutine(getLevel():ZoomAcross(vector2(135, 80), 1.2, 0.5)))
	wait(0.55)
	setFlag("solex_arrogancerumble", true)
	wait(1.0)
	coroutine.yield(getLevel():ZoomBack(0.5))
    end

function onEnd()
	getLevel():remove(coroutineEntity)
	celeste.Audio.SetMusicParam("dialog", 0.0)
	celeste.Audio.SetMusicParam("kick", 1.0)
    setFlag("solex_arrogancerumble", true)
    enableRetry()
    enableMovement()
end