-- LocManagersOffice

LocManagersOffice = Location:new("LocManagersOffice")

----------------------------------------------------------------------------------------------------
function LocManagersOffice_UPDATE()
	return 0
end

----------------------------------------------------------------------------------------------------
function LocManagersOffice_INIT()
    LocManagersOffice:init()
end

----------------------------------------------------------------------------------------------------
LocManagersOffice:setSceneHandler(1,
  function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'fax_paper', 'fax', 'tennis_ball','umbrella', 'champagne', 'donuts'})
        elseif aEvent == "generic_init" then
             
            aScene:setWinTerms({"ho_collected", "activate_fax"})
            aScene:setHidsParams({"fax_paper"}, {inventory = true})
            aScene:setHidsParams({"fax"}, {active = false, visible = false})
            
        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locmanagersoffice_1')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("fax", "fax_paper")
            aScene:setTask("ids_challenge_locmanagersoffice_1")

        elseif aEvent == "activate_fax" then
            aScene:setHidsParams({"fax"}, {active = true, visible = true})
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        elseif aEvent == "ho_collected" then
           
        end
    end)

----------------------------------------------------------------------------------------------------
LocManagersOffice:setSceneHandler(2,
    function(aScene, aEvent)

        -- win = ((message = red_pen + sticky_note) -> monitor) + (ho_complete)

        if aEvent == "capture" then
            aScene:captureObjects({'message', 'red_pen', 'sticky_note'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_monitor"})
            
        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locmanagersoffice_2') 
            aScene:attachHids(aScene:getHidList({except = {'message'}}))
            aScene:attachInteract("monitor", "message")
            aScene:setTask("ids_challenge_locmanagersoffice_2")
            aScene:addItemMix('message', {'red_pen', 'sticky_note'})
            
        elseif aEvent == "activate_monitor" then
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")
           
        end
    end)

----------------------------------------------------------------------------------------------------
LocManagersOffice:setSceneHandler(3,
    function(aScene, aEvent)

        -- win = (vinyl_record -> record_player) & (ho_collected)

        if aEvent == "capture" then
            aScene:captureObjects({'vinyl_record', 'shoes'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_record_player"})
            aScene:setHidsParams({"vinyl_record"}, {inventory = true})
            
        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locmanagersoffice_3') 
            aScene:setTask("ids_challenge_locmanagersoffice_3")
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("record_player", "vinyl_record")
            
        elseif aEvent == "activate_record_player" then
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        end
    end)

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

        -- keycard_managers(micro_chip + creditCard_manager)

        if aEvent == "capture" then
            aScene:captureObjects({'keycard_managers', 'micro_chip', 'creditCard_manager'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "found_keycard_managers"})
            
        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locmanagersoffice_4')
            aScene:setTask("ids_challenge_locmanagersoffice_4")
            aScene:attachHids(aScene:getHidList({except = {'keycard_managers'}}))
            aScene:addItemMix('keycard_managers', {'micro_chip', 'ccard_mgr'})

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

        end
    end)

----------------------------------------------------------------------------------------------------
LocManagersOffice:setSceneHandler(5,
    function(aScene, aEvent)
    
        -- organizer active,click(pages(yellow_page + blue_page + green_page) -> organizer)
    
        if aEvent == "capture" then
            aScene:captureObjects({'organazier', 'pages', 'yellow_page', 'blue_page', 'green_page'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_organizer"})
            aScene:setHidsParams({"organizer"}, {active = false})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locmanagersoffice_5') 
            aScene:setTask("ids_challenge_locmanagersoffice_5")
            aScene:attachHids(aScene:getHidList({except = {'pages'}}))
            aScene:addItemMix('pages', {'yellow_page', 'blue_page', 'green_page'})

        elseif aEvent == "found_pages" then
            aScene:attachInteract("organizer", "pages")

        elseif aEvent == "activate_organizer" then
            aScene:setHidsParams({"organizer"}, {active = true})
            ho:click('hid_5_organizer')
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        end
    end)
