hedgewars/uGears.pas
changeset 3072 b18038b3a0f4
parent 3065 4afa5e3e27e4
child 3080 b7fa8ad60e3b
equal deleted inserted replaced
3071:f40a3fbe3b34 3072:b18038b3a0f4
    27     PGear = ^TGear;
    27     PGear = ^TGear;
    28     TGearStepProcedure = procedure (Gear: PGear);
    28     TGearStepProcedure = procedure (Gear: PGear);
    29     TGear = record
    29     TGear = record
    30             NextGear, PrevGear: PGear;
    30             NextGear, PrevGear: PGear;
    31             Active: Boolean;
    31             Active: Boolean;
    32             AdvBounce: Boolean;
    32             AdvBounce: Longword;
    33             Invulnerable: Boolean;
    33             Invulnerable: Boolean;
    34             RenderTimer: Boolean;
    34             RenderTimer: Boolean;
    35             Ammo : PAmmo;
    35             Ammo : PAmmo;
    36             State : Longword;
    36             State : Longword;
    37             X : hwFloat;
    37             X : hwFloat;
   254     end;
   254     end;
   255 
   255 
   256 case Kind of
   256 case Kind of
   257    gtAmmo_Bomb,
   257    gtAmmo_Bomb,
   258  gtClusterBomb: begin
   258  gtClusterBomb: begin
   259                 gear^.AdvBounce:= true;
   259                 gear^.AdvBounce:= 1;
   260                 gear^.Radius:= 4;
   260                 gear^.Radius:= 4;
   261                 gear^.Elasticity:= _0_6;
   261                 gear^.Elasticity:= _0_6;
   262                 gear^.Friction:= _0_96;
   262                 gear^.Friction:= _0_96;
   263                 gear^.RenderTimer:= true;
   263                 gear^.RenderTimer:= true;
   264                 if gear^.Timer = 0 then gear^.Timer:= 3000
   264                 if gear^.Timer = 0 then gear^.Timer:= 3000
   265                 end;
   265                 end;
   266   gtWatermelon: begin
   266   gtWatermelon: begin
   267                 gear^.AdvBounce:= true;
   267                 gear^.AdvBounce:= 1;
   268                 gear^.Radius:= 4;
   268                 gear^.Radius:= 4;
   269                 gear^.Elasticity:= _0_8;
   269                 gear^.Elasticity:= _0_8;
   270                 gear^.Friction:= _0_995;
   270                 gear^.Friction:= _0_995;
   271                 gear^.RenderTimer:= true;
   271                 gear^.RenderTimer:= true;
   272                 if gear^.Timer = 0 then gear^.Timer:= 3000
   272                 if gear^.Timer = 0 then gear^.Timer:= 3000
   273                 end;
   273                 end;
   274     gtHedgehog: begin
   274     gtHedgehog: begin
   275                 gear^.AdvBounce:= true;
   275                 gear^.AdvBounce:= 1;
   276                 gear^.Radius:= cHHRadius;
   276                 gear^.Radius:= cHHRadius;
   277                 gear^.Elasticity:= _0_35;
   277                 gear^.Elasticity:= _0_35;
   278                 gear^.Friction:= _0_999;
   278                 gear^.Friction:= _0_999;
   279                 gear^.Angle:= cMaxAngle div 2;
   279                 gear^.Angle:= cMaxAngle div 2;
   280                 gear^.Z:= cHHZ;
   280                 gear^.Z:= cHHZ;
   406                 gear^.Z:= cOnHHZ;
   406                 gear^.Z:= cOnHHZ;
   407                 gear^.RenderTimer:= true;
   407                 gear^.RenderTimer:= true;
   408                 if not dX.isNegative then gear^.Angle:= 1 else gear^.Angle:= 3
   408                 if not dX.isNegative then gear^.Angle:= 1 else gear^.Angle:= 3
   409                 end;
   409                 end;
   410  gtHellishBomb: begin
   410  gtHellishBomb: begin
   411                 gear^.AdvBounce:= true;
   411                 gear^.AdvBounce:= 1;
   412                 gear^.Radius:= 4;
   412                 gear^.Radius:= 4;
   413                 gear^.Elasticity:= _0_5;
   413                 gear^.Elasticity:= _0_5;
   414                 gear^.Friction:= _0_96;
   414                 gear^.Friction:= _0_96;
   415                 gear^.RenderTimer:= true;
   415                 gear^.RenderTimer:= true;
   416                 gear^.Timer:= 5000
   416                 gear^.Timer:= 5000
   418        gtDrill: begin
   418        gtDrill: begin
   419                 gear^.Timer:= 5000;
   419                 gear^.Timer:= 5000;
   420                 gear^.Radius:= 4
   420                 gear^.Radius:= 4
   421                 end;
   421                 end;
   422         gtBall: begin
   422         gtBall: begin
   423                 gear^.AdvBounce:= true;
   423                 gear^.AdvBounce:= 1;
   424                 gear^.Radius:= 5;
   424                 gear^.Radius:= 5;
   425                 gear^.Tag:= random(8);
   425                 gear^.Tag:= random(8);
   426                 gear^.Timer:= 5000;
   426                 gear^.Timer:= 5000;
   427                 gear^.Elasticity:= _0_7;
   427                 gear^.Elasticity:= _0_7;
   428                 gear^.Friction:= _0_995;
   428                 gear^.Friction:= _0_995;
   451                 gear^.X:= gear^.X;
   451                 gear^.X:= gear^.X;
   452                 gear^.Y:= gear^.Y;
   452                 gear^.Y:= gear^.Y;
   453                 gear^.Angle:= random(360);
   453                 gear^.Angle:= random(360);
   454                 end;
   454                 end;
   455 		 gtEgg: begin 
   455 		 gtEgg: begin 
   456                 gear^.AdvBounce:= true;
       
   457                 gear^.Radius:= 4;
   456                 gear^.Radius:= 4;
   458                 gear^.Elasticity:= _0_6;
   457                 gear^.Elasticity:= _0_6;
   459                 gear^.Friction:= _0_96;
   458                 gear^.Friction:= _0_96;
   460                 gear^.RenderTimer:= true;
   459                 gear^.RenderTimer:= true;
   461                 if gear^.Timer = 0 then gear^.Timer:= 3000
   460                 if gear^.Timer = 0 then gear^.Timer:= 3000