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

function onBegin()
    setFlag("phone_visible", true)
    disableMovement()
    player.DummyAutoAnimate = false
    player.ForceCameraUpdate = true
    player.Sprite:PlayOffset("faint", 9*0.1)
    player.Sprite:Stop()
    wait(5)
    player.ForceCameraUpdate = true
    playMusic("event:/game/02_old_site/sequence_phone_ring_loop")
    wait(1.5)
    setFlag("flashbang", false)
    wait(3)
    coroutine.yield(engine.Scene:ZoomTo(vector2(70, 130), 2.5, 3))
    wait(1)
    player.DummyAutoAnimate = true
    walkTo(1770)
    wait(0.5)
    player.DummyAutoAnimate = false
    player.Sprite:Play("duck")
    wait(0.5)
    setFlag("phone_visible", false)
    wait(0.2)
    player.DummyAutoAnimate = true
    wait(0.3)
    playMusic("event:/game/02_old_site/sequence_phone_pickup")
    wait(0.05)
    playMusic("event:/game/02_old_site/sequence_phone_pickup")
    wait(0.5)
    miniTextbox("AnEnormousSmileyFace_RestlessDays_boss_get_to_work")
    wait(0.3)
    coroutine.yield(engine.Scene:ZoomAcross(vector2(160, 90), 1, 5))
    wait(2)
    enableMovement()
end

function onEnd()
    setFlag("phone_visible", false)
    setFlag("flashbang", false)
    playMusic("")
    engine.Scene:ResetZoom()
    enableMovement()
end