-- LocSecurityStation

LocSecurityStation = Location:new("LocSecurityStation")

----------------------------------------------------------------------------------------------------
function LocSecurityStation_UPDATE()
	return 0
end

----------------------------------------------------------------------------------------------------
function LocSecurityStation_INIT()
    LocSecurityStation:init()
end

----------------------------------------------------------------------------------------------------
LocSecurityStation:setSceneHandler(1,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'nippers'})
        elseif aEvent == "generic_init" then
            
            aScene:setHidsParams({"nippers"}, {inventory = true})
            aScene:setWinTerms({"ho_collected", "activate_lock"})

        elseif aEvent == "start" then
        
            aScene:setRemark('ids_remark_locsecuritystation_1')
            aScene:setTask('ids_challenge_locsecuritystation_1')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("lock", "nippers")

        elseif aEvent == "activate_lock" then
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        end
    end)

----------------------------------------------------------------------------------------------------
LocSecurityStation:setSceneHandler(2,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'bottle1'})
        elseif aEvent == "generic_init" then
            
            aScene:setHidsParams({"bottle1"}, {inventory = true})
            aScene:setWinTerms({"ho_collected", "activate_pult"})

        elseif aEvent == "start" then
        
            aScene:setRemark('ids_remark_locsecuritystation_2')
            aScene:setTask('ids_challenge_locsecuritystation_2')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("pult", "bottle1")

        elseif aEvent == "activate_pult" then
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        end
    end)

----------------------------------------------------------------------------------------------------
LocSecurityStation:setSceneHandler(3,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'usb_device', 'chicken'})
        elseif aEvent == "generic_init" then
            
            aScene:setHidsParams({"usb_device"}, {inventory = true})
            aScene:setWinTerms({"ho_collected", "activate_computer"})

        elseif aEvent == "start" then
        
            aScene:setRemark('ids_remark_locsecuritystation_3')
            aScene:setTask('ids_challenge_locsecuritystation_3')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("computer", "usb_device")

        elseif aEvent == "activate_computer" then
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        end
    end)

----------------------------------------------------------------------------------------------------
LocSecurityStation:setSceneHandler(4,
    function (aScene, aEvent)

        -- extra(monitor_video) play(video_cassette -> video_player)

        if aEvent == "capture" then
            aScene:captureObjects({'usb_device'})
        elseif aEvent == "generic_init" then
            
            aScene:setHidsParams({"video_cassette"}, {inventory = true})
            aScene:setWinTerms({"ho_collected", "activate_video_player"})

        elseif aEvent == "start" then
        
            aScene:setRemark('ids_remark_locsecuritystation_4')
            aScene:setTask('ids_challenge_locsecuritystation_4')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("video_player", "video_cassette")

        elseif aEvent == "activate_click_video_player" then
            aScene:setExtraParams('monitor_video', {play = true})

        elseif aEvent == "activate_video_player" then
            aScene:setExtraParams('monitor_video', {play = false, frame = 77})
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        end
    end)

----------------------------------------------------------------------------------------------------
LocSecurityStation:setSceneHandler(5,
    function(aScene, aEvent)

        -- pills_sec -> humburger

        if aEvent == "generic_init" then
            
            aScene:setHidsParams({"pills_sec"}, {inventory = true})
            aScene:setWinTerms({"ho_collected", "activate_humburger"})

        elseif aEvent == "start" then
			aScene:setRemark('ids_remark_locsecuritystation_5')
            aScene:setTask('ids_challenge_locsecuritystation_5')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("humburger", "pills_sec")

        elseif aEvent == "activate_humburger" then
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        end
    end)