local function doFadeWipe(state)
  local Color = require("#Microsoft.Xna.Framework.Color")
  local screenWipe = require("#Celeste.ScreenWipe")
    fadeWipe = celeste.FadeWipe(engine.Scene, state, nil)
    engine.Scene:Add(fadeWipe)
    fadeWipe.duration = 8
    fadeWipe.EndTimer = 3
    screenWipe.WipeColor = Color.White
end

local luaCutscenesUtils = require("#Celeste.Mod.MaxHelpingHand.Module.LuaCutscenesUtils")


function onBegin()

  if getFlag("msgroomout") then

    disablePause()
    disableMovement()
    player.ForceCameraUpdate = true

    coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CBR_BlackSpace_door3_msgroom_finalbom_door_question"))

    coroutine.yield(luaCutscenesUtils.ChoiceWithDifferentFont("OMORI_GAME", "CBR_BlackSpace_door3_msgroom_finalbom_door_answer1", "CBR_BlackSpace_door3_msgroom_finalbom_door_answer2"))
    local multipla = luaCutscenesUtils.GetChoice()

    if multipla == 1 then

      doFadeWipe(false)
      wait(5)
      setFlag("msgroomsaida", false)
      setFlag("msgroomout", false)
      setFlag("backtosapato")

    else

      wait(0.2)
      setFlag("msgroomout", false)
      enableMovement()
      enablePause()

    end

  end

end