Teach top AI level to track falling with airstrikes
authorWuzzy <Wuzzy2@mail.ru>
Sun, 05 Jul 2020 21:25:15 +0200
changeset 15702 3224d0d970ac
parent 15701 b64f96d43f1f
child 15703 a92220611821
Teach top AI level to track falling with airstrikes
hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAIAmmoTests.pas	Sun Jul 05 21:14:44 2020 +0200
+++ b/hedgewars/uAIAmmoTests.pas	Sun Jul 05 21:25:15 2020 +0200
@@ -1445,7 +1445,10 @@
             if TestColl(trunc(X) + LongWord(i * 30), trunc(Y), 4) then
                 begin
                 b[i]:= false;
-                dmg[i]:= RateExplosion(Me, trunc(X) + LongWord(i * 30), trunc(Y), 58);
+                if Level = 1 then
+                    dmg[i]:= RateExplosion(Me, trunc(X) + LongWord(i * 30), trunc(Y), 58, afTrackFall or afErasesLand)
+                else
+                    dmg[i]:= RateExplosion(Me, trunc(X) + LongWord(i * 30), trunc(Y), 58);
                 // 58 (instead of 60) for better prediction (hh moves after explosion of one of the rockets)
                 if (not firstHit) then
                     begin
@@ -1569,7 +1572,10 @@
             // Simulate explosion
             if collided then
                 begin
-                dmg[i]:= RateExplosion(Me, trunc(drillX), trunc(drillY), 58);
+                if Level = 1 then
+                    dmg[i]:= RateExplosion(Me, trunc(drillX), trunc(drillY), 58, afTrackFall or afErasesLand)
+                else
+                    dmg[i]:= RateExplosion(Me, trunc(drillX), trunc(drillY), 58);
                 // 58 (instead of 60) for better prediction (hh moves after explosion of one of the rockets)
                 if not firstHit then
                     begin
@@ -1690,7 +1696,11 @@
             if TestColl(trunc(X) + LongWord(i * 30), trunc(Y), 4) then
                 begin
                 b[i]:= false;
-                dmg[i]:= RateExplosion(Me, trunc(X) + LongWord(i * 30), trunc(Y), 96);
+                if Level = 1 then
+                    dmg[i]:= RateExplosion(Me, trunc(X) + LongWord(i * 30), trunc(Y), 96, afTrackFall or afErasesLand)
+                else
+                    dmg[i]:= RateExplosion(Me, trunc(X) + LongWord(i * 30), trunc(Y), 96);
+
                 if (not firstHit) then
                     begin
                     targetY:= trunc(Y);