share/hedgewars/Data/Scripts/Multiplayer/WxW.lua
changeset 14792 97a36fb44123
parent 14791 0ee6b01c7f30
child 14793 f5dcf47dff2c
equal deleted inserted replaced
14791:0ee6b01c7f30 14792:97a36fb44123
   694 	if GetGearType(gear) ~= gtCase then
   694 	if GetGearType(gear) ~= gtCase then
   695 		return
   695 		return
   696 	end
   696 	end
   697 
   697 
   698 	local baseColor, radius, alpha
   698 	local baseColor, radius, alpha
   699 	if getGearValue(gear, "frozen") then
   699 	if CurrentHedgehog == nil or band(GetState(CurrentHedgehog), gstHHDriven) == 0 then
       
   700 		radius = 40
       
   701 		baseColor = 0xFFFFFFFF
       
   702 		alpha = 255
       
   703 	elseif getGearValue(gear, "frozen") then
   700 		radius = 25
   704 		radius = 25
   701 		baseColor = 0xFFFFFFFF
   705 		baseColor = 0xFFFFFFFF
   702 		alpha = math.min(255, rAlpha+127)
   706 		alpha = math.min(255, rAlpha+127)
   703 	else
   707 	else
   704 		radius = 40
   708 		radius = 40
   940 end
   944 end
   941 
   945 
   942 
   946 
   943 function HandleBorderEffects()
   947 function HandleBorderEffects()
   944 
   948 
   945 	if band(GetState(CurrentHedgehog), gstHHDriven) == 0 then
   949 	if CurrentHedgehog == nil or band(GetState(CurrentHedgehog), gstHHDriven) == 0 then
   946 		return
   950 		return
   947 	end
   951 	end
   948 	effectTimer = effectTimer + 1
   952 	effectTimer = effectTimer + 1
   949 	if effectTimer > 15 then --25
   953 	if effectTimer > 15 then --25
   950 
   954 
  1315 
  1319 
  1316 		local teamName = GetHogTeamName(CurrentHedgehog)
  1320 		local teamName = GetHogTeamName(CurrentHedgehog)
  1317 
  1321 
  1318 		-- Restore team's radar mode
  1322 		-- Restore team's radar mode
  1319 		radarMode = getTeamValue(teamName, "radarMode")
  1323 		radarMode = getTeamValue(teamName, "radarMode")
       
  1324 		if radarMode == nil then
       
  1325 			radarMode = 0
       
  1326 		end
  1320 
  1327 
  1321 		if not AreCratesUnlocked() then
  1328 		if not AreCratesUnlocked() then
  1322 			FreezeCrates()
  1329 			FreezeCrates()
  1323 		end
  1330 		end
  1324 
  1331 
  1626 				end
  1633 				end
  1627 			end
  1634 			end
  1628 
  1635 
  1629 		end
  1636 		end
  1630 
  1637 
  1631 		HandleBorderEffects()
  1638 
  1632 		HandleCircles()
  1639 	end
  1633 
  1640 
  1634 	end
  1641 	HandleBorderEffects()
       
  1642 	HandleCircles()
  1635 
  1643 
  1636 end
  1644 end
  1637 
  1645 
  1638 local menuRepeatTimer = 0
  1646 local menuRepeatTimer = 0
  1639 function onGameTick20()
  1647 function onGameTick20()
  1660 
  1668 
  1661 		local vg = AddVisualGear(0, 0, vgtCircle, 0, true)
  1669 		local vg = AddVisualGear(0, 0, vgtCircle, 0, true)
  1662 		if vg then
  1670 		if vg then
  1663 			table.insert(rCirc, vg)
  1671 			table.insert(rCirc, vg)
  1664 			setGearValue(gear,"CIRC",vg)
  1672 			setGearValue(gear,"CIRC",vg)
  1665 			SetVisualGearValues(vg, 0, 0, 100, 255, 1, 10, 0, 40, 3, 0xff00ffff)
  1673 			SetVisualGearValues(vg, 0, 0, 100, 255, 1, 10, 0, 40, 3, 0x0)
  1666 		end
  1674 		end
  1667 		setGearValue(gear,"RX",0)
  1675 		setGearValue(gear,"RX",0)
  1668 		setGearValue(gear,"RY",0)
  1676 		setGearValue(gear,"RY",0)
  1669 
  1677 
  1670 		allowCrate = false
  1678 		allowCrate = false