hedgewars/uGearsList.pas
branchios-develop
changeset 13418 ba39a1d396c0
parent 13404 3d6aae2ae698
child 13468 f1d349a52bc7
equal deleted inserted replaced
13416:6e8b807bda4b 13418:ba39a1d396c0
   104 (*         gtIceGun *) , amIceGun
   104 (*         gtIceGun *) , amIceGun
   105 (*        gtAddAmmo *) , amNothing
   105 (*        gtAddAmmo *) , amNothing
   106 (*  gtGenericFaller *) , amNothing
   106 (*  gtGenericFaller *) , amNothing
   107 (*          gtKnife *) , amKnife
   107 (*          gtKnife *) , amKnife
   108 (*           gtDuck *) , amDuck
   108 (*           gtDuck *) , amDuck
       
   109 (*        gtMinigun *) , amMinigun
       
   110 (*  gtMinigunBullet *) , amMinigun
   109     );
   111     );
   110 
   112 
   111 
   113 
   112 var GCounter: LongWord = 0; // this does not get re-initialized, but should be harmless
   114 var GCounter: LongWord = 0; // this does not get re-initialized, but should be harmless
   113 
   115 
   220 case Kind of
   222 case Kind of
   221           gtFlame: Gear^.Boom := 2;  // some additional expl in there are x3, x4 this
   223           gtFlame: Gear^.Boom := 2;  // some additional expl in there are x3, x4 this
   222        gtHedgehog: Gear^.Boom := 30;
   224        gtHedgehog: Gear^.Boom := 30;
   223            gtMine: Gear^.Boom := 50;
   225            gtMine: Gear^.Boom := 50;
   224            gtCase: Gear^.Boom := 25;
   226            gtCase: Gear^.Boom := 25;
   225         gtAirMine: Gear^.Boom := 25;
   227         gtAirMine: Gear^.Boom := 30;
   226      gtExplosives: Gear^.Boom := 75;
   228      gtExplosives: Gear^.Boom := 75;
   227         gtGrenade: Gear^.Boom := 50;
   229         gtGrenade: Gear^.Boom := 50;
   228           gtShell: Gear^.Boom := 50;
   230           gtShell: Gear^.Boom := 50;
   229             gtBee: Gear^.Boom := 50;
   231             gtBee: Gear^.Boom := 50;
   230     gtShotgunShot: Gear^.Boom := 25;
   232     gtShotgunShot: Gear^.Boom := 25;
   263                          Gear^.Boom := 2
   265                          Gear^.Boom := 2
   264                     else Gear^.Boom := 3;
   266                     else Gear^.Boom := 3;
   265     gtPoisonCloud: Gear^.Boom := 20;
   267     gtPoisonCloud: Gear^.Boom := 20;
   266           gtKnife: Gear^.Boom := 40000; // arbitrary scaling factor since impact-based
   268           gtKnife: Gear^.Boom := 40000; // arbitrary scaling factor since impact-based
   267            gtDuck: Gear^.Boom := 40;
   269            gtDuck: Gear^.Boom := 40;
       
   270     gtMinigunBullet: Gear^.Boom := 2;
   268     end;
   271     end;
   269 
   272 
   270 case Kind of
   273 case Kind of
   271      gtGrenade,
   274      gtGrenade,
   272      gtClusterBomb,
   275      gtClusterBomb,
   310                 gear^.Density:= _3;
   313                 gear^.Density:= _3;
   311                 gear^.Z:= cHHZ;
   314                 gear^.Z:= cHHZ;
   312                 if (GameFlags and gfAISurvival) <> 0 then
   315                 if (GameFlags and gfAISurvival) <> 0 then
   313                     if gear^.Hedgehog^.BotLevel > 0 then
   316                     if gear^.Hedgehog^.BotLevel > 0 then
   314                         gear^.Hedgehog^.Effects[heResurrectable] := 1;
   317                         gear^.Hedgehog^.Effects[heResurrectable] := 1;
       
   318                 if (GameFlags and gfArtillery) <> 0 then
       
   319                     gear^.Hedgehog^.Effects[heArtillery] := 1;
   315                 // this would presumably be set in the frontend
   320                 // this would presumably be set in the frontend
   316                 // if we weren't going to do that yet, would need to reinit GetRandom
   321                 // if we weren't going to do that yet, would need to reinit GetRandom
   317                 // oh, and, randomising slightly R and B might be nice too.
   322                 // oh, and, randomising slightly R and B might be nice too.
   318                 //gear^.Tint:= $fa00efff or ((random(80)+128) shl 16)
   323                 //gear^.Tint:= $fa00efff or ((random(80)+128) shl 16)
   319                 //gear^.Tint:= $faa4efff
   324                 //gear^.Tint:= $faa4efff
   427                     else
   432                     else
   428                         gear^.Timer:= cMinesTime
   433                         gear^.Timer:= cMinesTime
   429                     end
   434                     end
   430                 end;
   435                 end;
   431      gtAirMine: begin
   436      gtAirMine: begin
       
   437                 gear^.AdvBounce:= 1;
   432                 gear^.ImpactSound:= sndAirMineImpact;
   438                 gear^.ImpactSound:= sndAirMineImpact;
   433                 gear^.nImpactSounds:= 1;
   439                 gear^.nImpactSounds:= 1;
   434                 gear^.Health:= 30;
   440                 gear^.Health:= 30;
   435                 gear^.State:= gear^.State or gstMoving or gstNoGravity or gstSubmersible;
   441                 gear^.State:= gear^.State or gstMoving or gstNoGravity or gstSubmersible;
   436                 gear^.Radius:= 8;
   442                 gear^.Radius:= 8;
   438                 gear^.Friction:= _0_995;
   444                 gear^.Friction:= _0_995;
   439                 gear^.Density:= _1;
   445                 gear^.Density:= _1;
   440                 gear^.Angle:= 175; // Radius at which air bombs will start "seeking". $FFFFFFFF = unlimited. check is skipped.
   446                 gear^.Angle:= 175; // Radius at which air bombs will start "seeking". $FFFFFFFF = unlimited. check is skipped.
   441                 gear^.Power:= cMaxWindSpeed.QWordValue div 2; // hwFloat converted. 1/2 g default. defines the "seek" speed when a gear is in range.
   447                 gear^.Power:= cMaxWindSpeed.QWordValue div 2; // hwFloat converted. 1/2 g default. defines the "seek" speed when a gear is in range.
   442                 gear^.Pos:= cMaxWindSpeed.QWordValue * 3 div 2; // air friction. slows it down when not hitting stuff
   448                 gear^.Pos:= cMaxWindSpeed.QWordValue * 3 div 2; // air friction. slows it down when not hitting stuff
   443                 gear^.Karma:= 30; // damage
       
   444                 if gear^.Timer = 0 then
   449                 if gear^.Timer = 0 then
   445                     begin
   450                     begin
   446                     if cMinesTime < 0 then
   451                     if cMinesTime < 0 then
   447                         gear^.Timer:= getrandom(13)*100
   452                         gear^.Timer:= getrandom(13)*100
   448                     else
   453                     else
   738                 gear^.State:= gear^.State or gstSubmersible;
   743                 gear^.State:= gear^.State or gstSubmersible;
   739                 gear^.Elasticity:= _0_6;
   744                 gear^.Elasticity:= _0_6;
   740                 gear^.Friction:= _0_8;
   745                 gear^.Friction:= _0_8;
   741                 gear^.Density:= _0_5;
   746                 gear^.Density:= _0_5;
   742                 gear^.AdvBounce:= 1;
   747                 gear^.AdvBounce:= 1;
       
   748                 end;
       
   749      gtMinigun: begin
       
   750                 // Timer. First, it's the timer before shooting. Then it will become the shooting timer and is set to Karma
       
   751                 if gear^.Timer = 0 then
       
   752                     gear^.Timer:= 601;
       
   753                 // minigun shooting time. 1 bullet is fired every 50ms
       
   754                 gear^.Karma:= 3451;
       
   755                 end;
       
   756  gtMinigunBullet: begin
       
   757                 gear^.Radius:= 1;
       
   758                 gear^.Health:= 2;
   743                 end;
   759                 end;
   744 gtGenericFaller:begin
   760 gtGenericFaller:begin
   745                 gear^.AdvBounce:= 1;
   761                 gear^.AdvBounce:= 1;
   746                 gear^.Radius:= 1;
   762                 gear^.Radius:= 1;
   747                 gear^.Elasticity:= _0_9;
   763                 gear^.Elasticity:= _0_9;