hedgewars/uAI.pas
changeset 9495 2fc346fadae3
parent 9317 a04c30940d2d
child 9521 8054d9d775fd
child 9844 8f5b48525a03
child 11360 7a7611adf715
--- a/hedgewars/uAI.pas	Mon Oct 07 22:22:49 2013 +0400
+++ b/hedgewars/uAI.pas	Mon Oct 07 23:36:40 2013 +0400
@@ -106,7 +106,7 @@
 procedure TestAmmos(var Actions: TActions; Me: PGear; rareChecks: boolean);
 var BotLevel: Byte;
     ap: TAttackParams;
-    Score, i, dAngle: LongInt;
+    Score, i, t, n, dAngle: LongInt;
     a, aa: TAmmoType;
 begin
 BotLevel:= Me^.Hedgehog^.BotLevel;
@@ -182,7 +182,15 @@
                         end else
                         if (Ammoz[a].Ammo.Propz and ammoprop_AttackingPut) = 0 then
                             begin
+                            if (AmmoTests[a].flags and amtest_MultipleAttacks) = 0 then
+                                n:= 1 else n:= ap.AttacksNum;
+
                             AddAction(BestActions, aia_attack, aim_push, 650 + random(300), 0, 0);
+                            for t:= 2 to n do
+                                begin
+                                AddAction(BestActions, aia_attack, aim_push, 150, 0, 0);
+                                AddAction(BestActions, aia_attack, aim_release, ap.Power, 0, 0);
+                                end;
                             AddAction(BestActions, aia_attack, aim_release, ap.Power, 0, 0);
                             end;