sparkles for dynamite at sheepy's request. he can tweak values if he wishes
authornemo
Sat, 23 Jan 2016 16:07:14 -0500
changeset 11532 44e646598e6a
parent 11531 743200547747
child 11533 8826ee0afe01
sparkles for dynamite at sheepy's request. he can tweak values if he wishes
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Sat Jan 23 15:23:54 2016 -0500
+++ b/hedgewars/uGearsHandlersMess.pas	Sat Jan 23 16:07:14 2016 -0500
@@ -2003,9 +2003,32 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepDynamite(Gear: PGear);
+var VGear: PVisualGear;
 begin
     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