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

local function doFadeWipe(state)
    fadeWipe = celeste.FadeWipe(engine.Scene, state, nil) -- (state = "false" escurece ,"true" clareia)
    engine.Scene:Add(fadeWipe)
    fadeWipe.duration = 1.5
    fadeWipe.EndTimer = 2
  end


  function onBegin()
    disablePause()
    disableMovement()
	walkTo(-6597)

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

    coroutine.yield(luaCutscenesUtils.ChoiceWithDifferentFont("OMORI_GAME", "CBR_DeepWell_RoadEndchoice1", "CBR_DeepWell_RoadEndchoice2"))
    local deeperwell = luaCutscenesUtils.GetChoice()
  
    if deeperwell == 1 then

      doFadeWipe(false)
      walk(-22)
      wait(0.6)
      setFlag("deeperwell_in")

    else

      wait(0.2)
      walk(30)
      enableMovement()
      enablePause()

    end

      -- disablePause()
      -- disableMovement()
      -- doFadeWipe(false)
      -- wait(1.3)
      -- setFlag("tp01")

  end