add sparkles to stunned airmines
authoralfadur
Tue, 13 Nov 2018 03:57:27 +0300
changeset 14223 dcf235a1f86b
parent 14222 abf4d12a59b1
child 14224 076c9fba3fa8
add sparkles to stunned airmines
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Tue Nov 13 03:22:16 2018 +0300
+++ b/hedgewars/uGearsHandlersMess.pas	Tue Nov 13 03:57:27 2018 +0300
@@ -2065,6 +2065,7 @@
     targ, tmpG: PGear;
     trackSpeed, airFriction, tX, tY: hwFloat;
     isUnderwater: Boolean;
+    sparkle: PVisualGear;
 begin
 	if (Gear^.State and gstFrozen) <> 0 then
 		begin
@@ -2094,6 +2095,19 @@
     if Gear^.Tag <> 0 then
         begin
         Gear^.Hedgehog:= nil;
+
+        if ((Gear^.FlightTime and $FF) = 0) then
+            begin
+            sparkle:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1);
+            if sparkle <> nil then
+                begin
+                    sparkle^.dX:= 0.004 * (random(100) - 50);
+                    sparkle^.dY:= -0.05 + 0.004 * (random(100) - 50);
+                    sparkle^.Tint:= $D5CD8CFF;
+                    sparkle^.Angle:= random(360);
+                end;
+            end;
+
         dec(Gear^.FlightTime);
         if Gear^.FlightTime = 0 then
             Gear^.Tag:= 0;