hedgewars/uAIMisc.pas
changeset 6011 519f8a58c021
parent 5881 099464aab4b6
child 6081 537bbd5c1a62
equal deleted inserted replaced
6010:10913a80cb50 6011:519f8a58c021
    78                     X, Y, Radius: LongInt
    78                     X, Y, Radius: LongInt
    79                     end = (X: 0; Y: 0; Radius: 0);
    79                     end = (X: 0; Y: 0; Radius: 0);
    80 
    80 
    81 procedure FillTargets;
    81 procedure FillTargets;
    82 var i, t: Longword;
    82 var i, t: Longword;
    83     f, e: Longword;
    83     f, e: LongInt;
    84 begin
    84 begin
    85 Targets.Count:= 0;
    85 Targets.Count:= 0;
    86 f:= 0;
    86 f:= 0;
    87 e:= 0;
    87 e:= 0;
    88 for t:= 0 to Pred(TeamsCount) do
    88 for t:= 0 to Pred(TeamsCount) do
   231 // rate explosion
   231 // rate explosion
   232 for i:= 0 to Targets.Count do
   232 for i:= 0 to Targets.Count do
   233     with Targets.ar[i] do
   233     with Targets.ar[i] do
   234          begin
   234          begin
   235          dmg:= hwRound(_0_01 * cDamageModifier
   235          dmg:= hwRound(_0_01 * cDamageModifier
   236             * min((r + cHHRadius div 2 - DistanceI(Point.x - x, Point.y - y).Round) div 2, r) * cDamagePercent);
   236             * min((r + cHHRadius div 2 - LongInt(DistanceI(Point.x - x, Point.y - y).Round)) div 2, r) * cDamagePercent);
   237 
   237 
   238          if dmg > 0 then
   238          if dmg > 0 then
   239             begin
   239             begin
   240             if dmg >= abs(Score) then
   240             if dmg >= abs(Score) then
   241                if Score > 0 then inc(rate, KillScore)
   241                if Score > 0 then inc(rate, KillScore)