hedgewars/uAI.pas
changeset 439 c336ed82e76d
parent 434 2c6ccce17f39
child 441 f2920f08ea5f
equal deleted inserted replaced
438:04bcc3fb127a 439:c336ed82e76d
    77               if Time <> 0 then AddAction(BestActions, aia_Timer, Time div 1000, 400, 0, 0);
    77               if Time <> 0 then AddAction(BestActions, aia_Timer, Time div 1000, 400, 0, 0);
    78               if (Angle > 0) then AddAction(BestActions, aia_LookRight, 0, 200, 0, 0)
    78               if (Angle > 0) then AddAction(BestActions, aia_LookRight, 0, 200, 0, 0)
    79               else if (Angle < 0) then AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0);
    79               else if (Angle < 0) then AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0);
    80               if (Ammoz[a].Ammo.Propz and ammoprop_NoCrosshair) = 0 then
    80               if (Ammoz[a].Ammo.Propz and ammoprop_NoCrosshair) = 0 then
    81                  begin
    81                  begin
    82                  Angle:= integer(Me^.Angle) - Abs(Angle);
    82                  Angle:= LongInt(Me^.Angle) - Abs(Angle);
    83                  if Angle > 0 then
    83                  if Angle > 0 then
    84                     begin
    84                     begin
    85                     AddAction(BestActions, aia_Up, aim_push, 500, 0, 0);
    85                     AddAction(BestActions, aia_Up, aim_push, 500, 0, 0);
    86                     AddAction(BestActions, aia_Up, aim_release, Angle, 0, 0)
    86                     AddAction(BestActions, aia_Up, aim_release, Angle, 0, 0)
    87                     end else if Angle < 0 then
    87                     end else if Angle < 0 then
   267 end;
   267 end;
   268 
   268 
   269 procedure StartThink(Me: PGear);
   269 procedure StartThink(Me: PGear);
   270 var a: TAmmoType;
   270 var a: TAmmoType;
   271 begin
   271 begin
   272 if ((Me^.State and gstAttacking) <> 0) or isInMultiShoot then exit;
   272 if ((Me^.State and (gstAttacking or gstHHJumping or gstFalling or gstMoving)) <> 0)
       
   273    or isInMultiShoot then exit;
   273 Me^.State:= Me^.State or gstHHThinking;
   274 Me^.State:= Me^.State or gstHHThinking;
   274 Me^.Message:= 0;
   275 Me^.Message:= 0;
   275 StopThinking:= false;
   276 StopThinking:= false;
   276 ThinkingHH:= Me;
   277 ThinkingHH:= Me;
   277 FillTargets;
   278 FillTargets;