Changeset 222 for trunk/UClientAI.pas
- Timestamp:
- Jul 13, 2018, 11:13:12 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UClientAI.pas
r213 r222 60 60 CanAttack := 0; 61 61 for NeighborCell in Neighbors do 62 if NeighborCell.Player = Game.CurrentPlayer then begin62 if NeighborCell.Player = ControlPlayer then begin 63 63 Inc(CanAttack); 64 64 end; … … 77 77 TotalPower := 0; 78 78 for NeighborCell in Neighbors do 79 if NeighborCell.Player = Game.CurrentPlayer then79 if NeighborCell.Player = ControlPlayer then 80 80 TotalPower := TotalPower + NeighborCell.GetAvialPower; 81 81 … … 84 84 TotalAttackPower := 0; 85 85 for NeighborCell in Neighbors do 86 if NeighborCell.Player = Game.CurrentPlayer then begin86 if NeighborCell.Player = ControlPlayer then begin 87 87 // Use only necessary power 88 88 AttackPower := Power - TotalAttackPower + AttackDiff; … … 109 109 NeighborCell: TCell; 110 110 begin 111 111 if ControlPlayer.Defensive then Exit; 112 112 113 113 AllCells := Game.Map.Cells; … … 188 188 for C := 0 to AllCells.Count - 1 do 189 189 with AllCells[C] do begin 190 if (Player <> Game.CurrentPlayer) and (Player <> nil) and (Terrain <> ttVoid) then begin190 if (Player <> ControlPlayer) and (Player <> nil) and (Terrain <> ttVoid) then begin 191 191 CanAttack := 0; 192 192 for I := 0 to Neighbors.Count - 1 do 193 if ((Neighbors[I].Player = Game.CurrentPlayer) or193 if ((Neighbors[I].Player = ControlPlayer) or 194 194 (Neighbors[I].Player = nil)) and (Neighbors[I].Terrain <> ttVoid) then begin 195 195 Inc(CanAttack); … … 218 218 for I := 0 to Neighbors.Count - 1 do begin 219 219 if (Neighbors[I].Terrain <> ttVoid) and (not Neighbors[I].Mark) then begin 220 if (TargetCells[C].Player = Game.CurrentPlayer) and221 (Neighbors[I].Player = Game.CurrentPlayer) then begin220 if (TargetCells[C].Player = ControlPlayer) and 221 (Neighbors[I].Player = ControlPlayer) then begin 222 222 // Do not take units from front line 223 223 Cells2 := Neighbors[I].Neighbors; 224 224 CanAttack := 0; 225 225 for J := 0 to Cells2.Count - 1 do 226 if ((Cells2[J].Player <> Game.CurrentPlayer) or (Cells2[J].Player = nil))226 if ((Cells2[J].Player <> ControlPlayer) or (Cells2[J].Player = nil)) 227 227 and (Cells2[J].Terrain <> ttVoid) then begin 228 228 Inc(CanAttack); … … 292 292 for C := 0 to AllCells.Count - 1 do 293 293 with AllCells[C] do begin 294 if (Terrain <> ttVoid) and (Player = Game.CurrentPlayer) then begin294 if (Terrain <> ttVoid) and (Player = ControlPlayer) then begin 295 295 if AttackersCount(AllCells[C]) > 0 then 296 296 BorderCells.Add(AllCells[C]); … … 305 305 EnemyPower := 0; 306 306 for I := 0 to Neighbors.Count - 1 do 307 if (Neighbors[I].Player <> Game.CurrentPlayer) and (Neighbors[I].Player <> nil) then begin307 if (Neighbors[I].Player <> ControlPlayer) and (Neighbors[I].Player <> nil) then begin 308 308 Inc(EnemyPower, Neighbors[I].Power); 309 309 end; … … 329 329 Result := 0; 330 330 for I := 0 to Cell.Neighbors.Count - 1 do 331 if (Cell.Neighbors[I].Player <> Game.CurrentPlayer) and331 if (Cell.Neighbors[I].Player <> ControlPlayer) and 332 332 (Cell.Neighbors[I].Player <> nil) then begin 333 333 Inc(Result);
Note:
See TracChangeset
for help on using the changeset viewer.