close Warning: Can't synchronize with repository "(default)" (No changeset 184 in the repository). Look in the Trac log for more information.

Changeset 142


Ignore:
Timestamp:
Jul 11, 2017, 10:27:47 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Improved attack to neutral units if computer have more units available when necessary.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UGame.pas

    r131 r142  
    21942194var
    21952195  I: Integer;
     2196  AvailPower: Integer;
    21962197begin
    21972198  // If available power remains then use all for existed unit moves
    21982199  for I := 0 to Game.Moves.Count - 1 do
    21992200  with TUnitMove(Game.Moves[I]) do begin
    2200     if CellFrom.GetAvialPower > 0 then
    2201       CountOnce := CountOnce + CellFrom.GetAvialPower;
     2201    if CellFrom.GetAvialPower > 0 then begin
     2202      AvailPower := CellFrom.GetAvialPower;
     2203      CountOnce := CountOnce + Min(AvailPower div CellFrom.MovesFrom.Count, AvailPower);
     2204    end;
    22022205  end;
    22032206end;
Note: See TracChangeset for help on using the changeset viewer.