hedgewars/uAIMisc.pas
changeset 6777 fb71556205f4
parent 6776 7a05f48bfa43
child 6778 a9c6457dca29
equal deleted inserted replaced
6776:7a05f48bfa43 6777:fb71556205f4
   193 rate:= 0;
   193 rate:= 0;
   194 for i:= 0 to Pred(bonuses.Count) do
   194 for i:= 0 to Pred(bonuses.Count) do
   195     with bonuses.ar[i] do
   195     with bonuses.ar[i] do
   196         begin
   196         begin
   197         r:= hwRound(Distance(Gear^.X - int2hwFloat(X), Gear^.Y - int2hwFloat(Y)));
   197         r:= hwRound(Distance(Gear^.X - int2hwFloat(X), Gear^.Y - int2hwFloat(Y)));
   198         if r < Radius then
   198         if r < 15 then
   199             inc(rate, Score * (Radius - r))
   199                 inc(rate, Score * Radius)
       
   200         else if r < Radius then
       
   201                 inc(rate, Score * (Radius - r))
   200         end;
   202         end;
   201     RatePlace:= rate;
   203     RatePlace:= rate;
   202 end;
   204 end;
   203 
   205 
   204 // Wrapper to test various approaches.  If it works reasonably, will just replace.
   206 // Wrapper to test various approaches.  If it works reasonably, will just replace.