-- LocObservationDeck

LocObservationDeck = Location:new("LocObservationDeck")

----------------------------------------------------------------------------------------------------
function LocObservationDeck_UPDATE()
	return 0
end

----------------------------------------------------------------------------------------------------
function LocObservationDeck_INIT()
    LocObservationDeck:init()
end

----------------------------------------------------------------------------------------------------
LocObservationDeck:setSceneHandler(1,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'scrap', 'guitar'})

        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected","activate_door"})
            aScene:setHidsParams({"scrap"}, {inventory = true})
            aScene:setHidsParams({"guitar"}, {active = false})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locobservationdeck_1') 
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("door", "scrap")
            aScene:setTask("ids_challenge_locobservationdeck_1")

        elseif aEvent == "activate_click_door" then
            aScene:setExtraParams("door_shadow", {play = true})

        elseif aEvent == "activate_door" then
            aScene:setExtraParams("door_shadow", {play = false, frame = 82})
            aScene:setInteractParams("door", {active = false})
            aScene:setHidsParams({"guitar"}, {active = true})
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        end
    end)

----------------------------------------------------------------------------------------------------
LocObservationDeck:setSceneHandler(2,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'blue_balloon', 'newspaper', 'balloon_with_newspaper'})

        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_glass"})
            
        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locobservationdeck_2') 
            aScene:setTask('ids_challenge_locobservationdeck_2')
            aScene:attachHids(aScene:getHidList({except = {'balloon_with_newspaper'}}))
            aScene:addItemMix('balloon_with_newspaper', {'blue_balloon', 'newspaper'})

        elseif aEvent == "found_balloon_with_newspaper" then
            aScene:attachInteract("glass", "balloon_with_newspaper")

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

        end
    end)

----------------------------------------------------------------------------------------------------
LocObservationDeck:setSceneHandler(3,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'camera_observ', 'tripod_observ'})

        elseif aEvent == "generic_init" then
            aScene:setWinTerms({"ho_collected", "activate_elevator_entrance"})
            
        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locobservationdeck_3') 
            aScene:setTask('ids_challenge_locobservationdeck_3')
            aScene:attachHids(aScene:getHidList({except = {'tripod_camera'}}))
            aScene:addItemMix('tripod_camera', {'camera_observ', 'tripod_observ'})
 
        elseif aEvent == "found_tripod_camera" then
            aScene:attachInteract("elevator_entrance", "tripod_camera")

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

----------------------------------------------------------------------------------------------------
LocObservationDeck:setSceneHandler(4,
    function (aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'hook_obs', 'rope_obs'})

        elseif aEvent == "generic_init" then
            aScene:setWinTerms({"ho_collected"})
            aScene:setHidsParams({"grappling_hook"}, {inventory = false})
            
        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locobservationdeck_4')
            aScene:setTask('ids_challenge_locobservationdeck_4')
            aScene:attachHids(aScene:getHidList({except = {'grappling_hook'}}))
            aScene:addItemMix('grappling_hook', {'hook_obs', 'rope_obs'})
        
        elseif aEvent == "found_grappling_hook" then
            aScene:setTask("ids_collect_ho")
            
        elseif aEvent == "ho_collected" then
            aScene:onChallengeComplete()
            
        end
    end)

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

        -- paper active(axe_observ -> treebranch)

        if aEvent == "capture" then
            aScene:captureObjects({'axe_observ'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected","activate_treebranch"})
            aScene:setHidsParams({"axe_observ"}, {inventory = true})
            aScene:setHidsParams({"paper"}, {active = false})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locobservationdeck_5') 
            aScene:setTask("ids_challenge_locobservationdeck_5")
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("treebranch", "axe_observ")

        elseif aEvent == "activate_treebranch" then
            aScene:setInteractParams({'treebranch'}, {active = false})
            aScene:setHidsParams({"paper"}, {active = true})
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        end
    end)
