local monocle = require("#monocle")

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

function onBegin(room)
  disableMovement()
  disableRetry()
  player.ForceCameraUpdate = true
  wait(1)
  playSound("event:/Nyan2026_Voicelines/roar3", player.Position)
  wait(2.5)
  playSound("event:/Nyan2026_Voicelines/roar2", player.Position)
  wait(1)
  say("Intro_PissedMaddy")
  wait(3)
  playSound("event:/Nyan2026_Voicelines/roar1", player.Position)
  wait(2)
  setFlag("donk_FadeOutBlackNyan", true)
  wait(1)
  say("Intro_PissedMaddy2")
  wait(0.5)
  walkTo(-620, false, 1, false)
  say("Intro_BackToBed")
  setFlag("donk_BedExplode", true)
  setFlag("donk_BedExplode_Die", true)
  playSound("event:/new_content/game/10_farewell/puffer_splode", player.Position)
  wait(2)
  say("Intro_PissedMaddy3")
  enableMovement()
end

function onEnd(room, wasSkipped)
  enableMovement()
  setFlag("donk_FadeOutBlackNyan", true)
  setFlag("donk_BedExplode", true)
  setFlag("donk_BedExplode_Die", true)
  player.DummyAutoAnimate = true
  player.ForceCameraUpdate = true
  getLevel():ResetZoom()
  enableMovement()
end