hedgewars/uAIAmmoTests.pas
changeset 80 3c3dc6a148ca
parent 79 29b477319854
child 82 2f4f3236cccc
equal deleted inserted replaced
79:29b477319854 80:3c3dc6a148ca
   193 repeat
   193 repeat
   194   x:= x + vX;
   194   x:= x + vX;
   195   y:= y + vY;
   195   y:= y + vY;
   196   if TestColl(round(x), round(y), 2) then
   196   if TestColl(round(x), round(y), 2) then
   197      begin
   197      begin
   198      Result:= RateShove(Me, round(x), round(y), 25, 25) * 1024;
   198      Result:= RateShove(Me, round(x), round(y), 25, 25);
   199      if Result = 0 then Result:= - Metric(Targ.X, Targ.Y, round(x), round(y)) div 64;
   199      if Result = 0 then Result:= - Metric(Targ.X, Targ.Y, round(x), round(y)) div 64;
   200      exit
   200      exit
   201      end
   201      end
   202 until (abs(Targ.X - x) + abs(Targ.Y - y) < 4) or (x < 0) or (y < 0) or (x > 2048) or (y > 1024);
   202 until (abs(Targ.X - x) + abs(Targ.Y - y) < 4) or (x < 0) or (y < 0) or (x > 2048) or (y > 1024);
   203 Result:= BadTurn
   203 Result:= BadTurn