share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
changeset 14844 358d81e29a88
parent 14832 d65e25e211d4
child 14845 f16868b40f2d
equal deleted inserted replaced
14843:72291f0df539 14844:358d81e29a88
   964 		if SI.shieldHealth == 80 then
   964 		if SI.shieldHealth == 80 then
   965 			AddCaption(loc("Shield depleted"),SI.colorMsgDepleted,capgrpAmmostate)
   965 			AddCaption(loc("Shield depleted"),SI.colorMsgDepleted,capgrpAmmostate)
   966 			PlaySound(sndDenied)
   966 			PlaySound(sndDenied)
   967 		elseif (SI.beam == false) and (SI.shieldHealth > 80) then
   967 		elseif (SI.beam == false) and (SI.shieldHealth > 80) then
   968 			SI.beam = true
   968 			SI.beam = true
   969 			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), 40, 255, 1, 10, 0, 300, 1, SI.colorShield)
   969 			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), 40, 255, 1, 10, 0, nil, 1, SI.colorShield-0x000000FF - -math.min(SI.shieldHealth))
   970 			AddCaption( string.format(loc("Shield ON: %d power remaining"), SI.shieldHealth - 80), SI.colorShield, capgrpAmmostate)
   970 			AddCaption( string.format(loc("Shield ON: %d power remaining"), SI.shieldHealth - 80), SI.colorShield, capgrpAmmostate)
   971 			PlaySound(sndInvulnerable)
   971 			PlaySound(sndInvulnerable)
   972 		else
   972 		else
   973 			SI.beam = false
   973 			SI.beam = false
   974 			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), 0, 0, 1, 10, 0, 0, 0, SI.colorShield)
   974 			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), nil, nil, nil, nil, nil, nil, nil, 0x0)
   975 			AddCaption( string.format(loc("Shield OFF: %d power remaining"), SI.shieldHealth - 80), SI.colorShield, capgrpAmmostate)
   975 			AddCaption( string.format(loc("Shield OFF: %d power remaining"), SI.shieldHealth - 80), SI.colorShield, capgrpAmmostate)
   976 		end
   976 		end
   977 	end
   977 	end
   978 end
   978 end
   979 
   979 
  1685 
  1685 
  1686 		SetVisualGearValues(SI.rCirc[i], 0, 0, 100, 255, 1, 10, 0, 40, 3, SI.vCircCol[i])
  1686 		SetVisualGearValues(SI.rCirc[i], 0, 0, 100, 255, 1, 10, 0, 40, 3, SI.vCircCol[i])
  1687 
  1687 
  1688 	end
  1688 	end
  1689 
  1689 
  1690 	SI.pShield = AddVisualGear(0,0,vgtCircle,0,true)
  1690 	SI.pShield = AddVisualGear(0,0,vgtCircle,200,true)
  1691 
  1691 
  1692 end
  1692 end
  1693 
  1693 
  1694 function IGotMeASafeXYValue(i)
  1694 function IGotMeASafeXYValue(i)
  1695 
  1695 
  2282 	end
  2282 	end
  2283 
  2283 
  2284 
  2284 
  2285 	if (CurrentHedgehog ~= nil) then
  2285 	if (CurrentHedgehog ~= nil) then
  2286 		if SI.beam == true then
  2286 		if SI.beam == true then
  2287 			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), nil, nil, nil, nil, nil, 200, nil, SI.colorShield-0x000000FF - -SI.shieldHealth )
  2287 			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), nil, nil, nil, nil, nil, nil, nil, SI.colorShield-0x000000FF - -math.min(SI.shieldHealth, 255))
  2288 			DrawTag(SI.TAG_SHIELD)
  2288 			DrawTag(SI.TAG_SHIELD)
  2289 		else
  2289 		else
  2290 			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), nil, nil, nil, nil, nil, 0)
  2290 			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), nil, nil, nil, nil, nil, nil, nil, 0x0)
  2291 		end
  2291 		end
  2292 
  2292 
  2293 	end
  2293 	end
  2294 
  2294 
  2295 
  2295