Make AI aware of new high jump technique (there's still an issue with two successive jumps)
authorunc0rr
Mon, 25 Feb 2008 20:12:00 +0000
changeset 791 928d2830fd0c
parent 790 a6f442173822
child 792 8d927ee24fc0
Make AI aware of new high jump technique (there's still an issue with two successive jumps)
hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Mon Feb 25 18:10:12 2008 +0000
+++ b/hedgewars/uAI.pas	Mon Feb 25 20:12:00 2008 +0000
@@ -220,13 +220,17 @@
           if Push(ticks, Actions, AltMe, Me^.Message) then
              with Stack.States[Pred(Stack.Count)] do
                   begin
-                  AddAction(MadeActions, aia_HJump, 0, 305, 0, 0);
+                  if Me^.dX.isNegative then AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0)
+                                       else AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0);
+                  AddAction(MadeActions, aia_HJump, 0, 305 + random(50), 0, 0);
                   AddAction(MadeActions, aia_HJump, 0, 350, 0, 0);
+                  if Me^.dX.isNegative then AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0)
+                                       else AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0);
                   end;
        if (BotLevel < 3) and (GoInfo.JumpType = jmpLJump) then // ljump support
           if Push(ticks, Actions, AltMe, Me^.Message) then
              with Stack.States[Pred(Stack.Count)] do
-                  AddAction(MadeActions, aia_LJump, 0, 305, 0, 0);
+                  AddAction(MadeActions, aia_LJump, 0, 305 + random(50), 0, 0);
 
        if not CanGo then break;
        inc(steps);