hedgewars/uAI.pas
branchwebgl
changeset 9521 8054d9d775fd
parent 9127 e350500c4edb
parent 9495 2fc346fadae3
child 9950 2759212a27de
--- a/hedgewars/uAI.pas	Fri Oct 11 11:55:31 2013 +0200
+++ b/hedgewars/uAI.pas	Fri Oct 11 17:43:13 2013 +0200
@@ -111,7 +111,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;
@@ -187,7 +187,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;
 
@@ -504,7 +512,7 @@
 FillBonuses(((Me^.State and gstAttacked) <> 0) and (not isInMultiShoot));
 
 SDL_LockMutex(ThreadLock);
-ThinkThread:= SDL_CreateThread(@Think{$IFDEF SDL13}, 'think'{$ENDIF}, Me);
+ThinkThread:= SDL_CreateThread(@Think{$IFDEF SDL2}, 'think'{$ENDIF}, Me);
 SDL_UnlockMutex(ThreadLock);
 end;