-- LocSwimmingPool

LocSwimmingPool = Location:new("LocSwimmingPool")

----------------------------------------------------------------------------------------------------
function LocSwimmingPool_UPDATE()
	return 0
end

----------------------------------------------------------------------------------------------------
function LocSwimmingPool_INIT()
    LocSwimmingPool:init()
end

----------------------------------------------------------------------------------------------------
LocSwimmingPool:setSceneHandler(1,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'mask', 'glasses', 'stick', 'elephant', 'white_soap'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "found_mask"})
            
        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locswimmingpool_1') 
            aScene:setTask('ids_challenge_locswimmingpool_1')
            aScene:attachHids(aScene:getHidList({except = {'mask'}}))
            aScene:addItemMix('mask', {'glasses', 'stick'})
            aScene:setCloseUpKey('LocSwimmingPoolCloseUp', 'mask')

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

        end
    end)

----------------------------------------------------------------------------------------------------
LocSwimmingPool:setSceneHandler(2,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'camera_pool', 'glue_pool', 'camera_with_glue'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_real_camera"})
            aScene:setHidsParams({"baseball_pool"}, {inventory = true})
            
        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locswimmingpool_2') 
            aScene:setTask('ids_challenge_locswimmingpool_2')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("real_camera", "baseball_pool")

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

        end
    end)

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

        -- money visible,active(screwdriver_pool -> chair)

        if aEvent == "capture" then
            aScene:captureObjects({'money', 'hippo'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_chair"})
            aScene:setHidsParams({"screwdriver_pool"}, {inventory = true})
            aScene:setHidsParams({"money"}, {active = false, visible = false})
            
        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locswimmingpool_3') 
            aScene:setTask('ids_challenge_locswimmingpool_3')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("chair", "screwdriver_pool")

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

        end
    end)

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

        -- sand -> generator

        if aEvent == "capture" then
            aScene:captureObjects({'sand'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_generator"})
            aScene:setHidsParams({"sand"}, {inventory = true})
            
        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locswimmingpool_4') 
            aScene:setTask('ids_challenge_locswimmingpool_4')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("generator", "sand")

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

        end
    end)

----------------------------------------------------------------------------------------------------
LocSwimmingPool:setSceneHandler(5,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'camera_pool', 'glue_pool', 'camera_with_glue'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_ladder"})
            
        elseif aEvent == "start" then
            aScene:setRemark('ids_remark_locswimmingpool_5') 
            aScene:setTask('ids_challenge_locswimmingpool_5')
            aScene:attachHids(aScene:getHidList({except = {'camera_with_glue'}}))
            aScene:addItemMix('camera_with_glue', {'camera_pool', 'glue_pool'})

        elseif aEvent == "found_camera_with_glue" then
            aScene:attachInteract("ladder", "camera_with_glue")

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

        end
    end)
