
.namespace s17_c01_Hotspot

function OnActivate()
	if transla==0 then
		if self.Name == "valve1" then
			if  tabeprouv[1]>=4 and tabeprouv[2]<=4  then
				
				tabeprouv[1]=tabeprouv[1]-4
				tabeprouv[2]=tabeprouv[2]+4
				transl1 = 1
				transl2 = -1
				valve1_4.Rotation = math.rad(-35)
				PlaySoundEffect("gmp_water")
			end
		end
		if self.Name == "valve2" then
			if  tabeprouv[2]>=2 and tabeprouv[1]<=6 then	
				tabeprouv[2]=tabeprouv[2]-2
				tabeprouv[1]=tabeprouv[1]+2
				transl1 = -1
				transl2 = 1
				valve2_2.Rotation = math.rad(35)
				PlaySoundEffect("gmp_water")
			end
		end
		if self.Name == "valve3" then
			if  tabeprouv[2]>=5 and tabeprouv[3]<=3 then	
				tabeprouv[2]=tabeprouv[2]-5
				tabeprouv[3]=tabeprouv[3]+5
				transl3 = -1
				transl2 = 1
				valve3_5.Rotation = math.rad(-35)
				PlaySoundEffect("gmp_water")
			end
		end
		if self.Name == "valve4" then
			if  tabeprouv[3]>=2 and tabeprouv[2]<=6 then	
				tabeprouv[3]=tabeprouv[3]-2
				tabeprouv[2]=tabeprouv[2]+2
				transl3 = 1
				transl2 = -1
				valve4_2.Rotation = math.rad(35)
				PlaySoundEffect("gmp_water")
			end
		end
		if self.Name == "valve5" then
			if  tabeprouv[3]>=3 and tabeprouv[4]<=5 then	
				tabeprouv[3]=tabeprouv[3]-3
				tabeprouv[4]=tabeprouv[4]+3
				transl3 = 1
				transl4 = -1
				valve5_3.Rotation = math.rad(-35)
				PlaySoundEffect("gmp_water")
			end
		end
		if self.Name == "valve6" then
			if  tabeprouv[4]>=5 and tabeprouv[3]<=3 then	
				tabeprouv[4]=tabeprouv[4]-5
				tabeprouv[3]=tabeprouv[3]+5
				transl3 = -1
				transl4 = 1
				valve6_5.Rotation = math.rad(35)
				PlaySoundEffect("gmp_water")
			end
		end
		if self.Name == "valve7" then
			if  tabeprouv[4]>=3 and tabeprouv[5]<=5 then	
				tabeprouv[4]=tabeprouv[4]-3
				tabeprouv[5]=tabeprouv[5]+3
				transl4 = 1
				transl5 = -1
				valve7_3.Rotation = math.rad(-35)
				PlaySoundEffect("gmp_water")
			end
		end
		if self.Name == "valve8" then
			if  tabeprouv[5]>=2 and tabeprouv[4]<=6 then	
				tabeprouv[5]=tabeprouv[5]-2
				tabeprouv[4]=tabeprouv[4]+2
				transl4 = -1
				transl5 = 1
				valve8_2.Rotation = math.rad(35)
				PlaySoundEffect("gmp_water")
			end
		end
		transla=1
	end

	
	-- liquide1.Position_Y=500-45*tabeprouv[1]
	-- liquide2.Position_Y=500-45*tabeprouv[2]
	-- liquide3.Position_Y=500-45*tabeprouv[3]
	-- liquide4.Position_Y=500-45*tabeprouv[4]
	-- liquide5.Position_Y=500-45*tabeprouv[5]
	
	
	
end

function OnDropObject()
	
	if IsEqualVariables("CurrentObject","InventoryKit") and self.Name == "kitbegin_hotspot" then
		PlaySoundEffect("gmp_addmetal")
		
		SampleLevel.Set("s17_c01_kit",true)
	
		SequencePlayer.PlaySequence("AI_"..GetCurrentManager().Name,s17_c01,nil,"help")
		return true
	end
	
	if IsEqualVariables("CurrentObject","InventoryFil") and self.Name == "kitbegin_hotspot" then
		PlaySoundEffect("gmp_addmetal")
		InventoryManager.RemoveFromInventory("InventoryFil")
		fils.Enabled=true
		return true
	end
	
	if IsEqualVariables("CurrentObject","InventoryReservoir") and self.Name == "kitbegin_hotspot" then
			PlaySoundEffect("gmp_addmetal")
		InventoryManager.RemoveFromInventory("InventoryReservoir")
		reservoir1.Enabled=true
		reservoir2.Enabled=true
		return true
	end
	
	if IsEqualVariables("CurrentObject","InventoryBouchons") and self.Name == "kitbegin_hotspot" then
		PlaySoundEffect("gmp_addmetal")
		InventoryManager.RemoveFromInventory("InventoryBouchons")
		valve1_4.Enabled=true
		valve2_2.Enabled=true
		valve3_5.Enabled=true
		valve4_2.Enabled=true
		valve5_3.Enabled=true
		valve6_5.Enabled=true
		valve7_3.Enabled=true
		valve8_2.Enabled=true
		return true
	end
	
	if IsEqualVariables("CurrentObject","InventoryTube") and self.Name == "kitbegin_hotspot" then
		PlaySoundEffect("gmp_addmetal")
		InventoryManager.RemoveFromInventory("InventoryTube")
		eprouvettes.Enabled=true
		return true
	end
	
	return false
end



function OnEnable()
	AreaHotspot.OnEnable()
end

function GetSpecificCursor()
	return CURSOR_AREA_HOTSPOT
end

function PrivateCanClickOn()
	return true
end

