Changeset 328 for trunk/AI/StdAI
- Timestamp:
- Mar 25, 2021, 3:02:29 PM (4 years ago)
- Location:
- trunk/AI/StdAI
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AI/StdAI/AI.pas
r319 r328 1122 1122 begin // settlers could be added to this city 1123 1123 Happy := BasicHappy; 1124 for i := 0 to 27do1124 for i := 0 to nWonder - 1 do 1125 1125 if Built[i] > 0 then 1126 1126 Inc(Happy); -
trunk/AI/StdAI/Barbarina.pas
r319 r328 1242 1242 WonderAvailable := WonderAvailable and PrimeWonder; // alway prefer prime wonders 1243 1243 Count := 0; 1244 for iix := 0 to 27do1244 for iix := 0 to nWonder - 1 do 1245 1245 begin 1246 1246 if (1 shl iix) and WonderAvailable <> 0 then … … 1254 1254 end; 1255 1255 Count := Random(Count); 1256 for iix := 0 to 27do1256 for iix := 0 to nWonder - 1 do 1257 1257 begin 1258 1258 if (1 shl iix) and WonderAvailable <> 0 then … … 1326 1326 WonderAvailable := 0; 1327 1327 WonderInWork := 0; 1328 for iix := 0 to 27do1328 for iix := 0 to nWonder - 1 do 1329 1329 if (Imp[iix].Preq <> preNA) and ((Imp[iix].Preq = preNone) or 1330 1330 IsResearched(Imp[iix].Preq)) and (RO.Wonder[iix].CityID = WonderNotBuiltYet) then … … 1334 1334 begin 1335 1335 iix := City_CurrentImprovementProject(cix); 1336 if (iix >= 0) and (iix < 28) then1336 if (iix >= 0) and (iix < nWonder) then 1337 1337 Inc(WonderInWork, 1 shl iix) 1338 1338 else if iix = imPalace then … … 1428 1428 1429 1429 iix := City_CurrentImprovementProject(cix); 1430 if (iix >= 0) and (iix < 28) or (iix = imPalace) or1430 if (iix >= 0) and (iix < nWonder) or (iix = imPalace) or 1431 1431 (iix = imShipComp) or (iix = imShipPow) or (iix = imShipHab) then 1432 1432 City_OptimizeTiles(cix, rwMaxProd) … … 1447 1447 if cix = cixNewCapital then 1448 1448 City_StartImprovement(cix, imPalace) 1449 else if (iix >= 0) and (iix < 28) and ((1 shl iix) and1449 else if (iix >= 0) and (iix < nWonder) and ((1 shl iix) and 1450 1450 WonderAvailable <> 0) then 1451 1451 // complete wonder production first … … 1503 1503 City_StartImprovement(cix, woZeus) 1504 1504 else if (City_CurrentImprovementProject(cix) >= 0) and 1505 (City_CurrentImprovementProject(cix) < 28) then1505 (City_CurrentImprovementProject(cix) < nWonder) then 1506 1506 begin// wonder already built, try to switch to different one 1507 1507 if (WonderAvailable and not WonderInWork > 0) and … … 1553 1553 begin // low prio projects 1554 1554 ImportantCity := WillProduceColonyShip or (Built[imPalace] > 0); 1555 for iix := 0 to 27do1555 for iix := 0 to nWonder - 1 do 1556 1556 if Built[iix] > 0 then 1557 1557 ImportantCity := True; … … 1605 1605 City_RebuildImprovement(cix, imTownHall) 1606 1606 else if (RO.Government = gFundamentalism) and not WillProduceColonyShip then 1607 for iix := 28to nImp - 1 do1607 for iix := nWonder to nImp - 1 do 1608 1608 if (Built[iix] > 0) and 1609 1609 ((iix in [imTemple, imTheater, imCathedral, imColosseum, -
trunk/AI/StdAI/Protocol.pas
r319 r328 11 11 nImp = 70; { number of improvements } 12 12 nPl = 15; { max number of players, don't change! } 13 nWonder = 28; { max number of wonders } 13 14 nUmax = 4096; { max units/player, don't set above 4096 } 14 15 nCmax = 1024; { max cities/player, don't set above 4096 } … … 1291 1292 Flags: Cardinal; 1292 1293 end; 1294 PUn = ^TUn; 1293 1295 1294 1296 { TCity } … … 1314 1316 // array value =1 indicates built improvement 1315 1317 end; 1318 PCity = ^TCity; 1316 1319 1317 1320 TModel = packed record … … 1352 1355 Flags: Word; 1353 1356 end; 1357 PUnitInfo = ^TUnitInfo; 1354 1358 1355 1359 TCityInfo = packed record … … 1362 1366 Flags: Word; 1363 1367 end; 1368 PCityInfo = ^TCityInfo; 1364 1369 1365 1370 TModelInfo = packed record … … 1591 1596 1592 1597 TTileList = array [0 .. INFIN] of Cardinal; 1598 PTileList = ^TTileList; 1593 1599 TTileObservedLastList = array [0 .. INFIN] of SmallInt; 1594 1600 TOwnerList = array [0 .. INFIN] of ShortInt; … … 1645 1651 Tribute: array [0 .. nPl - 1] of Integer; // no longer in use 1646 1652 TributePaid: array [0 .. nPl - 1] of Integer; // no longer in use 1647 Wonder: array [0 .. 27] of TWonderInfo;1653 Wonder: array [0 .. nWonder - 1] of TWonderInfo; 1648 1654 Ship: array [0 .. nPl - 1] of TShipInfo; 1649 NatBuilt: array [ 28.. (nImp + 3) div 4 * 4 - 1] of ShortInt;1655 NatBuilt: array [nWonder .. (nImp + 3) div 4 * 4 - 1] of ShortInt; 1650 1656 nBattleHistory: Integer; 1651 1657 BattleHistory: ^TBattleList; // complete list of all my battles in the whole game -
trunk/AI/StdAI/ToolAI.pas
r289 r328 234 234 Inc(Result, CityReport.FoodRep - CityReport.Eaten); 235 235 end; 236 for i := 28to nImp - 1 do236 for i := nWonder to nImp - 1 do 237 237 if MyCity[cix].Built[i] > 0 then 238 238 Dec(Result, Imp[i].Maint);
Note:
See TracChangeset
for help on using the changeset viewer.