Changeset 328 for trunk/LocalPlayer
- Timestamp:
- Mar 25, 2021, 3:02:29 PM (4 years ago)
- Location:
- trunk/LocalPlayer
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/CityScreen.pas
r325 r328 325 325 for i := 0 to 29 do 326 326 begin 327 for iix := 28to nImp - 1 do327 for iix := nWonder to nImp - 1 do 328 328 if (ImpPosition[iix] = i) and (c.Built[iix] > 0) then 329 329 begin … … 336 336 i := 30; 337 337 for iix := 0 to nImp do 338 if (c.Built[iix] > 0) and ((iix < 28) or (ImpPosition[iix] < 0)) then338 if (c.Built[iix] > 0) and ((iix < nWonder) or (ImpPosition[iix] < 0)) then 339 339 begin 340 340 FillRect(Rect(5 + 16 * (i mod 3) + 48 * (i div 18), … … 350 350 if iix <> imTrGoods then 351 351 begin 352 if (iix >= 28) and (ImpPosition[iix] >= 0) then352 if (iix >= nWonder) and (ImpPosition[iix] >= 0) then 353 353 i := ImpPosition[iix]; 354 354 if i < 36 then … … 827 827 Cnt := 0; 828 828 for iix := 0 to nImp - 1 do 829 if ((iix < 28) or (ImpPosition[iix] < 0)) and (c.Built[iix] > 0) then829 if ((iix < nWonder) or (ImpPosition[iix] < 0)) and (c.Built[iix] > 0) then 830 830 begin 831 831 i := Cnt - Page * 6; … … 838 838 else 839 839 begin 840 for iix := 28to nImp - 1 do840 for iix := nWonder to nImp - 1 do 841 841 begin 842 842 i := ImpPosition[iix] - 6 * ZoomArea; -
trunk/LocalPlayer/CityType.pas
r188 r328 158 158 159 159 nPool := 0; 160 for iix := 28to nImp - 1 do160 for iix := nWonder to nImp - 1 do 161 161 if not(iix in listed) and (Imp[iix].Kind = ikCommon) and (iix <> imTrGoods) 162 162 and (Imp[iix].Preq <> preNA) and -
trunk/LocalPlayer/ClientTools.pas
r327 r328 261 261 Inc(Result, CityReport.FoodSurplus); 262 262 end; 263 for i := 28to nImp - 1 do263 for i := nWonder to nImp - 1 do 264 264 if MyCity[cix].Built[i] > 0 then 265 265 Dec(Result, Imp[i].Maint); -
trunk/LocalPlayer/Help.pas
r318 r328 1484 1484 hkMisc + hkCrossLink, miscGovList); 1485 1485 NextSection('BUILDALLOW'); 1486 for i := 0 to 27do1486 for i := 0 to nWonder - 1 do 1487 1487 if Imp[i].Preq = no then 1488 1488 AddImprovement(i); 1489 for i := 28to nImp - 1 do1489 for i := nWonder to nImp - 1 do 1490 1490 if (Imp[i].Preq = no) and (Imp[i].Kind <> ikCommon) then 1491 1491 AddImprovement(i); 1492 for i := 28to nImp - 1 do1492 for i := nWonder to nImp - 1 do 1493 1493 if (Imp[i].Preq = no) and (Imp[i].Kind = ikCommon) then 1494 1494 AddImprovement(i); … … 1527 1527 end; 1528 1528 NextSection('EXPIRATION'); 1529 for i := 0 to 27do1529 for i := 0 to nWonder - 1 do 1530 1530 if (Imp[i].Preq <> preNA) and (Imp[i].Expiration = no) then 1531 1531 AddImprovement(i); … … 1545 1545 List := THyperText.Create; 1546 1546 List.OwnsObjects := True; 1547 for i := 28to nImp - 1 do1547 for i := nWonder to nImp - 1 do 1548 1548 if (i <> imTrGoods) and (Imp[i].Preq <> preNA) and 1549 1549 (Imp[i].Kind = ikCommon) then … … 1558 1558 Caption := HelpText.Lookup('HELPTITLE_UNIQUELIST'); 1559 1559 // AddLine(HelpText.Lookup('HELPTITLE_UNIQUELIST'),pkSection); 1560 for i := 28to nImp - 1 do1560 for i := nWonder to nImp - 1 do 1561 1561 if (Imp[i].Preq <> preNA) and 1562 1562 ((Imp[i].Kind = ikNatLocal) or (Imp[i].Kind = ikNatGlobal)) then … … 1566 1566 LineFeed; 1567 1567 AddLine(HelpText.Lookup('HELPTITLE_SHIPPARTLIST'),pkSection); 1568 for i:= 28to nImp-1 do1568 for i:= nWonder to nImp-1 do 1569 1569 if (Imp[i].Preq<>preNA) and (Imp[i].Kind=ikShipPart) then 1570 1570 AddLine(Phrases.Lookup('IMPROVEMENTS',i),pkSmallIcon,i,hkImp,i); } … … 1574 1574 Caption := HelpText.Lookup('HELPTITLE_WONDERLIST'); 1575 1575 // AddLine(HelpText.Lookup('HELPTITLE_WONDERLIST'),pkSection); 1576 for i := 0 to 27do1576 for i := 0 to nWonder - 1 do 1577 1577 if Imp[i].Preq <> preNA then 1578 1578 AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon, i, … … 1600 1600 AddFeature(mcAcademy); 1601 1601 end; 1602 if (no < 28) and not Phrases2FallenBackToEnglish then1602 if (no < nWonder) and not Phrases2FallenBackToEnglish then 1603 1603 begin 1604 1604 LineFeed; … … 1646 1646 [Phrases.Lookup('TERRAIN', 3 * 12 + i)]), pkTer, 3 * 12 + i); 1647 1647 end; 1648 if (no < 28) and (Imp[no].Expiration >= 0) then1648 if (no < nWonder) and (Imp[no].Expiration >= 0) then 1649 1649 begin 1650 1650 NextSection('EXPIRATION'); … … 1656 1656 end; 1657 1657 NextSection('SEEALSO'); 1658 if (no < 28) and (Imp[no].Expiration >= 0) then1658 if (no < nWonder) and (Imp[no].Expiration >= 0) then 1659 1659 AddImprovement(woEiffel); 1660 1660 for i := 0 to nImpReplacement - 1 do -
trunk/LocalPlayer/Select.pas
r318 r328 1068 1068 code[0, 0] := cpImp + imTrGoods; 1069 1069 Lines[0] := 1; 1070 for i := 28to nImp - 1 do1070 for i := nWonder to nImp - 1 do 1071 1071 if Imp[i].Kind = ikCommon then 1072 1072 TryAddImpLine(0, i + cpImp); 1073 for i := 28to nImp - 1 do1073 for i := nWonder to nImp - 1 do 1074 1074 if not(Imp[i].Kind in [ikCommon, ikTrGoods]) and 1075 1075 ((MyRO.NatBuilt[i] = 0) or (Imp[i].Kind = ikNatLocal)) then … … 1083 1083 1084 1084 // wonders 1085 for i := 0 to 27do1085 for i := 0 to nWonder - 1 do 1086 1086 TryAddImpLine(1, i + cpImp); 1087 1087 -
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.