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

function onBegin()
    disableMovement()
    player.DummyAutoAnimate = true
    walkTo(1350)
    setFlag("darkness_fade", false)
    wait(1)
    walkTo(1600, false, 0.9)
    miniTextbox("AnEnormousSmileyFace_RestlessDays_intro_shout")
    walkTo(1660, false, 0.9)
    wait(0.7)
    walkTo(1650)
    wait(0.5)
    walkTo(1528)
    wait(0.3)
    player.DummyAutoAnimate = false
    player.Sprite:Play("lookUp")
    wait(0.3)
    miniTextbox("AnEnormousSmileyFace_RestlessDays_intro_beg")
    wait(1.7)
    player.DummyAutoAnimate = true
    wait(0.3)
    walkTo(1550, true)
    wait(1.5)
    walkTo(1570, true)
    wait(2.7)
    miniTextbox("AnEnormousSmileyFace_RestlessDays_intro_escape")
    walkTo(1740)
    coroutine.yield(engine.Scene:ZoomTo(vector2(115, 105), 1.4, 0.1))
    wait(0.9)
    coroutine.yield(engine.Scene:ZoomAcross(vector2(115, 105), 1.7, 0.1))
    wait(1.3)
    coroutine.yield(engine.Scene:ZoomAcross(vector2(115, 105), 2, 0.1))
    wait(1.45)
    setFlag("crystal_0", true)
    setFlag("crystal_play", true)
    setFlag("crystal_call", true)
    wait(0.55)
    setFlag("flashbang", true)
end

function onEnd()
    enableMovement()
    instantTeleportTo(1872, 376, "intro-03")
end