hedgewars/uAI.pas
changeset 5162 60bc1af75c82
parent 5148 73b3b4b8359c
child 5163 1620a02d5282
equal deleted inserted replaced
5161:72f6eda2f73a 5162:60bc1af75c82
    85             if (BestActions.Score < 0) or (Actions.Score + Score > BestActions.Score + Byte(BotLevel) * 2048) then
    85             if (BestActions.Score < 0) or (Actions.Score + Score > BestActions.Score + Byte(BotLevel) * 2048) then
    86               begin
    86               begin
    87               BestActions:= Actions;
    87               BestActions:= Actions;
    88               inc(BestActions.Score, Score);
    88               inc(BestActions.Score, Score);
    89 
    89 
       
    90               if (ap.Angle > 0) then AddAction(BestActions, aia_LookRight, 0, 200, 0, 0)
       
    91               else if (ap.Angle < 0) then AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0);
       
    92 
    90               AddAction(BestActions, aia_Weapon, Longword(a), 300 + random(400), 0, 0);
    93               AddAction(BestActions, aia_Weapon, Longword(a), 300 + random(400), 0, 0);
    91               if (ap.Time <> 0) then AddAction(BestActions, aia_Timer, ap.Time div 1000, 400, 0, 0);
    94               if (ap.Time <> 0) then AddAction(BestActions, aia_Timer, ap.Time div 1000, 400, 0, 0);
    92               if (ap.Angle > 0) then AddAction(BestActions, aia_LookRight, 0, 200, 0, 0)
       
    93               else if (ap.Angle < 0) then AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0);
       
    94               if (Ammoz[a].Ammo.Propz and ammoprop_NoCrosshair) = 0 then
    95               if (Ammoz[a].Ammo.Propz and ammoprop_NoCrosshair) = 0 then
    95                  begin
    96                  begin
    96                  ap.Angle:= LongInt(Me^.Angle) - Abs(ap.Angle);
    97                  ap.Angle:= LongInt(Me^.Angle) - Abs(ap.Angle);
    97                  if ap.Angle > 0 then
    98                  if ap.Angle > 0 then
    98                     begin
    99                     begin