hedgewars/uAI.pas
changeset 15622 dc62f1c13bb2
parent 15546 fbcee515b946
child 15624 30ad3fd974f1
--- a/hedgewars/uAI.pas	Sat Jun 06 15:43:17 2020 +0200
+++ b/hedgewars/uAI.pas	Sat Jun 06 16:09:16 2020 +0200
@@ -247,7 +247,7 @@
 const FallPixForBranching = cHHRadius;
 var
     maxticks, oldticks, steps, tmp: Longword;
-    BaseRate, BestRate, Rate: LongInt;
+    BaseRate, BestRate, Rate, i: LongInt;
     GoInfo: TGoInfo;
     CanGo: boolean;
     AltMe: TGear;
@@ -321,6 +321,13 @@
                     AddAction(BestActions, aia_Weapon, Longword(amExtraTime), 80, 0, 0);
                     AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
                     AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);
+                    // Better bot levels know they can spam extra time if infinite
+                    if (BotLevel < 3) and (HHHasAmmo(Me^.Hedgehog^, amExtraTime) = AMMO_INFINITE) then
+                        for i:= 1 to 3 do
+                            begin
+                            AddAction(BestActions, aia_attack, aim_push, 100, 0, 0);
+                            AddAction(BestActions, aia_attack, aim_release, 100, 0, 0);
+                            end;
                 end;
 
                 break;