-- LocConferenceRoom

LocConferenceRoom = Location:new("LocConferenceRoom")

----------------------------------------------------------------------------------------------------
function LocConferenceRoom_UPDATE()
	return 0
end

----------------------------------------------------------------------------------------------------
function LocConferenceRoom_INIT()
    LocConferenceRoom:init()
end

----------------------------------------------------------------------------------------------------
LocConferenceRoom:setSceneHandler(1,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'glue', 'vase'})
        elseif aEvent == "generic_init" then
           
            aScene:setWinTerms({"ho_collected", "activate_vase2"})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locconferenceroom_1') 
            aScene:setTask("ids_challenge_locconferenceroom_1")
            aScene:attachHids(aScene:getHidList({except = {'glue', 'map_america'}}))
            aScene:removeHidHint('vase')
            aScene:setHidsParams({"vase"}, {visible = false, active = true})
            aScene:setInteractParams("vase2", {visible = false})
            aScene:attachInteract("vase")
            
        elseif aEvent == "activate_vase" then
            aScene:setTask("ids_challenge_loccroom_1_1")
            aScene:updateRemark('ids_remark_loccroom_1_1')
            aScene:replaceHid("vase", "glue")
            aScene:setHidsParams({"vase"}, {found = true})
            aScene:setHidsParams({"glue"}, {inventory = true})

            aScene:setInteractParams("vase", {visible = false})

            aScene:setInteractParams("vase2", {visible = true})
            aScene:attachInteract("vase2", "glue")

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

        end
    end)

----------------------------------------------------------------------------------------------------
LocConferenceRoom:setSceneHandler(2,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'flowers', 'globe'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({'ho_collected', 'activate_flowers'})
            aScene:setHidsParams({"red_microphone"}, {inventory = true})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locconferenceroom_2') 
            aScene:setTask("ids_challenge_locconferenceroom_2")
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract('flowers', 'red_microphone')

        elseif aEvent == 'activate_flowers' then
            aScene:onChallengeComplete()
            aScene:setTask('ids_collect_ho')

        end
    end)

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

        -- (keypad_buttons = keypad_buttons_z + keypad_buttons_f1 + keypad_buttons_l) -> notebook_keyboard

        if aEvent == "capture" then
            aScene:captureObjects({'keypad_buttons', 'keypad_buttons_z', 'keypad_buttons_f1', 'keypad_buttons_l', 'rainbow'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({'ho_collected', 'activate_notebook_keyboard'})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locconferenceroom_3') 
            aScene:setTask("ids_challenge_locconferenceroom_3")
            aScene:attachHids(aScene:getHidList({except = {'keypad_buttons'}}))
            aScene:addItemMix('keypad_buttons', {'keypad_buttons_z', 'keypad_buttons_f1', 'keypad_buttons_l'})

        elseif aEvent == "found_keypad_buttons" then
            aScene:attachInteract('notebook_keyboard', 'keypad_buttons')

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

        end
    end)

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

        -- finger_print active, visible (scotch -> hawtorn_glass)

        if aEvent == "capture" then
            aScene:captureObjects({'finger_print', 'earth'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_hawtorn_glass"})
            aScene:setHidsParams({'finger_print'}, {visible = false, active = false})
            aScene:setHidsParams({'empty_glass'}, {active = false})
            aScene:setHidsParams({'scotch'}, {inventory = true})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locconferenceroom_4') 
            aScene:setTask("ids_challenge_locconferenceroom_4")
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract('hawtorn_glass', 'scotch')

        elseif aEvent == "activate_hawtorn_glass" then
            aScene:setHidsParams({'finger_print'}, {visible = true, active = true})
            ho:click('hid_4_finger_print')
            aScene:setHidsParams({'empty_glass'}, {active = true})
            aScene:onChallengeComplete()
            aScene:setTask('ids_collect_ho')

        end
    end)

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

        -- (cd -> cd_drive) => (remote_control_conf -> monitor1)

        if aEvent == "capture" then
            
        elseif aEvent == "generic_init" then
            aScene:setWinTerms({"ho_collected", "activate_monitor1"})
            aScene:setHidsParams({'cd', 'remote_control_conf'}, {inventory = true})
            aScene:setHidsParams({'remote_control_conf'}, {active = false})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locconferenceroom_5')
            aScene:setTask("ids_challenge_locconferenceroom_5")
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract('cd_drive', 'cd')

        elseif aEvent == "activate_cd_drive" then
            aScene:setHidsParams({'remote_control_conf'}, {active = true})
            aScene:attachInteract('monitor1', 'remote_control_conf')

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

        end
    end)
