hedgewars/uGearsList.pas
changeset 10636 aba9ae27ead0
parent 10634 35d059bd0932
child 10638 99975e1860d2
equal deleted inserted replaced
10635:8e8b320eefad 10636:aba9ae27ead0
   658         CurAmmoGear^.Message:= gmDestroy;
   658         CurAmmoGear^.Message:= gmDestroy;
   659         exit
   659         exit
   660         end
   660         end
   661     else*)
   661     else*)
   662         begin
   662         begin
   663         if (Gear <> CurrentHedgehog^.Gear) or (CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtKamikaze) then
   663         if ((CurrentHedgehog = nil) or (Gear <> CurrentHedgehog^.Gear)) or (CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtKamikaze) then
   664             Gear^.Hedgehog^.Team^.Clan^.Flawless:= false;
   664             Gear^.Hedgehog^.Team^.Clan^.Flawless:= false;
   665         if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then
   665         if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then
   666             begin
   666             begin
   667             t:= max(Gear^.Damage, Gear^.Health);
   667             t:= max(Gear^.Damage, Gear^.Health);
   668             Gear^.Damage:= t;
   668             Gear^.Damage:= t;
   669             if (((not SuddenDeathDmg) and (WaterOpacity < $FF)) or (SuddenDeathDmg and (SDWaterOpacity < $FF))) then
   669             if (((not SuddenDeathDmg) and (WaterOpacity < $FF)) or (SuddenDeathDmg and (SDWaterOpacity < $FF))) then
   670                 spawnHealthTagForHH(Gear, t);
   670                 spawnHealthTagForHH(Gear, t);
   671             end;
   671             end;
   672 
   672 
   673         team:= Gear^.Hedgehog^.Team;
   673         team:= Gear^.Hedgehog^.Team;
   674         if CurrentHedgehog^.Gear = Gear then
   674         if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear = Gear) then
   675             begin
   675             begin
   676             AttackBar:= 0;
   676             AttackBar:= 0;
   677             FreeActionsList; // to avoid ThinkThread on drawned gear
   677             FreeActionsList; // to avoid ThinkThread on drawned gear
   678             if ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0)
   678             if ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0)
   679             and (CurrentHedgehog^.MultiShootAttacks > 0) then
   679             and (CurrentHedgehog^.MultiShootAttacks > 0) then
   698 
   698 
   699         // should be not CurrentHedgehog, but hedgehog of the last gear which caused damage to this hog
   699         // should be not CurrentHedgehog, but hedgehog of the last gear which caused damage to this hog
   700         // same stand for CheckHHDamage
   700         // same stand for CheckHHDamage
   701         if (Gear^.LastDamage <> nil) then
   701         if (Gear^.LastDamage <> nil) then
   702             uStats.HedgehogDamaged(Gear, Gear^.LastDamage, 0, true)
   702             uStats.HedgehogDamaged(Gear, Gear^.LastDamage, 0, true)
   703         else
   703         else if CurrentHedgehog <> nil then
   704             uStats.HedgehogDamaged(Gear, CurrentHedgehog, 0, true);
   704             uStats.HedgehogDamaged(Gear, CurrentHedgehog, 0, true);
   705 
   705 
   706         inc(KilledHHs);
   706         inc(KilledHHs);
   707         RecountTeamHealth(team);
   707         RecountTeamHealth(team);
   708         if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Effects[heResurrectable] <> 0)  and
   708         if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Effects[heResurrectable] <> 0)  and