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/letsnotdragon", player.Position)
  wait(2)
  say("Outro_PissedMaddyYou")
  walkTo(39106, false, 1, false)
  wait(0.5)
  playSound("event:/Nyan2026_Voicelines/fullnetherite", player.Position)
  wait(3)
  playSound("event:/Nyan2026_Voicelines/letsmakethisquick", player.Position)
  wait(5)
  say("Outro_PissedMaddyQuick")
  wait(0.5)
  playSound("event:/Nyan2026_Voicelines/yeah", player.Position)
  wait(1.5)
  say("Outro_PissedMaddyQuickNext")
  wait(0.5)
  playSound("event:/Nyan2026_Voicelines/mahjong", player.Position)
  wait(2.5)
  say("Outro_PissedMaddyQuickMahjong") 
  wait(1)
  playSound("event:/Nyan2026_Voicelines/sistersplinterbit", player.Position)
  wait(34)
  say("Outro_PissedMaddySisterSplinter") 
  wait(1)
  playSound("event:/Nyan2026_Voicelines/countof67", player.Position)
  wait(20)
  setFlag("donk_KillDragon", True)
  wait(1)
  playSound("event:/Nyan2026_Voicelines/ouch1", player.Position)
  wait(0.5)
  playSound("event:/Nyan2026_Voicelines/enderdragonDie", player.Position)
  say("Intro_PissedMaddySaved") 
  enableMovement()
end

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