hedgewars/uGears.pas
changeset 3065 4afa5e3e27e4
parent 3054 3b6b57d8b7cd
child 3072 b18038b3a0f4
--- a/hedgewars/uGears.pas	Thu Mar 25 23:02:55 2010 +0000
+++ b/hedgewars/uGears.pas	Thu Mar 25 23:03:21 2010 +0000
@@ -183,7 +183,8 @@
             @doStepMolotov,
             @doStepCase,
             @doStepBirdy,
-            @doStepBigExplosion
+            @doStepBigExplosion,
+			@doStepEggWork
             );
 
 procedure InsertGearToList(Gear: PGear);
@@ -443,13 +444,22 @@
        gtBirdy: begin
                 gear^.Radius:= 16; // todo: check
                 gear^.Timer:= 500;
-                gear^.Health:= 2000;
+				gear^.Health := 2000;
+                gear^.FlightTime := 2;
                 end;
 gtBigExplosion: begin
                 gear^.X:= gear^.X;
                 gear^.Y:= gear^.Y;
                 gear^.Angle:= random(360);
                 end;
+		 gtEgg: begin 
+                gear^.AdvBounce:= true;
+                gear^.Radius:= 4;
+                gear^.Elasticity:= _0_6;
+                gear^.Friction:= _0_96;
+                gear^.RenderTimer:= true;
+                if gear^.Timer = 0 then gear^.Timer:= 3000
+                end;
      end;
 InsertGearToList(gear);
 AddGear:= gear;
@@ -1673,6 +1683,7 @@
                     DrawRotatedTextureF(SpritesData[sprBigExplosion].Texture, 0.85 * (-power(2, -4 * Int(Gear^.Timer)/250) + 1) + 0.4, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 385, 385, Gear^.Angle);
                     glColor4f(1, 1, 1, 1);
                     end;
+			   gtEgg: DrawRotated(sprBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
          end;
       if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(hwRound(Gear^.X) + 8 + WorldDx, hwRound(Gear^.Y) + 8 + WorldDy, Gear^.Tex);
       Gear:= Gear^.NextGear