-- LocBeautySPA

LocBeautySPA = Location:new("LocBeautySPA")

----------------------------------------------------------------------------------------------------
function LocBeautySPA_UPDATE()
	return 0
end

----------------------------------------------------------------------------------------------------
function LocBeautySPA_INIT()
    LocBeautySPA:init()
end

----------------------------------------------------------------------------------------------------
LocBeautySPA:setSceneHandler(1,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'wig', 'robe', 'pink_hairdryer'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected"})

        elseif aEvent == "start" then
        
            aScene:setRemark('ids_remark_locbeautyspa_1')
            aScene:setTask("ids_challenge_locbeautyspa_1")
            aScene:addItemMix('powder_fan', {'fan', 'powder'})
            aScene:attachHids(aScene:getHidList({except = {'powder_fan'}}))
            aScene:setHidsParams({"handprint"}, {active = false})

        elseif aEvent == "found_powder_fan" then
            aScene:attachInteract("socket", "powder_fan")

        elseif aEvent == "activate_socket" then
            aScene:setHidsParams({"handprint"}, {active = true})        
            --aScene:setInteractParams("socket", {visible = false})
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        end
    end)

----------------------------------------------------------------------------------------------------
LocBeautySPA:setSceneHandler(2,
    function(aScene, aEvent)
        if aEvent == "capture" then
            aScene:captureObjects({'uv_lamp', 'hair', 'crown'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_chairs"})
            aScene:setHidsParams({"uv_lamp"}, {inventory = true})
            aScene:setHidsParams({"hair"}, {active = false, visible = false})

        elseif aEvent == "start" then
        
            aScene:setRemark('ids_remark_locbeautyspa_2')
            aScene:setTask("ids_challenge_locbeautyspa_2")
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("chairs", "uv_lamp")

        elseif aEvent == "activate_chairs" then
            aScene:setHidsParams({"hair"}, {active = true, visible = true})
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")
            ho:click('hid_2_hair')

        end
    end)

----------------------------------------------------------------------------------------------------
LocBeautySPA:setSceneHandler(3,
    function(aScene, aEvent)
    
        if aEvent == "capture" then
            aScene:captureObjects({'spray_paint'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_door"})
            aScene:setHidsParams({"spray_paint"}, {inventory = true})
            aScene:setHidsParams({"hall_tree"}, {active = false})

        elseif aEvent == "start" then
        
            aScene:setRemark('ids_remark_locbeautyspa_3')
            aScene:setTask("ids_challenge_locbeautyspa_3")
            aScene:attachHids(aScene:getHidList()) 
            aScene:attachInteract("door", "spray_paint")

        elseif aEvent == "found_hat" then
            aScene:setHidsParams({"hall_tree"}, {active = true})

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

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

        -- note visible,active(hair_curlers -> recycle_bin)

        if aEvent == "capture" then
            aScene:captureObjects({'hair_curlers', 'note'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_recycle_bin"})
            aScene:setHidsParams({"hair_curlers"}, {inventory = true})
            aScene:setHidsParams({"note"}, {visible = false, active = false})

        elseif aEvent == "start" then
        
            aScene:setRemark('ids_remark_locbeautyspa_4')
            aScene:setTask("ids_challenge_locbeautyspa_4")
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("recycle_bin", "hair_curlers")

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

        end
    end)

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

        -- keycard visible,active (nail_file -> vacuum)

        if aEvent == "capture" then
            aScene:captureObjects({'keycard', 'nail_file'})
        elseif aEvent == "generic_init" then
            
            aScene:setWinTerms({"ho_collected", "activate_vacuum"})
            aScene:setHidsParams({"nail_file"}, {inventory = true})
            aScene:setHidsParams({"keycard"}, {visible = false, active = false})

        elseif aEvent == "start" then
        
            aScene:setRemark('ids_remark_locbeautyspa_5')
            aScene:setTask('ids_challenge_locbeautyspa_5')
            aScene:attachHids(aScene:getHidList())
            aScene:attachInteract("vacuum", "nail_file")

        elseif aEvent == "activate_vacuum" then
            aScene:setHidsParams({"keycard"}, {visible = true, active = true})
            ho:click('hid_5_keycard')
            aScene:onChallengeComplete()
            aScene:setTask("ids_collect_ho")

        end
    end)
