hedgewars/uGears.pas
changeset 4826 d6a0a38407c8
parent 4824 efbc8f80acac
child 4830 c5ddc3e6c8a4
equal deleted inserted replaced
4825:e8539e429ae3 4826:d6a0a38407c8
   556             begin
   556             begin
   557             t:= max(Gear^.Damage, Gear^.Health);
   557             t:= max(Gear^.Damage, Gear^.Health);
   558             Gear^.Damage:= t;
   558             Gear^.Damage:= t;
   559             if ((not SuddenDeathDmg and (cWaterOpacity < $FF)) or (SuddenDeathDmg and (cWaterOpacity < $FF))) and (hwRound(Gear^.Y) < cWaterLine + 256) then
   559             if ((not SuddenDeathDmg and (cWaterOpacity < $FF)) or (SuddenDeathDmg and (cWaterOpacity < $FF))) and (hwRound(Gear^.Y) < cWaterLine + 256) then
   560                 spawnHealthTagForHH(Gear, t);
   560                 spawnHealthTagForHH(Gear, t);
       
   561 
       
   562             // should be CurrentHedgehog, but hedgehog of the last gear which caused damage to this hog
   561             uStats.HedgehogDamaged(Gear, CurrentHedgehog^.Gear)
   563             uStats.HedgehogDamaged(Gear, CurrentHedgehog^.Gear)
   562             end;
   564             end;
   563 
   565 
   564         team:= Gear^.Hedgehog^.Team;
   566         team:= Gear^.Hedgehog^.Team;
   565         if CurrentHedgehog^.Gear = Gear then
   567         if CurrentHedgehog^.Gear = Gear then
  1026            begin // this cannot just use Damage or it interrupts shotgun and gets you called stupid
  1028            begin // this cannot just use Damage or it interrupts shotgun and gets you called stupid
  1027            inc(CurrentHedgehog^.Gear^.Karma, tmpDmg);
  1029            inc(CurrentHedgehog^.Gear^.Karma, tmpDmg);
  1028            spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
  1030            spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
  1029            end;
  1031            end;
  1030         end;
  1032         end;
  1031     end;
  1033     end else // not gtHedgehog
       
  1034         Gear^.Hedgehog:= Attacker^.Hedgehog;
  1032     inc(Gear^.Damage, Damage);
  1035     inc(Gear^.Damage, Damage);
  1033     ScriptCall('onGearDamage', Gear^.UID, Damage);
  1036     ScriptCall('onGearDamage', Gear^.UID, Damage);
  1034 end;
  1037 end;
  1035 
  1038 
  1036 procedure SetAllToActive;
  1039 procedure SetAllToActive;