As an animation effect this should be in uGearsRender. Plus it'll still spark when paused then, which is kinda fun.
authornemo
Sat, 23 Jan 2016 17:29:44 -0500
changeset 11534 58b4e357bcbf
parent 11533 8826ee0afe01
child 11535 a52fb6485403
As an animation effect this should be in uGearsRender. Plus it'll still spark when paused then, which is kinda fun.
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsRender.pas
--- a/hedgewars/uGearsHandlersMess.pas	Sat Jan 23 23:02:03 2016 +0100
+++ b/hedgewars/uGearsHandlersMess.pas	Sat Jan 23 17:29:44 2016 -0500
@@ -2008,27 +2008,6 @@
     doStepFallingGear(Gear);
     AllInactive := false;
 
-    if (GameTicks and $F = 0) and (random(3) = 0) then
-        begin
-        VGear:= AddVisualGear(hwRound(Gear^.X)+12-(Gear^.Tag shr 1), hwRound(Gear^.Y)-16, vgtStraightShot);
-        if VGear <> nil then
-            with VGear^ do
-                begin
-                Tint:= $FFCC00FF;
-                Angle:= random(360);
-                dx:= 0.0005 * (random(200));
-                dy:= 0.0005 * (random(200));
-                if random(2) = 0 then
-                    dx := -dx;
-                if random(2) = 0 then
-                    dy := -dy;
-                FrameTicks:= 100+random(300);
-                Scale:= 0.1+1/(random(3)+3);
-                State:= ord(sprStar)
-                end
-        end;
-
-
     if Gear^.Timer mod 166 = 0 then
         inc(Gear^.Tag);
     if Gear^.Timer = 1000 then // might need better timing
--- a/hedgewars/uGearsRender.pas	Sat Jan 23 23:02:03 2016 +0100
+++ b/hedgewars/uGearsRender.pas	Sat Jan 23 17:29:44 2016 -0500
@@ -1268,7 +1268,29 @@
                     else
                         DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle)
                     end;
-        gtDynamite: DrawSprite(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1);
+        gtDynamite: begin
+                    DrawSprite(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1);
+                    if (random(3) = 0) then
+                        begin
+                        vg:= AddVisualGear(hwRound(Gear^.X)+12-(Gear^.Tag shr 1), hwRound(Gear^.Y)-16, vgtStraightShot);
+                        if vg <> nil then
+                            with vg^ do
+                                begin
+                                Tint:= $FFCC00FF;
+                                Angle:= random(360);
+                                dx:= 0.0005 * (random(200));
+                                dy:= 0.0005 * (random(200));
+                                if random(2) = 0 then
+                                    dx := -dx;
+                                if random(2) = 0 then
+                                    dy := -dy;
+                                FrameTicks:= 100+random(300);
+                                Scale:= 0.1+1/(random(3)+3);
+                                State:= ord(sprStar)
+                                end
+                        end;
+
+                    end;
      gtClusterBomb: DrawSpriteRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle);
          gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0);
            gtFlame: if Gear^.Tag and 1 = 0 then