local monocle = require("#monocle")

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

function onBegin(room)
  disableMovement()
  disableRetry()
  player.ForceCameraUpdate = true
  walkTo(5996, false, 1, false)
  coroutine.yield(getLevel():ZoomTo(vector2(160, 110), 1.6, 2))
  say("Ch3_FreezeOver2_Donk")
  playSound("event:/Donk_OrionsBelt/sfx_FreezeOver", player.Position)
  setFlag("donk_FreezeOver2_A", true)
  wait(0.2)
  setFlag("donk_FreezeOver2_B", true)
  wait(0.2)
  setFlag("donk_FreezeOver2_C", true)
  wait(0.2)
  setFlag("donk_FreezeOver2_D", true)
  wait(0.2)
  coroutine.yield(engine.Scene:ZoomBack(1))
  enableMovement()
end

function onEnd(room, wasSkipped)
  enableMovement()
  player.DummyAutoAnimate = true
  player.ForceCameraUpdate = true
  setFlag("donk_FreezeOver2_A", true)
  setFlag("donk_FreezeOver2_B", true)
  setFlag("donk_FreezeOver2_C", true)
  setFlag("donk_FreezeOver2_D", true)
  setFlag("donk_FreezeOver2_E", true)
  getLevel():ResetZoom()
  enableMovement()
end