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


function onTalk()

  if getFlag("mordomo") and getFlag("catdead") then

    disablePause()
    disableMovement()
    coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CBR_BlackSpace_door1_room6_burtler3"))
    enableMovement()
    enablePause()

  end

  if getFlag("mordomo") and not getFlag("catdead") then

    disablePause()
    disableMovement()
    coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CBR_BlackSpace_door1_room6_burtler1"))
    enableMovement()
    enablePause()

  end

  if not getFlag("mordomo") then

    disablePause()
    disableMovement()
    coroutine.yield(luaCutscenesUtils.SayWithDifferentFont("OMORI_GAME", "CBR_BlackSpace_door1_room6_burtler1"))
    wait(0.25)

    playSound("event:/game/WanderBDay/omori_key", player.Position)
    wait(1)

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

    setFlag("mordomo")
    setFlag("catinteract")
    enableMovement()
    enablePause()

  end

end