Changeset 274 for trunk/UClientAI.pas


Ignore:
Timestamp:
Feb 3, 2019, 8:32:20 PM (6 years ago)
Author:
chronos
Message:
  • Added: Keep information about available unit moves during turn.
  • Added: Allow to move units instantly during turn.
  • Added: Game system parameter to play without possibility to merge/split units.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UClientAI.pas

    r273 r274  
    6969
    7070  // Sort ascending to attack cells with lower power first
    71   // Low power cells are better for expanding our teritorry
     71  // Low power cells are better for expanding our territory
    7272  TargetCells.Sort(CellCompare);
    7373
     
    7979      for NeighborCell in Neighbors do
    8080      if NeighborCell.MapCell.Player = ControlPlayer then
    81         TotalPower := TotalPower + NeighborCell.GetAvialPower;
     81        TotalPower := TotalPower + NeighborCell.GetAvialPowerForMove;
    8282
    8383      // Attack if target is weaker
     
    195195  for C := 0 to AllCells.Count - 1 do
    196196  with AllCells[C] do begin
    197     if (MapCell.Player <> ControlPlayer) and (MapCell.Player <> nil) and (MapCell.Terrain <> ttVoid) then begin
     197    if (MapCell.Player <> ControlPlayer) and (MapCell.Terrain <> ttVoid) then begin
    198198      CanAttack := 0;
    199199      for I := 0 to Neighbors.Count - 1 do
     
    307307  // Move all units back to inner area from weak border cells
    308308  for C := 0 to BorderCells.Count - 1 do
    309   with BorderCells[C] do begin
     309  with TPlayerCell(BorderCells[C]) do begin
    310310    // Calculate enemy power
    311311    // TODO: Do not sum different enemy power to one value
Note: See TracChangeset for help on using the changeset viewer.