hedgewars/uGearsList.pas
branchwebgl
changeset 9950 2759212a27de
parent 9521 8054d9d775fd
parent 9825 de0da12b7d0e
child 10015 4feced261c68
equal deleted inserted replaced
9521:8054d9d775fd 9950:2759212a27de
   221                 gear^.RenderTimer:= true;
   221                 gear^.RenderTimer:= true;
   222                 if gear^.Timer = 0 then
   222                 if gear^.Timer = 0 then
   223                     gear^.Timer:= 3000
   223                     gear^.Timer:= 3000
   224                 end;
   224                 end;
   225   gtMelonPiece: begin
   225   gtMelonPiece: begin
   226                 gear^.Density:= _2;
   226                 gear^.AdvBounce:= 1;
       
   227                 gear^.Density:= _2
   227                 end;
   228                 end;
   228     gtHedgehog: begin
   229     gtHedgehog: begin
   229                 gear^.AdvBounce:= 1;
   230                 gear^.AdvBounce:= 1;
   230                 gear^.Radius:= cHHRadius;
   231                 gear^.Radius:= cHHRadius;
   231                 gear^.Elasticity:= _0_35;
   232                 gear^.Elasticity:= _0_35;
   236                 if (GameFlags and gfAISurvival) <> 0 then
   237                 if (GameFlags and gfAISurvival) <> 0 then
   237                     if gear^.Hedgehog^.BotLevel > 0 then
   238                     if gear^.Hedgehog^.BotLevel > 0 then
   238                         gear^.Hedgehog^.Effects[heResurrectable] := 1;
   239                         gear^.Hedgehog^.Effects[heResurrectable] := 1;
   239                 end;
   240                 end;
   240        gtShell: begin
   241        gtShell: begin
       
   242                 gear^.Elasticity:= _0_8;
       
   243                 gear^.Friction:= _0_8;
   241                 gear^.Radius:= 4;
   244                 gear^.Radius:= 4;
   242                 gear^.Density:= _1;
   245                 gear^.Density:= _1;
       
   246                 gear^.AdvBounce:= 1;
   243                 end;
   247                 end;
   244        gtSnowball: begin
   248        gtSnowball: begin
   245                 gear^.ImpactSound:= sndMudballImpact;
   249                 gear^.ImpactSound:= sndMudballImpact;
   246                 gear^.nImpactSounds:= 1;
   250                 gear^.nImpactSounds:= 1;
   247                 gear^.Radius:= 4;
   251                 gear^.Radius:= 4;
   248                 gear^.Elasticity:= _1;
       
   249                 gear^.Friction:= _1;
       
   250                 gear^.Density:= _0_5;
   252                 gear^.Density:= _0_5;
       
   253                 gear^.AdvBounce:= 1;
       
   254                 gear^.Elasticity:= _0_8;
       
   255                 gear^.Friction:= _0_8;
   251                 end;
   256                 end;
   252 
   257 
   253      gtFlake: begin
   258      gtFlake: begin
   254                 with Gear^ do
   259                 with Gear^ do
   255                     begin
   260                     begin
   257                     Radius:= 1;
   262                     Radius:= 1;
   258                     DirAngle:= random(360);
   263                     DirAngle:= random(360);
   259                     if State and gstTmpFlag = 0 then
   264                     if State and gstTmpFlag = 0 then
   260                         begin
   265                         begin
   261                         dx.isNegative:= GetRandom(2) = 0;
   266                         dx.isNegative:= GetRandom(2) = 0;
   262                         dx.QWordValue:= $40DA * GetRandom(10000) * 8;
   267                         dx.QWordValue:= QWord($40DA) * GetRandom(10000) * 8;
   263                         dy.isNegative:= false;
   268                         dy.isNegative:= false;
   264                         dy.QWordValue:= $3AD3 * GetRandom(7000) * 8;
   269                         dy.QWordValue:= QWord($3AD3) * GetRandom(7000) * 8;
   265                         if GetRandom(2) = 0 then
   270                         if GetRandom(2) = 0 then
   266                             dx := -dx
   271                             dx := -dx
   267                         end;
   272                         end;
   268                     State:= State or gstInvisible;
   273                     State:= State or gstInvisible;
   269                     Health:= random(vobFrameTicks);
   274                     Health:= random(vobFrameTicks);
   327                 gear^.State:= gear^.State or gstMoving;
   332                 gear^.State:= gear^.State or gstMoving;
   328                 gear^.Radius:= 2;
   333                 gear^.Radius:= 2;
   329                 gear^.Elasticity:= _0_55;
   334                 gear^.Elasticity:= _0_55;
   330                 gear^.Friction:= _0_995;
   335                 gear^.Friction:= _0_995;
   331                 gear^.Density:= _1_6;
   336                 gear^.Density:= _1_6;
       
   337                 gear^.AdvBounce:= 1;
   332                 if gear^.Timer = 0 then gear^.Timer:= 500;
   338                 if gear^.Timer = 0 then gear^.Timer:= 500;
   333                 end;
   339                 end;
   334        gtKnife: begin
   340        gtKnife: begin
       
   341                 gear^.AdvBounce:= 1;
       
   342                 gear^.Elasticity:= _0_8;
       
   343                 gear^.Friction:= _0_8;
   335                 gear^.Density:= _4;
   344                 gear^.Density:= _4;
   336                 gear^.Radius:= 7
   345                 gear^.Radius:= 7
   337                 end;
   346                 end;
   338         gtCase: begin
   347         gtCase: begin
   339                 gear^.ImpactSound:= sndGraveImpact;
   348                 gear^.ImpactSound:= sndGraveImpact;
   341                 gear^.Radius:= 16;
   350                 gear^.Radius:= 16;
   342                 gear^.Elasticity:= _0_3;
   351                 gear^.Elasticity:= _0_3;
   343                 if gear^.Timer = 0 then gear^.Timer:= 500
   352                 if gear^.Timer = 0 then gear^.Timer:= 500
   344                 end;
   353                 end;
   345   gtExplosives: begin
   354   gtExplosives: begin
       
   355                 gear^.AdvBounce:= 1;
   346                 gear^.ImpactSound:= sndGrenadeImpact;
   356                 gear^.ImpactSound:= sndGrenadeImpact;
   347                 gear^.nImpactSounds:= 1;
   357                 gear^.nImpactSounds:= 1;
   348                 gear^.Radius:= 16;
   358                 gear^.Radius:= 16;
   349                 gear^.Elasticity:= _0_4;
   359                 gear^.Elasticity:= _0_4;
   350                 gear^.Friction:= _0_995;
   360                 gear^.Friction:= _0_995;
   366                 gear^.Friction:= _0_03;
   376                 gear^.Friction:= _0_03;
   367                 gear^.Density:= _2;
   377                 gear^.Density:= _2;
   368                 if gear^.Timer = 0 then gear^.Timer:= 5000;
   378                 if gear^.Timer = 0 then gear^.Timer:= 5000;
   369                 end;
   379                 end;
   370      gtCluster: begin
   380      gtCluster: begin
       
   381                 gear^.AdvBounce:= 1;
       
   382                 gear^.Elasticity:= _0_8;
       
   383                 gear^.Friction:= _0_8;
   371                 gear^.Radius:= 2;
   384                 gear^.Radius:= 2;
   372                 gear^.Density:= _1_5;
   385                 gear^.Density:= _1_5;
   373                 gear^.RenderTimer:= true
   386                 gear^.RenderTimer:= true
   374                 end;
   387                 end;
   375       gtShover: gear^.Radius:= 20;
   388       gtShover: gear^.Radius:= 20;
   383                     gear^.dY:= (getrandomf - _0_8) * _0_03;
   396                     gear^.dY:= (getrandomf - _0_8) * _0_03;
   384                     gear^.dX:= (getrandomf - _0_5) * _0_4
   397                     gear^.dX:= (getrandomf - _0_5) * _0_4
   385                     end
   398                     end
   386                 end;
   399                 end;
   387    gtFirePunch: begin
   400    gtFirePunch: begin
       
   401                 if gear^.Timer = 0 then gear^.Timer:= 3000;
   388                 gear^.Radius:= 15;
   402                 gear^.Radius:= 15;
   389                 gear^.Tag:= Y
   403                 gear^.Tag:= Y
   390                 end;
   404                 end;
   391    gtAirAttack: gear^.Z:= cHHZ+2;
   405    gtAirAttack: gear^.Z:= cHHZ+2;
   392      gtAirBomb: begin
   406      gtAirBomb: begin
   409       gtTardis: begin
   423       gtTardis: begin
   410                 gear^.Pos:= 1;
   424                 gear^.Pos:= 1;
   411                 gear^.Z:= cCurrHHZ+1;
   425                 gear^.Z:= cCurrHHZ+1;
   412                 end;
   426                 end;
   413       gtMortar: begin
   427       gtMortar: begin
       
   428                 gear^.AdvBounce:= 1;
   414                 gear^.Radius:= 4;
   429                 gear^.Radius:= 4;
   415                 gear^.Elasticity:= _0_2;
   430                 gear^.Elasticity:= _0_2;
   416                 gear^.Friction:= _0_08;
   431                 gear^.Friction:= _0_08;
   417                 gear^.Density:= _1;
   432                 gear^.Density:= _1;
   418                 end;
   433                 end;
   443                 gear^.Density:= _1_5;
   458                 gear^.Density:= _1_5;
   444                 gear^.RenderTimer:= true;
   459                 gear^.RenderTimer:= true;
   445                 if gear^.Timer = 0 then gear^.Timer:= 5000
   460                 if gear^.Timer = 0 then gear^.Timer:= 5000
   446                 end;
   461                 end;
   447        gtDrill: begin
   462        gtDrill: begin
       
   463                 gear^.AdvBounce:= 1;
       
   464                 gear^.Elasticity:= _0_8;
       
   465                 gear^.Friction:= _0_8;
   448                 if gear^.Timer = 0 then
   466                 if gear^.Timer = 0 then
   449                     gear^.Timer:= 5000;
   467                     gear^.Timer:= 5000;
   450                 // Tag for drill strike. if 1 then first impact occured already
   468                 // Tag for drill strike. if 1 then first impact occured already
   451                 gear^.Tag := 0;
   469                 gear^.Tag := 0;
   452                 gear^.Radius:= 4;
   470                 gear^.Radius:= 4;
   475                 gear^.Health:= 2000;
   493                 gear^.Health:= 2000;
   476                 gear^.Damage:= 100;
   494                 gear^.Damage:= 100;
   477                 gear^.State:= Gear^.State or gstSubmersible
   495                 gear^.State:= Gear^.State or gstSubmersible
   478                 end;
   496                 end;
   479      gtMolotov: begin
   497      gtMolotov: begin
       
   498                 gear^.AdvBounce:= 1;
   480                 gear^.Radius:= 6;
   499                 gear^.Radius:= 6;
   481                 gear^.Density:= _2;
   500                 gear^.Density:= _2
   482                 end;
   501                 end;
   483        gtBirdy: begin
   502        gtBirdy: begin
   484                 gear^.Radius:= 16; // todo: check
   503                 gear^.Radius:= 16; // todo: check
   485                 gear^.Health := 2000;
   504                 gear^.Health := 2000;
   486                 gear^.FlightTime := 2;
   505                 gear^.FlightTime := 2
   487                 end;
   506                 end;
   488          gtEgg: begin
   507          gtEgg: begin
       
   508                 gear^.AdvBounce:= 1;
   489                 gear^.Radius:= 4;
   509                 gear^.Radius:= 4;
   490                 gear^.Elasticity:= _0_6;
   510                 gear^.Elasticity:= _0_6;
   491                 gear^.Friction:= _0_96;
   511                 gear^.Friction:= _0_96;
   492                 gear^.Density:= _1;
   512                 gear^.Density:= _1;
   493                 if gear^.Timer = 0 then
   513                 if gear^.Timer = 0 then
   494                     gear^.Timer:= 3000
   514                     gear^.Timer:= 3000
   495                 end;
   515                 end;
   496       gtPortal: begin
   516       gtPortal: begin
   497                 gear^.ImpactSound:= sndMelonImpact;
   517                 gear^.ImpactSound:= sndMelonImpact;
   498                 gear^.nImpactSounds:= 1;
   518                 gear^.nImpactSounds:= 1;
   499                 gear^.AdvBounce:= 0;
       
   500                 gear^.Radius:= 17;
   519                 gear^.Radius:= 17;
   501                 // set color
   520                 // set color
   502                 gear^.Tag:= 2 * gear^.Timer;
   521                 gear^.Tag:= 2 * gear^.Timer;
   503                 gear^.Timer:= 15000;
   522                 gear^.Timer:= 15000;
   504                 gear^.RenderTimer:= false;
   523                 gear^.RenderTimer:= false;
   534                 end;
   553                 end;
   535      gtWaterUp: begin
   554      gtWaterUp: begin
   536                 gear^.Tag := 47;
   555                 gear^.Tag := 47;
   537                 end;
   556                 end;
   538   gtNapalmBomb: begin
   557   gtNapalmBomb: begin
       
   558                 gear^.Elasticity:= _0_8;
       
   559                 gear^.Friction:= _0_8;
   539                 if gear^.Timer = 0 then gear^.Timer:= 1000;
   560                 if gear^.Timer = 0 then gear^.Timer:= 1000;
   540                 gear^.Radius:= 5;
   561                 gear^.Radius:= 5;
   541                 gear^.Density:= _1_5;
   562                 gear^.Density:= _1_5;
   542                 end;
   563                 end;
   543 {
   564 {