hedgewars/uAI.pas
changeset 8036 89740f927254
parent 8017 70d386de989f
child 8096 453917e94e55
child 8677 afb2b467f801
equal deleted inserted replaced
8033:4e40503e2b2c 8036:89740f927254
   289                 addMark(hwRound(Me^.X), hwRound(Me^.Y), markHJumped);
   289                 addMark(hwRound(Me^.X), hwRound(Me^.Y), markHJumped);
   290                 if Push(ticks, Actions, AltMe, Me^.Message xor 3) then
   290                 if Push(ticks, Actions, AltMe, Me^.Message xor 3) then
   291                     begin
   291                     begin
   292                     with Stack.States[Pred(Stack.Count)] do
   292                     with Stack.States[Pred(Stack.Count)] do
   293                         begin
   293                         begin
   294                         if Me^.dX.isNegative then
   294                         if (Me^.Message and gmLeft) <> 0 then
   295                             AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0)
   295                             AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0)
   296                         else
   296                         else
   297                             AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0);
   297                             AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0);
   298                             
   298                             
   299                         AddAction(MadeActions, aia_HJump, 0, 305 + random(50), 0, 0);
   299                         AddAction(MadeActions, aia_HJump, 0, 305 + random(50), 0, 0);
   300                         AddAction(MadeActions, aia_HJump, 0, 350, 0, 0);
   300                         AddAction(MadeActions, aia_HJump, 0, 350, 0, 0);
   301                         
       
   302                         if Me^.dX.isNegative then
       
   303                             AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0)
       
   304                         else
       
   305                             AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0);
       
   306                         end;
   301                         end;
   307                     // but first check walking forward
   302                     // but first check walking forward
   308                     Push(ticks, Stack.States[Pred(Stack.Count)].MadeActions, AltMe, Me^.Message)
   303                     Push(ticks, Stack.States[Pred(Stack.Count)].MadeActions, AltMe, Me^.Message)
   309                     end;
   304                     end;
   310                 end;
   305                 end;
   316                 addMark(hwRound(Me^.X), hwRound(Me^.Y), markLJumped);
   311                 addMark(hwRound(Me^.X), hwRound(Me^.Y), markLJumped);
   317                 // at final check where we go after jump walking backward
   312                 // at final check where we go after jump walking backward
   318                 if Push(ticks, Actions, AltMe, Me^.Message xor 3) then
   313                 if Push(ticks, Actions, AltMe, Me^.Message xor 3) then
   319                     with Stack.States[Pred(Stack.Count)] do
   314                     with Stack.States[Pred(Stack.Count)] do
   320                         begin
   315                         begin
   321                         if Me^.dX.isNegative then
   316                         if (Me^.Message and gmLeft) <> 0 then
   322                             AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0)
   317                             AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0)
   323                         else
   318                         else
   324                             AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0);
   319                             AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0);
   325 
   320 
   326                         AddAction(MadeActions, aia_LJump, 0, 305 + random(50), 0, 0);
   321                         AddAction(MadeActions, aia_LJump, 0, 305 + random(50), 0, 0);