AI hogs use timebox instead of skip if clueless what to do
authorWuzzy <almikes@aol.com>
Wed, 18 Oct 2017 05:28:22 +0200
changeset 12710 1ab53b945140
parent 12709 8673892ebf24
child 12711 20dbb3a03e61
AI hogs use timebox instead of skip if clueless what to do
ChangeLog.txt
hedgewars/uAI.pas
--- a/ChangeLog.txt	Wed Oct 18 03:39:01 2017 +0200
+++ b/ChangeLog.txt	Wed Oct 18 05:28:22 2017 +0200
@@ -18,7 +18,7 @@
  + New weapon: rubber duck
  + Freezer can now freeze sticky mines (they get disabled and fall into the water)
  + Improved hedgehog spawns on maps that lack land mass or free space
- + AI hedgehogs can now use Bee and Vampirism
+ + AI hedgehogs can now use Bee, Vampirism and Time Box
  + Divided Teams mode will now work with more than 2 teams (Hint: you probably want to set world edges to "wrap" in such games)
  + Fort Mode will now work with more than 2 teams
  + Render graves behind everything else, so that they can't hide mines etc.
--- a/hedgewars/uAI.pas	Wed Oct 18 03:39:01 2017 +0200
+++ b/hedgewars/uAI.pas	Wed Oct 18 05:28:22 2017 +0200
@@ -471,8 +471,17 @@
 
             FillBonuses(false);
 
+            // Hog has no idea what to do. Use tardis or skip
             if not bonuses.activity then
-                AddAction(BestActions, aia_Skip, 0, 250, 0, 0);
+                if ((HHHasAmmo(Me^.Hedgehog^, amTardis) > 0)) and (random(3) < 1) then
+                    // Tardis brings hog to a random place. Perfect for clueless AI
+                    begin
+                    AddAction(BestActions, aia_Weapon, Longword(amTardis), 80, 0, 0);
+                    AddAction(BestActions, aia_attack, aim_push, 10, 0, 0);
+                    AddAction(BestActions, aia_attack, aim_release, 10, 0, 0);
+                    end
+                else
+                    AddAction(BestActions, aia_Skip, 0, 250, 0, 0);
             end;
 
         end else SDL_Delay(100)