hedgewars/uGearsList.pas
changeset 9195 e653e96b0ec3
parent 9080 9b42757d7e71
child 9197 e4e366013e9a
child 9479 167dea42d7d7
equal deleted inserted replaced
9193:1394137589e4 9195:e653e96b0ec3
   263                         if GetRandom(2) = 0 then
   263                         if GetRandom(2) = 0 then
   264                             dx := -dx
   264                             dx := -dx
   265                         end;
   265                         end;
   266                     State:= State or gstInvisible;
   266                     State:= State or gstInvisible;
   267                     Health:= random(vobFrameTicks);
   267                     Health:= random(vobFrameTicks);
   268                     Timer:= random(vobFramesCount);
   268                     if gear^.Timer = 0 then Timer:= random(vobFramesCount);
   269                     Damage:= (random(2) * 2 - 1) * (vobVelocity + random(vobVelocity)) * 8;
   269                     Damage:= (random(2) * 2 - 1) * (vobVelocity + random(vobVelocity)) * 8;
   270                     end
   270                     end
   271                 end;
   271                 end;
   272        gtGrave: begin
   272        gtGrave: begin
   273                 gear^.ImpactSound:= sndGraveImpact;
   273                 gear^.ImpactSound:= sndGraveImpact;
   275                 gear^.Radius:= 10;
   275                 gear^.Radius:= 10;
   276                 gear^.Elasticity:= _0_6;
   276                 gear^.Elasticity:= _0_6;
   277                 end;
   277                 end;
   278          gtBee: begin
   278          gtBee: begin
   279                 gear^.Radius:= 5;
   279                 gear^.Radius:= 5;
   280                 gear^.Timer:= 500;
   280                 if gear^.Timer = 0 then gear^.Timer:= 500;
   281                 gear^.RenderTimer:= true;
   281                 gear^.RenderTimer:= true;
   282                 gear^.Elasticity:= _0_9;
   282                 gear^.Elasticity:= _0_9;
   283                 gear^.Tag:= 0;
   283                 gear^.Tag:= 0;
   284                 end;
   284                 end;
   285    gtSeduction: begin
   285    gtSeduction: begin
   286                 gear^.Radius:= 250;
   286                 gear^.Radius:= 250;
   287                 end;
   287                 end;
   288  gtShotgunShot: begin
   288  gtShotgunShot: begin
   289                 gear^.Timer:= 900;
   289                 if gear^.Timer = 0 then gear^.Timer:= 900;
   290                 gear^.Radius:= 2
   290                 gear^.Radius:= 2
   291                 end;
   291                 end;
   292   gtPickHammer: begin
   292   gtPickHammer: begin
   293                 gear^.Radius:= 10;
   293                 gear^.Radius:= 10;
   294                 gear^.Timer:= 4000
   294                 if gear^.Timer = 0 then gear^.Timer:= 4000
   295                 end;
   295                 end;
   296    gtHammerHit: begin
   296    gtHammerHit: begin
   297                 gear^.Radius:= 8;
   297                 gear^.Radius:= 8;
   298                 gear^.Timer:= 125
   298                 if gear^.Timer = 0 then gear^.Timer:= 125
   299                 end;
   299                 end;
   300         gtRope: begin
   300         gtRope: begin
   301                 gear^.Radius:= 3;
   301                 gear^.Radius:= 3;
   302                 gear^.Friction:= _450 * _0_01 * cRopePercent;
   302                 gear^.Friction:= _450 * _0_01 * cRopePercent;
   303                 RopePoints.Count:= 0;
   303                 RopePoints.Count:= 0;
   309                 gear^.State:= gear^.State or gstMoving;
   309                 gear^.State:= gear^.State or gstMoving;
   310                 gear^.Radius:= 2;
   310                 gear^.Radius:= 2;
   311                 gear^.Elasticity:= _0_55;
   311                 gear^.Elasticity:= _0_55;
   312                 gear^.Friction:= _0_995;
   312                 gear^.Friction:= _0_995;
   313                 gear^.Density:= _1;
   313                 gear^.Density:= _1;
   314                 if cMinesTime < 0 then
   314                 if gear^.Timer = 0 then
   315                     gear^.Timer:= getrandom(51)*100
   315                     begin
   316                 else
   316                     if cMinesTime < 0 then
   317                     gear^.Timer:= cMinesTime;
   317                         gear^.Timer:= getrandom(51)*100
       
   318                     else
       
   319                         gear^.Timer:= cMinesTime
       
   320                     end
   318                 end;
   321                 end;
   319        gtSMine: begin
   322        gtSMine: begin
   320                 gear^.Health:= 10;
   323                 gear^.Health:= 10;
   321                 gear^.State:= gear^.State or gstMoving;
   324                 gear^.State:= gear^.State or gstMoving;
   322                 gear^.Radius:= 2;
   325                 gear^.Radius:= 2;
   323                 gear^.Elasticity:= _0_55;
   326                 gear^.Elasticity:= _0_55;
   324                 gear^.Friction:= _0_995;
   327                 gear^.Friction:= _0_995;
   325                 gear^.Density:= _1_6;
   328                 gear^.Density:= _1_6;
   326                 gear^.Timer:= 500;
   329                 if gear^.Timer = 0 then gear^.Timer:= 500;
   327                 end;
   330                 end;
   328        gtKnife: begin
   331        gtKnife: begin
   329                 gear^.Density:= _4;
   332                 gear^.Density:= _4;
   330                 gear^.Radius:= 7
   333                 gear^.Radius:= 7
   331                 end;
   334                 end;
   332         gtCase: begin
   335         gtCase: begin
   333                 gear^.ImpactSound:= sndGraveImpact;
   336                 gear^.ImpactSound:= sndGraveImpact;
   334                 gear^.nImpactSounds:= 1;
   337                 gear^.nImpactSounds:= 1;
   335                 gear^.Radius:= 16;
   338                 gear^.Radius:= 16;
   336                 gear^.Elasticity:= _0_3;
   339                 gear^.Elasticity:= _0_3;
   337                 gear^.Timer:= 500
   340                 if gear^.Timer = 0 then gear^.Timer:= 500
   338                 end;
   341                 end;
   339   gtExplosives: begin
   342   gtExplosives: begin
   340                 gear^.ImpactSound:= sndGrenadeImpact;
   343                 gear^.ImpactSound:= sndGrenadeImpact;
   341                 gear^.nImpactSounds:= 1;
   344                 gear^.nImpactSounds:= 1;
   342                 gear^.Radius:= 16;
   345                 gear^.Radius:= 16;
   357     gtDynamite: begin
   360     gtDynamite: begin
   358                 gear^.Radius:= 3;
   361                 gear^.Radius:= 3;
   359                 gear^.Elasticity:= _0_55;
   362                 gear^.Elasticity:= _0_55;
   360                 gear^.Friction:= _0_03;
   363                 gear^.Friction:= _0_03;
   361                 gear^.Density:= _2;
   364                 gear^.Density:= _2;
   362                 gear^.Timer:= 5000;
   365                 if gear^.Timer = 0 then gear^.Timer:= 5000;
   363                 end;
   366                 end;
   364      gtCluster: begin
   367      gtCluster: begin
   365                 gear^.Radius:= 2;
   368                 gear^.Radius:= 2;
   366                 gear^.Density:= _1_5;
   369                 gear^.Density:= _1_5;
   367                 gear^.RenderTimer:= true
   370                 gear^.RenderTimer:= true
   387                 gear^.Radius:= 5;
   390                 gear^.Radius:= 5;
   388                 gear^.Density:= _2;
   391                 gear^.Density:= _2;
   389                 end;
   392                 end;
   390    gtBlowTorch: begin
   393    gtBlowTorch: begin
   391                 gear^.Radius:= cHHRadius + cBlowTorchC;
   394                 gear^.Radius:= cHHRadius + cBlowTorchC;
   392                 gear^.Timer:= 7500
   395                 if gear^.Timer = 0 then gear^.Timer:= 7500
   393                 end;
   396                 end;
   394     gtSwitcher: begin
   397     gtSwitcher: begin
   395                 gear^.Z:= cCurrHHZ
   398                 gear^.Z:= cCurrHHZ
   396                 end;
   399                 end;
   397       gtTarget: begin
   400       gtTarget: begin
   398                 gear^.ImpactSound:= sndGrenadeImpact;
   401                 gear^.ImpactSound:= sndGrenadeImpact;
   399                 gear^.nImpactSounds:= 1;
   402                 gear^.nImpactSounds:= 1;
   400                 gear^.Radius:= 10;
   403                 gear^.Radius:= 10;
   401                 gear^.Elasticity:= _0_3;
   404                 gear^.Elasticity:= _0_3;
   402                 gear^.Timer:= 0
       
   403                 end;
   405                 end;
   404       gtTardis: begin
   406       gtTardis: begin
   405                 gear^.Timer:= 0;
       
   406                 gear^.Pos:= 1;
   407                 gear^.Pos:= 1;
   407                 gear^.Z:= cCurrHHZ+1;
   408                 gear^.Z:= cCurrHHZ+1;
   408                 end;
   409                 end;
   409       gtMortar: begin
   410       gtMortar: begin
   410                 gear^.Radius:= 4;
   411                 gear^.Radius:= 4;
   436                 gear^.Radius:= 4;
   437                 gear^.Radius:= 4;
   437                 gear^.Elasticity:= _0_5;
   438                 gear^.Elasticity:= _0_5;
   438                 gear^.Friction:= _0_96;
   439                 gear^.Friction:= _0_96;
   439                 gear^.Density:= _1_5;
   440                 gear^.Density:= _1_5;
   440                 gear^.RenderTimer:= true;
   441                 gear^.RenderTimer:= true;
   441                 gear^.Timer:= 5000
   442                 if gear^.Timer = 0 then gear^.Timer:= 5000
   442                 end;
   443                 end;
   443        gtDrill: begin
   444        gtDrill: begin
   444                 if gear^.Timer = 0 then
   445                 if gear^.Timer = 0 then
   445                     gear^.Timer:= 5000;
   446                     gear^.Timer:= 5000;
   446                 // Tag for drill strike. if 1 then first impact occured already
   447                 // Tag for drill strike. if 1 then first impact occured already
   452                 gear^.ImpactSound:= sndGrenadeImpact;
   453                 gear^.ImpactSound:= sndGrenadeImpact;
   453                 gear^.nImpactSounds:= 1;
   454                 gear^.nImpactSounds:= 1;
   454                 gear^.AdvBounce:= 1;
   455                 gear^.AdvBounce:= 1;
   455                 gear^.Radius:= 5;
   456                 gear^.Radius:= 5;
   456                 gear^.Tag:= random(8);
   457                 gear^.Tag:= random(8);
   457                 gear^.Timer:= 5000;
   458                 if gear^.Timer = 0 then gear^.Timer:= 5000;
   458                 gear^.Elasticity:= _0_7;
   459                 gear^.Elasticity:= _0_7;
   459                 gear^.Friction:= _0_995;
   460                 gear^.Friction:= _0_995;
   460                 gear^.Density:= _1_5;
   461                 gear^.Density:= _1_5;
   461                 end;
   462                 end;
   462      gtBallgun: begin
   463      gtBallgun: begin
   463                 gear^.Timer:= 5001;
   464                 if gear^.Timer = 0 then gear^.Timer:= 5001;
   464                 end;
   465                 end;
   465      gtRCPlane: begin
   466      gtRCPlane: begin
   466                 gear^.Timer:= 15000;
   467                 if gear^.Timer = 0 then gear^.Timer:= 15000;
   467                 gear^.Health:= 3;
   468                 gear^.Health:= 3;
   468                 gear^.Radius:= 8
   469                 gear^.Radius:= 8
   469                 end;
   470                 end;
   470      gtJetpack: begin
   471      gtJetpack: begin
   471                 gear^.Health:= 2000;
   472                 gear^.Health:= 2000;
   472                 gear^.Damage:= 100;
   473                 gear^.Damage:= 100;
   473                 gear^.State:= gstSubmersible
   474                 gear^.State:= Gear^.State or gstSubmersible
   474                 end;
   475                 end;
   475      gtMolotov: begin
   476      gtMolotov: begin
   476                 gear^.Radius:= 6;
   477                 gear^.Radius:= 6;
   477                 gear^.Density:= _2;
   478                 gear^.Density:= _2;
   478                 end;
   479                 end;
   479        gtBirdy: begin
   480        gtBirdy: begin
   480                 gear^.Radius:= 16; // todo: check
   481                 gear^.Radius:= 16; // todo: check
   481                 gear^.Timer:= 0;
       
   482                 gear^.Health := 2000;
   482                 gear^.Health := 2000;
   483                 gear^.FlightTime := 2;
   483                 gear^.FlightTime := 2;
   484                 end;
   484                 end;
   485          gtEgg: begin
   485          gtEgg: begin
   486                 gear^.Radius:= 4;
   486                 gear^.Radius:= 4;
   509                 gear^.Radius:= 5;
   509                 gear^.Radius:= 5;
   510                 gear^.Health:= 6000;
   510                 gear^.Health:= 6000;
   511                 end;
   511                 end;
   512 gtFlamethrower: begin
   512 gtFlamethrower: begin
   513                 gear^.Tag:= 10;
   513                 gear^.Tag:= 10;
   514                 gear^.Timer:= 10;
   514                 if gear^.Timer = 0 then gear^.Timer:= 10;
   515                 gear^.Health:= 500;
   515                 gear^.Health:= 500;
   516                 gear^.Damage:= 100;
   516                 gear^.Damage:= 100;
   517                 end;
   517                 end;
   518      gtLandGun: begin
   518      gtLandGun: begin
   519                 gear^.Tag:= 10;
   519                 gear^.Tag:= 10;
   520                 gear^.Timer:= 10;
   520                 if gear^.Timer = 0 then gear^.Timer:= 10;
   521                 gear^.Health:= 1000;
   521                 gear^.Health:= 1000;
   522                 gear^.Damage:= 100;
   522                 gear^.Damage:= 100;
   523                 end;
   523                 end;
   524  gtPoisonCloud: begin
   524  gtPoisonCloud: begin
   525                 gear^.Timer:= 5000;
   525                 if gear^.Timer = 0 then gear^.Timer:= 5000;
   526                 gear^.dY:= int2hwfloat(-4 + longint(getRandom(8))) / 1000;
   526                 gear^.dY:= int2hwfloat(-4 + longint(getRandom(8))) / 1000;
   527                 end;
   527                 end;
   528  gtResurrector: begin
   528  gtResurrector: begin
   529                 gear^.Radius := 100;
   529                 gear^.Radius := 100;
   530                 gear^.Tag := 0
   530                 gear^.Tag := 0
   531                 end;
   531                 end;
   532      gtWaterUp: begin
   532      gtWaterUp: begin
   533                 gear^.Tag := 47;
   533                 gear^.Tag := 47;
   534                 end;
   534                 end;
   535   gtNapalmBomb: begin
   535   gtNapalmBomb: begin
   536                 gear^.Timer:= 1000;
   536                 if gear^.Timer = 0 then gear^.Timer:= 1000;
   537                 gear^.Radius:= 5;
   537                 gear^.Radius:= 5;
   538                 gear^.Density:= _1_5;
   538                 gear^.Density:= _1_5;
   539                 end;
   539                 end;
   540 {
   540 {
   541    gtStructure: begin
   541    gtStructure: begin