hedgewars/uGears.pas
changeset 3094 97c8406acc85
parent 3086 d11dea92fa2c
child 3097 6fa39c1c41b9
equal deleted inserted replaced
3093:ff59e61346f5 3094:97c8406acc85
    55             Tex: PTexture;
    55             Tex: PTexture;
    56             Z: Longword;
    56             Z: Longword;
    57             IntersectGear: PGear;
    57             IntersectGear: PGear;
    58             FlightTime: Longword;
    58             FlightTime: Longword;
    59             uid: Longword;
    59             uid: Longword;
       
    60             ImpactSound: TSound;
    60             SoundChannel: LongInt
    61             SoundChannel: LongInt
    61         end;
    62         end;
    62 
    63 
    63 var AllInactive: boolean;
    64 var AllInactive: boolean;
    64     PrvInactive: boolean;
    65     PrvInactive: boolean;
   244 gear^.Timer:= Timer;
   245 gear^.Timer:= Timer;
   245 gear^.Z:= cUsualZ;
   246 gear^.Z:= cUsualZ;
   246 gear^.FlightTime:= 0;
   247 gear^.FlightTime:= 0;
   247 gear^.uid:= Counter;
   248 gear^.uid:= Counter;
   248 gear^.SoundChannel:= -1;
   249 gear^.SoundChannel:= -1;
       
   250 gear^.ImpactSound:= sndNone;
   249 
   251 
   250 if CurrentTeam <> nil then
   252 if CurrentTeam <> nil then
   251     begin
   253     begin
   252     gear^.Hedgehog:= CurrentHedgehog;
   254     gear^.Hedgehog:= CurrentHedgehog;
   253     gear^.IntersectGear:= CurrentHedgehog^.Gear
   255     gear^.IntersectGear:= CurrentHedgehog^.Gear
   254     end;
   256     end;
   255 
   257 
   256 case Kind of
   258 case Kind of
   257    gtAmmo_Bomb,
   259    gtAmmo_Bomb,
   258  gtClusterBomb: begin
   260  gtClusterBomb: begin
       
   261                 gear^.ImpactSound:= sndGrenadeImpact;
   259                 gear^.AdvBounce:= 1;
   262                 gear^.AdvBounce:= 1;
   260                 gear^.Radius:= 4;
   263                 gear^.Radius:= 4;
   261                 gear^.Elasticity:= _0_6;
   264                 gear^.Elasticity:= _0_6;
   262                 gear^.Friction:= _0_96;
   265                 gear^.Friction:= _0_96;
   263                 gear^.RenderTimer:= true;
   266                 gear^.RenderTimer:= true;
   264                 if gear^.Timer = 0 then gear^.Timer:= 3000
   267                 if gear^.Timer = 0 then gear^.Timer:= 3000
   265                 end;
   268                 end;
   266   gtWatermelon: begin
   269   gtWatermelon: begin
       
   270                 gear^.ImpactSound:= sndMelonImpact;
   267                 gear^.AdvBounce:= 1;
   271                 gear^.AdvBounce:= 1;
   268                 gear^.Radius:= 4;
   272                 gear^.Radius:= 4;
   269                 gear^.Elasticity:= _0_8;
   273                 gear^.Elasticity:= _0_8;
   270                 gear^.Friction:= _0_995;
   274                 gear^.Friction:= _0_995;
   271                 gear^.RenderTimer:= true;
   275                 gear^.RenderTimer:= true;
   285    gtHealthTag: begin
   289    gtHealthTag: begin
   286                 gear^.Timer:= 1500;
   290                 gear^.Timer:= 1500;
   287                 gear^.Z:= 2002;
   291                 gear^.Z:= 2002;
   288                 end;
   292                 end;
   289        gtGrave: begin
   293        gtGrave: begin
       
   294                 gear^.ImpactSound:= sndGraveImpact;
   290                 gear^.Radius:= 10;
   295                 gear^.Radius:= 10;
   291                 gear^.Elasticity:= _0_6;
   296                 gear^.Elasticity:= _0_6;
   292                 end;
   297                 end;
   293          gtBee: begin
   298          gtBee: begin
   294                 gear^.Radius:= 5;
   299                 gear^.Radius:= 5;
   327                     gear^.Timer:= getrandom(4)*1000
   332                     gear^.Timer:= getrandom(4)*1000
   328                 else
   333                 else
   329                     gear^.Timer:= cMinesTime*1;
   334                     gear^.Timer:= cMinesTime*1;
   330                 end;
   335                 end;
   331         gtCase: begin
   336         gtCase: begin
       
   337                 gear^.ImpactSound:= sndGraveImpact;
   332                 gear^.Radius:= 16;
   338                 gear^.Radius:= 16;
   333                 gear^.Elasticity:= _0_3
   339                 gear^.Elasticity:= _0_3
   334                 end;
   340                 end;
   335   gtExplosives: begin
   341   gtExplosives: begin
       
   342                 gear^.ImpactSound:= sndGrenadeImpact;
   336                 gear^.Radius:= 16;
   343                 gear^.Radius:= 16;
   337                 gear^.Elasticity:= _0_4;
   344                 gear^.Elasticity:= _0_4;
   338                 gear^.Friction:= _0_995;
   345                 gear^.Friction:= _0_995;
   339                 gear^.Health:= cBarrelHealth
   346                 gear^.Health:= cBarrelHealth
   340                 end;
   347                 end;
   402                 gear^.Z:= cOnHHZ;
   409                 gear^.Z:= cOnHHZ;
   403                 gear^.RenderTimer:= true;
   410                 gear^.RenderTimer:= true;
   404                 if not dX.isNegative then gear^.Angle:= 1 else gear^.Angle:= 3
   411                 if not dX.isNegative then gear^.Angle:= 1 else gear^.Angle:= 3
   405                 end;
   412                 end;
   406  gtHellishBomb: begin
   413  gtHellishBomb: begin
       
   414                 gear^.ImpactSound:= sndHellishImpact;
   407                 gear^.AdvBounce:= 1;
   415                 gear^.AdvBounce:= 1;
   408                 gear^.Radius:= 4;
   416                 gear^.Radius:= 4;
   409                 gear^.Elasticity:= _0_5;
   417                 gear^.Elasticity:= _0_5;
   410                 gear^.Friction:= _0_96;
   418                 gear^.Friction:= _0_96;
   411                 gear^.RenderTimer:= true;
   419                 gear^.RenderTimer:= true;
   414        gtDrill: begin
   422        gtDrill: begin
   415                 gear^.Timer:= 5000;
   423                 gear^.Timer:= 5000;
   416                 gear^.Radius:= 4
   424                 gear^.Radius:= 4
   417                 end;
   425                 end;
   418         gtBall: begin
   426         gtBall: begin
       
   427                 gear^.ImpactSound:= sndGrenadeImpact;
   419                 gear^.AdvBounce:= 1;
   428                 gear^.AdvBounce:= 1;
   420                 gear^.Radius:= 5;
   429                 gear^.Radius:= 5;
   421                 gear^.Tag:= random(8);
   430                 gear^.Tag:= random(8);
   422                 gear^.Timer:= 5000;
   431                 gear^.Timer:= 5000;
   423                 gear^.Elasticity:= _0_7;
   432                 gear^.Elasticity:= _0_7;