nemo's molotov burst effect; with a slight color modification added
authorsheepluva
Mon, 12 Sep 2011 07:27:34 +0200
changeset 5874 5cd329cf2460
parent 5873 4f2d8ce3732b
child 5875 b3e23cb69ab4
nemo's molotov burst effect; with a slight color modification added
hedgewars/GSHandlers.inc
hedgewars/VGSHandlers.inc
hedgewars/uVisualGears.pas
--- a/hedgewars/GSHandlers.inc	Mon Sep 12 06:31:10 2011 +0200
+++ b/hedgewars/GSHandlers.inc	Mon Sep 12 07:27:34 2011 +0200
@@ -512,7 +512,7 @@
     i, gX, gY: LongInt;
     dX, dY: hwFloat;
     Fire: PGear;
-    smoke: PVisualGear;
+    smoke, glass: PVisualGear;
 begin
     AllInactive := false;
 
@@ -534,7 +534,17 @@
         PlaySound(sndMolotov);
         gX := hwRound(Gear^.X);
         gY := hwRound(Gear^.Y);
-        //doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 5, EXPLAutoSound);
+        for i:= 0 to 2 do
+            begin
+            glass:= AddVisualGear(gx+random(7)-3, gy+random(5)-2, vgtEgg);
+            if glass <> nil then
+                begin
+                glass^.Frame:= 2;
+                glass^.Tint:= $41B83ED0 - i * $10081000;
+                glass^.dX:= 1/(10*(random(11)-5));
+                glass^.dY:= -1/(random(4)+5);
+                end;
+            end;
         for i:= 0 to 24 do
         begin
             dX := AngleCos(i * 2) * ((_0_15*(i div 5))) * (GetRandom + _1);
--- a/hedgewars/VGSHandlers.inc	Mon Sep 12 06:31:10 2011 +0200
+++ b/hedgewars/VGSHandlers.inc	Mon Sep 12 07:27:34 2011 +0200
@@ -174,7 +174,10 @@
 if Gear^.FrameTicks <= Steps then
     DeleteVisualGear(Gear)
 else
-    dec(Gear^.FrameTicks, Steps)
+    dec(Gear^.FrameTicks, Steps);
+
+if Gear^.FrameTicks < $FF then
+   Gear^.Tint:= (Gear^.Tint and $FFFFFF00) or Gear^.FrameTicks
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/hedgewars/uVisualGears.pas	Mon Sep 12 06:31:10 2011 +0200
+++ b/hedgewars/uVisualGears.pas	Mon Sep 12 07:27:34 2011 +0200
@@ -649,14 +649,7 @@
                                    end;
                                DrawRotatedF(sprFeather, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
                              end;
-                   vgtEgg: begin
-                           if Gear^.FrameTicks < $FF then
-                               begin
-                                   Tint($FF, $FF, $FF, Gear^.FrameTicks);
-                                   tinted:= true
-                               end;
-                           DrawRotatedF(sprEgg, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
-                           end;
+                   vgtEgg: DrawRotatedF(sprEgg, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
                    vgtBeeTrace: begin
                                 if Gear^.FrameTicks < $FF then
                                     Tint($FF, $FF, $FF, Gear^.FrameTicks div 2)