hedgewars/uGears.pas
changeset 3461 0781275649e9
parent 3460 d957d5f7b58d
child 3470 2b0c88693535
equal deleted inserted replaced
3460:d957d5f7b58d 3461:0781275649e9
   179             @doStepBirdy,
   179             @doStepBirdy,
   180             @doStepEggWork,
   180             @doStepEggWork,
   181             @doStepPortalShot,
   181             @doStepPortalShot,
   182             @doStepPiano,
   182             @doStepPiano,
   183             @doStepBomb,
   183             @doStepBomb,
   184             @doStepSineGunShot,
   184             @doStepSineGunShot
   185             @doStepHealthTag
       
   186             );
   185             );
   187 
   186 
   188 procedure InsertGearToList(Gear: PGear);
   187 procedure InsertGearToList(Gear: PGear);
   189 var tmp, ptmp: PGear;
   188 var tmp, ptmp: PGear;
   190 begin
   189 begin
   296                 gear^.Z:= cHHZ;
   295                 gear^.Z:= cHHZ;
   297                 end;
   296                 end;
   298 gtAmmo_Grenade: begin // bazooka
   297 gtAmmo_Grenade: begin // bazooka
   299                 gear^.Radius:= 4;
   298                 gear^.Radius:= 4;
   300                 end;
   299                 end;
   301    gtHealthTag: begin
       
   302                 gear^.Timer:= 1500;
       
   303                 gear^.Z:= 2002;
       
   304                 end;
       
   305        gtGrave: begin
   300        gtGrave: begin
   306                 gear^.ImpactSound:= sndGraveImpact;
   301                 gear^.ImpactSound:= sndGraveImpact;
   307                 gear^.nImpactSounds:= 1;
   302                 gear^.nImpactSounds:= 1;
   308                 gear^.Radius:= 10;
   303                 gear^.Radius:= 10;
   309                 gear^.Elasticity:= _0_6;
   304                 gear^.Elasticity:= _0_6;
   528         if (hwRound(Gear^.Y) >= cWaterLine) then
   523         if (hwRound(Gear^.Y) >= cWaterLine) then
   529             begin
   524             begin
   530             t:= max(Gear^.Damage, Gear^.Health);
   525             t:= max(Gear^.Damage, Gear^.Health);
   531             Gear^.Damage:= t;
   526             Gear^.Damage:= t;
   532             if (cWaterOpacity < $FF) and (hwRound(Gear^.Y) < cWaterLine + 256) then
   527             if (cWaterOpacity < $FF) and (hwRound(Gear^.Y) < cWaterLine + 256) then
   533                 AddGear(hwRound(Gear^.X), min(hwRound(Gear^.Y),cWaterLine+cVisibleWater+32), gtHealthTag, t, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog; //spawnHealthTagForHH(Gear, t);
   528                 spawnHealthTagForHH(Gear, t);
   534             uStats.HedgehogDamaged(Gear)
   529             uStats.HedgehogDamaged(Gear)
   535             end;
   530             end;
   536 
   531 
   537         team:= PHedgehog(Gear^.Hedgehog)^.Team;
   532         team:= PHedgehog(Gear^.Hedgehog)^.Team;
   538         if CurrentHedgehog^.Gear = Gear then
   533         if CurrentHedgehog^.Gear = Gear then
   592                 not PHedgehog(Gear^.Hedgehog)^.King and
   587                 not PHedgehog(Gear^.Hedgehog)^.King and
   593                 not PHedgehog(Gear^.Hedgehog)^.Effects[hePoisoned] and
   588                 not PHedgehog(Gear^.Hedgehog)^.Effects[hePoisoned] and
   594                 not SuddenDeathDmg then
   589                 not SuddenDeathDmg then
   595                 Gear^.State:= Gear^.State or gstLoser;
   590                 Gear^.State:= Gear^.State or gstLoser;
   596 
   591 
   597             AddGear(hwRound(Gear^.X), hwRound(Gear^.Y) - cHHRadius - 12,
   592             spawnHealthTagForHH(Gear, dmg);
   598                     gtHealthTag, dmg, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog; // spawnHealthTagForHH(Gear, dmg);
       
   599 
   593 
   600             RenderHealth(PHedgehog(Gear^.Hedgehog)^);
   594             RenderHealth(PHedgehog(Gear^.Hedgehog)^);
   601             RecountTeamHealth(PHedgehog(Gear^.Hedgehog)^.Team);
   595             RecountTeamHealth(PHedgehog(Gear^.Hedgehog)^.Team);
   602 
   596 
   603             end;
   597             end;
   913         if ((GameFlags and gfKarma) <> 0) and
   907         if ((GameFlags and gfKarma) <> 0) and
   914            ((GameFlags and gfInvulnerable) = 0) and
   908            ((GameFlags and gfInvulnerable) = 0) and
   915            not CurrentHedgehog^.Gear^.Invulnerable then
   909            not CurrentHedgehog^.Gear^.Invulnerable then
   916            begin // this cannot just use Damage or it interrupts shotgun and gets you called stupid
   910            begin // this cannot just use Damage or it interrupts shotgun and gets you called stupid
   917            inc(CurrentHedgehog^.Gear^.Karma, tmpDmg);
   911            inc(CurrentHedgehog^.Gear^.Karma, tmpDmg);
   918            
   912            spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
   919            AddGear(hwRound(CurrentHedgehog^.Gear^.X),
       
   920                    hwRound(CurrentHedgehog^.Gear^.Y),
       
   921                    gtHealthTag, tmpDmg, _0, _0, 0)^.Hedgehog:= CurrentHedgehog; // spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
       
   922            end;
   913            end;
   923         end;
   914         end;
   924     end;
   915     end;
   925     inc(Gear^.Damage, Damage);
   916     inc(Gear^.Damage, Damage);
   926 end;
   917 end;