Space Invasion: Fix minor visual glitches of shield
authorWuzzy <Wuzzy2@mail.ru>
Sat, 20 Apr 2019 16:46:07 +0200
changeset 14828 358d81e29a88
parent 14827 72291f0df539
child 14829 f16868b40f2d
Space Invasion: Fix minor visual glitches of shield
share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Sat Apr 20 16:02:48 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Sat Apr 20 16:46:07 2019 +0200
@@ -966,12 +966,12 @@
 			PlaySound(sndDenied)
 		elseif (SI.beam == false) and (SI.shieldHealth > 80) then
 			SI.beam = true
-			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), 40, 255, 1, 10, 0, 300, 1, SI.colorShield)
+			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), 40, 255, 1, 10, 0, nil, 1, SI.colorShield-0x000000FF - -math.min(SI.shieldHealth))
 			AddCaption( string.format(loc("Shield ON: %d power remaining"), SI.shieldHealth - 80), SI.colorShield, capgrpAmmostate)
 			PlaySound(sndInvulnerable)
 		else
 			SI.beam = false
-			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), 0, 0, 1, 10, 0, 0, 0, SI.colorShield)
+			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), nil, nil, nil, nil, nil, nil, nil, 0x0)
 			AddCaption( string.format(loc("Shield OFF: %d power remaining"), SI.shieldHealth - 80), SI.colorShield, capgrpAmmostate)
 		end
 	end
@@ -1687,7 +1687,7 @@
 
 	end
 
-	SI.pShield = AddVisualGear(0,0,vgtCircle,0,true)
+	SI.pShield = AddVisualGear(0,0,vgtCircle,200,true)
 
 end
 
@@ -2284,10 +2284,10 @@
 
 	if (CurrentHedgehog ~= nil) then
 		if SI.beam == true then
-			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), nil, nil, nil, nil, nil, 200, nil, SI.colorShield-0x000000FF - -SI.shieldHealth )
+			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), nil, nil, nil, nil, nil, nil, nil, SI.colorShield-0x000000FF - -math.min(SI.shieldHealth, 255))
 			DrawTag(SI.TAG_SHIELD)
 		else
-			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), nil, nil, nil, nil, nil, 0)
+			SetVisualGearValues(SI.pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), nil, nil, nil, nil, nil, nil, nil, 0x0)
 		end
 
 	end