Changeset 549 for trunk/AI/StdAI/Barbarina.pas
- Timestamp:
- Apr 21, 2024, 8:55:53 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AI/StdAI/Barbarina.pas
r531 r549 218 218 Result := True; 219 219 for cix := 0 to RO.nCity - 1 do 220 with MyCity[cix] do 220 with MyCity[cix] do begin 221 221 if Loc >= 0 then 222 222 begin // search for modern resource … … 225 225 begin 226 226 Loc1 := Radius[V21]; 227 if (Loc1 >= 0) and (RO.Map[Loc1] and fModern <> 0) then 227 if (Loc1 >= 0) and (RO.Map[Loc1] and fModern <> 0) then begin 228 228 Result := False; 229 end; 230 end; 229 Break; 230 end; 231 end; 232 end; 233 if not Result then Break; 234 end; 231 235 end 232 236 else if IsResearched(adGunPowder) then … … 892 896 for F := 0 to maxCOD - 1 do 893 897 if (F < nContinent) and (ContinentPresence[F] and not 894 (1 shl Me or PresenceUnknown) <> 0) then 895 Go := True; // any enemy island known? 898 (1 shl Me or PresenceUnknown) <> 0) then begin 899 Go := True; // any enemy island known? 900 Break; 901 end; 896 902 if not Go then 897 903 Exit; … … 922 928 (TroopLoad = 0) and (Health = 100) then 923 929 begin 924 go := True;930 Go := True; 925 931 SeaTransport_AddTransport(uix); 926 932 end; … … 1170 1176 if MyUnit[uix].Loc >= 0 then 1171 1177 RateAttack(uix); 1172 end 1173 until BackToStart 1178 end; 1179 until BackToStart; 1174 1180 until not BackToStart; 1175 1181 … … 1214 1220 function LowPriority(cix: Integer): Boolean; 1215 1221 var 1216 part, cixHighPriority, TestDistance: Integer;1222 Part, cixHighPriority, TestDistance: Integer; 1217 1223 begin 1218 1224 Result := False; 1219 for part := 0 to nShipPart - 1 do1225 for Part := 0 to nShipPart - 1 do 1220 1226 begin 1221 cixHighPriority := ColonyShipPlan[ part].cixProducing;1227 cixHighPriority := ColonyShipPlan[Part].cixProducing; 1222 1228 if (cixHighPriority >= 0) and (cixHighPriority <> cix) then 1223 1229 begin … … 1375 1381 for cix := 0 to RO.nCity - 1 do 1376 1382 with MyCity[cix] do 1377 if (Loc >= 0) and (Project and (cpImp + cpIndex) = cpImp + imAlgae) then 1383 if (Loc >= 0) and (Project and (cpImp + cpIndex) = cpImp + imAlgae) then begin 1378 1384 AlgaeAvailable := False; 1385 Break; 1386 end; 1379 1387 1380 1388 for cix := 0 to RO.nCity - 1 do … … 1494 1502 with MyUnit[uix] do 1495 1503 if (Loc >= 0) and (Home = cix) and 1496 (MyModel[mix].Kind = mkSettler) then 1497 HasSettler := True; 1504 (MyModel[mix].Kind = mkSettler) then begin 1505 HasSettler := True; 1506 Break; 1507 end; 1498 1508 if ((RO.Government <> gDespotism) or (RO.nUn >= RO.nCity * 4)) and 1499 1509 not IsResearched(adMassProduction) and (Built[imPalace] > 0) and … … 1552 1562 ImportantCity := WillProduceColonyShip or (Built[imPalace] > 0); 1553 1563 for iix := 0 to nWonder - 1 do 1554 if Built[iix] > 0 then 1564 if Built[iix] > 0 then begin 1555 1565 ImportantCity := True; 1566 Break; 1567 end; 1556 1568 City_GetReportNew(cix, Report); 1557 1569 if (Report.Corruption >= 6) and (RO.nUn >= RO.nCity * 4) and … … 1697 1709 for I := 0 to nFeature - 1 do 1698 1710 if (Cap[I] > 0) and (Feature[I].Preq <> preNone) and 1699 ((Feature[I].Preq < 0) or not IsResearched(Feature[I].Preq)) then 1700 Ready := False; 1711 ((Feature[I].Preq < 0) or not IsResearched(Feature[I].Preq)) then begin 1712 Ready := False; 1713 Break; 1714 end; 1701 1715 if Ready then 1702 1716 begin 1703 1717 for I := 0 to nUpgrade - 1 do 1704 1718 if (Upgrades and (1 shl I) <> 0) and not 1705 IsResearched(Upgrade[Domain, I].Preq) then 1706 Ready := False; 1719 IsResearched(Upgrade[Domain, I].Preq) then begin 1720 Ready := False; 1721 Break; 1722 end; 1707 1723 end; 1708 1724 if Ready then … … 1911 1927 for Part := 0 to nShipPart - 1 do 1912 1928 if (RO.Ship[Me].Parts[Part] < ShipNeed[Part]) // not enough of this kind already 1913 and (ColonyShipPlan[Part].cixProducing < 0) then // no city to produce 1914 Check := True; 1929 and (ColonyShipPlan[Part].cixProducing < 0) then begin // no city to produce 1930 Check := True; 1931 Break; 1932 end; 1915 1933 if Check then 1916 1934 begin
Note:
See TracChangeset
for help on using the changeset viewer.