local vector2 = require("#microsoft.xna.framework.vector2")
local exCameraHelper = require("#Celeste.Mod.ExCameraDynamics.Code.Module.ExCameraInterop")

function onBegin()
    
    disableMovement()
    makeUnskippable ()

    local level = getLevel()
    coroutine.yield(exCameraHelper.Level_ZoomToFocus(level, vector2(-8, 1252), 2, 0.01))
    --coroutine.yield(level:ZoomSnap(vector2(160, 90), 2))
    
    local darkness = 1
    while (true) do
        wait(0.01)
        darkness = darkness - 0.05
        setDarkness (darkness)
        if darkness < 0.05 then
            break
        end
    end

    say("WHE_NaCline_D_01")

    walkTo (-28, false, 1.2, false)
    wait(0.3)
    walkTo (20, false, 1.2, false)
    wait(0.3)
    walkTo (-28, false, 1.2, false)
    wait(0.3)
    walkTo (20, false, 1.2, false)
    wait(0.3)
    walkTo (-28, false, 1.2, false)
    
    setDarkness (1)
    
    wait(0.5)

    teleportTo(680, 1471, "night_03")

    enableMovement()
    endCutscene ()

end



