hedgewars/uAIAmmoTests.pas
changeset 439 c336ed82e76d
parent 438 04bcc3fb127a
child 498 9c8b385dc9a1
--- a/hedgewars/uAIAmmoTests.pas	Mon Feb 12 21:57:29 2007 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Tue Feb 13 18:16:03 2007 +0000
@@ -50,7 +50,7 @@
 {amGirder}        nil
                   );
 
-const BadTurn = Low(LongInt);
+const BadTurn = Low(LongInt) div 4;
 
 
 implementation
@@ -106,7 +106,7 @@
      Score:= CheckTrace;
      if Result <= Score then
         begin
-        Angle:= DxDy2AttackAngle(Vx, Vy) + AIrndSign(random((Level - 1) * 11));
+        Angle:= DxDy2AttackAngle(Vx, Vy) + AIrndSign(random((Level - 1) * 9));
         Power:= hwRound(r * cMaxPower) - random((Level - 1) * 17 + 1);
         ExplR:= 100;
         ExplX:= EX;
@@ -167,7 +167,7 @@
         Result:= Score
         end;
      end
-until (TestTime = 5000);
+until (TestTime = 4000);
 TestGrenade:= Result
 end;
 
@@ -176,13 +176,10 @@
     rx, ry, Result: LongInt;
 begin
 ExplR:= 0;
-if Metric(hwRound(Me^.X), hwRound(Me^.Y), Targ.X, Targ.Y) < 80 then
-   begin
-   Result:= BadTurn;
-   exit
-   end;
 Time:= 0;
 Power:= 1;
+if Metric(hwRound(Me^.X), hwRound(Me^.Y), Targ.X, Targ.Y) < 80 then
+   exit(BadTurn);
 Vx:= (Targ.X - Me^.X) * _1div1024;
 Vy:= (Targ.Y - Me^.Y) * _1div1024;
 x:= Me^.X;
@@ -210,13 +207,10 @@
     Result: LongInt;
 begin
 ExplR:= 0;
-if hwAbs(Me^.X - Targ.X) + hwAbs(Me^.Y - Targ.Y) < 80 then
-   begin
-   Result:= BadTurn;
-   exit
-   end;
 Time:= 0;
 Power:= 1;
+if hwAbs(Me^.X - Targ.X) + hwAbs(Me^.Y - Targ.Y) < 80 then
+   exit(BadTurn);
 t:= _0_5 / Distance(Targ.X - Me^.X, Targ.Y - Me^.Y);
 Vx:= (Targ.X - Me^.X) * t;
 Vy:= (Targ.Y - Me^.Y) * t;