AI: Teach how to use resurrector fast
authorWuzzy <Wuzzy2@mail.ru>
Mon, 06 Jul 2020 11:10:27 +0200
changeset 15708 034955e721a1
parent 15707 78e383fff605
child 15709 326b024a24e3
AI: Teach how to use resurrector fast
hedgewars/uAI.pas
hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAI.pas	Mon Jul 06 01:46:22 2020 +0200
+++ b/hedgewars/uAI.pas	Mon Jul 06 11:10:27 2020 +0200
@@ -231,11 +231,15 @@
                                 n:= 1 else n:= ap.AttacksNum;
 
                             AddAction(BestActions, aia_attack, aim_push, 650 + random(300), 0, 0);
+                            if (a = amResurrector) and (BotLevel < 4) then
+                                AddAction(BestActions, aia_Up, aim_push, 1, 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;
+                            if (a = amResurrector) and (BotLevel < 4) then
+                                AddAction(BestActions, aia_Up, aim_release, ap.Power, 0, 0);
                             AddAction(BestActions, aia_attack, aim_release, ap.Power, 0, 0);
                             end;
 
--- a/hedgewars/uAIAmmoTests.pas	Mon Jul 06 01:46:22 2020 +0200
+++ b/hedgewars/uAIAmmoTests.pas	Mon Jul 06 11:10:27 2020 +0200
@@ -1509,11 +1509,16 @@
 
 ap.ExplR:= 0;
 ap.Time:= 0;
-if (GameFlags and gfInfAttack) = 0 then
-    ap.Power:= max(min(500 * heal - 500, 10000), 10)
+if (Level >= 4) then
+    // slow resurrect
+    ap.Power:= max(512 * heal - 512, 10)
 else
-    // Shorter attack duration in inf attack because the clock is ticking!
-    ap.Power:= max(min(500 * heal - 500, 3000), 10);
+    // fast resurrect
+    ap.Power:= max(16 * heal - 16, 10);
+
+// Time limit
+ap.Power:= min(ap.Power, 5000)
+
 ap.Angle:= 0;
 
 rate:= RateResurrector(Me);