Changeset 273 for trunk/UClientAI.pas
- Timestamp:
- Jan 30, 2019, 8:08:44 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UClientAI.pas
r265 r273 111 111 TargetCell: TPlayerCell; 112 112 NeighborCell: TPlayerCell; 113 DefendCount: Integer; 113 114 begin 114 115 if ControlPlayer.Defensive then Exit; … … 144 145 end; 145 146 // Attack if target is weaker 146 if Game.AttackProbability(TotalPower, TargetCell.MapCell.OneUnit.Power) >= 147 if Assigned(TargetCell.MapCell.OneUnit) then 148 DefendCount := TargetCell.MapCell.OneUnit.Power 149 else DefendCount := 0; 150 if Game.AttackProbability(TotalPower, DefendCount) >= 147 151 ComputerAggroProbability[ControlPlayer.Agressivity] then begin 148 152 // Try to limit total attacking power to necessary minimum 149 while Game.AttackProbability(TotalPower - 1, TargetCell.MapCell.OneUnit.Power) >=153 while Game.AttackProbability(TotalPower - 1, DefendCount) >= 150 154 ComputerAggroProbability[ControlPlayer.Agressivity] do 151 155 Dec(TotalPower);
Note:
See TracChangeset
for help on using the changeset viewer.