hedgewars/uAIMisc.pas
changeset 1141 44d4d6aaecb5
parent 1066 1f1b3686a2b0
child 1352 405ad07cf875
equal deleted inserted replaced
1140:a32f1eed51a6 1141:44d4d6aaecb5
   191      end;
   191      end;
   192 // rate explosion
   192 // rate explosion
   193 for i:= 0 to Targets.Count do
   193 for i:= 0 to Targets.Count do
   194     with Targets.ar[i] do
   194     with Targets.ar[i] do
   195          begin
   195          begin
   196          dmg:= r - hwRound(DistanceI(Point.x - x, Point.y - y));
   196          dmg:= r + cHHRadius div 2 - hwRound(DistanceI(Point.x - x, Point.y - y));
   197          if dmg > 0 then
   197          if dmg > 0 then
   198             begin
   198             begin
   199             dmg:= dmg shr 1;
   199             dmg:= min(dmg div 2, r);
   200             if dmg >= abs(Score) then
   200             if dmg >= abs(Score) then
   201                if Score > 0 then inc(Result, KillScore)
   201                if Score > 0 then inc(Result, KillScore)
   202                             else dec(Result, KillScore * friendlyfactor div 100)
   202                             else dec(Result, KillScore * friendlyfactor div 100)
   203             else
   203             else
   204                if Score > 0 then inc(Result, dmg)
   204                if Score > 0 then inc(Result, dmg)