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(1307, 2450), 1, 0.01))

    player.ForceCameraUpdate = true
    walkTo (1477, false, 1.2, false)
    wait(0.5)
    player.DummyAutoAnimate = false
    player.Sprite:Play("lookUp")
    wait(0.5)
    say("WHE_NaCline_E_01")
    wait(1)
    say("WHE_NaCline_E_02")
    wait(0.5)
    playSound("event:/WHE/WHE_bird")
    wait(2)
    say("WHE_NaCline_E_03")

    wait(1)

    setFlag("morning", false)
    player.ForceCameraUpdate = false

    local darkness = getDarkness ()
    while (true) do
        wait(0.01)
        darkness = darkness + 0.02
        setDarkness (darkness)
        if darkness > 0.98 then
            break
        end
    end

    wait(0.5)
    player.DummyAutoAnimate = true

    teleportTo(1992, 2487, "fade_01")
    
    enableMovement()
    endCutscene ()
    
end


