local LD = require("design.LevelDesignLibrary")
local timer = require("level.timer")
local player, playerPosition, pad
local DarkOneShadow = false
local WallPressOff = false
function OnScriptLoaded(level)
  player = game.Player.FindPlayer()
  pad = player.Pad
end
function OnUpdate(level)
  playerPosition = player.WorldPosition
  if game.World.IsInsideCameraZone(playerPosition, "WallPress_Alf490HivePress_Exit") and player:HasMarker("Exit") then
    game.Camera.SubmitCameraByName("ENV_Alf490_WallPressExit_Hack")
  end
  if game.Player.FindPlayer():InsideZone(GameObjects.DarkOneShadowZone) and DarkOneShadow == false then
    DarkOneShadow = true
    GameObjects.SuddenDarkOne2:PlayAnimToEnd()
  end
  if game.Player.FindPlayer():InsideZone(GameObjects.TurnOffWallPress) and WallPressOff == false then
    WallPressOff = true
    GameObjects.Squeeze:HideTraversePath()
  end
end
function FirePulse()
end
function ExitClimbEvent()
  GameObjects.CA_SyncExitHelper.LuaObjectScript.Enable()
  GameObjects.CA_ShieldEyes.LuaObjectScript.Disable()
  GameObjects.CA_AlertWait.LuaObjectScript.Disable()
end
function ClimbBottomEvent()
  GameObjects.CA_AlertWait.LuaObjectScript.Enable()
end
function TriggerCrawlyDarkOnes()
  LD.PlaySound(GameObjects.SNDGrpPOIDidYouHearThat.SoundEmitters[1], "SND_POI_Alf_490_Did_You_Hear_That")
  timer.StartLevelTimer(0.1, function()
    GameObjects.ClonePoseController20_1.LuaObjectScript.Enable()
  end)
  timer.StartLevelTimer(8, function()
    GameObjects.ClonePoseController21_1.LuaObjectScript.Enable()
  end)
  timer.StartLevelTimer(4, function()
    GameObjects.ClonePoseController22_1.LuaObjectScript.Enable()
  end)
  timer.StartLevelTimer(14, function()
    GameObjects.ClonePoseController23_1.LuaObjectScript.Enable()
  end)
  timer.StartLevelTimer(10, function()
    GameObjects.ClonePoseController24_1.LuaObjectScript.Enable()
  end)
  timer.StartLevelTimer(1, function()
    GameObjects.ClonePoseController25_1.LuaObjectScript.Enable()
  end)
  timer.StartLevelTimer(3, function()
    GameObjects.ClonePoseController26_1.LuaObjectScript.Enable()
  end)
end
function EZE_InputMaskOn()
  LD.SetEntityVariable("ALF_InputMaskStage", 490)
  pad:DisableGameButton(tweaks.ePad.kPadSquare)
  pad:DisableGameButton(tweaks.ePad.kPadL1)
  pad:DisableGameButton(tweaks.ePad.kPadL2)
  pad:DisableGameButton(tweaks.ePad.kPadL3)
  pad:DisableGameButton(tweaks.ePad.kPadR1)
  pad:DisableGameButton(tweaks.ePad.kPadR2)
  pad:DisableGameButton(tweaks.ePad.kPadR3)
  pad:DisableGameButton(tweaks.ePad.kPadUp)
  pad:DisableGameButton(tweaks.ePad.kPadLeft)
  pad:DisableGameButton(tweaks.ePad.kPadDown)
  pad:DisableGameButton(tweaks.ePad.kPadRight)
end
function EZE_InputMaskOff()
  LD.SetEntityVariable("ALF_InputMaskStage", 0)
  pad:ClearAllDisabledGameButtons()
end
function TriggerFloorBreak()
  GameObjects.FloorBreak_490.Child:PlayAnimToEnd()
end
