Changeset 328 for trunk/LocalPlayer/Term.pas
- Timestamp:
- Mar 25, 2021, 3:02:29 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Term.pas
r327 r328 458 458 EnhancementJobs: TEnhancementJobs; 459 459 ImpOrder: array [0 .. nCityType - 1] of TImpOrder; 460 ToldWonders: array [0 .. 27] of TWonderInfo;460 ToldWonders: array [0 .. nWonder - 1] of TWonderInfo; 461 461 ToldTech: array [0 .. nAdv - 1] of ShortInt; 462 462 end; … … 469 469 DeliveredPrices: TPriceSet; 470 470 ReceivedPrices: TPriceSet; 471 end; 472 473 TCurrentMoveInfo = record 474 AfterMovePaintRadius: Integer; 475 AfterAttackExpeller: Integer; 476 DoShow: Boolean; 477 IsAlly: Boolean; 471 478 end; 472 479 … … 568 575 569 576 var 570 Jump: array [0 .. nPl - 1] of integer; 571 pTurn, pLogo, UnStartLoc, ToldSlavery: integer; 572 SmallScreen, GameOK, MapValid, skipped, idle: boolean; 573 574 SaveOption: array of integer; 575 MiniColors: array [0..11, 0..1] of TColor; 577 Jump: array [0 .. nPl - 1] of Integer; 578 pTurn: Integer; 579 pLogo: Integer; 580 UnStartLoc: Integer; 581 ToldSlavery: Integer; 582 SmallScreen: Boolean; 583 GameOK: Boolean; 584 MapValid: Boolean; 585 Skipped: Boolean; 586 Idle: Boolean; 587 588 SaveOption: array of Integer; 576 589 MainMap: TIsoMap; 577 CurrentMoveInfo: record AfterMovePaintRadius, AfterAttackExpeller: integer; 578 DoShow, IsAlly: boolean; 579 end; 590 CurrentMoveInfo: TCurrentMoveInfo; 580 591 581 592 function CityEventName(i: integer): string; … … 1070 1081 begin 1071 1082 result := false; 1072 exit 1083 exit; 1073 1084 end; 1074 1085 ChosenResearch := ModalSelectDlg.result; … … 1396 1407 begin 1397 1408 need := false; 1398 for i := 0 to 27do1409 for i := 0 to nWonder - 1 do 1399 1410 if MyRO.Wonder[i].CityID <> WonderNotBuiltYet then 1400 1411 need := true; … … 1492 1503 $FF - Tribe[i].Color and $FF) * 2; 1493 1504 if TestColorDistance < ColorDistance then 1494 ColorDistance := TestColorDistance 1505 ColorDistance := TestColorDistance; 1495 1506 end; 1496 1507 if ColorDistance > BestColorDistance then 1497 1508 begin 1498 1509 CountBest := 0; 1499 BestColorDistance := ColorDistance 1510 BestColorDistance := ColorDistance; 1500 1511 end; 1501 1512 if ColorDistance = BestColorDistance then … … 1503 1514 inc(CountBest); 1504 1515 if DelphiRandom(CountBest) = 0 then 1505 result := j 1516 result := j; 1506 1517 end; 1507 1518 end; … … 1574 1585 begin 1575 1586 MostCost := TestCost; 1576 IconIndex := imShipComp + i 1587 IconIndex := imShipComp + i; 1577 1588 end; 1578 1589 end; … … 1586 1597 procedure TMainScreen.InitModule; 1587 1598 var 1588 x, y,i, j, Domain: integer;1599 i, j, Domain: integer; 1589 1600 begin 1590 1601 { search icons for advances: } … … 1610 1621 else 1611 1622 AdvIcon[i] := 86 + Domain; 1612 for j := 28to nImp - 1 do1623 for j := nWonder to nImp - 1 do 1613 1624 if Imp[j].Preq = i then 1614 1625 AdvIcon[i] := j; 1615 for j := 28to nImp - 1 do1626 for j := nWonder to nImp - 1 do 1616 1627 if (Imp[j].Preq = i) and (Imp[j].Kind <> ikCommon) then 1617 1628 AdvIcon[i] := j; … … 1619 1630 if i = JobPreq[j] then 1620 1631 AdvIcon[i] := 84; 1621 for j := 0 to 27do1632 for j := 0 to nWonder - 1 do 1622 1633 if Imp[j].Preq = i then 1623 1634 AdvIcon[i] := j; … … 1637 1648 TribeNames := tstringlist.Create; 1638 1649 1639 for x := 0 to 11 do1640 for y := 0 to 1 do1641 MiniColors[x, y] := HGrSystem.Data.Canvas.Pixels[66 + x, 67 + y];1642 1650 IsoEngine.Init(InitEnemyModel); 1643 1651 if not IsoEngine.ApplyTileSize(TileSize) and (TileSize <> tsMedium) then … … 2049 2057 end; 2050 2058 2051 for i := 0 to 27do2059 for i := 0 to nWonder - 1 do 2052 2060 begin 2053 2061 OwnWonder := false; … … 2221 2229 if (MyRO.Turn > 0) and (Loc >= 0) and (Flags and chCaptured = 0) and 2222 2230 (WondersOnly = (Flags and chProduction <> 0) and 2223 (Project0 and cpImp <> 0) and (Project0 and cpIndex < 28)) then2231 (Project0 and cpImp <> 0) and (Project0 and cpIndex < nWonder)) then 2224 2232 begin 2225 2233 if WondersOnly then … … 2602 2610 inc(ToldAlive, 1 shl i); 2603 2611 PeaceEvaHappened := 0; 2604 for i := 0 to 27do2612 for i := 0 to nWonder - 1 do 2605 2613 with ToldWonders[i] do 2606 2614 begin … … 5852 5860 if CityCaptured and (MyMap[ToLoc] and fCity = 0) then 5853 5861 begin // city destroyed 5854 for i := 0 to 27do { tell about destroyed wonders }5862 for i := 0 to nWonder - 1 do { tell about destroyed wonders } 5855 5863 if (MyRO.Wonder[i].CityID = WonderDestroyed) and (MyData.ToldWonders[i].CityID <> WonderDestroyed) 5856 5864 then … … 5874 5882 begin // city captured 5875 5883 ListDlg.AddCity; 5876 for i := 0 to 27do { tell about capture of wonders }5884 for i := 0 to nWonder - 1 do { tell about capture of wonders } 5877 5885 if MyRO.City[MyRO.nCity - 1].Built[i] > 0 then 5878 5886 with MessgExDlg do … … 7183 7191 // check if city types already usefull: 7184 7192 if MyRO.nCity > 0 then 7185 for i := 28to nImp - 1 do7193 for i := nWonder to nImp - 1 do 7186 7194 if (i <> imTrGoods) and (Imp[i].Kind = ikCommon) and 7187 7195 (Imp[i].Preq <> preNA) and … … 7262 7270 mEUnitStat.Enabled := MyRO.nEnemyModel > 0; 7263 7271 { mWonders.Enabled:= false; 7264 for i:=0 to 27do if MyRO.Wonder[i].CityID <> WonderNotBuiltYet then7272 for i:=0 to nWonder - 1 do if MyRO.Wonder[i].CityID <> WonderNotBuiltYet then 7265 7273 mWonders.Enabled:=true; } 7266 7274 mDiagram.Enabled := MyRO.Turn >= 2;
Note:
See TracChangeset
for help on using the changeset viewer.