-- LocPrivateRoom

LocPrivateRoom = Location:new("LocPrivateRoom")

----------------------------------------------------------------------------------------------------
function LocPrivateRoom_UPDATE()
	return 0
end

----------------------------------------------------------------------------------------------------
function LocPrivateRoom_INIT()
    LocPrivateRoom:init()
end

----------------------------------------------------------------------------------------------------
LocPrivateRoom:setSceneHandler(1,
  function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'remote_control', 'rabbit'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_tv"})
            aScene:setHidsParams({"remote_control"}, {inventory = true})
            aScene:setHidsParams({"rabbit"}, {active = false, visible = false})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locprivateroom_1')
            aScene:setTask('ids_challenge_locprivateroom_1') 
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("tv", "remote_control")
            
        elseif aEvent == "activate_tv" then
            aScene:setHidsParams({"rabbit"}, {active = true, visible = true})
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        end
    end)

----------------------------------------------------------------------------------------------------
LocPrivateRoom:setSceneHandler(2,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'bouquet', 'rose_white', 'rose_pink', 'rose_yellow'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_vase"})
            
        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locprivateroom_2') 
            aScene:setTask('ids_challenge_locprivateroom_2')
            aScene:attachHids(aScene:getHidList({except = {'bouquet'}}))
            aScene:addItemMix('bouquet', {'rose_white', 'rose_pink', 'rose_yellow'})

        elseif aEvent == "found_bouquet" then
            aScene:attachInteract("vase", "bouquet")

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

        end
    end)

----------------------------------------------------------------------------------------------------
LocPrivateRoom:setSceneHandler(3,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'aerosol'})
        elseif aEvent == 'generic_init' then
            
            aScene:setWinTerms({'ho_collected', 'activate_exit'})
            aScene:setHidsParams({'aerosol'}, {inventory = true})
            
        elseif aEvent == 'start' then
            aScene:setRemark('ids_remark_locprivateroom_3') 
            aScene:setTask('ids_challenge_locprivateroom_3')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract('exit', 'aerosol')

        elseif aEvent == 'activate_click_exit' then
            aScene:setExtraParams('lasers_appear', {play = true})
            aScene:setExtraParams('lasers', {play = true, loop = true})
            aScene.mDisplay:link_effect("WinterGardenGas", 'effectGas')
            aScene:setExtraParams('laserReflect', {play = false, frame = 0})

        elseif aEvent == 'activate_exit' then
            aScene.mDisplay:unlink_effect('effectGas')
            aScene:setExtraParams('lasers_appear', {play = false, frame = 94})
            aScene:setExtraParams('lasers', {play = true, loop = true})
            aScene:setExtraParams('laserReflect', {play = false, frame = 0})
            aScene:onChallengeComplete()
            aScene:setTask('ids_collect_ho')
            
        end
    end)

----------------------------------------------------------------------------------------------------
LocPrivateRoom:setSceneHandler(4,
    function (aScene, aEvent)
    
        -- mirror -> vases => laserReflect play -> f30

        if aEvent == "capture" then
            
        elseif aEvent == "generic_init" then
            aScene:setWinTerms({'ho_collected', 'activate_vases'})
            aScene:setHidsParams({'mirror'}, {inventory = true})

        elseif aEvent == 'start' then
            aScene:setRemark('ids_remark_locprivateroom_4') 
            aScene:setTask('ids_challenge_locprivateroom_4')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract('vases', 'mirror')
            aScene:setExtraParams('lasers_appear', {play = false, frame = 94})
            aScene:setExtraParams('lasers', {play = true, loop = true})
            aScene:setExtraParams('laserReflect', {play = false, frame = 0})

        elseif aEvent == 'activate_click_vases' then
            aScene:setExtraParams('laserReflect', {play = true})

        elseif aEvent == 'activate_vases' then
            aScene:setExtraParams('laserReflect', {play = false, frame = 29})
            aScene:onChallengeComplete()
            aScene:setTask('ids_collect_ho')

        end
    end)

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

        -- usbdrive -> notebook

        if aEvent == "capture" then
            
        elseif aEvent == "generic_init" then
            aScene:setWinTerms({"ho_collected", "activate_notebook"})
            aScene:setHidsParams({"usbdrive"}, {inventory = true})

        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locprivateroom_5')
            aScene:setTask('ids_challenge_locprivateroom_5') 
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("notebook", "usbdrive")
            
        elseif aEvent == "activate_notebook" then
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        end
    end)
