-- LocExecutiveWashroom

LocExecutiveWashroom = Location:new("LocExecutiveWashroom")

----------------------------------------------------------------------------------------------------
function LocExecutiveWashroom_UPDATE()
	return 0
end

----------------------------------------------------------------------------------------------------
function LocExecutiveWashroom_INIT()
    LocExecutiveWashroom:init()
end

----------------------------------------------------------------------------------------------------
LocExecutiveWashroom:setSceneHandler(1,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'tape_white', 'shell', 'gloves', 'ying_yan'})

        elseif aEvent == "generic_init" then
            aScene:setWinTerms({"ho_collected","activate_camera"})
            aScene:setHidsParams({"tape_white"}, {inventory = true})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locexecutivewashroom_1') 
            aScene:setTask('ids_challenge_locexecutivewashroom_1')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("camera", "tape_white")

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

        end
    end)

----------------------------------------------------------------------------------------------------
LocExecutiveWashroom:setSceneHandler(2,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'towel', 'glasses', 'candle'})

        elseif aEvent == "generic_init" then
            aScene:setWinTerms({"ho_collected", "activate_smoke_alarm"})
            aScene:setHidsParams({"towel"}, {inventory = true})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locexecutivewashroom_2') 
            aScene:setTask('ids_challenge_locexecutivewashroom_2')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("smoke_alarm", "towel")

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

        end
    end)

----------------------------------------------------------------------------------------------------
LocExecutiveWashroom:setSceneHandler(3,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'sponge_cleaner', 'sponge', 'spray_bottle', 'lemon', 'hat'})

        elseif aEvent == "generic_init" then
            aScene:setWinTerms({"ho_collected", "activate_numbers"})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locexecutivewashroom_3') 
            aScene:setTask('ids_challenge_locexecutivewashroom_3')
            aScene:attachHids(aScene:getHidList({except = {'sponge_cleaner'}}))
            aScene:attachInteract("smoke_alarm", "towel")
            aScene:addItemMix('sponge_cleaner', {'sponge', 'spray_bottle'})

        elseif aEvent == "found_sponge_cleaner" then
            aScene:attachInteract("numbers", "sponge_cleaner")

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

        end
    end)

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

        -- extra(flood, water) play (bath_plug -> sink)

        if aEvent == "capture" then
            aScene:captureObjects({'bath_plug', 'fan'})

        elseif aEvent == "generic_init" then
            aScene:setWinTerms({"ho_collected", "activate_sink"})
            aScene:setHidsParams({"bath_plug"}, {inventory = true})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locexecutivewashroom_4') 
            aScene:setTask('ids_challenge_locexecutivewashroom_4')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("sink", "bath_plug")

        elseif aEvent == "activate_sink" then
            aScene:setExtraParams('water', {play = true})
            aScene:setExtraParams('flood', {play = true, loop = true})
            aScene:setTask("ids_collect_ho")
            aScene:onChallengeComplete()

        end
    end)

----------------------------------------------------------------------------------------------------
LocExecutiveWashroom:setSceneHandler(5,
    function(aScene, aEvent)
        -- wrench -> lamps
        if aEvent == "generic_init" then
            aScene:setWinTerms({"ho_collected", "activate_lamps"})
            aScene:setHidsParams({"wrench"}, {inventory = true})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locexecutivewashroom_5') 
            aScene:setTask('ids_challenge_locexecutivewashroom_5')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("lamps", "wrench")

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

        end
    end)
