Teleport AI:
authormbait
Wed, 28 Apr 2010 05:58:14 +0000
changeset 3372 5d3daec0d0b5
parent 3371 da73f471798f
child 3373 c1ff724a5c34
Teleport AI: * teleport bombing without fall path check
hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAIAmmoTests.pas	Tue Apr 27 21:49:52 2010 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Wed Apr 28 05:58:14 2010 +0000
@@ -642,8 +642,15 @@
   i, failNum: longword;
 begin
   FillBonuses(true, [gtCase]);
-  if bonuses.Count = 0 then
-    TestTeleport := BadTurn
+  if bonuses.Count = 0 then begin
+    if Me^.Health <= 100  then begin
+      ap.AttackPutX := Targ.X;
+      ap.AttackPutY := topY + cHHRadius*2;
+      TestTeleport := Targ.Y - topY;
+    end
+    else
+      TestTeleport := BadTurn;
+  end
   else begin
 	failNum := 0;
     repeat