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