hedgewars/uVisualGears.pas
changeset 2974 f3fa665f0874
parent 2972 82828fd23dea
child 2982 4213c6a8aceb
--- a/hedgewars/uVisualGears.pas	Thu Mar 11 04:31:50 2010 +0000
+++ b/hedgewars/uVisualGears.pas	Thu Mar 11 17:56:26 2010 +0000
@@ -264,6 +264,14 @@
         else dec(Gear^.FrameTicks, Steps)
 end;
 
+procedure doStepSplash(Gear: PVisualGear; Steps: Longword);
+begin
+  if Gear^.FrameTicks <= Steps then
+      DeleteVisualGear(Gear)
+  else
+      dec(Gear^.FrameTicks, Steps);
+end;
+
 ////////////////////////////////////////////////////////////////////////////////
 const cSorterWorkTime = 640;
 var thexchar: array[0..cMaxTeams] of
@@ -401,7 +409,8 @@
             @doStepSmoke,
             @doStepHealth,
             @doStepShell,
-            @doStepDust
+            @doStepDust,
+            @doStepSplash
         );
 
 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear;
@@ -520,6 +529,13 @@
                 Frame:= 7 - random(2);
                 FrameTicks:= random(20) + 15;
                 end;
+  vgtSplash: begin
+                dx:= _0;
+                dx.isNegative:= false;
+                dy:= _0;
+                FrameTicks:= 740;
+                Frame:= 19;
+                end;
         end;
 
 if VisualGearsList <> nil then
@@ -614,6 +630,7 @@
                             if Gear^.FrameTicks < 250 then
                                 glColor4f(1, 1, 1, 1);
                             end;
+                vgtSplash: DrawSprite(sprSplash, hwRound(Gear^.X) + WorldDx - 64, hwRound(Gear^.Y) + WorldDy - 72, 19 - (Gear^.FrameTicks div 37));
             end;
         case Gear^.Kind of
             vgtSmallDamageTag: DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);