Changeset 465
- Timestamp:
- Nov 30, 2023, 10:16:14 PM (13 months ago)
- Location:
- branches/highdpi
- Files:
-
- 10 added
- 1 deleted
- 108 edited
- 16 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/AI/StdAI/AI.pas
r349 r465 23 23 24 24 nResearchOrder = 46; 25 ResearchOrder: array[0..1, 0..nResearchOrder - 1] of integer =25 ResearchOrder: array[0..1, 0..nResearchOrder - 1] of Integer = 26 26 ((adWheel, adWarriorCode, adHorsebackRiding, adCeremonialBurial, adPolytheism, 27 27 adMonarchy, adMysticism, adPoetry, adAstronomy, adMonotheism, … … 76 76 77 77 // mil research 78 BetterQuality: array[0..nModelCat - 1] of integer = (50, 50, 80, 80);78 BetterQuality: array[0..nModelCat - 1] of Integer = (50, 50, 80, 80); 79 79 MaxBuildWorseThanBestModel = 20; 80 80 MaxExistWorseThanBestModel = 50; … … 85 85 nRequestedTechs = 48; 86 86 87 PlayerHash: array[0..nPl - 1] of integer =87 PlayerHash: array[0..nPl - 1] of Integer = 88 88 (7, 6, 0, 2, 10, 8, 12, 14, 4, 1, 3, 5, 9, 11, 13); 89 89 … … 92 92 93 93 TPersistentData = record 94 LastResearchTech, BehaviorFlags, TheologyPartner: integer;94 LastResearchTech, BehaviorFlags, TheologyPartner: Integer; 95 95 RejectTurn: array[Suggestion, 0..15] of smallint; 96 RequestedTechs: array[0..nRequestedTechs - 1] of integer;96 RequestedTechs: array[0..nRequestedTechs - 1] of Integer; 97 97 // ad + p shl 8 + Turn shl 16 98 98 end; 99 99 100 100 TAI = class(TBarbarina) 101 constructor Create(Nation: integer); override;101 constructor Create(Nation: Integer); override; 102 102 103 103 procedure SetDataDefaults; override; … … 106 106 Data: ^TPersistentData; 107 107 WarNations, BombardingNations, mixSettlers, mixCaravan, mixTownGuard, 108 mixSlaves, mixMilitia, mixCruiser, OceanWithShip: integer;108 mixSlaves, mixMilitia, mixCruiser, OceanWithShip: Integer; 109 109 NegoCause: (Routine, CheckBarbarina); 110 SettlerSurplus: array[0..maxCOD - 1] of integer;111 uixPatrol: array[0..maxCOD - 1] of integer;112 113 ContinentPresence: array[0..maxCOD - 1] of integer;114 OceanPresence: array[0..maxCOD - 1] of integer;115 UnitLack: array[0..maxCOD - 1, mctGroundDefender..mctGroundAttacker] of integer;116 117 TotalPopulation: array[0..nPl - 1] of integer;118 ContinentPopulation: array[0..nPl - 1, 0..maxCOD - 1] of integer;110 SettlerSurplus: array[0..maxCOD - 1] of Integer; 111 uixPatrol: array[0..maxCOD - 1] of Integer; 112 113 ContinentPresence: array[0..maxCOD - 1] of Integer; 114 OceanPresence: array[0..maxCOD - 1] of Integer; 115 UnitLack: array[0..maxCOD - 1, mctGroundDefender..mctGroundAttacker] of Integer; 116 117 TotalPopulation: array[0..nPl - 1] of Integer; 118 ContinentPopulation: array[0..nPl - 1, 0..maxCOD - 1] of Integer; 119 119 // 1 means enemy territory spotted but no city 120 DistrictPopulation: array[0..maxCOD - 1] of integer;121 122 ModelCat: array[0..nMmax - 1] of integer;123 ModelQuality: array[0..nMmax - 1] of integer;124 ModelBestQuality: array[0..nModelCat - 1] of integer;125 126 AdvanceValue: array[0..nAdv - 1] of integer;127 AdvanceValuesSet: boolean;120 DistrictPopulation: array[0..maxCOD - 1] of Integer; 121 122 ModelCat: array[0..nMmax - 1] of Integer; 123 ModelQuality: array[0..nMmax - 1] of Integer; 124 ModelBestQuality: array[0..nModelCat - 1] of Integer; 125 126 AdvanceValue: array[0..nAdv - 1] of Integer; 127 AdvanceValuesSet: Boolean; 128 128 129 129 procedure DoTurn; override; 130 130 procedure DoNegotiation; override; 131 function ChooseResearchAdvance: integer; override;132 function ChooseStealAdvance: integer; override;133 function ChooseGovernment: integer; override;134 function WantNegotiation(Nation: integer; NegoTime: TNegoTime): boolean; override;135 function OnNegoRejected_CancelTreaty: boolean; override;136 137 procedure FindBestTrade(Nation: integer; var adWanted, adGiveAway: integer);131 function ChooseResearchAdvance: Integer; override; 132 function ChooseStealAdvance: Integer; override; 133 function ChooseGovernment: Integer; override; 134 function WantNegotiation(Nation: Integer; NegoTime: TNegoTime): Boolean; override; 135 function OnNegoRejected_CancelTreaty: Boolean; override; 136 137 procedure FindBestTrade(Nation: Integer; var adWanted, adGiveAway: Integer); 138 138 procedure CheckGender; 139 139 procedure AnalyzeMap; … … 141 141 procedure AttackAndPatrol; 142 142 procedure MoveUnitsHome; 143 procedure CheckAttack(uix: integer);144 procedure Patrol(uix: integer);143 procedure CheckAttack(uix: Integer); 144 procedure Patrol(uix: Integer); 145 145 procedure SetCityProduction; 146 146 procedure SetAdvanceValues; 147 function HavePort: boolean;148 {$IFDEF DEBUG}procedure TraceAdvanceValues(Nation: integer);{$ENDIF}147 function HavePort: Boolean; 148 {$IFDEF DEBUG}procedure TraceAdvanceValues(Nation: Integer);{$ENDIF} 149 149 150 150 // research 151 procedure RateModel(const mi: TModelInfo; var Category, Quality: integer);152 procedure RateMyModel(mix: integer; var Category, Quality: integer);153 function IsBetterModel(const mi: TModelInfo): boolean;151 procedure RateModel(const mi: TModelInfo; var Category, Quality: Integer); 152 procedure RateMyModel(mix: Integer; var Category, Quality: Integer); 153 function IsBetterModel(const mi: TModelInfo): Boolean; 154 154 155 155 //terraforming 156 procedure TileWorkPlan(Loc, cix: integer; var Value, NextJob, TotalWork: integer);156 procedure TileWorkPlan(Loc, cix: Integer; var Value, NextJob, TotalWork: Integer); 157 157 procedure ProcessSettlers; 158 158 159 159 // diplomacy 160 function MostWanted(Nation, adGiveAway: integer): integer;160 function MostWanted(Nation, adGiveAway: Integer): Integer; 161 161 162 162 end; … … 174 174 175 175 var 176 LeaveOutValue: array[0..nAdv - 1] of integer; 177 178 179 constructor TAI.Create(Nation: integer); 176 LeaveOutValue: array[0..nAdv - 1] of Integer; 177 178 constructor TAI.Create(Nation: Integer); 180 179 begin 181 180 inherited; 182 Data := pointer(RO.Data);181 Data := Pointer(RO.Data); 183 182 {$IFDEF DEBUG} 184 183 if Nation = 1 then … … 193 192 begin 194 193 LastResearchTech := -1; 195 if PlayerHash[ me] > 7 then194 if PlayerHash[Me] > 7 then 196 195 BehaviorFlags := bFemale 197 196 else … … 199 198 DebugMessage(1, 'Gender:=' + char(48 + BehaviorFlags and bGender)); 200 199 TheologyPartner := -1; 201 fillchar(RejectTurn, sizeof(RejectTurn), $FF);202 Fillchar(RequestedTechs, sizeof(RequestedTechs), $FF);200 FillChar(RejectTurn, SizeOf(RejectTurn), $FF); 201 Fillchar(RequestedTechs, SizeOf(RequestedTechs), $FF); 203 202 end; 204 203 end; 205 204 206 function TAI.OnNegoRejected_CancelTreaty: boolean;205 function TAI.OnNegoRejected_CancelTreaty: Boolean; 207 206 begin 208 207 Data.RejectTurn[suContact, Opponent] := RO.Turn; … … 210 209 end; 211 210 212 213 211 //------------------------------- 214 212 // RESEARCH 215 213 //------------------------------- 216 214 217 procedure TAI.RateModel(const mi: TModelInfo; var Category, Quality: integer);215 procedure TAI.RateModel(const mi: TModelInfo; var Category, Quality: Integer); 218 216 var 219 EffectiveTransport: integer;217 EffectiveTransport: Integer; 220 218 begin 221 219 if mi.Kind >= mkScout then 222 220 begin 223 221 Category := mctNone; 224 exit;222 Exit; 225 223 end; 226 224 case mi.Domain of … … 294 292 end; 295 293 296 procedure TAI.RateMyModel(mix: integer; var Category, Quality: integer);294 procedure TAI.RateMyModel(mix: Integer; var Category, Quality: Integer); 297 295 var 298 296 mi: TModelInfo; 299 297 begin 300 MakeModelInfo( me, mix, MyModel[mix], mi);298 MakeModelInfo(Me, mix, MyModel[mix], mi); 301 299 RateModel(mi, Category, Quality); 302 300 end; 303 301 304 function TAI.IsBetterModel(const mi: TModelInfo): boolean;302 function TAI.IsBetterModel(const mi: TModelInfo): Boolean; 305 303 var 306 mix, Cat, Quality, Cat1, Quality1: integer;304 mix, Cat, Quality, Cat1, Quality1: Integer; 307 305 begin 308 306 RateModel(mi, Cat, Quality); … … 314 312 begin 315 313 Result := False; 316 exit;314 Exit; 317 315 end; 318 316 end; … … 320 318 end; 321 319 322 function TAI.ChooseResearchAdvance: integer;320 function TAI.ChooseResearchAdvance: Integer; 323 321 var 324 adNext, iad, i, ad, Count, EarliestNeeded, EarliestNeeded_NoLeaveOut,325 NewResearch, StateOfArt, mix: integer;322 adNext, iad, I, ad, Count, EarliestNeeded, EarliestNeeded_NoLeaveOut, 323 NewResearch, StateOfArt, mix: Integer; 326 324 mi: TModelInfo; 327 Entry: array[0..nAdv - 1] of boolean;328 ok: boolean;329 330 function MarkEntry(ad: integer): boolean;325 Entry: array[0..nAdv - 1] of Boolean; 326 ok: Boolean; 327 328 function MarkEntry(ad: Integer): Boolean; 331 329 begin 332 330 if RO.Tech[ad] >= tsApplicable then … … 375 373 end; 376 374 377 procedure OptimizeDevModel(OptimizeCaps: integer);375 procedure OptimizeDevModel(OptimizeCaps: Integer); 378 376 var 379 f, Cat, OriginalCat, Quality, BestQuality, Best: integer;377 F, Cat, OriginalCat, Quality, BestQuality, Best: Integer; 380 378 mi: TModelInfo; 381 379 begin 382 MakeModelInfo( me, 0, RO.DevModel, mi);380 MakeModelInfo(Me, 0, RO.DevModel, mi); 383 381 RateModel(mi, OriginalCat, BestQuality); 384 382 repeat 385 383 Best := -1; 386 for f:= 0 to nFeature - 1 do387 if (1 shl fand OptimizeCaps <> 0) and388 ((Feature[ f].Preq < 0) or IsResearched(Feature[f].Preq)) // check prerequisite389 and (RO.DevModel.Weight + Feature[ f].Weight <= RO.DevModel.MaxWeight) and390 not (( f >= mcFirstNonCap) and (RO.DevModel.Cap[f] > 0)) then391 begin 392 if SetNewModelFeature( f, RO.DevModel.Cap[f] + 1) >= rExecuted then384 for F := 0 to nFeature - 1 do 385 if (1 shl F and OptimizeCaps <> 0) and 386 ((Feature[F].Preq < 0) or IsResearched(Feature[F].Preq)) // check prerequisite 387 and (RO.DevModel.Weight + Feature[F].Weight <= RO.DevModel.MaxWeight) and 388 not ((F >= mcFirstNonCap) and (RO.DevModel.Cap[F] > 0)) then 389 begin 390 if SetNewModelFeature(F, RO.DevModel.Cap[F] + 1) >= rExecuted then 393 391 begin 394 MakeModelInfo( me, 0, RO.DevModel, mi);392 MakeModelInfo(Me, 0, RO.DevModel, mi); 395 393 RateModel(mi, Cat, Quality); 396 assert(Cat = OriginalCat);394 Assert(Cat = OriginalCat); 397 395 if Quality > BestQuality then 398 396 begin 399 Best := f;397 Best := F; 400 398 BestQuality := Quality; 401 399 end; 402 SetNewModelFeature( f, RO.DevModel.Cap[f] - 1);400 SetNewModelFeature(F, RO.DevModel.Cap[F] - 1); 403 401 end; 404 402 end; … … 408 406 end; 409 407 410 function LeaveOutsMissing(ad: integer): boolean;408 function LeaveOutsMissing(ad: Integer): Boolean; 411 409 var 412 i: integer;410 I: Integer; 413 411 begin 414 412 Result := False; … … 424 422 Result := True 425 423 else 426 for i:= 0 to 1 do427 if AdvPreq[ad, i] >= 0 then428 Result := Result or LeaveOutsMissing(AdvPreq[ad, i]);424 for I := 0 to 1 do 425 if AdvPreq[ad, I] >= 0 then 426 Result := Result or LeaveOutsMissing(AdvPreq[ad, I]); 429 427 end; 430 428 … … 434 432 Result := Barbarina_ChooseResearchAdvance; 435 433 if Result >= 0 then 436 exit;434 Exit; 437 435 end; 438 436 … … 446 444 Result := ad; 447 445 if Result >= 0 then 448 exit;446 Exit; 449 447 450 448 if Data.BehaviorFlags and bBarbarina = 0 then … … 462 460 OptimizeDevModel(1 shl mcOffense + 1 shl mcDefense + 1 shl 463 461 mcMob + 1 shl mcLongRange + 1 shl mcFanatic); 464 MakeModelInfo( me, 0, RO.DevModel, mi);462 MakeModelInfo(Me, 0, RO.DevModel, mi); 465 463 if IsBetterModel(mi) then 466 464 begin 467 465 Result := adMilitary; 468 exit;466 Exit; 469 467 end; 470 468 … … 473 471 SetNewModelFeature(mcOffense, 1); 474 472 OptimizeDevModel(1 shl mcOffense + 1 shl mcDefense + 1 shl mcFanatic); 475 MakeModelInfo( me, 0, RO.DevModel, mi);473 MakeModelInfo(Me, 0, RO.DevModel, mi); 476 474 if IsBetterModel(mi) then 477 475 begin 478 476 Result := adMilitary; 479 exit;477 Exit; 480 478 end; 481 479 end; … … 493 491 SetNewModelFeature(mcWeapons, 0); 494 492 SetNewModelFeature(mcDefense, 3); 495 exit;493 Exit; 496 494 end; 497 495 end; … … 508 506 OptimizeDevModel(1 shl mcDefense+1 shl mcSeaTrans+1 shl mcTurbines 509 507 +1 shl mcAirDef); 510 MakeModelInfo( me,0,RO.DevModel,mi);508 MakeModelInfo(Me,0,RO.DevModel,mi); 511 509 if IsBetterModel(mi) then 512 begin result:=adMilitary; exit end;510 begin Result:=adMilitary; Exit end; 513 511 end; 514 512 … … 521 519 OptimizeDevModel(1 shl mcOffense+1 shl mcDefense 522 520 +1 shl mcLongRange+1 shl mcAirDef+1 shl mcRadar); 523 MakeModelInfo( me,0,RO.DevModel,mi);521 MakeModelInfo(Me,0,RO.DevModel,mi); 524 522 if IsBetterModel(mi) then 525 begin result:=adMilitary; exit end;523 begin Result:=adMilitary; Exit end; 526 524 end 527 525 end; … … 547 545 begin 548 546 ok := True; 549 break;547 Break; 550 548 end; 551 549 if not ok then … … 590 588 begin // 2 of 3 required 591 589 Count := 0; 592 for i:= 0 to 2 do593 if RO.Tech[AdvPreq[ad, i]] >= tsApplicable then590 for I := 0 to 2 do 591 if RO.Tech[AdvPreq[ad, I]] >= tsApplicable then 594 592 Inc(Count); 595 593 if Count >= 2 then 596 594 begin 597 595 Result := ad; 598 exit;596 Exit; 599 597 end; 600 598 end … … 604 602 begin 605 603 Result := ad; 606 exit;604 Exit; 607 605 end; 608 606 end; … … 620 618 begin // go for future techs 621 619 Result := -1; 622 i:= 0;620 I := 0; 623 621 for ad := nAdv - 4 to nAdv - 1 do 624 622 if (RO.Tech[ad] < MaxFutureTech) and (RO.Tech[AdvPreq[ad, 0]] >= 625 623 tsApplicable) then 626 624 begin 627 Inc( i);628 if random( i) = 0 then625 Inc(I); 626 if random(I) = 0 then 629 627 Result := ad; 630 628 end; 631 assert((Result < 0) or AdvanceResearchable(Result));632 exit;633 end; 634 635 assert(NewResearch >= 0);636 fillchar(Entry, sizeof(Entry), False);629 Assert((Result < 0) or AdvanceResearchable(Result)); 630 Exit; 631 end; 632 633 Assert(NewResearch >= 0); 634 FillChar(Entry, SizeOf(Entry), False); 637 635 MarkEntry(NewResearch); 638 636 Result := -1; … … 640 638 if Entry[ad] and ((Result < 0) or (Advancedness[ad] > Advancedness[Result])) then 641 639 Result := ad; 642 assert(Result >= 0);640 Assert(Result >= 0); 643 641 end; 644 642 645 function TAI.ChooseStealAdvance: integer;643 function TAI.ChooseStealAdvance: Integer; 646 644 var 647 ad: integer;645 ad: Integer; 648 646 begin 649 647 Result := -1; … … 654 652 end; 655 653 656 657 654 //------------------------------- 658 655 // TERRAFORMING … … 662 659 twpAllowFarmland = $0001; 663 660 664 procedure TAI.TileWorkPlan(Loc, cix: integer; var Value, NextJob, TotalWork: integer);661 procedure TAI.TileWorkPlan(Loc, cix: Integer; var Value, NextJob, TotalWork: Integer); 665 662 var 666 OldTile, TerrType: cardinal;663 OldTile, TerrType: Cardinal; 667 664 TileInfo: TTileInfo; 668 665 begin … … 672 669 begin 673 670 Value := 3 * 8 - 1; 674 exit;671 Exit; 675 672 end; // better than any tile with 2 food 676 673 … … 693 690 Map[Loc] := Map[Loc] and not fTerrain or fGrass; 694 691 TerrType := fGrass; 695 Map[Loc] := Map[Loc] or cardinal(SpecialTile(Loc, TerrType, G.lx) shl 5);692 Map[Loc] := Map[Loc] or Cardinal(SpecialTile(Loc, TerrType, G.lx) shl 5); 696 693 end 697 694 else if IsResearched(adExplosives) and … … 704 701 Map[Loc] := Map[Loc] and not fTerrain or fGrass; 705 702 TerrType := fGrass; 706 Map[Loc] := Map[Loc] or cardinal(SpecialTile(Loc, TerrType, G.lx) shl 5);703 Map[Loc] := Map[Loc] or Cardinal(SpecialTile(Loc, TerrType, G.lx) shl 5); 707 704 end; 708 705 if (Terrain[TerrType].MineEff > 0) and (RO.Government <> gDespotism) then … … 767 764 end; 768 765 end; 769 Server(sGetTileInfo, me, Loc, TileInfo);766 Server(sGetTileInfo, Me, Loc, TileInfo); 770 767 Value := TileInfo.Food * 8 + TileInfo.Prod * 2 + TileInfo.Trade; 771 768 Map[Loc] := OldTile; … … 775 772 procedure TAI.ProcessSettlers; 776 773 var 777 i, uix, cix, ecix, dtr, Loc, RadiusLoc, Special, Food, Prod, Trade,774 I, uix, cix, ecix, dtr, Loc, RadiusLoc, Special, Food, Prod, Trade, 778 775 CityFood, Happy, TestScore, BestNearCityScore, BestUnusedValue, 779 BestUnusedLoc, Value, NextJob, TotalWork, V21, part, Loc1: integer;780 Tile: cardinal;781 FoodOk, Started: boolean;776 BestUnusedLoc, Value, NextJob, TotalWork, V21, part, Loc1: Integer; 777 Tile: Cardinal; 778 FoodOk, Started: Boolean; 782 779 Radius: TVicinity21Loc; 783 780 CityAreaInfo: TCityAreaInfo; 784 TileFood, ResourceScore, CityScore: array[0..lxmax * lymax - 1] of integer;785 786 procedure AddJob(Loc, Job, Score: integer);781 TileFood, ResourceScore, CityScore: array[0..lxmax * lymax - 1] of Integer; 782 783 procedure AddJob(Loc, Job, Score: Integer); 787 784 // set Score=1 for low-priority jobs 788 785 begin … … 792 789 end; 793 790 794 procedure ReserveCityRadius(Loc: integer);791 procedure ReserveCityRadius(Loc: Integer); 795 792 var 796 V21, RadiusLoc: integer;793 V21, RadiusLoc: Integer; 797 794 Radius: TVicinity21Loc; 798 795 begin … … 811 808 procedure ScoreRoadConnections; 812 809 var 813 V8, nFragments, Loc, Loc1, History, RoadScore, a, b, FullyDeveloped,814 ConnectMask: integer;815 BridgeOk: boolean;810 V8, nFragments, Loc, Loc1, History, RoadScore, A, B, FullyDeveloped, 811 ConnectMask: Integer; 812 BridgeOk: Boolean; 816 813 Adjacent: TVicinity8Loc; 817 814 begin … … 824 821 if ((1 shl (Map[Loc] and fTerrain)) and (1 shl fOcean or 1 shl 825 822 fShore or 1 shl fDesert or 1 shl fArctic or 1 shl fUNKNOWN) = 0) and 826 (RO.Territory[Loc] = me) and (Map[Loc] and FullyDeveloped = 0) and823 (RO.Territory[Loc] = Me) and (Map[Loc] and FullyDeveloped = 0) and 827 824 (BridgeOk or (Map[Loc] and fRiver = 0)) then 828 825 begin … … 838 835 Loc1 := Adjacent[V8 and 7]; 839 836 History := History shl 1; 840 if (Loc1 >= 0) and (RO.Territory[Loc1] = me) and837 if (Loc1 >= 0) and (RO.Territory[Loc1] = Me) and 841 838 (Map[Loc1] and ConnectMask <> 0) then 842 839 begin … … 854 851 else if History and 4 <> 0 then 855 852 begin 856 V8_to_ab((V8 - 1) and 7, a, b);857 ab_to_Loc(Loc, a shl 1, bshl 1, Loc1);853 V8_to_ab((V8 - 1) and 7, A, B); 854 ab_to_Loc(Loc, A shl 1, B shl 1, Loc1); 858 855 if (Loc1 >= 0) and (Map[Loc1] and ConnectMask <> 0) then 859 856 Dec(nFragments); … … 879 876 880 877 begin 881 fillchar(SettlerSurplus, sizeof(SettlerSurplus), 0);878 FillChar(SettlerSurplus, SizeOf(SettlerSurplus), 0); 882 879 JobAssignment_Initialize; 883 880 884 881 if (Data.BehaviorFlags and bBarbarina = 0) or (RO.nCity < 3) then 885 882 begin 886 fillchar(TileFood, sizeof(TileFood), 0);887 fillchar(ResourceScore, sizeof(ResourceScore), 0);883 FillChar(TileFood, SizeOf(TileFood), 0); 884 FillChar(ResourceScore, SizeOf(ResourceScore), 0); 888 885 for Loc := 0 to MapSize - 1 do 889 886 if Map[Loc] and fTerrain <> fUNKNOWN then … … 926 923 927 924 // rate possible new cities 928 fillchar(CityScore, MapSize * sizeof(integer), 0);925 FillChar(CityScore, MapSize * SizeOf(Integer), 0); 929 926 for Loc := 0 to MapSize - 1 do 930 927 begin … … 933 930 ((RO.Government <> gDespotism) or (Map[Loc] and fSpecial = fSpecial1)) or 934 931 (Map[Loc] and (fTerrain or fSpecial) = fPrairie or fSpecial1)); 935 if FoodOk and ((RO.Territory[Loc] < 0) or (RO.Territory[Loc] = me)) then932 if FoodOk and ((RO.Territory[Loc] < 0) or (RO.Territory[Loc] = Me)) then 936 933 begin 937 934 TestScore := 0; … … 953 950 if CityFood >= MinCityFood then // city is worth founding 954 951 begin 955 TestScore := (72 + 2 * TestScore) shl 8 + ((loc xor me) * 4567) mod 251;952 TestScore := (72 + 2 * TestScore) shl 8 + ((loc xor Me) * 4567) mod 251; 956 953 // some unexactness, random but always the same for this tile 957 954 if TestScore > BestNearCityScore then … … 991 988 if not (Map[RadiusLoc] and fTerrain in [fDesert, fArctic]) then 992 989 begin 993 assert(RadiusLoc >= 0);990 Assert(RadiusLoc >= 0); 994 991 TileWorkPlan(RadiusLoc, cix, Value, NextJob, TotalWork); 995 992 if (NextJob = jRoad) and (Built[imPalace] + … … 1003 1000 begin // tile could be exploited 1004 1001 RadiusLoc := Radius[V21]; 1005 assert(RadiusLoc >= 0);1002 Assert(RadiusLoc >= 0); 1006 1003 if not (Map[RadiusLoc] and fTerrain in [fDesert, fArctic]) then 1007 1004 begin … … 1027 1024 if Data.BehaviorFlags and bBarbarina = 0 then // low priority jobs 1028 1025 for Loc := 0 to MapSize - 1 do 1029 if RO.Territory[Loc] = me then1026 if RO.Territory[Loc] = Me then 1030 1027 begin 1031 1028 Tile := Map[Loc]; … … 1051 1048 begin 1052 1049 for part := 0 to nShipPart - 1 do 1053 for i:= 0 to ColonyShipPlan[part].nLocFoundCity - 1 do1054 begin 1055 Loc := ColonyShipPlan[part].LocFoundCity[ i];1050 for I := 0 to ColonyShipPlan[part].nLocFoundCity - 1 do 1051 begin 1052 Loc := ColonyShipPlan[part].LocFoundCity[I]; 1056 1053 Started := False; 1057 1054 for uix := 0 to RO.nUn - 1 do … … 1059 1056 begin 1060 1057 Started := True; 1061 break;1058 Break; 1062 1059 end; 1063 1060 if not Started then … … 1122 1119 begin // settlers could be added to this city 1123 1120 Happy := BasicHappy; 1124 for i:= 0 to nWonder - 1 do1125 if Built[ i] > 0 then1121 for I := 0 to nWonder - 1 do 1122 if Built[I] > 0 then 1126 1123 Inc(Happy); 1127 1124 if Built[imTemple] > 0 then … … 1130 1127 begin 1131 1128 Inc(Happy, 2); 1132 if RO.Wonder[woBach].EffectiveOwner = me then1129 if RO.Wonder[woBach].EffectiveOwner = Me then 1133 1130 Inc(Happy, 1); 1134 1131 end; … … 1145 1142 end; 1146 1143 end; 1147 end; // ProcessSettlers 1148 1144 end; 1149 1145 1150 1146 //------------------------------- … … 1154 1150 procedure TAI.DoTurn; 1155 1151 var 1156 emix, i, p1, TaxSum, ScienceSum, NewTaxRate: integer;1157 AllHateMe: boolean;1152 emix, I, p1, TaxSum, ScienceSum, NewTaxRate: Integer; 1153 AllHateMe: Boolean; 1158 1154 {$IFDEF PERF} 1159 1155 PF, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9: int64; … … 1161 1157 begin 1162 1158 {$IFDEF DEBUG} 1163 fillchar(DebugMap, sizeof(DebugMap), 0);1159 FillChar(DebugMap, SizeOf(DebugMap), 0); 1164 1160 {$ENDIF} 1165 1161 … … 1173 1169 WarNations := PresenceUnknown; 1174 1170 for p1 := 0 to nPl - 1 do 1175 if (p1 <> me) and (1 shl p1 and RO.Alive <> 0) and (RO.Treaty[p1] < trPeace) then1171 if (p1 <> Me) and (1 shl p1 and RO.Alive <> 0) and (RO.Treaty[p1] < trPeace) then 1176 1172 Inc(WarNations, 1 shl p1); 1177 1173 BombardingNations := 0; … … 1189 1185 CheckGender; 1190 1186 1191 if G.Difficulty[ me] < MaxDiff then // not on beginner level1187 if G.Difficulty[Me] < MaxDiff then // not on beginner level 1192 1188 begin 1193 1189 if (Data.LastResearchTech = adHorsebackRiding) and (RO.ResearchTech < 0) and 1194 1190 (random(6) = 0) and (HavePort or (ContinentPresence[0] and not 1195 (1 shl me or PresenceUnknown) <> 0)) then1191 (1 shl Me or PresenceUnknown) <> 0)) then 1196 1192 begin 1197 1193 Data.BehaviorFlags := Data.BehaviorFlags or bBarbarina_Hide; … … 1210 1206 begin 1211 1207 AllHateMe := False; 1212 break;1208 Break; 1213 1209 end; 1214 1210 if AllHateMe then … … 1306 1302 else 1307 1303 begin 1308 if (RO.TaxRate = 0) or (RO.Money < (TotalPopulation[ me] - 4) * 2) then1304 if (RO.TaxRate = 0) or (RO.Money < (TotalPopulation[Me] - 4) * 2) then 1309 1305 NewTaxRate := RO.TaxRate // don't check decreasing tax 1310 1306 else … … 1313 1309 begin 1314 1310 SumCities(NewTaxRate, TaxSum, ScienceSum); 1315 if RO.Money + TaxSum >= (TotalPopulation[ me] - 4) then1316 break; // enough1311 if RO.Money + TaxSum >= (TotalPopulation[Me] - 4) then 1312 Break; // enough 1317 1313 Inc(NewTaxRate, 10); 1318 1314 end; … … 1328 1324 // research completed 1329 1325 for p1 := 0 to nPl - 1 do 1330 if (p1 <> me) and (1 shl p1 and RO.Alive <> 0) and1326 if (p1 <> Me) and (1 shl p1 and RO.Alive <> 0) and 1331 1327 (RO.EnemyReport[p1].TurnOfCivilReport + TechReportOutdated > RO.Turn) and 1332 1328 (RO.EnemyReport[p1].Tech[Data.LastResearchTech] < tsSeen) then 1333 1329 begin // latest researched advance might be of interest to this nation 1334 for i:= 0 to nRequestedTechs - 1 do1335 if (Data.RequestedTechs[ i] >= 0) and1336 (Data.RequestedTechs[ i] shr 8 and $F = p1) then1337 Data.RequestedTechs[ i] := -1;1330 for I := 0 to nRequestedTechs - 1 do 1331 if (Data.RequestedTechs[I] >= 0) and 1332 (Data.RequestedTechs[I] shr 8 and $F = p1) then 1333 Data.RequestedTechs[I] := -1; 1338 1334 end; 1339 1335 if RO.ResearchTech = adMilitary then … … 1341 1337 else 1342 1338 Data.LastResearchTech := RO.ResearchTech; 1343 for i:= 0 to nRequestedTechs - 1 do1344 if (Data.RequestedTechs[ i] >= 0) and1345 (RO.Tech[Data.RequestedTechs[ i] and $FF] >= tsSeen) then1346 Data.RequestedTechs[ i] := -1;1339 for I := 0 to nRequestedTechs - 1 do 1340 if (Data.RequestedTechs[I] >= 0) and 1341 (RO.Tech[Data.RequestedTechs[I] and $FF] >= tsSeen) then 1342 Data.RequestedTechs[I] := -1; 1347 1343 1348 1344 // prepare negotiation … … 1350 1346 SetAdvanceValues; 1351 1347 1352 1353 1348 {$IFDEF DEBUG} 1354 1349 (*for p1:=0 to nPl-1 do 1355 if (p1<> me) and (1 shl p1 and RO.Alive<>0) and (RO.Treaty[p1]>=trPeace)1350 if (p1<>Me) and (1 shl p1 and RO.Alive<>0) and (RO.Treaty[p1]>=trPeace) 1356 1351 and (RO.EnemyReport[p1].TurnOfCivilReport>=0) then 1357 1352 TraceAdvanceValues(p1);*) … … 1368 1363 1369 1364 {$IFDEF DEBUG} 1370 procedure TAI.TraceAdvanceValues(Nation: integer);1365 procedure TAI.TraceAdvanceValues(Nation: Integer); 1371 1366 var 1372 ad: integer;1367 ad: Integer; 1373 1368 begin 1374 1369 for ad := 0 to nAdv - 1 do … … 1380 1375 end; 1381 1376 end; 1382 1383 1377 {$ENDIF} 1384 1385 1378 1386 1379 procedure TAI.CheckGender; 1387 1380 var 1388 p1, NewGender: integer;1381 p1, NewGender: Integer; 1389 1382 begin 1390 1383 NewGender := -1; 1391 1384 for p1 := 0 to nPl - 1 do 1392 if (p1 <> me) and (1 shl p1 and RO.Alive <> 0) and1385 if (p1 <> Me) and (1 shl p1 and RO.Alive <> 0) and 1393 1386 (RO.Treaty[p1] >= trFriendlyContact) then 1394 if PlayerHash[ me] > PlayerHash[p1] then1387 if PlayerHash[Me] > PlayerHash[p1] then 1395 1388 begin 1396 1389 if NewGender = bMale then 1397 1390 begin 1398 1391 NewGender := -2; 1399 break;1392 Break; 1400 1393 end; // ambiguous, don't change gender 1401 1394 NewGender := bFemale; … … 1406 1399 begin 1407 1400 NewGender := -2; 1408 break;1401 Break; 1409 1402 end; // ambiguous, don't change gender 1410 1403 NewGender := bMale; … … 1417 1410 end; 1418 1411 1419 1420 1412 procedure TAI.SetAdvanceValues; 1421 1413 1422 procedure RateResearchAdv(ad, Time: integer);1414 procedure RateResearchAdv(ad, Time: Integer); 1423 1415 var 1424 Value: integer;1416 Value: Integer; 1425 1417 begin 1426 1418 if Time = 0 then … … 1432 1424 end; 1433 1425 1434 procedure SetPreqValues(ad, Value: integer);1426 procedure SetPreqValues(ad, Value: Integer); 1435 1427 begin 1436 1428 if (RO.Tech[ad] < tsSeen) and (ad <> RO.ResearchTech) then … … 1455 1447 end; 1456 1448 1457 procedure RateImpPreq(iix, Value: integer);1449 procedure RateImpPreq(iix, Value: Integer); 1458 1450 begin 1459 1451 if (Value > 0) and (Imp[iix].Preq >= 0) then … … 1462 1454 1463 1455 var 1464 emix, cix, adMissing, iad, ad, Count, i, Time, d, CurrentCost,1465 CurrentStrength, MaxSize, MaxTrade: integer;1466 PreView, Emergency, Bombarded: boolean;1456 emix, cix, adMissing, iad, ad, Count, I, Time, D, CurrentCost, 1457 CurrentStrength, MaxSize, MaxTrade: Integer; 1458 PreView, Emergency, Bombarded: Boolean; 1467 1459 begin 1468 1460 if AdvanceValuesSet then 1469 exit;1461 Exit; 1470 1462 AdvanceValuesSet := True; 1471 1463 1472 fillchar(AdvanceValue, sizeof(AdvanceValue), 0);1464 FillChar(AdvanceValue, SizeOf(AdvanceValue), 0); 1473 1465 1474 1466 // rate techs to ensure research progress … … 1490 1482 begin // 2 of 3 required 1491 1483 Count := 0; 1492 for i:= 0 to 2 do1493 if (AdvPreq[ad, i] = RO.ResearchTech) or1494 (RO.Tech[AdvPreq[ad, i]] >= tsSeen) then1484 for I := 0 to 2 do 1485 if (AdvPreq[ad, I] = RO.ResearchTech) or 1486 (RO.Tech[AdvPreq[ad, I]] >= tsSeen) then 1495 1487 Inc(Count); 1496 1488 if Count >= 2 then … … 1500 1492 if ad <> adMassProduction then // don't score third preq for MP 1501 1493 begin 1502 for i:= 0 to 2 do1503 if (AdvPreq[ad, i] <> RO.ResearchTech) and1504 (RO.Tech[AdvPreq[ad, i]] < tsSeen) then1505 RateResearchAdv(AdvPreq[ad, i], Time);1494 for I := 0 to 2 do 1495 if (AdvPreq[ad, I] <> RO.ResearchTech) and 1496 (RO.Tech[AdvPreq[ad, I]] < tsSeen) then 1497 RateResearchAdv(AdvPreq[ad, I], Time); 1506 1498 end; 1507 1499 Inc(Time, 2 - Count); … … 1511 1503 begin 1512 1504 Count := 0; 1513 for i:= 0 to 1 do1514 if (AdvPreq[ad, i] <> preNone) and (AdvPreq[ad, i] <> RO.ResearchTech) and1515 (RO.Tech[AdvPreq[ad, i]] < tsSeen) then1505 for I := 0 to 1 do 1506 if (AdvPreq[ad, I] <> preNone) and (AdvPreq[ad, I] <> RO.ResearchTech) and 1507 (RO.Tech[AdvPreq[ad, I]] < tsSeen) then 1516 1508 begin 1517 RateResearchAdv(AdvPreq[ad, i], Time);1509 RateResearchAdv(AdvPreq[ad, I], Time); 1518 1510 Inc(Count); 1519 1511 end; … … 1544 1536 1545 1537 // rate military techs 1546 for d:= 0 to nDomains - 1 do1538 for D := 0 to nDomains - 1 do 1547 1539 begin 1548 1540 CurrentCost := 0; 1549 1541 CurrentStrength := 0; 1550 1542 for PreView := True downto False do 1551 for i:= 0 to nUpgrade - 1 do1552 with Upgrade[ d, i] do1543 for I := 0 to nUpgrade - 1 do 1544 with Upgrade[D, I] do 1553 1545 if (Preq >= 0) and not (Preq in FutureTech) then 1554 1546 if ((Ro.ResearchTech = Preq) or (RO.Tech[Preq] >= tsSeen)) = PreView then … … 1561 1553 else 1562 1554 begin // rate 1563 if ( i> 0) and (Trans > 0) then1555 if (I > 0) and (Trans > 0) then 1564 1556 Inc(AdvanceValue[Preq], $400); 1565 1557 if Cost <= CurrentCost then 1566 Inc(AdvanceValue[Preq], (4 - d) * Strength * $400 div1567 (CurrentStrength + Upgrade[ d, 0].Strength))1558 Inc(AdvanceValue[Preq], (4 - D) * Strength * $400 div 1559 (CurrentStrength + Upgrade[D, 0].Strength)) 1568 1560 else 1569 Inc(AdvanceValue[Preq], (4 - d) * Strength * $200 div1570 (CurrentStrength + Upgrade[ d, 0].Strength));1561 Inc(AdvanceValue[Preq], (4 - D) * Strength * $200 div 1562 (CurrentStrength + Upgrade[D, 0].Strength)); 1571 1563 end; 1572 1564 end; … … 1648 1640 procedure TAI.AnalyzeMap; 1649 1641 var 1650 cix, Loc, Loc1, V8, f1, p1: integer;1642 cix, Loc, Loc1, V8, f1, p1: Integer; 1651 1643 Adjacent: TVicinity8Loc; 1652 1644 begin … … 1654 1646 1655 1647 // collect nation presence information for continents and oceans 1656 fillchar(ContinentPresence, sizeof(ContinentPresence), 0);1657 fillchar(OceanPresence, sizeof(OceanPresence), 0);1648 FillChar(ContinentPresence, SizeOf(ContinentPresence), 0); 1649 FillChar(OceanPresence, SizeOf(OceanPresence), 0); 1658 1650 for Loc := 0 to MapSize - 1 do 1659 1651 begin … … 1707 1699 end; 1708 1700 1709 fillchar(TotalPopulation, sizeof(TotalPopulation), 0);1710 fillchar(ContinentPopulation, sizeof(ContinentPopulation), 0);1711 fillchar(DistrictPopulation, 4 * nDistrict, 0);1701 FillChar(TotalPopulation, SizeOf(TotalPopulation), 0); 1702 FillChar(ContinentPopulation, SizeOf(ContinentPopulation), 0); 1703 FillChar(DistrictPopulation, 4 * nDistrict, 0); 1712 1704 1713 1705 // count population … … 1724 1716 if Loc >= 0 then 1725 1717 begin 1726 Inc(TotalPopulation[ me], Size);1727 assert(District[Loc] >= 0);1718 Inc(TotalPopulation[Me], Size); 1719 Assert(District[Loc] >= 0); 1728 1720 if District[Loc] < maxCOD then 1729 1721 Inc(DistrictPopulation[District[Loc]], Size); … … 1733 1725 procedure TAI.CollectModelCatStat; 1734 1726 var 1735 i, uix, Cat, mix, Quality: integer;1727 I, uix, Cat, mix, Quality: Integer; 1736 1728 begin 1737 1729 // categorize models … … 1779 1771 if (Loc >= 0) and (mix = mixCruiser) and (Map[Loc] and fTerrain < fGrass) then 1780 1772 begin 1781 i:= Formation[Loc];1782 if ( i >= 0) and (i< maxCOD) then1783 OceanWithShip := OceanWithShip or (1 shl i);1773 I := Formation[Loc]; 1774 if (I >= 0) and (I < maxCOD) then 1775 OceanWithShip := OceanWithShip or (1 shl I); 1784 1776 end; 1785 1777 end; 1786 1787 1778 1788 1779 procedure TAI.MoveUnitsHome; 1789 1780 const 1790 1781 PatrolDestination = lxmax * lymax; 1791 FirstSurplusLoop: array[mctGroundDefender..mctGroundAttacker] of integer = (2, 1);1782 FirstSurplusLoop: array[mctGroundDefender..mctGroundAttacker] of Integer = (2, 1); 1792 1783 var 1793 Cat, i, mix, cix, uix, Loop, nModelOrder: integer;1784 Cat, I, mix, cix, uix, Loop, nModelOrder: Integer; 1794 1785 Adjacent: TVicinity8Loc; 1795 LocNeed: array[0..lxmax * lymax - 1] of shortint;1796 Destination: array[0..nUmax - 1] of integer;1797 DistrictNeed, DistrictNeed0: array[0..maxCOD - 1] of integer;1798 ModelOrder: array[0..nMmax - 1] of integer;1799 complete, Fortified: boolean;1800 1801 function IsBombarded(cix: integer): boolean;1786 LocNeed: array[0..lxmax * lymax - 1] of ShortInt; 1787 Destination: array[0..nUmax - 1] of Integer; 1788 DistrictNeed, DistrictNeed0: array[0..maxCOD - 1] of Integer; 1789 ModelOrder: array[0..nMmax - 1] of Integer; 1790 complete, Fortified: Boolean; 1791 1792 function IsBombarded(cix: Integer): Boolean; 1802 1793 var 1803 Loc1, V8: integer;1794 Loc1, V8: Integer; 1804 1795 Adjacent: TVicinity8Loc; 1805 1796 begin … … 1818 1809 begin 1819 1810 Result := True; 1820 exit;1811 Exit; 1821 1812 end; 1822 1813 end; … … 1824 1815 end; 1825 1816 1826 procedure TryUtilize(uix: integer);1817 procedure TryUtilize(uix: Integer); 1827 1818 var 1828 cix, ProdCost, UtilizeCost: integer;1819 cix, ProdCost, UtilizeCost: Integer; 1829 1820 begin 1830 1821 if (MyUnit[uix].Health = 100) and (Map[MyUnit[uix].Loc] and … … 1838 1829 UtilizeCost := MyModel[MyUnit[uix].mix].Cost; 1839 1830 if Prod < (ProdCost - UtilizeCost * 2 div 3) * 1840 BuildCostMod[G.Difficulty[ me]] div 12 then1831 BuildCostMod[G.Difficulty[Me]] div 12 then 1841 1832 Unit_Disband(uix); 1842 1833 end; … … 1844 1835 end; 1845 1836 1846 procedure FindDestination(uix: integer);1837 procedure FindDestination(uix: Integer); 1847 1838 var 1848 MoveStyle, V8, Loc1, Time, NextLoc, NextTime, RecoverTurns: integer;1849 Reached: array[0..lxmax * lymax - 1] of boolean;1850 begin 1851 fillchar(Reached, MapSize, False);1839 MoveStyle, V8, Loc1, Time, NextLoc, NextTime, RecoverTurns: Integer; 1840 Reached: array[0..lxmax * lymax - 1] of Boolean; 1841 begin 1842 FillChar(Reached, MapSize, False); 1852 1843 Pile.Create(MapSize); 1853 1844 with MyUnit[uix] do … … 1863 1854 if (District[Loc1] >= 0) and (District[Loc1] < maxCOD) then 1864 1855 begin 1865 assert(DistrictNeed[District[Loc1]] > 0);1856 Assert(DistrictNeed[District[Loc1]] > 0); 1866 1857 Dec(DistrictNeed[District[Loc1]]); 1867 1858 end; 1868 1859 Destination[uix] := Loc1; 1869 break;1860 Break; 1870 1861 end; 1871 1862 Reached[Loc1] := True; … … 1874 1865 begin 1875 1866 NextLoc := Adjacent[V8]; 1876 if (NextLoc >= 0) and not Reached[NextLoc] and (RO.Territory[NextLoc] = me) then1867 if (NextLoc >= 0) and not Reached[NextLoc] and (RO.Territory[NextLoc] = Me) then 1877 1868 case CheckStep(MoveStyle, Time, V8 and 1, NextTime, RecoverTurns, 1878 1869 Map[Loc1], Map[NextLoc], False) of … … 1882 1873 Reached[NextLoc] := True; // don't check moving there again 1883 1874 csCheckTerritory: 1884 assert(False);1875 Assert(False); 1885 1876 end; 1886 1877 end; … … 1896 1887 Unit_Disband(uix); 1897 1888 1898 fillchar(UnitLack, sizeof(UnitLack), 0);1899 fillchar(Destination, 4 * RO.nUn, $FF);1900 for i:= 0 to maxCOD - 1 do1901 if uixPatrol[ i] >= 0 then1902 Destination[uixPatrol[ i]] := PatrolDestination;1889 FillChar(UnitLack, SizeOf(UnitLack), 0); 1890 FillChar(Destination, 4 * RO.nUn, $FF); 1891 for I := 0 to maxCOD - 1 do 1892 if uixPatrol[I] >= 0 then 1893 Destination[uixPatrol[I]] := PatrolDestination; 1903 1894 for uix := 0 to RO.nUn - 1 do 1904 1895 if (MyUnit[uix].mix = mixMilitia) or (MyUnit[uix].mix = mixCruiser) then … … 1912 1903 if ModelCat[mix] = Cat then 1913 1904 begin 1914 i:= nModelOrder;1915 while ( i > 0) and (ModelQuality[mix] < ModelQuality[ModelOrder[i- 1]]) do1916 begin 1917 ModelOrder[ i] := ModelOrder[i- 1];1918 Dec( i);1919 end; 1920 ModelOrder[ i] := mix;1905 I := nModelOrder; 1906 while (I > 0) and (ModelQuality[mix] < ModelQuality[ModelOrder[I - 1]]) do 1907 begin 1908 ModelOrder[I] := ModelOrder[I - 1]; 1909 Dec(I); 1910 end; 1911 ModelOrder[I] := mix; 1921 1912 Inc(nModelOrder); 1922 1913 end; … … 1931 1922 TryUtilize(uix); 1932 1923 1933 fillchar(LocNeed, MapSize, 0);1934 fillchar(DistrictNeed, sizeof(DistrictNeed), 0);1924 FillChar(LocNeed, MapSize, 0); 1925 FillChar(DistrictNeed, SizeOf(DistrictNeed), 0); 1935 1926 1936 1927 for cix := 0 to RO.nCity - 1 do … … 1955 1946 for uix := 0 to RO.nUn - 1 do 1956 1947 with MyUnit[uix] do 1957 if (Loc >= 0) and (Job = jCity) and (RO.Territory[Loc] = me) then1948 if (Loc >= 0) and (Job = jCity) and (RO.Territory[Loc] = Me) then 1958 1949 begin 1959 1950 LocNeed[Loc] := 1; … … 1963 1954 1964 1955 complete := Loop >= FirstSurplusLoop[Cat]; 1965 for i:= nModelOrder - 1 downto 0 do1956 for I := nModelOrder - 1 downto 0 do 1966 1957 begin 1967 1958 for Fortified := True downto False do 1968 1959 for uix := 0 to RO.nUn - 1 do 1969 1960 with MyUnit[uix] do 1970 if (mix = ModelOrder[ i]) and (Loc >= 0) and1961 if (mix = ModelOrder[I]) and (Loc >= 0) and 1971 1962 (Destination[uix] < 0) and (Master < 0) and 1972 1963 ((Flags and unFortified <> 0) = Fortified) and (LocNeed[Loc] > 0) then … … 1981 1972 for uix := 0 to RO.nUn - 1 do 1982 1973 with MyUnit[uix] do 1983 if (mix = ModelOrder[ i]) and (Loc >= 0) and (Destination[uix] < 0) and1974 if (mix = ModelOrder[I]) and (Loc >= 0) and (Destination[uix] < 0) and 1984 1975 (Master < 0) then 1985 1976 if (District[Loc] >= 0) and (District[Loc] < maxCOD) and … … 1998 1989 // distribute obsolete settlers 1999 1990 repeat 2000 fillchar(LocNeed, MapSize, 0);2001 fillchar(DistrictNeed, sizeof(DistrictNeed), 0);1991 FillChar(LocNeed, MapSize, 0); 1992 FillChar(DistrictNeed, SizeOf(DistrictNeed), 0); 2002 1993 2003 1994 for cix := 0 to RO.nCity - 1 do … … 2049 2040 for uix := 0 to RO.nUn - 1 do 2050 2041 with MyUnit[uix] do 2051 if (Loc >= 0) and (RO.Territory[Loc] = me) and (District[Loc] >= 0) and2042 if (Loc >= 0) and (RO.Territory[Loc] = Me) and (District[Loc] >= 0) and 2052 2043 (District[Loc] < maxCOD) and (ModelQuality[mix] > 0) then 2053 2044 case ModelCat[mix] of … … 2055 2046 Dec(UnitLack[District[Loc], ModelCat[mix]]) 2056 2047 end; 2057 end; // MoveUnitsHome 2058 2059 2060 procedure TAI.CheckAttack(uix: integer); 2048 end; 2049 2050 procedure TAI.CheckAttack(uix: Integer); 2061 2051 var 2062 2052 AttackScore, BestCount, AttackLoc, TestLoc, NextLoc, TestTime, V8, 2063 2053 TestScore, euix, MyDamage, EnemyDamage, OldLoc, AttackForecast, 2064 MoveResult, AttackResult, MoveStyle, NextTime, RecoverTurns: integer;2065 Tile: cardinal;2066 Exhausted: boolean;2054 MoveResult, AttackResult, MoveStyle, NextTime, RecoverTurns: Integer; 2055 Tile: Cardinal; 2056 Exhausted: Boolean; 2067 2057 Adjacent: TVicinity8Loc; 2068 Reached: array[0..lxmax * lymax - 1] of boolean;2058 Reached: array[0..lxmax * lymax - 1] of Boolean; 2069 2059 2070 2060 begin … … 2075 2065 AttackScore := -999999; 2076 2066 AttackLoc := -1; 2077 fillchar(Reached, MapSize, False);2067 FillChar(Reached, MapSize, False); 2078 2068 Pile.Create(MapSize); 2079 2069 Pile.Put(Loc, $800 - Movement); … … 2087 2077 if ((Tile and fUnit) <> 0) and ((Tile and fOwned) = 0) then 2088 2078 begin // enemy unit 2089 assert(TestTime < $1000);2079 Assert(TestTime < $1000); 2090 2080 Unit_FindEnemyDefender(TestLoc, euix); 2091 2081 if RO.Treaty[RO.EnemyUn[euix].Owner] < trPeace then … … 2176 2166 until Exhausted; 2177 2167 end; 2178 end; // CheckAttack 2179 2180 2181 procedure TAI.Patrol(uix: integer); 2168 end; 2169 2170 procedure TAI.Patrol(uix: Integer); 2182 2171 const 2183 2172 DistanceScore = 4; 2184 2173 var 2185 2174 PatrolScore, BestCount, PatrolLoc, TestLoc, NextLoc, TestTime, V8, 2186 TestScore, OldLoc, MoveResult, MoveStyle, NextTime, RecoverTurns: integer;2187 Tile: cardinal;2188 Exhausted, CaptureOnly: boolean;2175 TestScore, OldLoc, MoveResult, MoveStyle, NextTime, RecoverTurns: Integer; 2176 Tile: Cardinal; 2177 Exhausted, CaptureOnly: Boolean; 2189 2178 Adjacent: TVicinity8Loc; 2190 AdjacentUnknown: array[0..lxmax * lymax - 1] of shortint;2179 AdjacentUnknown: array[0..lxmax * lymax - 1] of ShortInt; 2191 2180 2192 2181 begin … … 2207 2196 // assume a score of 50 is the best achievable 2208 2197 or CaptureOnly and (TestTime >= $1000) then 2209 break;2198 Break; 2210 2199 2211 2200 TestScore := 0; … … 2282 2271 until Exhausted; 2283 2272 end; 2284 end; // Patrol2273 end; 2285 2274 2286 2275 procedure TAI.AttackAndPatrol; 2287 2276 const 2288 2277 nAttackCatOrder = 3; 2289 AttackCatOrder: array[0..nAttackCatOrder - 1] of integer =2278 AttackCatOrder: array[0..nAttackCatOrder - 1] of Integer = 2290 2279 (mctGroundAttacker, mctCruiser, mctGroundDefender); 2291 2280 var 2292 iCat, uix, uix1: integer;2293 IsPatrolUnit, Fortified: boolean;2281 iCat, uix, uix1: Integer; 2282 IsPatrolUnit, Fortified: Boolean; 2294 2283 begin 2295 2284 for uix := 0 to RO.nUn - 1 do … … 2310 2299 CheckAttack(uix); 2311 2300 2312 fillchar(uixPatrol, sizeof(uixPatrol), $FF);2301 FillChar(uixPatrol, SizeOf(uixPatrol), $FF); 2313 2302 for uix := 0 to RO.nUn - 1 do 2314 2303 with MyUnit[uix], MyModel[mix] do … … 2342 2331 Patrol(uix); 2343 2332 end; 2344 end; // AttackAndPatrol 2345 2346 2347 function TAI.HavePort: boolean; 2333 end; 2334 2335 function TAI.HavePort: Boolean; 2348 2336 var 2349 V8, cix, AdjacentLoc, f: integer;2337 V8, cix, AdjacentLoc, F: Integer; 2350 2338 Adjacent: TVicinity8Loc; 2351 2339 begin … … 2361 2349 if (AdjacentLoc >= 0) and ((Map[AdjacentLoc] and fTerrain) < fGrass) then 2362 2350 begin 2363 f:= Formation[AdjacentLoc];2364 if ( f >= 0) and (f < maxCOD) and (OceanPresence[f] and2365 not (1 shl me) <> 0) then2351 F := Formation[AdjacentLoc]; 2352 if (F >= 0) and (F < maxCOD) and (OceanPresence[F] and 2353 not (1 shl Me) <> 0) then 2366 2354 Result := True; 2367 2355 end; … … 2369 2357 end; 2370 2358 end; 2371 2372 2359 2373 2360 procedure TAI.SetCityProduction; 2374 2361 var 2375 2362 uix, cix, iix, dtr, V8, V21, NewImprovement, AdjacentLoc, MaxSettlers, 2376 maxcount, cixMilAcademy: integer;2377 TerrType: cardinal;2363 maxcount, cixMilAcademy: Integer; 2364 TerrType: Cardinal; 2378 2365 IsPort, IsNavalBase, NeedCruiser, CheckProd, Destructed, ProduceSettlers, 2379 ProduceMil: boolean;2366 ProduceMil: Boolean; 2380 2367 Adjacent: TVicinity8Loc; 2381 2368 Radius: TVicinity21Loc; 2382 2369 Report: TCityReport; 2383 HomeCount, CityProdRep: array[0..nCmax - 1] of integer;2384 MilProdCity: array[0..nCmax - 1] of boolean;2385 2386 procedure TryBuild(Improvement: integer);2370 HomeCount, CityProdRep: array[0..nCmax - 1] of Integer; 2371 MilProdCity: array[0..nCmax - 1] of Boolean; 2372 2373 procedure TryBuild(Improvement: Integer); 2387 2374 begin 2388 2375 if (NewImprovement = imTrGoods) // not already improvement of higher priority found … … 2394 2381 end; 2395 2382 2396 procedure TryDestruct(Improvement: integer);2383 procedure TryDestruct(Improvement: Integer); 2397 2384 begin 2398 2385 if Destructed or (MyCity[cix].Built[Improvement] = 0) then 2399 exit;2386 Exit; 2400 2387 if City_CurrentImprovementProject(cix) >= 0 then 2401 2388 City_RebuildImprovement(cix, Improvement) … … 2405 2392 and (Imp[CurrentImprovementProject].Kind in [ikCommon,ikNatGlobal,ikNatLocal]) 2406 2393 and ((Imp[CurrentImprovementProject].Cost*3-Imp[Improvement].Cost*2) 2407 *BuildCostMod[G.Difficulty[ me]]>MyCity[cix].Prod*(12*3)) then}2394 *BuildCostMod[G.Difficulty[Me]]>MyCity[cix].Prod*(12*3)) then} 2408 2395 Destructed := True; 2409 2396 end; 2410 2397 2411 function ChooseBuildModel(Cat: integer): integer;2398 function ChooseBuildModel(Cat: Integer): Integer; 2412 2399 var 2413 Count, mix: integer;2400 Count, mix: Integer; 2414 2401 begin 2415 2402 Count := 0; … … 2422 2409 Result := mix; 2423 2410 end; 2424 assert(Count > 0);2411 Assert(Count > 0); 2425 2412 end; 2426 2413 … … 2428 2415 // find military production cities 2429 2416 var 2430 cix, Total, d, Threshold, NewThreshold, Share, SharePlus, cixWorst: integer;2431 begin 2432 fillchar(MilProdCity, RO.nCity, 0);2417 cix, Total, D, Threshold, NewThreshold, Share, SharePlus, cixWorst: Integer; 2418 begin 2419 FillChar(MilProdCity, RO.nCity, 0); 2433 2420 GetCityProdPotential; 2434 for d:= 0 to maxCOD - 1 do2421 for D := 0 to maxCOD - 1 do 2435 2422 begin 2436 2423 Total := 0; 2437 2424 for cix := 0 to RO.nCity - 1 do 2438 2425 with MyCity[cix] do 2439 if (Loc >= 0) and (District[Loc] = d) then2426 if (Loc >= 0) and (District[Loc] = D) then 2440 2427 Total := Total + CityResult[cix]; 2441 2428 if Total = 0 then … … 2446 2433 for cix := 0 to RO.nCity - 1 do 2447 2434 with MyCity[cix] do 2448 if (Loc >= 0) and (District[Loc] = d) and2435 if (Loc >= 0) and (District[Loc] = D) and 2449 2436 (Built[imBarracks] + Built[imMilAcademy] > 0) then 2450 2437 begin … … 2461 2448 for cix := 0 to RO.nCity - 1 do 2462 2449 with MyCity[cix] do 2463 if (Loc >= 0) and (District[Loc] = d) and2450 if (Loc >= 0) and (District[Loc] = D) and 2464 2451 (Built[imBarracks] + Built[imMilAcademy] = 0) and 2465 2452 (Built[imObservatory] = 0) and (CityResult[cix] < Threshold) and … … 2478 2465 for cix := 0 to RO.nCity - 1 do 2479 2466 with MyCity[cix] do 2480 if (Loc >= 0) and (District[Loc] = d) and2467 if (Loc >= 0) and (District[Loc] = D) and 2481 2468 (Built[imBarracks] + Built[imMilAcademy] = 0) and 2482 2469 (CityResult[cix] >= Threshold) then … … 2484 2471 { if (cixWorst>=0) 2485 2472 and (Share-CityResult[cixWorst]*2>=Total*MilProdShare div 100) then 2486 MilProdCity[cixWorst]:= false;}2473 MilProdCity[cixWorst]:=False;} 2487 2474 end; 2488 2475 … … 2491 2478 if cixStateImp[imPalace] >= 0 then 2492 2479 begin 2493 d:= District[MyCity[cixStateImp[imPalace]].Loc];2494 if ( d >= 0) and (d< maxCOD) then2480 D := District[MyCity[cixStateImp[imPalace]].Loc]; 2481 if (D >= 0) and (D < maxCOD) then 2495 2482 begin 2496 2483 cixMilAcademy := -1; 2497 2484 for cix := 0 to RO.nCity - 1 do 2498 2485 with MyCity[cix] do 2499 if (Loc >= 0) and (District[Loc] = d) and2486 if (Loc >= 0) and (District[Loc] = D) and 2500 2487 (Built[imObservatory] + Built[imPalace] = 0) and 2501 2488 ((cixMilAcademy < 0) or (CityResult[cix] > CityResult[cixMilAcademy])) then … … 2513 2500 procedure ChangeHomeCities; 2514 2501 var 2515 uix, NewHome, HomeSupport, NewHomeSupport, SingleSupport: integer;2502 uix, NewHome, HomeSupport, NewHomeSupport, SingleSupport: Integer; 2516 2503 begin 2517 2504 if RO.Government in [gAnarchy, gFundamentalism] then 2518 exit;2505 Exit; 2519 2506 for uix := 0 to RO.nUn - 1 do 2520 2507 with MyUnit[uix] do … … 2564 2551 2565 2552 begin 2566 fillchar(HomeCount, 4 * RO.nCity, 0);2553 FillChar(HomeCount, 4 * RO.nCity, 0); 2567 2554 for uix := 0 to RO.nUn - 1 do 2568 2555 with MyUnit[uix] do … … 2757 2744 begin 2758 2745 TryBuild(imHarbor); 2759 break;2746 Break; 2760 2747 end; 2761 2748 end; … … 2775 2762 TryBuild(imRecycling); 2776 2763 if (Report.Trade - Report.Corruption >= 11) and 2777 (RO.Money < TotalPopulation[ me] * 2) then2764 (RO.Money < TotalPopulation[Me] * 2) then 2778 2765 TryBuild(imBank); 2779 2766 if (RO.NatBuilt[imStockEx] = 0) and … … 2812 2799 2813 2800 // rebuild imps no longer needed 2814 if (RO.TaxRate = 0) and (RO.Money >= TotalPopulation[ me] * 4) then2801 if (RO.TaxRate = 0) and (RO.Money >= TotalPopulation[Me] * 4) then 2815 2802 TryDestruct(imBank) 2816 2803 else if Report.Happy * 2 >= Size + 6 then … … 2836 2823 2837 2824 ChangeHomeCities; 2838 end; // SetCityProduction 2839 2840 2841 function TAI.ChooseGovernment: integer; 2825 end; 2826 2827 function TAI.ChooseGovernment: Integer; 2842 2828 begin 2843 2829 if Data.BehaviorFlags and bBarbarina <> 0 then … … 2856 2842 end; 2857 2843 2858 2859 2844 //------------------------------- 2860 2845 // DIPLOMACY 2861 2846 //------------------------------- 2862 2847 2863 function TAI.MostWanted(Nation, adGiveAway: integer): integer;2848 function TAI.MostWanted(Nation, adGiveAway: Integer): Integer; 2864 2849 var 2865 ad: integer;2850 ad: Integer; 2866 2851 begin 2867 2852 Result := -1; … … 2891 2876 end; 2892 2877 2893 procedure TAI.FindBestTrade(Nation: integer; var adWanted, adGiveAway: integer);2878 procedure TAI.FindBestTrade(Nation: Integer; var adWanted, adGiveAway: Integer); 2894 2879 var 2895 i, ad, ead, adTestGiveAway: integer;2880 I, ad, ead, adTestGiveAway: Integer; 2896 2881 begin 2897 2882 adWanted := -1; … … 2903 2888 begin 2904 2889 adTestGiveAway := -1; 2905 for i:= 0 to nRequestedTechs - 1 do2906 if (Data.RequestedTechs[ i] >= 0) and2907 (Data.RequestedTechs[ i] and $FFFF = Nation shl 8 + ead) then2890 for I := 0 to nRequestedTechs - 1 do 2891 if (Data.RequestedTechs[I] >= 0) and 2892 (Data.RequestedTechs[I] and $FFFF = Nation shl 8 + ead) then 2908 2893 adTestGiveAway := -2; // already requested before 2909 2894 if adTestGiveAway = -1 then … … 2928 2913 end; 2929 2914 2930 2931 function TAI.WantNegotiation(Nation: integer; NegoTime: TNegoTime): boolean; 2915 function TAI.WantNegotiation(Nation: Integer; NegoTime: TNegoTime): Boolean; 2932 2916 var 2933 p1, Count, adWanted, adGiveAway: integer;2917 p1, Count, adWanted, adGiveAway: Integer; 2934 2918 begin 2935 2919 if Data.BehaviorFlags and bBarbarina = bBarbarina then 2936 2920 begin 2937 2921 Result := Barbarina_WantNegotiation(Nation, NegoTime); 2938 exit;2922 Exit; 2939 2923 end; 2940 2924 … … 2944 2928 begin 2945 2929 Result := False; 2946 exit;2930 Exit; 2947 2931 end; 2948 2932 Count := 0; 2949 2933 for p1 := 0 to nPl - 1 do 2950 if (p1 <> me) and (1 shl p1 and RO.Alive <> 0) and (RO.Treaty[p1] >= trPeace) then2934 if (p1 <> Me) and (1 shl p1 and RO.Alive <> 0) and (RO.Treaty[p1] >= trPeace) then 2951 2935 Inc(Count); 2952 2936 if Count >= 3 then // enough peace made 2953 2937 begin 2954 2938 Result := False; 2955 exit;2939 Exit; 2956 2940 end; 2957 2941 end; … … 2994 2978 procedure TAI.DoNegotiation; 2995 2979 var 2996 i, adWanted, adGiveAway, adToGet, Slot: integer;2997 BuildFreeOffer: boolean;2980 I, adWanted, adGiveAway, adToGet, Slot: Integer; 2981 BuildFreeOffer: Boolean; 2998 2982 begin 2999 2983 if MyLastAction = scDipOffer then … … 3026 3010 begin 3027 3011 Barbarina_DoNegotiation; 3028 exit;3012 Exit; 3029 3013 end; 3030 3014 … … 3032 3016 begin 3033 3017 Barbarina_DoCheckNegotiation; 3034 exit;3018 Exit; 3035 3019 end; 3036 3020 … … 3047 3031 (OppoOffer.nDeliver + OppoOffer.nCost = 1) and 3048 3032 (OppoOffer.Price[0] and opMask = opTreaty) and 3049 ( integer(OppoOffer.Price[0] - opTreaty) > RO.Treaty[Opponent]) and3033 (Integer(OppoOffer.Price[0] - opTreaty) > RO.Treaty[Opponent]) and 3050 3034 ((OppoOffer.Price[0] - opTreaty < trAlliance) or 3051 3035 (RO.Tech[adScience] >= tsSeen)) then 3052 3036 MyAction := scDipAccept // accept all treaties 3053 3037 else if (RO.Treaty[Opponent] >= trPeace) and (OppoOffer.nDeliver = 1) and 3054 (OppoOffer.Price[0] and $FFFF0000 = opCivilReport + cardinal(Opponent) shl 16) and3038 (OppoOffer.Price[0] and $FFFF0000 = opCivilReport + Cardinal(Opponent) shl 16) and 3055 3039 (OppoOffer.nCost = 1) and (OppoOffer.Price[1] and $FFFF0000 = 3056 opCivilReport + cardinal(me) shl 16) then3040 opCivilReport + Cardinal(Me) shl 16) then 3057 3041 MyAction := scDipAccept // accept exchange of civil reports 3058 3042 else if (OppoOffer.nDeliver = 1) and (OppoOffer.nCost = 1) and … … 3084 3068 adWanted := MostWanted(Opponent, OppoOffer.Price[1] - opTech); 3085 3069 if (OppoOffer.Price[0] and opMask = opTech) and 3086 ( cardinal(adWanted) = OppoOffer.Price[0] - opTech) then3070 (Cardinal(adWanted) = OppoOffer.Price[0] - opTech) then 3087 3071 MyAction := scDipAccept // opponent's offer is already perfect 3088 3072 else if adWanted >= 0 then … … 3140 3124 MyOffer.Price[1] := opTech + adWanted; 3141 3125 MyAction := scDipOffer; 3142 for i:= 0 to nRequestedTechs - 1 do3143 if Data.RequestedTechs[ i] < 0 then3126 for I := 0 to nRequestedTechs - 1 do 3127 if Data.RequestedTechs[I] < 0 then 3144 3128 begin 3145 Slot := i;3146 break;3129 Slot := I; 3130 Break; 3147 3131 end 3148 else if ( i = 0) or (Data.RequestedTechs[i] shr 16 <3132 else if (I = 0) or (Data.RequestedTechs[I] shr 16 < 3149 3133 Data.RequestedTechs[Slot] shr 16) then // find most outdated entry 3150 Slot := i;3134 Slot := I; 3151 3135 Data.RequestedTechs[Slot] := RO.Turn shl 16 + Opponent shl 8 + adWanted; 3152 3136 end; 3153 3137 end; 3154 3138 end; 3155 end; // Negotiation 3156 3139 end; 3157 3140 3158 3141 procedure SetLeaveOutValue; 3159 3142 3160 procedure Process(ad: integer);3143 procedure Process(ad: Integer); 3161 3144 var 3162 i: integer;3145 I: Integer; 3163 3146 begin 3164 3147 if LeaveOutValue[ad] < 0 then 3165 3148 begin 3166 3149 LeaveOutValue[ad] := 0; 3167 for i:= 0 to 1 do3168 if AdvPreq[ad, i] >= 0 then3169 begin 3170 Process(AdvPreq[ad, i]);3171 if AdvPreq[ad, i] in LeaveOutTechs then3172 Inc(LeaveOutValue[ad], LeaveOutValue[AdvPreq[ad, i]] + 1);3150 for I := 0 to 1 do 3151 if AdvPreq[ad, I] >= 0 then 3152 begin 3153 Process(AdvPreq[ad, I]); 3154 if AdvPreq[ad, I] in LeaveOutTechs then 3155 Inc(LeaveOutValue[ad], LeaveOutValue[AdvPreq[ad, I]] + 1); 3173 3156 end; 3174 3157 end; … … 3176 3159 3177 3160 var 3178 ad: integer;3161 ad: Integer; 3179 3162 begin 3180 3163 FillChar(LeaveOutValue, SizeOf(LeaveOutValue), $FF); … … 3185 3168 3186 3169 initialization 3187 RWDataSize := sizeof(TPersistentData);3170 RWDataSize := SizeOf(TPersistentData); 3188 3171 SetLeaveOutValue; 3189 3172 -
branches/highdpi/AI/StdAI/Barbarina.pas
r349 r465 25 25 type 26 26 TColonyShipPlan = array[0..nShipPart - 1] of record 27 cixProducing: integer;28 LocResource: array[0..maxModern - 1] of integer;29 nLocResource: integer;30 LocFoundCity: array[0..maxModern - 1] of integer;31 nLocFoundCity: integer;27 cixProducing: Integer; 28 LocResource: array[0..maxModern - 1] of Integer; 29 nLocResource: Integer; 30 LocFoundCity: array[0..maxModern - 1] of Integer; 31 nLocFoundCity: Integer; 32 32 end; 33 33 34 34 TBarbarina = class(TToolAI) 35 constructor Create(Nation: integer); override;35 constructor Create(Nation: Integer); override; 36 36 37 37 protected 38 38 ColonyShipPlan: TColonyShipPlan; 39 function Barbarina_GoHidden: boolean; // whether we should prepare for barbarina mode40 function Barbarina_Go: boolean; // whether we should switch to barbarina mode now39 function Barbarina_GoHidden: Boolean; // whether we should prepare for barbarina mode 40 function Barbarina_Go: Boolean; // whether we should switch to barbarina mode now 41 41 procedure Barbarina_DoTurn; 42 42 procedure Barbarina_SetCityProduction; 43 function Barbarina_ChooseResearchAdvance: integer;44 function Barbarina_WantCheckNegotiation(Nation: integer): boolean;43 function Barbarina_ChooseResearchAdvance: Integer; 44 function Barbarina_WantCheckNegotiation(Nation: Integer): Boolean; 45 45 procedure Barbarina_DoCheckNegotiation; 46 function Barbarina_WantNegotiation(Nation: integer; NegoTime: TNegoTime): boolean;46 function Barbarina_WantNegotiation(Nation: Integer; NegoTime: TNegoTime): Boolean; 47 47 procedure Barbarina_DoNegotiation; 48 48 procedure MakeColonyShipPlan; 49 49 50 50 private 51 TurnOfMapAnalysis, Neighbours: integer;52 ContinentPresence: array[0..maxCOD - 1] of integer;53 OceanPresence: array[0..maxCOD - 1] of integer;54 ContinentSize: array[0..maxCOD - 1] of integer;55 OceanSize: array[0..maxCOD - 1] of integer;56 mixBest: array[0..nModelCategory - 1] of integer;51 TurnOfMapAnalysis, Neighbours: Integer; 52 ContinentPresence: array[0..maxCOD - 1] of Integer; 53 OceanPresence: array[0..maxCOD - 1] of Integer; 54 ContinentSize: array[0..maxCOD - 1] of Integer; 55 OceanSize: array[0..maxCOD - 1] of Integer; 56 mixBest: array[0..nModelCategory - 1] of Integer; 57 57 NegoCause: (CancelTreaty); 58 function IsModelAvailable(rmix: integer): boolean;58 function IsModelAvailable(rmix: Integer): Boolean; 59 59 procedure FindBestModels; 60 60 procedure AnalyzeMap; 61 procedure RateAttack(uix: integer);62 function DoAttack(uix, AttackLoc: integer): boolean;63 function ProcessMove(uix: integer): boolean;61 procedure RateAttack(uix: Integer); 62 function DoAttack(uix, AttackLoc: Integer): Boolean; 63 function ProcessMove(uix: Integer): Boolean; 64 64 procedure AttackAndPatrol; 65 65 end; … … 73 73 type 74 74 TResearchModel = record 75 Category, Domain, Weight, adStop, FutMStrength: integer;76 Upgrades: cardinal;77 Cap: array [0..nFeature - 1] of integer;75 Category, Domain, Weight, adStop, FutMStrength: Integer; 76 Upgrades: Cardinal; 77 Cap: array [0..nFeature - 1] of Integer; 78 78 end; 79 79 … … 93 93 94 94 nResearchOrder = 40; 95 ResearchOrder: array[0..nResearchOrder - 1] of integer =95 ResearchOrder: array[0..nResearchOrder - 1] of Integer = 96 96 (adBronzeWorking, -adMapMaking, adChivalry, adMonotheism, adIronWorking, 97 97 adGunPowder, adTheology, adConstruction, adCodeOfLaws, -adEngineering, … … 171 171 172 172 var 173 Moved: array[0..numax - 1] of boolean;174 UnitPresence: array[0..lxmax * lymax - 1] of byte;173 Moved: array[0..numax - 1] of Boolean; 174 UnitPresence: array[0..lxmax * lymax - 1] of Byte; 175 175 euixMap: array[0..lxmax * lymax - 1] of smallint; 176 176 uixAttack: array[0..neumax - 1] of smallint; 177 AttackScore: array[0..neumax - 1] of integer;178 179 constructor TBarbarina.Create(Nation: integer);177 AttackScore: array[0..neumax - 1] of Integer; 178 179 constructor TBarbarina.Create(Nation: Integer); 180 180 begin 181 181 inherited; … … 184 184 185 185 // whether one of the existing models matches a specific research model 186 function TBarbarina.IsModelAvailable(rmix: integer): boolean;186 function TBarbarina.IsModelAvailable(rmix: Integer): Boolean; 187 187 var 188 i, mix, MStrength: integer;188 I, mix, MStrength: Integer; 189 189 begin 190 190 Result := False; … … 199 199 Result := MStrength < (MyModel[mix].MStrength * 3) div 2; 200 200 // for future techs: don't count model available if 50% stronger possible 201 for i:= 0 to nFeature - 1 do202 if MyModel[mix].Cap[ i] < Cap[i] then201 for I := 0 to nFeature - 1 do 202 if MyModel[mix].Cap[I] < Cap[I] then 203 203 begin 204 204 Result := False; 205 break;205 Break; 206 206 end; 207 207 if Result then 208 break;208 Break; 209 209 end; 210 210 end; 211 211 end; 212 212 213 function TBarbarina.Barbarina_GoHidden: boolean;213 function TBarbarina.Barbarina_GoHidden: Boolean; 214 214 var 215 V21, Loc1, cix: integer;215 V21, Loc1, cix: Integer; 216 216 Radius: TVicinity21Loc; 217 217 begin … … 238 238 end; 239 239 240 function TBarbarina.Barbarina_Go: boolean;240 function TBarbarina.Barbarina_Go: Boolean; 241 241 begin 242 242 if IsResearched(adMassProduction) then … … 249 249 Result := (RO.nCity >= 3) and IsResearched(adMapMaking) and 250 250 IsModelAvailable(EntryModel_Base); 251 exit;251 Exit; 252 252 end; 253 253 Result := Result and ((RO.nUn >= RO.nCity * 3) or 254 (RO.Wonder[woZeus].EffectiveOwner = me));254 (RO.Wonder[woZeus].EffectiveOwner = Me)); 255 255 end; 256 256 257 257 procedure TBarbarina.AnalyzeMap; 258 258 var 259 Loc, Loc1, V8, f1, p1, cix: integer;259 Loc, Loc1, V8, f1, p1, cix: Integer; 260 260 Adjacent: TVicinity8Loc; 261 261 begin 262 262 if TurnOfMapAnalysis = RO.Turn then 263 exit;263 Exit; 264 264 265 265 // inherited; 266 266 267 267 // collect nation presence information for continents and oceans 268 fillchar(ContinentPresence, sizeof(ContinentPresence), 0);269 fillchar(OceanPresence, sizeof(OceanPresence), 0);270 fillchar(ContinentSize, sizeof(ContinentSize), 0);271 fillchar(OceanSize, sizeof(OceanSize), 0);268 FillChar(ContinentPresence, SizeOf(ContinentPresence), 0); 269 FillChar(OceanPresence, SizeOf(OceanPresence), 0); 270 FillChar(ContinentSize, SizeOf(ContinentSize), 0); 271 FillChar(OceanSize, SizeOf(OceanSize), 0); 272 272 for Loc := 0 to MapSize - 1 do 273 273 begin … … 339 339 procedure TBarbarina.FindBestModels; 340 340 var 341 i, mix, rmix, cat: integer;341 I, mix, rmix, cat: Integer; 342 342 begin 343 for i:= 0 to nModelCategory - 1 do344 mixBest[ i] := -1;343 for I := 0 to nModelCategory - 1 do 344 mixBest[I] := -1; 345 345 for rmix := nResearchModel - 1 downto 0 do 346 346 with ResearchModel[rmix] do … … 351 351 begin 352 352 mixBest[Category] := mix; 353 for i:= 0 to nFeature - 1 do354 if MyModel[mix].Cap[ i] < Cap[i] then353 for I := 0 to nFeature - 1 do 354 if MyModel[mix].Cap[I] < Cap[I] then 355 355 begin 356 356 mixBest[Category] := -1; 357 break;357 Break; 358 358 end; 359 359 if mixBest[Category] >= 0 then 360 break;360 Break; 361 361 end; 362 362 for mix := 3 to RO.nModel - 1 do … … 387 387 begin 388 388 mixBest[ctSeaTrans] := mix; 389 break;389 Break; 390 390 end; 391 391 end; … … 406 406 407 407 // find one unit to destroy each known enemy unit, result in uixAttack 408 procedure TBarbarina.RateAttack(uix: integer);408 procedure TBarbarina.RateAttack(uix: Integer); 409 409 var 410 410 MoveStyle, TestLoc, TestTime, NextLoc, NextTime, V8, RemHealth, 411 RecoverTurns, Score, BestScore, euixBest, uixOld: integer;412 NextTile: cardinal;411 RecoverTurns, Score, BestScore, euixBest, uixOld: Integer; 412 NextTile: Cardinal; 413 413 Adjacent: TVicinity8Loc; 414 414 Defense: ^TUnitInfo; 415 Reached: array[0..lxmax * lymax - 1] of boolean;415 Reached: array[0..lxmax * lymax - 1] of Boolean; 416 416 begin 417 417 with MyUnit[uix] do … … 419 419 begin 420 420 BestScore := 0; 421 fillchar(Reached, MapSize, False);421 FillChar(Reached, MapSize, False); 422 422 MoveStyle := GetMyMoveStyle(mix, Health); 423 423 Pile.Create(MapSize); … … 494 494 end; 495 495 496 function TBarbarina.DoAttack(uix, AttackLoc: integer): boolean;496 function TBarbarina.DoAttack(uix, AttackLoc: Integer): Boolean; 497 497 // AttackLoc=maNextCity means bombard only 498 498 var 499 499 MoveResult, Kind, Temp, MoveStyle, TestLoc, TestTime, NextLoc, 500 NextTime, V8, RecoverTurns, ecix: integer;501 NextTile: cardinal;502 AttackPositionReached, IsBombardment: boolean;500 NextTime, V8, RecoverTurns, ecix: Integer; 501 NextTile: Cardinal; 502 AttackPositionReached, IsBombardment: Boolean; 503 503 Adjacent: TVicinity8Loc; 504 PreLoc: array[0..lxmax * lymax - 1] of word;505 Reached: array[0..lxmax * lymax - 1] of boolean;504 PreLoc: array[0..lxmax * lymax - 1] of Word; 505 Reached: array[0..lxmax * lymax - 1] of Boolean; 506 506 begin 507 507 Result := False; … … 516 516 else 517 517 Kind := 0; 518 fillchar(Reached, MapSize, False);518 FillChar(Reached, MapSize, False); 519 519 AttackPositionReached := False; 520 520 MoveStyle := GetMyMoveStyle(mix, Health); … … 524 524 begin 525 525 if (TestTime >= $800) or (AttackLoc = maNextCity) and (TestTime > $800 - 100) then 526 break;526 Break; 527 527 Reached[TestLoc] := True; 528 528 V8_to_Loc(TestLoc, Adjacent); … … 537 537 begin 538 538 City_FindEnemyCity(NextLoc, ecix); 539 assert(ecix >= 0);539 Assert(ecix >= 0); 540 540 with RO.EnemyCity[ecix] do 541 541 if (Size > 2) and (Flags and ciCoastalFort = 0) then … … 547 547 begin 548 548 AttackPositionReached := True; 549 break;549 Break; 550 550 end 551 551 else if not Reached[NextLoc] then … … 572 572 begin 573 573 PreLoc[NextLoc] := TestLoc; 574 break;574 Break; 575 575 end; 576 576 end; 577 577 Pile.Free; 578 578 if not AttackPositionReached then 579 exit;579 Exit; 580 580 581 581 TestLoc := AttackLoc; … … 601 601 begin 602 602 City_FindEnemyCity(AttackLoc, ecix); 603 assert(ecix >= 0);603 Assert(ecix >= 0); 604 604 while (Movement >= 100) and (RO.EnemyCity[ecix].Size > 2) do 605 605 Unit_Step(uix, AttackLoc); … … 611 611 end; 612 612 613 function TBarbarina.ProcessMove(uix: integer): boolean;613 function TBarbarina.ProcessMove(uix: Integer): Boolean; 614 614 // return true if no new enemy spotted 615 615 const … … 618 618 PatrolScore, BestCount, PatrolLoc, TestLoc, NextLoc, TestTime, V8, 619 619 TestScore, MoveResult, MoveStyle, NextTime, TerrOwner, Kind, Temp, 620 RecoverTurns, MaxScore: integer;621 Tile, NextTile: cardinal;622 CaptureOnly, PeaceBorder, done, NextToEnemyCity: boolean;620 RecoverTurns, MaxScore: Integer; 621 Tile, NextTile: Cardinal; 622 CaptureOnly, PeaceBorder, done, NextToEnemyCity: Boolean; 623 623 Adjacent: TVicinity8Loc; 624 AdjacentUnknown: array[0..lxmax * lymax - 1] of shortint;625 PreLoc: array[0..lxmax * lymax - 1] of word;626 MoreTurn: array[0..lxmax * lymax - 1] of byte;624 AdjacentUnknown: array[0..lxmax * lymax - 1] of ShortInt; 625 PreLoc: array[0..lxmax * lymax - 1] of Word; 626 MoreTurn: array[0..lxmax * lymax - 1] of Byte; 627 627 628 628 begin … … 637 637 if Map[Loc] and fCity = 0 then 638 638 Unit_MoveEx(uix, maNextCity); 639 exit;639 Exit; 640 640 end; 641 641 … … 666 666 // assume a score of $400 is the best achievable 667 667 or CaptureOnly and (TestTime >= $1000) then 668 break;668 Break; 669 669 670 670 TestScore := 0; 671 671 Tile := Map[TestLoc]; 672 assert(Tile and (fUnit or fOwned) <> fUnit);672 Assert(Tile and (fUnit or fOwned) <> fUnit); 673 673 TerrOwner := RO.Territory[TestLoc]; 674 674 AdjacentUnknown[TestLoc] := 0; … … 743 743 TestScore := $400 - 14 744 744 else if AdjacentUnknown[TestLoc] > 0 then 745 if PeaceBorder or (TerrOwner >= 0) and (TerrOwner <> me) and745 if PeaceBorder or (TerrOwner >= 0) and (TerrOwner <> Me) and 746 746 (RO.Treaty[TerrOwner] < trPeace) then 747 747 TestScore := $400 - 32 + AdjacentUnknown[TestLoc] … … 790 790 end; 791 791 if PatrolLoc = Loc then 792 exit;792 Exit; 793 793 TestLoc := PatrolLoc; 794 794 NextLoc := PreLoc[TestLoc]; … … 814 814 Result := MoveResult and rEnemySpotted = 0; 815 815 done := True; 816 break;817 end; 818 assert(Loc = NextLoc);816 Break; 817 end; 818 Assert(Loc = NextLoc); 819 819 end; 820 820 if Loc >= 0 then … … 833 833 if Result then 834 834 Moved[uix] := True; 835 end; // ProcessMove835 end; 836 836 837 837 procedure TBarbarina.AttackAndPatrol; … … 839 839 procedure SetCityDefenders; 840 840 var 841 uix, cix, V8, Loc1, Best, uixBest, det: integer;841 uix, cix, V8, Loc1, Best, uixBest, det: Integer; 842 842 Adjacent: TVicinity8Loc; 843 IsPort: boolean;843 IsPort: Boolean; 844 844 begin 845 845 for cix := 0 to RO.nCity - 1 do … … 887 887 procedure ProcessSeaTransport; 888 888 var 889 i, f, uix, Loc1, a, b: integer;890 ready, go: boolean;889 I, F, uix, Loc1, A, B: Integer; 890 ready, go: Boolean; 891 891 TransportPlan: TGroupTransportPlan; 892 892 begin 893 893 go := False; 894 for f:= 0 to maxCOD - 1 do895 if ( f < nContinent) and (ContinentPresence[f] and not896 (1 shl me or PresenceUnknown) <> 0) then894 for F := 0 to maxCOD - 1 do 895 if (F < nContinent) and (ContinentPresence[F] and not 896 (1 shl Me or PresenceUnknown) <> 0) then 897 897 go := True; // any enemy island known? 898 898 if not go then 899 exit;899 Exit; 900 900 901 901 SeaTransport_BeginInitialize; … … 907 907 (MyModel[mix].Attack > 0) and (Map[Loc] and fTerrain >= fGrass) then 908 908 begin 909 f:= Formation[Loc];910 if ( f >= 0) and (f < maxCOD) and (ContinentPresence[f] and911 not (1 shl me) = 0) then909 F := Formation[Loc]; 910 if (F >= 0) and (F < maxCOD) and (ContinentPresence[F] and 911 not (1 shl Me) = 0) then 912 912 begin 913 913 go := True; … … 932 932 if Map[Loc1] and fTerrain >= fGrass then 933 933 begin 934 f:= Formation[Loc1];935 if ( f >= 0) and (f < maxCOD) and (ContinentPresence[f] and936 not (1 shl me or PresenceUnknown) <> 0) then934 F := Formation[Loc1]; 935 if (F >= 0) and (F < maxCOD) and (ContinentPresence[F] and 936 not (1 shl Me or PresenceUnknown) <> 0) then 937 937 SeaTransport_AddDestination(Loc1); 938 938 end; … … 948 948 end; 949 949 if ready then 950 for i:= 0 to TransportPlan.nLoad - 1 do950 for I := 0 to TransportPlan.nLoad - 1 do 951 951 begin 952 952 Loc_to_ab(TransportPlan.LoadLoc, 953 MyUnit[TransportPlan.uixLoad[ i]].Loc, a, b);954 ready := ready and (abs( a) <= 1) and (abs(b) <= 1);953 MyUnit[TransportPlan.uixLoad[I]].Loc, A, B); 954 ready := ready and (abs(A) <= 1) and (abs(B) <= 1); 955 955 end; 956 956 if ready then 957 957 begin 958 for i:= 0 to TransportPlan.nLoad - 1 do959 begin 960 Unit_Step(TransportPlan.uixLoad[ i], TransportPlan.LoadLoc);961 Moved[TransportPlan.uixLoad[ i]] := True;958 for I := 0 to TransportPlan.nLoad - 1 do 959 begin 960 Unit_Step(TransportPlan.uixLoad[I], TransportPlan.LoadLoc); 961 Moved[TransportPlan.uixLoad[I]] := True; 962 962 end; 963 963 end 964 964 else 965 965 begin 966 for i:= 0 to TransportPlan.nLoad - 1 do967 begin 968 Unit_MoveEx(TransportPlan.uixLoad[ i], TransportPlan.LoadLoc, mxAdjacent);969 Moved[TransportPlan.uixLoad[ i]] := True;966 for I := 0 to TransportPlan.nLoad - 1 do 967 begin 968 Unit_MoveEx(TransportPlan.uixLoad[I], TransportPlan.LoadLoc, mxAdjacent); 969 Moved[TransportPlan.uixLoad[I]] := True; 970 970 end; 971 971 end; … … 973 973 end; 974 974 975 procedure ProcessUnload(uix: integer);976 977 procedure Unload(Kind, ToLoc: integer);975 procedure ProcessUnload(uix: Integer); 976 977 procedure Unload(Kind, ToLoc: Integer); 978 978 var 979 uix1: integer;979 uix1: Integer; 980 980 begin 981 981 for uix1 := 0 to RO.nUn - 1 do … … 987 987 Unit_Step(uix1, ToLoc); 988 988 UnitPresence[ToLoc] := UnitPresence[ToLoc] or Kind; 989 break;989 Break; 990 990 end; 991 991 end; … … 993 993 var 994 994 uix1, MoveStyle, TestLoc, TestTime, NextLoc, NextTime, V8, 995 RecoverTurns, nSlow, nFast, SlowUnloadLoc, FastUnloadLoc, EndLoc, f: integer;996 NextTile: cardinal;995 RecoverTurns, nSlow, nFast, SlowUnloadLoc, FastUnloadLoc, EndLoc, F: Integer; 996 NextTile: Cardinal; 997 997 Adjacent: TVicinity8Loc; 998 Reached: array[0..lxmax * lymax - 1] of boolean;998 Reached: array[0..lxmax * lymax - 1] of Boolean; 999 999 begin 1000 1000 // inventory … … 1017 1017 FastUnloadLoc := -1; 1018 1018 EndLoc := -1; 1019 fillchar(Reached, MapSize, False);1019 FillChar(Reached, MapSize, False); 1020 1020 Pile.Create(MapSize); 1021 1021 Pile.Put(Loc, $800 - Movement); … … 1034 1034 else if NextTile and fTerrain >= fGrass then 1035 1035 begin 1036 f:= Formation[NextLoc];1037 if ( f >= 0) and (f< maxCOD) and1038 (ContinentPresence[ f] and not (1 shl me or PresenceUnknown) <> 0) and1036 F := Formation[NextLoc]; 1037 if (F >= 0) and (F < maxCOD) and 1038 (ContinentPresence[F] and not (1 shl Me or PresenceUnknown) <> 0) and 1039 1039 (NextTile and (fUnit or fOwned) <> fUnit) then 1040 1040 begin … … 1074 1074 1075 1075 if EndLoc < 0 then 1076 exit;1076 Exit; 1077 1077 if Loc <> EndLoc then 1078 1078 Unit_MoveEx(uix, EndLoc); 1079 1079 if Loc <> EndLoc then 1080 exit;1080 Exit; 1081 1081 if SlowUnloadLoc >= 0 then 1082 1082 begin … … 1092 1092 begin 1093 1093 Moved[uix] := False; 1094 exit;1094 Exit; 1095 1095 end 1096 1096 until False; … … 1099 1099 1100 1100 var 1101 uix, euix, Kind, euixBest, AttackLoc: integer;1102 OldTile: cardinal;1103 BackToStart, FirstLoop: boolean;1101 uix, euix, Kind, euixBest, AttackLoc: Integer; 1102 OldTile: Cardinal; 1103 BackToStart, FirstLoop: Boolean; 1104 1104 begin 1105 fillchar(UnitPresence, MapSize, 0);1105 FillChar(UnitPresence, MapSize, 0); 1106 1106 for uix := 0 to RO.nUn - 1 do 1107 1107 with MyUnit[uix] do … … 1116 1116 end; 1117 1117 1118 fillchar(Moved, RO.nUn, False);1118 FillChar(Moved, RO.nUn, False); 1119 1119 for uix := 0 to RO.nUn - 1 do 1120 1120 if (MyUnit[uix].Master >= 0) or (MyUnit[uix].TroopLoad > 0) then … … 1128 1128 if RO.nEnemyUn > 0 then 1129 1129 begin 1130 fillchar(euixMap, MapSize * 2, $FF);1131 fillchar(AttackScore, RO.nEnemyUn * 4, 0);1130 FillChar(euixMap, MapSize * 2, $FF); 1131 FillChar(AttackScore, RO.nEnemyUn * 4, 0); 1132 1132 for euix := 0 to RO.nEnemyUn - 1 do 1133 1133 with RO.EnemyUn[euix] do … … 1140 1140 end; 1141 1141 if not BackToStart then 1142 break;1142 Break; 1143 1143 1144 1144 for uix := 0 to RO.nUn - 1 do … … 1155 1155 euixBest := euix; 1156 1156 if euixBest < 0 then 1157 break;1157 Break; 1158 1158 uix := uixAttack[euixBest]; 1159 1159 AttackLoc := RO.EnemyUn[euixBest].Loc; … … 1202 1202 begin 1203 1203 BackToStart := True; 1204 break;1204 Break; 1205 1205 end 1206 1206 until not BackToStart; 1207 end; // AttackAndPatrol1207 end; 1208 1208 1209 1209 procedure TBarbarina.Barbarina_SetCityProduction; … … 1214 1214 1 shl woMagellan + 1 shl woEiffel + 1 shl woLiberty + 1 shl woShinkansen; 1215 1215 1216 function LowPriority(cix: integer): boolean;1216 function LowPriority(cix: Integer): Boolean; 1217 1217 var 1218 part, cixHighPriority, TestDistance: integer;1218 part, cixHighPriority, TestDistance: Integer; 1219 1219 begin 1220 1220 Result := False; … … 1228 1228 begin 1229 1229 Result := True; 1230 exit;1230 Exit; 1231 1231 end; 1232 1232 end; … … 1234 1234 end; 1235 1235 1236 function ChooseWonderToBuild(WonderAvailable: integer; AllowCoastal: boolean): integer;1236 function ChooseWonderToBuild(WonderAvailable: Integer; AllowCoastal: Boolean): Integer; 1237 1237 var 1238 Count, iix: integer;1238 Count, iix: Integer; 1239 1239 begin 1240 1240 if (WonderAvailable and PrimeWonder > 0) and (AllowCoastal or … … 1267 1267 begin 1268 1268 Result := iix; 1269 exit;1269 Exit; 1270 1270 end; 1271 1271 end; … … 1273 1273 1274 1274 var 1275 i, iix, cix, mix, uix, mixProduce, mixShip, V8, V21, Loc1, TotalPop,1276 AlonePop, f, f1, nTownGuard, ShipPart, ProduceShipPart, TestDistance,1277 part, WonderAvailable, WonderInWork, cixNewCapital, Center, Score, BestScore: integer;1278 mixCount: array[0..nmmax - 1] of integer;1275 I, iix, cix, mix, uix, mixProduce, mixShip, V8, V21, Loc1, TotalPop, 1276 AlonePop, F, f1, nTownGuard, ShipPart, ProduceShipPart, TestDistance, 1277 part, WonderAvailable, WonderInWork, cixNewCapital, Center, Score, BestScore: Integer; 1278 mixCount: array[0..nmmax - 1] of Integer; 1279 1279 //RareLoc: array[0..5] of integer; 1280 1280 Adjacent: TVicinity8Loc; 1281 1281 IsCoastal, IsPort, IsUnitProjectObsolete, HasSettler, SpezializeShipProduction, 1282 1282 AlgaeAvailable, ProjectComplete, DoLowPriority, WillProduceColonyShip, 1283 ImportantCity: boolean;1283 ImportantCity: Boolean; 1284 1284 Radius: TVicinity21Loc; 1285 1285 Report: TCityReportNew; … … 1289 1289 FindBestModels; 1290 1290 1291 fillchar(mixCount, RO.nModel * 4, 0);1291 FillChar(mixCount, RO.nModel * 4, 0); 1292 1292 for uix := 0 to RO.nUn - 1 do 1293 1293 with MyUnit[uix] do … … 1317 1317 begin 1318 1318 Inc(TotalPop, Size); 1319 f:= Formation[Loc];1320 if ( f < 0) or (f >= maxCOD) or (ContinentPresence[f] = 1 shl me) then1319 F := Formation[Loc]; 1320 if (F < 0) or (F >= maxCOD) or (ContinentPresence[F] = 1 shl Me) then 1321 1321 Inc(AlonePop, Size); 1322 1322 end; … … 1358 1358 if (f1 >= 0) and (f1 < maxCOD) and 1359 1359 ((OceanSize[f1] >= 8) or (OceanPresence[f1] and not 1360 (1 shl me) <> 0)) then1360 (1 shl Me) <> 0)) then 1361 1361 begin // prefer non-coastal cities 1362 1362 Dec(Score, 18); 1363 break;1363 Break; 1364 1364 end; 1365 1365 end; … … 1390 1390 (LowPriority(cix) = DoLowPriority) then 1391 1391 begin 1392 f:= Formation[Loc];1392 F := Formation[Loc]; 1393 1393 IsCoastal := False; 1394 1394 IsPort := False; … … 1402 1402 f1 := Formation[Loc1]; 1403 1403 if (f1 >= 0) and (f1 < maxCOD) and (OceanSize[f1] >= 8) and 1404 (OceanPresence[f1] and not (1 shl me) <> 0) then1404 (OceanPresence[f1] and not (1 shl Me) <> 0) then 1405 1405 begin 1406 1406 IsPort := True; 1407 break;1407 Break; 1408 1408 end; 1409 1409 end; … … 1412 1412 (RO.Model[City_CurrentUnitProject(cix)].Kind <> mkSettler) then 1413 1413 begin 1414 i:= nModelCategory - 1;1415 while ( i >= 0) and (City_CurrentUnitProject(cix) <> mixBest[i]) do1416 Dec( i);1417 IsUnitProjectObsolete := i< 0;1414 I := nModelCategory - 1; 1415 while (I >= 0) and (City_CurrentUnitProject(cix) <> mixBest[I]) do 1416 Dec(I); 1417 IsUnitProjectObsolete := I < 0; 1418 1418 end 1419 1419 else … … 1581 1581 City_StartImprovement(cix,imMissileBat)} 1582 1582 else if IsPort and (not SpezializeShipProduction or 1583 ( f < 0) or (f >= maxCOD) or (ContinentPresence[f] = 1 shl me)) and1583 (F < 0) or (F >= maxCOD) or (ContinentPresence[F] = 1 shl Me)) and 1584 1584 (Built[imDockyard] = 0) and City_Improvable(cix, imDockyard) then 1585 1585 City_StartImprovement(cix, imDockyard) 1586 1586 else if IsPort and (mixShip >= 0) and 1587 (not SpezializeShipProduction or ( f< 0) or1588 ( f >= maxCOD) or (ContinentPresence[f] = 1 shl me)) then1587 (not SpezializeShipProduction or (F < 0) or 1588 (F >= maxCOD) or (ContinentPresence[F] = 1 shl Me)) then 1589 1589 City_StartUnitProduction(cix, mixShip) 1590 1590 else if (Built[imBarracks] + Built[imMilAcademy] = 0) and … … 1600 1600 if (City_CurrentImprovementProject(cix) = imCourt) and 1601 1601 (Built[imTownHall] > 0) and (prod >= imp[imCourt].cost * 1602 BuildCostMod[G.Difficulty[ me]] div 12 -1603 (imp[imTownHall].cost * BuildCostMod[G.Difficulty[ me]] div 12) *1602 BuildCostMod[G.Difficulty[Me]] div 12 - 1603 (imp[imTownHall].cost * BuildCostMod[G.Difficulty[Me]] div 12) * 1604 1604 2 div 3) then 1605 1605 City_RebuildImprovement(cix, imTownHall) … … 1614 1614 if City_RebuildImprovement(cix, iix) < rExecuted then 1615 1615 City_SellImprovement(cix, iix); 1616 break;1616 Break; 1617 1617 end; 1618 1618 end; 1619 1619 end; 1620 1620 1621 function TBarbarina.Barbarina_ChooseResearchAdvance: integer;1621 function TBarbarina.Barbarina_ChooseResearchAdvance: Integer; 1622 1622 var 1623 nPreq, rmix, rmixChosen, i, MaxWeight, MaxDefense, ChosenPreq: integer;1624 NeedSeaUnits, ready: boolean;1623 nPreq, rmix, rmixChosen, I, MaxWeight, MaxDefense, ChosenPreq: Integer; 1624 NeedSeaUnits, ready: Boolean; 1625 1625 ModelExists: set of 0..nModelCategory - 1; 1626 known: array[0..nAdv - 1] of integer;1627 1628 procedure ChoosePreq(ad: integer);1626 known: array[0..nAdv - 1] of Integer; 1627 1628 procedure ChoosePreq(ad: Integer); 1629 1629 var 1630 i: integer;1631 PreqOk: boolean;1630 I: Integer; 1631 PreqOk: Boolean; 1632 1632 begin 1633 assert(RO.Tech[ad] < tsApplicable);1633 Assert(RO.Tech[ad] < tsApplicable); 1634 1634 if known[ad] = 0 then 1635 1635 begin … … 1637 1637 PreqOk := True; 1638 1638 if not (ad in [adScience, adMassProduction]) and (RO.Tech[ad] < tsSeen) then 1639 for i:= 0 to 1 do1640 if (AdvPreq[ad, i] >= 0) and (RO.Tech[AdvPreq[ad, i]] < tsApplicable) then1639 for I := 0 to 1 do 1640 if (AdvPreq[ad, I] >= 0) and (RO.Tech[AdvPreq[ad, I]] < tsApplicable) then 1641 1641 begin 1642 1642 PreqOk := False; 1643 ChoosePreq(AdvPreq[ad, i]);1643 ChoosePreq(AdvPreq[ad, I]); 1644 1644 end; 1645 1645 if PreqOk then … … 1697 1697 ready := (MaxWeight >= Weight) and (MaxDefense >= Cap[mcDefense]); 1698 1698 if ready then 1699 for i:= 0 to nFeature - 1 do1700 if (Cap[ i] > 0) and (Feature[i].Preq <> preNone) and1701 ((Feature[ i].Preq < 0) or not IsResearched(Feature[i].Preq)) then1699 for I := 0 to nFeature - 1 do 1700 if (Cap[I] > 0) and (Feature[I].Preq <> preNone) and 1701 ((Feature[I].Preq < 0) or not IsResearched(Feature[I].Preq)) then 1702 1702 ready := False; 1703 1703 if ready then 1704 1704 begin 1705 for i:= 0 to nUpgrade - 1 do1706 if (Upgrades and (1 shl i) <> 0) and not1707 IsResearched(Upgrade[Domain, i].Preq) then1705 for I := 0 to nUpgrade - 1 do 1706 if (Upgrades and (1 shl I) <> 0) and not 1707 IsResearched(Upgrade[Domain, I].Preq) then 1708 1708 ready := False; 1709 1709 end; 1710 1710 if ready then 1711 1711 begin 1712 include(ModelExists, Category);1712 Include(ModelExists, Category); 1713 1713 if not IsModelAvailable(rmix) then 1714 1714 rmixChosen := rmix; … … 1719 1719 begin 1720 1720 PrepareNewModel(Domain); 1721 for i:= 0 to nFeature - 1 do1722 if ( i < 2) or (Cap[i] > 0) then1723 SetNewModelFeature( i, Cap[i]);1724 if RO.Wonder[woSun].EffectiveOwner = me then1721 for I := 0 to nFeature - 1 do 1722 if (I < 2) or (Cap[I] > 0) then 1723 SetNewModelFeature(I, Cap[I]); 1724 if RO.Wonder[woSun].EffectiveOwner = Me then 1725 1725 begin 1726 1726 //if Cap[mcWeapons]>=2*Cap[mcArmor] then … … 1730 1730 end; 1731 1731 Result := adMilitary; 1732 exit;1732 Exit; 1733 1733 end; 1734 1734 1735 1735 NeedSeaUnits := True; 1736 i:= 0;1737 while ( i < nResearchOrder) and (not NeedSeaUnits and (ResearchOrder[i] < 0) or1738 IsResearched(abs(ResearchOrder[ i]))) do1739 Inc( i);1740 if i>= nResearchOrder then // list done, continue with future tech1736 I := 0; 1737 while (I < nResearchOrder) and (not NeedSeaUnits and (ResearchOrder[I] < 0) or 1738 IsResearched(abs(ResearchOrder[I]))) do 1739 Inc(I); 1740 if I >= nResearchOrder then // list done, continue with future tech 1741 1741 begin 1742 1742 if random(2) = 1 then … … 1750 1750 nPreq := 0; 1751 1751 ChosenPreq := -1; 1752 ChoosePreq(abs(ResearchOrder[ i]));1753 assert(nPreq > 0);1752 ChoosePreq(abs(ResearchOrder[I])); 1753 Assert(nPreq > 0); 1754 1754 Result := ChosenPreq; 1755 1755 end; 1756 1756 end; 1757 1757 1758 function TBarbarina.Barbarina_WantCheckNegotiation(Nation: integer): boolean;1758 function TBarbarina.Barbarina_WantCheckNegotiation(Nation: Integer): Boolean; 1759 1759 begin 1760 1760 if (RO.Tech[adTheRepublic] < tsSeen) and (RO.Tech[adTheology] >= tsApplicable) and … … 1769 1769 begin 1770 1770 if RO.Tech[adTheRepublic] >= tsSeen then 1771 exit; // default reaction1771 Exit; // default reaction 1772 1772 if MyLastAction = scContact then 1773 1773 begin … … 1797 1797 end; 1798 1798 1799 function TBarbarina.Barbarina_WantNegotiation(Nation: integer;1800 NegoTime: TNegoTime): boolean;1799 function TBarbarina.Barbarina_WantNegotiation(Nation: Integer; 1800 NegoTime: TNegoTime): Boolean; 1801 1801 var 1802 uix, TestLoc, V8: integer;1802 uix, TestLoc, V8: Integer; 1803 1803 Adjacent: TVicinity8Loc; 1804 1804 begin … … 1812 1812 if RO.Turn >= RO.LastCancelTreaty[Nation] + CancelTreatyTurns then 1813 1813 begin 1814 if (RO.Turn and 3 = (Nation + $F - me) and 3) and1814 if (RO.Turn and 3 = (Nation + $F - Me) and 3) and 1815 1815 (RO.Treaty[Nation] > trPeace) then 1816 1816 begin … … 1838 1838 NegoCause := CancelTreaty; 1839 1839 Result := True; 1840 exit;1840 Exit; 1841 1841 end; 1842 1842 end; … … 1858 1858 procedure TBarbarina.MakeColonyShipPlan; 1859 1859 var 1860 i, V21, V21C, CityLoc, Loc1, part, cix, BestValue, TestValue, FoodCount,1861 ProdCount, ProdExtra, Score, BestScore: integer;1862 Tile: cardinal;1863 ok, check: boolean;1860 I, V21, V21C, CityLoc, Loc1, part, cix, BestValue, TestValue, FoodCount, 1861 ProdCount, ProdExtra, Score, BestScore: Integer; 1862 Tile: Cardinal; 1863 ok, check: Boolean; 1864 1864 Radius, RadiusC: TVicinity21Loc; 1865 1865 begin … … 1887 1887 begin 1888 1888 part := (Tile and fModern) shr 25 - 1; 1889 if RO.Ship[ me].Parts[part] < ShipNeed[part] then1889 if RO.Ship[Me].Parts[part] < ShipNeed[part] then 1890 1890 // not enough of this kind already 1891 1891 begin … … 1893 1893 if ColonyShipPlan[part].cixProducing >= 0 then 1894 1894 begin // another city is already assigned to this ship part, choose one of the two 1895 TestValue := (ID and $FFF) shl 4 + ((ID shr 12) + 15 - me) and $F;1895 TestValue := (ID and $FFF) shl 4 + ((ID shr 12) + 15 - Me) and $F; 1896 1896 BestValue := 1897 1897 (MyCity[ColonyShipPlan[part].cixProducing].ID and $FFF) shl 1898 1898 4 + ((MyCity[ColonyShipPlan[part].cixProducing].ID shr 12) + 1899 15 - me) and $F;1899 15 - Me) and $F; 1900 1900 if TestValue <= BestValue then 1901 1901 ok := False; … … 1912 1912 check := False; 1913 1913 for part := 0 to nShipPart - 1 do 1914 if (RO.Ship[ me].Parts[part] < ShipNeed[part]) // not enough of this kind already1914 if (RO.Ship[Me].Parts[part] < ShipNeed[part]) // not enough of this kind already 1915 1915 and (ColonyShipPlan[part].cixProducing < 0) then // no city to produce 1916 1916 check := True; … … 1931 1931 end; 1932 1932 for part := 0 to nShipPart - 1 do 1933 if (RO.Ship[ me].Parts[part] < ShipNeed[part]) // not enough of this kind already1933 if (RO.Ship[Me].Parts[part] < ShipNeed[part]) // not enough of this kind already 1934 1934 and (ColonyShipPlan[part].cixProducing < 0) // no city to produce 1935 1935 and (ColonyShipPlan[part].nLocResource > 0) then // resource is known 1936 1936 begin 1937 for i:= 0 to ColonyShipPlan[part].nLocResource - 1 do1937 for I := 0 to ColonyShipPlan[part].nLocResource - 1 do 1938 1938 begin 1939 1939 BestScore := 0; 1940 V21_to_Loc(ColonyShipPlan[part].LocResource[ i], Radius);1940 V21_to_Loc(ColonyShipPlan[part].LocResource[I], Radius); 1941 1941 for V21 := 1 to 26 do 1942 1942 begin // check all potential cities in range … … 1984 1984 Dec(ProdCount, 5 - FoodCount); 1985 1985 Score := ProdCount * 4 + ProdExtra * 8 + FoodCount; 1986 Score := Score shl 8 + ((CityLoc xor me) * 4567) mod 251;1986 Score := Score shl 8 + ((CityLoc xor Me) * 4567) mod 251; 1987 1987 // some unexactness, random but always the same for this tile 1988 1988 end; -
branches/highdpi/AI/StdAI/CustomAI.pas
r303 r465 13 13 TCustomAI = class 14 14 public 15 procedure Process(Command: integer; var Data);15 procedure Process(Command: Integer; var Data); 16 16 17 17 // overridables 18 constructor Create(Nation: integer); virtual;18 constructor Create(Nation: Integer); virtual; 19 19 destructor Destroy; override; 20 20 procedure SetDataDefaults; virtual; 21 21 procedure SetDataRandom; virtual; 22 22 procedure OnBeforeEnemyAttack(UnitInfo: TUnitInfo; 23 ToLoc, EndHealth, EndHealthDef: integer); virtual;24 procedure OnBeforeEnemyCapture(UnitInfo: TUnitInfo; ToLoc: integer); virtual;23 ToLoc, EndHealth, EndHealthDef: Integer); virtual; 24 procedure OnBeforeEnemyCapture(UnitInfo: TUnitInfo; ToLoc: Integer); virtual; 25 25 procedure OnAfterEnemyAttack; virtual; 26 26 procedure OnAfterEnemyCapture; virtual; 27 27 28 28 protected 29 me: integer; // index of the controlled nation29 Me: Integer; // index of the controlled nation 30 30 RO: ^TPlayerContext; 31 31 Map: ^TTileList; … … 34 34 MyModel: ^TModelList; 35 35 36 cixStateImp: array[imPalace..imSpacePort] of integer;36 cixStateImp: array[imPalace..imSpacePort] of Integer; 37 37 38 38 // negotiation 39 Opponent: integer; // nation i'm in negotiation with, -1 indicates no-negotiation mode40 MyAction, MyLastAction, OppoAction: integer;39 Opponent: Integer; // nation i'm in negotiation with, -1 indicates no-negotiation mode 40 MyAction, MyLastAction, OppoAction: Integer; 41 41 MyOffer, MyLastOffer, OppoOffer: TOffer; 42 42 … … 44 44 procedure DoTurn; virtual; 45 45 procedure DoNegotiation; virtual; 46 function ChooseResearchAdvance: integer; virtual;47 function ChooseStealAdvance: integer; virtual;48 function ChooseGovernment: integer; virtual;49 function WantNegotiation(Nation: integer; NegoTime: TNegoTime): boolean; virtual;50 function OnNegoRejected_CancelTreaty: boolean; virtual;46 function ChooseResearchAdvance: Integer; virtual; 47 function ChooseStealAdvance: Integer; virtual; 48 function ChooseGovernment: Integer; virtual; 49 function WantNegotiation(Nation: Integer; NegoTime: TNegoTime): Boolean; virtual; 50 function OnNegoRejected_CancelTreaty: Boolean; virtual; 51 51 52 52 // general functions 53 function IsResearched(Advance: integer): boolean;54 function ResearchCost: integer;55 function ChangeAttitude(Nation, Attitude: integer): integer;56 function Revolution: integer;57 function ChangeRates(Tax, Lux: integer): integer;58 function PrepareNewModel(Domain: integer): integer;59 function SetNewModelFeature(F, Count: integer): integer;60 function AdvanceResearchable(Advance: integer): boolean;61 function AdvanceStealable(Advance: integer): boolean;62 function GetJobProgress(Loc: integer; var JobProgress: TJobProgressData): boolean;63 function DebugMessage(Level: integer; Text: string): boolean;64 function SetDebugMap(var DebugMap): boolean;53 function IsResearched(Advance: Integer): Boolean; 54 function ResearchCost: Integer; 55 function ChangeAttitude(Nation, Attitude: Integer): Integer; 56 function Revolution: Integer; 57 function ChangeRates(Tax, Lux: Integer): Integer; 58 function PrepareNewModel(Domain: Integer): Integer; 59 function SetNewModelFeature(F, Count: Integer): Integer; 60 function AdvanceResearchable(Advance: Integer): Boolean; 61 function AdvanceStealable(Advance: Integer): Boolean; 62 function GetJobProgress(Loc: Integer; var JobProgress: TJobProgressData): Boolean; 63 function DebugMessage(Level: Integer; Text: string): Boolean; 64 function SetDebugMap(var DebugMap): Boolean; 65 65 66 66 // unit functions 67 procedure Unit_FindMyDefender(Loc: integer; var uix: integer);68 procedure Unit_FindEnemyDefender(Loc: integer; var euix: integer);69 function Unit_Move(uix, ToLoc: integer): integer;70 function Unit_Step(uix, ToLoc: integer): integer;71 function Unit_Attack(uix, ToLoc: integer): integer;72 function Unit_DoMission(uix, MissionType, ToLoc: integer): integer;73 function Unit_MoveForecast(uix, ToLoc: integer;74 var RemainingMovement: integer): boolean;75 function Unit_AttackForecast(uix, ToLoc, AttackMovement: integer;76 var RemainingHealth: integer): boolean;77 function Unit_DefenseForecast(euix, ToLoc: integer;78 var RemainingHealth: integer): boolean;79 function Unit_Disband(uix: integer): integer;80 function Unit_StartJob(uix, NewJob: integer): integer;81 function Unit_SetHomeHere(uix: integer): integer;82 function Unit_Load(uix: integer): integer;83 function Unit_Unload(uix: integer): integer;84 function Unit_SelectTransport(uix: integer): integer;85 function Unit_AddToCity(uix: integer): integer;67 procedure Unit_FindMyDefender(Loc: Integer; var uix: Integer); 68 procedure Unit_FindEnemyDefender(Loc: Integer; var euix: Integer); 69 function Unit_Move(uix, ToLoc: Integer): Integer; 70 function Unit_Step(uix, ToLoc: Integer): Integer; 71 function Unit_Attack(uix, ToLoc: Integer): Integer; 72 function Unit_DoMission(uix, MissionType, ToLoc: Integer): Integer; 73 function Unit_MoveForecast(uix, ToLoc: Integer; 74 var RemainingMovement: Integer): Boolean; 75 function Unit_AttackForecast(uix, ToLoc, AttackMovement: Integer; 76 var RemainingHealth: Integer): Boolean; 77 function Unit_DefenseForecast(euix, ToLoc: Integer; 78 var RemainingHealth: Integer): Boolean; 79 function Unit_Disband(uix: Integer): Integer; 80 function Unit_StartJob(uix, NewJob: Integer): Integer; 81 function Unit_SetHomeHere(uix: Integer): Integer; 82 function Unit_Load(uix: Integer): Integer; 83 function Unit_Unload(uix: Integer): Integer; 84 function Unit_SelectTransport(uix: Integer): Integer; 85 function Unit_AddToCity(uix: Integer): Integer; 86 86 87 87 // city functions 88 procedure City_FindMyCity(Loc: integer; var cix: integer);89 procedure City_FindEnemyCity(Loc: integer; var ecix: integer);90 function City_HasProject(cix: integer): boolean;91 function City_CurrentImprovementProject(cix: integer): integer;92 function City_CurrentUnitProject(cix: integer): integer;93 function City_GetTileInfo(cix, TileLoc: integer; var TileInfo: TTileInfo): integer;94 function City_GetReport(cix: integer; var Report: TCityReport): integer;95 function City_GetHypoReport(cix, HypoTiles, HypoTax, HypoLux: integer;96 var Report: TCityReport): integer;97 function City_GetReportNew(cix: integer; var Report: TCityReportNew): integer;98 function City_GetHypoReportNew(cix, HypoTiles, HypoTaxRate, HypoLuxuryRate: integer;99 var Report: TCityReportNew): integer;100 function City_GetAreaInfo(cix: integer; var AreaInfo: TCityAreaInfo): integer;101 function City_StartUnitProduction(cix, mix: integer): integer;102 function City_StartEmigration(cix, mix: integer;103 AllowDisbandCity, AsConscripts: boolean): integer;104 function City_StartImprovement(cix, iix: integer): integer;105 function City_Improvable(cix, iix: integer): boolean;106 function City_StopProduction(cix: integer): integer;107 function City_BuyProject(cix: integer): integer;108 function City_SellImprovement(cix, iix: integer): integer;109 function City_RebuildImprovement(cix, iix: integer): integer;110 function City_SetTiles(cix, NewTiles: integer): integer;111 procedure City_OptimizeTiles(cix: integer; ResourceWeights: cardinal = rwMaxGrowth);88 procedure City_FindMyCity(Loc: Integer; var cix: Integer); 89 procedure City_FindEnemyCity(Loc: Integer; var ecix: Integer); 90 function City_HasProject(cix: Integer): Boolean; 91 function City_CurrentImprovementProject(cix: Integer): Integer; 92 function City_CurrentUnitProject(cix: Integer): Integer; 93 function City_GetTileInfo(cix, TileLoc: Integer; var TileInfo: TTileInfo): Integer; 94 function City_GetReport(cix: Integer; var Report: TCityReport): Integer; 95 function City_GetHypoReport(cix, HypoTiles, HypoTax, HypoLux: Integer; 96 var Report: TCityReport): Integer; 97 function City_GetReportNew(cix: Integer; var Report: TCityReportNew): Integer; 98 function City_GetHypoReportNew(cix, HypoTiles, HypoTaxRate, HypoLuxuryRate: Integer; 99 var Report: TCityReportNew): Integer; 100 function City_GetAreaInfo(cix: Integer; var AreaInfo: TCityAreaInfo): Integer; 101 function City_StartUnitProduction(cix, mix: Integer): Integer; 102 function City_StartEmigration(cix, mix: Integer; 103 AllowDisbandCity, AsConscripts: Boolean): Integer; 104 function City_StartImprovement(cix, iix: Integer): Integer; 105 function City_Improvable(cix, iix: Integer): Boolean; 106 function City_StopProduction(cix: Integer): Integer; 107 function City_BuyProject(cix: Integer): Integer; 108 function City_SellImprovement(cix, iix: Integer): Integer; 109 function City_RebuildImprovement(cix, iix: Integer): Integer; 110 function City_SetTiles(cix, NewTiles: Integer): Integer; 111 procedure City_OptimizeTiles(cix: Integer; ResourceWeights: Cardinal = rwMaxGrowth); 112 112 113 113 // negotiation 114 function Nego_CheckMyAction: integer;114 function Nego_CheckMyAction: Integer; 115 115 116 116 private 117 HaveTurned: boolean;117 HaveTurned: Boolean; 118 118 UnwantedNego: set of 0..nPl - 1; 119 119 Contacted: set of 0..nPl - 1; … … 125 125 Server: TServerCall; 126 126 G: TNewGameData; 127 RWDataSize, MapSize: integer;128 decompose24: cardinal;129 nodata: pointer;127 RWDataSize, MapSize: Integer; 128 decompose24: Cardinal; 129 nodata: Pointer; 130 130 131 131 const … … 139 139 140 140 type 141 TVicinity8Loc = array[0..7] of integer;142 TVicinity21Loc = array[0..27] of integer;141 TVicinity8Loc = array[0..7] of Integer; 142 TVicinity21Loc = array[0..27] of Integer; 143 143 144 144 145 145 procedure Init(NewGameData: TNewGameData); 146 146 147 procedure ab_to_Loc(Loc0, a, b: integer; var Loc: integer);148 procedure Loc_to_ab(Loc0, Loc: integer; var a, b: integer);149 procedure ab_to_V8( a, b: integer; var V8: integer);150 procedure V8_to_ab(V8: integer; var a, b: integer);151 procedure ab_to_V21( a, b: integer; var V21: integer);152 procedure V21_to_ab(V21: integer; var a, b: integer);153 procedure V8_to_Loc(Loc0: integer; var VicinityLoc: TVicinity8Loc);154 procedure V21_to_Loc(Loc0: integer; var VicinityLoc: TVicinity21Loc);155 function Distance(Loc0, Loc1: integer): integer;147 procedure ab_to_Loc(Loc0, A, B: Integer; var Loc: Integer); 148 procedure Loc_to_ab(Loc0, Loc: Integer; var A, B: Integer); 149 procedure ab_to_V8(A, B: Integer; var V8: Integer); 150 procedure V8_to_ab(V8: Integer; var A, B: Integer); 151 procedure ab_to_V21(A, B: Integer; var V21: Integer); 152 procedure V21_to_ab(V21: Integer; var A, B: Integer); 153 procedure V8_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity8Loc); 154 procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc); 155 function Distance(Loc0, Loc1: Integer): Integer; 156 156 157 157 … … 159 159 160 160 const 161 ab_v8: array[-4..4] of integer = (5, 6, 7, 4, -1, 0, 3, 2, 1);162 v8_a: array[0..7] of integer = (1, 1, 0, -1, -1, -1, 0, 1);163 v8_b: array[0..7] of integer = (0, 1, 1, 1, 0, -1, -1, -1);164 165 166 procedure ab_to_Loc(Loc0, a, b: integer; var Loc: integer);161 ab_v8: array[-4..4] of Integer = (5, 6, 7, 4, -1, 0, 3, 2, 1); 162 v8_a: array[0..7] of Integer = (1, 1, 0, -1, -1, -1, 0, 1); 163 v8_b: array[0..7] of Integer = (0, 1, 1, 1, 0, -1, -1, -1); 164 165 166 procedure ab_to_Loc(Loc0, A, B: Integer; var Loc: Integer); 167 167 {relative location from Loc0} 168 168 var 169 y0: integer;170 begin 171 assert((Loc0 >= 0) and (Loc0 < MapSize) and (a - b+ G.lx >= 0));172 y0 := cardinal(Loc0) * decompose24 shr 24;173 Loc := (Loc0 + ( a - b + y0 and 1 + G.lx + G.lx) shr 1) mod G.lx + G.lx * (y0 + a + b);169 y0: Integer; 170 begin 171 Assert((Loc0 >= 0) and (Loc0 < MapSize) and (A - B + G.lx >= 0)); 172 y0 := Cardinal(Loc0) * decompose24 shr 24; 173 Loc := (Loc0 + (A - B + y0 and 1 + G.lx + G.lx) shr 1) mod G.lx + G.lx * (y0 + A + B); 174 174 if Loc >= MapSize then 175 175 Loc := -$1000; 176 176 end; 177 177 178 procedure Loc_to_ab(Loc0, Loc: integer; var a, b: integer);178 procedure Loc_to_ab(Loc0, Loc: Integer; var A, B: Integer); 179 179 {$IFDEF FPC}// freepascal 180 180 var 181 dx, dy: integer;181 dx, dy: Integer; 182 182 begin 183 183 dx := ((Loc mod G.lx * 2 + Loc div G.lx and 1) - (Loc0 mod G.lx * 2 + Loc0 div 184 184 G.lx and 1) + 3 * G.lx) mod (2 * G.lx) - G.lx; 185 185 dy := Loc div G.lx - Loc0 div G.lx; 186 a:= (dx + dy) div 2;187 b:= (dy - dx) div 2;186 A := (dx + dy) div 2; 187 B := (dy - dx) div 2; 188 188 end; 189 189 … … 195 195 // calculate 196 196 push ecx 197 div byte ptr [G]197 div Byte ptr [G] 198 198 xor ebx,ebx 199 199 mov bl,ah // ebx:=Loc0 mod G.lx … … 201 201 and ecx,$000000FF // ecx:=Loc0 div G.lx 202 202 mov eax,edx 203 div byte ptr [G]203 div Byte ptr [G] 204 204 xor edx,edx 205 205 mov dl,ah // edx:=Loc mod G.lx … … 218 218 mov edx,dword ptr [G] 219 219 cmp eax,edx 220 jl @ a220 jl @A 221 221 sub eax,edx 222 222 sub eax,edx 223 223 jmp @ok 224 @ a:224 @A: 225 225 neg edx 226 226 cmp eax,edx … … 235 235 add eax,ebx 236 236 sar edx,1 // edx:=b 237 mov ebx,[ b]237 mov ebx,[B] 238 238 mov [ebx],edx 239 239 sar eax,1 // eax:=a 240 mov [ a],eax240 mov [A],eax 241 241 242 242 pop ebx … … 244 244 {$ENDIF} 245 245 246 procedure ab_to_V8( a, b: integer; var V8: integer);247 begin 248 assert((abs(a) <= 1) and (abs(b) <= 1) and ((a <> 0) or (b<> 0)));249 V8 := ab_v8[2 * b + b + a];250 end; 251 252 procedure V8_to_ab(V8: integer; var a, b: integer);253 begin 254 a:= v8_a[V8];255 b:= V8_b[V8];256 end; 257 258 procedure ab_to_V21( a, b: integer; var V21: integer);259 begin 260 V21 := ( a + b + 3) shl 2 + (a - b+ 3) shr 1;261 end; 262 263 procedure V21_to_ab(V21: integer; var a, b: integer);264 var 265 dx, dy: integer;246 procedure ab_to_V8(A, B: Integer; var V8: Integer); 247 begin 248 Assert((abs(A) <= 1) and (abs(B) <= 1) and ((A <> 0) or (B <> 0))); 249 V8 := ab_v8[2 * B + B + A]; 250 end; 251 252 procedure V8_to_ab(V8: Integer; var A, B: Integer); 253 begin 254 A := v8_a[V8]; 255 B := V8_b[V8]; 256 end; 257 258 procedure ab_to_V21(A, B: Integer; var V21: Integer); 259 begin 260 V21 := (A + B + 3) shl 2 + (A - B + 3) shr 1; 261 end; 262 263 procedure V21_to_ab(V21: Integer; var A, B: Integer); 264 var 265 dx, dy: Integer; 266 266 begin 267 267 dy := V21 shr 2 - 3; 268 268 dx := V21 and 3 shl 1 - 3 + (dy + 3) and 1; 269 a:= (dx + dy) div 2;270 b:= (dy - dx) div 2;271 end; 272 273 procedure V8_to_Loc(Loc0: integer; var VicinityLoc: TVicinity8Loc);274 var 275 x0, y0, lx: integer;269 A := (dx + dy) div 2; 270 B := (dy - dx) div 2; 271 end; 272 273 procedure V8_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity8Loc); 274 var 275 x0, y0, lx: Integer; 276 276 begin 277 277 lx := G.lx; 278 y0 := cardinal(Loc0) * decompose24 shr 24;278 y0 := Cardinal(Loc0) * decompose24 shr 24; 279 279 x0 := Loc0 - y0 * lx; // Loc0 mod lx; 280 280 VicinityLoc[1] := Loc0 + lx * 2; … … 323 323 end; 324 324 325 procedure V21_to_Loc(Loc0: integer; var VicinityLoc: TVicinity21Loc);326 var 327 dx, dy, bit, y0, xComp, yComp, xComp0, xCompSwitch: integer;328 dst: ^ integer;329 begin 330 y0 := cardinal(Loc0) * decompose24 shr 24;325 procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc); 326 var 327 dx, dy, bit, y0, xComp, yComp, xComp0, xCompSwitch: Integer; 328 dst: ^Integer; 329 begin 330 y0 := Cardinal(Loc0) * decompose24 shr 24; 331 331 xComp0 := Loc0 - y0 * G.lx - 1; // Loc0 mod G.lx -1 332 332 xCompSwitch := xComp0 - 1 + y0 and 1; … … 368 368 end; 369 369 370 function Distance(Loc0, Loc1: integer): integer;371 var 372 a, b, dx, dy: integer;373 begin 374 Loc_to_ab(Loc0, Loc1, a, b);375 dx := abs( a - b);376 dy := abs( a + b);370 function Distance(Loc0, Loc1: Integer): Integer; 371 var 372 A, B, dx, dy: Integer; 373 begin 374 Loc_to_ab(Loc0, Loc1, A, B); 375 dx := abs(A - B); 376 dy := abs(A + B); 377 377 Result := dx + dy + abs(dx - dy) shr 1; 378 378 end; … … 381 381 procedure Init(NewGameData: TNewGameData); 382 382 {$IFDEF DEBUG}var 383 Loc: integer;383 Loc: Integer; 384 384 {$ENDIF} 385 385 begin … … 389 389 {$IFDEF DEBUG} 390 390 for Loc := 0 to MapSize - 1 do 391 assert(cardinal(Loc) * decompose24 shr 24 = cardinal(Loc div G.lx));391 Assert(Cardinal(Loc) * decompose24 shr 24 = Cardinal(Loc div G.lx)); 392 392 {$ENDIF} 393 393 end; 394 394 395 395 396 constructor TCustomAI.Create(Nation: integer);396 constructor TCustomAI.Create(Nation: Integer); 397 397 begin 398 398 inherited Create; 399 me := Nation;400 RO := pointer(G.RO[Nation]);401 Map := pointer(RO.Map);402 MyUnit := pointer(RO.Un);403 MyCity := pointer(RO.City);404 MyModel := pointer(RO.Model);399 Me := Nation; 400 RO := Pointer(G.RO[Nation]); 401 Map := Pointer(RO.Map); 402 MyUnit := Pointer(RO.Un); 403 MyCity := Pointer(RO.City); 404 MyModel := Pointer(RO.Model); 405 405 Opponent := -1; 406 406 end; … … 408 408 destructor TCustomAI.Destroy; 409 409 begin 410 Server(sSetDebugMap, me, 0, nodata^);411 end; 412 413 414 procedure TCustomAI.Process(Command: integer; var Data);415 var 416 Nation, NewResearch, NewGov, Count, ad, cix, iix: integer;410 Server(sSetDebugMap, Me, 0, nodata^); 411 end; 412 413 414 procedure TCustomAI.Process(Command: Integer; var Data); 415 var 416 Nation, NewResearch, NewGov, Count, ad, cix, iix: Integer; 417 417 NegoTime: TNegoTime; 418 418 begin … … 420 420 cTurn, cContinue: 421 421 begin 422 if RO.Alive and (1 shl me) = 0 then422 if RO.Alive and (1 shl Me) = 0 then 423 423 begin // I'm dead, huhu 424 Server(sTurn, me, 0, nodata^);425 exit;424 Server(sTurn, Me, 0, nodata^); 425 Exit; 426 426 end; 427 427 if Command = cTurn then 428 428 begin 429 fillchar(cixStateImp, sizeof(cixStateImp), $FF);429 FillChar(cixStateImp, SizeOf(cixStateImp), $FF); 430 430 for cix := 0 to RO.nCity - 1 do 431 431 if MyCity[cix].Loc >= 0 then … … 437 437 NewGov := ChooseGovernment; 438 438 if NewGov > gAnarchy then 439 Server(sSetGovernment, me, NewGov, nodata^);439 Server(sSetGovernment, Me, NewGov, nodata^); 440 440 end; 441 441 HaveTurned := False; … … 446 446 if OnNegoRejected_CancelTreaty then 447 447 if RO.Treaty[Opponent] >= trPeace then 448 if Server(sCancelTreaty, me, 0, nodata^) < rExecuted then449 assert(False);448 if Server(sCancelTreaty, Me, 0, nodata^) < rExecuted then 449 Assert(False); 450 450 end 451 451 else … … 459 459 if RO.Government <> gAnarchy then 460 460 for Nation := 0 to nPl - 1 do 461 if (Nation <> me) and (1 shl Nation and RO.Alive <> 0) and461 if (Nation <> Me) and (1 shl Nation and RO.Alive <> 0) and 462 462 (RO.Treaty[Nation] >= trNone) and not (Nation in Contacted) and not 463 463 (Nation in UnwantedNego) and 464 (Server(scContact - sExecute + Nation shl 4, me, 0, nodata^) >= rExecuted) then464 (Server(scContact - sExecute + Nation shl 4, Me, 0, nodata^) >= rExecuted) then 465 465 if WantNegotiation(Nation, NegoTime) then 466 466 begin 467 if Server(scContact + Nation shl 4, me, 0, nodata^) >= rExecuted then467 if Server(scContact + Nation shl 4, Me, 0, nodata^) >= rExecuted then 468 468 begin 469 include(Contacted, Nation);469 Include(Contacted, Nation); 470 470 Opponent := Nation; 471 471 MyAction := scContact; 472 exit;472 Exit; 473 473 end; 474 474 end 475 475 else 476 include(UnwantedNego, Nation);476 Include(UnwantedNego, Nation); 477 477 if NegoTime = BeginOfTurn then 478 478 begin … … 483 483 end 484 484 else 485 break;485 Break; 486 486 until False; 487 487 if RO.Happened and phTech <> 0 then … … 499 499 end; 500 500 end; 501 Server(sSetResearch, me, NewResearch, nodata^);501 Server(sSetResearch, Me, NewResearch, nodata^); 502 502 end; 503 if Server(sTurn, me, 0, nodata^) < rExecuted then504 assert(False);503 if Server(sTurn, Me, 0, nodata^) < rExecuted then 504 Assert(False); 505 505 end; 506 506 scContact: 507 if WantNegotiation( integer(Data), EnemyCalled) then507 if WantNegotiation(Integer(Data), EnemyCalled) then 508 508 begin 509 if Server(scDipStart, me, 0, nodata^) < rExecuted then510 assert(False);511 Opponent := integer(Data);509 if Server(scDipStart, Me, 0, nodata^) < rExecuted then 510 Assert(False); 511 Opponent := Integer(Data); 512 512 MyAction := scDipStart; 513 513 end 514 514 else 515 515 begin 516 if Server(scReject, me, 0, nodata^) < rExecuted then517 assert(False);516 if Server(scReject, Me, 0, nodata^) < rExecuted then 517 Assert(False); 518 518 end; 519 519 scDipStart, scDipNotice, scDipAccept, scDipCancelTreaty, scDipOffer, scDipBreak: … … 538 538 end; 539 539 DoNegotiation; 540 assert((MyAction = scDipNotice) or (MyAction = scDipAccept) or540 Assert((MyAction = scDipNotice) or (MyAction = scDipAccept) or 541 541 (MyAction = scDipCancelTreaty) or (MyAction = scDipOffer) or (MyAction = scDipBreak)); 542 542 if MyAction = scDipOffer then 543 Server(MyAction, me, 0, MyOffer)543 Server(MyAction, Me, 0, MyOffer) 544 544 else 545 Server(MyAction, me, 0, nodata^);545 Server(MyAction, Me, 0, nodata^); 546 546 end; 547 547 cShowEndContact: … … 568 568 569 569 procedure TCustomAI.OnBeforeEnemyAttack(UnitInfo: TUnitInfo; 570 ToLoc, EndHealth, EndHealthDef: integer);571 begin 572 end; 573 574 procedure TCustomAI.OnBeforeEnemyCapture(UnitInfo: TUnitInfo; ToLoc: integer);570 ToLoc, EndHealth, EndHealthDef: Integer); 571 begin 572 end; 573 574 procedure TCustomAI.OnBeforeEnemyCapture(UnitInfo: TUnitInfo; ToLoc: Integer); 575 575 begin 576 576 end; … … 584 584 end; 585 585 586 function TCustomAI.ChooseResearchAdvance: integer;586 function TCustomAI.ChooseResearchAdvance: Integer; 587 587 begin 588 588 Result := -1; 589 589 end; 590 590 591 function TCustomAI.ChooseStealAdvance: integer;591 function TCustomAI.ChooseStealAdvance: Integer; 592 592 begin 593 593 Result := -1; 594 594 end; 595 595 596 function TCustomAI.ChooseGovernment: integer;596 function TCustomAI.ChooseGovernment: Integer; 597 597 begin 598 598 Result := gDespotism; 599 599 end; 600 600 601 function TCustomAI.WantNegotiation(Nation: integer; NegoTime: TNegoTime): boolean;601 function TCustomAI.WantNegotiation(Nation: Integer; NegoTime: TNegoTime): Boolean; 602 602 begin 603 603 Result := False; 604 604 end; 605 605 606 function TCustomAI.OnNegoRejected_CancelTreaty: boolean;606 function TCustomAI.OnNegoRejected_CancelTreaty: Boolean; 607 607 begin 608 608 Result := False; … … 613 613 procedure TCustomAI.StealAdvance; 614 614 var 615 Steal, ad, Count: integer;615 Steal, ad, Count: Integer; 616 616 begin 617 617 Steal := ChooseStealAdvance; … … 628 628 end; 629 629 if Steal >= 0 then 630 Server(sStealTech, me, Steal, nodata^);630 Server(sStealTech, Me, Steal, nodata^); 631 631 RO.Happened := RO.Happened and not phStealTech; 632 632 end; 633 633 634 function TCustomAI.IsResearched(Advance: integer): boolean;634 function TCustomAI.IsResearched(Advance: Integer): Boolean; 635 635 begin 636 636 Result := (Advance = preNone) or (Advance <> preNA) and (RO.Tech[Advance] >= tsApplicable); 637 637 end; 638 638 639 function TCustomAI.ResearchCost: integer;640 begin 641 Server(sGetTechCost, me, 0, Result);642 end; 643 644 function TCustomAI.ChangeAttitude(Nation, Attitude: integer): integer;645 begin 646 Result := Server(sSetAttitude + Nation shl 4, me, Attitude, nodata^);647 end; 648 649 function TCustomAI.Revolution: integer;650 begin 651 Result := Server(sRevolution, me, 0, nodata^);652 end; 653 654 function TCustomAI.ChangeRates(Tax, Lux: integer): integer;655 begin 656 Result := Server(sSetRates, me, Tax div 10 and $f + Lux div 10 and $fshl 4, nodata^);657 end; 658 659 function TCustomAI.PrepareNewModel(Domain: integer): integer;660 begin 661 Result := Server(sCreateDevModel, me, Domain, nodata^);662 end; 663 664 function TCustomAI.SetNewModelFeature(F, Count: integer): integer;665 begin 666 Result := Server(sSetDevModelCap + Count shl 4, me, F, nodata^);667 end; 668 669 function TCustomAI.AdvanceResearchable(Advance: integer): boolean;670 begin 671 Result := Server(sSetResearch - sExecute, me, Advance, nodata^) >= rExecuted;672 end; 673 674 function TCustomAI.AdvanceStealable(Advance: integer): boolean;675 begin 676 Result := Server(sStealTech - sExecute, me, Advance, nodata^) >= rExecuted;677 end; 678 679 function TCustomAI.GetJobProgress(Loc: integer;680 var JobProgress: TJobProgressData): boolean;681 begin 682 Result := Server(sGetJobProgress, me, Loc, JobProgress) >= rExecuted;683 end; 684 685 function TCustomAI.DebugMessage(Level: integer; Text: string): boolean;686 begin 687 Text := copy('P' + char(48 + me) + ' ' + Text, 1, 254);688 Server(sMessage, me, Level, PChar(Text)^);639 function TCustomAI.ResearchCost: Integer; 640 begin 641 Server(sGetTechCost, Me, 0, Result); 642 end; 643 644 function TCustomAI.ChangeAttitude(Nation, Attitude: Integer): Integer; 645 begin 646 Result := Server(sSetAttitude + Nation shl 4, Me, Attitude, nodata^); 647 end; 648 649 function TCustomAI.Revolution: Integer; 650 begin 651 Result := Server(sRevolution, Me, 0, nodata^); 652 end; 653 654 function TCustomAI.ChangeRates(Tax, Lux: Integer): Integer; 655 begin 656 Result := Server(sSetRates, Me, Tax div 10 and $F + Lux div 10 and $F shl 4, nodata^); 657 end; 658 659 function TCustomAI.PrepareNewModel(Domain: Integer): Integer; 660 begin 661 Result := Server(sCreateDevModel, Me, Domain, nodata^); 662 end; 663 664 function TCustomAI.SetNewModelFeature(F, Count: Integer): Integer; 665 begin 666 Result := Server(sSetDevModelCap + Count shl 4, Me, F, nodata^); 667 end; 668 669 function TCustomAI.AdvanceResearchable(Advance: Integer): Boolean; 670 begin 671 Result := Server(sSetResearch - sExecute, Me, Advance, nodata^) >= rExecuted; 672 end; 673 674 function TCustomAI.AdvanceStealable(Advance: Integer): Boolean; 675 begin 676 Result := Server(sStealTech - sExecute, Me, Advance, nodata^) >= rExecuted; 677 end; 678 679 function TCustomAI.GetJobProgress(Loc: Integer; 680 var JobProgress: TJobProgressData): Boolean; 681 begin 682 Result := Server(sGetJobProgress, Me, Loc, JobProgress) >= rExecuted; 683 end; 684 685 function TCustomAI.DebugMessage(Level: Integer; Text: string): Boolean; 686 begin 687 Text := Copy('P' + char(48 + Me) + ' ' + Text, 1, 254); 688 Server(sMessage, Me, Level, PChar(Text)^); 689 689 690 690 Result := True; … … 693 693 end; 694 694 695 function TCustomAI.SetDebugMap(var DebugMap): boolean;696 begin 697 Server(sSetDebugMap, me, 0, DebugMap);695 function TCustomAI.SetDebugMap(var DebugMap): Boolean; 696 begin 697 Server(sSetDebugMap, Me, 0, DebugMap); 698 698 699 699 Result := True; … … 702 702 end; 703 703 704 procedure TCustomAI.Unit_FindMyDefender(Loc: integer; var uix: integer);705 begin 706 if Server(sGetDefender, me, Loc, uix) < rExecuted then704 procedure TCustomAI.Unit_FindMyDefender(Loc: Integer; var uix: Integer); 705 begin 706 if Server(sGetDefender, Me, Loc, uix) < rExecuted then 707 707 uix := -1; 708 708 end; 709 709 710 procedure TCustomAI.Unit_FindEnemyDefender(Loc: integer; var euix: integer);710 procedure TCustomAI.Unit_FindEnemyDefender(Loc: Integer; var euix: Integer); 711 711 begin 712 712 euix := RO.nEnemyUn - 1; … … 715 715 end; 716 716 717 function TCustomAI.Unit_Move(uix, ToLoc: integer): integer;718 var 719 Step: integer;720 DestinationReached: boolean;717 function TCustomAI.Unit_Move(uix, ToLoc: Integer): Integer; 718 var 719 Step: Integer; 720 DestinationReached: Boolean; 721 721 Advice: TMoveAdviceData; 722 722 begin 723 assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0)); // is a unit723 Assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0)); // is a unit 724 724 {Loc_to_ab(MyUnit[uix].Loc,ToLoc,a,b); 725 assert((a<>0) or (b<>0));726 if ( a>=-1) and (a<=1) and (b>=-1) and (b<=1) then725 Assert((A<>0) or (B<>0)); 726 if (A>=-1) and (A<=1) and (B>=-1) and (B<=1) then 727 727 begin // move to adjacent tile 728 !!!problem: if move is invalid, return codes are not consistent with other branch (eNoWay)728 !!!problem: if Move is invalid, return codes are not consistent with other branch (eNoWay) 729 729 Advice.nStep:=1; 730 Advice.dx[0]:= a-b;731 Advice.dy[0]:= a+b;730 Advice.dx[0]:=A-B; 731 Advice.dy[0]:=A+B; 732 732 Advice.MoreTurns:=0; 733 733 Advice.MaxHostile_MovementLeft:=MyUnit[uix].Movement; 734 result:=eOK;734 Result:=eOK; 735 735 end 736 736 else} … … 739 739 Advice.MoreTurns := 9999; 740 740 Advice.MaxHostile_MovementLeft := 100; 741 Result := Server(sGetMoveAdvice, me, uix, Advice);741 Result := Server(sGetMoveAdvice, Me, uix, Advice); 742 742 end; 743 743 if Result = eOk then … … 755 755 begin 756 756 DestinationReached := True; 757 break;757 Break; 758 758 end // stop next to destination 759 759 else if Step = Advice.nStep then … … 761 761 762 762 if (Step = Advice.nStep) or (Result <> eOK) and (Result <> eLoaded) then 763 break;763 Break; 764 764 765 765 Result := Server(sMoveUnit + (Advice.dx[Step] and 7) shl 4 + 766 (Advice.dy[Step] and 7) shl 7, me, uix, nodata^);766 (Advice.dy[Step] and 7) shl 7, Me, uix, nodata^); 767 767 Inc(Step); 768 768 if RO.Happened and phStealTech <> 0 then … … 779 779 end; 780 780 781 function TCustomAI.Unit_Step(uix, ToLoc: integer): integer;782 var 783 a, b: integer;784 begin 785 Loc_to_ab(MyUnit[uix].Loc, ToLoc, a, b);786 assert(((a <> 0) or (b <> 0)) and (a >= -1) and (a <= 1) and (b >= -1) and (b<= 1));787 Result := Server(sMoveUnit + (( a - b) and 7) shl 4 + ((a + b) and 7) shl 7, me, uix, nodata^);781 function TCustomAI.Unit_Step(uix, ToLoc: Integer): Integer; 782 var 783 A, B: Integer; 784 begin 785 Loc_to_ab(MyUnit[uix].Loc, ToLoc, A, B); 786 Assert(((A <> 0) or (B <> 0)) and (A >= -1) and (A <= 1) and (B >= -1) and (B <= 1)); 787 Result := Server(sMoveUnit + ((A - B) and 7) shl 4 + ((A + B) and 7) shl 7, Me, uix, nodata^); 788 788 if RO.Happened and phStealTech <> 0 then 789 789 StealAdvance; 790 790 end; 791 791 792 function TCustomAI.Unit_Attack(uix, ToLoc: integer): integer;793 var 794 a, b: integer;795 begin 796 assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0) // is a unit792 function TCustomAI.Unit_Attack(uix, ToLoc: Integer): Integer; 793 var 794 A, B: Integer; 795 begin 796 Assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0) // is a unit 797 797 and ((Map[ToLoc] and (fUnit or fOwned) = fUnit) // is an attack 798 798 or (Map[ToLoc] and (fCity or fOwned) = fCity) and 799 799 (MyModel[MyUnit[uix].mix].Domain <> dGround))); // is a bombardment 800 Loc_to_ab(MyUnit[uix].Loc, ToLoc, a, b);801 assert(((a <> 0) or (b <> 0)) and (a >= -1) and (a <= 1) and (b >= -1) and (b<= 1));800 Loc_to_ab(MyUnit[uix].Loc, ToLoc, A, B); 801 Assert(((A <> 0) or (B <> 0)) and (A >= -1) and (A <= 1) and (B >= -1) and (B <= 1)); 802 802 // attack to adjacent tile 803 Result := Server(sMoveUnit + ( a - b) and 7 shl 4 + (a + b) and 7 shl 7, me, uix, nodata^);804 end; 805 806 function TCustomAI.Unit_DoMission(uix, MissionType, ToLoc: integer): integer;807 var 808 a, b: integer;809 begin 810 Result := Server(sSetSpyMission + MissionType shl 4, me, 0, nodata^);803 Result := Server(sMoveUnit + (A - B) and 7 shl 4 + (A + B) and 7 shl 7, Me, uix, nodata^); 804 end; 805 806 function TCustomAI.Unit_DoMission(uix, MissionType, ToLoc: Integer): Integer; 807 var 808 A, B: Integer; 809 begin 810 Result := Server(sSetSpyMission + MissionType shl 4, Me, 0, nodata^); 811 811 if Result >= rExecuted then 812 812 begin 813 assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0) // is a unit813 Assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0) // is a unit 814 814 and (MyModel[MyUnit[uix].mix].Kind = mkDiplomat)); // is a commando 815 Loc_to_ab(MyUnit[uix].Loc, ToLoc, a, b);816 assert(((a <> 0) or (b <> 0)) and (a >= -1) and (a <= 1) and (b >= -1) and (b<= 1));815 Loc_to_ab(MyUnit[uix].Loc, ToLoc, A, B); 816 Assert(((A <> 0) or (B <> 0)) and (A >= -1) and (A <= 1) and (B >= -1) and (B <= 1)); 817 817 // city must be adjacent 818 Result := Server(sMoveUnit - sExecute + ( a - b) and 7 shl 4 + (a + b) and 7 shl 7, me, uix, nodata^);818 Result := Server(sMoveUnit - sExecute + (A - B) and 7 shl 4 + (A + B) and 7 shl 7, Me, uix, nodata^); 819 819 if Result = eMissionDone then 820 Result := Server(sMoveUnit + ( a - b) and 7 shl 4 + (a + b) and 7 shl 7, me, uix, nodata^)820 Result := Server(sMoveUnit + (A - B) and 7 shl 4 + (A + B) and 7 shl 7, Me, uix, nodata^) 821 821 else if (Result <> eNoTime_Move) and (Result <> eTreaty) and (Result <> eNoTurn) then 822 822 Result := eInvalid; // not a special commando mission! … … 824 824 end; 825 825 826 function TCustomAI.Unit_MoveForecast(uix, ToLoc: integer;827 var RemainingMovement: integer): boolean;826 function TCustomAI.Unit_MoveForecast(uix, ToLoc: Integer; 827 var RemainingMovement: Integer): Boolean; 828 828 var 829 829 Advice: TMoveAdviceData; 830 830 begin 831 assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0)); // is a unit831 Assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0)); // is a unit 832 832 Advice.ToLoc := ToLoc; 833 833 Advice.MoreTurns := 0; 834 834 Advice.MaxHostile_MovementLeft := 100; 835 if Server(sGetMoveAdvice, me, uix, Advice) = eOk then835 if Server(sGetMoveAdvice, Me, uix, Advice) = eOk then 836 836 begin 837 837 RemainingMovement := Advice.MaxHostile_MovementLeft; … … 846 846 847 847 // negative RemainingHealth is remaining helth of defender if lost 848 function TCustomAI.Unit_AttackForecast(uix, ToLoc, AttackMovement: integer;849 var RemainingHealth: integer): boolean;848 function TCustomAI.Unit_AttackForecast(uix, ToLoc, AttackMovement: Integer; 849 var RemainingHealth: Integer): Boolean; 850 850 var 851 851 BattleForecast: TBattleForecast; 852 852 begin 853 assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0) // is a unit853 Assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0) // is a unit 854 854 and (Map[ToLoc] and (fUnit or fOwned) = fUnit)); // is an attack 855 855 RemainingHealth := -$100; … … 858 858 with MyUnit[uix] do 859 859 begin 860 BattleForecast.pAtt := me;860 BattleForecast.pAtt := Me; 861 861 BattleForecast.mixAtt := mix; 862 862 BattleForecast.HealthAtt := Health; … … 864 864 BattleForecast.FlagsAtt := Flags; 865 865 BattleForecast.Movement := AttackMovement; 866 if Server(sGetBattleForecast, me, ToLoc, BattleForecast) >= rExecuted then866 if Server(sGetBattleForecast, Me, ToLoc, BattleForecast) >= rExecuted then 867 867 begin 868 868 if BattleForecast.EndHealthAtt > 0 then … … 875 875 end; 876 876 877 function TCustomAI.Unit_DefenseForecast(euix, ToLoc: integer;878 var RemainingHealth: integer): boolean;877 function TCustomAI.Unit_DefenseForecast(euix, ToLoc: Integer; 878 var RemainingHealth: Integer): Boolean; 879 879 var 880 880 BattleForecast: TBattleForecast; 881 881 begin 882 assert((euix >= 0) and (euix < RO.nEnemyUn) and (RO.EnemyUn[euix].Loc >= 0) // is an enemy unit882 Assert((euix >= 0) and (euix < RO.nEnemyUn) and (RO.EnemyUn[euix].Loc >= 0) // is an enemy unit 883 883 and (Map[ToLoc] and (fUnit or fOwned) = (fUnit or fOwned))); // is an attack 884 884 RemainingHealth := $100; … … 892 892 BattleForecast.FlagsAtt := Flags; 893 893 BattleForecast.Movement := 100; 894 if Server(sGetBattleForecast, me, ToLoc, BattleForecast) >= rExecuted then894 if Server(sGetBattleForecast, Me, ToLoc, BattleForecast) >= rExecuted then 895 895 begin 896 896 if BattleForecast.EndHealthDef > 0 then … … 903 903 end; 904 904 905 function TCustomAI.Unit_Disband(uix: integer): integer;906 begin 907 Result := Server(sRemoveUnit, me, uix, nodata^);908 end; 909 910 function TCustomAI.Unit_StartJob(uix, NewJob: integer): integer;911 begin 912 Result := Server(sStartJob + NewJob shl 4, me, uix, nodata^);913 end; 914 915 function TCustomAI.Unit_SetHomeHere(uix: integer): integer;916 begin 917 Result := Server(sSetUnitHome, me, uix, nodata^);918 end; 919 920 function TCustomAI.Unit_Load(uix: integer): integer;921 begin 922 Result := Server(sLoadUnit, me, uix, nodata^);923 end; 924 925 function TCustomAI.Unit_Unload(uix: integer): integer;926 begin 927 Result := Server(sUnloadUnit, me, uix, nodata^);928 end; 929 930 function TCustomAI.Unit_AddToCity(uix: integer): integer;931 begin 932 Result := Server(sAddToCity, me, uix, nodata^);933 end; 934 935 function TCustomAI.Unit_SelectTransport(uix: integer): integer;936 begin 937 Result := Server(sSelectTransport, me, uix, nodata^);938 end; 939 940 941 procedure TCustomAI.City_FindMyCity(Loc: integer; var cix: integer);905 function TCustomAI.Unit_Disband(uix: Integer): Integer; 906 begin 907 Result := Server(sRemoveUnit, Me, uix, nodata^); 908 end; 909 910 function TCustomAI.Unit_StartJob(uix, NewJob: Integer): Integer; 911 begin 912 Result := Server(sStartJob + NewJob shl 4, Me, uix, nodata^); 913 end; 914 915 function TCustomAI.Unit_SetHomeHere(uix: Integer): Integer; 916 begin 917 Result := Server(sSetUnitHome, Me, uix, nodata^); 918 end; 919 920 function TCustomAI.Unit_Load(uix: Integer): Integer; 921 begin 922 Result := Server(sLoadUnit, Me, uix, nodata^); 923 end; 924 925 function TCustomAI.Unit_Unload(uix: Integer): Integer; 926 begin 927 Result := Server(sUnloadUnit, Me, uix, nodata^); 928 end; 929 930 function TCustomAI.Unit_AddToCity(uix: Integer): Integer; 931 begin 932 Result := Server(sAddToCity, Me, uix, nodata^); 933 end; 934 935 function TCustomAI.Unit_SelectTransport(uix: Integer): Integer; 936 begin 937 Result := Server(sSelectTransport, Me, uix, nodata^); 938 end; 939 940 941 procedure TCustomAI.City_FindMyCity(Loc: Integer; var cix: Integer); 942 942 begin 943 943 if Map[Loc] and (fCity or fOwned) <> fCity or fOwned then … … 951 951 end; 952 952 953 procedure TCustomAI.City_FindEnemyCity(Loc: integer; var ecix: integer);953 procedure TCustomAI.City_FindEnemyCity(Loc: Integer; var ecix: Integer); 954 954 begin 955 955 if Map[Loc] and (fCity or fOwned) <> fCity then … … 963 963 end; 964 964 965 function TCustomAI.City_HasProject(cix: integer): boolean;965 function TCustomAI.City_HasProject(cix: Integer): Boolean; 966 966 begin 967 967 Result := MyCity[cix].Project and (cpImp + cpIndex) <> cpImp + imTrGoods; 968 968 end; 969 969 970 function TCustomAI.City_CurrentImprovementProject(cix: integer): integer;970 function TCustomAI.City_CurrentImprovementProject(cix: Integer): Integer; 971 971 begin 972 972 if MyCity[cix].Project and cpImp = 0 then … … 980 980 end; 981 981 982 function TCustomAI.City_CurrentUnitProject(cix: integer): integer;982 function TCustomAI.City_CurrentUnitProject(cix: Integer): Integer; 983 983 begin 984 984 if MyCity[cix].Project and cpImp <> 0 then … … 988 988 end; 989 989 990 function TCustomAI.City_GetTileInfo(cix, TileLoc: integer;991 var TileInfo: TTileInfo): integer;990 function TCustomAI.City_GetTileInfo(cix, TileLoc: Integer; 991 var TileInfo: TTileInfo): Integer; 992 992 begin 993 993 TileInfo.ExplCity := cix; 994 Result := Server(sGetHypoCityTileInfo, me, TileLoc, TileInfo);995 end; 996 997 function TCustomAI.City_GetReport(cix: integer; var Report: TCityReport): integer;994 Result := Server(sGetHypoCityTileInfo, Me, TileLoc, TileInfo); 995 end; 996 997 function TCustomAI.City_GetReport(cix: Integer; var Report: TCityReport): Integer; 998 998 begin 999 999 Report.HypoTiles := -1; 1000 1000 Report.HypoTax := -1; 1001 1001 Report.HypoLux := -1; 1002 Result := Server(sGetCityReport, me, cix, Report);1003 end; 1004 1005 function TCustomAI.City_GetHypoReport(cix, HypoTiles, HypoTax, HypoLux: integer;1006 var Report: TCityReport): integer;1002 Result := Server(sGetCityReport, Me, cix, Report); 1003 end; 1004 1005 function TCustomAI.City_GetHypoReport(cix, HypoTiles, HypoTax, HypoLux: Integer; 1006 var Report: TCityReport): Integer; 1007 1007 begin 1008 1008 Report.HypoTiles := HypoTiles; 1009 1009 Report.HypoTax := HypoTax; 1010 1010 Report.HypoLux := HypoLux; 1011 Result := Server(sGetCityReport, me, cix, Report);1012 end; 1013 1014 function TCustomAI.City_GetReportNew(cix: integer; var Report: TCityReportNew): integer;1011 Result := Server(sGetCityReport, Me, cix, Report); 1012 end; 1013 1014 function TCustomAI.City_GetReportNew(cix: Integer; var Report: TCityReportNew): Integer; 1015 1015 begin 1016 1016 Report.HypoTiles := -1; 1017 1017 Report.HypoTaxRate := -1; 1018 1018 Report.HypoLuxuryRate := -1; 1019 Result := Server(sGetCityReportNew, me, cix, Report);1019 Result := Server(sGetCityReportNew, Me, cix, Report); 1020 1020 end; 1021 1021 1022 1022 function TCustomAI.City_GetHypoReportNew(cix, HypoTiles, HypoTaxRate, 1023 HypoLuxuryRate: integer; var Report: TCityReportNew): integer;1023 HypoLuxuryRate: Integer; var Report: TCityReportNew): Integer; 1024 1024 begin 1025 1025 Report.HypoTiles := HypoTiles; 1026 1026 Report.HypoTaxRate := HypoTaxRate; 1027 1027 Report.HypoLuxuryRate := HypoLuxuryRate; 1028 Result := Server(sGetCityReportNew, me, cix, Report);1029 end; 1030 1031 function TCustomAI.City_GetAreaInfo(cix: integer; var AreaInfo: TCityAreaInfo): integer;1032 begin 1033 Result := Server(sGetCityAreaInfo, me, cix, AreaInfo);1034 end; 1035 1036 function TCustomAI.City_StartUnitProduction(cix, mix: integer): integer;1028 Result := Server(sGetCityReportNew, Me, cix, Report); 1029 end; 1030 1031 function TCustomAI.City_GetAreaInfo(cix: Integer; var AreaInfo: TCityAreaInfo): Integer; 1032 begin 1033 Result := Server(sGetCityAreaInfo, Me, cix, AreaInfo); 1034 end; 1035 1036 function TCustomAI.City_StartUnitProduction(cix, mix: Integer): Integer; 1037 1037 begin 1038 1038 if (MyCity[cix].Project and (cpImp + cpIndex) <> mix) then 1039 1039 // not already producing that 1040 Result := Server(sSetCityProject, me, cix, mix);1041 end; 1042 1043 function TCustomAI.City_StartEmigration(cix, mix: integer;1044 AllowDisbandCity, AsConscripts: boolean): integer;1045 var 1046 NewProject: integer;1040 Result := Server(sSetCityProject, Me, cix, mix); 1041 end; 1042 1043 function TCustomAI.City_StartEmigration(cix, mix: Integer; 1044 AllowDisbandCity, AsConscripts: Boolean): Integer; 1045 var 1046 NewProject: Integer; 1047 1047 begin 1048 1048 NewProject := mix; … … 1051 1051 if AsConscripts then 1052 1052 NewProject := NewProject or cpConscripts; 1053 Result := Server(sSetCityProject, me, cix, NewProject);1054 end; 1055 1056 function TCustomAI.City_StartImprovement(cix, iix: integer): integer;1057 var 1058 NewProject: integer;1053 Result := Server(sSetCityProject, Me, cix, NewProject); 1054 end; 1055 1056 function TCustomAI.City_StartImprovement(cix, iix: Integer): Integer; 1057 var 1058 NewProject: Integer; 1059 1059 begin 1060 1060 NewProject := iix + cpImp; 1061 1061 if (MyCity[cix].Project and (cpImp + cpIndex) <> NewProject) then 1062 1062 // not already producing that 1063 Result := Server(sSetCityProject, me, cix, NewProject);1064 end; 1065 1066 function TCustomAI.City_Improvable(cix, iix: integer): boolean;1067 var 1068 NewProject: integer;1063 Result := Server(sSetCityProject, Me, cix, NewProject); 1064 end; 1065 1066 function TCustomAI.City_Improvable(cix, iix: Integer): Boolean; 1067 var 1068 NewProject: Integer; 1069 1069 begin 1070 1070 NewProject := iix + cpImp; 1071 Result := Server(sSetCityProject - sExecute, me, cix, NewProject) >= rExecuted;1072 end; 1073 1074 function TCustomAI.City_StopProduction(cix: integer): integer;1075 var 1076 NewProject: integer;1071 Result := Server(sSetCityProject - sExecute, Me, cix, NewProject) >= rExecuted; 1072 end; 1073 1074 function TCustomAI.City_StopProduction(cix: Integer): Integer; 1075 var 1076 NewProject: Integer; 1077 1077 begin 1078 1078 NewProject := imTrGoods + cpImp; 1079 Result := Server(sSetCityProject, me, cix, NewProject);1080 end; 1081 1082 function TCustomAI.City_BuyProject(cix: integer): integer;1083 begin 1084 Result := Server(sBuyCityProject, me, cix, nodata^);1085 end; 1086 1087 function TCustomAI.City_SellImprovement(cix, iix: integer): integer;1088 begin 1089 Result := Server(sSellCityImprovement, me, cix, iix);1090 end; 1091 1092 function TCustomAI.City_RebuildImprovement(cix, iix: integer): integer;1093 begin 1094 Result := Server(sRebuildCityImprovement, me, cix, iix);1095 end; 1096 1097 function TCustomAI.City_SetTiles(cix, NewTiles: integer): integer;1098 begin 1099 Result := Server(sSetCityTiles, me, cix, NewTiles);1100 end; 1101 1102 procedure TCustomAI.City_OptimizeTiles(cix: integer; ResourceWeights: cardinal);1079 Result := Server(sSetCityProject, Me, cix, NewProject); 1080 end; 1081 1082 function TCustomAI.City_BuyProject(cix: Integer): Integer; 1083 begin 1084 Result := Server(sBuyCityProject, Me, cix, nodata^); 1085 end; 1086 1087 function TCustomAI.City_SellImprovement(cix, iix: Integer): Integer; 1088 begin 1089 Result := Server(sSellCityImprovement, Me, cix, iix); 1090 end; 1091 1092 function TCustomAI.City_RebuildImprovement(cix, iix: Integer): Integer; 1093 begin 1094 Result := Server(sRebuildCityImprovement, Me, cix, iix); 1095 end; 1096 1097 function TCustomAI.City_SetTiles(cix, NewTiles: Integer): Integer; 1098 begin 1099 Result := Server(sSetCityTiles, Me, cix, NewTiles); 1100 end; 1101 1102 procedure TCustomAI.City_OptimizeTiles(cix: Integer; ResourceWeights: Cardinal); 1103 1103 var 1104 1104 Advice: TCityTileAdviceData; 1105 1105 begin 1106 1106 Advice.ResourceWeights := ResourceWeights; 1107 Server(sGetCityTileAdvice, me, cix, Advice);1107 Server(sGetCityTileAdvice, Me, cix, Advice); 1108 1108 City_SetTiles(cix, Advice.Tiles); 1109 1109 end; … … 1111 1111 1112 1112 // negotiation 1113 function TCustomAI.Nego_CheckMyAction: integer;1114 begin 1115 assert(Opponent >= 0); // only allowed in negotiation mode1116 assert((MyAction = scDipNotice) or (MyAction = scDipAccept) or1113 function TCustomAI.Nego_CheckMyAction: Integer; 1114 begin 1115 Assert(Opponent >= 0); // only allowed in negotiation mode 1116 Assert((MyAction = scDipNotice) or (MyAction = scDipAccept) or 1117 1117 (MyAction = scDipCancelTreaty) or (MyAction = scDipOffer) or (MyAction = scDipBreak)); 1118 1118 if MyAction = scDipOffer then 1119 Result := Server(MyAction - sExecute, me, 0, MyOffer)1119 Result := Server(MyAction - sExecute, Me, 0, MyOffer) 1120 1120 else 1121 Result := Server(MyAction - sExecute, me, 0, nodata^);1121 Result := Server(MyAction - sExecute, Me, 0, nodata^); 1122 1122 end; 1123 1123 1124 1124 1125 1125 initialization 1126 nodata := pointer(0);1126 nodata := Pointer(0); 1127 1127 RWDataSize := 0; 1128 1128 -
branches/highdpi/AI/StdAI/CustomAI_Reload.pas
r210 r465 13 13 TCustomAI=class 14 14 public 15 procedure Process(Command: integer; var Data);15 procedure Process(Command: Integer; var Data); 16 16 17 17 // overridables 18 constructor Create(Nation: integer); virtual;18 constructor Create(Nation: Integer); virtual; 19 19 destructor Destroy; override; 20 20 procedure SetDataDefaults; virtual; 21 21 procedure SetDataRandom; virtual; 22 22 procedure OnBeforeEnemyAttack(UnitInfo: TUnitInfo; 23 ToLoc, EndHealth, EndHealthDef: integer); virtual;24 procedure OnBeforeEnemyCapture(UnitInfo: TUnitInfo; ToLoc: integer); virtual;23 ToLoc, EndHealth, EndHealthDef: Integer); virtual; 24 procedure OnBeforeEnemyCapture(UnitInfo: TUnitInfo; ToLoc: Integer); virtual; 25 25 procedure OnAfterEnemyAttack; virtual; 26 26 procedure OnAfterEnemyCapture; virtual; 27 27 28 28 protected 29 me: integer; // index of the controlled nation29 Me: Integer; // index of the controlled nation 30 30 RO: ^TPlayerContext; 31 31 Map: ^TTileList; … … 34 34 MyModel: ^TModelList; 35 35 36 cixStateImp: array[imPalace..imSpacePort] of integer;36 cixStateImp: array[imPalace..imSpacePort] of Integer; 37 37 38 38 // negotiation 39 Opponent: integer; // nation i'm in negotiation with, -1 indicates no-negotiation mode40 MyAction, MyLastAction, OppoAction: integer;39 Opponent: Integer; // nation i'm in negotiation with, -1 indicates no-negotiation mode 40 MyAction, MyLastAction, OppoAction: Integer; 41 41 MyOffer, MyLastOffer, OppoOffer: TOffer; 42 42 … … 44 44 procedure DoTurn; virtual; 45 45 procedure DoNegotiation; virtual; 46 function ChooseResearchAdvance: integer; virtual;47 function ChooseStealAdvance: integer; virtual;48 function ChooseGovernment: integer; virtual;49 function WantNegotiation(Nation: integer; NegoTime: TNegoTime): boolean; virtual;50 function OnNegoRejected_CancelTreaty: boolean; virtual;46 function ChooseResearchAdvance: Integer; virtual; 47 function ChooseStealAdvance: Integer; virtual; 48 function ChooseGovernment: Integer; virtual; 49 function WantNegotiation(Nation: Integer; NegoTime: TNegoTime): Boolean; virtual; 50 function OnNegoRejected_CancelTreaty: Boolean; virtual; 51 51 52 52 // general functions 53 function IsResearched(Advance: integer): boolean;54 function ResearchCost: integer;55 function ChangeAttitude(Nation, Attitude: integer): integer;56 function Revolution: integer;57 function ChangeRates(Tax,Lux: integer): integer;58 function PrepareNewModel(Domain: integer): integer;59 function SetNewModelFeature(F, Count: integer): integer;60 function AdvanceResearchable(Advance: integer): boolean;61 function AdvanceStealable(Advance: integer): boolean;62 function DebugMessage(Level: integer; Text: string): boolean;63 function SetDebugMap(var DebugMap): boolean;53 function IsResearched(Advance: Integer): Boolean; 54 function ResearchCost: Integer; 55 function ChangeAttitude(Nation, Attitude: Integer): Integer; 56 function Revolution: Integer; 57 function ChangeRates(Tax,Lux: Integer): Integer; 58 function PrepareNewModel(Domain: Integer): Integer; 59 function SetNewModelFeature(F, Count: Integer): Integer; 60 function AdvanceResearchable(Advance: Integer): Boolean; 61 function AdvanceStealable(Advance: Integer): Boolean; 62 function DebugMessage(Level: Integer; Text: string): Boolean; 63 function SetDebugMap(var DebugMap): Boolean; 64 64 65 65 // unit functions 66 procedure Unit_FindMyDefender(Loc: integer; var uix: integer);67 procedure Unit_FindEnemyDefender(Loc: integer; var euix: integer);68 function Unit_Move(uix,ToLoc: integer): integer;69 function Unit_Step(uix,ToLoc: integer): integer;70 function Unit_Attack(uix,ToLoc: integer): integer;71 function Unit_DoMission(uix,MissionType,ToLoc: integer): integer;72 function Unit_MoveForecast(uix,ToLoc: integer; var RemainingMovement: integer): boolean;73 function Unit_AttackForecast(uix,ToLoc,AttackMovement: integer; var RemainingHealth: integer): boolean;74 function Unit_DefenseForecast(euix,ToLoc: integer; var RemainingHealth: integer): boolean;75 function Unit_Disband(uix: integer): integer;76 function Unit_StartJob(uix,NewJob: integer): integer;77 function Unit_SetHomeHere(uix: integer): integer;78 function Unit_Load(uix: integer): integer;79 function Unit_Unload(uix: integer): integer;80 function Unit_AddToCity(uix: integer): integer;66 procedure Unit_FindMyDefender(Loc: Integer; var uix: Integer); 67 procedure Unit_FindEnemyDefender(Loc: Integer; var euix: Integer); 68 function Unit_Move(uix,ToLoc: Integer): Integer; 69 function Unit_Step(uix,ToLoc: Integer): Integer; 70 function Unit_Attack(uix,ToLoc: Integer): Integer; 71 function Unit_DoMission(uix,MissionType,ToLoc: Integer): Integer; 72 function Unit_MoveForecast(uix,ToLoc: Integer; var RemainingMovement: Integer): Boolean; 73 function Unit_AttackForecast(uix,ToLoc,AttackMovement: Integer; var RemainingHealth: Integer): Boolean; 74 function Unit_DefenseForecast(euix,ToLoc: Integer; var RemainingHealth: Integer): Boolean; 75 function Unit_Disband(uix: Integer): Integer; 76 function Unit_StartJob(uix,NewJob: Integer): Integer; 77 function Unit_SetHomeHere(uix: Integer): Integer; 78 function Unit_Load(uix: Integer): Integer; 79 function Unit_Unload(uix: Integer): Integer; 80 function Unit_AddToCity(uix: Integer): Integer; 81 81 82 82 // city functions 83 procedure City_FindMyCity(Loc: integer; var cix: integer);84 procedure City_FindEnemyCity(Loc: integer; var ecix: integer);85 function City_HasProject(cix: integer): boolean;86 function City_CurrentImprovementProject(cix: integer): integer;87 function City_CurrentUnitProject(cix: integer): integer;88 function City_GetTileInfo(cix,TileLoc: integer; var TileInfo: TTileInfo): integer;89 function City_GetReport(cix: integer; var Report: TCityReport): integer;90 function City_GetHypoReport(cix, HypoTiles, HypoTax, HypoLux: integer; var Report: TCityReport): integer;91 function City_GetAreaInfo(cix: integer; var AreaInfo: TCityAreaInfo): integer;92 function City_StartUnitProduction(cix,mix: integer): integer;93 function City_StartEmigration(cix,mix: integer; AllowDisbandCity, AsConscripts: boolean): integer;94 function City_StartImprovement(cix,iix: integer): integer;95 function City_Improvable(cix,iix: integer): boolean;96 function City_StopProduction(cix: integer): integer;97 function City_BuyProject(cix: integer): integer;98 function City_SellImprovement(cix,iix: integer): integer;99 function City_RebuildImprovement(cix,iix: integer): integer;100 function City_SetTiles(cix,NewTiles: integer): integer;83 procedure City_FindMyCity(Loc: Integer; var cix: Integer); 84 procedure City_FindEnemyCity(Loc: Integer; var ecix: Integer); 85 function City_HasProject(cix: Integer): Boolean; 86 function City_CurrentImprovementProject(cix: Integer): Integer; 87 function City_CurrentUnitProject(cix: Integer): Integer; 88 function City_GetTileInfo(cix,TileLoc: Integer; var TileInfo: TTileInfo): Integer; 89 function City_GetReport(cix: Integer; var Report: TCityReport): Integer; 90 function City_GetHypoReport(cix, HypoTiles, HypoTax, HypoLux: Integer; var Report: TCityReport): Integer; 91 function City_GetAreaInfo(cix: Integer; var AreaInfo: TCityAreaInfo): Integer; 92 function City_StartUnitProduction(cix,mix: Integer): Integer; 93 function City_StartEmigration(cix,mix: Integer; AllowDisbandCity, AsConscripts: Boolean): Integer; 94 function City_StartImprovement(cix,iix: Integer): Integer; 95 function City_Improvable(cix,iix: Integer): Boolean; 96 function City_StopProduction(cix: Integer): Integer; 97 function City_BuyProject(cix: Integer): Integer; 98 function City_SellImprovement(cix,iix: Integer): Integer; 99 function City_RebuildImprovement(cix,iix: Integer): Integer; 100 function City_SetTiles(cix,NewTiles: Integer): Integer; 101 101 102 102 // negotiation 103 function Nego_CheckMyAction: integer;103 function Nego_CheckMyAction: Integer; 104 104 105 105 private 106 HaveTurned: boolean;106 HaveTurned: Boolean; 107 107 UnwantedNego: set of 0..nPl-1; 108 108 Contacted: set of 0..nPl-1; … … 114 114 Server: TServerCall; 115 115 G: TNewGameData; 116 RWDataSize, MapSize: integer;117 decompose24: cardinal;118 nodata: pointer;116 RWDataSize, MapSize: Integer; 117 decompose24: Cardinal; 118 nodata: Pointer; 119 119 120 120 const … … 126 126 127 127 type 128 TVicinity8Loc=array[0..7] of integer;129 TVicinity21Loc=array[0..27] of integer;128 TVicinity8Loc=array[0..7] of Integer; 129 TVicinity21Loc=array[0..27] of Integer; 130 130 131 131 132 132 procedure Init(NewGameData: TNewGameData); 133 133 134 procedure ab_to_Loc(Loc0, a,b: integer; var Loc: integer);135 procedure Loc_to_ab(Loc0,Loc: integer; var a,b: integer);136 procedure ab_to_V8( a,b: integer; var V8: integer);137 procedure V8_to_ab(V8: integer; var a,b: integer);138 procedure ab_to_V21( a,b: integer; var V21: integer);139 procedure V21_to_ab(V21: integer; var a,b: integer);140 procedure V8_to_Loc(Loc0: integer; var VicinityLoc: TVicinity8Loc);141 procedure V21_to_Loc(Loc0: integer; var VicinityLoc: TVicinity21Loc);134 procedure ab_to_Loc(Loc0,A,B: Integer; var Loc: Integer); 135 procedure Loc_to_ab(Loc0,Loc: Integer; var A,B: Integer); 136 procedure ab_to_V8(A,B: Integer; var V8: Integer); 137 procedure V8_to_ab(V8: Integer; var A,B: Integer); 138 procedure ab_to_V21(A,B: Integer; var V21: Integer); 139 procedure V21_to_ab(V21: Integer; var A,B: Integer); 140 procedure V8_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity8Loc); 141 procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc); 142 142 143 143 … … 145 145 146 146 const 147 ab_v8: array[-4..4] of integer = (5,6,7,4,-1,0,3,2,1);148 v8_a: array[0..7] of integer = (1,1,0,-1,-1,-1,0,1);149 v8_b: array[0..7] of integer = (0,1,1,1,0,-1,-1,-1);150 151 152 procedure ab_to_Loc(Loc0, a,b: integer; var Loc: integer);147 ab_v8: array[-4..4] of Integer = (5,6,7,4,-1,0,3,2,1); 148 v8_a: array[0..7] of Integer = (1,1,0,-1,-1,-1,0,1); 149 v8_b: array[0..7] of Integer = (0,1,1,1,0,-1,-1,-1); 150 151 152 procedure ab_to_Loc(Loc0,A,B: Integer; var Loc: Integer); 153 153 {relative location from Loc0} 154 154 var 155 y0: integer;156 begin 157 assert((Loc0>=0) and (Loc0<MapSize) and (a-b+G.lx>=0));158 y0:= cardinal(Loc0)*decompose24 shr 24;159 Loc:=(Loc0+( a-b+y0 and 1+G.lx+G.lx) shr 1) mod G.lx +G.lx*(y0+a+b);155 y0: Integer; 156 begin 157 Assert((Loc0>=0) and (Loc0<MapSize) and (A-B+G.lx>=0)); 158 y0:=Cardinal(Loc0)*decompose24 shr 24; 159 Loc:=(Loc0+(A-B+y0 and 1+G.lx+G.lx) shr 1) mod G.lx +G.lx*(y0+A+B); 160 160 if Loc>=MapSize then Loc:=-$1000 161 161 end; 162 162 163 procedure Loc_to_ab(Loc0,Loc: integer; var a,b: integer);163 procedure Loc_to_ab(Loc0,Loc: Integer; var A,B: Integer); 164 164 {$IFDEF FPC} // freepascal 165 165 var 166 dx,dy: integer;166 dx,dy: Integer; 167 167 begin 168 168 dx:=((Loc mod G.lx *2 +Loc div G.lx and 1) 169 169 -(Loc0 mod G.lx *2 +Loc0 div G.lx and 1)+3*G.lx) mod (2*G.lx) -G.lx; 170 170 dy:=Loc div G.lx-Loc0 div G.lx; 171 a:=(dx+dy) div 2;172 b:=(dy-dx) div 2;171 A:=(dx+dy) div 2; 172 B:=(dy-dx) div 2; 173 173 end; 174 174 {$ELSE} // delphi … … 179 179 // calculate 180 180 push ecx 181 div byte ptr [G]181 div Byte ptr [G] 182 182 xor ebx,ebx 183 183 mov bl,ah // ebx:=Loc0 mod G.lx … … 185 185 and ecx,$000000FF // ecx:=Loc0 div G.lx 186 186 mov eax,edx 187 div byte ptr [G]187 div Byte ptr [G] 188 188 xor edx,edx 189 189 mov dl,ah // edx:=Loc mod G.lx … … 202 202 mov edx,dword ptr [G] 203 203 cmp eax,edx 204 jl @ a204 jl @A 205 205 sub eax,edx 206 206 sub eax,edx 207 207 jmp @ok 208 @ a:208 @A: 209 209 neg edx 210 210 cmp eax,edx … … 219 219 add eax,ebx 220 220 sar edx,1 // edx:=b 221 mov ebx,[ b]221 mov ebx,[B] 222 222 mov [ebx],edx 223 223 sar eax,1 // eax:=a 224 mov [ a],eax224 mov [A],eax 225 225 226 226 pop ebx … … 228 228 {$ENDIF} 229 229 230 procedure ab_to_V8( a,b: integer; var V8: integer);231 begin 232 assert((abs(a)<=1) and (abs(b)<=1) and ((a<>0) or (b<>0)));233 V8:=ab_v8[2* b+b+a];234 end; 235 236 procedure V8_to_ab(V8: integer; var a,b: integer);237 begin 238 a:=v8_a[V8]; b:=V8_b[V8];239 end; 240 241 procedure ab_to_V21( a,b: integer; var V21: integer);242 begin 243 V21:=( a+b+3) shl 2+(a-b+3) shr 1;244 end; 245 246 procedure V21_to_ab(V21: integer; var a,b: integer);247 var 248 dx,dy: integer;230 procedure ab_to_V8(A,B: Integer; var V8: Integer); 231 begin 232 Assert((abs(A)<=1) and (abs(B)<=1) and ((A<>0) or (B<>0))); 233 V8:=ab_v8[2*B+B+A]; 234 end; 235 236 procedure V8_to_ab(V8: Integer; var A,B: Integer); 237 begin 238 A:=v8_a[V8]; B:=V8_b[V8]; 239 end; 240 241 procedure ab_to_V21(A,B: Integer; var V21: Integer); 242 begin 243 V21:=(A+B+3) shl 2+(A-B+3) shr 1; 244 end; 245 246 procedure V21_to_ab(V21: Integer; var A,B: Integer); 247 var 248 dx,dy: Integer; 249 249 begin 250 250 dy:=V21 shr 2-3; 251 251 dx:=V21 and 3 shl 1 -3 + (dy+3) and 1; 252 a:=(dx+dy) div 2;253 b:=(dy-dx) div 2;254 end; 255 256 procedure V8_to_Loc(Loc0: integer; var VicinityLoc: TVicinity8Loc);257 var 258 x0,y0,lx: integer;252 A:=(dx+dy) div 2; 253 B:=(dy-dx) div 2; 254 end; 255 256 procedure V8_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity8Loc); 257 var 258 x0,y0,lx: Integer; 259 259 begin 260 260 lx:=G.lx; 261 y0:= cardinal(Loc0)*decompose24 shr 24;261 y0:=Cardinal(Loc0)*decompose24 shr 24; 262 262 x0:=Loc0-y0*lx; // Loc0 mod lx; 263 263 VicinityLoc[1]:=Loc0+lx*2; … … 265 265 VicinityLoc[5]:=Loc0-lx*2; 266 266 VicinityLoc[7]:=Loc0+1; 267 inc(Loc0,y0 and 1);267 Inc(Loc0,y0 and 1); 268 268 VicinityLoc[0]:=Loc0+lx; 269 269 VicinityLoc[2]:=Loc0+lx-1; … … 276 276 if x0=0 then 277 277 begin 278 inc(VicinityLoc[3],lx);278 Inc(VicinityLoc[3],lx); 279 279 if y0 and 1=0 then 280 280 begin 281 inc(VicinityLoc[2],lx);282 inc(VicinityLoc[4],lx);281 Inc(VicinityLoc[2],lx); 282 Inc(VicinityLoc[4],lx); 283 283 end 284 284 end … … 286 286 else 287 287 begin 288 dec(VicinityLoc[7],lx);288 Dec(VicinityLoc[7],lx); 289 289 if y0 and 1=1 then 290 290 begin 291 dec(VicinityLoc[0],lx);292 dec(VicinityLoc[6],lx);291 Dec(VicinityLoc[0],lx); 292 Dec(VicinityLoc[6],lx); 293 293 end 294 294 end; … … 306 306 end; 307 307 308 procedure V21_to_Loc(Loc0: integer; var VicinityLoc: TVicinity21Loc);309 var 310 dx,dy,bit,y0,xComp,yComp,xComp0,xCompSwitch: integer;311 dst: ^ integer;312 begin 313 y0:= cardinal(Loc0)*decompose24 shr 24;308 procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc); 309 var 310 dx,dy,bit,y0,xComp,yComp,xComp0,xCompSwitch: Integer; 311 dst: ^Integer; 312 begin 313 y0:=Cardinal(Loc0)*decompose24 shr 24; 314 314 xComp0:=Loc0-y0*G.lx-1; // Loc0 mod G.lx -1 315 315 xCompSwitch:=xComp0-1+y0 and 1; 316 if xComp0<0 then inc(xComp0,G.lx);317 if xCompSwitch<0 then inc(xCompSwitch,G.lx);316 if xComp0<0 then Inc(xComp0,G.lx); 317 if xCompSwitch<0 then Inc(xCompSwitch,G.lx); 318 318 xCompSwitch:=xCompSwitch xor xComp0; 319 319 yComp:=G.lx*(y0-3); … … 329 329 if bit and $67F7F76<>0 then dst^:=xComp+yComp 330 330 else dst^:=-1; 331 inc(xComp);332 if xComp>=G.lx then dec(xComp, G.lx);333 inc(dst);331 Inc(xComp); 332 if xComp>=G.lx then Dec(xComp, G.lx); 333 Inc(dst); 334 334 bit:=bit shl 1; 335 335 end; 336 inc(yComp,G.lx);336 Inc(yComp,G.lx); 337 337 end 338 338 else 339 339 begin 340 340 for dx:=0 to 3 do 341 begin dst^:=-$1000; inc(dst); end;341 begin dst^:=-$1000; Inc(dst); end; 342 342 end 343 343 end; … … 345 345 346 346 procedure Init(NewGameData: TNewGameData); 347 {$IFDEF DEBUG}var Loc: integer;{$ENDIF}347 {$IFDEF DEBUG}var Loc: Integer;{$ENDIF} 348 348 begin 349 349 G:=NewGameData; 350 350 MapSize:=G.lx*G.ly; 351 351 decompose24:=(1 shl 24-1) div G.lx +1; 352 {$IFDEF DEBUG}for Loc:=0 to MapSize-1 do assert(cardinal(Loc)*decompose24 shr 24=cardinal(Loc div G.lx));{$ENDIF}353 end; 354 355 356 constructor TCustomAI.Create(Nation: integer);352 {$IFDEF DEBUG}for Loc:=0 to MapSize-1 do Assert(Cardinal(Loc)*decompose24 shr 24=Cardinal(Loc div G.lx));{$ENDIF} 353 end; 354 355 356 constructor TCustomAI.Create(Nation: Integer); 357 357 begin 358 358 inherited Create; 359 me:=Nation;360 RO:= pointer(G.RO[Nation]);361 Map:= pointer(RO.Map);362 MyUnit:= pointer(RO.Un);363 MyCity:= pointer(RO.City);364 MyModel:= pointer(RO.Model);359 Me:=Nation; 360 RO:=Pointer(G.RO[Nation]); 361 Map:=Pointer(RO.Map); 362 MyUnit:=Pointer(RO.Un); 363 MyCity:=Pointer(RO.City); 364 MyModel:=Pointer(RO.Model); 365 365 Opponent:=-1; 366 366 end; … … 368 368 destructor TCustomAI.Destroy; 369 369 begin 370 Server(sSetDebugMap, me,0,nodata^);371 end; 372 373 374 procedure TCustomAI.Process(Command: integer; var Data);375 var 376 Nation,NewResearch,NewGov,count,ad,cix,iix: integer;370 Server(sSetDebugMap,Me,0,nodata^); 371 end; 372 373 374 procedure TCustomAI.Process(Command: Integer; var Data); 375 var 376 Nation,NewResearch,NewGov,count,ad,cix,iix: Integer; 377 377 NegoTime: TNegoTime; 378 378 begin … … 380 380 cTurn, cContinue: 381 381 begin 382 if RO.Alive and (1 shl me)=0 then382 if RO.Alive and (1 shl Me)=0 then 383 383 begin // I'm dead, huhu 384 Server(sTurn, me,0,nodata^);385 exit384 Server(sTurn,Me,0,nodata^); 385 Exit 386 386 end; 387 387 if Command=cTurn then 388 388 begin 389 fillchar(cixStateImp, sizeof(cixStateImp), $FF);389 FillChar(cixStateImp, SizeOf(cixStateImp), $FF); 390 390 for cix:=0 to RO.nCity-1 do if MyCity[cix].Loc>=0 then 391 391 for iix:=imPalace to imSpacePort do … … 396 396 NewGov:=ChooseGovernment; 397 397 if NewGov>gAnarchy then 398 Server(sSetGovernment, me,NewGov,nodata^);398 Server(sSetGovernment,Me,NewGov,nodata^); 399 399 end; 400 HaveTurned:= false;400 HaveTurned:=False; 401 401 Contacted:=[]; 402 402 end; … … 405 405 if OnNegoRejected_CancelTreaty then 406 406 if RO.Treaty[Opponent]>=trPeace then 407 if Server(sCancelTreaty, me,0,nodata^)<rExecuted then408 assert(false)407 if Server(sCancelTreaty,Me,0,nodata^)<rExecuted then 408 Assert(False) 409 409 end 410 410 else UnwantedNego:=[]; … … 415 415 if RO.Government<>gAnarchy then 416 416 for Nation:=0 to nPl-1 do 417 if (Nation<> me) and (1 shl Nation and RO.Alive<>0)417 if (Nation<>Me) and (1 shl Nation and RO.Alive<>0) 418 418 and (RO.Treaty[Nation]>=trNone) 419 419 and not (Nation in Contacted) and not (Nation in UnwantedNego) 420 and (Server(scContact-sExecute + Nation shl 4, me, 0, nodata^)>=rExecuted) then420 and (Server(scContact-sExecute + Nation shl 4, Me, 0, nodata^)>=rExecuted) then 421 421 if WantNegotiation(Nation, NegoTime) then 422 422 begin 423 if Server(scContact + Nation shl 4, me, 0, nodata^)>=rExecuted then423 if Server(scContact + Nation shl 4, Me, 0, nodata^)>=rExecuted then 424 424 begin 425 include(Contacted, Nation);425 Include(Contacted, Nation); 426 426 Opponent:=Nation; 427 427 MyAction:=scContact; 428 exit;428 Exit; 429 429 end; 430 430 end 431 else include(UnwantedNego,Nation);431 else Include(UnwantedNego,Nation); 432 432 if NegoTime=BeginOfTurn then 433 433 begin 434 434 DoTurn; 435 HaveTurned:= true;435 HaveTurned:=True; 436 436 Contacted:=[]; 437 437 UnwantedNego:=[]; 438 438 end 439 else break;440 until false;439 else Break; 440 until False; 441 441 if RO.Happened and phTech<>0 then 442 442 begin … … 446 446 count:=0; 447 447 for ad:=0 to nAdv-1 do if AdvanceResearchable(ad) then 448 begin inc(count); if random(count)=0 then NewResearch:=ad end448 begin Inc(count); if random(count)=0 then NewResearch:=ad end 449 449 end; 450 Server(sSetResearch, me,NewResearch,nodata^)450 Server(sSetResearch,Me,NewResearch,nodata^) 451 451 end; 452 if ( me=1) and (RO.Turn=800) then452 if (Me=1) and (RO.Turn=800) then 453 453 begin 454 454 count:=0; 455 Server(sReload, me,0,count)455 Server(sReload,Me,0,count) 456 456 end 457 457 else if (RO.Turn>10) and (random(1000)=0) then 458 458 begin 459 459 count:=RO.Turn-10; 460 Server(sReload, me,0,count)460 Server(sReload,Me,0,count) 461 461 end 462 else if Server(sTurn, me,0,nodata^)<rExecuted then463 assert(false);462 else if Server(sTurn,Me,0,nodata^)<rExecuted then 463 Assert(False); 464 464 end; 465 465 scContact: 466 if WantNegotiation( integer(Data), EnemyCalled) then466 if WantNegotiation(Integer(Data), EnemyCalled) then 467 467 begin 468 if Server(scDipStart, me, 0, nodata^)<rExecuted then469 assert(false);470 Opponent:= integer(Data);468 if Server(scDipStart, Me, 0, nodata^)<rExecuted then 469 Assert(False); 470 Opponent:=Integer(Data); 471 471 MyAction:=scDipStart; 472 472 end 473 473 else 474 474 begin 475 if Server(scReject, me, 0, nodata^)<rExecuted then476 assert(false);475 if Server(scReject, Me, 0, nodata^)<rExecuted then 476 Assert(False); 477 477 end; 478 478 scDipStart, scDipNotice, scDipAccept, scDipCancelTreaty, scDipOffer, scDipBreak: … … 486 486 else begin MyAction:=scDipOffer; MyOffer.nDeliver:=0; MyOffer.nCost:=0; end; 487 487 DoNegotiation; 488 assert((MyAction=scDipNotice) or (MyAction=scDipAccept)488 Assert((MyAction=scDipNotice) or (MyAction=scDipAccept) 489 489 or (MyAction=scDipCancelTreaty) or (MyAction=scDipOffer) 490 490 or (MyAction=scDipBreak)); 491 if MyAction=scDipOffer then Server(MyAction, me, 0, MyOffer)492 else Server(MyAction, me, 0, nodata^);491 if MyAction=scDipOffer then Server(MyAction, Me, 0, MyOffer) 492 else Server(MyAction, Me, 0, nodata^); 493 493 end; 494 494 cShowEndContact: … … 515 515 516 516 procedure TCustomAI.OnBeforeEnemyAttack(UnitInfo: TUnitInfo; ToLoc, EndHealth, 517 EndHealthDef: integer);518 begin 519 end; 520 521 procedure TCustomAI.OnBeforeEnemyCapture(UnitInfo: TUnitInfo; ToLoc: integer);517 EndHealthDef: Integer); 518 begin 519 end; 520 521 procedure TCustomAI.OnBeforeEnemyCapture(UnitInfo: TUnitInfo; ToLoc: Integer); 522 522 begin 523 523 end; … … 531 531 end; 532 532 533 function TCustomAI.ChooseResearchAdvance: integer;534 begin 535 result:=-1536 end; 537 538 function TCustomAI.ChooseStealAdvance: integer;539 begin 540 result:=-1541 end; 542 543 function TCustomAI.ChooseGovernment: integer;544 begin 545 result:=gDespotism546 end; 547 548 function TCustomAI.WantNegotiation(Nation: integer; NegoTime: TNegoTime): boolean;549 begin 550 result:=false;551 end; 552 553 function TCustomAI.OnNegoRejected_CancelTreaty: boolean;554 begin 555 result:=false;533 function TCustomAI.ChooseResearchAdvance: Integer; 534 begin 535 Result:=-1 536 end; 537 538 function TCustomAI.ChooseStealAdvance: Integer; 539 begin 540 Result:=-1 541 end; 542 543 function TCustomAI.ChooseGovernment: Integer; 544 begin 545 Result:=gDespotism 546 end; 547 548 function TCustomAI.WantNegotiation(Nation: Integer; NegoTime: TNegoTime): Boolean; 549 begin 550 Result:=False; 551 end; 552 553 function TCustomAI.OnNegoRejected_CancelTreaty: Boolean; 554 begin 555 Result:=False; 556 556 end; 557 557 {$HINTS ON} … … 559 559 procedure TCustomAI.StealAdvance; 560 560 var 561 Steal, ad, count: integer;561 Steal, ad, count: Integer; 562 562 begin 563 563 Steal:=ChooseStealAdvance; … … 566 566 count:=0; 567 567 for ad:=0 to nAdv-1 do if AdvanceStealable(ad) then 568 begin inc(count); if random(count)=0 then Steal:=ad end568 begin Inc(count); if random(count)=0 then Steal:=ad end 569 569 end; 570 if Steal>=0 then Server(sStealTech, me,Steal,nodata^);570 if Steal>=0 then Server(sStealTech,Me,Steal,nodata^); 571 571 RO.Happened:=RO.Happened and not phStealTech 572 572 end; 573 573 574 function TCustomAI.IsResearched(Advance: integer): boolean;575 begin 576 result:= RO.Tech[Advance]>=tsApplicable577 end; 578 579 function TCustomAI.ResearchCost: integer;580 begin 581 Server(sGetTechCost, me,0,result)582 end; 583 584 function TCustomAI.ChangeAttitude(Nation, Attitude: integer): integer;585 begin 586 result:=Server(sSetAttitude+Nation shl 4,me,Attitude,nodata^)587 end; 588 589 function TCustomAI.Revolution: integer;590 begin 591 result:=Server(sRevolution,me,0,nodata^);592 end; 593 594 function TCustomAI.ChangeRates(Tax,Lux: integer): integer;595 begin 596 result:=Server(sSetRates,me,Tax div 10 and $f+Lux div 10 and $fshl 4,nodata^)597 end; 598 599 function TCustomAI.PrepareNewModel(Domain: integer): integer;600 begin 601 result:=Server(sCreateDevModel,me,Domain,nodata^);602 end; 603 604 function TCustomAI.SetNewModelFeature(F, Count: integer): integer;605 begin 606 result:=Server(sSetDevModelCap+Count shl 4,me,F,nodata^)607 end; 608 609 function TCustomAI.AdvanceResearchable(Advance: integer): boolean;610 begin 611 result:= Server(sSetResearch-sExecute,me,Advance,nodata^)>=rExecuted;612 end; 613 614 function TCustomAI.AdvanceStealable(Advance: integer): boolean;615 begin 616 result:= Server(sStealTech-sExecute,me,Advance,nodata^)>=rExecuted;617 end; 618 619 function TCustomAI.DebugMessage(Level: integer; Text: string): boolean;620 begin 621 Text:= copy('P'+char(48+me)+' '+Text,1,254);622 Server(sMessage, me,Level,pchar(Text)^);623 624 result:=true;574 function TCustomAI.IsResearched(Advance: Integer): Boolean; 575 begin 576 Result:= RO.Tech[Advance]>=tsApplicable 577 end; 578 579 function TCustomAI.ResearchCost: Integer; 580 begin 581 Server(sGetTechCost,Me,0,Result) 582 end; 583 584 function TCustomAI.ChangeAttitude(Nation, Attitude: Integer): Integer; 585 begin 586 Result:=Server(sSetAttitude+Nation shl 4,Me,Attitude,nodata^) 587 end; 588 589 function TCustomAI.Revolution: Integer; 590 begin 591 Result:=Server(sRevolution,Me,0,nodata^); 592 end; 593 594 function TCustomAI.ChangeRates(Tax,Lux: Integer): Integer; 595 begin 596 Result:=Server(sSetRates,Me,Tax div 10 and $F+Lux div 10 and $F shl 4,nodata^) 597 end; 598 599 function TCustomAI.PrepareNewModel(Domain: Integer): Integer; 600 begin 601 Result:=Server(sCreateDevModel,Me,Domain,nodata^); 602 end; 603 604 function TCustomAI.SetNewModelFeature(F, Count: Integer): Integer; 605 begin 606 Result:=Server(sSetDevModelCap+Count shl 4,Me,F,nodata^) 607 end; 608 609 function TCustomAI.AdvanceResearchable(Advance: Integer): Boolean; 610 begin 611 Result:= Server(sSetResearch-sExecute,Me,Advance,nodata^)>=rExecuted; 612 end; 613 614 function TCustomAI.AdvanceStealable(Advance: Integer): Boolean; 615 begin 616 Result:= Server(sStealTech-sExecute,Me,Advance,nodata^)>=rExecuted; 617 end; 618 619 function TCustomAI.DebugMessage(Level: Integer; Text: string): Boolean; 620 begin 621 Text:=Copy('P'+char(48+Me)+' '+Text,1,254); 622 Server(sMessage,Me,Level,PChar(Text)^); 623 624 Result:=True; 625 625 // always returns true so that it can be used like 626 626 // "assert(DebugMessage(...));" -> not compiled in release build 627 627 end; 628 628 629 function TCustomAI.SetDebugMap(var DebugMap): boolean;630 begin 631 Server(sSetDebugMap, me, 0, DebugMap);632 633 result:=true;629 function TCustomAI.SetDebugMap(var DebugMap): Boolean; 630 begin 631 Server(sSetDebugMap, Me, 0, DebugMap); 632 633 Result:=True; 634 634 // always returns true so that it can be used like 635 635 // "assert(SetDebugMap(...));" -> not compiled in release build 636 636 end; 637 637 638 procedure TCustomAI.Unit_FindMyDefender(Loc: integer; var uix: integer);639 begin 640 if Server(sGetDefender, me,Loc,uix)<rExecuted then uix:=-1641 end; 642 643 procedure TCustomAI.Unit_FindEnemyDefender(Loc: integer; var euix: integer);638 procedure TCustomAI.Unit_FindMyDefender(Loc: Integer; var uix: Integer); 639 begin 640 if Server(sGetDefender,Me,Loc,uix)<rExecuted then uix:=-1 641 end; 642 643 procedure TCustomAI.Unit_FindEnemyDefender(Loc: Integer; var euix: Integer); 644 644 begin 645 645 euix:=RO.nEnemyUn-1; 646 646 while (euix>=0) and (RO.EnemyUn[euix].Loc<>Loc) do 647 dec(euix);648 end; 649 650 function TCustomAI.Unit_Move(uix,ToLoc: integer): integer;651 var 652 Step: integer;653 DestinationReached: boolean;647 Dec(euix); 648 end; 649 650 function TCustomAI.Unit_Move(uix,ToLoc: Integer): Integer; 651 var 652 Step: Integer; 653 DestinationReached: Boolean; 654 654 Advice: TMoveAdviceData; 655 655 begin 656 assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0)); // is a unit656 Assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0)); // is a unit 657 657 {Loc_to_ab(MyUnit[uix].Loc,ToLoc,a,b); 658 assert((a<>0) or (b<>0));659 if ( a>=-1) and (a<=1) and (b>=-1) and (b<=1) then658 Assert((A<>0) or (B<>0)); 659 if (A>=-1) and (A<=1) and (B>=-1) and (B<=1) then 660 660 begin // move to adjacent tile 661 !!!problem: if move is invalid, return codes are not consistent with other branch (eNoWay)661 !!!problem: if Move is invalid, return codes are not consistent with other branch (eNoWay) 662 662 Advice.nStep:=1; 663 Advice.dx[0]:= a-b;664 Advice.dy[0]:= a+b;663 Advice.dx[0]:=A-B; 664 Advice.dy[0]:=A+B; 665 665 Advice.MoreTurns:=0; 666 666 Advice.MaxHostile_MovementLeft:=MyUnit[uix].Movement; 667 result:=eOK;667 Result:=eOK; 668 668 end 669 669 else} … … 672 672 Advice.MoreTurns:=9999; 673 673 Advice.MaxHostile_MovementLeft:=100; 674 result:=Server(sGetMoveAdvice,me,uix,Advice);674 Result:=Server(sGetMoveAdvice,Me,uix,Advice); 675 675 end; 676 if result=eOk then676 if Result=eOk then 677 677 begin 678 DestinationReached:= false;678 DestinationReached:=False; 679 679 Step:=0; 680 680 repeat 681 if result and (rExecuted or rUnitRemoved)=rExecuted then // check if destination reached681 if Result and (rExecuted or rUnitRemoved)=rExecuted then // check if destination reached 682 682 if (ToLoc>=0) and (Advice.MoreTurns=0) and (Step=Advice.nStep-1) 683 683 and ((Map[ToLoc] and (fUnit or fOwned)=fUnit) // attack … … 685 685 and ((MyModel[MyUnit[uix].mix].Domain<>dGround) // bombardment 686 686 or (MyModel[MyUnit[uix].mix].Flags and mdCivil<>0))) then // can't capture 687 begin DestinationReached:= true; break end // stop next to destination687 begin DestinationReached:=True; Break end // stop next to destination 688 688 else if Step=Advice.nStep then 689 DestinationReached:= true; // normal move -- stop at destination690 691 if (Step=Advice.nStep) or ( result<>eOK) and (result<>eLoaded) then692 break;693 694 result:=Server(sMoveUnit+(Advice.dx[Step] and 7) shl 4 +(Advice.dy[Step] and 7) shl 7,695 me,uix,nodata^);696 inc(Step);689 DestinationReached:=True; // normal move -- stop at destination 690 691 if (Step=Advice.nStep) or (Result<>eOK) and (Result<>eLoaded) then 692 Break; 693 694 Result:=Server(sMoveUnit+(Advice.dx[Step] and 7) shl 4 +(Advice.dy[Step] and 7) shl 7, 695 Me,uix,nodata^); 696 Inc(Step); 697 697 if RO.Happened and phStealTech<>0 then StealAdvance; 698 until false;698 until False; 699 699 if DestinationReached then 700 700 if Advice.nStep=25 then 701 result:=Unit_Move(uix,ToLoc) // Shinkansen701 Result:=Unit_Move(uix,ToLoc) // Shinkansen 702 702 else if Advice.MoreTurns=0 then 703 result:=result or rLocationReached704 else result:=result or rMoreTurns;705 end 706 end; 707 708 function TCustomAI.Unit_Step(uix,ToLoc: integer): integer;709 var 710 a,b: integer;711 begin 712 Loc_to_ab(MyUnit[uix].Loc, ToLoc, a, b);713 assert(((a<>0) or (b<>0)) and (a>=-1) and (a<=1) and (b>=-1) and (b<=1));714 result:=Server(sMoveUnit+((a-b) and 7) shl 4 +((a+b) and 7) shl 7, me, uix, nodata^);703 Result:=Result or rLocationReached 704 else Result:=Result or rMoreTurns; 705 end 706 end; 707 708 function TCustomAI.Unit_Step(uix,ToLoc: Integer): Integer; 709 var 710 A,B: Integer; 711 begin 712 Loc_to_ab(MyUnit[uix].Loc, ToLoc, A, B); 713 Assert(((A<>0) or (B<>0)) and (A>=-1) and (A<=1) and (B>=-1) and (B<=1)); 714 Result:=Server(sMoveUnit+((A-B) and 7) shl 4 +((A+B) and 7) shl 7, Me, uix, nodata^); 715 715 if RO.Happened and phStealTech<>0 then StealAdvance; 716 716 end; 717 717 718 function TCustomAI.Unit_Attack(uix,ToLoc: integer): integer;719 var 720 a,b: integer;721 begin 722 assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0) // is a unit718 function TCustomAI.Unit_Attack(uix,ToLoc: Integer): Integer; 719 var 720 A,B: Integer; 721 begin 722 Assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0) // is a unit 723 723 and ((Map[ToLoc] and (fUnit or fOwned)=fUnit) // is an attack 724 724 or (Map[ToLoc] and (fCity or fOwned)=fCity) 725 725 and (MyModel[MyUnit[uix].mix].Domain<>dGround))); // is a bombardment 726 Loc_to_ab(MyUnit[uix].Loc,ToLoc, a,b);727 assert(((a<>0) or (b<>0)) and (a>=-1) and (a<=1) and (b>=-1) and (b<=1)); // attack to adjacent tile728 result:=Server(sMoveUnit+(a-b) and 7 shl 4 +(a+b) and 7 shl 7,me,uix,nodata^);729 end; 730 731 function TCustomAI.Unit_DoMission(uix,MissionType,ToLoc: integer): integer;732 var 733 a,b: integer;734 begin 735 result:=Server(sSetSpyMission + MissionType shl 4,me,0,nodata^);736 if result>=rExecuted then726 Loc_to_ab(MyUnit[uix].Loc,ToLoc,A,B); 727 Assert(((A<>0) or (B<>0)) and (A>=-1) and (A<=1) and (B>=-1) and (B<=1)); // attack to adjacent tile 728 Result:=Server(sMoveUnit+(A-B) and 7 shl 4 +(A+B) and 7 shl 7,Me,uix,nodata^); 729 end; 730 731 function TCustomAI.Unit_DoMission(uix,MissionType,ToLoc: Integer): Integer; 732 var 733 A,B: Integer; 734 begin 735 Result:=Server(sSetSpyMission + MissionType shl 4,Me,0,nodata^); 736 if Result>=rExecuted then 737 737 begin 738 assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0) // is a unit738 Assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0) // is a unit 739 739 and (MyModel[MyUnit[uix].mix].Kind=mkDiplomat)); // is a commando 740 Loc_to_ab(MyUnit[uix].Loc,ToLoc, a,b);741 assert(((a<>0) or (b<>0)) and (a>=-1) and (a<=1) and (b>=-1) and (b<=1)); // city must be adjacent742 result:=Server(sMoveUnit-sExecute+(a-b) and 7 shl 4 +(a+b) and 7 shl 7,me,uix,nodata^);743 if result=eMissionDone then744 result:=Server(sMoveUnit+(a-b) and 7 shl 4 +(a+b) and 7 shl 7,me,uix,nodata^)745 else if ( result<>eNoTime_Move) and (result<>eTreaty) and (result<>eNoTurn) then746 result:=eInvalid // not a special commando mission!747 end 748 end; 749 750 function TCustomAI.Unit_MoveForecast(uix,ToLoc: integer;751 var RemainingMovement: integer): boolean;740 Loc_to_ab(MyUnit[uix].Loc,ToLoc,A,B); 741 Assert(((A<>0) or (B<>0)) and (A>=-1) and (A<=1) and (B>=-1) and (B<=1)); // city must be adjacent 742 Result:=Server(sMoveUnit-sExecute+(A-B) and 7 shl 4 +(A+B) and 7 shl 7,Me,uix,nodata^); 743 if Result=eMissionDone then 744 Result:=Server(sMoveUnit+(A-B) and 7 shl 4 +(A+B) and 7 shl 7,Me,uix,nodata^) 745 else if (Result<>eNoTime_Move) and (Result<>eTreaty) and (Result<>eNoTurn) then 746 Result:=eInvalid // not a special commando mission! 747 end 748 end; 749 750 function TCustomAI.Unit_MoveForecast(uix,ToLoc: Integer; 751 var RemainingMovement: Integer): Boolean; 752 752 var 753 753 Advice: TMoveAdviceData; 754 754 begin 755 assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0)); // is a unit755 Assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0)); // is a unit 756 756 Advice.ToLoc:=ToLoc; 757 757 Advice.MoreTurns:=0; 758 758 Advice.MaxHostile_MovementLeft:=100; 759 if Server(sGetMoveAdvice, me,uix,Advice)=eOk then759 if Server(sGetMoveAdvice,Me,uix,Advice)=eOk then 760 760 begin 761 761 RemainingMovement:=Advice.MaxHostile_MovementLeft; 762 result:=true762 Result:=True 763 763 end 764 764 else 765 765 begin 766 766 RemainingMovement:=-1; 767 result:=false768 end 769 end; 770 771 function TCustomAI.Unit_AttackForecast(uix,ToLoc,AttackMovement: integer;772 var RemainingHealth: integer): boolean;767 Result:=False 768 end 769 end; 770 771 function TCustomAI.Unit_AttackForecast(uix,ToLoc,AttackMovement: Integer; 772 var RemainingHealth: Integer): Boolean; 773 773 var 774 774 BattleForecast: TBattleForecast; 775 775 begin 776 assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0) // is a unit776 Assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0) // is a unit 777 777 and (Map[ToLoc] and (fUnit or fOwned)=fUnit)); // is an attack 778 778 RemainingHealth:=-$100; 779 result:=false;779 Result:=False; 780 780 if AttackMovement>=0 then with MyUnit[uix] do 781 781 begin 782 BattleForecast.pAtt:= me;782 BattleForecast.pAtt:=Me; 783 783 BattleForecast.mixAtt:=mix; 784 784 BattleForecast.HealthAtt:=Health; … … 786 786 BattleForecast.FlagsAtt:=Flags; 787 787 BattleForecast.Movement:=AttackMovement; 788 if Server(sGetBattleForecast, me,ToLoc,BattleForecast)>=rExecuted then788 if Server(sGetBattleForecast,Me,ToLoc,BattleForecast)>=rExecuted then 789 789 begin 790 790 if BattleForecast.EndHealthAtt>0 then 791 791 RemainingHealth:=BattleForecast.EndHealthAtt 792 792 else RemainingHealth:=-BattleForecast.EndHealthDef; 793 result:=true793 Result:=True 794 794 end 795 795 end 796 796 end; 797 797 798 function TCustomAI.Unit_DefenseForecast(euix,ToLoc: integer;799 var RemainingHealth: integer): boolean;798 function TCustomAI.Unit_DefenseForecast(euix,ToLoc: Integer; 799 var RemainingHealth: Integer): Boolean; 800 800 var 801 801 BattleForecast: TBattleForecast; 802 802 begin 803 assert((euix>=0) and (euix<RO.nEnemyUn) and (RO.EnemyUn[euix].Loc>=0) // is an enemy unit803 Assert((euix>=0) and (euix<RO.nEnemyUn) and (RO.EnemyUn[euix].Loc>=0) // is an enemy unit 804 804 and (Map[ToLoc] and (fUnit or fOwned)=(fUnit or fOwned))); // is an attack 805 805 RemainingHealth:=$100; 806 result:=false;806 Result:=False; 807 807 with RO.EnemyUn[euix] do 808 808 begin … … 813 813 BattleForecast.FlagsAtt:=Flags; 814 814 BattleForecast.Movement:=100; 815 if Server(sGetBattleForecast, me,ToLoc,BattleForecast)>=rExecuted then815 if Server(sGetBattleForecast,Me,ToLoc,BattleForecast)>=rExecuted then 816 816 begin 817 817 if BattleForecast.EndHealthDef>0 then 818 818 RemainingHealth:=BattleForecast.EndHealthDef 819 819 else RemainingHealth:=-BattleForecast.EndHealthAtt; 820 result:=true820 Result:=True 821 821 end 822 822 end 823 823 end; 824 824 825 function TCustomAI.Unit_Disband(uix: integer): integer;826 begin 827 result:=Server(sRemoveUnit,me,uix,nodata^)828 end; 829 830 function TCustomAI.Unit_StartJob(uix,NewJob: integer): integer;831 begin 832 result:=Server(sStartJob+NewJob shl 4,me,uix,nodata^)833 end; 834 835 function TCustomAI.Unit_SetHomeHere(uix: integer): integer;836 begin 837 result:=Server(sSetUnitHome,me,uix,nodata^)838 end; 839 840 function TCustomAI.Unit_Load(uix: integer): integer;841 begin 842 result:=Server(sLoadUnit,me,uix,nodata^)843 end; 844 845 function TCustomAI.Unit_Unload(uix: integer): integer;846 begin 847 result:=Server(sUnloadUnit,me,uix,nodata^)848 end; 849 850 function TCustomAI.Unit_AddToCity(uix: integer): integer;851 begin 852 result:=Server(sAddToCity,me,uix,nodata^)853 end; 854 855 856 procedure TCustomAI.City_FindMyCity(Loc: integer; var cix: integer);825 function TCustomAI.Unit_Disband(uix: Integer): Integer; 826 begin 827 Result:=Server(sRemoveUnit,Me,uix,nodata^) 828 end; 829 830 function TCustomAI.Unit_StartJob(uix,NewJob: Integer): Integer; 831 begin 832 Result:=Server(sStartJob+NewJob shl 4,Me,uix,nodata^) 833 end; 834 835 function TCustomAI.Unit_SetHomeHere(uix: Integer): Integer; 836 begin 837 Result:=Server(sSetUnitHome,Me,uix,nodata^) 838 end; 839 840 function TCustomAI.Unit_Load(uix: Integer): Integer; 841 begin 842 Result:=Server(sLoadUnit,Me,uix,nodata^) 843 end; 844 845 function TCustomAI.Unit_Unload(uix: Integer): Integer; 846 begin 847 Result:=Server(sUnloadUnit,Me,uix,nodata^) 848 end; 849 850 function TCustomAI.Unit_AddToCity(uix: Integer): Integer; 851 begin 852 Result:=Server(sAddToCity,Me,uix,nodata^) 853 end; 854 855 856 procedure TCustomAI.City_FindMyCity(Loc: Integer; var cix: Integer); 857 857 begin 858 858 if Map[Loc] and (fCity or fOwned)<>fCity or fOwned then … … 862 862 cix:=RO.nCity-1; 863 863 while (cix>=0) and (MyCity[cix].Loc<>Loc) do 864 dec(cix);865 end 866 end; 867 868 procedure TCustomAI.City_FindEnemyCity(Loc: integer; var ecix: integer);864 Dec(cix); 865 end 866 end; 867 868 procedure TCustomAI.City_FindEnemyCity(Loc: Integer; var ecix: Integer); 869 869 begin 870 870 if Map[Loc] and (fCity or fOwned)<>fCity then … … 874 874 ecix:=RO.nEnemyCity-1; 875 875 while (ecix>=0) and (RO.EnemyCity[ecix].Loc<>Loc) do 876 dec(ecix);877 end 878 end; 879 880 function TCustomAI.City_HasProject(cix: integer): boolean;881 begin 882 result:= MyCity[cix].Project and (cpImp+cpIndex)<>cpImp+imTrGoods883 end; 884 885 function TCustomAI.City_CurrentImprovementProject(cix: integer): integer;886 begin 887 if MyCity[cix].Project and cpImp=0 then result:=-1876 Dec(ecix); 877 end 878 end; 879 880 function TCustomAI.City_HasProject(cix: Integer): Boolean; 881 begin 882 Result:= MyCity[cix].Project and (cpImp+cpIndex)<>cpImp+imTrGoods 883 end; 884 885 function TCustomAI.City_CurrentImprovementProject(cix: Integer): Integer; 886 begin 887 if MyCity[cix].Project and cpImp=0 then Result:=-1 888 888 else 889 889 begin 890 result:=MyCity[cix].Project and cpIndex;891 if result=imTrGoods then result:=-1892 end 893 end; 894 895 function TCustomAI.City_CurrentUnitProject(cix: integer): integer;896 begin 897 if MyCity[cix].Project and cpImp<>0 then result:=-1898 else result:=MyCity[cix].Project and cpIndex;899 end; 900 901 function TCustomAI.City_GetTileInfo(cix,TileLoc: integer; var TileInfo: TTileInfo): integer;890 Result:=MyCity[cix].Project and cpIndex; 891 if Result=imTrGoods then Result:=-1 892 end 893 end; 894 895 function TCustomAI.City_CurrentUnitProject(cix: Integer): Integer; 896 begin 897 if MyCity[cix].Project and cpImp<>0 then Result:=-1 898 else Result:=MyCity[cix].Project and cpIndex; 899 end; 900 901 function TCustomAI.City_GetTileInfo(cix,TileLoc: Integer; var TileInfo: TTileInfo): Integer; 902 902 begin 903 903 TileInfo.ExplCity:=cix; 904 result:=Server(sGetHypoCityTileInfo,me,TileLoc,TileInfo)905 end; 906 907 function TCustomAI.City_GetReport(cix: integer; var Report: TCityReport): integer;904 Result:=Server(sGetHypoCityTileInfo,Me,TileLoc,TileInfo) 905 end; 906 907 function TCustomAI.City_GetReport(cix: Integer; var Report: TCityReport): Integer; 908 908 begin 909 909 Report.HypoTiles:=-1; 910 910 Report.HypoTax:=-1; 911 911 Report.HypoLux:=-1; 912 result:=Server(sGetCityReport,me,cix,Report)913 end; 914 915 function TCustomAI.City_GetHypoReport(cix, HypoTiles, HypoTax, HypoLux: integer;916 var Report: TCityReport): integer;912 Result:=Server(sGetCityReport,Me,cix,Report) 913 end; 914 915 function TCustomAI.City_GetHypoReport(cix, HypoTiles, HypoTax, HypoLux: Integer; 916 var Report: TCityReport): Integer; 917 917 begin 918 918 Report.HypoTiles:=HypoTiles; 919 919 Report.HypoTax:=HypoTax; 920 920 Report.HypoLux:=HypoLux; 921 result:=Server(sGetCityReport,me,cix,Report)922 end; 923 924 function TCustomAI.City_GetAreaInfo(cix: integer; var AreaInfo: TCityAreaInfo): integer;925 begin 926 result:=Server(sGetCityAreaInfo,me,cix,AreaInfo)927 end; 928 929 function TCustomAI.City_StartUnitProduction(cix,mix: integer): integer;930 begin 931 result:=Server(sSetCityProject,me,cix,mix)932 end; 933 934 function TCustomAI.City_StartEmigration(cix,mix: integer;935 AllowDisbandCity, AsConscripts: boolean): integer;936 var 937 NewProject: integer;921 Result:=Server(sGetCityReport,Me,cix,Report) 922 end; 923 924 function TCustomAI.City_GetAreaInfo(cix: Integer; var AreaInfo: TCityAreaInfo): Integer; 925 begin 926 Result:=Server(sGetCityAreaInfo,Me,cix,AreaInfo) 927 end; 928 929 function TCustomAI.City_StartUnitProduction(cix,mix: Integer): Integer; 930 begin 931 Result:=Server(sSetCityProject,Me,cix,mix) 932 end; 933 934 function TCustomAI.City_StartEmigration(cix,mix: Integer; 935 AllowDisbandCity, AsConscripts: Boolean): Integer; 936 var 937 NewProject: Integer; 938 938 begin 939 939 NewProject:=mix; 940 940 if AllowDisbandCity then NewProject:=NewProject or cpDisbandCity; 941 941 if AsConscripts then NewProject:=NewProject or cpConscripts; 942 result:=Server(sSetCityProject,me,cix,NewProject)943 end; 944 945 function TCustomAI.City_StartImprovement(cix,iix: integer): integer;946 var 947 NewProject: integer;942 Result:=Server(sSetCityProject,Me,cix,NewProject) 943 end; 944 945 function TCustomAI.City_StartImprovement(cix,iix: Integer): Integer; 946 var 947 NewProject: Integer; 948 948 begin 949 949 NewProject:=iix+cpImp; 950 result:=Server(sSetCityProject,me,cix,NewProject)951 end; 952 953 function TCustomAI.City_Improvable(cix,iix: integer): boolean;954 var 955 NewProject: integer;950 Result:=Server(sSetCityProject,Me,cix,NewProject) 951 end; 952 953 function TCustomAI.City_Improvable(cix,iix: Integer): Boolean; 954 var 955 NewProject: Integer; 956 956 begin 957 957 NewProject:=iix+cpImp; 958 result:= Server(sSetCityProject-sExecute,me,cix,NewProject)>=rExecuted;959 end; 960 961 function TCustomAI.City_StopProduction(cix: integer): integer;962 var 963 NewProject: integer;958 Result:= Server(sSetCityProject-sExecute,Me,cix,NewProject)>=rExecuted; 959 end; 960 961 function TCustomAI.City_StopProduction(cix: Integer): Integer; 962 var 963 NewProject: Integer; 964 964 begin 965 965 NewProject:=imTrGoods+cpImp; 966 result:=Server(sSetCityProject,me,cix,NewProject)967 end; 968 969 function TCustomAI.City_BuyProject(cix: integer): integer;970 begin 971 result:=Server(sBuyCityProject,me,cix,nodata^)972 end; 973 974 function TCustomAI.City_SellImprovement(cix,iix: integer): integer;975 begin 976 result:=Server(sSellCityImprovement,me,cix,iix)977 end; 978 979 function TCustomAI.City_RebuildImprovement(cix,iix: integer): integer;980 begin 981 result:=Server(sRebuildCityImprovement,me,cix,iix)982 end; 983 984 function TCustomAI.City_SetTiles(cix,NewTiles: integer): integer;985 begin 986 result:=Server(sSetCityTiles,me,cix,NewTiles)966 Result:=Server(sSetCityProject,Me,cix,NewProject) 967 end; 968 969 function TCustomAI.City_BuyProject(cix: Integer): Integer; 970 begin 971 Result:=Server(sBuyCityProject,Me,cix,nodata^) 972 end; 973 974 function TCustomAI.City_SellImprovement(cix,iix: Integer): Integer; 975 begin 976 Result:=Server(sSellCityImprovement,Me,cix,iix) 977 end; 978 979 function TCustomAI.City_RebuildImprovement(cix,iix: Integer): Integer; 980 begin 981 Result:=Server(sRebuildCityImprovement,Me,cix,iix) 982 end; 983 984 function TCustomAI.City_SetTiles(cix,NewTiles: Integer): Integer; 985 begin 986 Result:=Server(sSetCityTiles,Me,cix,NewTiles) 987 987 end; 988 988 989 989 990 990 // negotiation 991 function TCustomAI.Nego_CheckMyAction: integer;992 begin 993 assert(Opponent>=0); // only allowed in negotiation mode994 assert((MyAction=scDipNotice) or (MyAction=scDipAccept)991 function TCustomAI.Nego_CheckMyAction: Integer; 992 begin 993 Assert(Opponent>=0); // only allowed in negotiation mode 994 Assert((MyAction=scDipNotice) or (MyAction=scDipAccept) 995 995 or (MyAction=scDipCancelTreaty) or (MyAction=scDipOffer) 996 996 or (MyAction=scDipBreak)); 997 if MyAction=scDipOffer then result:=Server(MyAction-sExecute, me, 0, MyOffer)998 else result:=Server(MyAction-sExecute, me, 0, nodata^);997 if MyAction=scDipOffer then Result:=Server(MyAction-sExecute, Me, 0, MyOffer) 998 else Result:=Server(MyAction-sExecute, Me, 0, nodata^); 999 999 end; 1000 1000 1001 1001 1002 1002 initialization 1003 nodata:= pointer(0);1003 nodata:=Pointer(0); 1004 1004 RWDataSize:=0; 1005 1005 -
branches/highdpi/AI/StdAI/Pile.pas
r303 r465 8 8 interface 9 9 10 procedure Create(Size: integer);10 procedure Create(Size: Integer); 11 11 procedure Free; 12 12 procedure Empty; 13 function Put(Item, Value: integer): boolean;14 function TestPut(Item, Value: integer): boolean;15 function Get(var Item, Value: integer): boolean;13 function Put(Item, Value: Integer): Boolean; 14 function TestPut(Item, Value: Integer): Boolean; 15 function Get(var Item, Value: Integer): Boolean; 16 16 17 17 … … 23 23 type 24 24 TheapItem = record 25 Item: integer;26 Value: integer;25 Item: Integer; 26 Value: Integer; 27 27 end; 28 28 29 29 var 30 30 bh: array[0..MaxSize - 1] of TheapItem; 31 Ix: array[0..MaxSize - 1] of integer;32 n, CurrentSize: integer;33 {$IFDEF DEBUG}InUse: boolean;{$ENDIF}31 Ix: array[0..MaxSize - 1] of Integer; 32 N, CurrentSize: Integer; 33 {$IFDEF DEBUG}InUse: Boolean;{$ENDIF} 34 34 35 35 36 procedure Create(Size: integer);36 procedure Create(Size: Integer); 37 37 begin 38 38 {$IFDEF DEBUG} 39 assert(not InUse, 'Pile is a single instance class, ' +39 Assert(not InUse, 'Pile is a single instance class, ' + 40 40 'no multiple usage possible. Always call Pile.Free after use.'); 41 41 {$ENDIF} 42 assert(Size <= MaxSize);43 if ( n<> 0) or (Size > CurrentSize) then42 Assert(Size <= MaxSize); 43 if (N <> 0) or (Size > CurrentSize) then 44 44 begin 45 FillChar(Ix, Size * sizeOf( integer), 255);46 n:= 0;45 FillChar(Ix, Size * sizeOf(Integer), 255); 46 N := 0; 47 47 end; 48 48 CurrentSize := Size; … … 55 55 begin 56 56 {$IFDEF DEBUG} 57 assert(InUse);57 Assert(InUse); 58 58 InUse := False; 59 59 {$ENDIF} … … 62 62 procedure Empty; 63 63 begin 64 if n<> 0 then64 if N <> 0 then 65 65 begin 66 FillChar(Ix, CurrentSize * sizeOf( integer), 255);67 n:= 0;66 FillChar(Ix, CurrentSize * sizeOf(Integer), 255); 67 N := 0; 68 68 end; 69 69 end; 70 70 71 71 //Parent(i) = (i-1)/2. 72 function Put(Item, Value: integer): boolean; //O(lg(n))72 function Put(Item, Value: Integer): Boolean; //O(lg(n)) 73 73 var 74 i, j: integer;74 I, J: Integer; 75 75 begin 76 assert(Item < CurrentSize);77 i:= Ix[Item];78 if i>= 0 then76 Assert(Item < CurrentSize); 77 I := Ix[Item]; 78 if I >= 0 then 79 79 begin 80 if bh[ i].Value <= Value then80 if bh[I].Value <= Value then 81 81 begin 82 82 Result := False; 83 exit;83 Exit; 84 84 end; 85 85 end 86 86 else 87 87 begin 88 i := n;89 Inc( n);88 I := N; 89 Inc(N); 90 90 end; 91 91 92 while i> 0 do92 while I > 0 do 93 93 begin 94 j := (i- 1) shr 1; //Parent(i) = (i-1)/295 if Value >= bh[ j].Value then96 break;97 bh[ i] := bh[j];98 Ix[bh[ i].Item] := i;99 i := j;94 J := (I - 1) shr 1; //Parent(i) = (i-1)/2 95 if Value >= bh[J].Value then 96 Break; 97 bh[I] := bh[J]; 98 Ix[bh[I].Item] := I; 99 I := J; 100 100 end; 101 101 // Insert the new Item at the insertion point found. 102 bh[ i].Value := Value;103 bh[ i].Item := Item;104 Ix[bh[ i].Item] := i;102 bh[I].Value := Value; 103 bh[I].Item := Item; 104 Ix[bh[I].Item] := I; 105 105 Result := True; 106 106 end; 107 107 108 function TestPut(Item, Value: integer): boolean;108 function TestPut(Item, Value: Integer): Boolean; 109 109 var 110 i: integer;110 I: Integer; 111 111 begin 112 assert(Item < CurrentSize);113 i:= Ix[Item];114 Result := ( i < 0) or (bh[i].Value > Value);112 Assert(Item < CurrentSize); 113 I := Ix[Item]; 114 Result := (I < 0) or (bh[I].Value > Value); 115 115 end; 116 116 117 117 //Left(i) = 2*i+1. 118 118 //Right(i) = 2*i+2 => Left(i)+1 119 function Get(var Item, Value: integer): boolean; //O(lg(n))119 function Get(var Item, Value: Integer): Boolean; //O(lg(n)) 120 120 var 121 i, j: integer;122 last: TheapItem;121 I, J: Integer; 122 Last: TheapItem; 123 123 begin 124 if n= 0 then124 if N = 0 then 125 125 begin 126 126 Result := False; 127 exit;127 Exit; 128 128 end; 129 129 … … 133 133 Ix[Item] := -1; 134 134 135 Dec( n);136 if n> 0 then135 Dec(N); 136 if N > 0 then 137 137 begin 138 last := bh[n];139 i:= 0;140 j:= 1;141 while j < ndo138 Last := bh[N]; 139 I := 0; 140 J := 1; 141 while J < N do 142 142 begin 143 143 // Right(i) = Left(i)+1 144 if ( j < n - 1) and (bh[j].Value > bh[j+ 1].Value) then145 Inc( j);146 if last.Value <= bh[j].Value then147 break;144 if (J < N - 1) and (bh[J].Value > bh[J + 1].Value) then 145 Inc(J); 146 if Last.Value <= bh[J].Value then 147 Break; 148 148 149 bh[ i] := bh[j];150 Ix[bh[ i].Item] := i;151 i := j;152 j := jshl 1 + 1; //Left(j) = 2*j+1149 bh[I] := bh[J]; 150 Ix[bh[I].Item] := I; 151 I := J; 152 J := J shl 1 + 1; //Left(j) = 2*j+1 153 153 end; 154 154 155 155 // Insert the root in the correct place in the heap. 156 bh[ i] := last;157 Ix[ last.Item] := i;156 bh[I] := Last; 157 Ix[Last.Item] := I; 158 158 end; 159 159 Result := True; … … 161 161 162 162 initialization 163 n:= 0;163 N := 0; 164 164 CurrentSize := 0; 165 165 {$IFDEF DEBUG} -
branches/highdpi/AI/StdAI/Protocol.pas
r349 r465 916 916 Cost: Integer; 917 917 Maint: Integer; 918 Expiration: integer;918 Expiration: Integer; 919 919 end 920 920 = ((Kind: ikWonder; Preq: adMathematics; Cost: 400; Maint: 0; … … 1120 1120 Strength: Integer; 1121 1121 Trans: Integer; 1122 Cost: integer;1122 Cost: Integer; 1123 1123 end 1124 1124 = (((Preq: adWarriorCode; Strength: 4; Trans: 0; Cost: 3), … … 1510 1510 TGetCityData = record 1511 1511 Owner: Integer; 1512 c: TCity;1512 C: TCity; 1513 1513 end; 1514 1514 … … 1591 1591 TCreateUnitData = record 1592 1592 Loc: Integer; 1593 p: Integer;1593 P: Integer; 1594 1594 mix: Integer; 1595 1595 end; … … 1600 1600 TOwnerList = array [0 .. INFIN] of ShortInt; 1601 1601 TByteList = array [0 .. INFIN] of Byte; 1602 TIntList = array [0 .. INFIN] of integer;1602 TIntList = array [0 .. INFIN] of Integer; 1603 1603 TCityList = array [0 .. INFIN] of TCity; 1604 1604 TUnList = array [0 .. INFIN] of TUn; … … 1761 1761 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))); 1762 1762 1763 SpecialModelPreq: array [0 .. nSpecialModel - 1] of integer = (preNone,1763 SpecialModelPreq: array [0 .. nSpecialModel - 1] of Integer = (preNone, 1764 1764 adExplosives, preNone, preNone, (* adWri, *) adIntelligence, adTrade, 1765 1765 (* adTheCorporation,adHorsebackRiding,adAutomobile,adNavigation, … … 1770 1770 DelphiRandSeed: Integer; 1771 1771 1772 procedure MakeUnitInfo( p: Integer; const u: TUn; var ui: TUnitInfo);1773 procedure MakeModelInfo( p, mix: Integer; const m: TModel; var mi: TModelInfo);1772 procedure MakeUnitInfo(P: Integer; const U: TUn; var ui: TUnitInfo); 1773 procedure MakeModelInfo(P, mix: Integer; const M: TModel; var mi: TModelInfo); 1774 1774 function IsSameModel(const mi1, mi2: TModelInfo): Boolean; 1775 1775 function SpecialTile(Loc, TerrType, lx: Integer): Integer; … … 1781 1781 implementation 1782 1782 1783 procedure MakeUnitInfo( p: Integer; const u: TUn; var ui: TUnitInfo);1783 procedure MakeUnitInfo(P: Integer; const U: TUn; var ui: TUnitInfo); 1784 1784 begin 1785 ui.Owner := p;1786 ui.Loc := u.Loc;1787 ui.Health := u.Health;1788 ui.Fuel := u.Fuel;1789 ui.Job := u.Job;1790 ui.Exp := u.Exp;1791 ui.Load := u.TroopLoad + u.AirLoad;1792 ui.mix := u.mix;1793 ui.Flags := u.Flags;1785 ui.Owner := P; 1786 ui.Loc := U.Loc; 1787 ui.Health := U.Health; 1788 ui.Fuel := U.Fuel; 1789 ui.Job := U.Job; 1790 ui.Exp := U.Exp; 1791 ui.Load := U.TroopLoad + U.AirLoad; 1792 ui.mix := U.mix; 1793 ui.Flags := U.Flags; 1794 1794 end; 1795 1795 1796 procedure MakeModelInfo( p, mix: Integer; const m: TModel; var mi: TModelInfo);1796 procedure MakeModelInfo(P, mix: Integer; const M: TModel; var mi: TModelInfo); 1797 1797 var 1798 i: Integer;1798 I: Integer; 1799 1799 begin 1800 mi.Owner := p;1800 mi.Owner := P; 1801 1801 mi.mix := mix; 1802 mi.ID := m.ID;1803 mi.Domain := m.Domain;1804 if m.Kind = mkEnemyDeveloped then1802 mi.ID := M.ID; 1803 mi.Domain := M.Domain; 1804 if M.Kind = mkEnemyDeveloped then 1805 1805 mi.Kind := mkSelfDeveloped // important for IsSameModel() 1806 1806 else 1807 mi.Kind := m.Kind;1808 mi.Attack := m.Attack;1809 mi.Defense := m.Defense;1810 mi.Speed := m.Speed;1811 mi.Cost := m.Cost;1807 mi.Kind := M.Kind; 1808 mi.Attack := M.Attack; 1809 mi.Defense := M.Defense; 1810 mi.Speed := M.Speed; 1811 mi.Cost := M.Cost; 1812 1812 if mi.Domain = dAir then 1813 1813 begin 1814 mi.TTrans := m.Cap[mcAirTrans] * m.MTrans;1815 mi.ATrans_Fuel := m.Cap[mcFuel];1814 mi.TTrans := M.Cap[mcAirTrans] * M.MTrans; 1815 mi.ATrans_Fuel := M.Cap[mcFuel]; 1816 1816 end 1817 1817 else 1818 1818 begin 1819 mi.TTrans := m.Cap[mcSeaTrans] * m.MTrans;1820 mi.ATrans_Fuel := m.Cap[mcCarrier] * m.MTrans;1821 end; 1822 mi.Bombs := m.Cap[mcBombs] * m.MStrength * 2;1819 mi.TTrans := M.Cap[mcSeaTrans] * M.MTrans; 1820 mi.ATrans_Fuel := M.Cap[mcCarrier] * M.MTrans; 1821 end; 1822 mi.Bombs := M.Cap[mcBombs] * M.MStrength * 2; 1823 1823 mi.Cap := 0; 1824 for i:= mcFirstNonCap to nFeature - 1 do1825 if m.Cap[i] > 0 then1826 mi.Cap := mi.Cap or (1 shl ( i- mcFirstNonCap));1824 for I := mcFirstNonCap to nFeature - 1 do 1825 if M.Cap[I] > 0 then 1826 mi.Cap := mi.Cap or (1 shl (I - mcFirstNonCap)); 1827 1827 mi.MaxUpgrade := 0; 1828 for i:= 1 to nUpgrade - 1 do1829 if m.Upgrades and (1 shl i) <> 0 then1830 mi.MaxUpgrade := i;1831 mi.Weight := m.Weight;1828 for I := 1 to nUpgrade - 1 do 1829 if M.Upgrades and (1 shl I) <> 0 then 1830 mi.MaxUpgrade := I; 1831 mi.Weight := M.Weight; 1832 1832 mi.Lost := 0; 1833 1833 end; … … 1841 1841 Compare1 := @mi1; 1842 1842 Compare2 := @mi2; 1843 result := (Compare1[1] and $FFFF0000 = Compare2[1] and $FFFF0000) and1843 Result := (Compare1[1] and $FFFF0000 = Compare2[1] and $FFFF0000) and 1844 1844 (Compare1[2] = Compare2[2]) and (Compare1[3] = Compare2[3]) and 1845 1845 (Compare1[4] = Compare2[4]) and (Compare1[5] = Compare2[5]) … … 1848 1848 function SpecialTile(Loc, TerrType, lx: Integer): Integer; 1849 1849 var 1850 x, y, qx, qy, a: Integer;1850 X, Y, qx, qy, A: Integer; 1851 1851 begin 1852 1852 if TerrType = fOcean then 1853 result := 01853 Result := 0 1854 1854 else 1855 1855 begin 1856 y:= Loc div lx;1857 x := Loc - y* lx;1856 Y := Loc div lx; 1857 X := Loc - Y * lx; 1858 1858 if TerrType = fGrass then { formula for productive grassland } 1859 if Odd((lymax + x - y shr 1) shr 1 + x + (y+ 1) shr 1) then1860 result := 11859 if Odd((lymax + X - Y shr 1) shr 1 + X + (Y + 1) shr 1) then 1860 Result := 1 1861 1861 else 1862 result := 01862 Result := 0 1863 1863 else { formula for special resources } 1864 1864 begin 1865 a := 4 * x - y+ 9980;1866 qx := adiv 10;1867 if (qx * 10 = a) and (qx and 3 <> 0) then1865 A := 4 * X - Y + 9980; 1866 qx := A div 10; 1867 if (qx * 10 = A) and (qx and 3 <> 0) then 1868 1868 begin 1869 qy := ( y + x) div 5;1869 qy := (Y + X) div 5; 1870 1870 if qy and 3 <> qx shr 2 and 1 * 2 then 1871 1871 if (TerrType = fArctic) or (TerrType = fSwamp) then 1872 result := 11872 Result := 1 1873 1873 else if TerrType = fShore then 1874 1874 begin 1875 1875 if (qx + qy) and 1 = 0 then 1876 1876 if qx and 3 = 2 then 1877 result := 21877 Result := 2 1878 1878 else 1879 result := 11879 Result := 1 1880 1880 else 1881 result := 01881 Result := 0 1882 1882 end 1883 1883 else 1884 result := (qx + qy) and 1 + 11884 Result := (qx + qy) and 1 + 1 1885 1885 else 1886 result := 0;1886 Result := 0; 1887 1887 end 1888 1888 else 1889 result := 0;1889 Result := 0; 1890 1890 end 1891 1891 end; -
branches/highdpi/AI/StdAI/StdAI.ai.txt
r124 r465 5 5 #PATH_WIN32 StdAI-win32.dll 6 6 #PATH_WIN64 StdAI-win64.dll 7 #PATH_LINUX32 libstdai-i386.so 8 #PATH_LINUX64 libstdai-amd64.so 7 #PATH_LINUX_I386 libstdai-i386.so 8 #PATH_LINUX_AMD64 libstdai-amd64.so 9 #PATH_LINUX_ARM32 libstdai-arm32.so 10 #PATH_LINUX_ARM64 libstdai-arm64.so 9 11 #CREDITS Standard AI by Steffen Gerlach. -
branches/highdpi/AI/StdAI/StdAI.lpr
r303 r465 12 12 var 13 13 AIList: array[0..nPl - 1] of TCustomAI; 14 Defender: integer;14 Defender: Integer; 15 15 16 16 17 procedure Client(Command, Player: integer; var Data); stdcall;17 procedure Client(Command, Player: Integer; var Data); stdcall; 18 18 var 19 p, y0, ToLoc: integer;19 P, y0, ToLoc: Integer; 20 20 UnitInfo: TUnitInfo; 21 21 begin … … 32 32 {$ENDIF} 33 33 CustomAI.Init(TNewGameData(Data)); 34 for p:= nPl - 1 downto 0 do35 if G.RO[ p] <> nil then34 for P := nPl - 1 downto 0 do 35 if G.RO[P] <> nil then 36 36 begin 37 AIList[ p] := TAI.Create(p);38 AIList[ p].SetDataDefaults;37 AIList[P] := TAI.Create(P); 38 AIList[P].SetDataDefaults; 39 39 end 40 40 else 41 AIList[ p] := nil;41 AIList[P] := nil; 42 42 Defender := -1; 43 43 end; 44 44 cGetReady: 45 for p:= nPl - 1 downto 0 do46 if AIList[ p] <> nil then47 AIList[ p].SetDataRandom;45 for P := nPl - 1 downto 0 do 46 if AIList[P] <> nil then 47 AIList[P].SetDataRandom; 48 48 cBreakGame: 49 for p:= 0 to nPl - 1 do50 if AIList[ p] <> nil then51 AIList[ p].Free;49 for P := 0 to nPl - 1 do 50 if AIList[P] <> nil then 51 AIList[P].Free; 52 52 53 53 cTurn, cContinue, scContact..scDipBreak, cShowEndContact: -
branches/highdpi/AI/StdAI/ToolAI.pas
r349 r465 11 11 type 12 12 TGroupTransportPlan = record 13 LoadLoc, uixTransport, nLoad, TurnsEmpty, TurnsLoaded: integer;14 uixLoad: array[0..15] of integer;13 LoadLoc, uixTransport, nLoad, TurnsEmpty, TurnsLoaded: Integer; 14 uixLoad: array[0..15] of Integer; 15 15 end; 16 16 … … 18 18 TToolAI = class(TCustomAI) 19 19 protected 20 {$IFDEF DEBUG}DebugMap: array[0..lxmax * lymax - 1] of integer;{$ENDIF}21 22 function CenterOfEmpire: integer;20 {$IFDEF DEBUG}DebugMap: array[0..lxmax * lymax - 1] of Integer;{$ENDIF} 21 22 function CenterOfEmpire: Integer; 23 23 // tile that is in the middle of all own cities 24 24 25 function CityTaxBalance(cix: integer; const CityReport: TCityReport): integer;25 function CityTaxBalance(cix: Integer; const CityReport: TCityReport): Integer; 26 26 // calculates exact difference of income and maintenance cost for a single city 27 27 // positive result = income higher than maintenance … … 29 29 // respects production and food converted to gold 30 30 // CityReport must have been prepared before 31 procedure SumCities(TaxRate: integer; var TaxSum, ScienceSum: integer);31 procedure SumCities(TaxRate: Integer; var TaxSum, ScienceSum: Integer); 32 32 // calculates exact total tax and science income 33 33 // tax is reduced by maintenance (so might be negative) … … 46 46 procedure JobAssignment_Initialize; 47 47 // initialization, must be called first of the JobAssignment functions 48 procedure JobAssignment_AddJob(Loc, Job, Score: integer);48 procedure JobAssignment_AddJob(Loc, Job, Score: Integer); 49 49 // add job for settlers with certain score 50 50 // jobs include founding cities! 51 procedure JobAssignment_AddUnit(uix: integer);51 procedure JobAssignment_AddUnit(uix: Integer); 52 52 // add a settler unit to do jobs 53 53 procedure JobAssignment_Go; … … 57 57 // starting a job one turn earlier counts the same as 4 points of score 58 58 // function does not cancel jobs that are already started 59 function JobAssignment_GotJob(uix: integer): boolean;59 function JobAssignment_GotJob(uix: Integer): Boolean; 60 60 // can be called after JobAssignment_Go to find out whether 61 61 // a certain settler has been assigned a job to … … 64 64 // calculates formations and districts 65 65 66 function CheckStep(MoveStyle, TimeBeforeStep, CrossCorner: integer;67 var TimeAfterStep, RecoverTurns: integer; FromTile, ToTile: integer;68 IsCapture: boolean): integer;66 function CheckStep(MoveStyle, TimeBeforeStep, CrossCorner: Integer; 67 var TimeAfterStep, RecoverTurns: Integer; FromTile, ToTile: Integer; 68 IsCapture: Boolean): Integer; 69 69 // forecast single unit move between adjacent tiles 70 70 // format of TimeBeforeStep and TimeAfterStep: $1000*number of turns + $800-MP left … … 74 74 // CrossCorner=1 for long moves that cross the tile corner, =0 for short ones that don't 75 75 76 function GetMyMoveStyle(mix, Health: integer): integer;77 78 function Unit_MoveEx(uix, ToLoc: integer; Options: integer = 0): integer;76 function GetMyMoveStyle(mix, Health: Integer): Integer; 77 78 function Unit_MoveEx(uix, ToLoc: Integer; Options: Integer = 0): Integer; 79 79 80 80 procedure SeaTransport_BeginInitialize; … … 90 90 // - all transports have same capacity 91 91 // - no transport is damaged 92 procedure SeaTransport_AddLoad(uix: integer);93 procedure SeaTransport_AddTransport(uix: integer);94 procedure SeaTransport_AddDestination(Loc: integer);95 function SeaTransport_MakeGroupPlan(var TransportPlan: TGroupTransportPlan): boolean;92 procedure SeaTransport_AddLoad(uix: Integer); 93 procedure SeaTransport_AddTransport(uix: Integer); 94 procedure SeaTransport_AddDestination(Loc: Integer); 95 function SeaTransport_MakeGroupPlan(var TransportPlan: TGroupTransportPlan): Boolean; 96 96 // make plan for group of units to transport from a single loading location by a single transport 97 97 // the plan optimizes: … … 103 103 // function returns false if no more transports are possible 104 104 105 function CurrentMStrength(Domain: integer): integer; 106 end; 107 105 function CurrentMStrength(Domain: Integer): Integer; 106 end; 108 107 109 108 const … … 132 131 mxAdjacent = $00000001; 133 132 134 135 var 136 nContinent, nOcean, nDistrict: integer; 137 Formation: array[0..lxmax * lymax - 1] of integer; 133 var 134 nContinent, nOcean, nDistrict: Integer; 135 Formation: array[0..lxmax * lymax - 1] of Integer; 138 136 // water: ocean index, land: continent index, sorted by size 139 137 // territory unpassable due to peace treaty divides a continent 140 District: array[0..lxmax * lymax - 1] of integer;138 District: array[0..lxmax * lymax - 1] of Integer; 141 139 // index of coherent own territory, sorted by size 142 CityResult: array[0..nCmax - 1] of integer;143 144 Advancedness: array[0..nAdv - 1] of integer;140 CityResult: array[0..nCmax - 1] of Integer; 141 142 Advancedness: array[0..nAdv - 1] of Integer; 145 143 // total number of prerequisites for each advance 146 147 144 148 145 implementation … … 152 149 153 150 type 154 pinteger = ^ integer;151 pinteger = ^Integer; 155 152 156 153 var 157 154 // for JobAssignment 158 MaxScore: integer;159 TileJob, TileJobScore: array[0..lxmax * lymax - 1] of byte;160 JobLocOfSettler: array[0..nUmax - 1] of integer; // ToAssign = find job155 MaxScore: Integer; 156 TileJob, TileJobScore: array[0..lxmax * lymax - 1] of Byte; 157 JobLocOfSettler: array[0..nUmax - 1] of Integer; // ToAssign = find job 161 158 162 159 // for Transport 163 TransportMoveStyle, TransportCapacity, nTransportLoad: integer; 164 InitComplete, HaveDestinations: boolean; 165 uixTransportLoad, TransportAvailable: array[0..nUmax - 1] of integer; 166 TurnsAfterLoad: array[0..lxmax * lymax - 1] of shortint; 167 168 169 procedure ReplaceD(Start, Stop: pinteger; Raider, Twix: integer); 160 TransportMoveStyle, TransportCapacity, nTransportLoad: Integer; 161 InitComplete, HaveDestinations: Boolean; 162 uixTransportLoad, TransportAvailable: array[0..nUmax - 1] of Integer; 163 TurnsAfterLoad: array[0..lxmax * lymax - 1] of ShortInt; 164 165 procedure ReplaceD(Start, Stop: pinteger; Raider, Twix: Integer); 170 166 begin 171 167 while Start <> Stop do … … 177 173 end; 178 174 179 function NextZero(Start, Stop: pinteger; Mask: cardinal): pinteger;175 function NextZero(Start, Stop: pinteger; Mask: Cardinal): pinteger; 180 176 begin 181 177 while (Start <> Stop) and (Start^ and Mask <> 0) do … … 184 180 end; 185 181 186 187 function TToolAI.CenterOfEmpire: integer; 188 var 189 cix, Loc, x, y, sy, n: integer; 190 a, su, sv: double; 191 begin 192 n := 0; 182 function TToolAI.CenterOfEmpire: Integer; 183 var 184 cix, Loc, X, Y, sy, N: Integer; 185 A, su, sv: Double; 186 begin 187 N := 0; 193 188 sy := 0; 194 189 su := 0; … … 199 194 if Loc >= 0 then 200 195 begin 201 y:= Loc div G.lx;202 x := Loc - y* G.lx;203 Inc(sy, y);204 a := 2 * pi * x/ G.lx;205 su := su + cos( a);206 sv := sv + sin( a);207 Inc( n);208 end; 209 end; 210 a:= arctan2(sv, su);211 x := round(G.lx * a/ (2 * pi));212 while x>= G.lx do213 Dec( x, G.lx);214 while x< 0 do215 Inc( x, G.lx);216 Result := ((2 * sy + n) div (2 * n)) * G.lx + x;217 end; 218 219 function TToolAI.CityTaxBalance(cix: integer; const CityReport: TCityReport): integer;220 var 221 i: integer;196 Y := Loc div G.lx; 197 X := Loc - Y * G.lx; 198 Inc(sy, Y); 199 A := 2 * pi * X / G.lx; 200 su := su + cos(A); 201 sv := sv + sin(A); 202 Inc(N); 203 end; 204 end; 205 A := arctan2(sv, su); 206 X := round(G.lx * A / (2 * pi)); 207 while X >= G.lx do 208 Dec(X, G.lx); 209 while X < 0 do 210 Inc(X, G.lx); 211 Result := ((2 * sy + N) div (2 * N)) * G.lx + X; 212 end; 213 214 function TToolAI.CityTaxBalance(cix: Integer; const CityReport: TCityReport): Integer; 215 var 216 I: Integer; 222 217 begin 223 218 Result := 0; … … 234 229 Inc(Result, CityReport.FoodRep - CityReport.Eaten); 235 230 end; 236 for i:= nWonder to nImp - 1 do237 if MyCity[cix].Built[ i] > 0 then238 Dec(Result, Imp[ i].Maint);239 end; 240 241 procedure TToolAI.SumCities(TaxRate: integer; var TaxSum, ScienceSum: integer);242 var 243 cix, p1: integer;231 for I := nWonder to nImp - 1 do 232 if MyCity[cix].Built[I] > 0 then 233 Dec(Result, Imp[I].Maint); 234 end; 235 236 procedure TToolAI.SumCities(TaxRate: Integer; var TaxSum, ScienceSum: Integer); 237 var 238 cix, p1: Integer; 244 239 CityReport: TCityReport; 245 240 begin … … 247 242 ScienceSum := 0; 248 243 if RO.Government = gAnarchy then 249 exit;244 Exit; 250 245 for p1 := 0 to nPl - 1 do 251 246 if RO.Tribute[p1] <= RO.TributePaid[p1] then … … 263 258 end; 264 259 265 266 260 //------------------------------------------------------------------------------ 267 261 // City Tiles Processing … … 274 268 procedure TToolAI.OptimizeCityTiles; 275 269 var 276 cix: integer;270 cix: Integer; 277 271 begin 278 272 for cix := 0 to RO.nCity - 1 do … … 284 278 procedure TToolAI.GetCityProdPotential; 285 279 var 286 cix: integer;280 cix: Integer; 287 281 Advice: TCityTileAdviceData; 288 282 begin … … 292 286 begin 293 287 Advice.ResourceWeights := rwMaxProd; 294 Server(sGetCityTileAdvice, me, cix, Advice);288 Server(sGetCityTileAdvice, Me, cix, Advice); 295 289 CityResult[cix] := Advice.CityReport.ProdRep; // considers factory, but shouldn't 296 290 end; … … 299 293 procedure TToolAI.GetCityTradePotential; 300 294 var 301 cix: integer;295 cix: Integer; 302 296 Advice: TCityTileAdviceData; 303 297 begin … … 307 301 begin 308 302 Advice.ResourceWeights := rwMaxScience; 309 Server(sGetCityTileAdvice, me, cix, Advice);303 Server(sGetCityTileAdvice, Me, cix, Advice); 310 304 CityResult[cix] := Advice.CityReport.Trade; 311 305 end; 312 306 end; 313 314 307 315 308 //------------------------------------------------------------------------------ … … 321 314 procedure TToolAI.JobAssignment_Initialize; 322 315 begin 323 fillchar(JobLocOfSettler, RO.nUn * sizeof(integer), $FF); // -1324 fillchar(TileJob, MapSize, jNone);325 fillchar(TileJobScore, MapSize, 0);316 FillChar(JobLocOfSettler, RO.nUn * SizeOf(Integer), $FF); // -1 317 FillChar(TileJob, MapSize, jNone); 318 FillChar(TileJobScore, MapSize, 0); 326 319 MaxScore := 0; 327 320 end; 328 321 329 procedure TToolAI.JobAssignment_AddJob(Loc, Job, Score: integer);322 procedure TToolAI.JobAssignment_AddJob(Loc, Job, Score: Integer); 330 323 begin 331 324 if Score > 255 then … … 340 333 end; 341 334 342 procedure TToolAI.JobAssignment_AddUnit(uix: integer);343 begin 344 assert(MyModel[MyUnit[uix].mix].Kind in [mkSettler, mkSlaves]);335 procedure TToolAI.JobAssignment_AddUnit(uix: Integer); 336 begin 337 Assert(MyModel[MyUnit[uix].mix].Kind in [mkSettler, mkSlaves]); 345 338 JobLocOfSettler[uix] := ToAssign; 346 339 end; 347 340 348 function TToolAI.JobAssignment_GotJob(uix: integer): boolean;341 function TToolAI.JobAssignment_GotJob(uix: Integer): Boolean; 349 342 begin 350 343 Result := JobLocOfSettler[uix] >= 0; … … 354 347 const 355 348 DistanceScore = 4; 356 StepSizeByTerrain: array[0..11] of integer =349 StepSizeByTerrain: array[0..11] of Integer = 357 350 (0, 0, 1, 2, 1, 1, 0, 1, 0, 1, 1, 2); 358 351 //Oc-Sh-Gr-De-Pr-Tu-Ar-Sw-XX-Fo-Hi-Mo 359 352 var 360 353 uix, BestScore, BestCount, BestLoc, BestJob, BestDistance, TestLoc, 361 NextLoc, TestDistance, V8, TestScore, StepSize, MoveResult: integer;362 UnitsToAssign: boolean;354 NextLoc, TestDistance, V8, TestScore, StepSize, MoveResult: Integer; 355 UnitsToAssign: Boolean; 363 356 Adjacent: TVicinity8Loc; 364 357 SettlerOfJobLoc, DistToLoc: array[0..lxmax * lymax - 1] of smallint; 365 358 // DistToLoc is only defined where SettlerOfJobLoc>=0 366 TileChecked: array[0..lxmax * lymax - 1] of boolean;367 begin 368 fillchar(SettlerOfJobLoc, MapSize * 2, $FF); // -1359 TileChecked: array[0..lxmax * lymax - 1] of Boolean; 360 begin 361 FillChar(SettlerOfJobLoc, MapSize * 2, $FF); // -1 369 362 370 363 // keep up jobs that are already started … … 387 380 BestJob := jNone; 388 381 BestScore := -999999; 389 FillChar(TileChecked, MapSize * sizeof(boolean), False);382 FillChar(TileChecked, MapSize * SizeOf(Boolean), False); 390 383 Pile.Create(MapSize); 391 384 Pile.Put(MyUnit[uix].Loc, 0); // start search for new job at current location … … 406 399 and (Map[NextLoc] and (fUnit or fOwned) <> fUnit) // no foreign unit 407 400 and ((RO.Territory[NextLoc] < 0) or 408 (RO.Territory[NextLoc] = me)) // no foreign territory401 (RO.Territory[NextLoc] = Me)) // no foreign territory 409 402 and (Map[TestLoc] and Map[NextLoc] and fInEnemyZoC = 0) then 410 403 // move not prevented by ZoC … … 421 414 ((SettlerOfJobLoc[TestLoc] < 0) or (DistToLoc[TestLoc] > TestDistance)) then 422 415 begin 423 TestScore := integer(TileJobScore[TestLoc]) - DistanceScore * TestDistance;416 TestScore := Integer(TileJobScore[TestLoc]) - DistanceScore * TestDistance; 424 417 if TestScore > BestScore then 425 418 BestCount := 0; … … 469 462 Unit_StartJob(uix, TileJob[JobLocOfSettler[uix]]); 470 463 end; 471 end; // JobAssignment_Go 472 464 end; 473 465 474 466 //------------------------------------------------------------------------------ … … 477 469 procedure TToolAI.AnalyzeMap; 478 470 var 479 i, j, Loc, Loc1, V8, Count, Kind, MostIndex: integer;471 I, J, Loc, Loc1, V8, Count, Kind, MostIndex: Integer; 480 472 Adjacent: TVicinity8Loc; 481 473 IndexOfID: array[0..lxmax * lymax - 1] of smallint; 482 474 IDOfIndex: array[0..lxmax * lymax div 2 - 1] of smallint; 483 475 begin 484 fillchar(District, MapSize * 4, $FF);476 FillChar(District, MapSize * 4, $FF); 485 477 for Loc := 0 to MapSize - 1 do 486 478 if Map[Loc] and fTerrain = fUNKNOWN then … … 508 500 Formation[Loc], Formation[Loc1]); 509 501 end; 510 if (RO.Territory[Loc] = me) and (Map[Loc] and fTerrain >= fGrass) then502 if (RO.Territory[Loc] = Me) and (Map[Loc] and fTerrain >= fGrass) then 511 503 begin 512 504 District[Loc] := Loc; … … 553 545 Inc(Count); 554 546 end; 555 for i:= 0 to Count - 2 do556 begin 557 MostIndex := i;558 for j := i+ 1 to Count - 1 do559 if IndexOfID[IDOfIndex[ j]] > IndexOfID[IDOfIndex[MostIndex]] then560 MostIndex := j;561 if MostIndex <> ithen562 begin 563 j := IDOfIndex[i];564 IDOfIndex[ i] := IDOfIndex[MostIndex];565 IDOfIndex[MostIndex] := j;566 end; 567 end; 568 for i:= 0 to Count - 1 do569 IndexOfID[IDOfIndex[ i]] := i;547 for I := 0 to Count - 2 do 548 begin 549 MostIndex := I; 550 for J := I + 1 to Count - 1 do 551 if IndexOfID[IDOfIndex[J]] > IndexOfID[IDOfIndex[MostIndex]] then 552 MostIndex := J; 553 if MostIndex <> I then 554 begin 555 J := IDOfIndex[I]; 556 IDOfIndex[I] := IDOfIndex[MostIndex]; 557 IDOfIndex[MostIndex] := J; 558 end; 559 end; 560 for I := 0 to Count - 1 do 561 IndexOfID[IDOfIndex[I]] := I; 570 562 571 563 case Kind of … … 594 586 end; 595 587 end; 596 597 588 598 589 //------------------------------------------------------------------------------ … … 614 605 // other: | Basic | 0| Speed | X X X | MaxTerrType | 615 606 616 function TToolAI.GetMyMoveStyle(mix, Health: integer): integer;607 function TToolAI.GetMyMoveStyle(mix, Health: Integer): Integer; 617 608 begin 618 609 with MyModel[mix] do … … 623 614 begin 624 615 Inc(Result, (50 + (Speed - 150) * 13 shr 7) shl 8); //HeavyCost 625 if RO.Wonder[woShinkansen].EffectiveOwner <> me then616 if RO.Wonder[woShinkansen].EffectiveOwner <> Me then 626 617 Inc(Result, Speed * (4 * 1311) shr 17); // RailCost 627 if (RO.Wonder[woGardens].EffectiveOwner <> me) or618 if (RO.Wonder[woGardens].EffectiveOwner <> Me) or 628 619 (Kind = mkSettler) and (Speed >= 200) then 629 620 Inc(Result, msHostile); … … 640 631 begin 641 632 Result := Speed; 642 if RO.Wonder[woMagellan].EffectiveOwner = me then633 if RO.Wonder[woMagellan].EffectiveOwner = Me then 643 634 Inc(Result, 200); 644 635 if Health < 100 then … … 655 646 end; 656 647 657 function TToolAI.CheckStep(MoveStyle, TimeBeforeStep, CrossCorner: integer;658 var TimeAfterStep, RecoverTurns: integer; FromTile, ToTile: integer;659 IsCapture: boolean): integer;660 var 661 MoveCost, RecoverCost: integer;648 function TToolAI.CheckStep(MoveStyle, TimeBeforeStep, CrossCorner: Integer; 649 var TimeAfterStep, RecoverTurns: Integer; FromTile, ToTile: Integer; 650 IsCapture: Boolean): Integer; 651 var 652 MoveCost, RecoverCost: Integer; 662 653 begin 663 654 //IsCapture:=true; 664 assert(((FromTile and fTerrain <= fMountains) or (FromTile and655 Assert(((FromTile and fTerrain <= fMountains) or (FromTile and 665 656 fTerrain = fUNKNOWN)) and ((ToTile and fTerrain <= fMountains) or 666 657 (ToTile and fTerrain = fUNKNOWN))); … … 710 701 if ToTile and fPeace <> 0 then 711 702 Result := csCheckTerritory; 712 exit;703 Exit; 713 704 end; 714 705 end; … … 829 820 begin 830 821 Result := csForbiddenTile; 831 exit;822 Exit; 832 823 end; 833 824 end … … 878 869 // must wait for next turn 879 870 Result := csOk; 880 exit;871 Exit; 881 872 end; 882 873 end; … … 898 889 Result := csForbiddenTile; 899 890 end; 900 end; // CheckStep891 end; 901 892 902 893 (* 903 894 -------- Pathfinding Reference Implementation -------- 904 895 var 905 MoveStyle,V8,Loc,Time,NextLoc,NextTime,RecoverTurns: integer;896 MoveStyle,V8,Loc,Time,NextLoc,NextTime,RecoverTurns: Integer; 906 897 Adjacent: TVicinity8Loc; 907 Reached: array[0..lxmax*lymax-1] of boolean;908 begin 909 fillchar(Reached, MapSize, false);898 Reached: array[0..lxmax*lymax-1] of Boolean; 899 begin 900 FillChar(Reached, MapSize, False); 910 901 MoveStyle:=GetMyMoveStyle(MyUnit[uix].mix, MyUnit[uix].Health); 911 902 Pile.Create(MapSize); … … 915 906 // todo: check exit condition, e.g. whether destination reached 916 907 917 Reached[Loc]:= true;908 Reached[Loc]:=True; 918 909 V8_to_Loc(Loc, Adjacent); 919 910 for V8:=0 to 7 do … … 925 916 Pile.Put(NextLoc, NextTime+RecoverTurns*$1000); 926 917 csForbiddenTile: 927 Reached[NextLoc]:= true; // don't check moving there again918 Reached[NextLoc]:=True; // don't check moving there again 928 919 csCheckTerritory: 929 920 if RO.Territory[NextLoc]=RO.Territory[Loc] then … … 936 927 *) 937 928 938 function TToolAI.Unit_MoveEx(uix, ToLoc: integer; Options: integer): integer;929 function TToolAI.Unit_MoveEx(uix, ToLoc: Integer; Options: Integer): Integer; 939 930 var 940 931 Loc, NextLoc, Temp, FromLoc, EndLoc, Time, V8, MoveResult, RecoverTurns, 941 NextTime, MoveStyle: integer;932 NextTime, MoveStyle: Integer; 942 933 Adjacent: TVicinity8Loc; 943 PreLoc: array[0..lxmax * lymax - 1] of integer;944 Reached: array[0..lxmax * lymax - 1] of boolean;934 PreLoc: array[0..lxmax * lymax - 1] of Integer; 935 Reached: array[0..lxmax * lymax - 1] of Boolean; 945 936 begin 946 937 Result := eOk; 947 938 FromLoc := MyUnit[uix].Loc; 948 939 if FromLoc = ToLoc then 949 exit;940 Exit; 950 941 951 942 FillChar(Reached, MapSize, False); … … 1012 1003 begin 1013 1004 Result := MoveResult; 1014 break;1005 Break; 1015 1006 end; 1016 1007 end; … … 1020 1011 end; 1021 1012 1022 1023 1013 //------------------------------------------------------------------------------ 1024 1014 // Oversea Transport … … 1026 1016 procedure TToolAI.SeaTransport_BeginInitialize; 1027 1017 begin 1028 fillchar(TransportAvailable, RO.nUn * sizeof(integer), $FF); // -11018 FillChar(TransportAvailable, RO.nUn * SizeOf(Integer), $FF); // -1 1029 1019 InitComplete := False; 1030 1020 HaveDestinations := False; … … 1035 1025 end; 1036 1026 1037 procedure TToolAI.SeaTransport_AddLoad(uix: integer);1038 var 1039 i: integer;1040 begin 1041 assert(not InitComplete); // call order violation!1027 procedure TToolAI.SeaTransport_AddLoad(uix: Integer); 1028 var 1029 I: Integer; 1030 begin 1031 Assert(not InitComplete); // call order violation! 1042 1032 if Map[MyUnit[uix].Loc] and fTerrain < fGrass then 1043 exit;1044 for i:= 0 to nTransportLoad - 1 do1045 if uix = uixTransportLoad[ i] then1046 exit;1033 Exit; 1034 for I := 0 to nTransportLoad - 1 do 1035 if uix = uixTransportLoad[I] then 1036 Exit; 1047 1037 uixTransportLoad[nTransportLoad] := uix; 1048 1038 Inc(nTransportLoad); 1049 1039 end; 1050 1040 1051 procedure TToolAI.SeaTransport_AddTransport(uix: integer);1052 var 1053 MoveStyle: integer;1054 begin 1055 assert(not InitComplete); // call order violation!1056 assert(MyModel[MyUnit[uix].mix].Cap[mcSeaTrans] > 0);1041 procedure TToolAI.SeaTransport_AddTransport(uix: Integer); 1042 var 1043 MoveStyle: Integer; 1044 begin 1045 Assert(not InitComplete); // call order violation! 1046 Assert(MyModel[MyUnit[uix].mix].Cap[mcSeaTrans] > 0); 1057 1047 TransportAvailable[uix] := 1; 1058 1048 with MyModel[MyUnit[uix].mix] do … … 1068 1058 end; 1069 1059 1070 procedure TToolAI.SeaTransport_AddDestination(Loc: integer);1071 begin 1072 assert(not InitComplete); // call order violation!1060 procedure TToolAI.SeaTransport_AddDestination(Loc: Integer); 1061 begin 1062 Assert(not InitComplete); // call order violation! 1073 1063 Pile.Put(Loc, $800); 1074 1064 HaveDestinations := True; … … 1077 1067 procedure TToolAI.SeaTransport_EndInitialize; 1078 1068 var 1079 Loc0, Time0, V8, Loc1, ArriveTime, RecoverTurns: integer;1069 Loc0, Time0, V8, Loc1, ArriveTime, RecoverTurns: Integer; 1080 1070 Adjacent: TVicinity8Loc; 1081 1071 begin 1082 assert(not InitComplete); // call order violation!1072 Assert(not InitComplete); // call order violation! 1083 1073 InitComplete := True; 1084 1074 if HaveDestinations then 1085 1075 begin // calculate TurnsAfterLoad from destination locs 1086 fillchar(TurnsAfterLoad, MapSize, $FF); // -11076 FillChar(TurnsAfterLoad, MapSize, $FF); // -1 1087 1077 while Pile.Get(Loc0, Time0) do 1088 1078 begin // search backward … … 1109 1099 end; 1110 1100 1111 1112 1101 function TToolAI.SeaTransport_MakeGroupPlan( 1113 var TransportPlan: TGroupTransportPlan): boolean;1114 var 1115 V8, i, j, iPicked, uix, Loc0, Time0, Loc1, RecoverTurns, MoveStyle,1102 var TransportPlan: TGroupTransportPlan): Boolean; 1103 var 1104 V8, I, J, iPicked, uix, Loc0, Time0, Loc1, RecoverTurns, MoveStyle, 1116 1105 TurnsLoaded, TurnCount, tuix, tuix1, ArriveTime, TotalDelay, 1117 1106 BestTotalDelay, GroupCount, BestGroupCount, BestLoadLoc, FullMovementLoc, 1118 nSelectedLoad, f, OriginContinent, a, b: integer;1119 CompleteFlag, NotReachedFlag, ContinueUnit: cardinal;1120 IsComplete, ok, IsFirstLoc: boolean;1107 nSelectedLoad, F, OriginContinent, A, B: Integer; 1108 CompleteFlag, NotReachedFlag, ContinueUnit: Cardinal; 1109 IsComplete, ok, IsFirstLoc: Boolean; 1121 1110 StartLocPtr, ArrivedEnd: pinteger; 1122 1111 Adjacent: TVicinity8Loc; 1123 uixSelectedLoad: array[0..15] of integer;1124 tuixSelectedLoad: array[0..15] of integer;1125 Arrived: array[0..lxmax * lymax] of cardinal;1112 uixSelectedLoad: array[0..15] of Integer; 1113 tuixSelectedLoad: array[0..15] of Integer; 1114 Arrived: array[0..lxmax * lymax] of Cardinal; 1126 1115 ResponsibleTransport: array[0..lxmax * lymax - 1] of smallint; 1127 TurnsBeforeLoad: array[0..lxmax * lymax - 1] of shortint;1128 GroupComplete: array[0..lxmax * lymax - 1] of boolean;1129 begin 1130 assert(InitComplete); // call order violation!1116 TurnsBeforeLoad: array[0..lxmax * lymax - 1] of ShortInt; 1117 GroupComplete: array[0..lxmax * lymax - 1] of Boolean; 1118 begin 1119 Assert(InitComplete); // call order violation! 1131 1120 1132 1121 if HaveDestinations and (nTransportLoad > 0) then … … 1139 1128 for tuix := 0 to nTransportLoad - 1 do 1140 1129 begin 1141 Loc_to_ab(MyUnit[uix].Loc, MyUnit[uixTransportLoad[tuix]].Loc, a, b);1142 if (abs( a) <= 1) and (abs(b) <= 1) then1130 Loc_to_ab(MyUnit[uix].Loc, MyUnit[uixTransportLoad[tuix]].Loc, A, B); 1131 if (abs(A) <= 1) and (abs(B) <= 1) then 1143 1132 begin 1144 assert((a <> 0) or (b<> 0));1133 Assert((A <> 0) or (B <> 0)); 1145 1134 Inc(GroupCount); 1146 1135 end; … … 1156 1145 for tuix := nTransportLoad - 1 downto 0 do 1157 1146 begin 1158 Loc_to_ab(TransportPlan.LoadLoc, MyUnit[uixTransportLoad[tuix]].Loc, a, b);1159 if (abs( a) <= 1) and (abs(b) <= 1) then1147 Loc_to_ab(TransportPlan.LoadLoc, MyUnit[uixTransportLoad[tuix]].Loc, A, B); 1148 if (abs(A) <= 1) and (abs(B) <= 1) then 1160 1149 begin 1161 1150 TransportPlan.uixLoad[TransportPlan.nLoad] := uixTransportLoad[tuix]; … … 1164 1153 Inc(TransportPlan.nLoad); 1165 1154 if TransportPlan.nLoad = TransportCapacity then 1166 break;1155 Break; 1167 1156 end; 1168 1157 end; 1169 1158 Result := True; 1170 exit;1159 Exit; 1171 1160 end; 1172 1161 end; … … 1176 1165 begin 1177 1166 // select units from same continent 1178 fillchar(Arrived, 4 * nContinent, 0); // misuse Arrived as counter1167 FillChar(Arrived, 4 * nContinent, 0); // misuse Arrived as counter 1179 1168 for tuix := 0 to nTransportLoad - 1 do 1180 1169 begin 1181 assert(Map[MyUnit[uixTransportLoad[tuix]].Loc] and fTerrain >= fGrass);1182 f:= Formation[MyUnit[uixTransportLoad[tuix]].Loc];1183 if f>= 0 then1184 Inc(Arrived[ f]);1170 Assert(Map[MyUnit[uixTransportLoad[tuix]].Loc] and fTerrain >= fGrass); 1171 F := Formation[MyUnit[uixTransportLoad[tuix]].Loc]; 1172 if F >= 0 then 1173 Inc(Arrived[F]); 1185 1174 end; 1186 1175 OriginContinent := 0; 1187 for f:= 1 to nContinent - 1 do1188 if Arrived[ f] > Arrived[OriginContinent] then1189 OriginContinent := f;1176 for F := 1 to nContinent - 1 do 1177 if Arrived[F] > Arrived[OriginContinent] then 1178 OriginContinent := F; 1190 1179 nSelectedLoad := 0; 1191 1180 for tuix := 0 to nTransportLoad - 1 do … … 1196 1185 Inc(nSelectedLoad); 1197 1186 if nSelectedLoad = 16 then 1198 break;1187 Break; 1199 1188 end; 1200 1189 1201 1190 Pile.Create(MapSize); 1202 fillchar(ResponsibleTransport, MapSize * 2, $FF); // -11203 fillchar(TurnsBeforeLoad, MapSize, $FF); // -11191 FillChar(ResponsibleTransport, MapSize * 2, $FF); // -1 1192 FillChar(TurnsBeforeLoad, MapSize, $FF); // -1 1204 1193 ok := False; 1205 1194 for uix := 0 to RO.nUn - 1 do … … 1214 1203 Result := False; 1215 1204 Pile.Free; 1216 exit;1205 Exit; 1217 1206 end; 1218 1207 while Pile.Get(Loc0, Time0) do … … 1235 1224 end; 1236 1225 1237 fillchar(Arrived, MapSize * 4, $55); // set NotReachedFlag for all tiles1238 fillchar(GroupComplete, MapSize, False);1226 FillChar(Arrived, MapSize * 4, $55); // set NotReachedFlag for all tiles 1227 FillChar(GroupComplete, MapSize, False); 1239 1228 BestLoadLoc := -1; 1240 1229 … … 1243 1232 begin 1244 1233 uix := uixSelectedLoad[tuix]; 1245 if MyUnit[uix].Movement = integer(MyModel[MyUnit[uix].mix].Speed) then1234 if MyUnit[uix].Movement = Integer(MyModel[MyUnit[uix].mix].Speed) then 1246 1235 begin 1247 1236 NotReachedFlag := 1 shl (2 * tuix); … … 1257 1246 if (TurnsBeforeLoad[Loc1] >= 0) and (TurnsAfterLoad[Loc1] >= 0) then 1258 1247 begin 1259 i:= 1;1248 I := 1; 1260 1249 GroupCount := 0; 1261 1250 for tuix1 := 0 to nSelectedLoad - 1 do 1262 1251 begin 1263 if Arrived[loc1] and i= 0 then1252 if Arrived[loc1] and I = 0 then 1264 1253 Inc(GroupCount); 1265 i := ishl 2;1254 I := I shl 2; 1266 1255 end; 1267 assert(GroupCount <= TransportCapacity);1256 Assert(GroupCount <= TransportCapacity); 1268 1257 if (GroupCount = TransportCapacity) or (GroupCount = nSelectedLoad) then 1269 1258 GroupComplete[loc1] := True; … … 1303 1292 begin 1304 1293 Pile.Put(MyUnit[uix].Loc, $1800 - MyUnit[uix].Movement); 1305 if MyUnit[uix].Movement = integer(MyModel[MyUnit[uix].mix].Speed) then1294 if MyUnit[uix].Movement = Integer(MyModel[MyUnit[uix].mix].Speed) then 1306 1295 FullMovementLoc := MyUnit[uix].Loc; 1307 1296 // surrounding tiles can be loaded immediately … … 1319 1308 if StartLocPtr <> ArrivedEnd then 1320 1309 begin 1321 Loc0 := ( integer(StartLocPtr) - integer(@Arrived)) shr 2;1310 Loc0 := (Integer(StartLocPtr) - Integer(@Arrived)) shr 2; 1322 1311 Inc(StartLocPtr); 1323 1312 Time0 := $800; … … 1327 1316 if IsFirstLoc then 1328 1317 ContinueUnit := ContinueUnit and not (1 shl tuix); 1329 break;1318 Break; 1330 1319 end; 1331 1320 IsFirstLoc := False; … … 1334 1323 if not GroupComplete[Loc0] and (Map[Loc0] and fTerrain <> fMountains) then 1335 1324 begin // check whether group complete -- no mountains because complete flag might be faked there 1336 i:= 1;1325 I := 1; 1337 1326 GroupCount := 0; 1338 1327 for tuix1 := 0 to nSelectedLoad - 1 do 1339 1328 begin 1340 if Arrived[Loc0] and i= 0 then1329 if Arrived[Loc0] and I = 0 then 1341 1330 Inc(GroupCount); 1342 i := ishl 2;1331 I := I shl 2; 1343 1332 end; 1344 assert(GroupCount <= TransportCapacity);1333 Assert(GroupCount <= TransportCapacity); 1345 1334 if (GroupCount = TransportCapacity) or (GroupCount = nSelectedLoad) then 1346 1335 GroupComplete[Loc0] := True; … … 1364 1353 if (TurnsBeforeLoad[Loc1] >= 0) and (TurnsAfterLoad[Loc1] >= 0) then 1365 1354 begin 1366 i:= 1;1355 I := 1; 1367 1356 GroupCount := 0; 1368 1357 for tuix1 := 0 to nSelectedLoad - 1 do 1369 1358 begin 1370 if Arrived[loc1] and i= 0 then1359 if Arrived[loc1] and I = 0 then 1371 1360 Inc(GroupCount); 1372 i := ishl 2;1361 I := I shl 2; 1373 1362 end; 1374 assert(GroupCount <= TransportCapacity);1363 Assert(GroupCount <= TransportCapacity); 1375 1364 if (GroupCount = TransportCapacity) or 1376 1365 (GroupCount = nSelectedLoad) then … … 1447 1436 if 1 shl (2 * tuix) and Arrived[BestLoadLoc] = 0 then 1448 1437 begin 1449 assert(uixTransportLoad[tuixSelectedLoad[tuix]] = uixSelectedLoad[tuix]);1438 Assert(uixTransportLoad[tuixSelectedLoad[tuix]] = uixSelectedLoad[tuix]); 1450 1439 TransportPlan.uixLoad[TransportPlan.nLoad] := uixSelectedLoad[tuix]; 1451 1440 uixTransportLoad[tuixSelectedLoad[tuix]] := … … 1455 1444 end; 1456 1445 Result := True; 1457 exit;1446 Exit; 1458 1447 end; 1459 1448 … … 1462 1451 for tuix := nSelectedLoad - 1 downto 0 do 1463 1452 begin 1464 assert(uixTransportLoad[tuixSelectedLoad[tuix]] = uixSelectedLoad[tuix]);1453 Assert(uixTransportLoad[tuixSelectedLoad[tuix]] = uixSelectedLoad[tuix]); 1465 1454 uixTransportLoad[tuixSelectedLoad[tuix]] := 1466 1455 uixTransportLoad[nTransportLoad - 1]; … … 1472 1461 end; 1473 1462 1474 1475 1463 //------------------------------------------------------------------------------ 1476 1464 // Misc 1477 1465 1478 function TToolAI.CurrentMStrength(Domain: integer): integer;1479 var 1480 i: integer;1466 function TToolAI.CurrentMStrength(Domain: Integer): Integer; 1467 var 1468 I: Integer; 1481 1469 begin 1482 1470 Result := 0; 1483 for i:= 0 to nUpgrade - 1 do1484 with upgrade[Domain, i] do1471 for I := 0 to nUpgrade - 1 do 1472 with upgrade[Domain, I] do 1485 1473 if (Preq = preNone) or (Preq >= 0) and 1486 1474 ((RO.Tech[Preq] >= tsApplicable) or (Preq in FutureTech) and … … 1494 1482 end; 1495 1483 1496 1497 1484 //------------------------------------------------------------------------------ 1498 1485 1499 1486 procedure SetAdvancedness; 1500 1487 var 1501 ad, j, Reduction, AgeThreshold: integer;1502 known: array[0..nAdv - 1] of integer;1503 1504 procedure MarkPreqs(ad: integer);1488 ad, J, Reduction, AgeThreshold: Integer; 1489 known: array[0..nAdv - 1] of Integer; 1490 1491 procedure MarkPreqs(ad: Integer); 1505 1492 var 1506 i: integer;1493 I: Integer; 1507 1494 begin 1508 1495 if known[ad] = 0 then 1509 1496 begin 1510 1497 known[ad] := 1; 1511 for i:= 0 to 2 do1512 if AdvPreq[ad, i] >= 0 then1513 MarkPreqs(AdvPreq[ad, i]);1498 for I := 0 to 2 do 1499 if AdvPreq[ad, I] >= 0 then 1500 MarkPreqs(AdvPreq[ad, I]); 1514 1501 end; 1515 1502 end; … … 1521 1508 FillChar(known, SizeOf(known), 0); 1522 1509 MarkPreqs(ad); 1523 for j:= 0 to nAdv - 1 do1524 if known[ j] > 0 then1510 for J := 0 to nAdv - 1 do 1511 if known[J] > 0 then 1525 1512 Inc(Advancedness[ad]); 1526 1513 end; -
branches/highdpi/Back.lfm
r246 r465 8 8 Caption = 'C-evo' 9 9 Color = clBlack 10 DesignTimePPI = 144 10 11 Font.Color = clWindowText 11 Font.Height = - 1312 Font.Height = -30 12 13 Font.Name = 'MS Sans Serif' 13 14 OnClose = FormClose … … 16 17 OnPaint = FormPaint 17 18 OnShow = FormShow 18 LCLVersion = '1.6.2.0' 19 WindowState = wsMaximized 20 PixelsPerInch = 96 19 ShowInTaskBar = stNever 20 LCLVersion = '2.2.0.4' 21 21 Scaled = False 22 WindowState = wsFullScreen 22 23 end -
branches/highdpi/Back.pas
r349 r465 51 51 begin 52 52 if Assigned(Img) then 53 DpiBit Canvas(Canvas, DpiScreen.Width - Img.Width - (DpiScreen.Width - 800) *53 DpiBitBltCanvas(Canvas, DpiScreen.Width - Img.Width - (DpiScreen.Width - 800) * 54 54 3 div 8, (DpiScreen.Height - 600) div 3, Img.Width, Img.Height, 55 55 Img.Canvas, 0, 0); … … 70 70 if FileExists(FileName) then begin 71 71 Img := TDpiBitmap.Create; 72 LoadGraphicFile(img, FileName); 72 LoadGraphicFile(Img, FileName); 73 Repaint; 73 74 end; 74 75 end; -
branches/highdpi/Brain.pas
r464 r465 1 unit UBrain; 2 3 {$mode delphi} 1 unit Brain; 4 2 5 3 interface 6 4 7 5 uses 8 UDpiControls, Classes, SysUtils, fgl, Graphics, Protocol, LazFileUtils, dynlibs; 6 UDpiControls, Classes, SysUtils, Generics.Collections, Graphics, Protocol, LazFileUtils, 7 dynlibs, Types; 9 8 10 9 const … … 35 34 Picture: TDpiBitmap; 36 35 Beginner: Boolean; 36 procedure LoadPicture; 37 37 procedure LoadFromFile(AIFileName: string); 38 38 constructor Create; … … 42 42 { TBrains } 43 43 44 TBrains = class(T FPGObjectList<TBrain>)44 TBrains = class(TObjectList<TBrain>) 45 45 function AddNew: TBrain; 46 46 function GetKindCount(Kind: TBrainType): Integer; 47 47 procedure GetByKind(Kind: TBrainType; Brains: TBrains); 48 48 function GetBeginner: TBrain; 49 procedure LoadPictures; 49 50 end; 50 51 … … 53 54 54 55 uses 55 ScreenTools ;56 ScreenTools, Directories; 56 57 57 58 { TBrain } 59 60 procedure TBrain.LoadPicture; 61 var 62 TextSize: TSize; 63 begin 64 if not LoadGraphicFile(Picture, GetAiDir + DirectorySeparator + 65 FileName + DirectorySeparator + FileName + '.png', [gfNoError]) then begin 66 with Picture.Canvas do begin 67 Brush.Color := $904830; 68 FillRect(Rect(0, 0, 64, 64)); 69 Font.Assign(UniFont[ftTiny]); 70 Font.Style := []; 71 Font.Color := $5FDBFF; 72 TextSize := TextExtent(FileName); 73 TextOut(32 - TextSize.Width div 2, 32 - TextSize.Height div 2, FileName); 74 end; 75 end; 76 end; 58 77 59 78 procedure TBrain.LoadFromFile(AIFileName: string); … … 106 125 DLLName := BasePath + DirectorySeparator + Value 107 126 {$ENDIF}{$ENDIF} 108 {$IFDEF LINUX}{$IFDEF CPU32} 109 else if Key = '#PATH_LINUX32' then 110 DLLName := BasePath + DirectorySeparator + Value 111 {$ENDIF}{$ENDIF} 112 {$IFDEF LINUX}{$IFDEF CPU64} 113 else if Key = '#PATH_LINUX64' then 127 {$IFDEF UNIX}{$IFDEF CPUI386} 128 else if Key = '#PATH_LINUX_I386' then 129 DLLName := BasePath + DirectorySeparator + Value 130 {$ENDIF}{$ENDIF} 131 {$IFDEF UNIX}{$IFDEF CPUAMD64} 132 else if Key = '#PATH_LINUX_AMD64' then 133 DLLName := BasePath + DirectorySeparator + Value 134 {$ENDIF}{$ENDIF} 135 {$IFDEF UNIX}{$IFDEF CPUARM} 136 else if Key = '#PATH_LINUX_ARM32' then 137 DLLName := BasePath + DirectorySeparator + Value 138 {$ENDIF}{$ENDIF} 139 {$IFDEF UNIX}{$IFDEF CPUAARCH64} 140 else if Key = '#PATH_LINUX_ARM64' then 114 141 DLLName := BasePath + DirectorySeparator + Value 115 142 {$ENDIF}{$ENDIF} … … 177 204 end; 178 205 206 procedure TBrains.LoadPictures; 207 var 208 I: Integer; 209 begin 210 for I := 0 to Count - 1 do 211 with Items[I] do LoadPicture; 212 end; 213 179 214 end. 180 215 216 217 -
branches/highdpi/CityProcessing.pas
r349 r465 8 8 9 9 // Reporting 10 procedure GetCityAreaInfo( p, Loc: integer; var CityAreaInfo: TCityAreaInfo);11 function CanCityGrow( p, cix: integer): boolean;12 function GetCityReport( p, cix: integer; var CityReport: TCityReport): integer;13 function GetCityReportNew( p, cix: integer;14 var CityReportNew: TCityReportNew): integer;10 procedure GetCityAreaInfo(P, Loc: Integer; var CityAreaInfo: TCityAreaInfo); 11 function CanCityGrow(P, cix: Integer): Boolean; 12 function GetCityReport(P, cix: Integer; var CityReport: TCityReport): Integer; 13 function GetCityReportNew(P, cix: Integer; 14 var CityReportNew: TCityReportNew): Integer; 15 15 16 16 // Internal Tile Picking 17 function AddBestCityTile( p, cix: integer): boolean;18 procedure CityGrowth( p, cix: integer);19 procedure CityShrink( p, cix: integer);20 procedure Pollute( p, cix: integer);17 function AddBestCityTile(P, cix: Integer): Boolean; 18 procedure CityGrowth(P, cix: Integer); 19 procedure CityShrink(P, cix: Integer); 20 procedure Pollute(P, cix: Integer); 21 21 22 22 // Turn Processing 23 procedure PayCityMaintenance( p, cix: integer);24 procedure CollectCityResources( p, cix: integer);25 function CityTurn( p, cix: integer): boolean;23 procedure PayCityMaintenance(P, cix: Integer); 24 procedure CollectCityResources(P, cix: Integer); 25 function CityTurn(P, cix: Integer): Boolean; 26 26 27 27 // Tile Access 28 function SetCityTiles( p, cix, NewTiles: integer;29 TestOnly: boolean = false): integer;30 procedure GetCityTileAdvice( p, cix: integer; var Advice: TCityTileAdviceData);28 function SetCityTiles(P, cix, NewTiles: Integer; 29 TestOnly: Boolean = False): Integer; 30 procedure GetCityTileAdvice(P, cix: Integer; var Advice: TCityTileAdviceData); 31 31 32 32 // Start/End Game … … 34 34 procedure ReleaseGame; 35 35 36 36 37 implementation 37 38 38 39 type 39 40 TTradeProcessing = record 40 TaxBonus, LuxBonus, ScienceBonus, FutResBonus, ScienceDoubling, 41 HappyBase: integer; 42 RelCorr: single; 43 FlexibleLuxury: boolean; 41 TaxBonus: Integer; 42 LuxBonus: Integer; 43 ScienceBonus: Integer; 44 FutResBonus: Integer; 45 ScienceDoubling: Integer; 46 HappyBase: Integer; 47 RelCorr: Single; 48 FlexibleLuxury: Boolean; 44 49 end; 45 50 46 51 TProdProcessing = record 47 ProdBonus, PollBonus, FutProdBonus, PollThreshold: integer; 52 ProdBonus: Integer; 53 PollBonus: Integer; 54 FutProdBonus: Integer; 55 PollThreshold: Integer; 48 56 end; 49 57 … … 51 59 52 60 TCityReportEx = record 53 BaseHappiness, BaseControl, Material: integer; 61 BaseHappiness: Integer; 62 BaseControl: Integer; 63 Material: Integer; 54 64 ProdProcessing: TProdProcessing; 55 65 TradeProcessing: TTradeProcessing; … … 57 67 58 68 var 59 MaxDist: integer;60 61 62 63 64 65 procedure GetCityAreaInfo( p, Loc: integer; var CityAreaInfo: TCityAreaInfo);66 var 67 V21, Loc1, p1: integer;69 MaxDist: Integer; 70 71 { 72 Reporting 73 ____________________________________________________________________ 74 } 75 procedure GetCityAreaInfo(P, Loc: Integer; var CityAreaInfo: TCityAreaInfo); 76 var 77 V21, Loc1, p1: Integer; 68 78 Radius: TVicinity21Loc; 69 79 begin 70 {$IFOPT O-} assert(1 shl pand InvalidTreatyMap = 0); {$ENDIF}80 {$IFOPT O-}Assert(1 shl P and InvalidTreatyMap = 0); {$ENDIF} 71 81 with CityAreaInfo do 72 82 begin … … 80 90 begin 81 91 p1 := RealMap[Loc1] shr 27; 82 if (p1 < nPl) and (p1 <> p) and (RW[p].Treaty[p1] >= trPeace) then92 if (p1 < nPl) and (p1 <> P) and (RW[P].Treaty[p1] >= trPeace) then 83 93 Available[V21] := faTreaty 84 else if (ZoCMap[Loc1] > 0) and (Occupant[Loc1] <> p) and85 (RW[ p].Treaty[Occupant[Loc1]] < trAlliance) then94 else if (ZoCMap[Loc1] > 0) and (Occupant[Loc1] <> P) and 95 (RW[P].Treaty[Occupant[Loc1]] < trAlliance) then 86 96 Available[V21] := faSiege 87 97 else if (UsedByCity[Loc1] <> -1) and (UsedByCity[Loc1] <> Loc) then 88 98 Available[V21] := faNotAvailable 89 99 else 90 Available[V21] := faAvailable 91 end 92 end; 93 end 94 end; 95 96 function CanCityGrow( p, cix: integer): boolean;97 begin 98 with RW[ p].City[cix] do99 result := (Size < MaxCitySize) and100 Available[V21] := faAvailable; 101 end; 102 end; 103 end; 104 end; 105 106 function CanCityGrow(P, cix: Integer): Boolean; 107 begin 108 with RW[P].City[cix] do 109 Result := (Size < MaxCitySize) and 100 110 ((Size < NeedAqueductSize) or (Built[imAqueduct] = 1) and 101 111 (Size < NeedSewerSize) or (Built[imSewer] = 1)); 102 112 end; 103 113 104 procedure DetermineCityProdProcessing( p, cix: integer;114 procedure DetermineCityProdProcessing(P, cix: Integer; 105 115 var ProdProcessing: TProdProcessing); 106 116 begin 107 with RW[ p].City[cix], ProdProcessing do117 with RW[P].City[cix], ProdProcessing do 108 118 begin 109 119 ProdBonus := 0; 110 120 PollBonus := 0; 111 121 if Built[imFactory] = 1 then 112 inc(ProdBonus);122 Inc(ProdBonus); 113 123 if Built[imMfgPlant] = 1 then 114 inc(ProdBonus);124 Inc(ProdBonus); 115 125 if (Built[imPower] = 1) or (Built[imHydro] = 1) or (Built[imNuclear] = 1) or 116 (GWonder[woHoover].EffectiveOwner = p) then126 (GWonder[woHoover].EffectiveOwner = P) then 117 127 ProdBonus := ProdBonus * 2; 118 128 if Built[imFactory] = 1 then 119 inc(PollBonus);129 Inc(PollBonus); 120 130 if Built[imMfgPlant] = 1 then 121 inc(PollBonus);131 Inc(PollBonus); 122 132 if (Built[imFactory] + Built[imMfgPlant] > 0) then 123 if (Built[imHydro] > 0) or (GWonder[woHoover].EffectiveOwner = p) then124 dec(PollBonus)133 if (Built[imHydro] > 0) or (GWonder[woHoover].EffectiveOwner = P) then 134 Dec(PollBonus) 125 135 else if (Built[imNuclear] = 0) and (Built[imPower] = 1) then 126 inc(PollBonus);127 if (RW[ p].Government <= gDespotism) or (Built[imRecycling] = 1) then136 Inc(PollBonus); 137 if (RW[P].Government <= gDespotism) or (Built[imRecycling] = 1) then 128 138 PollBonus := -2; // no pollution 129 139 PollThreshold := Size; 130 140 FutProdBonus := 0; 131 if RW[ p].Tech[futProductionTechnology] > 0 then141 if RW[P].Tech[futProductionTechnology] > 0 then 132 142 begin // future tech benefits 133 143 if Built[imFactory] = 1 then 134 inc(FutProdBonus, FactoryFutureBonus * RW[p].Tech144 Inc(FutProdBonus, FactoryFutureBonus * RW[P].Tech 135 145 [futProductionTechnology]); 136 146 if Built[imMfgPlant] = 1 then 137 inc(FutProdBonus, MfgPlantFutureBonus * RW[p].Tech147 Inc(FutProdBonus, MfgPlantFutureBonus * RW[P].Tech 138 148 [futProductionTechnology]); 139 149 end; … … 141 151 end; 142 152 143 procedure BoostProd(BaseProd: integer; ProdProcessing: TProdProcessing;144 var Prod, Poll: integer);153 procedure BoostProd(BaseProd: Integer; ProdProcessing: TProdProcessing; 154 var Prod, Poll: Integer); 145 155 begin 146 156 Poll := BaseProd * (2 + ProdProcessing.PollBonus) shr 1; … … 148 158 Poll := 0 149 159 else 150 dec(Poll, ProdProcessing.PollThreshold);160 Dec(Poll, ProdProcessing.PollThreshold); 151 161 if ProdProcessing.FutProdBonus > 0 then 152 162 Prod := BaseProd * (100 + ProdProcessing.ProdBonus * 50 + … … 156 166 end; 157 167 158 procedure DetermineCityTradeProcessing( p, cix, HappinessBeforeLux: integer;168 procedure DetermineCityTradeProcessing(P, cix, HappinessBeforeLux: Integer; 159 169 var TradeProcessing: TTradeProcessing); 160 170 var 161 i, Dist: integer;162 begin 163 with RW[ p].City[cix], TradeProcessing do171 I, Dist: Integer; 172 begin 173 with RW[P].City[cix], TradeProcessing do 164 174 begin 165 175 TaxBonus := 0; 166 176 ScienceBonus := 0; 167 177 if Built[imMarket] = 1 then 168 inc(TaxBonus, 2);178 Inc(TaxBonus, 2); 169 179 if Built[imBank] = 1 then 170 180 begin 171 inc(TaxBonus, 3);172 if RW[ p].NatBuilt[imStockEx] = 1 then173 inc(TaxBonus, 3);181 Inc(TaxBonus, 3); 182 if RW[P].NatBuilt[imStockEx] = 1 then 183 Inc(TaxBonus, 3); 174 184 end; 175 185 LuxBonus := TaxBonus; 176 186 if Built[imLibrary] = 1 then 177 inc(ScienceBonus, 2);187 Inc(ScienceBonus, 2); 178 188 if Built[imUniversity] = 1 then 179 inc(ScienceBonus, 3);189 Inc(ScienceBonus, 3); 180 190 if Built[imResLab] = 1 then 181 inc(ScienceBonus, 3);191 Inc(ScienceBonus, 3); 182 192 ScienceDoubling := 0; 183 193 if Built[imNatObs] > 0 then 184 inc(ScienceDoubling);185 if RW[ p].Government = gFundamentalism then186 dec(ScienceDoubling)187 else if (GWonder[woNewton].EffectiveOwner = p) and188 (RW[ p].Government = gMonarchy) then189 inc(ScienceDoubling);190 FlexibleLuxury := ((ServerVersion[ p] >= $0100F1) and191 (GWonder[woLiberty].EffectiveOwner = p) or (ServerVersion[p] < $0100F1)192 and (GWonder[woMich].EffectiveOwner = p)) and193 (RW[ p].Government <> gAnarchy);194 Inc(ScienceDoubling); 195 if RW[P].Government = gFundamentalism then 196 Dec(ScienceDoubling) 197 else if (GWonder[woNewton].EffectiveOwner = P) and 198 (RW[P].Government = gMonarchy) then 199 Inc(ScienceDoubling); 200 FlexibleLuxury := ((ServerVersion[P] >= $0100F1) and 201 (GWonder[woLiberty].EffectiveOwner = P) or (ServerVersion[P] < $0100F1) 202 and (GWonder[woMich].EffectiveOwner = P)) and 203 (RW[P].Government <> gAnarchy); 194 204 FutResBonus := 0; 195 if RW[ p].Tech[futResearchTechnology] > 0 then205 if RW[P].Tech[futResearchTechnology] > 0 then 196 206 begin // future tech benefits 197 207 if Built[imUniversity] = 1 then 198 inc(FutResBonus, UniversityFutureBonus * RW[p].Tech208 Inc(FutResBonus, UniversityFutureBonus * RW[P].Tech 199 209 [futResearchTechnology]); 200 210 if Built[imResLab] = 1 then 201 inc(FutResBonus, ResLabFutureBonus * RW[p].Tech[futResearchTechnology]);202 end; 203 if (RW[ p].NatBuilt[imPalace] > 0) or (ServerVersion[p] < $010000) then211 Inc(FutResBonus, ResLabFutureBonus * RW[P].Tech[futResearchTechnology]); 212 end; 213 if (RW[P].NatBuilt[imPalace] > 0) or (ServerVersion[P] < $010000) then 204 214 begin // calculate corruption 205 215 Dist := MaxDist; 206 for i := 0 to RW[p].nCity - 1 do207 if (RW[ p].City[i].Loc >= 0) and (RW[p].City[i].Built[imPalace] = 1) then208 Dist := Distance(Loc, RW[ p].City[i].Loc);209 if (Dist = 0) or (CorrLevel[RW[ p].Government] = 0) then216 for I := 0 to RW[P].nCity - 1 do 217 if (RW[P].City[I].Loc >= 0) and (RW[P].City[I].Built[imPalace] = 1) then 218 Dist := Distance(Loc, RW[P].City[I].Loc); 219 if (Dist = 0) or (CorrLevel[RW[P].Government] = 0) then 210 220 RelCorr := 0.0 211 221 else 212 222 begin 213 223 RelCorr := Dist / MaxDist; 214 if CorrLevel[RW[ p].Government] > 1 then215 RelCorr := Exp(ln(RelCorr) / CorrLevel[RW[ p].Government]);224 if CorrLevel[RW[P].Government] > 1 then 225 RelCorr := Exp(ln(RelCorr) / CorrLevel[RW[P].Government]); 216 226 if Built[imCourt] = 1 then 217 227 RelCorr := RelCorr / 2; … … 224 234 RelCorr := 1.0; 225 235 HappyBase := Size + HappinessBeforeLux; 226 end 227 end; 228 229 procedure SplitTrade(Trade, TaxRate, LuxRate, Working: integer;236 end; 237 end; 238 239 procedure SplitTrade(Trade, TaxRate, LuxRate, Working: Integer; 230 240 TradeProcessing: TTradeProcessing; var Corruption, Tax, Lux, 231 Science: integer);232 var 233 plus: integer;241 Science: Integer); 242 var 243 plus: Integer; 234 244 begin 235 245 Corruption := Trunc(Trade * TradeProcessing.RelCorr); … … 266 276 end; 267 277 268 function GetProjectCost( p, cix: integer): integer;269 var 270 i: integer;271 begin 272 with RW[ p].City[cix] do278 function GetProjectCost(P, cix: Integer): Integer; 279 var 280 I: Integer; 281 begin 282 with RW[P].City[cix] do 273 283 begin 274 284 if Project and cpImp = 0 then 275 285 begin 276 result := RW[p].Model[Project and cpIndex].Cost; { unit project }286 Result := RW[P].Model[Project and cpIndex].Cost; { unit project } 277 287 if Project and cpConscripts <> 0 then 278 288 begin 279 i := RW[p].Model[Project and cpIndex].MCost;280 result := result - 3 * i;281 if result <= 0 then282 result := i289 I := RW[P].Model[Project and cpIndex].MCost; 290 Result := Result - 3 * I; 291 if Result <= 0 then 292 Result := I; 283 293 end 284 else if RW[ p].Model[Project and cpIndex].Cap[mcLine] > 0 then294 else if RW[P].Model[Project and cpIndex].Cap[mcLine] > 0 then 285 295 if Project0 and (not cpAuto or cpRepeat) = Project and not cpAuto or cpRepeat 286 296 then 287 result := result shr 1297 Result := Result shr 1 288 298 else 289 result := result * 2299 Result := Result * 2; 290 300 end 291 301 else 292 302 begin { improvement project } 293 result := Imp[Project and cpIndex].Cost;294 if (Project and cpIndex < nWonder) and (GWonder[woColossus].EffectiveOwner = p)303 Result := Imp[Project and cpIndex].Cost; 304 if (Project and cpIndex < nWonder) and (GWonder[woColossus].EffectiveOwner = P) 295 305 then 296 result := result * ColossusEffect div 100;297 end; 298 result := result * BuildCostMod[Difficulty[p]] div 12;299 end 300 end; 301 302 function GetSmallCityReport( p, cix: integer; var CityReport: TCityReport;303 PCityReportEx: PCityReportEx = nil): integer;304 var 305 i, uix, V21, Loc1, ForcedSupport, BaseHappiness, Control: integer;306 Result := Result * ColossusEffect div 100; 307 end; 308 Result := Result * BuildCostMod[Difficulty[P]] div 12; 309 end; 310 end; 311 312 function GetSmallCityReport(P, cix: Integer; var CityReport: TCityReport; 313 PCityReportEx: PCityReportEx = nil): Integer; 314 var 315 I, uix, V21, Loc1, ForcedSupport, BaseHappiness, Control: Integer; 306 316 ProdProcessing: TProdProcessing; 307 317 TradeProcessing: TTradeProcessing; 308 318 Radius: TVicinity21Loc; 309 319 UnitReport: TUnitReport; 310 RareOK: array [0 .. 3] of integer;320 RareOK: array [0 .. 3] of Integer; 311 321 TileInfo: TTileInfo; 312 322 begin 313 with RW[ p].City[cix], CityReport do323 with RW[P].City[cix], CityReport do 314 324 begin 315 325 if HypoTiles <= 0 then 316 326 HypoTiles := Tiles; 317 327 if HypoTax < 0 then 318 HypoTax := RW[ p].TaxRate;328 HypoTax := RW[P].TaxRate; 319 329 if HypoLux < 0 then 320 HypoLux := RW[ p].LuxRate;321 322 if (Flags and chCaptured <> 0) or (RW[ p].Government = gAnarchy) then330 HypoLux := RW[P].LuxRate; 331 332 if (Flags and chCaptured <> 0) or (RW[P].Government = gAnarchy) then 323 333 begin 324 334 Working := 0; 325 335 for V21 := 1 to 26 do 326 336 if HypoTiles and (1 shl V21) <> 0 then 327 inc(Working); // for backward compatibility328 329 if RW[ p].Government = gFundamentalism then337 Inc(Working); // for backward compatibility 338 339 if RW[P].Government = gFundamentalism then 330 340 begin 331 341 Happy := Size; 332 Control := Size 342 Control := Size; 333 343 end // !!! old bug, kept for compatibility 334 344 else 335 345 begin 336 346 Happy := 0; 337 Control := 0 347 Control := 0; 338 348 end; 339 349 … … 370 380 BaseHappiness := Size; 371 381 end; 372 for i:= 0 to nWonder - 1 do373 if Built[ i] = 1 then382 for I := 0 to nWonder - 1 do 383 if Built[I] = 1 then 374 384 begin 375 inc(Happy);376 inc(BaseHappiness, 2)385 Inc(Happy); 386 Inc(BaseHappiness, 2); 377 387 end; 378 388 if Built[imTemple] = 1 then 379 389 begin 380 inc(Happy);381 inc(BaseHappiness, 2)390 Inc(Happy); 391 Inc(BaseHappiness, 2); 382 392 end; 383 393 if Built[imCathedral] = 1 then 384 394 begin 385 inc(Happy, 2);386 inc(BaseHappiness, 4);387 if GWonder[woBach].EffectiveOwner = pthen395 Inc(Happy, 2); 396 Inc(BaseHappiness, 4); 397 if GWonder[woBach].EffectiveOwner = P then 388 398 begin 389 inc(Happy);390 inc(BaseHappiness, 2)399 Inc(Happy); 400 Inc(BaseHappiness, 2); 391 401 end; 392 402 end; 393 403 if Built[imTheater] > 0 then 394 404 begin 395 inc(Happy, 2);396 inc(BaseHappiness, 4)405 Inc(Happy, 2); 406 Inc(BaseHappiness, 4); 397 407 end; 398 408 399 409 // calculate unit support 400 {$IFOPT O-} assert(InvalidTreatyMap = 0); {$ENDIF}410 {$IFOPT O-}Assert(InvalidTreatyMap = 0); {$ENDIF} 401 411 Support := 0; 402 412 ForcedSupport := 0; 403 413 Eaten := Size * 2; 404 414 Deployed := 0; 405 for uix := 0 to RW[ p].nUn - 1 do406 with RW[ p].Un[uix] do415 for uix := 0 to RW[P].nUn - 1 do 416 with RW[P].Un[uix] do 407 417 if (Loc >= 0) and (Home = cix) then 408 418 begin 409 GetUnitReport( p, uix, UnitReport);410 inc(Eaten, UnitReport.FoodSupport);419 GetUnitReport(P, uix, UnitReport); 420 Inc(Eaten, UnitReport.FoodSupport); 411 421 if UnitReport.ReportFlags and urfAlwaysSupport <> 0 then 412 inc(ForcedSupport, UnitReport.ProdSupport)422 Inc(ForcedSupport, UnitReport.ProdSupport) 413 423 else 414 inc(Support, UnitReport.ProdSupport);424 Inc(Support, UnitReport.ProdSupport); 415 425 if UnitReport.ReportFlags and urfDeployed <> 0 then 416 inc(Deployed);426 Inc(Deployed); 417 427 end; 418 428 if Deployed >= Happy then 419 429 Happy := 0 420 430 else 421 dec(Happy, Deployed);422 dec(Support, Size * SupportFree[RW[p].Government] shr 1);431 Dec(Happy, Deployed); 432 Dec(Support, Size * SupportFree[RW[P].Government] shr 1); 423 433 if Support < 0 then 424 434 Support := 0; 425 inc(Support, ForcedSupport);435 Inc(Support, ForcedSupport); 426 436 427 437 { control } 428 case RW[ p].Government of438 case RW[P].Government of 429 439 gDespotism: 430 for uix := 0 to RW[ p].nUn - 1 do431 if (RW[ p].Un[uix].Loc = Loc) and432 (RW[ p].Model[RW[p].Un[uix].mix].Kind = mkSpecial_TownGuard) then440 for uix := 0 to RW[P].nUn - 1 do 441 if (RW[P].Un[uix].Loc = Loc) and 442 (RW[P].Model[RW[P].Un[uix].mix].Kind = mkSpecial_TownGuard) then 433 443 begin 434 inc(Happy);435 inc(Control, 2)444 Inc(Happy); 445 Inc(Control, 2); 436 446 end; 437 447 gFundamentalism: … … 439 449 BaseHappiness := 0; // done by control 440 450 Happy := Size; 441 Control := Size 451 Control := Size; 442 452 end; 443 453 end; 444 454 445 455 // collect processing parameters 446 DetermineCityProdProcessing( p, cix, ProdProcessing);447 DetermineCityTradeProcessing( p, cix, BaseHappiness + Control - 2 *456 DetermineCityProdProcessing(P, cix, ProdProcessing); 457 DetermineCityTradeProcessing(P, cix, BaseHappiness + Control - 2 * 448 458 Deployed, TradeProcessing); 449 459 … … 462 472 // HypoTiles go beyond map border! 463 473 begin 464 result := eInvalid;465 exit474 Result := eInvalid; 475 Exit; 466 476 end; 467 GetTileInfo( p, cix, Loc1, TileInfo);468 inc(FoodRep, TileInfo.Food);469 inc(ProdRep, TileInfo.Prod);470 inc(Trade, TileInfo.Trade);477 GetTileInfo(P, cix, Loc1, TileInfo); 478 Inc(FoodRep, TileInfo.Food); 479 Inc(ProdRep, TileInfo.Prod); 480 Inc(Trade, TileInfo.Trade); 471 481 if (RealMap[Loc1] and fModern <> 0) and 472 (RW[ p].Tech[adMassProduction] >= tsApplicable) then473 inc(RareOK[RealMap[Loc1] shr 25 and 3]);474 inc(Working)482 (RW[P].Tech[adMassProduction] >= tsApplicable) then 483 Inc(RareOK[RealMap[Loc1] shr 25 and 3]); 484 Inc(Working); 475 485 end; 476 486 if Built[imAlgae] = 1 then 477 inc(FoodRep, 12);487 Inc(FoodRep, 12); 478 488 479 489 if PCityReportEx <> nil then … … 500 510 end; 501 511 end; 502 result := eOk;503 end; { GetSmallCityReport }504 505 function GetCityReport( p, cix: integer; var CityReport: TCityReport): integer;506 begin 507 result := GetSmallCityReport(p, cix, CityReport);508 CityReport.Storage := StorageSize[Difficulty[ p]];509 CityReport.ProdCost := GetProjectCost( p, cix);510 end; 511 512 function GetCityReportNew( p, cix: integer;513 var CityReportNew: TCityReportNew): integer;512 Result := eOk; 513 end; 514 515 function GetCityReport(P, cix: Integer; var CityReport: TCityReport): Integer; 516 begin 517 Result := GetSmallCityReport(P, cix, CityReport); 518 CityReport.Storage := StorageSize[Difficulty[P]]; 519 CityReport.ProdCost := GetProjectCost(P, cix); 520 end; 521 522 function GetCityReportNew(P, cix: Integer; 523 var CityReportNew: TCityReportNew): Integer; 514 524 var 515 525 CityReport: TCityReport; … … 521 531 CityReport.HypoTax := HypoTaxRate; 522 532 CityReport.HypoLux := HypoLuxuryRate; 523 result := GetSmallCityReport(p, cix, CityReport, @CityReportEx);524 FoodSupport := CityReport.Eaten - 2 * RW[ p].City[cix].Size;533 Result := GetSmallCityReport(P, cix, CityReport, @CityReportEx); 534 FoodSupport := CityReport.Eaten - 2 * RW[P].City[cix].Size; 525 535 MaterialSupport := CityReport.Support; 526 ProjectCost := GetProjectCost( p, cix);527 Storage := StorageSize[Difficulty[ p]];536 ProjectCost := GetProjectCost(P, cix); 537 Storage := StorageSize[Difficulty[P]]; 528 538 Deployed := CityReport.Deployed; 529 539 Morale := CityReportEx.BaseHappiness; 530 540 CollectedControl := CityReportEx.BaseControl + 531 (RW[ p].City[cix].Size - CityReport.Working) * 2;541 (RW[P].City[cix].Size - CityReport.Working) * 2; 532 542 CollectedFood := CityReport.FoodRep; 533 543 CollectedMaterial := CityReportEx.Material; … … 541 551 Luxury := CityReport.Lux; 542 552 FoodSurplus := CityReport.FoodRep - CityReport.Eaten; 543 HappinessBalance := Morale + Luxury + CollectedControl - RW[ p].City[cix]553 HappinessBalance := Morale + Luxury + CollectedControl - RW[P].City[cix] 544 554 .Size - 2 * Deployed; 545 555 end; … … 550 560 ____________________________________________________________________ 551 561 } 552 procedure NextBest( p, cix: integer; var SelectedLoc, SelectedV21: integer);562 procedure NextBest(P, cix: Integer; var SelectedLoc, SelectedV21: Integer); 553 563 { best tile unused but available by city cix } 554 564 var 555 Resources, Most, Loc1, p1, V21: integer;565 Resources, Most, Loc1, p1, V21: Integer; 556 566 TileInfo: TTileInfo; 557 567 Radius: TVicinity21Loc; 558 568 begin 559 {$IFOPT O-} assert(1 shl pand InvalidTreatyMap = 0); {$ENDIF}569 {$IFOPT O-}Assert(1 shl P and InvalidTreatyMap = 0); {$ENDIF} 560 570 Most := 0; 561 571 SelectedLoc := -1; 562 572 SelectedV21 := -1; 563 with RW[ p].City[cix] do573 with RW[P].City[cix] do 564 574 begin 565 575 V21_to_Loc(Loc, Radius); … … 570 580 begin 571 581 p1 := RealMap[Loc1] shr 27; 572 if ((p1 = nPl) or (p1 = p) or (RW[p].Treaty[p1] < trPeace)) and573 ((ZoCMap[Loc1] = 0) or (Occupant[Loc1] = p) or574 (RW[ p].Treaty[Occupant[Loc1]] = trAlliance)) then582 if ((p1 = nPl) or (p1 = P) or (RW[P].Treaty[p1] < trPeace)) and 583 ((ZoCMap[Loc1] = 0) or (Occupant[Loc1] = P) or 584 (RW[P].Treaty[Occupant[Loc1]] = trAlliance)) then 575 585 begin 576 GetTileInfo( p, cix, Loc1, TileInfo);586 GetTileInfo(P, cix, Loc1, TileInfo); 577 587 Resources := TileInfo.Food shl 16 + TileInfo.Prod shl 8 + 578 588 TileInfo.Trade; … … 582 592 SelectedLoc := Loc1; 583 593 SelectedV21 := V21; 584 Most := Resources 585 end 586 end 587 end 588 end; 589 end; 590 end; 591 592 procedure NextWorst( p, cix: integer; var SelectedLoc, SelectedV21: integer);594 Most := Resources; 595 end; 596 end; 597 end; 598 end; 599 end; 600 end; 601 602 procedure NextWorst(P, cix: Integer; var SelectedLoc, SelectedV21: Integer); 593 603 { worst tile used by city cix } 594 604 var 595 Resources, Least, Loc1, V21: integer;605 Resources, Least, Loc1, V21: Integer; 596 606 Radius: TVicinity21Loc; 597 607 TileInfo: TTileInfo; … … 600 610 SelectedLoc := -1; 601 611 SelectedV21 := -1; 602 with RW[ p].City[cix] do612 with RW[P].City[cix] do 603 613 begin 604 614 V21_to_Loc(Loc, Radius); … … 609 619 if (Loc1 >= 0) and (Loc1 < MapSize) and (1 shl V21 and Tiles <> 0) then 610 620 begin 611 GetTileInfo( p, cix, Loc1, TileInfo);621 GetTileInfo(P, cix, Loc1, TileInfo); 612 622 Resources := TileInfo.Food shl 16 + TileInfo.Prod shl 8 + 613 623 TileInfo.Trade; … … 617 627 SelectedLoc := Loc1; 618 628 SelectedV21 := V21; 619 Least := Resources 620 end 621 end; 622 end 623 end 624 end; 625 626 function NextPoll( p, cix: integer): integer;627 var 628 Resources, Best, dx, dy, Loc1, Dist, BestDist, V21, pTerr: integer;629 Least := Resources; 630 end; 631 end; 632 end; 633 end; 634 end; 635 636 function NextPoll(P, cix: Integer): Integer; 637 var 638 Resources, Best, dx, dy, Loc1, Dist, BestDist, V21, pTerr: Integer; 629 639 Radius: TVicinity21Loc; 630 640 TileInfo: TTileInfo; 631 641 begin 632 642 BestDist := MaxInt; 633 {$IFOPT O-} assert(1 shl pand InvalidTreatyMap = 0); {$ENDIF}643 {$IFOPT O-}Assert(1 shl P and InvalidTreatyMap = 0); {$ENDIF} 634 644 Best := 0; 635 result := -1;636 with RW[ p].City[cix] do645 Result := -1; 646 with RW[P].City[cix] do 637 647 begin 638 648 V21_to_Loc(Loc, Radius); … … 646 656 begin 647 657 pTerr := RealMap[Loc1] shr 27; 648 if (pTerr = nPl) or (pTerr = p) or (RW[p].Treaty[pTerr] < trPeace)658 if (pTerr = nPl) or (pTerr = P) or (RW[P].Treaty[pTerr] < trPeace) 649 659 then 650 660 begin 651 GetTileInfo( p, cix, Loc1, TileInfo);661 GetTileInfo(P, cix, Loc1, TileInfo); 652 662 Resources := TileInfo.Prod shl 16 + TileInfo.Trade shl 8 + 653 663 TileInfo.Food; … … 659 669 then 660 670 begin 661 result := Loc1;671 Result := Loc1; 662 672 Best := Resources; 663 673 BestDist := Dist; … … 669 679 end; 670 680 671 function AddBestCityTile( p, cix: integer): boolean;672 var 673 TileLoc, V21: integer;674 begin 675 NextBest( p, cix, TileLoc, V21);676 result := TileLoc >= 0;677 if result then678 with RW[ p].City[cix] do679 begin 680 assert(1 shl V21 and Tiles = 0);681 function AddBestCityTile(P, cix: Integer): Boolean; 682 var 683 TileLoc, V21: Integer; 684 begin 685 NextBest(P, cix, TileLoc, V21); 686 Result := TileLoc >= 0; 687 if Result then 688 with RW[P].City[cix] do 689 begin 690 Assert(1 shl V21 and Tiles = 0); 681 691 Tiles := Tiles or (1 shl V21); 682 UsedByCity[TileLoc] := Loc 683 end 684 end; 685 686 procedure CityGrowth( p, cix: integer);687 var 688 TileLoc, V21: integer;692 UsedByCity[TileLoc] := Loc; 693 end; 694 end; 695 696 procedure CityGrowth(P, cix: Integer); 697 var 698 TileLoc, V21: Integer; 689 699 AltCityReport: TCityReport; 690 700 begin 691 with RW[ p].City[cix] do701 with RW[P].City[cix] do 692 702 begin 693 inc(Size);694 NextBest( p, cix, TileLoc, V21);703 Inc(Size); 704 NextBest(P, cix, TileLoc, V21); 695 705 if TileLoc >= 0 then 696 706 begin { test whether exploitation of tile would lead to disorder } … … 698 708 AltCityReport.HypoTax := -1; 699 709 AltCityReport.HypoLux := -1; 700 GetSmallCityReport( p, cix, AltCityReport);710 GetSmallCityReport(P, cix, AltCityReport); 701 711 if AltCityReport.Working - AltCityReport.Happy <= Size shr 1 then 702 712 // !!! change to new style disorder 703 713 begin { no disorder -- exploit tile } 704 assert(1 shl V21 and Tiles = 0);714 Assert(1 shl V21 and Tiles = 0); 705 715 Tiles := Tiles or (1 shl V21); 706 UsedByCity[TileLoc] := Loc 707 end 708 end; 709 end 710 end; 711 712 procedure CityShrink( p, cix: integer);713 var 714 TileLoc, V21, Working: integer;716 UsedByCity[TileLoc] := Loc; 717 end; 718 end; 719 end; 720 end; 721 722 procedure CityShrink(P, cix: Integer); 723 var 724 TileLoc, V21, Working: Integer; 715 725 AltCityReport: TCityReport; 716 726 begin 717 with RW[ p].City[cix] do727 with RW[P].City[cix] do 718 728 begin 719 729 Working := 0; 720 730 for V21 := 1 to 26 do 721 731 if Tiles and (1 shl V21) <> 0 then 722 inc(Working);723 dec(Size);724 if Food > StorageSize[Difficulty[ p]] then725 Food := StorageSize[Difficulty[ p]];726 NextWorst( p, cix, TileLoc, V21);732 Inc(Working); 733 Dec(Size); 734 if Food > StorageSize[Difficulty[P]] then 735 Food := StorageSize[Difficulty[P]]; 736 NextWorst(P, cix, TileLoc, V21); 727 737 if Working > Size then 728 738 begin { all citizens were working -- worst tile no longer exploited } 729 assert(1 shl V21 and Tiles <> 0);739 Assert(1 shl V21 and Tiles <> 0); 730 740 Tiles := Tiles and not(1 shl V21); 731 UsedByCity[TileLoc] := -1 741 UsedByCity[TileLoc] := -1; 732 742 end 733 743 else { test whether exploitation of tile would lead to disorder } … … 736 746 AltCityReport.HypoTax := -1; 737 747 AltCityReport.HypoLux := -1; 738 GetSmallCityReport( p, cix, AltCityReport);748 GetSmallCityReport(P, cix, AltCityReport); 739 749 if AltCityReport.Working - AltCityReport.Happy > Size shr 1 then 740 750 // !!! change to new style disorder 741 751 begin { disorder -- don't exploit tile } 742 assert(1 shl V21 and Tiles <> 0);752 Assert(1 shl V21 and Tiles <> 0); 743 753 Tiles := Tiles and not(1 shl V21); 744 UsedByCity[TileLoc] := -1 745 end 746 end; 747 end 748 end; 749 750 procedure Pollute( p, cix: integer);751 var 752 PollutionLoc: integer;753 begin 754 with RW[ p].City[cix] do754 UsedByCity[TileLoc] := -1; 755 end; 756 end; 757 end; 758 end; 759 760 procedure Pollute(P, cix: Integer); 761 var 762 PollutionLoc: Integer; 763 begin 764 with RW[P].City[cix] do 755 765 begin 756 766 Pollution := Pollution - MaxPollution; 757 PollutionLoc := NextPoll( p, cix);767 PollutionLoc := NextPoll(P, cix); 758 768 if PollutionLoc >= 0 then 759 769 begin 760 inc(Flags, chPollution);770 Inc(Flags, chPollution); 761 771 RealMap[PollutionLoc] := RealMap[PollutionLoc] or fPoll; 762 end 772 end; 763 773 end; 764 774 end; … … 768 778 ____________________________________________________________________ 769 779 } 770 procedure PayCityMaintenance( p, cix: integer);771 var 772 i: integer;773 begin 774 with RW[ p], City[cix] do775 for i:= nWonder to nImp - 1 do776 if (Built[ i] > 0) and (Project0 and (cpImp or cpIndex) <> (cpImp or i))780 procedure PayCityMaintenance(P, cix: Integer); 781 var 782 I: Integer; 783 begin 784 with RW[P], City[cix] do 785 for I := nWonder to nImp - 1 do 786 if (Built[I] > 0) and (Project0 and (cpImp or cpIndex) <> (cpImp or I)) 777 787 then // don't pay maintenance when just completed 778 788 begin 779 dec(Money, Imp[i].Maint);789 Dec(Money, Imp[I].Maint); 780 790 if Money < 0 then 781 791 begin { out of money - sell improvement } 782 inc(Money, Imp[i].Cost * BuildCostMod[Difficulty[p]] div 12);783 Built[ i] := 0;784 if Imp[ i].Kind <> ikCommon then792 Inc(Money, Imp[I].Cost * BuildCostMod[Difficulty[P]] div 12); 793 Built[I] := 0; 794 if Imp[I].Kind <> ikCommon then 785 795 begin 786 assert(i<> imSpacePort);796 Assert(I <> imSpacePort); 787 797 // never sell automatically! (solution: no maintenance) 788 NatBuilt[ i] := 0;789 if i= imGrWall then790 GrWallContinent[ p] := -1;798 NatBuilt[I] := 0; 799 if I = imGrWall then 800 GrWallContinent[P] := -1; 791 801 end; 792 inc(Flags, chImprovementLost)793 end 794 end; 795 end; 796 797 procedure CollectCityResources( p, cix: integer);798 var 799 CityStorage, CityProjectCost: integer;802 Inc(Flags, chImprovementLost); 803 end; 804 end; 805 end; 806 807 procedure CollectCityResources(P, cix: Integer); 808 var 809 CityStorage, CityProjectCost: Integer; 800 810 CityReport: TCityReportNew; 801 Disorder: boolean;802 begin 803 with RW[ p], City[cix], CityReport do811 Disorder: Boolean; 812 begin 813 with RW[P], City[cix], CityReport do 804 814 if Flags and chCaptured <> 0 then 805 815 begin 806 816 Flags := Flags and not chDisorder; 807 dec(Flags, $10000);817 Dec(Flags, $10000); 808 818 if Flags and chCaptured = 0 then 809 819 Flags := Flags or chAfterCapture; … … 816 826 HypoTaxRate := -1; 817 827 HypoLuxuryRate := -1; 818 GetCityReportNew( p, cix, CityReport);819 CityStorage := StorageSize[Difficulty[ p]];820 CityProjectCost := GetProjectCost( p, cix);828 GetCityReportNew(P, cix, CityReport); 829 CityStorage := StorageSize[Difficulty[P]]; 830 CityProjectCost := GetProjectCost(P, cix); 821 831 822 832 Disorder := (HappinessBalance < 0); … … 830 840 if not Disorder and ((Government = gFuture) or (Size >= NeedAqueductSize) 831 841 and (FoodSurplus < 2)) and (FoodSurplus > 0) then 832 inc(Money, FoodSurplus)842 Inc(Money, FoodSurplus) 833 843 else if not(Disorder and (FoodSurplus > 0)) then 834 844 begin { calculate new food storage } … … 839 849 (Project and (cpImp + cpIndex) <> cpImp + imAqueduct) and 840 850 (Project and (cpImp + cpIndex) <> cpImp + imSewer) and 841 not CanCityGrow( p, cix) then842 inc(Flags, chNoGrowthWarning);851 not CanCityGrow(P, cix) then 852 Inc(Flags, chNoGrowthWarning); 843 853 end; 844 854 845 855 if Prod > CityProjectCost then 846 856 begin 847 inc(Money, Prod - CityProjectCost);848 Prod := CityProjectCost 857 Inc(Money, Prod - CityProjectCost); 858 Prod := CityProjectCost; 849 859 end; 850 860 if Production < 0 then … … 852 862 else if not Disorder and (Flags and chProductionSabotaged = 0) then 853 863 if Project and (cpImp + cpIndex) = cpImp + imTrGoods then 854 inc(Money, Production)864 Inc(Money, Production) 855 865 else 856 inc(Prod, Production);866 Inc(Prod, Production); 857 867 858 868 if not Disorder then 859 869 begin 860 870 { sum research points and taxes } 861 inc(Research, Science);862 inc(Money, Tax);871 Inc(Research, Science); 872 Inc(Money, Tax); 863 873 Pollution := Pollution + AddPollution; 864 874 end; … … 866 876 end; 867 877 868 function CityTurn( p, cix: integer): boolean;878 function CityTurn(P, cix: Integer): Boolean; 869 879 // return value: whether city keeps existing 870 880 var 871 i, uix, cix2, p1, SizeMod, CityStorage, CityProjectCost, NewImp, Det,872 TestDet: integer;873 LackOfMaterial, CheckGrow, DoProd, IsActive: boolean;874 begin 875 with RW[ p], City[cix] do881 I, uix, cix2, p1, SizeMod, CityStorage, CityProjectCost, NewImp, Det, 882 TestDet: Integer; 883 LackOfMaterial, CheckGrow, DoProd, IsActive: Boolean; 884 begin 885 with RW[P], City[cix] do 876 886 begin 877 887 SizeMod := 0; 878 CityStorage := StorageSize[Difficulty[ p]];879 CityProjectCost := GetProjectCost( p, cix);888 CityStorage := StorageSize[Difficulty[P]]; 889 CityProjectCost := GetProjectCost(P, cix); 880 890 881 891 LackOfMaterial := Flags and chUnitLost <> 0; … … 887 897 if CheckGrow and (GTestFlags and tfImmGrow <> 0) then { fast growth } 888 898 begin 889 if CanCityGrow( p, cix) then890 inc(SizeMod)899 if CanCityGrow(P, cix) then 900 Inc(SizeMod); 891 901 end 892 902 else if CheckGrow and (Food >= CityStorage) then { normal growth } 893 903 begin 894 if CanCityGrow( p, cix) then904 if CanCityGrow(P, cix) then 895 905 begin 896 906 if Built[imGranary] = 1 then 897 dec(Food, CityStorage shr 1)907 Dec(Food, CityStorage shr 1) 898 908 else 899 dec(Food, CityStorage);900 inc(SizeMod)901 end 909 Dec(Food, CityStorage); 910 Inc(SizeMod); 911 end; 902 912 end 903 913 else if Food < 0 then { famine } … … 906 916 // check if settlers or conscripts there to disband 907 917 uix := -1; 908 for i:= 0 to nUn - 1 do909 if (Un[ i].Loc >= 0) and (Un[i].Home = cix) and910 ((Model[Un[ i].mix].Kind = mkSettler)918 for I := 0 to nUn - 1 do 919 if (Un[I].Loc >= 0) and (Un[I].Home = cix) and 920 ((Model[Un[I].mix].Kind = mkSettler) 911 921 { and (GWonder[woFreeSettlers].EffectiveOwner<>p) } 912 or (Un[ i].Flags and unConscripts <> 0)) and913 ((uix = -1) or (Model[Un[ i].mix].Cost < Model[Un[uix].mix].Cost) or914 (Model[Un[ i].mix].Cost = Model[Un[uix].mix].Cost) and915 (Un[ i].Exp < Un[uix].Exp)) then916 uix := i;922 or (Un[I].Flags and unConscripts <> 0)) and 923 ((uix = -1) or (Model[Un[I].mix].Cost < Model[Un[uix].mix].Cost) or 924 (Model[Un[I].mix].Cost = Model[Un[uix].mix].Cost) and 925 (Un[I].Exp < Un[uix].Exp)) then 926 uix := I; 917 927 918 928 if uix >= 0 then 919 929 begin 920 RemoveUnit_UpdateMap( p, uix);921 inc(Flags, chUnitLost);930 RemoveUnit_UpdateMap(P, uix); 931 Inc(Flags, chUnitLost); 922 932 end 923 933 else 924 934 begin 925 dec(SizeMod);926 inc(Flags, chPopDecrease)935 Dec(SizeMod); 936 Inc(Flags, chPopDecrease); 927 937 end 928 938 end; … … 936 946 uix := -1; 937 947 Det := MaxInt; 938 for i:= 0 to nUn - 1 do939 if (Un[ i].Loc >= 0) and (Un[i].Home = cix) then940 with Model[Un[ i].mix] do948 for I := 0 to nUn - 1 do 949 if (Un[I].Loc >= 0) and (Un[I].Home = cix) then 950 with Model[Un[I].mix] do 941 951 begin 942 952 if Kind = mkSpecial_TownGuard then 943 TestDet := Un[ i].Health + Un[i].Exp shl 8953 TestDet := Un[I].Health + Un[I].Exp shl 8 944 954 // disband townguards first 945 955 else 946 956 begin 947 TestDet := Un[ i].Health + Un[i].Exp shl 8 + Cost shl 16;957 TestDet := Un[I].Health + Un[I].Exp shl 8 + Cost shl 16; 948 958 // value of unit 949 959 if Flags and mdDoubleSupport <> 0 then … … 953 963 if TestDet < Det then 954 964 begin 955 uix := i;956 Det := TestDet 965 uix := I; 966 Det := TestDet; 957 967 end; 958 968 end; 959 969 if uix >= 0 then 960 970 begin 961 RemoveUnit_UpdateMap( p, uix);962 inc(Flags, chUnitLost);963 end 964 end 971 RemoveUnit_UpdateMap(P, uix); 972 Inc(Flags, chUnitLost); 973 end; 974 end; 965 975 end; 966 976 … … 974 984 (GWonder[Project and cpIndex].CityID <> WonderNotBuiltYet) then 975 985 begin 976 inc(Flags, chOldWonder);977 DoProd := false;986 Inc(Flags, chOldWonder); 987 DoProd := False; 978 988 end; 979 989 … … 985 995 (Project and cpConscripts <> 0))) then 986 996 begin 987 inc(Flags, chNoSettlerProd);988 DoProd := false;997 Inc(Flags, chNoSettlerProd); 998 DoProd := False; 989 999 end; 990 1000 991 1001 if DoProd then 992 1002 begin { project complete } 993 dec(Prod, CityProjectCost);1003 Dec(Prod, CityProjectCost); 994 1004 if Project and cpImp = 0 then { produce unit } 995 1005 begin 996 1006 if nUn < numax then 997 1007 begin 998 CreateUnit( p, Project and cpIndex);1008 CreateUnit(P, Project and cpIndex); 999 1009 Un[nUn - 1].Loc := Loc; 1000 1010 with Un[nUn - 1] do … … 1008 1018 Exp := ExpCost * 2; { vet } 1009 1019 if Project and cpConscripts <> 0 then 1010 Flags := Flags or unConscripts 1020 Flags := Flags or unConscripts; 1011 1021 end; 1012 PlaceUnit( p, nUn - 1);1022 PlaceUnit(P, nUn - 1); 1013 1023 UpdateUnitMap(Loc); 1014 1024 if Model[Project and cpIndex].Kind = mkSettler then 1015 dec(SizeMod, 2) { settler produced - city shrink }1025 Dec(SizeMod, 2) { settler produced - city shrink } 1016 1026 else if (Model[Project and cpIndex].Kind = mkSlaves) or 1017 1027 (Project and cpConscripts <> 0) then 1018 dec(SizeMod); { slaves/conscripts produced - city shrink }1028 Dec(SizeMod); { slaves/conscripts produced - city shrink } 1019 1029 end; 1020 1030 Project0 := Project or cpRepeat or cpCompleted; … … 1022 1032 else if Imp[Project and cpIndex].Kind = ikShipPart then 1023 1033 begin { produce ship parts } 1024 inc(GShip[p].Parts[Project and cpIndex - imShipComp]);1034 Inc(GShip[P].Parts[Project and cpIndex - imShipComp]); 1025 1035 Project0 := Project or cpCompleted; 1026 1036 end … … 1028 1038 begin 1029 1039 NewImp := Project and cpIndex; 1030 inc(Money, Prod); { change rest to money }1040 Inc(Money, Prod); { change rest to money } 1031 1041 Project0 := Project or cpCompleted; 1032 1042 Project := cpImp + imTrGoods; … … 1035 1045 if Imp[NewImp].Kind in [ikNatLocal, ikNatGlobal] then 1036 1046 begin // nat. project 1037 for i:= 0 to nCity - 1 do1038 if (City[ i].Loc >= 0) and (City[i].Built[NewImp] = 1) then1047 for I := 0 to nCity - 1 do 1048 if (City[I].Loc >= 0) and (City[I].Built[NewImp] = 1) then 1039 1049 begin { allowed only once } 1040 inc(Money, Imp[NewImp].Cost * BuildCostMod[Difficulty[p]] div 12);1041 City[ i].Built[NewImp] := 0;1050 Inc(Money, Imp[NewImp].Cost * BuildCostMod[Difficulty[P]] div 12); 1051 City[I].Built[NewImp] := 0; 1042 1052 end; 1043 1053 NatBuilt[NewImp] := 1; … … 1046 1056 case NewImp of 1047 1057 imGrWall: 1048 GrWallContinent[ p] := Continent[Loc];1058 GrWallContinent[P] := Continent[Loc]; 1049 1059 end; 1050 1060 end; … … 1053 1063 begin // wonder 1054 1064 GWonder[NewImp].CityID := ID; 1055 GWonder[NewImp].EffectiveOwner := p;1065 GWonder[NewImp].EffectiveOwner := P; 1056 1066 CheckExpiration(NewImp); 1057 1067 … … 1060 1070 woEiffel: 1061 1071 begin // reactivate wonders 1062 for i:= 0 to nWonder - 1 do1063 if Imp[ i].Expiration >= 0 then1072 for I := 0 to nWonder - 1 do 1073 if Imp[I].Expiration >= 0 then 1064 1074 for cix2 := 0 to nCity - 1 do 1065 if (City[cix2].Loc >= 0) and (City[cix2].Built[ i] = 1)1075 if (City[cix2].Loc >= 0) and (City[cix2].Built[I] = 1) 1066 1076 then 1067 GWonder[ i].EffectiveOwner := p1077 GWonder[I].EffectiveOwner := P; 1068 1078 end; 1069 1079 woLighthouse: 1070 CheckSpecialModels( p, preLighthouse);1080 CheckSpecialModels(P, preLighthouse); 1071 1081 woLeo: 1072 1082 begin 1073 inc(Research, TechBaseCost(nTech[p], Difficulty[p]) +1074 TechBaseCost(nTech[ p] + 2, Difficulty[p]));1075 CheckSpecialModels( p, preLeo);1083 Inc(Research, TechBaseCost(nTech[P], Difficulty[P]) + 1084 TechBaseCost(nTech[P] + 2, Difficulty[P])); 1085 CheckSpecialModels(P, preLeo); 1076 1086 end; 1077 1087 woPyramids: 1078 CheckSpecialModels( p, preBuilder);1088 CheckSpecialModels(P, preBuilder); 1079 1089 woMir: 1080 1090 begin 1081 1091 for p1 := 0 to nPl - 1 do 1082 if (p1 <> p) and (1 shl p1 and GAlive <> 0) then1092 if (p1 <> P) and (1 shl p1 and GAlive <> 0) then 1083 1093 begin 1084 if RW[ p].Treaty[p1] = trNoContact then1085 IntroduceEnemy( p, p1);1086 GiveCivilReport( p, p1);1087 GiveMilReport( p, p1)1094 if RW[P].Treaty[p1] = trNoContact then 1095 IntroduceEnemy(P, p1); 1096 GiveCivilReport(P, p1); 1097 GiveMilReport(P, p1); 1088 1098 end; 1089 end 1099 end; 1090 1100 end; 1091 1101 end; 1092 1102 1093 for i:= 0 to nImpReplacement - 1 do // sell obsolete buildings1094 if (ImpReplacement[ i].NewImp = NewImp) and1095 (Built[ImpReplacement[ i].OldImp] > 0) then1103 for I := 0 to nImpReplacement - 1 do // sell obsolete buildings 1104 if (ImpReplacement[I].NewImp = NewImp) and 1105 (Built[ImpReplacement[I].OldImp] > 0) then 1096 1106 begin 1097 inc(RW[p].Money, Imp[ImpReplacement[i].OldImp].Cost * BuildCostMod1098 [Difficulty[ p]] div 12);1099 Built[ImpReplacement[ i].OldImp] := 0;1107 Inc(RW[P].Money, Imp[ImpReplacement[I].OldImp].Cost * BuildCostMod 1108 [Difficulty[P]] div 12); 1109 Built[ImpReplacement[I].OldImp] := 0; 1100 1110 end; 1101 1111 1102 1112 if NewImp in [imPower, imHydro, imNuclear] then 1103 for i:= 0 to nImp - 1 do1104 if ( i <> NewImp) and (iin [imPower, imHydro, imNuclear]) and1105 (Built[ i] > 0) then1113 for I := 0 to nImp - 1 do 1114 if (I <> NewImp) and (I in [imPower, imHydro, imNuclear]) and 1115 (Built[I] > 0) then 1106 1116 begin // sell obsolete power plant 1107 inc(RW[p].Money, Imp[i].Cost * BuildCostMod[Difficulty[p]1117 Inc(RW[P].Money, Imp[I].Cost * BuildCostMod[Difficulty[P] 1108 1118 ] div 12); 1109 Built[ i] := 0;1119 Built[I] := 0; 1110 1120 end; 1111 1121 … … 1113 1123 end; 1114 1124 Prod0 := Prod; 1115 inc(Flags, chProduction)1125 Inc(Flags, chProduction); 1116 1126 end 1117 1127 else … … 1125 1135 if SizeMod > 0 then 1126 1136 begin 1127 CityGrowth( p, cix);1128 inc(Flags, chPopIncrease);1129 end; 1130 result := Size + SizeMod >= 2;1131 if result then1137 CityGrowth(P, cix); 1138 Inc(Flags, chPopIncrease); 1139 end; 1140 Result := Size + SizeMod >= 2; 1141 if Result then 1132 1142 while SizeMod < 0 do 1133 1143 begin 1134 CityShrink( p, cix);1135 inc(SizeMod)1136 end; 1137 end 1138 end; // CityTurn1144 CityShrink(P, cix); 1145 Inc(SizeMod); 1146 end; 1147 end; 1148 end; 1139 1149 1140 1150 { … … 1142 1152 ____________________________________________________________________ 1143 1153 } 1144 function SetCityTiles( p, cix, NewTiles: integer;1145 TestOnly: boolean = false): integer;1146 var 1147 V21, Working, ChangeTiles, AddTiles, Loc1: integer;1154 function SetCityTiles(P, cix, NewTiles: Integer; 1155 TestOnly: Boolean = False): Integer; 1156 var 1157 V21, Working, ChangeTiles, AddTiles, Loc1: Integer; 1148 1158 CityAreaInfo: TCityAreaInfo; 1149 1159 Radius: TVicinity21Loc; 1150 1160 begin 1151 with RW[ p].City[cix] do1161 with RW[P].City[cix] do 1152 1162 begin 1153 ChangeTiles := NewTiles xor integer(Tiles);1163 ChangeTiles := NewTiles xor Integer(Tiles); 1154 1164 AddTiles := NewTiles and not Tiles; 1155 1165 if Mode = moPlaying then … … 1157 1167 if NewTiles and not $67F7F76 <> 0 then 1158 1168 begin 1159 result := eInvalid;1160 exit1169 Result := eInvalid; 1170 Exit 1161 1171 end; // invalid tile index included 1162 1172 if NewTiles and (1 shl 13) = 0 then 1163 1173 begin 1164 result := eViolation;1165 exit1174 Result := eViolation; 1175 Exit 1166 1176 end; // city tile must be exploited 1167 1177 if ChangeTiles = 0 then 1168 1178 begin 1169 result := eNotChanged;1170 exit1179 Result := eNotChanged; 1180 Exit 1171 1181 end; 1172 1182 if AddTiles <> 0 then 1173 1183 begin 1174 1184 // check if new tiles possible 1175 GetCityAreaInfo( p, Loc, CityAreaInfo);1185 GetCityAreaInfo(P, Loc, CityAreaInfo); 1176 1186 for V21 := 1 to 26 do 1177 1187 if AddTiles and (1 shl V21) <> 0 then 1178 1188 if CityAreaInfo.Available[V21] <> faAvailable then 1179 1189 begin 1180 result := eTileNotAvailable;1181 exit1190 Result := eTileNotAvailable; 1191 Exit; 1182 1192 end; 1183 1193 // not more tiles than inhabitants … … 1185 1195 for V21 := 1 to 26 do 1186 1196 if NewTiles and (1 shl V21) <> 0 then 1187 inc(Working);1197 Inc(Working); 1188 1198 if Working > Size then 1189 1199 begin 1190 result := eNoWorkerAvailable;1191 exit1192 end; 1193 end; 1194 end; 1195 result := eOk;1200 Result := eNoWorkerAvailable; 1201 Exit; 1202 end; 1203 end; 1204 end; 1205 Result := eOk; 1196 1206 if not TestOnly then 1197 1207 begin … … 1201 1211 begin 1202 1212 Loc1 := Radius[V21]; 1203 assert((Loc1 >= 0) and (Loc1 < MapSize));1213 Assert((Loc1 >= 0) and (Loc1 < MapSize)); 1204 1214 if NewTiles and (1 shl V21) <> 0 then 1205 1215 UsedByCity[Loc1] := Loc // employ tile 1206 1216 else if UsedByCity[Loc1] <> Loc then 1207 assert(Mode < moPlaying)1217 Assert(Mode < moPlaying) 1208 1218 // should only happen during loading, because of wrong sSetCityTiles command order 1209 1219 else 1210 UsedByCity[Loc1] := -1 // unemploy tile1211 end; 1212 Tiles := NewTiles 1213 end 1214 end; 1215 end; 1216 1217 procedure GetCityTileAdvice( p, cix: integer; var Advice: TCityTileAdviceData);1220 UsedByCity[Loc1] := -1; // unemploy tile 1221 end; 1222 Tiles := NewTiles; 1223 end; 1224 end; 1225 end; 1226 1227 procedure GetCityTileAdvice(P, cix: Integer; var Advice: TCityTileAdviceData); 1218 1228 const 1219 1229 oFood = 0; … … 1223 1233 type 1224 1234 TTileData = record 1225 Food, Prod, Trade, SubValue, V21: integer; 1226 end; 1227 var 1228 i, V21, Loc1, nHierarchy, iH, iT, iH_Switch, MinWorking, MaxWorking, 1235 Food: Integer; 1236 Prod: Integer; 1237 Trade: Integer; 1238 SubValue: Integer; 1239 V21: Integer; 1240 end; 1241 var 1242 I, V21, Loc1, nHierarchy, iH, iT, iH_Switch, MinWorking, MaxWorking, 1229 1243 WantedProd, MinFood, MinProd, count, Take, MaxTake, AreaSize, FormulaCode, 1230 1244 NeedRare, RareTiles, cix1, dx, dy, BestTiles, ProdBeforeBoost, TestTiles, 1231 SubPlus, SuperPlus: integer;1232 SuperValue, BestSuperValue, SubValue, BestSubValue: integer;1233 Value, BestValue, ValuePlus: extended;1234 ValueFormula_Weight: array [oFood .. oScience] of extended;1235 ValueFormula_Multiply: array [oFood .. oScience] of boolean;1236 Output: array [oFood .. oScience] of integer;1245 SubPlus, SuperPlus: Integer; 1246 SuperValue, BestSuperValue, SubValue, BestSubValue: Integer; 1247 Value, BestValue, ValuePlus: Extended; 1248 ValueFormula_Weight: array [oFood .. oScience] of Extended; 1249 ValueFormula_Multiply: array [oFood .. oScience] of Boolean; 1250 Output: array [oFood .. oScience] of Integer; 1237 1251 TileInfo, BaseTileInfo: TTileInfo; 1238 1252 Radius, Radius1: TVicinity21Loc; … … 1241 1255 CityAreaInfo: TCityAreaInfo; 1242 1256 Hierarchy: array [0 .. 20, 0 .. 31] of TTileData; 1243 nTile, nSelection: array [0 .. 20] of integer;1244 SubCriterion: array [0 .. 27] of integer;1245 FoodWasted, FoodToTax, ProdToTax, RareOK, NeedStep2, IsBest: boolean;1246 begin 1247 if (RW[ p].Government = gAnarchy) or (RW[p].City[cix].Flags and chCaptured <> 0)1257 nTile, nSelection: array [0 .. 20] of Integer; 1258 SubCriterion: array [0 .. 27] of Integer; 1259 FoodWasted, FoodToTax, ProdToTax, RareOK, NeedStep2, IsBest: Boolean; 1260 begin 1261 if (RW[P].Government = gAnarchy) or (RW[P].City[cix].Flags and chCaptured <> 0) 1248 1262 then 1249 1263 begin … … 1251 1265 Advice.Tiles := 1 shl CityOwnTile; 1252 1266 Advice.CityReport.HypoTiles := 1 shl CityOwnTile; 1253 exit;1254 end; 1255 1256 for i:= oFood to oScience do1267 Exit; 1268 end; 1269 1270 for I := oFood to oScience do 1257 1271 begin // decode evaluation formula from weights parameter 1258 FormulaCode := Advice.ResourceWeights shr (24 - 8 * i) and $FF;1259 ValueFormula_Multiply[ i] := FormulaCode and $80 <> 0;1272 FormulaCode := Advice.ResourceWeights shr (24 - 8 * I) and $FF; 1273 ValueFormula_Multiply[I] := FormulaCode and $80 <> 0; 1260 1274 if FormulaCode and $40 <> 0 then 1261 ValueFormula_Weight[ i] := (FormulaCode and $0F) *1275 ValueFormula_Weight[I] := (FormulaCode and $0F) * 1262 1276 (1 shl (FormulaCode and $30 shr 4)) / 16 1263 1277 else 1264 ValueFormula_Weight[ i] := (FormulaCode and $0F) *1278 ValueFormula_Weight[I] := (FormulaCode and $0F) * 1265 1279 (1 shl (FormulaCode and $30 shr 4)); 1266 1280 end; … … 1269 1283 TestReport.HypoTax := -1; 1270 1284 TestReport.HypoLux := -1; 1271 GetSmallCityReport( p, cix, TestReport, @CityReportEx);1272 with RW[ p].City[cix] do1285 GetSmallCityReport(P, cix, TestReport, @CityReportEx); 1286 with RW[P].City[cix] do 1273 1287 begin 1274 1288 V21_to_Loc(Loc, Radius); 1275 FoodToTax := RW[ p].Government = gFuture;1289 FoodToTax := RW[P].Government = gFuture; 1276 1290 ProdToTax := Project and (cpImp + cpIndex) = cpImp + imTrGoods; 1277 FoodWasted := not FoodToTax and (Food = StorageSize[Difficulty[ p]]) and1278 not CanCityGrow( p, cix);1291 FoodWasted := not FoodToTax and (Food = StorageSize[Difficulty[P]]) and 1292 not CanCityGrow(P, cix); 1279 1293 1280 1294 // sub criteria … … 1286 1300 V21 xor $15; 1287 1301 end; 1288 for cix1 := 0 to RW[ p].nCity - 1 do1302 for cix1 := 0 to RW[P].nCity - 1 do 1289 1303 if cix1 <> cix then 1290 1304 begin 1291 Loc1 := RW[ p].City[cix1].Loc;1305 Loc1 := RW[P].City[cix1].Loc; 1292 1306 if Loc1 >= 0 then 1293 1307 begin … … 1302 1316 begin 1303 1317 dxdy(Loc, Loc1, dx, dy); 1304 dec(SubCriterion[(dy + 3) shl 2 + (dx + 3) shr 1], 160);1318 Dec(SubCriterion[(dy + 3) shl 2 + (dx + 3) shr 1], 160); 1305 1319 end; 1306 1320 end; … … 1309 1323 end; 1310 1324 1311 GetCityAreaInfo( p, Loc, CityAreaInfo);1325 GetCityAreaInfo(P, Loc, CityAreaInfo); 1312 1326 AreaSize := 0; 1313 1327 for V21 := 1 to 26 do 1314 1328 if CityAreaInfo.Available[V21] = faAvailable then 1315 inc(AreaSize);1316 1317 if RW[ p].Government = gFundamentalism then1329 Inc(AreaSize); 1330 1331 if RW[P].Government = gFundamentalism then 1318 1332 begin 1319 1333 MinWorking := Size; … … 1325 1339 if MinWorking > Size then 1326 1340 MinWorking := Size; 1327 if (RW[ p].LuxRate = 0) and not CityReportEx.TradeProcessing.FlexibleLuxury1341 if (RW[P].LuxRate = 0) and not CityReportEx.TradeProcessing.FlexibleLuxury 1328 1342 then 1329 1343 MaxWorking := MinWorking … … 1362 1376 Loc1 := Radius[V21]; 1363 1377 if (Loc1 >= 0) and (Loc1 < MapSize) and 1364 (RealMap[Loc1] and fModern = cardinal(NeedRare)) then1378 (RealMap[Loc1] and fModern = Cardinal(NeedRare)) then 1365 1379 RareTiles := RareTiles or (1 shl V21); 1366 end 1380 end; 1367 1381 end; 1368 1382 … … 1374 1388 begin 1375 1389 Loc1 := Radius[V21]; 1376 assert((Loc1 >= 0) and (Loc1 < MapSize));1377 GetTileInfo( p, cix, Loc1, TileInfo);1390 Assert((Loc1 >= 0) and (Loc1 < MapSize)); 1391 GetTileInfo(P, cix, Loc1, TileInfo); 1378 1392 if V21 = CityOwnTile then 1379 1393 BaseTileInfo := TileInfo … … 1391 1405 (TileInfo.Trade = Hierarchy[iH, iT].Trade) and 1392 1406 (SubCriterion[V21] >= SubCriterion[Hierarchy[iH, iT].V21])) do 1393 inc(iT);1407 Inc(iT); 1394 1408 if (iT = nTile[iH]) // new worst tile in this hierarchy 1395 1409 or ((TileInfo.Food >= Hierarchy[iH, iT].Food) … … 1397 1411 and (TileInfo.Prod >= Hierarchy[iH, iT].Prod) and 1398 1412 (TileInfo.Trade >= Hierarchy[iH, iT].Trade)) then 1399 break; // insert position found!1400 inc(iH);1413 Break; // insert position found! 1414 Inc(iH); 1401 1415 end; 1402 1416 if iH = nHierarchy then 1403 1417 begin // need to start new hierarchy 1404 1418 nTile[iH] := 0; 1405 inc(nHierarchy);1419 Inc(nHierarchy); 1406 1420 iT := 0; 1407 1421 end; 1408 move(Hierarchy[iH, iT], Hierarchy[iH, iT + 1],1422 Move(Hierarchy[iH, iT], Hierarchy[iH, iT + 1], 1409 1423 (nTile[iH] - iT) * SizeOf(TTileData)); 1410 inc(nTile[iH]);1424 Inc(nTile[iH]); 1411 1425 Hierarchy[iH, iT].V21 := V21; 1412 1426 Hierarchy[iH, iT].Food := TileInfo.Food; … … 1424 1438 begin 1425 1439 Loc1 := Radius[V21]; 1426 assert((V21 <> CityOwnTile) and (Loc1 >= 0) and (Loc1 < MapSize));1427 GetTileInfo( p, cix, Loc1, TileInfo);1440 Assert((V21 <> CityOwnTile) and (Loc1 >= 0) and (Loc1 < MapSize)); 1441 GetTileInfo(P, cix, Loc1, TileInfo); 1428 1442 if iH = nHierarchy then 1429 1443 begin // need to start new hierarchy 1430 1444 nTile[iH] := 0; 1431 inc(nHierarchy);1445 Inc(nHierarchy); 1432 1446 iT := 0; 1433 1447 end 1434 1448 else 1435 1449 iT := nTile[iH]; 1436 inc(nTile[iH]);1450 Inc(nTile[iH]); 1437 1451 Hierarchy[iH, iT].V21 := V21; 1438 1452 Hierarchy[iH, iT].Food := TileInfo.Food; // = 0 … … 1443 1457 end; 1444 1458 if Built[imAlgae] > 0 then 1445 inc(BaseTileInfo.Food, 12);1459 Inc(BaseTileInfo.Food, 12); 1446 1460 1447 1461 // step 2: summarize resources 1448 1462 for iH := 0 to nHierarchy - 1 do 1449 1463 begin 1450 move(Hierarchy[iH, 0], Hierarchy[iH, 1], nTile[iH] * SizeOf(TTileData));1464 Move(Hierarchy[iH, 0], Hierarchy[iH, 1], nTile[iH] * SizeOf(TTileData)); 1451 1465 Hierarchy[iH, 0].Food := 0; 1452 1466 Hierarchy[iH, 0].Prod := 0; … … 1456 1470 for iT := 1 to nTile[iH] do 1457 1471 begin 1458 inc(Hierarchy[iH, iT].Food, Hierarchy[iH, iT - 1].Food);1459 inc(Hierarchy[iH, iT].Prod, Hierarchy[iH, iT - 1].Prod);1460 inc(Hierarchy[iH, iT].Trade, Hierarchy[iH, iT - 1].Trade);1461 inc(Hierarchy[iH, iT].SubValue, Hierarchy[iH, iT - 1].SubValue);1472 Inc(Hierarchy[iH, iT].Food, Hierarchy[iH, iT - 1].Food); 1473 Inc(Hierarchy[iH, iT].Prod, Hierarchy[iH, iT - 1].Prod); 1474 Inc(Hierarchy[iH, iT].Trade, Hierarchy[iH, iT - 1].Trade); 1475 Inc(Hierarchy[iH, iT].SubValue, Hierarchy[iH, iT - 1].SubValue); 1462 1476 Hierarchy[iH, iT].V21 := 1 shl Hierarchy[iH, iT].V21 + 1463 1477 Hierarchy[iH, iT - 1].V21; … … 1487 1501 (ProdBeforeBoost < WantedProd)) do 1488 1502 begin 1489 assert(nSelection[iH] = 0);1503 Assert(nSelection[iH] = 0); 1490 1504 Take := MinWorking - TestReport.Working; 1491 1505 if Take > nTile[iH] then … … 1500 1514 while (Take < MaxTake) and 1501 1515 (TestReport.FoodRep + Hierarchy[iH, Take].Food < MinFood) do 1502 inc(Take);1516 Inc(Take); 1503 1517 while (Take < MaxTake) and 1504 1518 (ProdBeforeBoost + Hierarchy[iH, Take].Prod < MinProd) do 1505 inc(Take);1519 Inc(Take); 1506 1520 end; 1507 1521 nSelection[iH] := Take; 1508 inc(TestReport.Working, Take);1522 Inc(TestReport.Working, Take); 1509 1523 with Hierarchy[iH, Take] do 1510 1524 begin 1511 inc(TestReport.FoodRep, Food);1512 inc(ProdBeforeBoost, Prod);1513 inc(TestReport.Trade, Trade);1514 end; 1515 inc(iH);1516 end; 1517 1518 assert((TestReport.Working >= MinWorking) and1525 Inc(TestReport.FoodRep, Food); 1526 Inc(ProdBeforeBoost, Prod); 1527 Inc(TestReport.Trade, Trade); 1528 end; 1529 Inc(iH); 1530 end; 1531 1532 Assert((TestReport.Working >= MinWorking) and 1519 1533 (TestReport.Working <= MaxWorking)); 1520 1534 if (TestReport.FoodRep >= MinFood) and (ProdBeforeBoost >= MinProd) then 1521 1535 begin 1522 SplitTrade(TestReport.Trade, RW[ p].TaxRate, RW[p].LuxRate,1536 SplitTrade(TestReport.Trade, RW[P].TaxRate, RW[P].LuxRate, 1523 1537 TestReport.Working, CityReportEx.TradeProcessing, 1524 1538 TestReport.Corruption, TestReport.Tax, TestReport.Lux, … … 1529 1543 TestReport.Deployed >= Size then 1530 1544 begin // city is not in disorder -- evaluate combination 1531 inc(count);1545 Inc(count); 1532 1546 if (MinProd < WantedProd) and (ProdBeforeBoost > MinProd) then 1533 1547 begin // no combination reached wanted prod yet … … 1577 1591 then 1578 1592 begin 1579 inc(Output[oTax], Output[oFood]);1593 Inc(Output[oTax], Output[oFood]); 1580 1594 Output[oFood] := 0; 1581 1595 end; … … 1589 1603 if NeedRare > 0 then 1590 1604 begin 1591 RareOK := false;1605 RareOK := False; 1592 1606 for iH := 0 to nHierarchy - 1 do 1593 1607 if Hierarchy[iH, nSelection[iH]].V21 and RareTiles <> 0 then 1594 RareOK := true;1608 RareOK := True; 1595 1609 if not RareOK then 1596 1610 TestReport.ProdRep := TestReport.Support; … … 1599 1613 if ProdToTax then 1600 1614 begin 1601 inc(Output[oTax], Output[oProd]);1615 Inc(Output[oTax], Output[oProd]); 1602 1616 Output[oProd] := 0; 1603 1617 end; 1604 1618 end; 1605 1619 1606 NeedStep2 := false;1620 NeedStep2 := False; 1607 1621 Value := 0; 1608 for i:= oFood to oScience do1609 if ValueFormula_Multiply[ i] then1610 NeedStep2 := true1622 for I := oFood to oScience do 1623 if ValueFormula_Multiply[I] then 1624 NeedStep2 := True 1611 1625 else 1612 Value := Value + ValueFormula_Weight[ i] * Output[i];1626 Value := Value + ValueFormula_Weight[I] * Output[I]; 1613 1627 if NeedStep2 then 1614 1628 begin 1615 1629 if Value > 0 then 1616 1630 Value := ln(Value) + 123; 1617 for i:= oFood to oScience do1618 if ValueFormula_Multiply[ i] and (Output[i] > 0) then1619 Value := Value + ValueFormula_Weight[ i] *1620 (ln(Output[ i]) + 123);1631 for I := oFood to oScience do 1632 if ValueFormula_Multiply[I] and (Output[I] > 0) then 1633 Value := Value + ValueFormula_Weight[I] * 1634 (ln(Output[I]) + 123); 1621 1635 end; 1622 1636 … … 1629 1643 for iH := 0 to nHierarchy - 1 do 1630 1644 begin 1631 inc(TestTiles, Hierarchy[iH, nSelection[iH]].V21);1632 inc(SubValue, Hierarchy[iH, nSelection[iH]].SubValue);1645 Inc(TestTiles, Hierarchy[iH, nSelection[iH]].V21); 1646 Inc(SubValue, Hierarchy[iH, nSelection[iH]].SubValue); 1633 1647 end; 1634 IsBest := true;1648 IsBest := True; 1635 1649 if (SuperPlus = 0) and (ValuePlus = 0.0) then 1636 1650 begin 1637 1651 SubPlus := SubValue - BestSubValue; 1638 1652 if SubPlus < 0 then 1639 IsBest := false1653 IsBest := False 1640 1654 else if SubPlus = 0 then 1641 1655 begin 1642 assert(TestTiles <> BestTiles);1656 Assert(TestTiles <> BestTiles); 1643 1657 IsBest := TestTiles > BestTiles 1644 1658 end … … 1654 1668 TestReport.Lux shr 1; 1655 1669 Advice.CityReport := TestReport; 1656 end 1657 end // if (SuperPlus>0) or (ValuePlus>=0.0)1658 end // if SuperPlus>=01659 end 1670 end; 1671 end; // if (SuperPlus>0) or (ValuePlus>=0.0) 1672 end; // if SuperPlus>=0 1673 end; 1660 1674 end; 1661 1675 … … 1665 1679 with Hierarchy[iH_Switch, nSelection[iH_Switch]] do 1666 1680 begin 1667 dec(TestReport.FoodRep, Food);1668 dec(ProdBeforeBoost, Prod);1669 dec(TestReport.Trade, Trade);1670 end; 1671 inc(nSelection[iH_Switch]);1672 inc(TestReport.Working);1681 Dec(TestReport.FoodRep, Food); 1682 Dec(ProdBeforeBoost, Prod); 1683 Dec(TestReport.Trade, Trade); 1684 end; 1685 Inc(nSelection[iH_Switch]); 1686 Inc(TestReport.Working); 1673 1687 if (nSelection[iH_Switch] <= nTile[iH_Switch]) and 1674 1688 (TestReport.Working <= MaxWorking) then … … 1676 1690 with Hierarchy[iH_Switch, nSelection[iH_Switch]] do 1677 1691 begin 1678 inc(TestReport.FoodRep, Food);1679 inc(ProdBeforeBoost, Prod);1680 inc(TestReport.Trade, Trade);1692 Inc(TestReport.FoodRep, Food); 1693 Inc(ProdBeforeBoost, Prod); 1694 Inc(TestReport.Trade, Trade); 1681 1695 end; 1682 break;1683 end; 1684 dec(TestReport.Working, nSelection[iH_Switch]);1696 Break; 1697 end; 1698 Dec(TestReport.Working, nSelection[iH_Switch]); 1685 1699 nSelection[iH_Switch] := 0; 1686 inc(iH_Switch);1700 Inc(iH_Switch); 1687 1701 until iH_Switch = nHierarchy; 1688 1702 until iH_Switch = nHierarchy; // everything tested -- done 1689 1703 end; 1690 assert(BestSuperValue > 0); // advice should always be possible1704 Assert(BestSuperValue > 0); // advice should always be possible 1691 1705 Advice.Tiles := BestTiles; 1692 1706 Advice.CityReport.HypoTiles := BestTiles; 1693 end; // GetCityTileAdvice1707 end; 1694 1708 1695 1709 { … … 1699 1713 procedure InitGame; 1700 1714 var 1701 p, i, mixTownGuard: integer;1715 P, I, mixTownGuard: Integer; 1702 1716 begin 1703 1717 MaxDist := Distance(0, MapSize - lx shr 1); 1704 for p:= 0 to nPl - 1 do1705 if (1 shl pand GAlive <> 0) then1706 with RW[ p] do1718 for P := 0 to nPl - 1 do 1719 if (1 shl P and GAlive <> 0) then 1720 with RW[P] do 1707 1721 begin // initialize capital 1708 1722 mixTownGuard := 0; 1709 1723 while Model[mixTownGuard].Kind <> mkSpecial_TownGuard do 1710 inc(mixTownGuard);1724 Inc(mixTownGuard); 1711 1725 with City[0] do 1712 1726 begin 1713 1727 Built[imPalace] := 1; 1714 1728 Size := 4; 1715 for i:= 2 to Size do1716 AddBestCityTile( p, 0);1729 for I := 2 to Size do 1730 AddBestCityTile(P, 0); 1717 1731 Project := mixTownGuard; 1718 1732 end; -
branches/highdpi/CmdList.pas
r361 r465 5 5 6 6 uses 7 Classes ;7 Classes, SysUtils, Math; 8 8 9 9 const 10 10 MaxDataSize = 1024; 11 CommandDataElementSize = 4; 12 CommandDataElementCountMask = $F; 13 CommandDataMaxSize = CommandDataElementSize * CommandDataElementCountMask; 11 14 12 15 type … … 24 27 constructor Create; 25 28 destructor Destroy; override; 26 procedure Get(var Command, Player, Subject: integer; var Data: pointer);27 procedure GetDataChanges(Data: pointer; DataSize: integer);28 procedure Put(Command, Player, Subject: integer; Data: pointer);29 procedure PutDataChanges(Command, Player: integer;30 OldData, NewData: pointer; DataSize: integer);31 procedure LoadFromFile(const f: TFileStream);32 procedure SaveToFile(const f: TFileStream);33 procedure AppendToFile(const f: TFileStream; const OldState: TCmdListState);29 procedure Get(var Command, Player, Subject: Integer; var Data: Pointer); 30 procedure GetDataChanges(Data: Pointer; DataSize: Integer); 31 procedure Put(Command, Player, Subject: Integer; Data: Pointer); 32 procedure PutDataChanges(Command, Player: Integer; 33 OldData, NewData: Pointer; DataSize: Integer); 34 procedure LoadFromFile(const F: TFileStream); 35 procedure SaveToFile(const F: TFileStream); 36 procedure AppendToFile(const F: TFileStream; const OldState: TCmdListState); 34 37 procedure Cut; 35 function Progress: integer;38 function Progress: Integer; 36 39 private 37 LogAlloc: integer; { allocated size of LogData in bytes }40 LogAlloc: Integer; { allocated size of LogData in bytes } 38 41 LogData: ^TLogData; 39 42 FState: TCmdListState; 40 procedure PutData(Data: pointer; Length: integer);43 procedure PutData(Data: Pointer; Length: Integer); 41 44 procedure CompleteMoveCode; 42 45 public … … 44 47 end; 45 48 49 function CommandWithData(Command: Integer; DataSize: Byte): Integer; 50 51 resourcestring 52 SCommandDataSizeError = 'Command data size %d out of range (0-%d).'; 53 54 46 55 implementation 47 56 … … 53 62 54 63 type 55 TData = array [0 ..MaxDataSize - 1] of Cardinal;64 TData = array [0..MaxDataSize - 1] of Cardinal; 56 65 PData = ^TData; 66 67 function CommandWithData(Command: Integer; DataSize: Byte): Integer; 68 var 69 DataElementCount: Byte; 70 begin 71 if DataSize > CommandDataMaxSize then 72 raise Exception.Create(Format(SCommandDataSizeError, [DataSize, CommandDataMaxSize])); 73 DataElementCount := Ceil(DataSize / CommandDataElementSize); 74 Result := Command or (DataElementCount and CommandDataElementCountMask); 75 end; 57 76 58 77 constructor TCmdList.Create; … … 73 92 end; 74 93 75 procedure TCmdList.Get(var Command, Player, Subject: integer; var Data: pointer);94 procedure TCmdList.Get(var Command, Player, Subject: Integer; var Data: Pointer); 76 95 var 77 96 DirCode: Cardinal; … … 108 127 else 109 128 begin 110 code := Cardinal((@LogData[FState.LoadPos])^);111 if code and 3 = 0 then129 Code := Cardinal((@LogData[FState.LoadPos])^); 130 if Code and 3 = 0 then 112 131 begin // non-clientex command 113 Command := code shr 2 and $3FFF + sExecute;114 Player := code shr 16 and $F;115 Subject := code shr 20 and $FFF;116 inc(FState.LoadPos, 4);117 end 118 else if code and 7 = 2 then132 Command := Code shr 2 and $3FFF + sExecute; 133 Player := Code shr 16 and $F; 134 Subject := Code shr 20 and $FFF; 135 Inc(FState.LoadPos, 4); 136 end 137 else if Code and 7 = 2 then 119 138 begin // clientex command 120 Command := code shr 3 and $FFFF;121 Player := code shr 19 and $F;139 Command := Code shr 3 and $FFFF; 140 Player := Code shr 19 and $F; 122 141 Subject := 0; 123 inc(FState.LoadPos, 3);142 Inc(FState.LoadPos, 3); 124 143 end 125 144 else 126 145 begin // move command shortcut 127 if ( code and 1 = 1) and (code and (7 shl 4) <> 6 shl 4) then146 if (Code and 1 = 1) and (Code and (7 shl 4) <> 6 shl 4) then 128 147 begin 129 FState.LoadMoveCode := code and $FF;130 inc(FState.LoadPos);148 FState.LoadMoveCode := Code and $FF; 149 Inc(FState.LoadPos); 131 150 end 132 151 else 133 152 begin 134 FState.LoadMoveCode := code and $FFFFFF;135 inc(FState.LoadPos, 3);153 FState.LoadMoveCode := Code and $FFFFFF; 154 Inc(FState.LoadPos, 3); 136 155 end; 137 156 Get(Command, Player, Subject, Data); … … 139 158 end; 140 159 141 if Command and $F= 0 then160 if Command and CommandDataElementCountMask = 0 then 142 161 Data := nil 143 162 else 144 163 begin 145 164 Data := @LogData[FState.LoadPos]; 146 inc(FState.LoadPos, Command and $F * 4);147 end; 148 end; 149 end; 150 151 procedure TCmdList.GetDataChanges(Data: pointer; DataSize: integer);165 Inc(FState.LoadPos, Command and CommandDataElementCountMask * CommandDataElementSize); 166 end; 167 end; 168 end; 169 170 procedure TCmdList.GetDataChanges(Data: Pointer; DataSize: Integer); 152 171 var 153 b0, b1: integer;172 b0, b1: Integer; 154 173 Map0, Map1: Cardinal; 155 174 begin 156 175 Map0 := Cardinal((@LogData[FState.LoadPos])^); 157 inc(FState.LoadPos, 4);176 Inc(FState.LoadPos, 4); 158 177 b0 := 0; 159 178 while Map0 > 0 do begin 160 179 if Map0 and 1 <> 0 then begin 161 180 Map1 := Cardinal((@LogData[FState.LoadPos])^); 162 inc(FState.LoadPos, 4);181 Inc(FState.LoadPos, 4); 163 182 for b1 := 0 to 31 do 164 183 if 1 shl b1 and Map1 <> 0 then begin 165 184 if b0 * 32 + b1 < DataSize then 166 185 PData(Data)[b0 * 32 + b1] := Cardinal((@LogData[FState.LoadPos])^); 167 inc(FState.LoadPos, 4);186 Inc(FState.LoadPos, 4); 168 187 end; 169 188 end; 170 inc(b0);189 Inc(b0); 171 190 Map0 := Map0 shr 1; 172 191 end; 173 192 end; 174 193 175 procedure TCmdList.Put(Command, Player, Subject: integer; Data: pointer);194 procedure TCmdList.Put(Command, Player, Subject: Integer; Data: Pointer); 176 195 var 177 DirCode, code: Cardinal;196 DirCode, Code: Cardinal; 178 197 begin 179 198 if Command and $FC00 = sMoveUnit then … … 190 209 end; 191 210 if Subject = FState.LastMovingUnit then 192 code := 1 + DirCode shl 1193 else 194 code := 6 + DirCode shl 3 + Cardinal(Subject) shl 6;211 Code := 1 + DirCode shl 1 212 else 213 Code := 6 + DirCode shl 3 + Cardinal(Subject) shl 6; 195 214 if FState.MoveCode = 0 then 196 FState.MoveCode := code215 FState.MoveCode := Code 197 216 else if FState.MoveCode and 1 = 1 then 198 217 begin // FM + this 199 FState.MoveCode := FState.MoveCode + code shl 4;200 if code and 1 = 1 then218 FState.MoveCode := FState.MoveCode + Code shl 4; 219 if Code and 1 = 1 then 201 220 PutData(@FState.MoveCode, 1) // FM + FM 202 221 else … … 204 223 FState.MoveCode := 0; 205 224 end 206 else if code and 1 = 1 then225 else if Code and 1 = 1 then 207 226 begin // M + FM 208 FState.MoveCode := FState.MoveCode + code shl 18;227 FState.MoveCode := FState.MoveCode + Code shl 18; 209 228 PutData(@FState.MoveCode, 3); 210 229 FState.MoveCode := 0; … … 213 232 begin 214 233 PutData(@FState.MoveCode, 3); 215 FState.MoveCode := code;234 FState.MoveCode := Code; 216 235 end; 217 236 FState.LastMovingUnit := Subject; … … 222 241 if Command >= cClientEx then 223 242 begin 224 code := 2 + Command shl 3 + Player shl 19;225 PutData(@ code, 3);226 end 227 else 228 begin 229 code := Cardinal(Command - sExecute) shl 2 + Cardinal(Player) shl 16 +243 Code := 2 + Command shl 3 + Player shl 19; 244 PutData(@Code, 3); 245 end 246 else 247 begin 248 Code := Cardinal(Command - sExecute) shl 2 + Cardinal(Player) shl 16 + 230 249 Cardinal(Subject) shl 20; 231 PutData(@ code, 4);232 end; 233 end; 234 if Command and $F<> 0 then235 PutData(Data, Command and $F * 4);236 end; 237 238 procedure TCmdList.PutDataChanges(Command, Player: integer;239 OldData, NewData: pointer; DataSize: integer);250 PutData(@Code, 4); 251 end; 252 end; 253 if Command and CommandDataElementCountMask <> 0 then 254 PutData(Data, Command and CommandDataElementCountMask * CommandDataElementSize); 255 end; 256 257 procedure TCmdList.PutDataChanges(Command, Player: Integer; 258 OldData, NewData: Pointer; DataSize: Integer); 240 259 var 241 MapPos, LogPos, b0, b1, RowEnd: integer;242 Map0, Map1, code: Cardinal;260 MapPos, LogPos, b0, b1, RowEnd: Integer; 261 Map0, Map1, Code: Cardinal; 243 262 begin 244 263 if DataSize <= 0 then 245 exit;264 Exit; 246 265 if DataSize > MaxDataSize then 247 266 DataSize := MaxDataSize; … … 254 273 if LogPos + 4 * 32 > LogAlloc then 255 274 begin 256 inc(LogAlloc, LogGrow);275 Inc(LogAlloc, LogGrow); 257 276 ReallocMem(LogData, LogAlloc); 258 277 end; … … 268 287 begin 269 288 Cardinal((@LogData[LogPos])^) := PData(NewData)[b1]; 270 inc(LogPos, 4);271 inc(Map1, $80000000);289 Inc(LogPos, 4); 290 Inc(Map1, $80000000); 272 291 end; 273 292 end; … … 277 296 Cardinal((@LogData[MapPos])^) := Map1; 278 297 MapPos := LogPos; 279 inc(LogPos, 4);280 inc(Map0, $80000000);298 Inc(LogPos, 4); 299 Inc(Map0, $80000000); 281 300 end; 282 301 end; 283 302 if Map0 = 0 then 284 exit; // no changes303 Exit; // no changes 285 304 286 305 Map0 := Map0 shr (31 - (DataSize - 1) div 32); 287 306 Cardinal((@LogData[FState.nLog + 4])^) := Map0; 288 code := Cardinal(Command - sExecute) shl 2 + Cardinal(Player) shl 16;289 Cardinal((@LogData[FState.nLog])^) := code;307 Code := Cardinal(Command - sExecute) shl 2 + Cardinal(Player) shl 16; 308 Cardinal((@LogData[FState.nLog])^) := Code; 290 309 FState.nLog := MapPos; 291 310 end; 292 311 293 procedure TCmdList.PutData(Data: pointer; Length: integer);312 procedure TCmdList.PutData(Data: Pointer; Length: Integer); 294 313 begin 295 314 if FState.nLog + Length > LogAlloc then 296 315 begin 297 inc(LogAlloc, LogGrow);316 Inc(LogAlloc, LogGrow); 298 317 ReallocMem(LogData, LogAlloc); 299 318 end; 300 move(Data^, LogData[FState.nLog], Length);301 inc(FState.nLog, Length);319 Move(Data^, LogData[FState.nLog], Length); 320 Inc(FState.nLog, Length); 302 321 end; 303 322 … … 314 333 end; 315 334 316 procedure TCmdList.LoadFromFile(const f: TFileStream);317 begin 318 f.read(FState.nLog, 4);335 procedure TCmdList.LoadFromFile(const F: TFileStream); 336 begin 337 F.Read(FState.nLog, 4); 319 338 LogData := nil; 320 339 LogAlloc := ((FState.nLog + 2) div LogGrow + 1) * LogGrow; 321 340 ReallocMem(LogData, LogAlloc); 322 f.read(LogData^, FState.nLog);341 F.Read(LogData^, FState.nLog); 323 342 FState.LoadPos := 0; 324 343 end; 325 344 326 procedure TCmdList.SaveToFile(const f: TFileStream);345 procedure TCmdList.SaveToFile(const F: TFileStream); 327 346 begin 328 347 CompleteMoveCode; 329 f.write(FState.nLog, 4);330 f.write(LogData^, FState.nLog);331 end; 332 333 procedure TCmdList.AppendToFile(const f: TFileStream;348 F.Write(FState.nLog, 4); 349 F.Write(LogData^, FState.nLog); 350 end; 351 352 procedure TCmdList.AppendToFile(const F: TFileStream; 334 353 const OldState: TCmdListState); 335 354 begin 336 355 CompleteMoveCode; 337 f.write(FState.nLog, 4);338 f.Position := f.Position + OldState.nLog;339 f.write(LogData[OldState.nLog], FState.nLog - OldState.nLog);356 F.Write(FState.nLog, 4); 357 F.Position := F.Position + OldState.nLog; 358 F.Write(LogData[OldState.nLog], FState.nLog - OldState.nLog); 340 359 end; 341 360 … … 345 364 end; 346 365 347 function TCmdList.Progress: integer;366 function TCmdList.Progress: Integer; 348 367 begin 349 368 if (FState.LoadPos = FState.nLog) and (FState.LoadMoveCode = 0) then 350 result := 1000 // loading complete369 Result := 1000 // loading complete 351 370 else if FState.nLog > 1 shl 20 then 352 result := (FState.LoadPos shr 8) * 999 div (FState.nLog shr 8)371 Result := (FState.LoadPos shr 8) * 999 div (FState.nLog shr 8) 353 372 else 354 result := FState.LoadPos * 999 div FState.nLog;373 Result := FState.LoadPos * 999 div FState.nLog; 355 374 end; 356 375 … … 360 379 Byte3 Byte2 Byte1 Byte0 361 380 ssssssss sssspppp cccccccc cccccc00 362 ( c = Command-sExecute, p = Player, s= Subject)381 (C = Command-sExecute, P = Player, S = Subject) 363 382 364 383 ClientEx-Command: 365 384 Byte2 Byte1 Byte0 366 385 0ppppccc cccccccc ccccc010 367 ( c = Command, p= Player)386 (C = Command, P = Player) 368 387 369 388 Single Move: 370 389 Byte2 Byte1 Byte0 371 390 000000ss ssssssss ssaaa110 372 ( a = Direction, s= Subject)391 (A = Direction, S = Subject) 373 392 374 393 Move + Follow Move: 375 394 Byte2 Byte1 Byte0 376 395 00bbb1ss ssssssss ssaaa110 377 ( a = Direction 1, s = Subject 1, b= Direction 2)396 (A = Direction 1, S = Subject 1, B = Direction 2) 378 397 379 398 Follow Move + Move: 380 399 Byte2 Byte1 Byte0 381 400 00ssssss ssssssbb b110aaa1 382 ( a = Direction 1, b = Direction 2, s= Subject 2)401 (A = Direction 1, B = Direction 2, S = Subject 2) 383 402 384 403 Single Follow Move: 385 404 Byte0 386 405 0000aaa1 387 ( a= Direction)406 (A = Direction) 388 407 389 408 Double Follow Move: 390 409 Byte0 391 410 bbb1aaa1 392 ( a = Direction 1, b= Direction 2)411 (A = Direction 1, B = Direction 2) 393 412 } 394 413 -
branches/highdpi/Database.pas
r349 r465 26 26 27 27 nStartUn = 1; 28 StartUn: array [0 .. nStartUn - 1] of integer = (0); // mix of start units28 StartUn: array [0 .. nStartUn - 1] of Integer = (0); // mix of start units 29 29 30 30 CityOwnTile = 13; … … 50 50 Mode: TGameMode; 51 51 GWonder: array [0 .. nWonder - 1] of TWonderInfo; 52 ServerVersion: array [0 .. nPl - 1] of integer;53 ProcessClientData: array [0 .. nPl - 1] of boolean;52 ServerVersion: array [0 .. nPl - 1] of Integer; 53 ProcessClientData: array [0 .. nPl - 1] of Boolean; 54 54 CL: TCmdList; 55 55 {$IFDEF TEXTLOG}CmdInfo: string; … … 58 58 // map data 59 59 RealMap: array [0 .. lxmax * lymax - 1] of Cardinal; 60 Continent: array [0 .. lxmax * lymax - 1] of integer;60 Continent: array [0 .. lxmax * lymax - 1] of Integer; 61 61 { continent id for each tile } 62 62 Occupant: array [0 .. lxmax * lymax - 1] of ShortInt; … … 65 65 ObserveLevel: array [0 .. lxmax * lymax - 1] of Cardinal; 66 66 { Observe Level of player p in bits 2*p and 2*p+1 } 67 UsedByCity: array [0 .. lxmax * lymax - 1] of integer;67 UsedByCity: array [0 .. lxmax * lymax - 1] of Integer; 68 68 { location of exploiting city for 69 69 each tile, =-1 if not exploited } … … 71 71 // player data 72 72 RW: array [0 .. nPl - 1] of TPlayerContext; { player data } 73 Difficulty: array [0 .. nPl - 1] of integer;73 Difficulty: array [0 .. nPl - 1] of Integer; 74 74 GShip: array [0 .. nPl - 1] of TShipInfo; 75 75 ResourceMask: array [0 .. nPl - 1] of Cardinal; 76 Founded: array [0 .. nPl - 1] of integer; { number of cities founded }77 TerritoryCount: array [0 .. nPl] of integer;76 Founded: array [0 .. nPl - 1] of Integer; { number of cities founded } 77 TerritoryCount: array [0 .. nPl] of Integer; 78 78 LastValidStat, Researched, Discovered, // number of tiles discovered 79 GrWallContinent: array [0 .. nPl - 1] of integer;79 GrWallContinent: array [0 .. nPl - 1] of Integer; 80 80 RWemix: array [0 .. nPl - 1, 0 .. nPl - 1, 0 .. nmmax - 1] of SmallInt; 81 81 // [p1,p2,mix] -> index of p2's model mix in p1's enemy model list 82 82 Destroyed: array [0 .. nPl - 1, 0 .. nPl - 1, 0 .. nmmax - 1] of SmallInt; 83 83 // [p1,p2,mix] -> number of p2's units with model mix that p1 has destroyed 84 nTech: array [0 .. nPl - 1] of integer; { number of known techs }84 nTech: array [0 .. nPl - 1] of Integer; { number of known techs } 85 85 // NewContact: array[0..nPl-1,0..nPl-1] of boolean; 86 86 87 87 type 88 TVicinity8Loc = array [0 .. 7] of integer;89 TVicinity21Loc = array [0 .. 27] of integer;90 91 procedure MaskD(var x: array of Cardinal; Count, Mask: Cardinal);92 procedure IntServer(Command, Player, Subject: integer; var Data);93 procedure CompactLists( p: integer);94 procedure ClearTestFlags(ClearFlags: integer);95 procedure SetTestFlags( p, SetFlags: integer);88 TVicinity8Loc = array [0 .. 7] of Integer; 89 TVicinity21Loc = array [0 .. 27] of Integer; 90 91 procedure MaskD(var X: array of Cardinal; Count, Mask: Cardinal); 92 procedure IntServer(Command, Player, Subject: Integer; var Data); 93 procedure CompactLists(P: Integer); 94 procedure ClearTestFlags(ClearFlags: Integer); 95 procedure SetTestFlags(P, SetFlags: Integer); 96 96 97 97 // Tech Related Functions 98 function TechBaseCost(nTech, diff: integer): integer;99 function TechCost( p: integer): integer;100 procedure CalculateModel(var m: TModel);101 procedure CheckSpecialModels( p, pre: integer);102 procedure EnableDevModel( p: integer);103 procedure SeeTech( p, ad: integer);104 procedure DiscoverTech( p, ad: integer);105 procedure CheckExpiration(Wonder: integer);98 function TechBaseCost(nTech, diff: Integer): Integer; 99 function TechCost(P: Integer): Integer; 100 procedure CalculateModel(var M: TModel); 101 procedure CheckSpecialModels(P, pre: Integer); 102 procedure EnableDevModel(P: Integer); 103 procedure SeeTech(P, ad: Integer); 104 procedure DiscoverTech(P, ad: Integer); 105 procedure CheckExpiration(Wonder: Integer); 106 106 107 107 // Location Navigation 108 function dLoc(Loc, dx, dy: integer): integer;109 procedure dxdy(Loc0, Loc1: integer; var dx, dy: integer);110 function Distance(Loc0, Loc1: integer): integer;111 procedure V8_to_Loc(Loc0: integer; var VicinityLoc: TVicinity8Loc);112 procedure V21_to_Loc(Loc0: integer; var VicinityLoc: TVicinity21Loc);108 function dLoc(Loc, dx, dy: Integer): Integer; 109 procedure dxdy(Loc0, Loc1: Integer; var dx, dy: Integer); 110 function Distance(Loc0, Loc1: Integer): Integer; 111 procedure V8_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity8Loc); 112 procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc); 113 113 114 114 // Game Initialization 115 115 procedure InitRandomGame; 116 procedure InitMapGame(Human: integer);116 procedure InitMapGame(Human: Integer); 117 117 procedure ReleaseGame; 118 118 119 119 // Map Editor 120 function MapGeneratorAvailable: boolean;120 function MapGeneratorAvailable: Boolean; 121 121 procedure CreateElevation; 122 procedure CreateMap(preview: boolean);122 procedure CreateMap(preview: Boolean); 123 123 procedure InitMapEditor; 124 124 procedure ReleaseMapEditor; 125 procedure EditTile(Loc, NewTile: integer);125 procedure EditTile(Loc, NewTile: Integer); 126 126 127 127 // Map Revealing 128 function GetTileInfo( p, cix, Loc: integer; var Info: TTileInfo): integer;129 procedure Strongest(Loc: integer; var uix, Strength, Bonus, Cnt: integer);130 function UnitSpeed( p, mix, Health: integer): integer;131 procedure GetUnitReport( p, uix: integer; var UnitReport: TUnitReport);132 procedure SearchCity(Loc: integer; var p, cix: integer);133 procedure TellAboutModel( p, taOwner, tamix: integer);134 function emixSafe( p, taOwner, tamix: integer): integer;135 function Discover9(Loc, p, Level: integer;136 TellAllied, EnableContact: boolean): boolean;137 function Discover21(Loc, p, AdjacentLevel: integer;138 TellAllied, EnableContact: boolean): boolean;139 procedure DiscoverAll( p, Level: integer);140 procedure DiscoverViewAreas( p: integer);141 function GetUnitStack( p, Loc: integer): integer;142 procedure UpdateUnitMap(Loc: integer; CityChange: boolean = false);143 procedure RecalcV8ZoC( p, Loc: integer);144 procedure RecalcMapZoC( p: integer);145 procedure RecalcPeaceMap( p: integer);128 function GetTileInfo(P, cix, Loc: Integer; var Info: TTileInfo): Integer; 129 procedure Strongest(Loc: Integer; var uix, Strength, Bonus, Cnt: Integer); 130 function UnitSpeed(P, mix, Health: Integer): Integer; 131 procedure GetUnitReport(P, uix: Integer; var UnitReport: TUnitReport); 132 procedure SearchCity(Loc: Integer; var P, cix: Integer); 133 procedure TellAboutModel(P, taOwner, tamix: Integer); 134 function emixSafe(P, taOwner, tamix: Integer): Integer; 135 function Discover9(Loc, P, Level: Integer; 136 TellAllied, EnableContact: Boolean): Boolean; 137 function Discover21(Loc, P, AdjacentLevel: Integer; 138 TellAllied, EnableContact: Boolean): Boolean; 139 procedure DiscoverAll(P, Level: Integer); 140 procedure DiscoverViewAreas(P: Integer); 141 function GetUnitStack(P, Loc: Integer): Integer; 142 procedure UpdateUnitMap(Loc: Integer; CityChange: Boolean = False); 143 procedure RecalcV8ZoC(P, Loc: Integer); 144 procedure RecalcMapZoC(P: Integer); 145 procedure RecalcPeaceMap(P: Integer); 146 146 147 147 // Territory Calculation 148 procedure CheckBorders(OriginLoc: integer; PlayerLosingCity: integer = -1);149 procedure LogCheckBorders( p, cix: integer; PlayerLosingCity: integer = -1);148 procedure CheckBorders(OriginLoc: Integer; PlayerLosingCity: Integer = -1); 149 procedure LogCheckBorders(P, cix: Integer; PlayerLosingCity: Integer = -1); 150 150 151 151 // Map Processing 152 procedure CreateUnit( p, mix: integer);153 procedure FreeUnit( p, uix: integer);154 procedure PlaceUnit( p, uix: integer);155 procedure RemoveUnit( p, uix: integer; Enemy: integer = -1);156 procedure RemoveUnit_UpdateMap( p, uix: integer);157 procedure RemoveAllUnits( p, Loc: integer; Enemy: integer = -1);158 procedure RemoveDomainUnits( d, p, Loc: integer);159 procedure FoundCity( p, FoundLoc: integer);160 procedure DestroyCity( p, cix: integer; SaveUnits: boolean);161 procedure ChangeCityOwner(pOld, cixOld, pNew: integer);162 procedure CompleteJob( p, Loc, Job: integer);152 procedure CreateUnit(P, mix: Integer); 153 procedure FreeUnit(P, uix: Integer); 154 procedure PlaceUnit(P, uix: Integer); 155 procedure RemoveUnit(P, uix: Integer; Enemy: Integer = -1); 156 procedure RemoveUnit_UpdateMap(P, uix: Integer); 157 procedure RemoveAllUnits(P, Loc: Integer; Enemy: Integer = -1); 158 procedure RemoveDomainUnits(D, P, Loc: Integer); 159 procedure FoundCity(P, FoundLoc: Integer); 160 procedure DestroyCity(P, cix: Integer; SaveUnits: Boolean); 161 procedure ChangeCityOwner(pOld, cixOld, pNew: Integer); 162 procedure CompleteJob(P, Loc, Job: Integer); 163 163 164 164 // Diplomacy 165 procedure IntroduceEnemy(p1, p2: integer); 166 procedure GiveCivilReport(p, pAbout: integer); 167 procedure GiveMilReport(p, pAbout: integer); 168 procedure ShowPrice(pSender, pTarget, Price: integer); 169 function PayPrice(pSender, pTarget, Price: integer; execute: boolean): boolean; 170 procedure CancelTreaty(p, pWith: integer; DecreaseCredibility: boolean = true); 171 function DoSpyMission(p, pCity, cix, Mission: integer): Cardinal; 165 procedure IntroduceEnemy(p1, p2: Integer); 166 procedure GiveCivilReport(P, pAbout: Integer); 167 procedure GiveMilReport(P, pAbout: Integer); 168 procedure ShowPrice(pSender, pTarget, Price: Integer); 169 function PayPrice(pSender, pTarget, Price: Integer; execute: Boolean): Boolean; 170 procedure CancelTreaty(P, pWith: Integer; DecreaseCredibility: Boolean = True); 171 function DoSpyMission(P, pCity, cix, Mission: Integer): Cardinal; 172 172 173 173 174 implementation … … 179 180 180 181 var 181 UnBuilt: array [0 .. nPl - 1] of integer; { number of units built }182 183 procedure MaskD(var x: array of Cardinal; Count, Mask: Cardinal);182 UnBuilt: array [0 .. nPl - 1] of Integer; { number of units built } 183 184 procedure MaskD(var X: array of Cardinal; Count, Mask: Cardinal); 184 185 var 185 186 I: Integer; 186 187 begin 187 188 for I := 0 to Count - 1 do 188 x[I] := x[I] and Mask;189 end; 190 191 procedure CompactLists( p: integer);192 var 193 uix, uix1, cix: integer;194 {$IFOPT O-}V21: integer;189 X[I] := X[I] and Mask; 190 end; 191 192 procedure CompactLists(P: Integer); 193 var 194 uix, uix1, cix: Integer; 195 {$IFOPT O-}V21: Integer; 195 196 Radius: TVicinity21Loc; {$ENDIF} 196 197 begin 197 with RW[ p] do198 with RW[P] do 198 199 begin 199 200 // compact unit list … … 202 203 if Un[uix].Loc < 0 then 203 204 begin 204 dec(nUn);205 Dec(nUn); 205 206 Un[uix] := Un[nUn]; { replace removed unit by last } 206 207 if (Un[uix].TroopLoad > 0) or (Un[uix].AirLoad > 0) then … … 211 212 end 212 213 else 213 inc(uix);214 Inc(uix); 214 215 215 216 // compact city list … … 218 219 if City[cix].Loc < 0 then 219 220 begin 220 dec(nCity);221 Dec(nCity); 221 222 City[cix] := City[nCity]; { replace city by last } 222 223 for uix1 := 0 to nUn - 1 do … … 226 227 end 227 228 else 228 inc(cix);229 Inc(cix); 229 230 230 231 // compact enemy city list … … 233 234 if EnemyCity[cix].Loc < 0 then 234 235 begin 235 dec(nEnemyCity);236 Dec(nEnemyCity); 236 237 EnemyCity[cix] := EnemyCity[nEnemyCity]; { replace city by last } 237 238 end 238 239 else 239 inc(cix);240 Inc(cix); 240 241 241 242 {$IFOPT O-} … … 246 247 for V21 := 1 to 26 do 247 248 if Tiles and (1 shl V21) <> 0 then 248 assert(UsedByCity[Radius[V21]] = Loc);249 end 249 Assert(UsedByCity[Radius[V21]] = Loc); 250 end; 250 251 {$ENDIF} 251 252 end; 252 end; // CompactLists253 end; 253 254 254 255 { … … 256 257 ____________________________________________________________________ 257 258 } 258 function TechBaseCost(nTech, diff: integer): integer;259 var 260 c0: single;259 function TechBaseCost(nTech, diff: Integer): Integer; 260 var 261 c0: Single; 261 262 begin 262 263 c0 := TechFormula_M[diff] * (nTech + 4) * 263 264 exp((nTech + 4) / TechFormula_D[diff]); 264 265 if c0 >= $10000000 then 265 result := $10000000266 Result := $10000000 266 267 else 267 result := trunc(c0)268 end; 269 270 function TechCost( p: integer): integer;271 begin 272 with RW[ p] do273 begin 274 result := TechBaseCost(nTech[p], Difficulty[p]);268 Result := trunc(c0); 269 end; 270 271 function TechCost(P: Integer): Integer; 272 begin 273 with RW[P] do 274 begin 275 Result := TechBaseCost(nTech[P], Difficulty[P]); 275 276 if ResearchTech >= 0 then 276 277 if (ResearchTech = adMilitary) or (Tech[ResearchTech] = tsSeen) then 277 result := result shr 1278 Result := Result shr 1 278 279 else if ResearchTech in FutureTech then 279 280 if Government = gFuture then 280 result := result * 2281 Result := Result * 2 281 282 else 282 result := result * 4;283 end 284 end; 285 286 procedure SetModelFlags(var m: TModel);287 begin 288 m.Flags := 0;289 if ( m.Domain = dGround) and (m.Kind <> mkDiplomat) then290 m.Flags := m.Flags or mdZOC;291 if ( m.Kind = mkDiplomat) or (m.Attack + m.Cap[mcBombs] = 0) then292 m.Flags := m.Flags or mdCivil;293 if ( m.Cap[mcOver] > 0) or (m.Domain = dSea) and (m.Weight >= 6) then294 m.Flags := m.Flags or mdDoubleSupport;295 end; 296 297 procedure CalculateModel(var m: TModel);283 Result := Result * 4; 284 end; 285 end; 286 287 procedure SetModelFlags(var M: TModel); 288 begin 289 M.Flags := 0; 290 if (M.Domain = dGround) and (M.Kind <> mkDiplomat) then 291 M.Flags := M.Flags or mdZOC; 292 if (M.Kind = mkDiplomat) or (M.Attack + M.Cap[mcBombs] = 0) then 293 M.Flags := M.Flags or mdCivil; 294 if (M.Cap[mcOver] > 0) or (M.Domain = dSea) and (M.Weight >= 6) then 295 M.Flags := M.Flags or mdDoubleSupport; 296 end; 297 298 procedure CalculateModel(var M: TModel); 298 299 { calculate attack, defense, cost... of a model by features } 299 300 var 300 i: integer;301 begin 302 with mdo301 I: Integer; 302 begin 303 with M do 303 304 begin 304 305 Attack := (Cap[mcOffense] + Cap[mcOver]) * MStrength; … … 311 312 Speed := 350 + 200 * Cap[mcNP] + 200 * Cap[mcTurbines]; 312 313 if Cap[mcNP] = 0 then 313 inc(Speed, 100 * Cap[mcSE]);314 Inc(Speed, 100 * Cap[mcSE]); 314 315 end; 315 316 dAir: … … 317 318 end; 318 319 Cost := 0; 319 for i:= 0 to nFeature - 1 do320 if 1 shl Domain and Feature[ i].Domains <> 0 then321 inc(Cost, Cap[i] * Feature[i].Cost);320 for I := 0 to nFeature - 1 do 321 if 1 shl Domain and Feature[I].Domains <> 0 then 322 Inc(Cost, Cap[I] * Feature[I].Cost); 322 323 Cost := Cost * MCost; 323 324 Weight := 0; 324 for i:= 0 to nFeature - 1 do325 if 1 shl Domain and Feature[ i].Domains <> 0 then326 if (Domain = dGround) and ( i= mcDefense) then327 inc(Weight, Cap[i] * 2)325 for I := 0 to nFeature - 1 do 326 if 1 shl Domain and Feature[I].Domains <> 0 then 327 if (Domain = dGround) and (I = mcDefense) then 328 Inc(Weight, Cap[I] * 2) 328 329 else 329 inc(Weight, Cap[i] * Feature[i].Weight);330 end; 331 SetModelFlags( m);332 end; 333 334 procedure CheckSpecialModels( p, pre: integer);335 var 336 i, mix1: integer;337 HasAlready: boolean;338 begin 339 for i:= 0 to nSpecialModel -330 Inc(Weight, Cap[I] * Feature[I].Weight); 331 end; 332 SetModelFlags(M); 333 end; 334 335 procedure CheckSpecialModels(P, pre: Integer); 336 var 337 I, mix1: Integer; 338 HasAlready: Boolean; 339 begin 340 for I := 0 to nSpecialModel - 340 341 1 do { check whether new special model available } 341 if (SpecialModelPreq[ i] = pre) and (RW[p].nModel < nmmax) then342 begin 343 HasAlready := false;344 for mix1 := 0 to RW[ p].nModel - 1 do345 if (RW[ p].Model[mix1].Kind = SpecialModel[i].Kind) and346 (RW[ p].Model[mix1].Attack = SpecialModel[i].Attack) and347 (RW[ p].Model[mix1].Speed = SpecialModel[i].Speed) then348 HasAlready := true;342 if (SpecialModelPreq[I] = pre) and (RW[P].nModel < nmmax) then 343 begin 344 HasAlready := False; 345 for mix1 := 0 to RW[P].nModel - 1 do 346 if (RW[P].Model[mix1].Kind = SpecialModel[I].Kind) and 347 (RW[P].Model[mix1].Attack = SpecialModel[I].Attack) and 348 (RW[P].Model[mix1].Speed = SpecialModel[I].Speed) then 349 HasAlready := True; 349 350 if not HasAlready then 350 351 begin 351 RW[ p].Model[RW[p].nModel] := SpecialModel[i];352 SetModelFlags(RW[ p].Model[RW[p].nModel]);353 with RW[ p].Model[RW[p].nModel] do352 RW[P].Model[RW[P].nModel] := SpecialModel[I]; 353 SetModelFlags(RW[P].Model[RW[P].nModel]); 354 with RW[P].Model[RW[P].nModel] do 354 355 begin 355 356 Status := 0; … … 358 359 Built := 0; 359 360 Lost := 0; 360 ID := p shl 12 + RW[p].nModel;361 if (Kind = mkSpecial_Boat) and (ServerVersion[ p] < $000EF0) then361 ID := P shl 12 + RW[P].nModel; 362 if (Kind = mkSpecial_Boat) and (ServerVersion[P] < $000EF0) then 362 363 Speed := 350; // old longboat 363 364 end; 364 inc(RW[p].nModel);365 end 366 end; 367 end; 368 369 procedure EnableDevModel( p: integer);370 begin 371 with RW[ p] do365 Inc(RW[P].nModel); 366 end; 367 end; 368 end; 369 370 procedure EnableDevModel(P: Integer); 371 begin 372 with RW[P] do 372 373 if nModel < nmmax then 373 374 begin … … 380 381 Built := 0; 381 382 Lost := 0; 382 ID := p shl 12 + nModel383 end; 384 inc(nModel);385 inc(Researched[p])386 end 387 end; 388 389 procedure SeeTech( p, ad: integer);390 begin 391 {$IFDEF TEXTLOG}CmdInfo := CmdInfo + Format(' P%d:A%d', [ p, ad]); {$ENDIF}392 RW[ p].Tech[ad] := tsSeen;383 ID := P shl 12 + nModel; 384 end; 385 Inc(nModel); 386 Inc(Researched[P]); 387 end; 388 end; 389 390 procedure SeeTech(P, ad: Integer); 391 begin 392 {$IFDEF TEXTLOG}CmdInfo := CmdInfo + Format(' P%d:A%d', [P, ad]); {$ENDIF} 393 RW[P].Tech[ad] := tsSeen; 393 394 // inc(nTech[p]); 394 inc(Researched[p])395 Inc(Researched[P]); 395 396 end; 396 397 397 398 procedure FreeSlaves; 398 399 var 399 p1, uix: integer;400 p1, uix: Integer; 400 401 begin 401 402 for p1 := 0 to nPl - 1 do … … 403 404 for uix := 0 to RW[p1].nUn - 1 do 404 405 if RW[p1].Model[RW[p1].Un[uix].mix].Kind = mkSlaves then 405 RW[p1].Un[uix].Job := jNone 406 end; 407 408 procedure DiscoverTech( p, ad: integer);409 410 procedure TellAboutKeyTech( p, Source: integer);406 RW[p1].Un[uix].Job := jNone; 407 end; 408 409 procedure DiscoverTech(P, ad: Integer); 410 411 procedure TellAboutKeyTech(P, Source: Integer); 411 412 var 412 i, p1: integer;413 begin 414 for i:= 1 to 3 do415 if ad = AgePreq[ i] then413 I, p1: Integer; 414 begin 415 for I := 1 to 3 do 416 if ad = AgePreq[I] then 416 417 for p1 := 0 to nPl - 1 do 417 if (p1 <> p) and ((GAlive or GWatching) and (1 shl p1) <> 0) then418 RW[p1].EnemyReport[ p].Tech[ad] := Source;419 end; 420 421 var 422 i: integer;418 if (p1 <> P) and ((GAlive or GWatching) and (1 shl p1) <> 0) then 419 RW[p1].EnemyReport[P].Tech[ad] := Source; 420 end; 421 422 var 423 I: Integer; 423 424 begin 424 425 if ad in FutureTech then 425 426 begin 426 if RW[ p].Tech[ad] < tsApplicable then427 RW[ p].Tech[ad] := 1427 if RW[P].Tech[ad] < tsApplicable then 428 RW[P].Tech[ad] := 1 428 429 else 429 inc(RW[p].Tech[ad]);430 Inc(RW[P].Tech[ad]); 430 431 if ad <> futResearchTechnology then 431 inc(nTech[p], 2);432 inc(Researched[p], 8);433 exit;434 end; 435 436 if RW[ p].Tech[ad] = tsSeen then437 begin 438 inc(nTech[p]);439 inc(Researched[p]);432 Inc(nTech[P], 2); 433 Inc(Researched[P], 8); 434 Exit; 435 end; 436 437 if RW[P].Tech[ad] = tsSeen then 438 begin 439 Inc(nTech[P]); 440 Inc(Researched[P]); 440 441 end 441 442 else 442 443 begin 443 inc(nTech[p], 2);444 inc(Researched[p], 2);445 end; 446 RW[ p].Tech[ad] := tsResearched;447 TellAboutKeyTech( p, tsResearched);448 CheckSpecialModels( p, ad);444 Inc(nTech[P], 2); 445 Inc(Researched[P], 2); 446 end; 447 RW[P].Tech[ad] := tsResearched; 448 TellAboutKeyTech(P, tsResearched); 449 CheckSpecialModels(P, ad); 449 450 if ad = adScience then 450 ResourceMask[ p] := ResourceMask[p] or fSpecial2;451 ResourceMask[P] := ResourceMask[P] or fSpecial2; 451 452 if ad = adMassProduction then 452 ResourceMask[ p] := ResourceMask[p] or fModern;453 454 for i:= 0 to nWonder - 1 do { check whether wonders expired }455 if (GWonder[ i].EffectiveOwner <> GWonder[woEiffel].EffectiveOwner) and456 (Imp[ i].Expiration = ad) then457 begin 458 GWonder[ i].EffectiveOwner := -1;459 if i= woPyramids then453 ResourceMask[P] := ResourceMask[P] or fModern; 454 455 for I := 0 to nWonder - 1 do { check whether wonders expired } 456 if (GWonder[I].EffectiveOwner <> GWonder[woEiffel].EffectiveOwner) and 457 (Imp[I].Expiration = ad) then 458 begin 459 GWonder[I].EffectiveOwner := -1; 460 if I = woPyramids then 460 461 FreeSlaves; 461 462 end; 462 463 end; 463 464 464 procedure CheckExpiration(Wonder: integer);465 procedure CheckExpiration(Wonder: Integer); 465 466 // GWonder[Wonder].EffectiveOwner must be set before! 466 467 var 467 p: integer;468 P: Integer; 468 469 begin 469 470 if (Imp[Wonder].Expiration >= 0) and 470 471 (GWonder[woEiffel].EffectiveOwner <> GWonder[Wonder].EffectiveOwner) then 471 for p:= 0 to nPl - 1 do // check if already expired472 if (1 shl pand GAlive <> 0) and473 (RW[ p].Tech[Imp[Wonder].Expiration] >= tsApplicable) then472 for P := 0 to nPl - 1 do // check if already expired 473 if (1 shl P and GAlive <> 0) and 474 (RW[P].Tech[Imp[Wonder].Expiration] >= tsApplicable) then 474 475 begin 475 476 GWonder[Wonder].EffectiveOwner := -1; 476 477 if Wonder = woPyramids then 477 FreeSlaves 478 end 478 FreeSlaves; 479 end; 479 480 end; 480 481 … … 483 484 ____________________________________________________________________ 484 485 } 485 function dLoc(Loc, dx, dy: integer): integer;486 function dLoc(Loc, dx, dy: Integer): Integer; 486 487 { relative location, dx in hor and dy in ver direction from Loc } 487 488 var 488 y0: integer;489 y0: Integer; 489 490 begin 490 491 if not (Loc >= 0) and (Loc < MapSize) and (dx + lx >= 0) then 491 492 raise Exception.Create('Relative location error'); 492 assert((Loc >= 0) and (Loc < MapSize) and (dx + lx >= 0));493 Assert((Loc >= 0) and (Loc < MapSize) and (dx + lx >= 0)); 493 494 y0 := Loc div lx; 494 result := (Loc + (dx + y0 and 1 + lx + lx) shr 1) mod lx + lx * (y0 + dy);495 if ( result < 0) or (result >= MapSize) then496 result := -1;497 end; 498 499 procedure dxdy(Loc0, Loc1: integer; var dx, dy: integer);495 Result := (Loc + (dx + y0 and 1 + lx + lx) shr 1) mod lx + lx * (y0 + dy); 496 if (Result < 0) or (Result >= MapSize) then 497 Result := -1; 498 end; 499 500 procedure dxdy(Loc0, Loc1: Integer; var dx, dy: Integer); 500 501 begin 501 502 dx := ((Loc1 mod lx * 2 + Loc1 div lx and 1) - … … 504 505 end; 505 506 506 function Distance(Loc0, Loc1: integer): integer;507 var 508 dx, dy: integer;507 function Distance(Loc0, Loc1: Integer): Integer; 508 var 509 dx, dy: Integer; 509 510 begin 510 511 dxdy(Loc0, Loc1, dx, dy); 511 512 dx := abs(dx); 512 513 dy := abs(dy); 513 result := dx + dy + abs(dx - dy) shr 1;514 end; 515 516 procedure V8_to_Loc(Loc0: integer; var VicinityLoc: TVicinity8Loc);517 var 518 x0, y0, lx0: integer;514 Result := dx + dy + abs(dx - dy) shr 1; 515 end; 516 517 procedure V8_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity8Loc); 518 var 519 x0, y0, lx0: Integer; 519 520 begin 520 521 lx0 := lx; // put in register! … … 526 527 VicinityLoc[5] := Loc0 - lx0 * 2; 527 528 VicinityLoc[7] := Loc0 + 1; 528 inc(Loc0, y0);529 Inc(Loc0, y0); 529 530 VicinityLoc[0] := Loc0 + lx0; 530 531 VicinityLoc[2] := Loc0 + lx0 - 1; … … 537 538 if x0 = 0 then 538 539 begin 539 inc(VicinityLoc[3], lx0);540 Inc(VicinityLoc[3], lx0); 540 541 if y0 = 0 then 541 542 begin 542 inc(VicinityLoc[2], lx0);543 inc(VicinityLoc[4], lx0);544 end 545 end 543 Inc(VicinityLoc[2], lx0); 544 Inc(VicinityLoc[4], lx0); 545 end; 546 end; 546 547 end 547 548 else 548 549 begin 549 dec(VicinityLoc[7], lx0);550 Dec(VicinityLoc[7], lx0); 550 551 if y0 = 1 then 551 552 begin 552 dec(VicinityLoc[0], lx0);553 dec(VicinityLoc[6], lx0);554 end 555 end; 556 end; 557 558 procedure V21_to_Loc(Loc0: integer; var VicinityLoc: TVicinity21Loc);559 var 560 dx, dy, bit, y0, xComp, yComp, xComp0, xCompSwitch: integer;561 dst: ^ integer;553 Dec(VicinityLoc[0], lx0); 554 Dec(VicinityLoc[6], lx0); 555 end; 556 end; 557 end; 558 559 procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc); 560 var 561 dx, dy, bit, y0, xComp, yComp, xComp0, xCompSwitch: Integer; 562 dst: ^Integer; 562 563 begin 563 564 y0 := Loc0 div lx; … … 565 566 xCompSwitch := xComp0 - 1 + y0 and 1; 566 567 if xComp0 < 0 then 567 inc(xComp0, lx);568 Inc(xComp0, lx); 568 569 if xCompSwitch < 0 then 569 inc(xCompSwitch, lx);570 Inc(xCompSwitch, lx); 570 571 xCompSwitch := xCompSwitch xor xComp0; 571 572 yComp := lx * (y0 - 3); … … 582 583 else 583 584 dst^ := -1; 584 inc(xComp);585 Inc(xComp); 585 586 if xComp >= lx then 586 dec(xComp, lx);587 inc(dst);587 Dec(xComp, lx); 588 Inc(dst); 588 589 bit := bit shl 1; 589 590 end; 590 inc(yComp, lx);591 Inc(yComp, lx); 591 592 end; 592 593 end; … … 597 598 } 598 599 var 599 primitive: integer;600 StartLoc, StartLoc2: array [0 .. nPl - 1] of integer; { starting coordinates }600 primitive: Integer; 601 StartLoc, StartLoc2: array [0 .. nPl - 1] of Integer; { starting coordinates } 601 602 Elevation: array [0 .. lxmax * lymax - 1] of Byte; { map elevation } 602 ElCount: array [Byte] of integer; { count of elevation occurance }603 ElCount: array [Byte] of Integer; { count of elevation occurance } 603 604 604 605 procedure CalculatePrimitive; 605 606 var 606 i, j: integer;607 I, J: Integer; 607 608 begin 608 609 primitive := 1; 609 i:= 2;610 while i * i<= MapSize + 1 do // test whether prime611 begin 612 if (MapSize + 1) mod i= 0 then610 I := 2; 611 while I * I <= MapSize + 1 do // test whether prime 612 begin 613 if (MapSize + 1) mod I = 0 then 613 614 primitive := 0; 614 inc(i)615 Inc(I); 615 616 end; 616 617 617 618 if primitive > 0 then 618 619 repeat 619 inc(primitive);620 i:= 1;621 j:= 0;620 Inc(primitive); 621 I := 1; 622 J := 0; 622 623 repeat 623 inc(j);624 i := i * primitive mod (MapSize + 1)625 until ( i = 1) or (j= MapSize + 1);626 until j= MapSize;627 end; 628 629 function MapGeneratorAvailable: boolean;630 begin 631 result := (primitive > 0) and (lx >= 20) and (ly >= 40)624 Inc(J); 625 I := I * primitive mod (MapSize + 1); 626 until (I = 1) or (J = MapSize + 1); 627 until J = MapSize; 628 end; 629 630 function MapGeneratorAvailable: Boolean; 631 begin 632 Result := (primitive > 0) and (lx >= 20) and (ly >= 40); 632 633 end; 633 634 634 635 procedure CreateElevation; 635 636 const 636 d= 64;637 D = 64; 637 638 Smooth = 0.049; { causes low amplitude of short waves } 638 639 Detail = 0.095; { causes short period of short waves } … … 641 642 642 643 var 643 sa, ca, f1, f2: array [1 .. d] of single;644 imerge, x, y: integer;645 v, maxv: single;646 647 function Value( x, y: integer): single; { elevation formula }644 sa, ca, f1, f2: array [1 .. D] of Single; 645 imerge, X, Y: Integer; 646 V, maxv: Single; 647 648 function Value(X, Y: Integer): Single; { elevation formula } 648 649 var 649 i: integer;650 begin 651 result := 0;652 for i := 1 to ddo653 result := result + sin(f1[i] * ((x * 2 + y and 1) * sa[i] + y* 1.5 *654 ca[ i])) * f2[i];650 I: Integer; 651 begin 652 Result := 0; 653 for I := 1 to D do 654 Result := Result + sin(f1[I] * ((X * 2 + Y and 1) * sa[I] + Y * 1.5 * 655 ca[I])) * f2[I]; 655 656 { x values effectively multiplied with 2 to get 2 horizantal periods 656 657 of the prime waves } … … 658 659 659 660 begin 660 for x := 1 to ddo { prepare formula parameters }661 begin 662 {$IFNDEF SCR} if x= 1 then663 v:= pi / 2 { first wave goes horizontal }664 else {$ENDIF} v:= DelphiRandom * 2 * pi;665 sa[ x] := sin(v) / lx;666 ca[ x] := cos(v) / ly;667 f1[ x] := 2 * pi * exp(Detail * (x- 1));668 f2[ x] := exp(-x * Smooth)661 for X := 1 to D do { prepare formula parameters } 662 begin 663 {$IFNDEF SCR} if X = 1 then 664 V := pi / 2 { first wave goes horizontal } 665 else {$ENDIF} V := DelphiRandom * 2 * pi; 666 sa[X] := sin(V) / lx; 667 ca[X] := cos(V) / ly; 668 f1[X] := 2 * pi * exp(Detail * (X - 1)); 669 f2[X] := exp(-X * Smooth); 669 670 end; 670 671 … … 672 673 FillChar(ElCount, SizeOf(ElCount), 0); 673 674 maxv := 0; 674 for x:= 0 to lx - 1 do675 for y:= 0 to ly - 1 do676 begin 677 v := Value(x, y);678 if x* 2 < imerge then679 v := (x * 2 * v + (imerge - x * 2) * Value(x + lx, y)) / imerge;680 v := v - sqr(sqr(2 * y/ ly - 1)); { soft cut at poles }681 if v> maxv then682 maxv := v;683 684 if v< -4 then685 Elevation[ x + lx * y] := 0686 else if v> 8.75 then687 Elevation[ x + lx * y] := 255675 for X := 0 to lx - 1 do 676 for Y := 0 to ly - 1 do 677 begin 678 V := Value(X, Y); 679 if X * 2 < imerge then 680 V := (X * 2 * V + (imerge - X * 2) * Value(X + lx, Y)) / imerge; 681 V := V - sqr(sqr(2 * Y / ly - 1)); { soft cut at poles } 682 if V > maxv then 683 maxv := V; 684 685 if V < -4 then 686 Elevation[X + lx * Y] := 0 687 else if V > 8.75 then 688 Elevation[X + lx * Y] := 255 688 689 else 689 Elevation[ x + lx * y] := Round((v+ 4) * 20);690 inc(ElCount[Elevation[x + lx * y]])690 Elevation[X + lx * Y] := Round((V + 4) * 20); 691 Inc(ElCount[Elevation[X + lx * Y]]); 691 692 end; 692 693 end; … … 694 695 procedure FindContinents; 695 696 696 procedure ReplaceCont( a, b, Stop: integer);697 procedure ReplaceCont(A, B, Stop: Integer); 697 698 { replace continent name a by b } 698 699 // make sure always continent[loc]<=loc 699 700 var 700 i: integer;701 begin 702 if a < bthen703 begin 704 i := a;705 a := b;706 b := i707 end; 708 if a > bthen709 for i := ato Stop do710 if Continent[ i] = athen711 Continent[ i] := b712 end; 713 714 var 715 x, y, Loc, Wrong: integer;716 begin 717 for y:= 1 to ly - 2 do718 for x:= 0 to lx - 1 do719 begin 720 Loc := x + lx * y;701 I: Integer; 702 begin 703 if A < B then 704 begin 705 I := A; 706 A := B; 707 B := I 708 end; 709 if A > B then 710 for I := A to Stop do 711 if Continent[I] = A then 712 Continent[I] := B; 713 end; 714 715 var 716 X, Y, Loc, Wrong: Integer; 717 begin 718 for Y := 1 to ly - 2 do 719 for X := 0 to lx - 1 do 720 begin 721 Loc := X + lx * Y; 721 722 Continent[Loc] := -1; 722 723 if RealMap[Loc] and fTerrain >= fGrass then 723 724 begin 724 if ( y- 2 >= 1) and (RealMap[Loc - 2 * lx] and fTerrain >= fGrass) then725 if (Y - 2 >= 1) and (RealMap[Loc - 2 * lx] and fTerrain >= fGrass) then 725 726 Continent[Loc] := Continent[Loc - 2 * lx]; 726 if ( x - 1 + y and 1 >= 0) and (y- 1 >= 1) and727 (RealMap[Loc - 1 + yand 1 - lx] and fTerrain >= fGrass) then728 Continent[Loc] := Continent[Loc - 1 + yand 1 - lx];729 if ( x + y and 1 < lx) and (y- 1 >= 1) and730 (RealMap[Loc + yand 1 - lx] and fTerrain >= fGrass) then731 Continent[Loc] := Continent[Loc + yand 1 - lx];732 if ( x- 1 >= 0) and (RealMap[Loc - 1] and fTerrain >= fGrass) then727 if (X - 1 + Y and 1 >= 0) and (Y - 1 >= 1) and 728 (RealMap[Loc - 1 + Y and 1 - lx] and fTerrain >= fGrass) then 729 Continent[Loc] := Continent[Loc - 1 + Y and 1 - lx]; 730 if (X + Y and 1 < lx) and (Y - 1 >= 1) and 731 (RealMap[Loc + Y and 1 - lx] and fTerrain >= fGrass) then 732 Continent[Loc] := Continent[Loc + Y and 1 - lx]; 733 if (X - 1 >= 0) and (RealMap[Loc - 1] and fTerrain >= fGrass) then 733 734 if Continent[Loc] = -1 then 734 735 Continent[Loc] := Continent[Loc - 1] … … 736 737 ReplaceCont(Continent[Loc - 1], Continent[Loc], Loc); 737 738 if Continent[Loc] = -1 then 738 Continent[Loc] := Loc 739 end 739 Continent[Loc] := Loc; 740 end; 740 741 end; 741 742 742 743 { connect continents due to round earth } 743 for y:= 1 to ly - 2 do744 if RealMap[lx * y] and fTerrain >= fGrass then744 for Y := 1 to ly - 2 do 745 if RealMap[lx * Y] and fTerrain >= fGrass then 745 746 begin 746 747 Wrong := -1; 747 if RealMap[lx - 1 + lx * y] and fTerrain >= fGrass then748 Wrong := Continent[lx - 1 + lx * y];749 if ( y and 1 = 0) and (y- 1 >= 1) and750 (RealMap[lx - 1 + lx * ( y- 1)] and fTerrain >= fGrass) then751 Wrong := Continent[lx - 1 + lx * ( y- 1)];752 if ( y and 1 = 0) and (y+ 1 < ly - 1) and753 (RealMap[lx - 1 + lx * ( y+ 1)] and fTerrain >= fGrass) then754 Wrong := Continent[lx - 1 + lx * ( y+ 1)];748 if RealMap[lx - 1 + lx * Y] and fTerrain >= fGrass then 749 Wrong := Continent[lx - 1 + lx * Y]; 750 if (Y and 1 = 0) and (Y - 1 >= 1) and 751 (RealMap[lx - 1 + lx * (Y - 1)] and fTerrain >= fGrass) then 752 Wrong := Continent[lx - 1 + lx * (Y - 1)]; 753 if (Y and 1 = 0) and (Y + 1 < ly - 1) and 754 (RealMap[lx - 1 + lx * (Y + 1)] and fTerrain >= fGrass) then 755 Wrong := Continent[lx - 1 + lx * (Y + 1)]; 755 756 if Wrong >= 0 then 756 ReplaceCont(Wrong, Continent[lx * y], MapSize - 1)757 ReplaceCont(Wrong, Continent[lx * Y], MapSize - 1); 757 758 end; 758 759 end; … … 762 763 // must be done after FindContinents 763 764 var 764 i, j, Cnt, x, y, dx, dy, Loc0, Loc1, xworst, yworst, totalrare, RareMaxWater,765 RareType, iBest, jbest, MinDist, xBlock, yBlock, V8: integer;766 AreaCount, RareByArea, RareAdjacent: array [0 .. 7, 0 .. 4] of integer;767 RareLoc: array [0 .. 11] of integer;768 Dist: array [0 .. 11, 0 .. 11] of integer;765 I, J, Cnt, X, Y, dx, dy, Loc0, Loc1, xworst, yworst, totalrare, RareMaxWater, 766 RareType, iBest, jbest, MinDist, xBlock, yBlock, V8: Integer; 767 AreaCount, RareByArea, RareAdjacent: array [0 .. 7, 0 .. 4] of Integer; 768 RareLoc: array [0 .. 11] of Integer; 769 Dist: array [0 .. 11, 0 .. 11] of Integer; 769 770 Adjacent: TVicinity8Loc; 770 771 begin … … 772 773 repeat 773 774 FillChar(AreaCount, SizeOf(AreaCount), 0); 774 for y:= 1 to ly - 2 do775 begin 776 yBlock := y* 5 div ly;777 if yBlock = ( y+ 1) * 5 div ly then778 for x:= 0 to lx - 1 do779 begin 780 xBlock := x* 8 div lx;781 if xBlock = ( x+ 1) * 8 div lx then775 for Y := 1 to ly - 2 do 776 begin 777 yBlock := Y * 5 div ly; 778 if yBlock = (Y + 1) * 5 div ly then 779 for X := 0 to lx - 1 do 780 begin 781 xBlock := X * 8 div lx; 782 if xBlock = (X + 1) * 8 div lx then 782 783 begin 783 Loc0 := x + lx * y;784 Loc0 := X + lx * Y; 784 785 if RealMap[Loc0] and fTerrain >= fGrass then 785 786 begin … … 791 792 if (Loc1 >= 0) and (Loc1 < MapSize) and 792 793 (RealMap[Loc1] and fTerrain < fGrass) then 793 inc(Cnt); // count adjacent water794 Inc(Cnt); // count adjacent water 794 795 end; 795 796 if Cnt <= RareMaxWater then // inner land 796 797 begin 797 inc(AreaCount[xBlock, yBlock]);798 Inc(AreaCount[xBlock, yBlock]); 798 799 if DelphiRandom(AreaCount[xBlock, yBlock]) = 0 then 799 RareByArea[xBlock, yBlock] := Loc0 800 end 800 RareByArea[xBlock, yBlock] := Loc0; 801 end; 801 802 end; 802 803 end; 803 end 804 end; 804 805 end; 805 806 totalrare := 0; 806 for x:= 0 to 7 do807 for y:= 0 to 4 do808 if AreaCount[ x, y] > 0 then809 inc(totalrare);810 inc(RareMaxWater);807 for X := 0 to 7 do 808 for Y := 0 to 4 do 809 if AreaCount[X, Y] > 0 then 810 Inc(totalrare); 811 Inc(RareMaxWater); 811 812 until totalrare >= 12; 812 813 … … 814 815 begin // remove rarebyarea resources too close to each other 815 816 FillChar(RareAdjacent, SizeOf(RareAdjacent), 0); 816 for x:= 0 to 7 do817 for y:= 0 to 4 do818 if AreaCount[ x, y] > 0 then819 begin 820 if (AreaCount[( x + 1) mod 8, y] > 0) and821 (Continent[RareByArea[ x, y]] = Continent822 [RareByArea[( x + 1) mod 8, y]]) then817 for X := 0 to 7 do 818 for Y := 0 to 4 do 819 if AreaCount[X, Y] > 0 then 820 begin 821 if (AreaCount[(X + 1) mod 8, Y] > 0) and 822 (Continent[RareByArea[X, Y]] = Continent 823 [RareByArea[(X + 1) mod 8, Y]]) then 823 824 begin 824 inc(RareAdjacent[x, y]);825 inc(RareAdjacent[(x + 1) mod 8, y]);825 Inc(RareAdjacent[X, Y]); 826 Inc(RareAdjacent[(X + 1) mod 8, Y]); 826 827 end; 827 if y< 4 then828 if Y < 4 then 828 829 begin 829 if (AreaCount[ x, y+ 1] > 0) and830 (Continent[RareByArea[ x, y]] = Continent[RareByArea[x, y+ 1]])830 if (AreaCount[X, Y + 1] > 0) and 831 (Continent[RareByArea[X, Y]] = Continent[RareByArea[X, Y + 1]]) 831 832 then 832 833 begin 833 inc(RareAdjacent[x, y]);834 inc(RareAdjacent[x, y+ 1]);834 Inc(RareAdjacent[X, Y]); 835 Inc(RareAdjacent[X, Y + 1]); 835 836 end; 836 if (AreaCount[( x + 1) mod 8, y+ 1] > 0) and837 (Continent[RareByArea[ x, y]] = Continent[RareByArea[(x+ 1) mod 8,838 y+ 1]]) then837 if (AreaCount[(X + 1) mod 8, Y + 1] > 0) and 838 (Continent[RareByArea[X, Y]] = Continent[RareByArea[(X + 1) mod 8, 839 Y + 1]]) then 839 840 begin 840 inc(RareAdjacent[x, y]);841 inc(RareAdjacent[(x + 1) mod 8, y+ 1]);841 Inc(RareAdjacent[X, Y]); 842 Inc(RareAdjacent[(X + 1) mod 8, Y + 1]); 842 843 end; 843 if (AreaCount[( x + 7) mod 8, y+ 1] > 0) and844 (Continent[RareByArea[ x, y]] = Continent[RareByArea[(x+ 7) mod 8,845 y+ 1]]) then844 if (AreaCount[(X + 7) mod 8, Y + 1] > 0) and 845 (Continent[RareByArea[X, Y]] = Continent[RareByArea[(X + 7) mod 8, 846 Y + 1]]) then 846 847 begin 847 inc(RareAdjacent[x, y]);848 inc(RareAdjacent[(x + 7) mod 8, y+ 1]);848 Inc(RareAdjacent[X, Y]); 849 Inc(RareAdjacent[(X + 7) mod 8, Y + 1]); 849 850 end; 850 end 851 end; 851 852 end; 852 853 xworst := 0; 853 854 yworst := 0; 854 855 Cnt := 0; 855 for x:= 0 to 7 do856 for y:= 0 to 4 do857 if AreaCount[ x, y] > 0 then858 begin 859 if (Cnt = 0) or (RareAdjacent[ x, y] > RareAdjacent[xworst, yworst])856 for X := 0 to 7 do 857 for Y := 0 to 4 do 858 if AreaCount[X, Y] > 0 then 859 begin 860 if (Cnt = 0) or (RareAdjacent[X, Y] > RareAdjacent[xworst, yworst]) 860 861 then 861 862 begin 862 xworst := x;863 yworst := y;864 Cnt := 1 863 xworst := X; 864 yworst := Y; 865 Cnt := 1; 865 866 end 866 else if (RareAdjacent[ x, y] = RareAdjacent[xworst, yworst]) then867 else if (RareAdjacent[X, Y] = RareAdjacent[xworst, yworst]) then 867 868 begin 868 inc(Cnt);869 Inc(Cnt); 869 870 if DelphiRandom(Cnt) = 0 then 870 871 begin 871 xworst := x;872 yworst := y;873 end 872 xworst := X; 873 yworst := Y; 874 end; 874 875 end; 875 876 end; 876 877 AreaCount[xworst, yworst] := 0; 877 dec(totalrare)878 Dec(totalrare); 878 879 end; 879 880 880 881 Cnt := 0; 881 for x:= 0 to 7 do882 for y:= 0 to 4 do883 if AreaCount[ x, y] > 0 then884 begin 885 RareLoc[Cnt] := RareByArea[ x, y];886 inc(Cnt)887 end; 888 for i:= 0 to 11 do889 begin 890 RealMap[RareLoc[ i]] := RealMap[RareLoc[i]] and not(fTerrain or fSpecial) or882 for X := 0 to 7 do 883 for Y := 0 to 4 do 884 if AreaCount[X, Y] > 0 then 885 begin 886 RareLoc[Cnt] := RareByArea[X, Y]; 887 Inc(Cnt); 888 end; 889 for I := 0 to 11 do 890 begin 891 RealMap[RareLoc[I]] := RealMap[RareLoc[I]] and not(fTerrain or fSpecial) or 891 892 (fDesert or fDeadLands); 892 893 for dy := -1 to 1 do … … 894 895 if (dx + dy) and 1 = 0 then 895 896 begin 896 Loc1 := dLoc(RareLoc[ i], dx, dy);897 Loc1 := dLoc(RareLoc[I], dx, dy); 897 898 if (Loc1 >= 0) and (RealMap[Loc1] and fTerrain = fMountains) then 898 899 RealMap[Loc1] := RealMap[Loc1] and not fTerrain or fHills; 899 end 900 end; 901 for i:= 0 to 11 do902 for j:= 0 to 11 do903 Dist[ i, j] := Distance(RareLoc[i], RareLoc[j]);900 end; 901 end; 902 for I := 0 to 11 do 903 for J := 0 to 11 do 904 Dist[I, J] := Distance(RareLoc[I], RareLoc[J]); 904 905 905 906 ibest := 0; … … 909 910 begin 910 911 Cnt := 0; 911 for i:= 0 to 11 do912 if RareLoc[ i] >= 0 then913 for j:= 0 to 11 do914 if RareLoc[ j] >= 0 then912 for I := 0 to 11 do 913 if RareLoc[I] >= 0 then 914 for J := 0 to 11 do 915 if RareLoc[J] >= 0 then 915 916 if (Cnt > 0) and (Dist[iBest, jbest] >= MinDist) then 916 917 begin 917 if Dist[ i, j] >= MinDist then918 if Dist[I, J] >= MinDist then 918 919 begin 919 inc(Cnt);920 Inc(Cnt); 920 921 if DelphiRandom(Cnt) = 0 then 921 922 begin 922 iBest := i;923 jbest := j924 end 925 end 923 iBest := I; 924 jbest := J; 925 end; 926 end; 926 927 end 927 else if (Cnt = 0) or (Dist[ i, j] > Dist[iBest, jbest]) then928 else if (Cnt = 0) or (Dist[I, J] > Dist[iBest, jbest]) then 928 929 begin 929 iBest := i;930 jbest := j;930 iBest := I; 931 jbest := J; 931 932 Cnt := 1; 932 933 end; … … 938 939 RareLoc[jbest] := -1; 939 940 end; 940 end; // RarePositions941 942 function CheckShore(Loc: integer): boolean;943 var 944 Loc1, OldTile, V21: integer;941 end; 942 943 function CheckShore(Loc: Integer): Boolean; 944 var 945 Loc1, OldTile, V21: Integer; 945 946 Radius: TVicinity21Loc; 946 947 begin 947 result := false;948 Result := False; 948 949 OldTile := RealMap[Loc]; 949 950 if OldTile and fTerrain < fGrass then … … 960 961 end; 961 962 if (RealMap[Loc] xor Cardinal(OldTile)) and fTerrain <> 0 then 962 result := true;963 end; 964 end; 965 966 function ActualSpecialTile(Loc: integer): Cardinal;967 begin 968 result := SpecialTile(Loc, RealMap[Loc] and fTerrain, lx);969 end; 970 971 procedure CreateMap(preview: boolean);963 Result := True; 964 end; 965 end; 966 967 function ActualSpecialTile(Loc: Integer): Cardinal; 968 begin 969 Result := SpecialTile(Loc, RealMap[Loc] and fTerrain, lx); 970 end; 971 972 procedure CreateMap(preview: Boolean); 972 973 const 973 974 ShHiHills = 6; { of land } … … 980 981 hotunification = 50; // min. 25 981 982 982 Zone: array [0 .. 3, 2 .. 9] of single = { terrain distribution }983 Zone: array [0 .. 3, 2 .. 9] of Single = { terrain distribution } 983 984 ((0.25, 0, 0, 0.4, 0, 0, 0, 0.35), (0.55, 0, 0.1, 0, 0, 0, 0, 0.35), 984 985 (0.4, 0, 0.35, 0, 0, 0, 0, 0.25), (0, 0.7, 0, 0, 0, 0, 0, 0.3)); 985 986 { Grs Dst Pra Tun - - - For } 986 987 987 function RndLow( y: integer): Cardinal;988 function RndLow(Y: Integer): Cardinal; 988 989 { random lowland appropriate to climate } 989 990 var 990 z0, i: integer;991 p, p0, ZPlus: single;992 begin 993 if ly - 1 - y > ythen994 begin 995 z0 := 6 * ydiv ly;996 ZPlus := 6 * y/ ly - z0;991 z0, I: Integer; 992 P, p0, ZPlus: Single; 993 begin 994 if ly - 1 - Y > Y then 995 begin 996 z0 := 6 * Y div ly; 997 ZPlus := 6 * Y / ly - z0; 997 998 end 998 999 else 999 1000 begin 1000 z0 := 6 * (ly - 1 - y) div ly;1001 ZPlus := 6 * (ly - 1 - y) / ly - z0;1001 z0 := 6 * (ly - 1 - Y) div ly; 1002 ZPlus := 6 * (ly - 1 - Y) / ly - z0; 1002 1003 end; 1003 1004 p0 := 1; 1004 for i:= 2 to 9 do1005 begin 1006 p := Zone[z0, i] * (1 - ZPlus) + Zone[z0 + 1, i] * ZPlus;1005 for I := 2 to 9 do 1006 begin 1007 P := Zone[z0, I] * (1 - ZPlus) + Zone[z0 + 1, I] * ZPlus; 1007 1008 { weight between zones z0 and z0+1 } 1008 if DelphiRandom * p0 < pthen1009 begin 1010 RndLow := i;1009 if DelphiRandom * p0 < P then 1010 begin 1011 RndLow := I; 1011 1012 Break; 1012 1013 end; 1013 p0 := p0 - p;1014 end; 1015 end; 1016 1017 function RunRiver(Loc0: integer): integer;1014 p0 := p0 - P; 1015 end; 1016 end; 1017 1018 function RunRiver(Loc0: Integer): Integer; 1018 1019 { runs river from start point Loc0; return value: length } 1019 1020 var 1020 Dir, T, Loc, Loc1, Cost: integer;1021 Dir, T, Loc, Loc1, Cost: Integer; 1021 1022 Q: TIPQ; 1022 From: array [0 .. lxmax * lymax - 1] of integer;1023 Time: array [0 .. lxmax * lymax - 1] of integer;1024 OneTileLake: boolean;1023 From: array [0 .. lxmax * lymax - 1] of Integer; 1024 Time: array [0 .. lxmax * lymax - 1] of Integer; 1025 OneTileLake: Boolean; 1025 1026 begin 1026 1027 FillChar(Time, SizeOf(Time), 255); { -1 } … … 1031 1032 if (RealMap[Loc] and fTerrain < fGrass) then 1032 1033 begin 1033 OneTileLake := true;1034 OneTileLake := True; 1034 1035 for Dir := 0 to 3 do 1035 1036 begin 1036 1037 Loc1 := dLoc(Loc, Dir and 1 * 2 - 1, Dir shr 1 * 2 - 1); 1037 1038 if (Loc1 >= 0) and (RealMap[Loc1] and fTerrain < fGrass) then 1038 OneTileLake := false;1039 OneTileLake := False; 1039 1040 end; 1040 1041 if not OneTileLake then … … 1061 1062 end; 1062 1063 Loc1 := Loc; 1063 result := 0;1064 Result := 0; 1064 1065 while Loc <> Loc0 do 1065 1066 begin 1066 1067 Loc := From[Loc]; 1067 inc(result);1068 end; 1069 if ( result > 1) and ((result >= MinRivLen) or1068 Inc(Result); 1069 end; 1070 if (Result > 1) and ((Result >= MinRivLen) or 1070 1071 (RealMap[Loc1] and fTerrain >= fGrass)) then 1071 1072 begin … … 1081 1082 end 1082 1083 else 1083 result := 0;1084 Result := 0; 1084 1085 FreeAndNil(Q); 1085 1086 end; 1086 1087 1087 1088 var 1088 x, y, n, Dir, plus, Count, Loc0, Loc1, bLand, bHills, bMountains, V8: integer;1089 CopyFrom: array [0 .. lxmax * lymax - 1] of integer;1089 X, Y, N, Dir, plus, Count, Loc0, Loc1, bLand, bHills, bMountains, V8: Integer; 1090 CopyFrom: array [0 .. lxmax * lymax - 1] of Integer; 1090 1091 Adjacent: TVicinity8Loc; 1091 1092 … … 1096 1097 while plus < MapSize * LandMass * ShMountains div 10000 do 1097 1098 begin 1098 dec(bMountains);1099 inc(plus, ElCount[bMountains])1099 Dec(bMountains); 1100 Inc(plus, ElCount[bMountains]); 1100 1101 end; 1101 1102 Count := plus; … … 1104 1105 while plus < MapSize * LandMass * ShHiHills div 10000 do 1105 1106 begin 1106 dec(bHills);1107 inc(plus, ElCount[bHills])1108 end; 1109 inc(Count, plus);1107 Dec(bHills); 1108 Inc(plus, ElCount[bHills]); 1109 end; 1110 Inc(Count, plus); 1110 1111 bLand := bHills; 1111 1112 while Count < MapSize * LandMass div 100 do 1112 1113 begin 1113 dec(bLand);1114 inc(Count, ElCount[bLand])1114 Dec(bLand); 1115 Inc(Count, ElCount[bLand]); 1115 1116 end; 1116 1117 … … 1135 1136 (RealMap[Loc1] and fTerrain < fGrass) or 1136 1137 (RealMap[Loc1] and fTerrain = fArctic) then 1137 inc(Count); // count adjacent water1138 Inc(Count); // count adjacent water 1138 1139 end; 1139 1140 if Count = 8 then 1140 RealMap[Loc0] := fOcean 1141 RealMap[Loc0] := fOcean; 1141 1142 end; 1142 1143 … … 1147 1148 plus := MapSize; 1148 1149 Loc0 := DelphiRandom(MapSize); 1149 for n:= 0 to plus - 1 do1150 for N := 0 to plus - 1 do 1150 1151 begin 1151 1152 if (RealMap[Loc0] and fTerrain >= fGrass) and (Loc0 >= lx) and … … 1164 1165 CopyFrom[Loc0] := Loc0; 1165 1166 1166 for n:= 0 to unification * MapSize div 100 do1167 begin 1168 y:= DelphiRandom(ly);1169 if abs( y- (ly shr 1)) > ly div 4 + DelphiRandom(ly * hotunification div 100) then1170 if y< ly shr 1 then1171 y := ly shr 1 - y1167 for N := 0 to unification * MapSize div 100 do 1168 begin 1169 Y := DelphiRandom(ly); 1170 if abs(Y - (ly shr 1)) > ly div 4 + DelphiRandom(ly * hotunification div 100) then 1171 if Y < ly shr 1 then 1172 Y := ly shr 1 - Y 1172 1173 else 1173 y := 3 * ly shr 1 - y;1174 Loc0 := lx * y+ DelphiRandom(lx);1174 Y := 3 * ly shr 1 - Y; 1175 Loc0 := lx * Y + DelphiRandom(lx); 1175 1176 if RealMap[Loc0] and fTerrain = fGrass then 1176 1177 begin … … 1202 1203 Loc1 := CopyFrom[Loc1]; 1203 1204 RealMap[Loc0] := RealMap[Loc0] and not fTerrain or 1204 RealMap[Loc1] and fTerrain 1205 RealMap[Loc1] and fTerrain; 1205 1206 end; 1206 1207 … … 1225 1226 if Loc1 >= 0 then 1226 1227 if RealMap[Loc1] and fTerrain < fGrass then 1227 inc(Count, 2)1228 Inc(Count, 2); 1228 1229 end; 1229 1230 end; 1230 1231 if Count >= 4 then 1231 RealMap[Loc0] := RealMap[Loc0] and not fTerrain or fPrairie 1232 RealMap[Loc0] := RealMap[Loc0] and not fTerrain or fPrairie; 1232 1233 end; 1233 1234 … … 1241 1242 if Loc1 >= 0 then 1242 1243 if RealMap[Loc1] and fTerrain <> fDesert then 1243 inc(Count)1244 Inc(Count); 1244 1245 end; 1245 1246 if Count >= 4 then 1246 RealMap[Loc0] := RealMap[Loc0] and not fTerrain or fPrairie 1247 RealMap[Loc0] := RealMap[Loc0] and not fTerrain or fPrairie; 1247 1248 end; 1248 1249 1249 1250 for Loc0 := 0 to MapSize - 1 do 1250 1251 CheckShore(Loc0); // change ocean to shore 1251 for x:= 0 to lx - 1 do1252 begin 1253 RealMap[ x+ lx * 0] := fArctic;1254 if RealMap[ x+ lx * 1] >= fGrass then1255 RealMap[ x + lx * 1] := RealMap[x+ lx * 1] and not fTerrain or fTundra;1256 if RealMap[ x+ lx * (ly - 2)] >= fGrass then1257 RealMap[ x + lx * (ly - 2)] := RealMap[x+ lx * (ly - 2)] and1252 for X := 0 to lx - 1 do 1253 begin 1254 RealMap[X + lx * 0] := fArctic; 1255 if RealMap[X + lx * 1] >= fGrass then 1256 RealMap[X + lx * 1] := RealMap[X + lx * 1] and not fTerrain or fTundra; 1257 if RealMap[X + lx * (ly - 2)] >= fGrass then 1258 RealMap[X + lx * (ly - 2)] := RealMap[X + lx * (ly - 2)] and 1258 1259 not fTerrain or fTundra; 1259 RealMap[ x + lx * (ly - 1)] := fArctic1260 RealMap[X + lx * (ly - 1)] := fArctic; 1260 1261 end; 1261 1262 … … 1278 1279 CountGood: (cgBest, cgFlat, cgLand); 1279 1280 1280 function IsGoodTile(Loc: integer): boolean;1281 function IsGoodTile(Loc: Integer): Boolean; 1281 1282 var 1282 xLoc, yLoc: integer;1283 xLoc, yLoc: Integer; 1283 1284 begin 1284 1285 xLoc := Loc mod lx; 1285 1286 yLoc := Loc div lx; 1286 1287 if RealMap[Loc] and fDeadLands <> 0 then 1287 result := false1288 Result := False 1288 1289 else 1289 1290 case CountGood of 1290 1291 cgBest: 1291 result := (RealMap[Loc] and fTerrain in [fGrass, fPrairie, fTundra,1292 Result := (RealMap[Loc] and fTerrain in [fGrass, fPrairie, fTundra, 1292 1293 fSwamp, fForest]) and Odd((lymax + xLoc - yLoc shr 1) shr 1 + xLoc + 1293 1294 (yLoc + 1) shr 1); 1294 1295 cgFlat: 1295 result := (RealMap[Loc] and fTerrain in [fGrass, fPrairie, fTundra,1296 Result := (RealMap[Loc] and fTerrain in [fGrass, fPrairie, fTundra, 1296 1297 fSwamp, fForest]); 1297 1298 cgLand: 1298 result := RealMap[Loc] and fTerrain >= fGrass;1299 Result := RealMap[Loc] and fTerrain >= fGrass; 1299 1300 end; 1300 1301 end; … … 1304 1305 1305 1306 var 1306 p1, p2, nAlive, c, Loc, Loc1, CntGood, CntGoodGrass, MinDist, i, j, n,1307 p1, p2, nAlive, C, Loc, Loc1, CntGood, CntGoodGrass, MinDist, I, J, N, 1307 1308 nsc, V21, V8, BestDist, TestDist, MinGood, nIrrLoc, 1308 FineDistSQR, nRest: integer;1309 ccount: array [0 .. lxmax * lymax - 1] of word;1310 sc, StartLoc0, sccount: array [1 .. nPl] of integer;1311 TestStartLoc: array [0 .. nPl - 1] of integer;1312 CityLoc: array [1 .. nPl, 0 .. MaxCityLoc - 1] of integer;1313 nCityLoc: array [1 .. nPl] of integer;1314 RestLoc: array [0 .. MaxCityLoc - 1] of integer;1315 IrrLoc: array [0 .. 20] of integer;1309 FineDistSQR, nRest: Integer; 1310 ccount: array [0 .. lxmax * lymax - 1] of Word; 1311 sc, StartLoc0, sccount: array [1 .. nPl] of Integer; 1312 TestStartLoc: array [0 .. nPl - 1] of Integer; 1313 CityLoc: array [1 .. nPl, 0 .. MaxCityLoc - 1] of Integer; 1314 nCityLoc: array [1 .. nPl] of Integer; 1315 RestLoc: array [0 .. MaxCityLoc - 1] of Integer; 1316 IrrLoc: array [0 .. 20] of Integer; 1316 1317 Radius: TVicinity21Loc; 1317 1318 Adjacent: TVicinity8Loc; 1318 ok: boolean;1319 ok: Boolean; 1319 1320 1320 1321 begin … … 1322 1323 for p1 := 0 to nPl - 1 do 1323 1324 if 1 shl p1 and GAlive <> 0 then 1324 inc(nAlive);1325 Inc(nAlive); 1325 1326 if nAlive = 0 then 1326 exit;1327 Exit; 1327 1328 1328 1329 { count good tiles } … … 1331 1332 if RealMap[Loc] and fTerrain = fGrass then 1332 1333 if ActualSpecialTile(Loc) = 1 then 1333 inc(ccount[Continent[Loc]], 3)1334 Inc(ccount[Continent[Loc]], 3) 1334 1335 else 1335 inc(ccount[Continent[Loc]], 2)1336 Inc(ccount[Continent[Loc]], 2) 1336 1337 else if RealMap[Loc] and fTerrain in [fPrairie, fSwamp, fForest, fHills] 1337 1338 then 1338 inc(ccount[Continent[Loc]]);1339 Inc(ccount[Continent[Loc]]); 1339 1340 1340 1341 Loc := 0; 1341 1342 while ccount[Loc] > 0 do 1342 inc(Loc);1343 for i:= 1 to nAlive do1344 begin 1345 sc[ i] := Loc;1346 sccount[ i] := 11343 Inc(Loc); 1344 for I := 1 to nAlive do 1345 begin 1346 sc[I] := Loc; 1347 sccount[I] := 1 1347 1348 end; 1348 1349 { init with zero size start continents, then search bigger ones } … … 1355 1356 if p1 < nAlive + 1 then 1356 1357 sc[p1] := sc[p1 - 1]; 1357 dec(p1)1358 Dec(p1); 1358 1359 end; 1359 1360 if p1 < nAlive + 1 then … … 1362 1363 nsc := nAlive; 1363 1364 repeat 1364 c:= 1; // search least crowded continent after smallest1365 for i:= 2 to nsc - 1 do1366 if ccount[sc[ i]] * (2 * sccount[c] + 1) > ccount[sc[c]] *1367 (2 * sccount[ i] + 1) then1368 c := i;1369 if ccount[sc[nsc]] * (2 * sccount[ c] + 1) > ccount[sc[c]] then1365 C := 1; // search least crowded continent after smallest 1366 for I := 2 to nsc - 1 do 1367 if ccount[sc[I]] * (2 * sccount[C] + 1) > ccount[sc[C]] * 1368 (2 * sccount[I] + 1) then 1369 C := I; 1370 if ccount[sc[nsc]] * (2 * sccount[C] + 1) > ccount[sc[C]] then 1370 1371 Break; // even least crowded continent is more crowded than smallest 1371 inc(sccount[c]);1372 dec(nsc)1372 Inc(sccount[C]); 1373 Dec(nsc); 1373 1374 until sccount[nsc] > 1; 1374 1375 … … 1376 1377 CountGood := cgBest; 1377 1378 repeat 1378 dec(MinGood);1379 Dec(MinGood); 1379 1380 if (MinGood = 3) and (CountGood < cgLand) then // too demanding! 1380 1381 begin 1381 inc(CountGood);1382 MinGood := 6 1382 Inc(CountGood); 1383 MinGood := 6; 1383 1384 end; 1384 1385 FillChar(nCityLoc, SizeOf(nCityLoc), 0); 1385 1386 Loc := DelphiRandom(MapSize); 1386 for i:= 0 to MapSize - 1 do1387 for I := 0 to MapSize - 1 do 1387 1388 begin 1388 1389 if ((Loc >= 4 * lx) and (Loc < MapSize - 4 * lx) or (CountGood >= cgLand)) 1389 1390 and IsGoodTile(Loc) then 1390 1391 begin 1391 c:= nsc;1392 while ( c > 0) and (Continent[Loc] <> sc[c]) do1393 dec(c);1394 if ( c > 0) and (nCityLoc[c] < MaxCityLoc) then1392 C := nsc; 1393 while (C > 0) and (Continent[Loc] <> sc[C]) do 1394 Dec(C); 1395 if (C > 0) and (nCityLoc[C] < MaxCityLoc) then 1395 1396 begin 1396 1397 CntGood := 1; … … 1401 1402 Loc1 := Radius[V21]; 1402 1403 if (Loc1 >= 0) and (Loc1 < MapSize) and IsGoodTile(Loc1) then 1403 inc(CntGood)1404 Inc(CntGood); 1404 1405 end; 1405 1406 if CntGood >= MinGood then 1406 1407 begin 1407 CityLoc[ c, nCityLoc[c]] := Loc;1408 inc(nCityLoc[c])1408 CityLoc[C, nCityLoc[C]] := Loc; 1409 Inc(nCityLoc[C]); 1409 1410 end; 1410 1411 end; … … 1413 1414 end; 1414 1415 1415 ok := true;1416 for c:= 1 to nsc do1417 if nCityLoc[ c] < sccount[c] * (8 - MinGood) div (7 - MinGood) then1418 ok := false;1416 ok := True; 1417 for C := 1 to nsc do 1418 if nCityLoc[C] < sccount[C] * (8 - MinGood) div (7 - MinGood) then 1419 ok := False; 1419 1420 until ok; 1420 1421 1421 1422 FineDistSQR := MapSize * LandMass * 9 div (nAlive * 100); 1422 1423 p1 := 1; 1423 for c:= 1 to nsc do1424 for C := 1 to nsc do 1424 1425 begin // for all start continents 1425 if sccount[ c] = 1 then1426 StartLoc0[p1] := CityLoc[ c, DelphiRandom(nCityLoc[c])]1426 if sccount[C] = 1 then 1427 StartLoc0[p1] := CityLoc[C, DelphiRandom(nCityLoc[C])] 1427 1428 else 1428 1429 begin 1429 1430 BestDist := 0; 1430 n := 1 shl sccount[c] * 32; // number of tries to find good distribution1431 if n> 1 shl 12 then1432 n:= 1 shl 12;1433 while ( n> 0) and (BestDist * BestDist < FineDistSQR) do1431 N := 1 shl sccount[C] * 32; // number of tries to find good distribution 1432 if N > 1 shl 12 then 1433 N := 1 shl 12; 1434 while (N > 0) and (BestDist * BestDist < FineDistSQR) do 1434 1435 begin 1435 1436 MinDist := MaxInt; 1436 nRest := nCityLoc[ c];1437 for i:= 0 to nRest - 1 do1438 RestLoc[ i] := CityLoc[c, i];1439 for i := 0 to sccount[c] - 1 do1437 nRest := nCityLoc[C]; 1438 for I := 0 to nRest - 1 do 1439 RestLoc[I] := CityLoc[C, I]; 1440 for I := 0 to sccount[C] - 1 do 1440 1441 begin 1441 1442 if nRest = 0 then 1442 1443 Break; 1443 j:= DelphiRandom(nRest);1444 TestStartLoc[ i] := RestLoc[j];1445 RestLoc[ j] := RestLoc[nRest - 1];1446 dec(nRest);1447 for j := 0 to i- 1 do1444 J := DelphiRandom(nRest); 1445 TestStartLoc[I] := RestLoc[J]; 1446 RestLoc[J] := RestLoc[nRest - 1]; 1447 Dec(nRest); 1448 for J := 0 to I - 1 do 1448 1449 begin 1449 TestDist := Distance(TestStartLoc[ i], TestStartLoc[j]);1450 TestDist := Distance(TestStartLoc[I], TestStartLoc[J]); 1450 1451 if TestDist < MinDist then 1451 MinDist := TestDist 1452 MinDist := TestDist; 1452 1453 end; 1453 if i = sccount[c] - 1 then1454 if I = sccount[C] - 1 then 1454 1455 begin 1455 assert(MinDist > BestDist);1456 Assert(MinDist > BestDist); 1456 1457 BestDist := MinDist; 1457 for j := 0 to sccount[c] - 1 do1458 StartLoc0[p1 + j] := TestStartLoc[j];1458 for J := 0 to sccount[C] - 1 do 1459 StartLoc0[p1 + J] := TestStartLoc[J]; 1459 1460 end 1460 1461 else if BestDist > 0 then 1461 1462 begin 1462 j:= 0;1463 while j< nRest do1463 J := 0; 1464 while J < nRest do 1464 1465 begin // remove all locs from rest which have too little distance to this one 1465 TestDist := Distance(TestStartLoc[ i], RestLoc[j]);1466 TestDist := Distance(TestStartLoc[I], RestLoc[J]); 1466 1467 if TestDist <= BestDist then 1467 1468 begin 1468 RestLoc[ j] := RestLoc[nRest - 1];1469 dec(nRest);1469 RestLoc[J] := RestLoc[nRest - 1]; 1470 Dec(nRest); 1470 1471 end 1471 1472 else 1472 inc(j);1473 Inc(J); 1473 1474 end; 1474 1475 end; 1475 1476 end; 1476 dec(n)1477 end; 1478 end; 1479 p1 := p1 + sccount[ c]1477 Dec(N) 1478 end; 1479 end; 1480 p1 := p1 + sccount[C] 1480 1481 end; 1481 1482 … … 1494 1495 if (Loc1 >= 0) and (Loc1 < MapSize) and IsGoodTile(Loc1) then 1495 1496 if RealMap[Loc1] and fTerrain = fGrass then 1496 inc(CntGoodGrass)1497 Inc(CntGoodGrass) 1497 1498 else 1498 inc(CntGood);1499 Inc(CntGood); 1499 1500 end; 1500 1501 for V21 := 1 to 26 do … … 1528 1529 begin 1529 1530 IrrLoc[nIrrLoc] := Loc1; 1530 inc(nIrrLoc);1531 end; 1532 end; 1533 i:= 2;1534 if i> nIrrLoc then1535 i:= nIrrLoc;1536 while i> 0 do1537 begin 1538 j:= DelphiRandom(nIrrLoc);1539 RealMap[IrrLoc[ j]] := RealMap[IrrLoc[j]] or tiIrrigation;1540 IrrLoc[ j] := IrrLoc[nIrrLoc - 1];1541 dec(nIrrLoc);1542 dec(i);1531 Inc(nIrrLoc); 1532 end; 1533 end; 1534 I := 2; 1535 if I > nIrrLoc then 1536 I := nIrrLoc; 1537 while I > 0 do 1538 begin 1539 J := DelphiRandom(nIrrLoc); 1540 RealMap[IrrLoc[J]] := RealMap[IrrLoc[J]] or tiIrrigation; 1541 IrrLoc[J] := IrrLoc[nIrrLoc - 1]; 1542 Dec(nIrrLoc); 1543 Dec(I); 1543 1544 end; 1544 1545 end; … … 1549 1550 begin 1550 1551 repeat 1551 i:= DelphiRandom(nAlive) + 11552 until StartLoc0[ i] >= 0;1553 StartLoc[p1] := StartLoc0[ i];1554 StartLoc0[ i] := -11552 I := DelphiRandom(nAlive) + 1 1553 until StartLoc0[I] >= 0; 1554 StartLoc[p1] := StartLoc0[I]; 1555 StartLoc0[I] := -1 1555 1556 end; 1556 1557 SaveMapCenterLoc := StartLoc[0]; … … 1585 1586 StartLoc2[p1] := Loc1; 1586 1587 BestDist := TestDist; 1587 n:= 1;1588 N := 1; 1588 1589 end 1589 1590 else if TestDist = BestDist then 1590 1591 begin 1591 inc(n);1592 if DelphiRandom( n) = 0 then1592 Inc(N); 1593 if DelphiRandom(N) = 0 then 1593 1594 StartLoc2[p1] := Loc1; 1594 1595 end; 1595 1596 end; 1596 1597 end; 1597 end; { StartPositions }1598 1599 procedure PredefinedStartPositions(Human: integer);1598 end; 1599 1600 procedure PredefinedStartPositions(Human: Integer); 1600 1601 // use predefined nation start positions 1601 1602 var 1602 i, p1, Loc1, nAlive, nStartLoc0, nPrefStartLoc0, imax: integer;1603 StartLoc0: array [0 .. lxmax * lymax - 1] of integer;1604 ishuman: boolean;1603 I, p1, Loc1, nAlive, nStartLoc0, nPrefStartLoc0, imax: Integer; 1604 StartLoc0: array [0 .. lxmax * lymax - 1] of Integer; 1605 ishuman: Boolean; 1605 1606 begin 1606 1607 nAlive := 0; 1607 1608 for p1 := 0 to nPl - 1 do 1608 1609 if 1 shl p1 and GAlive <> 0 then 1609 inc(nAlive);1610 Inc(nAlive); 1610 1611 if nAlive = 0 then 1611 exit;1612 Exit; 1612 1613 1613 1614 for I := 0 to Length(StartLoc0) - 1 do … … 1622 1623 StartLoc0[nStartLoc0] := StartLoc0[nPrefStartLoc0]; 1623 1624 StartLoc0[nPrefStartLoc0] := Loc1; 1624 inc(nPrefStartLoc0);1625 inc(nStartLoc0);1625 Inc(nPrefStartLoc0); 1626 Inc(nStartLoc0); 1626 1627 RealMap[Loc1] := RealMap[Loc1] and not fPrefStartPos; 1627 1628 end … … 1629 1630 begin 1630 1631 StartLoc0[nStartLoc0] := Loc1; 1631 inc(nStartLoc0);1632 Inc(nStartLoc0); 1632 1633 RealMap[Loc1] := RealMap[Loc1] and not fStartPos; 1633 1634 end; 1634 assert(nStartLoc0 >= nAlive);1635 Assert(nStartLoc0 >= nAlive); 1635 1636 1636 1637 StartLoc[0] := 0; 1637 for ishuman := true downto false do1638 for ishuman := True downto False do 1638 1639 for p1 := 0 to nPl - 1 do 1639 1640 if (1 shl p1 and GAlive <> 0) and ((1 shl p1 and Human <> 0) = ishuman) 1640 1641 then 1641 1642 begin 1642 dec(nStartLoc0);1643 Dec(nStartLoc0); 1643 1644 imax := nStartLoc0; 1644 1645 if nPrefStartLoc0 > 0 then 1645 1646 begin 1646 dec(nPrefStartLoc0);1647 Dec(nPrefStartLoc0); 1647 1648 imax := nPrefStartLoc0; 1648 1649 end; 1649 i:= DelphiRandom(imax + 1);1650 StartLoc[p1] := StartLoc0[ i];1651 StartLoc2[p1] := StartLoc0[ i];1652 StartLoc0[ i] := StartLoc0[imax];1650 I := DelphiRandom(imax + 1); 1651 StartLoc[p1] := StartLoc0[I]; 1652 StartLoc2[p1] := StartLoc0[I]; 1653 StartLoc0[I] := StartLoc0[imax]; 1653 1654 StartLoc0[imax] := StartLoc0[nStartLoc0]; 1654 1655 end; 1655 1656 SaveMapCenterLoc := StartLoc[0]; 1656 end; { PredefinedStartPositions }1657 end; 1657 1658 1658 1659 procedure InitGame; 1659 1660 var 1660 i, p, p1, uix, Loc1: integer;1661 I, P, p1, uix, Loc1: Integer; 1661 1662 begin 1662 1663 {$IFDEF FastContact} … … 1670 1671 if RealMap[Loc1] and fterrain>=fGrass then 1671 1672 if Delphirandom(3)=0 then RealMap[Loc1]:=RealMap[Loc1] or fRoad 1672 else if Delphirandom(3)=0 then RealMap[Loc1]:=RealMap[Loc1] or fRR; 1673 else if Delphirandom(3)=0 then RealMap[Loc1]:=RealMap[Loc1] or fRR;} 1673 1674 {random Road and Railroad } 1674 1675 { !!!for Loc1:=0 to MapSize-1 do … … 1682 1683 GTestFlags := 0; 1683 1684 GInitialized := GAlive or GWatching; 1684 for p:= 0 to nPl - 1 do1685 if 1 shl pand GInitialized <> 0 then1686 with RW[ p] do1687 begin 1688 Researched[ p] := 0;1689 Discovered[ p] := 0;1690 TerritoryCount[ p] := 0;1691 nTech[ p] := 0;1692 if Difficulty[ p] = 0 then1693 ResourceMask[ p] := $FFFFFFFF1685 for P := 0 to nPl - 1 do 1686 if 1 shl P and GInitialized <> 0 then 1687 with RW[P] do 1688 begin 1689 Researched[P] := 0; 1690 Discovered[P] := 0; 1691 TerritoryCount[P] := 0; 1692 nTech[P] := 0; 1693 if Difficulty[P] = 0 then 1694 ResourceMask[P] := $FFFFFFFF 1694 1695 else 1695 ResourceMask[ p] := $FFFFFFFF and not(fSpecial2 or fModern);1696 GrWallContinent[ p] := -1;1696 ResourceMask[P] := $FFFFFFFF and not(fSpecial2 or fModern); 1697 GrWallContinent[P] := -1; 1697 1698 1698 1699 GetMem(Map, 4 * MapSize); … … 1712 1713 if 1 shl p1 and GInitialized <> 0 then 1713 1714 begin 1714 FillChar(RWemix[ p, p1], SizeOf(RWemix[p, p1]), 255); { -1 }1715 FillChar(Destroyed[ p, p1], SizeOf(Destroyed[p, p1]), 0);1715 FillChar(RWemix[P, p1], SizeOf(RWemix[P, p1]), 255); { -1 } 1716 FillChar(Destroyed[P, p1], SizeOf(Destroyed[P, p1]), 0); 1716 1717 end; 1717 1718 Attitude[p1] := atNeutral; … … 1721 1722 Tribute[p1] := 0; 1722 1723 TributePaid[p1] := 0; 1723 if (p1 <> p) and (1 shl p1 and GAlive <> 0) then1724 if (p1 <> P) and (1 shl p1 and GAlive <> 0) then 1724 1725 begin // initialize enemy report 1725 1726 GetMem(EnemyReport[p1], SizeOf(TEnemyReport) - 2 * … … 1731 1732 EnemyReport[p1].Attitude := atNeutral; 1732 1733 EnemyReport[p1].Government := gDespotism; 1733 if 1 shl pand GAlive = 0 then1734 if 1 shl P and GAlive = 0 then 1734 1735 Treaty[p1] := trNone // supervisor 1735 1736 end … … 1753 1754 1754 1755 // create initial models and units 1755 for p:= 0 to nPl - 1 do1756 if (1 shl pand GAlive <> 0) then1757 with RW[ p] do1756 for P := 0 to nPl - 1 do 1757 if (1 shl P and GAlive <> 0) then 1758 with RW[P] do 1758 1759 begin 1759 1760 nModel := 0; 1760 for i:= 0 to nSpecialModel - 1 do1761 if SpecialModelPreq[ i] = preNone then1761 for I := 0 to nSpecialModel - 1 do 1762 if SpecialModelPreq[I] = preNone then 1762 1763 begin 1763 Model[nModel] := SpecialModel[ i];1764 Model[nModel] := SpecialModel[I]; 1764 1765 Model[nModel].Status := 0; 1765 1766 Model[nModel].IntroTurn := 0; 1766 1767 Model[nModel].Built := 0; 1767 1768 Model[nModel].Lost := 0; 1768 Model[nModel].ID := pshl 12 + nModel;1769 Model[nModel].ID := P shl 12 + nModel; 1769 1770 SetModelFlags(Model[nModel]); 1770 inc(nModel)1771 Inc(nModel); 1771 1772 end; 1772 1773 nUn := 0; 1773 UnBuilt[ p] := 0;1774 UnBuilt[P] := 0; 1774 1775 for uix := 0 to nStartUn - 1 do 1775 1776 begin 1776 CreateUnit( p, StartUn[uix]);1777 dec(Model[StartUn[uix]].Built);1778 Un[uix].Loc := StartLoc2[ p];1779 PlaceUnit( p, uix);1780 end; 1781 FoundCity( p, StartLoc[p]); // capital1782 Founded[ p] := 1;1777 CreateUnit(P, StartUn[uix]); 1778 Dec(Model[StartUn[uix]].Built); 1779 Un[uix].Loc := StartLoc2[P]; 1780 PlaceUnit(P, uix); 1781 end; 1782 FoundCity(P, StartLoc[P]); // capital 1783 Founded[P] := 1; 1783 1784 with City[0] do 1784 1785 begin 1785 ID := pshl 12;1786 ID := P shl 12; 1786 1787 Flags := chFounded; 1787 1788 end; … … 1790 1791 TerritoryCount[nPl] := MapSize; 1791 1792 // fillchar(NewContact, sizeof(NewContact), false); 1792 end; // InitGame1793 end; 1793 1794 1794 1795 procedure InitRandomGame; … … 1797 1798 CalculatePrimitive; 1798 1799 CreateElevation; 1799 CreateMap( false);1800 CreateMap(False); 1800 1801 StartPositions; 1801 1802 InitGame; 1802 1803 end; 1803 1804 1804 procedure InitMapGame(Human: integer);1805 procedure InitMapGame(Human: Integer); 1805 1806 begin 1806 1807 DelphiRandSeed := RND; … … 1812 1813 procedure ReleaseGame; 1813 1814 var 1814 p1, p2: integer;1815 p1, p2: Integer; 1815 1816 begin 1816 1817 for p1 := 0 to nPl - 1 do … … 1834 1835 procedure InitMapEditor; 1835 1836 var 1836 p1: integer;1837 p1: Integer; 1837 1838 begin 1838 1839 CalculatePrimitive; … … 1871 1872 end; 1872 1873 1873 procedure EditTile(Loc, NewTile: integer);1874 var 1875 Loc1, V21: integer;1874 procedure EditTile(Loc, NewTile: Integer); 1875 var 1876 Loc1, V21: Integer; 1876 1877 Radius: TVicinity21Loc; 1877 1878 begin … … 1897 1898 if (NewTile and fTerImp = tiIrrigation) or (NewTile and fTerImp = tiFarm) 1898 1899 then 1899 NewTile := NewTile and not fTerImp 1900 NewTile := NewTile and not fTerImp; 1900 1901 end; 1901 1902 if (Terrain[NewTile and fTerrain].MineEff = 0) and … … 1921 1922 RealMap[Loc1] := RealMap[Loc1] or ($F shl 27); 1922 1923 RW[0].Map[Loc1] := RealMap[Loc1] and $07FFFFFF or fObserved; 1923 end 1924 end; 1924 1925 end; 1925 1926 // RealMap[Loc]:=RealMap[Loc] and not fSpecial; … … 1931 1932 ____________________________________________________________________ 1932 1933 } 1933 function GetTileInfo( p, cix, Loc: integer; var Info: TTileInfo): integer;1934 function GetTileInfo(P, cix, Loc: Integer; var Info: TTileInfo): Integer; 1934 1935 // cix>=0 - known city index of player p -- only core internal! 1935 1936 // cix=-1 - search city, player unknown, only if permission for p 1936 1937 // cix=-2 - don't search city, don't calculate city benefits, just government of player p 1937 1938 var 1938 p0, Tile, special: integer;1939 p0, Tile, special: Integer; 1939 1940 begin 1940 1941 with Info do 1941 1942 begin 1942 p0 := p;1943 p0 := P; 1943 1944 if cix >= 0 then 1944 1945 Tile := RealMap[Loc] 1945 1946 else 1946 1947 begin 1947 Tile := RW[ p].Map[Loc];1948 Tile := RW[P].Map[Loc]; 1948 1949 if Tile and fTerrain = fUNKNOWN then 1949 1950 begin 1950 result := eNoPreq;1951 exit;1951 Result := eNoPreq; 1952 Exit; 1952 1953 end; 1953 1954 end; … … 1955 1956 if (cix = -1) and (UsedByCity[Loc] >= 0) then 1956 1957 begin // search exploiting player and city 1957 SearchCity(UsedByCity[Loc], p, cix);1958 if not(( p= p0) or (ObserveLevel[UsedByCity[Loc]] shr (2 * p0) and1958 SearchCity(UsedByCity[Loc], P, cix); 1959 if not((P = p0) or (ObserveLevel[UsedByCity[Loc]] shr (2 * p0) and 1959 1960 3 = lObserveSuper)) then 1960 1961 cix := -1 … … 1962 1963 if cix = -1 then 1963 1964 begin 1964 result := eInvalid;1965 exit;1965 Result := eInvalid; 1966 Exit; 1966 1967 end; // no city found here 1967 1968 1968 special := Tile and fSpecial and ResourceMask[ p] shr 5;1969 special := Tile and fSpecial and ResourceMask[P] shr 5; 1969 1970 with Terrain[Tile and fTerrain] do 1970 1971 begin … … 1973 1974 Trade := TradeRes[special]; 1974 1975 if (special > 0) and (Tile and fTerrain <> fGrass) and 1975 (RW[ p].NatBuilt[imSpacePort] > 0) then1976 (RW[P].NatBuilt[imSpacePort] > 0) then 1976 1977 begin // GeoSat effect 1977 1978 Food := 2 * Food - FoodRes[0]; … … 1982 1983 if (Tile and fTerImp = tiIrrigation) or (Tile and fTerImp = tiFarm) or 1983 1984 (Tile and fCity <> 0) then 1984 inc(Food, IrrEff); { irrigation effect }1985 Inc(Food, IrrEff); { irrigation effect } 1985 1986 if Tile and fTerImp = tiMine then 1986 inc(Prod, MineEff); { mining effect }1987 if (Tile and fRiver <> 0) and (RW[ p].Tech[adMapMaking] >= tsApplicable)1987 Inc(Prod, MineEff); { mining effect } 1988 if (Tile and fRiver <> 0) and (RW[P].Tech[adMapMaking] >= tsApplicable) 1988 1989 then 1989 inc(Trade); { river effect }1990 Inc(Trade); { river effect } 1990 1991 if (Tile and (fRoad or fRR) <> 0) and (MoveCost = 1) and 1991 (RW[ p].Tech[adWheel] >= tsApplicable) then1992 inc(Trade); { road effect }1992 (RW[P].Tech[adWheel] >= tsApplicable) then 1993 Inc(Trade); { road effect } 1993 1994 if (Tile and (fRR or fCity) <> 0) and 1994 (RW[ p].Tech[adRailroad] >= tsApplicable) then1995 inc(Prod, Prod shr 1); { railroad effect }1995 (RW[P].Tech[adRailroad] >= tsApplicable) then 1996 Inc(Prod, Prod shr 1); { railroad effect } 1996 1997 1997 1998 ExplCity := -1; 1998 if (cix >= 0) and ( p= p0) then1999 if (cix >= 0) and (P = p0) then 1999 2000 ExplCity := cix; 2000 2001 if cix >= 0 then … … 2002 2003 begin 2003 2004 if ((Tile and fTerImp = tiFarm) or (Tile and fCity <> 0)) and 2004 (RW[ p].City[cix].Built[imSupermarket] > 0) then2005 inc(Food, Food shr 1); { farmland effect }2005 (RW[P].City[cix].Built[imSupermarket] > 0) then 2006 Inc(Food, Food shr 1); { farmland effect } 2006 2007 if (Tile and (fRoad or fRR) <> 0) and (MoveCost = 1) and 2007 (RW[ p].City[cix].Built[imHighways] > 0) then2008 inc(Trade, 1); { superhighway effect }2008 (RW[P].City[cix].Built[imHighways] > 0) then 2009 Inc(Trade, 1); { superhighway effect } 2009 2010 end 2010 2011 else 2011 2012 begin 2012 if RW[ p].City[cix].Built[imHarbor] > 0 then2013 inc(Food); { harbour effect }2014 if RW[ p].City[cix].Built[imPlatform] > 0 then2015 inc(Prod); { oil platform effect }2016 if GWonder[woLighthouse].EffectiveOwner = pthen2017 inc(Prod);2013 if RW[P].City[cix].Built[imHarbor] > 0 then 2014 Inc(Food); { harbour effect } 2015 if RW[P].City[cix].Built[imPlatform] > 0 then 2016 Inc(Prod); { oil platform effect } 2017 if GWonder[woLighthouse].EffectiveOwner = P then 2018 Inc(Prod); 2018 2019 end; 2019 2020 end; 2020 2021 2021 2022 { good government influence } 2022 if (RW[ p].Government in [gRepublic, gDemocracy, gFuture]) and (Trade > 0)2023 if (RW[P].Government in [gRepublic, gDemocracy, gFuture]) and (Trade > 0) 2023 2024 then 2024 inc(Trade);2025 if (RW[ p].Government = gCommunism) and (Prod > 1) then2026 inc(Prod);2027 2028 if RW[ p].Government in [gAnarchy, gDespotism] then2025 Inc(Trade); 2026 if (RW[P].Government = gCommunism) and (Prod > 1) then 2027 Inc(Prod); 2028 2029 if RW[P].Government in [gAnarchy, gDespotism] then 2029 2030 begin { bad government influence } 2030 2031 if Food > 3 then … … 2038 2039 if Tile and (fTerrain or fPoll) > fPoll then 2039 2040 begin { pollution - decrease ressources } 2040 dec(Food, Food shr 1);2041 dec(Prod, Prod shr 1);2042 dec(Trade, Trade shr 1);2041 Dec(Food, Food shr 1); 2042 Dec(Prod, Prod shr 1); 2043 Dec(Trade, Trade shr 1); 2043 2044 end; 2044 2045 2045 2046 if Tile and fCity <> 0 then 2046 2047 Trade := 0 2047 else if (cix >= 0) and (RW[ p].City[cix].Built[imCourt] + RW[p].City[cix]2048 else if (cix >= 0) and (RW[P].City[cix].Built[imCourt] + RW[P].City[cix] 2048 2049 .Built[imPalace] = 0) then 2049 if RW[ p].City[cix].Built[imTownHall] = 0 then2050 if RW[P].City[cix].Built[imTownHall] = 0 then 2050 2051 Trade := 0 2051 2052 else if Trade > 3 then 2052 2053 Trade := 3; 2053 2054 end; 2054 result := eOK;2055 end; { GetTileInfo }2056 2057 procedure Strongest(Loc: integer; var uix, Strength, Bonus, Cnt: integer);2055 Result := eOK; 2056 end; 2057 2058 procedure Strongest(Loc: Integer; var uix, Strength, Bonus, Cnt: Integer); 2058 2059 { find strongest defender at Loc } 2059 2060 var 2060 2061 Defender, uix1, Det, Cost, TestStrength, TestBonus, TestDet, TestCost, 2061 Domain: integer;2062 Domain: Integer; 2062 2063 PUn: ^TUn; 2063 2064 PModel: ^TModel; … … 2077 2078 if PUn.Loc = Loc then 2078 2079 begin 2079 inc(Cnt);2080 Inc(Cnt); 2080 2081 if PUn.Master < 0 then 2081 2082 begin … … 2084 2085 TestBonus := Terrain[RealMap[Loc] and fTerrain].Defense; 2085 2086 if RealMap[Loc] and fTerImp = tiFort then 2086 inc(TestBonus, 4);2087 Inc(TestBonus, 4); 2087 2088 if PUn.Flags and unFortified <> 0 then 2088 inc(TestBonus, 2);2089 Inc(TestBonus, 2); 2089 2090 if (PModel.Kind = mkSpecial_TownGuard) and 2090 2091 (RealMap[Loc] and fCity <> 0) then 2091 inc(TestBonus, 4);2092 Inc(TestBonus, 4); 2092 2093 end 2093 2094 else 2094 2095 TestBonus := 4; 2095 inc(TestBonus, PUn.exp div ExpCost);2096 Inc(TestBonus, PUn.exp div ExpCost); 2096 2097 TestStrength := PModel.Defense * TestBonus * PUn.Health; 2097 2098 if (Domain = dAir) and ((RealMap[Loc] and fCity <> 0) or … … 2103 2104 if PModel.Cap[mcStealth] > 0 then 2104 2105 else if PModel.Cap[mcSub] > 0 then 2105 inc(TestDet, 1 shl 28)2106 Inc(TestDet, 1 shl 28) 2106 2107 else if (Domain = dGround) and (PModel.Cap[mcFanatic] > 0) and 2107 2108 not(RW[Defender].Government in [gRepublic, gDemocracy, gFuture]) then 2108 inc(TestDet, 4 shl 28) // fanatic ground units always defend2109 Inc(TestDet, 4 shl 28) // fanatic ground units always defend 2109 2110 else if PModel.Flags and mdZOC <> 0 then 2110 inc(TestDet, 3 shl 28)2111 Inc(TestDet, 3 shl 28) 2111 2112 else 2112 inc(TestDet, 2 shl 28);2113 Inc(TestDet, 2 shl 28); 2113 2114 TestCost := RW[Defender].Model[PUn.mix].Cost; 2114 2115 if (TestDet > Det) or (TestDet = Det) and (TestCost < Cost) then … … 2125 2126 end; 2126 2127 2127 function UnitSpeed( p, mix, Health: integer): integer;2128 begin 2129 with RW[ p].Model[mix] do2130 begin 2131 result := Speed;2128 function UnitSpeed(P, mix, Health: Integer): Integer; 2129 begin 2130 with RW[P].Model[mix] do 2131 begin 2132 Result := Speed; 2132 2133 if Domain = dSea then 2133 2134 begin 2134 if GWonder[woMagellan].EffectiveOwner = pthen2135 inc(result, 200);2135 if GWonder[woMagellan].EffectiveOwner = P then 2136 Inc(Result, 200); 2136 2137 if Health < 100 then 2137 result := ((result - 250) * Health div 5000) * 50 + 250;2138 end 2139 end 2140 end; 2141 2142 procedure GetUnitReport( p, uix: integer; var UnitReport: TUnitReport);2143 var 2144 TerrOwner: integer;2138 Result := ((Result - 250) * Health div 5000) * 50 + 250; 2139 end; 2140 end; 2141 end; 2142 2143 procedure GetUnitReport(P, uix: Integer; var UnitReport: TUnitReport); 2144 var 2145 TerrOwner: Integer; 2145 2146 PModel: ^TModel; 2146 2147 begin … … 2148 2149 UnitReport.ProdSupport := 0; 2149 2150 UnitReport.ReportFlags := 0; 2150 if RW[ p].Government <> gAnarchy then2151 with RW[ p].Un[uix] do2152 begin 2153 PModel := @RW[ p].Model[mix];2151 if RW[P].Government <> gAnarchy then 2152 with RW[P].Un[uix] do 2153 begin 2154 PModel := @RW[P].Model[mix]; 2154 2155 if (PModel.Kind = mkSettler) 2155 2156 { and (GWonder[woFreeSettlers].EffectiveOwner<>p) } then 2156 UnitReport.FoodSupport := SettlerFood[RW[ p].Government]2157 UnitReport.FoodSupport := SettlerFood[RW[P].Government] 2157 2158 else if Flags and unConscripts <> 0 then 2158 2159 UnitReport.FoodSupport := 1; 2159 2160 2160 if RW[ p].Government <> gFundamentalism then2161 if RW[P].Government <> gFundamentalism then 2161 2162 begin 2162 2163 if GTestFlags and tfImmImprove = 0 then … … 2173 2174 begin 2174 2175 TerrOwner := RealMap[Loc] shr 27; 2175 case RW[ p].Government of2176 case RW[P].Government of 2176 2177 gRepublic, gFuture: 2177 if (TerrOwner <> p) and (TerrOwner < nPl) and2178 (RW[ p].Treaty[TerrOwner] < trAlliance) then2178 if (TerrOwner <> P) and (TerrOwner < nPl) and 2179 (RW[P].Treaty[TerrOwner] < trAlliance) then 2179 2180 UnitReport.ReportFlags := UnitReport.ReportFlags or urfDeployed; 2180 2181 gDemocracy: 2181 if (TerrOwner >= nPl) or (TerrOwner <> p) and2182 (RW[ p].Treaty[TerrOwner] < trAlliance) then2182 if (TerrOwner >= nPl) or (TerrOwner <> P) and 2183 (RW[P].Treaty[TerrOwner] < trAlliance) then 2183 2184 UnitReport.ReportFlags := UnitReport.ReportFlags or urfDeployed; 2184 2185 end; … … 2188 2189 end; 2189 2190 2190 procedure SearchCity(Loc: integer; var p, cix: integer);2191 procedure SearchCity(Loc: Integer; var P, cix: Integer); 2191 2192 // set p to supposed owner before call 2192 2193 var 2193 i: integer;2194 I: Integer; 2194 2195 begin 2195 2196 if RealMap[Loc] < nPl shl 27 then 2196 p:= RealMap[Loc] shr 27;2197 for i:= 0 to nPl - 1 do2198 begin 2199 if 1 shl pand GAlive <> 0 then2200 with RW[ p] do2197 P := RealMap[Loc] shr 27; 2198 for I := 0 to nPl - 1 do 2199 begin 2200 if 1 shl P and GAlive <> 0 then 2201 with RW[P] do 2201 2202 begin 2202 2203 cix := nCity - 1; 2203 2204 while (cix >= 0) and (City[cix].Loc <> Loc) do 2204 dec(cix);2205 Dec(cix); 2205 2206 if cix >= 0 then 2206 exit;2207 end; 2208 assert(i< nPl - 1);2209 p := (p+ 1) mod nPl;2210 end; 2211 end; 2212 2213 procedure MakeCityInfo( p, cix: integer; var ci: TCityInfo);2214 begin 2215 assert((p >= 0) and (p< nPl));2216 assert((cix >= 0) and (cix < RW[p].nCity));2217 with RW[ p].City[cix] do2207 Exit; 2208 end; 2209 Assert(I < nPl - 1); 2210 P := (P + 1) mod nPl; 2211 end; 2212 end; 2213 2214 procedure MakeCityInfo(P, cix: Integer; var ci: TCityInfo); 2215 begin 2216 Assert((P >= 0) and (P < nPl)); 2217 Assert((cix >= 0) and (cix < RW[P].nCity)); 2218 with RW[P].City[cix] do 2218 2219 begin 2219 2220 ci.Loc := Loc; 2220 2221 ci.ID := ID; 2221 ci.Owner := p;2222 ci.Owner := P; 2222 2223 ci.Size := Size; 2223 2224 ci.Flags := 0; 2224 2225 if Built[imPalace] > 0 then 2225 inc(ci.Flags, ciCapital);2226 if (Built[imWalls] > 0) or (Continent[Loc] = GrWallContinent[ p]) then2227 inc(ci.Flags, ciWalled);2226 Inc(ci.Flags, ciCapital); 2227 if (Built[imWalls] > 0) or (Continent[Loc] = GrWallContinent[P]) then 2228 Inc(ci.Flags, ciWalled); 2228 2229 if Built[imCoastalFort] > 0 then 2229 inc(ci.Flags, ciCoastalFort);2230 Inc(ci.Flags, ciCoastalFort); 2230 2231 if Built[imMissileBat] > 0 then 2231 inc(ci.Flags, ciMissileBat);2232 Inc(ci.Flags, ciMissileBat); 2232 2233 if Built[imBunker] > 0 then 2233 inc(ci.Flags, ciBunker);2234 Inc(ci.Flags, ciBunker); 2234 2235 if Built[imSpacePort] > 0 then 2235 inc(ci.Flags, ciSpacePort);2236 end; 2237 end; 2238 2239 procedure TellAboutModel( p, taOwner, tamix: integer);2240 var 2241 i: integer;2242 begin 2243 if ( p= taOwner) or (Mode < moPlaying) then2244 exit;2245 i:= 0;2246 while ( i < RW[p].nEnemyModel) and ((RW[p].EnemyModel[i].Owner <> taOwner) or2247 (RW[ p].EnemyModel[i].mix <> tamix)) do2248 inc(i);2249 if i = RW[p].nEnemyModel then2250 IntServer(sIntTellAboutModel + pshl 4, taOwner, tamix, nil^);2251 end; 2252 2253 function emixSafe( p, taOwner, tamix: integer): integer;2254 begin 2255 result := RWemix[p, taOwner, tamix];2256 if result < 0 then2236 Inc(ci.Flags, ciSpacePort); 2237 end; 2238 end; 2239 2240 procedure TellAboutModel(P, taOwner, tamix: Integer); 2241 var 2242 I: Integer; 2243 begin 2244 if (P = taOwner) or (Mode < moPlaying) then 2245 Exit; 2246 I := 0; 2247 while (I < RW[P].nEnemyModel) and ((RW[P].EnemyModel[I].Owner <> taOwner) or 2248 (RW[P].EnemyModel[I].mix <> tamix)) do 2249 Inc(I); 2250 if I = RW[P].nEnemyModel then 2251 IntServer(sIntTellAboutModel + P shl 4, taOwner, tamix, nil^); 2252 end; 2253 2254 function emixSafe(P, taOwner, tamix: Integer): Integer; 2255 begin 2256 Result := RWemix[P, taOwner, tamix]; 2257 if Result < 0 then 2257 2258 begin // sIntTellAboutModel comes too late 2258 assert(Mode = moMovie);2259 result := $FFFF;2260 end; 2261 end; 2262 2263 procedure IntroduceEnemy(p1, p2: integer);2259 Assert(Mode = moMovie); 2260 Result := $FFFF; 2261 end; 2262 end; 2263 2264 procedure IntroduceEnemy(p1, p2: Integer); 2264 2265 begin 2265 2266 RW[p1].Treaty[p2] := trNone; … … 2267 2268 end; 2268 2269 2269 function DiscoverTile(Loc, p, pTell, Level: integer; EnableContact: boolean;2270 euix: integer = -2): boolean;2270 function DiscoverTile(Loc, P, pTell, Level: Integer; EnableContact: Boolean; 2271 euix: Integer = -2): Boolean; 2271 2272 // euix = -2: full discover 2272 2273 // euix = -1: unit and city only, append units in EnemyUn 2273 2274 // euix >= 0: unit and city only, replace EnemyUn[euix] 2274 2275 2275 procedure SetContact(p1, p2: integer);2276 procedure SetContact(p1, p2: Integer); 2276 2277 begin 2277 2278 if (Mode < moPlaying) or (p1 = p2) or (RW[p1].Treaty[p2] > trNoContact) then 2278 exit;2279 Exit; 2279 2280 IntServer(sIntTellAboutNation, p1, p2, nil^); 2280 2281 // NewContact[p1,p2]:=true … … 2282 2283 2283 2284 var 2284 i, uix, cix, TerrOwner, TerrOwnerTreaty, Strength, Bonus, Cnt, pFoundCity,2285 cixFoundCity, MinLevel, Loc1, V8: integer;2285 I, uix, cix, TerrOwner, TerrOwnerTreaty, Strength, Bonus, Cnt, pFoundCity, 2286 cixFoundCity, MinLevel, Loc1, V8: Integer; 2286 2287 Tile, AddFlags: Cardinal; 2287 2288 Adjacent: TVicinity8Loc; … … 2289 2290 mox: ^TModel; 2290 2291 begin 2291 result := false;2292 Result := False; 2292 2293 with RW[pTell] do 2293 2294 begin … … 2305 2306 AddFlags := AddFlags or fGrWall; 2306 2307 if (Mode = moPlaying) and ((Tile and (nPl shl 27) <> nPl shl 27) and 2307 (pTell = p)) then2308 (pTell = P)) then 2308 2309 begin // set fPeace flag? 2309 2310 TerrOwner := Tile shr 27; … … 2314 2315 (1 shl trPeace or 1 shl TrFriendlyContact) <> 0 then 2315 2316 AddFlags := AddFlags or fPeace; 2316 end 2317 end; 2317 2318 end; 2318 2319 … … 2332 2333 unx := @RW[Occupant[Loc]].Un[uix]; 2333 2334 mox := @RW[Occupant[Loc]].Model[unx.mix]; 2334 assert((ZoCMap[Loc] <> 0) = (mox.Flags and mdZOC <> 0));2335 Assert((ZoCMap[Loc] <> 0) = (mox.Flags and mdZOC <> 0)); 2335 2336 if (mox.Cap[mcStealth] > 0) and (Tile and fCity = 0) and 2336 2337 (Tile and fTerImp <> tiBase) then … … 2348 2349 begin 2349 2350 uix := nEnemyUn; 2350 inc(nEnemyUn);2351 assert(nEnemyUn < neumax);2351 Inc(nEnemyUn); 2352 Assert(nEnemyUn < neumax); 2352 2353 end; 2353 2354 MakeUnitInfo(Occupant[Loc], unx^, EnemyUn[uix]); 2354 2355 if Cnt > 1 then 2355 2356 EnemyUn[uix].Flags := EnemyUn[uix].Flags or unMulti; 2356 if (mox.Flags and mdZOC <> 0) and (pTell = p) and2357 if (mox.Flags and mdZOC <> 0) and (pTell = P) and 2357 2358 (Treaty[Occupant[Loc]] < trAlliance) then 2358 2359 begin // set fInEnemyZoC flags of surrounding tiles … … 2363 2364 if (Loc1 >= 0) and (Loc1 < MapSize) then 2364 2365 Map[Loc1] := Map[Loc1] or fInEnemyZoC 2365 end 2366 end; 2366 2367 end; 2367 2368 if EnableContact and (mox.Domain = dGround) then … … 2373 2374 end; 2374 2375 // Level:=lObserveSuper; // don't discover unit twice 2375 if (pTell = p) and2376 if (pTell = P) and 2376 2377 ((Tile and fCity = 0) or (1 shl pTell and GAI <> 0)) then 2377 result := true;2378 Result := True; 2378 2379 end 2379 2380 else … … 2397 2398 while (cixFoundCity >= 0) and 2398 2399 (RW[pFoundCity].City[cixFoundCity].Loc <> Loc) do 2399 dec(cixFoundCity);2400 assert(cixFoundCity >= 0);2401 i:= 0;2402 while ( i < nEnemyCity) and (EnemyCity[i].Loc <> Loc) do2403 inc(i);2404 if i= nEnemyCity then2400 Dec(cixFoundCity); 2401 Assert(cixFoundCity >= 0); 2402 I := 0; 2403 while (I < nEnemyCity) and (EnemyCity[I].Loc <> Loc) do 2404 Inc(I); 2405 if I = nEnemyCity then 2405 2406 begin 2406 inc(nEnemyCity);2407 assert(nEnemyCity < necmax);2408 EnemyCity[ i].Status := 0;2409 EnemyCity[ i].SavedStatus := 0;2410 if pTell = pthen2411 result := true;2407 Inc(nEnemyCity); 2408 Assert(nEnemyCity < necmax); 2409 EnemyCity[I].Status := 0; 2410 EnemyCity[I].SavedStatus := 0; 2411 if pTell = P then 2412 Result := True; 2412 2413 end; 2413 MakeCityInfo(pFoundCity, cixFoundCity, EnemyCity[ i]);2414 MakeCityInfo(pFoundCity, cixFoundCity, EnemyCity[I]); 2414 2415 end; 2415 2416 end … … 2420 2421 2421 2422 if Map[Loc] and fTerrain = fUNKNOWN then 2422 inc(Discovered[pTell]);2423 Inc(Discovered[pTell]); 2423 2424 if euix >= -1 then 2424 2425 Map[Loc] := Map[Loc] and not(fUnit or fCity or fOwned or fOwnZoCUnit) or … … 2437 2438 Cardinal(Level) shl (2 * pTell); 2438 2439 end; 2439 end; // DiscoverTile2440 2441 function Discover9(Loc, p, Level: integer;2442 TellAllied, EnableContact: boolean): boolean;2443 var 2444 V9, Loc1, pTell, OldLevel: integer;2440 end; 2441 2442 function Discover9(Loc, P, Level: Integer; 2443 TellAllied, EnableContact: Boolean): Boolean; 2444 var 2445 V9, Loc1, pTell, OldLevel: Integer; 2445 2446 Radius: TVicinity8Loc; 2446 2447 begin 2447 assert((Mode > moLoading_Fast) or (RW[p].nEnemyUn = 0));2448 result := false;2448 Assert((Mode > moLoading_Fast) or (RW[P].nEnemyUn = 0)); 2449 Result := False; 2449 2450 V8_to_Loc(Loc, Radius); 2450 2451 for V9 := 0 to 8 do … … 2458 2459 begin 2459 2460 for pTell := 0 to nPl - 1 do 2460 if (pTell = p) or (1 shl pTell and GAlive <> 0) and2461 (RW[ p].Treaty[pTell] = trAlliance) then2461 if (pTell = P) or (1 shl pTell and GAlive <> 0) and 2462 (RW[P].Treaty[pTell] = trAlliance) then 2462 2463 begin 2463 2464 OldLevel := ObserveLevel[Loc1] shr (2 * pTell) and 3; 2464 2465 if Level > OldLevel then 2465 result := DiscoverTile(Loc1, p, pTell, Level, EnableContact)2466 or result;2466 Result := DiscoverTile(Loc1, P, pTell, Level, EnableContact) 2467 or Result; 2467 2468 end; 2468 2469 end 2469 2470 else 2470 2471 begin 2471 OldLevel := ObserveLevel[Loc1] shr (2 * p) and 3;2472 OldLevel := ObserveLevel[Loc1] shr (2 * P) and 3; 2472 2473 if Level > OldLevel then 2473 result := DiscoverTile(Loc1, p, p, Level, EnableContact) or result;2474 end; 2475 end; 2476 end; 2477 2478 function Discover21(Loc, p, AdjacentLevel: integer;2479 TellAllied, EnableContact: boolean): boolean;2480 var 2481 V21, Loc1, pTell, Level, OldLevel, AdjacentFlags: integer;2474 Result := DiscoverTile(Loc1, P, P, Level, EnableContact) or Result; 2475 end; 2476 end; 2477 end; 2478 2479 function Discover21(Loc, P, AdjacentLevel: Integer; 2480 TellAllied, EnableContact: Boolean): Boolean; 2481 var 2482 V21, Loc1, pTell, Level, OldLevel, AdjacentFlags: Integer; 2482 2483 Radius: TVicinity21Loc; 2483 2484 begin 2484 assert((Mode > moLoading_Fast) or (RW[p].nEnemyUn = 0));2485 result := false;2485 Assert((Mode > moLoading_Fast) or (RW[P].nEnemyUn = 0)); 2486 Result := False; 2486 2487 AdjacentFlags := $00267620 shr 1; 2487 2488 V21_to_Loc(Loc, Radius); … … 2498 2499 begin 2499 2500 for pTell := 0 to nPl - 1 do 2500 if (pTell = p) or (1 shl pTell and GAlive <> 0) and2501 (RW[ p].Treaty[pTell] = trAlliance) then2501 if (pTell = P) or (1 shl pTell and GAlive <> 0) and 2502 (RW[P].Treaty[pTell] = trAlliance) then 2502 2503 begin 2503 2504 OldLevel := ObserveLevel[Loc1] shr (2 * pTell) and 3; 2504 2505 if Level > OldLevel then 2505 result := DiscoverTile(Loc1, p, pTell, Level, EnableContact)2506 or result;2506 Result := DiscoverTile(Loc1, P, pTell, Level, EnableContact) 2507 or Result; 2507 2508 end; 2508 2509 end 2509 2510 else 2510 2511 begin 2511 OldLevel := ObserveLevel[Loc1] shr (2 * p) and 3;2512 OldLevel := ObserveLevel[Loc1] shr (2 * P) and 3; 2512 2513 if Level > OldLevel then 2513 result := DiscoverTile(Loc1, p, p, Level, EnableContact) or result;2514 Result := DiscoverTile(Loc1, P, P, Level, EnableContact) or Result; 2514 2515 end; 2515 2516 end; … … 2518 2519 end; 2519 2520 2520 procedure DiscoverAll( p, Level: integer);2521 procedure DiscoverAll(P, Level: Integer); 2521 2522 { player p discovers complete playground (for supervisor) } 2522 2523 var 2523 Loc, OldLevel: integer;2524 begin 2525 assert((Mode > moLoading_Fast) or (RW[p].nEnemyUn = 0));2524 Loc, OldLevel: Integer; 2525 begin 2526 Assert((Mode > moLoading_Fast) or (RW[P].nEnemyUn = 0)); 2526 2527 for Loc := 0 to MapSize - 1 do 2527 2528 begin 2528 OldLevel := ObserveLevel[Loc] shr (2 * p) and 3;2529 OldLevel := ObserveLevel[Loc] shr (2 * P) and 3; 2529 2530 if Level > OldLevel then 2530 DiscoverTile(Loc, p, p, Level, false);2531 end; 2532 end; 2533 2534 procedure DiscoverViewAreas( p: integer);2535 var 2536 pTell, uix, cix, ecix, Loc, RealOwner: integer;2531 DiscoverTile(Loc, P, P, Level, False); 2532 end; 2533 end; 2534 2535 procedure DiscoverViewAreas(P: Integer); 2536 var 2537 pTell, uix, cix, ecix, Loc, RealOwner: Integer; 2537 2538 PModel: ^TModel; 2538 2539 begin // discover unit and city view areas 2539 2540 for pTell := 0 to nPl - 1 do 2540 if (pTell = p) or (RW[p].Treaty[pTell] = trAlliance) then2541 if (pTell = P) or (RW[P].Treaty[pTell] = trAlliance) then 2541 2542 begin 2542 2543 for uix := 0 to RW[pTell].nUn - 1 do … … 2546 2547 PModel := @RW[pTell].Model[mix]; 2547 2548 if (PModel.Kind = mkDiplomat) or (PModel.Cap[mcSpy] > 0) then 2548 Discover21(Loc, p, lObserveSuper, false, true)2549 Discover21(Loc, P, lObserveSuper, False, True) 2549 2550 else if (PModel.Cap[mcRadar] + PModel.Cap[mcCarrier] > 0) or 2550 2551 (PModel.Domain = dAir) then 2551 Discover21(Loc, p, lObserveAll, false, false)2552 Discover21(Loc, P, lObserveAll, False, False) 2552 2553 else if (RealMap[Loc] and fTerrain = fMountains) or 2553 2554 (RealMap[Loc] and fTerImp = tiFort) or 2554 2555 (RealMap[Loc] and fTerImp = tiBase) or (PModel.Cap[mcAcademy] > 0) 2555 2556 then 2556 Discover21(Loc, p, lObserveUnhidden, false,2557 Discover21(Loc, P, lObserveUnhidden, False, 2557 2558 PModel.Domain = dGround) 2558 2559 else 2559 Discover9(Loc, p, lObserveUnhidden, false,2560 Discover9(Loc, P, lObserveUnhidden, False, 2560 2561 PModel.Domain = dGround); 2561 2562 end; 2562 2563 for cix := 0 to RW[pTell].nCity - 1 do 2563 2564 if RW[pTell].City[cix].Loc >= 0 then 2564 Discover21(RW[pTell].City[cix].Loc, p, lObserveUnhidden, false, true);2565 Discover21(RW[pTell].City[cix].Loc, P, lObserveUnhidden, False, True); 2565 2566 for ecix := 0 to RW[pTell].nEnemyCity - 1 do 2566 2567 begin // players know territory, so no use in hiding city owner … … 2574 2575 begin 2575 2576 RW[pTell].EnemyCity[ecix].Loc := -1; 2576 RW[pTell].Map[Loc] := RW[pTell].Map[Loc] and not fCity 2577 RW[pTell].Map[Loc] := RW[pTell].Map[Loc] and not fCity; 2577 2578 end; 2578 2579 end; … … 2581 2582 end; 2582 2583 2583 function GetUnitStack( p, Loc: integer): integer;2584 var 2585 uix: integer;2584 function GetUnitStack(P, Loc: Integer): Integer; 2585 var 2586 uix: Integer; 2586 2587 unx: ^TUn; 2587 2588 begin 2588 result := 0;2589 Result := 0; 2589 2590 if Occupant[Loc] < 0 then 2590 exit;2591 Exit; 2591 2592 for uix := 0 to RW[Occupant[Loc]].nUn - 1 do 2592 2593 begin … … 2594 2595 if unx.Loc = Loc then 2595 2596 begin 2596 MakeUnitInfo(Occupant[Loc], unx^, RW[ p].EnemyUn[RW[p].nEnemyUn + result]);2597 TellAboutModel( p, Occupant[Loc], unx.mix);2598 RW[ p].EnemyUn[RW[p].nEnemyUn + result].emix :=2599 RWemix[ p, Occupant[Loc], unx.mix];2600 inc(result);2601 end; 2602 end; 2603 end; 2604 2605 procedure UpdateUnitMap(Loc: integer; CityChange: boolean = false);2597 MakeUnitInfo(Occupant[Loc], unx^, RW[P].EnemyUn[RW[P].nEnemyUn + Result]); 2598 TellAboutModel(P, Occupant[Loc], unx.mix); 2599 RW[P].EnemyUn[RW[P].nEnemyUn + Result].emix := 2600 RWemix[P, Occupant[Loc], unx.mix]; 2601 Inc(Result); 2602 end; 2603 end; 2604 end; 2605 2606 procedure UpdateUnitMap(Loc: Integer; CityChange: Boolean = False); 2606 2607 // update maps and enemy units of all players after unit change 2607 2608 var 2608 p, euix, OldLevel: integer;2609 P, euix, OldLevel: Integer; 2609 2610 AddFlags, ClearFlags: Cardinal; 2610 2611 begin 2611 2612 if (Mode = moLoading_Fast) and not CityChange then 2612 exit;2613 for p:= 0 to nPl - 1 do2614 if 1 shl pand (GAlive or GWatching) <> 0 then2615 begin 2616 OldLevel := ObserveLevel[Loc] shr (2 * p) and 3;2613 Exit; 2614 for P := 0 to nPl - 1 do 2615 if 1 shl P and (GAlive or GWatching) <> 0 then 2616 begin 2617 OldLevel := ObserveLevel[Loc] shr (2 * P) and 3; 2617 2618 if OldLevel > lNoObserve then 2618 2619 begin 2619 if RW[ p].Map[Loc] and (fUnit or fOwned) = fUnit then2620 if RW[P].Map[Loc] and (fUnit or fOwned) = fUnit then 2620 2621 begin 2621 2622 // replace unit located here in EnemyUn 2622 2623 // do not just set loc:=-1 because total number would be unlimited 2623 euix := RW[ p].nEnemyUn - 1;2624 euix := RW[P].nEnemyUn - 1; 2624 2625 while euix >= 0 do 2625 2626 begin 2626 if RW[ p].EnemyUn[euix].Loc = Loc then2627 if RW[P].EnemyUn[euix].Loc = Loc then 2627 2628 begin 2628 RW[ p].EnemyUn[euix].Loc := -1;2629 RW[P].EnemyUn[euix].Loc := -1; 2629 2630 Break; 2630 2631 end; 2631 dec(euix);2632 Dec(euix); 2632 2633 end; 2633 RW[ p].Map[Loc] := RW[p].Map[Loc] and not fUnit2634 RW[P].Map[Loc] := RW[P].Map[Loc] and not fUnit 2634 2635 end 2635 2636 else 2636 2637 begin // look for empty slot in EnemyUn 2637 euix := RW[ p].nEnemyUn - 1;2638 while (euix >= 0) and (RW[ p].EnemyUn[euix].Loc >= 0) do2639 dec(euix);2638 euix := RW[P].nEnemyUn - 1; 2639 while (euix >= 0) and (RW[P].EnemyUn[euix].Loc >= 0) do 2640 Dec(euix); 2640 2641 end; 2641 2642 if (Occupant[Loc] < 0) and not CityChange then … … 2644 2645 if RealMap[Loc] and fCity = 0 then 2645 2646 ClearFlags := ClearFlags or fOwned; 2646 RW[ p].Map[Loc] := RW[p].Map[Loc] and not ClearFlags;2647 RW[P].Map[Loc] := RW[P].Map[Loc] and not ClearFlags; 2647 2648 end 2648 else if (Occupant[Loc] <> p) or CityChange then2649 else if (Occupant[Loc] <> P) or CityChange then 2649 2650 begin // city or enemy unit update necessary, call DiscoverTile 2650 ObserveLevel[Loc] := ObserveLevel[Loc] and not(3 shl (2 * p));2651 DiscoverTile(Loc, p, p, OldLevel, false, euix);2651 ObserveLevel[Loc] := ObserveLevel[Loc] and not(3 shl (2 * P)); 2652 DiscoverTile(Loc, P, P, OldLevel, False, euix); 2652 2653 end 2653 2654 else { if (Occupant[Loc]=p) and not CityChange then } … … 2659 2660 else 2660 2661 ClearFlags := ClearFlags or fOwnZoCUnit; 2661 RW[ p].Map[Loc] := RW[p].Map[Loc] and not ClearFlags or AddFlags;2662 end; 2663 end; 2664 end; 2665 end; 2666 2667 procedure RecalcV8ZoC( p, Loc: integer);2662 RW[P].Map[Loc] := RW[P].Map[Loc] and not ClearFlags or AddFlags; 2663 end; 2664 end; 2665 end; 2666 end; 2667 2668 procedure RecalcV8ZoC(P, Loc: Integer); 2668 2669 // recalculate fInEnemyZoC flags around single tile 2669 2670 var 2670 V8, V8V8, Loc1, Loc2, p1, ObserveMask: integer;2671 V8, V8V8, Loc1, Loc2, p1, ObserveMask: Integer; 2671 2672 Tile1: ^Cardinal; 2672 2673 Adjacent, AdjacentAdjacent: TVicinity8Loc; 2673 2674 begin 2674 2675 if Mode = moLoading_Fast then 2675 exit;2676 ObserveMask := 3 shl (2 * p);2676 Exit; 2677 ObserveMask := 3 shl (2 * P); 2677 2678 V8_to_Loc(Loc, Adjacent); 2678 2679 for V8 := 0 to 7 do … … 2681 2682 if (Loc1 >= 0) and (Loc1 < MapSize) then 2682 2683 begin 2683 Tile1 := @RW[ p].Map[Loc1];2684 Tile1 := @RW[P].Map[Loc1]; 2684 2685 Tile1^ := Tile1^ and not fInEnemyZoC; 2685 2686 V8_to_Loc(Loc1, AdjacentAdjacent); … … 2691 2692 begin 2692 2693 p1 := Occupant[Loc2]; 2693 assert(p1 <> nPl);2694 if (p1 <> p) and (RW[p].Treaty[p1] < trAlliance) then2694 Assert(p1 <> nPl); 2695 if (p1 <> P) and (RW[P].Treaty[p1] < trAlliance) then 2695 2696 begin 2696 2697 Tile1^ := Tile1^ or fInEnemyZoC; 2697 Break 2698 Break; 2698 2699 end; 2699 2700 end; … … 2703 2704 end; 2704 2705 2705 procedure RecalcMapZoC( p: integer);2706 procedure RecalcMapZoC(P: Integer); 2706 2707 // recalculate fInEnemyZoC flags for the whole map 2707 2708 var 2708 Loc, Loc1, V8, p1, ObserveMask: integer;2709 Loc, Loc1, V8, p1, ObserveMask: Integer; 2709 2710 Adjacent: TVicinity8Loc; 2710 2711 begin 2711 2712 if Mode = moLoading_Fast then 2712 exit;2713 MaskD(RW[ p].Map^, MapSize, Cardinal(not Cardinal(fInEnemyZoC)));2714 ObserveMask := 3 shl (2 * p);2713 Exit; 2714 MaskD(RW[P].Map^, MapSize, Cardinal(not Cardinal(fInEnemyZoC))); 2715 ObserveMask := 3 shl (2 * P); 2715 2716 for Loc := 0 to MapSize - 1 do 2716 2717 if (ZoCMap[Loc] > 0) and (ObserveLevel[Loc] and ObserveMask <> 0) then 2717 2718 begin 2718 2719 p1 := Occupant[Loc]; 2719 assert(p1 <> nPl);2720 if (p1 <> p) and (RW[p].Treaty[p1] < trAlliance) then2720 Assert(p1 <> nPl); 2721 if (p1 <> P) and (RW[P].Treaty[p1] < trAlliance) then 2721 2722 begin // this non-allied enemy ZoC unit is known to this player -- set flags! 2722 2723 V8_to_Loc(Loc, Adjacent); … … 2725 2726 Loc1 := Adjacent[V8]; 2726 2727 if (Loc1 >= 0) and (Loc1 < MapSize) then 2727 RW[ p].Map[Loc1] := RW[p].Map[Loc1] or fInEnemyZoC2728 end; 2729 end; 2730 end; 2731 end; 2732 2733 procedure RecalcPeaceMap( p: integer);2728 RW[P].Map[Loc1] := RW[P].Map[Loc1] or fInEnemyZoC; 2729 end; 2730 end; 2731 end; 2732 end; 2733 2734 procedure RecalcPeaceMap(P: Integer); 2734 2735 // recalculate fPeace flags for the whole map 2735 2736 var 2736 Loc, p1: integer;2737 PeacePlayer: array [-1 .. nPl - 1] of boolean;2737 Loc, p1: Integer; 2738 PeacePlayer: array [-1 .. nPl - 1] of Boolean; 2738 2739 begin 2739 2740 if Mode <> moPlaying then 2740 exit;2741 MaskD(RW[ p].Map^, MapSize, Cardinal(not Cardinal(fPeace)));2741 Exit; 2742 MaskD(RW[P].Map^, MapSize, Cardinal(not Cardinal(fPeace))); 2742 2743 for p1 := -1 to nPl - 1 do 2743 PeacePlayer[p1] := (p1 >= 0) and (p1 <> p) and (1 shl p1 and GAlive <> 0)2744 and (RW[ p].Treaty[p1] in [trPeace, TrFriendlyContact]);2744 PeacePlayer[p1] := (p1 >= 0) and (p1 <> P) and (1 shl p1 and GAlive <> 0) 2745 and (RW[P].Treaty[p1] in [trPeace, TrFriendlyContact]); 2745 2746 for Loc := 0 to MapSize - 1 do 2746 if PeacePlayer[RW[ p].Territory[Loc]] then2747 RW[ p].Map[Loc] := RW[p].Map[Loc] or fPeace;2747 if PeacePlayer[RW[P].Territory[Loc]] then 2748 RW[P].Map[Loc] := RW[P].Map[Loc] or fPeace; 2748 2749 end; 2749 2750 … … 2755 2756 BorderChanges: array [0 .. sIntExpandTerritory and $F - 1] of Cardinal; 2756 2757 2757 procedure ChangeTerritory(Loc, p: integer);2758 var 2759 p1: integer;2760 begin 2761 Assert( p>= 0); // no player's territory indicated by p=nPl2758 procedure ChangeTerritory(Loc, P: Integer); 2759 var 2760 p1: Integer; 2761 begin 2762 Assert(P >= 0); // no player's territory indicated by p=nPl 2762 2763 Dec(TerritoryCount[RealMap[Loc] shr 27]); 2763 Inc(TerritoryCount[ p]);2764 RealMap[Loc] := RealMap[Loc] and not($F shl 27) or Cardinal( p) shl 27;2765 if p= $F then2766 p:= -1;2764 Inc(TerritoryCount[P]); 2765 RealMap[Loc] := RealMap[Loc] and not($F shl 27) or Cardinal(P) shl 27; 2766 if P = $F then 2767 P := -1; 2767 2768 for p1 := 0 to nPl - 1 do 2768 2769 if 1 shl p1 and (GAlive or GWatching) <> 0 then 2769 2770 if RW[p1].Map[Loc] and fTerrain <> fUNKNOWN then 2770 2771 begin 2771 RW[p1].Territory[Loc] := p;2772 if ( p < nPl) and (p <> p1) and (1 shl pand GAlive <> 0) and2773 (RW[p1].Treaty[ p] in [trPeace, TrFriendlyContact]) then2772 RW[p1].Territory[Loc] := P; 2773 if (P < nPl) and (P <> p1) and (1 shl P and GAlive <> 0) and 2774 (RW[p1].Treaty[P] in [trPeace, TrFriendlyContact]) then 2774 2775 RW[p1].Map[Loc] := RW[p1].Map[Loc] or fPeace 2775 2776 else … … 2778 2779 end; 2779 2780 2780 procedure ExpandTerritory(OriginLoc: integer);2781 var 2782 i, dx, dy, dxMax, dyMax, Loc, NewOwner: integer;2781 procedure ExpandTerritory(OriginLoc: Integer); 2782 var 2783 I, dx, dy, dxMax, dyMax, Loc, NewOwner: Integer; 2783 2784 begin 2784 2785 if OriginLoc = -1 then 2785 2786 raise Exception.Create('Location error'); 2786 i:= 0;2787 I := 0; 2787 2788 dyMax := 0; 2788 2789 while (dyMax + 1) + (dyMax + 1) shr 1 <= CountryRadius do 2789 inc(dyMax);2790 Inc(dyMax); 2790 2791 for dy := -dyMax to dyMax do 2791 2792 begin … … 2793 2794 while abs(dy) + (dxMax + 2) + abs(abs(dy) - (dxMax + 2)) shr 1 <= 2794 2795 CountryRadius do 2795 inc(dxMax, 2);2796 Inc(dxMax, 2); 2796 2797 for dx := -dxMax to dxMax do 2797 2798 if (dy + dx) and 1 = 0 then 2798 2799 begin 2799 NewOwner := BorderChanges[ i div 8] shr (imod 8 * 4) and $F;2800 NewOwner := BorderChanges[I div 8] shr (I mod 8 * 4) and $F; 2800 2801 Loc := dLoc(OriginLoc, dx, dy); 2801 2802 if (Loc >= 0) and (Cardinal(NewOwner) <> RealMap[Loc] shr 27) then 2802 2803 ChangeTerritory(Loc, NewOwner); 2803 inc(i);2804 end; 2805 end; 2806 end; 2807 2808 procedure CheckBorders(OriginLoc, PlayerLosingCity: integer);2804 Inc(I); 2805 end; 2806 end; 2807 end; 2808 2809 procedure CheckBorders(OriginLoc, PlayerLosingCity: Integer); 2809 2810 // OriginLoc: only changes in CountryRadius around this location possible, 2810 2811 // -1 for complete map, -2 for double-check (no more changes allowed) … … 2812 2813 // player's territory, -1 for full border recalculation 2813 2814 var 2814 i, r, Loc, Loc1, dx, dy, p1, p2, cix, NewDist, dxMax, dyMax, OldOwner, V8: Integer;2815 I, R, Loc, Loc1, dx, dy, p1, p2, cix, NewDist, dxMax, dyMax, OldOwner, V8: Integer; 2815 2816 NewOwner: Cardinal; 2816 2817 Adjacent: TVicinity8Loc; 2817 AtPeace: array [0 .. nPl, 0 .. nPl] of boolean;2818 AtPeace: array [0 .. nPl, 0 .. nPl] of Boolean; 2818 2819 Country, FormerCountry, { to who's country a tile belongs } 2819 2820 Dist, FormerDist, StolenDist: array [0 .. lxmax * lymax - 1] of ShortInt; … … 2827 2828 StolenDist[RW[PlayerLosingCity].City[cix].Loc] := 0; 2828 2829 2829 for r:= 1 to CountryRadius shr 1 do2830 begin 2831 move(StolenDist, FormerDist, MapSize);2830 for R := 1 to CountryRadius shr 1 do 2831 begin 2832 Move(StolenDist, FormerDist, MapSize); 2832 2833 for Loc := 0 to MapSize - 1 do 2833 2834 if (FormerDist[Loc] <= CountryRadius - 2) … … 2861 2862 end; 2862 2863 2863 for r:= 1 to CountryRadius shr 1 do2864 begin 2865 move(Country, FormerCountry, MapSize);2866 move(Dist, FormerDist, MapSize);2864 for R := 1 to CountryRadius shr 1 do 2865 begin 2866 Move(Country, FormerCountry, MapSize); 2867 Move(Dist, FormerDist, MapSize); 2867 2868 for Loc := 0 to MapSize - 1 do 2868 2869 if (FormerDist[Loc] <= CountryRadius - 2) // use same conditions as above! … … 2870 2871 (1 shl fShore + 1 shl fMountains + 1 shl fArctic) = 0) then 2871 2872 begin 2872 assert(FormerCountry[Loc] >= 0);2873 Assert(FormerCountry[Loc] >= 0); 2873 2874 V8_to_Loc(Loc, Adjacent); 2874 2875 for V8 := 0 to 7 do … … 2885 2886 end; 2886 2887 2887 FillChar(AtPeace, SizeOf(AtPeace), false);2888 FillChar(AtPeace, SizeOf(AtPeace), False); 2888 2889 for p1 := 0 to nPl - 1 do 2889 2890 if 1 shl p1 and GAlive <> 0 then … … 2891 2892 if (p2 <> p1) and (1 shl p2 and GAlive <> 0) and 2892 2893 (RW[p1].Treaty[p2] >= trPeace) then 2893 AtPeace[p1, p2] := true;2894 AtPeace[p1, p2] := True; 2894 2895 2895 2896 if OriginLoc >= 0 then 2896 2897 begin // update area only 2897 i:= 0;2898 I := 0; 2898 2899 FillChar(BorderChanges, SizeOf(BorderChanges), 0); 2899 2900 dyMax := 0; 2900 2901 while (dyMax + 1) + (dyMax + 1) shr 1 <= CountryRadius do 2901 inc(dyMax);2902 Inc(dyMax); 2902 2903 for dy := -dyMax to dyMax do 2903 2904 begin … … 2905 2906 while abs(dy) + (dxMax + 2) + abs(abs(dy) - (dxMax + 2)) shr 1 <= 2906 2907 CountryRadius do 2907 inc(dxMax, 2);2908 Inc(dxMax, 2); 2908 2909 for dx := -dxMax to dxMax do 2909 2910 if (dy + dx) and 1 = 0 then … … 2921 2922 else 2922 2923 ChangeTerritory(Loc, NewOwner); 2923 BorderChanges[ i shr 3] := BorderChanges[ishr 3] or2924 ((NewOwner shl (( iand 7) * 4)) and $ffffffff);2924 BorderChanges[I shr 3] := BorderChanges[I shr 3] or 2925 ((NewOwner shl ((I and 7) * 4)) and $ffffffff); 2925 2926 end; 2926 inc(i);2927 Inc(I); 2927 2928 end; 2928 2929 end; … … 2937 2938 then 2938 2939 begin 2939 assert(OriginLoc <> -2); // test if border saving works2940 Assert(OriginLoc <> -2); // test if border saving works 2940 2941 ChangeTerritory(Loc, NewOwner); 2941 2942 end; … … 2944 2945 {$IFOPT O-} if OriginLoc <> -2 then 2945 2946 CheckBorders(-2); {$ENDIF} // check: single pass should do! 2946 end; // CheckBorders2947 2948 procedure LogCheckBorders( p, cix, PlayerLosingCity: integer);2949 begin 2950 CheckBorders(RW[ p].City[cix].Loc, PlayerLosingCity);2951 IntServer(sIntExpandTerritory, p, cix, BorderChanges);2947 end; 2948 2949 procedure LogCheckBorders(P, cix, PlayerLosingCity: Integer); 2950 begin 2951 CheckBorders(RW[P].City[cix].Loc, PlayerLosingCity); 2952 IntServer(sIntExpandTerritory, P, cix, BorderChanges); 2952 2953 end; 2953 2954 … … 2957 2958 } 2958 2959 2959 procedure CreateUnit( p, mix: integer);2960 begin 2961 with RW[ p] do2960 procedure CreateUnit(P, mix: Integer); 2961 begin 2962 with RW[P] do 2962 2963 begin 2963 2964 Un[nUn].mix := mix; 2964 2965 with Un[nUn] do 2965 2966 begin 2966 ID := UnBuilt[ p];2967 inc(UnBuilt[p]);2967 ID := UnBuilt[P]; 2968 Inc(UnBuilt[P]); 2968 2969 Status := 0; 2969 2970 SavedStatus := 0; 2970 inc(Model[mix].Built);2971 Inc(Model[mix].Built); 2971 2972 Home := -1; 2972 2973 Health := 100; … … 2976 2977 begin 2977 2978 Fuel := Model[mix].Cap[mcFuel]; 2978 Flags := Flags or unBombsLoaded 2979 Flags := Flags or unBombsLoaded; 2979 2980 end; 2980 2981 Job := jNone; … … 2984 2985 Master := -1; 2985 2986 end; 2986 inc(nUn);2987 Inc(nUn); 2987 2988 end 2988 2989 end; 2989 2990 2990 procedure FreeUnit( p, uix: integer);2991 procedure FreeUnit(P, uix: Integer); 2991 2992 // loc or master should be set after call 2992 2993 // implementation is critical for loading performance, change carefully 2993 2994 var 2994 Loc0, uix1: integer;2995 Occ, ZoC: boolean;2996 begin 2997 with RW[ p].Un[uix] do2995 Loc0, uix1: Integer; 2996 Occ, ZoC: Boolean; 2997 begin 2998 with RW[P].Un[uix] do 2998 2999 begin 2999 3000 Job := jNone; 3000 3001 Flags := Flags and not(unFortified or unMountainDelay); 3001 Loc0 := Loc 3002 Loc0 := Loc; 3002 3003 end; 3003 3004 if Occupant[Loc0] >= 0 then 3004 3005 begin 3005 assert(Occupant[Loc0] = p);3006 Occ := false;3007 ZoC := false;3008 for uix1 := 0 to RW[ p].nUn - 1 do3009 with RW[ p].Un[uix1] do3006 Assert(Occupant[Loc0] = P); 3007 Occ := False; 3008 ZoC := False; 3009 for uix1 := 0 to RW[P].nUn - 1 do 3010 with RW[P].Un[uix1] do 3010 3011 if (Loc = Loc0) and (Master < 0) and (uix1 <> uix) then 3011 3012 begin 3012 Occ := true;3013 if RW[ p].Model[mix].Flags and mdZOC <> 0 then3013 Occ := True; 3014 if RW[P].Model[mix].Flags and mdZOC <> 0 then 3014 3015 begin 3015 ZoC := true;3016 Break 3017 end 3016 ZoC := True; 3017 Break; 3018 end; 3018 3019 end; 3019 3020 if not Occ then … … 3024 3025 end; 3025 3026 3026 procedure PlaceUnit( p, uix: integer);3027 begin 3028 with RW[ p].Un[uix] do3029 begin 3030 Occupant[Loc] := p;3031 if RW[ p].Model[mix].Flags and mdZOC <> 0 then3027 procedure PlaceUnit(P, uix: Integer); 3028 begin 3029 with RW[P].Un[uix] do 3030 begin 3031 Occupant[Loc] := P; 3032 if RW[P].Model[mix].Flags and mdZOC <> 0 then 3032 3033 ZoCMap[Loc] := 1; 3033 3034 end; 3034 3035 end; 3035 3036 3036 procedure CountLost( p, mix, Enemy: integer);3037 begin 3038 Inc(RW[ p].Model[mix].Lost);3039 TellAboutModel(Enemy, p, mix);3040 Inc(Destroyed[Enemy, p, mix]);3041 end; 3042 3043 procedure RemoveUnit( p, uix: integer; Enemy: integer = -1);3037 procedure CountLost(P, mix, Enemy: Integer); 3038 begin 3039 Inc(RW[P].Model[mix].Lost); 3040 TellAboutModel(Enemy, P, mix); 3041 Inc(Destroyed[Enemy, P, mix]); 3042 end; 3043 3044 procedure RemoveUnit(P, uix: Integer; Enemy: Integer = -1); 3044 3045 // use enemy only from inside sMoveUnit if attack 3045 3046 var 3046 uix1: integer;3047 begin 3048 with RW[ p].Un[uix] do3049 begin 3050 assert((Loc >= 0) or (RW[p].Model[mix].Kind = mkDiplomat));3047 uix1: Integer; 3048 begin 3049 with RW[P].Un[uix] do 3050 begin 3051 Assert((Loc >= 0) or (RW[P].Model[mix].Kind = mkDiplomat)); 3051 3052 // already freed when spy mission 3052 3053 if Loc >= 0 then 3053 FreeUnit( p, uix);3054 FreeUnit(P, uix); 3054 3055 if Master >= 0 then 3055 if RW[ p].Model[mix].Domain = dAir then3056 dec(RW[p].Un[Master].AirLoad)3056 if RW[P].Model[mix].Domain = dAir then 3057 Dec(RW[P].Un[Master].AirLoad) 3057 3058 else 3058 dec(RW[p].Un[Master].TroopLoad);3059 Dec(RW[P].Un[Master].TroopLoad); 3059 3060 if (TroopLoad > 0) or (AirLoad > 0) then 3060 for uix1 := 0 to RW[ p].nUn - 1 do3061 if (RW[ p].Un[uix1].Loc >= 0) and (RW[p].Un[uix1].Master = uix) then3061 for uix1 := 0 to RW[P].nUn - 1 do 3062 if (RW[P].Un[uix1].Loc >= 0) and (RW[P].Un[uix1].Master = uix) then 3062 3063 { unit mastered by removed unit -- remove too } 3063 3064 begin 3064 RW[ p].Un[uix1].Loc := -1;3065 RW[P].Un[uix1].Loc := -1; 3065 3066 if Enemy >= 0 then 3066 CountLost( p, RW[p].Un[uix1].mix, Enemy);3067 CountLost(P, RW[P].Un[uix1].mix, Enemy); 3067 3068 end; 3068 3069 Loc := -1; 3069 3070 if Enemy >= 0 then 3070 CountLost( p, mix, Enemy);3071 end; 3072 end; 3073 3074 procedure RemoveUnit_UpdateMap( p, uix: integer);3071 CountLost(P, mix, Enemy); 3072 end; 3073 end; 3074 3075 procedure RemoveUnit_UpdateMap(P, uix: Integer); 3075 3076 var 3076 3077 Loc0: Integer; 3077 3078 begin 3078 Loc0 := RW[ p].Un[uix].Loc;3079 RemoveUnit( p, uix);3079 Loc0 := RW[P].Un[uix].Loc; 3080 RemoveUnit(P, uix); 3080 3081 if Mode > moLoading_Fast then 3081 3082 UpdateUnitMap(Loc0); 3082 3083 end; 3083 3084 3084 procedure RemoveAllUnits( p, Loc: integer; Enemy: integer = -1);3085 var 3086 uix: integer;3087 begin 3088 for uix := 0 to RW[ p].nUn - 1 do3089 if RW[ p].Un[uix].Loc = Loc then3085 procedure RemoveAllUnits(P, Loc: Integer; Enemy: Integer = -1); 3086 var 3087 uix: Integer; 3088 begin 3089 for uix := 0 to RW[P].nUn - 1 do 3090 if RW[P].Un[uix].Loc = Loc then 3090 3091 begin 3091 3092 if Enemy >= 0 then 3092 CountLost( p, RW[p].Un[uix].mix, Enemy);3093 RW[ p].Un[uix].Loc := -13093 CountLost(P, RW[P].Un[uix].mix, Enemy); 3094 RW[P].Un[uix].Loc := -1; 3094 3095 end; 3095 3096 Occupant[Loc] := -1; … … 3097 3098 end; 3098 3099 3099 procedure RemoveDomainUnits( d, p, Loc: integer);3100 var 3101 uix: integer;3102 begin 3103 for uix := 0 to RW[ p].nUn - 1 do3104 if (RW[ p].Model[RW[p].Un[uix].mix].Domain = d) and (RW[p].Un[uix].Loc = Loc)3100 procedure RemoveDomainUnits(D, P, Loc: Integer); 3101 var 3102 uix: Integer; 3103 begin 3104 for uix := 0 to RW[P].nUn - 1 do 3105 if (RW[P].Model[RW[P].Un[uix].mix].Domain = D) and (RW[P].Un[uix].Loc = Loc) 3105 3106 then 3106 RemoveUnit( p, uix);3107 end; 3108 3109 procedure FoundCity( p, FoundLoc: integer);3110 var 3111 p1, cix1, V21, dx, dy: integer;3112 begin 3113 if RW[ p].nCity = ncmax then3114 exit;3115 inc(RW[p].nCity);3116 with RW[ p].City[RW[p].nCity - 1] do3107 RemoveUnit(P, uix); 3108 end; 3109 3110 procedure FoundCity(P, FoundLoc: Integer); 3111 var 3112 p1, cix1, V21, dx, dy: Integer; 3113 begin 3114 if RW[P].nCity = ncmax then 3115 Exit; 3116 Inc(RW[P].nCity); 3117 with RW[P].City[RW[P].nCity - 1] do 3117 3118 begin 3118 3119 Size := 2; … … 3130 3131 if UsedByCity[FoundLoc] >= 0 then 3131 3132 begin { central tile is exploited - toggle in exploiting city } 3132 p1 := p;3133 p1 := P; 3133 3134 SearchCity(UsedByCity[FoundLoc], p1, cix1); 3134 3135 dxdy(UsedByCity[FoundLoc], FoundLoc, dx, dy); … … 3141 3142 (fTerrain or fSpecial or fRiver or nPl shl 27) or fCity; 3142 3143 3143 ChangeTerritory(Loc, p)3144 end; 3145 end; 3146 3147 procedure StealCity( p, cix: integer; SaveUnits: boolean);3148 var 3149 i, j, uix1, cix1, nearest: integer;3150 begin 3151 for i:= 0 to nWonder - 1 do3152 if RW[ p].City[cix].Built[i] = 1 then3153 begin 3154 GWonder[ i].EffectiveOwner := -1;3155 if i= woPyramids then3144 ChangeTerritory(Loc, P); 3145 end; 3146 end; 3147 3148 procedure StealCity(P, cix: Integer; SaveUnits: Boolean); 3149 var 3150 I, J, uix1, cix1, nearest: Integer; 3151 begin 3152 for I := 0 to nWonder - 1 do 3153 if RW[P].City[cix].Built[I] = 1 then 3154 begin 3155 GWonder[I].EffectiveOwner := -1; 3156 if I = woPyramids then 3156 3157 FreeSlaves; 3157 if i= woEiffel then // deactivate expired wonders3158 for j:= 0 to nWonder - 1 do3159 if GWonder[ j].EffectiveOwner = pthen3160 CheckExpiration( j);3161 end; 3162 for i:= nWonder to nImp - 1 do3163 if (Imp[ i].Kind <> ikCommon) and (RW[p].City[cix].Built[i] > 0) then3158 if I = woEiffel then // deactivate expired wonders 3159 for J := 0 to nWonder - 1 do 3160 if GWonder[J].EffectiveOwner = P then 3161 CheckExpiration(J); 3162 end; 3163 for I := nWonder to nImp - 1 do 3164 if (Imp[I].Kind <> ikCommon) and (RW[P].City[cix].Built[I] > 0) then 3164 3165 begin { destroy national projects } 3165 RW[ p].NatBuilt[i] := 0;3166 if i= imGrWall then3167 GrWallContinent[ p] := -1;3168 end; 3169 3170 for uix1 := 0 to RW[ p].nUn - 1 do3171 with RW[ p].Un[uix1] do3166 RW[P].NatBuilt[I] := 0; 3167 if I = imGrWall then 3168 GrWallContinent[P] := -1; 3169 end; 3170 3171 for uix1 := 0 to RW[P].nUn - 1 do 3172 with RW[P].Un[uix1] do 3172 3173 if (Loc >= 0) and (Home = cix) then 3173 3174 if SaveUnits then 3174 3175 begin // support units by nearest other city 3175 3176 nearest := -1; 3176 for cix1 := 0 to RW[ p].nCity - 1 do3177 if (cix1 <> cix) and (RW[ p].City[cix1].Loc >= 0) and3178 ((nearest < 0) or (Distance(RW[ p].City[cix1].Loc, Loc) <3179 Distance(RW[ p].City[nearest].Loc, Loc))) then3177 for cix1 := 0 to RW[P].nCity - 1 do 3178 if (cix1 <> cix) and (RW[P].City[cix1].Loc >= 0) and 3179 ((nearest < 0) or (Distance(RW[P].City[cix1].Loc, Loc) < 3180 Distance(RW[P].City[nearest].Loc, Loc))) then 3180 3181 nearest := cix1; 3181 Home := nearest 3182 Home := nearest; 3182 3183 end 3183 3184 else 3184 RemoveUnit( p, uix1); // destroy supported units3185 end; 3186 3187 procedure DestroyCity( p, cix: integer; SaveUnits: boolean);3188 var 3189 i, V21: integer;3185 RemoveUnit(P, uix1); // destroy supported units 3186 end; 3187 3188 procedure DestroyCity(P, cix: Integer; SaveUnits: Boolean); 3189 var 3190 I, V21: Integer; 3190 3191 Radius: TVicinity21Loc; 3191 3192 begin 3192 StealCity( p, cix, SaveUnits);3193 with RW[ p].City[cix] do begin3194 for i:= 0 to nWonder - 1 do3195 if Built[ i] > 0 then3196 GWonder[ i].CityID := WonderDestroyed;3193 StealCity(P, cix, SaveUnits); 3194 with RW[P].City[cix] do begin 3195 for I := 0 to nWonder - 1 do 3196 if Built[I] > 0 then 3197 GWonder[I].CityID := WonderDestroyed; 3197 3198 V21_to_Loc(Loc, Radius); 3198 3199 for V21 := 1 to 26 do … … 3200 3201 UsedByCity[Radius[V21]] := -1; 3201 3202 RealMap[Loc] := RealMap[Loc] and not fCity; 3202 Loc := -1 3203 end; 3204 end; 3205 3206 procedure ChangeCityOwner(pOld, cixOld, pNew: integer);3207 var 3208 i, j, cix1, Loc1, V21: integer;3203 Loc := -1; 3204 end; 3205 end; 3206 3207 procedure ChangeCityOwner(pOld, cixOld, pNew: Integer); 3208 var 3209 I, J, cix1, Loc1, V21: Integer; 3209 3210 Radius: TVicinity21Loc; 3210 3211 begin 3211 inc(RW[pNew].nCity);3212 Inc(RW[pNew].nCity); 3212 3213 RW[pNew].City[RW[pNew].nCity - 1] := RW[pOld].City[cixOld]; 3213 StealCity(pOld, cixOld, false);3214 StealCity(pOld, cixOld, False); 3214 3215 RW[pOld].City[cixOld].Loc := -1; 3215 3216 with RW[pNew].City[(RW[pNew].nCity - 1)] do … … 3230 3231 begin 3231 3232 Loc1 := Radius[V21]; 3232 assert((Loc1 >= 0) and (Loc1 < MapSize) and (UsedByCity[Loc1] = Loc));3233 Assert((Loc1 >= 0) and (Loc1 < MapSize) and (UsedByCity[Loc1] = Loc)); 3233 3234 if (ZoCMap[Loc1] > 0) and (Occupant[Loc1] <> pNew) and 3234 3235 (RW[pNew].Treaty[Occupant[Loc1]] < trAlliance) then … … 3242 3243 Built[imTownHall] := 0; 3243 3244 Built[imCourt] := 0; 3244 for i:= nWonder to nImp - 1 do3245 if Imp[ i].Kind <> ikCommon then3246 Built[ i] := 0; { destroy national projects }3247 for i:= 0 to nWonder - 1 do3248 if Built[ i] = 1 then3245 for I := nWonder to nImp - 1 do 3246 if Imp[I].Kind <> ikCommon then 3247 Built[I] := 0; { destroy national projects } 3248 for I := 0 to nWonder - 1 do 3249 if Built[I] = 1 then 3249 3250 begin // new wonder owner! 3250 GWonder[ i].EffectiveOwner := pNew;3251 if i= woEiffel then // reactivate expired wonders3252 begin 3253 for j:= 0 to nWonder - 1 do3254 if Imp[ j].Expiration >= 0 then3251 GWonder[I].EffectiveOwner := pNew; 3252 if I = woEiffel then // reactivate expired wonders 3253 begin 3254 for J := 0 to nWonder - 1 do 3255 if Imp[J].Expiration >= 0 then 3255 3256 for cix1 := 0 to (RW[pNew].nCity - 1) do 3256 if RW[pNew].City[cix1].Built[ j] = 1 then3257 GWonder[ j].EffectiveOwner := pNew;3257 if RW[pNew].City[cix1].Built[J] = 1 then 3258 GWonder[J].EffectiveOwner := pNew; 3258 3259 end 3259 3260 else 3260 CheckExpiration( i);3261 case iof3261 CheckExpiration(I); 3262 case I of 3262 3263 woLighthouse: 3263 3264 CheckSpecialModels(pNew, preLighthouse); … … 3273 3274 cix1 := RW[pNew].nEnemyCity - 1; 3274 3275 while (cix1 >= 0) and (RW[pNew].EnemyCity[cix1].Loc <> Loc) do 3275 dec(cix1);3276 assert(cix1 >= 0);3276 Dec(cix1); 3277 Assert(cix1 >= 0); 3277 3278 RW[pNew].EnemyCity[cix1].Loc := -1; 3278 3279 … … 3281 3282 end; 3282 3283 3283 procedure CompleteJob( p, Loc, Job: integer);3284 var 3285 ChangedTerrain, p1: integer;3286 begin 3287 assert(Job <> jCity);3284 procedure CompleteJob(P, Loc, Job: Integer); 3285 var 3286 ChangedTerrain, p1: Integer; 3287 begin 3288 Assert(Job <> jCity); 3288 3289 ChangedTerrain := -1; 3289 3290 case Job of … … 3327 3328 if not(RealMap[Loc] and fTerrain in TerrType_Canalable) then 3328 3329 begin 3329 RemoveDomainUnits(dSea, p, Loc);3330 RemoveDomainUnits(dSea, P, Loc); 3330 3331 RealMap[Loc] := RealMap[Loc] and not fCanal; 3331 3332 end; … … 3339 3340 begin 3340 3341 if RealMap[Loc] and fTerImp = tiBase then 3341 RemoveDomainUnits(dAir, p, Loc);3342 RemoveDomainUnits(dAir, P, Loc); 3342 3343 RealMap[Loc] := RealMap[Loc] and not fTerImp 3343 3344 end 3344 3345 else if RealMap[Loc] and fCanal <> 0 then 3345 3346 begin 3346 RemoveDomainUnits(dSea, p, Loc);3347 RemoveDomainUnits(dSea, P, Loc); 3347 3348 RealMap[Loc] := RealMap[Loc] and not fCanal 3348 3349 end … … 3374 3375 fPoll) or RealMap[Loc] and (fTerrain or fSpecial or fTerImp or 3375 3376 fRoad or fRR or fCanal or fPoll); 3376 end; // CompleteJob3377 end; 3377 3378 3378 3379 { … … 3380 3381 ____________________________________________________________________ 3381 3382 } 3382 procedure GiveCivilReport( p, pAbout: integer);3383 begin 3384 with RW[ p].EnemyReport[pAbout]^ do3383 procedure GiveCivilReport(P, pAbout: Integer); 3384 begin 3385 with RW[P].EnemyReport[pAbout]^ do 3385 3386 begin 3386 3387 // general info 3387 3388 TurnOfCivilReport := LastValidStat[pAbout]; 3388 move(RW[pAbout].Treaty, Treaty, SizeOf(Treaty));3389 Move(RW[pAbout].Treaty, Treaty, SizeOf(Treaty)); 3389 3390 Government := RW[pAbout].Government; 3390 3391 Money := RW[pAbout].Money; … … 3395 3396 if ResearchDone > 100 then 3396 3397 ResearchDone := 100; 3397 move(RW[pAbout].Tech, Tech, nAdv);3398 end; 3399 end; 3400 3401 procedure GiveMilReport( p, pAbout: integer);3402 var 3403 uix, mix: integer;3404 begin 3405 with RW[ p].EnemyReport[pAbout]^ do3398 Move(RW[pAbout].Tech, Tech, nAdv); 3399 end; 3400 end; 3401 3402 procedure GiveMilReport(P, pAbout: Integer); 3403 var 3404 uix, mix: Integer; 3405 begin 3406 with RW[P].EnemyReport[pAbout]^ do 3406 3407 begin 3407 3408 TurnOfMilReport := LastValidStat[pAbout]; … … 3409 3410 for mix := 0 to RW[pAbout].nModel - 1 do 3410 3411 begin 3411 TellAboutModel( p, pAbout, mix);3412 TellAboutModel(P, pAbout, mix); 3412 3413 UnCount[mix] := 0 3413 3414 end; 3414 3415 for uix := 0 to RW[pAbout].nUn - 1 do 3415 3416 if RW[pAbout].Un[uix].Loc >= 0 then 3416 inc(UnCount[RW[pAbout].Un[uix].mix]);3417 end; 3418 end; 3419 3420 procedure ShowPrice(pSender, pTarget, Price: integer);3417 Inc(UnCount[RW[pAbout].Un[uix].mix]); 3418 end; 3419 end; 3420 3421 procedure ShowPrice(pSender, pTarget, Price: Integer); 3421 3422 begin 3422 3423 case Price and opMask of … … 3433 3434 end; 3434 3435 3435 function CopyCivilReport(pSender, pTarget, pAbout: integer): boolean;3436 var 3437 i: integer;3436 function CopyCivilReport(pSender, pTarget, pAbout: Integer): Boolean; 3437 var 3438 I: Integer; 3438 3439 rSender, rTarget: ^TEnemyReport; 3439 3440 begin // copy third nation civil report 3440 result := false;3441 Result := False; 3441 3442 if RW[pTarget].Treaty[pAbout] = trNoContact then 3442 3443 IntroduceEnemy(pTarget, pAbout); 3443 rSender := pointer(RW[pSender].EnemyReport[pAbout]);3444 rTarget := pointer(RW[pTarget].EnemyReport[pAbout]);3444 rSender := Pointer(RW[pSender].EnemyReport[pAbout]); 3445 rTarget := Pointer(RW[pTarget].EnemyReport[pAbout]); 3445 3446 if rSender.TurnOfCivilReport > rTarget.TurnOfCivilReport then 3446 3447 begin // only if newer than current information … … 3451 3452 rTarget.ResearchTech := rSender.ResearchTech; 3452 3453 rTarget.ResearchDone := rSender.ResearchDone; 3453 result := true;3454 end; 3455 for i:= 0 to nAdv - 1 do3456 if rTarget.Tech[ i] < rSender.Tech[i] then3457 begin 3458 rTarget.Tech[ i] := rSender.Tech[i];3459 result := true;3460 end; 3461 end; 3462 3463 function CopyMilReport(pSender, pTarget, pAbout: integer): boolean;3464 var 3465 mix: integer;3454 Result := True; 3455 end; 3456 for I := 0 to nAdv - 1 do 3457 if rTarget.Tech[I] < rSender.Tech[I] then 3458 begin 3459 rTarget.Tech[I] := rSender.Tech[I]; 3460 Result := True; 3461 end; 3462 end; 3463 3464 function CopyMilReport(pSender, pTarget, pAbout: Integer): Boolean; 3465 var 3466 mix: Integer; 3466 3467 rSender, rTarget: ^TEnemyReport; 3467 3468 begin // copy third nation military report 3468 result := false;3469 Result := False; 3469 3470 if RW[pTarget].Treaty[pAbout] = trNoContact then 3470 3471 IntroduceEnemy(pTarget, pAbout); 3471 rSender := pointer(RW[pSender].EnemyReport[pAbout]);3472 rTarget := pointer(RW[pTarget].EnemyReport[pAbout]);3472 rSender := Pointer(RW[pSender].EnemyReport[pAbout]); 3473 rTarget := Pointer(RW[pTarget].EnemyReport[pAbout]); 3473 3474 if rSender.TurnOfMilReport > rTarget.TurnOfMilReport then 3474 3475 begin // only if newer than current information 3475 3476 rTarget.TurnOfMilReport := rSender.TurnOfMilReport; 3476 3477 rTarget.nModelCounted := rSender.nModelCounted; 3477 move(rSender.UnCount, rTarget.UnCount, 2 * rSender.nModelCounted);3478 Move(rSender.UnCount, rTarget.UnCount, 2 * rSender.nModelCounted); 3478 3479 for mix := 0 to rTarget.nModelCounted - 1 do 3479 3480 TellAboutModel(pTarget, pAbout, mix); 3480 result := true;3481 end; 3482 end; 3483 3484 procedure CopyModel(pSender, pTarget, mix: integer);3485 var 3486 i: integer;3481 Result := True; 3482 end; 3483 end; 3484 3485 procedure CopyModel(pSender, pTarget, mix: Integer); 3486 var 3487 I: Integer; 3487 3488 miSender, miTarget: TModelInfo; 3488 ok: boolean;3489 ok: Boolean; 3489 3490 begin 3490 3491 // only if target doesn't already have a model like this 3491 3492 ok := RW[pTarget].nModel < nmmax; 3492 3493 MakeModelInfo(pSender, mix, RW[pSender].Model[mix], miSender); 3493 for i:= 0 to RW[pTarget].nModel - 1 do3494 begin 3495 MakeModelInfo(pTarget, i, RW[pTarget].Model[i], miTarget);3494 for I := 0 to RW[pTarget].nModel - 1 do 3495 begin 3496 MakeModelInfo(pTarget, I, RW[pTarget].Model[I], miTarget); 3496 3497 if IsSameModel(miSender, miTarget) then 3497 ok := false;3498 ok := False; 3498 3499 end; 3499 3500 if ok then … … 3510 3511 Lost := 0; 3511 3512 end; 3512 inc(RW[pTarget].nModel);3513 inc(Researched[pTarget]);3513 Inc(RW[pTarget].nModel); 3514 Inc(Researched[pTarget]); 3514 3515 TellAboutModel(pSender, pTarget, RW[pTarget].nModel - 1); 3515 3516 end; 3516 3517 end; 3517 3518 3518 procedure CopyMap(pSender, pTarget: integer);3519 var 3520 Loc, i, cix: integer;3519 procedure CopyMap(pSender, pTarget: Integer); 3520 var 3521 Loc, I, cix: Integer; 3521 3522 Tile: Cardinal; 3522 3523 begin … … 3528 3529 if Tile and fCity <> 0 then 3529 3530 begin 3530 i:= 0;3531 while ( i< RW[pTarget].nEnemyCity) and3532 (RW[pTarget].EnemyCity[ i].Loc <> Loc) do3533 inc(i);3534 if i= RW[pTarget].nEnemyCity then3535 begin 3536 inc(RW[pTarget].nEnemyCity);3537 assert(RW[pTarget].nEnemyCity < necmax);3538 RW[pTarget].EnemyCity[ i].Status := 0;3539 RW[pTarget].EnemyCity[ i].SavedStatus := 0;3531 I := 0; 3532 while (I < RW[pTarget].nEnemyCity) and 3533 (RW[pTarget].EnemyCity[I].Loc <> Loc) do 3534 Inc(I); 3535 if I = RW[pTarget].nEnemyCity then 3536 begin 3537 Inc(RW[pTarget].nEnemyCity); 3538 Assert(RW[pTarget].nEnemyCity < necmax); 3539 RW[pTarget].EnemyCity[I].Status := 0; 3540 RW[pTarget].EnemyCity[I].SavedStatus := 0; 3540 3541 end; 3541 3542 if Tile and fOwned <> 0 then … … 3543 3544 cix := RW[pSender].nCity - 1; 3544 3545 while (cix >= 0) and (RW[pSender].City[cix].Loc <> Loc) do 3545 dec(cix);3546 MakeCityInfo(pSender, cix, RW[pTarget].EnemyCity[ i]);3546 Dec(cix); 3547 MakeCityInfo(pSender, cix, RW[pTarget].EnemyCity[I]); 3547 3548 end 3548 3549 else // city not owned by sender -- copy old info … … 3550 3551 cix := RW[pSender].nEnemyCity - 1; 3551 3552 while (cix >= 0) and (RW[pSender].EnemyCity[cix].Loc <> Loc) do 3552 dec(cix);3553 RW[pTarget].EnemyCity[ i] := RW[pSender].EnemyCity[cix];3553 Dec(cix); 3554 RW[pTarget].EnemyCity[I] := RW[pSender].EnemyCity[cix]; 3554 3555 end; 3555 3556 end … … 3565 3566 3566 3567 if RW[pTarget].Map[Loc] and fTerrain = fUNKNOWN then 3567 inc(Discovered[pTarget]);3568 Inc(Discovered[pTarget]); 3568 3569 RW[pTarget].Map[Loc] := RW[pTarget].Map[Loc] and fInEnemyZoC 3569 3570 // always preserve this flag! … … 3581 3582 end; 3582 3583 3583 function PayPrice(pSender, pTarget, Price: integer; execute: boolean): boolean;3584 var 3585 pSubject, i, n, NewTreaty: integer;3586 begin 3587 result := true;3584 function PayPrice(pSender, pTarget, Price: Integer; execute: Boolean): Boolean; 3585 var 3586 pSubject, I, N, NewTreaty: Integer; 3587 begin 3588 Result := True; 3588 3589 case Price and opMask of 3589 3590 opCivilReport: // + turn + concerned player shl 16 … … 3591 3592 pSubject := Price shr 16 and $F; 3592 3593 if pTarget = pSubject then 3593 result := false3594 Result := False 3594 3595 else if pSender = pSubject then 3595 3596 begin 3596 3597 if execute then 3597 GiveCivilReport(pTarget, pSender) 3598 GiveCivilReport(pTarget, pSender); 3598 3599 end 3599 3600 else if RW[pSender].EnemyReport[pSubject].TurnOfCivilReport < 0 then 3600 result := false3601 Result := False 3601 3602 else if execute then 3602 3603 CopyCivilReport(pSender, pTarget, pSubject); … … 3606 3607 pSubject := Price shr 16 and $F; 3607 3608 if pTarget = pSubject then 3608 result := false3609 Result := False 3609 3610 else if pSender = pSubject then 3610 3611 begin 3611 3612 if execute then 3612 GiveMilReport(pTarget, pSender) 3613 GiveMilReport(pTarget, pSender); 3613 3614 end 3614 3615 else if RW[pSender].EnemyReport[pSubject].TurnOfMilReport < 0 then 3615 result := false3616 Result := False 3616 3617 else if execute then 3617 CopyMilReport(pSender, pTarget, pSubject) 3618 CopyMilReport(pSender, pTarget, pSubject); 3618 3619 end; 3619 3620 opMap: … … 3628 3629 begin // agreed treaty end 3629 3630 if execute then 3630 CancelTreaty(pSender, pTarget, false)3631 CancelTreaty(pSender, pTarget, False); 3631 3632 end 3632 3633 else … … 3639 3640 NewTreaty := trPeace; 3640 3641 if NewTreaty < 0 then 3641 result := false3642 Result := False 3642 3643 else if execute then 3643 3644 begin 3644 assert(NewTreaty > RW[pSender].Treaty[pTarget]);3645 Assert(NewTreaty > RW[pSender].Treaty[pTarget]); 3645 3646 RW[pSender].Treaty[pTarget] := NewTreaty; 3646 3647 RW[pTarget].Treaty[pSender] := NewTreaty; … … 3671 3672 opShipParts: // + number + part type shl 16 3672 3673 begin 3673 n:= Price and $FFFF; // number3674 i:= Price shr 16 and $F; // type3675 if ( i < nShipPart) and (GShip[pSender].Parts[i] >= n) then3674 N := Price and $FFFF; // number 3675 I := Price shr 16 and $F; // type 3676 if (I < nShipPart) and (GShip[pSender].Parts[I] >= N) then 3676 3677 begin 3677 3678 if execute then 3678 3679 begin 3679 dec(GShip[pSender].Parts[i], n);3680 RW[pSender].Ship[pSender].Parts[ i] := GShip[pSender].Parts[i];3681 RW[pTarget].Ship[pSender].Parts[ i] := GShip[pSender].Parts[i];3680 Dec(GShip[pSender].Parts[I], N); 3681 RW[pSender].Ship[pSender].Parts[I] := GShip[pSender].Parts[I]; 3682 RW[pTarget].Ship[pSender].Parts[I] := GShip[pSender].Parts[I]; 3682 3683 if RW[pTarget].NatBuilt[imSpacePort] > 0 then 3683 3684 begin // space ship control requires space port 3684 inc(GShip[pTarget].Parts[i], n);3685 RW[pSender].Ship[pTarget].Parts[ i] := GShip[pTarget].Parts[i];3686 RW[pTarget].Ship[pTarget].Parts[ i] := GShip[pTarget].Parts[i];3685 Inc(GShip[pTarget].Parts[I], N); 3686 RW[pSender].Ship[pTarget].Parts[I] := GShip[pTarget].Parts[I]; 3687 RW[pTarget].Ship[pTarget].Parts[I] := GShip[pTarget].Parts[I]; 3687 3688 end; 3688 3689 end; 3689 3690 end 3690 3691 else 3691 result := false;3692 Result := False; 3692 3693 end; 3693 3694 opMoney: // + value … … 3697 3698 if execute then 3698 3699 begin 3699 dec(RW[pSender].Money, Price - opMoney);3700 inc(RW[pTarget].Money, Price - opMoney);3700 Dec(RW[pSender].Money, Price - opMoney); 3701 Inc(RW[pTarget].Money, Price - opMoney); 3701 3702 end; 3702 3703 end 3703 3704 else 3704 result := false;3705 Result := False; 3705 3706 opTribute: // + value 3706 3707 if execute then … … 3717 3718 end 3718 3719 else 3719 result := false;3720 Result := False; 3720 3721 opAllTech: 3721 3722 if execute then 3722 for i:= 0 to nAdv - 1 do3723 if (RW[pSender].Tech[ i] >= tsApplicable) and3724 (RW[pTarget].Tech[ i] = tsNA) then3723 for I := 0 to nAdv - 1 do 3724 if (RW[pSender].Tech[I] >= tsApplicable) and 3725 (RW[pTarget].Tech[I] = tsNA) then 3725 3726 begin 3726 SeeTech(pTarget, i);3727 RW[pSender].EnemyReport[pTarget].Tech[ i] := tsSeen;3728 RW[pTarget].EnemyReport[pSender].Tech[ i] := tsApplicable;3727 SeeTech(pTarget, I); 3728 RW[pSender].EnemyReport[pTarget].Tech[I] := tsSeen; 3729 RW[pTarget].EnemyReport[pSender].Tech[I] := tsApplicable; 3729 3730 end; 3730 3731 opModel: // + model index … … 3732 3733 begin 3733 3734 if execute then 3734 CopyModel(pSender, pTarget, Price - opModel) 3735 CopyModel(pSender, pTarget, Price - opModel); 3735 3736 end 3736 3737 else 3737 result := false;3738 Result := False; 3738 3739 opAllModel: 3739 3740 if execute then 3740 for i:= 0 to RW[pSender].nModel - 1 do3741 begin 3742 TellAboutModel(pTarget, pSender, i);3743 CopyModel(pSender, pTarget, i);3741 for I := 0 to RW[pSender].nModel - 1 do 3742 begin 3743 TellAboutModel(pTarget, pSender, I); 3744 CopyModel(pSender, pTarget, I); 3744 3745 end; 3745 3746 { opCity: // + city ID 3746 3747 begin 3747 result:=false3748 Result:=False 3748 3749 end; } 3749 end 3750 end; 3751 3752 procedure CancelTreaty( p, pWith: integer; DecreaseCredibility: boolean);3750 end; 3751 end; 3752 3753 procedure CancelTreaty(P, pWith: Integer; DecreaseCredibility: Boolean); 3753 3754 // side effect: PeaceEnded := bitarray of players with which peace treaty was canceled 3754 3755 var 3755 p1, OldTreaty: integer;3756 begin 3757 OldTreaty := RW[ p].Treaty[pWith];3756 p1, OldTreaty: Integer; 3757 begin 3758 OldTreaty := RW[P].Treaty[pWith]; 3758 3759 PeaceEnded := 0; 3759 3760 if OldTreaty >= trPeace then 3760 RW[ p].LastCancelTreaty[pWith] := GTurn;3761 RW[P].LastCancelTreaty[pWith] := GTurn; 3761 3762 if DecreaseCredibility then 3762 3763 begin … … 3764 3765 trPeace: 3765 3766 begin 3766 RW[ p].Credibility := RW[p].Credibility shr 1;3767 if RW[ p].MaxCredibility > 0 then3768 dec(RW[p].MaxCredibility, 10);3769 if RW[ p].Credibility > RW[p].MaxCredibility then3770 RW[ p].Credibility := RW[p].MaxCredibility;3767 RW[P].Credibility := RW[P].Credibility shr 1; 3768 if RW[P].MaxCredibility > 0 then 3769 Dec(RW[P].MaxCredibility, 10); 3770 if RW[P].Credibility > RW[P].MaxCredibility then 3771 RW[P].Credibility := RW[P].MaxCredibility; 3771 3772 end; 3772 3773 trAlliance: 3773 RW[ p].Credibility := RW[p].Credibility * 3 div 4;3774 end; 3775 RW[pWith].EnemyReport[ p].Credibility := RW[p].Credibility;3774 RW[P].Credibility := RW[P].Credibility * 3 div 4; 3775 end; 3776 RW[pWith].EnemyReport[P].Credibility := RW[P].Credibility; 3776 3777 end; 3777 3778 … … 3779 3780 begin 3780 3781 for p1 := 0 to nPl - 1 do 3781 if (p1 = pWith) or DecreaseCredibility and (p1 <> p) and3782 (RW[pWith].Treaty[p1] = trAlliance) and (RW[ p].Treaty[p1] >= trPeace)3782 if (p1 = pWith) or DecreaseCredibility and (p1 <> P) and 3783 (RW[pWith].Treaty[p1] = trAlliance) and (RW[P].Treaty[p1] >= trPeace) 3783 3784 then 3784 3785 begin 3785 RW[ p].Treaty[p1] := trNone;3786 RW[p1].Treaty[ p] := trNone;3787 RW[ p].EvaStart[p1] := -PeaceEvaTurns - 1;3788 RW[p1].EvaStart[ p] := -PeaceEvaTurns - 1;3789 inc(PeaceEnded, 1 shl p1);3786 RW[P].Treaty[p1] := trNone; 3787 RW[p1].Treaty[P] := trNone; 3788 RW[P].EvaStart[p1] := -PeaceEvaTurns - 1; 3789 RW[p1].EvaStart[P] := -PeaceEvaTurns - 1; 3790 Inc(PeaceEnded, 1 shl p1); 3790 3791 end; 3791 3792 CheckBorders(-1); 3792 3793 if (Mode > moLoading_Fast) and (PeaceEnded > 0) then 3793 RecalcMapZoC( p);3794 RecalcMapZoC(P); 3794 3795 end 3795 3796 else 3796 3797 begin 3797 RW[ p].Treaty[pWith] := OldTreaty - 1;3798 RW[pWith].Treaty[ p] := OldTreaty - 1;3798 RW[P].Treaty[pWith] := OldTreaty - 1; 3799 RW[pWith].Treaty[P] := OldTreaty - 1; 3799 3800 if OldTreaty = TrFriendlyContact then 3800 3801 begin // necessary for loading 3801 GiveCivilReport( p, pWith);3802 GiveCivilReport(pWith, p);3802 GiveCivilReport(P, pWith); 3803 GiveCivilReport(pWith, P); 3803 3804 end 3804 3805 else if OldTreaty = trAlliance then 3805 3806 begin // necessary for loading 3806 GiveMilReport( p, pWith);3807 GiveMilReport(pWith, p);3807 GiveMilReport(P, pWith); 3808 GiveMilReport(pWith, P); 3808 3809 end; 3809 3810 if (Mode > moLoading_Fast) and (OldTreaty = trAlliance) then 3810 3811 begin 3811 RecalcMapZoC( p);3812 RecalcMapZoC(P); 3812 3813 RecalcMapZoC(pWith); 3813 3814 end; … … 3815 3816 if OldTreaty in [trPeace, trAlliance] then 3816 3817 begin 3817 RecalcPeaceMap( p);3818 RecalcPeaceMap(P); 3818 3819 RecalcPeaceMap(pWith); 3819 3820 end; 3820 3821 end; 3821 3822 3822 function DoSpyMission( p, pCity, cix, Mission: integer): Cardinal;3823 var 3824 p1: integer;3825 begin 3826 result := 0;3823 function DoSpyMission(P, pCity, cix, Mission: Integer): Cardinal; 3824 var 3825 p1: Integer; 3826 begin 3827 Result := 0; 3827 3828 case Mission of 3828 3829 smSabotageProd: … … 3831 3832 smStealMap: 3832 3833 begin 3833 CopyMap(pCity, p);3834 RecalcPeaceMap( p);3834 CopyMap(pCity, P); 3835 RecalcPeaceMap(P); 3835 3836 end; 3836 3837 smStealCivilReport: 3837 3838 begin 3838 if RW[ p].Treaty[pCity] = trNoContact then3839 IntroduceEnemy( p, pCity);3840 GiveCivilReport( p, pCity);3839 if RW[P].Treaty[pCity] = trNoContact then 3840 IntroduceEnemy(P, pCity); 3841 GiveCivilReport(P, pCity); 3841 3842 end; 3842 3843 smStealMilReport: 3843 3844 begin 3844 if RW[ p].Treaty[pCity] = trNoContact then3845 IntroduceEnemy( p, pCity);3846 GiveMilReport( p, pCity);3845 if RW[P].Treaty[pCity] = trNoContact then 3846 IntroduceEnemy(P, pCity); 3847 GiveMilReport(P, pCity); 3847 3848 end; 3848 3849 smStealForeignReports: 3849 3850 begin 3850 3851 for p1 := 0 to nPl - 1 do 3851 if (p1 <> p) and (p1 <> pCity) and (RW[pCity].EnemyReport[p1] <> nil)3852 if (p1 <> P) and (p1 <> pCity) and (RW[pCity].EnemyReport[p1] <> nil) 3852 3853 then 3853 3854 begin 3854 3855 if RW[pCity].EnemyReport[p1].TurnOfCivilReport >= 0 then 3855 if CopyCivilReport(pCity, p, p1) then3856 result := result or (1 shl (2 * p1));3856 if CopyCivilReport(pCity, P, p1) then 3857 Result := Result or (1 shl (2 * p1)); 3857 3858 if RW[pCity].EnemyReport[p1].TurnOfMilReport >= 0 then 3858 if CopyMilReport(pCity, p, p1) then3859 result := result or (2 shl (2 * p1));3859 if CopyMilReport(pCity, P, p1) then 3860 Result := Result or (2 shl (2 * p1)); 3860 3861 end; 3861 3862 end; … … 3867 3868 ____________________________________________________________________ 3868 3869 } 3869 procedure ClearTestFlags(ClearFlags: integer);3870 var 3871 p1: integer;3870 procedure ClearTestFlags(ClearFlags: Integer); 3871 var 3872 p1: Integer; 3872 3873 begin 3873 3874 GTestFlags := GTestFlags and (not ClearFlags or tfTested or tfAllTechs or … … 3878 3879 end; 3879 3880 3880 procedure SetTestFlags( p, SetFlags: integer);3881 var 3882 i, p1, p2, MoreFlags: integer;3881 procedure SetTestFlags(P, SetFlags: Integer); 3882 var 3883 I, p1, p2, MoreFlags: Integer; 3883 3884 begin 3884 3885 MoreFlags := SetFlags and not GTestFlags; … … 3895 3896 begin // make p1 and p2 know each other 3896 3897 if RW[p1].Treaty[p2] = trNoContact then 3897 IntroduceEnemy(p1, p2) 3898 IntroduceEnemy(p1, p2); 3898 3899 end; 3899 3900 … … 3904 3905 if 1 shl p1 and GAlive <> 0 then 3905 3906 begin 3906 for i:= 0 to nAdv - 1 do // give all techs to player p13907 if not( i in FutureTech) and (RW[p1].Tech[i] < tsApplicable) then3907 for I := 0 to nAdv - 1 do // give all techs to player p1 3908 if not(I in FutureTech) and (RW[p1].Tech[I] < tsApplicable) then 3908 3909 begin 3909 RW[p1].Tech[ i] := tsCheat;3910 CheckSpecialModels(p1, i);3910 RW[p1].Tech[I] := tsCheat; 3911 CheckSpecialModels(p1, I); 3911 3912 end; 3912 3913 for p2 := 0 to nPl - 1 do 3913 3914 if (p2 <> p1) and (1 shl p2 and (GAlive or GWatching) <> 0) then 3914 for i:= 1 to 3 do3915 if RW[p2].EnemyReport[p1].Tech[AgePreq[ i]] < tsApplicable then3916 RW[p2].EnemyReport[p1].Tech[AgePreq[ i]] := tsCheat;3915 for I := 1 to 3 do 3916 if RW[p2].EnemyReport[p1].Tech[AgePreq[I]] < tsApplicable then 3917 RW[p2].EnemyReport[p1].Tech[AgePreq[I]] := tsCheat; 3917 3918 end; 3918 3919 end; … … 3920 3921 if MoreFlags and tfUncover <> 0 then 3921 3922 begin 3922 DiscoverAll( p, lObserveSuper);3923 DiscoverAll(P, lObserveSuper); 3923 3924 for p1 := 0 to nPl - 1 do 3924 3925 if 1 shl p1 and GAlive <> 0 then 3925 3926 begin 3926 3927 ResourceMask[p1] := $FFFFFFFF; 3927 if p1 <> pthen3928 begin 3929 GiveCivilReport( p, p1);3930 GiveMilReport( p, p1);3928 if p1 <> P then 3929 begin 3930 GiveCivilReport(P, p1); 3931 GiveMilReport(P, p1); 3931 3932 end; 3932 3933 end; … … 3938 3939 ____________________________________________________________________ 3939 3940 } 3940 procedure IntServer(Command, Player, Subject: integer; var Data); 3941 var 3942 i, p1: integer; 3943 3941 procedure IntServer(Command, Player, Subject: Integer; var Data); 3942 var 3943 I, p1: Integer; 3944 3944 begin 3945 3945 if Mode = moPlaying then … … 3951 3951 begin 3952 3952 {$IFDEF TEXTLOG}CmdInfo := Format('IntTellAboutNation P%d+P%d', [Player, Subject]); {$ENDIF} 3953 assert((Player >= 0) and (Player < nPl) and (Subject >= 0) and3953 Assert((Player >= 0) and (Player < nPl) and (Subject >= 0) and 3954 3954 (Subject < nPl)); 3955 3955 IntroduceEnemy(Player, Subject); … … 3959 3959 begin 3960 3960 {$IFDEF TEXTLOG}CmdInfo := Format('IntHaveContact P%d+P%d', [Player, Subject]); {$ENDIF} 3961 assert(RW[Player].Treaty[Subject] > trNoContact);3961 Assert(RW[Player].Treaty[Subject] > trNoContact); 3962 3962 RW[Player].EnemyReport[Subject].TurnOfContact := GTurn; 3963 3963 RW[Subject].EnemyReport[Player].TurnOfContact := GTurn; … … 3981 3981 p1 := (Command - sIntTellAboutModel) shr 4; // told player 3982 3982 {$IFDEF TEXTLOG}CmdInfo := Format('IntTellAboutModel P%d about P%d Mod%d', [p1, Player, Subject]); {$ENDIF} 3983 assert((Player >= 0) and (Player < nPl));3984 assert((Subject >= 0) and (Subject < RW[Player].nModel));3983 Assert((Player >= 0) and (Player < nPl)); 3984 Assert((Subject >= 0) and (Subject < RW[Player].nModel)); 3985 3985 MakeModelInfo(Player, Subject, RW[Player].Model[Subject], 3986 3986 RW[p1].EnemyModel[RW[p1].nEnemyModel]); 3987 3987 RWemix[p1, Player, Subject] := RW[p1].nEnemyModel; 3988 inc(RW[p1].nEnemyModel);3989 assert(RW[p1].nEnemyModel < nemmax);3988 Inc(RW[p1].nEnemyModel); 3989 Assert(RW[p1].nEnemyModel < nemmax); 3990 3990 end; 3991 3991 3992 3992 sIntDiscoverZOC: 3993 3993 begin 3994 {$IFDEF TEXTLOG}CmdInfo := Format('IntDiscoverZOC P%d Loc%d', [Player, integer(Data)]); {$ENDIF}3995 Discover9( integer(Data), Player, lObserveUnhidden, true, false);3994 {$IFDEF TEXTLOG}CmdInfo := Format('IntDiscoverZOC P%d Loc%d', [Player, Integer(Data)]); {$ENDIF} 3995 Discover9(Integer(Data), Player, lObserveUnhidden, True, False); 3996 3996 end; 3997 3997 … … 4000 4000 begin 4001 4001 {$IFDEF TEXTLOG}CmdInfo := Format('IntExpandTerritory P%d Loc%d', [Player, RW[Player].City[Subject].Loc]); {$ENDIF} 4002 move(Data, BorderChanges, SizeOf(BorderChanges));4002 Move(Data, BorderChanges, SizeOf(BorderChanges)); 4003 4003 ExpandTerritory(RW[Player].City[Subject].Loc); 4004 4004 end; … … 4007 4007 with RW[Player].City[Subject] do 4008 4008 begin 4009 {$IFDEF TEXTLOG}CmdInfo := Format('IntBuyMaterial P%d Loc%d Cost%d', [Player, Loc, integer(Data)]); {$ENDIF}4010 dec(RW[Player].Money, integer(Data));4009 {$IFDEF TEXTLOG}CmdInfo := Format('IntBuyMaterial P%d Loc%d Cost%d', [Player, Loc, Integer(Data)]); {$ENDIF} 4010 Dec(RW[Player].Money, Integer(Data)); 4011 4011 if (GWonder[woMich].EffectiveOwner = Player) and (Project and cpImp <> 0) 4012 4012 then 4013 inc(Prod, integer(Data) div 2)4013 Inc(Prod, Integer(Data) div 2) 4014 4014 else 4015 inc(Prod, integer(Data) div 4);4015 Inc(Prod, Integer(Data) div 4); 4016 4016 if Project0 and not cpAuto <> Project and not cpAuto then 4017 4017 Project0 := Project; … … 4022 4022 begin 4023 4023 {$IFDEF TEXTLOG}CmdInfo := Format('IntPayPrices P%d+P%d', [Player, Subject]); {$ENDIF} 4024 for i:= 0 to TOffer(Data).nDeliver - 1 do4025 PayPrice(Player, Subject, TOffer(Data).Price[ i], true);4026 for i:= 0 to TOffer(Data).nCost - 1 do4024 for I := 0 to TOffer(Data).nDeliver - 1 do 4025 PayPrice(Player, Subject, TOffer(Data).Price[I], True); 4026 for I := 0 to TOffer(Data).nCost - 1 do 4027 4027 PayPrice(Subject, Player, TOffer(Data).Price[TOffer(Data).nDeliver 4028 + i], true);4029 for i:= 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do4030 if TOffer(Data).Price[ i] = opTreaty + trAlliance then4028 + I], True); 4029 for I := 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do 4030 if TOffer(Data).Price[I] = opTreaty + trAlliance then 4031 4031 begin // add view area of allied player 4032 4032 DiscoverViewAreas(Player); 4033 4033 DiscoverViewAreas(Subject); 4034 Break 4035 end 4034 Break; 4035 end; 4036 4036 end; 4037 4037 4038 4038 sIntSetDevModel: 4039 4039 if Mode < moPlaying then 4040 move(Data, RW[Player].DevModel.Kind, sIntSetDevModel and $F * 4);4040 Move(Data, RW[Player].DevModel.Kind, sIntSetDevModel and $F * 4); 4041 4041 4042 4042 sIntSetModelStatus: … … 4045 4045 {$IFDEF TEXTLOG}CmdInfo := Format('IntSetModelStatus P%d', [Player]); 4046 4046 {$ENDIF} 4047 RW[Player].Model[Subject].Status := integer(Data);4047 RW[Player].Model[Subject].Status := Integer(Data); 4048 4048 end; 4049 4049 … … 4053 4053 {$IFDEF TEXTLOG}CmdInfo := Format('IntSetUnitStatus P%d', [Player]); 4054 4054 {$ENDIF} 4055 RW[Player].Un[Subject].Status := integer(Data);4055 RW[Player].Un[Subject].Status := Integer(Data); 4056 4056 end; 4057 4057 … … 4061 4061 {$IFDEF TEXTLOG}CmdInfo := Format('IntSetCityStatus P%d', [Player]); 4062 4062 {$ENDIF} 4063 RW[Player].City[Subject].Status := integer(Data);4063 RW[Player].City[Subject].Status := Integer(Data); 4064 4064 end; 4065 4065 … … 4069 4069 {$IFDEF TEXTLOG}CmdInfo := Format('IntSetECityStatus P%d', [Player]); 4070 4070 {$ENDIF} 4071 RW[Player].EnemyCity[Subject].Status := integer(Data); 4072 end; 4073 4074 end; { case command } 4075 end; { IntServer } 4071 RW[Player].EnemyCity[Subject].Status := Integer(Data); 4072 end; 4073 end; 4074 end; 4076 4075 4077 4076 end. -
branches/highdpi/Direct.lfm
r246 r465 8 8 Caption = 'C-evo' 9 9 Color = clBtnFace 10 DesignTimePPI = 1 2510 DesignTimePPI = 144 11 11 Font.Color = clWindowText 12 Font.Height = - 1312 Font.Height = -20 13 13 Font.Name = 'MS Sans Serif' 14 14 FormStyle = fsStayOnTop … … 17 17 OnPaint = FormPaint 18 18 OnShow = FormShow 19 LCLVersion = '1.8.0.6'20 PixelsPerInch = 9619 ShowInTaskBar = stNever 20 LCLVersion = '2.2.6.0' 21 21 Scaled = False 22 22 end -
branches/highdpi/Direct.pas
r405 r465 7 7 UDpiControls, Messg, 8 8 9 LCLIntf, LCLType, {$IFDEF Linux}LMessages, {$ENDIF}Messages, SysUtils, Classes,9 LCLIntf, LCLType, {$IFDEF UNIX}LMessages, {$ENDIF}Messages, SysUtils, Classes, 10 10 Graphics, Controls, Forms, DrawDlg, GameServer; 11 11 … … 29 29 Gone: Boolean; 30 30 Quick: Boolean; 31 procedure SetInfo( x: string);32 procedure SetState( x: integer);31 procedure SetInfo(X: string); 32 procedure SetState(X: Integer); 33 33 procedure OnGo(var Msg: TMessage); message WM_GO; 34 34 procedure OnChangeClient(var Msg: TMessage); message WM_CHANGECLIENT; … … 40 40 DirectDlg: TDirectDlg; 41 41 42 42 43 implementation 43 44 44 45 uses 45 ScreenTools, Protocol, Start, LocalPlayer, NoTerm, Back, Global, UNetworkServer,46 UNetworkClient;46 ScreenTools, Protocol, Start, LocalPlayer, NoTerm, Back, Global, NetworkServer, 47 NetworkClient; 47 48 48 49 {$R *.lfm} … … 57 58 // hMem: Cardinal; 58 59 // p: pointer; 59 s: string;60 S: string; 60 61 Begin 61 62 case ID of … … 72 73 if visible then 73 74 begin 74 s:= Format(Phrases.Lookup('BUSY_MOD'), [Brains[Index].Name]);75 while BiColorTextWidth(Canvas, s) + 64 > ClientWidth do76 Delete( s, Length(s), 1);77 SetInfo( s);75 S := Format(Phrases.Lookup('BUSY_MOD'), [Brains[Index].Name]); 76 while BiColorTextWidth(Canvas, S) + 64 > ClientWidth do 77 Delete(S, Length(S), 1); 78 SetInfo(S); 78 79 end; 79 80 ntCreateWorld: … … 111 112 hMem := GlobalAlloc(GMEM_MOVEABLE or GMEM_DDESHARE, 112 113 Length(NotifyMessage)); 113 p:= GlobalLock(hMem);114 if p<> nil then115 move(NotifyMessage[1], p^, Length(NotifyMessage));114 P := GlobalLock(hMem); 115 if P <> nil then 116 Move(NotifyMessage[1], P^, Length(NotifyMessage)); 116 117 GlobalUnlock(hMem); 117 118 SetClipboardData(CF_TEXT, hMem); … … 153 154 State := -1; 154 155 Show; 155 {$IFDEF LINUX} 156 // Force shown window repaint on Gtk2 widgetset 157 Sleep(1); 158 DpiApplication.ProcessMessages; 159 {$ENDIF} 156 Gtk2Fix; 160 157 Invalidate; 161 158 Update; … … 183 180 BrainTerm.Name := Phrases.Lookup('HUMAN'); 184 181 if NetworkEnabled then begin 185 BrainNetworkServer.Client := UNetworkServer.Client;182 BrainNetworkServer.Client := NetworkServer.Client; 186 183 BrainNetworkServer.Name := Phrases.Lookup('NETWORK_SERVER'); 187 BrainNetworkClient.Client := UNetworkClient.Client;184 BrainNetworkClient.Client := NetworkClient.Client; 188 185 BrainNetworkClient.Name := Phrases.Lookup('NETWORK_CLIENT'); 189 186 end; … … 198 195 begin 199 196 PostMessage(Handle, WM_GO, 0, 0); 200 Gone := true;197 Gone := True; 201 198 end; 202 199 end; … … 209 206 procedure TDirectDlg.OnGo(var Msg: TMessage); 210 207 var 211 i: integer;212 s: string;208 I: Integer; 209 S: string; 213 210 FileName: string; 214 211 begin … … 220 217 Exit; 221 218 end; 222 Quick := false;219 Quick := False; 223 220 if ParamCount > 0 then 224 221 begin 225 s:= ParamStr(1);226 if ( s[1] = '-') {$IFDEF WINDOWS}or (s[1] = '/'){$ENDIF} then222 S := ParamStr(1); 223 if (S[1] = '-') {$IFDEF WINDOWS}or (S[1] = '/'){$ENDIF} then 227 224 begin // special mode 228 Delete( s, 1, 1);229 for i := 1 to Length(s) do230 if s[i] in ['a' .. 'z'] then231 dec(s[i], 32);232 if s= 'MAN' then225 Delete(S, 1, 1); 226 for I := 1 to Length(S) do 227 if S[I] in ['a' .. 'z'] then 228 Dec(S[I], 32); 229 if S = 'MAN' then 233 230 begin 234 Quick := true;231 Quick := True; 235 232 DirectHelp(cHelpOnly); 236 233 Close; … … 242 239 Quick := True; 243 240 if not LoadGame(ExtractFilePath(ParamStr(1)), ExtractFileName(ParamStr(1) 244 ), -1, false) then begin241 ), -1, False) then begin 245 242 SimpleMessage(Phrases.Lookup('LOADERR')); 246 243 Close; … … 280 277 procedure TDirectDlg.FormPaint(Sender: TObject); 281 278 begin 282 PaintBackground( self, 3, 3, ClientWidth - 6, ClientHeight - 6);279 PaintBackground(Self, 3, 3, ClientWidth - 6, ClientHeight - 6); 283 280 Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0); 284 281 Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2, … … 297 294 end; 298 295 299 procedure TDirectDlg.SetInfo( x: string);300 begin 301 Info := x;296 procedure TDirectDlg.SetInfo(X: string); 297 begin 298 Info := X; 302 299 Invalidate; 303 300 Update; 304 {$IFDEF LINUX}301 {$IFDEF UNIX} 305 302 DpiApplication.ProcessMessages; 306 303 {$ENDIF} 307 304 end; 308 305 309 procedure TDirectDlg.SetState( x: integer);310 begin 311 if ( x< 0) <> (State < 0) then begin312 State := x;306 procedure TDirectDlg.SetState(X: Integer); 307 begin 308 if (X < 0) <> (State < 0) then begin 309 State := X; 313 310 Invalidate; 314 311 Update; 315 312 end 316 else if x<> State then begin317 State := x;313 else if X <> State then begin 314 State := X; 318 315 PaintProgressBar(Canvas, 6, ClientWidth div 2 - 64, 40, State, 128 - State, 319 316 128, MainTexture); -
branches/highdpi/GameServer.pas
r405 r465 7 7 8 8 uses 9 Protocol, Database, dynlibs, Platform, dateutils, fgl, LazFileUtils,10 Graphics, UBrain, Global;9 Protocol, Database, dynlibs, Platform, dateutils, LazFileUtils, Graphics, 10 Brain, Global; 11 11 12 12 const … … 49 49 // PARAMETERS 50 50 PlayersBrain: TBrains; { brain of the players view } 51 Difficulty: array [0 .. nPl - 1] of integer absolute Database.Difficulty;51 Difficulty: array [0 .. nPl - 1] of Integer absolute Database.Difficulty; 52 52 { difficulty } 53 53 … … 70 70 71 71 procedure StartNewGame(const Path, FileName, Map: string; 72 Newlx, Newly, NewLandMass, NewMaxTurn: integer);73 function LoadGame(const Path, FileName: string; Turn: integer;74 MovieMode: boolean): boolean;75 procedure EditMap(const Map: string; Newlx, Newly, NewLandMass: integer);76 procedure DirectHelp(Command: integer);72 Newlx, Newly, NewLandMass, NewMaxTurn: Integer); 73 function LoadGame(const Path, FileName: string; Turn: Integer; 74 MovieMode: Boolean): Boolean; 75 procedure EditMap(const Map: string; Newlx, Newly, NewLandMass: Integer); 76 procedure DirectHelp(Command: Integer); 77 77 78 78 procedure ChangeClient; 79 79 procedure NextPlayer; 80 function PreviewMap(lm: integer): pointer;80 function PreviewMap(lm: Integer): Pointer; 81 81 82 82 … … 112 112 MapField: ^Cardinal; // predefined map 113 113 LastOffer: TOffer; 114 CCData: array [0 .. 14] of integer;114 CCData: array [0 .. 14] of Integer; 115 115 bix: TBrains; { brain of the players } 116 116 DevModelTurn: array [0 .. nPl - 1] of Integer; { turn of last call to sResetModel } 117 117 OriginalDataVersion: array [0 .. nPl - 1] of Integer; 118 118 SavedTiles { , SavedResourceWeights } : array [0 .. ncmax - 1] of Cardinal; 119 SavedData: array [0 .. nPl - 1] of pointer;119 SavedData: array [0 .. nPl - 1] of Pointer; 120 120 LogFileName: string; 121 121 SavePath: string; { name of file for saving the current game } … … 135 135 PreviewRND = 41601260; { randseed for preview map } 136 136 137 function Server(Command, Player, Subject: integer; var Data): integer;137 function Server(Command, Player, Subject: Integer; var Data): Integer; 138 138 stdcall; forward; 139 139 140 procedure CallPlayer(Command, p: integer; var Data);140 procedure CallPlayer(Command, P: Integer; var Data); 141 141 begin 142 if ((Mode <> moMovie) or ( p= 0)) then142 if ((Mode <> moMovie) or (P = 0)) then 143 143 begin 144 144 {$IFOPT O-} 145 HandoverStack[nHandoverStack] := p;145 HandoverStack[nHandoverStack] := P; 146 146 HandoverStack[nHandoverStack + 1] := Command; 147 inc(nHandoverStack, 2);148 bix[ p].Client(Command, p, Data);149 dec(nHandoverStack, 2);147 Inc(nHandoverStack, 2); 148 bix[P].Client(Command, P, Data); 149 Dec(nHandoverStack, 2); 150 150 {$ELSE} 151 151 try 152 bix[ p].Client(Command, p, Data);152 bix[P].Client(Command, P, Data); 153 153 except 154 Notify(ntException + bix[ p]);154 Notify(ntException + bix[P]); 155 155 end; 156 156 {$ENDIF} 157 end 157 end; 158 158 end; 159 159 … … 167 167 end; 168 168 169 procedure CallClient(bix, Command: integer; var Data);169 procedure CallClient(bix, Command: Integer; var Data); 170 170 begin 171 171 if ((Mode <> moMovie) or (bix = Brains.IndexOf(GameServer.bix[0]))) then … … 174 174 HandoverStack[nHandoverStack] := bix; 175 175 HandoverStack[nHandoverStack + 1] := Command; 176 inc(nHandoverStack, 2);176 Inc(nHandoverStack, 2); 177 177 Brains[bix].Client(Command, -1, Data); 178 dec(nHandoverStack, 2);178 Dec(nHandoverStack, 2); 179 179 {$ELSE} 180 180 try … … 189 189 procedure Init(NotifyFunction: TNotifyFunction); 190 190 var 191 f: TSearchRec;191 F: TSearchRec; 192 192 BasePath: string; 193 193 NewBrain: TBrain; … … 195 195 begin 196 196 Notify := NotifyFunction; 197 PreviewElevation := false;197 PreviewElevation := False; 198 198 PlayersBrain := TBrains.Create(False); 199 199 PlayersBrain.Count := nPl; … … 246 246 end; 247 247 248 if FindFirst(GetAiDir + DirectorySeparator + '*', faDirectory or faArchive or faReadOnly, f) = 0 then248 if FindFirst(GetAiDir + DirectorySeparator + '*', faDirectory or faArchive or faReadOnly, F) = 0 then 249 249 repeat 250 BasePath := GetAiDir + DirectorySeparator + f.Name;251 if ( f.Name <> '.') and (f.Name <> '..') and DirectoryExists(BasePath) then begin250 BasePath := GetAiDir + DirectorySeparator + F.Name; 251 if (F.Name <> '.') and (F.Name <> '..') and DirectoryExists(BasePath) then begin 252 252 NewBrain := Brains.AddNew; 253 253 NewBrain.Kind := btAI; … … 258 258 end else Brains.Delete(Brains.Count - 1); 259 259 end; 260 until FindNext( f) <> 0;260 until FindNext(F) <> 0; 261 261 FindClose(F); 262 262 … … 281 281 end; 282 282 283 function PreviewMap(lm: integer): pointer;283 function PreviewMap(lm: Integer): Pointer; 284 284 begin 285 285 lx := lxmax; … … 291 291 begin 292 292 CreateElevation; 293 PreviewElevation := true;293 PreviewElevation := True; 294 294 end; 295 CreateMap( true);295 CreateMap(True); 296 296 Result := @RealMap; 297 297 end; 298 298 299 procedure ChangeClientWhenDone(Command, Player: integer; var Data;300 DataSize: integer);299 procedure ChangeClientWhenDone(Command, Player: Integer; var Data; 300 DataSize: Integer); 301 301 begin 302 302 CCCommand := Command; 303 303 CCPlayer := Player; 304 304 if DataSize > 0 then 305 move(Data, CCData, DataSize);305 Move(Data, CCData, DataSize); 306 306 Notify(ntChangeClient); 307 307 end; 308 308 309 procedure PutMessage(Level: integer; Text: string);309 procedure PutMessage(Level: Integer; Text: string); 310 310 begin 311 bix[0].Client(cDebugMessage, Level, pchar(Text)^);311 bix[0].Client(cDebugMessage, Level, PChar(Text)^); 312 312 end; 313 313 … … 336 336 // hand over control to other client (as specified by CC...) 337 337 var 338 p: integer;338 P: Integer; 339 339 T: TDateTime; 340 340 begin … … 346 346 [CCPlayer, bix[CCPlayer].Name])); 347 347 if CCCommand = cTurn then 348 for p:= 0 to nPl - 1 do349 if ( p <> CCPlayer) and (1 shl pand GWatching <> 0) then350 CallPlayer(cShowTurnChange, p, CCPlayer);351 352 p:= CCPlayer;348 for P := 0 to nPl - 1 do 349 if (P <> CCPlayer) and (1 shl P and GWatching <> 0) then 350 CallPlayer(cShowTurnChange, P, CCPlayer); 351 352 P := CCPlayer; 353 353 CCPlayer := -1; 354 CallPlayer(CCCommand, p, CCData);355 if (Mode = moPlaying) and (bix[ p].Flags and aiThreaded = 0) and354 CallPlayer(CCCommand, P, CCData); 355 if (Mode = moPlaying) and (bix[P].Flags and aiThreaded = 0) and 356 356 (CCPlayer < 0) then 357 357 begin 358 Notify(ntDeactivationMissing, p);358 Notify(ntDeactivationMissing, P); 359 359 ForceClientDeactivation; 360 360 end; 361 361 end; 362 362 363 procedure Inform( p: integer);363 procedure Inform(P: Integer); 364 364 var 365 i, p1: integer;365 I, p1: Integer; 366 366 begin 367 RW[ p].Turn := GTurn;368 if (GTurn = MaxTurn) and ( p = pTurn) and (p= 0) then369 RW[ p].Happened := RW[p].Happened or phTimeUp;370 if (GWinner > 0) and ( p = pTurn) and (p= 0) then371 RW[ p].Happened := RW[p].Happened or phShipComplete;372 RW[ p].Alive := GAlive;373 move(GWonder, RW[p].Wonder, SizeOf(GWonder));374 move(GShip, RW[p].Ship, SizeOf(GShip));367 RW[P].Turn := GTurn; 368 if (GTurn = MaxTurn) and (P = pTurn) and (P = 0) then 369 RW[P].Happened := RW[P].Happened or phTimeUp; 370 if (GWinner > 0) and (P = pTurn) and (P = 0) then 371 RW[P].Happened := RW[P].Happened or phShipComplete; 372 RW[P].Alive := GAlive; 373 Move(GWonder, RW[P].Wonder, SizeOf(GWonder)); 374 Move(GShip, RW[P].Ship, SizeOf(GShip)); 375 375 for p1 := 0 to nPl - 1 do 376 if (p1 <> p) and Assigned(bix[p1]) and (Difficulty[p1] > 0) then377 RW[ p].EnemyReport[p1].Credibility := RW[p1].Credibility;376 if (p1 <> P) and Assigned(bix[p1]) and (Difficulty[p1] > 0) then 377 RW[P].EnemyReport[p1].Credibility := RW[p1].Credibility; 378 378 for p1 := 0 to nPl - 1 do 379 if (p1 <> p) and (1 shl p1 and GAlive <> 0) then379 if (p1 <> P) and (1 shl p1 and GAlive <> 0) then 380 380 begin 381 if (GTestFlags and tfUncover <> 0) or (Difficulty[ p] = 0) or382 (RW[ p].Treaty[p1] >= trFriendlyContact) then383 GiveCivilReport( p, p1);384 if (GTestFlags and tfUncover <> 0) or (Difficulty[ p] = 0) or385 (RW[ p].Treaty[p1] = trAlliance) then386 GiveMilReport( p, p1)381 if (GTestFlags and tfUncover <> 0) or (Difficulty[P] = 0) or 382 (RW[P].Treaty[p1] >= trFriendlyContact) then 383 GiveCivilReport(P, p1); 384 if (GTestFlags and tfUncover <> 0) or (Difficulty[P] = 0) or 385 (RW[P].Treaty[p1] = trAlliance) then 386 GiveMilReport(P, p1) 387 387 end; 388 for i := 0 to RW[p].nEnemyModel - 1 do389 with RW[ p].EnemyModel[i] do390 Lost := Destroyed[ p, Owner, mix];388 for I := 0 to RW[P].nEnemyModel - 1 do 389 with RW[P].EnemyModel[I] do 390 Lost := Destroyed[P, Owner, mix]; 391 391 end; 392 392 393 393 procedure LogChanges; 394 394 var 395 p, ix: integer;395 P, ix: Integer; 396 396 begin 397 for p:= 0 to nPl - 1 do398 if (1 shl p and GWatching <> 0) and ProcessClientData[p] then397 for P := 0 to nPl - 1 do 398 if (1 shl P and GWatching <> 0) and ProcessClientData[P] then 399 399 begin 400 400 // log unit status changes 401 for ix := 0 to RW[ p].nUn - 1 do402 with RW[ p].Un[ix] do401 for ix := 0 to RW[P].nUn - 1 do 402 with RW[P].Un[ix] do 403 403 if (Loc >= 0) and (SavedStatus <> Status) then 404 404 begin 405 CL.Put(sIntSetUnitStatus, p, ix, @Status);405 CL.Put(sIntSetUnitStatus, P, ix, @Status); 406 406 SavedStatus := Status; 407 407 end; 408 408 // log city status changes 409 for ix := 0 to RW[ p].nCity - 1 do410 with RW[ p].City[ix] do409 for ix := 0 to RW[P].nCity - 1 do 410 with RW[P].City[ix] do 411 411 if (Loc >= 0) and (SavedStatus <> Status) then 412 412 begin 413 CL.Put(sIntSetCityStatus, p, ix, @Status);413 CL.Put(sIntSetCityStatus, P, ix, @Status); 414 414 SavedStatus := Status; 415 415 end; 416 416 // log model status changes 417 for ix := 0 to RW[ p].nModel - 1 do418 with RW[ p].Model[ix] do417 for ix := 0 to RW[P].nModel - 1 do 418 with RW[P].Model[ix] do 419 419 if SavedStatus <> Status then 420 420 begin 421 CL.Put(sIntSetModelStatus, p, ix, @Status);421 CL.Put(sIntSetModelStatus, P, ix, @Status); 422 422 SavedStatus := Status; 423 423 end; 424 424 // log enemy city status changes 425 for ix := 0 to RW[ p].nEnemyCity - 1 do426 with RW[ p].EnemyCity[ix] do425 for ix := 0 to RW[P].nEnemyCity - 1 do 426 with RW[P].EnemyCity[ix] do 427 427 if (Loc >= 0) and (SavedStatus <> Status) then 428 428 begin 429 CL.Put(sIntSetECityStatus, p, ix, @Status);429 CL.Put(sIntSetECityStatus, P, ix, @Status); 430 430 SavedStatus := Status; 431 431 end; 432 432 // log data changes 433 if bix[ p].DataSize > 0 then434 begin 435 CL.PutDataChanges(sIntDataChange, p, SavedData[p], RW[p].Data,436 bix[ p].DataSize);437 Move(RW[ p].Data^, SavedData[p]^, bix[p].DataSize * 4);433 if bix[P].DataSize > 0 then 434 begin 435 CL.PutDataChanges(sIntDataChange, P, SavedData[P], RW[P].Data, 436 bix[P].DataSize); 437 Move(RW[P].Data^, SavedData[P]^, bix[P].DataSize * 4); 438 438 end; 439 439 end; … … 442 442 procedure NoLogChanges; 443 443 var 444 p, ix: integer;444 P, ix: Integer; 445 445 begin 446 for p:= 0 to nPl - 1 do447 if (1 shl p and GWatching <> 0) and ProcessClientData[p] then446 for P := 0 to nPl - 1 do 447 if (1 shl P and GWatching <> 0) and ProcessClientData[P] then 448 448 begin 449 for ix := 0 to RW[ p].nUn - 1 do450 with RW[ p].Un[ix] do449 for ix := 0 to RW[P].nUn - 1 do 450 with RW[P].Un[ix] do 451 451 SavedStatus := Status; 452 for ix := 0 to RW[ p].nCity - 1 do453 with RW[ p].City[ix] do452 for ix := 0 to RW[P].nCity - 1 do 453 with RW[P].City[ix] do 454 454 SavedStatus := Status; 455 for ix := 0 to RW[ p].nModel - 1 do456 with RW[ p].Model[ix] do455 for ix := 0 to RW[P].nModel - 1 do 456 with RW[P].Model[ix] do 457 457 SavedStatus := Status; 458 for ix := 0 to RW[ p].nEnemyCity - 1 do459 with RW[ p].EnemyCity[ix] do458 for ix := 0 to RW[P].nEnemyCity - 1 do 459 with RW[P].EnemyCity[ix] do 460 460 SavedStatus := Status; 461 if bix[ p].DataSize > 0 then462 Move(RW[ p].Data^, SavedData[p]^, bix[p].DataSize * 4);461 if bix[P].DataSize > 0 then 462 Move(RW[P].Data^, SavedData[P]^, bix[P].DataSize * 4); 463 463 end; 464 464 end; 465 465 466 function HasChanges( p: integer): boolean;466 function HasChanges(P: Integer): Boolean; 467 467 type 468 468 TDWordList = array [0 .. INFIN] of Cardinal; 469 469 PDWortList = ^TDWordList; 470 470 var 471 ix: integer;471 ix: Integer; 472 472 begin 473 473 Result := False; 474 for ix := 0 to RW[ p].nUn - 1 do475 with RW[ p].Un[ix] do474 for ix := 0 to RW[P].nUn - 1 do 475 with RW[P].Un[ix] do 476 476 if (Loc >= 0) and (SavedStatus <> Status) then 477 477 Result := True; 478 for ix := 0 to RW[ p].nCity - 1 do479 with RW[ p].City[ix] do478 for ix := 0 to RW[P].nCity - 1 do 479 with RW[P].City[ix] do 480 480 if (Loc >= 0) and (SavedStatus <> Status) then 481 481 Result := True; 482 for ix := 0 to RW[ p].nModel - 1 do483 with RW[ p].Model[ix] do482 for ix := 0 to RW[P].nModel - 1 do 483 with RW[P].Model[ix] do 484 484 if SavedStatus <> Status then 485 485 Result := True; 486 for ix := 0 to RW[ p].nEnemyCity - 1 do487 with RW[ p].EnemyCity[ix] do486 for ix := 0 to RW[P].nEnemyCity - 1 do 487 with RW[P].EnemyCity[ix] do 488 488 if (Loc >= 0) and (SavedStatus <> Status) then 489 489 Result := True; 490 if RW[ p].Data <> nil then491 for ix := 0 to bix[ p].DataSize - 1 do492 if PDWortList(SavedData[ p])[ix] <> PDWortList(RW[p].Data)[ix] then490 if RW[P].Data <> nil then 491 for ix := 0 to bix[P].DataSize - 1 do 492 if PDWortList(SavedData[P])[ix] <> PDWortList(RW[P].Data)[ix] then 493 493 Result := True; 494 494 end; … … 498 498 InitModuleData: TInitModuleData; 499 499 begin 500 assert(bix.Kind <> btSuperVirtual);500 Assert(bix.Kind <> btSuperVirtual); 501 501 with bix do begin 502 502 if Initialized then 503 exit;503 Exit; 504 504 if Kind = btAI then 505 505 begin { get client function } … … 509 509 else 510 510 begin 511 hm := LoadLibrary( pchar(DLLName));511 hm := LoadLibrary(PChar(DLLName)); 512 512 if hm = 0 then 513 513 begin … … 525 525 if @Client <> nil then 526 526 begin 527 Initialized := true;527 Initialized := True; 528 528 InitModuleData.Server := @Server; 529 529 InitModuleData.DataVersion := 0; … … 542 542 procedure SaveMap(FileName: string); 543 543 var 544 i: integer;544 I: Integer; 545 545 MapFile: TFileStream; 546 s: string[255];546 S: string[255]; 547 547 begin 548 548 MapFile := TFileStream.Create(GetMapsDir + DirectorySeparator + FileName, … … 550 550 try 551 551 MapFile.Position := 0; 552 s:= 'cEvoMap'#0;553 MapFile. write(s[1], 8); { file id }554 i:= 0;555 MapFile. write(i, 4); { format id }556 MapFile. write(MaxTurn, 4);557 MapFile. write(lx, 4);558 MapFile. write(ly, 4);559 MapFile. write(RealMap, MapSize * 4);552 S := 'cEvoMap'#0; 553 MapFile.Write(S[1], 8); { file id } 554 I := 0; 555 MapFile.Write(I, 4); { format id } 556 MapFile.Write(MaxTurn, 4); 557 MapFile.Write(lx, 4); 558 MapFile.Write(ly, 4); 559 MapFile.Write(RealMap, MapSize * 4); 560 560 finally 561 561 FreeAndNil(MapFile); … … 563 563 end; 564 564 565 function LoadMap(FileName: string): boolean;565 function LoadMap(FileName: string): Boolean; 566 566 var 567 i, Loc1: integer;567 I, Loc1: Integer; 568 568 MapFile: TFileStream; 569 s: string[255];569 S: string[255]; 570 570 begin 571 result := false;571 Result := False; 572 572 MapFile := nil; 573 573 try 574 574 MapFile := TFileStream.Create(FileName, fmOpenRead or fmShareExclusive); 575 575 MapFile.Position := 0; 576 MapFile. read(s[1], 8); { file id }577 MapFile. read(i, 4); { format id }578 if i= 0 then576 MapFile.Read(S[1], 8); { file id } 577 MapFile.Read(I, 4); { format id } 578 if I = 0 then 579 579 begin 580 MapFile. read(i, 4); // MaxTurn581 MapFile. read(lx, 4);582 MapFile. read(ly, 4);580 MapFile.Read(I, 4); // MaxTurn 581 MapFile.Read(lx, 4); 582 MapFile.Read(ly, 4); 583 583 ly := ly and not 1; 584 584 if lx > lxmax then … … 587 587 ly := lymax; 588 588 MapSize := lx * ly; 589 MapFile. read(RealMap, MapSize * 4);589 MapFile.Read(RealMap, MapSize * 4); 590 590 for Loc1 := 0 to MapSize - 1 do 591 591 begin … … 600 600 or fDesert; 601 601 end; 602 result := true;602 Result := True; 603 603 end; 604 604 FreeAndNil(MapFile); … … 609 609 end; 610 610 611 procedure SaveGame(FileName: string; auto: boolean);611 procedure SaveGame(FileName: string; Auto: Boolean); 612 612 var 613 x, y, i, zero, Tile, nLocal: integer;613 X, Y, I, zero, Tile, nLocal: Integer; 614 614 LogFile: TFileStream; 615 s: string[255];615 S: string[255]; 616 616 SaveMap: array [0 .. lxmax * lymax - 1] of Byte; 617 617 begin 618 618 nLocal := 0; 619 for i:= 0 to nPl - 1 do620 if Assigned(bix[ i]) and (bix[i].Kind = btTerm) then621 inc(nLocal);619 for I := 0 to nPl - 1 do 620 if Assigned(bix[I]) and (bix[I].Kind = btTerm) then 621 Inc(nLocal); 622 622 if Difficulty[0] = 0 then 623 623 nLocal := 0; 624 624 if nLocal <= 1 then 625 for y:= 0 to ly - 1 do626 for x:= 0 to lx - 1 do627 begin 628 Tile := RW[0].Map[( x + SaveMapCenterLoc + lx shr 1) mod lx + lx * y];629 SaveMap[ x + lx * y] := Tile and fTerrain + Tile and625 for Y := 0 to ly - 1 do 626 for X := 0 to lx - 1 do 627 begin 628 Tile := RW[0].Map[(X + SaveMapCenterLoc + lx shr 1) mod lx + lx * Y]; 629 SaveMap[X + lx * Y] := Tile and fTerrain + Tile and 630 630 (fCity or fUnit or fOwned) shr 16; 631 631 end; 632 632 633 if auto and AutoSaveExists then // append to existing file633 if Auto and AutoSaveExists then // append to existing file 634 634 LogFile := TFileStream.Create(SavePath + FileName, fmOpenReadWrite or 635 635 fmShareExclusive) … … 640 640 zero := 0; 641 641 LogFile.Position := 0; 642 s:= 'cEvoBook';643 LogFile. write(s[1], 8); { file id }644 i:= CevoVersion;645 LogFile. write(i, 4); { c-evo version }646 LogFile. write(ExeInfo.Time, 4);647 LogFile. write(lx, 4);648 LogFile. write(ly, 4);649 LogFile. write(LandMass, 4);642 S := 'cEvoBook'; 643 LogFile.Write(S[1], 8); { file id } 644 I := CevoVersion; 645 LogFile.Write(I, 4); { c-evo version } 646 LogFile.Write(ExeInfo.Time, 4); 647 LogFile.Write(lx, 4); 648 LogFile.Write(ly, 4); 649 LogFile.Write(LandMass, 4); 650 650 if LandMass = 0 then 651 LogFile. write(MapField^, MapSize * 4);652 653 LogFile. write(MaxTurn, 4);654 LogFile. write(RND, 4);655 LogFile. write(GTurn, 4);651 LogFile.Write(MapField^, MapSize * 4); 652 653 LogFile.Write(MaxTurn, 4); 654 LogFile.Write(RND, 4); 655 LogFile.Write(GTurn, 4); 656 656 if nLocal > 1 then // multiplayer game -- no quick view 657 657 begin 658 i:= $80;659 LogFile. write(i, 4);658 I := $80; 659 LogFile.Write(I, 4); 660 660 end 661 661 else 662 LogFile. write(SaveMap, ((MapSize - 1) div 4 + 1) * 4);663 for i:= 0 to nPl - 1 do664 if not Assigned(bix[ i]) then665 LogFile. write(zero, 4)662 LogFile.Write(SaveMap, ((MapSize - 1) div 4 + 1) * 4); 663 for I := 0 to nPl - 1 do 664 if not Assigned(bix[I]) then 665 LogFile.Write(zero, 4) 666 666 else 667 667 begin 668 if PlayersBrain[ i].Kind in [btRandom, btAI] then669 s := bix[i].FileName670 else 671 s := PlayersBrain[i].FileName;672 move(zero, s[Length(s) + 1], 4);673 LogFile. write(s, (Length(s) div 4 + 1) * 4);674 LogFile. write(OriginalDataVersion[i], 4);675 s:= ''; { behavior }676 move(zero, s[Length(s) + 1], 4);677 LogFile. write(s, (Length(s) div 4 + 1) * 4);678 LogFile. write(Difficulty[i], 4);668 if PlayersBrain[I].Kind in [btRandom, btAI] then 669 S := bix[I].FileName 670 else 671 S := PlayersBrain[I].FileName; 672 Move(zero, S[Length(S) + 1], 4); 673 LogFile.Write(S, (Length(S) div 4 + 1) * 4); 674 LogFile.Write(OriginalDataVersion[I], 4); 675 S := ''; { behavior } 676 Move(zero, S[Length(S) + 1], 4); 677 LogFile.Write(S, (Length(S) div 4 + 1) * 4); 678 LogFile.Write(Difficulty[I], 4); 679 679 end; 680 680 681 if auto and AutoSaveExists then681 if Auto and AutoSaveExists then 682 682 CL.AppendToFile(LogFile, AutoSaveState) 683 683 else 684 684 CL.SaveToFile(LogFile); 685 685 FreeAndNil(LogFile); 686 if auto then686 if Auto then 687 687 begin 688 688 AutoSaveState := CL.State; 689 AutoSaveExists := true;689 AutoSaveExists := True; 690 690 end 691 691 end; … … 693 693 procedure StartGame; 694 694 var 695 i, p, p1, Human, nAlive, bixUni: integer;695 I, P, p1, Human, nAlive, bixUni: Integer; 696 696 Game: TNewGameData; 697 697 // GameEx: TNewGameExData; … … 722 722 723 723 BrainUsed := []; 724 for p:= 0 to nPl - 1 do725 if Assigned(bix[ p]) and ((Mode <> moMovie) or (p= 0)) then724 for P := 0 to nPl - 1 do 725 if Assigned(bix[P]) and ((Mode <> moMovie) or (P = 0)) then 726 726 begin { initiate selected control module } 727 AIInfo[ p] := bix[p].Name + #0;728 InitBrain(bix[ p]);727 AIInfo[P] := bix[P].Name + #0; 728 InitBrain(bix[P]); 729 729 if Mode = moPlaying then 730 730 begin // new game, this data version is original 731 OriginalDataVersion[ p] := bix[p].DataVersion;732 ProcessClientData[ p] := true;731 OriginalDataVersion[P] := bix[P].DataVersion; 732 ProcessClientData[P] := True; 733 733 end 734 734 else // loading game, compare with data version read from file 735 ProcessClientData[ p] := ProcessClientData[p] and736 (OriginalDataVersion[ p] = bix[p].DataVersion);737 if @bix[ p].Client = nil then // client function not found735 ProcessClientData[P] := ProcessClientData[P] and 736 (OriginalDataVersion[P] = bix[P].DataVersion); 737 if @bix[P].Client = nil then // client function not found 738 738 if bix[0].Kind = btNoTerm then 739 bix[ p] := nil739 bix[P] := nil 740 740 else 741 741 begin 742 bix[ p] := BrainTerm;743 OriginalDataVersion[ p] := -1;744 ProcessClientData[ p] := false;742 bix[P] := BrainTerm; 743 OriginalDataVersion[P] := -1; 744 ProcessClientData[P] := False; 745 745 end; 746 if Assigned(bix[ p]) then747 include(BrainUsed, Brains.IndexOf(bix[p]));746 if Assigned(bix[P]) then 747 Include(BrainUsed, Brains.IndexOf(bix[P])); 748 748 end; 749 749 … … 760 760 begin 761 761 if Mode <> moMovie then 762 inc(GWatching, 1 shl p1);762 Inc(GWatching, 1 shl p1); 763 763 if bix[p1].Kind = btAI then 764 inc(GAI, 1 shl p1);764 Inc(GAI, 1 shl p1); 765 765 if Difficulty[p1] > 0 then 766 766 begin 767 inc(GAlive, 1 shl p1);768 inc(nAlive);767 Inc(GAlive, 1 shl p1); 768 Inc(nAlive); 769 769 end; 770 770 ServerVersion[p1] := bix[p1].ServerVersion; … … 779 779 780 780 GTurn := 0; 781 for i:= 0 to nWonder - 1 do782 with GWonder[ i] do781 for I := 0 to nWonder - 1 do 782 with GWonder[I] do 783 783 begin 784 784 CityID := -1; … … 787 787 FillChar(GShip, SizeOf(GShip), 0); 788 788 789 for p:= 0 to nPl - 1 do790 if 1 shl pand (GAlive or GWatching) <> 0 then791 with RW[ p] do789 for P := 0 to nPl - 1 do 790 if 1 shl P and (GAlive or GWatching) <> 0 then 791 with RW[P] do 792 792 begin 793 793 Government := gDespotism; … … 799 799 AnarchyStart := -AnarchyTurns - 1; 800 800 Happened := 0; 801 LastValidStat[ p] := -1;802 Worked[ p] := 0;803 Founded[ p] := 0;804 DevModelTurn[ p] := -1;801 LastValidStat[P] := -1; 802 Worked[P] := 0; 803 Founded[P] := 0; 804 DevModelTurn[P] := -1; 805 805 OracleIncome := 0; 806 806 807 if bix[ p].DataSize > 0 then807 if bix[P].DataSize > 0 then 808 808 begin 809 GetMem(SavedData[ p], bix[p].DataSize * 4);810 GetMem(Data, bix[ p].DataSize * 4);811 FillChar(SavedData[ p]^, bix[p].DataSize * 4, 0);812 FillChar(Data^, bix[ p].DataSize * 4, 0);809 GetMem(SavedData[P], bix[P].DataSize * 4); 810 GetMem(Data, bix[P].DataSize * 4); 811 FillChar(SavedData[P]^, bix[P].DataSize * 4, 0); 812 FillChar(Data^, bix[P].DataSize * 4, 0); 813 813 end 814 814 else 815 815 begin 816 816 Data := nil; 817 SavedData[ p] := nil817 SavedData[P] := nil; 818 818 end; 819 819 nBattleHistory := 0; … … 825 825 end 826 826 else } BorderHelper := nil; 827 for i:= 0 to nStat - 1 do828 GetMem(Stat[ i, p], 4 * (MaxTurn + 1));829 if bix[ p].Flags and fDotNet <> 0 then827 for I := 0 to nStat - 1 do 828 GetMem(Stat[I, P], 4 * (MaxTurn + 1)); 829 if bix[P].Flags and fDotNet <> 0 then 830 830 begin 831 GetMem(RW[ p].DefaultDebugMap, MapSize * 4);832 FillChar(RW[ p].DefaultDebugMap^, MapSize * 4, 0);833 DebugMap[ p] := RW[p].DefaultDebugMap;831 GetMem(RW[P].DefaultDebugMap, MapSize * 4); 832 FillChar(RW[P].DefaultDebugMap^, MapSize * 4, 0); 833 DebugMap[P] := RW[P].DefaultDebugMap; 834 834 end 835 835 else 836 RW[ p].DefaultDebugMap := nil;837 838 { !!!for i:=0 to nShipPart-1 do GShip[p].Parts[i]:=Delphirandom((3-i)*2); {}836 RW[P].DefaultDebugMap := nil; 837 838 { !!!for i:=0 to nShipPart-1 do GShip[p].Parts[i]:=Delphirandom((3-i)*2); } 839 839 end; 840 840 … … 842 842 begin // random map 843 843 InitRandomGame; 844 PreviewElevation := false;844 PreviewElevation := False; 845 845 MapField := nil; 846 846 end … … 850 850 LoadMap(MapFileName); // new game -- load map from file 851 851 GetMem(MapField, MapSize * 4); 852 move(RealMap, MapField^, MapSize * 4);852 Move(RealMap, MapField^, MapSize * 4); 853 853 Human := 0; 854 854 for p1 := 0 to nPl - 1 do 855 855 if Assigned(bix[p1]) and (bix[p1].Kind = btTerm) then 856 inc(Human, 1 shl p1);856 Inc(Human, 1 shl p1); 857 857 InitMapGame(Human); 858 858 end; 859 859 CityProcessing.InitGame; 860 860 UnitProcessing.InitGame; 861 for p:= 0 to nPl - 1 do862 if 1 shl pand (GAlive or GWatching) <> 0 then863 Inform( p);861 for P := 0 to nPl - 1 do 862 if 1 shl P and (GAlive or GWatching) <> 0 then 863 Inform(P); 864 864 865 865 pTurn := -1; … … 870 870 Game.LandMass := LandMass; 871 871 Game.MaxTurn := MaxTurn; 872 move(Difficulty, Game.Difficulty, SizeOf(Difficulty));872 Move(Difficulty, Game.Difficulty, SizeOf(Difficulty)); 873 873 // GameEx.lx:=lx; GameEx.ly:=ly; GameEx.LandMass:=LandMass; 874 874 // GameEx.MaxTurn:=MaxTurn; GameEx.RND:=RND; 875 875 // move(Difficulty,GameEx.Difficulty,SizeOf(Difficulty)); 876 876 AICredits := ''; 877 for i:= 0 to Brains.Count - 1 do877 for I := 0 to Brains.Count - 1 do 878 878 with Brains[I] do begin 879 879 if Initialized then 880 if iin BrainUsed then880 if I in BrainUsed then 881 881 begin 882 882 if Kind = btAI then 883 883 Notify(ntInitPlayers); 884 for p:= 0 to nPl - 1 do884 for P := 0 to nPl - 1 do 885 885 begin 886 if Brains.IndexOf(bix[ p]) = ithen887 Game.RO[ p] := @RW[p]886 if Brains.IndexOf(bix[P]) = I then 887 Game.RO[P] := @RW[P] 888 888 else 889 Game.RO[ p] := nil;890 if (Kind = btTerm) and (Difficulty[0] = 0) and Assigned(bix[ p]) then891 Game.SuperVisorRO[ p] := @RW[p]889 Game.RO[P] := nil; 890 if (Kind = btTerm) and (Difficulty[0] = 0) and Assigned(bix[P]) then 891 Game.SuperVisorRO[P] := @RW[P] 892 892 else 893 Game.SuperVisorRO[ p] := nil;893 Game.SuperVisorRO[P] := nil; 894 894 end; 895 895 if Flags and fDotNet > 0 then 896 896 begin 897 897 Path := DLLName; 898 move(Path[1], Game.AssemblyPath, Length(Path));898 Move(Path[1], Game.AssemblyPath, Length(Path)); 899 899 Game.AssemblyPath[Length(Path)] := #0; 900 900 end … … 903 903 case Mode of 904 904 moLoading, moLoading_Fast: 905 CallClient( i, cLoadGame, Game);905 CallClient(I, cLoadGame, Game); 906 906 moMovie: 907 CallClient( i, cMovie, Game);907 CallClient(I, cMovie, Game); 908 908 moPlaying: 909 CallClient( i, cNewGame, Game);909 CallClient(I, cNewGame, Game); 910 910 end; 911 911 if (Kind = btAI) and (Credits <> '') then … … 917 917 else 918 918 begin { module no longer used -- unload } 919 CallClient( i, cReleaseModule, nil^);919 CallClient(I, cReleaseModule, nil^); 920 920 if Kind = btAI then 921 921 begin … … 924 924 Client := nil; 925 925 end; 926 Initialized := false;926 Initialized := False; 927 927 end; 928 928 end; … … 952 952 CheckBorders(-1); 953 953 {$IFOPT O-}InvalidTreatyMap := 0; {$ENDIF} 954 AutoSaveExists := false;954 AutoSaveExists := False; 955 955 pDipActive := -1; 956 956 pTurn := 0; … … 958 958 if Mode >= moMovie then 959 959 Notify(ntEndInfo); 960 end; { StartGame }960 end; 961 961 962 962 procedure EndGame; 963 963 var 964 i, p1: integer;964 I, p1: Integer; 965 965 begin 966 966 if LandMass = 0 then … … 969 969 if Assigned(bix[p1]) then 970 970 begin 971 for i:= 0 to nStat - 1 do972 FreeMem(Stat[ i, p1]);971 for I := 0 to nStat - 1 do 972 FreeMem(Stat[I, p1]); 973 973 if RW[p1].BattleHistory <> nil then 974 974 FreeMem(RW[p1].BattleHistory); … … 985 985 end; 986 986 987 procedure GenerateStat( p: integer);987 procedure GenerateStat(P: Integer); 988 988 var 989 cix, uix: integer;989 cix, uix: Integer; 990 990 begin 991 if Difficulty[ p] > 0 then992 with RW[ p] do991 if Difficulty[P] > 0 then 992 with RW[P] do 993 993 begin 994 Stat[stPop, p, GTurn] := 0;994 Stat[stPop, P, GTurn] := 0; 995 995 for cix := 0 to nCity - 1 do 996 996 if City[cix].Loc >= 0 then 997 inc(Stat[stPop, p, GTurn], City[cix].Size);998 Stat[stScience, p, GTurn] := Researched[p] * 50;999 if (RW[ p].ResearchTech >= 0) and (RW[p].ResearchTech <> adMilitary) then1000 inc(Stat[stScience, p, GTurn], Research * 100 div TechBaseCost(nTech[p],1001 Difficulty[ p]));1002 Stat[stMil, p, GTurn] := 0;997 Inc(Stat[stPop, P, GTurn], City[cix].Size); 998 Stat[stScience, P, GTurn] := Researched[P] * 50; 999 if (RW[P].ResearchTech >= 0) and (RW[P].ResearchTech <> adMilitary) then 1000 Inc(Stat[stScience, P, GTurn], Research * 100 div TechBaseCost(nTech[P], 1001 Difficulty[P])); 1002 Stat[stMil, P, GTurn] := 0; 1003 1003 for uix := 0 to nUn - 1 do 1004 1004 if Un[uix].Loc >= 0 then … … 1006 1006 begin 1007 1007 if (Kind <= mkEnemyDeveloped) and (Un[uix].mix <> 1) then 1008 inc(Stat[stMil, p, GTurn], Weight * MStrength *1008 Inc(Stat[stMil, P, GTurn], Weight * MStrength * 1009 1009 Un[uix].Health div 100) 1010 1010 else if Domain = dGround then 1011 inc(Stat[stMil, p, GTurn], (Attack + 2 * Defense) *1011 Inc(Stat[stMil, P, GTurn], (Attack + 2 * Defense) * 1012 1012 Un[uix].Health div 100) 1013 1013 else 1014 inc(Stat[stMil, p, GTurn], (Attack + Defense) *1014 Inc(Stat[stMil, P, GTurn], (Attack + Defense) * 1015 1015 Un[uix].Health div 100); 1016 1016 case Kind of 1017 1017 mkSlaves: 1018 inc(Stat[stPop, p, GTurn]);1018 Inc(Stat[stPop, P, GTurn]); 1019 1019 mkSettler: 1020 inc(Stat[stPop, p, GTurn], 2);1020 Inc(Stat[stPop, P, GTurn], 2); 1021 1021 end; 1022 1022 end; 1023 Stat[stMil, p, GTurn] := Stat[stMil, p, GTurn] div 16;1024 Stat[stExplore, p, GTurn] := Discovered[p];1025 Stat[stTerritory, p, GTurn] := TerritoryCount[p];1026 Stat[stWork, p, GTurn] := Worked[p];1027 LastValidStat[ p] := GTurn;1023 Stat[stMil, P, GTurn] := Stat[stMil, P, GTurn] div 16; 1024 Stat[stExplore, P, GTurn] := Discovered[P]; 1025 Stat[stTerritory, P, GTurn] := TerritoryCount[P]; 1026 Stat[stWork, P, GTurn] := Worked[P]; 1027 LastValidStat[P] := GTurn; 1028 1028 end; 1029 1029 end; … … 1031 1031 procedure LogCityTileChanges; 1032 1032 var 1033 cix: integer;1033 cix: Integer; 1034 1034 begin 1035 1035 for cix := 0 to RW[pTurn].nCity - 1 do … … 1052 1052 procedure NoLogCityTileChanges; 1053 1053 var 1054 cix: integer;1054 cix: Integer; 1055 1055 begin 1056 1056 for cix := 0 to RW[pTurn].nCity - 1 do … … 1063 1063 end; 1064 1064 1065 function HasCityTileChanges: boolean;1065 function HasCityTileChanges: Boolean; 1066 1066 var 1067 cix: integer;1067 cix: Integer; 1068 1068 begin 1069 result := false;1069 Result := False; 1070 1070 for cix := 0 to RW[pTurn].nCity - 1 do 1071 1071 with RW[pTurn].City[cix] do … … 1074 1074 // if SavedResourceWeights[cix]<>ResourceWeights then result:=true; 1075 1075 if SavedTiles[cix] <> Tiles then 1076 result := true;1076 Result := True; 1077 1077 end; 1078 1078 end; … … 1080 1080 procedure BeforeTurn0; 1081 1081 var 1082 p1, uix: integer;1082 p1, uix: Integer; 1083 1083 begin 1084 1084 for uix := 0 to RW[pTurn].nUn - 1 do { init movement points for first turn } … … 1101 1101 end; 1102 1102 1103 function LoadGame(const Path, FileName: string; Turn: integer;1104 MovieMode: boolean): boolean;1103 function LoadGame(const Path, FileName: string; Turn: Integer; 1104 MovieMode: Boolean): Boolean; 1105 1105 var 1106 1106 J: TBrain; 1107 i, ix, d, p1, Command, Subject: integer;1107 I, ix, D, p1, Command, Subject: Integer; 1108 1108 K: Integer; 1109 {$IFDEF TEXTLOG}LoadPos0: integer; {$ENDIF}1110 Data: pointer;1109 {$IFDEF TEXTLOG}LoadPos0: Integer; {$ENDIF} 1110 Data: Pointer; 1111 1111 LogFile: TFileStream; 1112 1112 FormerCLState: TCmdListState; 1113 s: string[255];1113 S: string[255]; 1114 1114 SaveMap: array [0 .. lxmax * lymax - 1] of Byte; 1115 Started, StatRequest: boolean;1115 Started, StatRequest: Boolean; 1116 1116 begin 1117 1117 SavePath := Path; … … 1121 1121 fmShareExclusive); 1122 1122 LogFile.Position := 0; 1123 LogFile.Read( s[1], 8); { file id }1124 LogFile.Read( i, 4); { c-evo version }1123 LogFile.Read(S[1], 8); { file id } 1124 LogFile.Read(I, 4); { c-evo version } 1125 1125 LogFile.Read(J, 4); { exe time } 1126 1126 1127 if ( i >= FirstBookCompatibleVersion) and (i<= CevoVersion) then1127 if (I >= FirstBookCompatibleVersion) and (I <= CevoVersion) then 1128 1128 begin 1129 result := true;1129 Result := True; 1130 1130 LogFile.Read(lx, 4); 1131 1131 LogFile.Read(ly, 4); … … 1139 1139 LogFile.Read(SaveMap, 4); 1140 1140 if SaveMap[0] <> $80 then 1141 LogFile. read(SaveMap[4], ((MapSize - 1) div 4 + 1) * 4 - 4);1141 LogFile.Read(SaveMap[4], ((MapSize - 1) div 4 + 1) * 4 - 4); 1142 1142 for p1 := 0 to nPl - 1 do 1143 1143 begin 1144 LogFile.Read( s[0], 4);1145 if s[0] = #0 then1144 LogFile.Read(S[0], 4); 1145 if S[0] = #0 then 1146 1146 PlayersBrain[p1] := nil 1147 1147 else 1148 1148 begin 1149 LogFile.Read( s[4], Byte(s[0]) div 4 * 4);1149 LogFile.Read(S[4], Byte(S[0]) div 4 * 4); 1150 1150 LogFile.Read(OriginalDataVersion[p1], 4); 1151 LogFile.Read( d, 4); { behavior }1151 LogFile.Read(D, 4); { behavior } 1152 1152 LogFile.Read(Difficulty[p1], 4); 1153 1153 J := Brains.Last; 1154 while Assigned(J) and (AnsiCompareFileName(J.FileName, s) <> 0) do begin1154 while Assigned(J) and (AnsiCompareFileName(J.FileName, S) <> 0) do begin 1155 1155 K := Brains.IndexOf(J) - 1; 1156 1156 if K >= 0 then J := Brains[K] … … 1159 1159 if not Assigned(J) then 1160 1160 begin // ai not found -- replace by local player 1161 ProcessClientData[p1] := false;1162 NotifyMessage := s;1161 ProcessClientData[p1] := False; 1162 NotifyMessage := S; 1163 1163 Notify(ntAIError); 1164 1164 J := BrainTerm; 1165 1165 end 1166 1166 else 1167 ProcessClientData[p1] := true;1168 if j.Kind = btNoTerm then1169 j:= BrainSuperVirtual;1167 ProcessClientData[p1] := True; 1168 if J.Kind = btNoTerm then 1169 J := BrainSuperVirtual; 1170 1170 // crashed tournament -- load as supervisor 1171 PlayersBrain[p1] := j;1171 PlayersBrain[p1] := J; 1172 1172 end; 1173 1173 end; 1174 1174 end 1175 1175 else 1176 Result := false;1176 Result := False; 1177 1177 1178 1178 if Result then begin … … 1181 1181 end; 1182 1182 FreeAndNil(LogFile); 1183 if not result then1183 if not Result then 1184 1184 Exit; 1185 1185 … … 1195 1195 {$IFDEF TEXTLOG}AssignFile(TextLog, SavePath + LogFileName + '.txt'); 1196 1196 Rewrite(TextLog); {$ENDIF} 1197 LoadOK := true;1197 LoadOK := True; 1198 1198 StartGame; 1199 1199 if MovieMode then … … 1205 1205 Notify(ntLoadBegin); 1206 1206 1207 started := false;1208 StatRequest := false;1209 MovieStopped := false;1207 started := False; 1208 StatRequest := False; 1209 MovieStopped := False; 1210 1210 {$IFDEF LOADPERF}QueryPerformanceCounter(time_total0); 1211 1211 time_a := 0; … … 1222 1222 begin 1223 1223 GenerateStat(pTurn); 1224 StatRequest := false;1224 StatRequest := False; 1225 1225 end; 1226 1226 // complete all internal commands following an sTurn before generating statistics … … 1237 1237 CallPlayer(cMovieTurn, 0, nil^); 1238 1238 end; 1239 StatRequest := true;1240 started := true;1239 StatRequest := True; 1240 started := True; 1241 1241 end 1242 1242 else if (Command = sTurn) and (pTurn = 0) and (GTurn = LoadTurn) then 1243 1243 begin 1244 assert(CL.State.LoadPos = FormerCLState.LoadPos + 4); // size of sTurn1244 Assert(CL.State.LoadPos = FormerCLState.LoadPos + 4); // size of sTurn 1245 1245 CL.State := FormerCLState; 1246 1246 CL.Cut; … … 1278 1278 EndGame; 1279 1279 Notify(ntStartGo); 1280 result := false;1281 exit;1280 Result := False; 1281 Exit; 1282 1282 end; 1283 1283 1284 1284 if StatRequest then 1285 1285 GenerateStat(pTurn); 1286 assert(started);1286 Assert(started); 1287 1287 {$IFDEF TEXTLOG}CloseFile(TextLog); {$ENDIF} 1288 1288 {$IFDEF LOADPERF}QueryPerformanceCounter(time_total); { time in s is: (time_total-time_total0)/PerfFreq }{$ENDIF} … … 1324 1324 Inform(pTurn); 1325 1325 ChangeClientWhenDone(cResume, 0, nil^, 0); 1326 end; // LoadGame1326 end; 1327 1327 1328 1328 procedure InsertTerritoryUpdateCommands; 1329 1329 var 1330 p1, Command, Subject: integer;1331 Data: pointer;1330 p1, Command, Subject: Integer; 1331 Data: Pointer; 1332 1332 FormerCLState: TCmdListState; 1333 1333 begin … … 1351 1351 1352 1352 procedure StartNewGame(const Path, FileName, Map: string; 1353 Newlx, Newly, NewLandMass, NewMaxTurn: integer);1353 Newlx, Newly, NewLandMass, NewMaxTurn: Integer); 1354 1354 var 1355 1355 I: Integer; … … 1395 1395 end; 1396 1396 1397 procedure DirectHelp(Command: integer);1397 procedure DirectHelp(Command: Integer); 1398 1398 begin 1399 1399 InitBrain(BrainTerm); … … 1402 1402 end; 1403 1403 1404 procedure EditMap(const Map: string; Newlx, Newly, NewLandMass: integer);1404 procedure EditMap(const Map: string; Newlx, Newly, NewLandMass: Integer); 1405 1405 var 1406 p1, Loc1: integer;1406 p1, Loc1: Integer; 1407 1407 Game: TNewGameData; 1408 1408 begin … … 1446 1446 end; 1447 1447 1448 procedure DestroySpacePort_TellPlayers( p, pCapturer: integer);1448 procedure DestroySpacePort_TellPlayers(P, pCapturer: Integer); 1449 1449 var 1450 cix, i, p1: integer;1450 cix, I, p1: Integer; 1451 1451 ShowShipChange: TShowShipChange; 1452 1452 begin 1453 1453 // stop ship part production 1454 for cix := 0 to RW[ p].nCity - 1 do1455 with RW[ p].City[cix] do1454 for cix := 0 to RW[P].nCity - 1 do 1455 with RW[P].City[cix] do 1456 1456 if (Loc >= 0) and (Project and cpImp <> 0) and 1457 1457 ((Project and cpIndex = woMIR) or 1458 1458 (Imp[Project and cpIndex].Kind = ikShipPart)) then 1459 1459 begin 1460 inc(RW[p].Money, Prod0);1460 Inc(RW[P].Money, Prod0); 1461 1461 Prod := 0; 1462 1462 Prod0 := 0; … … 1466 1466 1467 1467 // destroy ship 1468 with GShip[ p] do1468 with GShip[P] do 1469 1469 if Parts[0] + Parts[1] + Parts[2] > 0 then 1470 1470 begin 1471 for i:= 0 to nShipPart - 1 do1472 begin 1473 ShowShipChange.Ship1Change[ i] := -Parts[i];1471 for I := 0 to nShipPart - 1 do 1472 begin 1473 ShowShipChange.Ship1Change[I] := -Parts[I]; 1474 1474 if pCapturer >= 0 then 1475 1475 begin 1476 ShowShipChange.Ship2Change[ i] := Parts[i];1477 inc(GShip[pCapturer].Parts[i], Parts[i]);1476 ShowShipChange.Ship2Change[I] := Parts[I]; 1477 Inc(GShip[pCapturer].Parts[I], Parts[I]); 1478 1478 end; 1479 Parts[ i] := 0;1479 Parts[I] := 0; 1480 1480 end; 1481 1481 if Mode >= moMovie then … … 1485 1485 else 1486 1486 ShowShipChange.Reason := scrDestruction; 1487 ShowShipChange.Ship1Owner := p;1487 ShowShipChange.Ship1Owner := P; 1488 1488 ShowShipChange.Ship2Owner := pCapturer; 1489 1489 for p1 := 0 to nPl - 1 do 1490 1490 if 1 shl p1 and (GAlive or GWatching) <> 0 then 1491 1491 begin 1492 move(GShip, RW[p1].Ship, SizeOf(GShip));1492 Move(GShip, RW[p1].Ship, SizeOf(GShip)); 1493 1493 if 1 shl p1 and GWatching <> 0 then 1494 1494 CallPlayer(cShowShipChange, p1, ShowShipChange); … … 1498 1498 end; 1499 1499 1500 procedure DestroyCity_TellPlayers( p, cix: integer; SaveUnits: boolean);1500 procedure DestroyCity_TellPlayers(P, cix: Integer; SaveUnits: Boolean); 1501 1501 begin 1502 if RW[ p].City[cix].built[imSpacePort] > 0 then1503 DestroySpacePort_TellPlayers( p, -1);1504 DestroyCity( p, cix, SaveUnits);1502 if RW[P].City[cix].built[imSpacePort] > 0 then 1503 DestroySpacePort_TellPlayers(P, -1); 1504 DestroyCity(P, cix, SaveUnits); 1505 1505 end; 1506 1506 1507 procedure ChangeCityOwner_TellPlayers(pOld, cixOld, pNew: integer);1507 procedure ChangeCityOwner_TellPlayers(pOld, cixOld, pNew: Integer); 1508 1508 begin 1509 1509 if RW[pOld].City[cixOld].built[imSpacePort] > 0 then … … 1515 1515 end; 1516 1516 1517 procedure CheckWin( p: integer);1517 procedure CheckWin(P: Integer); 1518 1518 var 1519 i: integer;1520 ShipComplete: boolean;1519 I: Integer; 1520 ShipComplete: Boolean; 1521 1521 begin 1522 ShipComplete := true;1523 for i:= 0 to nShipPart - 1 do1524 if GShip[ p].Parts[i] < ShipNeed[i] then1525 ShipComplete := false;1522 ShipComplete := True; 1523 for I := 0 to nShipPart - 1 do 1524 if GShip[P].Parts[I] < ShipNeed[I] then 1525 ShipComplete := False; 1526 1526 if ShipComplete then 1527 GWinner := GWinner or 1 shl p; // game won!1527 GWinner := GWinner or 1 shl P; // game won! 1528 1528 end; 1529 1529 1530 1530 procedure BeforeTurn; 1531 1531 var 1532 i, p1, uix, cix, V21, Loc1, Cost, Job0, nAlive, nAppliers, ad, OldLoc,1533 SiegedTiles, nUpdateLoc: integer;1534 UpdateLoc: array [0 .. numax - 1] of integer;1532 I, p1, uix, cix, V21, Loc1, Cost, Job0, nAlive, nAppliers, ad, OldLoc, 1533 SiegedTiles, nUpdateLoc: Integer; 1534 UpdateLoc: array [0 .. numax - 1] of Integer; 1535 1535 Radius: TVicinity21Loc; 1536 1536 ShowShipChange: TShowShipChange; 1537 TribeExtinct, JobDone, MirBuilt: boolean;1537 TribeExtinct, JobDone, MirBuilt: Boolean; 1538 1538 begin 1539 {$IFOPT O-} assert(1 shl pTurn and InvalidTreatyMap = 0); {$ENDIF}1540 assert(1 shl pTurn and (GAlive or GWatching) <> 0);1539 {$IFOPT O-}Assert(1 shl pTurn and InvalidTreatyMap = 0); {$ENDIF} 1540 Assert(1 shl pTurn and (GAlive or GWatching) <> 0); 1541 1541 if (1 shl pTurn and GAlive = 0) and (Difficulty[pTurn] > 0) then 1542 exit;1542 Exit; 1543 1543 1544 1544 if (GWonder[woGrLibrary].EffectiveOwner = pTurn) and (GWinner = 0) then … … 1547 1547 for p1 := 0 to nPl - 1 do 1548 1548 if 1 shl p1 and GAlive <> 0 then 1549 inc(nAlive);1549 Inc(nAlive); 1550 1550 ad := 0; 1551 1551 while ad <= (nAdv - 5) do begin … … 1556 1556 if (p1 <> pTurn) and (1 shl p1 and GAlive <> 0) and 1557 1557 (RW[p1].Tech[ad] >= tsApplicable) then 1558 inc(nAppliers);1558 Inc(nAppliers); 1559 1559 if nAppliers * 2 > nAlive then 1560 1560 begin 1561 1561 SeeTech(pTurn, ad); 1562 inc(nTech[pTurn]);1562 Inc(nTech[pTurn]); 1563 1563 if Mode >= moMovie then 1564 1564 CallPlayer(cShowGreatLibTech, pTurn, ad); … … 1577 1577 RW[pTurn].nEnemyUn := 0; 1578 1578 1579 MirBuilt := false;1579 MirBuilt := False; 1580 1580 if (Difficulty[pTurn] > 0) and (GWinner = 0) then 1581 1581 with RW[pTurn] do … … 1600 1600 begin // transport unload 1601 1601 if Model[mix].Domain = dAir then 1602 dec(Un[Master].AirLoad)1602 Dec(Un[Master].AirLoad) 1603 1603 else 1604 dec(Un[Master].TroopLoad);1604 Dec(Un[Master].TroopLoad); 1605 1605 Master := -1; 1606 1606 end … … 1622 1622 if Mode >= moMovie then 1623 1623 FillChar(ShowShipChange, SizeOf(ShowShipChange), 0); 1624 TribeExtinct := true;1624 TribeExtinct := True; 1625 1625 nUpdateLoc := 0; 1626 1626 for cix := 0 to nCity - 1 do … … 1638 1638 begin 1639 1639 Loc1 := Radius[V21]; 1640 assert((Loc1 >= 0) and (Loc1 < MapSize) and1640 Assert((Loc1 >= 0) and (Loc1 < MapSize) and 1641 1641 (UsedByCity[Loc1] = Loc)); 1642 1642 p1 := RealMap[Loc1] shr 27; … … 1649 1649 UsedByCity[Loc1] := -1; 1650 1650 Flags := Flags or chSiege; 1651 inc(SiegedTiles);1651 Inc(SiegedTiles); 1652 1652 end; 1653 1653 end; … … 1656 1656 if not AddBestCityTile(pTurn, cix) then 1657 1657 Break; 1658 dec(SiegedTiles);1658 Dec(SiegedTiles); 1659 1659 end; 1660 1660 … … 1664 1664 1665 1665 if CityTurn(pTurn, cix) then 1666 TribeExtinct := false1666 TribeExtinct := False 1667 1667 else 1668 1668 begin // city is erased … … 1671 1671 Map[Loc] := Map[Loc] and not fCity; // !!! do this in inner core 1672 1672 UpdateLoc[nUpdateLoc] := Loc; 1673 inc(nUpdateLoc);1674 DestroyCity_TellPlayers(pTurn, cix, true);1673 Inc(nUpdateLoc); 1674 DestroyCity_TellPlayers(pTurn, cix, True); 1675 1675 end; 1676 1676 … … 1679 1679 begin 1680 1680 if Project0 and cpIndex = woMIR then // MIR completed 1681 MirBuilt := true1681 MirBuilt := True 1682 1682 else if Project0 and cpIndex = woManhattan then 1683 1683 GColdWarStart := GTurn 1684 1684 else if Imp[Project0 and cpIndex].Kind = ikShipPart 1685 1685 then { ship parts produced } 1686 inc(ShowShipChange.Ship1Change[Project0 and cpIndex -1686 Inc(ShowShipChange.Ship1Change[Project0 and cpIndex - 1687 1687 imShipComp]); 1688 1688 end; … … 1692 1692 begin 1693 1693 CheckBorders(-1, pTurn); 1694 for i:= 0 to nUpdateLoc - 1 do1695 UpdateUnitMap(UpdateLoc[ i], true);1694 for I := 0 to nUpdateLoc - 1 do 1695 UpdateUnitMap(UpdateLoc[I], True); 1696 1696 if Mode >= moMovie then 1697 1697 for p1 := 0 to nPl - 1 do 1698 1698 if (1 shl p1 and GWatching <> 0) and (p1 <> pTurn) then 1699 for i:= 0 to nUpdateLoc - 1 do1700 if ObserveLevel[UpdateLoc[ i]] shr (2 * p1) and 3 >= lObserveUnhidden1699 for I := 0 to nUpdateLoc - 1 do 1700 if ObserveLevel[UpdateLoc[I]] shr (2 * p1) and 3 >= lObserveUnhidden 1701 1701 then 1702 CallPlayer(cShowCityChanged, p1, UpdateLoc[ i]);1702 CallPlayer(cShowCityChanged, p1, UpdateLoc[I]); 1703 1703 end; 1704 1704 … … 1718 1718 Movement := UnitSpeed(pTurn, mix, Health); { refresh movement } 1719 1719 1720 assert(Loc >= 0);1720 Assert(Loc >= 0); 1721 1721 if Model[mix].Kind <> mkDiplomat then 1722 1722 begin // check treaty violation … … 1762 1762 begin 1763 1763 AddBestCityTile(pTurn, RW[pTurn].nCity - 1); 1764 UpdateUnitMap(Loc1, true);1764 UpdateUnitMap(Loc1, True); 1765 1765 if Mode >= moMovie then // tell enemies 1766 1766 for p1 := 0 to nPl - 1 do … … 1810 1810 end; 1811 1811 end; 1812 exit1812 Exit; 1813 1813 end; 1814 1814 … … 1824 1824 DiscoverTech(pTurn, ResearchTech); 1825 1825 1826 dec(Research, Cost);1826 Dec(Research, Cost); 1827 1827 Happened := Happened or phTech; 1828 ResearchTech := -1 1828 ResearchTech := -1; 1829 1829 end 1830 1830 else if (ResearchTech = -2) and (nCity > 0) then … … 1839 1839 (Treaty[p1] >= trPeace) then 1840 1840 begin 1841 inc(Credibility);1841 Inc(Credibility); 1842 1842 Break; 1843 1843 end; … … 1856 1856 if (p1 <> pTurn) and (1 shl p1 and (GAlive or GWatching) <> 0) then 1857 1857 begin 1858 move(GShip, RW[p1].Ship, SizeOf(GShip));1858 Move(GShip, RW[p1].Ship, SizeOf(GShip)); 1859 1859 if 1 shl p1 and GWatching <> 0 then 1860 1860 CallPlayer(cShowShipChange, p1, ShowShipChange); 1861 end 1861 end; 1862 1862 end; 1863 1863 if WinOnAlone and (GAlive and not(1 shl pTurn or 1) = 0) then … … 1871 1871 if (p1 <> pTurn) and ((GAlive or GWatching) and (1 shl p1) <> 0) then 1872 1872 RW[p1].EnemyReport[pTurn].Government := gDespotism; 1873 inc(Happened, phChangeGov)1873 Inc(Happened, phChangeGov); 1874 1874 end; 1875 1875 end; // if Difficulty[pTurn]>0 … … 1908 1908 end; 1909 1909 // CheckContact; 1910 end; { BeforeTurn }1910 end; 1911 1911 1912 1912 procedure AfterTurn; 1913 1913 var 1914 cix, uix, p1, Loc1, Job0: integer;1915 JobDone: boolean;1914 cix, uix, p1, Loc1, Job0: Integer; 1915 JobDone: Boolean; 1916 1916 begin 1917 1917 with RW[pTurn] do … … 1925 1925 end; 1926 1926 1927 inc(Money, OracleIncome);1927 Inc(Money, OracleIncome); 1928 1928 OracleIncome := 0; 1929 1929 if GWonder[woOracle].EffectiveOwner = pTurn then … … 1935 1935 if (RW[p1].City[cix].Loc >= 0) and 1936 1936 (RW[p1].City[cix].built[imTemple] > 0) then 1937 inc(OracleIncome);1937 Inc(OracleIncome); 1938 1938 end; 1939 1939 … … 1962 1962 begin 1963 1963 AddBestCityTile(pTurn, RW[pTurn].nCity - 1); 1964 UpdateUnitMap(Loc1, true);1964 UpdateUnitMap(Loc1, True); 1965 1965 if Mode >= moMovie then // tell enemies 1966 1966 for p1 := 0 to nPl - 1 do … … 1993 1993 else 1994 1994 begin 1995 dec(Fuel);1995 Dec(Fuel); 1996 1996 if Fuel < 0 then 1997 1997 begin … … 2013 2013 Flags := Flags and not unWithdrawn; 2014 2014 if (Loc >= 0) and (Model[mix].Domain = dGround) and (Master < 0) and 2015 (( integer(Movement) = Model[mix].Speed) or2015 ((Integer(Movement) = Model[mix].Speed) or 2016 2016 (Model[mix].Cap[mcAcademy] > 0) and (Movement * 2 >= Model[mix].Speed)) 2017 2017 then … … 2035 2035 CheckWin(p1); 2036 2036 end; 2037 end; // Afterturn2037 end; 2038 2038 2039 2039 procedure NextPlayer; … … 2049 2049 end; 2050 2050 2051 function ExecuteMove( p, uix, ToLoc: integer; var MoveInfo: TMoveInfo;2052 ShowMove: TShowMove): integer;2051 function ExecuteMove(P, uix, ToLoc: Integer; var MoveInfo: TMoveInfo; 2052 ShowMove: TShowMove): Integer; 2053 2053 var 2054 i, p1, FromLoc, uix1, nUpdateLoc: integer;2054 I, p1, FromLoc, uix1, nUpdateLoc: Integer; 2055 2055 MinLevel, MissionResult: Cardinal; 2056 2056 PModel: ^TModel; 2057 UpdateLoc: array [0 .. numax - 1] of integer;2058 SeeFrom, SeeTo, ExtDiscover: boolean;2057 UpdateLoc: array [0 .. numax - 1] of Integer; 2058 SeeFrom, SeeTo, ExtDiscover: Boolean; 2059 2059 begin 2060 result := 0;2061 with RW[ p], Un[uix] do2060 Result := 0; 2061 with RW[P], Un[uix] do 2062 2062 begin 2063 2063 PModel := @Model[mix]; … … 2065 2065 2066 2066 if Master < 0 then 2067 FreeUnit( p, uix);2067 FreeUnit(P, uix); 2068 2068 if (MoveInfo.MoveType in [mtMove, mtCapture]) and MoveInfo.MountainDelay 2069 2069 then … … 2073 2073 Loc := -2; 2074 2074 if TroopLoad + AirLoad > 0 then 2075 for i:= 0 to nUn - 1 do2076 if (Un[ i].Loc >= 0) and (Un[i].Master = uix) then2077 Un[ i].Loc := -2;2075 for I := 0 to nUn - 1 do 2076 if (Un[I].Loc >= 0) and (Un[I].Master = uix) then 2077 Un[I].Loc := -2; 2078 2078 UpdateUnitMap(FromLoc); 2079 2079 … … 2093 2093 ShowMove.Flags := ShowMove.Flags or umShipLoading; 2094 2094 for p1 := 0 to nPl - 1 do 2095 if (1 shl p1 and GWatching <> 0) and ((p1 <> p) or (bix[p1].Kind = btTerm))2095 if (1 shl p1 and GWatching <> 0) and ((p1 <> P) or (bix[p1].Kind = btTerm)) 2096 2096 then 2097 2097 begin … … 2102 2102 else 2103 2103 MinLevel := lObserveUnhidden; 2104 SeeFrom := (p1 = p) or (ObserveLevel[FromLoc] shr (2 * p1) and2104 SeeFrom := (p1 = P) or (ObserveLevel[FromLoc] shr (2 * p1) and 2105 2105 3 >= MinLevel); 2106 SeeTo := (p1 = p) or (ObserveLevel[ToLoc] shr (2 * p1) and2106 SeeTo := (p1 = P) or (ObserveLevel[ToLoc] shr (2 * p1) and 2107 2107 3 >= MinLevel); 2108 2108 if SeeFrom and SeeTo then 2109 2109 begin 2110 TellAboutModel(p1, p, mix);2111 if p1 = pthen2110 TellAboutModel(p1, P, mix); 2111 if p1 = P then 2112 2112 ShowMove.emix := -1 2113 2113 else 2114 ShowMove.emix := emixSafe(p1, p, mix);2114 ShowMove.emix := emixSafe(p1, P, mix); 2115 2115 if MoveInfo.MoveType = mtCapture then 2116 2116 CallPlayer(cShowCapturing, p1, ShowMove) … … 2126 2126 Loc := ToLoc; 2127 2127 if TroopLoad + AirLoad > 0 then 2128 for i:= 0 to nUn - 1 do2129 if Un[ i].Loc = -2 then2130 Un[ i].Loc := ToLoc;2131 2132 ExtDiscover := false;2128 for I := 0 to nUn - 1 do 2129 if Un[I].Loc = -2 then 2130 Un[I].Loc := ToLoc; 2131 2132 ExtDiscover := False; 2133 2133 nUpdateLoc := 0; 2134 2134 if MoveInfo.MoveType = mtCapture then 2135 2135 begin 2136 assert(Occupant[ToLoc] < 0);2136 Assert(Occupant[ToLoc] < 0); 2137 2137 for uix1 := 0 to RW[MoveInfo.Defender].nUn - 1 do 2138 2138 with RW[MoveInfo.Defender].Un[uix1] do … … 2140 2140 begin 2141 2141 UpdateLoc[nUpdateLoc] := Loc; 2142 inc(nUpdateLoc);2142 Inc(nUpdateLoc); 2143 2143 end; 2144 2144 // unit will be removed -- remember position and update for all players … … 2147 2147 then 2148 2148 begin // city captured 2149 ChangeCityOwner_TellPlayers(MoveInfo.Defender, MoveInfo.Dcix, p);2149 ChangeCityOwner_TellPlayers(MoveInfo.Defender, MoveInfo.Dcix, P); 2150 2150 City[nCity - 1].Flags := CaptureTurns shl 16; 2151 CityShrink( p, nCity - 1);2151 CityShrink(P, nCity - 1); 2152 2152 if Mode = moPlaying then 2153 with RW[ p].City[nCity - 1] do2153 with RW[P].City[nCity - 1] do 2154 2154 begin 2155 2155 // SavedResourceWeights[nCity-1]:=ResourceWeights; 2156 2156 SavedTiles[nCity - 1] := Tiles; 2157 2157 end; 2158 ExtDiscover := true;2158 ExtDiscover := True; 2159 2159 2160 2160 // Temple of Zeus effect 2161 if GWonder[woZeus].EffectiveOwner = pthen2161 if GWonder[woZeus].EffectiveOwner = P then 2162 2162 begin 2163 GiveCivilReport( p, MoveInfo.Defender);2164 for i:= 0 to nAdv - 1 do2165 if not( i in FutureTech) and (RW[p].Tech[i] < tsSeen) and2166 (RW[MoveInfo.Defender].Tech[ i] >= tsApplicable) then2163 GiveCivilReport(P, MoveInfo.Defender); 2164 for I := 0 to nAdv - 1 do 2165 if not(I in FutureTech) and (RW[P].Tech[I] < tsSeen) and 2166 (RW[MoveInfo.Defender].Tech[I] >= tsApplicable) then 2167 2167 begin 2168 2168 Happened := Happened or phStealTech; … … 2172 2172 end; 2173 2173 if Mode = moPlaying then 2174 LogCheckBorders( p, nCity - 1, MoveInfo.Defender);2174 LogCheckBorders(P, nCity - 1, MoveInfo.Defender); 2175 2175 {$IFOPT O-} if Mode < moPlaying then 2176 InvalidTreatyMap := not(1 shl p); {$ENDIF}2176 InvalidTreatyMap := not(1 shl P); {$ENDIF} 2177 2177 // territory should not be considered for the rest of the command 2178 2178 // execution, because during loading a game it's incorrect before … … 2181 2181 else // city destroyed 2182 2182 begin 2183 DestroyCity_TellPlayers(MoveInfo.Defender, MoveInfo.Dcix, false);2183 DestroyCity_TellPlayers(MoveInfo.Defender, MoveInfo.Dcix, False); 2184 2184 CheckBorders(ToLoc, MoveInfo.Defender); 2185 2185 end; 2186 RecalcPeaceMap( p);2186 RecalcPeaceMap(P); 2187 2187 if Mode >= moMovie then 2188 move(GWonder, Wonder, SizeOf(GWonder));2188 Move(GWonder, Wonder, SizeOf(GWonder)); 2189 2189 end; { if MoveInfo.MoveType=mtCapture } 2190 2190 2191 2191 if MoveInfo.MoveType = mtSpyMission then 2192 2192 begin 2193 MissionResult := DoSpyMission( p, MoveInfo.Defender, MoveInfo.Dcix,2193 MissionResult := DoSpyMission(P, MoveInfo.Defender, MoveInfo.Dcix, 2194 2194 SpyMission); 2195 2195 if (Mode = moPlaying) and (SpyMission = smStealForeignReports) then 2196 CallPlayer(cShowMissionResult, p, MissionResult);2196 CallPlayer(cShowMissionResult, P, MissionResult); 2197 2197 end; 2198 2198 2199 2199 Health := MoveInfo.EndHealth; 2200 dec(Movement, MoveInfo.Cost);2200 Dec(Movement, MoveInfo.Cost); 2201 2201 // transport unload 2202 2202 if Master >= 0 then 2203 2203 begin 2204 2204 if PModel.Domain = dAir then 2205 dec(Un[Master].AirLoad)2206 else 2207 begin 2208 dec(Un[Master].TroopLoad);2209 assert(Movement <= 0);2205 Dec(Un[Master].AirLoad) 2206 else 2207 begin 2208 Dec(Un[Master].TroopLoad); 2209 Assert(Movement <= 0); 2210 2210 end; 2211 2211 Master := -1; … … 2213 2213 2214 2214 if (Health <= 0) or (MoveInfo.MoveType = mtSpyMission) then 2215 RemoveUnit( p, uix) // spy mission or victim of HostileDamage2215 RemoveUnit(P, uix) // spy mission or victim of HostileDamage 2216 2216 else 2217 2217 begin // transport load … … 2220 2220 begin 2221 2221 if PModel.Domain = dAir then 2222 inc(Un[MoveInfo.ToMaster].AirLoad)2222 Inc(Un[MoveInfo.ToMaster].AirLoad) 2223 2223 else 2224 inc(Un[MoveInfo.ToMaster].TroopLoad);2224 Inc(Un[MoveInfo.ToMaster].TroopLoad); 2225 2225 end 2226 2226 else 2227 PlaceUnit( p, uix);2227 PlaceUnit(P, uix); 2228 2228 end; 2229 2229 2230 2230 if (MoveInfo.MoveType = mtCapture) and (nUpdateLoc > 0) then 2231 RecalcMapZoC( p);2231 RecalcMapZoC(P); 2232 2232 UpdateUnitMap(ToLoc, MoveInfo.MoveType = mtCapture); 2233 for i:= 0 to nUpdateLoc - 1 do2234 UpdateUnitMap(UpdateLoc[ i]);2233 for I := 0 to nUpdateLoc - 1 do 2234 UpdateUnitMap(UpdateLoc[I]); 2235 2235 // tell about lost units of defender 2236 2236 … … 2242 2242 (RealMap[ToLoc] and fTerImp = tiFort) or 2243 2243 (RealMap[ToLoc] and fTerImp = tiBase) then 2244 ExtDiscover := true;2244 ExtDiscover := True; 2245 2245 if (PModel.Kind = mkDiplomat) or (PModel.Cap[mcSpy] > 0) then 2246 i:= lObserveSuper2246 I := lObserveSuper 2247 2247 else if (PModel.Domain = dAir) or 2248 2248 (PModel.Cap[mcRadar] + PModel.Cap[mcCarrier] > 0) then 2249 i:= lObserveAll2250 else 2251 i:= lObserveUnhidden;2249 I := lObserveAll 2250 else 2251 I := lObserveUnhidden; 2252 2252 if ExtDiscover then 2253 2253 begin 2254 if Discover21(ToLoc, p, i, true, PModel.Domain = dGround) then2255 result := result or rEnemySpotted;2254 if Discover21(ToLoc, P, I, True, PModel.Domain = dGround) then 2255 Result := Result or rEnemySpotted; 2256 2256 end 2257 2257 else 2258 2258 begin 2259 if Discover9(ToLoc, p, i, true, PModel.Domain = dGround) then2260 result := result or rEnemySpotted;2259 if Discover9(ToLoc, P, I, True, PModel.Domain = dGround) then 2260 Result := Result or rEnemySpotted; 2261 2261 end; 2262 2262 end; … … 2264 2264 if Mode >= moMovie then { show after-move in interface modules } 2265 2265 for p1 := 0 to nPl - 1 do 2266 if (1 shl p1 and GWatching <> 0) and ((p1 <> p) or (bix[p1].Kind = btTerm))2266 if (1 shl p1 and GWatching <> 0) and ((p1 <> P) or (bix[p1].Kind = btTerm)) 2267 2267 then 2268 2268 begin … … 2273 2273 else 2274 2274 MinLevel := lObserveUnhidden; 2275 SeeFrom := (p1 = p) or (ObserveLevel[FromLoc] shr (2 * p1) and2275 SeeFrom := (p1 = P) or (ObserveLevel[FromLoc] shr (2 * p1) and 2276 2276 3 >= MinLevel); 2277 SeeTo := (p1 = p) or (ObserveLevel[ToLoc] shr (2 * p1) and2277 SeeTo := (p1 = P) or (ObserveLevel[ToLoc] shr (2 * p1) and 2278 2278 3 >= MinLevel); 2279 2279 if SeeTo and (MoveInfo.MoveType = mtCapture) then … … 2283 2283 else if (MoveInfo.MoveType <> mtSpyMission) and SeeTo then 2284 2284 CallPlayer(cShowUnitChanged, p1, ToLoc); 2285 for i:= 0 to nUpdateLoc - 1 do2286 if ObserveLevel[UpdateLoc[ i]] shr (2 * p1) and 3 >= lObserveUnhidden2285 for I := 0 to nUpdateLoc - 1 do 2286 if ObserveLevel[UpdateLoc[I]] shr (2 * p1) and 3 >= lObserveUnhidden 2287 2287 then 2288 CallPlayer(cShowUnitChanged, p1, UpdateLoc[ i]);2288 CallPlayer(cShowUnitChanged, p1, UpdateLoc[I]); 2289 2289 end; 2290 2290 end; 2291 end; // ExecuteMove2292 2293 function ExecuteAttack( p, uix, ToLoc: integer; var MoveInfo: TMoveInfo;2294 ShowMove: TShowMove): integer;2291 end; 2292 2293 function ExecuteAttack(P, uix, ToLoc: Integer; var MoveInfo: TMoveInfo; 2294 ShowMove: TShowMove): Integer; 2295 2295 2296 2296 procedure WriteBattleHistory(ToLoc, FromLoc, Attacker, Defender, mixAttacker, 2297 mixDefender: integer; AttackerLost, DefenderLost: boolean);2297 mixDefender: Integer; AttackerLost, DefenderLost: Boolean); 2298 2298 var 2299 2299 AttackerBattle, DefenderBattle: ^TBattle; … … 2307 2307 ReallocMem(BattleHistory, nBattleHistory * (2 * SizeOf(TBattle))); 2308 2308 AttackerBattle := @BattleHistory[nBattleHistory]; 2309 inc(nBattleHistory);2309 Inc(nBattleHistory); 2310 2310 end; 2311 2311 with RW[Defender] do … … 2317 2317 ReallocMem(BattleHistory, nBattleHistory * (2 * SizeOf(TBattle))); 2318 2318 DefenderBattle := @BattleHistory[nBattleHistory]; 2319 inc(nBattleHistory);2319 Inc(nBattleHistory); 2320 2320 end; 2321 2321 AttackerBattle.Enemy := Defender; … … 2346 2346 2347 2347 var 2348 i, p1, FromLoc, uix1, nUpdateLoc, ExpGain, ExpelToLoc, cix1: integer;2348 I, p1, FromLoc, uix1, nUpdateLoc, ExpGain, ExpelToLoc, cix1: Integer; 2349 2349 PModel: ^TModel; 2350 UpdateLoc: array [0 .. numax - 1] of integer;2351 LoseCityPop, CityDestroyed, SeeFrom, SeeTo, ZoCDefenderDestroyed: boolean;2350 UpdateLoc: array [0 .. numax - 1] of Integer; 2351 LoseCityPop, CityDestroyed, SeeFrom, SeeTo, ZoCDefenderDestroyed: Boolean; 2352 2352 begin 2353 result := 0;2354 with RW[ p].Un[uix] do2353 Result := 0; 2354 with RW[P].Un[uix] do 2355 2355 begin 2356 PModel := @RW[ p].Model[mix];2356 PModel := @RW[P].Model[mix]; 2357 2357 FromLoc := Loc; 2358 2358 … … 2360 2360 ShowMove.EndHealthDef := MoveInfo.EndHealthDef; 2361 2361 if MoveInfo.MoveType = mtAttack then 2362 WriteBattleHistory(ToLoc, FromLoc, p, MoveInfo.Defender, mix,2362 WriteBattleHistory(ToLoc, FromLoc, P, MoveInfo.Defender, mix, 2363 2363 RW[MoveInfo.Defender].Un[MoveInfo.Duix].mix, MoveInfo.EndHealth <= 0, 2364 2364 MoveInfo.EndHealthDef <= 0); … … 2367 2367 begin 2368 2368 if Mode>=moMovie then 2369 CallPlayer(cShowCancelTreaty,MoveInfo.Defender, p);2370 CancelTreaty( p,MoveInfo.Defender)2369 CallPlayer(cShowCancelTreaty,MoveInfo.Defender,P); 2370 CancelTreaty(P,MoveInfo.Defender) 2371 2371 end; } 2372 2372 if Mode >= moMovie then { show attack in interface modules } 2373 2373 for p1 := 0 to nPl - 1 do 2374 if (1 shl p1 and GWatching <> 0) and ((p1 <> p) or (bix[p1].Kind = btTerm))2374 if (1 shl p1 and GWatching <> 0) and ((p1 <> P) or (bix[p1].Kind = btTerm)) 2375 2375 then 2376 2376 begin … … 2380 2380 if SeeFrom and SeeTo then 2381 2381 begin 2382 TellAboutModel(p1, p, mix);2383 if p1 = pthen2382 TellAboutModel(p1, P, mix); 2383 if p1 = P then 2384 2384 ShowMove.emix := -1 2385 2385 else 2386 ShowMove.emix := emixSafe(p1, p, mix);2386 ShowMove.emix := emixSafe(p1, P, mix); 2387 2387 CallPlayer(cShowAttacking, p1, ShowMove); 2388 2388 end; 2389 2389 end; 2390 2390 2391 LoseCityPop := false;2391 LoseCityPop := False; 2392 2392 if (RealMap[ToLoc] and fCity <> 0) and 2393 2393 ((MoveInfo.MoveType = mtAttack) and (MoveInfo.EndHealthDef <= 0) or … … 2411 2411 if MoveInfo.MoveType = mtBombard then 2412 2412 begin 2413 assert(Movement >= 100);2413 Assert(Movement >= 100); 2414 2414 if PModel.Attack = 0 then 2415 2415 Flags := Flags and not unBombsLoaded; 2416 dec(Movement, 100);2416 Dec(Movement, 100); 2417 2417 end 2418 2418 else if MoveInfo.MoveType = mtExpel then 2419 2419 begin 2420 assert(Movement >= 100);2420 Assert(Movement >= 100); 2421 2421 Job := jNone; 2422 2422 Flags := Flags and not unFortified; 2423 dec(Movement, 100);2423 Dec(Movement, 100); 2424 2424 end 2425 2425 else 2426 2426 begin 2427 assert(MoveInfo.MoveType = mtAttack);2427 Assert(MoveInfo.MoveType = mtAttack); 2428 2428 if MoveInfo.EndHealth = 0 then 2429 RemoveUnit( p, uix, MoveInfo.Defender) // destroy attacker2429 RemoveUnit(P, uix, MoveInfo.Defender) // destroy attacker 2430 2430 else 2431 2431 begin // update attacker … … 2434 2434 Exp := (nExp - 1) * ExpCost 2435 2435 else 2436 inc(Exp, ExpGain);2436 Inc(Exp, ExpGain); 2437 2437 Health := MoveInfo.EndHealth; 2438 2438 Job := jNone; … … 2442 2442 Flags := Flags and not unFortified; 2443 2443 if Movement > 100 then 2444 dec(Movement, 100)2444 Dec(Movement, 100) 2445 2445 else 2446 2446 Movement := 0; … … 2448 2448 end; 2449 2449 2450 ZoCDefenderDestroyed := false;2450 ZoCDefenderDestroyed := False; 2451 2451 nUpdateLoc := 0; 2452 2452 if MoveInfo.MoveType = mtExpel then … … 2469 2469 PlaceUnit(MoveInfo.Defender, MoveInfo.Duix); 2470 2470 UpdateLoc[nUpdateLoc] := Loc; 2471 inc(nUpdateLoc);2471 Inc(nUpdateLoc); 2472 2472 Flags := Flags or unWithdrawn; 2473 2473 end; … … 2480 2480 Exp := (nExp - 1) * ExpCost 2481 2481 else 2482 inc(Exp, ExpGain);2482 Inc(Exp, ExpGain); 2483 2483 Health := MoveInfo.EndHealthDef; 2484 2484 end … … 2493 2493 (RealMap[ToLoc] and fTerImp <> tiFort)) or LoseCityPop and 2494 2494 (RW[MoveInfo.Defender].City[MoveInfo.Dcix].Size = 2) then 2495 RemoveAllUnits(MoveInfo.Defender, ToLoc, p)2495 RemoveAllUnits(MoveInfo.Defender, ToLoc, P) 2496 2496 { no city, base or fortress } 2497 2497 else 2498 RemoveUnit(MoveInfo.Defender, MoveInfo.Duix, p);2498 RemoveUnit(MoveInfo.Defender, MoveInfo.Duix, P); 2499 2499 end; 2500 2500 … … 2509 2509 begin 2510 2510 UpdateLoc[nUpdateLoc] := Loc; 2511 inc(nUpdateLoc);2511 Inc(nUpdateLoc); 2512 2512 end; 2513 2513 // unit will be removed -- remember position and update for all players 2514 DestroyCity_TellPlayers(MoveInfo.Defender, MoveInfo.Dcix, false);2514 DestroyCity_TellPlayers(MoveInfo.Defender, MoveInfo.Dcix, False); 2515 2515 CheckBorders(ToLoc, MoveInfo.Defender); 2516 RecalcPeaceMap( p);2516 RecalcPeaceMap(P); 2517 2517 end; 2518 2518 end; 2519 2519 2520 2520 if CityDestroyed and (nUpdateLoc > 0) then 2521 RecalcMapZoC( p)2521 RecalcMapZoC(P) 2522 2522 else if ZoCDefenderDestroyed then 2523 RecalcV8ZoC( p, ToLoc);2523 RecalcV8ZoC(P, ToLoc); 2524 2524 UpdateUnitMap(FromLoc); 2525 2525 UpdateUnitMap(ToLoc, LoseCityPop); 2526 for i:= 0 to nUpdateLoc - 1 do2527 UpdateUnitMap(UpdateLoc[ i]);2526 for I := 0 to nUpdateLoc - 1 do 2527 UpdateUnitMap(UpdateLoc[I]); 2528 2528 // tell about lost units of defender 2529 2529 2530 2530 if Mode >= moMovie then 2531 2531 begin 2532 for i := 0 to RW[p].nEnemyModel - 1 do2533 with RW[ p].EnemyModel[i] do2534 Lost := Destroyed[ p, Owner, mix];2532 for I := 0 to RW[P].nEnemyModel - 1 do 2533 with RW[P].EnemyModel[I] do 2534 Lost := Destroyed[P, Owner, mix]; 2535 2535 for p1 := 0 to nPl - 1 do { show after-attack in interface modules } 2536 if (1 shl p1 and GWatching <> 0) and ((p1 <> p) or (bix[p1].Kind = btTerm))2536 if (1 shl p1 and GWatching <> 0) and ((p1 <> P) or (bix[p1].Kind = btTerm)) 2537 2537 then 2538 2538 begin … … 2559 2559 end; 2560 2560 end; 2561 end; // ExecuteAttack2562 2563 function MoveUnit( p, uix, dx, dy: integer; TestOnly: boolean): integer;2561 end; 2562 2563 function MoveUnit(P, uix, dx, dy: Integer; TestOnly: Boolean): Integer; 2564 2564 var 2565 ToLoc: integer;2565 ToLoc: Integer; 2566 2566 MoveInfo: TMoveInfo; 2567 2567 ShowMove: TShowMove; 2568 2568 begin 2569 {$IFOPT O-} assert(1 shl pand InvalidTreatyMap = 0); {$ENDIF}2570 with RW[ p].Un[uix] do2569 {$IFOPT O-}Assert(1 shl P and InvalidTreatyMap = 0); {$ENDIF} 2570 with RW[P].Un[uix] do 2571 2571 begin 2572 2572 ToLoc := dLoc(Loc, dx, dy); 2573 2573 if (ToLoc < 0) or (ToLoc >= MapSize) then 2574 2574 begin 2575 result := eInvalid;2576 exit;2575 Result := eInvalid; 2576 Exit; 2577 2577 end; 2578 result := CalculateMove(p, uix, ToLoc, 3 - dy and 1, TestOnly, MoveInfo);2579 if result = eZOC_EnemySpotted then2578 Result := CalculateMove(P, uix, ToLoc, 3 - dy and 1, TestOnly, MoveInfo); 2579 if Result = eZOC_EnemySpotted then 2580 2580 ZOCTile := ToLoc; 2581 if ( result >= rExecuted) and not TestOnly then2581 if (Result >= rExecuted) and not TestOnly then 2582 2582 begin 2583 2583 ShowMove.dx := dx; … … 2589 2589 ShowMove.Exp := Exp; 2590 2590 ShowMove.Load := TroopLoad + AirLoad; 2591 ShowMove.Owner := p;2591 ShowMove.Owner := P; 2592 2592 if (TroopLoad > 0) or (AirLoad > 0) then 2593 2593 ShowMove.Flags := unMulti … … 2606 2606 case MoveInfo.MoveType of 2607 2607 mtMove, mtCapture, mtSpyMission: 2608 result := ExecuteMove(p, uix, ToLoc, MoveInfo, ShowMove) or result;2608 Result := ExecuteMove(P, uix, ToLoc, MoveInfo, ShowMove) or Result; 2609 2609 mtAttack, mtBombard, mtExpel: 2610 result := ExecuteAttack(p, uix, ToLoc, MoveInfo, ShowMove) or result;2610 Result := ExecuteAttack(P, uix, ToLoc, MoveInfo, ShowMove) or Result; 2611 2611 end; 2612 2612 end; 2613 end; // with2614 end; { MoveUnit }2615 2616 function Server(Command, Player, Subject: integer; var Data): integer; stdcall;2617 2618 function CountPrice(const Offer: TOffer; PriceType: integer): integer;2613 end; 2614 end; 2615 2616 function Server(Command, Player, Subject: Integer; var Data): Integer; stdcall; 2617 2618 function CountPrice(const Offer: TOffer; PriceType: Integer): Integer; 2619 2619 var 2620 i: integer;2620 I: Integer; 2621 2621 begin 2622 result := 0;2623 for i:= 0 to Offer.nDeliver + Offer.nCost - 1 do2624 if Offer.Price[ i] and $FFFF0000 = Cardinal(PriceType) then2625 inc(result);2622 Result := 0; 2623 for I := 0 to Offer.nDeliver + Offer.nCost - 1 do 2624 if Offer.Price[I] and $FFFF0000 = Cardinal(PriceType) then 2625 Inc(Result); 2626 2626 end; 2627 2627 2628 2628 { procedure UpdateBorderHelper; 2629 2629 var 2630 x, y, Loc, Loc1, dx, dy, ObserveMask: integer;2630 X, Y, Loc, Loc1, dx, dy, ObserveMask: Integer; 2631 2631 begin 2632 2632 ObserveMask:=3 shl (2*pTurn); 2633 for x:=0 to lx-1 do for y:=0 to ly shr 1-1 do2633 for X:=0 to lx-1 do for Y:=0 to ly shr 1-1 do 2634 2634 begin 2635 Loc:=lx*( y*2)+x;2635 Loc:=lx*(Y*2)+X; 2636 2636 if ObserveLevel[Loc] and ObserveMask<>0 then 2637 2637 begin 2638 2638 for dy:=0 to 1 do for dx:=0 to 1 do 2639 2639 begin 2640 Loc1:=(Loc+dx-1+lx) mod lx +lx*(( y+dy)*2-1);2640 Loc1:=(Loc+dx-1+lx) mod lx +lx*((Y+dy)*2-1); 2641 2641 if (Loc1>=0) and (Loc1<MapSize) 2642 2642 and (ObserveLevel[Loc1] and ObserveMask<>0) then … … 2666 2666 ptInvalid = 8; 2667 2667 2668 function ProjectType(Project: integer): integer;2668 function ProjectType(Project: Integer): Integer; 2669 2669 begin 2670 2670 if Project and cpCompleted <> 0 then 2671 result := ptSelect2671 Result := ptSelect 2672 2672 else if Project and (cpImp + cpIndex) = cpImp + imTrGoods then 2673 result := ptTrGoods2673 Result := ptTrGoods 2674 2674 else if Project and cpImp = 0 then 2675 2675 if RW[Player].Model[Project and cpIndex].Kind = mkCaravan then 2676 result := ptCaravan2677 else 2678 result := ptUn2676 Result := ptCaravan 2677 else 2678 Result := ptUn 2679 2679 else if Project and cpIndex >= nImp then 2680 result := ptInvalid2680 Result := ptInvalid 2681 2681 else if Imp[Project and cpIndex].Kind = ikWonder then 2682 result := ptWonder2682 Result := ptWonder 2683 2683 else if Imp[Project and cpIndex].Kind = ikShipPart then 2684 result := ptShip2684 Result := ptShip 2685 2685 else 2686 result := ptImp;2686 Result := ptImp; 2687 2687 end; 2688 2688 2689 2689 var 2690 d, i, j, p1, p2, pt0, pt1, uix1, cix1, Loc0, Loc1, dx, dy, NewCap, MinCap,2690 D, I, J, p1, p2, pt0, pt1, uix1, cix1, Loc0, Loc1, dx, dy, NewCap, MinCap, 2691 2691 MaxCap, CapWeight, Cost, NextProd, Preq, TotalFood, TotalProd, CheckSum, 2692 2692 StopTurn, FutureMCost, NewProject, OldImp, mix, V8, V21, AStr, DStr, 2693 ABaseDamage, DBaseDamage: integer;2693 ABaseDamage, DBaseDamage: Integer; 2694 2694 CityReport: TCityReport; 2695 2695 FormerCLState: TCmdListState; … … 2698 2698 ShowShipChange: TShowShipChange; 2699 2699 ShowNegoData: TShowNegoData; 2700 logged, ok, HasShipChanged, AllHumansDead, OfferFullySupported: boolean; 2701 2702 begin { >>>server } 2700 logged, ok, HasShipChanged, AllHumansDead, OfferFullySupported: Boolean; 2701 begin 2703 2702 if Command = sTurn then 2704 2703 begin … … 2709 2708 end; 2710 2709 2711 assert(MapSize = lx * ly);2712 assert(Command and (sctMask or sExecute) <> sctInternal or sExecute);2710 Assert(MapSize = lx * ly); 2711 Assert(Command and (sctMask or sExecute) <> sctInternal or sExecute); 2713 2712 // not for internal commands 2714 2713 if (Command < 0) or (Command >= $10000) then 2715 2714 begin 2716 result := eUnknown;2717 exit;2715 Result := eUnknown; 2716 Exit; 2718 2717 end; 2719 2718 … … 2722 2721 ((Subject < 0) or (Subject >= $1000))) then 2723 2722 begin 2724 result := eInvalid;2725 exit;2723 Result := eInvalid; 2724 Exit; 2726 2725 end; 2727 2726 … … 2732 2731 begin 2733 2732 PutMessage(1 shl 16 + 1, Format('NOT Alive: %d', [Player])); 2734 result := eNoTurn;2735 exit;2733 Result := eNoTurn; 2734 Exit; 2736 2735 end; 2737 2736 2738 result := eOK;2737 Result := eOK; 2739 2738 2740 2739 // check if command allowed now … … 2759 2758 PutMessage(1 shl 16 + 1, Format('No Turn: %d calls %x', 2760 2759 [Player, Command shr 4])); 2761 result := eNoTurn;2762 exit;2760 Result := eNoTurn; 2761 Exit; 2763 2762 end; 2764 2763 … … 2768 2767 HandoverStack[nHandoverStack] := Player + $1000; 2769 2768 HandoverStack[nHandoverStack + 1] := Command; 2770 inc(nHandoverStack, 2);2769 Inc(nHandoverStack, 2); 2771 2770 2772 2771 InvalidTreatyMap := 0; … … 2781 2780 FormerCLState := CL.State; 2782 2781 CL.Put(Command, Player, Subject, @Data); 2783 logged := true;2782 logged := True; 2784 2783 end 2785 2784 else 2786 logged := false;2785 logged := False; 2787 2786 2788 2787 case Command of … … 2799 2798 2800 2799 sGetDebugMap: 2801 pointer(Data) := DebugMap[Subject];2800 Pointer(Data) := DebugMap[Subject]; 2802 2801 2803 2802 { sChangeSuperView: 2804 2803 if Difficulty[Player]=0 then 2805 2804 begin 2806 for i:=0 to nBrain-1 do if Brain[i].Initialized then2807 CallClient( i, cShowSuperView, Subject)2805 for I:=0 to nBrain-1 do if Brain[I].Initialized then 2806 CallClient(I, cShowSuperView, Subject) 2808 2807 end 2809 else result:=eInvalid; }2808 else Result:=eInvalid; } 2810 2809 2811 2810 sRefreshDebugMap: … … 2830 2829 else 2831 2830 StopTurn := RW[Player].EnemyReport[Subject].TurnOfCivilReport + 1; 2832 move(Stat[Command shr 4 and $F, Subject]^, Data,2833 StopTurn * SizeOf( integer));2831 Move(Stat[Command shr 4 and $F, Subject]^, Data, 2832 StopTurn * SizeOf(Integer)); 2834 2833 FillChar(TChart(Data)[StopTurn], (GTurn - StopTurn) * 2835 SizeOf( integer), 0);2834 SizeOf(Integer), 0); 2836 2835 end 2837 2836 else 2838 result := eInvalid;2837 Result := eInvalid; 2839 2838 2840 2839 sGetTechCost: 2841 integer(Data) := TechCost(Player);2840 Integer(Data) := TechCost(Player); 2842 2841 2843 2842 sGetAIInfo: 2844 2843 if AIInfo[Subject] = '' then 2845 pchar(Data) := nil2846 else 2847 pchar(Data) := @AIInfo[Subject][1];2844 PChar(Data) := nil 2845 else 2846 PChar(Data) := @AIInfo[Subject][1]; 2848 2847 2849 2848 sGetAICredits: 2850 2849 if AICredits = '' then 2851 pchar(Data) := nil2852 else 2853 pchar(Data) := @AICredits[1];2850 PChar(Data) := nil 2851 else 2852 PChar(Data) := @AICredits[1]; 2854 2853 2855 2854 sGetVersion: 2856 integer(Data) := CevoVersion;2855 Integer(Data) := CevoVersion; 2857 2856 2858 2857 sGetGameChanged: 2859 2858 if Player <> 0 then 2860 result := eInvalid2859 Result := eInvalid 2861 2860 else if (CL <> nil) and (CL.State.nLog = nLogOpened) and 2862 2861 (CL.State.MoveCode = 0) and not HasCityTileChanges and 2863 2862 not HasChanges(Player) then 2864 result := eNotChanged;2863 Result := eNotChanged; 2865 2864 2866 2865 sGetTileInfo: 2867 2866 if (Subject >= 0) and (Subject < MapSize) then 2868 result := GetTileInfo(Player, -2, Subject, TTileInfo(Data))2869 else 2870 result := eInvalid;2867 Result := GetTileInfo(Player, -2, Subject, TTileInfo(Data)) 2868 else 2869 Result := eInvalid; 2871 2870 2872 2871 sGetCityTileInfo: 2873 2872 if (Subject >= 0) and (Subject < MapSize) then 2874 result := GetTileInfo(Player, -1, Subject, TTileInfo(Data))2875 else 2876 result := eInvalid;2873 Result := GetTileInfo(Player, -1, Subject, TTileInfo(Data)) 2874 else 2875 Result := eInvalid; 2877 2876 2878 2877 sGetHypoCityTileInfo: … … 2881 2880 if (TTileInfo(Data).ExplCity < 0) or 2882 2881 (TTileInfo(Data).ExplCity >= RW[Player].nCity) then 2883 result := eInvalid2882 Result := eInvalid 2884 2883 else if ObserveLevel[Subject] shr (Player * 2) and 3 = 0 then 2885 result := eNoPreq2884 Result := eNoPreq 2886 2885 else 2887 result := GetTileInfo(Player, TTileInfo(Data).ExplCity, Subject,2886 Result := GetTileInfo(Player, TTileInfo(Data).ExplCity, Subject, 2888 2887 TTileInfo(Data)); 2889 2888 end 2890 2889 else 2891 result := eInvalid;2890 Result := eInvalid; 2892 2891 2893 2892 sGetJobProgress: … … 2895 2894 begin 2896 2895 if ObserveLevel[Subject] shr (Player * 2) and 3 = 0 then 2897 result := eNoPreq2896 Result := eNoPreq 2898 2897 else 2899 result := GetJobProgress(Player, Subject, TJobProgressData(Data));2898 Result := GetJobProgress(Player, Subject, TJobProgressData(Data)); 2900 2899 end 2901 2900 else 2902 result := eInvalid;2901 Result := eInvalid; 2903 2902 2904 2903 sGetModels: … … 2912 2911 end 2913 2912 else 2914 result := eInvalid;2913 Result := eInvalid; 2915 2914 2916 2915 sGetUnits: 2917 2916 if (Subject >= 0) and (Subject < MapSize) and 2918 2917 (ObserveLevel[Subject] shr (Player * 2) and 3 = lObserveSuper) then 2919 integer(Data) := GetUnitStack(Player, Subject)2920 else 2921 result := eNoPreq;2918 Integer(Data) := GetUnitStack(Player, Subject) 2919 else 2920 Result := eNoPreq; 2922 2921 2923 2922 sGetDefender: 2924 2923 if (Subject >= 0) and (Subject < MapSize) and (Occupant[Subject] = Player) 2925 2924 then 2926 Strongest(Subject, integer(Data), d, i, j)2927 else 2928 result := eInvalid;2925 Strongest(Subject, Integer(Data), D, I, J) 2926 else 2927 Result := eInvalid; 2929 2928 2930 2929 sGetBattleForecast, sGetBattleForecastEx: … … 2936 2935 ((pAtt = Player) or (RWemix[Player, pAtt, mixAtt] >= 0)) then 2937 2936 begin 2938 result := GetBattleForecast(Subject, TBattleForecast(Data), uix1,2937 Result := GetBattleForecast(Subject, TBattleForecast(Data), uix1, 2939 2938 cix1, AStr, DStr, ABaseDamage, DBaseDamage); 2940 2939 if Command = sGetBattleForecastEx then … … 2945 2944 TBattleForecastEx(Data).DBaseDamage := DBaseDamage; 2946 2945 end; 2947 if result = eOK then2948 result := eInvalid; // no enemy unit there!2946 if Result = eOK then 2947 Result := eInvalid; // no enemy unit there! 2949 2948 end 2950 2949 else 2951 result := eInvalid2952 else 2953 result := eInvalid;2950 Result := eInvalid 2951 else 2952 Result := eInvalid; 2954 2953 2955 2954 sGetUnitReport: 2956 2955 if (Subject < 0) or (Subject >= RW[Player].nUn) or 2957 2956 (RW[Player].Un[Subject].Loc < 0) then 2958 result := eInvalid2957 Result := eInvalid 2959 2958 else 2960 2959 GetUnitReport(Player, Subject, TUnitReport(Data)); … … 2963 2962 if (Subject < 0) or (Subject >= RW[Player].nUn) or 2964 2963 (RW[Player].Un[Subject].Loc < 0) then 2965 result := eInvalid2966 else 2967 result := GetMoveAdvice(Player, Subject, TMoveAdviceData(Data));2964 Result := eInvalid 2965 else 2966 Result := GetMoveAdvice(Player, Subject, TMoveAdviceData(Data)); 2968 2967 2969 2968 sGetPlaneReturn: … … 2971 2970 (RW[Player].Un[Subject].Loc < 0) or 2972 2971 (RW[Player].Model[RW[Player].Un[Subject].mix].Domain <> dAir) then 2973 result := eInvalid2972 Result := eInvalid 2974 2973 else 2975 2974 begin 2976 2975 if CanPlaneReturn(Player, Subject, TPlaneReturnData(Data)) then 2977 result := eOK2976 Result := eOK 2978 2977 else 2979 result := eNoWay;2978 Result := eNoWay; 2980 2979 end; 2981 2980 … … 2988 2987 Owner := Player; 2989 2988 SearchCity(Subject, Owner, cix1); 2990 c:= RW[Owner].City[cix1];2991 if (Owner <> Player) and ( c.Project and cpImp = 0) then2992 TellAboutModel(Player, Owner, c.Project and cpIndex);2989 C := RW[Owner].City[cix1]; 2990 if (Owner <> Player) and (C.Project and cpImp = 0) then 2991 TellAboutModel(Player, Owner, C.Project and cpIndex); 2993 2992 end 2994 2993 else 2995 result := eInvalid;2994 Result := eInvalid; 2996 2995 2997 2996 sGetCityReport: 2998 2997 if (Subject < 0) or (Subject >= RW[Player].nCity) or 2999 2998 (RW[Player].City[Subject].Loc < 0) then 3000 result := eInvalid3001 else 3002 result := GetCityReport(Player, Subject, TCityReport(Data));2999 Result := eInvalid 3000 else 3001 Result := GetCityReport(Player, Subject, TCityReport(Data)); 3003 3002 3004 3003 sGetCityReportNew: 3005 3004 if (Subject < 0) or (Subject >= RW[Player].nCity) or 3006 3005 (RW[Player].City[Subject].Loc < 0) then 3007 result := eInvalid3006 Result := eInvalid 3008 3007 else 3009 3008 GetCityReportNew(Player, Subject, TCityReportNew(Data)); … … 3012 3011 if (Subject < 0) or (Subject >= RW[Player].nCity) or 3013 3012 (RW[Player].City[Subject].Loc < 0) then 3014 result := eInvalid3013 Result := eInvalid 3015 3014 else 3016 3015 GetCityAreaInfo(Player, RW[Player].City[Subject].Loc, … … 3032 3031 end 3033 3032 else 3034 result := eInvalid;3033 Result := eInvalid; 3035 3034 3036 3035 sGetEnemyCityReportNew: … … 3049 3048 end 3050 3049 else 3051 result := eInvalid;3050 Result := eInvalid; 3052 3051 3053 3052 sGetEnemyCityAreaInfo: … … 3063 3062 end 3064 3063 else 3065 result := eInvalid;3064 Result := eInvalid; 3066 3065 3067 3066 sGetCityTileAdvice: 3068 3067 if (Subject < 0) or (Subject >= RW[Player].nCity) or 3069 3068 (RW[Player].City[Subject].Loc < 0) then 3070 result := eInvalid3069 Result := eInvalid 3071 3070 else 3072 3071 GetCityTileAdvice(Player, Subject, TCityTileAdviceData(Data)); … … 3081 3080 EditTile(Loc, NewTile) 3082 3081 else 3083 result := eInvalid;3082 Result := eInvalid; 3084 3083 3085 3084 sRandomMap: … … 3087 3086 begin 3088 3087 CreateElevation; 3089 PreviewElevation := false;3090 CreateMap( false);3088 PreviewElevation := False; 3089 CreateMap(False); 3091 3090 FillChar(ObserveLevel, MapSize * 4, 0); 3092 3091 DiscoverAll(Player, lObserveSuper); 3093 3092 end 3094 3093 else 3095 result := eInvalid;3094 Result := eInvalid; 3096 3095 3097 3096 sMapGeneratorRequest: 3098 3097 if not MapGeneratorAvailable then 3099 result := eInvalid;3098 Result := eInvalid; 3100 3099 3101 3100 { … … 3105 3104 sTurn, sTurn - sExecute: 3106 3105 begin 3107 AllHumansDead := true;3106 AllHumansDead := True; 3108 3107 for p1 := 0 to nPl - 1 do 3109 3108 if (1 shl p1 and GAlive <> 0) and (bix[p1].Kind = btTerm) then 3110 AllHumansDead := false;3109 AllHumansDead := False; 3111 3110 if (pDipActive >= 0) // still in negotiation mode 3112 3111 or (pTurn = 0) and ((GWinner > 0) or (GTurn = MaxTurn) or 3113 3112 (Difficulty[0] > 0) and AllHumansDead) then // game end reached 3114 result := eViolation3113 Result := eViolation 3115 3114 else if Command >= sExecute then 3116 3115 begin … … 3123 3122 begin 3124 3123 LogChanges; 3125 SaveGame('~' + LogFileName, true);3124 SaveGame('~' + LogFileName, True); 3126 3125 end; 3127 3126 {$ENDIF} … … 3138 3137 TotalFood := 0; 3139 3138 TotalProd := 0; 3140 for i:= 0 to RW[pTurn].nCity - 1 do3141 if RW[pTurn].City[ i].Loc >= 0 then3139 for I := 0 to RW[pTurn].nCity - 1 do 3140 if RW[pTurn].City[I].Loc >= 0 then 3142 3141 begin 3143 inc(TotalFood, RW[pTurn].City[i].Food);3144 inc(TotalProd, RW[pTurn].City[i].Prod);3142 Inc(TotalFood, RW[pTurn].City[I].Food); 3143 Inc(TotalProd, RW[pTurn].City[I].Prod); 3145 3144 end; 3146 3145 CheckSum := TotalFood and 7 + TotalProd and 7 shl 3 + … … 3153 3152 begin 3154 3153 if CheckSum <> Subject then 3155 LoadOK := false;3154 LoadOK := False; 3156 3155 end 3157 3156 else // save checksum … … 3180 3179 pTurn := (pTurn + 1) mod nPl; 3181 3180 if pTurn = 0 then 3182 inc(GTurn);3181 Inc(GTurn); 3183 3182 if Assigned(bix[pTurn]) and ((1 shl pTurn) and GAlive = 0) then 3184 3183 begin // already made extinct -- continue statistics … … 3219 3218 sBreak, sResign, sNextRound, sReload: 3220 3219 if Mode = moMovie then 3221 MovieStopped := true3220 MovieStopped := True 3222 3221 else 3223 3222 begin … … 3225 3224 begin 3226 3225 ok := (Difficulty[0] = 0) and (bix[0].Kind <> btNoTerm) and 3227 ( integer(Data) >= 0) and (integer(Data) < GTurn);3226 (Integer(Data) >= 0) and (Integer(Data) < GTurn); 3228 3227 for p1 := 1 to nPl - 1 do 3229 3228 if bix[p1].Kind = btTerm then 3230 ok := false;3229 ok := False; 3231 3230 // allow reload in AI-only games only 3232 3231 end … … 3237 3236 if (Command = sBreak) or (Command = sResign) then 3238 3237 Notify(ntBackOn); 3239 for i:= 0 to Brains.Count - 1 do3240 if Brains[ i].Initialized then3238 for I := 0 to Brains.Count - 1 do 3239 if Brains[I].Initialized then 3241 3240 begin 3242 if Brains[ i].Kind = btAI then3243 Notify(ntDeinitModule, i);3244 CallClient( i, cBreakGame, nil^);3241 if Brains[I].Kind = btAI then 3242 Notify(ntDeinitModule, I); 3243 CallClient(I, cBreakGame, nil^); 3245 3244 end; 3246 3245 Notify(ntEndInfo); … … 3249 3248 LogCityTileChanges; 3250 3249 LogChanges; 3251 SaveGame(LogFileName, false);3250 SaveGame(LogFileName, False); 3252 3251 end; 3253 3252 DeleteFile(SavePath + '~' + LogFileName); … … 3262 3261 LandMass, MaxTurn); 3263 3262 sReload: 3264 LoadGame(SavePath, LogFileName, integer(Data), false);3263 LoadGame(SavePath, LogFileName, Integer(Data), False); 3265 3264 end; 3266 3265 end 3267 3266 else 3268 result := eInvalid;3267 Result := eInvalid; 3269 3268 end; 3270 3269 … … 3283 3282 end 3284 3283 else 3285 result := eInvalid;3284 Result := eInvalid; 3286 3285 3287 3286 scContact .. scContact + (nPl - 1) shl 4, scContact - sExecute .. scContact 3288 3287 - sExecute + (nPl - 1) shl 4: 3289 3288 if (pDipActive >= 0) or (1 shl (Command shr 4 and $F) and GAlive = 0) then 3290 result := eInvalid3289 Result := eInvalid 3291 3290 else if GWinner > 0 then 3292 result := eViolation // game end reached3291 Result := eViolation // game end reached 3293 3292 else if RW[Player].Treaty[Command shr 4 and $F] = trNoContact then 3294 result := eNoPreq3293 Result := eNoPreq 3295 3294 else if GTurn < GColdWarStart + ColdWarTurns then 3296 result := eColdWar3295 Result := eColdWar 3297 3296 else if RW[Player].Government = gAnarchy then 3298 result := eAnarchy3297 Result := eAnarchy 3299 3298 else if RW[Command shr 4 and $F].Government = gAnarchy then 3300 3299 begin 3301 result := eAnarchy;3300 Result := eAnarchy; 3302 3301 LastEndClientCommand := scReject; // enable cancel treaty 3303 3302 pContacted := Command shr 4 and $F; … … 3307 3306 pContacted := Command shr 4 and $F; 3308 3307 pDipActive := pContacted; 3309 assert(Mode = moPlaying);3308 Assert(Mode = moPlaying); 3310 3309 Inform(pDipActive); 3311 3310 ChangeClientWhenDone(scContact, pDipActive, pTurn, 4); … … 3318 3317 begin // contact requested and not accepted yet 3319 3318 pDipActive := -1; 3320 assert(Mode = moPlaying);3319 Assert(Mode = moPlaying); 3321 3320 ChangeClientWhenDone(cContinue, pTurn, nil^, 0); 3322 3321 end; 3323 3322 end 3324 3323 else 3325 result := eInvalid;3324 Result := eInvalid; 3326 3325 3327 3326 scDipStart, scDipStart - sExecute: … … 3334 3333 RW[pTurn].Credibility; 3335 3334 pDipActive := pTurn; 3336 assert(Mode = moPlaying);3335 Assert(Mode = moPlaying); 3337 3336 IntServer(sIntHaveContact, pTurn, pContacted, nil^); 3338 3337 ChangeClientWhenDone(scDipStart, pDipActive, nil^, 0); … … 3340 3339 end 3341 3340 else 3342 result := eInvalid;3341 Result := eInvalid; 3343 3342 3344 3343 scDipNotice, scDipAccept, scDipCancelTreaty, scDipBreak, … … 3347 3346 if pDipActive >= 0 then 3348 3347 begin 3349 assert(Mode = moPlaying);3348 Assert(Mode = moPlaying); 3350 3349 if pDipActive = pTurn then 3351 3350 p1 := pContacted … … 3363 3362 // check if offer can be accepted 3364 3363 if nDeliver + nCost = 0 then 3365 result := eOfferNotAcceptable;3366 for i:= 0 to nDeliver + nCost - 1 do3367 if Price[ i] = opChoose then3368 result := eOfferNotAcceptable;3369 for i:= 0 to nCost - 1 do3370 if not PayPrice(pDipActive, p1, Price[nDeliver + i], false) then3371 result := eOfferNotAcceptable;3372 if (Command >= sExecute) and ( result >= rExecuted) then3364 Result := eOfferNotAcceptable; 3365 for I := 0 to nDeliver + nCost - 1 do 3366 if Price[I] = opChoose then 3367 Result := eOfferNotAcceptable; 3368 for I := 0 to nCost - 1 do 3369 if not PayPrice(pDipActive, p1, Price[nDeliver + I], False) then 3370 Result := eOfferNotAcceptable; 3371 if (Command >= sExecute) and (Result >= rExecuted) then 3373 3372 begin 3374 3373 IntServer(sIntPayPrices + nDeliver + nCost, p1, pDipActive, … … 3377 3376 3378 3377 // tell other players about ship part trades 3379 HasShipChanged := false;3378 HasShipChanged := False; 3380 3379 FillChar(ShowShipChange, SizeOf(ShowShipChange), 0); 3381 for i:= 0 to nDeliver + nCost - 1 do3382 if Price[ i] and opMask = opShipParts then3380 for I := 0 to nDeliver + nCost - 1 do 3381 if Price[I] and opMask = opShipParts then 3383 3382 begin 3384 HasShipChanged := true;3385 if i>= nDeliver then3383 HasShipChanged := True; 3384 if I >= nDeliver then 3386 3385 begin // p1 has demanded from pDipActive 3387 ShowShipChange.Ship1Change[Price[ i] shr 16 and 3] :=3388 + integer(Price[i] and $FFFF);3389 ShowShipChange.Ship2Change[Price[ i] shr 16 and 3] :=3390 - integer(Price[i] and $FFFF);3386 ShowShipChange.Ship1Change[Price[I] shr 16 and 3] := 3387 +Integer(Price[I] and $FFFF); 3388 ShowShipChange.Ship2Change[Price[I] shr 16 and 3] := 3389 -Integer(Price[I] and $FFFF); 3391 3390 end 3392 3391 else 3393 3392 begin // p1 has delivered to pDipActive 3394 ShowShipChange.Ship1Change[Price[ i] shr 16 and 3] :=3395 - integer(Price[i] and $FFFF);3396 ShowShipChange.Ship2Change[Price[ i] shr 16 and 3] :=3397 + integer(Price[i] and $FFFF);3393 ShowShipChange.Ship1Change[Price[I] shr 16 and 3] := 3394 -Integer(Price[I] and $FFFF); 3395 ShowShipChange.Ship2Change[Price[I] shr 16 and 3] := 3396 +Integer(Price[I] and $FFFF); 3398 3397 end; 3399 3398 end; … … 3407 3406 (1 shl p2 and (GAlive or GWatching) <> 0) then 3408 3407 begin 3409 move(GShip, RW[p2].Ship, SizeOf(GShip));3408 Move(GShip, RW[p2].Ship, SizeOf(GShip)); 3410 3409 if 1 shl p2 and GWatching <> 0 then 3411 3410 CallPlayer(cShowShipChange, p2, ShowShipChange); … … 3420 3419 (GTurn < RW[pDipActive].LastCancelTreaty[p1] + CancelTreatyTurns) 3421 3420 then 3422 result := eCancelTreatyRush3421 Result := eCancelTreatyRush 3423 3422 else if Command >= sExecute then 3424 3423 begin … … 3427 3426 if (p2 <> p1) and (1 shl p2 and PeaceEnded <> 0) then 3428 3427 begin 3429 i:= p1 shl 4 + pDipActive;3430 CallPlayer(cShowSupportAllianceAgainst, p2, i);3428 I := p1 shl 4 + pDipActive; 3429 CallPlayer(cShowSupportAllianceAgainst, p2, I); 3431 3430 end; 3432 3431 for p2 := 0 to nPl - 1 do 3433 3432 if (p2 <> p1) and (1 shl p2 and PeaceEnded <> 0) then 3434 3433 begin 3435 i:= p2;3436 CallPlayer(cShowCancelTreatyByAlliance, pDipActive, i);3434 I := p2; 3435 CallPlayer(cShowCancelTreatyByAlliance, pDipActive, I); 3437 3436 end; 3438 3437 end; 3439 3438 end 3440 3439 else 3441 result := eInvalid;3442 if (Command >= sExecute) and ( result >= rExecuted) then3440 Result := eInvalid; 3441 if (Command >= sExecute) and (Result >= rExecuted) then 3443 3442 if LastEndClientCommand = scDipBreak then 3444 3443 begin // break negotiation … … 3462 3461 end 3463 3462 else 3464 result := eInvalid;3463 Result := eInvalid; 3465 3464 3466 3465 scDipOffer, scDipOffer - sExecute: … … 3475 3474 pDipActive := -1; 3476 3475 CallPlayer(cShowEndContact, pContacted, nil^); 3477 assert(Mode = moPlaying);3476 Assert(Mode = moPlaying); 3478 3477 ChangeClientWhenDone(cContinue, pTurn, nil^, 0); 3479 3478 end; … … 3488 3487 if RW[pDipActive].Treaty[p1] < trPeace then 3489 3488 begin // no tribute allowed! 3490 for i:= 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do3491 if (TOffer(Data).Price[ i] and opMask = opTribute) then3492 result := eInvalidOffer;3493 for i:= 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do3494 if (TOffer(Data).Price[ i] = opTreaty + trPeace) then3495 result := eOK;3489 for I := 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do 3490 if (TOffer(Data).Price[I] and opMask = opTribute) then 3491 Result := eInvalidOffer; 3492 for I := 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do 3493 if (TOffer(Data).Price[I] = opTreaty + trPeace) then 3494 Result := eOK; 3496 3495 end; 3497 for i:= 0 to TOffer(Data).nDeliver - 1 do3498 if (TOffer(Data).Price[ i] <> opChoose) and3499 not PayPrice(pDipActive, p1, TOffer(Data).Price[ i], false) then3500 result := eInvalidOffer;3496 for I := 0 to TOffer(Data).nDeliver - 1 do 3497 if (TOffer(Data).Price[I] <> opChoose) and 3498 not PayPrice(pDipActive, p1, TOffer(Data).Price[I], False) then 3499 Result := eInvalidOffer; 3501 3500 if CountPrice(TOffer(Data), opTreaty) > 1 then 3502 result := eInvalidOffer;3503 for i:= 0 to nShipPart - 1 do3504 if CountPrice(TOffer(Data), opShipParts + ishl 16) > 1 then3505 result := eInvalidOffer;3501 Result := eInvalidOffer; 3502 for I := 0 to nShipPart - 1 do 3503 if CountPrice(TOffer(Data), opShipParts + I shl 16) > 1 then 3504 Result := eInvalidOffer; 3506 3505 if CountPrice(TOffer(Data), opMoney) > 1 then 3507 result := eInvalidOffer;3506 Result := eInvalidOffer; 3508 3507 if CountPrice(TOffer(Data), opTribute) > 1 then 3509 result := eInvalidOffer;3508 Result := eInvalidOffer; 3510 3509 case CountPrice(TOffer(Data), opChoose) of 3511 3510 0: … … 3513 3512 1: 3514 3513 if (TOffer(Data).nCost = 0) or (TOffer(Data).nDeliver = 0) then 3515 result := eInvalidOffer;3514 Result := eInvalidOffer; 3516 3515 else 3517 result := eInvalidOffer;3516 Result := eInvalidOffer; 3518 3517 end; 3519 3518 3520 3519 // !!! check here if cost can be demanded 3521 3520 3522 if (Command >= sExecute) and ( result >= rExecuted) then3521 if (Command >= sExecute) and (Result >= rExecuted) then 3523 3522 begin 3524 3523 OfferFullySupported := (TOffer(Data).nDeliver <= 2) and 3525 3524 (TOffer(Data).nCost <= 2); // >2 no more allowed 3526 for i:= 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do3525 for I := 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do 3527 3526 begin 3528 if TOffer(Data).Price[ i] and opMask = opTribute then3529 OfferFullySupported := false;3527 if TOffer(Data).Price[I] and opMask = opTribute then 3528 OfferFullySupported := False; 3530 3529 // tribute no more part of the game 3531 if (TOffer(Data).Price[ i] and opMask = opTreaty) and3532 (TOffer(Data).Price[ i] - opTreaty <= RW[pDipActive].Treaty[p1])3530 if (TOffer(Data).Price[I] and opMask = opTreaty) and 3531 (TOffer(Data).Price[I] - opTreaty <= RW[pDipActive].Treaty[p1]) 3533 3532 then 3534 OfferFullySupported := false;3533 OfferFullySupported := False; 3535 3534 // agreed treaty end no more part of the game 3536 if TOffer(Data).Price[ i] = opTreaty + trCeaseFire then3537 OfferFullySupported := false;3535 if TOffer(Data).Price[I] = opTreaty + trCeaseFire then 3536 OfferFullySupported := False; 3538 3537 // ceasefire no more part of the game 3539 3538 end; … … 3560 3559 LastOffer := TOffer(Data); 3561 3560 // show offered things to receiver 3562 for i:= 0 to LastOffer.nDeliver - 1 do3563 ShowPrice(pDipActive, p1, LastOffer.Price[ i]);3561 for I := 0 to LastOffer.nDeliver - 1 do 3562 ShowPrice(pDipActive, p1, LastOffer.Price[I]); 3564 3563 pDipActive := p1; 3565 assert(Mode = moPlaying);3564 Assert(Mode = moPlaying); 3566 3565 ChangeClientWhenDone(scDipOffer, pDipActive, LastOffer, 3567 3566 SizeOf(LastOffer)); 3568 end 3569 end 3567 end; 3568 end; 3570 3569 end 3571 3570 else 3572 result := eInvalid;3571 Result := eInvalid; 3573 3572 3574 3573 { … … 3583 3582 end 3584 3583 else 3585 result := eInvalid;3584 Result := eInvalid; 3586 3585 3587 3586 sSetTestFlag: … … 3593 3592 end 3594 3593 else 3595 result := eInvalid;3594 Result := eInvalid; 3596 3595 3597 3596 sSetGovernment, sSetGovernment - sExecute: … … 3599 3598 {$IFDEF TEXTLOG}CmdInfo := Format('SetGovernment P%d: %d', [Player, Subject]); {$ENDIF} 3600 3599 if RW[Player].Happened and phChangeGov = 0 then 3601 result := eViolation3600 Result := eViolation 3602 3601 else if RW[Player].Government = Subject then 3603 result := eNotChanged3602 Result := eNotChanged 3604 3603 else if (Subject >= nGov) then 3605 result := eInvalid3604 Result := eInvalid 3606 3605 else if (Subject >= gMonarchy) and 3607 3606 (RW[Player].Tech[GovPreq[Subject]] < tsApplicable) then 3608 result := eNoPreq3607 Result := eNoPreq 3609 3608 else if Command >= sExecute then 3610 3609 begin … … 3614 3613 then 3615 3614 RW[p1].EnemyReport[Player].Government := Subject; 3616 end 3615 end; 3617 3616 end; 3618 3617 … … 3621 3620 {$IFDEF TEXTLOG}CmdInfo := Format('SetRates P%d: %d/%d', [Player, Subject and $F * 10, Subject shr 4 * 10]); {$ENDIF} 3622 3621 if Subject and $F + Subject shr 4 > 10 then 3623 result := eInvalid3622 Result := eInvalid 3624 3623 else if (RW[Player].TaxRate = Subject and $F * 10) and 3625 3624 (RW[Player].LuxRate = Subject shr 4 * 10) then 3626 result := eNotChanged3625 Result := eNotChanged 3627 3626 else if Command >= sExecute then 3628 3627 begin 3629 3628 RW[Player].TaxRate := Subject and $F * 10; 3630 3629 RW[Player].LuxRate := Subject shr 4 * 10; 3631 end 3630 end; 3632 3631 end; 3633 3632 … … 3636 3635 {$IFDEF TEXTLOG}CmdInfo := Format('Revolution P%d', [Player]); {$ENDIF} 3637 3636 if RW[Player].Government = gAnarchy then 3638 result := eInvalid3637 Result := eInvalid 3639 3638 else 3640 3639 begin … … 3658 3657 if (Mode = moPlaying) and (Subject = adMilitary) and 3659 3658 (DevModelTurn[Player] <> GTurn) then 3660 result := eNoModel3659 Result := eNoModel 3661 3660 else if Subject <> adMilitary then 3662 3661 begin … … 3664 3663 begin 3665 3664 if Tech[Subject] >= MaxFutureTech_Computing then 3666 result := eInvalid;3665 Result := eInvalid; 3667 3666 end 3668 3667 else if Subject in FutureTech then 3669 3668 begin 3670 3669 if Tech[Subject] >= MaxFutureTech then 3671 result := eInvalid;3670 Result := eInvalid; 3672 3671 end 3673 3672 else if Tech[Subject] >= tsApplicable then 3674 result := eInvalid; // already discovered3673 Result := eInvalid; // already discovered 3675 3674 if Tech[Subject] <> tsSeen then // look if preqs met 3676 3675 if AdvPreq[Subject, 2] <> preNone then 3677 3676 begin // 2 of 3 required 3678 i:= 0;3679 for j:= 0 to 2 do3680 if Tech[AdvPreq[Subject, j]] >= tsApplicable then3681 inc(i);3682 if i< 2 then3683 result := eNoPreq;3677 I := 0; 3678 for J := 0 to 2 do 3679 if Tech[AdvPreq[Subject, J]] >= tsApplicable then 3680 Inc(I); 3681 if I < 2 then 3682 Result := eNoPreq; 3684 3683 end 3685 3684 else if (AdvPreq[Subject, 0] <> preNone) and … … 3687 3686 (AdvPreq[Subject, 1] <> preNone) and 3688 3687 (Tech[AdvPreq[Subject, 1]] < tsApplicable) then 3689 result := eNoPreq;3688 Result := eNoPreq; 3690 3689 end; 3691 if ( result = eOK) and (Command >= sExecute) then3690 if (Result = eOK) and (Command >= sExecute) then 3692 3691 begin 3693 3692 if (Mode = moPlaying) and (Subject = adMilitary) then … … 3698 3697 end 3699 3698 else 3700 result := eViolation;3699 Result := eViolation; 3701 3700 end; 3702 3701 … … 3706 3705 {$ENDIF} 3707 3706 if RW[Player].Happened and phStealTech = 0 then 3708 result := eInvalid3707 Result := eInvalid 3709 3708 else if (Subject >= nAdv) or (Subject in FutureTech) or 3710 3709 (RW[Player].Tech[Subject] >= tsSeen) or 3711 3710 (RW[GStealFrom].Tech[Subject] < tsApplicable) then 3712 result := eInvalid3711 Result := eInvalid 3713 3712 else if Command >= sExecute then 3714 3713 begin 3715 3714 SeeTech(Player, Subject); 3716 dec(RW[Player].Happened, phStealTech);3715 Dec(RW[Player].Happened, phStealTech); 3717 3716 end; 3718 3717 end; … … 3725 3724 if (Subject >= nAttitude) or (p1 >= nPl) or 3726 3725 (RW[Player].EnemyReport[p1] = nil) then 3727 result := eInvalid3726 Result := eInvalid 3728 3727 else if RW[Player].Treaty[p1] = trNoContact then 3729 result := eNoPreq3728 Result := eNoPreq 3730 3729 else if RW[Player].Attitude[p1] = Subject then 3731 result := eNotChanged3730 Result := eNotChanged 3732 3731 else if Command >= sExecute then 3733 3732 begin … … 3740 3739 if (LastEndClientCommand <> scReject) or 3741 3740 (RW[Player].Treaty[pContacted] < trPeace) then 3742 result := eInvalid3741 Result := eInvalid 3743 3742 else if (ServerVersion[Player] >= $010100) and 3744 3743 (GTurn < RW[Player].LastCancelTreaty[pContacted] + CancelTreatyTurns) 3745 3744 then 3746 result := eCancelTreatyRush3745 Result := eCancelTreatyRush 3747 3746 else if Command >= sExecute then 3748 3747 begin … … 3752 3751 if (p2 <> pContacted) and (1 shl p2 and PeaceEnded <> 0) then 3753 3752 begin 3754 i:= pContacted shl 4 + Player;3755 CallPlayer(cShowSupportAllianceAgainst, p2, i);3753 I := pContacted shl 4 + Player; 3754 CallPlayer(cShowSupportAllianceAgainst, p2, I); 3756 3755 end; 3757 3756 for p2 := 0 to nPl - 1 do 3758 3757 if (p2 <> pContacted) and (1 shl p2 and PeaceEnded <> 0) then 3759 3758 begin 3760 i:= p2;3761 CallPlayer(cShowCancelTreatyByAlliance, Player, i);3759 I := p2; 3760 CallPlayer(cShowCancelTreatyByAlliance, Player, I); 3762 3761 end; 3763 3762 LastEndClientCommand := sTurn; … … 3772 3771 {$IFDEF TEXTLOG}CmdInfo := Format('CreateDevModel P%d', [Player]); {$ENDIF} 3773 3772 if Subject >= 4 then 3774 result := eInvalid3773 Result := eInvalid 3775 3774 else if (upgrade[Subject, 0].Preq <> preNone) and 3776 3775 (RW[Player].Tech[upgrade[Subject, 0].Preq] < tsApplicable) then 3777 result := eNoPreq3776 Result := eNoPreq 3778 3777 else if Command >= sExecute then 3779 3778 begin … … 3786 3785 Upgrades := 0; 3787 3786 FutureMCost := 0; 3788 for i:= 0 to nUpgrade - 1 do3789 with upgrade[Domain, i] do3787 for I := 0 to nUpgrade - 1 do 3788 with upgrade[Domain, I] do 3790 3789 if (Preq = preNone) or (Preq >= 0) and 3791 3790 ((RW[Player].Tech[Preq] >= tsApplicable) or … … 3794 3793 if Preq in FutureTech then 3795 3794 begin 3796 j:= RW[Player].Tech[Preq];3797 inc(FutureMCost, j* Cost);3795 J := RW[Player].Tech[Preq]; 3796 Inc(FutureMCost, J * Cost); 3798 3797 end 3799 3798 else 3800 3799 begin 3801 j:= 1;3800 J := 1; 3802 3801 if Cost > MCost then 3803 3802 MCost := Cost; 3804 3803 end; 3805 inc(Upgrades, 1 shl i);3806 inc(MStrength, j* Strength);3807 inc(MTrans, j* Trans);3804 Inc(Upgrades, 1 shl I); 3805 Inc(MStrength, J * Strength); 3806 Inc(MTrans, J * Trans); 3808 3807 end; 3809 inc(MCost, FutureMCost);3808 Inc(MCost, FutureMCost); 3810 3809 FillChar(Cap, SizeOf(Cap), 0); 3811 3810 Cap[mcOffense] := 2; 3812 3811 Cap[mcDefense] := 1; 3813 for i:= 0 to nFeature - 1 do3814 with Feature[ i] do3812 for I := 0 to nFeature - 1 do 3813 with Feature[I] do 3815 3814 if (1 shl Domain and Domains <> 0) and 3816 3815 ((Preq = preNone) or (Preq = preSun) and 3817 3816 (GWonder[woSun].EffectiveOwner = Player) or (Preq >= 0) and 3818 (RW[Player].Tech[Preq] >= tsApplicable)) and ( iin AutoFeature)3817 (RW[Player].Tech[Preq] >= tsApplicable)) and (I in AutoFeature) 3819 3818 then 3820 Cap[ i] := 1;3819 Cap[I] := 1; 3821 3820 MaxWeight := 5; 3822 3821 if (WeightPreq7[Domain] <> preNA) and … … 3840 3839 {$IFDEF TEXTLOG}CmdInfo := Format('SetDevModelCap P%d', [Player]); {$ENDIF} 3841 3840 if Subject >= nFeature then 3842 result := eInvalid3841 Result := eInvalid 3843 3842 else if DevModelTurn[Player] = GTurn then 3844 3843 begin … … 3846 3845 with RW[Player].DevModel do 3847 3846 if 1 shl Domain and Feature[Subject].Domains = 0 then 3848 result := eDomainMismatch3847 Result := eDomainMismatch 3849 3848 else if not((Feature[Subject].Preq = preNone) or 3850 3849 (Feature[Subject].Preq = preSun) and … … 3852 3851 (Feature[Subject].Preq >= 0) and 3853 3852 (RW[Player].Tech[Feature[Subject].Preq] >= tsApplicable)) then 3854 result := eNoPreq3853 Result := eNoPreq 3855 3854 else 3856 3855 begin … … 3868 3867 MaxCap := 3; 3869 3868 if RW[Player].Tech[adSteel] >= tsApplicable then 3870 inc(MaxCap);3869 Inc(MaxCap); 3871 3870 end 3872 3871 else … … 3878 3877 if (NewCap < MinCap) or (NewCap > MaxCap) or 3879 3878 (Weight + (NewCap - Cap[Subject]) * CapWeight > MaxWeight) then 3880 result := eViolation3879 Result := eViolation 3881 3880 else if Command >= sExecute then 3882 3881 begin … … 3921 3920 end 3922 3921 else 3923 result := eNoModel;3922 Result := eNoModel; 3924 3923 end; 3925 3924 … … 3932 3931 {$IFDEF TEXTLOG}CmdInfo := Format('RemoveUnit P%d Mod%d Loc%d', [Player, RW[Player].Un[Subject].mix, RW[Player].Un[Subject].Loc]); {$ENDIF} 3933 3932 if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then 3934 result := eInvalid3933 Result := eInvalid 3935 3934 else 3936 3935 begin 3937 result := eRemoved;3936 Result := eRemoved; 3938 3937 Loc0 := RW[Player].Un[Subject].Loc; 3939 3938 if RealMap[Loc0] and fCity <> 0 then { check utilize } … … 3947 3946 (Project and cpImp = 0) and 3948 3947 (RW[Player].Model[Project and cpIndex].Kind <> mkCaravan) then 3949 result := eUtilized;3948 Result := eUtilized; 3950 3949 if Command >= sExecute then 3951 3950 begin 3952 if result = eUtilized then3951 if Result = eUtilized then 3953 3952 begin 3954 3953 with RW[Player].Un[Subject] do 3955 3954 begin 3956 Cost := integer(RW[Player].Model[mix].Cost) * Health *3955 Cost := Integer(RW[Player].Model[mix].Cost) * Health * 3957 3956 BuildCostMod[Difficulty[Player]] div 1200; 3958 3957 if RW[Player].Model[mix].Cap[mcLine] > 0 then … … 3960 3959 end; 3961 3960 if Project and (cpImp + cpIndex) = cpImp + imTrGoods then 3962 inc(RW[Player].Money, Cost)3961 Inc(RW[Player].Money, Cost) 3963 3962 else 3964 3963 begin 3965 inc(Prod, Cost * 2 div 3);3964 Inc(Prod, Cost * 2 div 3); 3966 3965 Project0 := Project0 and not cpCompleted; 3967 3966 if Project0 and not cpAuto <> Project and not cpAuto then … … 3983 3982 {$IFDEF TEXTLOG}CmdInfo := Format('SetUnitHome P%d Mod%d Loc%d', [Player, RW[Player].Un[Subject].mix, RW[Player].Un[Subject].Loc]); {$ENDIF} 3984 3983 if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then 3985 result := eInvalid3984 Result := eInvalid 3986 3985 else 3987 3986 begin 3988 3987 Loc0 := RW[Player].Un[Subject].Loc; 3989 3988 if RealMap[Loc0] and fCity = 0 then 3990 result := eInvalid3989 Result := eInvalid 3991 3990 else 3992 3991 begin 3993 3992 SearchCity(Loc0, Player, cix1); 3994 3993 if RW[Player].City[cix1].Flags and chCaptured <> 0 then 3995 result := eViolation3994 Result := eViolation 3996 3995 else if Command >= sExecute then 3997 3996 RW[Player].Un[Subject].Home := cix1; … … 4010 4009 {$IFDEF TEXTLOG}CmdInfo := Format('LoadUnit P%d Mod%d Loc%d', [Player, RW[Player].Un[Subject].mix, RW[Player].Un[Subject].Loc]); {$ENDIF} 4011 4010 if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then 4012 result := eInvalid4011 Result := eInvalid 4013 4012 else 4014 result := LoadUnit(Player, Subject, Command < sExecute);4013 Result := LoadUnit(Player, Subject, Command < sExecute); 4015 4014 end; 4016 4015 … … 4019 4018 {$IFDEF TEXTLOG}CmdInfo := Format('UnloadUnit P%d Mod%d Loc%d', [Player, RW[Player].Un[Subject].mix, RW[Player].Un[Subject].Loc]); {$ENDIF} 4020 4019 if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then 4021 result := eInvalid4020 Result := eInvalid 4022 4021 else 4023 result := UnloadUnit(Player, Subject, Command < sExecute);4022 Result := UnloadUnit(Player, Subject, Command < sExecute); 4024 4023 end; 4025 4024 4026 4025 sSelectTransport, sSelectTransport - sExecute: 4027 4026 if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then 4028 result := eInvalid4027 Result := eInvalid 4029 4028 else 4030 4029 with RW[Player].Model[RW[Player].Un[Subject].mix] do 4031 4030 begin 4032 4031 if Cap[mcSeaTrans] + Cap[mcAirTrans] + Cap[mcCarrier] = 0 then 4033 result := eInvalid4032 Result := eInvalid 4034 4033 else if Command >= sExecute then 4035 4034 uixSelectedTransport := Subject; … … 4042 4041 begin 4043 4042 p1 := Command shr 4 and $F; 4044 Loc1 := integer(Data);4043 Loc1 := Integer(Data); 4045 4044 if (Occupant[Loc1] >= 0) and (p1 <> Occupant[Loc1]) or 4046 4045 (RealMap[Loc1] and fCity <> 0) and 4047 4046 (RealMap[Loc1] shr 27 <> Cardinal(p1)) or 4048 4047 (RW[p1].Model[Subject].Domain < dAir) and 4049 ((RW[p1].Model[Subject].Domain = dSea) <> (RealMap[ integer(Data)] and4048 ((RW[p1].Model[Subject].Domain = dSea) <> (RealMap[Integer(Data)] and 4050 4049 fTerrain < fGrass)) then 4051 result := eViolation4050 Result := eViolation 4052 4051 else if Command >= sExecute then 4053 4052 begin 4054 4053 CreateUnit(p1, Subject); 4055 RW[p1].Un[RW[p1].nUn - 1].Loc := integer(Data);4054 RW[p1].Un[RW[p1].nUn - 1].Loc := Integer(Data); 4056 4055 PlaceUnit(p1, RW[p1].nUn - 1); 4057 UpdateUnitMap( integer(Data));4056 UpdateUnitMap(Integer(Data)); 4058 4057 end; 4059 4058 end 4060 4059 else 4061 result := eInvalid;4060 Result := eInvalid; 4062 4061 4063 4062 sMoveUnit + (0 + 6 * 8) * 16, sMoveUnit + (1 + 7 * 8) * 16, … … 4076 4075 {$IFDEF TEXTLOG}CmdInfo := Format('MoveUnit P%d I%d Mod%d Loc%d (%d,%d)', [Player, Subject, RW[Player].Un[Subject].mix, RW[Player].Un[Subject].Loc, dx, dy]); {$ENDIF} 4077 4076 if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then 4078 result := eInvalid4077 Result := eInvalid 4079 4078 else 4080 result := MoveUnit(Player, Subject, dx, dy, Command < sExecute);4079 Result := MoveUnit(Player, Subject, dx, dy, Command < sExecute); 4081 4080 end; 4082 4081 … … 4089 4088 {$IFDEF TEXTLOG}CmdInfo := Format('AddToCity P%d Mod%d Loc%d', [Player, RW[Player].Un[Subject].mix, RW[Player].Un[Subject].Loc]); {$ENDIF} 4090 4089 if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then 4091 result := eInvalid4090 Result := eInvalid 4092 4091 else if not(RW[Player].Model[RW[Player].Un[Subject].mix].Kind 4093 4092 in [mkSettler, mkSlaves]) and 4094 4093 (RW[Player].Un[Subject].Flags and unConscripts = 0) then 4095 result := eViolation4094 Result := eViolation 4096 4095 else 4097 4096 begin 4098 4097 Loc0 := RW[Player].Un[Subject].Loc; 4099 4098 if RealMap[Loc0] and fCity = 0 then 4100 result := eInvalid4099 Result := eInvalid 4101 4100 else 4102 4101 begin … … 4104 4103 with RW[Player].City[cix1] do 4105 4104 if not CanCityGrow(Player, cix1) then 4106 result := eMaxSize4105 Result := eMaxSize 4107 4106 else if Command >= sExecute then 4108 4107 begin { add to city } … … 4124 4123 begin 4125 4124 Loc0 := RW[Player].Un[Subject].Loc; 4126 i:= Command shr 4 and $3F; // new job4127 {$IFDEF TEXTLOG}CmdInfo := Format('StartJob P%d Mod%d Loc%d: %d', [Player, RW[Player].Un[Subject].mix, Loc0, i]); {$ENDIF}4125 I := Command shr 4 and $3F; // new job 4126 {$IFDEF TEXTLOG}CmdInfo := Format('StartJob P%d Mod%d Loc%d: %d', [Player, RW[Player].Un[Subject].mix, Loc0, I]); {$ENDIF} 4128 4127 if (Subject >= RW[Player].nUn) or (Loc0 < 0) then 4129 result := eInvalid4130 else if i>= nJob then4131 result := eInvalid4128 Result := eInvalid 4129 else if I >= nJob then 4130 Result := eInvalid 4132 4131 else 4133 4132 begin 4134 result := StartJob(Player, Subject, i, Command < sExecute);4135 if result = eCity then4133 Result := StartJob(Player, Subject, I, Command < sExecute); 4134 if Result = eCity then 4136 4135 begin // new city 4137 4136 cix1 := RW[Player].nCity - 1; … … 4158 4157 sSetCityProject, sSetCityProject - sExecute: 4159 4158 begin 4160 NewProject := integer(Data) and not cpAuto;4159 NewProject := Integer(Data) and not cpAuto; 4161 4160 {$IFDEF TEXTLOG}CmdInfo := Format('SetCityProject P%d Loc%d: %d', [Player, RW[Player].City[Subject].Loc, NewProject]); {$ENDIF} 4162 4161 if (Subject >= RW[Player].nCity) or (RW[Player].City[Subject].Loc < 0) 4163 4162 then 4164 result := eInvalid4163 Result := eInvalid 4165 4164 else 4166 4165 with RW[Player].City[Subject] do 4167 4166 begin 4168 4167 if NewProject = Project then 4169 result := eNotChanged4168 Result := eNotChanged 4170 4169 else 4171 4170 begin … … 4175 4174 begin 4176 4175 if NewProject and cpIndex >= RW[Player].nModel then 4177 result := eInvalid4176 Result := eInvalid 4178 4177 else if (NewProject and cpConscripts <> 0) and 4179 4178 not((RW[Player].Tech[adConscription] >= tsApplicable) and … … 4181 4180 and (RW[Player].Model[NewProject and cpIndex].Kind < mkScout)) 4182 4181 then 4183 result := eViolation4182 Result := eViolation 4184 4183 // else if (RW[Player].Model[NewProject and cpIndex].Kind=mkSlaves) 4185 4184 // and (GWonder[woPyramids].EffectiveOwner<>Player) then … … 4187 4186 end 4188 4187 else if NewProject and cpIndex >= nImp then 4189 result := eInvalid4188 Result := eInvalid 4190 4189 else 4191 4190 begin 4192 4191 Preq := Imp[NewProject and cpIndex].Preq; 4193 for i:= 0 to nImpReplacement - 1 do4194 if (ImpReplacement[ i].OldImp = NewProject and cpIndex) and4195 (built[ImpReplacement[ i].NewImp] > 0) then4196 result := eObsolete;4197 if result = eObsolete then4192 for I := 0 to nImpReplacement - 1 do 4193 if (ImpReplacement[I].OldImp = NewProject and cpIndex) and 4194 (built[ImpReplacement[I].NewImp] > 0) then 4195 Result := eObsolete; 4196 if Result = eObsolete then 4198 4197 else if Preq = preNA then 4199 result := eInvalid4198 Result := eInvalid 4200 4199 else if (Preq >= 0) and (RW[Player].Tech[Preq] < tsApplicable) 4201 4200 then 4202 result := eNoPreq4201 Result := eNoPreq 4203 4202 else if built[NewProject and cpIndex] > 0 then 4204 result := eInvalid4203 Result := eInvalid 4205 4204 else if (NewProject and cpIndex < nWonder) and 4206 4205 (GWonder[NewProject and cpIndex].CityID <> WonderNotBuiltYet) then 4207 result := eViolation // wonder already exists4206 Result := eViolation // wonder already exists 4208 4207 else if (NewProject and cpIndex = imSpacePort) and 4209 4208 (RW[Player].NatBuilt[imSpacePort] > 0) then 4210 result := eViolation // space port already exists4209 Result := eViolation // space port already exists 4211 4210 else if (NewProject = cpImp + imBank) and (built[imMarket] = 0) 4212 4211 or (NewProject = cpImp + imUniversity) and … … 4214 4213 (built[imUniversity] = 0) or (NewProject = cpImp + imMfgPlant) 4215 4214 and (built[imFactory] = 0) then 4216 result := eNoPreq;4215 Result := eNoPreq; 4217 4216 case NewProject - cpImp of 4218 4217 woLighthouse, woMagellan, imCoastalFort, imHarbor, imPlatform: … … 4225 4224 if (Loc1 >= 0) and (Loc1 < MapSize) and 4226 4225 (RealMap[Loc1] and fTerrain = fShore) then 4227 inc(Preq);4226 Inc(Preq); 4228 4227 end; 4229 4228 if Preq = 0 then 4230 result := eNoPreq;4229 Result := eNoPreq; 4231 4230 end; 4232 4231 woHoover, imHydro: … … 4240 4239 ((RealMap[Loc1] and fTerrain = fMountains) or 4241 4240 (RealMap[Loc1] and fRiver <> 0)) then 4242 inc(Preq);4241 Inc(Preq); 4243 4242 end; 4244 4243 if Preq = 0 then 4245 result := eNoPreq;4244 Result := eNoPreq; 4246 4245 end; 4247 4246 woMIR, imShipComp, imShipPow, imShipHab: 4248 4247 if RW[Player].NatBuilt[imSpacePort] = 0 then 4249 result := eNoPreq;4248 Result := eNoPreq; 4250 4249 end; 4251 4250 if (GTestFlags and tfNoRareNeed = 0) and 4252 4251 (Imp[NewProject and cpIndex].Kind = ikShipPart) then 4253 4252 if RW[Player].Tech[adMassProduction] < tsApplicable then 4254 result := eNoPreq4253 Result := eNoPreq 4255 4254 else 4256 4255 begin // check for rare resources 4257 4256 if NewProject and cpIndex = imShipComp then 4258 j:= 14257 J := 1 4259 4258 else if NewProject and cpIndex = imShipPow then 4260 j:= 24259 J := 2 4261 4260 else { if NewProject and cpIndex=imShipHab then } 4262 j:= 3;4261 J := 3; 4263 4262 // j = rare resource required 4264 4263 Preq := 0; … … 4268 4267 Loc1 := Radius[V21]; 4269 4268 if (Loc1 >= 0) and (Loc1 < MapSize) and 4270 (RealMap[Loc1] shr 25 and 3 = Cardinal( j)) then4271 inc(Preq);4269 (RealMap[Loc1] shr 25 and 3 = Cardinal(J)) then 4270 Inc(Preq); 4272 4271 end; 4273 4272 if Preq = 0 then 4274 result := eNoPreq;4273 Result := eNoPreq; 4275 4274 end; 4276 4275 end; 4277 4276 4278 if (Command >= sExecute) and ( result >= rExecuted) then4277 if (Command >= sExecute) and (Result >= rExecuted) then 4279 4278 begin 4280 4279 if pt0 <> ptSelect then … … 4285 4284 and (pt0 <> ptCaravan) then 4286 4285 begin 4287 inc(RW[Player].Money, Prod0);4286 Inc(RW[Player].Money, Prod0); 4288 4287 Prod := 0; 4289 4288 Prod0 := 0; … … 4292 4291 else 4293 4292 Prod := Prod0 * 2 div 3; 4294 Project := NewProject 4293 Project := NewProject; 4295 4294 end; 4296 4295 end; … … 4303 4302 if (Subject >= RW[Player].nCity) or (RW[Player].City[Subject].Loc < 0) 4304 4303 then 4305 result := eInvalid4304 Result := eInvalid 4306 4305 else 4307 4306 with RW[Player].City[Subject] do 4308 4307 if (RW[Player].Government = gAnarchy) or (Flags and chCaptured <> 0) 4309 4308 then 4310 result := eOutOfControl4309 Result := eOutOfControl 4311 4310 else if (Project and cpImp <> 0) and 4312 4311 ((Project and cpIndex = imTrGoods) or 4313 4312 (Imp[Project and cpIndex].Kind = ikShipPart)) then 4314 result := eInvalid // don't buy colony ship4313 Result := eInvalid // don't buy colony ship 4315 4314 else 4316 4315 begin … … 4331 4330 Cost := Cost * 4; 4332 4331 if Cost <= 0 then 4333 result := eNotChanged4332 Result := eNotChanged 4334 4333 else if Cost > RW[Player].Money then 4335 result := eViolation4334 Result := eViolation 4336 4335 else if Command >= sExecute then 4337 4336 IntServer(sIntBuyMaterial, Player, Subject, Cost); … … 4346 4345 if (Subject >= RW[Player].nCity) or (RW[Player].City[Subject].Loc < 0) 4347 4346 then 4348 result := eInvalid4347 Result := eInvalid 4349 4348 else if Command >= sExecute then 4350 4349 with RW[Player].City[Subject] do 4351 4350 begin 4352 inc(RW[Player].Money, Prod0);4351 Inc(RW[Player].Money, Prod0); 4353 4352 Prod := 0; 4354 4353 Prod0 := 0; … … 4358 4357 sSellCityImprovement, sSellCityImprovement - sExecute: 4359 4358 begin 4360 {$IFDEF TEXTLOG}CmdInfo := Format('SellCityImprovement P%d Loc%d: %d', [Player, RW[Player].City[Subject].Loc, integer(Data)]); {$ENDIF}4359 {$IFDEF TEXTLOG}CmdInfo := Format('SellCityImprovement P%d Loc%d: %d', [Player, RW[Player].City[Subject].Loc, Integer(Data)]); {$ENDIF} 4361 4360 if (Subject >= RW[Player].nCity) or (RW[Player].City[Subject].Loc < 0) 4362 4361 then 4363 result := eInvalid4362 Result := eInvalid 4364 4363 else 4365 4364 with RW[Player].City[Subject] do 4366 if built[ integer(Data)] = 0 then4367 result := eInvalid4365 if built[Integer(Data)] = 0 then 4366 Result := eInvalid 4368 4367 else if (RW[Player].Government = gAnarchy) or 4369 4368 (Flags and chCaptured <> 0) then 4370 result := eOutOfControl4369 Result := eOutOfControl 4371 4370 else if Flags and chImprovementSold <> 0 then 4372 result := eOnlyOnce4371 Result := eOnlyOnce 4373 4372 else if Command >= sExecute then 4374 4373 begin 4375 inc(RW[Player].Money, Imp[integer(Data)].Cost * BuildCostMod4374 Inc(RW[Player].Money, Imp[Integer(Data)].Cost * BuildCostMod 4376 4375 [Difficulty[Player]] div 12); 4377 built[ integer(Data)] := 0;4378 if Imp[ integer(Data)].Kind in [ikNatLocal, ikNatGlobal] then4376 built[Integer(Data)] := 0; 4377 if Imp[Integer(Data)].Kind in [ikNatLocal, ikNatGlobal] then 4379 4378 begin 4380 RW[Player].NatBuilt[ integer(Data)] := 0;4381 case integer(Data) of4379 RW[Player].NatBuilt[Integer(Data)] := 0; 4380 case Integer(Data) of 4382 4381 imGrWall: 4383 4382 GrWallContinent[Player] := -1; … … 4386 4385 end; 4387 4386 end; 4388 inc(Flags, chImprovementSold);4387 Inc(Flags, chImprovementSold); 4389 4388 end; 4390 4389 end; … … 4392 4391 sRebuildCityImprovement, sRebuildCityImprovement - sExecute: 4393 4392 begin 4394 OldImp := integer(Data);4393 OldImp := Integer(Data); 4395 4394 {$IFDEF TEXTLOG}CmdInfo := Format('RebuildCityImprovement P%d Loc%d: %d', [Player, RW[Player].City[Subject].Loc, OldImp]); {$ENDIF} 4396 4395 if (Subject >= RW[Player].nCity) or (RW[Player].City[Subject].Loc < 0) 4397 4396 then 4398 result := eInvalid4397 Result := eInvalid 4399 4398 else 4400 4399 begin 4401 4400 if (OldImp < 0) or (OldImp >= nImp) or 4402 4401 not(Imp[OldImp].Kind in [ikCommon, ikNatLocal, ikNatGlobal]) then 4403 result := eInvalid4402 Result := eInvalid 4404 4403 else 4405 4404 with RW[Player].City[Subject] do … … 4407 4406 not(Imp[Project and cpIndex].Kind in [ikCommon, ikNatLocal, 4408 4407 ikNatGlobal]) then 4409 result := eInvalid4408 Result := eInvalid 4410 4409 else if (RW[Player].Government = gAnarchy) or 4411 4410 (Flags and chCaptured <> 0) then 4412 result := eOutOfControl4411 Result := eOutOfControl 4413 4412 else if Flags and chImprovementSold <> 0 then 4414 result := eOnlyOnce4413 Result := eOnlyOnce 4415 4414 else if Command >= sExecute then 4416 4415 begin 4417 inc(Prod, Imp[OldImp].Cost * BuildCostMod[Difficulty[Player]]4416 Inc(Prod, Imp[OldImp].Cost * BuildCostMod[Difficulty[Player]] 4418 4417 div 12 * 2 div 3); 4419 4418 Project0 := Project0 and not cpCompleted; … … 4432 4431 end; 4433 4432 end; 4434 inc(Flags, chImprovementSold);4433 Inc(Flags, chImprovementSold); 4435 4434 end; 4436 4435 end; … … 4439 4438 sSetCityTiles, sSetCityTiles - sExecute: 4440 4439 begin 4441 {$IFDEF TEXTLOG}CmdInfo := Format('SetCityTiles P%d Loc%d: %x', [Player, RW[Player].City[Subject].Loc, integer(Data)]); {$ENDIF}4440 {$IFDEF TEXTLOG}CmdInfo := Format('SetCityTiles P%d Loc%d: %x', [Player, RW[Player].City[Subject].Loc, Integer(Data)]); {$ENDIF} 4442 4441 if (Subject >= RW[Player].nCity) or (RW[Player].City[Subject].Loc < 0) 4443 4442 then 4444 result := eInvalid4443 Result := eInvalid 4445 4444 else 4446 result := SetCityTiles(Player, Subject, integer(Data),4445 Result := SetCityTiles(Player, Subject, Integer(Data), 4447 4446 Command < sExecute); 4448 4447 end; … … 4461 4460 end 4462 4461 else 4463 result := eUnknown;4462 Result := eUnknown; 4464 4463 end; { case command } 4465 4464 4466 4465 // do not log invalid and non-relevant commands 4467 if result = eZOC_EnemySpotted then4466 if Result = eZOC_EnemySpotted then 4468 4467 begin 4469 assert(Mode = moPlaying);4468 Assert(Mode = moPlaying); 4470 4469 CL.State := FormerCLState; 4471 4470 IntServer(sIntDiscoverZOC, Player, 0, ZOCTile); 4472 4471 end 4473 else if result and rEffective = 0 then4472 else if Result and rEffective = 0 then 4474 4473 if Mode < moPlaying then 4475 4474 begin 4476 {$IFDEF TEXTLOG}CmdInfo := Format('***ERROR (%x) ', [ result]) + CmdInfo;4475 {$IFDEF TEXTLOG}CmdInfo := Format('***ERROR (%x) ', [Result]) + CmdInfo; 4477 4476 {$ENDIF} 4478 LoadOK := false;4477 LoadOK := False; 4479 4478 end 4480 4479 else … … 4482 4481 if logged then 4483 4482 CL.State := FormerCLState; 4484 if ( result < rExecuted) and (Command >= sExecute) then4483 if (Result < rExecuted) and (Command >= sExecute) then 4485 4484 PutMessage(1 shl 16 + 1, Format('INVALID: %d calls %x (%d)', 4486 4485 [Player, Command, Subject])); … … 4488 4487 4489 4488 if (Command and (cClientEx or sExecute or sctMask) = sExecute or sctEndClient) 4490 and ( result >= rExecuted) then4489 and (Result >= rExecuted) then 4491 4490 LastEndClientCommand := Command; 4492 {$IFOPT O-} dec(nHandoverStack, 2); {$ENDIF}4493 end; { <<<server }4491 {$IFOPT O-}Dec(nHandoverStack, 2); {$ENDIF} 4492 end; 4494 4493 4495 4494 -
branches/highdpi/Global.pas
r412 r465 24 24 ((CevoVersionBugFix and $ff) shl 0); 25 25 26 27 26 implementation 28 27 29 28 end. 30 29 30 -
branches/highdpi/Graphics/System2.grs
r349 r465 9 9 <Height>26</Height> 10 10 </Item> 11 <Item> 12 <Name>BrainNoTerm</Name> 13 <Left>1</Left> 14 <Top>111</Top> 15 <Width>64</Width> 16 <Height>64</Height> 17 </Item> 18 <Item> 19 <Name>BrainSuperVirtual</Name> 20 <Left>66</Left> 21 <Top>111</Top> 22 <Width>64</Width> 23 <Height>64</Height> 24 </Item> 25 <Item> 26 <Name>BrainTerm</Name> 27 <Left>131</Left> 28 <Top>111</Top> 29 <Width>64</Width> 30 <Height>64</Height> 31 </Item> 32 <Item> 33 <Name>BrainRandom</Name> 34 <Left>131</Left> 35 <Top>46</Top> 36 <Width>64</Width> 37 <Height>64</Height> 38 </Item> 11 39 </Items> 12 40 </GraphicSet> -
branches/highdpi/IPQ.pas
r303 r465 1 1 { binary heap priority queue 2 code contributed by Rassim Eminli }2 Code contributed by Rassim Eminli } 3 3 4 4 {$INCLUDE Switches.inc} … … 8 8 9 9 type 10 11 TIntegerArray = array [0 .. $40000000 div sizeof(integer)] of integer; 10 TIntegerArray = array [0 .. $40000000 div SizeOf(Integer)] of Integer; 12 11 PIntegerArray = ^TIntegerArray; 13 12 14 13 TheapItem = record 15 Item: integer;16 Value: integer;14 Item: Integer; 15 Value: Integer; 17 16 end; 18 17 19 TItemArray = array [0 .. $40000000 div sizeof(TheapItem)] of TheapItem;18 TItemArray = array [0 .. $40000000 div SizeOf(TheapItem)] of TheapItem; 20 19 PItemArray = ^TItemArray; 21 20 22 21 TIPQ = class 23 constructor Create( max: integer);22 constructor Create(Max: Integer); 24 23 destructor Destroy; override; 25 24 procedure Empty; 26 function Put(Item, Value: integer): boolean;27 function TestPut(Item, Value: integer): boolean;28 function Get(var Item, Value: integer): boolean;25 function Put(Item, Value: Integer): Boolean; 26 function TestPut(Item, Value: Integer): Boolean; 27 function Get(var Item, Value: Integer): Boolean; 29 28 private 30 29 // n - is the size of the heap. 31 30 // fmax - is the max size of the heap. 32 n, fmax: integer;31 N, fmax: Integer; 33 32 34 33 // bh - stores (Value, Item) pairs of the heap. … … 40 39 implementation 41 40 42 constructor TIPQ.Create( max: integer);41 constructor TIPQ.Create(Max: Integer); 43 42 begin 44 43 inherited Create; 45 fmax := max;46 GetMem(bh, fmax * sizeof(TheapItem));47 GetMem(Ix, fmax * sizeof(integer));48 n:= -1;44 fmax := Max; 45 GetMem(bh, fmax * SizeOf(TheapItem)); 46 GetMem(Ix, fmax * SizeOf(Integer)); 47 N := -1; 49 48 Empty; 50 49 end; … … 59 58 procedure TIPQ.Empty; 60 59 begin 61 if n<> 0 then60 if N <> 0 then 62 61 begin 63 FillChar(Ix^, fmax * sizeof(integer), 255);64 n:= 0;62 FillChar(Ix^, fmax * SizeOf(Integer), 255); 63 N := 0; 65 64 end; 66 65 end; 67 66 68 67 // Parent(i) = (i-1)/2. 69 function TIPQ.Put(Item, Value: integer): boolean; // O(lg(n))68 function TIPQ.Put(Item, Value: Integer): Boolean; // O(lg(n)) 70 69 var 71 i, j: integer;70 I, J: Integer; 72 71 lbh: PItemArray; 73 72 lIx: PIntegerArray; … … 75 74 lIx := Ix; 76 75 lbh := bh; 77 i:= lIx[Item];78 if i>= 0 then76 I := lIx[Item]; 77 if I >= 0 then 79 78 begin 80 if lbh[ i].Value <= Value then79 if lbh[I].Value <= Value then 81 80 begin 82 result := False;83 exit;81 Result := False; 82 Exit; 84 83 end; 85 84 end 86 85 else 87 86 begin 88 i := n;89 Inc( n);87 I := N; 88 Inc(N); 90 89 end; 91 90 92 while i> 0 do91 while I > 0 do 93 92 begin 94 j := (i- 1) shr 1; // Parent(i) = (i-1)/295 if Value >= lbh[ j].Value then96 break;97 lbh[ i] := lbh[j];98 lIx[lbh[ i].Item] := i;99 i := j;93 J := (I - 1) shr 1; // Parent(i) = (i-1)/2 94 if Value >= lbh[J].Value then 95 Break; 96 lbh[I] := lbh[J]; 97 lIx[lbh[I].Item] := I; 98 I := J; 100 99 end; 101 100 // Insert the new Item at the insertion point found. 102 lbh[ i].Value := Value;103 lbh[ i].Item := Item;104 lIx[lbh[ i].Item] := i;105 result := True;101 lbh[I].Value := Value; 102 lbh[I].Item := Item; 103 lIx[lbh[I].Item] := I; 104 Result := True; 106 105 end; 107 106 108 function TIPQ.TestPut(Item, Value: integer): boolean;107 function TIPQ.TestPut(Item, Value: Integer): Boolean; 109 108 var 110 i: integer;109 I: Integer; 111 110 begin 112 i:= Ix[Item];113 result := (i < 0) or (bh[i].Value > Value);111 I := Ix[Item]; 112 Result := (I < 0) or (bh[I].Value > Value); 114 113 end; 115 114 116 115 // Left(i) = 2*i+1. 117 116 // Right(i) = 2*i+2 => Left(i)+1 118 function TIPQ.Get(var Item, Value: integer): boolean; // O(lg(n))117 function TIPQ.Get(var Item, Value: Integer): Boolean; // O(lg(n)) 119 118 var 120 i, j: integer;121 last: TheapItem;119 I, J: Integer; 120 Last: TheapItem; 122 121 lbh: PItemArray; 123 122 begin 124 if n= 0 then123 if N = 0 then 125 124 begin 126 result := False;127 exit;125 Result := False; 126 Exit; 128 127 end; 129 128 … … 134 133 Ix[Item] := -1; 135 134 136 dec(n);137 if n> 0 then135 Dec(N); 136 if N > 0 then 138 137 begin 139 last := lbh[n];140 i:= 0;141 j:= 1;142 while j < ndo138 Last := lbh[N]; 139 I := 0; 140 J := 1; 141 while J < N do 143 142 begin 144 143 // Right(i) = Left(i)+1 145 if ( j < n - 1) and (lbh[j].Value > lbh[j+ 1].Value) then146 Inc( j);147 if last.Value <= lbh[j].Value then148 break;144 if (J < N - 1) and (lbh[J].Value > lbh[J + 1].Value) then 145 Inc(J); 146 if Last.Value <= lbh[J].Value then 147 Break; 149 148 150 lbh[ i] := lbh[j];151 Ix[lbh[ i].Item] := i;152 i := j;153 j := jshl 1 + 1; // Left(j) = 2*j+1149 lbh[I] := lbh[J]; 150 Ix[lbh[I].Item] := I; 151 I := J; 152 J := J shl 1 + 1; // Left(j) = 2*j+1 154 153 end; 155 154 156 155 // Insert the root in the correct place in the heap. 157 lbh[ i] := last;158 Ix[ last.Item] := i;156 lbh[I] := Last; 157 Ix[Last.Item] := I; 159 158 end; 160 result := True159 Result := True; 161 160 end; 162 161 -
branches/highdpi/Inp.pas
r412 r465 21 21 procedure CenterToRect(Rect: TRect); 22 22 private 23 Center: boolean;23 Center: Boolean; 24 24 end; 25 25 26 26 var 27 27 InputDlg: TInputDlg; 28 28 29 29 30 implementation … … 53 54 9, Caption); 54 55 { Corner(canvas,1,1,0,MainTexture); 55 Corner( canvas,ClientWidth-9,1,1,MainTexture);56 Corner( canvas,1,ClientHeight-9,2,MainTexture);57 Corner( canvas,ClientWidth-9,ClientHeight-9,3,MainTexture); }56 Corner(Canvas,ClientWidth-9,1,1,MainTexture); 57 Corner(Canvas,1,ClientHeight-9,2,MainTexture); 58 Corner(Canvas,ClientWidth-9,ClientHeight-9,3,MainTexture); } 58 59 end; 59 60 -
branches/highdpi/Install/rpm/c-evo.spec
r405 r465 11 11 Requires: sox 12 12 13 #BuildRequires: lazarus 13 BuildRequires: lazarus >= 2.0.12 14 14 15 15 %description 16 Turn-based empire building game inspired by Civilization.16 A turn-based empire building game inspired by Civilization. 17 17 18 18 %global debug_package %{nil} … … 72 72 /usr/bin/c-evo 73 73 /usr/share/applications/c-evo.desktop 74 /usr/share/c-evo/ *74 /usr/share/c-evo/ 75 75 /usr/share/pixmaps/c-evo.png 76 76 -
branches/highdpi/Install/snap/local/build.sh
r405 r465 4 4 5 5 pushd ../../.. 6 snapcraft --debug --use-lxd 6 snapcraft --debug --use-lxd $@ 7 7 popd 8 8 -
branches/highdpi/Install/snap/snapcraft.yaml
r405 r465 5 5 description: | 6 6 This is a fork and Lazarus/FPC port of the original C-evo 1.2.0 game. 7 Now it is finally possible to play C-evo natively on Linux. 7 Now it is finally possible to play C-evo natively on Linux. 8 8 * Zoomable map by mouse wheel with three tile sizes 9 9 * Many sample maps included 10 * All available localizations include 10 * Multiple localizations included 11 * Support for user defined key mapping 11 12 * Many other small improvements 12 confinement: strict13 base: core2 013 confinement: devmode 14 base: core22 14 15 grade: stable 15 16 icon: Graphics/c-evo_64x64.png 16 17 license: NLPL 17 18 18 environment: 19 LD_LIBRARY_PATH: $SNAP /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio19 environment: 20 LD_LIBRARY_PATH: $SNAP_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/usr/lib/x86_64-linux-gnu:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio 20 21 PULSE_SERVER: unix:/run/user/1000/pulse/native 21 22 22 23 layout: 23 24 /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox: 24 bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox 25 bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox 25 26 26 27 parts: … … 29 30 source: . 30 31 source-type: local 31 build-packages: 32 - fpc 33 - lazarus 34 - lcl 35 - lcl-utils 36 stage-packages: 32 after: [lazarus] 33 stage-packages: 37 34 - sox 38 35 - libsox-fmt-mp3 … … 72 69 override-build: | 73 70 snapcraftctl build 74 (cd AI/StdAI &&lazbuild --build-mode= ReleaseStdAI.lpi)71 (cd AI/StdAI &&lazbuild --build-mode=Debug StdAI.lpi) 75 72 mv AI/StdAI/libstdai.so AI/StdAI/libstdai-amd64.so 76 lazbuild --build-mode=Release Integrated.lpi 77 ROOT=/root/parts/c-evo/install 78 install -d -m 755 $ROOT/usr/share/c-evo 79 install -s -m 755 c-evo $ROOT/usr/share/c-evo 80 install -m 644 Language.txt $ROOT/usr/share/c-evo 81 install -m 644 Language2.txt $ROOT/usr/share/c-evo 82 install -m 644 Fonts.txt $ROOT/usr/share/c-evo 83 install -d -m 755 $ROOT/usr/share/applications 84 install -m 755 Install/deb/c-evo.desktop $ROOT/usr/share/applications 85 install -d -m 755 $ROOT/usr/share/mime/packages 86 install -m 755 Install/deb/c-evo.xml $ROOT/usr/share/mime/packages 87 install -d -m 755 $ROOT/usr/share/pixmaps 88 install -m 644 Graphics/c-evo_64x64.png $ROOT/usr/share/pixmaps/c-evo.png 89 install -m 644 Graphics/c-evo_64x64.png $ROOT/usr/share/pixmaps/application-cevo.png 90 install -m 644 Graphics/c-evo_64x64.png $ROOT/usr/share/pixmaps/application-cevomap.png 91 install -d -m 755 $ROOT/usr/share/c-evo/AI/StdAI 92 install -m 644 AI/StdAI/libstdai-amd64.so $ROOT/usr/share/c-evo/AI/StdAI 93 install -m 644 AI/StdAI/StdAI.ai.txt $ROOT/usr/share/c-evo/AI/StdAI 94 install -m 644 AI/StdAI/StdAI.png $ROOT/usr/share/c-evo/AI/StdAI 95 cp -r Graphics $ROOT/usr/share/c-evo 96 cp -r Help $ROOT/usr/share/c-evo 97 cp -r Sounds $ROOT/usr/share/c-evo 98 cp -r Tribes $ROOT/usr/share/c-evo 99 cp -r Localization $ROOT/usr/share/c-evo 100 cp -r Maps $ROOT/usr/share/c-evo 101 cp -r Saved $ROOT/usr/share/c-evo 102 cp -r "AI Template" $ROOT/usr/share/c-evo 73 lazbuild --build-mode=Debug Integrated.lpi 74 install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/c-evo 75 install -s -m 755 c-evo $SNAPCRAFT_PART_INSTALL/usr/share/c-evo 76 install -m 644 Language.txt $SNAPCRAFT_PART_INSTALL/usr/share/c-evo 77 install -m 644 Language2.txt $SNAPCRAFT_PART_INSTALL/usr/share/c-evo 78 install -m 644 Fonts.txt $SNAPCRAFT_PART_INSTALL/usr/share/c-evo 79 install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications 80 install -m 755 Install/deb/c-evo.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications 81 install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/mime/packages 82 install -m 644 Install/deb/c-evo.xml $SNAPCRAFT_PART_INSTALL/usr/share/mime/packages 83 install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps 84 install -m 644 Graphics/c-evo_64x64.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/c-evo.png 85 install -m 644 Graphics/c-evo_64x64.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/application-cevo.png 86 install -m 644 Graphics/c-evo_64x64.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/application-cevomap.png 87 install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/c-evo/AI/StdAI 88 install -m 644 AI/StdAI/libstdai-amd64.so $SNAPCRAFT_PART_INSTALL/usr/share/c-evo/AI/StdAI 89 install -m 644 AI/StdAI/StdAI.ai.txt $SNAPCRAFT_PART_INSTALL/usr/share/c-evo/AI/StdAI 90 install -m 644 AI/StdAI/StdAI.png $SNAPCRAFT_PART_INSTALL/usr/share/c-evo/AI/StdAI 91 cp -r Graphics $SNAPCRAFT_PART_INSTALL/usr/share/c-evo 92 cp -r Help $SNAPCRAFT_PART_INSTALL/usr/share/c-evo 93 cp -r Sounds $SNAPCRAFT_PART_INSTALL/usr/share/c-evo 94 cp -r Tribes $SNAPCRAFT_PART_INSTALL/usr/share/c-evo 95 cp -r Localization $SNAPCRAFT_PART_INSTALL/usr/share/c-evo 96 cp -r Maps $SNAPCRAFT_PART_INSTALL/usr/share/c-evo 97 cp -r Saved $SNAPCRAFT_PART_INSTALL/usr/share/c-evo 98 cp -r "AI Template" $SNAPCRAFT_PART_INSTALL/usr/share/c-evo 103 99 stage: 104 100 - etc … … 107 103 - usr/share/applications/c-evo.desktop 108 104 - usr/share/mime/packages/c-evo.xml 109 105 lazarus: 106 plugin: nil 107 source: . 108 source-type: local 109 build-packages: 110 - wget 111 - libgtk2.0-dev 112 override-build: | 113 wget -nc https://downloads.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.2/lazarus-project_2.2.2-0_amd64.deb 114 wget -nc https://downloads.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.2/fpc-laz_3.2.2-210709_amd64.deb 115 wget -nc https://downloads.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.2/fpc-src_3.2.2-210709_amd64.deb 116 apt install ./lazarus-project_2.2.2-0_amd64.deb ./fpc-laz_3.2.2-210709_amd64.deb ./fpc-src_3.2.2-210709_amd64.deb 117 stage: [-*] 118 prime: [-*] 119 110 120 apps: 111 121 c-evo: 112 122 command: usr/share/c-evo/c-evo 113 desktop: usr/share/applications/c-evo.desktop 123 desktop: usr/share/applications/c-evo.desktop 114 124 plugs: 115 125 - home -
branches/highdpi/Integrated.lpi
r405 r465 2 2 <CONFIG> 3 3 <ProjectOptions> 4 <Version Value="1 1"/>4 <Version Value="12"/> 5 5 <PathDelim Value="\"/> 6 6 <General> … … 9 9 <MainUnitHasCreateFormStatements Value="False"/> 10 10 <MainUnitHasTitleStatement Value="False"/> 11 <CompatibilityMode Value="True"/> 11 12 </Flags> 12 13 <SessionStorage Value="InProjectDir"/> 13 <MainUnit Value="0"/>14 14 <Title Value="Integrated"/> 15 15 <UseAppBundle Value="False"/> … … 59 59 <Debugging> 60 60 <GenerateDebugInfo Value="False"/> 61 <DebugInfoType Value="dsDwarf2Set"/> 61 62 </Debugging> 62 63 <LinkSmart Value="True"/> … … 106 107 </Item4> 107 108 </RequiredPackages> 108 <Units Count="4 8">109 <Units Count="47"> 109 110 <Unit0> 110 111 <Filename Value="Integrated.lpr"/> … … 344 345 </Unit40> 345 346 <Unit41> 346 <Filename Value="LocalPlayer\ UKeyBindings.pas"/>347 <Filename Value="LocalPlayer\KeyBindings.pas"/> 347 348 <IsPartOfProject Value="True"/> 348 349 </Unit41> 349 350 <Unit42> 350 <Filename Value=" UMiniMap.pas"/>351 <Filename Value="MiniMap.pas"/> 351 352 <IsPartOfProject Value="True"/> 352 353 </Unit42> 353 354 <Unit43> 354 <Filename Value=" UBrain.pas"/>355 <Filename Value="Brain.pas"/> 355 356 <IsPartOfProject Value="True"/> 356 357 </Unit43> 357 358 <Unit44> 358 <Filename Value="Network\ UNetworkServer.pas"/>359 <Filename Value="Network\NetworkServer.pas"/> 359 360 <IsPartOfProject Value="True"/> 360 361 </Unit44> 361 362 <Unit45> 362 <Filename Value="Network\ UNetworkClient.pas"/>363 <Filename Value="Network\NetworkClient.pas"/> 363 364 <IsPartOfProject Value="True"/> 364 365 </Unit45> 365 366 <Unit46> 366 <Filename Value="Network\ UNetworkCommon.pas"/>367 <Filename Value="Network\NetworkCommon.pas"/> 367 368 <IsPartOfProject Value="True"/> 368 369 </Unit46> 369 <Unit47>370 <Filename Value="ULanguages.pas"/>371 <IsPartOfProject Value="True"/>372 </Unit47>373 370 </Units> 374 371 </ProjectOptions> … … 404 401 <Linking> 405 402 <Debugging> 403 <DebugInfoType Value="dsDwarf2Set"/> 404 <UseHeaptrc Value="True"/> 406 405 <UseExternalDbgSyms Value="True"/> 407 406 </Debugging> -
branches/highdpi/Integrated.lpr
r405 r465 6 6 cthreads, clocale, 7 7 {$ENDIF} 8 UDpiControls,Forms, Interfaces, SysUtils, Protocol, GameServer, Direct, Start, Messg, Inp,8 Forms, Interfaces, SysUtils, Protocol, GameServer, Direct, Start, Messg, Inp, 9 9 Back, Log, LocalPlayer, ClientTools, Tribes, IsoEngine, Term, CityScreen, Nego, 10 NoTerm, ScreenTools, Directories ;10 NoTerm, ScreenTools, Directories, UDpiControls; 11 11 12 12 {$if declared(UseHeapTrace)} … … 26 26 DotNetClient := nil; 27 27 DpiApplication.Initialize; 28 DpiApplication.Title := 'c-evo'; 28 DpiApplication.Title := 'C-evo'; 29 DpiApplication.TaskBarBehavior := tbMultiButton; 29 30 Directories.UnitInit; 30 31 ScreenTools.UnitInit; -
branches/highdpi/Language.txt
r405 r465 140 140 #TITLE_SPYMISSION Covert Operation 141 141 #TITLE_SUICIDE Suicide Mission 142 #TITLE_MESSAGE Message 142 143 #FRMILREP Military Report 143 144 -
branches/highdpi/LocalPlayer/Battle.pas
r361 r465 32 32 uix, ToLoc: Integer; 33 33 Forecast: TBattleForecastEx; 34 IsSuicideQuery: boolean; 35 end; 36 37 var 38 BattleDlg: TBattleDlg; 34 IsSuicideQuery: Boolean; 35 end; 36 39 37 40 38 implementation … … 62 60 TextSize: TSize; 63 61 LabelText: string; 64 FirstStrike: boolean;62 FirstStrike: Boolean; 65 63 begin 66 64 MaxBar := 65; … … 112 110 VLightGradient(ca, xm - 8, ym + 8 + LABaseDamage, LADamage - LABaseDamage, 113 111 FanaticColor); 114 DpiBit Canvas(ca, xm - 12, ym - 12, 24, 24,112 DpiBitBltCanvas(ca, xm - 12, ym - 12, 24, 24, 115 113 HGrSystem.Mask.Canvas, 26, 146, SRCAND); 116 DpiBit Canvas(ca, xm - 12, ym - 12, 24, 24,114 DpiBitBltCanvas(ca, xm - 12, ym - 12, 24, 24, 117 115 HGrSystem.Data.Canvas, 26, 146, SRCPAINT); 118 116 … … 137 135 if Forecast.EndHealthDef <= 0 then 138 136 begin 139 DpiBit Canvas(ca, xm + 9 + LDDamage - 7, ym - 6, 14, 17,137 DpiBitBltCanvas(ca, xm + 9 + LDDamage - 7, ym - 6, 14, 17, 140 138 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 141 DpiBit Canvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17,139 DpiBitBltCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17, 142 140 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 143 DpiBit Canvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17,141 DpiBitBltCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17, 144 142 HGrSystem.Data.Canvas, 51, 153, SRCPAINT); 145 143 end; … … 149 147 begin 150 148 if Forecast.EndHealthDef > 0 then 151 RisedTextOut(ca, xm + 10, ym - (TextSize.cy + 1) div 2, LabelText) 149 RisedTextOut(ca, xm + 10, ym - (TextSize.cy + 1) div 2, LabelText); 152 150 end 153 151 else … … 157 155 if Forecast.EndHealthAtt <= 0 then 158 156 begin 159 DpiBit Canvas(ca, xm - 6, ym + 9 + LADamage - 7, 14, 17,157 DpiBitBltCanvas(ca, xm - 6, ym + 9 + LADamage - 7, 14, 17, 160 158 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 161 DpiBit Canvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17,159 DpiBitBltCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17, 162 160 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 163 DpiBit Canvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17,161 DpiBitBltCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17, 164 162 HGrSystem.Data.Canvas, 51, 153, SRCPAINT); 165 163 end; … … 171 169 if Forecast.EndHealthAtt > 0 then 172 170 RisedTextOut(ca, xm - (TextSize.cx + 1) div 2, ym + 8 + LAAvoidedDamage, 173 LabelText) 171 LabelText); 174 172 end 175 173 else … … 178 176 179 177 IsoMap.SetOutput(Buffer); 180 DpiBit Canvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm + 8 + 4,178 DpiBitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm + 8 + 4, 181 179 ym - 8 - 12 - 48); 182 180 { if TerrType<fForest then … … 190 188 end; } 191 189 IsoMap.PaintUnit(1, 0, UnitInfo, 0); 192 DpiBit Canvas(ca, xm + 8 + 4, ym - 8 - 12 - 48, 66, 48, Buffer.Canvas,190 DpiBitBltCanvas(ca, xm + 8 + 4, ym - 8 - 12 - 48, 66, 48, Buffer.Canvas, 193 191 0, 0); 194 192 195 DpiBit Canvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm - 8 - 4 - 66,193 DpiBitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm - 8 - 4 - 66, 196 194 ym + 8 + 12); 197 MakeUnitInfo( me, MyUn[uix], UnitInfo);195 MakeUnitInfo(Me, MyUn[uix], UnitInfo); 198 196 UnitInfo.Flags := UnitInfo.Flags and not unFortified; 199 197 IsoMap.PaintUnit(1, 0, UnitInfo, 0); 200 DpiBit Canvas(ca, xm - 8 - 4 - 66, ym + 8 + 12, 66, 48, Buffer.Canvas, 0, 0);201 end; { PaintBattleOutcome }198 DpiBitBltCanvas(ca, xm - 8 - 4 - 66, ym + 8 + 12, 66, 48, Buffer.Canvas, 0, 0); 199 end; 202 200 203 201 procedure TBattleDlg.FormCreate(Sender: TObject); … … 215 213 ClientWidth := 300; 216 214 ClientHeight := 288; 217 OKBtn.Visible := true;218 CancelBtn.Visible := true;215 OKBtn.Visible := True; 216 CancelBtn.Visible := True; 219 217 Left := (DpiScreen.Width - ClientWidth) div 2; // center on screen 220 218 Top := (DpiScreen.Height - ClientHeight) div 2; … … 224 222 ClientWidth := 178; 225 223 ClientHeight := 178; 226 OKBtn.Visible := false;227 CancelBtn.Visible := false;224 OKBtn.Visible := False; 225 CancelBtn.Visible := False; 228 226 end; 229 227 end; … … 231 229 procedure TBattleDlg.FormPaint(Sender: TObject); 232 230 var 233 ym, cix, p: Integer;234 s, s1: string;231 ym, cix, P: Integer; 232 S, s1: string; 235 233 begin 236 234 with Canvas do … … 240 238 Brush.Style := bsClear; 241 239 PaintBackground(self, 3 + Border, 3 + Border, 242 ClientWidth - (6 + 2 * Border), ClientHeight - (6 + 2 * Border)) 240 ClientWidth - (6 + 2 * Border), ClientHeight - (6 + 2 * Border)); 243 241 end; 244 242 Frame(Canvas, Border + 1, Border + 1, ClientWidth - (2 + Border), … … 252 250 begin 253 251 Canvas.Font.Assign(UniFont[ftCaption]); 254 s:= Phrases.Lookup('TITLE_SUICIDE');255 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, s)) div 2,256 7 + Border, s);252 S := Phrases.Lookup('TITLE_SUICIDE'); 253 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, S)) div 2, 254 7 + Border, S); 257 255 Canvas.Font.Assign(UniFont[ftNormal]); 258 s:= Phrases.Lookup('SUICIDE');259 p := pos('\', s);260 if p= 0 then261 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, s))262 div 2, 205, s)256 S := Phrases.Lookup('SUICIDE'); 257 P := Pos('\', S); 258 if P = 0 then 259 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, S)) 260 div 2, 205, S) 263 261 else 264 262 begin 265 s1 := copy(s, 1, p- 1);263 s1 := Copy(S, 1, P - 1); 266 264 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, s1)) div 2, 267 265 205 - MessageLineSpacing div 2, s1); 268 s1 := copy(s, p+ 1, 255);266 s1 := Copy(S, P + 1, 255); 269 267 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, s1)) div 2, 270 268 205 + (MessageLineSpacing - MessageLineSpacing div 2), s1); 271 269 end; 272 ym := 110 270 ym := 110; 273 271 end 274 272 else … … 297 295 begin 298 296 if not IsSuicideQuery then 299 Close 297 Close; 300 298 end; 301 299 … … 309 307 if Key <> VK_ESCAPE then 310 308 MainScreen.FormKeyDown(Sender, Key, Shift); 311 end 309 end; 312 310 end; 313 311 -
branches/highdpi/LocalPlayer/CityScreen.pas
r405 r465 5 5 6 6 uses 7 UDpiControls, {$IFDEF LINUX}LMessages,{$ENDIF}8 Protocol, ClientTools, Term, ScreenTools, IsoEngine, BaseWin,9 LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,10 Button A, ButtonC, Area, GraphType, UTexture;7 UDpiControls, {$IFDEF UNIX}LMessages,{$ENDIF} 8 Protocol, ClientTools, ScreenTools, IsoEngine, BaseWin, LCLIntf, LCLType, 9 Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, ButtonA, 10 ButtonC, Area, GraphType, Texture; 11 11 12 12 const … … 39 39 procedure FormDestroy(Sender: TObject); 40 40 procedure FormMouseDown(Sender: TObject; Button: TMouseButton; 41 Shift: TShiftState; x, y: integer);41 Shift: TShiftState; X, Y: Integer); 42 42 procedure BuyClick(Sender: TObject); 43 43 procedure CloseBtnClick(Sender: TObject); … … 49 49 procedure PrevCityBtnClick(Sender: TObject); 50 50 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 51 // procedure AdviceBtnClick(Sender: TObject);52 51 procedure PageUpBtnClick(Sender: TObject); 53 52 procedure PageDownBtnClick(Sender: TObject); 54 53 private 55 c: TCity;54 C: TCity; 56 55 Report: TCityReportNew; 57 56 cOwner: Integer; … … 70 69 Optimize_cixTileChange: Integer; 71 70 Optimize_TilesBeforeChange: Integer; 72 Happened: cardinal;73 imix: array [0 .. 15] of integer;71 Happened: Cardinal; 72 imix: array [0 .. 15] of Integer; 74 73 CityAreaInfo: TCityAreaInfo; 75 74 AreaMap: TIsoMap; … … 89 88 procedure InitZoomCityMap; 90 89 procedure ChooseProject; 91 procedure ChangeCity( d: integer);92 procedure ChangeResourceWeights(iResourceWeights: integer);90 procedure ChangeCity(D: Integer); 91 procedure ChangeResourceWeights(iResourceWeights: Integer); 93 92 procedure OnPlaySound(var Msg: TMessage); message WM_PLAYSOUND; 94 93 public 95 RestoreUnFocus: integer;94 RestoreUnFocus: Integer; 96 95 CloseAction: TCityCloseAction; 97 96 procedure OffscreenPaint; override; 98 procedure ShowNewContent(NewMode , Loc: integer; ShowEvent: cardinal);97 procedure ShowNewContent(NewMode: TWindowMode; Loc: Integer; ShowEvent: Cardinal); 99 98 procedure Reset; 100 99 procedure CheckAge; 101 100 end; 102 101 103 var104 CityDlg: TCityDlg;105 106 102 107 103 implementation 108 104 109 105 uses 110 Select, Messg, MessgEx, Help, Tribes, Directories, Math, Sound ;106 Select, Messg, MessgEx, Help, Tribes, Directories, Math, Sound, Term; 111 107 112 108 {$R *.lfm} … … 148 144 wZoomEnvironment = 68; 149 145 150 ImpPosition: array [28 .. nImp - 1] of integer = (-1, // imTrGoods 146 ImpPosition: array [28 .. nImp - 1] of Integer = ( 147 -1, // imTrGoods 151 148 21, // imBarracks 152 149 6, // imGranary … … 192 189 193 190 var 194 ImpSorted: array [0 .. nImp - 1] of integer;191 ImpSorted: array [0 .. nImp - 1] of Integer; 195 192 196 193 procedure TCityDlg.FormCreate(Sender: TObject); … … 201 198 NoMap := TIsoMap.Create; 202 199 AreaMap := TIsoMap.Create; 203 AreaMap.SetOutput( offscreen);200 AreaMap.SetOutput(Offscreen); 204 201 AreaMap.SetPaintBounds(xmArea - 192, ymArea - 96 - 32, xmArea + 192, 205 202 ymArea + 96); 206 SmallMapMode := smImprovements; 207 ZoomArea := 1; 208 ProdHint := false; 203 Reset; 204 ProdHint := False; 209 205 RestoreUnFocus := -1; 210 206 OpenSoundEvent := -1; … … 279 275 280 276 UnshareBitmap(Back); 281 DpiBit Canvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight,277 DpiBitBltCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight, 282 278 MainTexture.Image.Canvas, 0, 0); 283 279 ImageOp_B(Back, Template, 0, 0, 0, 0, ClientWidth, ClientHeight); … … 292 288 procedure TCityDlg.InitSmallCityMap; 293 289 var 294 i, iix, cli1, Color0, Color1, Color2: integer;290 I, iix, cli1, Color0, Color1, Color2: Integer; 295 291 begin 296 292 if cix >= 0 then 297 c:= MyCity[cix];293 C := MyCity[cix]; 298 294 case MyMap[cLoc] and fTerrain of 299 295 fPrairie: cli1 := cliPrairie; … … 307 303 Color2 := Colors.Canvas.Pixels[clkAge0 + Age, cliHouse]; 308 304 SmallCityMap.Canvas.FillRect(0, 0, SmallCityMap.Width, SmallCityMap.Height); 309 DpiBit Canvas(SmallCityMap.Canvas, 0, 0, 83, hSmallMap,305 DpiBitBltCanvas(SmallCityMap.Canvas, 0, 0, 83, hSmallMap, 310 306 SmallCityMapTemplate.Canvas, 83 * SizeClass, 0); 311 307 if IsPort then 312 308 begin 313 DpiBit Canvas(SmallCityMap.Canvas, 83, 0, 15, hSmallMap,309 DpiBitBltCanvas(SmallCityMap.Canvas, 83, 0, 15, hSmallMap, 314 310 SmallCityMapTemplate.Canvas, 332 + 15, 0); 315 311 ImageOp_CCC(SmallCityMap, 0, 0, 83, hSmallMap, Color0, Color1, Color2); … … 319 315 else 320 316 begin 321 DpiBit Canvas(SmallCityMap.Canvas, 83, 0, 15, hSmallMap,317 DpiBitBltCanvas(SmallCityMap.Canvas, 83, 0, 15, hSmallMap, 322 318 SmallCityMapTemplate.Canvas, 332, 0); 323 319 ImageOp_CCC(SmallCityMap, 0, 0, wSmallMap, hSmallMap, Color0, … … 328 324 begin 329 325 Brush.Color := ScreenTools.Colors.Canvas.Pixels[clkAge0 + Age, cliImp]; 330 for i:= 0 to 29 do326 for I := 0 to 29 do 331 327 begin 332 328 for iix := nWonder to nImp - 1 do 333 if (ImpPosition[iix] = i) and (c.Built[iix] > 0) then329 if (ImpPosition[iix] = I) and (C.Built[iix] > 0) then 334 330 begin 335 FillRect(Rect(5 + 16 * ( i mod 3) + 48 * (idiv 18),336 3 + 12 * ( i mod 18 div 3), 13 + 16 * (i mod 3) + 48 * (idiv 18),337 11 + 12 * ( imod 18 div 3)));338 break;331 FillRect(Rect(5 + 16 * (I mod 3) + 48 * (I div 18), 332 3 + 12 * (I mod 18 div 3), 13 + 16 * (I mod 3) + 48 * (I div 18), 333 11 + 12 * (I mod 18 div 3))); 334 Break; 339 335 end; 340 336 end; 341 i:= 30;337 I := 30; 342 338 for iix := 0 to nImp do 343 if ( c.Built[iix] > 0) and ((iix < nWonder) or (ImpPosition[iix] < 0)) then339 if (C.Built[iix] > 0) and ((iix < nWonder) or (ImpPosition[iix] < 0)) then 344 340 begin 345 FillRect(Rect(5 + 16 * ( i mod 3) + 48 * (idiv 18),346 3 + 12 * ( i mod 18 div 3), 13 + 16 * (i mod 3) + 48 * (idiv 18),347 11 + 12 * ( imod 18 div 3)));348 inc(i);349 if i= 36 then350 break; // area is full341 FillRect(Rect(5 + 16 * (I mod 3) + 48 * (I div 18), 342 3 + 12 * (I mod 18 div 3), 13 + 16 * (I mod 3) + 48 * (I div 18), 343 11 + 12 * (I mod 18 div 3))); 344 Inc(I); 345 if I = 36 then 346 Break; // area is full 351 347 end; 352 if c.Project and cpImp <> 0 then353 begin 354 iix := c.Project and cpIndex;348 if C.Project and cpImp <> 0 then 349 begin 350 iix := C.Project and cpIndex; 355 351 if iix <> imTrGoods then 356 352 begin 357 353 if (iix >= nWonder) and (ImpPosition[iix] >= 0) then 358 i:= ImpPosition[iix];359 if i< 36 then354 I := ImpPosition[iix]; 355 if I < 36 then 360 356 begin 361 brush.Color := ScreenTools.Colors.Canvas.Pixels[clkAge0 + Age, cliImpProject];362 FillRect(Rect(5 + 16 * ( i mod 3) + 48 * (idiv 18),363 3 + 12 * ( i mod 18 div 3), 13 + 16 * (i mod 3) + 48 * (idiv 18),364 11 + 12 * ( imod 18 div 3)));357 Brush.Color := ScreenTools.Colors.Canvas.Pixels[clkAge0 + Age, cliImpProject]; 358 FillRect(Rect(5 + 16 * (I mod 3) + 48 * (I div 18), 359 3 + 12 * (I mod 18 div 3), 13 + 16 * (I mod 3) + 48 * (I div 18), 360 11 + 12 * (I mod 18 div 3))); 365 361 end; 366 362 end; 367 363 end; 368 brush.style := bsClear;364 Brush.style := bsClear; 369 365 end; 370 366 end; … … 373 369 begin 374 370 UnshareBitmap(ZoomCityMap); 375 DpiBit Canvas(ZoomCityMap.Canvas, 0, 0, wZoomMap, hZoomMap,371 DpiBitBltCanvas(ZoomCityMap.Canvas, 0, 0, wZoomMap, hZoomMap, 376 372 Back.Canvas, xZoomMap, yZoomMap); 377 373 if SmallMapMode = smImprovements then begin … … 383 379 112 * (ZoomArea - 3), wZoomMap - wZoomEnvironment, hZoomMap); 384 380 ImageOp_B(ZoomCityMap, CityMapTemplate, wZoomMap - wZoomEnvironment, 0, 385 1504 + wZoomEnvironment * byte(IsPort), 112 * (ZoomArea - 3),381 1504 + wZoomEnvironment * Byte(IsPort), 112 * (ZoomArea - 3), 386 382 wZoomEnvironment, hZoomMap); 387 383 end; … … 391 387 procedure TCityDlg.OffscreenPaint; 392 388 393 procedure FillBar( x, y, pos, Growth, max, Kind: integer;394 IndicateComplete: boolean);389 procedure FillBar(X, Y, Pos, Growth, Max, Kind: Integer; 390 IndicateComplete: Boolean); 395 391 begin 396 392 BarTex.Assign(MainTexture); … … 399 395 BarTex.ColorBevelShade := BarTex.ColorBevelLight; 400 396 end; 401 PaintRelativeProgressBar( offscreen.Canvas, Kind, x - 3, y, wBar - 4, pos,402 Growth, max, IndicateComplete, BarTex);403 end; 404 405 procedure PaintResources( x, y, Loc: integer; Add4Happy: boolean);397 PaintRelativeProgressBar(Offscreen.Canvas, Kind, X - 3, Y, wBar - 4, Pos, 398 Growth, Max, IndicateComplete, BarTex); 399 end; 400 401 procedure PaintResources(X, Y, Loc: Integer; Add4Happy: Boolean); 406 402 var 407 d, i, Total, xGr, yGr: integer;403 D, I, Total, xGr, yGr: Integer; 408 404 TileInfo: TTileInfo; 409 rare: boolean;405 rare: Boolean; 410 406 begin 411 407 with AreaMap do begin 412 if Server(sGetCityTileInfo, me, Loc, TileInfo) <> eOk then413 begin 414 assert(cix < 0);415 exit408 if Server(sGetCityTileInfo, Me, Loc, TileInfo) <> eOk then 409 begin 410 Assert(cix < 0); 411 Exit 416 412 end; 417 413 Total := TileInfo.Food + TileInfo.Prod + TileInfo.Trade; 418 414 rare := MyMap[Loc] and $06000000 > 0; 419 415 if rare then 420 inc(Total);416 Inc(Total); 421 417 if Add4Happy then 422 inc(Total, 4);418 Inc(Total, 4); 423 419 if Total > 1 then 424 d:= (xxt - 11) div (Total - 1);425 if d< 1 then426 d:= 1;427 if d> 4 then428 d:= 4;429 for i:= 0 to Total - 1 do420 D := (xxt - 11) div (Total - 1); 421 if D < 1 then 422 D := 1; 423 if D > 4 then 424 D := 4; 425 for I := 0 to Total - 1 do 430 426 begin 431 427 yGr := 115; 432 if Add4Happy and ( i>= Total - 4) then428 if Add4Happy and (I >= Total - 4) then 433 429 begin 434 430 xGr := 132; 435 431 yGr := 126 436 432 end 437 else if rare and ( i= Total - 1) then433 else if rare and (I = Total - 1) then 438 434 xGr := 66 + 110 439 else if i>= TileInfo.Food + TileInfo.Prod then435 else if I >= TileInfo.Food + TileInfo.Prod then 440 436 xGr := 66 + 44 441 else if i>= TileInfo.Prod then437 else if I >= TileInfo.Prod then 442 438 xGr := 66 443 439 else 444 440 xGr := 66 + 22; 445 Sprite( offscreen, HGrSystem, x + xxt - 5 + d * (2 * i+ 1 - Total),446 y+ yyt - 5, 10, 10, xGr, yGr);441 Sprite(Offscreen, HGrSystem, X + xxt - 5 + D * (2 * I + 1 - Total), 442 Y + yyt - 5, 10, 10, xGr, yGr); 447 443 end; 448 444 end; 449 445 end; 450 446 var 451 line, MessageCount: integer;452 453 procedure CheckMessage(Flag: integer);447 Line, MessageCount: Integer; 448 449 procedure CheckMessage(Flag: Integer); 454 450 var 455 i, test: integer;456 s: string;451 I, Test: Integer; 452 S: string; 457 453 begin 458 454 if Happened and Flag <> 0 then 459 455 begin 460 i:= 0;461 test := 1;462 while test < Flag do456 I := 0; 457 Test := 1; 458 while Test < Flag do 463 459 begin 464 inc(i);465 inc(test, test)460 Inc(I); 461 Inc(Test, Test); 466 462 end; 467 463 468 464 if AllowChange and (Sounds <> nil) and (OpenSoundEvent = -1) then 469 465 begin 470 s := CityEventSoundItem[i];471 if s<> '' then472 s := Sounds.Lookup(s);473 if (Flag = chProduction) or ( s <> '') and (s[1] <> '*') and (s[1] <> '[')466 S := CityEventSoundItem[I]; 467 if S <> '' then 468 S := Sounds.Lookup(S); 469 if (Flag = chProduction) or (S <> '') and (S[1] <> '*') and (S[1] <> '[') 474 470 then 475 OpenSoundEvent := i471 OpenSoundEvent := I; 476 472 end; 477 473 478 s := CityEventName(i);474 S := CityEventName(I); 479 475 { if Flag=chNoGrowthWarning then 480 if c.Built[imAqueduct]=0 then481 s:=Format(s,[Phrases.Lookup('IMPROVEMENTS',imAqueduct)])482 else s:=Format(s,[Phrases.Lookup('IMPROVEMENTS',imSewer)]); }483 RisedTextOut( offscreen.Canvas, xmOpt + 40, ymOpt - 1 - 8 * MessageCount +484 16 * line, s);485 inc(line)476 if C.Built[imAqueduct]=0 then 477 S:=Format(S,[Phrases.Lookup('IMPROVEMENTS',imAqueduct)]) 478 else S:=Format(S,[Phrases.Lookup('IMPROVEMENTS',imSewer)]); } 479 RisedTextOut(Offscreen.Canvas, xmOpt + 40, ymOpt - 1 - 8 * MessageCount + 480 16 * Line, S); 481 Inc(Line); 486 482 end; 487 483 end; 488 484 489 485 var 490 x, y, xGr, i, j, iix, d, dx, dy, PrCost, Cnt, Loc1, FreeSupp, Paintiix,491 HappyGain, OptiType, rx, ry, TrueFood, TrueProd, TruePoll: integer;492 av: integer;493 PrName, s: string;486 X, Y, xGr, I, J, iix, D, dx, dy, PrCost, Cnt, Loc1, FreeSupp, Paintiix, 487 HappyGain, OptiType, rx, ry, TrueFood, TrueProd, TruePoll: Integer; 488 av: Integer; 489 PrName, S: string; 494 490 UnitInfo: TUnitInfo; 495 491 UnitReport: TUnitReport; 496 IsCityAlive, CanGrow: boolean;492 IsCityAlive, CanGrow: Boolean; 497 493 begin 498 494 inherited; 499 495 if cix >= 0 then 500 c:= MyCity[cix];496 C := MyCity[cix]; 501 497 Report.HypoTiles := -1; 502 498 Report.HypoTaxRate := -1; 503 499 Report.HypoLuxuryRate := -1; 504 500 if cix >= 0 then 505 Server(sGetCityReportNew, me, cix, Report) // own city501 Server(sGetCityReportNew, Me, cix, Report) // own city 506 502 else 507 Server(sGetEnemyCityReportNew, me, cLoc, Report); // enemy city508 TrueFood := c.Food;509 TrueProd := c.Prod;510 TruePoll := c.Pollution;511 if supervising or (cix < 0) then503 Server(sGetEnemyCityReportNew, Me, cLoc, Report); // enemy city 504 TrueFood := C.Food; 505 TrueProd := C.Prod; 506 TruePoll := C.Pollution; 507 if Supervising or (cix < 0) then 512 508 begin // normalize city from after-turn state 513 dec(TrueFood, Report.FoodSurplus);509 Dec(TrueFood, Report.FoodSurplus); 514 510 if TrueFood < 0 then 515 511 TrueFood := 0; // shouldn't happen 516 dec(TrueProd, Report.Production);512 Dec(TrueProd, Report.Production); 517 513 if TrueProd < 0 then 518 514 TrueProd := 0; // shouldn't happen 519 dec(TruePoll, Report.AddPollution);515 Dec(TruePoll, Report.AddPollution); 520 516 if TruePoll < 0 then 521 517 TruePoll := 0; // shouldn't happen 522 518 end; 523 IsCityAlive := (cGov <> gAnarchy) and ( c.Flags and chCaptured = 0);519 IsCityAlive := (cGov <> gAnarchy) and (C.Flags and chCaptured = 0); 524 520 if not IsCityAlive then 525 Report.Working := c.Size;521 Report.Working := C.Size; 526 522 527 523 RedTex.Assign(MainTexture); … … 531 527 RedTex.ColorTextShade := $0000FF; 532 528 533 DpiBit Canvas(offscreen.Canvas, 0, 0, 640, 480, Back.Canvas, 0, 0);529 DpiBitBltCanvas(Offscreen.Canvas, 0, 0, 640, 480, Back.Canvas, 0, 0); 534 530 535 531 Offscreen.Canvas.Font.Assign(UniFont[ftCaption]); 536 RisedTextOut( offscreen.Canvas, 42, 7, Caption);537 with offscreen.Canvas do532 RisedTextOut(Offscreen.Canvas, 42, 7, Caption); 533 with Offscreen.Canvas do 538 534 begin // city size 539 brush.Color := $000000;535 Brush.Color := $000000; 540 536 FillRect(Rect(8 + 1, 7 + 1, 36 + 1, 32 + 1)); 541 brush.Color := $FFFFFF;537 Brush.Color := $FFFFFF; 542 538 FillRect(Rect(8, 7, 36, 32)); 543 brush.style := bsClear;539 Brush.style := bsClear; 544 540 Font.Color := $000000; 545 s := inttostr(c.Size);546 TextOut(8 + 14 - textwidth(s) div 2, 7, s);541 S := IntToStr(C.Size); 542 TextOut(8 + 14 - TextWidth(S) div 2, 7, S); 547 543 end; 548 544 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); … … 552 548 MakeRed(Offscreen, 18, 280, 298, 40); 553 549 if cGov = gAnarchy then 554 s:= Phrases.Lookup('GOVERNMENT', gAnarchy)550 S := Phrases.Lookup('GOVERNMENT', gAnarchy) 555 551 else { if c.Flags and chCaptured<>0 then } 556 s:= Phrases.Lookup('CITYEVENTS', 14);557 RisedTextOut( offscreen.Canvas, 167 - BiColorTextWidth(offscreen.Canvas, s)558 div 2, ymOpt - 9, s);552 S := Phrases.Lookup('CITYEVENTS', 14); 553 RisedTextOut(Offscreen.Canvas, 167 - BiColorTextWidth(Offscreen.Canvas, S) 554 div 2, ymOpt - 9, S); 559 555 end 560 556 else if AllowChange then 561 557 begin 562 OptiType := c.Status shr 4 and $0F;563 Sprite( offscreen, HGrSystem2, xmOpt - 32, ymOpt - 32, 64, 64,558 OptiType := C.Status shr 4 and $0F; 559 Sprite(Offscreen, HGrSystem2, xmOpt - 32, ymOpt - 32, 64, 64, 564 560 1 + OptiType mod 3 * 64, 217 + OptiType div 3 * 64); 565 561 566 562 { display messages now } 567 563 MessageCount := 0; 568 for i:= 0 to 31 do569 if Happened and ($FFFFFFFF - chCaptured) and (1 shl i) <> 0 then570 inc(MessageCount);564 for I := 0 to 31 do 565 if Happened and ($FFFFFFFF - chCaptured) and (1 shl I) <> 0 then 566 Inc(MessageCount); 571 567 if MessageCount > 3 then 572 568 MessageCount := 3; 573 569 if MessageCount > 0 then 574 570 begin 575 MakeBlue( offscreen, 74, 280, 242, 40);576 line := 0;577 for i:= 0 to nCityEventPriority - 1 do578 if line < MessageCount then579 CheckMessage(CityEventPriority[ i]);571 MakeBlue(Offscreen, 74, 280, 242, 40); 572 Line := 0; 573 for I := 0 to nCityEventPriority - 1 do 574 if Line < MessageCount then 575 CheckMessage(CityEventPriority[I]); 580 576 end 581 577 else 582 578 begin 583 s:= Phrases.Lookup('CITYMANAGETYPE', OptiType);584 j := pos('\', s);585 if j= 0 then586 LoweredTextout( offscreen.Canvas, -1, MainTexture, xmOpt + 40,587 ymOpt - 9, s)579 S := Phrases.Lookup('CITYMANAGETYPE', OptiType); 580 J := Pos('\', S); 581 if J = 0 then 582 LoweredTextout(Offscreen.Canvas, -1, MainTexture, xmOpt + 40, 583 ymOpt - 9, S) 588 584 else 589 585 begin 590 LoweredTextout( offscreen.Canvas, -1, MainTexture, xmOpt + 40,591 ymOpt - 17, copy(s, 1, j- 1));592 LoweredTextout( offscreen.Canvas, -1, MainTexture, xmOpt + 40, ymOpt - 1,593 copy(s, j+ 1, 255));586 LoweredTextout(Offscreen.Canvas, -1, MainTexture, xmOpt + 40, 587 ymOpt - 17, Copy(S, 1, J - 1)); 588 LoweredTextout(Offscreen.Canvas, -1, MainTexture, xmOpt + 40, ymOpt - 1, 589 Copy(S, J + 1, 255)); 594 590 end; 595 591 end; … … 601 597 AreaMap.Paint(xmArea - xxt * 2 * rx, ymArea - yyt * 2 * ry - 3 * yyt, 602 598 dLoc(cLoc, -2 * rx + 1, -2 * ry - 1), 4 * rx - 1, 4 * ry + 1, cLoc, cOwner, 603 false, AllowChange and IsCityAlive and604 ( c.Status and csResourceWeightsMask = 0));605 DpiBit Canvas(offscreen.Canvas, xmArea + 102, 42, 90, 33, Back.Canvas,599 False, AllowChange and IsCityAlive and 600 (C.Status and csResourceWeightsMask = 0)); 601 DpiBitBltCanvas(Offscreen.Canvas, xmArea + 102, 42, 90, 33, Back.Canvas, 606 602 xmArea + 102, 42); 607 603 … … 615 611 ((Loc1 < 0) or (Loc1 >= G.lx * G.ly) or (MyMap[Loc1] and fCity = 0)) 616 612 then 617 Sprite( offscreen, HGrTerrain, xmArea - xxt + xxt * dx,613 Sprite(Offscreen, HGrTerrain, xmArea - xxt + xxt * dx, 618 614 ymArea - yyt + yyt * dy, xxt * 2, yyt * 2, 1 + 5 * (xxt * 2 + 1), 619 615 1 + yyt + 15 * (yyt * 3 + 1)); 620 if (1 shl ((dy + 3) shl 2 + (dx + 3) shr 1) and c.Tiles <> 0) then616 if (1 shl ((dy + 3) shl 2 + (dx + 3) shr 1) and C.Tiles <> 0) then 621 617 PaintResources(xmArea - xxt + xxt * dx, ymArea - yyt + yyt * dy, 622 618 Loc1, (dx = 0) and (dy = 0)); … … 625 621 626 622 if Report.Working > 1 then 627 d:= (xService - (xmArea - 192) - 8 - 32) div (Report.Working - 1);628 if d> 28 then629 d:= 28;630 for i:= Report.Working - 1 downto 0 do623 D := (xService - (xmArea - 192) - 8 - 32) div (Report.Working - 1); 624 if D > 28 then 625 D := 28; 626 for I := Report.Working - 1 downto 0 do 631 627 begin 632 628 if IsCityAlive then … … 634 630 else 635 631 xGr := 141; 636 DpiBit Canvas(offscreen.Canvas, xmArea - 192 + 5 + i * d, ymArea - 96 - 29,632 DpiBitBltCanvas(Offscreen.Canvas, xmArea - 192 + 5 + I * D, ymArea - 96 - 29, 637 633 27, 30, HGrSystem.Mask.Canvas, xGr, 171, SRCAND); { shadow } 638 Sprite( offscreen, HGrSystem, xmArea - 192 + 4 + i * d, ymArea - 96 - 30, 27,634 Sprite(Offscreen, HGrSystem, xmArea - 192 + 4 + I * D, ymArea - 96 - 30, 27, 639 635 30, xGr, 171); 640 636 end; 641 if c.Size - Report.Working > 1 then642 d := (xmArea + 192 - xService - 32) div (c.Size - Report.Working - 1);643 if d> 28 then644 d:= 28;645 for i := 0 to c.Size - Report.Working - 1 do637 if C.Size - Report.Working > 1 then 638 D := (xmArea + 192 - xService - 32) div (C.Size - Report.Working - 1); 639 if D > 28 then 640 D := 28; 641 for I := 0 to C.Size - Report.Working - 1 do 646 642 begin 647 643 xGr := 1 + 112; 648 DpiBit Canvas(offscreen.Canvas, xmArea + 192 - 27 + 1 - i * d, 29 + 1, 27,644 DpiBitBltCanvas(Offscreen.Canvas, xmArea + 192 - 27 + 1 - I * D, 29 + 1, 27, 649 645 30, HGrSystem.Mask.Canvas, xGr, 171, SRCAND); { shadow } 650 Sprite( offscreen, HGrSystem, xmArea + 192 - 27 - i * d, 29, 27, 30,646 Sprite(Offscreen, HGrSystem, xmArea + 192 - 27 - I * D, 29, 27, 30, 651 647 xGr, 171); 652 Sprite( offscreen, HGrSystem, xmArea + 192 - 27 + 4 - i * d, 29 + 32, 10,648 Sprite(Offscreen, HGrSystem, xmArea + 192 - 27 + 4 - I * D, 29 + 32, 10, 653 649 10, 121, 126); 654 Sprite( offscreen, HGrSystem, xmArea + 192 - 27 + 13 - i * d, 29 + 32, 10,650 Sprite(Offscreen, HGrSystem, xmArea + 192 - 27 + 13 - I * D, 29 + 32, 10, 655 651 10, 121, 126); 656 652 // Sprite(offscreen,HGrSystem,xmArea+192-31+18-i*d,ymArea-96-80+32,10,10,88,115); 657 653 end; 658 654 659 if c.Project and cpImp = 0 then660 PrName := Tribe[cOwner].ModelName[ c.Project and cpIndex]655 if C.Project and cpImp = 0 then 656 PrName := Tribe[cOwner].ModelName[C.Project and cpIndex] 661 657 else 662 PrName := Phrases.Lookup('IMPROVEMENTS', c.Project and cpIndex);658 PrName := Phrases.Lookup('IMPROVEMENTS', C.Project and cpIndex); 663 659 PrCost := Report.ProjectCost; 664 660 … … 667 663 begin 668 664 if cGov = gFundamentalism then 669 CountBar( offscreen, xHapp, yHapp + dyBar, wBar, 17,665 CountBar(Offscreen, xHapp, yHapp + dyBar, wBar, 17, 670 666 Phrases.Lookup('FAITH'), Report.CollectedControl, MainTexture) 671 667 else 672 668 begin 673 CountBar( offscreen, xHapp, yHapp + dyBar, wBar, 17,669 CountBar(Offscreen, xHapp, yHapp + dyBar, wBar, 17, 674 670 Phrases.Lookup('HAPPINESS'), Report.Morale, MainTexture); 675 CountBar( offscreen, xHapp, yHapp + 2 * dyBar, wBar, 16,671 CountBar(Offscreen, xHapp, yHapp + 2 * dyBar, wBar, 16, 676 672 Phrases.Lookup('CONTROL'), Report.CollectedControl, MainTexture); 677 673 end; 678 CountBar( offscreen, xHapp, yHapp, wBar, 8, Phrases.Lookup('LUX'),674 CountBar(Offscreen, xHapp, yHapp, wBar, 8, Phrases.Lookup('LUX'), 679 675 Report.Luxury, MainTexture); 680 CountBar( offscreen, xHapp + dxBar, yHapp, wBar, 19,676 CountBar(Offscreen, xHapp + dxBar, yHapp, wBar, 19, 681 677 Phrases.Lookup('UNREST'), 2 * Report.Deployed, MainTexture); 682 CountBar( offscreen, xHapp + dxBar, yHapp + dyBar, wBar, 17,683 Phrases.Lookup('HAPPINESSDEMAND'), c.Size, MainTexture);678 CountBar(Offscreen, xHapp + dxBar, yHapp + dyBar, wBar, 17, 679 Phrases.Lookup('HAPPINESSDEMAND'), C.Size, MainTexture); 684 680 if Report.HappinessBalance >= 0 then 685 CountBar( offscreen, xHapp + dxBar, yHapp + 2 * dyBar, wBar, 17,681 CountBar(Offscreen, xHapp + dxBar, yHapp + 2 * dyBar, wBar, 17, 686 682 Phrases.Lookup('HAPPINESSPLUS'), Report.HappinessBalance, MainTexture) 687 683 else 688 684 begin 689 685 MakeRed(Offscreen, xHapp + dxBar - 6, yHapp + 2 * dyBar, wBar + 10, 38); 690 CountBar( offscreen, xHapp + dxBar, yHapp + 2 * dyBar, wBar, 18,686 CountBar(Offscreen, xHapp + dxBar, yHapp + 2 * dyBar, wBar, 18, 691 687 Phrases.Lookup('LACK'), -Report.HappinessBalance, RedTex); 692 688 end; … … 696 692 if IsCityAlive then 697 693 begin 698 CountBar( offscreen, xFood, yFood + dyBar div 2, wBar, 0,694 CountBar(Offscreen, xFood, yFood + dyBar div 2, wBar, 0, 699 695 Phrases.Lookup('FOOD'), Report.CollectedFood, MainTexture); 700 CountBar( offscreen, xFood + dxBar, yFood + dyBar, wBar, 0,701 Phrases.Lookup('DEMAND'), 2 * c.Size, MainTexture);702 CountBar( offscreen, xFood + dxBar, yFood, wBar, 0,696 CountBar(Offscreen, xFood + dxBar, yFood + dyBar, wBar, 0, 697 Phrases.Lookup('DEMAND'), 2 * C.Size, MainTexture); 698 CountBar(Offscreen, xFood + dxBar, yFood, wBar, 0, 703 699 Phrases.Lookup('SUPPORT'), Report.FoodSupport, MainTexture); 704 700 if Report.FoodSurplus >= 0 then 705 if (cGov = gFuture) or ( c.Size >= NeedAqueductSize) and701 if (cGov = gFuture) or (C.Size >= NeedAqueductSize) and 706 702 (Report.FoodSurplus < 2) then 707 CountBar( offscreen, xFood + dxBar, yFood + 2 * dyBar, wBar, 6,703 CountBar(Offscreen, xFood + dxBar, yFood + 2 * dyBar, wBar, 6, 708 704 Phrases.Lookup('PROFIT'), Report.FoodSurplus, MainTexture) 709 705 else 710 CountBar( offscreen, xFood + dxBar, yFood + 2 * dyBar, wBar, 0,706 CountBar(Offscreen, xFood + dxBar, yFood + 2 * dyBar, wBar, 0, 711 707 Phrases.Lookup('SURPLUS'), Report.FoodSurplus, MainTexture) 712 708 else 713 709 begin 714 710 MakeRed(Offscreen, xFood + dxBar - 6, yFood + 2 * dyBar, wBar + 10, 38); 715 CountBar( offscreen, xFood + dxBar, yFood + 2 * dyBar, wBar, 1,711 CountBar(Offscreen, xFood + dxBar, yFood + 2 * dyBar, wBar, 1, 716 712 Phrases.Lookup('LACK'), -Report.FoodSurplus, RedTex); 717 713 end; 718 714 end; 719 CanGrow := ( c.Size < MaxCitySize) and (cGov <> gFuture) and720 (Report.FoodSurplus > 0) and (( c.Size < NeedAqueductSize) or721 ( c.Built[imAqueduct] = 1) and (c.Size < NeedSewerSize) or722 ( c.Built[imSewer] = 1));715 CanGrow := (C.Size < MaxCitySize) and (cGov <> gFuture) and 716 (Report.FoodSurplus > 0) and ((C.Size < NeedAqueductSize) or 717 (C.Built[imAqueduct] = 1) and (C.Size < NeedSewerSize) or 718 (C.Built[imSewer] = 1)); 723 719 FillBar(xFood + 3, yFood + 102, TrueFood, 724 CutCityFoodSurplus(Report.FoodSurplus, IsCityAlive, cGov, c.Size),720 CutCityFoodSurplus(Report.FoodSurplus, IsCityAlive, cGov, C.Size), 725 721 Report.Storage, 1, CanGrow); 726 LoweredTextout( offscreen.Canvas, -1, MainTexture, xFood + 3 - 5,722 LoweredTextout(Offscreen.Canvas, -1, MainTexture, xFood + 3 - 5, 727 723 yFood + 102 - 20, Format('%d/%d', [TrueFood, Report.Storage])); 728 LoweredTextout( offscreen.Canvas, -1, MainTexture, xFood - 2, yFood + 66,724 LoweredTextout(Offscreen.Canvas, -1, MainTexture, xFood - 2, yFood + 66, 729 725 Phrases.Lookup('STORAGE')); 730 726 … … 732 728 if IsCityAlive then 733 729 begin 734 CountBar( offscreen, xProd, yProd, wBar, 2, Phrases.Lookup('MATERIAL'),730 CountBar(Offscreen, xProd, yProd, wBar, 2, Phrases.Lookup('MATERIAL'), 735 731 Report.CollectedMaterial, MainTexture); 736 CountBar( offscreen, xProd + dxBar, yProd, wBar, 2,732 CountBar(Offscreen, xProd + dxBar, yProd, wBar, 2, 737 733 Phrases.Lookup('SUPPORT'), Report.MaterialSupport, MainTexture); 738 734 if Report.Production >= 0 then 739 if c.Project and (cpImp + cpIndex) = cpImp + imTrGoods then740 CountBar( offscreen, xProd + dxBar, yProd + dyBar + 16, wBar, 6,735 if C.Project and (cpImp + cpIndex) = cpImp + imTrGoods then 736 CountBar(Offscreen, xProd + dxBar, yProd + dyBar + 16, wBar, 6, 741 737 Phrases.Lookup('PROFIT'), Report.Production, MainTexture) 742 738 else 743 CountBar( offscreen, xProd + dxBar, yProd + dyBar + 16, wBar, 2,739 CountBar(Offscreen, xProd + dxBar, yProd + dyBar + 16, wBar, 2, 744 740 Phrases.Lookup('PROD'), Report.Production, MainTexture) 745 741 else 746 742 begin 747 743 MakeRed(Offscreen, xProd + dxBar - 6, yProd + dyBar + 17, wBar + 10, 38); 748 CountBar( offscreen, xProd + dxBar, yProd + dyBar + 16, wBar, 3,744 CountBar(Offscreen, xProd + dxBar, yProd + dyBar + 16, wBar, 3, 749 745 Phrases.Lookup('LACK'), -Report.Production, RedTex); 750 746 end; 751 747 end; 752 if c.Project and (cpImp + cpIndex) <> cpImp + imTrGoods then753 with offscreen.Canvas do754 begin 755 i:= Report.Production;756 if ( i< 0) or not IsCityAlive then757 i:= 0;758 FillBar(xProd + 3, yProd + 16 + 63, TrueProd, i, PrCost, 4, true);759 LoweredTextout( offscreen.Canvas, -1, MainTexture, xProd + 3 - 5,748 if C.Project and (cpImp + cpIndex) <> cpImp + imTrGoods then 749 with Offscreen.Canvas do 750 begin 751 I := Report.Production; 752 if (I < 0) or not IsCityAlive then 753 I := 0; 754 FillBar(xProd + 3, yProd + 16 + 63, TrueProd, I, PrCost, 4, True); 755 LoweredTextout(Offscreen.Canvas, -1, MainTexture, xProd + 3 - 5, 760 756 yProd + 16 + 43, Format('%d/%d', [TrueProd, PrCost])); 761 if BiColorTextWidth( offscreen.Canvas, PrName) > wBar + dxBar then757 if BiColorTextWidth(Offscreen.Canvas, PrName) > wBar + dxBar then 762 758 begin 763 759 repeat 764 Delete(PrName, length(PrName), 1)765 until BiColorTextWidth( offscreen.Canvas, PrName) <= wBar + dxBar;760 Delete(PrName, Length(PrName), 1) 761 until BiColorTextWidth(Offscreen.Canvas, PrName) <= wBar + dxBar; 766 762 PrName := PrName + '.' 767 763 end; 768 764 end; 769 RisedTextOut( offscreen.Canvas, xProd - 2, yProd + 36, PrName);765 RisedTextOut(Offscreen.Canvas, xProd - 2, yProd + 36, PrName); 770 766 771 767 // pollution section … … 773 769 begin 774 770 FillBar(xPoll + 3, yPoll + 20, TruePoll, Report.AddPollution, 775 MaxPollution, 3, true);776 RisedTextOut( offscreen.Canvas, xPoll + 3 - 5, yPoll + 20 - 20,771 MaxPollution, 3, True); 772 RisedTextOut(Offscreen.Canvas, xPoll + 3 - 5, yPoll + 20 - 20, 777 773 Phrases.Lookup('POLL')); 778 774 end; … … 781 777 if IsCityAlive and (Report.CollectedTrade > 0) then 782 778 begin 783 CountBar( offscreen, xTrade, yTrade + dyBar div 2, wBar, 4,779 CountBar(Offscreen, xTrade, yTrade + dyBar div 2, wBar, 4, 784 780 Phrases.Lookup('TRADE'), Report.CollectedTrade, MainTexture); 785 CountBar( offscreen, xTrade + dxBar, yTrade + 2 * dyBar, wBar, 5,781 CountBar(Offscreen, xTrade + dxBar, yTrade + 2 * dyBar, wBar, 5, 786 782 Phrases.Lookup('CORR'), Report.Corruption, MainTexture); 787 CountBar( offscreen, xTrade + dxBar, yTrade, wBar, 6, Phrases.Lookup('TAX'),783 CountBar(Offscreen, xTrade + dxBar, yTrade, wBar, 6, Phrases.Lookup('TAX'), 788 784 Report.Tax, MainTexture); 789 CountBar( offscreen, xTrade + dxBar, yTrade + dyBar, wBar, 12,785 CountBar(Offscreen, xTrade + dxBar, yTrade + dyBar, wBar, 12, 790 786 Phrases.Lookup('SCIENCE'), Report.Science, MainTexture); 791 787 end; 792 788 793 789 // small map 794 DpiBit Canvas(offscreen.Canvas, xSmallMap, ySmallMap, wSmallMap, hSmallMap,790 DpiBitBltCanvas(Offscreen.Canvas, xSmallMap, ySmallMap, wSmallMap, hSmallMap, 795 791 SmallCityMap.Canvas, 0, 0); 796 792 if SmallMapMode = smImprovements then 797 Frame( offscreen.Canvas, xSmallMap + 48 * (ZoomArea div 3),793 Frame(Offscreen.Canvas, xSmallMap + 48 * (ZoomArea div 3), 798 794 ySmallMap + 24 * (ZoomArea mod 3), xSmallMap + 48 * (ZoomArea div 3) + 49, 799 795 ySmallMap + 24 * (ZoomArea mod 3) + 25, MainTexture.ColorMark, 800 796 MainTexture.ColorMark); 801 Frame( offscreen.Canvas, xSmallMap - 1, ySmallMap - 1, xSmallMap + wSmallMap,797 Frame(Offscreen.Canvas, xSmallMap - 1, ySmallMap - 1, xSmallMap + wSmallMap, 802 798 ySmallMap + hSmallMap, $B0B0B0, $FFFFFF); 803 RFrame( offscreen.Canvas, xSmallMap - 2, ySmallMap - 2, xSmallMap + wSmallMap +799 RFrame(Offscreen.Canvas, xSmallMap - 2, ySmallMap - 2, xSmallMap + wSmallMap + 804 800 1, ySmallMap + hSmallMap + 1, $FFFFFF, $B0B0B0); 805 801 806 Frame( offscreen.Canvas, xSupport - 1, ySupport - 1, xSupport + wSupport,802 Frame(Offscreen.Canvas, xSupport - 1, ySupport - 1, xSupport + wSupport, 807 803 ySupport + hSupport, $B0B0B0, $FFFFFF); 808 RFrame( offscreen.Canvas, xSupport - 2, ySupport - 2, xSupport + wSupport + 1,804 RFrame(Offscreen.Canvas, xSupport - 2, ySupport - 2, xSupport + wSupport + 1, 809 805 ySupport + hSupport + 1, $FFFFFF, $B0B0B0); 810 x:= xSupport + wSupport div 2;811 y:= ySupport + hSupport div 2;806 X := xSupport + wSupport div 2; 807 Y := ySupport + hSupport div 2; 812 808 if SmallMapMode = smSupportedUnits then 813 809 begin 814 offscreen.Canvas.brush.Color := MainTexture.ColorMark;815 offscreen.Canvas.FillRect(Rect(x - 27, y - 6, x + 27, y+ 6));816 offscreen.Canvas.brush.style := bsClear;817 end; 818 Sprite( offscreen, HGrSystem, x - 16, y- 5, 10, 10, 88, 115);819 Sprite( offscreen, HGrSystem, x - 5, y- 5, 10, 10, 66, 115);820 Sprite( offscreen, HGrSystem, x + 6, y- 5, 10, 10, 154, 126);821 822 DpiBit Canvas(offscreen.Canvas, xZoomMap, yZoomMap, wZoomMap, hZoomMap,810 Offscreen.Canvas.Brush.Color := MainTexture.ColorMark; 811 Offscreen.Canvas.FillRect(Rect(X - 27, Y - 6, X + 27, Y + 6)); 812 Offscreen.Canvas.Brush.style := bsClear; 813 end; 814 Sprite(Offscreen, HGrSystem, X - 16, Y - 5, 10, 10, 88, 115); 815 Sprite(Offscreen, HGrSystem, X - 5, Y - 5, 10, 10, 66, 115); 816 Sprite(Offscreen, HGrSystem, X + 6, Y - 5, 10, 10, 154, 126); 817 818 DpiBitBltCanvas(Offscreen.Canvas, xZoomMap, yZoomMap, wZoomMap, hZoomMap, 823 819 ZoomCityMap.Canvas, 0, 0); 824 820 825 for i:= 0 to 5 do826 imix[ i] := -1;821 for I := 0 to 5 do 822 imix[I] := -1; 827 823 if SmallMapMode = smImprovements then 828 824 begin … … 831 827 Cnt := 0; 832 828 for iix := 0 to nImp - 1 do 833 if ((iix < nWonder) or (ImpPosition[iix] < 0)) and ( c.Built[iix] > 0) then829 if ((iix < nWonder) or (ImpPosition[iix] < 0)) and (C.Built[iix] > 0) then 834 830 begin 835 i:= Cnt - Page * 6;836 if ( i >= 0) and (i< 6) then837 imix[ i] := iix;838 inc(Cnt);831 I := Cnt - Page * 6; 832 if (I >= 0) and (I < 6) then 833 imix[I] := iix; 834 Inc(Cnt); 839 835 end; 840 836 PageCount := (Cnt + 5) div 6; … … 844 840 for iix := nWonder to nImp - 1 do 845 841 begin 846 i:= ImpPosition[iix] - 6 * ZoomArea;847 if ( i >= 0) and (i < 6) and (c.Built[iix] > 0) then848 imix[ i] := iix;842 I := ImpPosition[iix] - 6 * ZoomArea; 843 if (I >= 0) and (I < 6) and (C.Built[iix] > 0) then 844 imix[I] := iix; 849 845 end; 850 846 PageCount := 0; 851 847 end; 852 for i:= 0 to 5 do853 if imix[ i] >= 0 then848 for I := 0 to 5 do 849 if imix[I] >= 0 then 854 850 begin 855 iix := imix[ i];856 x := xZoomMap + 14 + 72 * (imod 3);857 y := yZoomMap + 14 + 56 * (idiv 3);858 ImpImage( offscreen.Canvas, x, y, iix, cGov, AllowChange and851 iix := imix[I]; 852 X := xZoomMap + 14 + 72 * (I mod 3); 853 Y := yZoomMap + 14 + 56 * (I div 3); 854 ImpImage(Offscreen.Canvas, X, Y, iix, cGov, AllowChange and 859 855 (ClientMode < scContact)); 860 856 if IsCityAlive then … … 862 858 if iix = imColosseum then 863 859 begin 864 Sprite( offscreen, HGrSystem, x + 46, y, 14, 14, 82, 100);860 Sprite(Offscreen, HGrSystem, X + 46, Y, 14, 14, 82, 100); 865 861 end 866 862 else … … 880 876 if HappyGain > 1 then 881 877 begin 882 d:= 30 div (HappyGain - 1);883 if d> 10 then884 d:= 10878 D := 30 div (HappyGain - 1); 879 if D > 10 then 880 D := 10 885 881 end; 886 for j:= 0 to HappyGain - 1 do887 Sprite( offscreen, HGrSystem, x + 50, y + d * j, 10, 10, 132, 126);882 for J := 0 to HappyGain - 1 do 883 Sprite(Offscreen, HGrSystem, X + 50, Y + D * J, 10, 10, 132, 126); 888 884 end; 889 for j:= 0 to Imp[iix].Maint - 1 do890 Sprite( offscreen, HGrSystem, x - 4, y + 29 - 3 * j, 10, 10,885 for J := 0 to Imp[iix].Maint - 1 do 886 Sprite(Offscreen, HGrSystem, X - 4, Y + 29 - 3 * J, 10, 10, 891 887 132, 115); 892 888 end … … 919 915 else { if SmallMapMode = smSupportedUnits then } 920 916 begin 921 LoweredTextout( offscreen.Canvas, -1, MainTexture, xZoomMap + 6,917 LoweredTextout(Offscreen.Canvas, -1, MainTexture, xZoomMap + 6, 922 918 yZoomMap + 2, Phrases.Lookup('SUPUNITS')); 923 FreeSupp := c.Size * SupportFree[cGov] shr 1;919 FreeSupp := C.Size * SupportFree[cGov] shr 1; 924 920 Cnt := 0; 925 for i:= 0 to MyRO.nUn - 1 do926 if (MyUn[ i].Loc >= 0) and (MyUn[i].Home = cix) then927 with MyModel[MyUn[ i].mix] do921 for I := 0 to MyRO.nUn - 1 do 922 if (MyUn[I].Loc >= 0) and (MyUn[I].Home = cix) then 923 with MyModel[MyUn[I].mix] do 928 924 begin 929 Server(sGetUnitReport, me, i, UnitReport);925 Server(sGetUnitReport, Me, I, UnitReport); 930 926 if (Cnt >= 6 * Page) and (Cnt < 6 * (Page + 1)) then 931 927 begin // unit visible in display 932 imix[Cnt - 6 * Page] := i;933 x:= ((Cnt - 6 * Page) mod 3) * 64 + xZoomMap;934 y:= ((Cnt - 6 * Page) div 3) * 52 + yZoomMap + 20;935 MakeUnitInfo( me, MyUn[i], UnitInfo);936 NoMap.SetOutput( offscreen);937 NoMap.PaintUnit( x, y, UnitInfo, MyUn[i].Status);938 939 for j:= 0 to UnitReport.FoodSupport - 1 do940 Sprite( offscreen, HGrSystem, x + 38 + 11 * j, y+ 40, 10,928 imix[Cnt - 6 * Page] := I; 929 X := ((Cnt - 6 * Page) mod 3) * 64 + xZoomMap; 930 Y := ((Cnt - 6 * Page) div 3) * 52 + yZoomMap + 20; 931 MakeUnitInfo(Me, MyUn[I], UnitInfo); 932 NoMap.SetOutput(Offscreen); 933 NoMap.PaintUnit(X, Y, UnitInfo, MyUn[I].Status); 934 935 for J := 0 to UnitReport.FoodSupport - 1 do 936 Sprite(Offscreen, HGrSystem, X + 38 + 11 * J, Y + 40, 10, 941 937 10, 66, 115); 942 for j:= 0 to UnitReport.ProdSupport - 1 do938 for J := 0 to UnitReport.ProdSupport - 1 do 943 939 begin 944 940 if (FreeSupp > 0) and 945 941 (UnitReport.ReportFlags and urfAlwaysSupport = 0) then 946 942 begin 947 Sprite( offscreen, HGrSystem, x + 16 - 11 * j, y+ 40, 10,943 Sprite(Offscreen, HGrSystem, X + 16 - 11 * J, Y + 40, 10, 948 944 10, 143, 115); 949 dec(FreeSupp);945 Dec(FreeSupp); 950 946 end 951 947 else 952 Sprite( offscreen, HGrSystem, x + 16 - 11 * j, y+ 40, 10,948 Sprite(Offscreen, HGrSystem, X + 16 - 11 * J, Y + 40, 10, 953 949 10, 88, 115); 954 950 end; 955 951 if UnitReport.ReportFlags and urfDeployed <> 0 then 956 for j:= 0 to 1 do957 Sprite( offscreen, HGrSystem, x + 27 + 11 * j, y+ 40, 10,952 for J := 0 to 1 do 953 Sprite(Offscreen, HGrSystem, X + 27 + 11 * J, Y + 40, 10, 958 954 10, 154, 126) 959 955 end // unit visible in display 960 956 else 961 dec(FreeSupp, UnitReport.ProdSupport);962 inc(Cnt);957 Dec(FreeSupp, UnitReport.ProdSupport); 958 Inc(Cnt); 963 959 end; 964 960 PageCount := (Cnt + 5) div 6; … … 973 969 PageDownBtn.Visible := PageCount > 1; 974 970 975 with offscreen.Canvas do971 with Offscreen.Canvas do 976 972 begin 977 973 { display project now } 978 DLine( offscreen.Canvas, xView + 9 + xSizeBig, xProd + 2 * wBar + 10,974 DLine(Offscreen.Canvas, xView + 9 + xSizeBig, xProd + 2 * wBar + 10, 979 975 yProd + dyBar + 16, $FFFFFF, $B0B0B0); 980 976 if ProdHint then 981 977 begin 982 ScreenTools.Frame( offscreen.Canvas, xView + 9 - 1, yView + 5 - 1,978 ScreenTools.Frame(Offscreen.Canvas, xView + 9 - 1, yView + 5 - 1, 983 979 xView + 9 + xSizeBig, yView + 5 + ySizeBig, $B0B0B0, $FFFFFF); 984 RFrame( offscreen.Canvas, xView + 9 - 2, yView + 5 - 2,980 RFrame(Offscreen.Canvas, xView + 9 - 2, yView + 5 - 2, 985 981 xView + 9 + xSizeBig + 1, yView + 5 + ySizeBig + 1, $FFFFFF, $B0B0B0); 986 with offscreen.Canvas do982 with Offscreen.Canvas do 987 983 begin 988 brush.Color := $000000;984 Brush.Color := $000000; 989 985 FillRect(Rect(xView + 9, yView + 5, xView + 1 + 72 - 8, 990 986 yView + 5 + 40)); 991 brush.style := bsClear;987 Brush.style := bsClear; 992 988 end; 993 989 end 994 else if AllowChange and ( c.Status and 7 <> 0) then990 else if AllowChange and (C.Status and 7 <> 0) then 995 991 begin // city type autobuild 996 FrameImage( offscreen.Canvas, bigimp, xView + 9, yView + 5, xSizeBig,997 ySizeBig, ( c.Status and 7 - 1 + 3) * xSizeBig, 0, (cix >= 0) and992 FrameImage(Offscreen.Canvas, bigimp, xView + 9, yView + 5, xSizeBig, 993 ySizeBig, (C.Status and 7 - 1 + 3) * xSizeBig, 0, (cix >= 0) and 998 994 (ClientMode < scContact)); 999 995 end 1000 else if c.Project and cpImp = 0 then996 else if C.Project and cpImp = 0 then 1001 997 begin // project is unit 1002 FrameImage( offscreen.Canvas, bigimp, xView + 9, yView + 5, xSizeBig,998 FrameImage(Offscreen.Canvas, bigimp, xView + 9, yView + 5, xSizeBig, 1003 999 ySizeBig, 0, 0, AllowChange and (ClientMode < scContact)); 1004 with Tribe[cOwner].ModelPicture[ c.Project and cpIndex] do1005 Sprite( offscreen, HGr, xView + 5, yView + 1, 64, 44,1000 with Tribe[cOwner].ModelPicture[C.Project and cpIndex] do 1001 Sprite(Offscreen, HGr, xView + 5, yView + 1, 64, 44, 1006 1002 pix mod 10 * 65 + 1, pix div 10 * 49 + 1); 1007 1003 end … … 1009 1005 begin // project is building 1010 1006 if ProdHint then 1011 Paintiix := c.Project0 and cpIndex1007 Paintiix := C.Project0 and cpIndex 1012 1008 else 1013 Paintiix := c.Project and cpIndex;1014 ImpImage( offscreen.Canvas, xView + 9, yView + 5, Paintiix, cGov,1009 Paintiix := C.Project and cpIndex; 1010 ImpImage(Offscreen.Canvas, xView + 9, yView + 5, Paintiix, cGov, 1015 1011 AllowChange and (ClientMode < scContact)); 1016 1012 end; … … 1019 1015 if AllowChange and (ClientMode < scContact) then 1020 1016 begin 1021 i := Server(sBuyCityProject - sExecute, me, cix, nil^);1022 BuyBtn.Visible := ( i = eOk) or (i= eViolation);1017 I := Server(sBuyCityProject - sExecute, Me, cix, nil^); 1018 BuyBtn.Visible := (I = eOk) or (I = eViolation); 1023 1019 end 1024 1020 else 1025 BuyBtn.Visible := false;1021 BuyBtn.Visible := False; 1026 1022 1027 1023 MarkUsedOffscreen(ClientWidth, ClientHeight); 1028 end; { OffscreenPaint }1024 end; 1029 1025 1030 1026 procedure TCityDlg.FormShow(Sender: TObject); 1031 1027 var 1032 dx, dy, Loc1: integer;1028 dx, dy, Loc1: Integer; 1033 1029 GetCityData: TGetCityData; 1034 1030 begin … … 1036 1032 if cix >= 0 then 1037 1033 begin { own city } 1038 c:= MyCity[cix];1039 cOwner := me;1034 C := MyCity[cix]; 1035 cOwner := Me; 1040 1036 cGov := MyRO.Government; 1041 1037 ProdHint := (cGov <> gAnarchy) and 1042 1038 (Happened and (chProduction or chFounded or chCaptured or 1043 1039 chAllImpsMade) <> 0); 1044 Server(sGetCityAreaInfo, me, cix, CityAreaInfo);1040 Server(sGetCityAreaInfo, Me, cix, CityAreaInfo); 1045 1041 NextCityBtn.Visible := WindowMode = wmPersistent; 1046 1042 PrevCityBtn.Visible := WindowMode = wmPersistent; … … 1049 1045 begin 1050 1046 SmallMapMode := smImprovements; 1051 Server(sGetCity, me, cLoc, GetCityData);1052 c := GetCityData.c;1047 Server(sGetCity, Me, cLoc, GetCityData); 1048 C := GetCityData.C; 1053 1049 cOwner := GetCityData.Owner; 1054 1050 cGov := MyRO.EnemyReport[cOwner].Government; 1055 Happened := c.Flags and $7FFFFFFF;1056 ProdHint := false;1057 Server(sGetEnemyCityAreaInfo, me, cLoc, CityAreaInfo);1058 1059 if c.Project and cpImp = 0 then1051 Happened := C.Flags and $7FFFFFFF; 1052 ProdHint := False; 1053 Server(sGetEnemyCityAreaInfo, Me, cLoc, CityAreaInfo); 1054 1055 if C.Project and cpImp = 0 then 1060 1056 begin 1061 1057 emix := MyRO.nEnemyModel - 1; 1062 1058 while (emix > 0) and ((MyRO.EnemyModel[emix].Owner <> cOwner) or 1063 ( integer(MyRO.EnemyModel[emix].mix) <> c.Project and cpIndex)) do1064 dec(emix);1065 if not Assigned(Tribe[cOwner].ModelPicture[ c.Project and cpIndex].HGr) then1059 (Integer(MyRO.EnemyModel[emix].mix) <> C.Project and cpIndex)) do 1060 Dec(emix); 1061 if not Assigned(Tribe[cOwner].ModelPicture[C.Project and cpIndex].HGr) then 1066 1062 InitEnemyModel(emix); 1067 1063 end; 1068 1064 1069 NextCityBtn.Visible := false;1070 PrevCityBtn.Visible := false;1065 NextCityBtn.Visible := False; 1066 PrevCityBtn.Visible := False; 1071 1067 end; 1072 1068 Page := 0; 1073 1069 1074 if c.Size < 5 then1070 if C.Size < 5 then 1075 1071 SizeClass := 0 1076 else if c.Size < 9 then1072 else if C.Size < 9 then 1077 1073 SizeClass := 1 1078 else if c.Size < 13 then1074 else if C.Size < 13 then 1079 1075 SizeClass := 2 1080 1076 else … … 1082 1078 1083 1079 // check if port 1084 IsPort := false;1080 IsPort := False; 1085 1081 for dx := -2 to 2 do 1086 1082 for dy := -2 to 2 do 1087 if abs(dx) + abs(dy) = 2 then1083 if Abs(dx) + Abs(dy) = 2 then 1088 1084 begin 1089 1085 Loc1 := dLoc(cLoc, dx, dy); 1090 1086 if (Loc1 >= 0) and (Loc1 < G.lx * G.ly) and 1091 1087 (MyMap[Loc1] and fTerrain < fGrass) then 1092 IsPort := true;1088 IsPort := True; 1093 1089 end; 1094 1090 … … 1099 1095 end; 1100 1096 1101 Caption := CityName( c.ID);1097 Caption := CityName(C.ID); 1102 1098 1103 1099 InitSmallCityMap; … … 1105 1101 OpenSoundEvent := -1; 1106 1102 OffscreenPaint; 1107 Timer1.Enabled := true;1108 end; 1109 1110 procedure TCityDlg.ShowNewContent(NewMode , Loc: integer; ShowEvent: cardinal);1103 Timer1.Enabled := True; 1104 end; 1105 1106 procedure TCityDlg.ShowNewContent(NewMode: TWindowMode; Loc: Integer; ShowEvent: Cardinal); 1111 1107 begin 1112 1108 if MyMap[Loc] and fOwned <> 0 then … … 1114 1110 cix := MyRO.nCity - 1; 1115 1111 while (cix >= 0) and (MyCity[cix].Loc <> Loc) do 1116 dec(cix);1117 assert(cix >= 0);1112 Dec(cix); 1113 Assert(cix >= 0); 1118 1114 if (Optimize_cixTileChange >= 0) and 1119 1115 (Optimize_TilesBeforeChange and not MyCity[Optimize_cixTileChange].Tiles … … 1131 1127 else 1132 1128 cix := -1; 1133 AllowChange := not supervising and (cix >= 0);1129 AllowChange := not Supervising and (cix >= 0); 1134 1130 cLoc := Loc; 1135 1131 Happened := ShowEvent; … … 1138 1134 1139 1135 procedure TCityDlg.FormMouseDown(Sender: TObject; Button: TMouseButton; 1140 Shift: TShiftState; x, y: integer);1136 Shift: TShiftState; X, Y: Integer); 1141 1137 var 1142 i, qx, qy, dx, dy, fix, NewTiles, Loc1, iix, SellResult: integer;1143 Rebuild: boolean;1144 begin 1145 if (ssLeft in Shift) and ( x >= xSmallMap) and (x< xSmallMap + wSmallMap) and1146 ( y >= ySmallMap) and (y< ySmallMap + hSmallMap) then1138 I, qx, qy, dx, dy, fix, NewTiles, Loc1, iix, SellResult: Integer; 1139 Rebuild: Boolean; 1140 begin 1141 if (ssLeft in Shift) and (X >= xSmallMap) and (X < xSmallMap + wSmallMap) and 1142 (Y >= ySmallMap) and (Y < ySmallMap + hSmallMap) then 1147 1143 begin 1148 1144 SmallMapMode := smImprovements; 1149 ZoomArea := ( y- ySmallMap) * 3 div hSmallMap + 3 *1150 (( x- xSmallMap) * 2 div wSmallMap);1145 ZoomArea := (Y - ySmallMap) * 3 div hSmallMap + 3 * 1146 ((X - xSmallMap) * 2 div wSmallMap); 1151 1147 Page := 0; 1152 1148 InitZoomCityMap; 1153 1149 SmartUpdateContent; 1154 exit;1155 end; 1156 if (ssLeft in Shift) and ( x >= xSupport) and (x< xSupport + wSupport) and1157 ( y >= ySupport) and (y< ySupport + hSupport) then1150 Exit; 1151 end; 1152 if (ssLeft in Shift) and (X >= xSupport) and (X < xSupport + wSupport) and 1153 (Y >= ySupport) and (Y < ySupport + hSupport) then 1158 1154 begin 1159 1155 SmallMapMode := smSupportedUnits; … … 1161 1157 InitZoomCityMap; 1162 1158 SmartUpdateContent; 1163 exit;1159 Exit; 1164 1160 end; 1165 1161 if not AllowChange then 1166 exit; // not an own city1162 Exit; // Not an own city 1167 1163 1168 1164 if (ssLeft in Shift) then 1169 if (ClientMode < scContact) and ( x >= xView) and (y>= yView) and1170 ( x < xView + 73) and (y< yView + 50) then1165 if (ClientMode < scContact) and (X >= xView) and (Y >= yView) and 1166 (X < xView + 73) and (Y < yView + 50) then 1171 1167 if cGov = gAnarchy then 1172 with M essgExDlg do1168 with MainScreen.MessgExDlg do 1173 1169 begin 1174 1170 { MessgText:=Phrases.Lookup('OUTOFCONTROL'); 1175 if c.Project and cpImp=0 then1176 MessgText:=Format(MessgText,[Tribe[cOwner].ModelName[ c.Project and cpIndex]])1177 else MessgText:=Format(MessgText,[Phrases.Lookup('IMPROVEMENTS', c.Project and cpIndex)]); }1171 if C.Project and cpImp=0 then 1172 MessgText:=Format(MessgText,[Tribe[cOwner].ModelName[C.Project and cpIndex]]) 1173 else MessgText:=Format(MessgText,[Phrases.Lookup('IMPROVEMENTS',C.Project and cpIndex)]); } 1178 1174 MessgText := Phrases.Lookup('NOCHANGEINANARCHY'); 1179 1175 Kind := mkOk; … … 1184 1180 if ProdHint then 1185 1181 begin 1186 ProdHint := false;1182 ProdHint := False; 1187 1183 SmartUpdateContent 1188 1184 end; 1189 1185 ChooseProject; 1190 1186 end 1191 else if (SmallMapMode = smImprovements) and ( x >= xZoomMap) and (x< xZoomMap + wZoomMap) and1192 ( y >= yZoomMap) and (y< yZoomMap + hZoomMap) then1193 begin 1194 i:= 5;1195 while ( i >= 0) and not((x >= xZoomMap + 14 + 72 * (imod 3)) and1196 ( x < xZoomMap + 14 + 56 + 72 * (imod 3)) and1197 ( y >= yZoomMap + 14 + 56 * (idiv 3)) and1198 ( y < yZoomMap + 14 + 40 + 56 * (idiv 3))) do1199 dec(i);1200 if i>= 0 then1187 else if (SmallMapMode = smImprovements) and (X >= xZoomMap) and (X < xZoomMap + wZoomMap) and 1188 (Y >= yZoomMap) and (Y < yZoomMap + hZoomMap) then 1189 begin 1190 I := 5; 1191 while (I >= 0) and not((X >= xZoomMap + 14 + 72 * (I mod 3)) and 1192 (X < xZoomMap + 14 + 56 + 72 * (I mod 3)) and 1193 (Y >= yZoomMap + 14 + 56 * (I div 3)) and 1194 (Y < yZoomMap + 14 + 40 + 56 * (I div 3))) do 1195 Dec(I); 1196 if I >= 0 then 1201 1197 begin 1202 iix := imix[ i];1198 iix := imix[I]; 1203 1199 if iix >= 0 then 1204 1200 if ssShift in Shift then 1205 HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp, iix)1201 MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, iix) 1206 1202 else if (ClientMode < scContact) then 1207 with M essgExDlg do1203 with MainScreen.MessgExDlg do 1208 1204 begin 1209 1205 IconKind := mikImp; … … 1220 1216 else 1221 1217 begin 1222 SellResult := Server(sSellCityImprovement - sExecute, me,1218 SellResult := Server(sSellCityImprovement - sExecute, Me, 1223 1219 cix, iix); 1224 1220 if SellResult < rExecuted then … … 1235 1231 else 1236 1232 begin 1237 if Server(sRebuildCityImprovement - sExecute, me, cix, iix) < rExecuted1233 if Server(sRebuildCityImprovement - sExecute, Me, cix, iix) < rExecuted 1238 1234 then 1239 1235 begin // no rebuild possible, ask for sell only 1240 Rebuild := false;1236 Rebuild := False; 1241 1237 MessgText := Phrases.Lookup('IMPROVEMENTS', iix); 1242 1238 if not Phrases2FallenBackToEnglish then 1243 1239 MessgText := Format(Phrases2.Lookup('SELL2'), 1244 1240 [MessgText, Imp[iix].Cost * BuildCostMod 1245 [G.Difficulty[ me]] div 12])1241 [G.Difficulty[Me]] div 12]) 1246 1242 else 1247 1243 MessgText := Format(Phrases.Lookup('SELL'), [MessgText]); 1248 1244 if iix = imSpacePort then 1249 with MyRO.Ship[ me] do1245 with MyRO.Ship[Me] do 1250 1246 if Parts[0] + Parts[1] + Parts[2] > 0 then 1251 1247 MessgText := MessgText + ' ' + … … 1258 1254 else 1259 1255 begin 1260 Rebuild := true;1256 Rebuild := True; 1261 1257 MessgText := Phrases.Lookup('IMPROVEMENTS', iix); 1262 1258 if not Phrases2FallenBackToEnglish then 1263 1259 MessgText := Format(Phrases2.Lookup('DISPOSE2'), 1264 1260 [MessgText, Imp[iix].Cost * BuildCostMod 1265 [G.Difficulty[ me]] div 12 * 2 div 3])1261 [G.Difficulty[Me]] div 12 * 2 div 3]) 1266 1262 else 1267 1263 MessgText := Format(Phrases.Lookup('DISPOSE'), 1268 1264 [MessgText]); 1269 1265 if iix = imSpacePort then 1270 with MyRO.Ship[ me] do1266 with MyRO.Ship[Me] do 1271 1267 if Parts[0] + Parts[1] + Parts[2] > 0 then 1272 1268 MessgText := MessgText + ' ' + … … 1282 1278 begin 1283 1279 Play('CITY_REBUILDIMP'); 1284 Server(sRebuildCityImprovement, me, cix, iix);1280 Server(sRebuildCityImprovement, Me, cix, iix); 1285 1281 end 1286 1282 else 1287 1283 begin 1288 1284 Play('CITY_SELLIMP'); 1289 Server(sSellCityImprovement, me, cix, iix);1285 Server(sSellCityImprovement, Me, cix, iix); 1290 1286 end; 1291 1287 CityOptimizer_CityChange(cix); … … 1300 1296 end; 1301 1297 end 1302 else if (SmallMapMode = smSupportedUnits) and ( x >= xZoomMap) and (x< xZoomMap + wZoomMap) and1303 ( y >= yZoomMap) and (y< yZoomMap + hZoomMap) then1304 begin 1305 i:= 5;1306 while ( i >= 0) and not((x >= xZoomMap + 64 * (imod 3)) and1307 ( x < xZoomMap + 64 + 64 * (imod 3)) and1308 ( y >= yZoomMap + 20 + 48 * (idiv 3)) and1309 ( y < yZoomMap + 20 + 52 + 48 * (idiv 3))) do1310 dec(i);1311 if ( i >= 0) and (imix[i] >= 0) then1298 else if (SmallMapMode = smSupportedUnits) and (X >= xZoomMap) and (X < xZoomMap + wZoomMap) and 1299 (Y >= yZoomMap) and (Y < yZoomMap + hZoomMap) then 1300 begin 1301 I := 5; 1302 while (I >= 0) and not((X >= xZoomMap + 64 * (I mod 3)) and 1303 (X < xZoomMap + 64 + 64 * (I mod 3)) and 1304 (Y >= yZoomMap + 20 + 48 * (I div 3)) and 1305 (Y < yZoomMap + 20 + 52 + 48 * (I div 3))) do 1306 Dec(I); 1307 if (I >= 0) and (imix[I] >= 0) then 1312 1308 if ssShift in Shift then 1313 1309 else if (cix >= 0) and (ClientMode < scContact) and … … 1316 1312 CloseAction := None; 1317 1313 Close; 1318 MainScreen.CityClosed(imix[ i], false, true);1314 MainScreen.CityClosed(imix[I], False, True); 1319 1315 end; 1320 1316 end 1321 else if ( x >= xmArea - 192) and (x < xmArea + 192) and (y>= ymArea - 96)1322 and ( y< ymArea + 96) then1317 else if (X >= xmArea - 192) and (X < xmArea + 192) and (Y >= ymArea - 96) 1318 and (Y < ymArea + 96) then 1323 1319 with AreaMap do begin 1324 qx := ((4000 * xxt * yyt) + ( x - xmArea) * (yyt * 2) + (y- ymArea + yyt)1320 qx := ((4000 * xxt * yyt) + (X - xmArea) * (yyt * 2) + (Y - ymArea + yyt) 1325 1321 * (xxt * 2)) div (xxt * yyt * 4) - 1000; 1326 qy := ((4000 * xxt * yyt) + ( y - ymArea + yyt) * (xxt * 2) - (x- xmArea)1322 qy := ((4000 * xxt * yyt) + (Y - ymArea + yyt) * (xxt * 2) - (X - xmArea) 1327 1323 * (yyt * 2)) div (xxt * yyt * 4) - 1000; 1328 1324 dx := qx - qy; … … 1334 1330 Loc1 := dLoc(cLoc, dx, dy); 1335 1331 if (Loc1 >= 0) and (Loc1 < G.lx * G.ly) then 1336 HelpOnTerrain(Loc1, FWindowMode or wmPersistent)1332 HelpOnTerrain(Loc1, WindowModeMakePersistent(FWindowMode)) 1337 1333 end 1338 1334 else if (ClientMode < scContact) and (cGov <> gAnarchy) and 1339 ( c.Flags and chCaptured = 0) then1335 (C.Flags and chCaptured = 0) then 1340 1336 begin // toggle exploitation 1341 assert(not supervising);1342 if c.Status and csResourceWeightsMask <> 0 then1337 Assert(not Supervising); 1338 if C.Status and csResourceWeightsMask <> 0 then 1343 1339 begin 1344 with M essgExDlg do1340 with MainScreen.MessgExDlg do 1345 1341 begin 1346 1342 MessgText := Phrases.Lookup('CITYMANAGEOFF'); … … 1350 1346 ShowModal; 1351 1347 end; 1352 if M essgExDlg.ModalResult = mrOK then1348 if MainScreen.MessgExDlg.ModalResult = mrOK then 1353 1349 begin 1354 1350 MyCity[cix].Status := MyCity[cix].Status and 1355 1351 not csResourceWeightsMask; // off 1356 c.Status := MyCity[cix].Status;1352 C.Status := MyCity[cix].Status; 1357 1353 SmartUpdateContent; 1358 1354 end; 1359 exit;1355 Exit; 1360 1356 end; 1361 1357 fix := (dy + 3) shl 2 + (dx + 3) shr 1; 1362 1358 NewTiles := MyCity[cix].Tiles xor (1 shl fix); 1363 if Server(sSetCityTiles, me, cix, NewTiles) >= rExecuted then1359 if Server(sSetCityTiles, Me, cix, NewTiles) >= rExecuted then 1364 1360 begin 1365 1361 SmartUpdateContent; … … 1370 1366 end 1371 1367 else if (ClientMode < scContact) and (cGov <> gAnarchy) and 1372 ( c.Flags and chCaptured = 0) and (x >= xmOpt - 32) and (x< xmOpt + 32)1373 and ( y >= ymOpt - 32) and (y< ymOpt + 32) then1374 begin 1375 i := sqr(x - xmOpt) + sqr(y- ymOpt); // click radius1376 if i<= 32 * 32 then1368 (C.Flags and chCaptured = 0) and (X >= xmOpt - 32) and (X < xmOpt + 32) 1369 and (Y >= ymOpt - 32) and (Y < ymOpt + 32) then 1370 begin 1371 I := sqr(X - xmOpt) + sqr(Y - ymOpt); // click radius 1372 if I <= 32 * 32 then 1377 1373 begin 1378 if i< 16 * 16 then // inner area clicked1379 if c.Status and csResourceWeightsMask <> 0 then1380 i := (c.Status shr 4 and $0F) mod 5 + 1 // rotate except off1374 if I < 16 * 16 then // inner area clicked 1375 if C.Status and csResourceWeightsMask <> 0 then 1376 I := (C.Status shr 4 and $0F) mod 5 + 1 // rotate except off 1381 1377 else 1382 i:= 3 // rwGrowth1378 I := 3 // rwGrowth 1383 1379 else 1384 case trunc(arctan2( x - xmOpt, ymOpt - y) * 180 / pi) of1380 case trunc(arctan2(X - xmOpt, ymOpt - Y) * 180 / pi) of 1385 1381 - 25 - 52 * 2 .. -26 - 52: 1386 i:= 1;1382 I := 1; 1387 1383 -25 - 52 .. -26: 1388 i:= 2;1384 I := 2; 1389 1385 -25 .. 25: 1390 i:= 3;1386 I := 3; 1391 1387 26 .. 25 + 52: 1392 i:= 4;1388 I := 4; 1393 1389 26 + 52 .. 25 + 52 * 2: 1394 i:= 5;1390 I := 5; 1395 1391 180 - 26 .. 180, -180 .. -180 + 26: 1396 i:= 0;1392 I := 0; 1397 1393 else 1398 i:= -1;1394 I := -1; 1399 1395 end; 1400 if i>= 0 then1396 if I >= 0 then 1401 1397 begin 1402 ChangeResourceWeights( i);1398 ChangeResourceWeights(I); 1403 1399 SmartUpdateContent; 1404 1400 if WindowMode <> wmModal then … … 1407 1403 end; 1408 1404 end; 1409 end; { FormMouseDown }1405 end; 1410 1406 1411 1407 procedure TCityDlg.ChooseProject; … … 1422 1418 ); 1423 1419 1424 function ProjectType(Project: integer): TProjectType;1420 function ProjectType(Project: Integer): TProjectType; 1425 1421 begin 1426 1422 if Project and cpCompleted <> 0 then … … 1444 1440 1445 1441 var 1446 NewProject, OldMoney, cix1: integer;1442 NewProject, OldMoney, cix1: Integer; 1447 1443 pt0, pt1: TProjectType; 1448 QueryOk: boolean;1449 begin 1450 Assert(not supervising);1451 M odalSelectDlg.ShowNewContent_CityProject(wmModal, cix);1452 if M odalSelectDlg.result <> -1 then1453 begin 1454 if M odalSelectDlg.result and cpType <> 0 then1444 QueryOk: Boolean; 1445 begin 1446 Assert(not Supervising); 1447 MainScreen.ModalSelectDlg.ShowNewContent_CityProject(wmModal, cix); 1448 if MainScreen.ModalSelectDlg.Result <> -1 then 1449 begin 1450 if MainScreen.ModalSelectDlg.Result and cpType <> 0 then 1455 1451 begin 1456 1452 MyCity[cix].Status := MyCity[cix].Status and not 7 or 1457 (1 + M odalSelectDlg.result and cpIndex);1458 AutoBuild(cix, MyData.ImpOrder[M odalSelectDlg.result and cpIndex]);1453 (1 + MainScreen.ModalSelectDlg.Result and cpIndex); 1454 AutoBuild(cix, MyData.ImpOrder[MainScreen.ModalSelectDlg.Result and cpIndex]); 1459 1455 end 1460 1456 else 1461 1457 begin 1462 NewProject := M odalSelectDlg.Result;1458 NewProject := MainScreen.ModalSelectDlg.Result; 1463 1459 QueryOk := True; 1464 1460 if (NewProject and cpImp <> 0) and (NewProject and cpIndex >= 28) and 1465 1461 (MyRO.NatBuilt[NewProject and cpIndex] > 0) then 1466 with M essgExDlg do1462 with MainScreen.MessgExDlg do 1467 1463 begin 1468 1464 cix1 := MyRO.nCity - 1; … … 1521 1517 then 1522 1518 NewProject := NewProject or cpDisbandCity; 1523 Server(sSetCityProject, me, cix, NewProject);1524 c.Project := MyCity[cix].Project;1519 Server(sSetCityProject, Me, cix, NewProject); 1520 C.Project := MyCity[cix].Project; 1525 1521 if MyRO.Money > OldMoney then 1526 1522 Play('CITY_SELLIMP'); … … 1537 1533 procedure TCityDlg.BuyClick(Sender: TObject); 1538 1534 var 1539 NextProd, Cost: integer;1535 NextProd, Cost: Integer; 1540 1536 begin 1541 1537 if (cix < 0) or (ClientMode >= scContact) then 1542 exit;1543 with MyCity[cix], M essgExDlg do1538 Exit; 1539 with MyCity[cix], MainScreen.MessgExDlg do 1544 1540 begin 1545 1541 Cost := Report.ProjectCost; … … 1548 1544 NextProd := 0; 1549 1545 Cost := Cost - Prod - NextProd; 1550 if (MyRO.Wonder[woMich].EffectiveOwner = me) and (Project and cpImp <> 0)1546 if (MyRO.Wonder[woMich].EffectiveOwner = Me) and (Project and cpImp <> 0) 1551 1547 then 1552 1548 Cost := Cost * 2 … … 1572 1568 if (Kind = mkYesNo) and (ModalResult = mrOK) then 1573 1569 begin 1574 if Server(sBuyCityProject, me, cix, nil^) >= rExecuted then1570 if Server(sBuyCityProject, Me, cix, nil^) >= rExecuted then 1575 1571 begin 1576 1572 Play('CITY_BUYPROJECT'); … … 1585 1581 procedure TCityDlg.FormClose(Sender: TObject; var Action: TCloseAction); 1586 1582 begin 1587 Timer1.Enabled := false;1588 ProdHint := false;1583 Timer1.Enabled := False; 1584 ProdHint := False; 1589 1585 MarkCityLoc := -1; 1590 1586 if Optimize_cixTileChange >= 0 then … … 1615 1611 with Canvas do 1616 1612 begin 1617 DpiBit Canvas(Canvas, xView + 5, yView + 1, 64, 2, Back.Canvas,1613 DpiBitBltCanvas(Canvas, xView + 5, yView + 1, 64, 2, Back.Canvas, 1618 1614 xView + 5, yView + 1); 1619 DpiBit Canvas(Canvas, xView + 5, yView + 3, 2, 42, Back.Canvas,1615 DpiBitBltCanvas(Canvas, xView + 5, yView + 3, 2, 42, Back.Canvas, 1620 1616 xView + 5, yView + 3); 1621 DpiBit Canvas(Canvas, xView + 5 + 62, yView + 3, 2, 42,1617 DpiBitBltCanvas(Canvas, xView + 5 + 62, yView + 3, 2, 42, 1622 1618 Back.Canvas, xView + 5 + 62, yView + 3); 1623 1619 ScreenTools.Frame(Canvas, xView + 9 - 1, yView + 5 - 1, xView + 9 + xSizeBig, … … 1632 1628 else if BlinkTime = 6 then 1633 1629 begin 1634 if AllowChange and ( c.Status and 7 <> 0) then1630 if AllowChange and (C.Status and 7 <> 0) then 1635 1631 begin // city type autobuild 1636 1632 FrameImage(Canvas, bigimp, xView + 9, yView + 5, xSizeBig, ySizeBig, 1637 ( c.Status and 7 - 1 + 3) * xSizeBig, 0, true);1633 (C.Status and 7 - 1 + 3) * xSizeBig, 0, True); 1638 1634 end 1639 else if c.Project and cpImp = 0 then1635 else if C.Project and cpImp = 0 then 1640 1636 begin // project is unit 1641 DpiBit Canvas(Canvas, xView + 9, yView + 5, xSizeBig, ySizeBig,1637 DpiBitBltCanvas(Canvas, xView + 9, yView + 5, xSizeBig, ySizeBig, 1642 1638 Bigimp.Canvas, 0, 0); 1643 with Tribe[cOwner].ModelPicture[ c.Project and cpIndex] do1639 with Tribe[cOwner].ModelPicture[C.Project and cpIndex] do 1644 1640 Sprite(Canvas, HGr, xView + 5, yView + 1, 64, 44, pix mod 10 * 65 + 1, 1645 1641 pix div 10 * 49 + 1); 1646 1642 end 1647 1643 else 1648 ImpImage(Canvas, xView + 9, yView + 5, c.Project0 and cpIndex,1649 cGov, true);1644 ImpImage(Canvas, xView + 9, yView + 5, C.Project0 and cpIndex, 1645 cGov, True); 1650 1646 end; 1651 1647 end; … … 1663 1659 if 1 shl OpenSoundEvent = chProduction then 1664 1660 begin 1665 if c.Project0 and cpImp <> 0 then1666 begin 1667 if c.Project0 and cpIndex >= 28 then1661 if C.Project0 and cpImp <> 0 then 1662 begin 1663 if C.Project0 and cpIndex >= 28 then 1668 1664 // wonders have already extra message with sound 1669 if Imp[ c.Project0 and cpIndex].Kind = ikShipPart then1665 if Imp[C.Project0 and cpIndex].Kind = ikShipPart then 1670 1666 Play('SHIP_BUILT') 1671 1667 else … … 1681 1677 end; 1682 1678 1683 function Prio(iix: integer): integer;1679 function Prio(iix: Integer): Integer; 1684 1680 begin 1685 1681 case Imp[iix].Kind of 1686 1682 ikWonder: 1687 result := iix + 10000;1683 Result := iix + 10000; 1688 1684 ikNatLocal, ikNatGlobal: 1689 1685 case iix of 1690 1686 imPalace: 1691 result := 0;1687 Result := 0; 1692 1688 else 1693 result := iix + 20000;1689 Result := iix + 20000; 1694 1690 end; 1695 1691 else 1696 1692 case iix of 1697 1693 imTownHall, imCourt: 1698 result := iix + 30000;1694 Result := iix + 30000; 1699 1695 imAqueduct, imSewer: 1700 result := iix + 40000;1696 Result := iix + 40000; 1701 1697 imTemple, imTheater, imCathedral: 1702 result := iix + 50000;1703 else 1704 result := iix + 90000;1698 Result := iix + 50000; 1699 else 1700 Result := iix + 90000; 1705 1701 end; 1706 1702 end; … … 1717 1713 end; 1718 1714 1719 procedure TCityDlg.ChangeCity( d: integer);1715 procedure TCityDlg.ChangeCity(D: Integer); 1720 1716 var 1721 cixNew: integer;1717 cixNew: Integer; 1722 1718 begin 1723 1719 cixNew := cix; 1724 1720 repeat 1725 cixNew := (cixNew + MyRO.nCity + d) mod MyRO.nCity;1721 cixNew := (cixNew + MyRO.nCity + D) mod MyRO.nCity; 1726 1722 until (MyCity[cixNew].Loc >= 0) or (cixNew = cix); 1727 1723 if cixNew <> cix then … … 1742 1738 end; 1743 1739 1744 { procedure TCityDlg.AdviceBtnClick(Sender: TObject);1745 begin1746 AdvisorDlg.GiveCityAdvice(cix);1747 end; }1748 1749 1740 procedure TCityDlg.PageUpBtnClick(Sender: TObject); 1750 1741 begin 1751 1742 if Page > 0 then 1752 1743 begin 1753 dec(Page);1744 Dec(Page); 1754 1745 SmartUpdateContent; 1755 1746 end; … … 1760 1751 if Page < PageCount - 1 then 1761 1752 begin 1762 inc(Page);1753 Inc(Page); 1763 1754 SmartUpdateContent; 1764 1755 end; 1765 1756 end; 1766 1757 1767 procedure TCityDlg.ChangeResourceWeights(iResourceWeights: integer);1758 procedure TCityDlg.ChangeResourceWeights(iResourceWeights: Integer); 1768 1759 var 1769 1760 Advice: TCityTileAdviceData; 1770 1761 begin 1771 assert(not supervising);1772 assert(cix >= 0);1762 Assert(not Supervising); 1763 Assert(cix >= 0); 1773 1764 MyCity[cix].Status := MyCity[cix].Status and not csResourceWeightsMask or 1774 1765 (iResourceWeights shl 4); 1775 c.Status := MyCity[cix].Status;1766 C.Status := MyCity[cix].Status; 1776 1767 if iResourceWeights > 0 then 1777 1768 begin 1778 1769 Advice.ResourceWeights := OfferedResourceWeights[iResourceWeights]; 1779 Server(sGetCityTileAdvice, me, cix, Advice);1770 Server(sGetCityTileAdvice, Me, cix, Advice); 1780 1771 if Advice.Tiles <> MyCity[cix].Tiles then 1781 Server(sSetCityTiles, me, cix, Advice.Tiles);1772 Server(sSetCityTiles, Me, cix, Advice.Tiles); 1782 1773 end; 1783 1774 end; … … 1785 1776 procedure SortImprovements; 1786 1777 var 1787 i, j, k: integer;1788 begin 1789 for i:= 0 to nImp - 1 do1790 ImpSorted[ i] := i;1791 for i:= 0 to nImp - 2 do1792 for j := i+ 1 to nImp - 1 do1793 if Prio(ImpSorted[ i]) > Prio(ImpSorted[j]) then begin1794 k := ImpSorted[i];1795 ImpSorted[ i] := ImpSorted[j];1796 ImpSorted[ j] := k;1778 I, J, K: Integer; 1779 begin 1780 for I := 0 to nImp - 1 do 1781 ImpSorted[I] := I; 1782 for I := 0 to nImp - 2 do 1783 for J := I + 1 to nImp - 1 do 1784 if Prio(ImpSorted[I]) > Prio(ImpSorted[J]) then begin 1785 K := ImpSorted[I]; 1786 ImpSorted[I] := ImpSorted[J]; 1787 ImpSorted[J] := K; 1797 1788 end; 1798 1789 end; -
branches/highdpi/LocalPlayer/CityType.pas
r361 r465 5 5 6 6 uses 7 UDpiControls, Protocol, ClientTools, Term, ScreenTools, BaseWin, LCLIntf, LCLType, 8 SysUtils, Classes, Graphics, Controls, Forms, 9 ButtonB, ExtCtrls; 7 UDpiControls, Protocol, ClientTools, ScreenTools, BaseWin, LCLIntf, LCLType, 8 SysUtils, Classes, Graphics, Controls, Forms, ButtonB, ExtCtrls; 10 9 11 10 type … … 18 17 procedure FormShow(Sender: TObject); 19 18 procedure PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; 20 Shift: TShiftState; x, y: integer);19 Shift: TShiftState; X, Y: Integer); 21 20 procedure PaintBox1MouseUp(Sender: TObject; Button: TMouseButton; 22 Shift: TShiftState; x, y: integer);21 Shift: TShiftState; X, Y: Integer); 23 22 procedure FormClose(Sender: TObject; var Action: TCloseAction); 24 23 procedure DeleteBtnClick(Sender: TObject); 25 24 public 26 procedure ShowNewContent(NewMode: integer);25 procedure ShowNewContent(NewMode: TWindowMode); 27 26 protected 28 27 procedure OffscreenPaint; override; 29 28 private 30 nPool, dragiix, ctype: integer;31 Pooliix: array [0 .. nImp - 1] of integer;29 nPool, dragiix, ctype: Integer; 30 Pooliix: array [0 .. nImp - 1] of Integer; 32 31 listed: Set of 0 .. nImp; 33 Changed: boolean;34 procedure LoadType(NewType: integer);32 Changed: Boolean; 33 procedure LoadType(NewType: Integer); 35 34 procedure SaveType; 36 35 end; 37 36 38 var39 CityTypeDlg: TCityTypeDlg;40 37 41 38 implementation 42 39 43 uses Help; 40 uses 41 Help, Term; 44 42 45 43 {$R *.lfm} … … 82 80 procedure TCityTypeDlg.OffscreenPaint; 83 81 var 84 i, iix: integer;85 s: string;82 I, iix: Integer; 83 S: string; 86 84 begin 87 85 inherited; 88 offscreen.Canvas.Font.Assign(UniFont[ftSmall]);86 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 89 87 FillOffscreen(xList - 7, yList, 42 * nListCol + 14, 32 * nListRow); 90 88 FillOffscreen(xPool - 7, yPool, 42 * nPoolCol + 14, 32 * nPoolRow); … … 92 90 yPool - yList - 32 * nListRow); 93 91 94 Frame( offscreen.Canvas, 0, yList + 32 * nListRow, InnerWidth - 255,92 Frame(Offscreen.Canvas, 0, yList + 32 * nListRow, InnerWidth - 255, 95 93 yPool - 23, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 96 Frame( offscreen.Canvas, InnerWidth - 254, yList + 32 * nListRow,94 Frame(Offscreen.Canvas, InnerWidth - 254, yList + 32 * nListRow, 97 95 InnerWidth - 89, yPool - 23, MainTexture.ColorBevelLight, 98 96 MainTexture.ColorBevelShade); 99 Frame( offscreen.Canvas, InnerWidth - 88, yList + 32 * nListRow,97 Frame(Offscreen.Canvas, InnerWidth - 88, yList + 32 * nListRow, 100 98 InnerWidth - 1, yPool - 23, MainTexture.ColorBevelLight, 101 99 MainTexture.ColorBevelShade); 102 Frame( offscreen.Canvas, 0, yPool - 22, InnerWidth - 1, yPool - 1,100 Frame(Offscreen.Canvas, 0, yPool - 22, InnerWidth - 1, yPool - 1, 103 101 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 104 for i:= 0 to nCityType - 1 do105 begin 106 RFrame( offscreen.Canvas, xSwitch + i * 42, ySwitch, xSwitch + 39 + i* 42,102 for I := 0 to nCityType - 1 do 103 begin 104 RFrame(Offscreen.Canvas, xSwitch + I * 42, ySwitch, xSwitch + 39 + I * 42, 107 105 ySwitch + 23, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 108 if i= ctype then109 Frame( offscreen.Canvas, xSwitch + 1 + i* 42, ySwitch + 1,110 xSwitch + 38 + i* 42, ySwitch + 22, MainTexture.ColorBevelShade,106 if I = ctype then 107 Frame(Offscreen.Canvas, xSwitch + 1 + I * 42, ySwitch + 1, 108 xSwitch + 38 + I * 42, ySwitch + 22, MainTexture.ColorBevelShade, 111 109 MainTexture.ColorBevelLight) 112 110 else 113 Frame( offscreen.Canvas, xSwitch + 1 + i* 42, ySwitch + 1,114 xSwitch + 38 + i* 42, ySwitch + 22, MainTexture.ColorBevelLight,111 Frame(Offscreen.Canvas, xSwitch + 1 + I * 42, ySwitch + 1, 112 xSwitch + 38 + I * 42, ySwitch + 22, MainTexture.ColorBevelLight, 115 113 MainTexture.ColorBevelShade); 116 DpiBit Canvas(offscreen.Canvas, xSwitch + 2 + i* 42, ySwitch + 2,117 xSizeSmall, ySizeSmall, SmallImp.Canvas, ( i+ 3) * xSizeSmall, 0);118 end; 119 RisedTextOut( offscreen.Canvas, 8, yList + 32 * nListRow + 2,114 DpiBitBltCanvas(Offscreen.Canvas, xSwitch + 2 + I * 42, ySwitch + 2, 115 xSizeSmall, ySizeSmall, SmallImp.Canvas, (I + 3) * xSizeSmall, 0); 116 end; 117 RisedTextOut(Offscreen.Canvas, 8, yList + 32 * nListRow + 2, 120 118 Phrases.Lookup('BUILDORDER')); 121 RisedTextOut( offscreen.Canvas, 8, ySwitch + 26,119 RisedTextOut(Offscreen.Canvas, 8, ySwitch + 26, 122 120 Phrases.Lookup('CITYTYPE', ctype)); 123 s:= Phrases.Lookup('BUILDREST');124 RisedTextOut( offscreen.Canvas,125 (InnerWidth - BiColorTextWidth( offscreen.Canvas, s)) div 2,126 yList + 72 + 32 * nListRow, s);127 128 with offscreen.Canvas do129 begin 130 for i:= 1 to nListRow - 1 do131 DLine( offscreen.Canvas, xList - 5, xList + 4 + 42 * nListCol,132 yList - 1 + 32 * i, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);133 for i:= 0 to nListCol * nListRow - 1 do134 begin 135 s := IntToStr(i+ 1);121 S := Phrases.Lookup('BUILDREST'); 122 RisedTextOut(Offscreen.Canvas, 123 (InnerWidth - BiColorTextWidth(Offscreen.Canvas, S)) div 2, 124 yList + 72 + 32 * nListRow, S); 125 126 with Offscreen.Canvas do 127 begin 128 for I := 1 to nListRow - 1 do 129 DLine(Offscreen.Canvas, xList - 5, xList + 4 + 42 * nListCol, 130 yList - 1 + 32 * I, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 131 for I := 0 to nListCol * nListRow - 1 do 132 begin 133 S := IntToStr(I + 1); 136 134 Font.Color := MainTexture.ColorTextLight; 137 Textout(xList + 20 + i mod nListCol * 42 - TextWidth(s) div 2,138 yList + 15 + i div nListCol * 32 - TextHeight(s) div 2, s);139 end; 140 end; 141 142 i:= 0;143 while MyData.ImpOrder[ctype, i] >= 0 do144 begin 145 RFrame( offscreen.Canvas, xList + 20 - xSizeSmall div 2 + imod nListCol *146 42, yList + 15 - ySizeSmall div 2 + idiv nListCol * 32,147 xList + 21 + xSizeSmall div 2 + imod nListCol * 42,148 yList + 16 + ySizeSmall div 2 + idiv nListCol * 32,135 Textout(xList + 20 + I mod nListCol * 42 - TextWidth(S) div 2, 136 yList + 15 + I div nListCol * 32 - TextHeight(S) div 2, S); 137 end; 138 end; 139 140 I := 0; 141 while MyData.ImpOrder[ctype, I] >= 0 do 142 begin 143 RFrame(Offscreen.Canvas, xList + 20 - xSizeSmall div 2 + I mod nListCol * 144 42, yList + 15 - ySizeSmall div 2 + I div nListCol * 32, 145 xList + 21 + xSizeSmall div 2 + I mod nListCol * 42, 146 yList + 16 + ySizeSmall div 2 + I div nListCol * 32, 149 147 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 150 DpiBit Canvas(offscreen.Canvas, xList + 21 - xSizeSmall div 2 +151 i mod nListCol * 42, yList + 16 - ySizeSmall div 2 + idiv nListCol * 32,148 DpiBitBltCanvas(Offscreen.Canvas, xList + 21 - xSizeSmall div 2 + 149 I mod nListCol * 42, yList + 16 - ySizeSmall div 2 + I div nListCol * 32, 152 150 xSizeSmall, ySizeSmall, SmallImp.Canvas, 153 MyData.ImpOrder[ctype, i] mod 7 * xSizeSmall,154 (MyData.ImpOrder[ctype, i] + SystemIconLines * 7) div 7 *151 MyData.ImpOrder[ctype, I] mod 7 * xSizeSmall, 152 (MyData.ImpOrder[ctype, I] + SystemIconLines * 7) div 7 * 155 153 ySizeSmall); 156 inc(i);154 Inc(I); 157 155 end; 158 156 … … 165 163 begin 166 164 Pooliix[nPool] := iix; 167 RFrame( offscreen.Canvas, xPool + 20 - xSizeSmall div 2 +165 RFrame(Offscreen.Canvas, xPool + 20 - xSizeSmall div 2 + 168 166 nPool mod nPoolCol * 42, yPool + 15 - ySizeSmall div 2 + 169 167 nPool div nPoolCol * 32, xPool + 21 + xSizeSmall div 2 + … … 171 169 nPool div nPoolCol * 32, MainTexture.ColorBevelLight, 172 170 MainTexture.ColorBevelShade); 173 DpiBit Canvas(offscreen.Canvas, xPool + 21 - xSizeSmall div 2 +171 DpiBitBltCanvas(Offscreen.Canvas, xPool + 21 - xSizeSmall div 2 + 174 172 nPool mod nPoolCol * 42, yPool + 16 - ySizeSmall div 2 + 175 173 nPool div nPoolCol * 32, xSizeSmall, ySizeSmall, SmallImp.Canvas, 176 174 iix mod 7 * xSizeSmall, (iix + SystemIconLines * 7) div 7 * 177 175 ySizeSmall); 178 inc(nPool);176 Inc(nPool); 179 177 end; 180 178 DeleteBtn.Visible := MyData.ImpOrder[ctype, 0] >= 0; … … 182 180 if dragiix >= 0 then 183 181 begin 184 ImpImage( offscreen.Canvas, xView + 9, yView + 5, dragiix);185 s:= Phrases.Lookup('IMPROVEMENTS', dragiix);186 RisedTextOut( offscreen.Canvas,187 xView + 36 - BiColorTextWidth( offscreen.Canvas, s) div 2,188 ySwitch + 26, s);182 ImpImage(Offscreen.Canvas, xView + 9, yView + 5, dragiix); 183 S := Phrases.Lookup('IMPROVEMENTS', dragiix); 184 RisedTextOut(Offscreen.Canvas, 185 xView + 36 - BiColorTextWidth(Offscreen.Canvas, S) div 2, 186 ySwitch + 26, S); 189 187 end; 190 188 MarkUsedOffscreen(InnerWidth, InnerHeight); 191 end; { MainPaint }192 193 procedure TCityTypeDlg.LoadType(NewType: integer);194 var 195 i: integer;189 end; 190 191 procedure TCityTypeDlg.LoadType(NewType: Integer); 192 var 193 I: Integer; 196 194 begin 197 195 ctype := NewType; 198 196 listed := []; 199 i:= 0;200 while MyData.ImpOrder[ctype, i] >= 0 do201 begin 202 include(listed, MyData.ImpOrder[ctype, i]);203 inc(i);204 end; 205 Changed := false;197 I := 0; 198 while MyData.ImpOrder[ctype, I] >= 0 do 199 begin 200 Include(listed, MyData.ImpOrder[ctype, I]); 201 Inc(I); 202 end; 203 Changed := False; 206 204 end; 207 205 208 206 procedure TCityTypeDlg.SaveType; 209 207 var 210 cix: integer;208 cix: Integer; 211 209 begin 212 210 if Changed then … … 215 213 if (MyCity[cix].Loc >= 0) and (MyCity[cix].Status and 7 = ctype + 1) then 216 214 AutoBuild(cix, MyData.ImpOrder[ctype]); 217 Changed := false;215 Changed := False; 218 216 end; 219 217 end; … … 226 224 end; 227 225 228 procedure TCityTypeDlg.ShowNewContent(NewMode: integer);226 procedure TCityTypeDlg.ShowNewContent(NewMode: TWindowMode); 229 227 begin 230 228 inherited ShowNewContent(NewMode); … … 232 230 233 231 procedure TCityTypeDlg.PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; 234 Shift: TShiftState; x, y: integer);235 var 236 i: integer;237 begin 238 x := x- SideFrame;239 y := y- WideFrame;240 i := (x - xList) div 42 + (y- yList) div 32 * nListCol;241 if ( i < nImp) and (MyData.ImpOrder[ctype, i] >= 0) and242 ( x > xList + 2 + imod nListCol * 42) and243 ( y > yList + 5 + idiv nListCol * 32) and244 ( x < xList + 3 + 36 + imod nListCol * 42) and245 ( y < yList + 6 + 20 + idiv nListCol * 32) then232 Shift: TShiftState; X, Y: Integer); 233 var 234 I: Integer; 235 begin 236 X := X - SideFrame; 237 Y := Y - WideFrame; 238 I := (X - xList) div 42 + (Y - yList) div 32 * nListCol; 239 if (I < nImp) and (MyData.ImpOrder[ctype, I] >= 0) and 240 (X > xList + 2 + I mod nListCol * 42) and 241 (Y > yList + 5 + I div nListCol * 32) and 242 (X < xList + 3 + 36 + I mod nListCol * 42) and 243 (Y < yList + 6 + 20 + I div nListCol * 32) then 246 244 begin 247 245 if ssShift in Shift then 248 HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp,249 MyData.ImpOrder[ctype, i])246 MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, 247 MyData.ImpOrder[ctype, I]) 250 248 else 251 249 begin 252 dragiix := MyData.ImpOrder[ctype, i];250 dragiix := MyData.ImpOrder[ctype, I]; 253 251 DpiScreen.Cursor := crImpDrag; 254 252 SmartUpdateContent; 255 253 end; 256 exit;257 end; 258 i := (x - xPool) div 42 + (y- yPool) div 32 * nPoolCol;259 if ( i < nPool) and (x > xPool + 2 + imod nPoolCol * 42) and260 ( y > yPool + 5 + idiv nPoolCol * 32) and261 ( x < xPool + 3 + 36 + imod nPoolCol * 42) and262 ( y < yPool + 6 + 20 + idiv nPoolCol * 32) then254 Exit; 255 end; 256 I := (X - xPool) div 42 + (Y - yPool) div 32 * nPoolCol; 257 if (I < nPool) and (X > xPool + 2 + I mod nPoolCol * 42) and 258 (Y > yPool + 5 + I div nPoolCol * 32) and 259 (X < xPool + 3 + 36 + I mod nPoolCol * 42) and 260 (Y < yPool + 6 + 20 + I div nPoolCol * 32) then 263 261 begin 264 262 if ssShift in Shift then 265 HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp, Pooliix[i])263 MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, Pooliix[I]) 266 264 else 267 265 begin 268 dragiix := Pooliix[ i];266 dragiix := Pooliix[I]; 269 267 DpiScreen.Cursor := crImpDrag; 270 268 SmartUpdateContent; 271 269 end; 272 exit;273 end; 274 i := (x- xSwitch) div 42;275 if ( i < nCityType) and (x > xSwitch + 2 + i* 42) and276 ( x < xSwitch + 3 + 36 + i * 42) and (y >= ySwitch + 2) and (y< ySwitch + 22)270 Exit; 271 end; 272 I := (X - xSwitch) div 42; 273 if (I < nCityType) and (X > xSwitch + 2 + I * 42) and 274 (X < xSwitch + 3 + 36 + I * 42) and (Y >= ySwitch + 2) and (Y < ySwitch + 22) 277 275 then 278 276 begin 279 277 SaveType; 280 LoadType( i);278 LoadType(I); 281 279 SmartUpdateContent; 282 280 end; … … 284 282 285 283 procedure TCityTypeDlg.PaintBox1MouseUp(Sender: TObject; Button: TMouseButton; 286 Shift: TShiftState; x, y: integer);287 288 procedure UnList(iix: integer);284 Shift: TShiftState; X, Y: Integer); 285 286 procedure UnList(iix: Integer); 289 287 var 290 i: integer;291 begin 292 i:= 0;293 while (MyData.ImpOrder[ctype, i] >= 0) and294 (MyData.ImpOrder[ctype, i] <> iix) do295 inc(i);296 assert(MyData.ImpOrder[ctype, i] = iix);297 move(MyData.ImpOrder[ctype, i + 1], MyData.ImpOrder[ctype, i], nImp - i);288 I: Integer; 289 begin 290 I := 0; 291 while (MyData.ImpOrder[ctype, I] >= 0) and 292 (MyData.ImpOrder[ctype, I] <> iix) do 293 Inc(I); 294 Assert(MyData.ImpOrder[ctype, I] = iix); 295 Move(MyData.ImpOrder[ctype, I + 1], MyData.ImpOrder[ctype, I], nImp - I); 298 296 Exclude(listed, iix); 299 297 end; 300 298 301 299 var 302 i: integer;303 begin 304 x := x- SideFrame;305 y := y- WideFrame;300 I: Integer; 301 begin 302 X := X - SideFrame; 303 Y := Y - WideFrame; 306 304 if dragiix >= 0 then 307 305 begin 308 if ( x >= xList) and (x < xList + nListCol * 42) and (y>= yList) and309 ( y< yList + nListRow * 32) then306 if (X >= xList) and (X < xList + nListCol * 42) and (Y >= yList) and 307 (Y < yList + nListRow * 32) then 310 308 begin 311 309 if dragiix in listed then 312 310 UnList(dragiix); 313 i := (x - xList) div 42 + (y- yList) div 32 * nListCol;314 while ( i > 0) and (MyData.ImpOrder[ctype, i- 1] < 0) do315 dec(i);316 move(MyData.ImpOrder[ctype, i], MyData.ImpOrder[ctype, i+ 1],317 nImp - i- 1);318 MyData.ImpOrder[ctype, i] := dragiix;319 include(listed, dragiix);320 Changed := true;311 I := (X - xList) div 42 + (Y - yList) div 32 * nListCol; 312 while (I > 0) and (MyData.ImpOrder[ctype, I - 1] < 0) do 313 Dec(I); 314 Move(MyData.ImpOrder[ctype, I], MyData.ImpOrder[ctype, I + 1], 315 nImp - I - 1); 316 MyData.ImpOrder[ctype, I] := dragiix; 317 Include(listed, dragiix); 318 Changed := True; 321 319 end 322 else if (dragiix in listed) and ( x >= xPool) and (x< xPool + nPoolCol * 42)323 and ( y >= yPool) and (y< yPool + nPoolRow * 32) then320 else if (dragiix in listed) and (X >= xPool) and (X < xPool + nPoolCol * 42) 321 and (Y >= yPool) and (Y < yPool + nPoolRow * 32) then 324 322 begin 325 323 UnList(dragiix); 326 Changed := true;324 Changed := True; 327 325 end; 328 326 dragiix := -1; … … 340 338 procedure TCityTypeDlg.DeleteBtnClick(Sender: TObject); 341 339 begin 342 fillchar(MyData.ImpOrder[ctype], sizeof(MyData.ImpOrder[ctype]), Byte(-1));340 FillChar(MyData.ImpOrder[ctype], SizeOf(MyData.ImpOrder[ctype]), Byte(-1)); 343 341 listed := []; 344 Changed := true;342 Changed := True; 345 343 SmartUpdateContent; 346 344 end; -
branches/highdpi/LocalPlayer/ClientTools.pas
r405 r465 9 9 const 10 10 nOfferedResourceWeights = 6; 11 OfferedResourceWeights: array [0 .. nOfferedResourceWeights - 1] of cardinal =11 OfferedResourceWeights: array [0 .. nOfferedResourceWeights - 1] of Cardinal = 12 12 (rwOff, rwMaxScience, rwForceScience, rwMaxGrowth, rwForceProd, rwMaxProd); 13 13 14 14 type 15 TImpOrder = array [0 .. (nImp + 4) div 4 * 4 - 1] of shortint;16 TEnhancementJobs = array [0 .. 11, 0 .. 7] of byte;15 TImpOrder = array [0 .. (nImp + 4) div 4 * 4 - 1] of ShortInt; 16 TEnhancementJobs = array [0 .. 11, 0 .. 7] of Byte; 17 17 JobResultSet = set of 0 .. 39; 18 18 … … 36 36 Server: TServerCall; 37 37 G: TNewGameData; 38 me: integer;38 Me: Integer; 39 39 MyRO: ^TPlayerContext; 40 40 MyMap: ^TTileList; … … 43 43 MyModel: ^TModelList; 44 44 45 AdvValue: array [0 .. nAdv - 1] of integer;46 47 function dLoc(Loc, dx, dy: integer): integer;48 function Distance(Loc0, Loc1: integer): integer;49 function UnrestAtLoc(uix, Loc: integer): boolean;50 function GetMoveAdvice(uix, ToLoc: integer;51 var MoveAdviceData: TMoveAdviceData): integer;52 function ColorOfHealth(Health: integer): integer;53 function IsMultiPlayerGame: boolean;54 procedure ItsMeAgain( p: integer);55 function GetAge( p: integer): integer;56 function IsCivilReportNew(Enemy: integer): boolean;57 function IsMilReportNew(Enemy: integer): boolean;58 function CutCityFoodSurplus(FoodSurplus: integer; IsCityAlive: boolean;59 gov, size: integer): integer;60 function CityTaxBalance(cix: integer; const CityReport: TCityReportNew): integer;61 procedure SumCities(var TaxSum, ScienceSum: integer);62 function JobTest(uix, Job: integer; IgnoreResults: JobResultSet = []): boolean;63 procedure GetUnitInfo(Loc: integer; var uix: integer; var UnitInfo: TUnitInfo);64 procedure GetCityInfo(Loc: integer; var cix: integer; var CityInfo: TCityInfo);65 function UnitExhausted(uix: integer): boolean;66 function ModelHash(const ModelInfo: TModelInfo): integer;67 function ProcessEnhancement(uix: integer; const Jobs: TEnhancementJobs): integer;68 function AutoBuild(cix: integer; const ImpOrder: TImpOrder): boolean;69 procedure DebugMessage(Level: integer; Text: string);45 AdvValue: array [0 .. nAdv - 1] of Integer; 46 47 function dLoc(Loc, dx, dy: Integer): Integer; 48 function Distance(Loc0, Loc1: Integer): Integer; 49 function UnrestAtLoc(uix, Loc: Integer): Boolean; 50 function GetMoveAdvice(uix, ToLoc: Integer; 51 var MoveAdviceData: TMoveAdviceData): Integer; 52 function ColorOfHealth(Health: Integer): Integer; 53 function IsMultiPlayerGame: Boolean; 54 procedure ItsMeAgain(P: Integer); 55 function GetAge(P: Integer): Integer; 56 function IsCivilReportNew(Enemy: Integer): Boolean; 57 function IsMilReportNew(Enemy: Integer): Boolean; 58 function CutCityFoodSurplus(FoodSurplus: Integer; IsCityAlive: Boolean; 59 gov, size: Integer): Integer; 60 function CityTaxBalance(cix: Integer; const CityReport: TCityReportNew): Integer; 61 procedure SumCities(var TaxSum, ScienceSum: Integer); 62 function JobTest(uix, Job: Integer; IgnoreResults: JobResultSet = []): Boolean; 63 procedure GetUnitInfo(Loc: Integer; var uix: Integer; var UnitInfo: TUnitInfo); 64 procedure GetCityInfo(Loc: Integer; var cix: Integer; var CityInfo: TCityInfo); 65 function UnitExhausted(uix: Integer): Boolean; 66 function ModelHash(const ModelInfo: TModelInfo): Integer; 67 function ProcessEnhancement(uix: Integer; const Jobs: TEnhancementJobs): Integer; 68 function AutoBuild(cix: Integer; const ImpOrder: TImpOrder): Boolean; 69 procedure DebugMessage(Level: Integer; Text: string); 70 70 procedure CityOptimizer_BeginOfTurn; 71 procedure CityOptimizer_CityChange(cix: integer);72 procedure CityOptimizer_TileBecomesAvailable(Loc: integer);73 procedure CityOptimizer_ReleaseCityTiles(cix, ReleasedTiles: integer);74 procedure CityOptimizer_BeforeRemoveUnit(uix: integer);71 procedure CityOptimizer_CityChange(cix: Integer); 72 procedure CityOptimizer_TileBecomesAvailable(Loc: Integer); 73 procedure CityOptimizer_ReleaseCityTiles(cix, ReleasedTiles: Integer); 74 procedure CityOptimizer_BeforeRemoveUnit(uix: Integer); 75 75 procedure CityOptimizer_AfterRemoveUnit; 76 76 procedure CityOptimizer_EndOfTurn; … … 84 84 85 85 var 86 CityNeedsOptimize: array [0 .. ncmax - 1] of boolean;87 88 function dLoc(Loc, dx, dy: integer): integer;89 var 90 y0: integer;86 CityNeedsOptimize: array [0 .. ncmax - 1] of Boolean; 87 88 function dLoc(Loc, dx, dy: Integer): Integer; 89 var 90 y0: Integer; 91 91 begin 92 92 y0 := (Loc + G.lx * 1024) div G.lx - 1024; … … 94 94 end; 95 95 96 function Distance(Loc0, Loc1: integer): integer;97 var 98 dx, dy: integer;96 function Distance(Loc0, Loc1: Integer): Integer; 97 var 98 dx, dy: Integer; 99 99 begin 100 100 Inc(Loc0, G.lx * 1024); … … 106 106 end; 107 107 108 function UnrestAtLoc(uix, Loc: integer): boolean;109 var 110 uix1: integer;108 function UnrestAtLoc(uix, Loc: Integer): Boolean; 109 var 110 uix1: Integer; 111 111 begin 112 112 Result := False; … … 114 114 case MyRO.Government of 115 115 gRepublic, gFuture: 116 Result := (MyRO.Territory[Loc] >= 0) and (MyRO.Territory[Loc] <> me) and116 Result := (MyRO.Territory[Loc] >= 0) and (MyRO.Territory[Loc] <> Me) and 117 117 (MyRO.Treaty[MyRO.Territory[Loc]] < trAlliance); 118 118 gDemocracy: 119 Result := (MyRO.Territory[Loc] < 0) or (MyRO.Territory[Loc] <> me) and119 Result := (MyRO.Territory[Loc] < 0) or (MyRO.Territory[Loc] <> Me) and 120 120 (MyRO.Treaty[MyRO.Territory[Loc]] < trAlliance); 121 121 end; … … 127 127 end; 128 128 129 function GetMoveAdvice(uix, ToLoc: integer;130 var MoveAdviceData: TMoveAdviceData): integer;131 var 132 MinEndHealth: integer;129 function GetMoveAdvice(uix, ToLoc: Integer; 130 var MoveAdviceData: TMoveAdviceData): Integer; 131 var 132 MinEndHealth: Integer; 133 133 begin 134 134 if MyModel[MyUn[uix].mix].Domain = dGround then … … 142 142 MoveAdviceData.MoreTurns := 999; 143 143 MoveAdviceData.MaxHostile_MovementLeft := MyUn[uix].Health - MinEndHealth; 144 Result := Server(sGetMoveAdvice, me, uix, MoveAdviceData);144 Result := Server(sGetMoveAdvice, Me, uix, MoveAdviceData); 145 145 if (MinEndHealth <= 1) or (Result <> eNoWay) then 146 exit;146 Exit; 147 147 end; 148 148 case MinEndHealth of … … 159 159 end; 160 160 161 function ColorOfHealth(Health: integer): integer;162 var 163 red, green: integer;164 begin 165 green := 400 * Health div 100;166 if green > 200 then167 green := 200;168 red := 510 * (100 - Health) div 100;169 if red > 255 then170 red := 255;171 Result := green shl 8 + red;172 end; 173 174 function IsMultiPlayerGame: boolean;175 var 176 p1: integer;161 function ColorOfHealth(Health: Integer): Integer; 162 var 163 Red, Green: Integer; 164 begin 165 Green := 400 * Health div 100; 166 if Green > 200 then 167 Green := 200; 168 Red := 510 * (100 - Health) div 100; 169 if Red > 255 then 170 Red := 255; 171 Result := Green shl 8 + Red; 172 end; 173 174 function IsMultiPlayerGame: Boolean; 175 var 176 p1: Integer; 177 177 begin 178 178 Result := False; … … 182 182 end; 183 183 184 procedure ItsMeAgain( p: integer);185 begin 186 if G.RO[ p] <> nil then187 MyRO := pointer(G.RO[p])188 else if G.SuperVisorRO[ p] <> nil then189 MyRO := pointer(G.SuperVisorRO[p])184 procedure ItsMeAgain(P: Integer); 185 begin 186 if G.RO[P] <> nil then 187 MyRO := Pointer(G.RO[P]) 188 else if G.SuperVisorRO[P] <> nil then 189 MyRO := Pointer(G.SuperVisorRO[P]) 190 190 else 191 exit;192 me := p;193 MyMap := pointer(MyRO.Map);194 MyUn := pointer(MyRO.Un);195 MyCity := pointer(MyRO.City);196 MyModel := pointer(MyRO.Model);197 end; 198 199 function GetAge( p: integer): integer;200 var 201 i: integer;202 begin 203 if p = me then begin191 Exit; 192 Me := P; 193 MyMap := Pointer(MyRO.Map); 194 MyUn := Pointer(MyRO.Un); 195 MyCity := Pointer(MyRO.City); 196 MyModel := Pointer(MyRO.Model); 197 end; 198 199 function GetAge(P: Integer): Integer; 200 var 201 I: Integer; 202 begin 203 if P = Me then begin 204 204 Result := 0; 205 for i:= 1 to 3 do206 if MyRO.Tech[AgePreq[ i]] >= tsApplicable then207 Result := i;205 for I := 1 to 3 do 206 if MyRO.Tech[AgePreq[I]] >= tsApplicable then 207 Result := I; 208 208 end else begin 209 209 Result := 0; 210 for i:= 1 to 3 do211 if MyRO.EnemyReport[ p].Tech[AgePreq[i]] >= tsApplicable then212 Result := i;213 end; 214 end; 215 216 function IsCivilReportNew(Enemy: integer): boolean;217 var 218 i: integer;219 begin 220 assert(Enemy <> me);221 i:= MyRO.EnemyReport[Enemy].TurnOfCivilReport;222 Result := ( i = MyRO.Turn) or (i = MyRO.Turn - 1) and (Enemy > me);223 end; 224 225 function IsMilReportNew(Enemy: integer): boolean;226 var 227 i: integer;228 begin 229 assert(Enemy <> me);230 i:= MyRO.EnemyReport[Enemy].TurnOfMilReport;231 Result := ( i = MyRO.Turn) or (i = MyRO.Turn - 1) and (Enemy > me);232 end; 233 234 function CutCityFoodSurplus(FoodSurplus: integer; IsCityAlive: boolean;235 gov, size: integer): integer;210 for I := 1 to 3 do 211 if MyRO.EnemyReport[P].Tech[AgePreq[I]] >= tsApplicable then 212 Result := I; 213 end; 214 end; 215 216 function IsCivilReportNew(Enemy: Integer): Boolean; 217 var 218 I: Integer; 219 begin 220 Assert(Enemy <> Me); 221 I := MyRO.EnemyReport[Enemy].TurnOfCivilReport; 222 Result := (I = MyRO.Turn) or (I = MyRO.Turn - 1) and (Enemy > Me); 223 end; 224 225 function IsMilReportNew(Enemy: Integer): Boolean; 226 var 227 I: Integer; 228 begin 229 Assert(Enemy <> Me); 230 I := MyRO.EnemyReport[Enemy].TurnOfMilReport; 231 Result := (I = MyRO.Turn) or (I = MyRO.Turn - 1) and (Enemy > Me); 232 end; 233 234 function CutCityFoodSurplus(FoodSurplus: Integer; IsCityAlive: Boolean; 235 gov, size: Integer): Integer; 236 236 begin 237 237 Result := FoodSurplus; … … 241 241 end; 242 242 243 function CityTaxBalance(cix: integer; const CityReport: TCityReportNew): integer;244 var 245 i: integer;243 function CityTaxBalance(cix: Integer; const CityReport: TCityReportNew): Integer; 244 var 245 I: Integer; 246 246 begin 247 247 Result := 0; … … 258 258 Inc(Result, CityReport.FoodSurplus); 259 259 end; 260 for i:= nWonder to nImp - 1 do261 if MyCity[cix].Built[ i] > 0 then262 Dec(Result, Imp[ i].Maint);263 end; 264 265 procedure SumCities(var TaxSum, ScienceSum: integer);266 var 267 cix: integer;260 for I := nWonder to nImp - 1 do 261 if MyCity[cix].Built[I] > 0 then 262 Dec(Result, Imp[I].Maint); 263 end; 264 265 procedure SumCities(var TaxSum, ScienceSum: Integer); 266 var 267 cix: Integer; 268 268 CityReport: TCityReportNew; 269 269 begin … … 271 271 ScienceSum := 0; 272 272 if MyRO.Government = gAnarchy then 273 exit;273 Exit; 274 274 for cix := 0 to MyRO.nCity - 1 do 275 275 if MyCity[cix].Loc >= 0 then … … 278 278 CityReport.HypoTaxRate := -1; 279 279 CityReport.HypoLuxuryRate := -1; 280 Server(sGetCityReportNew, me, cix, CityReport);280 Server(sGetCityReportNew, Me, cix, CityReport); 281 281 if (CityReport.HappinessBalance >= 0) { no disorder } and 282 282 (MyCity[cix].Flags and chCaptured = 0) then // not captured … … 286 286 end; 287 287 288 function JobTest(uix, Job: integer; IgnoreResults: JobResultSet): boolean;289 var 290 Test: integer;291 begin 292 Test := Server(sStartJob + Job shl 4 - sExecute, me, uix, nil^);288 function JobTest(uix, Job: Integer; IgnoreResults: JobResultSet): Boolean; 289 var 290 Test: Integer; 291 begin 292 Test := Server(sStartJob + Job shl 4 - sExecute, Me, uix, nil^); 293 293 Result := (Test >= rExecuted) or (Test in IgnoreResults); 294 294 end; 295 295 296 procedure GetUnitInfo(Loc: integer; var uix: integer; var UnitInfo: TUnitInfo);297 var 298 i, Cnt: integer;296 procedure GetUnitInfo(Loc: Integer; var uix: Integer; var UnitInfo: TUnitInfo); 297 var 298 I, Cnt: Integer; 299 299 begin 300 300 if MyMap[Loc] and fOwned <> 0 then 301 301 begin 302 Server(sGetDefender, me, Loc, uix);302 Server(sGetDefender, Me, Loc, uix); 303 303 Cnt := 0; 304 for i:= 0 to MyRO.nUn - 1 do305 if MyUn[ i].Loc = Loc then304 for I := 0 to MyRO.nUn - 1 do 305 if MyUn[I].Loc = Loc then 306 306 Inc(Cnt); 307 MakeUnitInfo( me, MyUn[uix], UnitInfo);307 MakeUnitInfo(Me, MyUn[uix], UnitInfo); 308 308 if Cnt > 1 then 309 309 UnitInfo.Flags := UnitInfo.Flags or unMulti; … … 316 316 UnitInfo := MyRO.EnemyUn[uix]; 317 317 end; 318 end; { GetUnitInfo }319 320 procedure GetCityInfo(Loc: integer; var cix: integer; var CityInfo: TCityInfo);318 end; 319 320 procedure GetCityInfo(Loc: Integer; var cix: Integer; var CityInfo: TCityInfo); 321 321 begin 322 322 if MyMap[Loc] and fOwned <> 0 then … … 328 328 with CityInfo do 329 329 begin 330 Owner := me;330 Owner := Me; 331 331 ID := MyCity[cix].ID; 332 332 size := MyCity[cix].size; … … 356 356 end; 357 357 358 function UnitExhausted(uix: integer): boolean;358 function UnitExhausted(uix: Integer): Boolean; 359 359 // check if another move of this unit is still possible 360 360 var 361 dx, dy: integer;361 dx, dy: Integer; 362 362 begin 363 363 Result := True; 364 364 if (MyUn[uix].Movement > 0) or 365 (MyRO.Wonder[woShinkansen].EffectiveOwner = me) then365 (MyRO.Wonder[woShinkansen].EffectiveOwner = Me) then 366 366 if (MyUn[uix].Movement >= 100) or 367 367 ((MyModel[MyUn[uix].mix].Kind = mkCaravan) and … … 373 373 if abs(dx) + abs(dy) = 2 then 374 374 if Server(sMoveUnit - sExecute + dx and 7 shl 4 + dy and 375 7 shl 7, me, uix, nil^) >= rExecuted then375 7 shl 7, Me, uix, nil^) >= rExecuted then 376 376 Result := False; 377 377 end; 378 378 379 function ModelHash(const ModelInfo: TModelInfo): integer;380 var 381 i, FeatureCode, Hash1, Hash2, Hash2r, d: cardinal;379 function ModelHash(const ModelInfo: TModelInfo): Integer; 380 var 381 I, FeatureCode, Hash1, Hash2, Hash2r, D: Cardinal; 382 382 begin 383 383 with ModelInfo do 384 384 if Kind > mkEnemyDeveloped then 385 Result := integer($C0000000 + Speed div 50 + Kind shl 8)385 Result := Integer($C0000000 + Speed div 50 + Kind shl 8) 386 386 else 387 387 begin 388 388 FeatureCode := 0; 389 for i:= mcFirstNonCap to nFeature - 1 do390 if 1 shl Domain and Feature[ i].Domains <> 0 then389 for I := mcFirstNonCap to nFeature - 1 do 390 if 1 shl Domain and Feature[I].Domains <> 0 then 391 391 begin 392 392 FeatureCode := FeatureCode * 2; 393 if 1 shl ( i- mcFirstNonCap) <> 0 then393 if 1 shl (I - mcFirstNonCap) <> 0 then 394 394 Inc(FeatureCode); 395 395 end; … … 397 397 dGround: 398 398 begin 399 assert(FeatureCode < 1 shl 8);400 assert(Attack < 5113);401 assert(Defense < 2273);402 assert(Cost < 1611);399 Assert(FeatureCode < 1 shl 8); 400 Assert(Attack < 5113); 401 Assert(Defense < 2273); 402 Assert(Cost < 1611); 403 403 Hash1 := (Attack * 2273 + Defense) * 9 + (Speed - 150) div 50; 404 404 Hash2 := FeatureCode * 1611 + Cost; … … 406 406 dSea: 407 407 begin 408 assert(FeatureCode < 1 shl 9);409 assert(Attack < 12193);410 assert(Defense < 6097);411 assert(Cost < 4381);408 Assert(FeatureCode < 1 shl 9); 409 Assert(Attack < 12193); 410 Assert(Defense < 6097); 411 Assert(Cost < 4381); 412 412 Hash1 := ((Attack * 6097 + Defense) * 5 + 413 413 (Speed - 350) div 100) * 2; … … 419 419 dAir: 420 420 begin 421 assert(FeatureCode < 1 shl 5);422 assert(Attack < 2407);423 assert(Defense < 1605);424 assert(Bombs < 4813);425 assert(Cost < 2089);421 Assert(FeatureCode < 1 shl 5); 422 Assert(Attack < 2407); 423 Assert(Defense < 1605); 424 Assert(Bombs < 4813); 425 Assert(Cost < 2089); 426 426 Hash1 := (Attack * 1605 + Defense) shl 5 + FeatureCode; 427 427 Hash2 := ((Bombs * 7 + ATrans_Fuel) * 4 + TTrans) * 2089 + Cost; … … 429 429 end; 430 430 Hash2r := 0; 431 for i:= 0 to 7 do431 for I := 0 to 7 do 432 432 begin 433 433 Hash2r := Hash2r * 13; 434 d:= Hash2 div 13;435 Inc(Hash2r, Hash2 - d* 13);436 Hash2 := d;434 D := Hash2 div 13; 435 Inc(Hash2r, Hash2 - D * 13); 436 Hash2 := D; 437 437 end; 438 Result := integer(Domain shl 30 + Hash1 xor Hash2r);438 Result := Integer(Domain shl 30 + Hash1 xor Hash2r); 439 439 end; 440 440 end; 441 441 442 function ProcessEnhancement(uix: integer; const Jobs: TEnhancementJobs): integer;442 function ProcessEnhancement(uix: Integer; const Jobs: TEnhancementJobs): Integer; 443 443 { return values: 444 444 eJobDone - all applicable jobs done … … 446 446 eDied - job done and died (thurst) } 447 447 var 448 stage, NextJob, Tile: integer;448 stage, NextJob, Tile: Integer; 449 449 Done: set of jNone .. jPoll; 450 450 begin … … 452 452 Tile := MyMap[MyUn[uix].Loc]; 453 453 if Tile and fRoad <> 0 then 454 include(Done, jRoad);454 Include(Done, jRoad); 455 455 if Tile and fRR <> 0 then 456 include(Done, jRR);456 Include(Done, jRR); 457 457 if (Tile and fTerImp = tiIrrigation) or (Tile and fTerImp = tiFarm) then 458 include(Done, jIrr);458 Include(Done, jIrr); 459 459 if Tile and fTerImp = tiFarm then 460 include(Done, jFarm);460 Include(Done, jFarm); 461 461 if Tile and fTerImp = tiMine then 462 include(Done, jMine);462 Include(Done, jMine); 463 463 if Tile and fPoll = 0 then 464 include(Done, jPoll);464 Include(Done, jPoll); 465 465 466 466 if MyUn[uix].Job = jNone then … … 485 485 Break; 486 486 end; // tile enhancement complete 487 Result := Server(sStartJob + NextJob shl 4, me, uix, nil^);488 include(Done, NextJob);489 end; 490 end; 491 492 function AutoBuild(cix: integer; const ImpOrder: TImpOrder): boolean;493 var 494 i, NewProject: integer;487 Result := Server(sStartJob + NextJob shl 4, Me, uix, nil^); 488 Include(Done, NextJob); 489 end; 490 end; 491 492 function AutoBuild(cix: Integer; const ImpOrder: TImpOrder): Boolean; 493 var 494 I, NewProject: Integer; 495 495 begin 496 496 Result := False; … … 498 498 (MyCity[cix].Flags and chProduction <> 0) then 499 499 begin 500 i:= 0;500 I := 0; 501 501 repeat 502 while (ImpOrder[ i] >= 0) and (MyCity[cix].Built[ImpOrder[i]] > 0) do503 Inc( i);504 if ImpOrder[ i] < 0 then502 while (ImpOrder[I] >= 0) and (MyCity[cix].Built[ImpOrder[I]] > 0) do 503 Inc(I); 504 if ImpOrder[I] < 0 then 505 505 Break; 506 assert(i< nImp);507 NewProject := cpImp + ImpOrder[ i];508 if Server(sSetCityProject, me, cix, NewProject) >= rExecuted then506 Assert(I < nImp); 507 NewProject := cpImp + ImpOrder[I]; 508 if Server(sSetCityProject, Me, cix, NewProject) >= rExecuted then 509 509 begin 510 510 Result := True; … … 512 512 Break; 513 513 end; 514 Inc( i);514 Inc(I); 515 515 until False; 516 516 end; … … 519 519 procedure CalculateAdvValues; 520 520 var 521 i, j: integer;522 known: array [0 .. nAdv - 1] of integer;523 524 procedure MarkPreqs( i: integer);525 begin 526 if known[ i] = 0 then521 I, J: Integer; 522 known: array [0 .. nAdv - 1] of Integer; 523 524 procedure MarkPreqs(I: Integer); 525 begin 526 if known[I] = 0 then 527 527 begin 528 known[ i] := 1;529 if ( i <> adScience) and (i<> adMassProduction) then528 known[I] := 1; 529 if (I <> adScience) and (I <> adMassProduction) then 530 530 begin 531 if (AdvPreq[ i, 0] >= 0) then532 MarkPreqs(AdvPreq[ i, 0]);533 if (AdvPreq[ i, 1] >= 0) then534 MarkPreqs(AdvPreq[ i, 1]);531 if (AdvPreq[I, 0] >= 0) then 532 MarkPreqs(AdvPreq[I, 0]); 533 if (AdvPreq[I, 1] >= 0) then 534 MarkPreqs(AdvPreq[I, 1]); 535 535 end; 536 536 end; … … 539 539 begin 540 540 FillChar(AdvValue, SizeOf(AdvValue), 0); 541 for i:= 0 to nAdv - 1 do541 for I := 0 to nAdv - 1 do 542 542 begin 543 543 FillChar(known, SizeOf(known), 0); 544 MarkPreqs( i);545 for j:= 0 to nAdv - 1 do546 if known[ j] > 0 then547 Inc(AdvValue[ i]);548 if iin FutureTech then549 Inc(AdvValue[ i], 3000)544 MarkPreqs(I); 545 for J := 0 to nAdv - 1 do 546 if known[J] > 0 then 547 Inc(AdvValue[I]); 548 if I in FutureTech then 549 Inc(AdvValue[I], 3000) 550 550 else if known[adMassProduction] > 0 then 551 Inc(AdvValue[ i], 2000)551 Inc(AdvValue[I], 2000) 552 552 else if known[adScience] > 0 then 553 Inc(AdvValue[ i], 1000);554 end; 555 end; 556 557 procedure DebugMessage(Level: integer; Text: string);558 begin 559 Server(sMessage, me, Level, PChar(Text)^);560 end; 561 562 function MarkCitiesAround(Loc, cixExcept: integer): boolean;553 Inc(AdvValue[I], 1000); 554 end; 555 end; 556 557 procedure DebugMessage(Level: Integer; Text: string); 558 begin 559 Server(sMessage, Me, Level, PChar(Text)^); 560 end; 561 562 function MarkCitiesAround(Loc, cixExcept: Integer): Boolean; 563 563 // return whether a city was marked 564 564 var 565 cix: integer;565 cix: Integer; 566 566 begin 567 567 Result := False; … … 576 576 end; 577 577 578 procedure OptimizeCities(CheckOnly: boolean);579 var 580 cix, fix, dx, dy, Loc1, OptiType: integer;581 Done: boolean;578 procedure OptimizeCities(CheckOnly: Boolean); 579 var 580 cix, fix, dx, dy, Loc1, OptiType: Integer; 581 Done: Boolean; 582 582 Advice: TCityTileAdviceData; 583 583 begin … … 591 591 begin 592 592 Advice.ResourceWeights := OfferedResourceWeights[OptiType]; 593 Server(sGetCityTileAdvice, me, cix, Advice);593 Server(sGetCityTileAdvice, Me, cix, Advice); 594 594 if Advice.Tiles <> MyCity[cix].Tiles then 595 595 if CheckOnly then … … 611 611 Done := False; 612 612 end; 613 Server(sSetCityTiles, me, cix, Advice.Tiles);613 Server(sSetCityTiles, Me, cix, Advice.Tiles); 614 614 end; 615 615 end; … … 621 621 procedure CityOptimizer_BeginOfTurn; 622 622 var 623 cix: integer;623 cix: Integer; 624 624 begin 625 625 FillChar(CityNeedsOptimize, MyRO.nCity - 1, 0); // false … … 634 634 end; 635 635 636 procedure CityOptimizer_CityChange(cix: integer);636 procedure CityOptimizer_CityChange(cix: Integer); 637 637 begin 638 638 if (MyRO.Government <> gAnarchy) and (cix <> -1) and (MyCity[cix].Flags and … … 644 644 end; 645 645 646 procedure CityOptimizer_TileBecomesAvailable(Loc: integer);646 procedure CityOptimizer_TileBecomesAvailable(Loc: Integer); 647 647 begin 648 648 if (MyRO.Government <> gAnarchy) and MarkCitiesAround(Loc, -1) then … … 650 650 end; 651 651 652 procedure CityOptimizer_ReleaseCityTiles(cix, ReleasedTiles: integer);653 var 654 fix, dx, dy, Loc1: integer;655 Done: boolean;652 procedure CityOptimizer_ReleaseCityTiles(cix, ReleasedTiles: Integer); 653 var 654 fix, dx, dy, Loc1: Integer; 655 Done: Boolean; 656 656 begin 657 657 if (MyRO.Government <> gAnarchy) and (ReleasedTiles <> 0) then … … 672 672 end; 673 673 674 procedure CityOptimizer_BeforeRemoveUnit(uix: integer);675 var 676 uix1: integer;674 procedure CityOptimizer_BeforeRemoveUnit(uix: Integer); 675 var 676 uix1: Integer; 677 677 begin 678 678 if MyRO.Government <> gAnarchy then … … 698 698 // all cities should already be optimized here -- only check this 699 699 var 700 cix: integer;700 cix: Integer; 701 701 begin 702 702 {$IFOPT O-} -
branches/highdpi/LocalPlayer/Diagram.pas
r361 r465 9 9 10 10 type 11 TDiagramKind = (dkChart, dkShip); 12 11 13 TDiaDlg = class(TFramedDlg) 12 14 CloseBtn: TButtonB; … … 19 21 procedure ToggleBtnClick(Sender: TObject); 20 22 procedure PlayerClick(Sender: TObject); 21 procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState); 22 23 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 23 24 public 24 25 procedure OffscreenPaint; override; 25 procedure ShowNewContent_Charts(NewMode: integer); 26 procedure ShowNewContent_Ship(NewMode: integer; p: integer = -1); 27 26 procedure ShowNewContent_Charts(NewMode: TWindowMode); 27 procedure ShowNewContent_Ship(NewMode: TWindowMode; P: Integer = -1); 28 28 private 29 Kind: (dkChart, dkShip); 30 Player, Mode: integer; 31 end; 32 33 var 34 DiaDlg: TDiaDlg; 35 36 procedure PaintColonyShip(canvas: TDpiCanvas; Player, Left, Width, Top: integer); 29 Kind: TDiagramKind; 30 Player: Integer; 31 Mode: Integer; 32 end; 33 34 procedure PaintColonyShip(Canvas: TDpiCanvas; Player, Left, Width, Top: Integer); 35 37 36 38 37 implementation … … 45 44 const 46 45 Border = 24; 47 RoundPixels: array [0 .. nStat - 1] of integer = (0, 0, 0, 5, 5, 5);46 RoundPixels: array [0 .. nStat - 1] of Integer = (0, 0, 0, 5, 5, 5); 48 47 49 48 yArea = 48; 50 xComp: array [0 .. 5] of integer = (-60, -28, 4, 4, 36, 68);51 yComp: array [0 .. 5] of integer = (-40, -40, -79, -1, -40, -40);52 xPow: array [0 .. 3] of integer = (-116, -116, -116, -116);53 yPow: array [0 .. 3] of integer = (-28, 0, -44, 16);54 xHab: array [0 .. 1] of integer = (23, 23);55 yHab: array [0 .. 1] of integer = (-81, 1);56 57 procedure PaintColonyShip( canvas: TDpiCanvas; Player, Left, Width, Top: integer);49 xComp: array [0 .. 5] of Integer = (-60, -28, 4, 4, 36, 68); 50 yComp: array [0 .. 5] of Integer = (-40, -40, -79, -1, -40, -40); 51 xPow: array [0 .. 3] of Integer = (-116, -116, -116, -116); 52 yPow: array [0 .. 3] of Integer = (-28, 0, -44, 16); 53 xHab: array [0 .. 1] of Integer = (23, 23); 54 yHab: array [0 .. 1] of Integer = (-81, 1); 55 56 procedure PaintColonyShip(Canvas: TDpiCanvas; Player, Left, Width, Top: Integer); 58 57 var 59 i, x, r, nComp, nPow, nHab: integer;58 I, X, R, nComp, nPow, nHab: Integer; 60 59 begin 61 60 Canvas.Brush.Color := $000000; 62 61 Canvas.FillRect(Rect(Left, Top, Left + Width, Top + 200)); 63 62 Canvas.Brush.Style := bsClear; 64 ScreenTools.Frame( canvas, Left - 1, Top - 1, Left + Width, Top + 200,63 ScreenTools.Frame(Canvas, Left - 1, Top - 1, Left + Width, Top + 200, 65 64 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 66 RFrame( canvas, Left - 2, Top - 2, Left + Width + 1, Top + 200 + 1,65 RFrame(Canvas, Left - 2, Top - 2, Left + Width + 1, Top + 200 + 1, 67 66 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 68 67 69 68 // stars 70 69 DelphiRandSeed := Player * 11111; 71 for i:= 1 to Width - 16 do70 for I := 1 to Width - 16 do 72 71 begin 73 x:= DelphiRandom((Width - 16) * 200);74 r:= DelphiRandom(13) + 28;75 Canvas.Pixels[ x div 200 + 8, xmod 200 + Top] :=76 ( r * r * r * rdiv 10001) * $10101;72 X := DelphiRandom((Width - 16) * 200); 73 R := DelphiRandom(13) + 28; 74 Canvas.Pixels[X div 200 + 8, X mod 200 + Top] := 75 (R * R * R * R div 10001) * $10101; 77 76 end; 78 77 … … 86 85 if nHab > 2 then 87 86 nHab := 2; 88 for i:= 0 to nHab - 1 do89 Sprite( canvas, HGrSystem2, Left + Width div 2 + xHab[i],90 Top + 100 + yHab[ i], 80, 80, 34, 1);91 for i:= 0 to nComp - 1 do92 Sprite( canvas, HGrSystem2, Left + Width div 2 + xComp[i],93 Top + 100 + yComp[ i], 32, 80, 1, 1);87 for I := 0 to nHab - 1 do 88 Sprite(Canvas, HGrSystem2, Left + Width div 2 + xHab[I], 89 Top + 100 + yHab[I], 80, 80, 34, 1); 90 for I := 0 to nComp - 1 do 91 Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[I], 92 Top + 100 + yComp[I], 32, 80, 1, 1); 94 93 if nComp > 0 then 95 for i:= 3 downto nPow do96 Sprite( canvas, HGrSystem2, Left + Width div 2 + xPow[i] + 40,97 Top + 100 + yPow[ i], 16, 27, 1, 82);98 for i:= nPow - 1 downto 0 do99 Sprite( canvas, HGrSystem2, Left + Width div 2 + xPow[i],100 Top + 100 + yPow[ i], 56, 28, 58, 82);94 for I := 3 downto nPow do 95 Sprite(Canvas, HGrSystem2, Left + Width div 2 + xPow[I] + 40, 96 Top + 100 + yPow[I], 16, 27, 1, 82); 97 for I := nPow - 1 downto 0 do 98 Sprite(Canvas, HGrSystem2, Left + Width div 2 + xPow[I], 99 Top + 100 + yPow[I], 56, 28, 58, 82); 101 100 if (nComp < 3) and (nHab >= 1) then 102 Sprite( canvas, HGrSystem2, Left + Width div 2 + xComp[2] + 32 - 16,101 Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[2] + 32 - 16, 103 102 Top + 100 + 7 + yComp[2], 16, 27, 1, 82); 104 103 if (nComp >= 3) and (nHab < 1) then 105 Sprite( canvas, HGrSystem2, Left + Width div 2 + xComp[2] + 32,104 Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[2] + 32, 106 105 Top + 100 + 7 + yComp[2], 16, 27, 18, 82); 107 106 if (nComp < 4) and (nHab >= 2) then 108 Sprite( canvas, HGrSystem2, Left + Width div 2 + xComp[3] + 32 - 16,107 Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[3] + 32 - 16, 109 108 Top + 100 + 46 + yComp[3], 16, 27, 1, 82); 110 109 if (nComp >= 4) and (nHab < 2) then 111 Sprite( canvas, HGrSystem2, Left + Width div 2 + xComp[3] + 32,110 Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[3] + 32, 112 111 Top + 100 + 46 + yComp[3], 16, 27, 18, 82); 113 112 if (nComp <> 6) and (nComp <> 2) and not((nComp = 0) and (nPow < 1)) then 114 Sprite( canvas, HGrSystem2, Left + Width div 2 + xComp[nComp],113 Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[nComp], 115 114 Top + 100 + 7 + yComp[nComp], 16, 27, 18, 82); 116 115 if (nComp <> 6) and (nComp <> 3) and not((nComp = 0) and (nPow < 2)) then 117 Sprite( canvas, HGrSystem2, Left + Width div 2 + xComp[nComp],116 Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[nComp], 118 117 Top + 100 + 46 + yComp[nComp], 16, 27, 18, 82); 119 118 if nComp = 2 then 120 Sprite( canvas, HGrSystem2, Left + Width div 2 + xComp[3],119 Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[3], 121 120 Top + 100 + 7 + yComp[3], 16, 27, 18, 82); 122 121 if nComp = 3 then 123 Sprite( canvas, HGrSystem2, Left + Width div 2 + xComp[4],122 Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[4], 124 123 Top + 100 + 7 + yComp[4], 16, 27, 18, 82); 125 124 end; … … 142 141 procedure TDiaDlg.OffscreenPaint; 143 142 var 144 p, T, max, x, y, y0, Stop, r, RoundRange, LineStep: integer;145 s: string;143 P, T, Max, X, Y, y0, Stop, R, RoundRange, LineStep: Integer; 144 S: string; 146 145 List: ^TChart; 147 146 148 function Round(T: integer): integer;147 function Round(T: Integer): Integer; 149 148 var 150 n, i: integer;149 N, I: Integer; 151 150 begin 152 151 if T < RoundRange then 153 n:= T152 N := T 154 153 else 155 n:= RoundRange;156 result := 0;157 for i := T - nto T do158 inc(result, List[i]);159 result := result div (n+ 1);160 end; 161 162 procedure ShareBar( x, y: integer; Cap: string; val0, val1: integer);163 begin 164 LoweredTextOut( offscreen.canvas, -1, MainTexture, x - 2, y, Cap);165 DLine( offscreen.canvas, x - 2, x + 169, y+ 16, MainTexture.ColorTextShade,154 N := RoundRange; 155 Result := 0; 156 for I := T - N to T do 157 Inc(Result, List[I]); 158 Result := Result div (N + 1); 159 end; 160 161 procedure ShareBar(X, Y: Integer; Cap: string; val0, val1: Integer); 162 begin 163 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, X - 2, Y, Cap); 164 DLine(Offscreen.Canvas, X - 2, X + 169, Y + 16, MainTexture.ColorTextShade, 166 165 MainTexture.ColorTextLight); 167 166 if val0 > 0 then 168 s:= Format(Phrases.Lookup('SHARE'), [val0, val1])167 S := Format(Phrases.Lookup('SHARE'), [val0, val1]) 169 168 else 170 s:= '0';171 RisedTextOut( offscreen.canvas,172 x + 170 - BiColorTextWidth(offscreen.canvas, s), y, s);169 S := '0'; 170 RisedTextOut(Offscreen.Canvas, 171 X + 170 - BiColorTextWidth(Offscreen.Canvas, S), Y, S); 173 172 end; 174 173 … … 176 175 inherited; 177 176 if Kind = dkChart then 178 with offscreen.canvas do177 with Offscreen.Canvas do 179 178 begin 180 179 Font.Assign(UniFont[ftTiny]); … … 186 185 GetMem(List, 4 * (MyRO.Turn + 2)); 187 186 if Mode = stExplore then 188 max := G.lx * G.ly187 Max := G.lx * G.ly 189 188 else 190 189 begin 191 max := -1;192 for p:= 0 to nPl - 1 do193 if (G.Difficulty[ p] > 0) and194 (Server(sGetChart + Mode shl 4, me, p, List^) >= rExecuted) then190 Max := -1; 191 for P := 0 to nPl - 1 do 192 if (G.Difficulty[P] > 0) and 193 (Server(sGetChart + Mode shl 4, Me, P, List^) >= rExecuted) then 195 194 for T := 0 to MyRO.Turn - 1 do 196 195 begin 197 r:= Round(T);198 if r > max then199 max := r;196 R := Round(T); 197 if R > Max then 198 Max := R; 200 199 end; 201 200 end; … … 215 214 for T := 0 to (MyRO.Turn - 1) div LineStep do 216 215 begin 217 x:= Border + (InnerWidth - 2 * Border) * T *216 X := Border + (InnerWidth - 2 * Border) * T * 218 217 LineStep div (MyRO.Turn - 1); 219 MoveTo( x, Border);220 LineTo( x, InnerHeight - Border);221 s:= IntToStr(abs(TurnToYear(T * LineStep)));222 Textout( x - TextWidth(s) div 2, Border - 16, s);218 MoveTo(X, Border); 219 LineTo(X, InnerHeight - Border); 220 S := IntToStr(abs(TurnToYear(T * LineStep))); 221 Textout(X - TextWidth(S) div 2, Border - 16, S); 223 222 end; 224 223 225 224 y0 := 0; 226 if max > 0 then225 if Max > 0 then 227 226 begin 228 for p:= 0 to nPl - 1 do229 if (G.Difficulty[ p] > 0) and230 (Server(sGetChart + Mode shl 4, me, p, List^) >= rExecuted) then227 for P := 0 to nPl - 1 do 228 if (G.Difficulty[P] > 0) and 229 (Server(sGetChart + Mode shl 4, Me, P, List^) >= rExecuted) then 231 230 begin 232 Pen.Color := Tribe[ p].Color;231 Pen.Color := Tribe[P].Color; 233 232 Stop := MyRO.Turn - 1; 234 233 while (Stop > 0) and (List[Stop] = 0) do 235 dec(Stop);234 Dec(Stop); 236 235 for T := 0 to Stop do 237 236 begin 238 r:= Round(T);239 x:= Border + (InnerWidth - 2 * Border) * T div (MyRO.Turn - 1);240 y:= InnerHeight - Border - (InnerHeight - 2 * Border) *241 r div max;237 R := Round(T); 238 X := Border + (InnerWidth - 2 * Border) * T div (MyRO.Turn - 1); 239 Y := InnerHeight - Border - (InnerHeight - 2 * Border) * 240 R div Max; 242 241 if T = 0 then 243 MoveTo( x, y)242 MoveTo(X, Y) 244 243 // else if Mode=stTerritory then 245 244 // begin LineTo(x,y0); LineTo(x,y) end 246 245 else if RoundPixels[Mode] = 0 then 247 246 begin 248 if ( y<> y0) or (T = Stop) then249 LineTo( x, y)247 if (Y <> y0) or (T = Stop) then 248 LineTo(X, Y) 250 249 end 251 250 else 252 LineTo( x, y);253 y0 := y;251 LineTo(X, Y); 252 y0 := Y; 254 253 end; 255 254 end; … … 258 257 end 259 258 else 260 with offscreen.canvas do259 with Offscreen.Canvas do 261 260 begin 262 261 Font.Assign(UniFont[ftSmall]); 263 262 FillOffscreen(0, 0, InnerWidth, InnerHeight); 264 263 265 PaintColonyShip( offscreen.canvas, Player, 8, InnerWidth - 16, yArea);264 PaintColonyShip(Offscreen.Canvas, Player, 8, InnerWidth - 16, yArea); 266 265 267 266 ShareBar(InnerWidth div 2 - 85, InnerHeight - 62, … … 273 272 end; 274 273 MarkUsedOffscreen(InnerWidth, InnerHeight); 275 end; // OffscreenPaint274 end; 276 275 277 276 procedure TDiaDlg.FormPaint(Sender: TObject); 278 277 var 279 s: string;278 S: string; 280 279 begin 281 280 inherited; 282 canvas.Font.Assign(UniFont[ftNormal]);281 Canvas.Font.Assign(UniFont[ftNormal]); 283 282 if Kind = dkChart then 284 s:= Phrases.Lookup('DIAGRAM', Mode)285 else 286 s:= Tribe[Player].TPhrase('SHORTNAME');287 LoweredTextOut( canvas, -1, MainTexture,288 (ClientWidth - BiColorTextWidth( canvas, s)) div 2, 31, s);283 S := Phrases.Lookup('DIAGRAM', Mode) 284 else 285 S := Tribe[Player].TPhrase('SHORTNAME'); 286 LoweredTextOut(Canvas, -1, MainTexture, 287 (ClientWidth - BiColorTextWidth(Canvas, S)) div 2, 31, S); 289 288 end; 290 289 … … 299 298 end; 300 299 301 procedure TDiaDlg.ShowNewContent_Charts(NewMode: integer);300 procedure TDiaDlg.ShowNewContent_Charts(NewMode: TWindowMode); 302 301 begin 303 302 Kind := dkChart; … … 309 308 end; 310 309 311 procedure TDiaDlg.ShowNewContent_Ship(NewMode , p: integer);310 procedure TDiaDlg.ShowNewContent_Ship(NewMode: TWindowMode; P: Integer); 312 311 begin 313 312 Kind := dkShip; 314 if p< 0 then315 begin 316 Player := me;313 if P < 0 then 314 begin 315 Player := Me; 317 316 while MyRO.Ship[Player].Parts[spComp] + MyRO.Ship[Player].Parts[spPow] + 318 317 MyRO.Ship[Player].Parts[spHab] = 0 do … … 320 319 end 321 320 else 322 Player := p;321 Player := P; 323 322 ToggleBtn.ButtonIndex := 28; 324 323 ToggleBtn.Hint := Phrases.Lookup('BTN_SELECT'); … … 329 328 procedure TDiaDlg.ToggleBtnClick(Sender: TObject); 330 329 var 331 p1: integer;332 m: TDpiMenuItem;330 p1: Integer; 331 M: TDpiMenuItem; 333 332 begin 334 333 if Kind = dkChart then … … 345 344 MyRO.Ship[p1].Parts[spHab] > 0 then 346 345 begin 347 m:= TDpiMenuItem.Create(Popup);348 m.RadioItem := true;349 m.Caption := Tribe[p1].TPhrase('SHORTNAME');350 m.Tag := p1;351 m.OnClick := PlayerClick;346 M := TDpiMenuItem.Create(Popup); 347 M.RadioItem := True; 348 M.Caption := Tribe[p1].TPhrase('SHORTNAME'); 349 M.Tag := p1; 350 M.OnClick := PlayerClick; 352 351 if p1 = Player then 353 m.Checked := true;354 Popup.Items.Add( m);352 M.Checked := True; 353 Popup.Items.Add(M); 355 354 end; 356 355 Popup.Popup(Left + ToggleBtn.Left, Top + ToggleBtn.Top + ToggleBtn.Height); … … 363 362 end; 364 363 365 procedure TDiaDlg.FormKeyDown(Sender: TObject; var Key: word;364 procedure TDiaDlg.FormKeyDown(Sender: TObject; var Key: Word; 366 365 Shift: TShiftState); 367 366 begin -
branches/highdpi/LocalPlayer/Diplomacy.pas
r210 r465 7 7 8 8 function DipCommandToString(pSender, pTarget, Treaty, OppCommand, 9 Command: integer; const OppOffer, Offer: TOffer): string;9 Command: Integer; const OppOffer, Offer: TOffer): string; 10 10 11 11 implementation … … 16 16 function DipCommandToString; 17 17 18 function PriceToString( p, Price: integer): string;18 function PriceToString(P, Price: Integer): string; 19 19 begin 20 20 case Price and opMask of 21 21 opChoose: 22 result := Phrases.Lookup('PRICE_CHOOSE');22 Result := Phrases.Lookup('PRICE_CHOOSE'); 23 23 opCivilReport: 24 result := Tribe[p].TPhrase('PRICE_CIVIL');24 Result := Tribe[P].TPhrase('PRICE_CIVIL'); 25 25 opMilReport: 26 result := Tribe[p].TPhrase('PRICE_MIL');26 Result := Tribe[P].TPhrase('PRICE_MIL'); 27 27 opMap: 28 result := Tribe[p].TPhrase('PRICE_MAP');28 Result := Tribe[P].TPhrase('PRICE_MAP'); 29 29 opTreaty: 30 30 { if Price-opTreaty<Treaty then 31 31 case Treaty of 32 trPeace: result:=Phrases.Lookup('FRENDTREATY_PEACE');33 trFriendlyContact: result:=Phrases.Lookup('FRENDTREATY_FRIENDLY');34 trAlliance: result:=Phrases.Lookup('FRENDTREATY_ALLIANCE');35 end 36 else } result := Phrases.Lookup('TREATY', Price - opTreaty);32 trPeace: Result:=Phrases.Lookup('FRENDTREATY_PEACE'); 33 trFriendlyContact: Result:=Phrases.Lookup('FRENDTREATY_FRIENDLY'); 34 trAlliance: Result:=Phrases.Lookup('FRENDTREATY_ALLIANCE'); 35 end 36 else } Result := Phrases.Lookup('TREATY', Price - opTreaty); 37 37 opShipParts: 38 38 case Price shr 16 and $F of 39 39 0: 40 result := Format(Phrases.Lookup('PRICE_SHIPCOMP'),40 Result := Format(Phrases.Lookup('PRICE_SHIPCOMP'), 41 41 [Price and $FFFF]); 42 42 1: 43 result := Format(Phrases.Lookup('PRICE_SHIPPOW'),43 Result := Format(Phrases.Lookup('PRICE_SHIPPOW'), 44 44 [Price and $FFFF]); 45 45 2: 46 result := Format(Phrases.Lookup('PRICE_SHIPHAB'),46 Result := Format(Phrases.Lookup('PRICE_SHIPHAB'), 47 47 [Price and $FFFF]); 48 48 end; 49 49 opMoney: 50 result := Format('%d%%c', [Price - opMoney]);50 Result := Format('%d%%c', [Price - opMoney]); 51 51 opTribute: 52 result := Format(Phrases.Lookup('PRICE_TRIBUTE'), [Price - opTribute]);52 Result := Format(Phrases.Lookup('PRICE_TRIBUTE'), [Price - opTribute]); 53 53 opTech: 54 result := Phrases.Lookup('ADVANCES', Price - opTech);54 Result := Phrases.Lookup('ADVANCES', Price - opTech); 55 55 opAllTech: 56 result := Tribe[p].TPhrase('PRICE_ALLTECH');56 Result := Tribe[P].TPhrase('PRICE_ALLTECH'); 57 57 opModel: 58 result := Tribe[p].ModelName[Price - opModel];58 Result := Tribe[P].ModelName[Price - opModel]; 59 59 opAllModel: 60 result := Tribe[p].TPhrase('PRICE_ALLMODEL');60 Result := Tribe[P].TPhrase('PRICE_ALLMODEL'); 61 61 { opCity: 62 result:=Format(TPhrase('PRICE_CITY',p),[CityName(Price-opCity)]); }62 Result:=Format(TPhrase('PRICE_CITY',P),[CityName(Price-opCity)]); } 63 63 end 64 64 end; 65 65 66 66 var 67 i: integer;67 I: Integer; 68 68 sAdd, sDeliver, sCost: string; 69 DoIntro: boolean;69 DoIntro: Boolean; 70 70 begin 71 71 DoIntro := OppCommand = scDipStart; … … 75 75 case Treaty of 76 76 trPeace: 77 result := Phrases.Lookup('FRCANCELTREATY_PEACE');77 Result := Phrases.Lookup('FRCANCELTREATY_PEACE'); 78 78 trFriendlyContact: 79 result := Phrases.Lookup('FRCANCELTREATY_FRIENDLY');79 Result := Phrases.Lookup('FRCANCELTREATY_FRIENDLY'); 80 80 trAlliance: 81 result := Phrases.Lookup('FRCANCELTREATY_ALLIANCE');82 end; 83 DoIntro := false;81 Result := Phrases.Lookup('FRCANCELTREATY_ALLIANCE'); 82 end; 83 DoIntro := False; 84 84 end; 85 85 scDipNotice: 86 result := Phrases.Lookup('FRNOTICE');86 Result := Phrases.Lookup('FRNOTICE'); 87 87 scDipAccept: 88 88 begin 89 89 if (OppOffer.nDeliver + OppOffer.nCost = 1) and 90 90 (OppOffer.Price[0] and opMask = opTreaty) and 91 ( integer(OppOffer.Price[0] - opTreaty) > Treaty) then91 (Integer(OppOffer.Price[0] - opTreaty) > Treaty) then 92 92 // simple treaty offer 93 93 { if OppOffer.Price[0]-opTreaty=trCeaseFire then 94 result:=Tribe[pTarget].TPhrase('FRACCEPTCEASEFIRE')95 else } result := Tribe[pTarget].TPhrase('FRACCEPTTREATY')94 Result:=Tribe[pTarget].TPhrase('FRACCEPTCEASEFIRE') 95 else } Result := Tribe[pTarget].TPhrase('FRACCEPTTREATY') 96 96 else if OppOffer.nDeliver = 0 then 97 result := Tribe[pSender].TPhrase('FRACCEPTDEMAND_STRONG')97 Result := Tribe[pSender].TPhrase('FRACCEPTDEMAND_STRONG') 98 98 else if OppOffer.nCost = 0 then 99 result := Tribe[pSender].TPhrase('FRACCEPTPRESENT')99 Result := Tribe[pSender].TPhrase('FRACCEPTPRESENT') 100 100 else 101 result := Tribe[pSender].TPhrase('FRACCEPTOFFER');101 Result := Tribe[pSender].TPhrase('FRACCEPTOFFER'); 102 102 end; 103 103 scDipBreak: 104 104 begin 105 result := Tribe[pTarget].TPhrase('FRBREAK');106 DoIntro := false;105 Result := Tribe[pTarget].TPhrase('FRBREAK'); 106 DoIntro := False; 107 107 end; 108 108 scDipOffer: 109 109 begin 110 result := '';110 Result := ''; 111 111 if (OppCommand = scDipOffer) and 112 112 ((OppOffer.nDeliver > 0) or (OppOffer.nCost > 0)) and … … 115 115 if (OppOffer.nDeliver + OppOffer.nCost = 1) and 116 116 (OppOffer.Price[0] and opMask = opTreaty) and 117 ( integer(OppOffer.Price[0] - opTreaty) > Treaty) then117 (Integer(OppOffer.Price[0] - opTreaty) > Treaty) then 118 118 // simple treaty offer 119 result := Tribe[pSender].TPhrase('FRNOTACCEPTTREATY') + '\'119 Result := Tribe[pSender].TPhrase('FRNOTACCEPTTREATY') + '\' 120 120 else if OppOffer.nDeliver = 0 then 121 result := Tribe[pSender].TPhrase('FRNOTACCEPTDEMAND_STRONG') + '\'121 Result := Tribe[pSender].TPhrase('FRNOTACCEPTDEMAND_STRONG') + '\' 122 122 else if OppOffer.nCost = 0 then 123 result := Tribe[pSender].TPhrase('FRNOTACCEPTPRESENT') + '\';123 Result := Tribe[pSender].TPhrase('FRNOTACCEPTPRESENT') + '\'; 124 124 end; 125 125 126 126 sDeliver := ''; 127 for i:= 0 to Offer.nDeliver - 1 do128 begin 129 sAdd := PriceToString(pSender, Offer.Price[ i]);130 if i= 0 then127 for I := 0 to Offer.nDeliver - 1 do 128 begin 129 sAdd := PriceToString(pSender, Offer.Price[I]); 130 if I = 0 then 131 131 sDeliver := sAdd 132 132 else … … 134 134 end; 135 135 sCost := ''; 136 for i:= 0 to Offer.nCost - 1 do137 begin 138 sAdd := PriceToString(pTarget, Offer.Price[Offer.nDeliver + i]);139 if i= 0 then136 for I := 0 to Offer.nCost - 1 do 137 begin 138 sAdd := PriceToString(pTarget, Offer.Price[Offer.nDeliver + I]); 139 if I = 0 then 140 140 sCost := sAdd 141 141 else … … 147 147 if (OppCommand = scDipOffer) and 148 148 ((OppOffer.nDeliver = 0) and (OppOffer.nCost = 0)) then 149 result := Tribe[pTarget].TPhrase('FRBYE')149 Result := Tribe[pTarget].TPhrase('FRBYE') 150 150 else 151 151 begin 152 if ( result = '') and (OppCommand = scDipOffer) and152 if (Result = '') and (OppCommand = scDipOffer) and 153 153 ((OppOffer.nDeliver > 0) or (OppOffer.nCost > 0)) then 154 154 begin 155 155 if (OppOffer.nDeliver = 1) and (OppOffer.Price[0] = opChoose) and 156 156 not Phrases2FallenBackToEnglish then 157 result := Tribe[pSender].TString157 Result := Tribe[pSender].TString 158 158 (Phrases2.Lookup('FRNOTACCEPTANYOFFER')) + ' ' 159 159 else if (OppOffer.nCost = 1) and 160 160 (OppOffer.Price[OppOffer.nDeliver] = opChoose) and not Phrases2FallenBackToEnglish 161 161 then 162 result := Tribe[pSender].TString162 Result := Tribe[pSender].TString 163 163 (Phrases2.Lookup('FRNOTACCEPTANYWANT')) + ' ' 164 164 else 165 result := Tribe[pSender].TPhrase('FRNOTACCEPTOFFER') + ' ';165 Result := Tribe[pSender].TPhrase('FRNOTACCEPTOFFER') + ' '; 166 166 end; 167 result := result + Phrases.Lookup('FRDONE');168 DoIntro := false167 Result := Result + Phrases.Lookup('FRDONE'); 168 DoIntro := False 169 169 end 170 170 end 171 171 else if (Offer.nDeliver + Offer.nCost = 1) and 172 172 (Offer.Price[0] and opMask = opTreaty) and 173 ( integer(Offer.Price[0] - opTreaty) > Treaty) then173 (Integer(Offer.Price[0] - opTreaty) > Treaty) then 174 174 // simple treaty offer 175 175 begin … … 177 177 // trCeaseFire: result:=result+Tribe[pTarget].TPhrase('FRCEASEFIRE'); 178 178 trPeace: 179 result := result + Tribe[pTarget].TPhrase('FRPEACE');179 Result := Result + Tribe[pTarget].TPhrase('FRPEACE'); 180 180 trFriendlyContact: 181 result := result + Tribe[pTarget].TPhrase('FRFRIENDLY');181 Result := Result + Tribe[pTarget].TPhrase('FRFRIENDLY'); 182 182 trAlliance: 183 result := result + Tribe[pTarget].TPhrase('FRALLIANCE');183 Result := Result + Tribe[pTarget].TPhrase('FRALLIANCE'); 184 184 end 185 185 end … … 188 188 if (Treaty >= trFriendlyContact) and not Phrases2FallenBackToEnglish 189 189 then 190 result := result +190 Result := Result + 191 191 Format(Tribe[pTarget].TString(Phrases2.Lookup('FRDEMAND_SOFT') 192 192 ), [sCost]) 193 193 else 194 194 begin 195 result := result +195 Result := Result + 196 196 Format(Tribe[pTarget].TPhrase('FRDEMAND_STRONG'), [sCost]); 197 DoIntro := false197 DoIntro := False 198 198 end 199 199 end 200 200 else if Offer.nCost = 0 then // present 201 result := result + Format(Tribe[pTarget].TPhrase('FRPRESENT'),201 Result := Result + Format(Tribe[pTarget].TPhrase('FRPRESENT'), 202 202 [sDeliver]) 203 203 else if (Offer.nDeliver = 1) and (Offer.Price[0] = opChoose) then 204 result := result + Format(Phrases.Lookup('FRDELCHOICE'), [sCost])204 Result := Result + Format(Phrases.Lookup('FRDELCHOICE'), [sCost]) 205 205 else if (Offer.nCost = 1) and (Offer.Price[Offer.nDeliver] = opChoose) 206 206 then 207 result := result + Format(Phrases.Lookup('FRCOSTCHOICE'), [sDeliver])207 Result := Result + Format(Phrases.Lookup('FRCOSTCHOICE'), [sDeliver]) 208 208 else 209 result := result + Format(Phrases.Lookup('FROFFER'),209 Result := Result + Format(Phrases.Lookup('FROFFER'), 210 210 [sDeliver, sCost]); 211 211 end; … … 213 213 if DoIntro then 214 214 if Treaty < trPeace then 215 result := Tribe[pSender].TPhrase('FRSTART_NOTREATY') + ' ' + result215 Result := Tribe[pSender].TPhrase('FRSTART_NOTREATY') + ' ' + Result 216 216 else 217 result := Tribe[pSender].TPhrase('FRSTART_PEACE') + ' ' + result217 Result := Tribe[pSender].TPhrase('FRSTART_PEACE') + ' ' + Result 218 218 end; 219 219 -
branches/highdpi/LocalPlayer/Draft.pas
r361 r465 5 5 6 6 uses 7 UDpiControls, Protocol, ClientTools, Term, ScreenTools, BaseWin, 8 9 LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, 10 ButtonA, 11 ButtonB, Area; 7 UDpiControls, Protocol, ClientTools, ScreenTools, BaseWin, LCLIntf, LCLType, SysUtils, 8 Classes, Graphics, Controls, Forms, ExtCtrls, ButtonA, ButtonB, Area; 12 9 13 10 type … … 23 20 procedure CloseBtnClick(Sender: TObject); 24 21 procedure PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; 25 Shift: TShiftState; x, y: integer);22 Shift: TShiftState; X, Y: Integer); 26 23 procedure OKBtnClick(Sender: TObject); 27 24 procedure PaintBox1MouseUp(Sender: TObject; Button: TMouseButton; 28 Shift: TShiftState; x, y: integer);25 Shift: TShiftState; X, Y: Integer); 29 26 public 30 procedure ShowNewContent(NewMode: integer);27 procedure ShowNewContent(NewMode: TWindowMode); 31 28 protected 32 29 procedure OffscreenPaint; override; 33 30 private 34 31 Domain, MaxLines, Lines, Cut, yDomain, yFeature, yWeight, yTotal, yView, 35 IncCap, DecCap: integer;36 code: array [0 .. nFeature - 1] of integer;32 IncCap, DecCap: Integer; 33 Code: array [0 .. nFeature - 1] of Integer; 37 34 Template, Back: TDpiBitmap; 38 function IsFeatureInList(d, i: integer): boolean; 39 procedure SetDomain(d: integer); 40 end; 41 42 var 43 DraftDlg: TDraftDlg; 35 function IsFeatureInList(D, I: Integer): Boolean; 36 procedure SetDomain(D: Integer); 37 end; 38 44 39 45 40 implementation 46 41 47 uses Help, Tribes, Directories; 42 uses 43 Term, Help, Tribes, Directories; 48 44 49 45 {$R *.lfm} … … 109 105 procedure TDraftDlg.OffscreenPaint; 110 106 111 function DomainAvailable( d: integer): boolean;112 begin 113 result := (upgrade[d, 0].Preq = preNone) or114 (MyRO.Tech[upgrade[ d, 0].Preq] >= tsApplicable);107 function DomainAvailable(D: Integer): Boolean; 108 begin 109 Result := (upgrade[D, 0].Preq = preNone) or 110 (MyRO.Tech[upgrade[D, 0].Preq] >= tsApplicable); 115 111 end; 116 112 117 113 procedure PaintTotalBars; 118 114 var 119 i, y, dx, num, w: integer;120 s: string;121 begin 122 with offscreen.Canvas do115 I, Y, dx, num, W: Integer; 116 S: string; 117 begin 118 with Offscreen.Canvas do 123 119 begin 124 120 // strength bar 125 y:= yTotal;126 DarkGradient( offscreen.Canvas, xTotal - 6, y+ 1, 184, 2);127 DarkGradient( offscreen.Canvas, xTotal2 + 172, y+ 1, 95, 2);128 RisedTextOut( offscreen.Canvas, xTotal - 2, y,121 Y := yTotal; 122 DarkGradient(Offscreen.Canvas, xTotal - 6, Y + 1, 184, 2); 123 DarkGradient(Offscreen.Canvas, xTotal2 + 172, Y + 1, 95, 2); 124 RisedTextOut(Offscreen.Canvas, xTotal - 2, Y, 129 125 Phrases.Lookup('UNITSTRENGTH')); 130 RisedTextOut( offscreen.Canvas, xTotal + 112 + 30, y,126 RisedTextOut(Offscreen.Canvas, xTotal + 112 + 30, Y, 131 127 'x' + IntToStr(MyRO.DevModel.MStrength)); 132 RisedTextOut( offscreen.Canvas, xTotal2 + 148 + 30, y, '=');133 s:= IntToStr(MyRO.DevModel.Attack) + '/' +128 RisedTextOut(Offscreen.Canvas, xTotal2 + 148 + 30, Y, '='); 129 S := IntToStr(MyRO.DevModel.Attack) + '/' + 134 130 IntToStr(MyRO.DevModel.Defense); 135 RisedTextOut( offscreen.Canvas, xTotal2 + 170 + 64 + 30 -136 BiColorTextWidth( offscreen.Canvas, s), y, s);131 RisedTextOut(Offscreen.Canvas, xTotal2 + 170 + 64 + 30 - 132 BiColorTextWidth(Offscreen.Canvas, S), Y, S); 137 133 138 134 // transport bar 139 135 if MyRO.DevModel.MTrans > 0 then 140 136 begin 141 y:= yTotal + 19;142 DarkGradient( offscreen.Canvas, xTotal - 6, y+ 1, 184, 1);143 DarkGradient( offscreen.Canvas, xTotal2 + 172, y+ 1, 95, 1);144 RisedTextOut( offscreen.Canvas, xTotal - 2, y,137 Y := yTotal + 19; 138 DarkGradient(Offscreen.Canvas, xTotal - 6, Y + 1, 184, 1); 139 DarkGradient(Offscreen.Canvas, xTotal2 + 172, Y + 1, 95, 1); 140 RisedTextOut(Offscreen.Canvas, xTotal - 2, Y, 145 141 Phrases.Lookup('UNITTRANSPORT')); 146 RisedTextOut( offscreen.Canvas, xTotal + 112 + 30, y,142 RisedTextOut(Offscreen.Canvas, xTotal + 112 + 30, Y, 147 143 'x' + IntToStr(MyRO.DevModel.MTrans)); 148 RisedTextOut( offscreen.Canvas, xTotal2 + 148 + 30, y, '=');144 RisedTextOut(Offscreen.Canvas, xTotal2 + 148 + 30, Y, '='); 149 145 150 146 Font.Color := $000000; 151 147 dx := -237 - 30; 152 for i:= mcFirstNonCap - 1 downto 3 do153 if iin [mcSeaTrans, mcCarrier, mcAirTrans] then148 for I := mcFirstNonCap - 1 downto 3 do 149 if I in [mcSeaTrans, mcCarrier, mcAirTrans] then 154 150 begin 155 num := MyRO.DevModel.Cap[ i] * MyRO.DevModel.MTrans;151 num := MyRO.DevModel.Cap[I] * MyRO.DevModel.MTrans; 156 152 if num > 0 then 157 153 begin 158 inc(dx, 15);154 Inc(dx, 15); 159 155 Brush.Color := $C0C0C0; 160 FrameRect(Rect(xTotal2 - 3 - dx, y+ 2,161 xTotal2 + 11 - dx, y+ 16));156 FrameRect(Rect(xTotal2 - 3 - dx, Y + 2, 157 xTotal2 + 11 - dx, Y + 16)); 162 158 Brush.Style := bsClear; 163 Sprite( offscreen, HGrSystem, xTotal2 - 1 - dx, y+ 4, 10, 10,164 66 + i mod 11 * 11, 137 + idiv 11 * 11);159 Sprite(Offscreen, HGrSystem, xTotal2 - 1 - dx, Y + 4, 10, 10, 160 66 + I mod 11 * 11, 137 + I div 11 * 11); 165 161 if num > 1 then 166 162 begin 167 s:= IntToStr(num);168 w := TextWidth(s);169 inc(dx, w+ 1);163 S := IntToStr(num); 164 W := TextWidth(S); 165 Inc(dx, W + 1); 170 166 Brush.Color := $FFFFFF; 171 FillRect(Rect(xTotal2 - 3 - dx, y+ 2,172 xTotal2 + w - 1 - dx, y+ 16));167 FillRect(Rect(xTotal2 - 3 - dx, Y + 2, 168 xTotal2 + W - 1 - dx, Y + 16)); 173 169 Brush.Style := bsClear; 174 Textout(xTotal2 - 3 - dx + 1, y, s);170 Textout(xTotal2 - 3 - dx + 1, Y, S); 175 171 end; 176 172 end; 177 end 173 end; 178 174 end; 179 175 180 176 // speed bar 181 y:= yTotal + 38;182 LoweredTextOut( offscreen.Canvas, -1, MainTexture, xTotal - 2, y,177 Y := yTotal + 38; 178 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2, Y, 183 179 Phrases.Lookup('UNITSPEED')); 184 DLine( offscreen.Canvas, xTotal - 2, xTotal + 174, y+ 16,180 DLine(Offscreen.Canvas, xTotal - 2, xTotal + 174, Y + 16, 185 181 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 186 DLine( offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, y+ 16,182 DLine(Offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, Y + 16, 187 183 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 188 s:= MovementToString(MyRO.DevModel.Speed);189 RisedTextOut( offscreen.Canvas, xTotal2 + 170 + 64 + 30 -190 TextWidth( s), y, s);184 S := MovementToString(MyRO.DevModel.Speed); 185 RisedTextOut(Offscreen.Canvas, xTotal2 + 170 + 64 + 30 - 186 TextWidth(S), Y, S); 191 187 192 188 // cost bar 193 y:= yTotal + 57;194 LoweredTextOut( offscreen.Canvas, -1, MainTexture, xTotal - 2, y,189 Y := yTotal + 57; 190 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2, Y, 195 191 Phrases.Lookup('UNITCOST')); 196 LoweredTextOut( offscreen.Canvas, -1, MainTexture, xTotal + 112 + 30, y,192 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal + 112 + 30, Y, 197 193 'x' + IntToStr(MyRO.DevModel.MCost)); 198 LoweredTextOut( offscreen.Canvas, -1, MainTexture,199 xTotal2 + 148 + 30, y, '=');200 DLine( offscreen.Canvas, xTotal - 2, xTotal + 174, y+ 16,194 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, 195 xTotal2 + 148 + 30, Y, '='); 196 DLine(Offscreen.Canvas, xTotal - 2, xTotal + 174, Y + 16, 201 197 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 202 DLine( offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, y+ 16,198 DLine(Offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, Y + 16, 203 199 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 204 s:= IntToStr(MyRO.DevModel.Cost);205 RisedTextOut( offscreen.Canvas, xTotal2 + 170 + 64 + 30 - 12 -206 TextWidth( s), y, s);207 Sprite( offscreen, HGrSystem, xTotal2 + 170 + 54 + 30, y+ 4, 10,200 S := IntToStr(MyRO.DevModel.Cost); 201 RisedTextOut(Offscreen.Canvas, xTotal2 + 170 + 64 + 30 - 12 - 202 TextWidth(S), Y, S); 203 Sprite(Offscreen, HGrSystem, xTotal2 + 170 + 54 + 30, Y + 4, 10, 208 204 10, 88, 115); 209 205 210 if G.Difficulty[ me] <> 2 then206 if G.Difficulty[Me] <> 2 then 211 207 begin // corrected cost bar 212 y:= yTotal + 76;213 LoweredTextOut( offscreen.Canvas, -1, MainTexture, xTotal - 2, y,214 Phrases.Lookup('COSTDIFF' + char(48 + G.Difficulty[ me])));215 LoweredTextOut( offscreen.Canvas, -1, MainTexture,216 xTotal2 + 148 + 30, y, '=');217 DLine( offscreen.Canvas, xTotal - 2, xTotal + 174, y+ 16,208 Y := yTotal + 76; 209 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2, Y, 210 Phrases.Lookup('COSTDIFF' + char(48 + G.Difficulty[Me]))); 211 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, 212 xTotal2 + 148 + 30, Y, '='); 213 DLine(Offscreen.Canvas, xTotal - 2, xTotal + 174, Y + 16, 218 214 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 219 DLine( offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, y+ 16,215 DLine(Offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, Y + 16, 220 216 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 221 s:= IntToStr(MyRO.DevModel.Cost * BuildCostMod222 [G.Difficulty[ me]] div 12);223 RisedTextOut( offscreen.Canvas, xTotal2 + 170 + 64 + 30 - 12 -224 TextWidth( s), y, s);225 Sprite( offscreen, HGrSystem, xTotal2 + 170 + 54 + 30, y+ 4, 10,217 S := IntToStr(MyRO.DevModel.Cost * BuildCostMod 218 [G.Difficulty[Me]] div 12); 219 RisedTextOut(Offscreen.Canvas, xTotal2 + 170 + 64 + 30 - 12 - 220 TextWidth(S), Y, S); 221 Sprite(Offscreen, HGrSystem, xTotal2 + 170 + 54 + 30, Y + 4, 10, 226 222 10, 88, 115); 227 223 end; … … 230 226 231 227 var 232 i, j, x, d, n, TextColor, CapWeight, DomainCount: integer;228 I, J, X, D, N, TextColor, CapWeight, DomainCount: Integer; 233 229 begin 234 230 inherited; … … 239 235 // assemble background from 2 texture tiles 240 236 begin 241 DpiBit Canvas(Back.Canvas, 0, 0, ClientWidth, 64,237 DpiBitBltCanvas(Back.Canvas, 0, 0, ClientWidth, 64, 242 238 MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2, 243 239 MainTexture.Height - 64); 244 DpiBit Canvas(Back.Canvas, 0, 64, ClientWidth, ClientHeight - 64,240 DpiBitBltCanvas(Back.Canvas, 0, 64, ClientWidth, ClientHeight - 64, 245 241 MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2, 246 242 0); 247 243 end 248 244 else 249 DpiBit Canvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight,245 DpiBitBltCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight, 250 246 MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2, 251 247 (MainTexture.Height - ClientHeight) div 2); … … 254 250 Template.Height - 64 - Cut); 255 251 256 DpiBit Canvas(offscreen.Canvas, 0, 0, ClientWidth, ClientHeight,252 DpiBitBltCanvas(Offscreen.Canvas, 0, 0, ClientWidth, ClientHeight, 257 253 Back.Canvas, 0, 0); 258 254 259 offscreen.Canvas.Font.Assign(UniFont[ftCaption]);260 RisedTextOut( offscreen.Canvas, 10, 7, Caption);261 offscreen.Canvas.Font.Assign(UniFont[ftSmall]);255 Offscreen.Canvas.Font.Assign(UniFont[ftCaption]); 256 RisedTextOut(Offscreen.Canvas, 10, 7, Caption); 257 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 262 258 263 259 with MyRO.DevModel do 264 260 begin 265 261 DomainCount := 0; 266 for d:= 0 to nDomains - 1 do267 if DomainAvailable( d) then268 inc(DomainCount);262 for D := 0 to nDomains - 1 do 263 if DomainAvailable(D) then 264 Inc(DomainCount); 269 265 if DomainCount > 1 then 270 266 begin 271 for d:= 0 to nDomains - 1 do272 if DomainAvailable( d) then267 for D := 0 to nDomains - 1 do 268 if DomainAvailable(D) then 273 269 begin 274 x := xDomain + d* DomainPitch;275 if d= Domain then276 ImageOp_BCC( offscreen, Templates.Data, x, yDomain, 142, 246 + 37 * d, 36,270 X := xDomain + D * DomainPitch; 271 if D = Domain then 272 ImageOp_BCC(Offscreen, Templates.Data, X, yDomain, 142, 246 + 37 * D, 36, 277 273 36, 0, $00C0FF) 278 274 else 279 ImageOp_BCC( offscreen, Templates.Data, x, yDomain, 142, 246 + 37 * d, 36,275 ImageOp_BCC(Offscreen, Templates.Data, X, yDomain, 142, 246 + 37 * D, 36, 280 276 36, 0, $606060); 281 277 end; 282 Frame( offscreen.Canvas, xDomain - 11, yDomain - 3,278 Frame(Offscreen.Canvas, xDomain - 11, yDomain - 3, 283 279 xDomain + 2 * DomainPitch + 46, yDomain + 38, $B0B0B0, $FFFFFF); 284 RFrame( offscreen.Canvas, xDomain - 12, yDomain - 4,280 RFrame(Offscreen.Canvas, xDomain - 12, yDomain - 4, 285 281 xDomain + 2 * DomainPitch + 47, yDomain + 39, $FFFFFF, $B0B0B0); 286 282 end; … … 295 291 296 292 // display weight 297 with offscreen.Canvas do298 begin 299 for i:= 0 to MaxWeight - 1 do300 if i< Weight then301 ImageOp_BCC( offscreen, Templates.Data, Point(xWeight + 20 * i, yWeight),293 with Offscreen.Canvas do 294 begin 295 for I := 0 to MaxWeight - 1 do 296 if I < Weight then 297 ImageOp_BCC(Offscreen, Templates.Data, Point(xWeight + 20 * I, yWeight), 302 298 WeightOn.BoundsRect, 0, $949494) 303 299 else 304 ImageOp_BCC( offscreen, Templates.Data, Point(xWeight + 20 * i, yWeight),300 ImageOp_BCC(Offscreen, Templates.Data, Point(xWeight + 20 * I, yWeight), 305 301 WeightOff.BoundsRect, 0, $949494); 306 302 end; 307 303 308 with offscreen.Canvas do309 for i:= 0 to Lines - 1 do304 with Offscreen.Canvas do 305 for I := 0 to Lines - 1 do 310 306 begin 311 if not( code[i] in AutoFeature) then307 if not(Code[I] in AutoFeature) then 312 308 begin 313 309 // paint +/- butttons 314 if code[i] < mcFirstNonCap then310 if Code[I] < mcFirstNonCap then 315 311 begin 316 Dump( offscreen, HGrSystem, xFeature - 21, yFeature + 2 + LinePitch *317 i, 12, 12, 169, 172);318 Dump( offscreen, HGrSystem, xFeature - 9, yFeature + 2 + LinePitch *319 i, 12, 12, 169, 159);320 RFrame( offscreen.Canvas, xFeature - (21 + 1),321 yFeature + 2 + LinePitch * i- 1, xFeature - (21 - 24),322 yFeature + 2 + LinePitch * i+ 12, MainTexture.ColorBevelShade,312 Dump(Offscreen, HGrSystem, xFeature - 21, yFeature + 2 + LinePitch * 313 I, 12, 12, 169, 172); 314 Dump(Offscreen, HGrSystem, xFeature - 9, yFeature + 2 + LinePitch * 315 I, 12, 12, 169, 159); 316 RFrame(Offscreen.Canvas, xFeature - (21 + 1), 317 yFeature + 2 + LinePitch * I - 1, xFeature - (21 - 24), 318 yFeature + 2 + LinePitch * I + 12, MainTexture.ColorBevelShade, 323 319 MainTexture.ColorBevelLight); 324 320 end 325 321 else 326 322 begin 327 Dump( offscreen, HGrSystem, xFeature - 9, yFeature + 2 + LinePitch *328 i, 12, 12, 169, 185 + 13 * MyRO.DevModel.Cap[code[i]]);329 RFrame( offscreen.Canvas, xFeature - (9 + 1),330 yFeature + 2 + LinePitch * i- 1, xFeature - (21 - 24),331 yFeature + 2 + LinePitch * i+ 12, MainTexture.ColorBevelShade,323 Dump(Offscreen, HGrSystem, xFeature - 9, yFeature + 2 + LinePitch * 324 I, 12, 12, 169, 185 + 13 * MyRO.DevModel.Cap[Code[I]]); 325 RFrame(Offscreen.Canvas, xFeature - (9 + 1), 326 yFeature + 2 + LinePitch * I - 1, xFeature - (21 - 24), 327 yFeature + 2 + LinePitch * I + 12, MainTexture.ColorBevelShade, 332 328 MainTexture.ColorBevelLight); 333 329 end; 334 330 335 331 // paint cost 336 LightGradient( offscreen.Canvas, xFeature + 34,337 yFeature + LinePitch * i, 50, HGrSystem.Data.Canvas.Pixels332 LightGradient(Offscreen.Canvas, xFeature + 34, 333 yFeature + LinePitch * I, 50, HGrSystem.Data.Canvas.Pixels 338 334 [187, 137]); 339 if (Domain = dGround) and ( code[i] = mcDefense) then335 if (Domain = dGround) and (Code[I] = mcDefense) then 340 336 CapWeight := 2 341 337 else 342 CapWeight := Feature[ code[i]].Weight;343 n := CapWeight + Feature[code[i]].Cost;344 d:= 6;345 while ( n - 1) * d* 2 > 48 - 10 do346 dec(d);347 for j := 0 to n- 1 do348 if j< CapWeight then349 Sprite( offscreen, HGrSystem, xFeature + 54 + (j * 2 + 1 - n) * d,350 yFeature + 2 + LinePitch * i+ 1, 10, 10, 88, 126)338 CapWeight := Feature[Code[I]].Weight; 339 N := CapWeight + Feature[Code[I]].Cost; 340 D := 6; 341 while (N - 1) * D * 2 > 48 - 10 do 342 Dec(D); 343 for J := 0 to N - 1 do 344 if J < CapWeight then 345 Sprite(Offscreen, HGrSystem, xFeature + 54 + (J * 2 + 1 - N) * D, 346 yFeature + 2 + LinePitch * I + 1, 10, 10, 88, 126) 351 347 else 352 Sprite( offscreen, HGrSystem, xFeature + 54 + (j * 2 + 1 - n) * d,353 yFeature + 2 + LinePitch * i+ 1, 10, 10, 88, 115);348 Sprite(Offscreen, HGrSystem, xFeature + 54 + (J * 2 + 1 - N) * D, 349 yFeature + 2 + LinePitch * I + 1, 10, 10, 88, 115); 354 350 end; // if not (code[i] in AutoFeature) 355 DarkGradient( offscreen.Canvas, xFeature + 17,356 yFeature + LinePitch * i, 16, 1);357 ScreenTools.Frame( offscreen.Canvas, xFeature + 18, yFeature + 1 + LinePitch * i,358 xFeature + 20 - 2 + 13, yFeature + 2 + 1 - 2 + 13 + LinePitch * i,351 DarkGradient(Offscreen.Canvas, xFeature + 17, 352 yFeature + LinePitch * I, 16, 1); 353 ScreenTools.Frame(Offscreen.Canvas, xFeature + 18, yFeature + 1 + LinePitch * I, 354 xFeature + 20 - 2 + 13, yFeature + 2 + 1 - 2 + 13 + LinePitch * I, 359 355 $C0C0C0, $C0C0C0); 360 Sprite( offscreen, HGrSystem, xFeature + 20, yFeature + 2 + 1 + LinePitch361 * i, 10, 10, 66 + code[i] mod 11 * 11, 137 + code[i] div 11 * 11);362 363 if MyRO.DevModel.Cap[ code[i]] > 0 then356 Sprite(Offscreen, HGrSystem, xFeature + 20, yFeature + 2 + 1 + LinePitch 357 * I, 10, 10, 66 + Code[I] mod 11 * 11, 137 + Code[I] div 11 * 11); 358 359 if MyRO.DevModel.Cap[Code[I]] > 0 then 364 360 TextColor := MainTexture.ColorLitText 365 361 else 366 362 TextColor := -1; 367 363 368 if code[i] < mcFirstNonCap then369 LoweredTextOut( offscreen.Canvas, TextColor, MainTexture, xFeature + 7,370 yFeature + LinePitch * i - 1, IntToStr(MyRO.DevModel.Cap[code[i]]));371 LoweredTextOut( offscreen.Canvas, TextColor, MainTexture, xFeature + 88,372 yFeature + LinePitch * i - 1, Phrases.Lookup('FEATURES', code[i]));364 if Code[I] < mcFirstNonCap then 365 LoweredTextOut(Offscreen.Canvas, TextColor, MainTexture, xFeature + 7, 366 yFeature + LinePitch * I - 1, IntToStr(MyRO.DevModel.Cap[Code[I]])); 367 LoweredTextOut(Offscreen.Canvas, TextColor, MainTexture, xFeature + 88, 368 yFeature + LinePitch * I - 1, Phrases.Lookup('FEATURES', Code[I])); 373 369 end; 374 370 end; 375 371 376 372 // free features 377 j:= 0;378 for i:= 0 to nFeature - 1 do379 if ( i in AutoFeature) and (1 shl Domain and Feature[i].Domains <> 0) and380 (Feature[ i].Preq <> preNA) and381 ((Feature[ i].Preq = preSun) and (MyRO.Wonder[woSun].EffectiveOwner = me)382 or (Feature[ i].Preq >= 0) and (MyRO.Tech[Feature[i].Preq] >= tsApplicable)383 ) and not((Feature[ i].Preq = adSteamEngine) and373 J := 0; 374 for I := 0 to nFeature - 1 do 375 if (I in AutoFeature) and (1 shl Domain and Feature[I].Domains <> 0) and 376 (Feature[I].Preq <> preNA) and 377 ((Feature[I].Preq = preSun) and (MyRO.Wonder[woSun].EffectiveOwner = Me) 378 or (Feature[I].Preq >= 0) and (MyRO.Tech[Feature[I].Preq] >= tsApplicable) 379 ) and not((Feature[I].Preq = adSteamEngine) and 384 380 (MyRO.Tech[adNuclearPower] >= tsApplicable)) then 385 381 begin 386 DarkGradient( offscreen.Canvas, xWeight + 4, yWeight + 32 + LinePitch387 * j, 16, 1);388 Frame( offscreen.Canvas, xWeight + 5, yWeight + 33 + LinePitch * j,389 xWeight + 18, yWeight + 47 + LinePitch * j, $C0C0C0, $C0C0C0);390 Sprite( offscreen, HGrSystem, xWeight + 7, yWeight + 36 + LinePitch * j,391 10, 10, 66 + i mod 11 * 11, 137 + idiv 11 * 11);392 LoweredTextOut( offscreen.Canvas, -1, MainTexture, xWeight + 26,393 yWeight + 31 + LinePitch * j, Phrases.Lookup('FEATURES', i));394 inc(j);395 end; 396 397 with Tribe[ me].ModelPicture[MyRO.nModel] do398 begin 399 FrameImage( offscreen.Canvas, BigImp, xView + 4, yView + 4, xSizeBig,382 DarkGradient(Offscreen.Canvas, xWeight + 4, yWeight + 32 + LinePitch 383 * J, 16, 1); 384 Frame(Offscreen.Canvas, xWeight + 5, yWeight + 33 + LinePitch * J, 385 xWeight + 18, yWeight + 47 + LinePitch * J, $C0C0C0, $C0C0C0); 386 Sprite(Offscreen, HGrSystem, xWeight + 7, yWeight + 36 + LinePitch * J, 387 10, 10, 66 + I mod 11 * 11, 137 + I div 11 * 11); 388 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xWeight + 26, 389 yWeight + 31 + LinePitch * J, Phrases.Lookup('FEATURES', I)); 390 Inc(J); 391 end; 392 393 with Tribe[Me].ModelPicture[MyRO.nModel] do 394 begin 395 FrameImage(Offscreen.Canvas, BigImp, xView + 4, yView + 4, xSizeBig, 400 396 ySizeBig, 0, 0); 401 Sprite( offscreen, HGr, xView, yView, 64, 44, pix mod 10 * 65 + 1,397 Sprite(Offscreen, HGr, xView, yView, 64, 44, pix mod 10 * 65 + 1, 402 398 pix div 10 * 49 + 1); 403 399 end; 404 400 MarkUsedOffscreen(ClientWidth, ClientHeight); 405 end; { MainPaint }406 407 procedure TDraftDlg.SetDomain( d: integer);408 409 function Prio(fix: integer): integer;401 end; 402 403 procedure TDraftDlg.SetDomain(D: Integer); 404 405 function Prio(fix: Integer): Integer; 410 406 var 411 FeaturePreq: integer;407 FeaturePreq: Integer; 412 408 begin 413 409 FeaturePreq := Feature[fix].Preq; 414 assert(FeaturePreq <> preNA);410 Assert(FeaturePreq <> preNA); 415 411 if fix < mcFirstNonCap then 416 result := 10000 + fix412 Result := 10000 + fix 417 413 else if FeaturePreq = preNone then 418 result := 20000414 Result := 20000 419 415 else if FeaturePreq < 0 then 420 result := 40000416 Result := 40000 421 417 else 422 result := 30000 + AdvValue[FeaturePreq];418 Result := 30000 + AdvValue[FeaturePreq]; 423 419 if not(fix in AutoFeature) then 424 inc(result, 90000);420 Inc(Result, 90000); 425 421 end; 426 422 427 423 var 428 i, j, x: integer;429 begin 430 Domain := d;424 I, J, X: Integer; 425 begin 426 Domain := D; 431 427 Lines := 0; 432 for i:= 0 to nFeature - 1 do433 if IsFeatureInList(Domain, i) then434 begin 435 code[Lines] := i;436 inc(Lines)428 for I := 0 to nFeature - 1 do 429 if IsFeatureInList(Domain, I) then 430 begin 431 Code[Lines] := I; 432 Inc(Lines); 437 433 end; 438 434 yFeature := yFeature0 + (MaxLines - Lines) * LinePitch div 2; 439 435 440 436 // sort features 441 for i:= 0 to Lines - 2 do442 for j := i+ 1 to Lines - 1 do443 if Prio( code[i]) > Prio(code[j]) then437 for I := 0 to Lines - 2 do 438 for J := I + 1 to Lines - 1 do 439 if Prio(Code[I]) > Prio(Code[J]) then 444 440 begin // exchange 445 x := code[i];446 code[i] := code[j];447 code[j] := x441 X := Code[I]; 442 Code[I] := Code[J]; 443 Code[J] := X; 448 444 end; 449 445 end; 450 446 451 function TDraftDlg.IsFeatureInList( d, i: integer): boolean;452 begin 453 result := not(i in AutoFeature) and (1 shl d and Feature[i].Domains <> 0) and454 (Feature[ i].Preq <> preNA) and455 ((Feature[ i].Preq = preNone) or (Feature[i].Preq = preSun) and456 (MyRO.Wonder[woSun].EffectiveOwner = me) or (Feature[i].Preq >= 0) and457 (MyRO.Tech[Feature[ i].Preq] >= tsApplicable));447 function TDraftDlg.IsFeatureInList(D, I: Integer): Boolean; 448 begin 449 Result := not(I in AutoFeature) and (1 shl D and Feature[I].Domains <> 0) and 450 (Feature[I].Preq <> preNA) and 451 ((Feature[I].Preq = preNone) or (Feature[I].Preq = preSun) and 452 (MyRO.Wonder[woSun].EffectiveOwner = Me) or (Feature[I].Preq >= 0) and 453 (MyRO.Tech[Feature[I].Preq] >= tsApplicable)); 458 454 end; 459 455 460 456 procedure TDraftDlg.FormShow(Sender: TObject); 461 457 var 462 count, d, i: integer;458 count, D, I: Integer; 463 459 begin 464 460 Domain := dGround; 465 461 while (Domain < dAir) and (upgrade[Domain, 0].Preq <> preNone) and 466 462 (MyRO.Tech[upgrade[Domain, 0].Preq] < tsApplicable) do 467 inc(Domain);463 Inc(Domain); 468 464 469 465 // count max number of features in any domain 470 466 MaxLines := 0; 471 for d:= 0 to nDomains - 1 do472 if (upgrade[ d, 0].Preq = preNone) or473 (MyRO.Tech[upgrade[ d, 0].Preq] >= tsApplicable) then467 for D := 0 to nDomains - 1 do 468 if (upgrade[D, 0].Preq = preNone) or 469 (MyRO.Tech[upgrade[D, 0].Preq] >= tsApplicable) then 474 470 begin 475 471 count := 0; 476 for i:= 0 to nFeature - 1 do477 if IsFeatureInList( d, i) then478 inc(count);472 for I := 0 to nFeature - 1 do 473 if IsFeatureInList(D, I) then 474 Inc(count); 479 475 if count > MaxLines then 480 476 MaxLines := count; … … 494 490 495 491 SetDomain(Domain); 496 Server(sCreateDevModel, me, Domain, nil^);492 Server(sCreateDevModel, Me, Domain, nil^); 497 493 MyModel[MyRO.nModel] := MyRO.DevModel; 498 InitMyModel(MyRO.nModel, false);494 InitMyModel(MyRO.nModel, False); 499 495 OffscreenPaint; 500 496 IncCap := -1; … … 502 498 end; 503 499 504 procedure TDraftDlg.ShowNewContent(NewMode: integer);500 procedure TDraftDlg.ShowNewContent(NewMode: TWindowMode); 505 501 begin 506 502 inherited ShowNewContent(NewMode); … … 508 504 509 505 procedure TDraftDlg.PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; 510 Shift: TShiftState; x, y: integer);506 Shift: TShiftState; X, Y: Integer); 511 507 var 512 i, d: integer;508 I, D: Integer; 513 509 begin 514 510 if Button = mbLeft then 515 511 begin 516 for d:= 0 to nDomains - 1 do517 if ( d <> Domain) and ((upgrade[d, 0].Preq = preNone) or518 (MyRO.Tech[upgrade[ d, 0].Preq] >= tsApplicable)) and519 ( x >= xDomain + d* DomainPitch) and520 ( x < xDomain + d * DomainPitch + 36) and (y>= yDomain) and521 ( y< yDomain + 36) then512 for D := 0 to nDomains - 1 do 513 if (D <> Domain) and ((upgrade[D, 0].Preq = preNone) or 514 (MyRO.Tech[upgrade[D, 0].Preq] >= tsApplicable)) and 515 (X >= xDomain + D * DomainPitch) and 516 (X < xDomain + D * DomainPitch + 36) and (Y >= yDomain) and 517 (Y < yDomain + 36) then 522 518 begin 523 SetDomain( d);524 Server(sCreateDevModel, me, Domain, nil^);519 SetDomain(D); 520 Server(sCreateDevModel, Me, Domain, nil^); 525 521 MyModel[MyRO.nModel] := MyRO.DevModel; 526 InitMyModel(MyRO.nModel, false);522 InitMyModel(MyRO.nModel, False); 527 523 SmartUpdateContent; 528 524 end; 529 525 530 if ( y >= yFeature) and (y< yFeature + LinePitch * Lines) then531 begin 532 i := (y- yFeature) div LinePitch;533 if ( x >= xFeature - 21) and (x< ClientWidth) and (ssShift in Shift) then534 HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkFeature, code[i])535 else if not( code[i] in AutoFeature) then526 if (Y >= yFeature) and (Y < yFeature + LinePitch * Lines) then 527 begin 528 I := (Y - yFeature) div LinePitch; 529 if (X >= xFeature - 21) and (X < ClientWidth) and (ssShift in Shift) then 530 MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkFeature, Code[I]) 531 else if not(Code[I] in AutoFeature) then 536 532 begin 537 if ( code[i] < mcFirstNonCap) and (x>= xFeature - 21) and538 ( x< xFeature - 21 + 12) then533 if (Code[I] < mcFirstNonCap) and (X >= xFeature - 21) and 534 (X < xFeature - 21 + 12) then 539 535 begin 540 IncCap := code[i];541 Dump( offscreen, HGrSystem, xFeature - 21, yFeature + 2 + LinePitch *542 i, 12, 12, 182, 172);536 IncCap := Code[I]; 537 Dump(Offscreen, HGrSystem, xFeature - 21, yFeature + 2 + LinePitch * 538 I, 12, 12, 182, 172); 543 539 SmartInvalidate; 544 540 end 545 else if ( x >= xFeature - 9) and (x< xFeature - 9 + 12) then541 else if (X >= xFeature - 9) and (X < xFeature - 9 + 12) then 546 542 begin 547 DecCap := code[i];548 if code[i] < mcFirstNonCap then549 Dump( offscreen, HGrSystem, xFeature - 9, yFeature + 2 + LinePitch *550 i, 12, 12, 182, 159)543 DecCap := Code[I]; 544 if Code[I] < mcFirstNonCap then 545 Dump(Offscreen, HGrSystem, xFeature - 9, yFeature + 2 + LinePitch * 546 I, 12, 12, 182, 159) 551 547 else 552 Dump( offscreen, HGrSystem, xFeature - 9, yFeature + 2 + LinePitch *553 i, 12, 12, 182, 185 + 13 * MyRO.DevModel.Cap[code[i]]);548 Dump(Offscreen, HGrSystem, xFeature - 9, yFeature + 2 + LinePitch * 549 I, 12, 12, 182, 185 + 13 * MyRO.DevModel.Cap[Code[I]]); 554 550 SmartInvalidate; 555 551 end; 556 end 557 end 558 end 552 end; 553 end; 554 end; 559 555 end; 560 556 561 557 procedure TDraftDlg.PaintBox1MouseUp(Sender: TObject; Button: TMouseButton; 562 Shift: TShiftState; x, y: integer);558 Shift: TShiftState; X, Y: Integer); 563 559 var 564 NewValue: integer;560 NewValue: Integer; 565 561 begin 566 562 if IncCap >= 0 then 567 563 begin 568 564 NewValue := MyRO.DevModel.Cap[IncCap] + 1; 569 Server(sSetDevModelCap + NewValue shl 4, me, IncCap, nil^);565 Server(sSetDevModelCap + NewValue shl 4, Me, IncCap, nil^); 570 566 MyModel[MyRO.nModel] := MyRO.DevModel; 571 InitMyModel(MyRO.nModel, false);567 InitMyModel(MyRO.nModel, False); 572 568 SmartUpdateContent; 573 569 IncCap := -1; … … 580 576 if DecCap >= mcFirstNonCap then 581 577 NewValue := -NewValue; 582 Server(sSetDevModelCap + NewValue shl 4, me, DecCap, nil^);578 Server(sSetDevModelCap + NewValue shl 4, Me, DecCap, nil^); 583 579 MyModel[MyRO.nModel] := MyRO.DevModel; 584 InitMyModel(MyRO.nModel, false);580 InitMyModel(MyRO.nModel, False); 585 581 end; 586 582 SmartUpdateContent; -
branches/highdpi/LocalPlayer/Enhance.pas
r361 r465 5 5 6 6 uses 7 UDpiControls, ScreenTools, BaseWin, Protocol, ClientTools, Term, LCLIntf, LCLType, 8 9 SysUtils, Classes, Graphics, Controls, Forms, IsoEngine, 10 ButtonB, ButtonC, Menus; 7 UDpiControls, ScreenTools, BaseWin, Protocol, ClientTools, LCLIntf, LCLType, SysUtils, 8 Classes, Graphics, Controls, Forms, IsoEngine, ButtonB, ButtonC, Menus; 11 9 12 10 type … … 39 37 NoMap: TIsoMap; 40 38 public 41 procedure ShowNewContent(NewMode: integer; TerrType: integer = -1);39 procedure ShowNewContent(NewMode: TWindowMode; TerrType: Integer = -1); 42 40 protected 43 Page: integer;41 Page: Integer; 44 42 procedure OffscreenPaint; override; 45 43 end; 46 44 47 var48 EnhanceDlg: TEnhanceDlg;49 50 45 51 46 implementation 52 47 53 48 uses 54 Help, UKeyBindings;49 Help, KeyBindings, Term; 55 50 56 51 {$R *.lfm} … … 58 53 procedure TEnhanceDlg.FormCreate(Sender: TObject); 59 54 var 60 TerrType: integer;61 m: TDpiMenuItem;55 TerrType: Integer; 56 M: TDpiMenuItem; 62 57 begin 63 58 inherited; … … 73 68 if TerrType <> fJungle then 74 69 begin 75 m:= TDpiMenuItem.Create(Popup);76 m.RadioItem := true;70 M := TDpiMenuItem.Create(Popup); 71 M.RadioItem := True; 77 72 if TerrType = fGrass then 78 m.Caption := Format(Phrases.Lookup('TWOTERRAINS'),73 M.Caption := Format(Phrases.Lookup('TWOTERRAINS'), 79 74 [Phrases.Lookup('TERRAIN', fGrass), Phrases.Lookup('TERRAIN', 80 75 fGrass + 12)]) 81 76 else if TerrType = fForest then 82 m.Caption := Format(Phrases.Lookup('TWOTERRAINS'),77 M.Caption := Format(Phrases.Lookup('TWOTERRAINS'), 83 78 [Phrases.Lookup('TERRAIN', fForest), Phrases.Lookup('TERRAIN', 84 79 fJungle)]) 85 80 else 86 m.Caption := Phrases.Lookup('TERRAIN', TerrType);87 m.Tag := TerrType;88 m.OnClick := TerrClick;89 Popup.Items.Add( m);81 M.Caption := Phrases.Lookup('TERRAIN', TerrType); 82 M.Tag := TerrType; 83 M.OnClick := TerrClick; 84 Popup.Items.Add(M); 90 85 end; 91 86 end; … … 98 93 procedure TEnhanceDlg.FormPaint(Sender: TObject); 99 94 var 100 i: integer;95 I: Integer; 101 96 begin 102 97 inherited; … … 105 100 BtnFrame(Canvas, Rect(job3.Left, job3.Top, job9.Left + job9.Width, 106 101 job3.Top + job3.Height), MainTexture); 107 for i:= 0 to ControlCount - 1 do108 if Controls[ i] is TButtonC then109 DpiBit Canvas(Canvas, Controls[i].Left + 2, Controls[i].Top - 11, 8, 8,110 HGrSystem.Data.Canvas, 121 + Controls[ i].Tag mod 7 * 9,111 1 + Controls[ i].Tag div 7 * 9);102 for I := 0 to ControlCount - 1 do 103 if Controls[I] is TButtonC then 104 DpiBitBltCanvas(Canvas, Controls[I].Left + 2, Controls[I].Top - 11, 8, 8, 105 HGrSystem.Data.Canvas, 121 + Controls[I].Tag mod 7 * 9, 106 1 + Controls[I].Tag div 7 * 9); 112 107 end; 113 108 … … 117 112 end; 118 113 119 procedure TEnhanceDlg.ShowNewContent(NewMode , TerrType: integer);114 procedure TEnhanceDlg.ShowNewContent(NewMode: TWindowMode; TerrType: Integer); 120 115 begin 121 116 if (TerrType < fGrass) or (TerrType > fMountains) then … … 128 123 procedure TEnhanceDlg.OffscreenPaint; 129 124 var 130 i, stage, TerrType, TileImp, x, EndStage, Cost, LastJob: integer;131 s: string;132 Done: Set of jNone .. jTrans;133 TypeChanged: boolean;125 I, stage, TerrType, TileImp, X, EndStage, Cost, LastJob: Integer; 126 S: string; 127 Done: set of jNone .. jTrans; 128 TypeChanged: Boolean; 134 129 begin 135 130 OffscreenUser := self; 136 offscreen.Canvas.Font.Assign(UniFont[ftSmall]);131 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 137 132 FillOffscreen(0, 0, InnerWidth, InnerHeight); 138 133 139 134 EndStage := 0; 140 135 while (EndStage < 5) and (MyData.EnhancementJobs[Page, EndStage] <> jNone) do 141 inc(EndStage);136 Inc(EndStage); 142 137 with NoMap do 143 x:= InnerWidth div 2 - xxt - (xxt + 3) * EndStage;138 X := InnerWidth div 2 - xxt - (xxt + 3) * EndStage; 144 139 145 140 TerrType := Page; … … 151 146 if stage > 0 then 152 147 begin 153 Sprite( offscreen, HGrSystem, x- 10, 66, 14, 14, 80, 1);148 Sprite(Offscreen, HGrSystem, X - 10, 66, 14, 14, 80, 1); 154 149 case MyData.EnhancementJobs[Page, stage - 1] of 155 150 jRoad: 156 151 begin 157 inc(Cost, Terrain[TerrType].MoveCost * RoadWork);152 Inc(Cost, Terrain[TerrType].MoveCost * RoadWork); 158 153 TileImp := TileImp or fRoad; 159 154 end; 160 155 jRR: 161 156 begin 162 inc(Cost, Terrain[TerrType].MoveCost * RRWork);157 Inc(Cost, Terrain[TerrType].MoveCost * RRWork); 163 158 TileImp := TileImp or fRR; 164 159 end; 165 160 jIrr: 166 161 begin 167 inc(Cost, Terrain[TerrType].IrrClearWork);162 Inc(Cost, Terrain[TerrType].IrrClearWork); 168 163 TileImp := TileImp and not fTerImp or tiIrrigation; 169 164 end; 170 165 jFarm: 171 166 begin 172 inc(Cost, Terrain[TerrType].IrrClearWork * FarmWork);167 Inc(Cost, Terrain[TerrType].IrrClearWork * FarmWork); 173 168 TileImp := TileImp and not fTerImp or tiFarm; 174 169 end; 175 170 jMine: 176 171 begin 177 inc(Cost, Terrain[TerrType].MineAfforestWork);172 Inc(Cost, Terrain[TerrType].MineAfforestWork); 178 173 TileImp := TileImp and not fTerImp or tiMine; 179 174 end; 180 175 jClear: 181 176 begin 182 inc(Cost, Terrain[TerrType].IrrClearWork);177 Inc(Cost, Terrain[TerrType].IrrClearWork); 183 178 TerrType := Terrain[TerrType].ClearTerrain; 184 179 end; 185 180 jAfforest: 186 181 begin 187 inc(Cost, Terrain[TerrType].MineAfforestWork);182 Inc(Cost, Terrain[TerrType].MineAfforestWork); 188 183 TerrType := Terrain[TerrType].AfforestTerrain; 189 184 end; 190 185 jTrans: 191 186 begin 192 inc(Cost, Terrain[TerrType].TransWork);187 Inc(Cost, Terrain[TerrType].TransWork); 193 188 TerrType := Terrain[TerrType].TransTerrain; 194 189 end; 195 190 end; 196 include(Done, MyData.EnhancementJobs[Page, stage - 1]);191 Include(Done, MyData.EnhancementJobs[Page, stage - 1]); 197 192 end; 198 193 199 194 with NoMap do begin 200 195 if TerrType < fForest then 201 Sprite( offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2,196 Sprite(Offscreen, HGrTerrain, X, 64 - yyt, xxt * 2, yyt * 2, 202 197 1 + TerrType * (xxt * 2 + 1), 1 + yyt) 203 198 else 204 199 begin 205 Sprite( offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2,200 Sprite(Offscreen, HGrTerrain, X, 64 - yyt, xxt * 2, yyt * 2, 206 201 1 + 2 * (xxt * 2 + 1), 1 + yyt + 2 * (yyt * 3 + 1)); 207 Sprite( offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2,202 Sprite(Offscreen, HGrTerrain, X, 64 - yyt, xxt * 2, yyt * 2, 208 203 1 + 7 * (xxt * 2 + 1), 1 + yyt + 2 * (2 + TerrType - fForest) * 209 204 (yyt * 3 + 1)); 210 205 end; 211 206 if TileImp and fTerImp = tiFarm then 212 Sprite( offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2,207 Sprite(Offscreen, HGrTerrain, X, 64 - yyt, xxt * 2, yyt * 2, 213 208 1 + (xxt * 2 + 1), 1 + yyt + 12 * (yyt * 3 + 1)) 214 209 else if TileImp and fTerImp = tiIrrigation then 215 Sprite( offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2, 1,210 Sprite(Offscreen, HGrTerrain, X, 64 - yyt, xxt * 2, yyt * 2, 1, 216 211 1 + yyt + 12 * (yyt * 3 + 1)); 217 212 if TileImp and fRR <> 0 then 218 213 begin 219 Sprite( offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2,214 Sprite(Offscreen, HGrTerrain, X, 64 - yyt, xxt * 2, yyt * 2, 220 215 1 + 6 * (xxt * 2 + 1), 1 + yyt + 10 * (yyt * 3 + 1)); 221 Sprite( offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2,216 Sprite(Offscreen, HGrTerrain, X, 64 - yyt, xxt * 2, yyt * 2, 222 217 1 + 2 * (xxt * 2 + 1), 1 + yyt + 10 * (yyt * 3 + 1)); 223 218 end 224 219 else if TileImp and fRoad <> 0 then 225 220 begin 226 Sprite( offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2,221 Sprite(Offscreen, HGrTerrain, X, 64 - yyt, xxt * 2, yyt * 2, 227 222 1 + 6 * (xxt * 2 + 1), 1 + yyt + 9 * (yyt * 3 + 1)); 228 Sprite( offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2,223 Sprite(Offscreen, HGrTerrain, X, 64 - yyt, xxt * 2, yyt * 2, 229 224 1 + 2 * (xxt * 2 + 1), 1 + yyt + 9 * (yyt * 3 + 1)); 230 225 end; 231 226 if TileImp and fTerImp = tiMine then 232 Sprite( offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2,227 Sprite(Offscreen, HGrTerrain, X, 64 - yyt, xxt * 2, yyt * 2, 233 228 1 + 2 * (xxt * 2 + 1), 1 + yyt + 12 * (yyt * 3 + 1)); 234 inc(x, xxt * 2 + 6);235 end; 236 end; 237 238 for i:= 0 to Popup.Items.Count - 1 do239 if Popup.Items[ i].Tag = Page then240 s := Popup.Items[i].Caption;229 Inc(X, xxt * 2 + 6); 230 end; 231 end; 232 233 for I := 0 to Popup.Items.Count - 1 do 234 if Popup.Items[I].Tag = Page then 235 S := Popup.Items[I].Caption; 241 236 if Cost > 0 then 242 s := Format(Phrases.Lookup('ENHANCE'), [s, MovementToString(Cost)]);243 LoweredTextOut( offscreen.Canvas, -1, MainTexture,244 (InnerWidth - BiColorTextWidth( offscreen.Canvas, s)) div 2, 12, s);237 S := Format(Phrases.Lookup('ENHANCE'), [S, MovementToString(Cost)]); 238 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, 239 (InnerWidth - BiColorTextWidth(Offscreen.Canvas, S)) div 2, 12, S); 245 240 246 241 if EndStage > 0 then … … 291 286 (Terrain[TerrType].MineEff > 0); 292 287 job3.Visible := not TypeChanged and (Terrain[TerrType].ClearTerrain >= 0) and 293 ((TerrType <> fDesert) or (MyRO.Wonder[woGardens].EffectiveOwner = me)) or288 ((TerrType <> fDesert) or (MyRO.Wonder[woGardens].EffectiveOwner = Me)) or 294 289 (LastJob = jClear); 295 290 job6.Visible := not TypeChanged and (Terrain[TerrType].AfforestTerrain >= 0) … … 299 294 300 295 MarkUsedOffscreen(InnerWidth, InnerHeight); 301 end; { OffscreenPaint }296 end; 302 297 303 298 procedure TEnhanceDlg.CloseBtnClick(Sender: TObject); … … 308 303 procedure TEnhanceDlg.ToggleBtnClick(Sender: TObject); 309 304 var 310 i: integer;311 begin 312 for i:= 0 to Popup.Items.Count - 1 do313 Popup.Items[ i].Checked := Popup.Items[i].Tag = Page;305 I: Integer; 306 begin 307 for I := 0 to Popup.Items.Count - 1 do 308 Popup.Items[I].Checked := Popup.Items[I].Tag = Page; 314 309 Popup.Popup(Left + ToggleBtn.Left, Top + ToggleBtn.Top + ToggleBtn.Height); 315 310 end; … … 323 318 procedure TEnhanceDlg.JobClick(Sender: TObject); 324 319 var 325 stage, NewJob: integer;320 Stage, NewJob: Integer; 326 321 Done: Set of jNone .. jTrans; 327 322 328 procedure RemoveJob( j: integer);323 procedure RemoveJob(J: Integer); 329 324 begin // remove job 330 stage := 0;331 while ( stage < 5) and (MyData.EnhancementJobs[Page, stage] <> jNone) do332 begin 333 if (MyData.EnhancementJobs[Page, stage] = j) or (j= jRoad) and334 (MyData.EnhancementJobs[Page, stage] = jRR) or (j= jIrr) and335 (MyData.EnhancementJobs[Page, stage] = jFarm) then325 Stage := 0; 326 while (Stage < 5) and (MyData.EnhancementJobs[Page, Stage] <> jNone) do 327 begin 328 if (MyData.EnhancementJobs[Page, Stage] = J) or (J = jRoad) and 329 (MyData.EnhancementJobs[Page, Stage] = jRR) or (J = jIrr) and 330 (MyData.EnhancementJobs[Page, Stage] = jFarm) then 336 331 begin 337 if stage < 4 then338 move(MyData.EnhancementJobs[Page, stage + 1],339 MyData.EnhancementJobs[Page, stage], 4 - stage);332 if Stage < 4 then 333 Move(MyData.EnhancementJobs[Page, Stage + 1], 334 MyData.EnhancementJobs[Page, Stage], 4 - Stage); 340 335 MyData.EnhancementJobs[Page, 4] := jNone; 341 336 end 342 337 else 343 inc(stage);338 Inc(Stage); 344 339 end; 345 340 end; … … 348 343 NewJob := TButtonC(Sender).Tag; 349 344 Done := []; 350 stage := 0;351 while ( stage < 5) and (MyData.EnhancementJobs[Page, stage] <> jNone) do345 Stage := 0; 346 while (Stage < 5) and (MyData.EnhancementJobs[Page, Stage] <> jNone) do 352 347 begin 353 include(Done, MyData.EnhancementJobs[Page, stage]);354 inc(stage);348 Include(Done, MyData.EnhancementJobs[Page, Stage]); 349 Inc(Stage); 355 350 end; 356 351 if NewJob in Done then … … 364 359 if (NewJob = jRR) and not(jRoad in Done) then 365 360 begin 366 MyData.EnhancementJobs[Page, stage] := jRoad;367 inc(stage);361 MyData.EnhancementJobs[Page, Stage] := jRoad; 362 Inc(Stage); 368 363 end; 369 364 if (NewJob = jFarm) and not(jIrr in Done) then 370 365 begin 371 MyData.EnhancementJobs[Page, stage] := jIrr;372 inc(stage);373 end; 374 MyData.EnhancementJobs[Page, stage] := NewJob;366 MyData.EnhancementJobs[Page, Stage] := jIrr; 367 Inc(Stage); 368 end; 369 MyData.EnhancementJobs[Page, Stage] := NewJob; 375 370 end; 376 371 SmartUpdateContent; … … 384 379 ShortCut := KeyToShortCut(Key, Shift); 385 380 if BHelp.Test(ShortCut) then 386 HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkText,387 HelpDlg.TextIndex('MACRO'))381 MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkText, 382 MainScreen.HelpDlg.TextIndex('MACRO')) 388 383 end; 389 384 -
branches/highdpi/LocalPlayer/Help.pas
r412 r465 7 7 UDpiControls, Protocol, ScreenTools, BaseWin, StringTables, Math, LCLIntf, LCLType, 8 8 Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, 9 ButtonB, PVSB, Types, fgl, IsoEngine;9 ButtonB, PVSB, Types, Generics.Collections, IsoEngine; 10 10 11 11 const 12 12 MaxHist = 16; 13 13 14 { link categories } 15 hkNoLink = 0; 16 hkAdv = 1; 17 hkImp = 2; 18 hkTer = 3; 19 hkFeature = 4; 20 hkInternet = 5; 21 hkModel = 6; 22 hkMisc = 7; 23 hkCrossLink = $40; 24 hkText = $80; 25 26 liInvalid = $3FFF; // link index indicates invalid link 27 28 { link indices for category hkMisc } 29 miscMain = 0; 30 miscCredits = 1; 31 miscGovList = 2; 32 miscJobList = 3; 33 miscSearchResult = 7; 34 35 fJungle = 8; // pseudo terrain 14 fJungle = 8; // Pseudo terrain 36 15 37 16 type 17 { Link categories } 18 TLinkCategory = ( 19 hkNoLink, 20 hkAdv, 21 hkImp, 22 hkTer, 23 hkFeature , 24 hkInternet, 25 hkModel, 26 hkMisc, 27 hkText); 28 29 { Link indices for category hkMisc } 30 TMiscLinkIndex = ( 31 miscMain, 32 miscCredits, 33 miscGovList, 34 miscJobList, 35 miscSearchResult); 36 37 TTextFormat = ( 38 pkNormal, 39 pkCaption, 40 pkSmallIcon, 41 pkBigIcon, 42 pkAdvIcon, 43 pkTer, 44 pkBigTer, 45 pkFeature, 46 pkDot, 47 pkNormal_Dot, 48 pkDomain, 49 pkSection, 50 pkBigFeature, 51 pkExp, 52 pkAITStat, 53 pkExternal, 54 pkModel, 55 pkNormal_64, 56 pkIllu, 57 pkLogo, 58 pkTerImp, 59 pkRightIcon, 60 pkAdvIcon_AsPreq, 61 pkSmallIcon_AsPreq, 62 pkSpecialIcon, 63 pkGov); 38 64 39 65 { THyperText } … … 41 67 THyperText = class(TStringList) 42 68 public 43 procedure AddLine( s: String = ''; Format: integer = 0; Picpix: Integer = 0;44 LinkCategory: integer = 0; LinkIndex: integer = 0);69 procedure AddLine(S: String = ''; Format: TTextFormat = pkNormal; Picpix: Integer = 0; 70 LinkCategory: TLinkCategory = hkNoLink; LinkIndex: Integer = 0; CrossLink: Boolean = False); 45 71 procedure LineFeed; 46 72 procedure AppendList(Source: THyperText); 47 destructor Destroy; override;48 73 end; 49 74 … … 51 76 52 77 THistItem = class 53 Kind: Integer;78 Kind: TLinkCategory; 54 79 No: Integer; 55 80 Pos: Integer; … … 60 85 { THistItems } 61 86 62 THistItems = class(T FPGObjectList<THistItem>)63 function AddNew(Kind ,No, Pos: Integer; SearchContent: string): THistItem;87 THistItems = class(TObjectList<THistItem>) 88 function AddNew(Kind: TLinkCategory; No, Pos: Integer; SearchContent: string): THistItem; 64 89 end; 65 90 … … 78 103 procedure CloseBtnClick(Sender: TObject); 79 104 procedure PaintBox1MouseMove(Sender: TObject; Shift: TShiftState; 80 x, y: integer);105 X, Y: Integer); 81 106 procedure PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; 82 Shift: TShiftState; x, y: integer);107 Shift: TShiftState; X, Y: Integer); 83 108 procedure BackBtnClick(Sender: TObject); 84 109 procedure TopBtnClick(Sender: TObject); … … 89 114 procedure OffscreenPaint; override; 90 115 private 91 Kind: Integer;92 no: Integer;116 Kind: TLinkCategory; 117 No: Integer; 93 118 Sel: Integer; 94 119 CaptionColor: Integer; … … 100 125 SearchResult: THyperText; 101 126 HelpText: TStringTable; 102 ExtPic, TerrIcon: TDpiBitmap; 127 ExtPic: TDpiBitmap; 128 TerrIcon: TDpiBitmap; 103 129 ScrollBar: TPVScrollbar; 104 130 NoMap: TIsoMap; 105 131 x0: array [-2..180] of Integer; 106 procedure PaintTerrIcon( x, y, xSrc, ySrc: Integer);132 procedure PaintTerrIcon(X, Y, xSrc, ySrc: Integer); 107 133 procedure ScrollBarUpdate(Sender: TObject); 108 procedure Line( ca: TDpiCanvas; i: Integer; lit: Boolean);134 procedure Line(ACanvas: TDpiCanvas; I: Integer; Lit: Boolean); 109 135 procedure Prepare(sbPos: Integer = 0); 110 procedure ShowNewContentProcExecute(NewMode: Integer; HelpContext: string);136 procedure ShowNewContentProcExecute(NewMode: TWindowMode; HelpContext: string); 111 137 procedure WaterSign(x0, y0, iix: Integer); 112 138 procedure Search(SearchString: string); … … 117 143 Difficulty: Integer; 118 144 procedure ClearHistory; 119 procedure ShowNewContent(NewMode , Category,Index: Integer);145 procedure ShowNewContent(NewMode: TWindowMode; Category: TLinkCategory; Index: Integer); 120 146 function TextIndex(Item: string): Integer; 121 147 end; 122 148 123 var124 HelpDlg: THelpDlg;125 126 149 127 150 implementation 128 151 129 152 uses 130 Directories, ClientTools, Term, Tribes, Inp, Messg, UPixelPointer, Global,131 UKeyBindings;153 Directories, ClientTools, Term, Tribes, Inp, Messg, PixelPointer, Global, 154 KeyBindings; 132 155 133 156 {$R *.lfm} … … 138 161 139 162 THelpLineInfo = class 140 Format: Byte;163 Format: TTextFormat; 141 164 Picpix: Byte; 142 Link: Word; 165 Category: TLinkCategory; 166 Index: Integer; 167 CrossLink: Boolean; 143 168 procedure Assign(Source: THelpLineInfo); 144 169 end; 145 170 146 { THelpLineInfo } 147 148 procedure THelpLineInfo.Assign(Source: THelpLineInfo); 149 begin 150 Format := Source.Format; 151 PicPix := Source.PicPix; 152 Link := Source.Link; 153 end; 154 155 { THistItem } 156 157 procedure THistItem.Assign(Source: THistItem); 158 begin 159 Kind := Source.Kind; 160 No := Source.No; 161 Pos := Source.Pos; 162 SearchContent := Source.SearchContent; 163 end; 164 165 { THistItems } 166 167 function THistItems.AddNew(Kind, No, Pos: Integer; SearchContent: string 168 ): THistItem; 169 begin 170 Result := THistItem.Create; 171 Result.Kind := Kind; 172 Result.No := No; 173 Result.Pos := Pos; 174 Result.SearchContent := SearchContent; 175 Add(Result); 176 end; 177 178 procedure THyperText.AddLine(s: String; Format: integer; Picpix: integer; 179 LinkCategory: integer; LinkIndex: integer); 180 var 181 HelpLineInfo: THelpLineInfo; 182 begin 183 HelpLineInfo := THelpLineInfo.Create; 184 if LinkIndex < 0 then 185 LinkIndex := liInvalid; 186 HelpLineInfo.Format := Format; 187 HelpLineInfo.Picpix := Picpix; 188 HelpLineInfo.Link := LinkCategory shl 8 + LinkIndex; 189 AddObject(s, TObject(HelpLineInfo)); 190 end; 191 192 procedure THyperText.LineFeed; 193 begin 194 AddLine; 195 end; 196 197 procedure THyperText.AppendList(Source: THyperText); 198 var 199 I: Integer; 200 HelpLineInfo: THelpLineInfo; 201 begin 202 for I := 0 to Source.Count - 1 do begin 203 HelpLineInfo := THelpLineInfo.Create; 204 HelpLineInfo.Assign(THelpLineInfo(Source.Objects[I])); 205 AddObject(Source.Strings[I], HelpLineInfo); 206 end; 207 end; 208 209 destructor THyperText.Destroy; 210 begin 211 inherited; 212 end; 171 TSeeAlso = record 172 Kind: TLinkCategory; 173 No: Integer; 174 SeeKind: TLinkCategory; 175 SeeNo: Integer; 176 end; 213 177 214 178 const 215 { text formats } 216 pkNormal = 0; 217 pkCaption = 1; 218 pkSmallIcon = 2; 219 pkBigIcon = 3; 220 pkAdvIcon = 4; 221 pkTer = 5; 222 pkBigTer = 6; 223 pkFeature = 7; 224 pkDot = 8; 225 pkNormal_Dot = 9; 226 pkDomain = 10; 227 pkSection = 11; 228 pkBigFeature = 12; 229 pkExp = 13; 230 pkAITStat = 14; 231 pkExternal = 15; 232 pkModel = 16; 233 pkNormal_64 = 17; 234 pkIllu = 18; 235 pkLogo = 19; 236 pkTerImp = 20; 237 pkRightIcon = 21; 238 pkAdvIcon_AsPreq = 22; 239 pkSmallIcon_AsPreq = 23; 240 pkSpecialIcon = 24; 241 pkGov = 25; 242 243 nSeeAlso = 14; 244 SeeAlso: array [0 .. nSeeAlso - 1] of record 245 Kind: Integer; 246 no: Integer; 247 SeeKind: Integer; 248 SeeNo: Integer; 249 end = ((Kind: hkImp; no: imWalls; SeeKind: hkFeature; 179 SeeAlso: array[0..13] of TSeeAlso = ((Kind: hkImp; no: imWalls; SeeKind: hkFeature; 250 180 SeeNo: mcArtillery), (Kind: hkImp; no: imHydro; SeeKind: hkImp; 251 181 SeeNo: woHoover), (Kind: hkImp; no: imWalls; SeeKind: hkImp; … … 262 192 SeeKind: hkFeature; SeeNo: mcDefense)); 263 193 264 nTerrainHelp = 14; 265 TerrainHelp: array [0 .. nTerrainHelp - 1] of integer = (fGrass, fGrass + 12, 194 TerrainHelp: array[0..13] of Integer = (fGrass, fGrass + 12, 266 195 fPrairie, fForest, fJungle, fHills, fMountains, fSwamp, fTundra, fArctic, 267 fDesert, 3 * 12 { DeadLands } , fShore, fOcean); 268 269 nJobHelp = 8; 270 JobHelp: array [0 .. nJobHelp - 1] of integer = (jRoad, jRR, jCanal, jIrr, 196 fDesert, 3 * 12 { DeadLands }, fShore, fOcean); 197 198 JobHelp: array[0..7] of Integer = (jRoad, jRR, jCanal, jIrr, 271 199 jFarm, jMine, jFort, jBase); 272 200 201 { THelpLineInfo } 202 203 procedure THelpLineInfo.Assign(Source: THelpLineInfo); 204 begin 205 Format := Source.Format; 206 PicPix := Source.PicPix; 207 Category := Source.Category; 208 Index := Source.Index; 209 end; 210 211 { THistItem } 212 213 procedure THistItem.Assign(Source: THistItem); 214 begin 215 Kind := Source.Kind; 216 No := Source.No; 217 Pos := Source.Pos; 218 SearchContent := Source.SearchContent; 219 end; 220 221 { THistItems } 222 223 function THistItems.AddNew(Kind: TLinkCategory; No, Pos: Integer; SearchContent: string 224 ): THistItem; 225 begin 226 Result := THistItem.Create; 227 Result.Kind := Kind; 228 Result.No := No; 229 Result.Pos := Pos; 230 Result.SearchContent := SearchContent; 231 Add(Result); 232 end; 233 234 procedure THyperText.AddLine(S: String; Format: TTextFormat; Picpix: Integer; 235 LinkCategory: TLinkCategory = hkNoLink; LinkIndex: Integer = 0; 236 CrossLink: Boolean = False); 237 var 238 HelpLineInfo: THelpLineInfo; 239 begin 240 HelpLineInfo := THelpLineInfo.Create; 241 HelpLineInfo.Format := Format; 242 HelpLineInfo.Picpix := Picpix; 243 HelpLineInfo.Category := LinkCategory; 244 HelpLineInfo.Index := LinkIndex; 245 HelpLineInfo.CrossLink := CrossLink; 246 AddObject(S, HelpLineInfo); 247 end; 248 249 procedure THyperText.LineFeed; 250 begin 251 AddLine; 252 end; 253 254 procedure THyperText.AppendList(Source: THyperText); 255 var 256 I: Integer; 257 HelpLineInfo: THelpLineInfo; 258 begin 259 for I := 0 to Source.Count - 1 do begin 260 HelpLineInfo := THelpLineInfo.Create; 261 HelpLineInfo.Assign(THelpLineInfo(Source.Objects[I])); 262 AddObject(Source.Strings[I], HelpLineInfo); 263 end; 264 end; 265 273 266 procedure THelpDlg.FormCreate(Sender: TObject); 274 267 begin 275 inherited;276 268 NoMap := TIsoMap.Create; 277 269 … … 280 272 CaptionLeft := BackBtn.Left + BackBtn.Width; 281 273 CaptionRight := SearchBtn.Left; 282 inc(ModalFrameIndent, 29);274 Inc(ModalFrameIndent, 29); 283 275 MainText := THyperText.Create; 284 276 MainText.OwnsObjects := True; … … 290 282 291 283 HelpText := TStringTable.Create; 292 HelpText.LoadFromFile(LocalizedFilePath('Help' + DirectorySeparator + ' help.txt'));284 HelpText.LoadFromFile(LocalizedFilePath('Help' + DirectorySeparator + 'Help.txt')); 293 285 hADVHELP := HelpText.Gethandle('ADVHELP'); 294 286 hIMPHELP := HelpText.Gethandle('IMPHELP'); … … 316 308 end; 317 309 318 procedure THelpDlg.ShowNewContentProcExecute(NewMode: Integer;310 procedure THelpDlg.ShowNewContentProcExecute(NewMode: TWindowMode; 319 311 HelpContext: string); 320 312 begin 321 HelpDlg.ShowNewContent(NewMode, hkText, 322 HelpDlg.TextIndex(HelpContext)) 313 ShowNewContent(NewMode, hkText, TextIndex(HelpContext)); 323 314 end; 324 315 … … 356 347 if ScrollBar.Process(Msg) then begin 357 348 Sel := -1; 358 SmartUpdateContent( true)349 SmartUpdateContent(True) 359 350 end; 360 351 } … … 364 355 begin 365 356 if Sel <> -1 then begin 366 Line(Canvas, Sel, false);367 Sel := -1 357 Line(Canvas, Sel, False); 358 Sel := -1; 368 359 end; 369 360 end; … … 380 371 end; 381 372 382 procedure THelpDlg.Line( ca: TDpiCanvas; i: Integer; lit: Boolean);373 procedure THelpDlg.Line(ACanvas: TDpiCanvas; I: Integer; Lit: Boolean); 383 374 var 384 TextColor, x, y: Integer; 375 TextColor: TColor; 376 X, Y: Integer; 385 377 TextSize: TSize; 386 s: string;387 begin 388 s := MainText[ScrollBar.Position + i];389 if s= '' then378 S: string; 379 begin 380 S := MainText[ScrollBar.Position + I]; 381 if S = '' then 390 382 Exit; 391 x := x0[i];392 y := 2 + i* 24;393 if ca= Canvas then394 begin 395 x := x+ SideFrame;396 y := y + WideFrame397 end; 398 if THelpLineInfo(MainText.Objects[ScrollBar.Position + i]).Format383 X := x0[I]; 384 Y := 2 + I * 24; 385 if ACanvas = Canvas then 386 begin 387 X := X + SideFrame; 388 Y := Y + WideFrame; 389 end; 390 if THelpLineInfo(MainText.Objects[ScrollBar.Position + I]).Format 399 391 in [pkCaption, pkBigTer, pkRightIcon, pkBigFeature] then 400 392 begin 401 ca.Font.Assign(CaptionFont);402 { ca.brush.color:=CaptionColor;403 ca.FillRect(rect(x,i*24,x+24,i*24+24));404 ca.brush.color:=$FFFFFF;405 ca.FrameRect(rect(x+1,i*24+1,x+24-1,i*24+24-1));406 ca.Brush.Style:=bsClear; }407 DpiBit Canvas(ca, x, y- 4, 24, 24, HGrSystem.Data.Canvas, 1,393 ACanvas.Font.Assign(CaptionFont); 394 { ACanvas.brush.color:=CaptionColor; 395 ACanvas.FillRect(rect(X,I*24,X+24,I*24+24)); 396 ACanvas.Brush.Color:=$FFFFFF; 397 ACanvas.FrameRect(rect(X+1,I*24+1,X+24-1,I*24+24-1)); 398 ACanvas.Brush.Style:=bsClear; } 399 DpiBitBltCanvas(ACanvas, X, Y - 4, 24, 24, HGrSystem.Data.Canvas, 1, 408 400 146); 409 BiColorTextOut( ca, $FFFFFF, $7F007F, x + 10 - ca.Textwidth(s[1]) div 2,410 y - 3, s[1]);411 BiColorTextOut( ca, CaptionColor, $7F007F, x + 24, y - 3, copy(s, 2, 255));412 ca.Font.Assign(UniFont[ftNormal]);401 BiColorTextOut(ACanvas, $FFFFFF, $7F007F, X + 10 - ACanvas.Textwidth(S[1]) div 2, 402 Y - 3, S[1]); 403 BiColorTextOut(ACanvas, CaptionColor, $7F007F, X + 24, Y - 3, Copy(S, 2, 255)); 404 ACanvas.Font.Assign(UniFont[ftNormal]); 413 405 end 414 else if THelpLineInfo(MainText.Objects[ScrollBar.Position + i]).Format = pkSection 415 then 416 begin 417 ca.Font.Assign(CaptionFont); 418 BiColorTextOut(ca, CaptionColor, $7F007F, x, y - 3, s); 419 ca.Font.Assign(UniFont[ftNormal]); 406 else if THelpLineInfo(MainText.Objects[ScrollBar.Position + I]).Format = pkSection then 407 begin 408 ACanvas.Font.Assign(CaptionFont); 409 BiColorTextOut(ACanvas, CaptionColor, $7F007F, X, Y - 3, S); 410 ACanvas.Font.Assign(UniFont[ftNormal]); 420 411 end 421 412 else 422 413 begin 423 if (Kind = hkMisc) and ( no = miscMain) then424 ca.Font.Assign(CaptionFont);414 if (Kind = hkMisc) and (No = Integer(miscMain)) then 415 ACanvas.Font.Assign(CaptionFont); 425 416 TextColor := Colors.Canvas.Pixels[clkMisc, cliPaperText]; 426 if ca= Canvas then417 if ACanvas = Canvas then 427 418 begin 428 TextSize.cx := BiColorTextWidth( ca, s);429 TextSize.cy := ca.TextHeight(s);430 if y+ TextSize.cy >= WideFrame + InnerHeight then431 TextSize.cy := WideFrame + InnerHeight - y;432 FillSeamless( ca, x, y, TextSize.cx, TextSize.cy, -SideFrame,419 TextSize.cx := BiColorTextWidth(ACanvas, S); 420 TextSize.cy := ACanvas.TextHeight(S); 421 if Y + TextSize.cy >= WideFrame + InnerHeight then 422 TextSize.cy := WideFrame + InnerHeight - Y; 423 FillSeamless(ACanvas, X, Y, TextSize.cx, TextSize.cy, -SideFrame, 433 424 ScrollBar.Position * 24 - WideFrame, Paper); 434 425 end; 435 BiColorTextOut( ca, TextColor, $7F007F, x, y, s);426 BiColorTextOut(ACanvas, TextColor, $7F007F, X, Y, S); 436 427 if lit then 437 with cado428 with ACanvas do 438 429 begin 439 Assert( ca= Canvas);430 Assert(ACanvas = Canvas); 440 431 Pen.Color := TextColor; 441 MoveTo( x + 1, y+ TextSize.cy - 2);442 LineTo( x + TextSize.cx, y+ TextSize.cy - 2);432 MoveTo(X + 1, Y + TextSize.cy - 2); 433 LineTo(X + TextSize.cx, Y + TextSize.cy - 2); 443 434 end; 444 if (Kind = hkMisc) and ( no = miscMain) then445 ca.Font.Assign(UniFont[ftNormal]);446 end; 447 end; 448 449 procedure THelpDlg.WaterSign(x0, y0, iix: integer);435 if (Kind = hkMisc) and (No = Integer(miscMain)) then 436 ACanvas.Font.Assign(UniFont[ftNormal]); 437 end; 438 end; 439 440 procedure THelpDlg.WaterSign(x0, y0, iix: Integer); 450 441 const 451 442 nHeaven = 28; 452 443 MaxSum = 9 * 9 * 255 * 75 div 100; 453 444 var 454 x, y, dx, dy, xSrc, ySrc, Sum, xx: integer;455 Heaven: array [0..nHeaven] of integer;445 X, Y, dx, dy, xSrc, ySrc, Sum, xx: Integer; 446 Heaven: array [0..nHeaven] of Integer; 456 447 PaintPtr: TPixelPointer; 457 448 CoalPtr: TPixelPointer; … … 467 458 xSrc := iix mod 7 * xSizeBig; 468 459 ySrc := (iix div 7 + 1) * ySizeBig; 469 PaintPtr := PixelPointer(OffScreen, ScaleToNative(x0), ScaleToNative(y0));470 CoalPtr := PixelPointer(Templates.Data, ScaleToNative(xCoal), ScaleToNative(yCoal));460 PaintPtr := TPixelPointer.Create(OffScreen, ScaleToNative(x0), ScaleToNative(y0)); 461 CoalPtr := TPixelPointer.Create(Templates.Data, ScaleToNative(xCoal), ScaleToNative(yCoal)); 471 462 for dy := -1 to 1 do 472 ImpPtr[dy] := PixelPointer(BigImp, ScaleToNative(xSrc), ScaleToNative(ySrc));473 for y:= 0 to ScaleToNative(ySizeBig) * 2 - 1 do begin474 if ((ScaleToNative(y0) + y) >= 0) and ((ScaleToNative(y0) + y) < ScaleToNative(InnerHeight)) then begin463 ImpPtr[dy] := TPixelPointer.Create(BigImp, ScaleToNative(xSrc), ScaleToNative(ySrc)); 464 for Y := 0 to ScaleToNative(ySizeBig) * 2 - 1 do begin 465 if ((ScaleToNative(y0) + Y) >= 0) and ((ScaleToNative(y0) + Y) < ScaleToNative(InnerHeight)) then begin 475 466 for dy := -1 to 1 do 476 if ((Max( y + ScaleToNative(dy), 0) shr 1) >= 0) and ((Max(y+ ScaleToNative(dy), 0) shr 1) < ScaleToNative(ySizeBig)) then477 ImpPtr[dy].SetXY(0, Max( y+ ScaleToNative(dy), 0) shr 1);478 for x:= 0 to ScaleToNative(xSizeBig * 2) - 1 do begin467 if ((Max(Y + ScaleToNative(dy), 0) shr 1) >= 0) and ((Max(Y + ScaleToNative(dy), 0) shr 1) < ScaleToNative(ySizeBig)) then 468 ImpPtr[dy].SetXY(0, Max(Y + ScaleToNative(dy), 0) shr 1); 469 for X := 0 to ScaleToNative(xSizeBig * 2) - 1 do begin 479 470 Sum := 0; 480 471 for dx := -1 to 1 do begin 481 xx := Max(( x+ ScaleToNative(dx)), 0) shr 1;472 xx := Max((X + ScaleToNative(dx)), 0) shr 1; 482 473 for dy := -1 to 1 do begin 483 474 ImpPtr[dy].SetX(xx); 484 if (( y + ScaleToNative(dy)) shr 1 < 0) or ((y+ ScaleToNative(dy)) shr 1 >= ScaleToNative(ySizeBig)) or485 (( x + ScaleToNative(dx)) shr 1 < 0) or ((x+ ScaleToNative(dx)) shr 1 >= ScaleToNative(xSizeBig)) or486 (( y+ ScaleToNative(dy)) shr 1 < ScaleToNative(nHeaven)) and475 if ((Y + ScaleToNative(dy)) shr 1 < 0) or ((Y + ScaleToNative(dy)) shr 1 >= ScaleToNative(ySizeBig)) or 476 ((X + ScaleToNative(dx)) shr 1 < 0) or ((X + ScaleToNative(dx)) shr 1 >= ScaleToNative(xSizeBig)) or 477 ((Y + ScaleToNative(dy)) shr 1 < ScaleToNative(nHeaven)) and 487 478 (ImpPtr[dy].Pixel^.B shl 16 + ImpPtr[dy].Pixel^.G shl 8 + 488 ImpPtr[dy].Pixel^.R = Heaven[(ScaleFromNative( y+ ScaleToNative(dy))) shr 1]) then479 ImpPtr[dy].Pixel^.R = Heaven[(ScaleFromNative(Y + ScaleToNative(dy))) shr 1]) then 489 480 Sum := Sum + 9 * 255 490 481 else … … 493 484 end; 494 485 end; 495 if Sum < MaxSum then begin // no saturation486 if Sum < MaxSum then begin // No saturation 496 487 Sum := 1 shl 22 - (MaxSum - Sum) * (256 - CoalPtr.Pixel^.B * 2); 497 488 PaintPtr.Pixel^.B := Min(PaintPtr.Pixel^.B * Sum shr 22, 255); … … 510 501 end; 511 502 512 procedure THelpDlg.PaintTerrIcon( x, y, xSrc, ySrc: integer);503 procedure THelpDlg.PaintTerrIcon(X, Y, xSrc, ySrc: Integer); 513 504 begin 514 505 with NoMap do begin 515 Frame(OffScreen.Canvas, x - 1, y - 1, x + xSizeBig, y+ ySizeBig,506 Frame(OffScreen.Canvas, X - 1, Y - 1, X + xSizeBig, Y + ySizeBig, 516 507 $000000, $000000); 517 508 if 2 * yyt < 40 then begin 518 Sprite(OffScreen, HGrTerrain, x, y, 56, 2 * yyt, xSrc, ySrc);519 Sprite(OffScreen, HGrTerrain, x, y+ 2 * yyt, 56, 40 - 2 * yyt,509 Sprite(OffScreen, HGrTerrain, X, Y, 56, 2 * yyt, xSrc, ySrc); 510 Sprite(OffScreen, HGrTerrain, X, Y + 2 * yyt, 56, 40 - 2 * yyt, 520 511 xSrc, ySrc); 521 512 end else 522 Sprite(OffScreen, HGrTerrain, x, y, 56, 40, xSrc, ySrc);523 Sprite(OffScreen, HGrTerrain, x, y, xxt, yyt, xSrc + xxt, ySrc + yyt);524 Sprite(OffScreen, HGrTerrain, x, y+ yyt, xxt, 40 - yyt, xSrc + xxt, ySrc);525 Sprite(OffScreen, HGrTerrain, x + xxt, y, 56 - xxt, yyt, xSrc, ySrc + yyt);526 Sprite(OffScreen, HGrTerrain, x + xxt, y+ yyt, 56 - xxt, 40 - yyt,513 Sprite(OffScreen, HGrTerrain, X, Y, 56, 40, xSrc, ySrc); 514 Sprite(OffScreen, HGrTerrain, X, Y, xxt, yyt, xSrc + xxt, ySrc + yyt); 515 Sprite(OffScreen, HGrTerrain, X, Y + yyt, xxt, 40 - yyt, xSrc + xxt, ySrc); 516 Sprite(OffScreen, HGrTerrain, X + xxt, Y, 56 - xxt, yyt, xSrc, ySrc + yyt); 517 Sprite(OffScreen, HGrTerrain, X + xxt, Y + yyt, 56 - xxt, 40 - yyt, 527 518 xSrc, ySrc); 528 519 end; … … 531 522 procedure THelpDlg.OffscreenPaint; 532 523 var 533 i, j, yl, srcno, ofs, cnt, y: Integer;534 s: string;524 I, J, yl, srcno, ofs, cnt, Y: Integer; 525 S: string; 535 526 HelpLineInfo: THelpLineInfo; 536 527 begin … … 542 533 begin 543 534 Font.Assign(UniFont[ftNormal]); 544 for i:= -ScrollBar.Position to InnerHeight div 24 do545 if ScrollBar.Position + i< MainText.Count then535 for I := -ScrollBar.Position to InnerHeight div 24 do 536 if ScrollBar.Position + I < MainText.Count then 546 537 begin 547 HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + i]);538 HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + I]); 548 539 if HelpLineInfo.Format = pkExternal then 549 540 begin 550 541 yl := ExtPic.Height; 551 if 4 + i* 24 + yl > InnerHeight then552 yl := InnerHeight - (4 + i* 24);553 DpiBit Canvas(OffScreen.Canvas, 8, 4 + i* 24, ExtPic.Width, yl, ExtPic.Canvas,542 if 4 + I * 24 + yl > InnerHeight then 543 yl := InnerHeight - (4 + I * 24); 544 DpiBitBltCanvas(OffScreen.Canvas, 8, 4 + I * 24, ExtPic.Width, yl, ExtPic.Canvas, 554 545 0, 0); 555 546 end; 556 547 end; 557 for i:= -2 to InnerHeight div 24 do558 if (ScrollBar.Position + i >= 0) and (ScrollBar.Position + i< MainText.Count) then548 for I := -2 to InnerHeight div 24 do 549 if (ScrollBar.Position + I >= 0) and (ScrollBar.Position + I < MainText.Count) then 559 550 begin 560 HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + i]);561 if HelpLineInfo.Link <> 0then551 HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + I]); 552 if (HelpLineInfo.Category <> hkNoLink) or (HelpLineInfo.Index <> 0) then 562 553 begin 563 if (Kind = hkMisc) and ( no = miscSearchResult) then564 Sprite(OffScreen, HGrSystem, 18, 9 + i* 24, 8, 8, 90, 16)554 if (Kind = hkMisc) and (No = Integer(miscSearchResult)) then 555 Sprite(OffScreen, HGrSystem, 18, 9 + I * 24, 8, 8, 90, 16) 565 556 else if HelpLineInfo.Format in [pkSmallIcon_AsPreq, pkAdvIcon_AsPreq] 566 557 then 567 Sprite(OffScreen, HGrSystem, 12, i* 24 + 5, 14, 14, 65, 20)568 else if HelpLineInfo. Link and (hkCrossLink shl 8) <> 0then569 Sprite(OffScreen, HGrSystem, 12, i* 24 + 5, 14, 14, 80, 1)570 else if not((Kind = hkMisc) and ( no = miscMain)) then571 Sprite(OffScreen, HGrSystem, 10, i* 24 + 6, 14, 14, 65, 1);572 x0[ i] := 24;558 Sprite(OffScreen, HGrSystem, 12, I * 24 + 5, 14, 14, 65, 20) 559 else if HelpLineInfo.CrossLink then 560 Sprite(OffScreen, HGrSystem, 12, I * 24 + 5, 14, 14, 80, 1) 561 else if not((Kind = hkMisc) and (No = Integer(miscMain))) then 562 Sprite(OffScreen, HGrSystem, 10, I * 24 + 6, 14, 14, 65, 1); 563 x0[I] := 24; 573 564 end 574 565 else 575 x0[ i] := 0;566 x0[I] := 0; 576 567 case HelpLineInfo.Format of 577 568 pkLogo: 578 569 begin 579 Server(sGetVersion, 0, 0, j);580 s := Format('%d.%d.%d', [j shr 16 and $FF, jshr 8 and $FF,581 jand $FF]);582 PaintLogo(OffScreen.Canvas, (InnerWidth - 122) div 2, i* 24 + 1,570 Server(sGetVersion, 0, 0, J); 571 S := Format('%d.%d.%d', [J shr 16 and $FF, J shr 8 and $FF, 572 J and $FF]); 573 PaintLogo(OffScreen.Canvas, (InnerWidth - 122) div 2, I * 24 + 1, 583 574 HGrSystem.Data.Canvas.Pixels[95, 1], $000000); 584 575 Font.Assign(UniFont[ftSmall]); 585 576 BiColorTextOut(OffScreen.Canvas, $000000, $7F007F, 586 (InnerWidth - Textwidth( s)) div 2, i * 24 + 26, s);577 (InnerWidth - Textwidth(S)) div 2, I * 24 + 26, S); 587 578 Font.Assign(UniFont[ftNormal]); 588 579 end; 589 580 pkSmallIcon, pkSmallIcon_AsPreq: 590 581 begin 591 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[ i], 2 - 1 + i* 24,592 8 + xSizeSmall + x0[ i], 2 + 20 + i* 24, $000000, $000000);582 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[I], 2 - 1 + I * 24, 583 8 + xSizeSmall + x0[I], 2 + 20 + I * 24, $000000, $000000); 593 584 if HelpLineInfo.Picpix = imPalace then 594 DpiBit Canvas(OffScreen.Canvas, 8 + x0[i], 2 + i* 24,585 DpiBitBltCanvas(OffScreen.Canvas, 8 + x0[I], 2 + I * 24, 595 586 xSizeSmall, ySizeSmall, SmallImp.Canvas, 596 587 0 * xSizeSmall, 1 * ySizeSmall) 597 588 else 598 DpiBit Canvas(OffScreen.Canvas, 8 + x0[i], 2 + i* 24,589 DpiBitBltCanvas(OffScreen.Canvas, 8 + x0[I], 2 + I * 24, 599 590 xSizeSmall, ySizeSmall, SmallImp.Canvas, 600 591 HelpLineInfo.Picpix mod 7 * xSizeSmall, 601 592 (HelpLineInfo.Picpix + SystemIconLines * 7) div 7 * 602 593 ySizeSmall); 603 x0[ i] := x0[i] + (8 + 8 + 36);594 x0[I] := x0[I] + (8 + 8 + 36); 604 595 end; 605 596 pkBigIcon: 606 597 begin 607 FrameImage(OffScreen.Canvas, BigImp, x0[ i] + 12, i* 24 - 7, 56,598 FrameImage(OffScreen.Canvas, BigImp, x0[I] + 12, I * 24 - 7, 56, 608 599 40, HelpLineInfo.Picpix mod 7 * xSizeBig, 609 600 HelpLineInfo.Picpix div 7 * ySizeBig); 610 x0[ i] := 64 + 8 + 8 + x0[i];601 x0[I] := 64 + 8 + 8 + x0[I]; 611 602 end; 612 603 pkSpecialIcon: … … 615 606 0: 616 607 FrameImage(OffScreen.Canvas, HGrSystem2.Data, 617 12 + x0[ i], -7 + i* 24, 56, 40, 137, 127);608 12 + x0[I], -7 + I * 24, 56, 40, 137, 127); 618 609 1: 619 610 with NoMap do begin 620 PaintTerrIcon(12 + x0[ i], -7 + i* 24,611 PaintTerrIcon(12 + x0[I], -7 + I * 24, 621 612 1 + 3 * (xxt * 2 + 1), 1 + yyt); 622 613 if 2 * yyt < 40 then 623 Sprite(OffScreen, HGrTerrain, 12 + x0[ i], -7 + 4 + i* 24,614 Sprite(OffScreen, HGrTerrain, 12 + x0[I], -7 + 4 + I * 24, 624 615 56, 2 * yyt, 1 + 3 * (xxt * 2 + 1) + xxt - 28, 625 616 1 + yyt + 1 * (yyt * 3 + 1)) 626 617 else 627 Sprite(OffScreen, HGrTerrain, 12 + x0[ i],628 -7 + 4 + i* 24 - 4, 56, 40, 1 + 3 * (xxt * 2 + 1) + xxt618 Sprite(OffScreen, HGrTerrain, 12 + x0[I], 619 -7 + 4 + I * 24 - 4, 56, 40, 1 + 3 * (xxt * 2 + 1) + xxt 629 620 - 28, 1 + yyt + 1 * (yyt * 3 + 1) + yyt - 20); 630 621 end; 631 622 2: 632 623 with NoMap do begin 633 PaintTerrIcon(12 + x0[ i], -7 + i* 24,624 PaintTerrIcon(12 + x0[I], -7 + I * 24, 634 625 1 + 7 * (xxt * 2 + 1), 1 + yyt + 4 * (yyt * 3 + 1)); 635 626 if 2 * yyt < 40 then 636 Sprite(OffScreen, HGrTerrain, 12 + x0[ i], -7 + 4 + i* 24,627 Sprite(OffScreen, HGrTerrain, 12 + x0[I], -7 + 4 + I * 24, 637 628 56, 32, 1 + 4 * (xxt * 2 + 1) + xxt - 28, 638 629 1 + yyt + 12 * (yyt * 3 + 1) + yyt - 16) 639 630 else 640 Sprite(OffScreen, HGrTerrain, 12 + x0[ i], -7 + 4 + i* 24,631 Sprite(OffScreen, HGrTerrain, 12 + x0[I], -7 + 4 + I * 24, 641 632 56, 32, 1 + 4 * (xxt * 2 + 1) + xxt - 28, 642 633 1 + yyt + 12 * (yyt * 3 + 1) + yyt - 16) 643 634 end; 644 635 end; 645 x0[ i] := 64 + 8 + 8 + x0[i];636 x0[I] := 64 + 8 + 8 + x0[I]; 646 637 end; 647 638 pkDomain: 648 639 begin 649 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[ i], 2 - 1 + i* 24,650 8 + 36 + x0[ i], 2 + 20 + i* 24, $000000, $000000);651 Dump(OffScreen, HGrSystem, 8 + x0[ i], 2 + i* 24, 36, 20,640 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[I], 2 - 1 + I * 24, 641 8 + 36 + x0[I], 2 + 20 + I * 24, $000000, $000000); 642 Dump(OffScreen, HGrSystem, 8 + x0[I], 2 + I * 24, 36, 20, 652 643 75 + HelpLineInfo.Picpix * 37, 295); 653 x0[ i] := x0[i] + (8 + 8 + 36);644 x0[I] := x0[I] + (8 + 8 + 36); 654 645 end; 655 646 pkAdvIcon, pkAdvIcon_AsPreq: 656 647 begin 657 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[ i], 2 - 1 + i* 24,658 8 + xSizeSmall + x0[ i], 2 + ySizeSmall + i* 24,648 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[I], 2 - 1 + I * 24, 649 8 + xSizeSmall + x0[I], 2 + ySizeSmall + I * 24, 659 650 $000000, $000000); 660 651 if AdvIcon[HelpLineInfo.Picpix] < 84 then 661 DpiBit Canvas(OffScreen.Canvas, 8 + x0[i], 2 + i* 24,652 DpiBitBltCanvas(OffScreen.Canvas, 8 + x0[I], 2 + I * 24, 662 653 xSizeSmall, ySizeSmall, SmallImp.Canvas, 663 654 (AdvIcon[HelpLineInfo.Picpix] + SystemIconLines * 7) mod 7 * … … 665 656 7) div 7 * ySizeSmall) 666 657 else 667 Dump(OffScreen, HGrSystem, 8 + x0[ i], 2 + i* 24, 36, 20,658 Dump(OffScreen, HGrSystem, 8 + x0[I], 2 + I * 24, 36, 20, 668 659 1 + (AdvIcon[HelpLineInfo.Picpix] - 84) mod 8 * 37, 669 660 295 + (AdvIcon[HelpLineInfo.Picpix] - 84) div 8 * 21); 670 j:= AdvValue[HelpLineInfo.Picpix] div 1000;671 DpiBit Canvas(OffScreen.Canvas, x0[i] + 4, 4 + i* 24, 14, 14,672 HGrSystem.Mask.Canvas, 127 + j* 15, 85, SRCAND);673 Sprite(OffScreen, HGrSystem, x0[ i] + 3, 3 + i* 24, 14, 14,674 127 + j* 15, 85);675 x0[ i] := x0[i] + (8 + 8 + 36);661 J := AdvValue[HelpLineInfo.Picpix] div 1000; 662 DpiBitBltCanvas(OffScreen.Canvas, x0[I] + 4, 4 + I * 24, 14, 14, 663 HGrSystem.Mask.Canvas, 127 + J * 15, 85, SRCAND); 664 Sprite(OffScreen, HGrSystem, x0[I] + 3, 3 + I * 24, 14, 14, 665 127 + J * 15, 85); 666 x0[I] := x0[I] + (8 + 8 + 36); 676 667 end; 677 668 pkRightIcon: 678 669 begin 679 670 if Imp[HelpLineInfo.Picpix].Kind <> ikWonder then 680 ImpImage(OffScreen.Canvas, InnerWidth - (40 + xSizeBig), i* 24,671 ImpImage(OffScreen.Canvas, InnerWidth - (40 + xSizeBig), I * 24, 681 672 HelpLineInfo.Picpix, gDespotism) 682 673 else 683 WaterSign(InnerWidth - (40 + 2 * xSizeBig), i* 24 - 8,674 WaterSign(InnerWidth - (40 + 2 * xSizeBig), I * 24 - 8, 684 675 HelpLineInfo.Picpix + 7); 685 x0[ i] := x0[i] + 8;676 x0[I] := x0[I] + 8; 686 677 end; 687 678 pkIllu: 688 WaterSign(8, i* 24 - 8, HelpLineInfo.Picpix);679 WaterSign(8, I * 24 - 8, HelpLineInfo.Picpix); 689 680 pkBigFeature: 690 681 begin 691 682 cnt := 0; 692 for j:= nDomains - 1 downto 0 do693 if 1 shl jand Feature[HelpLineInfo.Picpix].Domains <> 0 then683 for J := nDomains - 1 downto 0 do 684 if 1 shl J and Feature[HelpLineInfo.Picpix].Domains <> 0 then 694 685 begin 695 inc(cnt);686 Inc(cnt); 696 687 Dump(OffScreen, HGrSystem, InnerWidth - 38 - 38 * cnt, 697 i * 24 + 1, 36, 20, 75 + j* 37, 295);698 ScreenTools.Frame(OffScreen.Canvas, InnerWidth - 39 - 38 * cnt, i* 24,699 InnerWidth - 2 - 38 * cnt, i* 24 + 21, $000000, $000000);688 I * 24 + 1, 36, 20, 75 + J * 37, 295); 689 ScreenTools.Frame(OffScreen.Canvas, InnerWidth - 39 - 38 * cnt, I * 24, 690 InnerWidth - 2 - 38 * cnt, I * 24 + 21, $000000, $000000); 700 691 end; 701 692 DarkGradient(OffScreen.Canvas, InnerWidth - 38 - 38 * cnt, 702 i* 24 + 23, cnt * 38 - 2, 1);693 I * 24 + 23, cnt * 38 - 2, 1); 703 694 ofs := InnerWidth - (39 + 7) - 19 * cnt; 704 695 with OffScreen.Canvas do 705 696 begin 706 Brush. color := $C0C0C0;707 FrameRect(Rect(ofs, 1 + 23 + i* 24, ofs + 14,708 15 + 23 + i* 24));697 Brush.Color := $C0C0C0; 698 FrameRect(Rect(ofs, 1 + 23 + I * 24, ofs + 14, 699 15 + 23 + I * 24)); 709 700 Brush.Style := bsClear; 710 Sprite(OffScreen, HGrSystem, ofs + 2, 3 + 23 + i* 24, 10, 10,701 Sprite(OffScreen, HGrSystem, ofs + 2, 3 + 23 + I * 24, 10, 10, 711 702 66 + HelpLineInfo.Picpix mod 11 * 11, 712 703 137 + HelpLineInfo.Picpix div 11 * 11); 713 704 end; 714 x0[ i] := x0[i] + 8;705 x0[I] := x0[I] + 8; 715 706 end; 716 707 pkTer, pkBigTer: 717 708 with NoMap do begin 718 709 if HelpLineInfo.Format = pkBigTer then 719 y := i* 24 - 3 + yyt710 Y := I * 24 - 3 + yyt 720 711 else 721 y := i* 24 + 13;712 Y := I * 24 + 13; 722 713 if HelpLineInfo.Picpix >= 3 * 12 then 723 714 srcno := 2 * 9 + 6 … … 730 721 if HelpLineInfo.Format = pkTer then 731 722 begin 732 ofs := x0[ i] + 8;733 x0[ i] := 2 * xxt + 8 + ofs;723 ofs := x0[I] + 8; 724 x0[I] := 2 * xxt + 8 + ofs; 734 725 end 735 726 else 736 727 begin 737 728 ofs := InnerWidth - (2 * xxt + 38); 738 x0[ i] := x0[i] + 8;729 x0[I] := x0[I] + 8; 739 730 end; 740 731 if srcno >= fJungle then 741 732 begin 742 Sprite(OffScreen, HGrTerrain, ofs + 4, y- yyt + 2, xxt * 2 - 8,733 Sprite(OffScreen, HGrTerrain, ofs + 4, Y - yyt + 2, xxt * 2 - 8, 743 734 yyt * 2 - 4, 5 + 2 * (xxt * 2 + 1), 744 735 3 + yyt + 2 * (yyt * 3 + 1)); 745 Sprite(OffScreen, HGrTerrain, ofs, y- 2 * yyt, xxt * 2,736 Sprite(OffScreen, HGrTerrain, ofs, Y - 2 * yyt, xxt * 2, 746 737 yyt * 3 - 2, 1 + srcno mod 9 * (xxt * 2 + 1), 747 738 1 + srcno div 9 * (yyt * 3 + 1)); 748 739 end 749 740 else 750 Sprite(OffScreen, HGrTerrain, ofs + 4, y- yyt + 2, xxt * 2 - 8,741 Sprite(OffScreen, HGrTerrain, ofs + 4, Y - yyt + 2, xxt * 2 - 8, 751 742 yyt * 2 - 4, 5 + srcno mod 9 * (xxt * 2 + 1), 752 743 3 + yyt + srcno div 9 * (yyt * 3 + 1)); 753 744 if HelpLineInfo.Picpix >= 3 * 12 then { rare resource } 754 Sprite(OffScreen, HGrTerrain, ofs, y- 2 * yyt, xxt * 2,745 Sprite(OffScreen, HGrTerrain, ofs, Y - 2 * yyt, xxt * 2, 755 746 yyt * 3, 1 + 8 * (xxt * 2 + 1), 756 747 1 + (HelpLineInfo.Picpix - 2 * 12) * (yyt * 3 + 1)) … … 764 755 srcno := 18 + 8 + (HelpLineInfo.Picpix mod 12 - 9) * 18; 765 756 srcno := srcno + HelpLineInfo.Picpix div 12 * 9; 766 Sprite(OffScreen, HGrTerrain, ofs, y- 2 * yyt, xxt * 2,757 Sprite(OffScreen, HGrTerrain, ofs, Y - 2 * yyt, xxt * 2, 767 758 yyt * 3, 1 + srcno mod 9 * (xxt * 2 + 1), 768 759 1 + srcno div 9 * (yyt * 3 + 1)); … … 774 765 if HelpLineInfo.Picpix = 5 then 775 766 begin // display mine on hills 776 Sprite(OffScreen, HGrTerrain, ofs + 4, i* 24 + 13 - yyt,767 Sprite(OffScreen, HGrTerrain, ofs + 4, I * 24 + 13 - yyt, 777 768 xxt * 2 - 8, yyt * 2 - 4, 5 + 2 * (xxt * 2 + 1), 778 769 3 + yyt + 2 * (yyt * 3 + 1)); … … 781 772 else 782 773 srcno := fPrairie; // display on prairie 783 Sprite(OffScreen, HGrTerrain, ofs + 4, i* 24 + 13 - yyt,774 Sprite(OffScreen, HGrTerrain, ofs + 4, I * 24 + 13 - yyt, 784 775 xxt * 2 - 8, yyt * 2 - 4, 5 + srcno mod 9 * (xxt * 2 + 1), 785 776 3 + yyt + srcno div 9 * (yyt * 3 + 1)); 786 777 if HelpLineInfo.Picpix = 12 then { river } 787 Sprite(OffScreen, HGrTerrain, ofs, i* 24 + 11 - yyt, xxt * 2,778 Sprite(OffScreen, HGrTerrain, ofs, I * 24 + 11 - yyt, xxt * 2, 788 779 yyt * 2, 1 + 5 * (xxt * 2 + 1), 1 + yyt + 13 * (yyt * 3 + 1)) 789 780 else if HelpLineInfo.Picpix >= 3 then { improvement 2 } 790 781 begin 791 782 if HelpLineInfo.Picpix = 6 then 792 Sprite(OffScreen, HGrTerrain, ofs, i* 24 + 11 - 2 * yyt,783 Sprite(OffScreen, HGrTerrain, ofs, I * 24 + 11 - 2 * yyt, 793 784 xxt * 2, yyt * 3, 1 + 7 * (xxt * 2 + 1), 794 785 1 + 12 * (yyt * 3 + 1)); 795 Sprite(OffScreen, HGrTerrain, ofs, i* 24 + 11 - 2 * yyt,786 Sprite(OffScreen, HGrTerrain, ofs, I * 24 + 11 - 2 * yyt, 796 787 xxt * 2, yyt * 3, 1 + (HelpLineInfo.Picpix - 3) * 797 788 (xxt * 2 + 1), 1 + 12 * (yyt * 3 + 1)) … … 799 790 else { improvement 1 } 800 791 begin 801 Sprite(OffScreen, HGrTerrain, ofs, i* 24 + 11 - 2 * yyt,792 Sprite(OffScreen, HGrTerrain, ofs, I * 24 + 11 - 2 * yyt, 802 793 xxt * 2, yyt * 3, 1 + 2 * (xxt * 2 + 1), 803 794 1 + (9 + HelpLineInfo.Picpix) * (yyt * 3 + 1)); 804 Sprite(OffScreen, HGrTerrain, ofs, i* 24 + 11 - 2 * yyt,795 Sprite(OffScreen, HGrTerrain, ofs, I * 24 + 11 - 2 * yyt, 805 796 xxt * 2, yyt * 3, 1 + 5 * (xxt * 2 + 1), 806 797 1 + (9 + HelpLineInfo.Picpix) * (yyt * 3 + 1)) 807 798 end; 808 x0[ i] := x0[i] + 8;799 x0[I] := x0[I] + 8; 809 800 end; 810 801 pkModel: 811 802 begin 812 FrameImage(OffScreen.Canvas, BigImp, x0[ i] + 12, i* 24 - 7,803 FrameImage(OffScreen.Canvas, BigImp, x0[I] + 12, I * 24 - 7, 813 804 56, 40, 0, 0); 814 Sprite(OffScreen, HGrStdUnits, x0[ i] + 8, i* 24 - 11, 64, 44,805 Sprite(OffScreen, HGrStdUnits, x0[I] + 8, I * 24 - 11, 64, 44, 815 806 1 + HelpLineInfo.Picpix mod 10 * 65, 816 807 1 + HelpLineInfo.Picpix div 10 * 49); 817 x0[ i] := 64 + 8 + 8 + x0[i];808 x0[I] := 64 + 8 + 8 + x0[I]; 818 809 end; 819 810 pkFeature: 820 811 begin 821 DarkGradient(OffScreen.Canvas, x0[ i] + 8 - 1,822 7 + i* 24 - 3, 16, 1);823 ScreenTools.Frame(OffScreen.Canvas, x0[ i] + 8, 7 + i * 24 - 2, x0[i] + 8 + 13,824 7 + i* 24 - 2 + 13, $C0C0C0, $C0C0C0);825 Sprite(OffScreen, HGrSystem, x0[ i] + 8 + 2, 7 + i* 24, 10, 10,812 DarkGradient(OffScreen.Canvas, x0[I] + 8 - 1, 813 7 + I * 24 - 3, 16, 1); 814 ScreenTools.Frame(OffScreen.Canvas, x0[I] + 8, 7 + I * 24 - 2, x0[I] + 8 + 13, 815 7 + I * 24 - 2 + 13, $C0C0C0, $C0C0C0); 816 Sprite(OffScreen, HGrSystem, x0[I] + 8 + 2, 7 + I * 24, 10, 10, 826 817 66 + HelpLineInfo.Picpix mod 11 * 11, 827 818 137 + HelpLineInfo.Picpix div 11 * 11); 828 x0[ i] := x0[i] + 8 + 8 + 2 + 13;819 x0[I] := x0[I] + 8 + 8 + 2 + 13; 829 820 end; 830 821 pkExp: 831 822 begin 832 ScreenTools.Frame(OffScreen.Canvas, 20 - 1, 8 - 4 + i* 24, 20 + 12,833 8 + 11 + i* 24, $000000, $000000);834 Dump(OffScreen, HGrSystem, 20, 8 - 3 + i* 24, 12, 14,823 ScreenTools.Frame(OffScreen.Canvas, 20 - 1, 8 - 4 + I * 24, 20 + 12, 824 8 + 11 + I * 24, $000000, $000000); 825 Dump(OffScreen, HGrSystem, 20, 8 - 3 + I * 24, 12, 14, 835 826 121 + HelpLineInfo.Picpix * 13, 28); 836 x0[ i] := 20 + 8 + 11;827 x0[I] := 20 + 8 + 11; 837 828 end; 838 829 pkAITStat: 839 830 begin 840 Sprite(OffScreen, HGrSystem, 20, 6 + i* 24, 14, 14,831 Sprite(OffScreen, HGrSystem, 20, 6 + I * 24, 14, 14, 841 832 1 + HelpLineInfo.Picpix * 15, 316); 842 x0[ i] := 20 + 8 + 11;833 x0[I] := 20 + 8 + 11; 843 834 end; 844 835 pkGov: 845 836 begin 846 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[ i], 2 - 1 + i* 24,847 8 + xSizeSmall + x0[ i], 2 + 20 + i* 24, $000000, $000000);848 DpiBit Canvas(OffScreen.Canvas, 8 + x0[i], 2 + i* 24, xSizeSmall,837 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[I], 2 - 1 + I * 24, 838 8 + xSizeSmall + x0[I], 2 + 20 + I * 24, $000000, $000000); 839 DpiBitBltCanvas(OffScreen.Canvas, 8 + x0[I], 2 + I * 24, xSizeSmall, 849 840 ySizeSmall, SmallImp.Canvas, (HelpLineInfo.Picpix - 1) * 850 841 xSizeSmall, ySizeSmall); 851 x0[ i] := x0[i] + (8 + 8 + 36);842 x0[I] := x0[I] + (8 + 8 + 36); 852 843 end; 853 844 pkDot: 854 845 begin 855 Sprite(OffScreen, HGrSystem, x0[ i] + 18, 9 + i* 24, 8,846 Sprite(OffScreen, HGrSystem, x0[I] + 18, 9 + I * 24, 8, 856 847 8, 81, 16); 857 x0[ i] := 20 + 8 + 4;848 x0[I] := 20 + 8 + 4; 858 849 end; 859 850 pkNormal_Dot: 860 x0[ i] := 20 + 8 + 4;851 x0[I] := 20 + 8 + 4; 861 852 pkNormal_64: 862 x0[ i] := 64 + 8 + 8;853 x0[I] := 64 + 8 + 8; 863 854 else 864 x0[ i] := x0[i] + 8;855 x0[I] := x0[I] + 8; 865 856 end; 866 Self.Line(OffScreen.Canvas, i, False)857 Self.Line(OffScreen.Canvas, I, False) 867 858 end; 868 859 end; … … 873 864 begin 874 865 Sel := -1; 875 SmartUpdateContent( true)876 end; 877 878 procedure THelpDlg.Prepare(sbPos: integer = 0);866 SmartUpdateContent(True); 867 end; 868 869 procedure THelpDlg.Prepare(sbPos: Integer = 0); 879 870 var 880 i, j, Special, Domain, Headline, TerrType, TerrSubType: integer;881 s: string;882 ps: pchar;871 I, J, Special, Domain, Headline, TerrType, TerrSubType: Integer; 872 S: string; 873 ps: PChar; 883 874 List: THyperText; 884 875 CheckSeeAlso: Boolean; 885 876 886 procedure AddAdvance( i: integer);887 begin 888 MainText.AddLine(Phrases.Lookup('ADVANCES', i), pkAdvIcon, i,889 hkAdv + hkCrossLink, i);890 end; 891 892 procedure AddPreqAdv( i: integer);893 begin 894 MainText.AddLine(Phrases.Lookup('ADVANCES', i), pkAdvIcon_AsPreq, i,895 hkAdv + hkCrossLink, i);896 end; 897 898 procedure AddImprovement( i: integer);899 begin 900 MainText.AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon, i,901 hkImp + hkCrossLink, i);902 end; 903 904 procedure AddPreqImp( i: integer);905 begin 906 MainText.AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon_AsPreq, i,907 hkImp + hkCrossLink, i);908 end; 909 910 procedure AddTerrain( i: integer);877 procedure AddAdvance(I: Integer); 878 begin 879 MainText.AddLine(Phrases.Lookup('ADVANCES', I), pkAdvIcon, I, 880 hkAdv, I, True); 881 end; 882 883 procedure AddPreqAdv(I: Integer); 884 begin 885 MainText.AddLine(Phrases.Lookup('ADVANCES', I), pkAdvIcon_AsPreq, I, 886 hkAdv, I, True); 887 end; 888 889 procedure AddImprovement(I: Integer); 890 begin 891 MainText.AddLine(Phrases.Lookup('IMPROVEMENTS', I), pkSmallIcon, I, 892 hkImp, I, True); 893 end; 894 895 procedure AddPreqImp(I: Integer); 896 begin 897 MainText.AddLine(Phrases.Lookup('IMPROVEMENTS', I), pkSmallIcon_AsPreq, I, 898 hkImp, I, True); 899 end; 900 901 procedure AddTerrain(I: Integer); 911 902 begin 912 903 if MainText.Count > 1 then … … 914 905 MainText.LineFeed; 915 906 end; 916 MainText.AddLine(Phrases.Lookup('TERRAIN', i), pkTer, i, hkTer, i);917 end; 918 919 procedure AddFeature( i: integer);920 begin 921 MainText.AddLine(Phrases.Lookup('FEATURES', i), pkFeature, i,922 hkFeature + hkCrossLink, i);923 end; 924 925 procedure AddModel( i: integer);907 MainText.AddLine(Phrases.Lookup('TERRAIN', I), pkTer, I, hkTer, I); 908 end; 909 910 procedure AddFeature(I: Integer); 911 begin 912 MainText.AddLine(Phrases.Lookup('FEATURES', I), pkFeature, I, 913 hkFeature, I, True); 914 end; 915 916 procedure AddModel(I: Integer); 926 917 var 927 pix: integer;918 pix: Integer; 928 919 Name: string; 929 920 begin 930 921 if MainText.Count > 1 then 931 922 MainText.LineFeed; 932 FindStdModelPicture(SpecialModelPictureCode[ i], pix, Name);933 MainText.AddLine(Name, pkModel, pix, hkModel + hkCrossLink, i)923 FindStdModelPicture(SpecialModelPictureCode[I], pix, Name); 924 MainText.AddLine(Name, pkModel, pix, hkModel, I, True); 934 925 end; 935 926 936 927 procedure AddStandardBlock(Item: string); 937 928 var 938 i: integer;929 I: Integer; 939 930 begin 940 931 with MainText do … … 947 938 else if Item = 'TECHFORMULA' then 948 939 begin 949 i:= Difficulty;950 if i= 0 then951 i:= 2;952 AddLine(Format(HelpText.Lookup('TECHFORMULA'), [TechFormula_M[ i],953 TechFormula_D[ i]]))940 I := Difficulty; 941 if I = 0 then 942 I := 2; 943 AddLine(Format(HelpText.Lookup('TECHFORMULA'), [TechFormula_M[I], 944 TechFormula_D[I]])); 954 945 end 955 946 else if Item = 'EXPERIENCE' then 956 for i:= 0 to nExp - 1 do957 AddLine(Phrases.Lookup('EXPERIENCE', i), pkExp, i)947 for I := 0 to nExp - 1 do 948 AddLine(Phrases.Lookup('EXPERIENCE', I), pkExp, I) 958 949 else if Item = 'MODERN' then 959 for i:= 1 to 3 do950 for I := 1 to 3 do 960 951 begin 961 952 LineFeed; 962 AddLine(Phrases.Lookup('TERRAIN', 3 * 12 + i), pkTer, 3 * 12 + i);953 AddLine(Phrases.Lookup('TERRAIN', 3 * 12 + I), pkTer, 3 * 12 + I); 963 954 end 964 955 else if Item = 'SAVED' then 965 956 AddLine(DataDir + 'Saved', pkNormal) 966 957 else if Item = 'AITSTAT' then 967 for i:= 0 to 3 do968 AddLine(Phrases2.Lookup('AITSTAT', i), pkAITStat, i)969 end 970 end; 971 972 procedure DecodeItem( s: string; var Category,Index: Integer);958 for I := 0 to 3 do 959 AddLine(Phrases2.Lookup('AITSTAT', I), pkAITStat, I) 960 end; 961 end; 962 963 procedure DecodeItem(S: string; var Category: TLinkCategory; var Index: Integer); 973 964 var 974 i: Integer;975 begin 976 if (Length( s) > 0) and (s[1] = ':') then begin965 I: Integer; 966 begin 967 if (Length(S) > 0) and (S[1] = ':') then begin 977 968 Category := hkMisc; 978 969 Index := 0; 979 for i := 3 to length(s) do980 Index := Index * 10 + Ord( s[i]) - 48;981 case s[2] of970 for I := 3 to Length(S) do 971 Index := Index * 10 + Ord(S[I]) - 48; 972 case S[2] of 982 973 'A': Category := hkAdv; 983 974 'B': Category := hkImp; … … 986 977 'E': Category := hkInternet; 987 978 'S': Category := hkModel; 988 'C': Index := miscCredits;989 'J': Index := miscJobList;990 'G': Index := miscGovList;979 'C': Index := Integer(miscCredits); 980 'J': Index := Integer(miscJobList); 981 'G': Index := Integer(miscGovList); 991 982 end; 992 983 if (Category <> hkMisc) and (Index = 0) then … … 994 985 end else begin 995 986 Category := hkText; 996 Index := HelpText.Get handle(Copy(s, 1, 255));987 Index := HelpText.GetHandle(Copy(S, 1, 255)); 997 988 end; 998 989 end; 999 990 1000 procedure AddTextual( s: string);991 procedure AddTextual(S: string); 1001 992 var 1002 i: Integer;1003 p: Integer;1004 l: Integer;993 I: Integer; 994 P: Integer; 995 L: Integer; 1005 996 ofs: Integer; 1006 CurrentFormat: Integer;1007 FollowFormat: Integer;997 CurrentFormat: TTextFormat; 998 FollowFormat: TTextFormat; 1008 999 Picpix: Integer; 1009 LinkCategory: Integer; 1000 LinkCategory: TLinkCategory; 1001 CrossLink: Boolean; 1010 1002 LinkIndex: Integer; 1011 1003 RightMargin: Integer; … … 1013 1005 Text: string; 1014 1006 begin 1007 CrossLink := False; 1015 1008 RightMargin := InnerWidth - 16 - DpiGetSystemMetrics(SM_CXVSCROLL); 1016 1009 FollowFormat := pkNormal; 1017 while s<> '' do1010 while S <> '' do 1018 1011 begin 1019 1012 Picpix := 0; 1020 LinkCategory := 0;1013 LinkCategory := hkNoLink; 1021 1014 LinkIndex := 0; 1022 if s[1] = '$' then1023 begin // window caption1024 p:= 1;1015 if S[1] = '$' then 1016 begin // Window caption 1017 P := 1; 1025 1018 repeat 1026 inc(p)1027 until ( p > Length(s)) or (s[p] = '\');1028 Caption := Copy( s, 2, p- 2);1029 Delete( s, 1, p);1019 Inc(P); 1020 until (P > Length(S)) or (S[P] = '\'); 1021 Caption := Copy(S, 2, P - 2); 1022 Delete(S, 1, P); 1030 1023 end 1031 else if s[1] = '&' then1032 begin // standard block1033 p:= 1;1024 else if S[1] = '&' then 1025 begin // Standard block 1026 P := 1; 1034 1027 repeat 1035 inc(p)1036 until ( p > Length(s)) or (s[p] = '\');1037 AddStandardBlock(Copy( s, 2, p- 2));1038 Delete( s, 1, p);1028 Inc(P); 1029 until (P > Length(S)) or (S[P] = '\'); 1030 AddStandardBlock(Copy(S, 2, P - 2)); 1031 Delete(S, 1, P); 1039 1032 end 1040 else if s[1] = '@' then1041 begin // image1042 if (Length( s) >= 2) and (s[2] = '@') then1043 begin // generate from icon1033 else if S[1] = '@' then 1034 begin // Image 1035 if (Length(S) >= 2) and (S[2] = '@') then 1036 begin // Generate from icon 1044 1037 Picpix := 0; 1045 p:= 3;1046 while ( p <= Length(s)) and (s[p] <> '\') do1038 P := 3; 1039 while (P <= Length(S)) and (S[P] <> '\') do 1047 1040 begin 1048 Picpix := Picpix * 10 + Ord( s[p]) - 48;1049 inc(p)1041 Picpix := Picpix * 10 + Ord(S[P]) - 48; 1042 Inc(P); 1050 1043 end; 1051 1044 if (Picpix < 0) or (Picpix >= nImp) then … … 1057 1050 else 1058 1051 begin // external image 1059 p:= 1;1052 P := 1; 1060 1053 repeat 1061 Inc( p)1062 until ( p > Length(s)) or (s[p] = '\');1054 Inc(P); 1055 until (P > Length(S)) or (S[P] = '\'); 1063 1056 if LoadGraphicFile(ExtPic, LocalizedFilePath('Help' + 1064 DirectorySeparator + Copy( s, 2, p- 2)) + '.png') then1057 DirectorySeparator + Copy(S, 2, P - 2)) + '.png') then 1065 1058 begin 1066 1059 MainText.AddLine('', pkExternal); 1067 for i:= 0 to (ExtPic.Height - 12) div 24 do1060 for I := 0 to (ExtPic.Height - 12) div 24 do 1068 1061 MainText.LineFeed; 1069 1062 end; 1070 1063 end; 1071 Delete( s, 1, p);1064 Delete(S, 1, P); 1072 1065 end 1073 1066 else 1074 1067 begin 1075 case s[1] of1068 case S[1] of 1076 1069 ':', ';': 1077 1070 begin // link 1078 p:= 1;1071 P := 1; 1079 1072 repeat 1080 inc(p)1081 until ( p > Length(s)) or (s[p] = '\') or (s[p] = ' ');1082 DecodeItem(Copy( s, 2, p- 2), LinkCategory, LinkIndex);1083 CurrentFormat := 0;1073 Inc(P); 1074 until (P > Length(S)) or (S[P] = '\') or (S[P] = ' '); 1075 DecodeItem(Copy(S, 2, P - 2), LinkCategory, LinkIndex); 1076 CurrentFormat := pkNormal; 1084 1077 if (LinkCategory <> hkText) and (LinkIndex < 200) then 1085 1078 // show icon … … 1088 1081 begin 1089 1082 CurrentFormat := pkAdvIcon; 1090 Picpix := LinkIndex 1083 Picpix := LinkIndex; 1091 1084 end; 1092 1085 hkImp: 1093 1086 begin 1094 1087 CurrentFormat := pkSmallIcon; 1095 Picpix := LinkIndex 1088 Picpix := LinkIndex; 1096 1089 end; 1097 1090 hkTer: … … 1103 1096 begin 1104 1097 CurrentFormat := pkFeature; 1105 Picpix := LinkIndex 1098 Picpix := LinkIndex; 1106 1099 end; 1107 1100 hkModel: … … 1112 1105 end; 1113 1106 end; 1114 if s[1] = ':' then1115 LinkCategory := LinkCategory + hkCrossLink;1116 if ( p > Length(s)) or (s[p] = ' ') then1117 Delete( s, 1, p)1107 if S[1] = ':' then 1108 CrossLink := True; 1109 if (P > Length(S)) or (S[P] = ' ') then 1110 Delete(S, 1, P) 1118 1111 else 1119 Delete( s, 1, p- 1)1120 end; 1121 '!': // highli ted1122 if (Length( s) >= 2) and (s[2] = '!') then1112 Delete(S, 1, P - 1) 1113 end; 1114 '!': // highlighted 1115 if (Length(S) >= 2) and (S[2] = '!') then 1123 1116 begin 1124 1117 if MainText.Count > 1 then … … 1126 1119 FollowFormat := pkCaption; 1127 1120 CurrentFormat := pkCaption; 1128 Delete( s, 1, 2);1121 Delete(S, 1, 2); 1129 1122 end 1130 1123 else … … 1132 1125 FollowFormat := pkSection; 1133 1126 CurrentFormat := pkSection; 1134 Delete( s, 1, 1);1127 Delete(S, 1, 1); 1135 1128 end; 1136 1129 '-': … … 1138 1131 FollowFormat := pkNormal_Dot; 1139 1132 CurrentFormat := pkDot; 1140 Delete( s, 1, 1);1133 Delete(S, 1, 1); 1141 1134 end; 1142 1135 else … … 1147 1140 else 1148 1141 ofs := 8; 1149 p:= 0;1142 P := 0; 1150 1143 repeat 1151 1144 repeat 1152 Inc( p)1153 until ( p > Length(s)) or (s[p] = ' ') or (s[p] = '\');1154 if (BiColorTextWidth(OffScreen.Canvas, Copy( s, 1, p- 1)) <=1145 Inc(P) 1146 until (P > Length(S)) or (S[P] = ' ') or (S[P] = '\'); 1147 if (BiColorTextWidth(OffScreen.Canvas, Copy(S, 1, P - 1)) <= 1155 1148 RightMargin - ofs) then 1156 l := p- 11149 L := P - 1 1157 1150 else 1158 1151 Break; 1159 until ( p >= Length(s)) or (s[l+ 1] = '\');1160 Text := Copy( s, 1, l);1161 if LinkCategory and $3f= hkInternet then begin1152 until (P >= Length(S)) or (S[L + 1] = '\'); 1153 Text := Copy(S, 1, L); 1154 if LinkCategory = hkInternet then begin 1162 1155 if LinkIndex = 1 then Text := AITemplateManual 1163 1156 else if LinkIndex = 2 then Text := CevoHomepageShort … … 1165 1158 end; 1166 1159 MainText.AddLine(Text, CurrentFormat, Picpix, LinkCategory, 1167 LinkIndex );1168 if ( l < Length(s)) and (s[l+ 1] = '\') then1160 LinkIndex, CrossLink); 1161 if (L < Length(S)) and (S[L + 1] = '\') then 1169 1162 FollowFormat := pkNormal; 1170 Delete( s, 1, l+ 1);1171 end 1172 end 1163 Delete(S, 1, L + 1); 1164 end; 1165 end; 1173 1166 end; 1174 1167 … … 1178 1171 end; 1179 1172 1180 procedure AddModelText( i: Integer);1173 procedure AddModelText(I: Integer); 1181 1174 var 1182 1175 pix: Integer; 1183 s: string;1176 S: string; 1184 1177 begin 1185 1178 with MainText do begin … … 1188 1181 LineFeed; 1189 1182 end; 1190 FindStdModelPicture(SpecialModelPictureCode[ i], pix, s);1191 AddLine( s, pkSection);1192 AddLine(Format(HelpText.Lookup('STRENGTH'), [SpecialModel[ i].Attack,1193 SpecialModel[ i].Defense]), pkNormal_64);1183 FindStdModelPicture(SpecialModelPictureCode[I], pix, S); 1184 AddLine(S, pkSection); 1185 AddLine(Format(HelpText.Lookup('STRENGTH'), [SpecialModel[I].Attack, 1186 SpecialModel[I].Defense]), pkNormal_64); 1194 1187 AddLine(Format(HelpText.Lookup('SPEED'), 1195 [MovementToString(SpecialModel[ i].Speed)]), pkModel, pix);1188 [MovementToString(SpecialModel[I].Speed)]), pkModel, pix); 1196 1189 if Difficulty = 0 then 1197 AddLine(Format(HelpText.Lookup('BUILDCOST'), [SpecialModel[ i].Cost]),1190 AddLine(Format(HelpText.Lookup('BUILDCOST'), [SpecialModel[I].Cost]), 1198 1191 pkNormal_64) 1199 1192 else 1200 1193 AddLine(Format(HelpText.Lookup('BUILDCOST'), 1201 [SpecialModel[ i].Cost * BuildCostMod[Difficulty] div 12]),1194 [SpecialModel[I].Cost * BuildCostMod[Difficulty] div 12]), 1202 1195 pkNormal_64); 1203 s := HelpText.LookupByHandle(hSPECIALMODEL, i);1204 if ( s <> '') and (s<> '*') then1205 AddTextual( s);1206 if SpecialModelPreq[ i] >= 0 then1207 AddPreqAdv(SpecialModelPreq[ i])1208 else if SpecialModelPreq[ i] = preLighthouse then1196 S := HelpText.LookupByHandle(hSPECIALMODEL, I); 1197 if (S <> '') and (S <> '*') then 1198 AddTextual(S); 1199 if SpecialModelPreq[I] >= 0 then 1200 AddPreqAdv(SpecialModelPreq[I]) 1201 else if SpecialModelPreq[I] = preLighthouse then 1209 1202 AddPreqImp(woLighthouse) 1210 else if SpecialModelPreq[ i] = preBuilder then1203 else if SpecialModelPreq[I] = preBuilder then 1211 1204 AddPreqImp(woPyramids) 1212 else if SpecialModelPreq[ i] = preLeo then1205 else if SpecialModelPreq[I] = preLeo then 1213 1206 AddPreqImp(woLeo); 1214 if SpecialModelPreq[ i] <> preNone then1207 if SpecialModelPreq[I] <> preNone then 1215 1208 MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'), 1216 1209 [MainText[Count - 1]]); … … 1220 1213 procedure AddJobList; 1221 1214 var 1222 i, JobCost: Integer;1215 I, JobCost: Integer; 1223 1216 begin 1224 1217 with MainText do begin 1225 for i := 0 to nJobHelp- 1 do begin1226 if i> 0 then begin1218 for I := 0 to Length(JobHelp) - 1 do begin 1219 if I > 0 then begin 1227 1220 LineFeed; 1228 1221 LineFeed; 1229 1222 end; 1230 AddLine(Phrases.Lookup('JOBRESULT', JobHelp[ i]), pkSection);1223 AddLine(Phrases.Lookup('JOBRESULT', JobHelp[I]), pkSection); 1231 1224 AddLine; 1232 AddLine('', pkTerImp, i);1225 AddLine('', pkTerImp, I); 1233 1226 AddLine; 1234 AddTextual(HelpText.LookupByHandle(hJOBHELP, i));1227 AddTextual(HelpText.LookupByHandle(hJOBHELP, I)); 1235 1228 JobCost := -1; 1236 case JobHelp[ i] of1229 case JobHelp[I] of 1237 1230 jCanal: JobCost := CanalWork; 1238 1231 jFort: JobCost := FortWork; … … 1244 1237 else 1245 1238 AddTextual(HelpText.Lookup('JOBCOSTVAR')); 1246 if JobPreq[JobHelp[ i]] <> preNone then begin1247 AddPreqAdv(JobPreq[JobHelp[ i]]);1239 if JobPreq[JobHelp[I]] <> preNone then begin 1240 AddPreqAdv(JobPreq[JobHelp[I]]); 1248 1241 MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'), 1249 1242 [MainText[Count - 1]]); … … 1255 1248 procedure AddGraphicCredits; 1256 1249 var 1257 i: Integer;1258 s: string;1250 I: Integer; 1251 S: string; 1259 1252 sr: TSearchRec; 1260 1253 List, Plus: TStringList; … … 1271 1264 1272 1265 List.Sort; 1273 i:= 1;1274 while i< List.Count do1275 if List[ i] = List[i- 1] then1276 List.Delete( i)1266 I := 1; 1267 while I < List.Count do 1268 if List[I] = List[I - 1] then 1269 List.Delete(I) 1277 1270 else 1278 Inc( i);1279 1280 for i:= 0 to List.Count - 1 do begin1281 s := List[i];1282 while BiColorTextWidth(OffScreen.Canvas, s) > InnerWidth - 16 -1271 Inc(I); 1272 1273 for I := 0 to List.Count - 1 do begin 1274 S := List[I]; 1275 while BiColorTextWidth(OffScreen.Canvas, S) > InnerWidth - 16 - 1283 1276 DpiGetSystemMetrics(SM_CXVSCROLL) do 1284 Delete( s, length(s), 1);1285 MainText.AddLine( s);1277 Delete(S, Length(S), 1); 1278 MainText.AddLine(S); 1286 1279 end; 1287 1280 FreeAndNil(List); … … 1290 1283 procedure AddSoundCredits; 1291 1284 var 1292 i: Integer;1293 s: string;1285 I: Integer; 1286 S: string; 1294 1287 List: TStringList; 1295 1288 begin 1296 1289 List := TStringList.Create; 1297 1290 List.LoadFromFile(GetSoundsDir + DirectorySeparator + 'sound.credits.txt'); 1298 for i:= 0 to List.Count - 1 do begin1299 s := List[i];1300 while BiColorTextWidth(OffScreen.Canvas, s) > InnerWidth - 16 -1291 for I := 0 to List.Count - 1 do begin 1292 S := List[I]; 1293 while BiColorTextWidth(OffScreen.Canvas, S) > InnerWidth - 16 - 1301 1294 DpiGetSystemMetrics(SM_CXVSCROLL) do 1302 Delete( s, length(s), 1);1303 MainText.AddLine( s);1295 Delete(S, Length(S), 1); 1296 MainText.AddLine(S); 1304 1297 end; 1305 1298 FreeAndNil(List); … … 1323 1316 Clear; 1324 1317 Headline := -1; 1325 if ( no >= 200) or not(Kind in [hkAdv, hkImp, hkTer, hkFeature]) then1318 if (No >= 200) or not (Kind in [hkAdv, hkImp, hkTer, hkFeature]) then 1326 1319 LineFeed; 1327 1320 case Kind of 1328 1321 hkText: 1329 AddTextual(HelpText.LookupByHandle( no));1322 AddTextual(HelpText.LookupByHandle(No)); 1330 1323 hkMisc: 1331 1324 begin 1332 case no of1333 miscMain:1325 case No of 1326 Integer(miscMain): 1334 1327 begin 1335 1328 Caption := HelpText.Lookup('HELPTITLE_MAIN'); 1336 1329 AddLine(HelpText.Lookup('HELPTITLE_QUICKSTART'), pkSpecialIcon, 1337 0, { pkBigIcon,22, } hkText, HelpText.Get handle('QUICK'));1330 0, { pkBigIcon,22, } hkText, HelpText.GetHandle('QUICK')); 1338 1331 LineFeed; 1339 1332 AddLine(HelpText.Lookup('HELPTITLE_CONCEPTS'), pkBigIcon, 6, … … 1344 1337 LineFeed; 1345 1338 AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkSpecialIcon, 2, 1346 hkMisc, miscJobList);1339 hkMisc, Integer(miscJobList)); 1347 1340 LineFeed; 1348 1341 AddLine(HelpText.Lookup('HELPTITLE_TECHLIST'), pkBigIcon, 39, 1349 1342 hkAdv, 200); 1350 1343 LineFeed; 1351 FindStdModelPicture(SpecialModelPictureCode[6], i, s);1352 AddLine(HelpText.Lookup('HELPTITLE_MODELLIST'), pkModel, i,1344 FindStdModelPicture(SpecialModelPictureCode[6], I, S); 1345 AddLine(HelpText.Lookup('HELPTITLE_MODELLIST'), pkModel, I, 1353 1346 hkModel, 0); 1354 1347 LineFeed; … … 1366 1359 LineFeed; 1367 1360 AddLine(HelpText.Lookup('HELPTITLE_GOVLIST'), pkBigIcon, 1368 gDemocracy + 6, hkMisc, miscGovList);1361 gDemocracy + 6, hkMisc, Integer(miscGovList)); 1369 1362 LineFeed; 1370 1363 AddLine(HelpText.Lookup('HELPTITLE_KEYS'), pkBigIcon, 2, hkText, … … 1375 1368 LineFeed; 1376 1369 AddLine(HelpText.Lookup('HELPTITLE_CREDITS'), pkBigIcon, 22, 1377 hkMisc, miscCredits);1370 hkMisc, Integer(miscCredits)); 1378 1371 end; 1379 miscCredits:1372 Integer(miscCredits): 1380 1373 begin 1381 1374 AddItem('CREDITS'); … … 1390 1383 AddItem('AUTHOR'); 1391 1384 end; 1392 miscJobList:1385 Integer(miscJobList): 1393 1386 begin 1394 1387 Caption := HelpText.Lookup('HELPTITLE_JOBLIST'); … … 1399 1392 AddItem('TERIMPCITY'); 1400 1393 end; 1401 miscGovList:1394 Integer(miscGovList): 1402 1395 begin 1403 1396 Caption := HelpText.Lookup('HELPTITLE_GOVLIST'); 1404 for i:= 1 to nGov do1397 for I := 1 to nGov do 1405 1398 begin 1406 AddLine(Phrases.Lookup('GOVERNMENT', imod nGov), pkSection);1399 AddLine(Phrases.Lookup('GOVERNMENT', I mod nGov), pkSection); 1407 1400 LineFeed; 1408 if i= nGov then1401 if I = nGov then 1409 1402 AddLine('', pkBigIcon, 7 * SystemIconLines + imPalace) 1410 1403 else 1411 AddLine('', pkBigIcon, i+ 6);1404 AddLine('', pkBigIcon, I + 6); 1412 1405 LineFeed; 1413 AddTextual(HelpText.LookupByHandle(hGOVHELP, imod nGov));1414 if imod nGov >= 2 then1406 AddTextual(HelpText.LookupByHandle(hGOVHELP, I mod nGov)); 1407 if I mod nGov >= 2 then 1415 1408 begin 1416 AddPreqAdv(GovPreq[ imod nGov]);1409 AddPreqAdv(GovPreq[I mod nGov]); 1417 1410 MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'), 1418 1411 [MainText[Count - 1]]); 1419 1412 end; 1420 if i< nGov then1413 if I < nGov then 1421 1414 begin 1422 1415 LineFeed; … … 1425 1418 end; 1426 1419 end; 1427 miscSearchResult:1420 Integer(miscSearchResult): 1428 1421 begin 1429 1422 Caption := HelpText.Lookup('HELPTITLE_SEARCHRESULTS'); … … 1431 1424 MainText.AppendList(SearchResult); 1432 1425 end; 1433 end; // case no1426 end; // case No 1434 1427 end; 1435 1428 1436 1429 hkAdv: 1437 if no = 200 then1430 if No = 200 then 1438 1431 begin // complete advance list 1439 1432 Caption := HelpText.Lookup('HELPTITLE_TECHLIST'); 1440 1433 List := THyperText.Create; 1441 1434 List.OwnsObjects := True; 1442 for j:= 0 to 3 do1435 for J := 0 to 3 do 1443 1436 begin 1444 if j> 0 then1437 if J > 0 then 1445 1438 begin 1446 1439 LineFeed; 1447 1440 LineFeed; 1448 1441 end; 1449 AddLine(HelpText.Lookup('TECHAGE', j), pkSection);1450 if j= 1 then1442 AddLine(HelpText.Lookup('TECHAGE', J), pkSection); 1443 if J = 1 then 1451 1444 AddLine(Phrases.Lookup('ADVANCES', adScience) + ' ' + 1452 1445 HelpText.Lookup('BASETECH'), pkAdvIcon, adScience, hkAdv, 1453 1446 adScience); 1454 if j= 2 then1447 if J = 2 then 1455 1448 AddLine(Phrases.Lookup('ADVANCES', adMassProduction) + ' ' + 1456 1449 HelpText.Lookup('BASETECH'), pkAdvIcon, adMassProduction, hkAdv, 1457 1450 adMassProduction); 1458 1451 List.Clear; 1459 for i:= 0 to nAdv - 1 do1460 if ( i <> adScience) and (i<> adMassProduction) and1461 (AdvValue[ i] div 1000 = j) then1462 List.AddLine(Phrases.Lookup('ADVANCES', i), pkAdvIcon, i,1463 hkAdv, i);1452 for I := 0 to nAdv - 1 do 1453 if (I <> adScience) and (I <> adMassProduction) and 1454 (AdvValue[I] div 1000 = J) then 1455 List.AddLine(Phrases.Lookup('ADVANCES', I), pkAdvIcon, I, 1456 hkAdv, I); 1464 1457 List.Sort; 1465 1458 AppendList(List); … … 1469 1462 else // single advance 1470 1463 begin 1471 Caption := Phrases.Lookup('ADVANCES', no);1464 Caption := Phrases.Lookup('ADVANCES', No); 1472 1465 LineFeed; 1473 AddLine(Phrases.Lookup('ADVANCES', no), pkCaption);1474 if no in FutureTech then1466 AddLine(Phrases.Lookup('ADVANCES', No), pkCaption); 1467 if No in FutureTech then 1475 1468 begin 1476 1469 AddLine(HelpText.Lookup('HELPSPEC_FUTURE')); 1477 1470 LineFeed; 1478 if no = futResearchTechnology then1471 if No = futResearchTechnology then 1479 1472 AddItem('FUTURETECHHELP100') 1480 1473 else … … 1483 1476 else 1484 1477 AddLine(HelpText.Lookup('HELPSPEC_ADV')); 1485 if AdvPreq[ no, 2] <> preNone then1478 if AdvPreq[No, 2] <> preNone then 1486 1479 NextSection('PREREQALT') 1487 1480 else 1488 1481 NextSection('PREREQ'); 1489 for i:= 0 to 2 do1490 if AdvPreq[ no, i] <> preNone then1491 AddPreqAdv(AdvPreq[ no, i]);1482 for I := 0 to 2 do 1483 if AdvPreq[No, I] <> preNone then 1484 AddPreqAdv(AdvPreq[No, I]); 1492 1485 NextSection('GOVALLOW'); 1493 for i:= 2 to nGov - 1 do1494 if GovPreq[ i] = no then1495 AddLine(Phrases.Lookup('GOVERNMENT', i), pkGov, i,1496 hkMisc + hkCrossLink, miscGovList);1486 for I := 2 to nGov - 1 do 1487 if GovPreq[I] = No then 1488 AddLine(Phrases.Lookup('GOVERNMENT', I), pkGov, I, 1489 hkMisc, Integer(miscGovList), True); 1497 1490 NextSection('BUILDALLOW'); 1498 for i:= 0 to nWonder - 1 do1499 if Imp[ i].Preq = no then1500 AddImprovement( i);1501 for i:= nWonder to nImp - 1 do1502 if (Imp[ i].Preq = no) and (Imp[i].Kind <> ikCommon) then1503 AddImprovement( i);1504 for i:= nWonder to nImp - 1 do1505 if (Imp[ i].Preq = no) and (Imp[i].Kind = ikCommon) then1506 AddImprovement( i);1491 for I := 0 to nWonder - 1 do 1492 if Imp[I].Preq = No then 1493 AddImprovement(I); 1494 for I := nWonder to nImp - 1 do 1495 if (Imp[I].Preq = No) and (Imp[I].Kind <> ikCommon) then 1496 AddImprovement(I); 1497 for I := nWonder to nImp - 1 do 1498 if (Imp[I].Preq = No) and (Imp[I].Kind = ikCommon) then 1499 AddImprovement(I); 1507 1500 NextSection('MODELALLOW'); 1508 for i:= 0 to nSpecialModel - 1 do1509 if SpecialModelPreq[ i] = no then1510 AddModel( i);1501 for I := 0 to nSpecialModel - 1 do 1502 if SpecialModelPreq[I] = No then 1503 AddModel(I); 1511 1504 NextSection('FEATALLOW'); 1512 for i:= 0 to nFeature - 1 do1513 if Feature[ i].Preq = no then1514 AddFeature( i);1505 for I := 0 to nFeature - 1 do 1506 if Feature[I].Preq = No then 1507 AddFeature(I); 1515 1508 NextSection('FOLLOWADV'); 1516 for i:= 0 to nAdv - 1 do1517 if (AdvPreq[ i, 0] = no) or (AdvPreq[i, 1] = no) or1518 (AdvPreq[ i, 2] = no) then1519 AddAdvance( i);1509 for I := 0 to nAdv - 1 do 1510 if (AdvPreq[I, 0] = No) or (AdvPreq[I, 1] = No) or 1511 (AdvPreq[I, 2] = No) then 1512 AddAdvance(I); 1520 1513 NextSection('UPGRADEALLOW'); 1521 1514 for Domain := 0 to nDomains - 1 do 1522 for i:= 1 to nUpgrade - 1 do1523 if upgrade[Domain, i].Preq = no then1515 for I := 1 to nUpgrade - 1 do 1516 if upgrade[Domain, I].Preq = No then 1524 1517 begin 1525 if upgrade[Domain, i].Strength > 0 then1518 if upgrade[Domain, I].Strength > 0 then 1526 1519 AddLine(Format(HelpText.Lookup('STRENGTHUP'), 1527 1520 [Phrases.Lookup('DOMAIN', Domain), upgrade[Domain, 1528 i].Strength]), pkDomain, Domain);1529 if upgrade[Domain, i].Trans > 0 then1521 I].Strength]), pkDomain, Domain); 1522 if upgrade[Domain, I].Trans > 0 then 1530 1523 AddLine(Format(HelpText.Lookup('TRANSUP'), 1531 [Phrases.Lookup('DOMAIN', Domain), upgrade[Domain, i].Trans]1524 [Phrases.Lookup('DOMAIN', Domain), upgrade[Domain, I].Trans] 1532 1525 ), pkDomain, Domain); 1533 if no in FutureTech then1526 if No in FutureTech then 1534 1527 AddLine(Format(HelpText.Lookup('COSTUP'), 1535 [upgrade[Domain, i].Cost]), pkNormal_Dot)1528 [upgrade[Domain, I].Cost]), pkNormal_Dot) 1536 1529 else 1537 1530 AddLine(Format(HelpText.Lookup('COSTMIN'), 1538 [upgrade[Domain, i].Cost]), pkNormal_Dot)1531 [upgrade[Domain, I].Cost]), pkNormal_Dot) 1539 1532 end; 1540 1533 NextSection('EXPIRATION'); 1541 for i:= 0 to nWonder - 1 do1542 if (Imp[ i].Preq <> preNA) and (Imp[i].Expiration = no) then1543 AddImprovement( i);1534 for I := 0 to nWonder - 1 do 1535 if (Imp[I].Preq <> preNA) and (Imp[I].Expiration = No) then 1536 AddImprovement(I); 1544 1537 NextSection('ADVEFFECT'); 1545 s := HelpText.LookupByHandle(hADVHELP, no);1546 if s<> '*' then1547 AddTextual( s);1538 S := HelpText.LookupByHandle(hADVHELP, No); 1539 if S <> '*' then 1540 AddTextual(S); 1548 1541 NextSection('SEEALSO'); 1549 CheckSeeAlso := true1542 CheckSeeAlso := True; 1550 1543 end; 1551 1544 1552 1545 hkImp: 1553 if no = 200 then1546 if No = 200 then 1554 1547 begin // complete city improvement list 1555 1548 Caption := HelpText.Lookup('HELPTITLE_IMPLIST'); … … 1557 1550 List := THyperText.Create; 1558 1551 List.OwnsObjects := True; 1559 for i:= nWonder to nImp - 1 do1560 if ( i <> imTrGoods) and (Imp[i].Preq <> preNA) and1561 (Imp[ i].Kind = ikCommon) then1562 List.AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon,1563 i, hkImp, i);1552 for I := nWonder to nImp - 1 do 1553 if (I <> imTrGoods) and (Imp[I].Preq <> preNA) and 1554 (Imp[I].Kind = ikCommon) then 1555 List.AddLine(Phrases.Lookup('IMPROVEMENTS', I), pkSmallIcon, 1556 I, hkImp, I); 1564 1557 List.Sort; 1565 1558 AppendList(List); 1566 1559 FreeAndNil(List); 1567 1560 end 1568 else if no = 201 then1561 else if No = 201 then 1569 1562 begin // complete nat. project list 1570 1563 Caption := HelpText.Lookup('HELPTITLE_UNIQUELIST'); 1571 1564 // AddLine(HelpText.Lookup('HELPTITLE_UNIQUELIST'),pkSection); 1572 for i:= nWonder to nImp - 1 do1573 if (Imp[ i].Preq <> preNA) and1574 ((Imp[ i].Kind = ikNatLocal) or (Imp[i].Kind = ikNatGlobal)) then1575 AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon, i,1576 hkImp, i);1565 for I := nWonder to nImp - 1 do 1566 if (Imp[I].Preq <> preNA) and 1567 ((Imp[I].Kind = ikNatLocal) or (Imp[I].Kind = ikNatGlobal)) then 1568 AddLine(Phrases.Lookup('IMPROVEMENTS', I), pkSmallIcon, I, 1569 hkImp, I); 1577 1570 { LineFeed; 1578 1571 LineFeed; 1579 1572 AddLine(HelpText.Lookup('HELPTITLE_SHIPPARTLIST'),pkSection); 1580 for i:= nWonder to nImp-1 do1581 if (Imp[ i].Preq<>preNA) and (Imp[i].Kind=ikShipPart) then1582 AddLine(Phrases.Lookup('IMPROVEMENTS', i),pkSmallIcon,i,hkImp,i); }1573 for I:= nWonder to nImp-1 do 1574 if (Imp[I].Preq<>preNA) and (Imp[I].Kind=ikShipPart) then 1575 AddLine(Phrases.Lookup('IMPROVEMENTS',I),pkSmallIcon,I,hkImp,I); } 1583 1576 end 1584 else if no = 202 then1577 else if No = 202 then 1585 1578 begin // complete wonder list 1586 1579 Caption := HelpText.Lookup('HELPTITLE_WONDERLIST'); 1587 1580 // AddLine(HelpText.Lookup('HELPTITLE_WONDERLIST'),pkSection); 1588 for i:= 0 to nWonder - 1 do1589 if Imp[ i].Preq <> preNA then1590 AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon, i,1591 hkImp, i);1581 for I := 0 to nWonder - 1 do 1582 if Imp[I].Preq <> preNA then 1583 AddLine(Phrases.Lookup('IMPROVEMENTS', I), pkSmallIcon, I, 1584 hkImp, I); 1592 1585 end 1593 1586 else 1594 1587 begin // single building 1595 Caption := Phrases.Lookup('IMPROVEMENTS', no);1588 Caption := Phrases.Lookup('IMPROVEMENTS', No); 1596 1589 LineFeed; 1597 AddLine(Phrases.Lookup('IMPROVEMENTS', no), pkRightIcon, no);1598 case Imp[ no].Kind of1590 AddLine(Phrases.Lookup('IMPROVEMENTS', No), pkRightIcon, No); 1591 case Imp[No].Kind of 1599 1592 ikWonder: AddLine(HelpText.Lookup('HELPSPEC_WONDER')); 1600 1593 ikCommon: AddLine(HelpText.Lookup('HELPSPEC_IMP')); … … 1603 1596 AddLine(HelpText.Lookup('HELPSPEC_NAT')) 1604 1597 end; 1605 if Imp[ no].Kind <> ikShipPart then begin1598 if Imp[No].Kind <> ikShipPart then begin 1606 1599 NextSection('EFFECT'); 1607 AddTextual(HelpText.LookupByHandle(hIMPHELP, no));1600 AddTextual(HelpText.LookupByHandle(hIMPHELP, No)); 1608 1601 end; 1609 if no = woSun then begin1602 if No = woSun then begin 1610 1603 AddFeature(mcFirst); 1611 1604 AddFeature(mcWill); 1612 1605 AddFeature(mcAcademy); 1613 1606 end; 1614 if ( no < nWonder) and not Phrases2FallenBackToEnglish then1607 if (No < nWonder) and not Phrases2FallenBackToEnglish then 1615 1608 begin 1616 1609 LineFeed; 1617 if Imp[ no].Expiration >= 0 then1610 if Imp[No].Expiration >= 0 then 1618 1611 AddTextual(Phrases2.Lookup('HELP_WONDERMORALE1')) 1619 1612 else 1620 1613 AddTextual(Phrases2.Lookup('HELP_WONDERMORALE2')); 1621 1614 end; 1622 if Imp[ no].Preq <> preNone then1615 if Imp[No].Preq <> preNone then 1623 1616 begin 1624 1617 NextSection('PREREQ'); 1625 AddPreqAdv(Imp[ no].Preq);1618 AddPreqAdv(Imp[No].Preq); 1626 1619 end; 1627 1620 NextSection('COSTS'); 1628 1621 if Difficulty = 0 then 1629 s := Format(HelpText.Lookup('BUILDCOST'), [Imp[no].Cost])1622 S := Format(HelpText.Lookup('BUILDCOST'), [Imp[No].Cost]) 1630 1623 else 1631 s:= Format(HelpText.Lookup('BUILDCOST'),1632 [Imp[ no].Cost * BuildCostMod[Difficulty] div 12]);1633 AddLine( s);1634 if Imp[ no].Maint > 0 then1635 AddLine(Format(HelpText.Lookup('MAINTCOST'), [Imp[ no].Maint]));1636 j:= 0;1637 for i:= 0 to nImpReplacement - 1 do1638 if ImpReplacement[ i].NewImp = no then1639 begin 1640 if j= 0 then1624 S := Format(HelpText.Lookup('BUILDCOST'), 1625 [Imp[No].Cost * BuildCostMod[Difficulty] div 12]); 1626 AddLine(S); 1627 if Imp[No].Maint > 0 then 1628 AddLine(Format(HelpText.Lookup('MAINTCOST'), [Imp[No].Maint])); 1629 J := 0; 1630 for I := 0 to nImpReplacement - 1 do 1631 if ImpReplacement[I].NewImp = No then 1632 begin 1633 if J = 0 then 1641 1634 begin 1642 1635 NextSection('REPLACE'); 1643 1636 AddItem('REPLACETEXT'); 1644 j:= 1;1637 J := 1; 1645 1638 end; 1646 AddImprovement(ImpReplacement[ i].OldImp);1647 end; 1648 if Imp[ no].Kind = ikShipPart then1639 AddImprovement(ImpReplacement[I].OldImp); 1640 end; 1641 if Imp[No].Kind = ikShipPart then 1649 1642 begin 1650 1643 LineFeed; 1651 if no = imShipComp then1652 i:= 11653 else if no = imShipPow then1654 i:= 21655 else { if no=imShipHab then }1656 i:= 3;1644 if No = imShipComp then 1645 I := 1 1646 else if No = imShipPow then 1647 I := 2 1648 else { if No=imShipHab then } 1649 I := 3; 1657 1650 AddLine(Format(HelpText.Lookup('RAREREQUIRED'), 1658 [Phrases.Lookup('TERRAIN', 3 * 12 + i)]), pkTer, 3 * 12 + i);1651 [Phrases.Lookup('TERRAIN', 3 * 12 + I)]), pkTer, 3 * 12 + I); 1659 1652 end; 1660 if ( no < nWonder) and (Imp[no].Expiration >= 0) then1653 if (No < nWonder) and (Imp[No].Expiration >= 0) then 1661 1654 begin 1662 1655 NextSection('EXPIRATION'); 1663 s:= Format(HelpText.Lookup('EXPWITH'),1664 [Phrases.Lookup('ADVANCES', Imp[ no].Expiration)]);1665 if no = woPyramids then1666 s := s+ ' ' + HelpText.Lookup('EXPSLAVE');1667 AddTextual( s);1656 S := Format(HelpText.Lookup('EXPWITH'), 1657 [Phrases.Lookup('ADVANCES', Imp[No].Expiration)]); 1658 if No = woPyramids then 1659 S := S + ' ' + HelpText.Lookup('EXPSLAVE'); 1660 AddTextual(S); 1668 1661 end; 1669 1662 NextSection('SEEALSO'); 1670 if ( no < nWonder) and (Imp[no].Expiration >= 0) then1663 if (No < nWonder) and (Imp[No].Expiration >= 0) then 1671 1664 AddImprovement(woEiffel); 1672 for i:= 0 to nImpReplacement - 1 do1673 if ImpReplacement[ i].OldImp = no then1674 AddImprovement(ImpReplacement[ i].NewImp);1675 if no = imSupermarket then1665 for I := 0 to nImpReplacement - 1 do 1666 if ImpReplacement[I].OldImp = No then 1667 AddImprovement(ImpReplacement[I].NewImp); 1668 if No = imSupermarket then 1676 1669 AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkNormal, 0, 1677 hkMisc + hkCrossLink, miscJobList);1678 CheckSeeAlso := true;1670 hkMisc, Integer(miscJobList), True); 1671 CheckSeeAlso := True; 1679 1672 end; 1680 1673 1681 1674 hkTer: 1682 if no = 200 then1675 if No = 200 then 1683 1676 begin // complete terrain type list 1684 1677 Caption := HelpText.Lookup('HELPTITLE_TERLIST'); 1685 1678 // AddLine(HelpText.Lookup('HELPTITLE_TERLIST'),pkSection); 1686 for i := 0 to nTerrainHelp- 1 do1687 AddTerrain(TerrainHelp[ i]);1679 for I := 0 to Length(TerrainHelp) - 1 do 1680 AddTerrain(TerrainHelp[I]); 1688 1681 end 1689 1682 else 1690 1683 begin // sigle terrain type 1691 TerrType := no mod 12;1684 TerrType := No mod 12; 1692 1685 if TerrType = fJungle then 1693 1686 TerrType := fForest; 1694 TerrSubType := no div 12;1695 if no = 3 * 12 then1687 TerrSubType := No div 12; 1688 if No = 3 * 12 then 1696 1689 begin 1697 1690 TerrType := fDesert; … … 1700 1693 with Terrain[TerrType] do 1701 1694 begin 1702 Caption := Phrases.Lookup('TERRAIN', no);1695 Caption := Phrases.Lookup('TERRAIN', No); 1703 1696 LineFeed; 1704 AddLine(Phrases.Lookup('TERRAIN', no), pkBigTer, no);1697 AddLine(Phrases.Lookup('TERRAIN', No), pkBigTer, No); 1705 1698 AddLine(HelpText.Lookup('HELPSPEC_TER')); 1706 1699 LineFeed; … … 1708 1701 AddLine(Format(HelpText.Lookup('RESPROD'), 1709 1702 [ProdRes[TerrSubType]])); 1710 if ( no < 3 * 12) and (MineEff > 0) then1703 if (No < 3 * 12) and (MineEff > 0) then 1711 1704 MainText[Count - 1] := MainText[Count - 1] + ' ' + 1712 1705 Format(HelpText.Lookup('MOREMINE'), [MineEff]); … … 1714 1707 AddLine(Format(HelpText.Lookup('RESFOOD'), 1715 1708 [FoodRes[TerrSubType]])); 1716 if ( no < 3 * 12) and (IrrEff > 0) then1709 if (No < 3 * 12) and (IrrEff > 0) then 1717 1710 MainText[Count - 1] := MainText[Count - 1] + ' ' + 1718 1711 Format(HelpText.Lookup('MOREIRR'), [IrrEff]); … … 1728 1721 else 1729 1722 AddLine(HelpText.Lookup('MOVEPLAIN')); 1730 if no = 3 * 12 then1723 if No = 3 * 12 then 1731 1724 begin 1732 1725 LineFeed; 1733 1726 AddTextual(HelpText.Lookup('DEADLANDS')); 1734 1727 end; 1735 if (TerrType = fDesert) and ( no <> fDesert + 12) then1728 if (TerrType = fDesert) and (No <> fDesert + 12) then 1736 1729 begin 1737 1730 LineFeed; … … 1743 1736 AddTextual(Format(HelpText.Lookup('HOSTILE'), [ArcticThurst])); 1744 1737 end; 1745 if ( no < 3 * 12) and (TransTerrain >= 0) then1738 if (No < 3 * 12) and (TransTerrain >= 0) then 1746 1739 begin 1747 1740 LineFeed; 1748 i:= TransTerrain;1749 if (TerrType <> fGrass) and ( i<> fGrass) then1750 i := i+ TerrSubType * 12;1741 I := TransTerrain; 1742 if (TerrType <> fGrass) and (I <> fGrass) then 1743 I := I + TerrSubType * 12; 1751 1744 // trafo to same Special resource group 1752 1745 AddLine(Format(HelpText.Lookup('TRAFO'), 1753 [Phrases.Lookup('TERRAIN', i)]), pkTer, i,1754 hkTer + hkCrossLink, i);1755 if no = fSwamp + 12 then1746 [Phrases.Lookup('TERRAIN', I)]), pkTer, I, 1747 hkTer, I, True); 1748 if No = fSwamp + 12 then 1756 1749 begin 1757 1750 LineFeed; 1758 1751 AddLine(Format(HelpText.Lookup('TRAFO'), 1759 1752 [Phrases.Lookup('TERRAIN', TransTerrain + 24)]), pkTer, 1760 TransTerrain + 24, hkTer + hkCrossLink, TransTerrain + 24);1753 TransTerrain + 24, hkTer, TransTerrain + 24, True); 1761 1754 end 1762 else if i= fGrass then1755 else if I = fGrass then 1763 1756 begin 1764 1757 LineFeed; 1765 1758 AddLine(Format(HelpText.Lookup('TRAFO'), 1766 1759 [Phrases.Lookup('TERRAIN', fGrass + 12)]), pkTer, fGrass + 12, 1767 hkTer + hkCrossLink, fGrass + 12);1760 hkTer, fGrass + 12, True); 1768 1761 end; 1769 1762 end; 1770 1763 NextSection('SPECIAL'); 1771 if no = 3 * 12 then1764 if No = 3 * 12 then 1772 1765 begin 1773 1766 LineFeed; … … 1780 1773 end; 1781 1774 end 1782 else if ( no < 12) and (no <> fGrass) and (no <> fOcean) then1775 else if (No < 12) and (No <> fGrass) and (No <> fOcean) then 1783 1776 begin 1784 1777 LineFeed; 1785 1778 for Special := 1 to 2 do 1786 if ( no <> fArctic) and (no <> fSwamp) or (Special < 2) then1779 if (No <> fArctic) and (No <> fSwamp) or (Special < 2) then 1787 1780 begin 1788 1781 if Special > 1 then 1789 1782 LineFeed; 1790 AddLine(Phrases.Lookup('TERRAIN', no + Special * 12), pkTer,1791 no + Special * 12);1792 i:= FoodRes[Special] - FoodRes[0];1793 if i<> 0 then1783 AddLine(Phrases.Lookup('TERRAIN', No + Special * 12), pkTer, 1784 No + Special * 12); 1785 I := FoodRes[Special] - FoodRes[0]; 1786 if I <> 0 then 1794 1787 MainText[Count - 1] := MainText[Count - 1] + 1795 Format(HelpText.Lookup('SPECIALFOOD'), [ i]);1796 i:= ProdRes[Special] - ProdRes[0];1797 if i<> 0 then1788 Format(HelpText.Lookup('SPECIALFOOD'), [I]); 1789 I := ProdRes[Special] - ProdRes[0]; 1790 if I <> 0 then 1798 1791 MainText[Count - 1] := MainText[Count - 1] + 1799 Format(HelpText.Lookup('SPECIALPROD'), [ i]);1800 i:= TradeRes[Special] - TradeRes[0];1801 if i<> 0 then1792 Format(HelpText.Lookup('SPECIALPROD'), [I]); 1793 I := TradeRes[Special] - TradeRes[0]; 1794 if I <> 0 then 1802 1795 MainText[Count - 1] := MainText[Count - 1] + 1803 Format(HelpText.Lookup('SPECIALTRADE'), [ i]);1796 Format(HelpText.Lookup('SPECIALTRADE'), [I]); 1804 1797 end; 1805 1798 end; 1806 if no = 3 * 12 then1799 if No = 3 * 12 then 1807 1800 begin 1808 1801 LineFeed; 1809 1802 AddTextual(HelpText.Lookup('RARE')); 1810 1803 end; 1811 if ( no < 3 * 12) and (TerrType in [fDesert, fArctic]) then1804 if (No < 3 * 12) and (TerrType in [fDesert, fArctic]) then 1812 1805 begin 1813 1806 NextSection('SEEALSO'); 1814 1807 AddImprovement(woGardens); 1815 CheckSeeAlso := true1808 CheckSeeAlso := True; 1816 1809 end; 1817 1810 end; … … 1819 1812 1820 1813 hkFeature: 1821 if no = 200 then1814 if No = 200 then 1822 1815 begin // complete feature list 1823 1816 Caption := HelpText.Lookup('HELPTITLE_FEATURELIST'); … … 1837 1830 end; 1838 1831 List.Clear; 1839 for i:= 0 to nFeature - 1 do1840 if Feature[ i].Preq <> preNA then1832 for I := 0 to nFeature - 1 do 1833 if Feature[I].Preq <> preNA then 1841 1834 begin 1842 if i< mcFirstNonCap then1843 j:= 01844 else if iin AutoFeature then1845 j:= 21835 if I < mcFirstNonCap then 1836 J := 0 1837 else if I in AutoFeature then 1838 J := 2 1846 1839 else 1847 j:= 1;1848 if j= Special then1849 List.AddLine(Phrases.Lookup('FEATURES', i), pkFeature, i,1850 hkFeature, i);1840 J := 1; 1841 if J = Special then 1842 List.AddLine(Phrases.Lookup('FEATURES', I), pkFeature, I, 1843 hkFeature, I); 1851 1844 end; 1852 1845 List.Sort; … … 1857 1850 else 1858 1851 begin // single feature 1859 Caption := Phrases.Lookup('FEATURES', no);1852 Caption := Phrases.Lookup('FEATURES', No); 1860 1853 LineFeed; 1861 AddLine(Phrases.Lookup('FEATURES', no), pkBigFeature, no);1862 if no < mcFirstNonCap then1854 AddLine(Phrases.Lookup('FEATURES', No), pkBigFeature, No); 1855 if No < mcFirstNonCap then 1863 1856 AddLine(HelpText.Lookup('HELPSPEC_CAP')) 1864 else if no in AutoFeature then1857 else if No in AutoFeature then 1865 1858 AddLine(HelpText.Lookup('HELPSPEC_STANDARD')) 1866 1859 else 1867 1860 AddLine(HelpText.Lookup('HELPSPEC_FEATURE')); 1868 1861 NextSection('EFFECT'); 1869 AddTextual(HelpText.LookupByHandle(hFEATUREHELP, no));1870 if (Feature[ no].Weight <> 0) or (Feature[no].Cost <> 0) then1862 AddTextual(HelpText.LookupByHandle(hFEATUREHELP, No)); 1863 if (Feature[No].Weight <> 0) or (Feature[No].Cost <> 0) then 1871 1864 begin 1872 1865 NextSection('COSTS'); 1873 s := IntToStr(Feature[no].Cost);1874 if Feature[ no].Cost >= 0 then1875 s := '+' + s;1876 AddLine(Format(HelpText.Lookup('COSTBASE'), [ s]));1877 if Feature[ no].Weight > 0 then1866 S := IntToStr(Feature[No].Cost); 1867 if Feature[No].Cost >= 0 then 1868 S := '+' + S; 1869 AddLine(Format(HelpText.Lookup('COSTBASE'), [S])); 1870 if Feature[No].Weight > 0 then 1878 1871 begin 1879 1872 AddLine(Format(HelpText.Lookup('WEIGHT'), 1880 ['+' + IntToStr(Feature[ no].Weight)]));1881 if no = mcDefense then1873 ['+' + IntToStr(Feature[No].Weight)])); 1874 if No = mcDefense then 1882 1875 AddLine(Format(HelpText.Lookup('WEIGHT'), ['+2']), 1883 1876 pkDomain, dGround); 1884 1877 end; 1885 1878 end; 1886 if Feature[ no].Preq <> preNone then1879 if Feature[No].Preq <> preNone then 1887 1880 begin 1888 1881 LineFeed; 1889 if Feature[ no].Preq = preSun then1882 if Feature[No].Preq = preSun then 1890 1883 AddPreqImp(woSun) // sun tsu feature 1891 1884 else 1892 AddPreqAdv(Feature[ no].Preq);1885 AddPreqAdv(Feature[No].Preq); 1893 1886 MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'), 1894 1887 [MainText[Count - 1]]); … … 1901 1894 begin 1902 1895 Caption := HelpText.Lookup('HELPTITLE_MODELLIST'); 1903 for i:= 0 to nSpecialModel - 1 do1904 if i<> 2 then1905 AddModelText( i);1896 for I := 0 to nSpecialModel - 1 do 1897 if I <> 2 then 1898 AddModelText(I); 1906 1899 LineFeed; 1907 1900 AddItem('MODELNOTE'); … … 1910 1903 end; 1911 1904 if CheckSeeAlso then 1912 for i := 0 to nSeeAlso- 1 do1913 if (SeeAlso[ i].Kind = Kind) and (SeeAlso[i].no = no) then1914 case SeeAlso[ i].SeeKind of1915 hkImp: AddImprovement(SeeAlso[ i].SeeNo);1916 hkAdv: AddAdvance(SeeAlso[ i].SeeNo);1917 hkFeature: AddFeature(SeeAlso[ i].SeeNo);1905 for I := 0 to Length(SeeAlso) - 1 do 1906 if (SeeAlso[I].Kind = Kind) and (SeeAlso[I].No = No) then 1907 case SeeAlso[I].SeeKind of 1908 hkImp: AddImprovement(SeeAlso[I].SeeNo); 1909 hkAdv: AddAdvance(SeeAlso[I].SeeNo); 1910 hkFeature: AddFeature(SeeAlso[I].SeeNo); 1918 1911 end; 1919 1912 if (Headline >= 0) and (Count = Headline + 1) then … … 1926 1919 ScrollBar.SetPos(sbPos); 1927 1920 BackBtn.Visible := HistItems.Count > 1; 1928 TopBtn.Visible := (HistItems.Count > 1) or (Kind <> hkMisc) or ( no <> miscMain);1921 TopBtn.Visible := (HistItems.Count > 1) or (Kind <> hkMisc) or (No <> Integer(miscMain)); 1929 1922 Sel := -1; 1930 1923 end; // with MainText 1931 1924 end; 1932 1925 1933 procedure THelpDlg.ShowNewContent(NewMode, Category, Index: Integer); 1934 begin 1935 if (Category <> Kind) or (Index <> no) or (Category = hkMisc) and 1936 (Index = miscSearchResult) then begin 1926 procedure THelpDlg.ShowNewContent(NewMode: TWindowMode; Category: TLinkCategory; 1927 Index: Integer); 1928 begin 1929 if (Category <> Kind) or (Index <> No) or (Category = hkMisc) and 1930 (Index = Integer(miscSearchResult)) then begin 1937 1931 if HistItems.Count = MaxHist then HistItems.Delete(0); 1938 1932 if HistItems.Count = 0 then … … 1941 1935 end; 1942 1936 Kind := Category; 1943 no := Index;1937 No := Index; 1944 1938 SearchContent := NewSearchContent; 1945 1939 Prepare; … … 1949 1943 1950 1944 procedure THelpDlg.PaintBox1MouseMove(Sender: TObject; Shift: TShiftState; 1951 x, y: integer);1945 X, Y: Integer); 1952 1946 var 1953 1947 i0, Sel0: Integer; 1954 1948 begin 1955 y := y- WideFrame;1949 Y := Y - WideFrame; 1956 1950 i0 := ScrollBar.Position; 1957 1951 Sel0 := Sel; 1958 if ( x >= SideFrame) and (x < SideFrame + InnerWidth) and (y>= 0) and1959 ( y < InnerHeight) and (ymod 24 >= 8) then1960 Sel := ydiv 241952 if (X >= SideFrame) and (X < SideFrame + InnerWidth) and (Y >= 0) and 1953 (Y < InnerHeight) and (Y mod 24 >= 8) then 1954 Sel := Y div 24 1961 1955 else 1962 1956 Sel := -1; 1963 1957 if (Sel + i0 >= MainText.Count) or (Sel >= 0) and 1964 (THelpLineInfo(MainText.Objects[Sel + i0]).Link = 0) then 1958 (THelpLineInfo(MainText.Objects[Sel + i0]).Category = hkNoLink) and 1959 (THelpLineInfo(MainText.Objects[Sel + i0]).Index = 0)then 1965 1960 Sel := -1; 1966 1961 if Sel <> Sel0 then … … 1974 1969 1975 1970 procedure THelpDlg.PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; 1976 Shift: TShiftState; x, y: integer);1971 Shift: TShiftState; X, Y: Integer); 1977 1972 begin 1978 1973 if Sel >= 0 then 1979 1974 with THelpLineInfo(MainText.Objects[Sel + ScrollBar.Position]) do 1980 if Link shr 8 and $3F= hkInternet then1981 case Link and $FFof1975 if Category = hkInternet then 1976 case Index of 1982 1977 1: OpenDocument(HomeDir + AITemplateFileName); 1983 1978 2: OpenURL(CevoHomepage); … … 1986 1981 else 1987 1982 begin 1988 if (Link >= $8000) and (Link and $3FFF = liInvalid) then 1989 exit; // invalid link; 1990 if Link >= $8000 then 1991 ShowNewContent(FWindowMode, hkText, Link and $3FFF) 1992 else 1993 ShowNewContent(FWindowMode, Link shr 8 and $3F, Link and $FF); 1983 if Index < 0 then Exit; // invalid link; 1984 ShowNewContent(FWindowMode, Category, Index); 1994 1985 end; 1995 1986 end; … … 2003 1994 HistItem.Assign(HistItems.Last); 2004 1995 HistItems.Delete(HistItems.Count - 1); 2005 if (HistItem.Kind = hkMisc) and (HistItem.No = miscSearchResult) and1996 if (HistItem.Kind = hkMisc) and (HistItem.No = Integer(miscSearchResult)) and 2006 1997 (HistItem.SearchContent <> SearchContent) then 2007 1998 begin … … 2010 2001 end; 2011 2002 Kind := HistItem.Kind; 2012 no := HistItem.No;2003 No := HistItem.No; 2013 2004 Prepare(HistItem.Pos); 2014 2005 OffscreenPaint; … … 2022 2013 while HistItems.Count > 1 do HistItems.Delete(HistItems.Count - 1); 2023 2014 Kind := hkMisc; 2024 no := miscMain;2015 No := Integer(miscMain); 2025 2016 Prepare; 2026 2017 OffscreenPaint; … … 2036 2027 function THelpDlg.TextIndex(Item: string): Integer; 2037 2028 begin 2038 Result := HelpText.Get handle(Item);2029 Result := HelpText.GetHandle(Item); 2039 2030 end; 2040 2031 … … 2064 2055 1: 2065 2056 with THelpLineInfo(SearchResult.Objects[0]) do 2066 if Link >= $8000 then 2067 ShowNewContent(FWindowMode, hkText, Link and $3FFF) 2068 else 2069 ShowNewContent(FWindowMode, Link shr 8 and $3F, Link and $FF); 2070 else 2071 begin 2057 ShowNewContent(FWindowMode, Category, Index); 2058 else begin 2072 2059 NewSearchContent := InputDlg.EInput.Text; 2073 ShowNewContent(FWindowMode, hkMisc, miscSearchResult);2060 ShowNewContent(FWindowMode, hkMisc, Integer(miscSearchResult)); 2074 2061 end; 2075 2062 end; … … 2079 2066 procedure THelpDlg.Search(SearchString: string); 2080 2067 var 2081 h, i, PrevHandle, PrevIndex, p, RightMargin: Integer;2082 s: string;2083 mADVHELP, mIMPHELP, mFEATUREHELP: set of 0 ..255;2068 H, I, PrevHandle, PrevIndex, P, RightMargin: Integer; 2069 S: string; 2070 mADVHELP, mIMPHELP, mFEATUREHELP: set of 0..255; 2084 2071 bGOVHELP, bSPECIALMODEL, bJOBHELP: Boolean; 2085 2072 begin … … 2092 2079 bJOBHELP := False; 2093 2080 2094 // search in generic reference2081 // Search in generic reference 2095 2082 SearchString := UpperCase(SearchString); 2096 for i:= 0 to 35 + 4 do begin2097 s := Phrases.Lookup('TERRAIN', i);2098 if pos(SearchString, UpperCase(s)) > 0 then2099 if i< 36 then2100 SearchResult.AddLine( s+ ' ' + HelpText.Lookup('HELPSPEC_TER'),2101 pkNormal, 0, hkTer + hkCrossLink, i)2083 for I := 0 to 35 + 4 do begin 2084 S := Phrases.Lookup('TERRAIN', I); 2085 if Pos(SearchString, UpperCase(S)) > 0 then 2086 if I < 36 then 2087 SearchResult.AddLine(S + ' ' + HelpText.Lookup('HELPSPEC_TER'), 2088 pkNormal, 0, hkTer, I, True) 2102 2089 else 2103 2090 begin 2104 2091 SearchResult.AddLine(Phrases.Lookup('TERRAIN', 36) + ' ' + 2105 2092 HelpText.Lookup('HELPSPEC_TER'), pkNormal, 0, 2106 hkTer + hkCrossLink, 36);2107 if i> 36 then2093 hkTer, 36, True); 2094 if I > 36 then 2108 2095 SearchResult.AddLine(Phrases.Lookup('IMPROVEMENTS', 2109 imShipComp + i- 37) + ' ' + HelpText.Lookup('HELPSPEC_SHIPPART'),2110 pkNormal, 0, hkImp + hkCrossLink, imShipComp + i - 37);2096 imShipComp + I - 37) + ' ' + HelpText.Lookup('HELPSPEC_SHIPPART'), 2097 pkNormal, 0, hkImp, imShipComp + I - 37, True); 2111 2098 Break; 2112 2099 end; 2113 2100 end; 2114 for i := 0 to nJobHelp- 1 do2115 if pos(SearchString, UpperCase(Phrases.Lookup('JOBRESULT', JobHelp[i]))) > 02101 for I := 0 to Length(JobHelp) - 1 do 2102 if Pos(SearchString, UpperCase(Phrases.Lookup('JOBRESULT', JobHelp[I]))) > 0 2116 2103 then 2117 2104 begin 2118 2105 SearchResult.AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkNormal, 0, 2119 hkMisc + hkCrossLink, miscJobList);2106 hkMisc, Integer(miscJobList), True); 2120 2107 bJOBHELP := True; 2121 2108 Break; 2122 2109 end; 2123 for i:= 0 to nAdv - 1 do2124 begin 2125 s := Phrases.Lookup('ADVANCES', i);2126 if pos(SearchString, UpperCase(s)) > 0 then2110 for I := 0 to nAdv - 1 do 2111 begin 2112 S := Phrases.Lookup('ADVANCES', I); 2113 if Pos(SearchString, UpperCase(S)) > 0 then 2127 2114 begin 2128 if iin FutureTech then2129 s := s+ ' ' + HelpText.Lookup('HELPSPEC_FUTURE')2115 if I in FutureTech then 2116 S := S + ' ' + HelpText.Lookup('HELPSPEC_FUTURE') 2130 2117 else 2131 s := s+ ' ' + HelpText.Lookup('HELPSPEC_ADV');2132 SearchResult.AddLine( s, pkNormal, 0, hkAdv + hkCrossLink, i);2133 include(mADVHELP, i);2118 S := S + ' ' + HelpText.Lookup('HELPSPEC_ADV'); 2119 SearchResult.AddLine(S, pkNormal, 0, hkAdv, I, True); 2120 Include(mADVHELP, I); 2134 2121 end; 2135 2122 end; 2136 for i:= 0 to nSpecialModel - 1 do2137 begin 2138 FindStdModelPicture(SpecialModelPictureCode[ i], h, s);2139 if pos(SearchString, UpperCase(s)) > 0 then2123 for I := 0 to nSpecialModel - 1 do 2124 begin 2125 FindStdModelPicture(SpecialModelPictureCode[I], H, S); 2126 if Pos(SearchString, UpperCase(S)) > 0 then 2140 2127 begin 2141 2128 SearchResult.AddLine(HelpText.Lookup('HELPTITLE_MODELLIST'), pkNormal, 0, 2142 hkModel + hkCrossLink, 0);2129 hkModel, 0, True); 2143 2130 bSPECIALMODEL := True; 2144 2131 Break; 2145 2132 end; 2146 2133 end; 2147 for i:= 0 to nFeature - 1 do2148 begin 2149 s := Phrases.Lookup('FEATURES', i);2150 if Pos(SearchString, UpperCase( s)) > 0 then2134 for I := 0 to nFeature - 1 do 2135 begin 2136 S := Phrases.Lookup('FEATURES', I); 2137 if Pos(SearchString, UpperCase(S)) > 0 then 2151 2138 begin 2152 if i< mcFirstNonCap then2153 s := s+ ' ' + HelpText.Lookup('HELPSPEC_CAP')2154 else if iin AutoFeature then2155 s := s+ ' ' + HelpText.Lookup('HELPSPEC_STANDARD')2139 if I < mcFirstNonCap then 2140 S := S + ' ' + HelpText.Lookup('HELPSPEC_CAP') 2141 else if I in AutoFeature then 2142 S := S + ' ' + HelpText.Lookup('HELPSPEC_STANDARD') 2156 2143 else 2157 s := s+ ' ' + HelpText.Lookup('HELPSPEC_FEATURE');2158 SearchResult.AddLine( s, pkNormal, 0, hkFeature + hkCrossLink, i);2159 Include(mFEATUREHELP, i);2144 S := S + ' ' + HelpText.Lookup('HELPSPEC_FEATURE'); 2145 SearchResult.AddLine(S, pkNormal, 0, hkFeature, I, True); 2146 Include(mFEATUREHELP, I); 2160 2147 end; 2161 2148 end; 2162 for i:= 0 to nImp - 1 do2163 begin 2164 s := Phrases.Lookup('IMPROVEMENTS', i);2165 if Pos(SearchString, UpperCase( s)) > 0 then2149 for I := 0 to nImp - 1 do 2150 begin 2151 S := Phrases.Lookup('IMPROVEMENTS', I); 2152 if Pos(SearchString, UpperCase(S)) > 0 then 2166 2153 begin 2167 case Imp[ i].Kind of2154 case Imp[I].Kind of 2168 2155 ikWonder: 2169 s := s+ ' ' + HelpText.Lookup('HELPSPEC_WONDER');2156 S := S + ' ' + HelpText.Lookup('HELPSPEC_WONDER'); 2170 2157 ikCommon: 2171 s := s+ ' ' + HelpText.Lookup('HELPSPEC_IMP');2158 S := S + ' ' + HelpText.Lookup('HELPSPEC_IMP'); 2172 2159 ikShipPart: 2173 s := s+ ' ' + HelpText.Lookup('HELPSPEC_SHIPPART');2160 S := S + ' ' + HelpText.Lookup('HELPSPEC_SHIPPART'); 2174 2161 else 2175 s := s+ ' ' + HelpText.Lookup('HELPSPEC_NAT')2162 S := S + ' ' + HelpText.Lookup('HELPSPEC_NAT') 2176 2163 end; 2177 SearchResult.AddLine( s, pkNormal, 0, hkImp + hkCrossLink, i);2178 Include(mIMPHELP, i);2164 SearchResult.AddLine(S, pkNormal, 0, hkImp, I, True); 2165 Include(mIMPHELP, I); 2179 2166 end 2180 2167 end; 2181 for i:= 0 to nGov - 1 do2182 if Pos(SearchString, UpperCase(Phrases.Lookup('GOVERNMENT', i))) > 0 then2168 for I := 0 to nGov - 1 do 2169 if Pos(SearchString, UpperCase(Phrases.Lookup('GOVERNMENT', I))) > 0 then 2183 2170 begin 2184 2171 SearchResult.AddLine(HelpText.Lookup('HELPTITLE_GOVLIST'), pkNormal, 0, 2185 hkMisc + hkCrossLink, miscGovList);2172 hkMisc, Integer(miscGovList), True); 2186 2173 bGOVHELP := True; 2187 2174 Break; 2188 2175 end; 2189 2176 2190 // full text search2191 h:= -1;2177 // Full text search 2178 H := -1; 2192 2179 repeat 2193 PrevHandle := h;2194 PrevIndex := i;2195 if not HelpText.Search(SearchString, h, i) then2180 PrevHandle := H; 2181 PrevIndex := I; 2182 if not HelpText.Search(SearchString, H, I) then 2196 2183 Break; 2197 if h= hADVHELP then2184 if H = hADVHELP then 2198 2185 begin 2199 if ( i >= 0) and ((i <> PrevIndex) or (h<> PrevHandle)) and2200 not( iin mADVHELP) then2186 if (I >= 0) and ((I <> PrevIndex) or (H <> PrevHandle)) and 2187 not(I in mADVHELP) then 2201 2188 begin 2202 s := Phrases.Lookup('ADVANCES', i);2203 if iin FutureTech then2204 s := s+ ' ' + HelpText.Lookup('HELPSPEC_FUTURE')2189 S := Phrases.Lookup('ADVANCES', I); 2190 if I in FutureTech then 2191 S := S + ' ' + HelpText.Lookup('HELPSPEC_FUTURE') 2205 2192 else 2206 s := s+ ' ' + HelpText.Lookup('HELPSPEC_ADV');2207 SearchResult.AddLine( s, pkNormal, 0, hkAdv + hkCrossLink, i)2193 S := S + ' ' + HelpText.Lookup('HELPSPEC_ADV'); 2194 SearchResult.AddLine(S, pkNormal, 0, hkAdv, I, True); 2208 2195 end; 2209 2196 end 2210 else if h= hIMPHELP then2197 else if H = hIMPHELP then 2211 2198 begin 2212 if ( i >= 0) and ((i <> PrevIndex) or (h<> PrevHandle)) and2213 not( iin mIMPHELP) then2199 if (I >= 0) and ((I <> PrevIndex) or (H <> PrevHandle)) and 2200 not(I in mIMPHELP) then 2214 2201 begin 2215 s := Phrases.Lookup('IMPROVEMENTS', i);2216 case Imp[ i].Kind of2202 S := Phrases.Lookup('IMPROVEMENTS', I); 2203 case Imp[I].Kind of 2217 2204 ikWonder: 2218 s := s+ ' ' + HelpText.Lookup('HELPSPEC_WONDER');2205 S := S + ' ' + HelpText.Lookup('HELPSPEC_WONDER'); 2219 2206 ikCommon: 2220 s := s+ ' ' + HelpText.Lookup('HELPSPEC_IMP');2207 S := S + ' ' + HelpText.Lookup('HELPSPEC_IMP'); 2221 2208 ikShipPart: 2222 s := s+ ' ' + HelpText.Lookup('HELPSPEC_SHIPPART');2209 S := S + ' ' + HelpText.Lookup('HELPSPEC_SHIPPART'); 2223 2210 else 2224 s := s+ ' ' + HelpText.Lookup('HELPSPEC_NAT')2211 S := S + ' ' + HelpText.Lookup('HELPSPEC_NAT') 2225 2212 end; 2226 SearchResult.AddLine( s, pkNormal, 0, hkImp + hkCrossLink, i)2213 SearchResult.AddLine(S, pkNormal, 0, hkImp, I, True); 2227 2214 end; 2228 2215 end 2229 else if h= hFEATUREHELP then2216 else if H = hFEATUREHELP then 2230 2217 begin 2231 if ( i >= 0) and ((i <> PrevIndex) or (h<> PrevHandle)) and2232 not( iin mFEATUREHELP) then2218 if (I >= 0) and ((I <> PrevIndex) or (H <> PrevHandle)) and 2219 not(I in mFEATUREHELP) then 2233 2220 begin 2234 s := Phrases.Lookup('FEATURES', i);2235 if i< mcFirstNonCap then2236 s := s+ ' ' + HelpText.Lookup('HELPSPEC_CAP')2237 else if iin AutoFeature then2238 s := s+ ' ' + HelpText.Lookup('HELPSPEC_STANDARD')2221 S := Phrases.Lookup('FEATURES', I); 2222 if I < mcFirstNonCap then 2223 S := S + ' ' + HelpText.Lookup('HELPSPEC_CAP') 2224 else if I in AutoFeature then 2225 S := S + ' ' + HelpText.Lookup('HELPSPEC_STANDARD') 2239 2226 else 2240 s := s+ ' ' + HelpText.Lookup('HELPSPEC_FEATURE');2241 SearchResult.AddLine( s, pkNormal, 0, hkFeature + hkCrossLink, i);2227 S := S + ' ' + HelpText.Lookup('HELPSPEC_FEATURE'); 2228 SearchResult.AddLine(S, pkNormal, 0, hkFeature, I, True); 2242 2229 end; 2243 2230 end 2244 else if h= hGOVHELP then2231 else if H = hGOVHELP then 2245 2232 begin 2246 if ( i >= 0) and (h<> PrevHandle) and not bGOVHELP then2233 if (I >= 0) and (H <> PrevHandle) and not bGOVHELP then 2247 2234 SearchResult.AddLine(HelpText.Lookup('HELPTITLE_GOVLIST'), pkNormal, 0, 2248 hkMisc + hkCrossLink, miscGovList)2235 hkMisc, Integer(miscGovList), True); 2249 2236 end 2250 else if h= hSPECIALMODEL then2237 else if H = hSPECIALMODEL then 2251 2238 begin 2252 if ( i >= 0) and (h<> PrevHandle) and not bSPECIALMODEL then2239 if (I >= 0) and (H <> PrevHandle) and not bSPECIALMODEL then 2253 2240 SearchResult.AddLine(HelpText.Lookup('HELPTITLE_MODELLIST'), pkNormal, 2254 0, hkModel + hkCrossLink, 0)2241 0, hkModel, 0, True); 2255 2242 end 2256 else if h= hJOBHELP then2243 else if H = hJOBHELP then 2257 2244 begin 2258 if ( i >= 0) and (h<> PrevHandle) and not bJOBHELP then2245 if (I >= 0) and (H <> PrevHandle) and not bJOBHELP then 2259 2246 SearchResult.AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkNormal, 0, 2260 hkMisc + hkCrossLink, miscJobList)2247 hkMisc, Integer(miscJobList), True); 2261 2248 end 2262 else if { (h<>hMAIN) and } ( h<> PrevHandle) then2249 else if { (h<>hMAIN) and } (H <> PrevHandle) then 2263 2250 begin 2264 s := HelpText.LookupByHandle(h);2265 p := Pos('$', s);2266 if p> 0 then2251 S := HelpText.LookupByHandle(H); 2252 P := Pos('$', S); 2253 if P > 0 then 2267 2254 begin 2268 s := Copy(s, p + 1, maxint);2269 p := Pos('\', s);2270 if p> 0 then2271 s := Copy(s, 1, p- 1);2272 SearchResult.AddLine( s, pkNormal, 0, hkText + hkCrossLink, h);2255 S := Copy(S, P + 1, MaxInt); 2256 P := Pos('\', S); 2257 if P > 0 then 2258 S := Copy(S, 1, P - 1); 2259 SearchResult.AddLine(S, pkNormal, 0, hkText, H, True); 2273 2260 end; 2274 2261 end; 2275 2276 2277 // cut lines to fit to window2278 2279 2280 for i:= 0 to SearchResult.Count - 1 do2281 2282 while BiColorTextWidth(OffScreen.Canvas, SearchResult[i]) >2283 2284 SearchResult[i] := copy(SearchResult[i], 1, length(SearchResult[i]) - 1)2285 2286 2262 until False; 2263 2264 // Cut lines to fit to window 2265 RightMargin := InnerWidth - 16 - DpiGetSystemMetrics(SM_CXVSCROLL); 2266 OffScreen.Canvas.Font.Assign(UniFont[ftNormal]); 2267 for I := 0 to SearchResult.Count - 1 do 2268 begin 2269 while BiColorTextWidth(OffScreen.Canvas, SearchResult[I]) > 2270 RightMargin - 32 do 2271 SearchResult[I] := Copy(SearchResult[I], 1, Length(SearchResult[I]) - 1) 2272 end; 2273 end; 2287 2274 2288 2275 end. -
branches/highdpi/LocalPlayer/IsoEngine.pas
r405 r465 5 5 6 6 uses 7 UDpiControls, Protocol, ClientTools, ScreenTools, Tribes, 8 LCLIntf, LCLType, SysUtils, Classes, Graphics, UPixelPointer, UGraphicSet;7 UDpiControls, Protocol, ClientTools, ScreenTools, Tribes, LCLIntf, LCLType, SysUtils, 8 Classes, Graphics, PixelPointer, GraphicSet; 9 9 10 10 const … … 13 13 14 14 type 15 TInitEnemyModelEvent = function(emix: integer): boolean;15 TInitEnemyModelEvent = function(emix: Integer): Boolean; 16 16 TTileSize = (tsSmall, tsMedium, tsBig); 17 17 … … 33 33 Dirx: array [0..7] of Integer = (1, 2, 1, 0, -1, -2, -1, 0); 34 34 Diry: array [0..7] of Integer = (-1, 0, 1, 2, 1, 0, -1, -2); 35 procedure CityGrid(xm, ym: integer; CityAllowClick: Boolean);36 function IsShoreTile(Loc: integer): boolean;35 procedure CityGrid(xm, ym: Integer; CityAllowClick: Boolean); 36 function IsShoreTile(Loc: Integer): Boolean; 37 37 procedure MakeDark(Line: PPixelPointer; Length: Integer); 38 38 procedure SetTileSize(AValue: TTileSize); 39 procedure ShadeOutside(x0, y0, Width, Height, xm, ym: integer);39 procedure ShadeOutside(x0, y0, Width, Height, xm, ym: Integer); 40 40 protected 41 41 FOutput: TDpiBitmap; … … 65 65 ShowDebug: Boolean; 66 66 FoW: Boolean; 67 function Connection4(Loc, Mask, Value: integer): integer;68 function Connection8(Loc, Mask: integer): integer;69 function OceanConnection(Loc: integer): integer;70 procedure PaintShore( x, y, Loc: integer);71 procedure PaintTileExtraTerrain( x, y, Loc: integer);72 procedure PaintTileObjects( x, y, Loc, CityLoc, CityOwner: integer;73 UseBlink: boolean);74 procedure PaintGrid( x, y, nx, ny: integer);75 procedure FillRect( x, y, Width, Height, Color: integer);76 procedure Textout( x, y, Color: integer; const s: string);77 procedure Sprite(HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);78 procedure TSprite(xDst, yDst, grix: integer; PureBlack: boolean = false);67 function Connection4(Loc, Mask, Value: Integer): Integer; 68 function Connection8(Loc, Mask: Integer): Integer; 69 function OceanConnection(Loc: Integer): Integer; 70 procedure PaintShore(X, Y, Loc: Integer); 71 procedure PaintTileExtraTerrain(X, Y, Loc: Integer); 72 procedure PaintTileObjects(X, Y, Loc, CityLoc, CityOwner: Integer; 73 UseBlink: Boolean); 74 procedure PaintGrid(X, Y, nx, ny: Integer); 75 procedure FillRect(X, Y, Width, Height, Color: Integer); 76 procedure Textout(X, Y, Color: Integer; const S: string); 77 procedure Sprite(HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer); 78 procedure TSprite(xDst, yDst, grix: Integer; PureBlack: Boolean = False); 79 79 procedure ApplyTileSize(ATileSize: TTileSize); 80 80 public … … 89 89 procedure Reset; 90 90 procedure SetOutput(Output: TDpiBitmap); 91 procedure SetPaintBounds(Left, Top, Right, Bottom: integer);92 procedure Paint( x, y, Loc, nx, ny, CityLoc, CityOwner: integer;93 UseBlink: boolean = false; CityAllowClick: boolean = false);94 procedure PaintUnit( x, y: integer; const UnitInfo: TUnitInfo;95 Status: integer);96 procedure PaintCity( x, y: integer; const CityInfo: TCityInfo;97 accessory: boolean = true);98 procedure BitBltBitmap(Src: TDpiBitmap; x, y, Width, Height, xSrc, ySrc,99 Rop: integer);91 procedure SetPaintBounds(Left, Top, Right, Bottom: Integer); 92 procedure Paint(X, Y, Loc, nx, ny, CityLoc, CityOwner: Integer; 93 UseBlink: Boolean = False; CityAllowClick: Boolean = False); 94 procedure PaintUnit(X, Y: Integer; const UnitInfo: TUnitInfo; 95 Status: Integer); 96 procedure PaintCity(X, Y: Integer; const CityInfo: TCityInfo; 97 accessory: Boolean = True); 98 procedure BitBltBitmap(Src: TDpiBitmap; X, Y, Width, Height, xSrc, ySrc, 99 Rop: Integer); 100 100 procedure AttackBegin(const ShowMove: TShowMove); 101 101 procedure AttackEffect(const ShowMove: TShowMove); 102 102 procedure AttackEnd; 103 103 procedure ReduceTerrainIconsSize; 104 property AdviceLoc: integer read FAdviceLoc write FAdviceLoc;104 property AdviceLoc: Integer read FAdviceLoc write FAdviceLoc; 105 105 property TileSize: TTileSize read FTileSize write SetTileSize; 106 106 end; … … 127 127 (X: 72; Y: 36)); 128 128 129 function IsJungle( y: integer): boolean;129 function IsJungle(Y: Integer): Boolean; 130 130 procedure Init(InitEnemyModelHandler: TInitEnemyModelEvent); 131 131 … … 173 173 IsoMapCache: array[TTileSize] of TIsoMapCache; 174 174 175 function IsJungle( y: integer): boolean;176 begin 177 result := (y > (G.ly - 2) div 4) and (G.ly - 1 - y> (G.ly - 2) div 4)175 function IsJungle(Y: Integer): Boolean; 176 begin 177 Result := (Y > (G.ly - 2) div 4) and (G.ly - 1 - Y > (G.ly - 2) div 4) 178 178 end; 179 179 … … 254 254 Mask24.BeginUpdate; 255 255 for ySrc := 0 to TerrainIconLines - 1 do begin 256 for i:= 0 to yyt * 3 - 1 do257 MaskLine[ i] := PixelPointer(Mask24, ScaleToNative(0),258 ScaleToNative(1 + ySrc * (yyt * 3 + 1) + i));256 for I := 0 to yyt * 3 - 1 do 257 MaskLine[I] := TPixelPointer.Create(Mask24, ScaleToNative(0), 258 ScaleToNative(1 + ySrc * (yyt * 3 + 1) + I)); 259 259 for xSrc := 0 to TerrainIconCols - 1 do begin 260 i:= ySrc * 9 + xSrc;261 TSpriteSize[ i].Left := 0;260 I := ySrc * 9 + xSrc; 261 TSpriteSize[I].Left := 0; 262 262 repeat 263 Border := true;264 for y:= 0 to yyt * 3 - 1 do begin265 MaskLine[ y].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + TSpriteSize[i].Left));266 if MaskLine[ y].Pixel^.B = 0 then Border := false;263 Border := True; 264 for Y := 0 to yyt * 3 - 1 do begin 265 MaskLine[Y].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + TSpriteSize[I].Left)); 266 if MaskLine[Y].Pixel^.B = 0 then Border := False; 267 267 end; 268 if Border then Inc(TSpriteSize[ i].Left);269 until not Border or (TSpriteSize[ i].Left = xxt * 2 - 1);270 TSpriteSize[ i].Top := 0;268 if Border then Inc(TSpriteSize[I].Left); 269 until not Border or (TSpriteSize[I].Left = xxt * 2 - 1); 270 TSpriteSize[I].Top := 0; 271 271 repeat 272 Border := true;273 for x:= 0 to xxt * 2 - 1 do begin274 MaskLine[TSpriteSize[ i].Top].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + x));275 if MaskLine[TSpriteSize[ i].Top].Pixel^.B = 0 then Border := false;272 Border := True; 273 for X := 0 to xxt * 2 - 1 do begin 274 MaskLine[TSpriteSize[I].Top].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + X)); 275 if MaskLine[TSpriteSize[I].Top].Pixel^.B = 0 then Border := False; 276 276 end; 277 if Border then inc(TSpriteSize[i].Top);278 until not Border or (TSpriteSize[ i].Top = yyt * 3 - 1);279 TSpriteSize[ i].Right := xxt * 2;277 if Border then Inc(TSpriteSize[I].Top); 278 until not Border or (TSpriteSize[I].Top = yyt * 3 - 1); 279 TSpriteSize[I].Right := xxt * 2; 280 280 repeat 281 Border := true;282 for y:= 0 to yyt * 3 - 1 do begin283 MaskLine[ y].SetX(ScaleToNative(xSrc * (xxt * 2 + 1) + TSpriteSize[i].Right));284 if MaskLine[ y].Pixel^.B = 0 then Border := false;281 Border := True; 282 for Y := 0 to yyt * 3 - 1 do begin 283 MaskLine[Y].SetX(ScaleToNative(xSrc * (xxt * 2 + 1) + TSpriteSize[I].Right)); 284 if MaskLine[Y].Pixel^.B = 0 then Border := False; 285 285 end; 286 if Border then Dec(TSpriteSize[ i].Right);287 until not Border or (TSpriteSize[ i].Right = TSpriteSize[i].Left);288 TSpriteSize[ i].Bottom := yyt * 3;286 if Border then Dec(TSpriteSize[I].Right); 287 until not Border or (TSpriteSize[I].Right = TSpriteSize[I].Left); 288 TSpriteSize[I].Bottom := yyt * 3; 289 289 repeat 290 Border := true;291 for x:= 0 to xxt * 2 - 1 do begin292 MaskLine[TSpriteSize[ i].Bottom - 1].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + x));293 if MaskLine[TSpriteSize[ i].Bottom - 1].Pixel^.B = 0 then Border := false;290 Border := True; 291 for X := 0 to xxt * 2 - 1 do begin 292 MaskLine[TSpriteSize[I].Bottom - 1].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + X)); 293 if MaskLine[TSpriteSize[I].Bottom - 1].Pixel^.B = 0 then Border := False; 294 294 end; 295 if Border then Dec(TSpriteSize[ i].Bottom);296 until not Border or (TSpriteSize[ i].Bottom = TSpriteSize[i].Top);295 if Border then Dec(TSpriteSize[I].Bottom); 296 until not Border or (TSpriteSize[I].Bottom = TSpriteSize[I].Top); 297 297 end; 298 298 end; … … 303 303 procedure TIsoMap.ApplyTileSize(ATileSize: TTileSize); 304 304 var 305 x: Integer;306 y: Integer;305 X: Integer; 306 Y: Integer; 307 307 xSrc: Integer; 308 308 ySrc: Integer; … … 357 357 DitherMask.SetSize(xxt * 2, yyt * 2); 358 358 DitherMask.Canvas.FillRect(0, 0, DitherMask.Width, DitherMask.Height); 359 DpiBit Canvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2,359 DpiBitBltCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2, 360 360 HGrTerrain.Mask.Canvas, 1 + 7 * (xxt * 2 + 1), 361 361 1 + yyt + 15 * (yyt * 3 + 1), SRCAND); 362 362 363 for x:= -1 to 6 do begin364 if x= -1 then begin363 for X := -1 to 6 do begin 364 if X = -1 then begin 365 365 xSrc := ShoreDither * (xxt * 2 + 1) + 1; 366 366 ySrc := 1 + yyt; 367 367 end 368 else if x= 6 then begin368 else if X = 6 then begin 369 369 xSrc := 1 + (xxt * 2 + 1) * 2; 370 370 ySrc := 1 + yyt + (yyt * 3 + 1) * 2; 371 371 end else begin 372 xSrc := ( x+ 2) * (xxt * 2 + 1) + 1;372 xSrc := (X + 2) * (xxt * 2 + 1) + 1; 373 373 ySrc := 1 + yyt; 374 374 end; 375 for y:= -1 to 6 do376 DpiBit Canvas(LandPatch.Canvas, (x + 2) * (xxt * 2), (y+ 2) * yyt,375 for Y := -1 to 6 do 376 DpiBitBltCanvas(LandPatch.Canvas, (X + 2) * (xxt * 2), (Y + 2) * yyt, 377 377 xxt * 2, yyt, HGrTerrain.Data.Canvas, xSrc, ySrc); 378 for y:= -2 to 6 do379 DpiBit Canvas(LandPatch.Canvas, (x + 2) * (xxt * 2), (y+ 2) * yyt, xxt,378 for Y := -2 to 6 do 379 DpiBitBltCanvas(LandPatch.Canvas, (X + 2) * (xxt * 2), (Y + 2) * yyt, xxt, 380 380 yyt, HGrTerrain.Data.Canvas, xSrc + xxt, ySrc + yyt, 381 381 SRCPAINT); 382 for y:= -2 to 6 do383 DpiBit Canvas(LandPatch.Canvas, (x + 2) * (xxt * 2) + xxt, (y+ 2) * yyt,382 for Y := -2 to 6 do 383 DpiBitBltCanvas(LandPatch.Canvas, (X + 2) * (xxt * 2) + xxt, (Y + 2) * yyt, 384 384 xxt, yyt, HGrTerrain.Data.Canvas, xSrc, ySrc + yyt, 385 385 SRCPAINT); 386 for y:= -2 to 6 do387 DpiBit Canvas(LandPatch.Canvas, (x + 2) * (xxt * 2), (y+ 2) * yyt, xxt,386 for Y := -2 to 6 do 387 DpiBitBltCanvas(LandPatch.Canvas, (X + 2) * (xxt * 2), (Y + 2) * yyt, xxt, 388 388 yyt, DitherMask.Canvas, xxt, yyt, SRCAND); 389 for y:= -2 to 6 do390 DpiBit Canvas(LandPatch.Canvas, (x + 2) * (xxt * 2) + xxt, (y+ 2) * yyt,389 for Y := -2 to 6 do 390 DpiBitBltCanvas(LandPatch.Canvas, (X + 2) * (xxt * 2) + xxt, (Y + 2) * yyt, 391 391 xxt, yyt, DitherMask.Canvas, 0, yyt, SRCAND); 392 392 end; 393 393 394 for y:= -1 to 6 do begin395 if y= -1 then begin394 for Y := -1 to 6 do begin 395 if Y = -1 then begin 396 396 xSrc := ShoreDither * (xxt * 2 + 1) + 1; 397 397 ySrc := 1 + yyt; 398 398 end 399 else if y= 6 then begin399 else if Y = 6 then begin 400 400 xSrc := 1 + 2 * (xxt * 2 + 1); 401 401 ySrc := 1 + yyt + 2 * (yyt * 3 + 1); 402 402 end else begin 403 xSrc := ( y+ 2) * (xxt * 2 + 1) + 1;403 xSrc := (Y + 2) * (xxt * 2 + 1) + 1; 404 404 ySrc := 1 + yyt; 405 405 end; 406 for x:= -2 to 6 do407 DpiBit Canvas(LandMore.Canvas, (x + 2) * (xxt * 2), (y+ 2) * yyt,406 for X := -2 to 6 do 407 DpiBitBltCanvas(LandMore.Canvas, (X + 2) * (xxt * 2), (Y + 2) * yyt, 408 408 xxt * 2, yyt, HGrTerrain.Data.Canvas, xSrc, ySrc); 409 DpiBit Canvas(LandMore.Canvas, xxt * 2, (y+ 2) * yyt, xxt, yyt,409 DpiBitBltCanvas(LandMore.Canvas, xxt * 2, (Y + 2) * yyt, xxt, yyt, 410 410 HGrTerrain.Data.Canvas, xSrc + xxt, ySrc + yyt, SRCPAINT); 411 for x:= 0 to 7 do412 DpiBit Canvas(LandMore.Canvas, (x + 2) * (xxt * 2) - xxt, (y+ 2) * yyt,411 for X := 0 to 7 do 412 DpiBitBltCanvas(LandMore.Canvas, (X + 2) * (xxt * 2) - xxt, (Y + 2) * yyt, 413 413 xxt * 2, yyt, HGrTerrain.Data.Canvas, xSrc, ySrc + yyt, 414 414 SRCPAINT); 415 for x:= -2 to 6 do416 DpiBit Canvas(LandMore.Canvas, (x + 2) * (xxt * 2), (y+ 2) * yyt,415 for X := -2 to 6 do 416 DpiBitBltCanvas(LandMore.Canvas, (X + 2) * (xxt * 2), (Y + 2) * yyt, 417 417 xxt * 2, yyt, DitherMask.Canvas, 0, 0, SRCAND); 418 418 end; 419 419 420 for x:= 0 to 3 do begin421 for y:= 0 to 3 do begin422 if ( x = 1) and (y= 1) then xSrc := 1420 for X := 0 to 3 do begin 421 for Y := 0 to 3 do begin 422 if (X = 1) and (Y = 1) then xSrc := 1 423 423 else 424 xSrc := ( xmod 2) * (xxt * 2 + 1) + 1;424 xSrc := (X mod 2) * (xxt * 2 + 1) + 1; 425 425 ySrc := 1 + yyt; 426 if ( x >= 1) = (y>= 2) then427 DpiBit Canvas(OceanPatch.Canvas, x * (xxt * 2), y* yyt, xxt * 2, yyt,426 if (X >= 1) = (Y >= 2) then 427 DpiBitBltCanvas(OceanPatch.Canvas, X * (xxt * 2), Y * yyt, xxt * 2, yyt, 428 428 HGrTerrain.Data.Canvas, xSrc, ySrc); 429 if ( x >= 1) and ((y < 2) or (x>= 2)) then429 if (X >= 1) and ((Y < 2) or (X >= 2)) then 430 430 begin 431 DpiBit Canvas(OceanPatch.Canvas, x * (xxt * 2), y* yyt, xxt, yyt,431 DpiBitBltCanvas(OceanPatch.Canvas, X * (xxt * 2), Y * yyt, xxt, yyt, 432 432 HGrTerrain.Data.Canvas, xSrc + xxt, ySrc + yyt, 433 433 SRCPAINT); 434 DpiBit Canvas(OceanPatch.Canvas, x * (xxt * 2) + xxt, y* yyt, xxt, yyt,434 DpiBitBltCanvas(OceanPatch.Canvas, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt, 435 435 HGrTerrain.Data.Canvas, xSrc, ySrc + yyt, SRCPAINT); 436 436 end; 437 DpiBit Canvas(OceanPatch.Canvas, x * (xxt * 2), y* yyt, xxt, yyt,437 DpiBitBltCanvas(OceanPatch.Canvas, X * (xxt * 2), Y * yyt, xxt, yyt, 438 438 DitherMask.Canvas, xxt, yyt, SRCAND); 439 DpiBit Canvas(OceanPatch.Canvas, x * (xxt * 2) + xxt, y* yyt, xxt, yyt,439 DpiBitBltCanvas(OceanPatch.Canvas, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt, 440 440 DitherMask.Canvas, 0, yyt, SRCAND); 441 441 end; 442 442 end; 443 443 444 for y:= 0 to 3 do begin445 for x:= 0 to 3 do begin446 if ( x = 1) and (y= 1) then xSrc := 1444 for Y := 0 to 3 do begin 445 for X := 0 to 3 do begin 446 if (X = 1) and (Y = 1) then xSrc := 1 447 447 else 448 xSrc := ( ymod 2) * (xxt * 2 + 1) + 1;448 xSrc := (Y mod 2) * (xxt * 2 + 1) + 1; 449 449 ySrc := 1 + yyt; 450 if ( x < 1) or (y>= 2) then451 DpiBit Canvas(OceanMore.Canvas, x * (xxt * 2), y* yyt, xxt * 2, yyt,450 if (X < 1) or (Y >= 2) then 451 DpiBitBltCanvas(OceanMore.Canvas, X * (xxt * 2), Y * yyt, xxt * 2, yyt, 452 452 HGrTerrain.Data.Canvas, xSrc, ySrc); 453 if ( x = 1) and (y < 2) or (x >= 2) and (y>= 1) then453 if (X = 1) and (Y < 2) or (X >= 2) and (Y >= 1) then 454 454 begin 455 DpiBit Canvas(OceanMore.Canvas, x * (xxt * 2), y* yyt, xxt, yyt,455 DpiBitBltCanvas(OceanMore.Canvas, X * (xxt * 2), Y * yyt, xxt, yyt, 456 456 HGrTerrain.Data.Canvas, xSrc + xxt, ySrc + yyt, 457 457 SRCPAINT); 458 DpiBit Canvas(OceanMore.Canvas, x * (xxt * 2) + xxt, y* yyt, xxt, yyt,458 DpiBitBltCanvas(OceanMore.Canvas, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt, 459 459 HGrTerrain.Data.Canvas, xSrc, ySrc + yyt, SRCPAINT); 460 460 end; 461 DpiBit Canvas(OceanMore.Canvas, x * (xxt * 2), y* yyt, xxt * 2, yyt,461 DpiBitBltCanvas(OceanMore.Canvas, X * (xxt * 2), Y * yyt, xxt * 2, yyt, 462 462 DitherMask.Canvas, 0, 0, SRCAND); 463 463 end; 464 464 end; 465 465 466 DpiBit Canvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2,466 DpiBitBltCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2, 467 467 DitherMask.Canvas, 0, 0, DSTINVERT); { invert dither mask } 468 DpiBit Canvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2,468 DpiBitBltCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2, 469 469 HGrTerrain.Mask.Canvas, 1, 1 + yyt, SRCPAINT); 470 470 471 for x:= -1 to 6 do472 for y:= -2 to 6 do473 DpiBit Canvas(LandPatch.Canvas, (x + 2) * (xxt * 2), (y+ 2) * yyt,471 for X := -1 to 6 do 472 for Y := -2 to 6 do 473 DpiBitBltCanvas(LandPatch.Canvas, (X + 2) * (xxt * 2), (Y + 2) * yyt, 474 474 xxt * 2, yyt, DitherMask.Canvas, 0, 0, SRCAND); 475 475 476 for y:= -1 to 6 do477 for x:= -2 to 7 do478 DpiBit Canvas(LandMore.Canvas, (x + 2) * (xxt * 2) - xxt, (y+ 2) * yyt,476 for Y := -1 to 6 do 477 for X := -2 to 7 do 478 DpiBitBltCanvas(LandMore.Canvas, (X + 2) * (xxt * 2) - xxt, (Y + 2) * yyt, 479 479 xxt * 2, yyt, DitherMask.Canvas, 0, yyt, SRCAND); 480 480 481 DpiBit Canvas(LandPatch.Canvas, 0, 0, (xxt * 2) * 9, yyt * 9,481 DpiBitBltCanvas(LandPatch.Canvas, 0, 0, (xxt * 2) * 9, yyt * 9, 482 482 LandMore.Canvas, 0, 0, SRCPAINT); 483 483 484 for x:= 0 to 3 do485 for y:= 0 to 3 do486 DpiBit Canvas(OceanPatch.Canvas, x * (xxt * 2), y* yyt, xxt * 2, yyt,484 for X := 0 to 3 do 485 for Y := 0 to 3 do 486 DpiBitBltCanvas(OceanPatch.Canvas, X * (xxt * 2), Y * yyt, xxt * 2, yyt, 487 487 DitherMask.Canvas, 0, 0, SRCAND); 488 488 489 for y:= 0 to 3 do490 for x:= 0 to 4 do491 DpiBit Canvas(OceanMore.Canvas, x * (xxt * 2) - xxt, y* yyt, xxt * 2,489 for Y := 0 to 3 do 490 for X := 0 to 4 do 491 DpiBitBltCanvas(OceanMore.Canvas, X * (xxt * 2) - xxt, Y * yyt, xxt * 2, 492 492 yyt, DitherMask.Canvas, 0, yyt, SRCAND); 493 493 494 DpiBit Canvas(OceanPatch.Canvas, 0, 0, (xxt * 2) * 4, yyt * 4,494 DpiBitBltCanvas(OceanPatch.Canvas, 0, 0, (xxt * 2) * 4, yyt * 4, 495 495 OceanMore.Canvas, 0, 0, SRCPAINT); 496 496 … … 499 499 FillRect(Rect(0, 0, xxt * 2, yyt)); 500 500 end; 501 DpiBit Canvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt,501 DpiBitBltCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt, 502 502 HGrTerrain.Mask.Canvas, 1, 1 + yyt); 503 503 504 for x:= 0 to 6 do505 DpiBit Canvas(LandPatch.Canvas, (x+ 2) * (xxt * 2), yyt, xxt * 2, yyt,504 for X := 0 to 6 do 505 DpiBitBltCanvas(LandPatch.Canvas, (X + 2) * (xxt * 2), yyt, xxt * 2, yyt, 506 506 DitherMask.Canvas, 0, 0, SRCAND); 507 DpiBit Canvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt, DitherMask.Canvas,507 DpiBitBltCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt, DitherMask.Canvas, 508 508 0, 0, DSTINVERT); 509 509 510 for y:= 0 to 6 do511 DpiBit Canvas(LandPatch.Canvas, xxt * 2, (y+ 2) * yyt, xxt * 2, yyt,510 for Y := 0 to 6 do 511 DpiBitBltCanvas(LandPatch.Canvas, xxt * 2, (Y + 2) * yyt, xxt * 2, yyt, 512 512 DitherMask.Canvas, 0, 0, SRCAND); 513 513 … … 555 555 end; 556 556 557 procedure TIsoMap.SetPaintBounds(Left, Top, Right, Bottom: integer);557 procedure TIsoMap.SetPaintBounds(Left, Top, Right, Bottom: Integer); 558 558 begin 559 559 FLeft := Left; … … 563 563 end; 564 564 565 procedure TIsoMap.FillRect( x, y, Width, Height, Color: integer);566 begin 567 if x< FLeft then568 begin 569 Width := Width - (FLeft - x);570 x:= FLeft;571 end; 572 if y< FTop then573 begin 574 Height := Height - (FTop - y);575 y:= FTop;576 end; 577 if x+ Width >= FRight then578 Width := FRight - x;579 if y+ Height >= FBottom then580 Height := FBottom - y;565 procedure TIsoMap.FillRect(X, Y, Width, Height, Color: Integer); 566 begin 567 if X < FLeft then 568 begin 569 Width := Width - (FLeft - X); 570 X := FLeft; 571 end; 572 if Y < FTop then 573 begin 574 Height := Height - (FTop - Y); 575 Y := FTop; 576 end; 577 if X + Width >= FRight then 578 Width := FRight - X; 579 if Y + Height >= FBottom then 580 Height := FBottom - Y; 581 581 if (Width <= 0) or (Height <= 0) then 582 exit;582 Exit; 583 583 584 584 FOutput.Canvas.Brush.Color := Color; 585 FOutput.Canvas.FillRect(Rect( x, y, x + Width, y+ Height));585 FOutput.Canvas.FillRect(Rect(X, Y, X + Width, Y + Height)); 586 586 FOutput.Canvas.Brush.Style := bsClear; 587 587 end; 588 588 589 procedure TIsoMap.Textout( x, y, Color: integer; const s: string);589 procedure TIsoMap.Textout(X, Y, Color: Integer; const S: string); 590 590 begin 591 591 FOutput.Canvas.Font.Color := Color; 592 FOutput.Canvas.TextRect(Rect(FLeft, FTop, FRight, FBottom), x, y, s)593 end; 594 595 procedure TIsoMap.BitBltBitmap(Src: TDpiBitmap; x, y, Width, Height, xSrc, ySrc,596 Rop: integer);597 begin 598 if x< FLeft then599 begin 600 Width := Width - (FLeft - x);601 xSrc := xSrc + (FLeft - x);602 x:= FLeft;603 end; 604 if y< FTop then605 begin 606 Height := Height - (FTop - y);607 ySrc := ySrc + (FTop - y);608 y:= FTop;609 end; 610 if x+ Width >= FRight then611 Width := FRight - x;612 if y+ Height >= FBottom then613 Height := FBottom - y;592 FOutput.Canvas.TextRect(Rect(FLeft, FTop, FRight, FBottom), X, Y, S) 593 end; 594 595 procedure TIsoMap.BitBltBitmap(Src: TDpiBitmap; X, Y, Width, Height, xSrc, ySrc, 596 Rop: Integer); 597 begin 598 if X < FLeft then 599 begin 600 Width := Width - (FLeft - X); 601 xSrc := xSrc + (FLeft - X); 602 X := FLeft; 603 end; 604 if Y < FTop then 605 begin 606 Height := Height - (FTop - Y); 607 ySrc := ySrc + (FTop - Y); 608 Y := FTop; 609 end; 610 if X + Width >= FRight then 611 Width := FRight - X; 612 if Y + Height >= FBottom then 613 Height := FBottom - Y; 614 614 if (Width <= 0) or (Height <= 0) then 615 exit;616 617 DpiBit Canvas(FOutput.Canvas, x, y, Width, Height, Src.Canvas, xSrc, ySrc, Rop);618 end; 619 620 procedure TIsoMap.Sprite(HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);615 Exit; 616 617 DpiBitBltCanvas(FOutput.Canvas, X, Y, Width, Height, Src.Canvas, xSrc, ySrc, Rop); 618 end; 619 620 procedure TIsoMap.Sprite(HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer); 621 621 begin 622 622 BitBltBitmap(HGr.Mask, xDst, yDst, Width, Height, xGr, yGr, SRCAND); … … 624 624 end; 625 625 626 procedure TIsoMap.TSprite(xDst, yDst, grix: integer;627 PureBlack: boolean = false);626 procedure TIsoMap.TSprite(xDst, yDst, grix: Integer; 627 PureBlack: Boolean = False); 628 628 var 629 629 Width: Integer; 630 630 Height: Integer; 631 631 xSrc: Integer; 632 ySrc: integer;632 ySrc: Integer; 633 633 begin 634 634 Width := TSpriteSize[grix].Right - TSpriteSize[grix].Left; … … 653 653 Height := FBottom - yDst; 654 654 if (Width <= 0) or (Height <= 0) then 655 exit;656 657 DpiBit Canvas(FOutput.Canvas, xDst, yDst, Width, Height, MaskCanvas, xSrc, ySrc, SRCAND);655 Exit; 656 657 DpiBitBltCanvas(FOutput.Canvas, xDst, yDst, Width, Height, MaskCanvas, xSrc, ySrc, SRCAND); 658 658 if not PureBlack then 659 DpiBit Canvas(FOutput.Canvas, xDst, yDst, Width, Height, DataCanvas, xSrc, ySrc, SRCPAINT);660 end; 661 662 procedure TIsoMap.PaintUnit( x, y: integer; const UnitInfo: TUnitInfo;663 Status: integer);664 var 665 xsh, ysh, xGr, yGr, j, mixShow: integer;659 DpiBitBltCanvas(FOutput.Canvas, xDst, yDst, Width, Height, DataCanvas, xSrc, ySrc, SRCPAINT); 660 end; 661 662 procedure TIsoMap.PaintUnit(X, Y: Integer; const UnitInfo: TUnitInfo; 663 Status: Integer); 664 var 665 xsh, ysh, xGr, yGr, J, mixShow: Integer; 666 666 begin 667 667 with UnitInfo do 668 if (Owner = me) or (emix <> $FFFF) then668 if (Owner = Me) or (emix <> $FFFF) then 669 669 begin 670 670 if Job = jCity then … … 675 675 (@OnInitEnemyModel <> nil) then 676 676 if not OnInitEnemyModel(emix) then 677 exit;677 Exit; 678 678 xsh := Tribe[Owner].ModelPicture[mixShow].xShield; 679 679 ysh := Tribe[Owner].ModelPicture[mixShow].yShield; 680 680 {$IFNDEF SCR} if Status and usStay <> 0 then 681 j:= 19681 J := 19 682 682 else if Status and usRecover <> 0 then 683 j:= 16683 J := 16 684 684 else if Status and (usGoto or usEnhance) = usGoto or usEnhance then 685 j:= 18685 J := 18 686 686 else if Status and usEnhance <> 0 then 687 j:= 17687 J := 17 688 688 else if Status and usGoto <> 0 then 689 j:= 20689 J := 20 690 690 else {$ENDIF} if Job = jCity then 691 j:= jNone691 J := jNone 692 692 else 693 j:= Job;693 J := Job; 694 694 if Flags and unMulti <> 0 then 695 Sprite(Tribe[Owner].symHGr, x + xsh - 1 + 4, y+ ysh - 2, 14, 12,695 Sprite(Tribe[Owner].symHGr, X + xsh - 1 + 4, Y + ysh - 2, 14, 12, 696 696 33 + Tribe[Owner].sympix mod 10 * 65, 697 697 1 + Tribe[Owner].sympix div 10 * 49); 698 Sprite(Tribe[Owner].symHGr, x + xsh - 1, y+ ysh - 2, 14, 12,698 Sprite(Tribe[Owner].symHGr, X + xsh - 1, Y + ysh - 2, 14, 12, 699 699 18 + Tribe[Owner].sympix mod 10 * 65, 700 700 1 + Tribe[Owner].sympix div 10 * 49); 701 FillRect( x + xsh, y+ ysh + 5, 1 + Health * 11 div 100, 3,701 FillRect(X + xsh, Y + ysh + 5, 1 + Health * 11 div 100, 3, 702 702 ColorOfHealth(Health)); 703 if j> 0 then703 if J > 0 then 704 704 begin 705 xGr := 121 + jmod 7 * 9;706 yGr := 1 + jdiv 7 * 9;707 BitBltBitmap(HGrSystem.Mask, x + xsh + 3, y+ ysh + 9, 8, 8, xGr,705 xGr := 121 + J mod 7 * 9; 706 yGr := 1 + J div 7 * 9; 707 BitBltBitmap(HGrSystem.Mask, X + xsh + 3, Y + ysh + 9, 8, 8, xGr, 708 708 yGr, SRCAND); 709 Sprite(HGrSystem, x + xsh + 2, y+ ysh + 8, 8, 8, xGr, yGr);709 Sprite(HGrSystem, X + xsh + 2, Y + ysh + 8, 8, 8, xGr, yGr); 710 710 end; 711 711 with Tribe[Owner].ModelPicture[mixShow] do 712 Sprite(HGr, x, y, 64, 48, pix mod 10 * 65 + 1, pix div 10 * 49 + 1);712 Sprite(HGr, X, Y, 64, 48, pix mod 10 * 65 + 1, pix div 10 * 49 + 1); 713 713 if Flags and unFortified <> 0 then 714 714 begin 715 715 { DataCanvas:=HGrTerrain.Data.Canvas; 716 716 MaskCanvas:=HGrTerrain.Mask.Canvas; 717 TSprite( x,y+16,12*9+7); }718 Sprite(HGrStdUnits, x, y, xxu * 2, yyu * 2, 1 + 6 * (xxu * 2 + 1), 1);717 TSprite(X,Y+16,12*9+7); } 718 Sprite(HGrStdUnits, X, Y, xxu * 2, yyu * 2, 1 + 6 * (xxu * 2 + 1), 1); 719 719 end; 720 720 end; 721 end; { PaintUnit }722 723 procedure TIsoMap.PaintCity( x, y: integer; const CityInfo: TCityInfo;724 accessory: boolean);721 end; 722 723 procedure TIsoMap.PaintCity(X, Y: Integer; const CityInfo: TCityInfo; 724 accessory: Boolean); 725 725 var 726 726 age: Integer; … … 733 733 LabelLength: Integer; 734 734 cpic: TCityPicture; 735 s: string;735 S: string; 736 736 begin 737 737 age := GetAge(CityInfo.Owner); … … 752 752 (cHGr.Data.Canvas.Pixels[(xGr + 4) * 65, cpix * 49 + 48] = $00FFFF) 753 753 then 754 Sprite(cHGr, x - xxc, y- 2 * yyc, xxc * 2, yyc * 3,754 Sprite(cHGr, X - xxc, Y - 2 * yyc, xxc * 2, yyc * 3, 755 755 xGr * (xxc * 2 + 1) + 1, 1 + cpix * (yyc * 3 + 1)); 756 756 if ciWalled and CityInfo.Flags <> 0 then 757 Sprite(cHGr, x - xxc, y- 2 * yyc, xxc * 2, yyc * 3,757 Sprite(cHGr, X - xxc, Y - 2 * yyc, xxc * 2, yyc * 3, 758 758 (xGr + 4) * (xxc * 2 + 1) + 1, 1 + cpix * (yyc * 3 + 1)); 759 759 end … … 761 761 begin 762 762 if ciWalled and CityInfo.Flags <> 0 then 763 Sprite(HGrCities, x - xxt, y- 2 * yyt, 2 * xxt, 3 * yyt,763 Sprite(HGrCities, X - xxt, Y - 2 * yyt, 2 * xxt, 3 * yyt, 764 764 (xGr + 4) * (2 * xxt + 1) + 1, 1 + (age - 2) * (3 * yyt + 1)) 765 765 else 766 Sprite(HGrCities, x - xxt, y- 2 * yyt, 2 * xxt, 3 * yyt,766 Sprite(HGrCities, X - xxt, Y - 2 * yyt, 2 * xxt, 3 * yyt, 767 767 xGr * (2 * xxt + 1) + 1, 1 + (age - 2) * (3 * yyt + 1)); 768 768 end; 769 769 770 770 if not accessory then 771 exit;771 Exit; 772 772 773 773 { if ciCapital and CityInfo.Flags<>0 then 774 Sprite(Tribe[CityInfo.Owner].symHGr, x+cpic.xf,y-13+cpic.yf,13,14,774 Sprite(Tribe[CityInfo.Owner].symHGr,X+cpic.xf,Y-13+cpic.yf,13,14, 775 775 1+Tribe[CityInfo.Owner].sympix mod 10 *65, 776 776 1+Tribe[CityInfo.Owner].sympix div 10 *49); {capital -- paint flag } … … 781 781 begin 782 782 cpic := Tribe[CityInfo.Owner].CityPicture[xGr]; 783 xShield := x- xxc + cpic.xShield;784 yShield := y- 2 * yyc + cpic.yShield;783 xShield := X - xxc + cpic.xShield; 784 yShield := Y - 2 * yyc + cpic.yShield; 785 785 end 786 786 else 787 787 begin 788 788 cpic := CitiesPictures.Pictures[age, xGr]; 789 xShield := x- xxt + cpic.xShield;790 yShield := y- 2 * yyt + cpic.yShield;789 xShield := X - xxt + cpic.xShield; 790 yShield := Y - 2 * yyt + cpic.yShield; 791 791 end; 792 s:= IntToStr(CityInfo.size);793 LabelLength := FOutput.Canvas.TextWidth( s);792 S := IntToStr(CityInfo.size); 793 LabelLength := FOutput.Canvas.TextWidth(S); 794 794 FillRect(xShield, yShield, LabelLength + 4, 16, $000000); 795 795 if MyMap[CityInfo.Loc] and (fUnit or fObserved) = fObserved then … … 802 802 LabelTextColor := $000000; 803 803 end; 804 Textout(xShield + 2, yShield - 1, LabelTextColor, s);805 end; 806 end; { PaintCity }807 808 function PoleTile(Loc: integer): integer;804 Textout(xShield + 2, yShield - 1, LabelTextColor, S); 805 end; 806 end; 807 808 function PoleTile(Loc: Integer): Integer; 809 809 begin { virtual pole tile } 810 result := fUNKNOWN;810 Result := fUNKNOWN; 811 811 if Loc < -2 * G.lx then 812 812 else if Loc < -G.lx then … … 815 815 (MyMap[dLoc(Loc, -2, 2)] and fTerrain <> fUNKNOWN) and 816 816 (MyMap[dLoc(Loc, 2, 2)] and fTerrain <> fUNKNOWN) then 817 result := fArctic;817 Result := fArctic; 818 818 if (MyMap[dLoc(Loc, 0, 2)] and fObserved <> 0) and 819 819 (MyMap[dLoc(Loc, -2, 2)] and fObserved <> 0) and 820 820 (MyMap[dLoc(Loc, 2, 2)] and fObserved <> 0) then 821 result := result or fObserved;821 Result := Result or fObserved; 822 822 end 823 823 else if Loc < 0 then … … 825 825 if (MyMap[dLoc(Loc, -1, 1)] and fTerrain <> fUNKNOWN) and 826 826 (MyMap[dLoc(Loc, 1, 1)] and fTerrain <> fUNKNOWN) then 827 result := fArctic;827 Result := fArctic; 828 828 if (MyMap[dLoc(Loc, -1, 1)] and fObserved <> 0) and 829 829 (MyMap[dLoc(Loc, 1, 1)] and fObserved <> 0) then 830 result := result or fObserved;830 Result := Result or fObserved; 831 831 end 832 832 else if Loc < G.lx * (G.ly + 1) then … … 834 834 if (MyMap[dLoc(Loc, -1, -1)] and fTerrain <> fUNKNOWN) and 835 835 (MyMap[dLoc(Loc, 1, -1)] and fTerrain <> fUNKNOWN) then 836 result := fArctic;836 Result := fArctic; 837 837 if (MyMap[dLoc(Loc, -1, -1)] and fObserved <> 0) and 838 838 (MyMap[dLoc(Loc, 1, -1)] and fObserved <> 0) then 839 result := result or fObserved;839 Result := Result or fObserved; 840 840 end 841 841 else if Loc < G.lx * (G.ly + 2) then … … 844 844 (MyMap[dLoc(Loc, -2, -2)] and fTerrain <> fUNKNOWN) and 845 845 (MyMap[dLoc(Loc, 2, -2)] and fTerrain <> fUNKNOWN) then 846 result := fArctic;846 Result := fArctic; 847 847 if (MyMap[dLoc(Loc, 0, -2)] and fObserved <> 0) and 848 848 (MyMap[dLoc(Loc, -2, -2)] and fObserved <> 0) and 849 849 (MyMap[dLoc(Loc, 2, -2)] and fObserved <> 0) then 850 result := result or fObserved;851 end; 852 end; 853 854 function TIsoMap.Connection4(Loc, Mask, Value: integer): integer;855 begin 856 result := 0;850 Result := Result or fObserved; 851 end; 852 end; 853 854 function TIsoMap.Connection4(Loc, Mask, Value: Integer): Integer; 855 begin 856 Result := 0; 857 857 if dLoc(Loc, 1, -1) >= 0 then 858 858 begin 859 859 if MyMap[dLoc(Loc, 1, -1)] and Mask = Cardinal(Value) then 860 inc(result, 1);860 Inc(Result, 1); 861 861 if MyMap[dLoc(Loc, -1, -1)] and Mask = Cardinal(Value) then 862 inc(result, 8);862 Inc(Result, 8); 863 863 end; 864 864 if dLoc(Loc, 1, 1) < G.lx * G.ly then 865 865 begin 866 866 if MyMap[dLoc(Loc, 1, 1)] and Mask = Cardinal(Value) then 867 inc(result, 2);867 Inc(Result, 2); 868 868 if MyMap[dLoc(Loc, -1, 1)] and Mask = Cardinal(Value) then 869 inc(result, 4);870 end; 871 end; 872 873 function TIsoMap.Connection8(Loc, Mask: integer): integer;869 Inc(Result, 4); 870 end; 871 end; 872 873 function TIsoMap.Connection8(Loc, Mask: Integer): Integer; 874 874 var 875 875 Dir: Integer; 876 876 ConnLoc: Integer; 877 877 begin 878 result := 0;878 Result := 0; 879 879 for Dir := 0 to 7 do 880 880 begin … … 882 882 if (ConnLoc >= 0) and (ConnLoc < G.lx * G.ly) and 883 883 (MyMap[ConnLoc] and Mask <> 0) then 884 inc(result, 1 shl Dir);885 end; 886 end; 887 888 function TIsoMap.OceanConnection(Loc: integer): integer;884 Inc(Result, 1 shl Dir); 885 end; 886 end; 887 888 function TIsoMap.OceanConnection(Loc: Integer): Integer; 889 889 var 890 890 Dir: Integer; 891 891 ConnLoc: Integer; 892 892 begin 893 result := 0;893 Result := 0; 894 894 for Dir := 0 to 7 do 895 895 begin … … 897 897 if (ConnLoc < 0) or (ConnLoc >= G.lx * G.ly) or 898 898 ((MyMap[ConnLoc] - 2) and fTerrain < 13) then 899 inc(result, 1 shl Dir);900 end; 901 end; 902 903 procedure TIsoMap.PaintShore( x, y, Loc: integer);899 Inc(Result, 1 shl Dir); 900 end; 901 end; 902 903 procedure TIsoMap.PaintShore(X, Y, Loc: Integer); 904 904 var 905 905 Conn: Integer; 906 906 Tile: Integer; 907 907 begin 908 if ( y <= FTop - yyt * 2) or (y > FBottom) or (x<= FLeft - xxt * 2) or909 ( x> FRight) then910 exit;908 if (Y <= FTop - yyt * 2) or (Y > FBottom) or (X <= FLeft - xxt * 2) or 909 (X > FRight) then 910 Exit; 911 911 if (Loc < 0) or (Loc >= G.lx * G.ly) then 912 exit;912 Exit; 913 913 Tile := MyMap[Loc]; 914 914 if Tile and fTerrain >= fGrass then 915 exit;915 Exit; 916 916 Conn := OceanConnection(Loc); 917 917 if Conn = 0 then 918 exit;919 920 BitBltBitmap(HGrTerrain.Data, x + xxt div 2, y, xxt, yyt,918 Exit; 919 920 BitBltBitmap(HGrTerrain.Data, X + xxt div 2, Y, xxt, yyt, 921 921 1 + (Conn shr 6 + Conn and 1 shl 2) * (xxt * 2 + 1), 922 922 1 + yyt + (16 + Tile and fTerrain) * (yyt * 3 + 1), SRCPAINT); 923 BitBltBitmap(HGrTerrain.Data, x + xxt, y+ yyt div 2, xxt, yyt,923 BitBltBitmap(HGrTerrain.Data, X + xxt, Y + yyt div 2, xxt, yyt, 924 924 1 + (Conn and 7) * (xxt * 2 + 1) + xxt, 925 925 1 + yyt * 2 + (16 + Tile and fTerrain) * (yyt * 3 + 1), SRCPAINT); 926 BitBltBitmap(HGrTerrain.Data, x + xxt div 2, y+ yyt, xxt, yyt,926 BitBltBitmap(HGrTerrain.Data, X + xxt div 2, Y + yyt, xxt, yyt, 927 927 1 + (Conn shr 2 and 7) * (xxt * 2 + 1) + xxt, 928 928 1 + yyt + (16 + Tile and fTerrain) * (yyt * 3 + 1), SRCPAINT); 929 BitBltBitmap(HGrTerrain.Data, x, y+ yyt div 2, xxt, yyt,929 BitBltBitmap(HGrTerrain.Data, X, Y + yyt div 2, xxt, yyt, 930 930 1 + (Conn shr 4 and 7) * (xxt * 2 + 1), 931 931 1 + yyt * 2 + (16 + Tile and fTerrain) * (yyt * 3 + 1), SRCPAINT); 932 932 Conn := Connection4(Loc, fTerrain, fUNKNOWN); { dither to black } 933 933 if Conn and 1 <> 0 then 934 BitBltBitmap(HGrTerrain.Mask, x + xxt, y, xxt, yyt, 1 + 7 * (xxt * 2 + 1) +934 BitBltBitmap(HGrTerrain.Mask, X + xxt, Y, xxt, yyt, 1 + 7 * (xxt * 2 + 1) + 935 935 xxt, 1 + yyt + 15 * (yyt * 3 + 1), SRCAND); 936 936 if Conn and 2 <> 0 then 937 BitBltBitmap(HGrTerrain.Mask, x + xxt, y+ yyt, xxt, yyt,937 BitBltBitmap(HGrTerrain.Mask, X + xxt, Y + yyt, xxt, yyt, 938 938 1 + 7 * (xxt * 2 + 1) + xxt, 1 + yyt * 2 + 15 * (yyt * 3 + 1), SRCAND); 939 939 if Conn and 4 <> 0 then 940 BitBltBitmap(HGrTerrain.Mask, x, y+ yyt, xxt, yyt, 1 + 7 * (xxt * 2 + 1),940 BitBltBitmap(HGrTerrain.Mask, X, Y + yyt, xxt, yyt, 1 + 7 * (xxt * 2 + 1), 941 941 1 + yyt * 2 + 15 * (yyt * 3 + 1), SRCAND); 942 942 if Conn and 8 <> 0 then 943 BitBltBitmap(HGrTerrain.Mask, x, y, xxt, yyt, 1 + 7 * (xxt * 2 + 1),943 BitBltBitmap(HGrTerrain.Mask, X, Y, xxt, yyt, 1 + 7 * (xxt * 2 + 1), 944 944 1 + yyt + 15 * (yyt * 3 + 1), SRCAND); 945 945 end; 946 946 947 procedure TIsoMap.PaintTileExtraTerrain( x, y, Loc: integer);948 var 949 Dir, Conn, RRConn, yGr, Tile, yLoc: integer;950 begin 951 if (Loc < 0) or (Loc >= G.lx * G.ly) or ( y<= -yyt * 2) or952 ( y > FOutput.Height) or (x <= -xxt * 2) or (x> FOutput.Width) then953 exit;947 procedure TIsoMap.PaintTileExtraTerrain(X, Y, Loc: Integer); 948 var 949 Dir, Conn, RRConn, yGr, Tile, yLoc: Integer; 950 begin 951 if (Loc < 0) or (Loc >= G.lx * G.ly) or (Y <= -yyt * 2) or 952 (Y > FOutput.Height) or (X <= -xxt * 2) or (X > FOutput.Width) then 953 Exit; 954 954 Tile := MyMap[Loc]; 955 955 if Tile and fTerrain = fForest then … … 966 966 then 967 967 Conn := Conn and not 9; // no connection to north 968 TSprite( x, y, yGr + Conn mod 8 + (Conn div 8) * TerrainIconCols);968 TSprite(X, Y, yGr + Conn mod 8 + (Conn div 8) * TerrainIconCols); 969 969 end 970 970 else if Tile and fTerrain in [fHills, fMountains, fForest] then … … 972 972 yGr := 3 + 2 * (Tile and fTerrain - fForest); 973 973 Conn := Connection4(Loc, fTerrain, Tile and fTerrain); 974 TSprite( x, y, Conn mod 8 + (yGr + Conn div 8) * TerrainIconCols);974 TSprite(X, Y, Conn mod 8 + (yGr + Conn div 8) * TerrainIconCols); 975 975 end 976 976 else if Tile and fDeadLands <> 0 then 977 TSprite( x, y, spRow2);977 TSprite(X, Y, spRow2); 978 978 979 979 if ShowObjects then 980 980 begin 981 981 if Tile and fTerImp = tiFarm then 982 TSprite( x, y, spFarmLand)982 TSprite(X, Y, spFarmLand) 983 983 else if Tile and fTerImp = tiIrrigation then 984 TSprite( x, y, spIrrigation);984 TSprite(X, Y, spIrrigation); 985 985 end; 986 986 if Tile and fRiver <> 0 then … … 989 989 Connection4(Loc, fTerrain, fShore) or Connection4(Loc, fTerrain, 990 990 fUNKNOWN); 991 TSprite( x, y, spRiver + Conn mod 8 + (Conn div 8) * TerrainIconCols);991 TSprite(X, Y, spRiver + Conn mod 8 + (Conn div 8) * TerrainIconCols); 992 992 end; 993 993 … … 997 997 for Dir := 0 to 3 do 998 998 if Conn and (1 shl Dir) <> 0 then { river mouths } 999 TSprite( x, y, spRiverMouths + Dir);999 TSprite(X, Y, spRiverMouths + Dir); 1000 1000 if ShowObjects then 1001 1001 begin … … 1003 1003 for Dir := 0 to 7 do 1004 1004 if Conn and (1 shl Dir) <> 0 then { canal mouths } 1005 TSprite( x, y, spCanalMouths + 1 + Dir);1005 TSprite(X, Y, spCanalMouths + 1 + Dir); 1006 1006 end; 1007 1007 end; … … 1015 1015 if Conn = 0 then begin 1016 1016 if Tile and fCanal <> 0 then 1017 TSprite( x, y, spCanal);1017 TSprite(X, Y, spCanal); 1018 1018 end 1019 1019 else 1020 1020 for Dir := 0 to 7 do 1021 1021 if (1 shl Dir) and Conn <> 0 then 1022 TSprite( x, y, spCanal + 1 + Dir);1022 TSprite(X, Y, spCanal + 1 + Dir); 1023 1023 end; 1024 1024 … … 1032 1032 Conn := Connection8(Loc, fRoad or fRR or fCity) and not RRConn; 1033 1033 if (Conn = 0) and (Tile and (fRR or fCity) = 0) then 1034 TSprite( x, y, spRoad)1034 TSprite(X, Y, spRoad) 1035 1035 else if Conn > 0 then 1036 1036 for Dir := 0 to 7 do 1037 1037 if (1 shl Dir) and Conn <> 0 then 1038 TSprite( x, y, spRoad + 1 + Dir);1038 TSprite(X, Y, spRoad + 1 + Dir); 1039 1039 end; 1040 1040 1041 1041 // Paint railroad connections 1042 1042 if (Tile and fRR <> 0) and (RRConn = 0) then 1043 TSprite( x, y, spRailRoad)1043 TSprite(X, Y, spRailRoad) 1044 1044 else if RRConn > 0 then begin 1045 1045 for Dir := 0 to 7 do 1046 1046 if (1 shl Dir) and RRConn <> 0 then 1047 TSprite( x, y, spRailRoad + 1 + Dir);1047 TSprite(X, Y, spRailRoad + 1 + Dir); 1048 1048 end; 1049 1049 end; … … 1051 1051 1052 1052 // (x,y) is top left pixel of (2*xxt,3*yyt) rectangle 1053 procedure TIsoMap.PaintTileObjects( x, y, Loc, CityLoc, CityOwner: integer;1054 UseBlink: boolean);1055 var 1056 p1, p2, uix, cix, dy, Loc1, Tile, Multi, Destination: integer;1053 procedure TIsoMap.PaintTileObjects(X, Y, Loc, CityLoc, CityOwner: Integer; 1054 UseBlink: Boolean); 1055 var 1056 p1, p2, uix, cix, dy, Loc1, Tile, Multi, Destination: Integer; 1057 1057 CityInfo: TCityInfo; 1058 1058 UnitInfo: TUnitInfo; 1059 fog: boolean;1059 fog: Boolean; 1060 1060 SpecialRow: Integer; 1061 1061 SpecialCol: Integer; … … 1063 1063 procedure NameCity; 1064 1064 var 1065 cix, xs, w: integer;1065 cix, xs, W: Integer; 1066 1066 BehindCityInfo: TCityInfo; 1067 s: string;1068 IsCapital: boolean;1067 S: string; 1068 IsCapital: Boolean; 1069 1069 begin 1070 1070 BehindCityInfo.Loc := Loc - 2 * G.lx; … … 1076 1076 IsCapital := BehindCityInfo.Flags and ciCapital <> 0; 1077 1077 { if Showuix and (cix>=0) then s:=IntToStr(cix) 1078 else } s:= CityName(BehindCityInfo.ID);1079 w := FOutput.Canvas.TextWidth(s);1080 xs := x + xxt - (w+ 1) div 2;1078 else } S := CityName(BehindCityInfo.ID); 1079 W := FOutput.Canvas.TextWidth(S); 1080 xs := X + xxt - (W + 1) div 2; 1081 1081 if IsCapital then 1082 1082 FOutput.Canvas.Font.Style := FOutput.Canvas.Font.Style + [fsUnderline]; 1083 Textout(xs + 1, y - 9, $000000, s);1084 Textout(xs, y - 10, $FFFFFF, s);1083 Textout(xs + 1, Y - 9, $000000, S); 1084 Textout(xs, Y - 10, $FFFFFF, S); 1085 1085 if IsCapital then 1086 1086 FOutput.Canvas.Font.Style := FOutput.Canvas.Font.Style - [fsUnderline]; … … 1092 1092 if ShowObjects and not (moEditMode in MapOptions) and 1093 1093 (Tile and fCity <> 0) and (CityInfo.Flags and ciSpacePort <> 0) then 1094 TSprite( x + xxt, y- 6, spSpacePort);1094 TSprite(X + xxt, Y - 6, spSpacePort); 1095 1095 end; 1096 1096 1097 1097 procedure PaintBorder; 1098 1098 var 1099 dx, dy: integer;1099 dx, dy: Integer; 1100 1100 begin 1101 1101 if ShowBorder and (Loc >= 0) and (Loc < G.lx * G.ly) and 1102 1102 (Tile and fTerrain <> fUNKNOWN) then begin 1103 1103 p1 := MyRO.Territory[Loc]; 1104 if (p1 >= 0) and (ShowMyBorder or (p1 <> me)) then begin1104 if (p1 >= 0) and (ShowMyBorder or (p1 <> Me)) then begin 1105 1105 if BordersOK^ and (1 shl p1) = 0 then begin 1106 1106 UnshareBitmap(Borders); 1107 DpiBit Canvas(Borders.Canvas, 0, p1 * (yyt * 2), xxt * 2,1107 DpiBitBltCanvas(Borders.Canvas, 0, p1 * (yyt * 2), xxt * 2, 1108 1108 yyt * 2, HGrTerrain.Data.Canvas, 1109 1109 1 + 8 * (xxt * 2 + 1), 1 + yyt + 16 * (yyt * 3 + 1)); … … 1123 1123 if p2 <> p1 then 1124 1124 begin 1125 BitBltBitmap(HGrTerrain.Mask, x + dx * xxt, y+ dy * yyt, xxt,1125 BitBltBitmap(HGrTerrain.Mask, X + dx * xxt, Y + dy * yyt, xxt, 1126 1126 yyt, 1 + 8 * (xxt * 2 + 1) + dx * xxt, 1127 1127 1 + yyt + 16 * (yyt * 3 + 1) + dy * yyt, SRCAND); 1128 BitBltBitmap(Borders, x + dx * xxt, y+ dy * yyt, xxt, yyt, dx * xxt,1128 BitBltBitmap(Borders, X + dx * xxt, Y + dy * yyt, xxt, yyt, dx * xxt, 1129 1129 p1 * (yyt * 2) + dy * yyt, SRCPAINT); 1130 1130 end; … … 1143 1143 (Tile and fCity <> 0) then 1144 1144 GetCityInfo(Loc, cix, CityInfo); 1145 if ( y <= FTop - yyt * 2) or (y > FBottom) or (x<= FLeft - xxt * 2) or1146 ( x> FRight) then1145 if (Y <= FTop - yyt * 2) or (Y > FBottom) or (X <= FLeft - xxt * 2) or 1146 (X > FRight) then 1147 1147 begin 1148 1148 NameCity; 1149 1149 ShowSpacePort; 1150 exit;1150 Exit; 1151 1151 end; 1152 1152 if Tile and fTerrain = fUNKNOWN then … … 1154 1154 NameCity; 1155 1155 ShowSpacePort; 1156 exit;1156 Exit; 1157 1157 end; { square not discovered } 1158 1158 … … 1161 1161 1162 1162 if (Loc >= 0) and (Loc < G.lx * G.ly) and (Loc = FAdviceLoc) then 1163 TSprite( x, y, spPlain);1163 TSprite(X, Y, spPlain); 1164 1164 1165 1165 if (Loc >= 0) and (Loc < G.lx * G.ly) and (Tile and fSpecial <> 0) … … 1170 1170 SpecialRow := Tile and fSpecial shr 5; 1171 1171 if SpecialCol < fForest then 1172 TSprite( x, y, SpecialCol + SpecialRow * TerrainIconCols)1172 TSprite(X, Y, SpecialCol + SpecialRow * TerrainIconCols) 1173 1173 else if (SpecialCol = fForest) and IsJungle(dy) then 1174 TSprite( x, y, spJungle - 1 + SpecialRow * TerrainIconCols)1174 TSprite(X, Y, spJungle - 1 + SpecialRow * TerrainIconCols) 1175 1175 else 1176 TSprite( x, y, spForest - 1 + ((SpecialCol - fForest) * 2 + SpecialRow) * TerrainIconCols);1176 TSprite(X, Y, spForest - 1 + ((SpecialCol - fForest) * 2 + SpecialRow) * TerrainIconCols); 1177 1177 end; 1178 1178 … … 1180 1180 begin 1181 1181 if Tile and fTerImp = tiMine then 1182 TSprite( x, y, spMine);1182 TSprite(X, Y, spMine); 1183 1183 if Tile and fTerImp = tiBase then 1184 TSprite( x, y, spBase);1184 TSprite(X, Y, spBase); 1185 1185 if Tile and fPoll <> 0 then 1186 TSprite( x, y, spPollution);1186 TSprite(X, Y, spPollution); 1187 1187 if Tile and fTerImp = tiFort then 1188 1188 begin 1189 TSprite( x, y, spFortBack);1189 TSprite(X, Y, spFortBack); 1190 1190 if Tile and fObserved = 0 then 1191 TSprite( x, y, spFortFront);1191 TSprite(X, Y, spFortFront); 1192 1192 end; 1193 1193 end; 1194 1194 if (Tile and fDeadLands) <> 0 then 1195 TSprite( x, y, spMinerals + (Tile shr 25 and 3) * TerrainIconCols);1195 TSprite(X, Y, spMinerals + (Tile shr 25 and 3) * TerrainIconCols); 1196 1196 1197 1197 if moEditMode in MapOptions then … … 1205 1205 if fog and ShowObjects then 1206 1206 if Loc < -G.lx then 1207 Sprite(HGrTerrain, x, y+ yyt, xxt * 2, yyt, 1 + 6 * (xxt * 2 + 1),1207 Sprite(HGrTerrain, X, Y + yyt, xxt * 2, yyt, 1 + 6 * (xxt * 2 + 1), 1208 1208 1 + yyt * 2 + 15 * (yyt * 3 + 1)) 1209 1209 else if Loc >= G.lx * (G.ly + 1) then 1210 Sprite(HGrTerrain, x, y, xxt * 2, yyt, 1 + 6 * (xxt * 2 + 1),1210 Sprite(HGrTerrain, X, Y, xxt * 2, yyt, 1 + 6 * (xxt * 2 + 1), 1211 1211 1 + yyt + 15 * (yyt * 3 + 1)) 1212 1212 else 1213 TSprite( x, y, spGrid, xxt <> 33);1213 TSprite(X, Y, spGrid, xxt <> 33); 1214 1214 1215 1215 if FoW and (Tile and fObserved = 0) then … … 1224 1224 if (Destination = Loc) and (Destination <> MyUn[UnFocus].Loc) then 1225 1225 if not UseBlink or BlinkOn then 1226 TSprite( x, y, spBlink1)1226 TSprite(X, Y, spBlink1) 1227 1227 else 1228 TSprite( x, y, spBlink2)1228 TSprite(X, Y, spBlink2) 1229 1229 end; 1230 1230 {$ENDIF} … … 1232 1232 begin 1233 1233 if Tile and fPrefStartPos <> 0 then 1234 TSprite( x, y, spPrefStartPos)1234 TSprite(X, Y, spPrefStartPos) 1235 1235 else if Tile and fStartPos <> 0 then 1236 TSprite( x, y, spStartPos);1236 TSprite(X, Y, spStartPos); 1237 1237 end 1238 1238 else if ShowObjects then 1239 1239 begin 1240 1240 { if (CityLoc<0) and (UnFocus>=0) and (Loc=MyUn[UnFocus].Loc) then 1241 if BlinkOn then TSprite( x,y,8+9*0)1242 else TSprite( x,y,8+9*1); }1241 if BlinkOn then TSprite(X,Y,8+9*0) 1242 else TSprite(X,Y,8+9*1); } 1243 1243 1244 1244 NameCity; 1245 1245 ShowSpacePort; 1246 1246 if Tile and fCity <> 0 then 1247 PaintCity( x + xxt, y+ yyt, CityInfo, CityOwner < 0);1247 PaintCity(X + xxt, Y + yyt, CityInfo, CityOwner < 0); 1248 1248 1249 1249 if (Tile and fUnit <> 0) and (Loc <> AttLoc) and … … 1259 1259 UnitInfo.Health := DefHealth; 1260 1260 if (UnitInfo.Owner <> CityOwner) and 1261 not((CityOwner = me) and (MyRO.Treaty[UnitInfo.Owner] = trAlliance))1261 not((CityOwner = Me) and (MyRO.Treaty[UnitInfo.Owner] = trAlliance)) 1262 1262 then 1263 1263 {$IFNDEF SCR} if (UnFocus >= 0) and (Loc = MyUn[UnFocus].Loc) then { active unit } 1264 1264 begin 1265 1265 Multi := UnitInfo.Flags and unMulti; 1266 MakeUnitInfo( me, MyUn[UnFocus], UnitInfo);1266 MakeUnitInfo(Me, MyUn[UnFocus], UnitInfo); 1267 1267 UnitInfo.Flags := UnitInfo.Flags or Multi; 1268 PaintUnit( x + (xxt - xxu), y+ (yyt - yyu_anchor), UnitInfo,1268 PaintUnit(X + (xxt - xxu), Y + (yyt - yyu_anchor), UnitInfo, 1269 1269 MyUn[UnFocus].Status); 1270 1270 end 1271 else if UnitInfo.Owner = me then1271 else if UnitInfo.Owner = Me then 1272 1272 begin 1273 1273 if ClientMode = cMovieTurn then 1274 PaintUnit( x + (xxt - xxu), y+ (yyt - yyu_anchor), UnitInfo, 0)1274 PaintUnit(X + (xxt - xxu), Y + (yyt - yyu_anchor), UnitInfo, 0) 1275 1275 // status is not set with precise timing during loading 1276 1276 else 1277 PaintUnit( x + (xxt - xxu), y+ (yyt - yyu_anchor), UnitInfo,1277 PaintUnit(X + (xxt - xxu), Y + (yyt - yyu_anchor), UnitInfo, 1278 1278 MyUn[uix].Status); 1279 1279 // if Showuix then Textout(x+16,y+5,$80FF00,IntToStr(uix)); 1280 1280 end 1281 else {$ENDIF} PaintUnit( x + (xxt - xxu), y+ (yyt - yyu_anchor), UnitInfo, 0);1281 else {$ENDIF} PaintUnit(X + (xxt - xxu), Y + (yyt - yyu_anchor), UnitInfo, 0); 1282 1282 end 1283 1283 else if Tile and fHiddenUnit <> 0 then 1284 Sprite(HGrStdUnits, x + (xxt - xxu), y+ (yyt - yyu_anchor), xxu * 2,1284 Sprite(HGrStdUnits, X + (xxt - xxu), Y + (yyt - yyu_anchor), xxu * 2, 1285 1285 yyu * 2, 1 + 5 * (xxu * 2 + 1), 1) 1286 1286 else if Tile and fStealthUnit <> 0 then 1287 Sprite(HGrStdUnits, x + (xxt - xxu), y+ (yyt - yyu_anchor), xxu * 2,1287 Sprite(HGrStdUnits, X + (xxt - xxu), Y + (yyt - yyu_anchor), xxu * 2, 1288 1288 yyu * 2, 1 + 5 * (xxu * 2 + 1), 1 + 1 * (yyu * 2 + 1)) 1289 1289 end; … … 1291 1291 if ShowObjects and (Tile and fTerImp = tiFort) and (Tile and fObserved <> 0) 1292 1292 then 1293 TSprite( x, y, spFortFront);1293 TSprite(X, Y, spFortFront); 1294 1294 1295 1295 if (Loc >= 0) and (Loc < G.lx * G.ly) then 1296 1296 if ShowLoc then 1297 Textout( x + xxt - 16, y+ yyt - 9, $FFFF00, IntToStr(Loc))1297 Textout(X + xxt - 16, Y + yyt - 9, $FFFF00, IntToStr(Loc)) 1298 1298 else if ShowDebug and (DebugMap <> nil) and (Loc >= 0) and 1299 1299 (Loc < G.lx * G.ly) and (DebugMap[Loc] <> 0) then 1300 Textout( x + xxt - 16, y+ yyt - 9, $00E0FF,1301 IntToStr( integer(DebugMap[Loc])))1302 end; { PaintTileObjects }1303 1304 procedure TIsoMap.PaintGrid( x, y, nx, ny: integer);1305 1306 procedure ClippedLine(dx0, dy0: integer; mirror: boolean);1300 Textout(X + xxt - 16, Y + yyt - 9, $00E0FF, 1301 IntToStr(Integer(DebugMap[Loc]))) 1302 end; 1303 1304 procedure TIsoMap.PaintGrid(X, Y, nx, ny: Integer); 1305 1306 procedure ClippedLine(dx0, dy0: Integer; mirror: Boolean); 1307 1307 var 1308 x0, x1, dxmin, dymin, dxmax, dymax, n: integer;1308 x0, x1, dxmin, dymin, dxmax, dymax, N: Integer; 1309 1309 begin 1310 1310 with FOutput.Canvas do 1311 1311 begin 1312 dxmin := (FLeft - x) div xxt;1313 dymin := (RealTop - y) div yyt;1314 dxmax := (FRight - x- 1) div xxt + 1;1315 dymax := (RealBottom - y- 1) div yyt + 1;1316 n:= dymax - dy0;1312 dxmin := (FLeft - X) div xxt; 1313 dymin := (RealTop - Y) div yyt; 1314 dxmax := (FRight - X - 1) div xxt + 1; 1315 dymax := (RealBottom - Y - 1) div yyt + 1; 1316 N := dymax - dy0; 1317 1317 if mirror then 1318 1318 begin 1319 if dx0 - dxmin < nthen1320 n:= dx0 - dxmin;1319 if dx0 - dxmin < N then 1320 N := dx0 - dxmin; 1321 1321 if dx0 > dxmax then 1322 1322 begin 1323 n := n- (dx0 - dxmax);1323 N := N - (dx0 - dxmax); 1324 1324 dy0 := dy0 + (dx0 - dxmax); 1325 1325 dx0 := dxmax … … 1327 1327 if dy0 < dymin then 1328 1328 begin 1329 n := n- (dymin - dy0);1329 N := N - (dymin - dy0); 1330 1330 dx0 := dx0 - (dymin - dy0); 1331 1331 dy0 := dymin … … 1334 1334 else 1335 1335 begin 1336 if dxmax - dx0 < nthen1337 n:= dxmax - dx0;1336 if dxmax - dx0 < N then 1337 N := dxmax - dx0; 1338 1338 if dx0 < dxmin then 1339 1339 begin 1340 n := n- (dxmin - dx0);1340 N := N - (dxmin - dx0); 1341 1341 dy0 := dy0 + (dxmin - dx0); 1342 1342 dx0 := dxmin … … 1344 1344 if dy0 < dymin then 1345 1345 begin 1346 n := n- (dymin - dy0);1346 N := N - (dymin - dy0); 1347 1347 dx0 := dx0 + (dymin - dy0); 1348 1348 dy0 := dymin 1349 1349 end; 1350 1350 end; 1351 if n<= 0 then1352 exit;1351 if N <= 0 then 1352 Exit; 1353 1353 if mirror then 1354 1354 begin 1355 x0 := x+ dx0 * xxt - 1;1356 x1 := x + (dx0 - n) * xxt - 1;1355 x0 := X + dx0 * xxt - 1; 1356 x1 := X + (dx0 - N) * xxt - 1; 1357 1357 end 1358 1358 else 1359 1359 begin 1360 x0 := x+ dx0 * xxt;1361 x1 := x + (dx0 + n) * xxt;1360 x0 := X + dx0 * xxt; 1361 x1 := X + (dx0 + N) * xxt; 1362 1362 end; 1363 moveto(x0, y+ dy0 * yyt);1364 lineto(x1, y + (dy0 + n) * yyt);1363 moveto(x0, Y + dy0 * yyt); 1364 lineto(x1, Y + (dy0 + N) * yyt); 1365 1365 end; 1366 1366 end; 1367 1367 1368 1368 var 1369 i: integer;1369 I: Integer; 1370 1370 begin 1371 1371 FOutput.Canvas.pen.Color := $000000; // $FF shl (8*random(3)); 1372 for i:= 0 to nx div 2 do1373 ClippedLine( i * 2, 0, false);1374 for i:= 1 to (nx + 1) div 2 do1375 ClippedLine( i * 2, 0, true);1376 for i:= 0 to ny div 2 do1377 begin 1378 ClippedLine(0, 2 * i + 2, false);1379 ClippedLine(nx + 1, 2 * i + 1 + nx and 1, true);1380 end; 1381 end; 1382 1383 function TIsoMap.IsShoreTile(Loc: integer): boolean;1372 for I := 0 to nx div 2 do 1373 ClippedLine(I * 2, 0, False); 1374 for I := 1 to (nx + 1) div 2 do 1375 ClippedLine(I * 2, 0, True); 1376 for I := 0 to ny div 2 do 1377 begin 1378 ClippedLine(0, 2 * I + 2, False); 1379 ClippedLine(nx + 1, 2 * I + 1 + nx and 1, True); 1380 end; 1381 end; 1382 1383 function TIsoMap.IsShoreTile(Loc: Integer): Boolean; 1384 1384 var 1385 1385 Dir: Integer; 1386 ConnLoc: integer;1387 begin 1388 result := false;1386 ConnLoc: Integer; 1387 begin 1388 Result := False; 1389 1389 for Dir := 0 to 7 do 1390 1390 begin … … 1392 1392 if (ConnLoc < 0) or (ConnLoc >= G.lx * G.ly) or 1393 1393 ((MyMap[ConnLoc] - 2) and fTerrain < 13) then 1394 result := true;1394 Result := True; 1395 1395 end; 1396 1396 end; … … 1401 1401 begin 1402 1402 for I := 0 to Length - 1 do begin 1403 Line^.Pixel^.B := (Line^.Pixel^.B shr 1) and $7 f;1404 Line^.Pixel^.G := (Line^.Pixel^.G shr 1) and $7 f;1405 Line^.Pixel^.R := (Line^.Pixel^.R shr 1) and $7 f;1403 Line^.Pixel^.B := (Line^.Pixel^.B shr 1) and $7F; 1404 Line^.Pixel^.G := (Line^.Pixel^.G shr 1) and $7F; 1405 Line^.Pixel^.R := (Line^.Pixel^.R shr 1) and $7F; 1406 1406 Line^.NextPixel; 1407 1407 end; … … 1415 1415 end; 1416 1416 1417 procedure TIsoMap.ShadeOutside(x0, y0, Width, Height, xm, ym: integer);1417 procedure TIsoMap.ShadeOutside(x0, y0, Width, Height, xm, ym: Integer); 1418 1418 const 1419 1419 rShade = 3.75; 1420 1420 var 1421 y, wBright: integer;1422 y_n, w_n: single;1421 Y, wBright: Integer; 1422 y_n, w_n: Single; 1423 1423 Line: TPixelPointer; 1424 1424 begin 1425 1425 FOutput.BeginUpdate; 1426 Line := PixelPointer(FOutput, ScaleToNative(x0), ScaleToNative(y0));1427 for y:= 0 to ScaleToNative(Height) - 1 do begin1428 y_n := (ScaleFromNative( y) + y0 - ym) / yyt;1426 Line := TPixelPointer.Create(FOutput, ScaleToNative(x0), ScaleToNative(y0)); 1427 for Y := 0 to ScaleToNative(Height) - 1 do begin 1428 y_n := (ScaleFromNative(Y) + y0 - ym) / yyt; 1429 1429 if abs(y_n) < rShade then begin 1430 1430 // Darken left and right parts of elipsis … … 1445 1445 end; 1446 1446 1447 procedure TIsoMap.CityGrid(xm, ym: integer; CityAllowClick: Boolean);1448 var 1449 i: integer;1447 procedure TIsoMap.CityGrid(xm, ym: Integer; CityAllowClick: Boolean); 1448 var 1449 I: Integer; 1450 1450 begin 1451 1451 with FOutput.Canvas do … … 1456 1456 pen.Color := $000000; 1457 1457 pen.Width := 1; 1458 for i:= 0 to 3 do1458 for I := 0 to 3 do 1459 1459 begin 1460 moveto(xm - xxt * (4 - i), ym + yyt * (1 + i));1461 lineto(xm + xxt * (1 + i), ym - yyt * (4 - i));1462 moveto(xm - xxt * (4 - i), ym - yyt * (1 + i));1463 lineto(xm + xxt * (1 + i), ym + yyt * (4 - i));1460 moveto(xm - xxt * (4 - I), ym + yyt * (1 + I)); 1461 lineto(xm + xxt * (1 + I), ym - yyt * (4 - I)); 1462 moveto(xm - xxt * (4 - I), ym - yyt * (1 + I)); 1463 lineto(xm + xxt * (1 + I), ym + yyt * (4 - I)); 1464 1464 end; 1465 1465 moveto(xm - xxt * 4, ym + yyt * 1); … … 1475 1475 end; 1476 1476 1477 procedure TIsoMap.Paint( x, y, Loc, nx, ny, CityLoc, CityOwner: integer;1478 UseBlink: boolean; CityAllowClick: boolean);1479 var 1480 dx, dy, xm, ym, ALoc, BLoc, ATer, BTer, Aix, bix: integer;1481 begin 1482 FoW := true;1477 procedure TIsoMap.Paint(X, Y, Loc, nx, ny, CityLoc, CityOwner: Integer; 1478 UseBlink: Boolean; CityAllowClick: Boolean); 1479 var 1480 dx, dy, xm, ym, ALoc, BLoc, ATer, BTer, Aix, bix: Integer; 1481 begin 1482 FoW := True; 1483 1483 ShowLoc := moLocCodes in MapOptions; 1484 1484 ShowDebug := pDebugMap >= 0; … … 1486 1486 ShowCityNames := ShowObjects and (CityOwner < 0) and 1487 1487 (moCityNames in MapOptions); 1488 ShowBorder := true;1488 ShowBorder := True; 1489 1489 ShowMyBorder := CityOwner < 0; 1490 1490 ShowGrWall := (CityOwner < 0) and (moGreatWall in MapOptions); 1491 1491 if ShowDebug then 1492 Server(sGetDebugMap, me, pDebugMap, DebugMap)1492 Server(sGetDebugMap, Me, pDebugMap, DebugMap) 1493 1493 else 1494 1494 DebugMap := nil; 1495 1495 with FOutput.Canvas do 1496 1496 begin 1497 RealTop := y- ((Loc + 12345 * G.lx) div G.lx - 12345) * yyt;1498 RealBottom := y+ (G.ly - ((Loc + 12345 * G.lx) div G.lx - 12345) +1497 RealTop := Y - ((Loc + 12345 * G.lx) div G.lx - 12345) * yyt; 1498 RealBottom := Y + (G.ly - ((Loc + 12345 * G.lx) div G.lx - 12345) + 1499 1499 3) * yyt; 1500 1500 Brush.Color := EmptySpaceColor; … … 1573 1573 bix := 0; 1574 1574 end; 1575 BitBltBitmap(OceanPatch, x + dx * xxt, y+ dy * yyt, xxt, yyt,1575 BitBltBitmap(OceanPatch, X + dx * xxt, Y + dy * yyt, xxt, yyt, 1576 1576 Aix * (xxt * 2) + (dx + dy + 1) and 1 * xxt, bix * yyt, SRCCOPY) 1577 1577 end … … 1621 1621 bix := Aix; 1622 1622 if Aix = -1 then 1623 BitBltBitmap(HGrTerrain.Data, x + dx * xxt, y+ dy * yyt, xxt,1623 BitBltBitmap(HGrTerrain.Data, X + dx * xxt, Y + dy * yyt, xxt, 1624 1624 yyt, 1 + 6 * (xxt * 2 + 1) + (dx + dy + 1) and 1 * xxt, 1 + yyt, 1625 1625 SRCCOPY) // arctic <-> ocean 1626 1626 else if bix = -1 then 1627 BitBltBitmap(HGrTerrain.Data, x + dx * xxt, y+ dy * yyt, xxt,1627 BitBltBitmap(HGrTerrain.Data, X + dx * xxt, Y + dy * yyt, xxt, 1628 1628 yyt, 1 + 6 * (xxt * 2 + 1) + xxt - (dx + dy + 1) and 1 * xxt, 1629 1629 1 + yyt * 2, SRCCOPY) // arctic <-> ocean 1630 1630 else 1631 BitBltBitmap(LandPatch, x + dx * xxt, y+ dy * yyt, xxt, yyt,1631 BitBltBitmap(LandPatch, X + dx * xxt, Y + dy * yyt, xxt, yyt, 1632 1632 Aix * (xxt * 2) + (dx + dy + 1) and 1 * xxt, bix * yyt, SRCCOPY) 1633 1633 end; … … 1639 1639 for dx := -1 to nx do 1640 1640 if (dx + dy) and 1 = 0 then 1641 PaintShore( x + xxt * dx, y+ yyt + yyt * dy, dLoc(Loc, dx, dy));1641 PaintShore(X + xxt * dx, Y + yyt + yyt * dy, dLoc(Loc, dx, dy)); 1642 1642 for dy := -2 to ny + 1 do 1643 1643 for dx := -1 to nx do 1644 1644 if (dx + dy) and 1 = 0 then 1645 PaintTileExtraTerrain( x + xxt * dx, y+ yyt + yyt * dy,1645 PaintTileExtraTerrain(X + xxt * dx, Y + yyt + yyt * dy, 1646 1646 dLoc(Loc, dx, dy)); 1647 1647 if CityOwner >= 0 then … … 1653 1653 ALoc := dLoc(Loc, dx, dy); 1654 1654 if Distance(ALoc, CityLoc) > 5 then 1655 PaintTileObjects( x + xxt * dx, y+ yyt + yyt * dy, ALoc, CityLoc,1655 PaintTileObjects(X + xxt * dx, Y + yyt + yyt * dy, ALoc, CityLoc, 1656 1656 CityOwner, UseBlink); 1657 1657 end; … … 1660 1660 * G.lx) mod (2 * G.lx) - G.lx; 1661 1661 dy := CityLoc div G.lx - (Loc + 666 * G.lx) div G.lx + 666; 1662 xm := x+ (dx + 1) * xxt;1663 ym := y+ (dy + 1) * yyt + yyt;1662 xm := X + (dx + 1) * xxt; 1663 ym := Y + (dy + 1) * yyt + yyt; 1664 1664 ShadeOutside(FLeft, FTop, FRight - FLeft, FBottom - FTop, xm, ym); 1665 1665 CityGrid(xm, ym, CityAllowClick); … … 1670 1670 ALoc := dLoc(Loc, dx, dy); 1671 1671 if Distance(ALoc, CityLoc) <= 5 then 1672 PaintTileObjects( x + xxt * dx, y+ yyt + yyt * dy, ALoc, CityLoc,1672 PaintTileObjects(X + xxt * dx, Y + yyt + yyt * dy, ALoc, CityLoc, 1673 1673 CityOwner, UseBlink); 1674 1674 end; … … 1678 1678 if ShowLoc or (moEditMode in MapOptions) or 1679 1679 (moGrid in MapOptions) then 1680 PaintGrid( x, y, nx, ny);1680 PaintGrid(X, Y, nx, ny); 1681 1681 for dy := -2 to ny + 1 do 1682 1682 for dx := -2 to nx + 1 do 1683 1683 if (dx + dy) and 1 = 0 then 1684 PaintTileObjects( x + xxt * dx, y+ yyt + yyt * dy, dLoc(Loc, dx, dy),1684 PaintTileObjects(X + xxt * dx, Y + yyt + yyt * dy, dLoc(Loc, dx, dy), 1685 1685 CityLoc, CityOwner, UseBlink); 1686 1686 end; 1687 1687 1688 1688 // frame(FOutput.Canvas,x+1,y+1,x+nx*33+33-2,y+ny*16+32-2,$FFFF,$FFFF); 1689 end; { Paint }1689 end; 1690 1690 1691 1691 procedure TIsoMap.AttackBegin(const ShowMove: TShowMove); -
branches/highdpi/LocalPlayer/KeyBindings.pas
r464 r465 1 unit UKeyBindings; 2 3 {$mode delphi} 1 unit KeyBindings; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, fgl, LCLProc, LCLType, Menus, Registry; 6 Classes, SysUtils, Generics.Collections, Generics.Defaults, LCLProc, LCLType, 7 Menus, Registry; 9 8 10 9 type … … 26 25 { TKeyBindings } 27 26 28 TKeyBindings = class(T FPGObjectList<TKeyBinding>)27 TKeyBindings = class(TObjectList<TKeyBinding>) 29 28 private 30 29 public … … 38 37 procedure ResetToDefault; 39 38 procedure RemoveShortCut(ShortCut: TShortCut); 39 procedure SortAlpha; 40 40 end; 41 41 … … 241 241 Text: string; 242 242 begin 243 Strings.Clear; 244 for I := 0 to Count - 1 do begin 245 Text:= ''; 246 if Items[I].ShortCut <> 0 then 247 Text:= Text + ShortCutToText(Items[I].ShortCut); 248 if Items[I].ShortCut2 <> 0 then begin 249 if Text <> '' then Text := Text + ', '; 250 Text:= Text + ShortCutToText(Items[I].ShortCut2); 243 Strings.BeginUpdate; 244 try 245 Strings.Clear; 246 for I := 0 to Count - 1 do begin 247 Text := ''; 248 if Items[I].ShortCut <> 0 then 249 Text := Text + ShortCutToText(Items[I].ShortCut); 250 if Items[I].ShortCut2 <> 0 then begin 251 if Text <> '' then Text := Text + ', '; 252 Text := Text + ShortCutToText(Items[I].ShortCut2); 253 end; 254 if Text <> '' then Text := Items[I].FullName + ' (' + Text + ')' 255 else Text := Items[I].FullName; 256 Strings.Add(Text); 251 257 end; 252 if Text <> '' then Text := Items[I].FullName + ' (' + Text + ')' 253 else Text := Items[I].FullName; 254 Strings.Add(Text); 258 finally 259 Strings.EndUpdate; 255 260 end; 256 261 end; … … 284 289 if Items[I].ShortCut2 = ShortCut then Items[I].ShortCut2 := 0; 285 290 end; 291 end; 292 293 function CompareAlpha(constref Item1, Item2: TKeyBinding): Integer; 294 begin 295 Result := CompareStr(Item1.FullName, Item2.FullName); 296 end; 297 298 procedure TKeyBindings.SortAlpha; 299 begin 300 Sort(TComparer<TKeyBinding>.Construct(CompareAlpha)); 286 301 end; 287 302 … … 372 387 BMoveLeftUp := AddItem('MoveLeftUp', 'Move unit left-up', 'Num7', 'Home'); 373 388 BMoveLeft := AddItem('MoveLeft', 'Move unit left', 'Num4', 'Left'); 389 SortAlpha; 374 390 end; 375 391 … … 381 397 end. 382 398 399 -
branches/highdpi/LocalPlayer/LocalPlayer.pas
r378 r465 4 4 interface 5 5 6 procedure Client(Command, Player: integer; var Data); stdcall;7 procedure SetAIName( p: integer; Name: string);6 procedure Client(Command, Player: Integer; var Data); stdcall; 7 procedure SetAIName(P: Integer; Name: string); 8 8 9 9 implementation 10 10 11 11 uses 12 UDpiControls, Term, CityScreen, Draft, MessgEx, Select, CityType, Help, UnitStat, Diagram, 13 NatStat, Wonders, Nego, Enhance, BaseWin, Battle, Rates, TechTree, Forms; 12 UDpiControls, Term, CityScreen, Nego, BaseWin, Forms; 14 13 15 14 var 16 FormsCreated: boolean;15 FormsCreated: Boolean; 17 16 18 procedure Client(Command, Player: integer; var Data);17 procedure Client(Command, Player: Integer; var Data); 19 18 begin 20 19 if not FormsCreated then 21 20 begin 22 FormsCreated := true;21 FormsCreated := True; 23 22 // TODO: Changing application name in runtime will cause change of Linux XML registry file path 24 // DpiApplication.MainForm := MainScreen;23 // Application.MainForm := MainScreen; 25 24 DpiApplication.CreateForm(TMainScreen, MainScreen); 26 DpiApplication.CreateForm(TCityDlg, CityDlg);27 DpiApplication.CreateForm(TModalSelectDlg, ModalSelectDlg);28 DpiApplication.CreateForm(TListDlg, ListDlg);29 DpiApplication.CreateForm(TMessgExDlg, MessgExDlg);30 DpiApplication.CreateForm(TDraftDlg, DraftDlg);31 DpiApplication.CreateForm(TCityTypeDlg, CityTypeDlg);32 DpiApplication.CreateForm(THelpDlg, HelpDlg);33 DpiApplication.CreateForm(TUnitStatDlg, UnitStatDlg);34 DpiApplication.CreateForm(TDiaDlg, DiaDlg);35 DpiApplication.CreateForm(TNatStatDlg, NatStatDlg);36 DpiApplication.CreateForm(TWondersDlg, WondersDlg);37 DpiApplication.CreateForm(TNegoDlg, NegoDlg);38 DpiApplication.CreateForm(TEnhanceDlg, EnhanceDlg);39 DpiApplication.CreateForm(TBattleDlg, BattleDlg);40 // DpiApplication.CreateForm(TAdvisorDlg, AdvisorDlg);41 DpiApplication.CreateForm(TRatesDlg, RatesDlg);42 DpiApplication.CreateForm(TTechTreeDlg, TechTreeDlg);43 25 end; 44 26 MainScreen.Client(Command, Player, Data); 45 27 end; 46 28 47 procedure SetAIName( p: integer; Name: string);29 procedure SetAIName(P: Integer; Name: string); 48 30 begin 49 MainScreen.SetAIName( p, Name);31 MainScreen.SetAIName(P, Name); 50 32 end; 51 33 52 34 initialization 53 35 54 FormsCreated := false;36 FormsCreated := False; 55 37 56 38 end. -
branches/highdpi/LocalPlayer/MessgEx.lfm
r349 r465 6 6 BorderIcons = [] 7 7 BorderStyle = bsNone 8 Caption = ' C-evo'8 Caption = 'Message' 9 9 ClientHeight = 134 10 10 ClientWidth = 418 … … 12 12 DesignTimePPI = 144 13 13 Font.Color = clWindowText 14 Font.Height = - 1314 Font.Height = -20 15 15 Font.Name = 'MS Sans Serif' 16 16 FormStyle = fsStayOnTop … … 20 20 OnPaint = FormPaint 21 21 OnShow = FormShow 22 LCLVersion = '2. 0.12.0'22 LCLVersion = '2.2.2.0' 23 23 Scaled = False 24 24 object Button1: TButtonA … … 61 61 object EInput: TDpiEdit 62 62 Left = 125 63 Height = 2 663 Height = 27 64 64 Top = 64 65 65 Width = 168 -
branches/highdpi/LocalPlayer/MessgEx.pas
r412 r465 5 5 6 6 uses 7 UDpiControls, Messg, Protocol, ScreenTools, Platform, DateUtils, 8 LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ButtonA,9 ButtonB, StdCtrls, DrawDlg;7 UDpiControls, Messg, Protocol, ScreenTools, Platform, DateUtils, LCLIntf, LCLType, Messages, 8 SysUtils, Classes, Graphics, Controls, Forms, ButtonA, ButtonB, StdCtrls, 9 DrawDlg, Help; 10 10 11 11 type … … 13 13 mikPureIcon, mikMyArmy, mikEnemyArmy, mikFullControl, mikShip, mikBigIcon, 14 14 mikEnemyShipComplete); 15 16 { TMessgExDlg } 15 17 16 18 TMessgExDlg = class(TBaseMessgDlg) … … 32 34 Kind: TMessageKind; 33 35 IconIndex: Integer; 34 HelpKind: Integer;36 HelpKind: TLinkCategory; 35 37 HelpNo: Integer; 36 38 CenterTo: Integer; 37 39 IconKind: TMessageIconKind; 38 40 OpenSound: string; 39 function ShowModal: integer; override;41 function ShowModal: Integer; override; 40 42 procedure CancelMovie; 41 43 private 42 MovieCancelled: boolean;43 procedure PaintBook(ca: TDpiCanvas; x, y, clPage, clCover: integer);44 MovieCancelled: Boolean; 45 procedure PaintBook(ca: TDpiCanvas; X, Y, clPage, clCover: Integer); 44 46 procedure PaintMyArmy; 45 47 procedure PaintEnemyArmy; … … 47 49 end; 48 50 49 var50 MessgExDlg: TMessgExDlg;51 51 52 52 procedure SoundMessageEx(SimpleText, SoundItem: string); 53 procedure TribeMessage( p: integer; SimpleText, SoundItem: string);53 procedure TribeMessage(P: Integer; SimpleText, SoundItem: string); 54 54 function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string) 55 : integer;55 : Integer; 56 56 procedure ContextMessage(SimpleText, SoundItem: string; 57 ContextKind, ContextNo: integer); 57 ContextKind: TLinkCategory; ContextNo: Integer); 58 58 59 59 60 implementation 60 61 61 62 uses 62 ClientTools, BaseWin, Term, Help, UnitStat, Tribes, UPixelPointer,63 IsoEngine,Diagram, Sound;63 ClientTools, BaseWin, Term, UnitStat, Tribes, PixelPointer, 64 Diagram, Sound; 64 65 65 66 {$R *.lfm} … … 78 79 procedure TMessgExDlg.FormShow(Sender: TObject); 79 80 var 80 i: integer;81 I: Integer; 81 82 begin 82 83 if IconKind = mikEnemyArmy then … … 147 148 end; 148 149 149 SplitText( true);150 SplitText(True); 150 151 ClientHeight := 72 + Border + TopSpace + Lines * MessageLineSpacing; 151 152 if GameMode = cMovie then … … 178 179 end; 179 180 end; 180 for i:= 0 to ControlCount - 1 do181 Controls[ i].Top := ClientHeight - (34 + Border);181 for I := 0 to ControlCount - 1 do 182 Controls[I].Top := ClientHeight - (34 + Border); 182 183 if Kind = mkModel then 183 184 EInput.Top := ClientHeight - (76 + Border); 184 185 end; 185 186 186 function TMessgExDlg.ShowModal: integer;187 function TMessgExDlg.ShowModal: Integer; 187 188 var 188 189 Ticks0: TDateTime; 189 190 Ticks: TDateTime; 190 191 begin 192 Caption := Phrases.Lookup('TITLE_MESSAGE'); 191 193 if GameMode = cMovie then 192 194 begin 193 195 if not((GameMode = cMovie) and (MovieSpeed = 4)) then 194 196 begin 195 MovieCancelled := false;197 MovieCancelled := False; 196 198 Show; 197 199 Ticks0 := NowPrecise; … … 203 205 Hide; 204 206 end; 205 result := mrOk;207 Result := mrOk; 206 208 end 207 209 else 208 result := inherited; 210 Result := inherited; 211 //Gtk2Fix; 209 212 end; 210 213 211 214 procedure TMessgExDlg.CancelMovie; 212 215 begin 213 MovieCancelled := true;214 end; 215 216 procedure TMessgExDlg.PaintBook(ca: TDpiCanvas; x, y, clPage, clCover: integer);216 MovieCancelled := True; 217 end; 218 219 procedure TMessgExDlg.PaintBook(ca: TDpiCanvas; X, Y, clPage, clCover: Integer); 217 220 const 218 221 xScrewed = 77; … … 220 223 wScrewed = 43; 221 224 hScrewed = 27; 225 type 226 TScrewed = array [0 .. wScrewed - 1, 0 .. hScrewed - 1, 0 .. 3] of Single; 222 227 var 223 ix, iy, xDst, yDst, dx, dy, xIcon, yIcon: integer;228 ix, iy, xDst, yDst, dx, dy, xIcon, yIcon: Integer; 224 229 BookRect: TRect; 225 x1, xR, yR, share: single;226 Screwed: array [0 .. wScrewed - 1, 0 .. hScrewed - 1, 0 .. 3] of single;230 x1, xR, yR, share: Single; 231 Screwed: TScrewed; 227 232 SrcPtr: TPixelPointer; 228 233 Width: Integer; … … 235 240 yIcon := (IconIndex + SystemIconLines * 7) div 7 * ySizeBig; 236 241 // prepare screwed icon 237 FillChar(Screwed, sizeof(Screwed), 0);242 Screwed := Default(TScrewed); 238 243 BigImp.BeginUpdate; 239 SrcPtr := PixelPointer(BigImp, ScaleToNative(xIcon), ScaleToNative(yIcon));244 SrcPtr := TPixelPointer.Create(BigImp, ScaleToNative(xIcon), ScaleToNative(yIcon)); 240 245 for iy := 0 to ScaleToNative(Height) - 1 do begin 241 246 for ix := 0 to ScaleToNative(Width) - 1 do begin … … 277 282 BookRect := SmallBook.BoundsRect; 278 283 end; 279 x := x- BookRect.Width div 2;284 X := X - BookRect.Width div 2; 280 285 281 286 // paint 282 287 UnshareBitmap(LogoBuffer); 283 DpiBit Canvas(LogoBuffer.Canvas, 0, 0, BookRect.Width, BookRect.Height, ca, x, y);288 DpiBitBltCanvas(LogoBuffer.Canvas, 0, 0, BookRect.Width, BookRect.Height, ca, X, Y); 284 289 285 290 if IconIndex >= 0 then … … 294 299 ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), BookRect, clCover, clPage); 295 300 296 DpiBit Canvas(ca, x, y, BookRect.Width, BookRect.Height, LogoBuffer.Canvas, 0, 0);301 DpiBitBltCanvas(ca, X, Y, BookRect.Width, BookRect.Height, LogoBuffer.Canvas, 0, 0); 297 302 end; 298 303 … … 303 308 procedure TMessgExDlg.PaintEnemyArmy; 304 309 var 305 emix, ix, iy, x, y, count, UnitsInLine: integer;310 emix, ix, iy, X, Y, count, UnitsInLine: Integer; 306 311 begin 307 312 ix := 0; … … 314 319 for count := 0 to LostArmy[emix] - 1 do 315 320 begin 316 x:= ClientWidth div 2 + ix * 64 - UnitsInLine * 32;317 y:= 26 + Border + TopSpace + Lines * MessageLineSpacing + iy * 48;321 X := ClientWidth div 2 + ix * 64 - UnitsInLine * 32; 322 Y := 26 + Border + TopSpace + Lines * MessageLineSpacing + iy * 48; 318 323 with MyRO.EnemyModel[emix], Tribe[Owner].ModelPicture[mix] do 319 324 begin 320 DpiBit Canvas(Canvas, x, y, 64, 48, HGr.Mask.Canvas,325 DpiBitBltCanvas(Canvas, X, Y, 64, 48, HGr.Mask.Canvas, 321 326 pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCAND); 322 DpiBit Canvas(Canvas, x, y, 64, 48, HGr.Data.Canvas,327 DpiBitBltCanvas(Canvas, X, Y, 64, 48, HGr.Data.Canvas, 323 328 pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCPAINT); 324 329 end; 325 330 326 331 // next position 327 inc(ix);332 Inc(ix); 328 333 if ix = LostUnitsPerLine then 329 334 begin // next line 330 335 ix := 0; 331 inc(iy);336 Inc(iy); 332 337 if iy = 6 then 333 exit;338 Exit; 334 339 UnitsInLine := nLostArmy - LostUnitsPerLine * iy; 335 340 if UnitsInLine > LostUnitsPerLine then … … 341 346 procedure TMessgExDlg.FormPaint(Sender: TObject); 342 347 var 343 p1, clSaveTextLight, clSaveTextShade: integer;348 p1, clSaveTextLight, clSaveTextShade: Integer; 344 349 begin 345 350 if (IconKind = mikImp) and (IconIndex = 27) then … … 362 367 p1 := MyRO.Wonder[IconIndex].EffectiveOwner; 363 368 UnshareBitmap(Buffer); 364 DpiBit Canvas(Buffer.Canvas, 0, 0, xSizeBig + 2 * GlowRange,369 DpiBitBltCanvas(Buffer.Canvas, 0, 0, xSizeBig + 2 * GlowRange, 365 370 ySizeBig + 2 * GlowRange, Canvas, 366 371 ClientWidth div 2 - (28 + GlowRange), 24 - GlowRange); 367 DpiBit Canvas(Buffer.Canvas, GlowRange, GlowRange, xSizeBig, ySizeBig,372 DpiBitBltCanvas(Buffer.Canvas, GlowRange, GlowRange, xSizeBig, ySizeBig, 368 373 BigImp.Canvas, IconIndex mod 7 * xSizeBig, 369 374 (IconIndex + SystemIconLines * 7) div 7 * ySizeBig); … … 373 378 GlowFrame(Buffer, GlowRange, GlowRange, xSizeBig, ySizeBig, 374 379 Tribe[p1].Color); 375 DpiBit Canvas(Canvas, ClientWidth div 2 - (28 + GlowRange),380 DpiBitBltCanvas(Canvas, ClientWidth div 2 - (28 + GlowRange), 376 381 24 - GlowRange, xSizeBig + 2 * GlowRange, ySizeBig + 2 * GlowRange, 377 382 Buffer.Canvas, 0, 0); … … 387 392 end; 388 393 mikModel: 389 with Tribe[ me].ModelPicture[IconIndex] do394 with Tribe[Me].ModelPicture[IconIndex] do 390 395 begin 391 396 FrameImage(Canvas, BigImp, ClientWidth div 2 - 28, 24, xSizeBig, 392 397 ySizeBig, 0, 0); 393 DpiBit Canvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44,398 DpiBitBltCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44, 394 399 HGr.Mask.Canvas, pix mod 10 * 65 + 1, 395 400 pix div 10 * 49 + 1, SRCAND); 396 DpiBit Canvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44,401 DpiBitBltCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44, 397 402 HGr.Data.Canvas, pix mod 10 * 65 + 1, 398 403 pix div 10 * 49 + 1, SRCPAINT); … … 406 411 Frame(Canvas, ClientWidth div 2 - 32 - 1, 24 - 1, 407 412 ClientWidth div 2 + 32, 24 + 48, $000000, $000000); 408 DpiBit Canvas(Canvas, ClientWidth div 2 - 32, 24, 64, 48,413 DpiBitBltCanvas(Canvas, ClientWidth div 2 - 32, 24, 64, 48, 409 414 Tribe[IconIndex].faceHGr.Data.Canvas, 410 415 1 + Tribe[IconIndex].facepix mod 10 * 65, … … 420 425 mikEnemyShipComplete: 421 426 begin 422 DpiBit Canvas(Buffer.Canvas, 0, 0, 140, 120, Canvas,427 DpiBitBltCanvas(Buffer.Canvas, 0, 0, 140, 120, Canvas, 423 428 (ClientWidth - 140) div 2, 24); 424 429 ImageOp_BCC(Buffer, Templates.Data, Point(0, 0), StarshipDeparted.BoundsRect, 0, $FFFFFF); 425 DpiBit Canvas(Canvas, (ClientWidth - 140) div 2, 24, 140, 120,430 DpiBitBltCanvas(Canvas, (ClientWidth - 140) div 2, 24, 140, 120, 426 431 Buffer.Canvas, 0, 0); 427 432 end; … … 451 456 begin 452 457 if Kind = mkOkHelp then 453 HelpDlg.ShowNewContent(wmSubmodal, HelpKind, HelpNo)458 MainScreen.HelpDlg.ShowNewContent(wmSubmodal, HelpKind, HelpNo) 454 459 else if Kind = mkModel then 455 UnitStatDlg.ShowNewContent_OwnModel(wmSubmodal, IconIndex)460 MainScreen.UnitStatDlg.ShowNewContent_OwnModel(wmSubmodal, IconIndex) 456 461 else 457 462 ModalResult := mrIgnore; … … 482 487 // because Messg.SoundMessage not capable of movie mode 483 488 begin 484 with M essgExDlg do489 with MainScreen.MessgExDlg do 485 490 begin 486 491 MessgText := SimpleText; … … 491 496 end; 492 497 493 procedure TribeMessage( p: integer; SimpleText, SoundItem: string);494 begin 495 with M essgExDlg do498 procedure TribeMessage(P: Integer; SimpleText, SoundItem: string); 499 begin 500 with MainScreen.MessgExDlg do 496 501 begin 497 502 OpenSound := SoundItem; … … 499 504 Kind := mkOk; 500 505 IconKind := mikTribe; 501 IconIndex := p;506 IconIndex := P; 502 507 ShowModal; 503 508 end; … … 505 510 506 511 function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string) 507 : integer;508 begin 509 with M essgExDlg do512 : Integer; 513 begin 514 with MainScreen.MessgExDlg do 510 515 begin 511 516 MessgText := SimpleText; … … 513 518 Kind := QueryKind; 514 519 ShowModal; 515 result := ModalResult;520 Result := ModalResult; 516 521 end; 517 522 end; 518 523 519 524 procedure ContextMessage(SimpleText, SoundItem: string; 520 ContextKind , ContextNo: integer);521 begin 522 with M essgExDlg do525 ContextKind: TLinkCategory; ContextNo: Integer); 526 begin 527 with MainScreen.MessgExDlg do 523 528 begin 524 529 MessgText := SimpleText; … … 543 548 end; 544 549 545 546 initialization547 548 550 end. -
branches/highdpi/LocalPlayer/NatStat.pas
r361 r465 5 5 6 6 uses 7 UDpiControls, Protocol, ClientTools, Term, ScreenTools, BaseWin, 8 9 LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, 10 ButtonB, ButtonC, Menus, EOTButton; 7 UDpiControls, Protocol, ClientTools, ScreenTools, BaseWin, LCLIntf, LCLType, SysUtils, 8 Classes, Graphics, Controls, Forms, ButtonB, ButtonC, Menus, EOTButton; 11 9 12 10 type … … 27 25 procedure ToggleBtnClick(Sender: TObject); 28 26 procedure PlayerClick(Sender: TObject); 29 procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);27 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 30 28 procedure FormDestroy(Sender: TObject); 31 29 procedure ScrollUpBtnClick(Sender: TObject); 32 30 procedure ScrollDownBtnClick(Sender: TObject); 33 31 procedure TellAIBtnClick(Sender: TObject); 34 35 32 public 36 33 procedure CheckAge; 37 procedure ShowNewContent(NewMode: integer; p: integer = -1);34 procedure ShowNewContent(NewMode: TWindowMode; P: Integer = -1); 38 35 procedure EcoChange; 39 40 36 protected 41 37 procedure OffscreenPaint; override; 42 43 38 private 44 pView, AgePrepared, LinesDown: integer; 45 SelfReport, CurrentReport: PEnemyReport; 46 ShowContact, ContactEnabled: boolean; 47 Back, Template: TDpiBitmap; 39 pView: Integer; 40 AgePrepared: Integer; 41 LinesDown: Integer; 42 SelfReport: PEnemyReport; 43 CurrentReport: PEnemyReport; 44 ShowContact: Boolean; 45 ContactEnabled: Boolean; 46 Back: TDpiBitmap; 47 Template: TDpiBitmap; 48 48 ReportText: TStringList; 49 49 procedure GenerateReportText; 50 50 end; 51 51 52 var53 NatStatDlg: TNatStatDlg;54 52 55 53 implementation … … 58 56 59 57 uses 60 Messg, Tribes, Directories;58 Term, Messg, Tribes, Directories; 61 59 62 60 const … … 109 107 if MainTexture.Age <> AgePrepared then begin 110 108 AgePrepared := MainTexture.Age; 111 DpiBit Canvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight,109 DpiBitBltCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight, 112 110 MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2, 113 111 (MainTexture.Height - ClientHeight) div 2); … … 118 116 procedure TNatStatDlg.FormShow(Sender: TObject); 119 117 begin 120 if pView = me then118 if pView = Me then 121 119 begin 122 120 SelfReport.TurnOfCivilReport := MyRO.Turn; 123 121 SelfReport.TurnOfMilReport := MyRO.Turn; 124 move(MyRO.Treaty, SelfReport.Treaty, SizeOf(SelfReport.Treaty));122 Move(MyRO.Treaty, SelfReport.Treaty, SizeOf(SelfReport.Treaty)); 125 123 SelfReport.Government := MyRO.Government; 126 124 SelfReport.Money := MyRO.Money; 127 CurrentReport := pointer(SelfReport);125 CurrentReport := Pointer(SelfReport); 128 126 end 129 127 else 130 CurrentReport := pointer(MyRO.EnemyReport[pView]);128 CurrentReport := Pointer(MyRO.EnemyReport[pView]); 131 129 if CurrentReport.TurnOfCivilReport >= 0 then 132 130 GenerateReportText; 133 ShowContact := (pView <> me) and (not supervising or (me <> 0));134 ContactEnabled := ShowContact and not supervising and131 ShowContact := (pView <> Me) and (not Supervising or (Me <> 0)); 132 ContactEnabled := ShowContact and not Supervising and 135 133 (1 shl pView and MyRO.Alive <> 0); 136 134 ContactBtn.Visible := ContactEnabled and (MyRO.Happened and phGameEnd = 0) and … … 150 148 end; 151 149 152 procedure TNatStatDlg.ShowNewContent(NewMode , p: integer);153 begin 154 if p< 0 then150 procedure TNatStatDlg.ShowNewContent(NewMode: TWindowMode; P: Integer); 151 begin 152 if P < 0 then 155 153 if ClientMode >= scContact then 156 pView := DipMem[ me].pContact154 pView := DipMem[Me].pContact 157 155 else 158 156 begin … … 160 158 while (pView < nPl) and ((MyRO.Treaty[pView] < trNone) or 161 159 (1 shl pView and MyRO.Alive = 0)) do 162 inc(pView);160 Inc(pView); 163 161 if pView >= nPl then 164 pView := me;162 pView := Me; 165 163 end 166 164 else 167 pView := p;165 pView := P; 168 166 inherited ShowNewContent(NewMode); 169 167 end; … … 178 176 List: ^TChart; 179 177 180 function StatText(no: integer): string;178 function StatText(no: Integer): string; 181 179 var 182 i: integer;180 I: Integer; 183 181 begin 184 182 if (CurrentReport.TurnOfCivilReport >= 0) and 185 (Server(sGetChart + no shl 4, me, pView, List^) >= rExecuted) then183 (Server(sGetChart + no shl 4, Me, pView, List^) >= rExecuted) then 186 184 begin 187 i:= List[CurrentReport.TurnOfCivilReport];185 I := List[CurrentReport.TurnOfCivilReport]; 188 186 case no of 189 187 stPop: 190 result := Format(Phrases.Lookup('FRSTATPOP'), [i]);188 Result := Format(Phrases.Lookup('FRSTATPOP'), [I]); 191 189 stTerritory: 192 result := Format(Phrases.Lookup('FRSTATTER'), [i]);190 Result := Format(Phrases.Lookup('FRSTATTER'), [I]); 193 191 stScience: 194 result := Format(Phrases.Lookup('FRSTATTECH'), [idiv nAdv]);192 Result := Format(Phrases.Lookup('FRSTATTECH'), [I div nAdv]); 195 193 stExplore: 196 result := Format(Phrases.Lookup('FRSTATEXP'),197 [ i* 100 div (G.lx * G.ly)]);194 Result := Format(Phrases.Lookup('FRSTATEXP'), 195 [I * 100 div (G.lx * G.ly)]); 198 196 end; 199 end 197 end; 200 198 end; 201 199 202 200 var 203 p1, Treaty: integer;204 s: string;205 HasContact, ExtinctPart: boolean;201 p1, Treaty: Integer; 202 S: string; 203 HasContact, ExtinctPart: Boolean; 206 204 begin 207 205 GetMem(List, 4 * (MyRO.Turn + 2)); … … 212 210 (1 shl pView and MyRO.Alive <> 0) then 213 211 begin 214 s:= Format(Phrases.Lookup('FROLDCIVILREP'),212 S := Format(Phrases.Lookup('FROLDCIVILREP'), 215 213 [TurnToString(CurrentReport.TurnOfCivilReport)]); 216 ReportText.Add('C' + s);214 ReportText.Add('C' + S); 217 215 ReportText.Add(''); 218 216 end; … … 227 225 ReportText.Add('S' + StatText(stScience)); 228 226 ReportText.Add('E' + StatText(stExplore)); 229 HasContact := false;227 HasContact := False; 230 228 for p1 := 0 to nPl - 1 do 231 if (p1 <> me) and (CurrentReport.Treaty[p1] > trNoContact) then232 HasContact := true;229 if (p1 <> Me) and (CurrentReport.Treaty[p1] > trNoContact) then 230 HasContact := True; 233 231 if HasContact then 234 232 begin 235 233 ReportText.Add(''); 236 234 ReportText.Add(' ' + Phrases.Lookup('FRRELATIONS')); 237 for ExtinctPart := false to true do235 for ExtinctPart := False to True do 238 236 for Treaty := trAlliance downto trNone do 239 237 for p1 := 0 to nPl - 1 do 240 if (p1 <> me) and (CurrentReport.Treaty[p1] = Treaty) and238 if (p1 <> Me) and (CurrentReport.Treaty[p1] = Treaty) and 241 239 ((1 shl p1 and MyRO.Alive = 0) = ExtinctPart) then 242 240 begin 243 s:= Tribe[p1].TString(Phrases.Lookup('HAVETREATY', Treaty));241 S := Tribe[p1].TString(Phrases.Lookup('HAVETREATY', Treaty)); 244 242 if ExtinctPart then 245 s := '(' + s+ ')';246 ReportText.Add(char(48 + Treaty) + s);243 S := '(' + S + ')'; 244 ReportText.Add(char(48 + Treaty) + S); 247 245 end; 248 246 end; … … 254 252 procedure TNatStatDlg.OffscreenPaint; 255 253 var 256 i, y: integer; 257 s: string; 258 ps: pchar; 259 Extinct: boolean; 260 254 I, Y: Integer; 255 S: string; 256 ps: PChar; 257 Extinct: Boolean; 261 258 begin 262 259 inherited; … … 264 261 Extinct := 1 shl pView and MyRO.Alive = 0; 265 262 266 DpiBit Canvas(offscreen.Canvas, 0, 0, ClientWidth, ClientHeight,263 DpiBitBltCanvas(Offscreen.Canvas, 0, 0, ClientWidth, ClientHeight, 267 264 Back.Canvas, 0, 0); 268 265 269 offscreen.Canvas.Font.Assign(UniFont[ftCaption]);270 RisedTextout( offscreen.Canvas,266 Offscreen.Canvas.Font.Assign(UniFont[ftCaption]); 267 RisedTextout(Offscreen.Canvas, 271 268 40 { (ClientWidth-BiColorTextWidth(offscreen.canvas,caption)) div 2 } , 272 269 7, Caption); 273 270 274 offscreen.Canvas.Font.Assign(UniFont[ftNormal]);275 276 with offscreen do271 Offscreen.Canvas.Font.Assign(UniFont[ftNormal]); 272 273 with Offscreen do 277 274 begin 278 275 // show leader picture … … 280 277 if Assigned(Tribe[pView].faceHGr) then 281 278 begin 282 Dump( offscreen, Tribe[pView].faceHGr, 18, yIcon - 4, 64, 48,279 Dump(Offscreen, Tribe[pView].faceHGr, 18, yIcon - 4, 64, 48, 283 280 1 + Tribe[pView].facepix mod 10 * 65, 284 281 1 + Tribe[pView].facepix div 10 * 49); 285 frame(offscreen.Canvas, 18 - 1, yIcon - 4 - 1, 18 + 64, yIcon - 4 + 48,282 Frame(Offscreen.Canvas, 18 - 1, yIcon - 4 - 1, 18 + 64, yIcon - 4 + 48, 286 283 $000000, $000000); 287 284 end; 288 285 289 if (pView = me) or not Extinct then286 if (pView = Me) or not Extinct then 290 287 LoweredTextOut(Canvas, -1, MainTexture, xAttrib, yAttrib, 291 288 Phrases.Lookup('GOVERNMENT', CurrentReport.Government) + 292 289 Phrases.Lookup('FRAND')); 293 if pView = me then290 if pView = Me then 294 291 begin 295 292 LoweredTextOut(Canvas, -1, MainTexture, xAttrib, yAttrib + 19, … … 305 302 Phrases.Lookup('FREXTINCT')); 306 303 LoweredTextOut(Canvas, -1, MainTexture, xAttrib, yAttrib + 28, 307 TurnToString(CurrentReport.TurnOfCivilReport)) 304 TurnToString(CurrentReport.TurnOfCivilReport)); 308 305 end 309 306 else … … 318 315 if MyRO.Treaty[pView] = trNoContact then 319 316 begin 320 s:= Phrases.Lookup('FRNOCONTACT');317 S := Phrases.Lookup('FRNOCONTACT'); 321 318 LoweredTextOut(Canvas, -1, MainTexture, 322 (ClientWidth - BiColorTextWidth(Canvas, s)) div 2, yRelation + 9, s)319 (ClientWidth - BiColorTextWidth(Canvas, S)) div 2, yRelation + 9, S); 323 320 end 324 321 else if ShowContact then … … 344 341 FrameImage(Canvas, BigImp, xIcon, yIcon, xSizeBig, ySizeBig, 0, 200) 345 342 { else if CurrentReport.Government=gAnarchy then 346 FrameImage( canvas,BigImp,xIcon,yIcon,xSizeBig,ySizeBig,112,400,343 FrameImage(Canvas,BigImp,xIcon,yIcon,xSizeBig,ySizeBig,112,400, 347 344 ContactEnabled and (MyRO.Happened and phGameEnd=0) and (ClientMode<scContact)) 348 345 else 349 FrameImage( canvas,BigImp,xIcon,yIcon,xSizeBig,ySizeBig,346 FrameImage(Canvas,BigImp,xIcon,yIcon,xSizeBig,ySizeBig, 350 347 56*(CurrentReport.Government-1),40, 351 348 ContactEnabled and (MyRO.Happened and phGameEnd=0) and (ClientMode<scContact)) }; … … 365 362 end; 366 363 367 y:= 0;368 for i:= 0 to ReportText.Count - 1 do369 begin 370 if ( i >= LinesDown) and (i< LinesDown + ReportLines) then364 Y := 0; 365 for I := 0 to ReportText.Count - 1 do 366 begin 367 if (I >= LinesDown) and (I < LinesDown + ReportLines) then 371 368 begin 372 s := ReportText[i];373 if s<> '' then369 S := ReportText[I]; 370 if S <> '' then 374 371 begin 375 372 // LineType:=s[1]; 376 delete(s, 1, 1);373 Delete(S, 1, 1); 377 374 BiColorTextOut(Canvas, Colors.Canvas.Pixels[clkMisc, cliPaperText], 378 $7F007F, xReport + 8, yReport + LineSpacing * y, s);375 $7F007F, xReport + 8, yReport + LineSpacing * Y, S); 379 376 end; 380 inc(y);381 end 377 Inc(Y); 378 end; 382 379 end; 383 380 end 384 381 else 385 382 begin 386 s:= Phrases.Lookup('FRNOCIVILREP');387 RisedTextout(Canvas, (ClientWidth - BiColorTextWidth(Canvas, s)) div 2,388 yReport + hReport div 2 - 10, s);383 S := Phrases.Lookup('FRNOCIVILREP'); 384 RisedTextout(Canvas, (ClientWidth - BiColorTextWidth(Canvas, S)) div 2, 385 yReport + hReport div 2 - 10, S); 389 386 end; 390 387 391 388 if soTellAI in OptionChecked then begin 392 Server(sGetAIInfo, me, pView, ps);389 Server(sGetAIInfo, Me, pView, ps); 393 390 LoweredTextOut(Canvas, -1, MainTexture, 42, 445, ps); 394 391 end else … … 396 393 Phrases2.Lookup('MENU_TELLAI')); 397 394 end; 398 ContactBtn.SetBack(offscreen.Canvas, ContactBtn.Left, ContactBtn.Top); 395 396 ContactBtn.SetBack(Offscreen.Canvas, ContactBtn.Left, ContactBtn.Top); 399 397 400 398 MarkUsedOffscreen(ClientWidth, ClientHeight); 401 end; { OffscreenPaint }399 end; 402 400 403 401 procedure TNatStatDlg.CloseBtnClick(Sender: TObject); 404 402 begin 405 Close 403 Close; 406 404 end; 407 405 408 406 procedure TNatStatDlg.DialogBtnClick(Sender: TObject); 409 407 var 410 ContactResult: integer;408 ContactResult: Integer; 411 409 begin 412 410 ContactResult := MainScreen.DipCall(scContact + pView shl 4); … … 416 414 SoundMessage(Phrases.Lookup('FRCOLDWAR'), 'MSG_DEFAULT') 417 415 else if MyRO.Government = gAnarchy then 418 SoundMessage(Tribe[ me].TPhrase('FRMYANARCHY'), 'MSG_DEFAULT')416 SoundMessage(Tribe[Me].TPhrase('FRMYANARCHY'), 'MSG_DEFAULT') 419 417 else if ContactResult = eAnarchy then 420 418 if MyRO.Treaty[pView] >= trPeace then 421 419 begin 422 420 if MainScreen.ContactRefused(pView, 'FRANARCHY') then 423 SmartUpdateContent 421 SmartUpdateContent; 424 422 end 425 423 else … … 427 425 end 428 426 else 429 Close 427 Close; 430 428 end; 431 429 432 430 procedure TNatStatDlg.ToggleBtnClick(Sender: TObject); 433 431 var 434 p1, StartCount: integer;435 m: TDpiMenuItem;436 ExtinctPart: boolean;432 p1, StartCount: Integer; 433 M: TDpiMenuItem; 434 ExtinctPart: Boolean; 437 435 begin 438 436 EmptyMenu(Popup.Items); 439 437 440 438 // own nation 441 if G.Difficulty[ me] <> 0 then442 begin 443 m:= TDpiMenuItem.Create(Popup);444 m.RadioItem := true;445 m.Caption := Tribe[me].TPhrase('TITLE_NATION');446 m.Tag := me;447 m.OnClick := PlayerClick;448 if me = pView then449 m.Checked := true;450 Popup.Items.Add( m);439 if G.Difficulty[Me] <> 0 then 440 begin 441 M := TDpiMenuItem.Create(Popup); 442 M.RadioItem := True; 443 M.Caption := Tribe[Me].TPhrase('TITLE_NATION'); 444 M.Tag := Me; 445 M.OnClick := PlayerClick; 446 if Me = pView then 447 M.Checked := True; 448 Popup.Items.Add(M); 451 449 end; 452 450 453 451 // foreign nations 454 for ExtinctPart := false to true do452 for ExtinctPart := False to True do 455 453 begin 456 454 StartCount := Popup.Items.Count; … … 460 458 (1 shl p1 and MyRO.Alive <> 0) and (MyRO.Treaty[p1] >= trNone) then 461 459 begin 462 m:= TDpiMenuItem.Create(Popup);463 m.RadioItem := true;464 m.Caption := Tribe[p1].TPhrase('TITLE_NATION');460 M := TDpiMenuItem.Create(Popup); 461 M.RadioItem := True; 462 M.Caption := Tribe[p1].TPhrase('TITLE_NATION'); 465 463 if ExtinctPart then 466 m.Caption := '(' + m.Caption + ')';467 m.Tag := p1;468 m.OnClick := PlayerClick;464 M.Caption := '(' + M.Caption + ')'; 465 M.Tag := p1; 466 M.OnClick := PlayerClick; 469 467 if p1 = pView then 470 m.Checked := true;471 Popup.Items.Add( m);468 M.Checked := True; 469 Popup.Items.Add(M); 472 470 end; 473 471 if (StartCount > 0) and (Popup.Items.Count > StartCount) then 474 472 begin // seperator 475 m:= TDpiMenuItem.Create(Popup);476 m.Caption := '-';477 Popup.Items.Insert(StartCount, m);473 M := TDpiMenuItem.Create(Popup); 474 M.Caption := '-'; 475 Popup.Items.Insert(StartCount, M); 478 476 end; 479 477 end; … … 482 480 end; 483 481 484 procedure TNatStatDlg.FormKeyDown(Sender: TObject; var Key: word;482 procedure TNatStatDlg.FormKeyDown(Sender: TObject; var Key: Word; 485 483 Shift: TShiftState); 486 484 var 487 i: integer;485 I: Integer; 488 486 begin 489 487 if Key = VK_F9 then // my key 490 488 begin // toggle nation 491 i:= 0;489 I := 0; 492 490 repeat 493 491 pView := (pView + 1) mod nPl; 494 inc(i);495 until ( i>= nPl) or (1 shl pView and MyRO.Alive <> 0) and492 Inc(I); 493 until (I >= nPl) or (1 shl pView and MyRO.Alive <> 0) and 496 494 (MyRO.Treaty[pView] >= trNone); 497 if i>= nPl then498 pView := me;495 if I >= nPl then 496 pView := Me; 499 497 Tag := pView; 500 498 PlayerClick(self); // no, this is not nice 501 499 end 502 500 else 503 inherited 501 inherited; 504 502 end; 505 503 506 504 procedure TNatStatDlg.EcoChange; 507 505 begin 508 if Visible and (pView = me) then506 if Visible and (pView = Me) then 509 507 begin 510 508 SelfReport.Government := MyRO.Government; 511 509 SelfReport.Money := MyRO.Money; 512 SmartUpdateContent 513 end 510 SmartUpdateContent; 511 end; 514 512 end; 515 513 … … 518 516 if LinesDown > 0 then 519 517 begin 520 dec(LinesDown);518 Dec(LinesDown); 521 519 SmartUpdateContent; 522 end 520 end; 523 521 end; 524 522 … … 527 525 if LinesDown + ReportLines < ReportText.Count then 528 526 begin 529 inc(LinesDown);527 Inc(LinesDown); 530 528 SmartUpdateContent; 531 end 529 end; 532 530 end; 533 531 … … 540 538 else 541 539 TellAIBtn.ButtonIndex := 2; 542 SmartUpdateContent 540 SmartUpdateContent; 543 541 end; 544 542 -
branches/highdpi/LocalPlayer/Nego.pas
r361 r465 5 5 6 6 uses 7 UDpiControls, ScreenTools, BaseWin, Protocol, Term,LCLType, SysUtils, Classes, Graphics,7 UDpiControls, ScreenTools, BaseWin, Protocol, LCLType, SysUtils, Classes, Graphics, 8 8 Controls, Forms, ButtonA, ButtonB, ButtonN; 9 9 … … 15 15 type 16 16 THistory = record 17 n: Integer;17 N: Integer; 18 18 Text: array[0 .. MaxHistory - 1] of ansistring; 19 19 end; 20 20 21 21 TCommandAllowedEnum = scDipNoticeStart..scDipBreakStart; 22 TPriceSet = set of $00..$FF; 22 23 23 24 { TNegoDlg } … … 59 60 procedure FormDestroy(Sender: TObject); 60 61 procedure FormMouseDown(Sender: TObject; Button: TMouseButton; 61 Shift: TShiftState; X, Y: integer);62 Shift: TShiftState; X, Y: Integer); 62 63 procedure OkBtnClick(Sender: TObject); 63 64 procedure BwdBtnClick(Sender: TObject); … … 69 70 procedure OfferClick(Sender: TObject); 70 71 procedure FastBtnClick(Sender: TObject); 71 72 72 public 73 73 procedure Initiate; // first turn of negotiation, initiate … … 75 75 procedure Start; // next turn of negotiation 76 76 procedure OffscreenPaint; override; 77 procedure ShowNewContent(NewMode: integer); 78 77 procedure ShowNewContent(NewMode: TWindowMode); 79 78 private 80 Page, DipCommand: integer;79 Page, DipCommand: Integer; 81 80 CurrentOffer: TOffer; 82 81 MyAllowed, OppoAllowed: TPriceSet; … … 84 83 History: array [0 .. nPl - 1] of THistory; 85 84 RomanFont: TDpiFont; 86 Costs, Delivers: array [0 .. 11] of cardinal;85 Costs, Delivers: array [0 .. 11] of Cardinal; 87 86 procedure ResetCurrentOffer; 88 87 procedure BuildCurrentOffer; 89 88 procedure FindAllowed; 90 89 procedure SplitText(Text: string; Bounds: TRect); 91 procedure PaintNationPicture(X, Y, p: integer);90 procedure PaintNationPicture(X, Y, P: Integer); 92 91 procedure SetButtonStates; 93 92 end; 94 93 95 var96 NegoDlg: TNegoDlg;97 94 98 95 implementation 99 96 100 97 uses 101 Messg, ClientTools, Diplomacy, Inp, Select, NatStat, Tribes, MessgEx ;98 Messg, ClientTools, Diplomacy, Inp, Select, NatStat, Tribes, MessgEx, Term; 102 99 103 100 {$R *.lfm} … … 136 133 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI'); 137 134 138 ButtonPrice: array [0 .. 11] of cardinal = (opChoose, opCivilReport,135 ButtonPrice: array [0 .. 11] of Cardinal = (opChoose, opCivilReport, 139 136 opMilReport, opMap, opAllTech, opAllTech, opAllModel, opMoney, opTreaty, 140 137 opLowTreaty, opShipParts, opShipParts); … … 142 139 procedure TNegoDlg.FormCreate(Sender: TObject); 143 140 var 144 cix: integer;141 cix: Integer; 145 142 begin 146 143 InitButtons; … … 153 150 BackGraphic := HGrSystem2.Data; 154 151 case Tag shr 8 of 155 1: 156 SmartHint := Phrases.Lookup('WANT', ButtonIndex - 6); 157 2: 158 SmartHint := Phrases.Lookup('OFFER', ButtonIndex - 6); 152 1: SmartHint := Phrases.Lookup('WANT', ButtonIndex - 6); 153 2: SmartHint := Phrases.Lookup('OFFER', ButtonIndex - 6); 159 154 end; 160 155 end; 161 156 162 fillchar(History, sizeof(History), 0);157 FillChar(History, SizeOf(History), 0); 163 158 RomanFont := TDpiFont.Create; 164 159 RomanFont.Name := 'Times New Roman'; … … 184 179 procedure TNegoDlg.ResetCurrentOffer; 185 180 var 186 i: integer;181 I: Integer; 187 182 begin 188 183 CurrentOffer.nDeliver := 0; 189 184 CurrentOffer.nCost := 0; 190 for i:= 0 to 11 do191 Costs[ i] := $FFFFFFFF;192 for i:= 0 to 11 do193 Delivers[ i] := $FFFFFFFF;194 end; 195 196 procedure TNegoDlg.ShowNewContent(NewMode: integer);185 for I := 0 to 11 do 186 Costs[I] := $FFFFFFFF; 187 for I := 0 to 11 do 188 Delivers[I] := $FFFFFFFF; 189 end; 190 191 procedure TNegoDlg.ShowNewContent(NewMode: TWindowMode); 197 192 begin 198 193 inherited ShowNewContent(NewMode); … … 202 197 else 203 198 PassBtn.SmartHint := Phrases.Lookup('BTN_PASS'); 204 case MyRO.Treaty[DipMem[ me].pContact] of199 case MyRO.Treaty[DipMem[Me].pContact] of 205 200 trNone: 206 201 begin … … 238 233 begin 239 234 if ClientMode <> scDipStart then 240 with History[ me] do241 begin 242 if n= MaxHistory then243 begin 244 move(Text[2], Text[0], (MaxHistory - 2) * sizeof(integer));245 dec(n, 2);235 with History[Me] do 236 begin 237 if N = MaxHistory then 238 begin 239 Move(Text[2], Text[0], (MaxHistory - 2) * SizeOf(Integer)); 240 Dec(N, 2); 246 241 end; 247 Text[ n] := copy(DipCommandToString(DipMem[me].pContact, me,248 DipMem[ me].FormerTreaty, DipMem[me].SentCommand, ClientMode,249 DipMem[ me].SentOffer, ReceivedOffer), 1, 255);250 inc(n);242 Text[N] := Copy(DipCommandToString(DipMem[Me].pContact, Me, 243 DipMem[Me].FormerTreaty, DipMem[Me].SentCommand, ClientMode, 244 DipMem[Me].SentOffer, ReceivedOffer), 1, 255); 245 Inc(N); 251 246 end; 252 assert(History[me].nmod 2 = 1);253 254 Page := History[ me].n;247 Assert(History[Me].N mod 2 = 1); 248 249 Page := History[Me].N; 255 250 FindAllowed; 256 251 ResetCurrentOffer; … … 284 279 procedure TNegoDlg.SplitText(Text: string; Bounds: TRect); 285 280 var 286 nLines, Line, Start, Stop, OrdinaryStop, Indent, Y: integer;287 s: string;288 preview, Dot: boolean;281 nLines, Line, Start, Stop, OrdinaryStop, Indent, Y: Integer; 282 S: string; 283 preview, Dot: Boolean; 289 284 begin 290 285 nLines := 0; 291 for preview := true downto false do286 for preview := True downto False do 292 287 begin 293 288 Start := 1; … … 296 291 while Start < Length(Text) do 297 292 begin 298 Dot := false;293 Dot := False; 299 294 if (Start = 1) or (Text[Start - 1] = '\') then 300 295 if Text[Start] = '-' then 301 296 begin 302 297 Indent := ListIndent; 303 inc(Start);298 Inc(Start); 304 299 if Start = Length(Text) then 305 break;306 Dot := true;300 Break; 301 Dot := True; 307 302 end 308 303 else … … 311 306 while (Stop < Length(Text)) and (Text[Stop] <> '\') do 312 307 begin 313 inc(Stop);308 Inc(Stop); 314 309 if BiColorTextWidth(Offscreen.Canvas, 315 copy(Text, Start, Stop - Start + 1)) > Bounds.Right - Bounds.Left -310 Copy(Text, Start, Stop - Start + 1)) > Bounds.Right - Bounds.Left - 316 311 PaperBorder_Left - PaperBorder_Right - Indent then 317 312 begin 318 dec(Stop);319 break313 Dec(Stop); 314 Break 320 315 end; 321 316 end; … … 325 320 while (Text[OrdinaryStop + 1] <> ' ') and 326 321 (Text[OrdinaryStop + 1] <> '\') do 327 dec(OrdinaryStop);322 Dec(OrdinaryStop); 328 323 if (OrdinaryStop + 1 - Start) * 2 >= Stop - Start then 329 324 Stop := OrdinaryStop … … 335 330 Sprite(Offscreen, HGrSystem, Bounds.Left + PaperBorder_Left + 336 331 (ListIndent - 14), Y + 7, 8, 8, 90, 16); 337 s := copy(Text, Start, Stop - Start + 1);332 S := Copy(Text, Start, Stop - Start + 1); 338 333 BiColorTextOut(Offscreen.Canvas, Colors.Canvas.Pixels[clkMisc, 339 334 cliPaperText], $7F007F, Bounds.Left + PaperBorder_Left + 340 Indent, Y, s);335 Indent, Y, S); 341 336 end; 342 inc(Line);337 Inc(Line); 343 338 Start := Stop + 2; 344 339 end; … … 349 344 procedure TNegoDlg.FindAllowed; 350 345 var 351 i: integer;346 I: Integer; 352 347 begin 353 348 CommandAllowed := [scDipOffer - scDipStart]; 354 349 if ClientMode <> scDipBreak then 355 include(CommandAllowed, scDipBreak - scDipStart);356 if MyRO.Treaty[DipMem[ me].pContact] >= trPeace then357 include(CommandAllowed, scDipCancelTreaty - scDipStart);358 if (ClientMode = scDipOffer) and (Server(scDipAccept - sExecute, me, 0, nil^)350 Include(CommandAllowed, scDipBreak - scDipStart); 351 if MyRO.Treaty[DipMem[Me].pContact] >= trPeace then 352 Include(CommandAllowed, scDipCancelTreaty - scDipStart); 353 if (ClientMode = scDipOffer) and (Server(scDipAccept - sExecute, Me, 0, nil^) 359 354 >= rExecuted) then 360 include(CommandAllowed, scDipAccept - scDipStart);355 Include(CommandAllowed, scDipAccept - scDipStart); 361 356 362 357 MyAllowed := [opChoose shr 24, opMoney shr 24]; 363 358 OppoAllowed := [opChoose shr 24, opMoney shr 24]; 364 if not IsCivilReportNew(DipMem[ me].pContact) then359 if not IsCivilReportNew(DipMem[Me].pContact) then 365 360 begin // no up-to-date civil report 366 361 MyAllowed := MyAllowed + [opCivilReport shr 24]; 367 for i:= 0 to nAdv - 1 do368 if MyRO.Tech[ i] >= tsApplicable then362 for I := 0 to nAdv - 1 do 363 if MyRO.Tech[I] >= tsApplicable then 369 364 begin 370 365 MyAllowed := MyAllowed + [opAllTech shr 24]; 371 break366 Break 372 367 end; 373 368 OppoAllowed := OppoAllowed + [opCivilReport shr 24, opAllTech shr 24]; … … 375 370 else 376 371 begin // check techs 377 for i:= 0 to nAdv - 1 do378 if not( iin FutureTech) then379 if (MyRO.Tech[ i] < tsSeen) and380 (MyRO.EnemyReport[DipMem[ me].pContact].Tech[i] >= tsApplicable) then372 for I := 0 to nAdv - 1 do 373 if not(I in FutureTech) then 374 if (MyRO.Tech[I] < tsSeen) and 375 (MyRO.EnemyReport[DipMem[Me].pContact].Tech[I] >= tsApplicable) then 381 376 OppoAllowed := OppoAllowed + [opAllTech shr 24] 382 else if (MyRO.EnemyReport[DipMem[ me].pContact].Tech[i] < tsSeen) and383 (MyRO.Tech[ i] >= tsApplicable) then377 else if (MyRO.EnemyReport[DipMem[Me].pContact].Tech[I] < tsSeen) and 378 (MyRO.Tech[I] >= tsApplicable) then 384 379 MyAllowed := MyAllowed + [opAllTech shr 24]; 385 380 end; 386 if not IsMilReportNew(DipMem[ me].pContact) then381 if not IsMilReportNew(DipMem[Me].pContact) then 387 382 begin // no up-to-date military report 388 383 MyAllowed := MyAllowed + [opMilReport shr 24]; … … 393 388 else 394 389 begin 395 if M odalSelectDlg.OnlyChoice(kChooseModel) <> mixAll then390 if MainScreen.ModalSelectDlg.OnlyChoice(kChooseModel) <> mixAll then 396 391 MyAllowed := MyAllowed + [opAllModel shr 24]; 397 if M odalSelectDlg.OnlyChoice(kChooseEModel) <> mixAll then392 if MainScreen.ModalSelectDlg.OnlyChoice(kChooseEModel) <> mixAll then 398 393 OppoAllowed := OppoAllowed + [opAllModel shr 24]; 399 394 end; 400 if MyRO.Treaty[DipMem[ me].pContact] < trAlliance then395 if MyRO.Treaty[DipMem[Me].pContact] < trAlliance then 401 396 begin 402 397 MyAllowed := MyAllowed + [opTreaty shr 24, opMap shr 24]; … … 408 403 OppoAllowed:=OppoAllowed+[opLowTreaty shr 24]; 409 404 end; } 410 for i:= 0 to nShipPart - 1 do411 begin 412 if MyRO.Ship[ me].Parts[i] > 0 then413 include(MyAllowed, opShipParts shr 24);414 if MyRO.Ship[DipMem[ me].pContact].Parts[i] > 0 then415 include(OppoAllowed, opShipParts shr 24);416 end; 417 MyAllowed := MyAllowed - DipMem[ me].DeliveredPrices *405 for I := 0 to nShipPart - 1 do 406 begin 407 if MyRO.Ship[Me].Parts[I] > 0 then 408 Include(MyAllowed, opShipParts shr 24); 409 if MyRO.Ship[DipMem[Me].pContact].Parts[I] > 0 then 410 Include(OppoAllowed, opShipParts shr 24); 411 end; 412 MyAllowed := MyAllowed - DipMem[Me].DeliveredPrices * 418 413 [opAllTech shr 24, opAllModel shr 24, opCivilReport shr 24, 419 414 opMilReport shr 24, opMap shr 24]; 420 OppoAllowed := OppoAllowed - DipMem[ me].ReceivedPrices *415 OppoAllowed := OppoAllowed - DipMem[Me].ReceivedPrices * 421 416 [opAllTech shr 24, opAllModel shr 24, opCivilReport shr 24, 422 417 opMilReport shr 24, opMap shr 24]; 423 418 end; 424 419 425 procedure TNegoDlg.PaintNationPicture(X, Y, p: integer);420 procedure TNegoDlg.PaintNationPicture(X, Y, P: Integer); 426 421 begin 427 422 with Offscreen.Canvas do 428 423 begin 429 424 Pen.Color := $000000; 430 Brush.Color := Tribe[ p].Color;425 Brush.Color := Tribe[P].Color; 431 426 Rectangle(X - 6, Y - 1, X + 70, Y + 49); 432 427 Brush.Color := $000000; 433 Tribe[ p].InitAge(GetAge(p));434 if Assigned(Tribe[ p].faceHGr) then435 Dump(Offscreen, Tribe[ p].faceHGr, X, Y, 64, 48,436 1 + Tribe[ p].facepix mod 10 * 65, 1 + Tribe[p].facepix div 10 * 49)428 Tribe[P].InitAge(GetAge(P)); 429 if Assigned(Tribe[P].faceHGr) then 430 Dump(Offscreen, Tribe[P].faceHGr, X, Y, 64, 48, 431 1 + Tribe[P].facepix mod 10 * 65, 1 + Tribe[P].facepix div 10 * 49) 437 432 else 438 433 FillRect(Rect(X, Y, X + 64, Y + 48)); … … 444 439 procedure TNegoDlg.SetButtonStates; 445 440 var 446 cix: integer;447 IsActionPage: boolean;448 begin 449 IsActionPage := Page = History[ me].n;441 cix: Integer; 442 IsActionPage: Boolean; 443 begin 444 IsActionPage := Page = History[Me].N; 450 445 451 446 AcceptBtn.Possible := IsActionPage and … … 478 473 (ButtonPrice[Tag and $FF] shr 24 in MyAllowed); 479 474 Lit := Delivers[Tag and $FF] <> $FFFFFFFF; 480 end 475 end; 481 476 end; 482 477 end; … … 484 479 procedure TNegoDlg.OffscreenPaint; 485 480 var 486 i, cred: integer;487 s: string;488 OkEnabled: boolean;481 I, cred: Integer; 482 S: string; 483 OkEnabled: Boolean; 489 484 begin 490 485 if (OffscreenUser <> nil) and (OffscreenUser <> self) then … … 493 488 OffscreenUser := self; 494 489 495 if (DipCommand >= 0) and (Page = History[ me].n) then496 History[ me].Text[History[me].n] :=497 copy(DipCommandToString(me, DipMem[me].pContact,498 MyRO.Treaty[DipMem[ me].pContact], ClientMode, DipCommand, ReceivedOffer,490 if (DipCommand >= 0) and (Page = History[Me].N) then 491 History[Me].Text[History[Me].N] := 492 Copy(DipCommandToString(Me, DipMem[Me].pContact, 493 MyRO.Treaty[DipMem[Me].pContact], ClientMode, DipCommand, ReceivedOffer, 499 494 CurrentOffer), 1, 255); 500 495 501 FwdBtn.Visible := Page < History[ me].n;496 FwdBtn.Visible := Page < History[Me].N; 502 497 BwdBtn.Visible := Page >= 2; 503 if Page < History[ me].nthen504 OkEnabled := false498 if Page < History[Me].N then 499 OkEnabled := False 505 500 else if DipCommand = scDipOffer then 506 OkEnabled := Server(scDipOffer - sExecute, me, 0, CurrentOffer) >= rExecuted501 OkEnabled := Server(scDipOffer - sExecute, Me, 0, CurrentOffer) >= rExecuted 507 502 else 508 503 OkEnabled := DipCommand >= 0; … … 533 528 yPad1 + 41 + 42 * 2, $FFFFFF, $B0B0B0); 534 529 535 PaintNationPicture(xNationPicture0, yNationPicture, DipMem[ me].pContact);536 PaintNationPicture(xNationPicture1, yNationPicture, me);537 538 if History[ me].Text[Page - 1] <> '' then530 PaintNationPicture(xNationPicture0, yNationPicture, DipMem[Me].pContact); 531 PaintNationPicture(xNationPicture1, yNationPicture, Me); 532 533 if History[Me].Text[Page - 1] <> '' then 539 534 begin 540 535 FillSeamless(Offscreen.Canvas, xText0, yText0, wText, hText, 0, 0, Paper); 541 i:= Page - 1;542 if History[ me].Text[0] = '' then543 dec(i);544 if i< 16 then536 I := Page - 1; 537 if History[Me].Text[0] = '' then 538 Dec(I); 539 if I < 16 then 545 540 begin 546 541 Offscreen.Canvas.Font.Assign(RomanFont); 547 542 Offscreen.Canvas.TextOut 548 (xText0 + (wText - Offscreen.Canvas.TextWidth(RomanNo[ i])) div 2,549 yText0 + (hText - Offscreen.Canvas.TextHeight(RomanNo[ i])) div 2,550 RomanNo[ i]);543 (xText0 + (wText - Offscreen.Canvas.TextWidth(RomanNo[I])) div 2, 544 yText0 + (hText - Offscreen.Canvas.TextHeight(RomanNo[I])) div 2, 545 RomanNo[I]); 551 546 end 552 547 end; 553 548 FillSeamless(Offscreen.Canvas, xText1, yText1, wText, hText, 0, 0, Paper); 554 i:= Page;555 if History[ me].Text[0] = '' then556 dec(i);557 if i< 16 then549 I := Page; 550 if History[Me].Text[0] = '' then 551 Dec(I); 552 if I < 16 then 558 553 begin 559 554 Offscreen.Canvas.Font.Assign(RomanFont); 560 555 Offscreen.Canvas.TextOut 561 (xText1 + (wText - Offscreen.Canvas.TextWidth(RomanNo[ i])) div 2,562 yText1 + (hText - Offscreen.Canvas.TextHeight(RomanNo[ i])) div 2,563 RomanNo[ i]);556 (xText1 + (wText - Offscreen.Canvas.TextWidth(RomanNo[I])) div 2, 557 yText1 + (hText - Offscreen.Canvas.TextHeight(RomanNo[I])) div 2, 558 RomanNo[I]); 564 559 end; 565 560 with Offscreen.Canvas do 566 561 begin 567 562 Brush.Color := MainTexture.ColorBevelShade; 568 if History[ me].Text[Page - 1] <> '' then563 if History[Me].Text[Page - 1] <> '' then 569 564 begin 570 565 FillRect(Rect(xText0 + wText, yText0 + PaperShade, … … 584 579 { if Page=History[me].n then 585 580 begin // show attitude 586 s:=Phrases.Lookup('ATTITUDE',MyRO.EnemyReport[DipMem[me].pContact].Attitude);581 S:=Phrases.Lookup('ATTITUDE',MyRO.EnemyReport[DipMem[Me].pContact].Attitude); 587 582 //LoweredTextOut(Offscreen.Canvas,-1,MainTexture, 588 583 RisedTextOut(Offscreen.Canvas,xText0+wText div 2- 589 BiColorTextWidth(Offscreen.Canvas, s) div 2,yAttitude,s);590 s:=Phrases.Lookup('ATTITUDE',MyRO.Attitude[DipMem[me].pContact]);584 BiColorTextWidth(Offscreen.Canvas,S) div 2,yAttitude,S); 585 S:=Phrases.Lookup('ATTITUDE',MyRO.Attitude[DipMem[Me].pContact]); 591 586 //LoweredTextOut(Offscreen.Canvas,-1,MainTexture, 592 587 RisedTextOut(Offscreen.Canvas,xText1+wText div 2- 593 BiColorTextWidth(Offscreen.Canvas, s) div 2,yAttitude,s);588 BiColorTextWidth(Offscreen.Canvas,S) div 2,yAttitude,S); 594 589 end; } 595 590 596 if History[ me].Text[Page - 1] <> '' then597 SplitText(History[ me].Text[Page - 1], Rect(xText0, yText0, xText0 + wText,591 if History[Me].Text[Page - 1] <> '' then 592 SplitText(History[Me].Text[Page - 1], Rect(xText0, yText0, xText0 + wText, 598 593 yText0 + hText)); 599 if (Page < History[ me].n) or OkEnabled then600 SplitText(History[ me].Text[Page], Rect(xText1, yText1, xText1 + wText,594 if (Page < History[Me].N) or OkEnabled then 595 SplitText(History[Me].Text[Page], Rect(xText1, yText1, xText1 + wText, 601 596 yText1 + hText)); 602 597 603 598 // show credibility 604 599 Offscreen.Canvas.Font.Assign(UniFont[ftTiny]); 605 cred := MyRO.EnemyReport[DipMem[ me].pContact].Credibility;600 cred := MyRO.EnemyReport[DipMem[Me].pContact].Credibility; 606 601 case cred of 607 602 0 .. 49: 608 i:= 3;603 I := 3; 609 604 50 .. 90: 610 i:= 0;605 I := 0; 611 606 91 .. 100: 612 i:= 1;613 end; 614 PaintProgressBar(Offscreen.Canvas, i, xCred0, yCred0 + 17, (cred + 2) div 5,607 I := 1; 608 end; 609 PaintProgressBar(Offscreen.Canvas, I, xCred0, yCred0 + 17, (cred + 2) div 5, 615 610 0, 20, MainTexture); 616 s:= IntToStr(cred);611 S := IntToStr(cred); 617 612 RisedTextOut(Offscreen.Canvas, xCred0 + 10 - 618 (BiColorTextWidth(Offscreen.Canvas, s) + 1) div 2, yCred0, s);613 (BiColorTextWidth(Offscreen.Canvas, S) + 1) div 2, yCred0, S); 619 614 case MyRO.Credibility of 620 615 0 .. 49: 621 i:= 3;616 I := 3; 622 617 50 .. 90: 623 i:= 0;618 I := 0; 624 619 91 .. 100: 625 i:= 1;626 end; 627 PaintProgressBar(Offscreen.Canvas, i, xCred1, yCred1 + 17,620 I := 1; 621 end; 622 PaintProgressBar(Offscreen.Canvas, I, xCred1, yCred1 + 17, 628 623 (MyRO.Credibility + 2) div 5, 0, 20, MainTexture); 629 s:= IntToStr(MyRO.Credibility);624 S := IntToStr(MyRO.Credibility); 630 625 RisedTextOut(Offscreen.Canvas, xCred1 + 10 - 631 (BiColorTextWidth(Offscreen.Canvas, s) + 1) div 2, yCred1, s);626 (BiColorTextWidth(Offscreen.Canvas, S) + 1) div 2, yCred1, S); 632 627 633 628 MarkUsedOffscreen(ClientWidth, ClientHeight); 634 end; { OffscreenPaint }629 end; 635 630 636 631 procedure TNegoDlg.Initiate; 637 632 begin 638 History[ me].n:= 1;639 History[ me].Text[0] := '';633 History[Me].N := 1; 634 History[Me].Text[0] := ''; 640 635 end; 641 636 642 637 procedure TNegoDlg.Respond; 643 638 begin 644 History[ me].n:= 0;639 History[Me].N := 0; 645 640 end; 646 641 647 642 procedure TNegoDlg.FormMouseDown(Sender: TObject; Button: TMouseButton; 648 Shift: TShiftState; X, Y: integer);643 Shift: TShiftState; X, Y: Integer); 649 644 begin 650 645 if (X >= xNationPicture0) and (X < xNationPicture0 + 64) and 651 646 (Y >= yNationPicture) and (Y < yNationPicture + 48) then 652 NatStatDlg.ShowNewContent(FWindowMode or wmPersistent, DipMem[me].pContact)647 MainScreen.NatStatDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), DipMem[Me].pContact) 653 648 else if (X >= xNationPicture1) and (X < xNationPicture1 + 64) and 654 649 (Y >= yNationPicture) and (Y < yNationPicture + 48) then 655 NatStatDlg.ShowNewContent(FWindowMode or wmPersistent, me)650 MainScreen.NatStatDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), Me) 656 651 end; 657 652 658 653 procedure TNegoDlg.BwdBtnClick(Sender: TObject); 659 654 begin 660 dec(Page, 2);655 Dec(Page, 2); 661 656 SetButtonStates; 662 657 SmartUpdateContent; … … 665 660 procedure TNegoDlg.FwdBtnClick(Sender: TObject); 666 661 begin 667 inc(Page, 2);662 Inc(Page, 2); 668 663 SetButtonStates; 669 664 SmartUpdateContent; … … 672 667 procedure TNegoDlg.OkBtnClick(Sender: TObject); 673 668 begin 674 inc(History[me].n);669 Inc(History[Me].N); 675 670 if DipCommand = scDipOffer then 676 671 MainScreen.OfferCall(CurrentOffer) … … 698 693 procedure TNegoDlg.BuildCurrentOffer; 699 694 var 700 i: integer;695 I: Integer; 701 696 begin 702 697 CurrentOffer.nDeliver := 0; 703 698 CurrentOffer.nCost := 0; 704 for i:= 0 to 11 do705 if Delivers[ i] <> $FFFFFFFF then706 begin 707 CurrentOffer.Price[CurrentOffer.nDeliver] := Delivers[ i];708 inc(CurrentOffer.nDeliver);699 for I := 0 to 11 do 700 if Delivers[I] <> $FFFFFFFF then 701 begin 702 CurrentOffer.Price[CurrentOffer.nDeliver] := Delivers[I]; 703 Inc(CurrentOffer.nDeliver); 709 704 end; 710 for i:= 0 to 11 do711 if Costs[ i] <> $FFFFFFFF then705 for I := 0 to 11 do 706 if Costs[I] <> $FFFFFFFF then 712 707 begin 713 708 CurrentOffer.Price[CurrentOffer.nDeliver + CurrentOffer.nCost] := 714 Costs[ i];715 inc(CurrentOffer.nCost);709 Costs[I]; 710 Inc(CurrentOffer.nCost); 716 711 end; 717 712 end; … … 719 714 procedure TNegoDlg.WantClick(Sender: TObject); 720 715 var 721 a, i, max: integer;722 Price: cardinal;723 begin 724 if (Page <> History[ me].n) or (ClientMode = scDipCancelTreaty) or716 A, I, Max: Integer; 717 Price: Cardinal; 718 begin 719 if (Page <> History[Me].N) or (ClientMode = scDipCancelTreaty) or 725 720 (ClientMode = scDipBreak) then 726 exit;721 Exit; 727 722 if Costs[TButtonN(Sender).Tag and $FF] <> $FFFFFFFF then 728 723 Price := $FFFFFFFF // toggle off … … 732 727 begin 733 728 SimpleMessage(Phrases.Lookup('MAX2WANTS')); 734 exit729 Exit; 735 730 end; 736 731 Price := ButtonPrice[TButtonN(Sender).Tag and $FF]; 737 732 if not(Price shr 24 in OppoAllowed) then 738 exit;733 Exit; 739 734 case Price of 740 735 opCivilReport, opMilReport: 741 inc(Price, DipMem[me].pContact shl 16 + MyRO.Turn);736 Inc(Price, DipMem[Me].pContact shl 16 + MyRO.Turn); 742 737 // !!! choose player and year! 743 738 opMoney: … … 748 743 InputDlg.ShowModal; 749 744 if InputDlg.ModalResult <> mrOK then 750 exit;751 val(InputDlg.EInput.Text, a, i);752 if ( i <> 0) or (a <= 0) or (a>= MaxMoneyPrice) then753 exit;754 inc(Price, a);745 Exit; 746 val(InputDlg.EInput.Text, A, I); 747 if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then 748 Exit; 749 Inc(Price, A); 755 750 end; 756 751 opShipParts: 757 752 begin // choose type and number 758 753 if MyRO.NatBuilt[imSpacePort] = 0 then 759 with M essgExDlg do754 with MainScreen.MessgExDlg do 760 755 begin 761 756 OpenSound := 'WARNING_LOWSUPPORT'; … … 766 761 ShowModal; 767 762 if ModalResult <> mrOK then 768 exit763 Exit; 769 764 end; 770 M odalSelectDlg.ShowNewContent(wmModal, kEShipPart);771 if M odalSelectDlg.result < 0 then772 exit;773 inc(Price, ModalSelectDlg.result shl 16);774 max := MyRO.Ship[DipMem[me].pContact].Parts[ModalSelectDlg.result];765 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kEShipPart); 766 if MainScreen.ModalSelectDlg.Result < 0 then 767 Exit; 768 Inc(Price, MainScreen.ModalSelectDlg.Result shl 16); 769 Max := MyRO.Ship[DipMem[Me].pContact].Parts[MainScreen.ModalSelectDlg.Result]; 775 770 InputDlg.Caption := Phrases.Lookup('TITLE_NUMBER'); 776 771 InputDlg.EInput.Text := ''; … … 778 773 InputDlg.ShowModal; 779 774 if InputDlg.ModalResult <> mrOK then 780 exit;781 val(InputDlg.EInput.Text, a, i);782 if ( i <> 0) or (a<= 0) then783 exit;784 if a > max then785 a := max;786 if a> MaxShipPartPrice then787 a:= MaxShipPartPrice;788 inc(Price, a)775 Exit; 776 val(InputDlg.EInput.Text, A, I); 777 if (I <> 0) or (A <= 0) then 778 Exit; 779 if A > Max then 780 A := Max; 781 if A > MaxShipPartPrice then 782 A := MaxShipPartPrice; 783 Inc(Price, A); 789 784 end; 790 785 opAllTech: 791 786 begin // choose technology 792 M odalSelectDlg.ShowNewContent(wmModal, kChooseETech);793 if M odalSelectDlg.result < 0 then794 exit;795 if M odalSelectDlg.result = adAll then787 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kChooseETech); 788 if MainScreen.ModalSelectDlg.Result < 0 then 789 Exit; 790 if MainScreen.ModalSelectDlg.Result = adAll then 796 791 Price := opAllTech 797 792 else 798 Price := OpTech + M odalSelectDlg.result;793 Price := OpTech + MainScreen.ModalSelectDlg.Result; 799 794 end; 800 795 opAllModel: 801 796 begin // choose model 802 M odalSelectDlg.ShowNewContent(wmModal, kChooseEModel);803 if M odalSelectDlg.result < 0 then804 exit;805 if M odalSelectDlg.result = mixAll then797 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kChooseEModel); 798 if MainScreen.ModalSelectDlg.Result < 0 then 799 Exit; 800 if MainScreen.ModalSelectDlg.Result = mixAll then 806 801 Price := opAllModel 807 802 else 808 Price := OpModel + MyRO.EnemyModel[M odalSelectDlg.result].mix;803 Price := OpModel + MyRO.EnemyModel[MainScreen.ModalSelectDlg.Result].mix; 809 804 end; 810 805 opTreaty: 811 806 begin 812 if MyRO.Treaty[DipMem[ me].pContact] < trPeace then807 if MyRO.Treaty[DipMem[Me].pContact] < trPeace then 813 808 Price := opTreaty + trPeace 814 809 else 815 Price := opTreaty + MyRO.Treaty[DipMem[ me].pContact] + 1;810 Price := opTreaty + MyRO.Treaty[DipMem[Me].pContact] + 1; 816 811 end; 817 812 { opLowTreaty: 818 813 begin 819 if MyRO.Treaty[DipMem[ me].pContact]=trNone then Price:=opTreaty+trCeaseFire820 else Price:=opTreaty+MyRO.Treaty[DipMem[ me].pContact]-1;814 if MyRO.Treaty[DipMem[Me].pContact]=trNone then Price:=opTreaty+trCeaseFire 815 else Price:=opTreaty+MyRO.Treaty[DipMem[Me].pContact]-1; 821 816 end } 822 817 end; … … 832 827 procedure TNegoDlg.OfferClick(Sender: TObject); 833 828 var 834 a, i, max: integer;835 Price: cardinal;836 begin 837 if (Page <> History[ me].n) or (ClientMode = scDipCancelTreaty) or829 A, I, Max: Integer; 830 Price: Cardinal; 831 begin 832 if (Page <> History[Me].N) or (ClientMode = scDipCancelTreaty) or 838 833 (ClientMode = scDipBreak) then 839 exit;834 Exit; 840 835 if Delivers[TButtonN(Sender).Tag and $FF] <> $FFFFFFFF then 841 836 Price := $FFFFFFFF // toggle off … … 845 840 begin 846 841 SimpleMessage(Phrases.Lookup('MAX2OFFERS')); 847 exit842 Exit; 848 843 end; 849 844 Price := ButtonPrice[TButtonN(Sender).Tag and $FF]; 850 845 if not(Price shr 24 in MyAllowed) then 851 exit;846 Exit; 852 847 case Price of 853 848 opCivilReport, opMilReport: 854 inc(Price, me shl 16 + MyRO.Turn); // !!! choose player and year!849 Inc(Price, Me shl 16 + MyRO.Turn); // !!! choose player and year! 855 850 opMoney: 856 851 begin // choose amount … … 860 855 InputDlg.ShowModal; 861 856 if InputDlg.ModalResult <> mrOK then 862 exit;863 val(InputDlg.EInput.Text, a, i);864 if ( i <> 0) or (a <= 0) or (a>= MaxMoneyPrice) then865 exit;866 if (Price = opMoney) and ( a> MyRO.Money) then867 a:= MyRO.Money;868 inc(Price, a);857 Exit; 858 val(InputDlg.EInput.Text, A, I); 859 if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then 860 Exit; 861 if (Price = opMoney) and (A > MyRO.Money) then 862 A := MyRO.Money; 863 Inc(Price, A); 869 864 end; 870 865 opShipParts: 871 866 begin // choose type and number 872 M odalSelectDlg.ShowNewContent(wmModal, kShipPart);873 if M odalSelectDlg.result < 0 then874 exit;875 inc(Price, ModalSelectDlg.result shl 16);876 max := MyRO.Ship[me].Parts[ModalSelectDlg.result];867 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kShipPart); 868 if MainScreen.ModalSelectDlg.Result < 0 then 869 Exit; 870 Inc(Price, MainScreen.ModalSelectDlg.Result shl 16); 871 Max := MyRO.Ship[Me].Parts[MainScreen.ModalSelectDlg.Result]; 877 872 InputDlg.Caption := Phrases.Lookup('TITLE_NUMBER'); 878 873 InputDlg.EInput.Text := ''; … … 880 875 InputDlg.ShowModal; 881 876 if InputDlg.ModalResult <> mrOK then 882 exit;883 val(InputDlg.EInput.Text, a, i);884 if ( i <> 0) or (a<= 0) then885 exit;886 if a > max then887 a := max;888 if a> MaxShipPartPrice then889 a:= MaxShipPartPrice;890 inc(Price, a)877 Exit; 878 val(InputDlg.EInput.Text, A, I); 879 if (I <> 0) or (A <= 0) then 880 Exit; 881 if A > Max then 882 A := Max; 883 if A > MaxShipPartPrice then 884 A := MaxShipPartPrice; 885 Inc(Price, A); 891 886 end; 892 887 opAllTech: 893 888 begin // choose technology 894 M odalSelectDlg.ShowNewContent(wmModal, kChooseTech);895 if M odalSelectDlg.result < 0 then896 exit;897 if M odalSelectDlg.result = adAll then889 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kChooseTech); 890 if MainScreen.ModalSelectDlg.Result < 0 then 891 Exit; 892 if MainScreen.ModalSelectDlg.Result = adAll then 898 893 Price := opAllTech 899 894 else 900 Price := OpTech + M odalSelectDlg.result;895 Price := OpTech + MainScreen.ModalSelectDlg.Result; 901 896 end; 902 897 opAllModel: 903 898 begin // choose model 904 M odalSelectDlg.ShowNewContent(wmModal, kChooseModel);905 if M odalSelectDlg.result < 0 then906 exit;907 if M odalSelectDlg.result = mixAll then899 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kChooseModel); 900 if MainScreen.ModalSelectDlg.Result < 0 then 901 Exit; 902 if MainScreen.ModalSelectDlg.Result = mixAll then 908 903 Price := opAllModel 909 904 else 910 Price := OpModel + M odalSelectDlg.result905 Price := OpModel + MainScreen.ModalSelectDlg.Result; 911 906 end; 912 907 opTreaty: 913 908 begin 914 if MyRO.Treaty[DipMem[ me].pContact] < trPeace then909 if MyRO.Treaty[DipMem[Me].pContact] < trPeace then 915 910 Price := opTreaty + trPeace 916 911 else 917 Price := opTreaty + MyRO.Treaty[DipMem[ me].pContact] + 1;912 Price := opTreaty + MyRO.Treaty[DipMem[Me].pContact] + 1; 918 913 end; 919 914 { opLowTreaty: 920 915 begin 921 if MyRO.Treaty[DipMem[ me].pContact]=trNone then Price:=opTreaty+trCeaseFire922 else Price:=opTreaty+MyRO.Treaty[DipMem[ me].pContact]-1;916 if MyRO.Treaty[DipMem[Me].pContact]=trNone then Price:=opTreaty+trCeaseFire 917 else Price:=opTreaty+MyRO.Treaty[DipMem[Me].pContact]-1; 923 918 end } 924 919 end; … … 934 929 procedure TNegoDlg.FastBtnClick(Sender: TObject); 935 930 var 936 NewCommand: cardinal;937 begin 938 if Page <> History[ me].nthen939 exit;931 NewCommand: Cardinal; 932 begin 933 if Page <> History[Me].N then 934 Exit; 940 935 NewCommand := TButtonN(Sender).Tag and $FF + scDipStart; 941 936 if not(NewCommand - scDipStart in CommandAllowed) then 942 exit;937 Exit; 943 938 if (NewCommand = scDipCancelTreaty) and 944 (MyRO.Turn < MyRO.LastCancelTreaty[DipMem[ me].pContact] + CancelTreatyTurns)939 (MyRO.Turn < MyRO.LastCancelTreaty[DipMem[Me].pContact] + CancelTreatyTurns) 945 940 then 946 941 begin 947 942 SimpleMessage(Phrases.Lookup('CANCELTREATYRUSH')); 948 exit;943 Exit; 949 944 end; 950 945 if (NewCommand = scDipOffer) and ((ClientMode = scDipCancelTreaty) or -
branches/highdpi/LocalPlayer/PVSB.pas
r349 r465 5 5 6 6 uses 7 UDpiControls, {$IFDEF WINDOWS} 8 Windows, 9 {$ENDIF} 7 UDpiControls, {$IFDEF WINDOWS}Windows,{$ENDIF} 10 8 Classes, Controls, Forms, LCLIntf, LCLType, LMessages, Messages, SysUtils, 11 9 StdCtrls, Math; … … 32 30 procedure Init(Max, PageSize: Integer); 33 31 procedure SetPos(Pos: Integer); 34 function Process(const Msg: TMessage): boolean;32 function Process(const Msg: TMessage): Boolean; 35 33 function ProcessMouseWheel(Delta: Integer): Boolean; 36 procedure Show(Visible: boolean);34 procedure Show(Visible: Boolean); 37 35 procedure EndSB; 38 36 procedure SetBorderSpacing(Top, Right, Bottom: Integer); … … 65 63 end; 66 64 67 function TPVScrollBar.Process(const Msg: TMessage): boolean;65 function TPVScrollBar.Process(const Msg: TMessage): Boolean; 68 66 var 69 NewPos: integer;67 NewPos: Integer; 70 68 begin 71 69 if Max < ScrollBar.PageSize then 72 result := false70 Result := False 73 71 else 74 72 begin 75 73 if (Msg.wParam and $ffff) in [SB_THUMBPOSITION, SB_THUMBTRACK] then 76 74 begin 77 result := ((Msg.wParam shr 16) and $ffff) <> ScrollBar.Position;75 Result := ((Msg.wParam shr 16) and $ffff) <> ScrollBar.Position; 78 76 ScrollBar.Position := (Msg.wParam shr 16) and $ffff; 79 77 end else begin … … 94 92 if NewPos > Max - ScrollBar.PageSize + 1 then 95 93 NewPos := Max - ScrollBar.PageSize + 1; 96 result := NewPos <> ScrollBar.Position;94 Result := NewPos <> ScrollBar.Position; 97 95 if (NewPos <> ScrollBar.Position) or ((Msg.wParam and $ffff) = SB_ENDSCROLL) then 98 96 begin … … 105 103 function TPVScrollBar.ProcessMouseWheel(Delta: Integer): Boolean; 106 104 var 107 NewPos: integer;105 NewPos: Integer; 108 106 begin 109 107 if Max < ScrollBar.PageSize then Result := False … … 120 118 end; 121 119 122 procedure TPVScrollBar.Show(Visible: boolean);120 procedure TPVScrollBar.Show(Visible: Boolean); 123 121 begin 124 122 if not Visible or (Max < ScrollBar.PageSize) then -
branches/highdpi/LocalPlayer/Rates.pas
r361 r465 5 5 6 6 uses 7 UDpiControls, Protocol, ScreenTools, BaseWin, LCLIntf, LCLType, 8 9 SysUtils, Classes, Graphics, Controls, Forms, 10 ButtonB, ButtonC; 7 UDpiControls, Protocol, ScreenTools, BaseWin, LCLIntf, LCLType, SysUtils, Classes, Graphics, 8 Controls, Forms, ButtonB, ButtonC; 11 9 12 10 type … … 23 21 public 24 22 procedure OffscreenPaint; override; 25 procedure ShowNewContent(NewMode: integer); 26 end; 27 28 var 29 RatesDlg: TRatesDlg; 23 procedure ShowNewContent(NewMode: TWindowMode); 24 end; 25 30 26 31 27 implementation … … 47 43 procedure TRatesDlg.OffscreenPaint; 48 44 var 49 p, x, y, current, max, i: integer;50 s, s1: string;45 P, X, Y, current, Max, I: Integer; 46 S, s1: string; 51 47 begin 52 48 if (OffscreenUser <> nil) and (OffscreenUser <> self) then … … 65 61 BtnFrame(Offscreen.Canvas, CloseBtn.BoundsRect, MainTexture); 66 62 Offscreen.Canvas.Font.Assign(UniFont[ftCaption]); 67 s:= Phrases.Lookup('TITLE_RATES');63 S := Phrases.Lookup('TITLE_RATES'); 68 64 RisedTextOut(Offscreen.Canvas, 69 (ClientWidth - BiColorTextWidth(Offscreen.Canvas, s)) div 2 - 1, 7, s);70 71 if MyRO.Wonder[woLiberty].EffectiveOwner = me then72 s:= Phrases.Lookup('NORATES')73 else 74 s:= Phrases.Lookup('RATES');65 (ClientWidth - BiColorTextWidth(Offscreen.Canvas, S)) div 2 - 1, 7, S); 66 67 if MyRO.Wonder[woLiberty].EffectiveOwner = Me then 68 S := Phrases.Lookup('NORATES') 69 else 70 S := Phrases.Lookup('RATES'); 75 71 Offscreen.Canvas.Font.Assign(UniFont[ftNormal]); 76 p := pos('\', s);77 if p= 0 then78 RisedTextOut(Offscreen.Canvas, (ClientWidth - BiColorTextWidth(Canvas, s))79 div 2, 114, s)80 else 81 begin 82 s1 := copy(s, 1, p- 1);72 P := Pos('\', S); 73 if P = 0 then 74 RisedTextOut(Offscreen.Canvas, (ClientWidth - BiColorTextWidth(Canvas, S)) 75 div 2, 114, S) 76 else 77 begin 78 s1 := Copy(S, 1, P - 1); 83 79 RisedTextOut(Offscreen.Canvas, 84 80 (ClientWidth - BiColorTextWidth(Offscreen.Canvas, s1)) div 2, 85 81 114 - MessageLineSpacing div 2, s1); 86 s1 := copy(s, p+ 1, 255);82 s1 := Copy(S, P + 1, 255); 87 83 RisedTextOut(Offscreen.Canvas, 88 84 (ClientWidth - BiColorTextWidth(Offscreen.Canvas, s1)) div 2, … … 91 87 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 92 88 93 if MyRO.Wonder[woLiberty].EffectiveOwner = me then89 if MyRO.Wonder[woLiberty].EffectiveOwner = Me then 94 90 begin 95 91 GlowFrame(Offscreen, ClientWidth div 2 - xSizeBig div 2, 52, xSizeBig, 96 ySizeBig, Tribe[ me].Color);97 DpiBit Canvas(Offscreen.Canvas, ClientWidth div 2 - xSizeBig div 2, 52,92 ySizeBig, Tribe[Me].Color); 93 DpiBitBltCanvas(Offscreen.Canvas, ClientWidth div 2 - xSizeBig div 2, 52, 98 94 xSizeBig, ySizeBig, BigImp.Canvas, (woLiberty mod 7) * xSizeBig, 99 95 (woLiberty div 7 + SystemIconLines) * ySizeBig); … … 103 99 // ImageOp_CBC(Offscreen,Templates,260,40,145,112,36,36,$404000,$8B8BEB); 104 100 105 s:= Phrases.Lookup('SCIENCE');106 RisedTextOut(Offscreen.Canvas, 107 16 + 120 - BiColorTextWidth(Offscreen.Canvas, s), 44, s);108 s:= Format('%d%%', [100 - MyRO.TaxRate - MyRO.LuxRate]);109 RisedTextOut(Offscreen.Canvas, 110 16 + 120 - BiColorTextWidth(Offscreen.Canvas, s), 60, s);101 S := Phrases.Lookup('SCIENCE'); 102 RisedTextOut(Offscreen.Canvas, 103 16 + 120 - BiColorTextWidth(Offscreen.Canvas, S), 44, S); 104 S := Format('%d%%', [100 - MyRO.TaxRate - MyRO.LuxRate]); 105 RisedTextOut(Offscreen.Canvas, 106 16 + 120 - BiColorTextWidth(Offscreen.Canvas, S), 60, S); 111 107 // PaintProgressBar(Offscreen.Canvas,2,16,81,(100-MyRO.LuxRate-MyRO.TaxRate)*120 div 100,0,120,MainTexture); 112 108 113 109 // reverse progress bar for science 114 x:= 16;115 y:= 81;110 X := 16; 111 Y := 81; 116 112 current := (100 - MyRO.LuxRate - MyRO.TaxRate) * 120 div 100; 117 max := 120;118 Frame(Offscreen.Canvas, x - 1, y - 1, x + max, y+ 7, $000000, $000000);119 RFrame(Offscreen.Canvas, x - 2, y - 2, x + max + 1, y+ 8,113 Max := 120; 114 Frame(Offscreen.Canvas, X - 1, Y - 1, X + Max, Y + 7, $000000, $000000); 115 RFrame(Offscreen.Canvas, X - 2, Y - 2, X + Max + 1, Y + 8, 120 116 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 121 117 with Offscreen.Canvas do 122 118 begin 123 for i:= 0 to current div 8 - 1 do124 DpiBit Canvas(Offscreen.Canvas, x + max - 8 - i * 8, y, 8, 7,119 for I := 0 to current div 8 - 1 do 120 DpiBitBltCanvas(Offscreen.Canvas, X + Max - 8 - I * 8, Y, 8, 7, 125 121 HGrSystem.Data.Canvas, 104, 9 + 8 * 2); 126 DpiBit Canvas(Offscreen.Canvas, x + max - current, y, current - 8 * (current div 8), 7,122 DpiBitBltCanvas(Offscreen.Canvas, X + Max - current, Y, current - 8 * (current div 8), 7, 127 123 HGrSystem.Data.Canvas, 104, 9 + 8 * 2); 128 124 Brush.Color := $000000; 129 FillRect(Rect( x, y, x + max - current, y+ 7));125 FillRect(Rect(X, Y, X + Max - current, Y + 7)); 130 126 Brush.Style := bsClear; 131 127 end; 132 128 133 129 RisedTextOut(Offscreen.Canvas, 16 + 160, 44, Phrases.Lookup('LUX')); 134 s:= Format('%d%%', [MyRO.LuxRate]);135 RisedTextOut(Offscreen.Canvas, 136 16 + 160 { +120-BiColorTextWidth(Offscreen.Canvas,s) } , 60, s);130 S := Format('%d%%', [MyRO.LuxRate]); 131 RisedTextOut(Offscreen.Canvas, 132 16 + 160 { +120-BiColorTextWidth(Offscreen.Canvas,s) } , 60, S); 137 133 PaintProgressBar(Offscreen.Canvas, 5, 16 + 160, 81, 138 134 MyRO.LuxRate * 120 div 100, 0, 120, MainTexture); … … 145 141 MainTexture.ColorBevelLight); 146 142 RisedTextOut(Offscreen.Canvas, 16 + 80, 164, Phrases.Lookup('TAXRATE')); 147 s:= Format('%d%%', [MyRO.TaxRate]);143 S := Format('%d%%', [MyRO.TaxRate]); 148 144 RisedTextOut(Offscreen.Canvas, 149 16 + 80 { +120-BiColorTextWidth(Offscreen.Canvas,s) } , 180, s);145 16 + 80 { +120-BiColorTextWidth(Offscreen.Canvas,s) } , 180, S); 150 146 PaintProgressBar(Offscreen.Canvas, 0, 16 + 80, 201, 151 147 MyRO.TaxRate * 120 div 100, 0, 120, MainTexture); … … 157 153 end; 158 154 159 procedure TRatesDlg.ShowNewContent(NewMode: integer);155 procedure TRatesDlg.ShowNewContent(NewMode: TWindowMode); 160 156 begin 161 157 inherited ShowNewContent(NewMode); … … 164 160 procedure TRatesDlg.FormShow(Sender: TObject); 165 161 begin 166 if MyRO.Wonder[woLiberty].EffectiveOwner = me then 167 begin 168 ScienceBtn.Visible := false; 169 LuxBtn.Visible := false; 162 Caption := Phrases.Lookup('TITLE_RATES'); 163 if MyRO.Wonder[woLiberty].EffectiveOwner = Me then 164 begin 165 ScienceBtn.Visible := False; 166 LuxBtn.Visible := False; 170 167 end 171 168 else 172 169 begin 173 ScienceBtn.Visible := true;174 LuxBtn.Visible := true;170 ScienceBtn.Visible := True; 171 LuxBtn.Visible := True; 175 172 end; 176 173 OffscreenPaint; … … 184 181 procedure TRatesDlg.TaxLuxBtnClick(Sender: TObject); 185 182 var 186 NewTax, NewLux: integer;183 NewTax, NewLux: Integer; 187 184 begin 188 185 NewTax := MyRO.TaxRate div 10; … … 191 188 begin 192 189 if NewTax < 10 then 193 inc(NewTax);190 Inc(NewTax); 194 191 if NewTax + NewLux > 10 then 195 dec(NewLux);192 Dec(NewLux); 196 193 end 197 194 else if (Sender = TaxDownBtn) and (NewTax > 0) then 198 dec(NewTax)195 Dec(NewTax) 199 196 else if (Sender = ScienceBtn) and (NewLux > 0) then 200 dec(NewLux)197 Dec(NewLux) 201 198 else if (Sender = LuxBtn) and (NewLux + NewTax < 100) then 202 inc(NewLux);203 if Server(sSetRates, me, NewTax + NewLux shl 4, nil^) <> eNotChanged then199 Inc(NewLux); 200 if Server(sSetRates, Me, NewTax + NewLux shl 4, nil^) <> eNotChanged then 204 201 begin 205 202 CityOptimizer_BeginOfTurn; 206 203 SmartUpdateContent; 207 MainScreen.UpdateViews( true);204 MainScreen.UpdateViews(True); 208 205 end; 209 206 end; -
branches/highdpi/LocalPlayer/Select.lfm
r246 r465 1 1 object ListDlg: TListDlg 2 2 Left = 290 3 Height = 262 3 4 Top = 145 5 Width = 381 4 6 BorderIcons = [] 5 7 BorderStyle = bsNone … … 7 9 ClientWidth = 381 8 10 Color = clBtnFace 9 Font.Charset = DEFAULT_CHARSET11 DesignTimePPI = 144 10 12 Font.Color = clWindowText 11 Font.Height = - 1313 Font.Height = -20 12 14 Font.Name = 'MS Sans Serif' 13 Font.Style = []14 15 FormStyle = fsStayOnTop 15 16 OnCloseQuery = FormCloseQuery … … 17 18 OnDestroy = FormDestroy 18 19 OnKeyDown = FormKeyDown 19 OnMouseWheel = FormMouseWheel20 20 OnMouseDown = PaintBox1MouseDown 21 21 OnMouseMove = PaintBox1MouseMove 22 OnMouseWheel = FormMouseWheel 22 23 OnPaint = FormPaint 23 24 OnShow = FormShow 24 PixelsPerInch = 9625 LCLVersion = '2.2.2.0' 25 26 Scaled = False 26 27 object CloseBtn: TButtonB 27 28 Left = 343 29 Height = 25 28 30 Top = 6 29 31 Width = 25 30 Height = 2531 32 Down = False 32 33 Permanent = False … … 37 38 Tag = 2 38 39 Left = 344 40 Height = 25 39 41 Top = 224 40 42 Width = 25 41 Height = 2542 43 Down = False 43 44 Permanent = True … … 48 49 Tag = 1 49 50 Left = 312 51 Height = 25 50 52 Top = 224 51 53 Width = 25 52 Height = 2553 54 Down = False 54 55 Permanent = True … … 58 59 object Layer0Btn: TButtonB 59 60 Left = 280 61 Height = 25 60 62 Top = 224 61 63 Width = 25 62 Height = 2563 64 Down = False 64 65 Permanent = True … … 68 69 object ToggleBtn: TButtonB 69 70 Left = 13 71 Height = 25 70 72 Top = 6 71 73 Width = 25 72 Height = 2573 74 Down = False 74 75 Permanent = False -
branches/highdpi/LocalPlayer/Select.pas
r378 r465 5 5 6 6 uses 7 UDpiControls, Protocol, ClientTools, Term, ScreenTools, IsoEngine, PVSB, BaseWin,7 UDpiControls, Protocol, ClientTools, ScreenTools, PVSB, BaseWin, 8 8 LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, 9 9 ExtCtrls, ButtonB, ButtonBase, Menus, Types; … … 27 27 ToggleBtn: TButtonB; 28 28 Popup: TDpiPopupMenu; 29 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 29 30 procedure FormMouseWheel(Sender: TObject; Shift: TShiftState; 30 31 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); 31 32 procedure PaintBox1MouseMove(Sender: TObject; Shift: TShiftState; 32 x, y: integer);33 X, Y: Integer); 33 34 procedure FormCreate(Sender: TObject); 34 35 procedure FormDestroy(Sender: TObject); 35 36 procedure PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; 36 Shift: TShiftState; x, y: integer);37 Shift: TShiftState; X, Y: Integer); 37 38 procedure FormPaint(Sender: TObject); 38 39 procedure CloseBtnClick(Sender: TObject); 39 procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);40 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); 40 41 procedure FormShow(Sender: TObject); 41 42 procedure ModeBtnClick(Sender: TObject); 42 43 procedure ToggleBtnClick(Sender: TObject); 43 procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);44 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 44 45 procedure PlayerClick(Sender: TObject); 45 46 private … … 49 50 cixProject: Integer; 50 51 pView: Integer; 51 Sel : Integer;52 Selected: Integer; 52 53 DispLines: Integer; 53 54 Layer: Integer; … … 55 56 TechNameSpace: Integer; 56 57 ScienceNation: Integer; 57 sb: TPVScrollbar; 58 Lines, FirstShrinkedLine: array [0 .. MaxLayer - 1] of integer; 59 code: array [0 .. MaxLayer - 1, 0 .. 4095] of integer; 60 Column: array [0 .. nPl - 1] of integer; 58 ScrollBar: TPVScrollbar; 59 Lines: array [0 .. MaxLayer - 1] of Integer; 60 FirstShrinkedLine: array [0 .. MaxLayer - 1] of Integer; 61 Code: array [0 .. MaxLayer - 1, 0 .. 4095] of Integer; 62 Column: array [0 .. nPl - 1] of Integer; 61 63 Closable: Boolean; 62 64 MultiPage: Boolean; … … 64 66 procedure ScrollBarUpdate(Sender: TObject); 65 67 procedure InitLines; 66 procedure line(ca: TDpiCanvas; l: integer; NonText, lit: boolean);67 function RenameCity(cix: integer): boolean;68 function RenameModel(mix: integer): boolean;68 procedure Line(ca: TDpiCanvas; L: Integer; NonText, lit: Boolean); 69 function RenameCity(cix: Integer): Boolean; 70 function RenameModel(mix: Integer): Boolean; 69 71 procedure OnScroll(var Msg: TMessage); message WM_VSCROLL; 70 72 procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE; 71 73 public 72 result: integer;73 function OnlyChoice(TestKind: TListKind): integer;74 Result: Integer; 75 function OnlyChoice(TestKind: TListKind): Integer; 74 76 // -2=empty, -1=ambiguous, other=only choice 75 77 procedure OffscreenPaint; override; 76 procedure ShowNewContent(NewMode: integer; ListKind: TListKind);77 procedure ShowNewContent_CityProject(NewMode , cix: integer);78 procedure ShowNewContent_MilReport(NewMode , p: integer);78 procedure ShowNewContent(NewMode: TWindowMode; ListKind: TListKind); 79 procedure ShowNewContent_CityProject(NewMode: TWindowMode; cix: Integer); 80 procedure ShowNewContent_MilReport(NewMode: TWindowMode; P: Integer); 79 81 procedure EcoChange; 80 82 procedure TechChange; … … 90 92 adAll = $10000; 91 93 92 var93 ListDlg: TListDlg;94 ModalSelectDlg: TModalSelectDlg;95 96 94 97 95 implementation 98 96 99 97 uses 100 CityScreen, Help, UnitStat, Tribes, Inp;98 Term, CityScreen, Help, UnitStat, Tribes, Inp, CmdList; 101 99 102 100 {$R *.lfm} … … 111 109 inherited; 112 110 Canvas.Font.Assign(UniFont[ftNormal]); 113 sb:= TPVScrollbar.Create(Self);114 sb.SetBorderSpacing(36, 10, 36);115 sb.OnUpdate := ScrollBarUpdate;111 ScrollBar := TPVScrollbar.Create(Self); 112 ScrollBar.SetBorderSpacing(36, 10, 36); 113 ScrollBar.OnUpdate := ScrollBarUpdate; 116 114 InitButtons; 117 115 Kind := kMission; … … 127 125 procedure TListDlg.FormDestroy(Sender: TObject); 128 126 begin 129 FreeAndNil( sb);127 FreeAndNil(ScrollBar); 130 128 FreeAndNil(ScienceNationDotBuffer); 131 129 end; … … 133 131 procedure TListDlg.CloseBtnClick(Sender: TObject); 134 132 begin 135 Closable := true;133 Closable := True; 136 134 Close; 137 135 end; 138 136 139 procedure TListDlg.FormCloseQuery(Sender: TObject; var CanClose: boolean);137 procedure TListDlg.FormCloseQuery(Sender: TObject; var CanClose: Boolean); 140 138 begin 141 139 CanClose := Closable or not(Kind in MustChooseKind); … … 145 143 begin 146 144 { TODO: Handled by MouseWheel event 147 if sb.Process(Msg) then begin148 Sel := -2;149 SmartUpdateContent( true);145 if ScrollBar.Process(Msg) then begin 146 Selected := -2; 147 SmartUpdateContent(True); 150 148 end; 151 149 } … … 154 152 procedure TListDlg.OnMouseLeave(var Msg: TMessage); 155 153 begin 156 if not Closable and (Sel <> -2) then157 begin 158 line(Canvas, Sel, false, false);159 Sel := -2;154 if not Closable and (Selected <> -2) then 155 begin 156 Line(Canvas, Selected, False, False); 157 Selected := -2; 160 158 end; 161 159 end; … … 163 161 procedure TListDlg.FormPaint(Sender: TObject); 164 162 var 165 s: string;163 S: string; 166 164 begin 167 165 inherited; 168 166 Canvas.Font.Assign(UniFont[ftNormal]); 169 if Sel <> -2 then170 line(Canvas, Sel, false, true);171 s:= '';167 if Selected <> -2 then 168 Line(Canvas, Selected, False, True); 169 S := ''; 172 170 if (Kind = kAdvance) and (MyData.FarTech <> adNone) then 173 s:= Format(Phrases.Lookup('TECHFOCUS'),171 S := Format(Phrases.Lookup('TECHFOCUS'), 174 172 [Phrases.Lookup('ADVANCES', MyData.FarTech)]) 175 173 else if Kind = kModels then 176 s := Tribe[me].TPhrase('SHORTNAME')174 S := Tribe[Me].TPhrase('SHORTNAME') 177 175 else if Kind = kEModels then 178 s:= Tribe[pView].TPhrase('SHORTNAME') + ' (' +176 S := Tribe[pView].TPhrase('SHORTNAME') + ' (' + 179 177 TurnToString(MyRO.EnemyReport[pView].TurnOfMilReport) + ')'; 180 if s<> '' then178 if S <> '' then 181 179 LoweredTextOut(Canvas, -1, MainTexture, 182 (ClientWidth - BiColorTextWidth(Canvas, s)) div 2, 31, s);180 (ClientWidth - BiColorTextWidth(Canvas, S)) div 2, 31, S); 183 181 if not MultiPage and (Kind in [kProject, kAdvance, kFarAdvance]) and not Phrases2FallenBackToEnglish 184 182 then 185 183 begin 186 s:= Phrases2.Lookup('SHIFTCLICK');184 S := Phrases2.Lookup('SHIFTCLICK'); 187 185 LoweredTextOut(Canvas, -2, MainTexture, 188 (ClientWidth - BiColorTextWidth(Canvas, s)) div 2, ClientHeight - 29, s);189 end; 190 end; 191 192 procedure TListDlg. line(ca: TDpiCanvas; l: integer; NonText, lit: boolean);186 (ClientWidth - BiColorTextWidth(Canvas, S)) div 2, ClientHeight - 29, S); 187 end; 188 end; 189 190 procedure TListDlg.Line(ca: TDpiCanvas; L: Integer; NonText, lit: Boolean); 193 191 // paint a line 194 192 195 procedure DisplayProject( x, y, pix: integer);193 procedure DisplayProject(X, Y, pix: Integer); 196 194 begin 197 195 if pix and (cpType or cpImp) = 0 then 198 with Tribe[ me].ModelPicture[pix and cpIndex] do199 Sprite( offscreen, HGr, x, y, 64, 48, pix mod 10 * 65 + 1,196 with Tribe[Me].ModelPicture[pix and cpIndex] do 197 Sprite(Offscreen, HGr, X, Y, 64, 48, pix mod 10 * 65 + 1, 200 198 pix div 10 * 49 + 1) 201 199 else 202 200 begin 203 Frame( offscreen.Canvas, x + (16 - 1), y + (16 - 2), x+ (16 + xSizeSmall),204 y+ (16 - 1 + ySizeSmall), MainTexture.ColorBevelLight,201 Frame(Offscreen.Canvas, X + (16 - 1), Y + (16 - 2), X + (16 + xSizeSmall), 202 Y + (16 - 1 + ySizeSmall), MainTexture.ColorBevelLight, 205 203 MainTexture.ColorBevelShade); 206 204 if pix and cpType = 0 then 207 205 if (pix and cpIndex = imPalace) and (MyRO.Government <> gAnarchy) then 208 DpiBit Canvas(offscreen.Canvas, x + 16, y+ (16 - 1), xSizeSmall,206 DpiBitBltCanvas(Offscreen.Canvas, X + 16, Y + (16 - 1), xSizeSmall, 209 207 ySizeSmall, SmallImp.Canvas, (MyRO.Government - 1) * 210 208 xSizeSmall, ySizeSmall) 211 209 else 212 DpiBit Canvas(offscreen.Canvas, x + 16, y+ (16 - 1), xSizeSmall,210 DpiBitBltCanvas(Offscreen.Canvas, X + 16, Y + (16 - 1), xSizeSmall, 213 211 ySizeSmall, SmallImp.Canvas, pix and cpIndex mod 7 * 214 212 xSizeSmall, (pix and cpIndex + SystemIconLines * 7) div 7 * 215 213 ySizeSmall) 216 214 else 217 DpiBit Canvas(offscreen.Canvas, x + 16, y+ (16 - 1), xSizeSmall,215 DpiBitBltCanvas(Offscreen.Canvas, X + 16, Y + (16 - 1), xSizeSmall, 218 216 ySizeSmall, SmallImp.Canvas, (3 + pix and cpIndex) * 219 217 xSizeSmall, 0); … … 221 219 end; 222 220 223 procedure ReplaceText( x, y, Color: integer; s: string);221 procedure ReplaceText(X, Y, Color: Integer; S: string); 224 222 var 225 223 TextSize: TSize; … … 227 225 if ca = Canvas then 228 226 begin 229 TextSize.cx := BiColorTextWidth(ca, s);230 TextSize.cy := ca.TextHeight( s);231 if y+ TextSize.cy >= TitleHeight + InnerHeight then232 TextSize.cy := TitleHeight + InnerHeight - y;233 Fill(ca, x, y, TextSize.cx, TextSize.cy, (Maintexture.Width - ClientWidth)227 TextSize.cx := BiColorTextWidth(ca, S); 228 TextSize.cy := ca.TextHeight(S); 229 if Y + TextSize.cy >= TitleHeight + InnerHeight then 230 TextSize.cy := TitleHeight + InnerHeight - Y; 231 Fill(ca, X, Y, TextSize.cx, TextSize.cy, (Maintexture.Width - ClientWidth) 234 232 div 2, (Maintexture.Height - ClientHeight) div 2); 235 233 end; 236 LoweredTextOut(ca, Color, MainTexture, x, y, s);234 LoweredTextOut(ca, Color, MainTexture, X, Y, S); 237 235 end; 238 236 239 237 var 240 icon, ofs, x, y, y0, lix, i, j, TextColor, Available, first, test,241 FutureCount, growth, TrueFood, TrueProd: integer;238 icon, ofs, X, Y, y0, lix, I, J, TextColor, Available, first, Test, 239 FutureCount, growth, TrueFood, TrueProd: Integer; 242 240 CityReport: TCityReportNew; 243 241 mox: ^TModelInfo; 244 s, number: string;245 CanGrow: boolean;246 begin 247 lix := code[Layer, sb.Position + l];248 y0 := 2 + ( l+ 1) * LineDistance;249 if sb.Position + l>= FirstShrinkedLine[Layer] then250 ofs := ( sb.Position + l- FirstShrinkedLine[Layer]) and 1 * 33242 S, number: string; 243 CanGrow: Boolean; 244 begin 245 lix := Code[Layer, ScrollBar.Position + L]; 246 y0 := 2 + (L + 1) * LineDistance; 247 if ScrollBar.Position + L >= FirstShrinkedLine[Layer] then 248 ofs := (ScrollBar.Position + L - FirstShrinkedLine[Layer]) and 1 * 33 251 249 else { if FirstShrinkedLine[Layer]<Lines[Layer] then } 252 250 ofs := 33; … … 255 253 with MyCity[lix] do 256 254 begin 257 x:= 104 - 76;258 y:= y0;255 X := 104 - 76; 256 Y := y0; 259 257 if ca = Canvas then 260 258 begin 261 x := x+ SideFrame;262 y := y+ TitleHeight;259 X := X + SideFrame; 260 Y := Y + TitleHeight; 263 261 end; 264 262 if lit then … … 266 264 else 267 265 TextColor := -1; 268 s:= CityName(ID);269 while BiColorTextWidth(ca, s) > CityNameSpace do270 delete(s, length(s), 1);271 ReplaceText( x + 15, y, TextColor, s);266 S := CityName(ID); 267 while BiColorTextWidth(ca, S) > CityNameSpace do 268 Delete(S, Length(S), 1); 269 ReplaceText(X + 15, Y, TextColor, S); 272 270 273 271 if NonText then 274 with offscreen.Canvas do272 with Offscreen.Canvas do 275 273 begin // city size 276 brush.Color := $000000;277 fillrect(rect(x - 4 - 11, y + 1, x - 4 + 13, y+ 21));278 brush.Color := $FFFFFF;279 fillrect(rect(x - 4 - 12, y, x - 4 + 12, y+ 20));280 brush.style := bsClear;274 Brush.Color := $000000; 275 FillRect(rect(X - 4 - 11, Y + 1, X - 4 + 13, Y + 21)); 276 Brush.Color := $FFFFFF; 277 FillRect(rect(X - 4 - 12, Y, X - 4 + 12, Y + 20)); 278 Brush.style := bsClear; 281 279 Font.Color := $000000; 282 s := inttostr(MyCity[lix].Size);283 TextOut( x - 4 - textwidth(s) div 2, y, s);280 S := IntToStr(MyCity[lix].Size); 281 TextOut(X - 4 - textwidth(S) div 2, Y, S); 284 282 end; 285 283 … … 287 285 begin 288 286 first := -1; 289 for j:= 0 to nCityEventPriority - 1 do290 if (Flags and CityRepMask and CityEventPriority[ j] <> 0) then291 begin 292 first := j;293 Break 287 for J := 0 to nCityEventPriority - 1 do 288 if (Flags and CityRepMask and CityEventPriority[J] <> 0) then 289 begin 290 first := J; 291 Break; 294 292 end; 295 293 if first >= 0 then 296 294 begin 297 i:= 0;298 test := 1;299 while test < CityEventPriority[first] do300 begin 301 inc(i);302 inc(test, test)303 end; 304 s := CityEventName(i);295 I := 0; 296 Test := 1; 297 while Test < CityEventPriority[first] do 298 begin 299 Inc(I); 300 Inc(Test, Test); 301 end; 302 S := CityEventName(I); 305 303 { if CityEventPriority[first]=chNoGrowthWarning then 306 304 if Built[imAqueduct]=0 then 307 s:=Format(s,[Phrases.Lookup('IMPROVEMENTS',imAqueduct)])308 else begin s:=Format(s,[Phrases.Lookup('IMPROVEMENTS',imSewer)]); i:=17 end; }309 ReplaceText( x + (CityNameSpace + 4 + 40 + 18 + 8), y, TextColor, s);305 S:=Format(S,[Phrases.Lookup('IMPROVEMENTS',imAqueduct)]) 306 else begin S:=Format(S,[Phrases.Lookup('IMPROVEMENTS',imSewer)]); I:=17 end; } 307 ReplaceText(X + (CityNameSpace + 4 + 40 + 18 + 8), Y, TextColor, S); 310 308 if NonText then 311 309 begin 312 Sprite( offscreen, HGrSystem, 105 - 76 + CityNameSpace + 4 + 40,313 y0 + 1, 18, 18, 1 + i mod 3 * 19, 1 + idiv 3 * 19);314 x:= InnerWidth - 26;315 for j:= nCityEventPriority - 1 downto first + 1 do316 if (Flags and CityRepMask and CityEventPriority[ j] <> 0) then310 Sprite(Offscreen, HGrSystem, 105 - 76 + CityNameSpace + 4 + 40, 311 y0 + 1, 18, 18, 1 + I mod 3 * 19, 1 + I div 3 * 19); 312 X := InnerWidth - 26; 313 for J := nCityEventPriority - 1 downto first + 1 do 314 if (Flags and CityRepMask and CityEventPriority[J] <> 0) then 317 315 begin 318 i:= 0;319 test := 1;320 while test < CityEventPriority[j] do316 I := 0; 317 Test := 1; 318 while Test < CityEventPriority[J] do 321 319 begin 322 inc(i);323 inc(test, test)320 Inc(I); 321 Inc(Test, Test); 324 322 end; 325 if (CityEventPriority[ j] = chNoGrowthWarning) and323 if (CityEventPriority[J] = chNoGrowthWarning) and 326 324 (Built[imAqueduct] > 0) then 327 i:= 17;328 Sprite( offscreen, HGrSystem, x, y0 + 1, 18, 18,329 1 + i mod 3 * 19, 1 + idiv 3 * 19);330 dec(x, 20)331 end 332 end 333 end 325 I := 17; 326 Sprite(Offscreen, HGrSystem, X, y0 + 1, 18, 18, 327 1 + I mod 3 * 19, 1 + I div 3 * 19); 328 Dec(X, 20); 329 end; 330 end; 331 end; 334 332 end 335 333 else … … 338 336 CityReport.HypoTaxRate := -1; 339 337 CityReport.HypoLuxuryRate := -1; 340 Server(sGetCityReportNew, me, lix, CityReport);338 Server(sGetCityReportNew, Me, lix, CityReport); 341 339 TrueFood := Food; 342 340 TrueProd := Prod; 343 if supervising then341 if Supervising then 344 342 begin // normalize city from after-turn state 345 dec(TrueFood, CityReport.FoodSurplus);343 Dec(TrueFood, CityReport.FoodSurplus); 346 344 if TrueFood < 0 then 347 345 TrueFood := 0; // shouldn't happen 348 dec(TrueProd, CityReport.Production);346 Dec(TrueProd, CityReport.Production); 349 347 if TrueProd < 0 then 350 348 TrueProd := 0; // shouldn't happen 351 349 end; 352 350 353 s:= ''; // disorder info351 S := ''; // disorder info 354 352 if Flags and chCaptured <> 0 then 355 s:= Phrases.Lookup('CITYEVENTS', 14)353 S := Phrases.Lookup('CITYEVENTS', 14) 356 354 else if CityReport.HappinessBalance < 0 then 357 s:= Phrases.Lookup('CITYEVENTS', 0);358 if s<> '' then355 S := Phrases.Lookup('CITYEVENTS', 0); 356 if S <> '' then 359 357 begin { disorder } 360 358 if NonText then 361 359 begin 362 DarkGradient( offscreen.Canvas, 99 + 31 + CityNameSpace + 4,360 DarkGradient(Offscreen.Canvas, 99 + 31 + CityNameSpace + 4, 363 361 y0 + 2, 131, 3); 364 362 ca.Font.Assign(UniFont[ftSmall]); 365 RisedTextout( offscreen.Canvas, 103 + CityNameSpace + 4 + 31,366 y0 + 1, s);363 RisedTextout(Offscreen.Canvas, 103 + CityNameSpace + 4 + 31, 364 y0 + 1, S); 367 365 ca.Font.Assign(UniFont[ftNormal]); 368 end 366 end; 369 367 end 370 368 else 371 369 begin 372 370 { s:=IntToStr(CityReport.FoodSurplus); 373 ReplaceText( x+(CityNameSpace+4+48)-BiColorTextWidth(ca,s),y,TextColor,s); }374 s := inttostr(CityReport.Science);375 ReplaceText( x+ CityNameSpace + 4 + 370 + 48 - BiColorTextWidth(ca,376 s), y, TextColor, s);377 s := inttostr(CityReport.Production);378 ReplaceText( x + CityNameSpace + 4 + 132 - BiColorTextWidth(ca, s), y,379 TextColor, s);371 ReplaceText(X+(CityNameSpace+4+48)-BiColorTextWidth(ca,S),Y,TextColor,S); } 372 S := IntToStr(CityReport.Science); 373 ReplaceText(X + CityNameSpace + 4 + 370 + 48 - BiColorTextWidth(ca, 374 S), Y, TextColor, S); 375 S := IntToStr(CityReport.Production); 376 ReplaceText(X + CityNameSpace + 4 + 132 - BiColorTextWidth(ca, S), Y, 377 TextColor, S); 380 378 if NonText then 381 379 begin 382 380 // Sprite(offscreen,HGrSystem,x+CityNameSpace+4+333+1,y+6,10,10,66,115); 383 Sprite( offscreen, HGrSystem, x+ CityNameSpace + 4 + 370 + 48 + 1,384 y+ 6, 10, 10, 77, 126);385 Sprite( offscreen, HGrSystem, x + CityNameSpace + 4 + 132 + 1, y+ 6,381 Sprite(Offscreen, HGrSystem, X + CityNameSpace + 4 + 370 + 48 + 1, 382 Y + 6, 10, 10, 77, 126); 383 Sprite(Offscreen, HGrSystem, X + CityNameSpace + 4 + 132 + 1, Y + 6, 386 384 10, 10, 88, 115); 387 end 388 end; 389 s := inttostr(CityTaxBalance(lix, CityReport));390 ReplaceText( x + CityNameSpace + 4 + 370 - BiColorTextWidth(ca, s), y,391 TextColor, s);385 end; 386 end; 387 S := IntToStr(CityTaxBalance(lix, CityReport)); 388 ReplaceText(X + CityNameSpace + 4 + 370 - BiColorTextWidth(ca, S), Y, 389 TextColor, S); 392 390 // if Project and (cpImp+cpIndex)<>cpImp+imTrGoods then 393 391 // ReplaceText(x+CityNameSpace+4+333+1,y,TextColor,Format('%d/%d',[TrueProd,CityReport.ProjectCost])); 394 392 if NonText then 395 393 begin 396 Sprite( offscreen, HGrSystem, x + CityNameSpace + 4 + 370 + 1, y+ 6,394 Sprite(Offscreen, HGrSystem, X + CityNameSpace + 4 + 370 + 1, Y + 6, 397 395 10, 10, 132, 115); 398 396 … … 402 400 ((Size < NeedAqueductSize) or (Built[imAqueduct] = 1) and 403 401 (Size < NeedSewerSize) or (Built[imSewer] = 1)); 404 PaintRelativeProgressBar( offscreen.Canvas, 1, x+ 15 + CityNameSpace +405 4, y+ 7, 68, TrueFood, CutCityFoodSurplus(CityReport.FoodSurplus,402 PaintRelativeProgressBar(Offscreen.Canvas, 1, X + 15 + CityNameSpace + 403 4, Y + 7, 68, TrueFood, CutCityFoodSurplus(CityReport.FoodSurplus, 406 404 (MyRO.Government <> gAnarchy) and (Flags and chCaptured = 0), 407 405 MyRO.Government, Size), CityReport.Storage, CanGrow, MainTexture); … … 409 407 if Project <> cpImp + imTrGoods then 410 408 begin 411 DisplayProject(ofs + 104 - 76 + x- 28 + CityNameSpace + 4 + 206 -409 DisplayProject(ofs + 104 - 76 + X - 28 + CityNameSpace + 4 + 206 - 412 410 60, y0 - 15, Project); 413 411 … … 417 415 (Flags and chCaptured <> 0) then 418 416 growth := 0; 419 PaintRelativeProgressBar( offscreen.Canvas, 4,420 x + CityNameSpace + 4 + 304 - 60 + 9, y+ 7, 68, TrueProd, growth,421 CityReport.ProjectCost, true, MainTexture);422 end; 423 end 417 PaintRelativeProgressBar(Offscreen.Canvas, 4, 418 X + CityNameSpace + 4 + 304 - 60 + 9, Y + 7, 68, TrueProd, growth, 419 CityReport.ProjectCost, True, MainTexture); 420 end; 421 end; 424 422 end; 425 423 end 426 424 else if Kind in [kModels, kEModels] then 427 425 begin 428 x:= 104;429 y:= y0;426 X := 104; 427 Y := y0; 430 428 if ca = Canvas then 431 429 begin 432 x := x+ SideFrame;433 y := y + TitleHeight430 X := X + SideFrame; 431 Y := Y + TitleHeight; 434 432 end; 435 433 if lit then … … 440 438 begin 441 439 Available := 0; 442 for j:= 0 to MyRO.nUn - 1 do443 if (MyUn[ j].Loc >= 0) and (MyUn[j].mix = lix) then444 inc(Available);440 for J := 0 to MyRO.nUn - 1 do 441 if (MyUn[J].Loc >= 0) and (MyUn[J].mix = lix) then 442 Inc(Available); 445 443 if MainScreen.mNames.Checked then 446 s := Tribe[me].ModelName[lix]444 S := Tribe[Me].ModelName[lix] 447 445 else 448 s := Format(Tribe[me].TPhrase('GENMODEL'), [lix]);446 S := Format(Tribe[Me].TPhrase('GENMODEL'), [lix]); 449 447 if NonText then 450 448 DisplayProject(8 + ofs, y0 - 15, lix); … … 454 452 Available := MyRO.EnemyReport[pView].UnCount[lix]; 455 453 if MainScreen.mNames.Checked then 456 s:= Tribe[pView].ModelName[lix]454 S := Tribe[pView].ModelName[lix] 457 455 else 458 s:= Format(Tribe[pView].TPhrase('GENMODEL'), [lix]);456 S := Format(Tribe[pView].TPhrase('GENMODEL'), [lix]); 459 457 if NonText then 460 458 with Tribe[pView].ModelPicture[lix] do 461 Sprite( offscreen, HGr, 8 + ofs, y0 - 15, 64, 48, pix mod 10 * 65 + 1,459 Sprite(Offscreen, HGr, 8 + ofs, y0 - 15, 64, 48, pix mod 10 * 65 + 1, 462 460 pix div 10 * 49 + 1); 463 461 end; 464 462 if Available > 0 then 465 ReplaceText( x + 32 - BiColorTextWidth(ca, inttostr(Available)), y,466 TextColor, inttostr(Available));467 ReplaceText( x + 40, y, TextColor, s);463 ReplaceText(X + 32 - BiColorTextWidth(ca, IntToStr(Available)), Y, 464 TextColor, IntToStr(Available)); 465 ReplaceText(X + 40, Y, TextColor, S); 468 466 end 469 467 else … … 472 470 kAllEModels, kChooseEModel: 473 471 if lix = mixAll then 474 s:= Phrases.Lookup('PRICECAT_ALLMODEL')472 S := Phrases.Lookup('PRICECAT_ALLMODEL') 475 473 else 476 474 begin … … 478 476 if MainScreen.mNames.Checked then 479 477 begin 480 s:= Tribe[mox.Owner].ModelName[mox.mix];481 if (Kind = kAllEModels) and ( code[1, sb.Position + l] = 0) then482 s := Format(Tribe[mox.Owner].TPhrase('OWNED'), [s]);478 S := Tribe[mox.Owner].ModelName[mox.mix]; 479 if (Kind = kAllEModels) and (Code[1, ScrollBar.Position + L] = 0) then 480 S := Format(Tribe[mox.Owner].TPhrase('OWNED'), [S]); 483 481 end 484 482 else 485 s:= Format(Tribe[mox.Owner].TPhrase('GENMODEL'), [mox.mix]);483 S := Format(Tribe[mox.Owner].TPhrase('GENMODEL'), [mox.mix]); 486 484 if NonText then 487 485 with Tribe[mox.Owner].ModelPicture[mox.mix] do 488 Sprite( offscreen, HGr, 8 + ofs, y0 - 15, 64, 48,486 Sprite(Offscreen, HGr, 8 + ofs, y0 - 15, 64, 48, 489 487 pix mod 10 * 65 + 1, pix div 10 * 49 + 1); 490 488 end; 491 489 kChooseModel: 492 490 if lix = mixAll then 493 s:= Phrases.Lookup('PRICECAT_ALLMODEL')491 S := Phrases.Lookup('PRICECAT_ALLMODEL') 494 492 else 495 493 begin 496 s := Tribe[me].ModelName[lix];494 S := Tribe[Me].ModelName[lix]; 497 495 if NonText then 498 496 DisplayProject(8 + ofs, y0 - 15, lix); … … 501 499 begin 502 500 if lix and cpType <> 0 then 503 s:= Phrases.Lookup('CITYTYPE', lix and cpIndex)501 S := Phrases.Lookup('CITYTYPE', lix and cpIndex) 504 502 else if lix and cpImp = 0 then 505 503 with MyModel[lix and cpIndex] do 506 504 begin 507 s := Tribe[me].ModelName[lix and cpIndex];505 S := Tribe[Me].ModelName[lix and cpIndex]; 508 506 if lix and cpConscripts <> 0 then 509 s := Format(Phrases.Lookup('CONSCRIPTS'), [s]);507 S := Format(Phrases.Lookup('CONSCRIPTS'), [S]); 510 508 end 511 509 else 512 510 begin 513 s:= Phrases.Lookup('IMPROVEMENTS', lix and cpIndex);511 S := Phrases.Lookup('IMPROVEMENTS', lix and cpIndex); 514 512 if (Imp[lix and cpIndex].Kind in [ikNatLocal, ikNatGlobal]) and 515 513 (MyRO.NatBuilt[lix and cpIndex] > 0) or … … 517 515 (MyCity[cixProject].Built[imPower] + MyCity[cixProject].Built 518 516 [imHydro] + MyCity[cixProject].Built[imNuclear] > 0) then 519 s := Format(Phrases.Lookup('NATEXISTS'), [s]);517 S := Format(Phrases.Lookup('NATEXISTS'), [S]); 520 518 end; 521 519 if NonText then … … 525 523 begin 526 524 if lix = adAll then 527 s:= Phrases.Lookup('PRICECAT_ALLTECH')525 S := Phrases.Lookup('PRICECAT_ALLTECH') 528 526 else 529 527 begin 530 528 if lix = adNexus then 531 s:= Phrases.Lookup('NEXUS')529 S := Phrases.Lookup('NEXUS') 532 530 else if lix = adNone then 533 s:= Phrases.Lookup('NOFARTECH')531 S := Phrases.Lookup('NOFARTECH') 534 532 else if lix = adMilitary then 535 s:= Phrases.Lookup('INITUNIT')533 S := Phrases.Lookup('INITUNIT') 536 534 else 537 535 begin 538 s:= Phrases.Lookup('ADVANCES', lix);536 S := Phrases.Lookup('ADVANCES', lix); 539 537 if (Kind = kAdvance) and (lix in FutureTech) then 540 538 if MyRO.Tech[lix] < tsApplicable then 541 s := s+ ' 1'539 S := S + ' 1' 542 540 else 543 s := s + ' ' + inttostr(MyRO.Tech[lix] + 1);541 S := S + ' ' + IntToStr(MyRO.Tech[lix] + 1); 544 542 end; 545 if BiColorTextWidth(ca, s) > TechNameSpace + 8 then543 if BiColorTextWidth(ca, S) > TechNameSpace + 8 then 546 544 begin 547 545 repeat 548 delete(s, length(s), 1);549 until BiColorTextWidth(ca, s) <= TechNameSpace + 5;550 s := s+ '.';546 Delete(S, Length(S), 1); 547 until BiColorTextWidth(ca, S) <= TechNameSpace + 5; 548 S := S + '.'; 551 549 end; 552 550 … … 555 553 if lix = adNexus then 556 554 begin 557 Frame( offscreen.Canvas, (8 + 16 - 1), y0 - 1, (8 + 16 + 36),555 Frame(Offscreen.Canvas, (8 + 16 - 1), y0 - 1, (8 + 16 + 36), 558 556 y0 + 20, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 559 Dump( offscreen, HGrSystem, (8 + 16), y0, 36, 20, 223, 295)557 Dump(Offscreen, HGrSystem, (8 + 16), y0, 36, 20, 223, 295) 560 558 end 561 559 else if lix = adNone then 562 560 begin 563 Frame( offscreen.Canvas, (8 + 16 - 1), y0 - 1, (8 + 16 + 36),561 Frame(Offscreen.Canvas, (8 + 16 - 1), y0 - 1, (8 + 16 + 36), 564 562 y0 + 20, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 565 Dump( offscreen, HGrSystem, (8 + 16), y0, 36, 20, 260, 295)563 Dump(Offscreen, HGrSystem, (8 + 16), y0, 36, 20, 260, 295) 566 564 end 567 565 else if lix = adMilitary then 568 566 begin 569 Frame( offscreen.Canvas, (8 + 16 - 1), y0 - 1, (8 + 16 + 36),567 Frame(Offscreen.Canvas, (8 + 16 - 1), y0 - 1, (8 + 16 + 36), 570 568 y0 + 20, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 571 Dump( offscreen, HGrSystem, (8 + 16), y0, 36, 20, 38, 295)569 Dump(Offscreen, HGrSystem, (8 + 16), y0, 36, 20, 38, 295) 572 570 end 573 571 else 574 572 begin 575 Frame( offscreen.Canvas, (8 + 16 - 1), y0 - 1,573 Frame(Offscreen.Canvas, (8 + 16 - 1), y0 - 1, 576 574 (8 + 16 + xSizeSmall), y0 + ySizeSmall, 577 575 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 578 576 if AdvIcon[lix] < 84 then 579 DpiBit Canvas(offscreen.Canvas, (8 + 16), y0, xSizeSmall,577 DpiBitBltCanvas(Offscreen.Canvas, (8 + 16), y0, xSizeSmall, 580 578 ySizeSmall, SmallImp.Canvas, 581 579 (AdvIcon[lix] + SystemIconLines * 7) mod 7 * xSizeSmall, … … 583 581 ySizeSmall) 584 582 else 585 Dump( offscreen, HGrSystem, (8 + 16), y0, 36, 20,583 Dump(Offscreen, HGrSystem, (8 + 16), y0, 36, 20, 586 584 1 + (AdvIcon[lix] - 84) mod 8 * 37, 587 585 295 + (AdvIcon[lix] - 84) div 8 * 21); 588 j:= AdvValue[lix] div 1000;589 DpiBit Canvas(offscreen.Canvas, (8 + 16 - 4), y0 + 2, 14, 14,590 HGrSystem.Mask.Canvas, 127 + j* 15,586 J := AdvValue[lix] div 1000; 587 DpiBitBltCanvas(Offscreen.Canvas, (8 + 16 - 4), y0 + 2, 14, 14, 588 HGrSystem.Mask.Canvas, 127 + J * 15, 591 589 85, SRCAND); 592 Sprite( offscreen, HGrSystem, (8 + 16 - 5), y0 + 1, 14, 14,593 127 + j* 15, 85);590 Sprite(Offscreen, HGrSystem, (8 + 16 - 5), y0 + 1, 14, 14, 591 127 + J * 15, 85); 594 592 end; 595 593 end; … … 598 596 if NonText and (Kind in [kAdvance, kScience]) then 599 597 begin // show research state 600 for j:= 0 to nColumn - 1 do598 for J := 0 to nColumn - 1 do 601 599 begin 602 600 FutureCount := 0; 603 if j= 0 then // own science601 if J = 0 then // own science 604 602 if lix = MyRO.ResearchTech then 605 603 begin 606 Server(sGetTechCost, me, 0, icon);604 Server(sGetTechCost, Me, 0, icon); 607 605 icon := 4 + MyRO.Research * 4 div icon; 608 606 if icon > 4 + 3 then … … 623 621 icon := -1 624 622 else 625 with MyRO.EnemyReport[Column[ j]]^ do // enemy science626 if (MyRO.Alive and (1 shl Column[ j]) <> 0) and623 with MyRO.EnemyReport[Column[J]]^ do // enemy science 624 if (MyRO.Alive and (1 shl Column[J]) <> 0) and 627 625 (TurnOfCivilReport >= 0) and (lix = ResearchTech) and 628 626 ((lix = adMilitary) or (lix in FutureTech) or … … 631 629 icon := 4 + ResearchDone div 25; 632 630 if icon > 4 + 3 then 633 icon := 4 + 3 631 icon := 4 + 3; 634 632 end 635 633 else if lix = adMilitary then … … 647 645 icon := -1; 648 646 if icon >= 0 then 649 Sprite( offscreen, HGrSystem, 104 - 33 + 15 + 3 + TechNameSpace +650 24 * j, y0 + 3, 14, 14, 67 + icon * 15, 85)647 Sprite(Offscreen, HGrSystem, 104 - 33 + 15 + 3 + TechNameSpace + 648 24 * J, y0 + 3, 14, 14, 67 + icon * 15, 85) 651 649 else if (Kind = kScience) and (FutureCount > 0) then 652 650 begin 653 number := inttostr(FutureCount);654 RisedTextout(ca, 104 - 33 + 15 + 10 + TechNameSpace + 24 * j-651 number := IntToStr(FutureCount); 652 RisedTextout(ca, 104 - 33 + 15 + 10 + TechNameSpace + 24 * J - 655 653 BiColorTextWidth(ca, number) div 2, y0, number); 656 end 657 end 654 end; 655 end; 658 656 end; 659 657 end; // kAdvance, kScience 660 658 kTribe: 661 s:= TribeNames[lix];659 S := TribeNames[lix]; 662 660 kShipPart: 663 661 begin 664 s:= Phrases.Lookup('IMPROVEMENTS', imShipComp + lix) + ' (' +665 inttostr(MyRO.Ship[me].Parts[lix]) + ')';662 S := Phrases.Lookup('IMPROVEMENTS', imShipComp + lix) + ' (' + 663 IntToStr(MyRO.Ship[Me].Parts[lix]) + ')'; 666 664 if NonText then 667 665 DisplayProject(8 + ofs, y0 - 15, cpImp + imShipComp + lix); … … 669 667 kEShipPart: 670 668 begin 671 s:= Phrases.Lookup('IMPROVEMENTS', imShipComp + lix) + ' (' +672 inttostr(MyRO.Ship[DipMem[me].pContact].Parts[lix]) + ')';669 S := Phrases.Lookup('IMPROVEMENTS', imShipComp + lix) + ' (' + 670 IntToStr(MyRO.Ship[DipMem[Me].pContact].Parts[lix]) + ')'; 673 671 if NonText then 674 672 DisplayProject(8 + ofs, y0 - 15, cpImp + imShipComp + lix); … … 676 674 kGov: 677 675 begin 678 s:= Phrases.Lookup('GOVERNMENT', lix);676 S := Phrases.Lookup('GOVERNMENT', lix); 679 677 if NonText then 680 678 begin 681 Frame( offscreen.Canvas, 8 + 16 - 1, y0 - 15 + (16 - 2),679 Frame(Offscreen.Canvas, 8 + 16 - 1, y0 - 15 + (16 - 2), 682 680 8 + 16 + xSizeSmall, y0 - 15 + (16 - 1 + ySizeSmall), 683 681 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 684 DpiBit Canvas(offscreen.Canvas, 8 + 16, y0 - 15 + (16 - 1),682 DpiBitBltCanvas(Offscreen.Canvas, 8 + 16, y0 - 15 + (16 - 1), 685 683 xSizeSmall, ySizeSmall, SmallImp.Canvas, 686 684 (lix - 1) * xSizeSmall, ySizeSmall); 687 end 685 end; 688 686 end; 689 687 kMission: 690 s:= Phrases.Lookup('SPYMISSION', lix);688 S := Phrases.Lookup('SPYMISSION', lix); 691 689 end; 692 690 case Kind of 693 691 kTribe, kMission: // center text 694 692 if Lines[0] > MaxLines then 695 x:= (InnerWidth - DpiGetSystemMetrics(SM_CXVSCROLL)) div 2 -696 BiColorTextWidth(ca, s) div 2693 X := (InnerWidth - DpiGetSystemMetrics(SM_CXVSCROLL)) div 2 - 694 BiColorTextWidth(ca, S) div 2 697 695 else 698 x := InnerWidth div 2 - BiColorTextWidth(ca, s) div 2;696 X := InnerWidth div 2 - BiColorTextWidth(ca, S) div 2; 699 697 kAdvance, kFarAdvance, kScience, kChooseTech, kChooseETech, 700 698 kStealTech, kGov: 701 x:= 104 - 33;699 X := 104 - 33; 702 700 kAllEModels: 703 x:= 104;701 X := 104; 704 702 else 705 x:= 104 + 15;703 X := 104 + 15; 706 704 end; 707 y:= y0;705 Y := y0; 708 706 if ca = Canvas then 709 707 begin 710 x := x+ SideFrame;711 y := y + TitleHeight708 X := X + SideFrame; 709 Y := Y + TitleHeight; 712 710 end; 713 711 if lit then … … 716 714 TextColor := -1; 717 715 { if Kind=kTribe then ReplaceText_Tribe(x,y,TextColor, 718 integer(TribeNames.Objects[lix]),s)719 else } ReplaceText( x, y, TextColor, s);720 end 716 Integer(TribeNames.Objects[lix]),S) 717 else } ReplaceText(X, Y, TextColor, S); 718 end; 721 719 end; 722 720 723 721 procedure TListDlg.OffscreenPaint; 724 722 var 725 i, j: integer;723 I, J: Integer; 726 724 begin 727 725 case Kind of 728 726 kCities: 729 Caption := Tribe[ me].TPhrase('TITLE_CITIES');727 Caption := Tribe[Me].TPhrase('TITLE_CITIES'); 730 728 kCityEvents: 731 729 Caption := Format(Phrases.Lookup('TITLE_EVENTS'), … … 734 732 735 733 inherited; 736 offscreen.Canvas.Font.Assign(UniFont[ftNormal]);734 Offscreen.Canvas.Font.Assign(UniFont[ftNormal]); 737 735 FillOffscreen(0, 0, InnerWidth, InnerHeight); 738 with offscreen.Canvas do736 with Offscreen.Canvas do 739 737 begin 740 738 if Kind = kScience then 741 for i:= 1 to nColumn - 1 do739 for I := 1 to nColumn - 1 do 742 740 begin 743 741 Pen.Color := $000000; 744 MoveTo(104 - 33 + 15 + TechNameSpace + 24 * i, 0);745 LineTo(104 - 33 + 15 + TechNameSpace + 24 * i, InnerHeight);746 MoveTo(104 - 33 + 15 + TechNameSpace + 9 * 2 + 24 * i, 0);747 LineTo(104 - 33 + 15 + TechNameSpace + 9 * 2 + 24 * i, InnerHeight);748 if MyRO.EnemyReport[Column[ i]].TurnOfCivilReport >= MyRO.Turn - 1 then749 begin 750 brush.Color := Tribe[Column[i]].Color;751 fillrect(rect(104 - 33 + 14 + TechNameSpace + 24 * i+ 1 * 2, 0,752 104 - 33 + 17 + TechNameSpace + 24 * i+ 8 * 2, InnerHeight));753 brush.style := bsClear;742 MoveTo(104 - 33 + 15 + TechNameSpace + 24 * I, 0); 743 LineTo(104 - 33 + 15 + TechNameSpace + 24 * I, InnerHeight); 744 MoveTo(104 - 33 + 15 + TechNameSpace + 9 * 2 + 24 * I, 0); 745 LineTo(104 - 33 + 15 + TechNameSpace + 9 * 2 + 24 * I, InnerHeight); 746 if MyRO.EnemyReport[Column[I]].TurnOfCivilReport >= MyRO.Turn - 1 then 747 begin 748 Brush.Color := Tribe[Column[I]].Color; 749 FillRect(rect(104 - 33 + 14 + TechNameSpace + 24 * I + 1 * 2, 0, 750 104 - 33 + 17 + TechNameSpace + 24 * I + 8 * 2, InnerHeight)); 751 Brush.style := bsClear; 754 752 end 755 753 else 756 754 begin // colored player columns 757 Pen.Color := Tribe[Column[ i]].Color;758 for j:= 1 to 8 do759 begin 760 MoveTo(104 - 33 + 15 + TechNameSpace + 24 * i + j* 2, 0);761 LineTo(104 - 33 + 15 + TechNameSpace + 24 * i + j* 2, InnerHeight);762 end 763 end; 764 end; 765 766 for i:= -1 to DispLines do767 if ( i + sb.Position >= 0) and (i + sb.Position < Lines[Layer]) then768 Self. line(offscreen.Canvas, i, true, false)755 Pen.Color := Tribe[Column[I]].Color; 756 for J := 1 to 8 do 757 begin 758 MoveTo(104 - 33 + 15 + TechNameSpace + 24 * I + J * 2, 0); 759 LineTo(104 - 33 + 15 + TechNameSpace + 24 * I + J * 2, InnerHeight); 760 end; 761 end; 762 end; 763 764 for I := -1 to DispLines do 765 if (I + ScrollBar.Position >= 0) and (I + ScrollBar.Position < Lines[Layer]) then 766 Self.Line(Offscreen.Canvas, I, True, False); 769 767 end; 770 768 MarkUsedOffscreen(InnerWidth, 8 + 48 + DispLines * LineDistance); … … 772 770 773 771 procedure TListDlg.PaintBox1MouseMove(Sender: TObject; Shift: TShiftState; 774 x, y: integer);772 X, Y: Integer); 775 773 var 776 i0, Sel0, iColumn, OldScienceNation, xScreen: integer;777 s: string;778 begin 779 y := y- TitleHeight;780 i0 := sb.Position;781 Sel0 := Sel ;782 if ( x >= SideFrame) and (x < SideFrame + InnerWidth) and (y>= 0) and783 ( y < InnerHeight) and (y mod LineDistance >= 4) and (ymod LineDistance < 20)774 i0, Sel0, iColumn, OldScienceNation, xScreen: Integer; 775 S: string; 776 begin 777 Y := Y - TitleHeight; 778 i0 := ScrollBar.Position; 779 Sel0 := Selected; 780 if (X >= SideFrame) and (X < SideFrame + InnerWidth) and (Y >= 0) and 781 (Y < InnerHeight) and (Y mod LineDistance >= 4) and (Y mod LineDistance < 20) 784 782 then 785 Sel := ydiv LineDistance - 1783 Selected := Y div LineDistance - 1 786 784 else 787 Sel := -2;788 if (Sel < -1) or (Sel > DispLines) or (Sel+ i0 < 0) or789 (Sel + i0 >= Lines[Layer]) then790 Sel := -2;791 if Sel <> Sel0 then785 Selected := -2; 786 if (Selected < -1) or (Selected > DispLines) or (Selected + i0 < 0) or 787 (Selected + i0 >= Lines[Layer]) then 788 Selected := -2; 789 if Selected <> Sel0 then 792 790 begin 793 791 if Sel0 <> -2 then 794 line(Canvas, Sel0, false, false);795 if Sel <> -2 then796 line(Canvas, Sel, false, true)792 Line(Canvas, Sel0, False, False); 793 if Selected <> -2 then 794 Line(Canvas, Selected, False, True); 797 795 end; 798 796 … … 801 799 OldScienceNation := ScienceNation; 802 800 ScienceNation := -1; 803 if ( x>= SideFrame + (104 - 33 + 15 + TechNameSpace)) and804 (( x- SideFrame - (104 - 33 + 15 + TechNameSpace)) mod 24 <= 18) and805 ( y >= 0) and (y< InnerHeight) then801 if (X >= SideFrame + (104 - 33 + 15 + TechNameSpace)) and 802 ((X - SideFrame - (104 - 33 + 15 + TechNameSpace)) mod 24 <= 18) and 803 (Y >= 0) and (Y < InnerHeight) then 806 804 begin 807 iColumn := ( x- SideFrame - (104 - 33 + 15 + TechNameSpace)) div 24;805 iColumn := (X - SideFrame - (104 - 33 + 15 + TechNameSpace)) div 24; 808 806 if (iColumn >= 1) and (iColumn < nColumn) then 809 807 ScienceNation := Column[iColumn]; … … 816 814 if ScienceNation >= 0 then 817 815 begin 818 s:= Tribe[ScienceNation].TPhrase('SHORTNAME');816 S := Tribe[ScienceNation].TPhrase('SHORTNAME'); 819 817 if MyRO.Alive and (1 shl ScienceNation) = 0 then 820 s := Format(Phrases.Lookup('SCIENCEREPORT_EXTINCT'), [s]) // extinct818 S := Format(Phrases.Lookup('SCIENCEREPORT_EXTINCT'), [S]) // extinct 821 819 else if MyRO.EnemyReport[ScienceNation].TurnOfCivilReport < MyRO.Turn - 1 822 820 then 823 s := s+ ' (' + TurnToString(MyRO.EnemyReport[ScienceNation]821 S := S + ' (' + TurnToString(MyRO.EnemyReport[ScienceNation] 824 822 .TurnOfCivilReport) + ')'; // old report 825 xScreen := (ClientWidth - BiColorTextWidth(Canvas, s)) div 2;823 xScreen := (ClientWidth - BiColorTextWidth(Canvas, S)) div 2; 826 824 LoweredTextOut(Canvas, -1, MainTexture, xScreen + 10, 827 ClientHeight - 29, s);828 DpiBit Canvas(ScienceNationDotBuffer.Canvas, 0, 0, ScienceNationDot.Width,825 ClientHeight - 29, S); 826 DpiBitBltCanvas(ScienceNationDotBuffer.Canvas, 0, 0, ScienceNationDot.Width, 829 827 ScienceNationDot.Height, Canvas, xScreen - 10, ClientHeight - 27); 830 828 ImageOp_BCC(ScienceNationDotBuffer, Templates.Data, Point(0, 0), 831 829 ScienceNationDot.BoundsRect, MainTexture.ColorBevelShade, Tribe[ScienceNation].Color); 832 DpiBit Canvas(Canvas, xScreen - 10, ClientHeight - 27, ScienceNationDot.Width,830 DpiBitBltCanvas(Canvas, xScreen - 10, ClientHeight - 27, ScienceNationDot.Width, 833 831 ScienceNationDot.Height, ScienceNationDotBuffer.Canvas, 0, 0); 834 832 end; … … 840 838 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); 841 839 begin 842 if sb.ProcessMouseWheel(WheelDelta) then begin840 if ScrollBar.ProcessMouseWheel(WheelDelta) then begin 843 841 PaintBox1MouseMove(nil, [], MousePos.X - Left, 844 842 MousePos.Y - Top); … … 846 844 end; 847 845 848 function TListDlg.RenameCity(cix: integer): boolean; 846 procedure TListDlg.FormClose(Sender: TObject; var CloseAction: TCloseAction); 847 begin 848 //Gtk2Fix; 849 end; 850 851 function TListDlg.RenameCity(cix: Integer): Boolean; 849 852 var 850 853 CityNameInfo: TCityNameInfo; … … 859 862 CityNameInfo.ID := MyCity[cix].ID; 860 863 CityNameInfo.NewName := InputDlg.EInput.Text; 861 Server(cSetCityName + (length(CityNameInfo.NewName) + 8) div 4, me, 0, 862 CityNameInfo); 863 if CityDlg.Visible then 864 if CityNameInfo.GetCommandDataSize > CommandDataMaxSize then 865 Delete(CityNameInfo.NewName, Length(CityNameInfo.NewName) - 866 (CityNameInfo.GetCommandDataSize - 1 - CommandDataMaxSize), MaxInt); 867 Server(CommandWithData(cSetCityName, CityNameInfo.GetCommandDataSize), 868 Me, 0, CityNameInfo); 869 if MainScreen.CityDlg.Visible then 864 870 begin 865 CityDlg.FormShow(nil);866 CityDlg.Invalidate;871 MainScreen.CityDlg.FormShow(nil); 872 MainScreen.CityDlg.Invalidate; 867 873 end; 868 result := true;874 Result := True; 869 875 end 870 876 else 871 result := false;872 end; 873 874 function TListDlg.RenameModel(mix: integer): boolean;877 Result := False; 878 end; 879 880 function TListDlg.RenameModel(mix: Integer): Boolean; 875 881 var 876 882 ModelNameInfo: TModelNameInfo; 877 883 begin 878 884 InputDlg.Caption := Phrases.Lookup('TITLE_MODELNAME'); 879 InputDlg.EInput.Text := Tribe[ me].ModelName[mix];885 InputDlg.EInput.Text := Tribe[Me].ModelName[mix]; 880 886 InputDlg.CenterToRect(BoundsRect); 881 887 InputDlg.ShowModal; 882 888 if (InputDlg.ModalResult = mrOK) and (InputDlg.EInput.Text <> '') and 883 (InputDlg.EInput.Text <> Tribe[ me].ModelName[mix]) then889 (InputDlg.EInput.Text <> Tribe[Me].ModelName[mix]) then 884 890 begin 885 891 ModelNameInfo.mix := mix; 886 892 ModelNameInfo.NewName := InputDlg.EInput.Text; 887 Server(cSetModelName + (length(ModelNameInfo.NewName) + 1 + 4 + 3) div 4, 888 me, 0, ModelNameInfo); 889 if UnitStatDlg.Visible then 893 if ModelNameInfo.GetCommandDataSize > CommandDataMaxSize then 894 Delete(ModelNameInfo.NewName, Length(ModelNameInfo.NewName) - 895 (ModelNameInfo.GetCommandDataSize - 1 - CommandDataMaxSize), MaxInt); 896 Server(CommandWithData(cSetModelName, ModelNameInfo.GetCommandDataSize), 897 Me, 0, ModelNameInfo); 898 if MainScreen.UnitStatDlg.Visible then 890 899 begin 891 UnitStatDlg.FormShow(nil);892 UnitStatDlg.Invalidate;900 MainScreen.UnitStatDlg.FormShow(nil); 901 MainScreen.UnitStatDlg.Invalidate; 893 902 end; 894 result := true;903 Result := True; 895 904 end 896 905 else 897 result := false;906 Result := False; 898 907 end; 899 908 900 909 procedure TListDlg.PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; 901 Shift: TShiftState; x, y: integer);910 Shift: TShiftState; X, Y: Integer); 902 911 var 903 lix: integer;904 begin 905 if sb.Position + Sel>= 0 then906 lix := code[Layer, sb.Position + Sel];912 lix: Integer; 913 begin 914 if ScrollBar.Position + Selected >= 0 then 915 lix := Code[Layer, ScrollBar.Position + Selected]; 907 916 if Kind in [kScience, kCities, kCityEvents, kModels, kEModels, kAllEModels] 908 917 then 909 include(Shift, ssShift); // don't close list window918 Include(Shift, ssShift); // don't close list window 910 919 if (ssLeft in Shift) and not(ssShift in Shift) then 911 920 begin 912 if Sel <> -2 then921 if Selected <> -2 then 913 922 begin 914 result := lix;915 Closable := true;923 Result := lix; 924 Closable := True; 916 925 Close; 917 926 end; … … 919 928 else if (ssLeft in Shift) and (ssShift in Shift) then 920 929 begin // show help/info popup 921 if Sel <> -2 then930 if Selected <> -2 then 922 931 case Kind of 923 932 kCities: 924 933 MainScreen.ZoomToCity(MyCity[lix].Loc); 925 934 kCityEvents: 926 MainScreen.ZoomToCity(MyCity[lix].Loc, false, MyCity[lix].Flags and935 MainScreen.ZoomToCity(MyCity[lix].Loc, False, MyCity[lix].Flags and 927 936 CityRepMask); 928 937 kModels, kChooseModel: 929 938 if lix <> mixAll then 930 UnitStatDlg.ShowNewContent_OwnModel(FWindowMode or 931 wmPersistent, lix); 939 MainScreen.UnitStatDlg.ShowNewContent_OwnModel(wmPersistent, lix); 932 940 kEModels: 933 UnitStatDlg.ShowNewContent_EnemyModel(FWindowMode orwmPersistent,934 code[1, sb.Position + Sel]);941 MainScreen.UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent, 942 Code[1, ScrollBar.Position + Selected]); 935 943 kAllEModels, kChooseEModel: 936 944 if lix <> mixAll then 937 UnitStatDlg.ShowNewContent_EnemyModel(FWindowMode or 938 wmPersistent, lix); 945 MainScreen.UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent, lix); 939 946 kAdvance, kFarAdvance, kScience, kChooseTech, kChooseETech, kStealTech: 940 947 if lix = adMilitary then 941 HelpDlg.ShowNewContent(FWindowMode orwmPersistent, hkText,942 HelpDlg.TextIndex('MILRES'))948 MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkText, 949 MainScreen.HelpDlg.TextIndex('MILRES')) 943 950 else if lix < adMilitary then 944 HelpDlg.ShowNewContent(FWindowMode orwmPersistent, hkAdv, lix);951 MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkAdv, lix); 945 952 kProject: 946 953 if lix = cpImp + imTrGoods then 947 HelpDlg.ShowNewContent(FWindowMode orwmPersistent, hkText,948 HelpDlg.TextIndex('TRADINGGOODS'))954 MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkText, 955 MainScreen.HelpDlg.TextIndex('TRADINGGOODS')) 949 956 else if lix and (cpImp + cpType) = 0 then 950 UnitStatDlg.ShowNewContent_OwnModel(FWindowMode orwmPersistent,957 MainScreen.UnitStatDlg.ShowNewContent_OwnModel(wmPersistent, 951 958 lix and cpIndex) 952 959 else if (lix and cpType = 0) and (lix <> cpImp + imTrGoods) then 953 HelpDlg.ShowNewContent(FWindowMode orwmPersistent, hkImp,960 MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkImp, 954 961 lix and cpIndex); 955 962 kGov: 956 HelpDlg.ShowNewContent(FWindowMode orwmPersistent, hkMisc,957 miscGovList);963 MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkMisc, 964 Integer(miscGovList)); 958 965 kShipPart, kEShipPart: 959 966 ; … … 962 969 else if ssRight in Shift then 963 970 begin 964 if Sel <> -2 then971 if Selected <> -2 then 965 972 case Kind of 966 973 kCities, kCityEvents: … … 976 983 procedure TListDlg.InitLines; 977 984 var 978 required: array [0 .. nAdv - 1] of integer;979 980 procedure TryAddImpLine(Layer, Project: integer);981 begin 982 if Server(sSetCityProject - sExecute, me, cixProject, Project) >= rExecuted985 required: array [0 .. nAdv - 1] of Integer; 986 987 procedure TryAddImpLine(Layer, Project: Integer); 988 begin 989 if Server(sSetCityProject - sExecute, Me, cixProject, Project) >= rExecuted 983 990 then 984 991 begin 985 code[Layer, Lines[Layer]] := Project;986 inc(Lines[Layer]);992 Code[Layer, Lines[Layer]] := Project; 993 Inc(Lines[Layer]); 987 994 end; 988 995 end; … … 990 997 procedure SortTechs; 991 998 var 992 i, j, swap: integer;999 I, J, swap: Integer; 993 1000 begin // sort by advancedness 994 for i:= 0 to Lines[0] - 2 do995 if code[0, i] < adMilitary then996 for j := i+ 1 to Lines[0] - 1 do997 if AdvValue[ code[0, i]] * nAdv + code[0, i] < AdvValue[code[0, j]] *998 nAdv + code[0, j] then999 begin 1000 swap := code[0, i];1001 code[0, i] := code[0, j];1002 code[0, j] := swap;1001 for I := 0 to Lines[0] - 2 do 1002 if Code[0, I] < adMilitary then 1003 for J := I + 1 to Lines[0] - 1 do 1004 if AdvValue[Code[0, I]] * nAdv + Code[0, I] < AdvValue[Code[0, J]] * 1005 nAdv + Code[0, J] then 1006 begin 1007 swap := Code[0, I]; 1008 Code[0, I] := Code[0, J]; 1009 Code[0, J] := swap; 1003 1010 end; 1004 1011 end; … … 1006 1013 procedure SortCities; 1007 1014 var 1008 i, j, swap: integer;1009 begin 1010 for i:= 0 to Lines[0] - 2 do1011 for j := i+ 1 to Lines[0] - 1 do1012 if CityName(MyCity[ code[0, i]].ID) > CityName(MyCity[code[0, j]].ID)1015 I, J, swap: Integer; 1016 begin 1017 for I := 0 to Lines[0] - 2 do 1018 for J := I + 1 to Lines[0] - 1 do 1019 if CityName(MyCity[Code[0, I]].ID) > CityName(MyCity[Code[0, J]].ID) 1013 1020 then 1014 1021 begin 1015 swap := code[0, i];1016 code[0, i] := code[0, j];1017 code[0, j] := swap;1022 swap := Code[0, I]; 1023 Code[0, I] := Code[0, J]; 1024 Code[0, J] := swap; 1018 1025 end; 1019 1026 end; 1020 1027 1021 1028 function ModelSortValue(const mi: TModelInfo; 1022 MixPlayers: boolean = false): integer;1023 begin 1024 result := (mi.Domain + 1) shl 28 - mi.mix;1029 MixPlayers: Boolean = False): Integer; 1030 begin 1031 Result := (mi.Domain + 1) shl 28 - mi.mix; 1025 1032 if MixPlayers then 1026 dec(result, ModelCode(mi) shl 16);1033 Dec(Result, ModelCode(mi) shl 16); 1027 1034 end; 1028 1035 1029 1036 procedure SortModels; 1030 1037 var 1031 i, j, swap: integer;1038 I, J, swap: Integer; 1032 1039 begin // sort by code[2] 1033 for i:= 0 to Lines[0] - 2 do1034 for j := i+ 1 to Lines[0] - 1 do1035 if code[2, i] > code[2, j] then1036 begin 1037 swap := code[0, i];1038 code[0, i] := code[0, j];1039 code[0, j] := swap;1040 swap := code[1, i];1041 code[1, i] := code[1, j];1042 code[1, j] := swap;1043 swap := code[2, i];1044 code[2, i] := code[2, j];1045 code[2, j] := swap;1046 end; 1047 end; 1048 1049 procedure MarkPreqs( i: integer);1050 begin 1051 required[ i] := 1;1052 if MyRO.Tech[ i] < tsSeen then1040 for I := 0 to Lines[0] - 2 do 1041 for J := I + 1 to Lines[0] - 1 do 1042 if Code[2, I] > Code[2, J] then 1043 begin 1044 swap := Code[0, I]; 1045 Code[0, I] := Code[0, J]; 1046 Code[0, J] := swap; 1047 swap := Code[1, I]; 1048 Code[1, I] := Code[1, J]; 1049 Code[1, J] := swap; 1050 swap := Code[2, I]; 1051 Code[2, I] := Code[2, J]; 1052 Code[2, J] := swap; 1053 end; 1054 end; 1055 1056 procedure MarkPreqs(I: Integer); 1057 begin 1058 required[I] := 1; 1059 if MyRO.Tech[I] < tsSeen then 1053 1060 begin 1054 if (AdvPreq[ i, 0] >= 0) then1055 MarkPreqs(AdvPreq[ i, 0]);1056 if (AdvPreq[ i, 1] >= 0) then1057 MarkPreqs(AdvPreq[ i, 1]);1061 if (AdvPreq[I, 0] >= 0) then 1062 MarkPreqs(AdvPreq[I, 0]); 1063 if (AdvPreq[I, 1] >= 0) then 1064 MarkPreqs(AdvPreq[I, 1]); 1058 1065 end; 1059 1066 end; 1060 1067 1061 1068 var 1062 Loc1, i, j, p1, dx, dy, mix, emix, EnemyType, TestEnemyType: integer;1069 Loc1, I, J, p1, dx, dy, mix, emix, EnemyType, TestEnemyType: Integer; 1063 1070 mi: TModelInfo; 1064 1071 PPicture, PTestPicture: ^TModelPicture; 1065 ModelOk: array [0 .. 4095] of boolean;1066 ok: boolean;1067 begin 1068 for i:= 0 to MaxLayer - 1 do1069 begin 1070 Lines[ i] := 0;1071 FirstShrinkedLine[ i] := MaxInt;1072 ModelOk: array [0 .. 4095] of Boolean; 1073 ok: Boolean; 1074 begin 1075 for I := 0 to MaxLayer - 1 do 1076 begin 1077 Lines[I] := 0; 1078 FirstShrinkedLine[I] := MaxInt; 1072 1079 end; 1073 1080 case Kind of … … 1075 1082 begin 1076 1083 // improvements 1077 code[0, 0] := cpImp + imTrGoods;1084 Code[0, 0] := cpImp + imTrGoods; 1078 1085 Lines[0] := 1; 1079 for i:= nWonder to nImp - 1 do1080 if Imp[ i].Kind = ikCommon then1081 TryAddImpLine(0, i+ cpImp);1082 for i:= nWonder to nImp - 1 do1083 if not(Imp[ i].Kind in [ikCommon, ikTrGoods]) and1084 ((MyRO.NatBuilt[ i] = 0) or (Imp[i].Kind = ikNatLocal)) then1085 TryAddImpLine(0, i+ cpImp);1086 for i:= 0 to nCityType - 1 do1087 if MyData.ImpOrder[ i, 0] >= 0 then1088 begin 1089 code[0, Lines[0]] := cpType + i;1090 inc(Lines[0]);1086 for I := nWonder to nImp - 1 do 1087 if Imp[I].Kind = ikCommon then 1088 TryAddImpLine(0, I + cpImp); 1089 for I := nWonder to nImp - 1 do 1090 if not(Imp[I].Kind in [ikCommon, ikTrGoods]) and 1091 ((MyRO.NatBuilt[I] = 0) or (Imp[I].Kind = ikNatLocal)) then 1092 TryAddImpLine(0, I + cpImp); 1093 for I := 0 to nCityType - 1 do 1094 if MyData.ImpOrder[I, 0] >= 0 then 1095 begin 1096 Code[0, Lines[0]] := cpType + I; 1097 Inc(Lines[0]); 1091 1098 end; 1092 1099 1093 1100 // wonders 1094 for i:= 0 to nWonder - 1 do1095 TryAddImpLine(1, i+ cpImp);1101 for I := 0 to nWonder - 1 do 1102 TryAddImpLine(1, I + cpImp); 1096 1103 1097 1104 // units 1098 for i:= 0 to MyRO.nModel - 1 do1105 for I := 0 to MyRO.nModel - 1 do 1099 1106 begin 1100 1107 { if MyModel[i].Kind=mkSlaves then 1101 ok:= MyRO.Wonder[woPyramids].EffectiveOwner= me1102 else } if MyModel[ i].Domain = dSea then1103 begin 1104 ok := false;1108 ok:= MyRO.Wonder[woPyramids].EffectiveOwner=Me 1109 else } if MyModel[I].Domain = dSea then 1110 begin 1111 ok := False; 1105 1112 for dx := -2 to 2 do 1106 1113 for dy := -2 to 2 do … … 1111 1118 ((MyMap[Loc1] and fTerrain = fShore) or 1112 1119 (MyMap[Loc1] and fCanal > 0)) then 1113 ok := true;1120 ok := True; 1114 1121 end; 1115 1122 end 1116 1123 else 1117 ok := true;1124 ok := True; 1118 1125 if ok then 1119 1126 begin 1120 if MyModel[ i].Status and msObsolete = 0 then1127 if MyModel[I].Status and msObsolete = 0 then 1121 1128 begin 1122 code[2, Lines[2]] := i;1123 inc(Lines[2]);1129 Code[2, Lines[2]] := I; 1130 Inc(Lines[2]); 1124 1131 end; 1125 if MyModel[ i].Status and msAllowConscripts <> 0 then1132 if MyModel[I].Status and msAllowConscripts <> 0 then 1126 1133 begin 1127 code[2, Lines[2]] := i+ cpConscripts;1128 inc(Lines[2]);1134 Code[2, Lines[2]] := I + cpConscripts; 1135 Inc(Lines[2]); 1129 1136 end; 1130 1137 end; … … 1140 1147 MarkPreqs(MyData.FarTech); 1141 1148 end; 1142 for i:= 0 to nAdv - 1 do1143 if (( i in FutureTech) or (MyRO.Tech[i] < tsApplicable)) and1144 (Server(sSetResearch - sExecute, me, i, nil^) >= rExecuted) and1145 ((MyData.FarTech = adNone) or (required[ i] > 0)) then1146 begin 1147 code[0, Lines[0]] := i;1148 inc(Lines[0]);1149 for I := 0 to nAdv - 1 do 1150 if ((I in FutureTech) or (MyRO.Tech[I] < tsApplicable)) and 1151 (Server(sSetResearch - sExecute, Me, I, nil^) >= rExecuted) and 1152 ((MyData.FarTech = adNone) or (required[I] > 0)) then 1153 begin 1154 Code[0, Lines[0]] := I; 1155 Inc(Lines[0]); 1149 1156 end; 1150 1157 SortTechs; 1151 1158 if Lines[0] = 0 then // no more techs -- offer nexus 1152 1159 begin 1153 code[0, Lines[0]] := adNexus;1154 inc(Lines[0]);1155 end; 1156 ok := false;1157 for i:= 0 to nDomains - 1 do1158 if (upgrade[ i, 0].Preq = preNone) or1159 (MyRO.Tech[upgrade[ i, 0].Preq] >= tsApplicable) then1160 ok := true;1160 Code[0, Lines[0]] := adNexus; 1161 Inc(Lines[0]); 1162 end; 1163 ok := False; 1164 for I := 0 to nDomains - 1 do 1165 if (upgrade[I, 0].Preq = preNone) or 1166 (MyRO.Tech[upgrade[I, 0].Preq] >= tsApplicable) then 1167 ok := True; 1161 1168 if ok then { new unit class } 1162 1169 begin 1163 code[0, Lines[0]] := adMilitary;1164 inc(Lines[0]);1170 Code[0, Lines[0]] := adMilitary; 1171 Inc(Lines[0]); 1165 1172 end; 1166 1173 end; 1167 1174 kFarAdvance: 1168 1175 begin 1169 code[0, Lines[0]] := adNone;1170 inc(Lines[0]);1171 for i:= 0 to nAdv - 1 do1172 if not( i in FutureTech) and (MyRO.Tech[i] < tsApplicable) and1173 ((AdvValue[ i] < 2000) or (MyRO.Tech[adMassProduction] > tsNA)) and1174 ((AdvValue[ i] < 1000) or (MyRO.Tech[adScience] > tsNA)) then1175 begin 1176 code[0, Lines[0]] := i;1177 inc(Lines[0]);1176 Code[0, Lines[0]] := adNone; 1177 Inc(Lines[0]); 1178 for I := 0 to nAdv - 1 do 1179 if not(I in FutureTech) and (MyRO.Tech[I] < tsApplicable) and 1180 ((AdvValue[I] < 2000) or (MyRO.Tech[adMassProduction] > tsNA)) and 1181 ((AdvValue[I] < 1000) or (MyRO.Tech[adScience] > tsNA)) then 1182 begin 1183 Code[0, Lines[0]] := I; 1184 Inc(Lines[0]); 1178 1185 end; 1179 1186 SortTechs; … … 1181 1188 kChooseTech: 1182 1189 begin 1183 for i:= 0 to nAdv - 1 do1184 if not( i in FutureTech) and (MyRO.Tech[i] >= tsApplicable) and1185 (MyRO.EnemyReport[DipMem[ me].pContact].Tech[i] < tsSeen) then1186 begin 1187 code[0, Lines[0]] := i;1188 inc(Lines[0]);1190 for I := 0 to nAdv - 1 do 1191 if not(I in FutureTech) and (MyRO.Tech[I] >= tsApplicable) and 1192 (MyRO.EnemyReport[DipMem[Me].pContact].Tech[I] < tsSeen) then 1193 begin 1194 Code[0, Lines[0]] := I; 1195 Inc(Lines[0]); 1189 1196 end; 1190 1197 SortTechs; 1191 1198 // if Lines[0]>1 then 1192 1199 begin 1193 code[0, Lines[0]] := adAll;1194 inc(Lines[0]);1200 Code[0, Lines[0]] := adAll; 1201 Inc(Lines[0]); 1195 1202 end; 1196 1203 end; 1197 1204 kChooseETech: 1198 1205 begin 1199 for i:= 0 to nAdv - 1 do1200 if not( i in FutureTech) and (MyRO.Tech[i] < tsSeen) and1201 (MyRO.EnemyReport[DipMem[ me].pContact].Tech[i] >= tsApplicable) then1202 begin 1203 code[0, Lines[0]] := i;1204 inc(Lines[0]);1206 for I := 0 to nAdv - 1 do 1207 if not(I in FutureTech) and (MyRO.Tech[I] < tsSeen) and 1208 (MyRO.EnemyReport[DipMem[Me].pContact].Tech[I] >= tsApplicable) then 1209 begin 1210 Code[0, Lines[0]] := I; 1211 Inc(Lines[0]); 1205 1212 end; 1206 1213 SortTechs; 1207 1214 // if Lines[0]>1 then 1208 1215 begin 1209 code[0, Lines[0]] := adAll;1210 inc(Lines[0]);1216 Code[0, Lines[0]] := adAll; 1217 Inc(Lines[0]); 1211 1218 end; 1212 1219 end; 1213 1220 kStealTech: 1214 1221 begin 1215 for i:= 0 to nAdv - 1 do1216 if Server(sStealTech - sExecute, me, i, nil^) >= rExecuted then1217 begin 1218 code[0, Lines[0]] := i;1219 inc(Lines[0]);1222 for I := 0 to nAdv - 1 do 1223 if Server(sStealTech - sExecute, Me, I, nil^) >= rExecuted then 1224 begin 1225 Code[0, Lines[0]] := I; 1226 Inc(Lines[0]); 1220 1227 end; 1221 1228 SortTechs; … … 1223 1230 kScience: 1224 1231 begin 1225 Column[0] := me;1232 Column[0] := Me; 1226 1233 nColumn := 1; 1227 1234 for EnemyType := 0 to 2 do … … 1241 1248 begin 1242 1249 Column[nColumn] := p1; 1243 inc(nColumn);1250 Inc(nColumn); 1244 1251 end; 1245 1252 end; 1246 for i:= 0 to nAdv - 1 do1247 begin 1248 ok := (MyRO.Tech[ i] <> tsNA) or (MyRO.ResearchTech = i);1249 for j:= 1 to nColumn - 1 do1250 with MyRO.EnemyReport[Column[ j]]^ do1251 if (Tech[ i] <> tsNA) or (TurnOfCivilReport >= 0) and1252 (ResearchTech = i) then1253 ok := true;1253 for I := 0 to nAdv - 1 do 1254 begin 1255 ok := (MyRO.Tech[I] <> tsNA) or (MyRO.ResearchTech = I); 1256 for J := 1 to nColumn - 1 do 1257 with MyRO.EnemyReport[Column[J]]^ do 1258 if (Tech[I] <> tsNA) or (TurnOfCivilReport >= 0) and 1259 (ResearchTech = I) then 1260 ok := True; 1254 1261 if ok then 1255 1262 begin 1256 code[0, Lines[0]] := i;1257 inc(Lines[0]);1263 Code[0, Lines[0]] := I; 1264 Inc(Lines[0]); 1258 1265 end; 1259 1266 end; … … 1261 1268 1262 1269 ok := MyRO.ResearchTech = adMilitary; 1263 for j:= 1 to nColumn - 1 do1264 with MyRO.EnemyReport[Column[ j]]^ do1265 if (MyRO.Alive and (1 shl Column[ j]) <> 0) and1270 for J := 1 to nColumn - 1 do 1271 with MyRO.EnemyReport[Column[J]]^ do 1272 if (MyRO.Alive and (1 shl Column[J]) <> 0) and 1266 1273 (TurnOfCivilReport >= 0) and (ResearchTech = adMilitary) then 1267 ok := true;1274 ok := True; 1268 1275 if ok then 1269 1276 begin 1270 code[0, Lines[0]] := adMilitary;1271 inc(Lines[0]);1277 Code[0, Lines[0]] := adMilitary; 1278 Inc(Lines[0]); 1272 1279 end 1273 1280 end; … … 1275 1282 begin 1276 1283 if ClientMode < scContact then 1277 for i:= 0 to MyRO.nCity - 1 do1278 if MyCity[ i].Loc >= 0 then1284 for I := 0 to MyRO.nCity - 1 do 1285 if MyCity[I].Loc >= 0 then 1279 1286 begin 1280 code[0, Lines[0]] := i;1281 inc(Lines[0]);1287 Code[0, Lines[0]] := I; 1288 Inc(Lines[0]); 1282 1289 end; 1283 1290 SortCities; … … 1286 1293 kCityEvents: 1287 1294 begin 1288 for i:= 0 to MyRO.nCity - 1 do1289 if (MyCity[ i].Loc >= 0) and (MyCity[i].Flags and CityRepMask <> 0)1295 for I := 0 to MyRO.nCity - 1 do 1296 if (MyCity[I].Loc >= 0) and (MyCity[I].Flags and CityRepMask <> 0) 1290 1297 then 1291 1298 begin 1292 code[0, Lines[0]] := i;1293 inc(Lines[0]);1299 Code[0, Lines[0]] := I; 1300 Inc(Lines[0]); 1294 1301 end; 1295 1302 SortCities; … … 1298 1305 { kChooseECity: 1299 1306 begin 1300 for i:=0 to MyRO.nEnemyCity-1 do1301 if (MyRO.EnemyCity[ i].Loc>=0)1302 and (MyRO.EnemyCity[ i].owner=DipMem[me].pContact) then1303 begin code[0,Lines[0]]:=i; inc(Lines[0]); end;1307 for I:=0 to MyRO.nEnemyCity-1 do 1308 if (MyRO.EnemyCity[I].Loc>=0) 1309 and (MyRO.EnemyCity[I].owner=DipMem[Me].pContact) then 1310 begin Code[0,Lines[0]]:=I; Inc(Lines[0]); end; 1304 1311 FirstShrinkedLine:=0 1305 1312 end; } … … 1308 1315 for mix := 0 to MyRO.nModel - 1 do 1309 1316 begin 1310 code[0, mix] := mix;1311 MakeModelInfo( me, mix, MyModel[mix], mi);1312 code[2, mix] := ModelSortValue(mi);1317 Code[0, mix] := mix; 1318 MakeModelInfo(Me, mix, MyModel[mix], mi); 1319 Code[2, mix] := ModelSortValue(mi); 1313 1320 end; 1314 1321 Lines[0] := MyRO.nModel; … … 1320 1327 for mix := 3 to MyRO.nModel - 1 do 1321 1328 begin // check if opponent already has this model 1322 MakeModelInfo( me, mix, MyModel[mix], mi);1323 ok := true;1329 MakeModelInfo(Me, mix, MyModel[mix], mi); 1330 ok := True; 1324 1331 for emix := 0 to MyRO.nEnemyModel - 1 do 1325 if (MyRO.EnemyModel[emix].Owner = DipMem[ me].pContact) and1332 if (MyRO.EnemyModel[emix].Owner = DipMem[Me].pContact) and 1326 1333 IsSameModel(MyRO.EnemyModel[emix], mi) then 1327 ok := false;1334 ok := False; 1328 1335 if ok then 1329 1336 begin 1330 code[0, Lines[0]] := mix;1331 MakeModelInfo( me, mix, MyModel[mix], mi);1332 code[2, Lines[0]] := ModelSortValue(mi);1333 inc(Lines[0]);1337 Code[0, Lines[0]] := mix; 1338 MakeModelInfo(Me, mix, MyModel[mix], mi); 1339 Code[2, Lines[0]] := ModelSortValue(mi); 1340 Inc(Lines[0]); 1334 1341 end; 1335 1342 end; … … 1337 1344 // if Lines[0]>1 then 1338 1345 begin 1339 code[0, Lines[0]] := mixAll;1340 inc(Lines[0]);;1346 Code[0, Lines[0]] := mixAll; 1347 Inc(Lines[0]);; 1341 1348 end; 1342 1349 FirstShrinkedLine[0] := 0; … … 1345 1352 begin 1346 1353 if MyRO.TestFlags and tfUncover <> 0 then 1347 Server(sGetModels, me, 0, nil^);1354 Server(sGetModels, Me, 0, nil^); 1348 1355 for emix := 0 to MyRO.nEnemyModel - 1 do 1349 ModelOk[emix] := MyRO.EnemyModel[emix].Owner = DipMem[ me].pContact;1356 ModelOk[emix] := MyRO.EnemyModel[emix].Owner = DipMem[Me].pContact; 1350 1357 for mix := 0 to MyRO.nModel - 1 do 1351 1358 begin // don't list models I already have 1352 MakeModelInfo( me, mix, MyModel[mix], mi);1359 MakeModelInfo(Me, mix, MyModel[mix], mi); 1353 1360 for emix := 0 to MyRO.nEnemyModel - 1 do 1354 1361 ModelOk[emix] := ModelOk[emix] and … … 1358 1365 if ModelOk[emix] then 1359 1366 begin 1360 if not Assigned(Tribe[DipMem[ me].pContact].ModelPicture1367 if not Assigned(Tribe[DipMem[Me].pContact].ModelPicture 1361 1368 [MyRO.EnemyModel[emix].mix].HGr) then 1362 1369 InitEnemyModel(emix); 1363 code[0, Lines[0]] := emix;1364 code[2, Lines[0]] := ModelSortValue(MyRO.EnemyModel[emix]);1365 inc(Lines[0]);1370 Code[0, Lines[0]] := emix; 1371 Code[2, Lines[0]] := ModelSortValue(MyRO.EnemyModel[emix]); 1372 Inc(Lines[0]); 1366 1373 end; 1367 1374 SortModels; 1368 1375 // if not IsMilReportNew(DipMem[me].pContact) or (Lines[0]>1) then 1369 1376 begin 1370 code[0, Lines[0]] := mixAll;1371 inc(Lines[0]);1377 Code[0, Lines[0]] := mixAll; 1378 Inc(Lines[0]); 1372 1379 end; 1373 1380 FirstShrinkedLine[0] := 0; … … 1375 1382 kEModels: 1376 1383 begin 1377 for i:= 0 to MyRO.EnemyReport[pView].nModelCounted - 1 do1378 begin 1379 code[1, Lines[0]] := MyRO.nEnemyModel - 1;1380 while ( code[1, Lines[0]] >= 0) and1381 not((MyRO.EnemyModel[ code[1, Lines[0]]].Owner = pView) and1382 (MyRO.EnemyModel[ code[1, Lines[0]]].mix = i)) do1383 dec(code[1, Lines[0]]);1384 if not Assigned(Tribe[pView].ModelPicture[ i].HGr) then1385 InitEnemyModel( code[1, Lines[0]]);1386 code[0, Lines[0]] := i;1387 code[2, Lines[0]] :=1388 ModelSortValue(MyRO.EnemyModel[ code[1, Lines[0]]]);1389 inc(Lines[0]);1384 for I := 0 to MyRO.EnemyReport[pView].nModelCounted - 1 do 1385 begin 1386 Code[1, Lines[0]] := MyRO.nEnemyModel - 1; 1387 while (Code[1, Lines[0]] >= 0) and 1388 not((MyRO.EnemyModel[Code[1, Lines[0]]].Owner = pView) and 1389 (MyRO.EnemyModel[Code[1, Lines[0]]].mix = I)) do 1390 Dec(Code[1, Lines[0]]); 1391 if not Assigned(Tribe[pView].ModelPicture[I].HGr) then 1392 InitEnemyModel(Code[1, Lines[0]]); 1393 Code[0, Lines[0]] := I; 1394 Code[2, Lines[0]] := 1395 ModelSortValue(MyRO.EnemyModel[Code[1, Lines[0]]]); 1396 Inc(Lines[0]); 1390 1397 end; 1391 1398 SortModels; … … 1394 1401 kAllEModels: 1395 1402 begin 1396 if (MyRO.TestFlags and tfUncover <> 0) or (G.Difficulty[ me] = 0) then1397 Server(sGetModels, me, 0, nil^);1403 if (MyRO.TestFlags and tfUncover <> 0) or (G.Difficulty[Me] = 0) then 1404 Server(sGetModels, Me, 0, nil^); 1398 1405 for emix := 0 to MyRO.nEnemyModel - 1 do 1399 1406 if (MyRO.EnemyModel[emix].mix >= 3) and … … 1405 1412 if not Assigned(PPicture.HGr) then 1406 1413 InitEnemyModel(emix); 1407 ok := true;1414 ok := True; 1408 1415 if MainScreen.mNames.Checked then 1409 for j:= 0 to Lines[0] - 1 do1416 for J := 0 to Lines[0] - 1 do 1410 1417 begin 1411 PTestPicture := @Tribe[MyRO.EnemyModel[ code[0, j]].Owner]1412 .ModelPicture[MyRO.EnemyModel[ code[0, j]].mix];1418 PTestPicture := @Tribe[MyRO.EnemyModel[Code[0, J]].Owner] 1419 .ModelPicture[MyRO.EnemyModel[Code[0, J]].mix]; 1413 1420 if (PPicture.HGr = PTestPicture.HGr) and 1414 1421 (PPicture.pix = PTestPicture.pix) and 1415 1422 (ModelHash(MyRO.EnemyModel[emix]) 1416 = ModelHash(MyRO.EnemyModel[ code[0, j]])) then1423 = ModelHash(MyRO.EnemyModel[Code[0, J]])) then 1417 1424 begin 1418 code[1, j] := 1;1419 ok := false;1425 Code[1, J] := 1; 1426 ok := False; 1420 1427 Break; 1421 1428 end; … … 1423 1430 if ok then 1424 1431 begin 1425 code[0, Lines[0]] := emix;1426 code[1, Lines[0]] := 0;1427 code[2, Lines[0]] := ModelSortValue(MyRO.EnemyModel[emix], true);1428 inc(Lines[0]);1432 Code[0, Lines[0]] := emix; 1433 Code[1, Lines[0]] := 0; 1434 Code[2, Lines[0]] := ModelSortValue(MyRO.EnemyModel[emix], True); 1435 Inc(Lines[0]); 1429 1436 end; 1430 1437 end; … … 1433 1440 end; 1434 1441 kTribe: 1435 for i:= 0 to TribeNames.Count - 1 do1436 begin 1437 code[0, Lines[0]] := i;1438 inc(Lines[0]);1442 for I := 0 to TribeNames.Count - 1 do 1443 begin 1444 Code[0, Lines[0]] := I; 1445 Inc(Lines[0]); 1439 1446 end; 1440 1447 (* kDeliver: 1441 if MyRO.Treaty[DipMem[ me].pContact]<trAlliance then1448 if MyRO.Treaty[DipMem[Me].pContact]<trAlliance then 1442 1449 begin // suggest next treaty level 1443 code[0,Lines[0]]:=opTreaty+MyRO.Treaty[DipMem[me].pContact]+1;1444 inc(Lines[0]);1445 end; 1446 if MyRO.Treaty[DipMem[ me].pContact]=trNone then1450 Code[0,Lines[0]]:=opTreaty+MyRO.Treaty[DipMem[Me].pContact]+1; 1451 Inc(Lines[0]); 1452 end; 1453 if MyRO.Treaty[DipMem[Me].pContact]=trNone then 1447 1454 begin // suggest peace 1448 code[0,Lines[0]]:=opTreaty+trPeace;1449 inc(Lines[0]);1450 end; 1451 if MyRO.Treaty[DipMem[ me].pContact]>trNone then1455 Code[0,Lines[0]]:=opTreaty+trPeace; 1456 Inc(Lines[0]); 1457 end; 1458 if MyRO.Treaty[DipMem[Me].pContact]>trNone then 1452 1459 begin // suggest next treaty level 1453 code[0,Lines[0]]:=opTreaty+MyRO.Treaty[DipMem[me].pContact]-1;1454 inc(Lines[0]);1460 Code[0,Lines[0]]:=opTreaty+MyRO.Treaty[DipMem[Me].pContact]-1; 1461 Inc(Lines[0]); 1455 1462 end; *) 1456 1463 kShipPart: 1457 1464 begin 1458 1465 Lines[0] := 0; 1459 for i:= 0 to nShipPart - 1 do1460 if MyRO.Ship[ me].Parts[i] > 0 then1461 begin 1462 code[0, Lines[0]] := i;1463 inc(Lines[0]);1466 for I := 0 to nShipPart - 1 do 1467 if MyRO.Ship[Me].Parts[I] > 0 then 1468 begin 1469 Code[0, Lines[0]] := I; 1470 Inc(Lines[0]); 1464 1471 end; 1465 1472 end; … … 1467 1474 begin 1468 1475 Lines[0] := 0; 1469 for i:= 0 to nShipPart - 1 do1470 if MyRO.Ship[DipMem[ me].pContact].Parts[i] > 0 then1471 begin 1472 code[0, Lines[0]] := i;1473 inc(Lines[0]);1476 for I := 0 to nShipPart - 1 do 1477 if MyRO.Ship[DipMem[Me].pContact].Parts[I] > 0 then 1478 begin 1479 Code[0, Lines[0]] := I; 1480 Inc(Lines[0]); 1474 1481 end; 1475 1482 end; 1476 1483 kGov: 1477 for i:= 1 to nGov - 1 do1478 if (GovPreq[ i] <> preNA) and1479 ((GovPreq[ i] = preNone) or (MyRO.Tech[GovPreq[i]] >= tsApplicable))1484 for I := 1 to nGov - 1 do 1485 if (GovPreq[I] <> preNA) and 1486 ((GovPreq[I] = preNone) or (MyRO.Tech[GovPreq[I]] >= tsApplicable)) 1480 1487 then 1481 1488 begin 1482 code[0, Lines[0]] := i;1483 inc(Lines[0]);1489 Code[0, Lines[0]] := I; 1490 Inc(Lines[0]); 1484 1491 end; 1485 1492 kMission: 1486 for i:= 0 to nSpyMission - 1 do1487 begin 1488 code[0, Lines[0]] := i;1489 inc(Lines[0]);1493 for I := 0 to nSpyMission - 1 do 1494 begin 1495 Code[0, Lines[0]] := I; 1496 Inc(Lines[0]); 1490 1497 end; 1491 1498 end; … … 1494 1501 if Lines[0] + Lines[1] + Lines[2] <= MaxLines then 1495 1502 begin 1496 for i:= 0 to Lines[1] - 1 do // add wonders to first page1497 begin 1498 code[0, Lines[0]] := code[1, i];1499 inc(Lines[0]);1503 for I := 0 to Lines[1] - 1 do // add wonders to first page 1504 begin 1505 Code[0, Lines[0]] := Code[1, I]; 1506 Inc(Lines[0]); 1500 1507 end; 1501 1508 Lines[1] := 0; 1502 1509 FirstShrinkedLine[0] := Lines[0]; 1503 for i:= 0 to Lines[2] - 1 do // add models to first page1504 begin 1505 code[0, Lines[0]] := code[2, i];1506 inc(Lines[0]);1510 for I := 0 to Lines[2] - 1 do // add models to first page 1511 begin 1512 Code[0, Lines[0]] := Code[2, I]; 1513 Inc(Lines[0]); 1507 1514 end; 1508 1515 Lines[2] := 0; 1509 1516 end; 1510 end; // InitLines1511 1512 function TListDlg.OnlyChoice(TestKind: TListKind): integer;1517 end; 1518 1519 function TListDlg.OnlyChoice(TestKind: TListKind): Integer; 1513 1520 begin 1514 1521 Kind := TestKind; 1515 1522 InitLines; 1516 1523 if Lines[0] = 0 then 1517 result := -21524 Result := -2 1518 1525 else if Lines[0] > 1 then 1519 result := -11526 Result := -1 1520 1527 else 1521 result := code[0, 0];1528 Result := Code[0, 0]; 1522 1529 end; 1523 1530 1524 1531 procedure TListDlg.FormShow(Sender: TObject); 1525 1532 var 1526 i: integer;1527 begin 1528 result := -1;1529 Closable := false;1533 I: Integer; 1534 begin 1535 Result := -1; 1536 Closable := False; 1530 1537 1531 1538 if Kind = kTribe then … … 1543 1550 InitLines; 1544 1551 1545 MultiPage := false;1546 for i:= 1 to MaxLayer - 1 do1547 if Lines[ i] > 0 then1548 MultiPage := true;1552 MultiPage := False; 1553 for I := 1 to MaxLayer - 1 do 1554 if Lines[I] > 0 then 1555 MultiPage := True; 1549 1556 WideBottom := MultiPage or (Kind = kScience) or 1550 1557 not Phrases2FallenBackToEnglish and … … 1552 1559 if (Kind = kAdvance) and (MyData.FarTech <> adNone) or (Kind = kModels) or 1553 1560 (Kind = kEModels) then begin 1554 sb.SetBorderSpacing(56, 10, 10);1561 ScrollBar.SetBorderSpacing(56, 10, 10); 1555 1562 TitleHeight := WideFrame + 20; 1556 1563 end else begin 1557 sb.SetBorderSpacing(36, 10, 34);1564 ScrollBar.SetBorderSpacing(36, 10, 34); 1558 1565 TitleHeight := WideFrame; 1559 1566 end; 1560 1567 1561 1568 DispLines := Lines[0]; 1562 for i:= 0 to MaxLayer - 1 do1563 if Lines[ i] > DispLines then1564 DispLines := Lines[ i];1569 for I := 0 to MaxLayer - 1 do 1570 if Lines[I] > DispLines then 1571 DispLines := Lines[I]; 1565 1572 if WideBottom then 1566 1573 begin … … 1577 1584 ClientHeight := InnerHeight + TitleHeight + NarrowFrame; 1578 1585 end; 1579 assert(ClientHeight <= Maintexture.Height);1586 Assert(ClientHeight <= Maintexture.Height); 1580 1587 1581 1588 TechNameSpace := 224; … … 1615 1622 CaptionRight := CloseBtn.Left; 1616 1623 { TODO: 1617 SetWindowPos( sb.ScrollBar.Handle, 0, SideFrame + InnerWidth - DpiGetSystemMetrics(SM_CXVSCROLL),1624 SetWindowPos(ScrollBar.ScrollBar.Handle, 0, SideFrame + InnerWidth - DpiGetSystemMetrics(SM_CXVSCROLL), 1618 1625 TitleHeight, DpiGetSystemMetrics(SM_CXVSCROLL), LineDistance * DispLines + 48, 1619 1626 SWP_NOZORDER or SWP_NOREDRAW); … … 1638 1645 Layer0Btn.Top := ClientHeight - 31; 1639 1646 Layer0Btn.Left := ClientWidth div 2 - (12 + 29); 1640 Layer0Btn.Down := true;1647 Layer0Btn.Down := True; 1641 1648 Layer1Btn.Top := ClientHeight - 31; 1642 1649 Layer1Btn.Left := ClientWidth div 2 - (12 - 29); 1643 Layer1Btn.Down := false;1650 Layer1Btn.Down := False; 1644 1651 Layer2Btn.Top := ClientHeight - 31; 1645 1652 Layer2Btn.Left := ClientWidth div 2 - 12; 1646 Layer2Btn.Down := false;1653 Layer2Btn.Down := False; 1647 1654 end; 1648 1655 1649 1656 Layer := 0; 1650 Sel := -2;1657 Selected := -2; 1651 1658 ScienceNation := -1; 1652 sb.Init(Lines[Layer] - 1, DispLines);1659 ScrollBar.Init(Lines[Layer] - 1, DispLines); 1653 1660 1654 1661 OffscreenPaint; 1655 1662 end; 1656 1663 1657 procedure TListDlg.ShowNewContent(NewMode: integer; ListKind: TListKind);1664 procedure TListDlg.ShowNewContent(NewMode: TWindowMode; ListKind: TListKind); 1658 1665 var 1659 i: integer;1660 ShowFocus, forceclose: boolean;1666 I: Integer; 1667 ShowFocus, forceclose: Boolean; 1661 1668 begin 1662 1669 forceclose := (ListKind <> Kind) and … … 1722 1729 if Kind = kAdvance then // show focus button? 1723 1730 if MyData.FarTech <> adNone then 1724 ShowFocus := true1731 ShowFocus := True 1725 1732 else 1726 1733 begin 1727 ShowFocus := false;1728 for i:= 0 to nAdv - 1 do1729 if not( i in FutureTech) and (MyRO.Tech[i] < tsApplicable) and1730 ((AdvValue[ i] < 2000) or (MyRO.Tech[adMassProduction] > tsNA)) and1731 ((AdvValue[ i] < 1000) or (MyRO.Tech[adScience] > tsNA)) and1732 (Server(sSetResearch - sExecute, me, i, nil^) < rExecuted) then1733 ShowFocus := true;1734 ShowFocus := False; 1735 for I := 0 to nAdv - 1 do 1736 if not(I in FutureTech) and (MyRO.Tech[I] < tsApplicable) and 1737 ((AdvValue[I] < 2000) or (MyRO.Tech[adMassProduction] > tsNA)) and 1738 ((AdvValue[I] < 1000) or (MyRO.Tech[adScience] > tsNA)) and 1739 (Server(sSetResearch - sExecute, Me, I, nil^) < rExecuted) then 1740 ShowFocus := True; 1734 1741 end; 1735 ToggleBtn.Visible := (Kind = kCities) and not supervising or (Kind = kAdvance)1742 ToggleBtn.Visible := (Kind = kCities) and not Supervising or (Kind = kAdvance) 1736 1743 and ShowFocus or (Kind = kModels) or (Kind = kEModels); 1737 1744 CloseBtn.Visible := not(Kind in MustChooseKind); 1738 1745 1739 1746 inherited ShowNewContent(NewMode, forceclose); 1740 end; // ShowNewContent1741 1742 procedure TListDlg.ShowNewContent_CityProject(NewMode , cix: integer);1747 end; 1748 1749 procedure TListDlg.ShowNewContent_CityProject(NewMode: TWindowMode; cix: Integer); 1743 1750 begin 1744 1751 cixProject := cix; … … 1746 1753 end; 1747 1754 1748 procedure TListDlg.ShowNewContent_MilReport(NewMode , p: integer);1749 begin 1750 pView := p;1751 if p = me then1755 procedure TListDlg.ShowNewContent_MilReport(NewMode: TWindowMode; P: Integer); 1756 begin 1757 pView := P; 1758 if P = Me then 1752 1759 ShowNewContent(NewMode, kModels) 1753 1760 else … … 1757 1764 procedure TListDlg.PlayerClick(Sender: TObject); 1758 1765 begin 1759 if TComponent(Sender).Tag = me then1766 if TComponent(Sender).Tag = Me then 1760 1767 Kind := kModels 1761 1768 else … … 1765 1772 end; 1766 1773 InitLines; 1767 Sel := -2;1768 sb.Init(Lines[Layer] - 1, DispLines);1774 Selected := -2; 1775 ScrollBar.Init(Lines[Layer] - 1, DispLines); 1769 1776 OffscreenPaint; 1770 1777 Invalidate; … … 1778 1785 Layer := TComponent(Sender).Tag; 1779 1786 1780 Sel := -2;1781 sb.Init(Lines[Layer] - 1, DispLines);1787 Selected := -2; 1788 ScrollBar.Init(Lines[Layer] - 1, DispLines); 1782 1789 SmartUpdateContent; 1783 1790 end; … … 1785 1792 procedure TListDlg.ToggleBtnClick(Sender: TObject); 1786 1793 var 1787 p1: integer;1788 m: TDpiMenuItem;1794 p1: Integer; 1795 M: TDpiMenuItem; 1789 1796 begin 1790 1797 case Kind of 1791 1798 kAdvance: 1792 1799 begin 1793 result := adFar;1794 Closable := true;1800 Result := adFar; 1801 Closable := True; 1795 1802 Close; 1796 1803 end; … … 1807 1814 begin 1808 1815 EmptyMenu(Popup.Items); 1809 if G.Difficulty[ me] > 0 then1810 begin 1811 m:= TDpiMenuItem.Create(Popup);1812 m.RadioItem := true;1813 m.Caption := Tribe[me].TPhrase('SHORTNAME');1814 m.Tag := me;1815 m.OnClick := PlayerClick;1816 if G.Difficulty[Me] > 0 then 1817 begin 1818 M := TDpiMenuItem.Create(Popup); 1819 M.RadioItem := True; 1820 M.Caption := Tribe[Me].TPhrase('SHORTNAME'); 1821 M.Tag := Me; 1822 M.OnClick := PlayerClick; 1816 1823 if Kind = kModels then 1817 m.Checked := true;1818 Popup.Items.Add( m);1824 M.Checked := True; 1825 Popup.Items.Add(M); 1819 1826 end; 1820 1827 for p1 := 0 to nPl - 1 do 1821 if (p1 <> me) and (MyRO.EnemyReport[p1] <> nil) and1828 if (p1 <> Me) and (MyRO.EnemyReport[p1] <> nil) and 1822 1829 (MyRO.EnemyReport[p1].TurnOfMilReport >= 0) then 1823 1830 begin 1824 m:= TDpiMenuItem.Create(Popup);1825 m.RadioItem := true;1826 m.Caption := Tribe[p1].TPhrase('SHORTNAME');1827 m.Tag := p1;1828 m.OnClick := PlayerClick;1831 M := TDpiMenuItem.Create(Popup); 1832 M.RadioItem := True; 1833 M.Caption := Tribe[p1].TPhrase('SHORTNAME'); 1834 M.Tag := p1; 1835 M.OnClick := PlayerClick; 1829 1836 if (Kind = kEModels) and (p1 = pView) then 1830 m.Checked := true;1831 Popup.Items.Add( m);1837 M.Checked := True; 1838 Popup.Items.Add(M); 1832 1839 end; 1833 1840 Popup.Popup(Left + ToggleBtn.Left, Top + ToggleBtn.Top + … … 1837 1844 end; 1838 1845 1839 procedure TListDlg.FormKeyDown(Sender: TObject; var Key: word;1846 procedure TListDlg.FormKeyDown(Sender: TObject; var Key: Word; 1840 1847 Shift: TShiftState); 1841 1848 begin … … 1876 1883 procedure TListDlg.RemoveUnit; 1877 1884 begin 1878 if ListDlg.Visible and (Kind = kModels) then1885 if Visible and (Kind = kModels) then 1879 1886 SmartUpdateContent; 1880 1887 end; … … 1882 1889 procedure TListDlg.ScrollBarUpdate(Sender: TObject); 1883 1890 begin 1884 Sel := -2;1885 SmartUpdateContent( true);1891 Selected := -2; 1892 SmartUpdateContent(True); 1886 1893 end; 1887 1894 -
branches/highdpi/LocalPlayer/TechTree.pas
r349 r465 30 30 end; 31 31 32 var33 TechTreeDlg: TTechTreeDlg;34 35 32 36 33 implementation … … 55 52 yLegendPitch = 32; 56 53 57 function min(a, b: Integer): Integer;58 begin 59 if a < bthen60 result := a54 function Min(A, B: Integer): Integer; 55 begin 56 if A < B then 57 Result := A 61 58 else 62 result := b;63 end; 64 65 function max(a, b: Integer): Integer;66 begin 67 if a > bthen68 result := a59 Result := B; 60 end; 61 62 function Max(A, B: Integer): Integer; 63 begin 64 if A > B then 65 Result := A 69 66 else 70 result := b;67 Result := B; 71 68 end; 72 69 … … 84 81 procedure TTechTreeDlg.FormPaint(Sender: TObject); 85 82 var 86 X, w: Integer;83 X, W: Integer; 87 84 begin 88 85 with Canvas do begin 89 86 // black border 90 brush.color := $000000;91 fillrect(rect(0, 0, BlackBorder, ClientHeight));92 fillrect(rect(BlackBorder, 0, ClientWidth - BlackBorder, BlackBorder));93 fillrect(rect(ClientWidth - BlackBorder, 0, ClientWidth, ClientHeight));94 fillrect(rect(BlackBorder, ClientHeight - BlackBorder,87 Brush.Color := $000000; 88 FillRect(rect(0, 0, BlackBorder, ClientHeight)); 89 FillRect(rect(BlackBorder, 0, ClientWidth - BlackBorder, BlackBorder)); 90 FillRect(rect(ClientWidth - BlackBorder, 0, ClientWidth, ClientHeight)); 91 FillRect(rect(BlackBorder, ClientHeight - BlackBorder, 95 92 ClientWidth - BlackBorder, ClientHeight)); 96 93 97 94 // texturize empty space 98 brush.color := $FFFFFF;95 Brush.Color := $FFFFFF; 99 96 if xOffset > 0 then 100 97 FillRectSeamless(Canvas, BlackBorder, BlackBorder, BlackBorder + xOffset, … … 105 102 ClientWidth - BlackBorder, ClientHeight - BlackBorder, 106 103 -BlackBorder - xOffset, -BlackBorder - yOffset, Paper); 107 X := max(BlackBorder, BlackBorder + xOffset);108 w := min(BlackBorder + xOffset + Image.width, ClientWidth - BlackBorder);104 X := Max(BlackBorder, BlackBorder + xOffset); 105 W := Min(BlackBorder + xOffset + Image.width, ClientWidth - BlackBorder); 109 106 if yOffset > 0 then 110 FillRectSeamless(Canvas, X, BlackBorder, w, BlackBorder + yOffset,107 FillRectSeamless(Canvas, X, BlackBorder, W, BlackBorder + yOffset, 111 108 -BlackBorder - xOffset, -BlackBorder - yOffset, Paper); 112 109 if yOffset + Image.height < ClientHeight - 2 * BlackBorder then 113 FillRectSeamless(Canvas, X, BlackBorder + yOffset + Image.height, w,110 FillRectSeamless(Canvas, X, BlackBorder + yOffset + Image.height, W, 114 111 ClientHeight - BlackBorder, -BlackBorder - xOffset, 115 112 -BlackBorder - yOffset, Paper); 116 113 end; 117 DpiBit Canvas(Canvas, max(BlackBorder, BlackBorder + xOffset),118 max(BlackBorder, BlackBorder + yOffset),119 min(Image.width, min(Image.width + xOffset,120 min(ClientWidth - 2 * BlackBorder, ClientWidth - 2 * BlackBorder - xOffset))121 ), min(Image.height, min(Image.height + yOffset,122 min(ClientHeight - 2 * BlackBorder, ClientHeight - 2 * BlackBorder -123 yOffset))), Image.Canvas, max(0, -xOffset),124 max(0, -yOffset));114 DpiBitBltCanvas(Canvas, Max(BlackBorder, BlackBorder + xOffset), 115 Max(BlackBorder, BlackBorder + yOffset), 116 Min(Image.width, Min(Image.width + xOffset, 117 Min(ClientWidth - 2 * BlackBorder, ClientWidth - 2 * BlackBorder - xOffset)) 118 ), Min(Image.height, Min(Image.height + yOffset, 119 Min(ClientHeight - 2 * BlackBorder, ClientHeight - 2 * BlackBorder - 120 yOffset))), Image.Canvas, Max(0, -xOffset), 121 Max(0, -yOffset)); 125 122 end; 126 123 … … 128 125 var 129 126 X, Y, ad: Integer; 130 s: string;127 S: string; 131 128 NewWidth: Integer; 132 129 NewHeight: Integer; 133 130 begin 131 Caption := Phrases2.Lookup('MENU_ADVTREE'); 134 132 if Image = nil then begin 135 133 Image := TDpiBitmap.Create; … … 139 137 140 138 with Image.Canvas do begin 141 // write advance names139 // Write advance names 142 140 Font.Assign(UniFont[ftSmall]); 143 Font. color := clBlack;144 brush.Style := bsClear;145 for X := 0 to (Image. width - xStart) div xPitch do146 for Y := 0 to (Image. height - yStart) div yPitch do141 Font.Color := clBlack; 142 Brush.Style := bsClear; 143 for X := 0 to (Image.Width - xStart) div xPitch do 144 for Y := 0 to (Image.Height - yStart) div yPitch do 147 145 begin 148 146 ad := Pixels[xStart + X * xPitch + 10, yStart + Y * yPitch - 1]; 149 147 if ad and $FFFF00 = 0 then 150 148 begin 151 s:= Phrases.Lookup('ADVANCES', ad);152 while TextWidth( s) > 112 do153 Delete( s, Length(s), 1);154 TextOut(xStart + X * xPitch + 2, yStart + Y * yPitch, s);149 S := Phrases.Lookup('ADVANCES', ad); 150 while TextWidth(S) > 112 do 151 Delete(S, Length(S), 1); 152 TextOut(xStart + X * xPitch + 2, yStart + Y * yPitch, S); 155 153 Pixels[xStart + X * xPitch + 10, yStart + Y * yPitch - 1] 156 154 := TransparentColor2; 157 end 155 end; 158 156 end; 159 157 160 // write legend158 // Write legend 161 159 TextOut(xLegend, yLegend, Phrases2.Lookup('ADVTREE_UP0')); 162 160 TextOut(xLegend, yLegend + yLegendPitch, Phrases2.Lookup('ADVTREE_UP1')); … … 172 170 end; 173 171 174 // fit window to image, center image in window, center window to screen172 // Fit window to image, center image in window, center window to screen 175 173 NewWidth := Min(DpiScreen.Width - 40, Image.Width + LeftBorder + RightBorder + 2 * BlackBorder); 176 174 NewHeight := Min(DpiScreen.Height - 40, Image.Height + TopBorder + BottomBorder + 2 * BlackBorder); … … 190 188 if Button = mbLeft then 191 189 begin 192 dragging := true;190 Dragging := True; 193 191 xDown := X; 194 192 yDown := Y; … … 199 197 Shift: TShiftState; X, Y: Integer); 200 198 begin 201 dragging := false;199 Dragging := False; 202 200 end; 203 201 … … 205 203 X, Y: Integer); 206 204 begin 207 if dragging then205 if Dragging then 208 206 begin 209 207 xOffset := xOffset + X - xDown; -
branches/highdpi/LocalPlayer/Term.lfm
r405 r465 1 1 object MainScreen: TMainScreen 2 Left = 5162 Left = 469 3 3 Height = 480 4 Top = 8344 Top = 251 5 5 Width = 800 6 6 HorzScrollBar.Visible = False … … 14 14 DesignTimePPI = 144 15 15 Font.Color = clWindowText 16 Font.Height = - 1316 Font.Height = -20 17 17 Font.Name = 'MS Sans Serif' 18 18 KeyPreview = True … … 31 31 OnShow = FormShow 32 32 Position = poDefault 33 LCLVersion = '2. 0.12.0'33 LCLVersion = '2.2.0.4' 34 34 Scaled = False 35 35 WindowState = wsMaximized … … 227 227 Tag = 7 228 228 ShortCut = 112 229 OnClick = MenuClick229 OnClick = mHelpClick 230 230 end 231 231 object mTechTree: TDpiMenuItem 232 232 GroupIndex = 1 233 233 ShortCut = 84 234 OnClick = MenuClick234 OnClick = mTechTreeClick 235 235 end 236 236 object N12: TDpiMenuItem … … 251 251 object mOwnMovement: TDpiMenuItem 252 252 Tag = 30 253 GroupIndex = 1254 RadioItem = True255 253 object mSlowMoves: TDpiMenuItem 256 254 Tag = 75 … … 278 276 object mAllyMovement: TDpiMenuItem 279 277 Tag = 90 280 GroupIndex = 1281 RadioItem = True282 278 object mAlSlowMoves: TDpiMenuItem 283 279 Tag = 91 … … 305 301 object mEnemyMovement: TDpiMenuItem 306 302 Tag = 74 307 GroupIndex = 1308 RadioItem = True309 303 object mEnMoves: TDpiMenuItem 310 304 Tag = 78 … … 349 343 object mRep: TDpiMenuItem 350 344 Tag = 34 351 GroupIndex = 1352 345 object mRep0: TDpiMenuItem 353 346 OnClick = mRepClicked … … 417 410 Caption = '-' 418 411 GroupIndex = 1 412 RadioItem = True 419 413 end 420 414 object mWaitTurn: TDpiMenuItem 421 415 Tag = 32 422 GroupIndex = 1423 416 OnClick = Toggle 424 417 end 425 418 object mScrolling: TDpiMenuItem 426 419 Tag = 84 427 GroupIndex = 1428 420 object mScrollSlow: TDpiMenuItem 429 421 Tag = 85 … … 444 436 object mTileSize: TDpiMenuItem 445 437 Tag = 96 446 GroupIndex = 1447 438 object mSmallTiles: TDpiMenuItem 448 439 Tag = 97 … … 463 454 object mSound: TDpiMenuItem 464 455 Tag = 80 465 GroupIndex = 1466 456 object mSoundOn: TDpiMenuItem 467 457 Tag = 82 … … 484 474 Caption = '-' 485 475 GroupIndex = 1 476 RadioItem = True 486 477 end 487 478 object mTest: TDpiMenuItem 488 479 Tag = 8 489 GroupIndex = 1490 480 object mJump: TDpiMenuItem 491 481 Tag = 54 492 482 ShortCut = 16458 493 OnClick = MenuClick483 OnClick = mJumpClick 494 484 end 495 485 object mRun: TDpiMenuItem 496 486 Tag = 63 497 487 ShortCut = 16466 498 OnClick = MenuClick488 OnClick = mRunClick 499 489 end 500 490 object mNames: TDpiMenuItem … … 552 542 object mEnhanceDef: TDpiMenuItem 553 543 Tag = 40 554 OnClick = MenuClick544 OnClick = mEnhanceDefClick 555 545 end 556 546 object mCityTypes: TDpiMenuItem 557 547 Tag = 11 558 OnClick = MenuClick548 OnClick = mCityTypesClick 559 549 end 560 550 end … … 563 553 GroupIndex = 1 564 554 ShortCut = 16466 565 OnClick = MenuClick555 OnClick = mRandomMapClick 566 556 end 567 557 object N3: TDpiMenuItem … … 572 562 Tag = 88 573 563 GroupIndex = 1 574 OnClick = MenuClick564 OnClick = mWebsiteClick 575 565 end 576 566 object N2: TDpiMenuItem … … 582 572 GroupIndex = 1 583 573 ShortCut = 16465 584 OnClick = MenuClick574 OnClick = mResignClick 585 575 end 586 576 end … … 592 582 Tag = 72 593 583 ShortCut = 16452 594 OnClick = MenuClick584 OnClick = mDisbandOrUtilizeClick 595 585 end 596 586 object mUtilize: TDpiMenuItem 597 587 ShortCut = 90 598 OnClick = MenuClick588 OnClick = mDisbandOrUtilizeClick 599 589 end 600 590 object N1: TDpiMenuItem … … 603 593 object mcity: TDpiMenuItem 604 594 ShortCut = 66 605 OnClick = MenuClick595 OnClick = mcityClick 606 596 end 607 597 object mPillage: TDpiMenuItem 608 598 Tag = 19 609 599 ShortCut = 16464 610 OnClick = MenuClick600 OnClick = mPillageClick 611 601 end 612 602 object N5: TDpiMenuItem … … 615 605 object mhome: TDpiMenuItem 616 606 ShortCut = 72 617 OnClick = MenuClick607 OnClick = mhomeClick 618 608 end 619 609 object mLoad: TDpiMenuItem 620 610 Tag = 24 621 611 ShortCut = 76 622 OnClick = MenuClick612 OnClick = mLoadClick 623 613 end 624 614 object mUnload: TDpiMenuItem 625 615 Tag = 70 626 616 ShortCut = 85 627 OnClick = MenuClick617 OnClick = mUnloadClick 628 618 end 629 619 object mSelectTransport: TDpiMenuItem 630 620 Tag = 73 631 621 ShortCut = 16468 632 OnClick = MenuClick622 OnClick = mSelectTransportClick 633 623 end 634 624 object mGoOn: TDpiMenuItem 635 625 Tag = 13 636 626 ShortCut = 71 637 OnClick = MenuClick627 OnClick = mGoOnClick 638 628 end 639 629 object mCancel: TDpiMenuItem 640 630 Tag = 1 641 631 ShortCut = 16451 642 OnClick = MenuClick632 OnClick = mCancelClick 643 633 end 644 634 object mRecover: TDpiMenuItem 645 635 Tag = 69 646 636 ShortCut = 86 647 OnClick = MenuClick637 OnClick = mRecoverClick 648 638 end 649 639 object mwait: TDpiMenuItem 650 640 Tag = 25 651 641 ShortCut = 87 652 OnClick = MenuClick642 OnClick = mwaitClick 653 643 end 654 644 object mnoorders: TDpiMenuItem 655 645 Tag = 26 656 646 ShortCut = 32 657 OnClick = MenuClick647 OnClick = mnoordersClick 658 648 end 659 649 object mstay: TDpiMenuItem 660 650 Tag = 22 661 651 ShortCut = 83 662 OnClick = MenuClick652 OnClick = mstayClick 663 653 end 664 654 object mCentre: TDpiMenuItem 665 655 Tag = 12 666 656 ShortCut = 67 667 OnClick = MenuClick657 OnClick = mCentreClick 668 658 end 669 659 object N13: TDpiMenuItem … … 673 663 Tag = 100 674 664 ShortCut = 46 675 OnClick = MenuClick665 OnClick = mPrevUnitClick 676 666 end 677 667 object mNextUnit: TDpiMenuItem 678 668 Tag = 101 679 669 ShortCut = 45 680 OnClick = MenuClick670 OnClick = mNextUnitClick 681 671 end 682 672 end … … 688 678 Tag = 9 689 679 ShortCut = 113 690 OnClick = MenuClick680 OnClick = mUnitStatClick 691 681 end 692 682 object mCityStat: TDpiMenuItem 693 683 Tag = 37 694 684 ShortCut = 114 695 OnClick = MenuClick685 OnClick = mCityStatClick 696 686 end 697 687 object mScienceStat: TDpiMenuItem 698 688 Tag = 38 699 689 ShortCut = 115 700 OnClick = MenuClick690 OnClick = mScienceStatClick 701 691 end 702 692 object mEUnitStat: TDpiMenuItem 703 693 Tag = 50 704 694 ShortCut = 116 705 OnClick = MenuClick695 OnClick = mEUnitStatClick 706 696 end 707 697 object mDiagram: TDpiMenuItem 708 698 Tag = 21 709 699 ShortCut = 117 710 OnClick = MenuClick700 OnClick = mDiagramClick 711 701 end 712 702 object mWonders: TDpiMenuItem 713 703 Tag = 6 714 704 ShortCut = 118 715 OnClick = MenuClick705 OnClick = mWondersClick 716 706 end 717 707 object mShips: TDpiMenuItem 718 708 Tag = 41 719 709 ShortCut = 119 720 OnClick = MenuClick710 OnClick = mShipsClick 721 711 end 722 712 object N4: TDpiMenuItem … … 726 716 Tag = 55 727 717 ShortCut = 120 728 OnClick = MenuClick718 OnClick = mNationsClick 729 719 end 730 720 object mEmpire: TDpiMenuItem 731 721 Tag = 3 732 722 ShortCut = 121 733 OnClick = MenuClick723 OnClick = mEmpireClick 734 724 end 735 725 object mRevolution: TDpiMenuItem 736 726 Tag = 89 737 OnClick = MenuClick727 OnClick = mRevolutionClick 738 728 end 739 729 end … … 751 741 Tag = 273 752 742 ShortCut = 79 753 OnClick = MenuClick743 OnClick = mtransClick 754 744 end 755 745 object mAfforest: TDpiMenuItem 756 746 Tag = 301 757 747 ShortCut = 77 758 OnClick = MenuClick748 OnClick = mAfforestClick 759 749 end 760 750 object mClear: TDpiMenuItem 761 751 Tag = 298 762 752 ShortCut = 73 763 OnClick = MenuClick753 OnClick = mClearClick 764 754 end 765 755 object mfort: TDpiMenuItem 766 756 Tag = 276 767 757 ShortCut = 70 768 OnClick = MenuClick758 OnClick = mfortClick 769 759 end 770 760 object mAirBase: TDpiMenuItem 771 761 Tag = 272 772 762 ShortCut = 65 773 OnClick = MenuClick763 OnClick = mAirBaseClick 774 764 end 775 765 object mCanal: TDpiMenuItem 776 766 Tag = 279 777 767 ShortCut = 78 778 OnClick = MenuClick768 OnClick = mCanalClick 779 769 end 780 770 object mmine: TDpiMenuItem 781 771 Tag = 302 782 772 ShortCut = 77 783 OnClick = MenuClick773 OnClick = mmineClick 784 774 end 785 775 object mFarm: TDpiMenuItem 786 776 Tag = 300 787 777 ShortCut = 73 788 OnClick = MenuClick778 OnClick = mFarmClick 789 779 end 790 780 object mirrigation: TDpiMenuItem 791 781 Tag = 299 792 782 ShortCut = 73 793 OnClick = MenuClick794 end 795 object m rr: TDpiMenuItem783 OnClick = mirrigationClick 784 end 785 object mRailRoad: TDpiMenuItem 796 786 Tag = 297 797 787 ShortCut = 82 798 OnClick = MenuClick788 OnClick = mRailRoadClick 799 789 end 800 790 object mroad: TDpiMenuItem 801 791 Tag = 296 802 792 ShortCut = 82 803 OnClick = MenuClick793 OnClick = mroadClick 804 794 end 805 795 object mpollution: TDpiMenuItem 806 796 Tag = 274 807 797 ShortCut = 80 808 OnClick = MenuClick798 OnClick = mpollutionClick 809 799 end 810 800 object mEnhance: TDpiMenuItem 811 801 Tag = 295 812 802 ShortCut = 69 813 OnClick = MenuClick803 OnClick = mEnhanceClick 814 804 end 815 805 end -
branches/highdpi/LocalPlayer/Term.pas
r405 r465 5 5 6 6 uses 7 UDpiControls, {$IFDEF W indows}7 UDpiControls, {$IFDEF WINDOWS} 8 8 Windows, 9 9 {$ENDIF} 10 {$IFDEF Linux}10 {$IFDEF UNIX} 11 11 LMessages, Messages, 12 12 {$ENDIF} … … 14 14 LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, DrawDlg, Types, 15 15 Forms, Menus, ExtCtrls, dateutils, Platform, ButtonB, ButtonC, EOTButton, Area, 16 UGraphicSet, UMiniMap, IsoEngine; 16 GraphicSet, MiniMap, IsoEngine, Wonders, TechTree, Enhance, Nego, CityType, 17 Diagram, CityScreen, Rates, Battle, NatStat, UnitStat, Draft, Select, MessgEx, 18 Help; 17 19 18 20 const … … 68 70 mWonders: TDpiMenuItem; 69 71 mScienceStat: TDpiMenuItem; 70 mR R: TDpiMenuItem;72 mRailRoad: TDpiMenuItem; 71 73 mClear: TDpiMenuItem; 72 74 mFarm: TDpiMenuItem; … … 181 183 procedure FormMouseWheel(Sender: TObject; Shift: TShiftState; 182 184 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); 185 procedure mAfforestClick(Sender: TObject); 186 procedure mAirBaseClick(Sender: TObject); 187 procedure mCanalClick(Sender: TObject); 188 procedure mCancelClick(Sender: TObject); 189 procedure mCentreClick(Sender: TObject); 190 procedure mcityClick(Sender: TObject); 191 procedure mCityStatClick(Sender: TObject); 192 procedure mCityTypesClick(Sender: TObject); 193 procedure mClearClick(Sender: TObject); 194 procedure mDiagramClick(Sender: TObject); 195 procedure mEmpireClick(Sender: TObject); 196 procedure mEnhanceClick(Sender: TObject); 197 procedure mEnhanceDefClick(Sender: TObject); 198 procedure mEUnitStatClick(Sender: TObject); 199 procedure mFarmClick(Sender: TObject); 200 procedure mfortClick(Sender: TObject); 201 procedure mGoOnClick(Sender: TObject); 202 procedure mHelpClick(Sender: TObject); 203 procedure mhomeClick(Sender: TObject); 204 procedure mirrigationClick(Sender: TObject); 205 procedure mirrigationDrawItem(Sender: TObject; ACanvas: TDpiCanvas; 206 ARect: TRect; AState: TOwnerDrawState); 207 procedure mJumpClick(Sender: TObject); 208 procedure mLoadClick(Sender: TObject); 209 procedure mmineClick(Sender: TObject); 210 procedure mNationsClick(Sender: TObject); 211 procedure mNextUnitClick(Sender: TObject); 212 procedure mnoordersClick(Sender: TObject); 213 procedure mPillageClick(Sender: TObject); 214 procedure mpollutionClick(Sender: TObject); 215 procedure mPrevUnitClick(Sender: TObject); 216 procedure mRandomMapClick(Sender: TObject); 217 procedure mRecoverClick(Sender: TObject); 218 procedure mResignClick(Sender: TObject); 219 procedure mRevolutionClick(Sender: TObject); 220 procedure mroadClick(Sender: TObject); 221 procedure mRailRoadClick(Sender: TObject); 222 procedure mRunClick(Sender: TObject); 223 procedure mScienceStatClick(Sender: TObject); 224 procedure mSelectTransportClick(Sender: TObject); 225 procedure mShipsClick(Sender: TObject); 226 procedure mstayClick(Sender: TObject); 227 procedure mTechTreeClick(Sender: TObject); 228 procedure mtransClick(Sender: TObject); 229 procedure mUnitStatClick(Sender: TObject); 230 procedure mUnloadClick(Sender: TObject); 231 procedure mwaitClick(Sender: TObject); 232 procedure mWebsiteClick(Sender: TObject); 233 procedure mWondersClick(Sender: TObject); 183 234 procedure Timer1Timer(Sender: TObject); 184 235 procedure MapBoxMouseDown(Sender: TObject; Button: TMouseButton; 185 Shift: TShiftState; x, y: integer);236 Shift: TShiftState; X, Y: Integer); 186 237 procedure EOTClick(Sender: TObject); 187 238 procedure PanelBoxMouseDown(Sender: TObject; Button: TMouseButton; 188 Shift: TShiftState; x, y: integer);189 procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);190 procedure MenuClick(Sender: TObject);239 Shift: TShiftState; X, Y: Integer); 240 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 241 procedure mDisbandOrUtilizeClick(Sender: TObject); 191 242 procedure FormResize(Sender: TObject); 192 243 procedure PanelBtnClick(Sender: TObject); 193 procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);244 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); 194 245 procedure Toggle(Sender: TObject); 195 246 procedure PanelBoxMouseMove(Sender: TObject; Shift: TShiftState; 196 x, y: integer);247 X, Y: Integer); 197 248 procedure PanelBoxMouseUp(Sender: TObject; Button: TMouseButton; 198 Shift: TShiftState; x, y: integer);249 Shift: TShiftState; X, Y: Integer); 199 250 procedure MapBoxMouseMove(Sender: TObject; Shift: TShiftState; 200 x, y: integer);251 X, Y: Integer); 201 252 procedure mShowClick(Sender: TObject); 202 253 procedure FormMouseDown(Sender: TObject; Button: TMouseButton; 203 Shift: TShiftState; x, y: integer);204 procedure FormMouseMove(Sender: TObject; Shift: TShiftState; x, y: integer);254 Shift: TShiftState; X, Y: Integer); 255 procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); 205 256 procedure FormMouseUp(Sender: TObject; Button: TMouseButton; 206 Shift: TShiftState; x, y: integer);257 Shift: TShiftState; X, Y: Integer); 207 258 procedure FormPaint(Sender: TObject); 208 259 procedure mRepClicked(Sender: TObject); … … 214 265 procedure mNamesClick(Sender: TObject); 215 266 procedure MapBtnClick(Sender: TObject); 216 procedure FormKeyUp(Sender: TObject; var Key: word; Shift: TShiftState);267 procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 217 268 procedure CreateUnitClick(Sender: TObject); 218 269 procedure mSoundOffClick(Sender: TObject); … … 275 326 NoMap: TIsoMap; 276 327 NoMapPanel: TIsoMap; 277 function ChooseUnusedTribe: integer; 328 // Forms 329 FWondersDlg: TWondersDlg; 330 FTechTreeDlg: TTechTreeDlg; 331 FEnhanceDlg: TEnhanceDlg; 332 FNegoDlg: TNegoDlg; 333 FCityTypeDlg: TCityTypeDlg; 334 FDiaDlg: TDiaDlg; 335 FCityDlg: TCityDlg; 336 FRatesDlg: TRatesDlg; 337 FBattleDlg: TBattleDlg; 338 FNatStatDlg: TNatStatDlg; 339 FUnitStatDlg: TUnitStatDlg; 340 FDraftDlg: TDraftDlg; 341 FModalSelectDlg: TModalSelectDlg; 342 FListDlg: TListDlg; 343 FMessgExDlg: TMessgExDlg; 344 FHelpDlg: THelpDlg; 345 procedure ArrangeDialogs; 346 procedure ArrangeDialog(Form: TBufferedDrawDlg); 347 function ChooseUnusedTribe: Integer; 348 function DoJob(j0: Integer): Integer; 349 function GetBattleDlg: TBattleDlg; 350 function GetCityDlg: TCityDlg; 351 function GetCityTypeDlg: TCityTypeDlg; 352 function GetDiaDlg: TDiaDlg; 353 function GetDraftDlg: TDraftDlg; 354 function GetEnhanceDlg: TEnhanceDlg; 355 function GetHelpDlg: THelpDlg; 356 function GetListDlg: TListDlg; 357 function GetMessgExDlg: TMessgExDlg; 358 function GetModalSelectDlg: TModalSelectDlg; 359 function GetNatStatDlg: TNatStatDlg; 360 function GetNegoDlg: TNegoDlg; 361 function GetRatesDlg: TRatesDlg; 362 function GetTechTreeDlg: TTechTreeDlg; 278 363 procedure GetTribeList; 364 function GetUnitStatDlg: TUnitStatDlg; 365 function GetWondersDlg: TWondersDlg; 279 366 procedure InitModule; 280 367 procedure DoneModule; 281 procedure InitTurn(NewPlayer: integer);368 procedure InitTurn(NewPlayer: Integer); 282 369 procedure SaveMenuItemsState; 283 370 procedure ScrollBarUpdate(Sender: TObject); … … 291 378 procedure FocusNextUnit(Dir: Integer = 1); 292 379 procedure NextUnit(NearLoc: Integer; AutoTurn: Boolean); 293 procedure Scroll(dx, dy: integer);294 procedure SetMapPos(Loc: integer; MapPos: TPoint);295 procedure Centre(Loc: integer);296 procedure SetTroopLoc(Loc: integer);297 procedure ProcessRect(x0, y0, nx, ny, Options: integer);298 procedure PaintLoc(Loc: integer; Radius: integer = 0);299 procedure PaintLoc_BeforeMove(FromLoc: integer);300 procedure PaintLocTemp(Loc: integer; Style: TPaintLocTempStyle = pltsNormal);301 procedure PaintBufferToScreen(xMap, yMap, width, height: integer);380 procedure Scroll(dx, dy: Integer); 381 procedure SetMapPos(Loc: Integer; MapPos: TPoint); 382 procedure Centre(Loc: Integer); 383 procedure SetTroopLoc(Loc: Integer); 384 procedure ProcessRect(x0, y0, nx, ny, Options: Integer); 385 procedure PaintLoc(Loc: Integer; Radius: Integer = 0); 386 procedure PaintLoc_BeforeMove(FromLoc: Integer); 387 procedure PaintLocTemp(Loc: Integer; Style: TPaintLocTempStyle = pltsNormal); 388 procedure PaintBufferToScreen(xMap, yMap, width, height: Integer); 302 389 procedure PaintDestination; 303 procedure SetUnFocus(uix: integer);304 function MoveUnit(dx, dy: integer; Options: integer = 0): integer;305 procedure MoveToLoc(Loc: integer; CheckSuicide: boolean);306 procedure MoveOnScreen(ShowMove: TShowMove; Step0, Step1, nStep: integer;307 Restore: boolean = true);308 procedure FocusOnLoc(Loc: integer; Options: integer = 0);309 function EndTurn(WasSkipped: boolean = false): boolean;390 procedure SetUnFocus(uix: Integer); 391 function MoveUnit(dx, dy: Integer; Options: Integer = 0): Integer; 392 procedure MoveToLoc(Loc: Integer; CheckSuicide: Boolean); 393 procedure MoveOnScreen(ShowMove: TShowMove; Step0, Step1, nStep: Integer; 394 Restore: Boolean = True); 395 procedure FocusOnLoc(Loc: Integer; Options: Integer = 0); 396 function EndTurn(WasSkipped: Boolean = False): Boolean; 310 397 procedure EndNego; 311 function IsPanelPixel( x, y: integer): boolean;398 function IsPanelPixel(X, Y: Integer): Boolean; 312 399 procedure InitPopup(Popup: TDpiPopupMenu); 313 400 procedure SetMapOptions; … … 315 402 procedure CheckTerrainBtnVisible; 316 403 procedure RememberPeaceViolation; 317 procedure SetDebugMap( p: integer);318 procedure SetViewpoint( p: integer);319 function LocationOfScreenPixel( x, y: integer): Integer;404 procedure SetDebugMap(P: Integer); 405 procedure SetViewpoint(P: Integer); 406 function LocationOfScreenPixel(X, Y: Integer): Integer; 320 407 function GetCenterLoc: Integer; 321 408 procedure SetTileSizeCenter(TileSize: TTileSize); 322 409 procedure SetTileSize(TileSize: TTileSize; Loc: Integer; MapPos: TPoint); 323 procedure RectInvalidate(Left, Top, Rigth, Bottom: integer);410 procedure RectInvalidate(Left, Top, Rigth, Bottom: Integer); 324 411 procedure ShowEnemyShipChange(ShowShipChange: TShowShipChange); 325 procedure SmartRectInvalidate(Left, Top, Rigth, Bottom: integer);412 procedure SmartRectInvalidate(Left, Top, Rigth, Bottom: Integer); 326 413 procedure LoadSettings; 327 414 procedure SaveSettings; … … 331 418 procedure UpdateKeyShortcuts; 332 419 procedure SetFullScreen(Active: Boolean); 333 procedure PaintZoomedTile(dst: TDpiBitmap; x, y, Loc: integer);420 procedure PaintZoomedTile(dst: TDpiBitmap; X, Y, Loc: Integer); 334 421 public 335 UsedOffscreenWidth, UsedOffscreenHeight: integer; 422 UsedOffscreenWidth: Integer; 423 UsedOffscreenHeight: Integer; 336 424 Offscreen: TDpiBitmap; 337 425 OffscreenUser: TDpiForm; 338 procedure Client(Command, NewPlayer: integer; var Data); 339 procedure SetAIName(p: integer; Name: string); 340 function ZoomToCity(Loc: integer; NextUnitOnClose: boolean = false; 341 ShowEvent: integer = 0): boolean; 342 procedure CityClosed(Activateuix: integer; StepFocus: boolean = false; 343 SelectFocus: boolean = false); 344 function DipCall(Command: integer): integer; 345 function OfferCall(var Offer: TOffer): integer; 346 procedure UpdateViews(UpdateCityScreen: boolean = false); 347 function ContactRefused(p: integer; Item: String): boolean; 426 procedure Client(Command, NewPlayer: Integer; var Data); 427 procedure SetAIName(P: Integer; Name: string); 428 function ZoomToCity(Loc: Integer; NextUnitOnClose: Boolean = False; 429 ShowEvent: Integer = 0): Boolean; 430 procedure CityClosed(Activateuix: Integer; StepFocus: Boolean = False; 431 SelectFocus: Boolean = False); 432 function DipCall(Command: Integer): Integer; 433 function OfferCall(var Offer: TOffer): Integer; 434 procedure UpdateViews(UpdateCityScreen: Boolean = False); 435 function ContactRefused(P: Integer; Item: String): Boolean; 436 // Forms 437 property WondersDlg: TWondersDlg read GetWondersDlg; 438 property TechTreeDlg: TTechTreeDlg read GetTechTreeDlg; 439 property EnhanceDlg: TEnhanceDlg read GetEnhanceDlg; 440 property NegoDlg: TNegoDlg read GetNegoDlg; 441 property CityTypeDlg: TCityTypeDlg read GetCityTypeDlg; 442 property DiaDlg: TDiaDlg read GetDiaDlg; 443 property CityDlg: TCityDlg read GetCityDlg; 444 property RatesDlg: TRatesDlg read GetRatesDlg; 445 property BattleDlg: TBattleDlg read GetBattleDlg; 446 property NatStatDlg: TNatStatDlg read GetNatStatDlg; 447 property UnitStatDlg: TUnitStatDlg read GetUnitStatDlg; 448 property DraftDlg: TDraftDlg read GetDraftDlg; 449 property ModalSelectDlg: TModalSelectDlg read GetModalSelectDlg; 450 property ListDlg: TListDlg read GetListDlg; 451 property MessgExDlg: TMessgExDlg read GetMessgExDlg; 452 property HelpDlg: THelpDlg read GetHelpDlg; 348 453 end; 349 454 … … 352 457 353 458 type 459 460 { TTribeInfo } 461 354 462 TTribeInfo = record 355 trix: integer;463 trix: Integer; 356 464 FileName: ShortString; 357 end; 465 function GetCommandDataSize: Byte; 466 end; 467 468 { TCityNameInfo } 358 469 359 470 TCityNameInfo = record 360 ID: integer;471 ID: Integer; 361 472 NewName: ShortString; 362 end; 473 function GetCommandDataSize: Byte; 474 end; 475 476 { TModelNameInfo } 363 477 364 478 TModelNameInfo = record 365 mix: integer;479 mix: Integer; 366 480 NewName: ShortString; 367 end; 368 369 TPriceSet = set of $00 .. $FF; 481 function GetCommandDataSize: Byte; 482 end; 483 484 TFormAction = (faClose, faEnable, faDisable, faUpdate, faSmartUpdateContent); 370 485 371 486 const … … 410 525 usToldNoReturn = $100; 411 526 usPersistent = usStay or usGoto or usEnhance or usRecover or 412 integer($FFFF0000);527 Integer($FFFF0000); 413 528 414 529 { model status flags } … … 424 539 adNexus = $803; 425 540 426 SpecialModelPictureCode: array [0 .. nSpecialModel - 1] of integer = (10,541 SpecialModelPictureCode: array [0 .. nSpecialModel - 1] of Integer = (10, 427 542 11, 40, 41, 21, 30, { 50,51, } 64, 74, { 71, } 73); 428 543 … … 437 552 438 553 nCityEventPriority = 16; 439 CityEventPriority: array [0 .. nCityEventPriority - 1] of integer =554 CityEventPriority: array [0 .. nCityEventPriority - 1] of Integer = 440 555 (chDisorder, chImprovementLost, chUnitLost, chAllImpsMade, chProduction, 441 556 chOldWonder, chNoSettlerProd, chPopDecrease, chProductionSabotaged, … … 504 619 DestinationMarkON: Boolean; 505 620 StartRunning: Boolean; 506 StayOnTop_Ensured: Boolean;507 621 Supervising: Boolean; 508 622 UnusedTribeFiles: TStringList; … … 512 626 DipMem: array [0 .. nPl - 1] of TDipMem; 513 627 514 function CityEventName( i: integer): string;515 function RoughCredibility(Credibility: integer): integer;516 517 function InitEnemyModel(emix: integer): boolean;628 function CityEventName(I: Integer): string; 629 function RoughCredibility(Credibility: Integer): Integer; 630 631 function InitEnemyModel(emix: Integer): Boolean; 518 632 procedure InitAllEnemyModels; 519 procedure InitMyModel(mix: integer; final: boolean); 520 521 procedure ImpImage(ca: TDpiCanvas; x, y, iix: integer; Government: integer = -1; 522 IsControl: boolean = false); 523 procedure HelpOnTerrain(Loc, NewMode: integer); 633 procedure InitMyModel(Mix: Integer; Final: Boolean); 634 635 procedure ImpImage(ca: TDpiCanvas; X, Y, iix: Integer; Government: Integer = -1; 636 IsControl: Boolean = False); 637 procedure HelpOnTerrain(Loc: Integer; NewMode: TWindowMode); 638 function AlignUp(Value, Alignment: Integer): Integer; 524 639 525 640 … … 527 642 528 643 uses 529 Directories, CityScreen, Draft, MessgEx, Select, CityType, Help, 530 UnitStat, Log, Diagram, NatStat, Wonders, Enhance, Nego, UPixelPointer, Sound, 531 Battle, Rates, TechTree, Registry, Global, UKeyBindings; 644 Directories, Log, PixelPointer, Sound, Registry, Global, KeyBindings, CmdList; 532 645 533 646 {$R *.lfm} … … 536 649 lxmax_xxx = 130; 537 650 LeftPanelWidth = 70; 538 LeftPanelWidth_Editor = 46;539 651 overlap = PanelHeight - MidPanelHeight; 540 652 yTroop = PanelHeight - 83; 541 653 xPalace = 66; 542 654 yPalace = 24; // 120; 543 xAdvisor = 108;544 yAdvisor = 48; 655 { xAdvisor = 108; 656 yAdvisor = 48;} 545 657 xUnitText = 80; 546 PaperShade = 3;547 658 BlinkOnTime = 12; 548 659 BlinkOffTime = 6; 549 660 MoveTime = 300; // {time for moving a unit in ms} 550 661 WaitAfterShowMove = 32; 551 FastScrolling = false; // causes problems with overlapping windows662 FastScrolling = False; // causes problems with overlapping windows 552 663 553 664 nBrushTypes = 26; … … 587 698 CurrentMoveInfo: TCurrentMoveInfo; 588 699 589 function CityEventName( i: integer): string;590 begin 591 if i= 14 then // chAllImpsMade700 function CityEventName(I: Integer): string; 701 begin 702 if I = 14 then // chAllImpsMade 592 703 if not Phrases2FallenBackToEnglish then 593 result := Phrases2.Lookup('CITYEVENT_ALLIMPSMADE')704 Result := Phrases2.Lookup('CITYEVENT_ALLIMPSMADE') 594 705 else 595 result := Phrases.Lookup('CITYEVENTS', 1)706 Result := Phrases.Lookup('CITYEVENTS', 1) 596 707 else 597 result := Phrases.Lookup('CITYEVENTS', i);708 Result := Phrases.Lookup('CITYEVENTS', I); 598 709 end; 599 710 … … 605 716 TBuffer = array [0 .. 99999, 0 .. 2] of Integer; 606 717 var 607 Sum, Cnt, dx, dy, nx, ny, ix, iy, ir, x, y, c, ch: Integer; 718 Sum: Int64; 719 Cnt, dx, dy, nx, ny, ix, iy, ir, X, Y, C, ch: Integer; 608 720 xdivider, ydivider: Integer; 609 721 Resampled: ^TBuffer; … … 611 723 begin 612 724 nx := BigImp.Width div xSizeBig * xSizeSmall; 613 ny := BigImp.Height div ySizeBig * ySizeSmall;614 SmallImp.SetSize(nx, ny);615 SmallImp.Canvas.StretchDraw(Rect(0, 0, SmallImp.Width, SmallImp.Height), BigImp);616 617 { nx := BigImp.Width div xSizeBig * xSizeSmall;618 725 ny := BigImp.Height div ySizeBig * ySizeSmall; 619 726 … … 624 731 for ix := 0 to BigImp.Width div xSizeBig - 1 do 625 732 for iy := 0 to BigImp.Height div ySizeBig - 1 do begin 626 PixelPtr := PixelPointer(BigImp, ScaleToNative(ix * xSizeBig),627 ScaleToNative( cut + iy * ySizeBig));628 for y := 0 to ScaleToNative(ySizeBig - 2 * cut) - 1 do begin629 ydivider := (ScaleFromNative( y) * ySizeSmall div (ySizeBig - 2 * cut) + 1) *630 (ySizeBig - 2 * cut) - ScaleFromNative(y) * ySizeSmall;733 PixelPtr := TPixelPointer.Create(BigImp, ScaleToNative(ix * xSizeBig), 734 ScaleToNative(Cut + iy * ySizeBig)); 735 for Y := 0 to ScaleToNative(ySizeBig - 2 * Cut) - 1 do begin 736 ydivider := (ScaleFromNative(Y) * ySizeSmall div (ySizeBig - 2 * Cut) + 1) * 737 (ySizeBig - 2 * Cut) - ScaleFromNative(Y) * ySizeSmall; 631 738 if ydivider > ySizeSmall then 632 739 ydivider := ySizeSmall; 633 for x:= 0 to ScaleToNative(xSizeBig) - 1 do begin634 ir := ix * xSizeSmall + iy * nx * ySizeSmall + ScaleFromNative( x) *635 xSizeSmall div xSizeBig + ScaleFromNative( y) *636 ySizeSmall div (ySizeBig - 2 * cut) * nx;637 xdivider := (ScaleFromNative( x) * xSizeSmall div xSizeBig + 1) *638 xSizeBig - ScaleFromNative( x) * xSizeSmall;740 for X := 0 to ScaleToNative(xSizeBig) - 1 do begin 741 ir := ix * xSizeSmall + iy * nx * ySizeSmall + ScaleFromNative(X) * 742 xSizeSmall div xSizeBig + ScaleFromNative(Y) * 743 ySizeSmall div (ySizeBig - 2 * Cut) * nx; 744 xdivider := (ScaleFromNative(X) * xSizeSmall div xSizeBig + 1) * 745 xSizeBig - ScaleFromNative(X) * xSizeSmall; 639 746 if xdivider > xSizeSmall then 640 747 xdivider := xSizeSmall; 641 748 for ch := 0 to 2 do begin 642 c:= PixelPtr.Pixel^.Planes[ch];643 Inc(Resampled[ir, ch], c* xdivider * ydivider);749 C := PixelPtr.Pixel^.Planes[ch]; 750 Inc(Resampled[ir, ch], C * xdivider * ydivider); 644 751 if xdivider < xSizeSmall then 645 Inc(Resampled[ir + 1, ch], c* (xSizeSmall - xdivider) *752 Inc(Resampled[ir + 1, ch], C * (xSizeSmall - xdivider) * 646 753 ydivider); 647 754 if ydivider < ySizeSmall then 648 755 Inc(Resampled[ir + nx, ch], 649 c* xdivider * (ySizeSmall - ydivider));756 C * xdivider * (ySizeSmall - ydivider)); 650 757 if (xdivider < xSizeSmall) and (ydivider < ySizeSmall) then 651 Inc(Resampled[ir + nx + 1, ch], c* (xSizeSmall - xdivider) *758 Inc(Resampled[ir + nx + 1, ch], C * (xSizeSmall - xdivider) * 652 759 (ySizeSmall - ydivider)); 653 760 end; … … 662 769 SmallImp.SetSize(nx, ny); 663 770 SmallImp.BeginUpdate; 664 PixelPtr := PixelPointer(SmallImp);665 for y:= 0 to ScaleToNative(ny) - 1 do begin666 for x:= 0 to ScaleToNative(nx) - 1 do begin771 PixelPtr := TPixelPointer.Create(SmallImp); 772 for Y := 0 to ScaleToNative(ny) - 1 do begin 773 for X := 0 to ScaleToNative(nx) - 1 do begin 667 774 for ch := 0 to 2 do begin 668 775 Sum := 0; 669 776 Cnt := 0; 670 777 for dy := -1 to 1 do 671 if ((dy >= 0) or (ScaleFromNative( y) mod ySizeSmall > 0)) and672 ((dy <= 0) or (ScaleFromNative( y) mod ySizeSmall < ySizeSmall - 1)) then778 if ((dy >= 0) or (ScaleFromNative(Y) mod ySizeSmall > 0)) and 779 ((dy <= 0) or (ScaleFromNative(Y) mod ySizeSmall < ySizeSmall - 1)) then 673 780 for dx := -1 to 1 do 674 if ((dx >= 0) or (ScaleFromNative( x) mod xSizeSmall > 0)) and675 ((dx <= 0) or (ScaleFromNative( x) mod xSizeSmall < xSizeSmall - 1)) then781 if ((dx >= 0) or (ScaleFromNative(X) mod xSizeSmall > 0)) and 782 ((dx <= 0) or (ScaleFromNative(X) mod xSizeSmall < xSizeSmall - 1)) then 676 783 begin 677 Inc(Sum, Resampled[ScaleFromNative( x) + dx + nx * (ScaleFromNative(y) + dy), ch]);784 Inc(Sum, Resampled[ScaleFromNative(X) + dx + nx * (ScaleFromNative(Y) + dy), ch]); 678 785 Inc(Cnt); 679 786 end; 680 Sum := ((Cnt * Sharpen + 800) * Resampled[ScaleFromNative( x) + nx * ScaleFromNative(y), ch] - Sum *681 Sharpen) div (800 * xSizeBig * (ySizeBig - 2 * cut));787 Sum := ((Cnt * Sharpen + 800) * Resampled[ScaleFromNative(X) + nx * ScaleFromNative(Y), ch] - Sum * 788 Sharpen) div (800 * xSizeBig * (ySizeBig - 2 * Cut)); 682 789 if Sum < 0 then Sum := 0; 683 790 if Sum > 255 then Sum := 255; … … 690 797 SmallImp.EndUpdate; 691 798 FreeMem(Resampled); 692 } 693 end; 694 695 procedure ImpImage(ca: TDpiCanvas; x, y, iix: integer; Government: integer; 696 IsControl: boolean); 799 end; 800 801 procedure ImpImage(ca: TDpiCanvas; X, Y, iix: Integer; Government: Integer; 802 IsControl: Boolean); 697 803 begin 698 804 if Government < 0 then … … 700 806 if (iix = imPalace) and (Government <> gAnarchy) then 701 807 iix := Government - 8; 702 FrameImage(ca, BigImp, x, y, xSizeBig, ySizeBig, (iix + SystemIconLines * 7)808 FrameImage(ca, BigImp, X, Y, xSizeBig, ySizeBig, (iix + SystemIconLines * 7) 703 809 mod 7 * xSizeBig, (iix + SystemIconLines * 7) div 7 * ySizeBig, IsControl); 704 810 end; 705 811 706 procedure HelpOnTerrain(Loc , NewMode: integer);812 procedure HelpOnTerrain(Loc: Integer; NewMode: TWindowMode); 707 813 begin 708 814 if MyMap[Loc] and fDeadLands <> 0 then 709 HelpDlg.ShowNewContent(NewMode, hkTer, 3 * 12)815 MainScreen.HelpDlg.ShowNewContent(NewMode, hkTer, 3 * 12) 710 816 else if (MyMap[Loc] and fTerrain = fForest) and IsJungle(Loc div G.lx) then 711 HelpDlg.ShowNewContent(NewMode, hkTer,817 MainScreen.HelpDlg.ShowNewContent(NewMode, hkTer, 712 818 fJungle + (MyMap[Loc] shr 5 and 3) * 12) 713 819 else 714 HelpDlg.ShowNewContent(NewMode, hkTer, MyMap[Loc] and fTerrain +820 MainScreen.HelpDlg.ShowNewContent(NewMode, hkTer, MyMap[Loc] and fTerrain + 715 821 (MyMap[Loc] shr 5 and 3) * 12); 716 822 end; 717 823 824 function AlignUp(Value, Alignment: Integer): Integer; 825 begin 826 Result := Value or (Alignment - 1); 827 end; 828 718 829 { *** tribe management procedures *** } 719 830 720 function RoughCredibility(Credibility: integer): integer;831 function RoughCredibility(Credibility: Integer): Integer; 721 832 begin 722 833 case Credibility of 723 834 0 .. 69: 724 result := 0;835 Result := 0; 725 836 70 .. 89: 726 result := 1;837 Result := 1; 727 838 90 .. 99: 728 result := 2;839 Result := 2; 729 840 100: 730 result := 3731 end; 732 end; 733 734 procedure ChooseModelPicture( p, mix, code, Hash, Turn: integer;735 ForceNew, final: boolean);841 Result := 3; 842 end; 843 end; 844 845 procedure ChooseModelPicture(P, mix, Code, Hash, Turn: Integer; 846 ForceNew, final: Boolean); 736 847 var 737 i: integer;848 I: Integer; 738 849 Picture: TModelPictureInfo; 739 IsNew: boolean;740 begin 741 Picture.trix := p;850 IsNew: Boolean; 851 begin 852 Picture.trix := P; 742 853 Picture.mix := mix; 743 if code = 74 then854 if Code = 74 then 744 855 begin // use correct pictures for slaves 745 if Tribe[ p].mixSlaves < 0 then746 if not TribeOriginal[ p] then747 Tribe[ p].mixSlaves := mix856 if Tribe[P].mixSlaves < 0 then 857 if not TribeOriginal[P] then 858 Tribe[P].mixSlaves := mix 748 859 else 749 860 begin 750 i := mix + pshl 16;751 Server(cSetSlaveIndex, 0, 0, i);861 I := mix + P shl 16; 862 Server(cSetSlaveIndex, 0, 0, I); 752 863 end; 753 864 if ToldSlavery = 1 then … … 757 868 Picture.Hash := 0; 758 869 Picture.GrName := 'StdUnits.png'; 759 IsNew := true;870 IsNew := True; 760 871 end 761 872 else 762 873 begin 763 874 Picture.Hash := Hash; 764 IsNew := Tribe[ p].ChooseModelPicture(Picture, code, Turn, ForceNew);875 IsNew := Tribe[P].ChooseModelPicture(Picture, Code, Turn, ForceNew); 765 876 end; 766 877 if final then 767 if not TribeOriginal[ p] then768 Tribe[ p].SetModelPicture(Picture, IsNew)878 if not TribeOriginal[P] then 879 Tribe[P].SetModelPicture(Picture, IsNew) 769 880 else if IsNew then 770 Server( cSetNewModelPicture + (Length(Picture.GrName) + 1 + 16 + 3) div 4,881 Server(CommandWithData(cSetNewModelPicture, Picture.GetCommandDataSize), 771 882 0, 0, Picture) 772 883 else 773 Server( cSetModelPicture + (Length(Picture.GrName) + 1 + 16 + 3) div 4, 0,774 0, Picture)884 Server(CommandWithData(cSetModelPicture, Picture.GetCommandDataSize), 885 0, 0, Picture) 775 886 else 776 with Tribe[ p].ModelPicture[mix] do887 with Tribe[P].ModelPicture[mix] do 777 888 begin 778 889 HGr := LoadGraphicSet(Picture.GrName); … … 781 892 end; 782 893 783 function InitEnemyModel(emix: integer): boolean;894 function InitEnemyModel(emix: Integer): Boolean; 784 895 begin 785 896 if GameMode = cMovie then 786 897 begin 787 result := false;788 exit898 Result := False; 899 Exit; 789 900 end; 790 901 with MyRO.EnemyModel[emix] do 791 902 ChooseModelPicture(Owner, mix, ModelCode(MyRO.EnemyModel[emix]), 792 ModelHash(MyRO.EnemyModel[emix]), MyRO.Turn, false, true);793 result := true;903 ModelHash(MyRO.EnemyModel[emix]), MyRO.Turn, False, True); 904 Result := True; 794 905 end; 795 906 796 907 procedure InitAllEnemyModels; 797 908 var 798 emix: integer;909 emix: Integer; 799 910 begin 800 911 for emix := 0 to MyRO.nEnemyModel - 1 do … … 804 915 end; 805 916 806 procedure InitMyModel( mix: integer; final: boolean);917 procedure InitMyModel(Mix: Integer; Final: Boolean); 807 918 var 808 919 mi: TModelInfo; 809 920 begin 810 921 if (GameMode = cMovie) and (MyModel[mix].Kind < $08) then 811 exit;922 Exit; 812 923 // don't exit for special units because cSetModelPicture comes after TellNewModels 813 MakeModelInfo( me, mix, MyModel[mix], mi);814 ChooseModelPicture( me, mix, ModelCode(mi), ModelHash(mi), MyRO.Turn,815 false, final);816 end; 817 818 function AttackSound( code: integer): string;819 begin 820 result := 'ATTACK_' + char(48 + code div 100 mod 10) +821 char(48 + code div 10 mod 10) + char(48 + code mod 10);822 end; 823 824 procedure CheckToldNoReturn(uix: integer);924 MakeModelInfo(Me, Mix, MyModel[mix], mi); 925 ChooseModelPicture(Me, Mix, ModelCode(mi), ModelHash(mi), MyRO.Turn, 926 False, Final); 927 end; 928 929 function AttackSound(Code: Integer): string; 930 begin 931 Result := 'ATTACK_' + char(48 + Code div 100 mod 10) + 932 char(48 + Code div 10 mod 10) + char(48 + Code mod 10); 933 end; 934 935 procedure CheckToldNoReturn(uix: Integer); 825 936 // check whether aircraft survived low-fuel warning 826 937 begin 827 assert(not supervising);938 Assert(not Supervising); 828 939 with MyUn[uix] do 829 940 if (Status and usToldNoReturn <> 0) and … … 833 944 end; 834 945 835 function CreateTribe( p: integer; FileName: string; Original: boolean): boolean;946 function CreateTribe(P: Integer; FileName: string; Original: Boolean): Boolean; 836 947 begin 837 948 FileName := LocalizedFilePath('Tribes' + DirectorySeparator + FileName + … … 843 954 end; 844 955 845 TribeOriginal[ p] := Original;846 Tribe[ p] := TTribe.Create(FileName);847 with Tribe[ p] do956 TribeOriginal[P] := Original; 957 Tribe[P] := TTribe.Create(FileName); 958 with Tribe[P] do 848 959 begin 849 960 if (GameMode = cNewGame) or not Original then 850 961 begin 851 Term.ChooseModelPicture( p, 0, 010, 1, 0, true, true);852 Term.ChooseModelPicture( p, 1, 040, 1, 0, true, true);853 Term.ChooseModelPicture( p, 2, 041, 1, 0, true, true);854 Term.ChooseModelPicture( p, -1, 017, 1, 0, true, true);855 end; 856 DipMem[ p].pContact := -1;857 end; 858 result := true;962 Term.ChooseModelPicture(P, 0, 010, 1, 0, True, True); 963 Term.ChooseModelPicture(P, 1, 040, 1, 0, True, True); 964 Term.ChooseModelPicture(P, 2, 041, 1, 0, True, True); 965 Term.ChooseModelPicture(P, -1, 017, 1, 0, True, True); 966 end; 967 DipMem[P].pContact := -1; 968 end; 969 Result := True; 859 970 end; 860 971 861 972 procedure TellNewContacts; 862 973 var 863 p1: integer;864 begin 865 if not supervising then974 p1: Integer; 975 begin 976 if not Supervising then 866 977 for p1 := 0 to nPl - 1 do 867 if (p1 <> me) and (1 shl p1 and MyData.ToldContact = 0) and978 if (p1 <> Me) and (1 shl p1 and MyData.ToldContact = 0) and 868 979 (1 shl p1 and MyRO.Alive <> 0) and (MyRO.Treaty[p1] > trNoContact) then 869 980 begin 870 981 TribeMessage(p1, Tribe[p1].TPhrase('FRNEWNATION'), ''); 871 982 MyData.ToldContact := MyData.ToldContact or (1 shl p1); 872 end 983 end; 873 984 end; 874 985 875 986 procedure TellNewModels; 876 987 var 877 mix: integer;988 mix: Integer; 878 989 ModelNameInfo: TModelNameInfo; 879 990 begin 880 if supervising then881 exit;882 with Tribe[ me] do991 if Supervising then 992 Exit; 993 with Tribe[Me] do 883 994 while MyData.ToldModels < MyRO.nModel do 884 995 begin { new Unit class available } … … 891 1002 end; 892 1003 if not Assigned(ModelPicture[MyData.ToldModels].HGr) then 893 InitMyModel(MyData.ToldModels, true);1004 InitMyModel(MyData.ToldModels, True); 894 1005 { only run if no researched model } 895 with M essgExDlg do1006 with MainScreen.MessgExDlg do 896 1007 begin 897 1008 { MakeModelInfo(me,MyData.ToldModels,MyModel[MyData.ToldModels],mi); … … 919 1030 ModelNameInfo.mix := MyData.ToldModels; 920 1031 ModelNameInfo.NewName := EInput.Text; 921 Server(cSetModelName + (Length(ModelNameInfo.NewName) + 1 + 4 + 3) 922 div 4, me, 0, ModelNameInfo); 1032 if ModelNameInfo.GetCommandDataSize > CommandDataMaxSize then 1033 Delete(ModelNameInfo.NewName, Length(ModelNameInfo.NewName) - 1034 (ModelNameInfo.GetCommandDataSize - 1 - CommandDataMaxSize), MaxInt); 1035 Server(CommandWithData(cSetModelName, ModelNameInfo.GetCommandDataSize), 1036 Me, 0, ModelNameInfo); 923 1037 end; 924 1038 end; … … 929 1043 MyModel[mix].Status := MyModel[mix].Status or msObsolete; 930 1044 end; 931 inc(MyData.ToldModels); 932 end; 933 end; 934 935 procedure TMainScreen.PaintZoomedTile(dst: TDpiBitmap; x, y, Loc: integer); 936 937 procedure TSprite(xDst, yDst, xSrc, ySrc: integer); 1045 Inc(MyData.ToldModels); 1046 end; 1047 end; 1048 1049 { TTribeInfo } 1050 1051 function TTribeInfo.GetCommandDataSize: Byte; 1052 begin 1053 Result := SizeOf(trix) + 1 + Length(FileName) 1054 end; 1055 1056 { TModelNameInfo } 1057 1058 function TModelNameInfo.GetCommandDataSize: Byte; 1059 begin 1060 Result := SizeOf(mix) + 1 + Length(NewName); 1061 end; 1062 1063 { TCityNameInfo } 1064 1065 function TCityNameInfo.GetCommandDataSize: Byte; 1066 begin 1067 Result := SizeOf(ID) + 1 + Length(NewName); 1068 end; 1069 1070 procedure TMainScreen.PaintZoomedTile(dst: TDpiBitmap; X, Y, Loc: Integer); 1071 1072 procedure TSprite(xDst, yDst, xSrc, ySrc: Integer); 938 1073 begin 939 1074 with NoMapPanel do 940 Sprite(dst, HGrTerrain, x + xDst, y+ yDst, xxt * 2, yyt * 3,1075 Sprite(dst, HGrTerrain, X + xDst, Y + yDst, xxt * 2, yyt * 3, 941 1076 1 + xSrc * (xxt * 2 + 1), 1 + ySrc * (yyt * 3 + 1)); 942 1077 end; 943 1078 944 procedure TSprite4(xSrc, ySrc: integer);1079 procedure TSprite4(xSrc, ySrc: Integer); 945 1080 begin 946 1081 with NoMapPanel do begin 947 Sprite(dst, HGrTerrain, x + xxt, y+ yyt + 2, xxt * 2, yyt * 2 - 2,1082 Sprite(dst, HGrTerrain, X + xxt, Y + yyt + 2, xxt * 2, yyt * 2 - 2, 948 1083 1 + xSrc * (xxt * 2 + 1), 3 + yyt + ySrc * (yyt * 3 + 1)); 949 Sprite(dst, HGrTerrain, x + 4, y+ 2 * yyt, xxt * 2 - 4, yyt * 2,1084 Sprite(dst, HGrTerrain, X + 4, Y + 2 * yyt, xxt * 2 - 4, yyt * 2, 950 1085 5 + xSrc * (xxt * 2 + 1), 1 + yyt + ySrc * (yyt * 3 + 1)); 951 Sprite(dst, HGrTerrain, x + xxt * 2, y+ 2 * yyt, xxt * 2 - 4, yyt * 2,1086 Sprite(dst, HGrTerrain, X + xxt * 2, Y + 2 * yyt, xxt * 2 - 4, yyt * 2, 952 1087 1 + xSrc * (xxt * 2 + 1), 1 + yyt + ySrc * (yyt * 3 + 1)); 953 Sprite(dst, HGrTerrain, x + xxt, y+ yyt * 3, xxt * 2, yyt * 2 - 2,1088 Sprite(dst, HGrTerrain, X + xxt, Y + yyt * 3, xxt * 2, yyt * 2 - 2, 954 1089 1 + xSrc * (xxt * 2 + 1), 1 + yyt + ySrc * (yyt * 3 + 1)); 955 1090 end; … … 957 1092 958 1093 var 959 cix, ySrc, Tile: integer;1094 cix, ySrc, Tile: Integer; 960 1095 begin 961 1096 with NoMapPanel do begin … … 971 1106 cix := MyRO.nCity - 1; 972 1107 while (cix >= 0) and (MyCity[cix].Loc <> Loc) do 973 dec(cix);974 assert(cix >= 0);1108 Dec(cix); 1109 Assert(cix >= 0); 975 1110 if MyCity[cix].Built[imSupermarket] > 0 then 976 1111 Tile := Tile or tiFarm … … 1063 1198 end; 1064 1199 1065 function ChooseResearch: boolean;1200 function ChooseResearch: Boolean; 1066 1201 var 1067 ChosenResearch: integer;1202 ChosenResearch: Integer; 1068 1203 begin 1069 1204 if (MyData.FarTech <> adNone) and (MyRO.Tech[MyData.FarTech] >= tsApplicable) … … 1073 1208 { research complete -- select new } 1074 1209 repeat 1075 M odalSelectDlg.ShowNewContent(wmModal, kAdvance);1076 if M odalSelectDlg.result < 0 then1210 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kAdvance); 1211 if MainScreen.ModalSelectDlg.Result < 0 then 1077 1212 begin 1078 result := false;1079 exit;1080 end; 1081 ChosenResearch := M odalSelectDlg.result;1213 Result := False; 1214 Exit; 1215 end; 1216 ChosenResearch := MainScreen.ModalSelectDlg.Result; 1082 1217 if ChosenResearch = adMilitary then 1083 1218 begin 1084 DraftDlg.ShowNewContent(wmModal);1085 if DraftDlg.ModalResult <> mrOK then1086 Tribe[ me].ModelPicture[MyRO.nModel].HGr := nil1087 end; 1088 until (ChosenResearch <> adMilitary) or ( DraftDlg.ModalResult = mrOK);1219 MainScreen.DraftDlg.ShowNewContent(wmModal); 1220 if MainScreen.DraftDlg.ModalResult <> mrOK then 1221 Tribe[Me].ModelPicture[MyRO.nModel].HGr := nil; 1222 end; 1223 until (ChosenResearch <> adMilitary) or (MainScreen.DraftDlg.ModalResult = mrOK); 1089 1224 1090 1225 if ChosenResearch = adMilitary then 1091 InitMyModel(MyRO.nModel, true)1226 InitMyModel(MyRO.nModel, True) 1092 1227 else if ChosenResearch = adFar then 1093 1228 begin 1094 M odalSelectDlg.ShowNewContent(wmModal, kFarAdvance);1095 if M odalSelectDlg.result >= 0 then1096 if (M odalSelectDlg.result = adNone) or1097 (Server(sSetResearch - sExecute, me, ModalSelectDlg.result, nil^) <1229 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kFarAdvance); 1230 if MainScreen.ModalSelectDlg.Result >= 0 then 1231 if (MainScreen.ModalSelectDlg.Result = adNone) or 1232 (Server(sSetResearch - sExecute, Me, MainScreen.ModalSelectDlg.Result, nil^) < 1098 1233 rExecuted) then 1099 MyData.FarTech := M odalSelectDlg.result1234 MyData.FarTech := MainScreen.ModalSelectDlg.Result 1100 1235 else 1101 1236 begin 1102 ChosenResearch := M odalSelectDlg.result;1237 ChosenResearch := MainScreen.ModalSelectDlg.Result; 1103 1238 // can be researched immediately 1104 MyData.FarTech := adNone 1239 MyData.FarTech := adNone; 1105 1240 end; 1106 1241 end; … … 1109 1244 MyData.FarTech := adNexus 1110 1245 else 1111 Server(sSetResearch, me, ChosenResearch, nil^); 1112 ListDlg.TechChange; 1113 result := true; 1246 Server(sSetResearch, Me, ChosenResearch, nil^); 1247 MainScreen.ListDlg.TechChange; 1248 Result := True; 1249 end; 1250 1251 procedure ApplyToVisibleForms(FormAction: TFormAction); 1252 var 1253 I: Integer; 1254 Form: TDpiForm; 1255 begin 1256 for I := 0 to DpiScreen.FormCount - 1 do begin 1257 Form := DpiScreen.Forms[I]; 1258 if Form.Visible and (Form is TBufferedDrawDlg) then begin 1259 case FormAction of 1260 faClose: Form.Close; 1261 faEnable: Form.Enabled := True; 1262 faDisable: Form.Enabled := False; 1263 faUpdate: begin 1264 if @Form.OnShow <> nil then Form.OnShow(nil); 1265 Form.Invalidate; 1266 Form.Update; 1267 end; 1268 faSmartUpdateContent: TBufferedDrawDlg(Form).SmartUpdateContent(False); 1269 end; 1270 end; 1271 end; 1114 1272 end; 1115 1273 1116 1274 (* ** client function handling ** *) 1117 1275 1118 function TMainScreen.DipCall(Command: integer): integer;1276 function TMainScreen.DipCall(Command: Integer): Integer; 1119 1277 var 1120 i: integer;1121 IsTreatyDeal: boolean;1122 begin 1123 result := Server(Command, me, 0, nil^);1124 if result >= rExecuted then1278 I: Integer; 1279 IsTreatyDeal: Boolean; 1280 begin 1281 Result := Server(Command, Me, 0, nil^); 1282 if Result >= rExecuted then 1125 1283 begin 1126 1284 if Command and $FF0F = scContact then 1127 1285 begin 1128 DipMem[ me].pContact := Command shr 4 and $F;1286 DipMem[Me].pContact := Command shr 4 and $F; 1129 1287 NegoDlg.Initiate; 1130 DipMem[ me].DeliveredPrices := [];1131 DipMem[ me].ReceivedPrices := [];1132 end; 1133 1134 DipMem[ me].SentCommand := Command;1135 DipMem[ me].FormerTreaty := MyRO.Treaty[DipMem[me].pContact];1288 DipMem[Me].DeliveredPrices := []; 1289 DipMem[Me].ReceivedPrices := []; 1290 end; 1291 1292 DipMem[Me].SentCommand := Command; 1293 DipMem[Me].FormerTreaty := MyRO.Treaty[DipMem[Me].pContact]; 1136 1294 if Command = scDipCancelTreaty then 1137 1295 Play('CANCELTREATY') 1138 1296 else if Command = scDipAccept then 1139 1297 begin // remember delivered and received prices 1140 for i:= 0 to ReceivedOffer.nDeliver - 1 do1141 include(DipMem[me].ReceivedPrices, ReceivedOffer.Price[i] shr 24);1142 for i:= 0 to ReceivedOffer.nCost - 1 do1143 include(DipMem[me].DeliveredPrices,1144 ReceivedOffer.Price[ReceivedOffer.nDeliver + i] shr 24);1145 IsTreatyDeal := false;1146 for i:= 0 to ReceivedOffer.nDeliver + ReceivedOffer.nCost - 1 do1147 if ReceivedOffer.Price[ i] and opMask = opTreaty then1148 IsTreatyDeal := true;1298 for I := 0 to ReceivedOffer.nDeliver - 1 do 1299 Include(DipMem[Me].ReceivedPrices, ReceivedOffer.Price[I] shr 24); 1300 for I := 0 to ReceivedOffer.nCost - 1 do 1301 Include(DipMem[Me].DeliveredPrices, 1302 ReceivedOffer.Price[ReceivedOffer.nDeliver + I] shr 24); 1303 IsTreatyDeal := False; 1304 for I := 0 to ReceivedOffer.nDeliver + ReceivedOffer.nCost - 1 do 1305 if ReceivedOffer.Price[I] and opMask = opTreaty then 1306 IsTreatyDeal := True; 1149 1307 if IsTreatyDeal then 1150 1308 Play('NEWTREATY') … … 1153 1311 end; 1154 1312 CityDlg.CloseAction := None; 1155 if G.RO[DipMem[ me].pContact] <> nil then1313 if G.RO[DipMem[Me].pContact] <> nil then 1156 1314 begin // close windows for next player 1157 for i := 0 to DpiScreen.FormCount - 1 do 1158 if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) 1159 then 1160 DpiScreen.Forms[i].Close; 1315 ApplyToVisibleForms(faClose); 1161 1316 end 1162 1317 else … … 1170 1325 end; 1171 1326 1172 function TMainScreen.OfferCall(var Offer: TOffer): integer; 1173 var 1174 i: integer; 1175 begin 1176 result := Server(scDipOffer, me, 0, Offer); 1177 if result >= rExecuted then 1178 begin 1179 DipMem[me].SentCommand := scDipOffer; 1180 DipMem[me].FormerTreaty := MyRO.Treaty[DipMem[me].pContact]; 1181 DipMem[me].SentOffer := Offer; 1327 function TMainScreen.OfferCall(var Offer: TOffer): Integer; 1328 begin 1329 Result := Server(scDipOffer, Me, 0, Offer); 1330 if Result >= rExecuted then 1331 begin 1332 DipMem[Me].SentCommand := scDipOffer; 1333 DipMem[Me].FormerTreaty := MyRO.Treaty[DipMem[Me].pContact]; 1334 DipMem[Me].SentOffer := Offer; 1182 1335 CityDlg.CloseAction := None; 1183 if G.RO[DipMem[ me].pContact] <> nil then1336 if G.RO[DipMem[Me].pContact] <> nil then 1184 1337 begin // close windows for next player 1185 for i := 0 to DpiScreen.FormCount - 1 do 1186 if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) 1187 then 1188 DpiScreen.Forms[i].Close; 1338 ApplyToVisibleForms(faClose); 1189 1339 end 1190 1340 else … … 1198 1348 end; 1199 1349 1200 procedure TMainScreen.SetUnFocus(uix: integer);1350 procedure TMainScreen.SetUnFocus(uix: Integer); 1201 1351 var 1202 Loc0: integer;1203 begin 1204 assert(not((uix >= 0) and supervising));1352 Loc0: Integer; 1353 begin 1354 Assert(not((uix >= 0) and Supervising)); 1205 1355 if uix <> UnFocus then 1206 1356 begin 1207 DestinationMarkON := false;1357 DestinationMarkON := False; 1208 1358 PaintDestination; 1209 1359 if uix >= 0 then 1210 1360 UnStartLoc := MyUn[uix].Loc; 1211 BlinkON := false;1361 BlinkON := False; 1212 1362 BlinkTime := -1; 1213 1363 if UnFocus >= 0 then … … 1229 1379 procedure TMainScreen.CheckTerrainBtnVisible; 1230 1380 var 1231 Tile: integer;1381 Tile: Integer; 1232 1382 mox: ^TModel; 1233 1383 begin … … 1241 1391 end 1242 1392 else 1243 TerrainBtn.Visible := false;1393 TerrainBtn.Visible := False; 1244 1394 end; 1245 1395 … … 1249 1399 begin 1250 1400 MovieSpeed1Btn.Down := MovieSpeed = 1; 1251 MovieSpeed1Btn.Visible := true;1401 MovieSpeed1Btn.Visible := True; 1252 1402 MovieSpeed2Btn.Down := MovieSpeed = 2; 1253 MovieSpeed2Btn.Visible := true;1403 MovieSpeed2Btn.Visible := True; 1254 1404 MovieSpeed3Btn.Down := MovieSpeed = 3; 1255 MovieSpeed3Btn.Visible := true;1405 MovieSpeed3Btn.Visible := True; 1256 1406 MovieSpeed4Btn.Down := MovieSpeed = 4; 1257 MovieSpeed4Btn.Visible := true;1407 MovieSpeed4Btn.Visible := True; 1258 1408 end 1259 1409 else 1260 1410 begin 1261 MovieSpeed1Btn.Visible := false;1262 MovieSpeed2Btn.Visible := false;1263 MovieSpeed3Btn.Visible := false;1264 MovieSpeed4Btn.Visible := false;1411 MovieSpeed1Btn.Visible := False; 1412 MovieSpeed2Btn.Visible := False; 1413 MovieSpeed3Btn.Visible := False; 1414 MovieSpeed4Btn.Visible := False; 1265 1415 end; 1266 1416 end; … … 1276 1426 end; 1277 1427 1278 procedure TMainScreen.UpdateViews(UpdateCityScreen: boolean);1428 procedure TMainScreen.UpdateViews(UpdateCityScreen: Boolean); 1279 1429 begin 1280 1430 SumCities(TaxSum, ScienceSum); … … 1286 1436 end; 1287 1437 1288 procedure TMainScreen.SetAIName( p: integer; Name: string);1438 procedure TMainScreen.SetAIName(P: Integer; Name: string); 1289 1439 begin 1290 1440 if Name = '' then 1291 1441 begin 1292 if AILogo[ p] <> nil then1442 if AILogo[P] <> nil then 1293 1443 begin 1294 FreeAndNil(AILogo[ p]);1444 FreeAndNil(AILogo[P]); 1295 1445 end; 1296 1446 end 1297 1447 else 1298 1448 begin 1299 if AILogo[ p] = nil then1300 AILogo[ p] := TDpiBitmap.Create;1301 if not LoadGraphicFile(AILogo[ p], HomeDir + Name + '.png', [gfNoError]) then1449 if AILogo[P] = nil then 1450 AILogo[P] := TDpiBitmap.Create; 1451 if not LoadGraphicFile(AILogo[P], HomeDir + Name + '.png', [gfNoError]) then 1302 1452 begin 1303 FreeAndNil(AILogo[ p]);1304 end; 1305 end; 1306 end; 1307 1308 function TMainScreen.ContactRefused( p: integer; Item: String): boolean;1453 FreeAndNil(AILogo[P]); 1454 end; 1455 end; 1456 end; 1457 1458 function TMainScreen.ContactRefused(P: Integer; Item: String): Boolean; 1309 1459 // return whether treaty was cancelled 1310 1460 var 1311 s: string;1312 begin 1313 assert(MyRO.Treaty[p] >= trPeace);1314 s := Tribe[p].TPhrase(Item);1315 if MyRO.Turn < MyRO.LastCancelTreaty[ p] + CancelTreatyTurns then1316 begin 1317 SimpleMessage( s);1318 result := false;1461 S: string; 1462 begin 1463 Assert(MyRO.Treaty[P] >= trPeace); 1464 S := Tribe[P].TPhrase(Item); 1465 if MyRO.Turn < MyRO.LastCancelTreaty[P] + CancelTreatyTurns then 1466 begin 1467 SimpleMessage(S); 1468 Result := False; 1319 1469 end 1320 1470 else 1321 1471 begin 1322 case MyRO.Treaty[ p] of1472 case MyRO.Treaty[P] of 1323 1473 trPeace: 1324 s := s+ ' ' + Phrases.Lookup('FRCANCELQUERY_PEACE');1474 S := S + ' ' + Phrases.Lookup('FRCANCELQUERY_PEACE'); 1325 1475 trFriendlyContact: 1326 s := s+ ' ' + Phrases.Lookup('FRCANCELQUERY_FRIENDLY');1476 S := S + ' ' + Phrases.Lookup('FRCANCELQUERY_FRIENDLY'); 1327 1477 trAlliance: 1328 s := s+ ' ' + Phrases.Lookup('FRCANCELQUERY_ALLIANCE');1329 end; 1330 result := SimpleQuery(mkYesNo, s, 'NEGO_REJECTED') = mrOK;1331 if result then1478 S := S + ' ' + Phrases.Lookup('FRCANCELQUERY_ALLIANCE'); 1479 end; 1480 Result := SimpleQuery(mkYesNo, S, 'NEGO_REJECTED') = mrOK; 1481 if Result then 1332 1482 begin 1333 1483 Play('CANCELTREATY'); 1334 Server(sCancelTreaty, me, 0, nil^);1335 if MyRO.Treaty[ p] = trNone then1484 Server(sCancelTreaty, Me, 0, nil^); 1485 if MyRO.Treaty[P] = trNone then 1336 1486 CityOptimizer_BeginOfTurn; 1337 1487 // peace treaty was cancelled -- use formerly forbidden tiles 1338 MapValid := false;1488 MapValid := False; 1339 1489 PaintAllMaps; 1340 1490 end; … … 1344 1494 procedure TMainScreen.RememberPeaceViolation; 1345 1495 var 1346 uix, p1: integer;1496 uix, p1: Integer; 1347 1497 begin 1348 1498 MyData.PeaceEvaHappened := 0; … … 1352 1502 begin 1353 1503 p1 := MyRO.Territory[Loc]; 1354 if (p1 <> me) and (p1 >= 0) and1504 if (p1 <> Me) and (p1 >= 0) and 1355 1505 (MyRO.Turn = MyRO.EvaStart[p1] + (PeaceEvaTurns - 1)) then 1356 1506 MyData.PeaceEvaHappened := MyData.PeaceEvaHappened or (1 shl p1); … … 1390 1540 1391 1541 var 1392 i, cix, mix: integer;1393 need: boolean;1542 I, cix, mix: Integer; 1543 need: Boolean; 1394 1544 mi: TModelInfo; 1395 1545 begin 1396 1546 if (sbStart in Check) and not (sbStart in SoundPreloadDone) then begin 1397 for i:= 0 to nStartBlock - 1 do1398 PreparePlay(StartBlock[ i]);1547 for I := 0 to nStartBlock - 1 do 1548 PreparePlay(StartBlock[I]); 1399 1549 SoundPreloadDone := SoundPreloadDone + [sbStart]; 1400 1550 end; 1401 1551 if (sbWonder in Check) and not (sbWonder in SoundPreloadDone) then begin 1402 need := false;1403 for i:= 0 to nWonder - 1 do1404 if MyRO.Wonder[ i].CityID <> WonderNotBuiltYet then1405 need := true;1552 need := False; 1553 for I := 0 to nWonder - 1 do 1554 if MyRO.Wonder[I].CityID <> WonderNotBuiltYet then 1555 need := True; 1406 1556 if need then begin 1407 for i:= 0 to nWonderBlock - 1 do1408 PreparePlay(WonderBlock[ i]);1557 for I := 0 to nWonderBlock - 1 do 1558 PreparePlay(WonderBlock[I]); 1409 1559 SoundPreloadDone := SoundPreloadDone + [sbWonder]; 1410 1560 end; … … 1412 1562 if ((sbScience in Check) and not (sbScience in SoundPreloadDone)) and 1413 1563 (MyRO.Tech[adScience] >= tsApplicable) then begin 1414 for i:= 0 to nScienceBlock - 1 do1415 PreparePlay(ScienceBlock[ i]);1564 for I := 0 to nScienceBlock - 1 do 1565 PreparePlay(ScienceBlock[I]); 1416 1566 SoundPreloadDone := SoundPreloadDone + [sbScience]; 1417 1567 end; 1418 1568 if ((sbContact in Check) and not (sbContact in SoundPreloadDone)) and 1419 1569 (MyRO.nEnemyModel + MyRO.nEnemyCity > 0) then begin 1420 for i:= 0 to nContactBlock - 1 do1421 PreparePlay(ContactBlock[ i]);1570 for I := 0 to nContactBlock - 1 do 1571 PreparePlay(ContactBlock[I]); 1422 1572 SoundPreloadDone := SoundPreloadDone + [sbContact]; 1423 1573 end; … … 1430 1580 with MyCity[cix] do 1431 1581 if (Loc >= 0) and (Flags and CityRepMask <> 0) then 1432 for i:= 0 to 12 do1433 if 1 shl iand Flags and CityRepMask <> 0 then1434 PreparePlay(CityEventSoundItem[ i]);1582 for I := 0 to 12 do 1583 if 1 shl I and Flags and CityRepMask <> 0 then 1584 PreparePlay(CityEventSoundItem[I]); 1435 1585 for mix := 0 to MyRO.nModel - 1 do 1436 1586 with MyModel[mix] do 1437 1587 if Attack > 0 then 1438 1588 begin 1439 MakeModelInfo( me, mix, MyModel[mix], mi);1589 MakeModelInfo(Me, mix, MyModel[mix], mi); 1440 1590 PreparePlay(AttackSound(ModelCode(mi))); 1441 1591 end; … … 1448 1598 Color: TColor; 1449 1599 Name: string; 1450 ok: boolean;1600 ok: Boolean; 1451 1601 begin 1452 1602 UnusedTribeFiles.Clear; … … 1468 1618 end; 1469 1619 1470 function TMainScreen.ChooseUnusedTribe: integer; 1620 function TMainScreen.GetUnitStatDlg: TUnitStatDlg; 1621 begin 1622 if not Assigned(FUnitStatDlg) then begin 1623 FUnitStatDlg := TUnitStatDlg.Create(nil); 1624 ArrangeDialog(FUnitStatDlg); 1625 FUnitStatDlg.CheckAge; 1626 end; 1627 Result := FUnitStatDlg; 1628 end; 1629 1630 function TMainScreen.GetWondersDlg: TWondersDlg; 1631 begin 1632 if not Assigned(FWondersDlg) then FWondersDlg := TWondersDlg.Create(nil); 1633 Result := FWondersDlg; 1634 end; 1635 1636 function TMainScreen.ChooseUnusedTribe: Integer; 1471 1637 var 1472 i: Integer;1473 j: Integer;1638 I: Integer; 1639 J: Integer; 1474 1640 ColorDistance: Integer; 1475 1641 BestColorDistance: Integer; … … 1477 1643 CountBest: Integer; 1478 1644 begin 1479 assert(UnusedTribeFiles.Count > 0);1480 result := -1;1645 Assert(UnusedTribeFiles.Count > 0); 1646 Result := -1; 1481 1647 BestColorDistance := -1; 1482 for j:= 0 to UnusedTribeFiles.Count - 1 do1648 for J := 0 to UnusedTribeFiles.Count - 1 do 1483 1649 begin 1484 1650 ColorDistance := 250; // consider differences more than this infinite 1485 for i:= 0 to nPl - 1 do1486 if Tribe[ i] <> nil then1651 for I := 0 to nPl - 1 do 1652 if Tribe[I] <> nil then 1487 1653 begin 1488 TestColorDistance := abs( integer(UnusedTribeFiles.Objects[j])1489 shr 16 and $FF - Tribe[ i].Color shr 16 and $FF) +1490 abs( integer(UnusedTribeFiles.Objects[j]) shr 8 and1491 $FF - Tribe[ i].Color shr 8 and $FF) * 3 +1492 abs( integer(UnusedTribeFiles.Objects[j]) and1493 $FF - Tribe[ i].Color and $FF) * 2;1654 TestColorDistance := abs(Integer(UnusedTribeFiles.Objects[J]) 1655 shr 16 and $FF - Tribe[I].Color shr 16 and $FF) + 1656 abs(Integer(UnusedTribeFiles.Objects[J]) shr 8 and 1657 $FF - Tribe[I].Color shr 8 and $FF) * 3 + 1658 abs(Integer(UnusedTribeFiles.Objects[J]) and 1659 $FF - Tribe[I].Color and $FF) * 2; 1494 1660 if TestColorDistance < ColorDistance then 1495 1661 ColorDistance := TestColorDistance; … … 1502 1668 if ColorDistance = BestColorDistance then 1503 1669 begin 1504 inc(CountBest);1670 Inc(CountBest); 1505 1671 if DelphiRandom(CountBest) = 0 then 1506 result := j;1672 Result := J; 1507 1673 end; 1508 1674 end; … … 1511 1677 procedure TMainScreen.ShowEnemyShipChange(ShowShipChange: TShowShipChange); 1512 1678 var 1513 i, TestCost, MostCost: integer;1514 Ship1Plus, Ship2Plus: boolean;1679 I, TestCost, MostCost: Integer; 1680 Ship1Plus, Ship2Plus: Boolean; 1515 1681 begin 1516 1682 with ShowShipChange, MessgExDlg do … … 1535 1701 begin 1536 1702 OpenSound := 'SHIP_TRADED'; 1537 Ship1Plus := false;1538 Ship2Plus := false;1539 for i:= 0 to nShipPart - 1 do1703 Ship1Plus := False; 1704 Ship2Plus := False; 1705 for I := 0 to nShipPart - 1 do 1540 1706 begin 1541 if Ship1Change[ i] > 0 then1542 Ship1Plus := true;1543 if Ship2Change[ i] > 0 then1544 Ship2Plus := true;1707 if Ship1Change[I] > 0 then 1708 Ship1Plus := True; 1709 if Ship2Change[I] > 0 then 1710 Ship2Plus := True; 1545 1711 end; 1546 1712 if Ship1Plus and Ship2Plus then … … 1569 1735 begin 1570 1736 MostCost := 0; 1571 for i:= 0 to nShipPart - 1 do1737 for I := 0 to nShipPart - 1 do 1572 1738 begin 1573 TestCost := abs(Ship1Change[ i]) * Imp[imShipComp + i].Cost;1739 TestCost := abs(Ship1Change[I]) * Imp[imShipComp + I].Cost; 1574 1740 if TestCost > MostCost then 1575 1741 begin 1576 1742 MostCost := TestCost; 1577 IconIndex := imShipComp + i;1743 IconIndex := imShipComp + I; 1578 1744 end; 1579 1745 end; … … 1587 1753 procedure TMainScreen.InitModule; 1588 1754 var 1589 i, j, Domain: integer;1755 I, J, Domain: Integer; 1590 1756 begin 1591 1757 { search icons for advances: } 1592 for i:= 0 to nAdv - 1 do1593 if iin FutureTech then1594 AdvIcon[ i] := 96 + i- futResearchTechnology1758 for I := 0 to nAdv - 1 do 1759 if I in FutureTech then 1760 AdvIcon[I] := 96 + I - futResearchTechnology 1595 1761 else 1596 1762 begin 1597 AdvIcon[ i] := -1;1763 AdvIcon[I] := -1; 1598 1764 for Domain := 0 to nDomains - 1 do 1599 for j:= 0 to nUpgrade - 1 do1600 if upgrade[Domain, j].Preq = ithen1601 if AdvIcon[ i] >= 0 then1602 AdvIcon[ i] := 851765 for J := 0 to nUpgrade - 1 do 1766 if upgrade[Domain, J].Preq = I then 1767 if AdvIcon[I] >= 0 then 1768 AdvIcon[I] := 85 1603 1769 else 1604 AdvIcon[ i] := 86 + Domain;1605 for j:= 0 to nFeature - 1 do1606 if Feature[ j].Preq = ithen1770 AdvIcon[I] := 86 + Domain; 1771 for J := 0 to nFeature - 1 do 1772 if Feature[J].Preq = I then 1607 1773 for Domain := 0 to nDomains - 1 do 1608 if 1 shl Domain and Feature[ j].Domains <> 0 then1609 if (AdvIcon[ i] >= 0) and (AdvIcon[i] <> 86 + Domain) then1610 AdvIcon[ i] := 851774 if 1 shl Domain and Feature[J].Domains <> 0 then 1775 if (AdvIcon[I] >= 0) and (AdvIcon[I] <> 86 + Domain) then 1776 AdvIcon[I] := 85 1611 1777 else 1612 AdvIcon[ i] := 86 + Domain;1613 for j:= nWonder to nImp - 1 do1614 if Imp[ j].Preq = ithen1615 AdvIcon[ i] := j;1616 for j:= nWonder to nImp - 1 do1617 if (Imp[ j].Preq = i) and (Imp[j].Kind <> ikCommon) then1618 AdvIcon[ i] := j;1619 for j:= 0 to nJob - 1 do1620 if i = JobPreq[j] then1621 AdvIcon[ i] := 84;1622 for j:= 0 to nWonder - 1 do1623 if Imp[ j].Preq = ithen1624 AdvIcon[ i] := j;1625 if AdvIcon[ i] < 0 then1626 if AdvValue[ i] < 1000 then1627 AdvIcon[ i] := -71778 AdvIcon[I] := 86 + Domain; 1779 for J := nWonder to nImp - 1 do 1780 if Imp[J].Preq = I then 1781 AdvIcon[I] := J; 1782 for J := nWonder to nImp - 1 do 1783 if (Imp[J].Preq = I) and (Imp[J].Kind <> ikCommon) then 1784 AdvIcon[I] := J; 1785 for J := 0 to nJob - 1 do 1786 if I = JobPreq[J] then 1787 AdvIcon[I] := 84; 1788 for J := 0 to nWonder - 1 do 1789 if Imp[J].Preq = I then 1790 AdvIcon[I] := J; 1791 if AdvIcon[I] < 0 then 1792 if AdvValue[I] < 1000 then 1793 AdvIcon[I] := -7 1628 1794 else 1629 AdvIcon[ i] := 24 + AdvValue[i] div 1000;1630 for j:= 2 to nGov - 1 do1631 if GovPreq[ j] = ithen1632 AdvIcon[ i] := j- 8;1795 AdvIcon[I] := 24 + AdvValue[I] div 1000; 1796 for J := 2 to nGov - 1 do 1797 if GovPreq[J] = I then 1798 AdvIcon[I] := J - 8; 1633 1799 end; 1634 1800 AdvIcon[adConscription] := 86 + dGround; 1635 1801 1636 1802 UnusedTribeFiles := tstringlist.Create; 1637 UnusedTribeFiles.Sorted := true;1803 UnusedTribeFiles.Sorted := True; 1638 1804 TribeNames := tstringlist.Create; 1639 1805 1640 1806 IsoEngine.Init(InitEnemyModel); 1641 1807 // non-default tile size is missing a file, switch to default 1642 MainMap.SetOutput( offscreen);1808 MainMap.SetOutput(Offscreen); 1643 1809 1644 1810 HGrStdUnits := LoadGraphicSet('StdUnits.png'); … … 1647 1813 InitSmallImp; 1648 1814 SoundPreloadDone := []; 1649 StartRunning := false; 1650 StayOnTop_Ensured := false; 1815 StartRunning := False; 1651 1816 1652 1817 sb := TPVScrollbar.Create(Self); … … 1659 1824 FreeAndNil(UnusedTribeFiles); 1660 1825 FreeAndNil(TribeNames); 1661 // AdvisorDlg.DeInit; 1662 end; 1663 1664 procedure TMainScreen.InitTurn(NewPlayer: integer); 1826 end; 1827 1828 procedure TMainScreen.InitTurn(NewPlayer: Integer); 1665 1829 const 1666 1830 nAdvBookIcon = 16; 1667 1831 AdvBookIcon: array [0 .. nAdvBookIcon - 1] of record Adv, 1668 Icon: integer end = ((Adv: adPolyTheism; Icon: woZeus),1832 Icon: Integer end = ((Adv: adPolyTheism; Icon: woZeus), 1669 1833 (Adv: adBronzeWorking; Icon: woColossus), (Adv: adMapMaking; 1670 1834 Icon: woLighthouse), (Adv: adPoetry; Icon: imTheater), (Adv: adMonotheism; … … 1678 1842 sbAll = [sbStart, sbWonder, sbScience, sbContact, sbTurn]; 1679 1843 var 1680 p1, i, ad, uix, cix, MoveOptions, MoveResult, Loc1,1844 p1, I, ad, uix, cix, MoveOptions, MoveResult, Loc1, 1681 1845 NewAgeCenterTo, Winners, NewGovAvailable, dx, 1682 dy: integer;1846 dy: Integer; 1683 1847 MoveAdviceData: TMoveAdviceData; 1684 1848 Picture: TModelPictureInfo; 1685 s, Item, Item2: string;1849 S, Item, Item2: string; 1686 1850 UpdatePanel, OwnWonder, ok, Stop, ShowCityList, WondersOnly, 1687 AllowCityScreen: boolean;1688 begin 1689 if IsMultiPlayerGame and (NewPlayer <> me) then1690 begin 1691 UnitInfoBtn.Visible := false;1692 UnitBtn.Visible := false;1693 TerrainBtn.Visible := false;1694 EOT.Visible := false;1695 end; 1696 if IsMultiPlayerGame and (NewPlayer <> me) and1851 AllowCityScreen: Boolean; 1852 begin 1853 if IsMultiPlayerGame and (NewPlayer <> Me) then 1854 begin 1855 UnitInfoBtn.Visible := False; 1856 UnitBtn.Visible := False; 1857 TerrainBtn.Visible := False; 1858 EOT.Visible := False; 1859 end; 1860 if IsMultiPlayerGame and (NewPlayer <> Me) and 1697 1861 (G.RO[0].Happened and phShipComplete = 0) then 1698 1862 begin // inter player screen 1699 for i:= 0 to ControlCount - 1 do1700 if Controls[ i] is TButtonC then1701 Controls[ i].Visible := false;1702 me := -1;1863 for I := 0 to ControlCount - 1 do 1864 if Controls[I] is TButtonC then 1865 Controls[I].Visible := False; 1866 Me := -1; 1703 1867 MainTexture.Age := -1; 1704 1868 with Panel.Canvas do … … 1716 1880 Invalidate; 1717 1881 1718 s:= TurnToString(G.RO[0].Turn);1719 if supervising then1720 SimpleMessage(Format(Phrases.Lookup('SUPERTURN'), [ s]))1882 S := TurnToString(G.RO[0].Turn); 1883 if Supervising then 1884 SimpleMessage(Format(Phrases.Lookup('SUPERTURN'), [S])) 1721 1885 else 1722 SimpleMessage(Format(Tribe[NewPlayer].TPhrase('TURN'), [ s]));1723 end; 1724 for i:= 0 to ControlCount - 1 do1725 if Controls[ i] is TButtonC then1726 Controls[ i].Visible := true;1886 SimpleMessage(Format(Tribe[NewPlayer].TPhrase('TURN'), [S])); 1887 end; 1888 for I := 0 to ControlCount - 1 do 1889 if Controls[I] is TButtonC then 1890 Controls[I].Visible := True; 1727 1891 1728 1892 ItsMeAgain(NewPlayer); 1729 1893 MyData := G.RO[NewPlayer].Data; 1730 if not supervising then1894 if not Supervising then 1731 1895 SoundPreload(sbAll); 1732 if ( me = 0) and ((MyRO.Turn = 0) or (ClientMode = cResume)) then1896 if (Me = 0) and ((MyRO.Turn = 0) or (ClientMode = cResume)) then 1733 1897 Invalidate; // colorize empty space 1734 1898 1735 if not supervising then1899 if not Supervising then 1736 1900 begin 1737 1901 … … 1743 1907 else } 1744 1908 begin 1745 Age := GetAge( me);1909 Age := GetAge(Me); 1746 1910 if MainTexture.Age <> Age then begin 1747 1911 MainTexture.Age := Age; … … 1767 1931 end; 1768 1932 InitCityMark(MainTexture); 1769 CityDlg.CheckAge;1770 NatStatDlg.CheckAge;1771 UnitStatDlg.CheckAge;1772 HelpDlg.Difficulty := G.Difficulty[me];1933 if Assigned(FCityDlg) then FCityDlg.CheckAge; 1934 if Assigned(FNatStatDlg) then FNatStatDlg.CheckAge; 1935 if Assigned(FUnitStatDlg) then FUnitStatDlg.CheckAge; 1936 if Assigned(FHelpDlg) then FHelpDlg.Difficulty := G.Difficulty[Me]; 1773 1937 1774 1938 UnFocus := -1; 1775 1939 MarkCityLoc := -1; 1776 BlinkON := false;1940 BlinkON := False; 1777 1941 BlinkTime := -1; 1778 Tracking := false;1779 TurnComplete := false;1942 Tracking := False; 1943 TurnComplete := False; 1780 1944 1781 1945 if (ToldSlavery < 0) or … … 1797 1961 Hash := 0; 1798 1962 GrName := 'StdUnits.png'; 1799 Tribe[p1].SetModelPicture(Picture, true);1800 end 1801 end; 1802 1803 if not supervising and (ClientMode = cTurn) then1963 Tribe[p1].SetModelPicture(Picture, True); 1964 end; 1965 end; 1966 1967 if not Supervising and (ClientMode = cTurn) then 1804 1968 begin 1805 1969 for cix := 0 to MyRO.nCity - 1 do … … 1816 1980 if ClientMode = cMovieTurn then 1817 1981 begin 1818 UnitInfoBtn.Visible := false;1819 UnitBtn.Visible := false;1820 TerrainBtn.Visible := false;1982 UnitInfoBtn.Visible := False; 1983 UnitBtn.Visible := False; 1984 TerrainBtn.Visible := False; 1821 1985 EOT.Hint := Phrases.Lookup('BTN_STOP'); 1822 EOT.Visible := true;1986 EOT.Visible := True; 1823 1987 end 1824 1988 else if ClientMode < scContact then … … 1827 1991 UnitBtn.Visible := UnFocus >= 0; 1828 1992 CheckTerrainBtnVisible; 1829 TurnComplete := supervising;1993 TurnComplete := Supervising; 1830 1994 EOT.Hint := Phrases.Lookup('BTN_ENDTURN'); 1831 EOT.Visible := Server(sTurn - sExecute, me, 0, nil^) >= rExecuted;1995 EOT.Visible := Server(sTurn - sExecute, Me, 0, nil^) >= rExecuted; 1832 1996 end 1833 1997 else 1834 1998 begin 1835 UnitInfoBtn.Visible := false;1836 UnitBtn.Visible := false;1837 TerrainBtn.Visible := false;1999 UnitInfoBtn.Visible := False; 2000 UnitBtn.Visible := False; 2001 TerrainBtn.Visible := False; 1838 2002 EOT.Hint := Phrases.Lookup('BTN_NEGO'); 1839 EOT.Visible := true;2003 EOT.Visible := True; 1840 2004 end; 1841 2005 SetTroopLoc(-1); 1842 MapValid := false;2006 MapValid := False; 1843 2007 NewAgeCenterTo := 0; 1844 if ((MyRO.Turn = 0) and not supervising or IsMultiPlayerGame or2008 if ((MyRO.Turn = 0) and not Supervising or IsMultiPlayerGame or 1845 2009 (ClientMode = cResume)) and (MyRO.nCity > 0) then 1846 2010 begin … … 1857 2021 begin 1858 2022 NewAgeCenterTo := -1; 1859 Loc1 := dLoc(Loc1, -dx, -dy) 2023 Loc1 := dLoc(Loc1, -dx, -dy); 1860 2024 end 1861 2025 else … … 1865 2029 end 1866 2030 end; 1867 Centre(Loc1) 1868 end; 1869 1870 for i := 0 to DpiScreen.FormCount - 1 do 1871 if DpiScreen.Forms[i] is TBufferedDrawDlg then 1872 DpiScreen.Forms[i].Enabled := true; 2031 Centre(Loc1); 2032 end; 2033 2034 ApplyToVisibleForms(faEnable); 1873 2035 1874 2036 if ClientMode <> cResume then … … 1881 2043 // first turn after anarchy -- don't show despotism palace! 1882 2044 Update; 1883 for i := 0 to DpiScreen.FormCount - 1 do 1884 if (DpiScreen.Forms[i].Visible) and (DpiScreen.Forms[i] is TBufferedDrawDlg) 1885 then 1886 begin 1887 if @DpiScreen.Forms[i].OnShow <> nil then 1888 DpiScreen.Forms[i].OnShow(nil); 1889 DpiScreen.Forms[i].Invalidate; 1890 DpiScreen.Forms[i].Update; 1891 end; 2045 ApplyToVisibleForms(faUpdate); 1892 2046 1893 2047 if MyRO.Happened and phGameEnd <> 0 then … … 1897 2051 begin 1898 2052 OpenSound := 'MSG_GAMEOVER'; 1899 MessgText := Tribe[ me].TPhrase('GAMEOVER');2053 MessgText := Tribe[Me].TPhrase('GAMEOVER'); 1900 2054 IconKind := mikBigIcon; 1901 2055 IconIndex := 8; … … 1908 2062 begin 1909 2063 Winners := Winners or 1 shl p1; 1910 for i:= 0 to nShipPart - 1 do1911 if MyRO.Ship[p1].Parts[ i] < ShipNeed[i] then2064 for I := 0 to nShipPart - 1 do 2065 if MyRO.Ship[p1].Parts[I] < ShipNeed[I] then 1912 2066 Winners := Winners and not(1 shl p1); 1913 2067 end; 1914 assert(Winners <> 0);1915 if Winners and (1 shl me) <> 0 then2068 Assert(Winners <> 0); 2069 if Winners and (1 shl Me) <> 0 then 1916 2070 begin 1917 s:= '';2071 S := ''; 1918 2072 for p1 := 0 to nPl - 1 do 1919 if (p1 <> me) and (1 shl p1 and Winners <> 0) then1920 if s= '' then1921 s:= Tribe[p1].TPhrase('SHORTNAME')2073 if (p1 <> Me) and (1 shl p1 and Winners <> 0) then 2074 if S = '' then 2075 S := Tribe[p1].TPhrase('SHORTNAME') 1922 2076 else 1923 s:= Format(Phrases.Lookup('SHAREDWIN_CONCAT'),1924 [ s, Tribe[p1].TPhrase('SHORTNAME')]);2077 S := Format(Phrases.Lookup('SHAREDWIN_CONCAT'), 2078 [S, Tribe[p1].TPhrase('SHORTNAME')]); 1925 2079 1926 2080 OpenSound := 'MSG_YOUWIN'; 1927 MessgText := Tribe[ me].TPhrase('MYSPACESHIP');1928 if s<> '' then2081 MessgText := Tribe[Me].TPhrase('MYSPACESHIP'); 2082 if S <> '' then 1929 2083 MessgText := MessgText + '\' + 1930 Format(Phrases.Lookup('SHAREDWIN'), [ s]);2084 Format(Phrases.Lookup('SHAREDWIN'), [S]); 1931 2085 IconKind := mikBigIcon; 1932 2086 IconIndex := 9; … … 1934 2088 else 1935 2089 begin 1936 assert(me = 0);2090 Assert(Me = 0); 1937 2091 OpenSound := 'MSG_GAMEOVER'; 1938 2092 MessgText := ''; … … 1946 2100 else { if MyRO.Happened and fTimeUp<>0 then } 1947 2101 begin 1948 assert(me = 0);2102 Assert(Me = 0); 1949 2103 OpenSound := 'MSG_GAMEOVER'; 1950 if not supervising then1951 MessgText := Tribe[ me].TPhrase('TIMEUP')2104 if not Supervising then 2105 MessgText := Tribe[Me].TPhrase('TIMEUP') 1952 2106 else 1953 2107 MessgText := Phrases.Lookup('TIMEUPSUPER'); … … 1961 2115 p1 := 0; 1962 2116 while (p1 < nPl - 1) and (Winners and (1 shl p1) = 0) do 1963 inc(p1);2117 Inc(p1); 1964 2118 if MyRO.Happened and phShipComplete = 0 then 1965 2119 DiaDlg.ShowNewContent_Charts(wmModal); 1966 2120 end; 1967 TurnComplete := true;1968 exit;1969 end; 1970 if not supervising and (1 shl me and MyRO.Alive = 0) then2121 TurnComplete := True; 2122 Exit; 2123 end; 2124 if not Supervising and (1 shl Me and MyRO.Alive = 0) then 1971 2125 begin 1972 TurnComplete := true;1973 exit;2126 TurnComplete := True; 2127 Exit; 1974 2128 end; 1975 2129 1976 2130 if (ClientMode = cContinue) and 1977 (DipMem[ me].SentCommand and $FF0F = scContact) then2131 (DipMem[Me].SentCommand and $FF0F = scContact) then 1978 2132 // contact was refused 1979 if MyRO.Treaty[DipMem[ me].pContact] >= trPeace then1980 ContactRefused(DipMem[ me].pContact, 'FRREJECTED')2133 if MyRO.Treaty[DipMem[Me].pContact] >= trPeace then 2134 ContactRefused(DipMem[Me].pContact, 'FRREJECTED') 1981 2135 else 1982 SoundMessage(Tribe[DipMem[ me].pContact].TPhrase('FRREJECTED'),2136 SoundMessage(Tribe[DipMem[Me].pContact].TPhrase('FRREJECTED'), 1983 2137 'NEGO_REJECTED'); 1984 2138 1985 if not supervising and (Age > MyData.ToldAge) and2139 if not Supervising and (Age > MyData.ToldAge) and 1986 2140 ((Age > 0) or (ClientMode <> cMovieTurn)) then 1987 2141 with MessgExDlg do … … 1991 2145 if Phrases2FallenBackToEnglish then 1992 2146 begin 1993 s := Tribe[me].TPhrase('AGE0');2147 S := Tribe[Me].TPhrase('AGE0'); 1994 2148 MessgText := 1995 Format( s, [TurnToString(MyRO.Turn), CityName(MyCity[0].ID)])2149 Format(S, [TurnToString(MyRO.Turn), CityName(MyCity[0].ID)]); 1996 2150 end 1997 2151 else 1998 2152 begin 1999 s := Tribe[me].TString(Phrases2.Lookup('AGE0'));2000 MessgText := Format( s, [TurnToString(MyRO.Turn)]);2001 end 2153 S := Tribe[Me].TString(Phrases2.Lookup('AGE0')); 2154 MessgText := Format(S, [TurnToString(MyRO.Turn)]); 2155 end; 2002 2156 end 2003 2157 else 2004 2158 begin 2005 s := Tribe[me].TPhrase('AGE' + char(48 + Age));2006 MessgText := Format( s, [TurnToString(MyRO.Turn)]);2159 S := Tribe[Me].TPhrase('AGE' + char(48 + Age)); 2160 MessgText := Format(S, [TurnToString(MyRO.Turn)]); 2007 2161 end; 2008 2162 IconKind := mikAge; … … 2012 2166 CenterTo := NewAgeCenterTo; 2013 2167 OpenSound := 'AGE_' + char(48 + Age); 2168 DpiApplication.ProcessMessages; 2014 2169 ShowModal; 2015 2170 MyData.ToldAge := Age; … … 2025 2180 begin 2026 2181 OpenSound := 'MSG_EXTINCT'; 2027 s:= Tribe[p1].TPhrase('EXTINCT');2028 MessgText := Format( s, [TurnToString(MyRO.Turn)]);2029 if MyRO.Alive = 1 shl me then2182 S := Tribe[p1].TPhrase('EXTINCT'); 2183 MessgText := Format(S, [TurnToString(MyRO.Turn)]); 2184 if MyRO.Alive = 1 shl Me then 2030 2185 MessgText := MessgText + Phrases.Lookup('EXTINCTALL'); 2031 2186 Kind := mkOk; … … 2034 2189 ShowModal; 2035 2190 end; 2036 if (ClientMode <> cMovieTurn) and not supervising then2191 if (ClientMode <> cMovieTurn) and not Supervising then 2037 2192 DiaDlg.ShowNewContent_Charts(wmModal); 2038 2193 end; 2039 2194 2040 2195 // tell changes of own credibility 2041 if not supervising then2196 if not Supervising then 2042 2197 begin 2043 2198 if RoughCredibility(MyRO.Credibility) <> … … 2046 2201 if RoughCredibility(MyRO.Credibility) > 2047 2202 RoughCredibility(MyData.ToldOwnCredibility) then 2048 s:= Phrases.Lookup('CREDUP')2203 S := Phrases.Lookup('CREDUP') 2049 2204 else 2050 s:= Phrases.Lookup('CREDDOWN');2051 TribeMessage( me, Format(s, [Phrases.Lookup('CREDIBILITY',2205 S := Phrases.Lookup('CREDDOWN'); 2206 TribeMessage(Me, Format(S, [Phrases.Lookup('CREDIBILITY', 2052 2207 RoughCredibility(MyRO.Credibility))]), ''); 2053 2208 end; … … 2055 2210 end; 2056 2211 2057 for i:= 0 to nWonder - 1 do2212 for I := 0 to nWonder - 1 do 2058 2213 begin 2059 OwnWonder := false;2214 OwnWonder := False; 2060 2215 for cix := 0 to MyRO.nCity - 1 do 2061 if (MyCity[cix].Loc >= 0) and (MyCity[cix].ID = MyRO.Wonder[ i].CityID)2216 if (MyCity[cix].Loc >= 0) and (MyCity[cix].ID = MyRO.Wonder[I].CityID) 2062 2217 then 2063 OwnWonder := true;2064 if MyRO.Wonder[ i].CityID <> MyData.ToldWonders[i].CityID then2218 OwnWonder := True; 2219 if MyRO.Wonder[I].CityID <> MyData.ToldWonders[I].CityID then 2065 2220 begin 2066 if MyRO.Wonder[ i].CityID = WonderDestroyed then2221 if MyRO.Wonder[I].CityID = WonderDestroyed then 2067 2222 with MessgExDlg do 2068 2223 begin { tell about destroyed wonders } 2069 2224 OpenSound := 'WONDER_DESTROYED'; 2070 2225 MessgText := Format(Phrases.Lookup('WONDERDEST'), 2071 [Phrases.Lookup('IMPROVEMENTS', i)]);2226 [Phrases.Lookup('IMPROVEMENTS', I)]); 2072 2227 Kind := mkOkHelp; 2073 2228 HelpKind := hkImp; 2074 HelpNo := i;2229 HelpNo := I; 2075 2230 IconKind := mikImp; 2076 IconIndex := i;2231 IconIndex := I; 2077 2232 ShowModal; 2078 2233 end 2079 2234 else 2080 2235 begin 2081 if i= woManhattan then2082 if MyRO.Wonder[ i].EffectiveOwner > me then2236 if I = woManhattan then 2237 if MyRO.Wonder[I].EffectiveOwner > Me then 2083 2238 MyData.ColdWarStart := MyRO.Turn - 1 2084 2239 else … … 2087 2242 with MessgExDlg do 2088 2243 begin { tell about newly built wonders } 2089 if i= woManhattan then2244 if I = woManhattan then 2090 2245 begin 2091 2246 OpenSound := 'MSG_COLDWAR'; 2092 s := Tribe[MyRO.Wonder[i].EffectiveOwner].TPhrase('COLDWAR')2247 S := Tribe[MyRO.Wonder[I].EffectiveOwner].TPhrase('COLDWAR'); 2093 2248 end 2094 else if MyRO.Wonder[ i].EffectiveOwner >= 0 then2249 else if MyRO.Wonder[I].EffectiveOwner >= 0 then 2095 2250 begin 2096 2251 OpenSound := 'WONDER_BUILT'; 2097 s := Tribe[MyRO.Wonder[i].EffectiveOwner]2098 .TPhrase('WONDERBUILT') 2252 S := Tribe[MyRO.Wonder[I].EffectiveOwner] 2253 .TPhrase('WONDERBUILT'); 2099 2254 end 2100 2255 else 2101 2256 begin 2102 2257 OpenSound := 'MSG_DEFAULT'; 2103 s:= Phrases.Lookup('WONDERBUILTEXP');2258 S := Phrases.Lookup('WONDERBUILTEXP'); 2104 2259 // already expired when built 2105 2260 end; 2106 MessgText := Format( s, [Phrases.Lookup('IMPROVEMENTS', i),2107 CityName(MyRO.Wonder[ i].CityID)]);2261 MessgText := Format(S, [Phrases.Lookup('IMPROVEMENTS', I), 2262 CityName(MyRO.Wonder[I].CityID)]); 2108 2263 Kind := mkOkHelp; 2109 2264 HelpKind := hkImp; 2110 HelpNo := i;2265 HelpNo := I; 2111 2266 IconKind := mikImp; 2112 IconIndex := i;2267 IconIndex := I; 2113 2268 ShowModal; 2114 end 2115 end 2269 end; 2270 end; 2116 2271 end 2117 else if (MyRO.Wonder[ i].EffectiveOwner <> MyData.ToldWonders[i]2118 .EffectiveOwner) and (MyRO.Wonder[ i].CityID > WonderDestroyed) then2119 if MyRO.Wonder[ i].EffectiveOwner < 0 then2272 else if (MyRO.Wonder[I].EffectiveOwner <> MyData.ToldWonders[I] 2273 .EffectiveOwner) and (MyRO.Wonder[I].CityID > WonderDestroyed) then 2274 if MyRO.Wonder[I].EffectiveOwner < 0 then 2120 2275 begin 2121 if i<> woMIR then2276 if I <> woMIR then 2122 2277 with MessgExDlg do 2123 2278 begin { tell about expired wonders } 2124 2279 OpenSound := 'WONDER_EXPIRED'; 2125 2280 MessgText := Format(Phrases.Lookup('WONDEREXP'), 2126 [Phrases.Lookup('IMPROVEMENTS', i),2127 CityName(MyRO.Wonder[ i].CityID)]);2281 [Phrases.Lookup('IMPROVEMENTS', I), 2282 CityName(MyRO.Wonder[I].CityID)]); 2128 2283 Kind := mkOkHelp; 2129 2284 HelpKind := hkImp; 2130 HelpNo := i;2285 HelpNo := I; 2131 2286 IconKind := mikImp; 2132 IconIndex := i;2287 IconIndex := I; 2133 2288 ShowModal; 2134 end 2289 end; 2135 2290 end 2136 else if (MyData.ToldWonders[ i].EffectiveOwner >= 0) and not OwnWonder2291 else if (MyData.ToldWonders[I].EffectiveOwner >= 0) and not OwnWonder 2137 2292 then 2138 2293 with MessgExDlg do 2139 2294 begin { tell about capture of wonders } 2140 2295 OpenSound := 'WONDER_CAPTURED'; 2141 s := Tribe[MyRO.Wonder[i].EffectiveOwner].TPhrase('WONDERCAPT');2142 MessgText := Format( s, [Phrases.Lookup('IMPROVEMENTS', i),2143 CityName(MyRO.Wonder[ i].CityID)]);2296 S := Tribe[MyRO.Wonder[I].EffectiveOwner].TPhrase('WONDERCAPT'); 2297 MessgText := Format(S, [Phrases.Lookup('IMPROVEMENTS', I), 2298 CityName(MyRO.Wonder[I].CityID)]); 2144 2299 Kind := mkOkHelp; 2145 2300 HelpKind := hkImp; 2146 HelpNo := i;2301 HelpNo := I; 2147 2302 IconKind := mikImp; 2148 IconIndex := i;2303 IconIndex := I; 2149 2304 ShowModal; 2150 2305 end; … … 2154 2309 begin 2155 2310 SoundMessageEx(Phrases.Lookup('COLDWAREND'), 'MSG_DEFAULT'); 2156 MyData.ColdWarStart := -ColdWarTurns - 1 2311 MyData.ColdWarStart := -ColdWarTurns - 1; 2157 2312 end; 2158 2313 … … 2160 2315 end; // ClientMode<>cResume 2161 2316 MyData.ToldAlive := MyRO.Alive; 2162 move(MyRO.Wonder, MyData.ToldWonders, SizeOf(MyData.ToldWonders));2317 Move(MyRO.Wonder, MyData.ToldWonders, SizeOf(MyData.ToldWonders)); 2163 2318 2164 2319 NewGovAvailable := -1; … … 2184 2339 IconKind := mikBook; 2185 2340 IconIndex := -1; 2186 for i:= 0 to nAdvBookIcon - 1 do2187 if AdvBookIcon[ i].Adv = ad then2188 IconIndex := AdvBookIcon[ i].Icon;2341 for I := 0 to nAdvBookIcon - 1 do 2342 if AdvBookIcon[I].Adv = ad then 2343 IconIndex := AdvBookIcon[I].Icon; 2189 2344 ShowModal; 2190 2345 MyData.ToldTech[ad] := MyRO.Tech[ad]; 2191 for i:= gMonarchy to nGov - 1 do2192 if GovPreq[ i] = ad then2193 NewGovAvailable := i;2346 for I := gMonarchy to nGov - 1 do 2347 if GovPreq[I] = ad then 2348 NewGovAvailable := I; 2194 2349 end; 2195 2350 end; 2196 2351 2197 ShowCityList := false;2352 ShowCityList := False; 2198 2353 if ClientMode = cTurn then 2199 2354 begin … … 2201 2356 ChooseResearch; 2202 2357 2203 UpdatePanel := false;2358 UpdatePanel := False; 2204 2359 if MyRO.Happened and phChangeGov <> 0 then 2205 2360 begin 2206 2361 ModalSelectDlg.ShowNewContent(wmModal, kGov); 2207 2362 Play('NEWGOV'); 2208 Server(sSetGovernment, me, ModalSelectDlg.result, nil^);2363 Server(sSetGovernment, Me, ModalSelectDlg.Result, nil^); 2209 2364 CityOptimizer_BeginOfTurn; 2210 UpdatePanel := true;2365 UpdatePanel := True; 2211 2366 end; 2212 2367 end; // ClientMode=cTurn 2213 2368 2214 if not supervising and ((ClientMode = cTurn) or (ClientMode = cMovieTurn))2369 if not Supervising and ((ClientMode = cTurn) or (ClientMode = cMovieTurn)) 2215 2370 then 2216 2371 for cix := 0 to MyRO.nCity - 1 do … … 2222 2377 begin 2223 2378 // tell what happened in cities 2224 for WondersOnly := true downto false do2379 for WondersOnly := True downto False do 2225 2380 for cix := 0 to MyRO.nCity - 1 do 2226 2381 with MyCity[cix] do … … 2233 2388 begin { tell about newly built wonder } 2234 2389 OpenSound := 'WONDER_BUILT'; 2235 s := Tribe[me].TPhrase('WONDERBUILTOWN');2390 S := Tribe[Me].TPhrase('WONDERBUILTOWN'); 2236 2391 MessgText := 2237 Format( s, [Phrases.Lookup('IMPROVEMENTS',2392 Format(S, [Phrases.Lookup('IMPROVEMENTS', 2238 2393 Project0 and cpIndex), CityName(ID)]); 2239 2394 Kind := mkOkHelp; … … 2244 2399 ShowModal; 2245 2400 end; 2246 if not supervising and (ClientMode = cTurn) then2401 if not Supervising and (ClientMode = cTurn) then 2247 2402 begin 2248 AllowCityScreen := true;2403 AllowCityScreen := True; 2249 2404 if (Status and 7 <> 0) and 2250 2405 (Project and (cpImp + cpIndex) = cpImp + imTrGoods) then … … 2252 2407 begin 2253 2408 if AutoBuild(cix, MyData.ImpOrder[Status and 7 - 1]) then 2254 AllowCityScreen := false2409 AllowCityScreen := False 2255 2410 else if Flags and chProduction <> 0 then 2256 2411 Flags := (Flags and not chProduction) or chAllImpsMade … … 2280 2435 CityDlg.ShowNewContent(wmModal, MyCity[cix].Loc, 2281 2436 Flags and CityRepMask); 2282 UpdatePanel := true;2437 UpdatePanel := True; 2283 2438 end; 2284 2439 end … … 2286 2441 begin 2287 2442 if Flags and CityRepMask <> 0 then 2288 ShowCityList := true2443 ShowCityList := True; 2289 2444 end; 2290 2445 end; … … 2306 2461 begin 2307 2462 Play('REVOLUTION'); 2308 Server(sRevolution, me, 0, nil^);2463 Server(sRevolution, Me, 0, nil^); 2309 2464 end; 2310 2465 end; … … 2340 2495 DpiApplication.ProcessMessages; 2341 2496 2342 if not supervising then2497 if not Supervising then 2343 2498 for uix := 0 to MyRO.nUn - 1 do 2344 2499 with MyUn[uix] do … … 2368 2523 begin // !!! Shinkansen 2369 2524 MoveResult := eOK; 2370 ok := true;2371 for i:= 0 to MoveAdviceData.nStep - 1 do2525 ok := True; 2526 for I := 0 to MoveAdviceData.nStep - 1 do 2372 2527 begin 2373 Loc1 := dLoc(Loc, MoveAdviceData.dx[ i],2374 MoveAdviceData.dy[ i]);2528 Loc1 := dLoc(Loc, MoveAdviceData.dx[I], 2529 MoveAdviceData.dy[I]); 2375 2530 if (MyMap[Loc1] and (fCity or fOwned) = fCity) 2376 2531 // don't capture cities during auto move … … 2378 2533 // don't attack during auto move 2379 2534 begin 2380 ok := false;2535 ok := False; 2381 2536 Break 2382 2537 end … … 2385 2540 if (Loc1 = MoveAdviceData.ToLoc) or 2386 2541 (MoveAdviceData.ToLoc = maNextCity) and 2387 (MyMap[dLoc(Loc, MoveAdviceData.dx[ i],2388 MoveAdviceData.dy[ i])] and fCity <> 0) then2542 (MyMap[dLoc(Loc, MoveAdviceData.dx[I], 2543 MoveAdviceData.dy[I])] and fCity <> 0) then 2389 2544 MoveOptions := muAutoNoWait 2390 2545 else 2391 2546 MoveOptions := 0; 2392 MoveResult := MoveUnit(MoveAdviceData.dx[ i],2393 MoveAdviceData.dy[ i], MoveOptions);2547 MoveResult := MoveUnit(MoveAdviceData.dx[I], 2548 MoveAdviceData.dy[I], MoveOptions); 2394 2549 if (MoveResult < rExecuted) or (MoveResult = eEnemySpotted) 2395 2550 then 2396 2551 begin 2397 ok := false;2552 ok := False; 2398 2553 Break 2399 2554 end; … … 2407 2562 begin 2408 2563 MoveResult := eOK; 2409 Stop := true;2564 Stop := True; 2410 2565 end; 2411 2566 … … 2430 2585 end; // ClientMode=cTurn 2431 2586 2432 HaveStrategyAdvice := false; 2433 // (GameMode<>cMovie) and not supervising 2434 // and AdvisorDlg.HaveStrategyAdvice; 2435 GoOnPhase := true; 2436 if supervising or (GameMode = cMovie) then 2587 HaveStrategyAdvice := False; 2588 GoOnPhase := True; 2589 if Supervising or (GameMode = cMovie) then 2437 2590 begin 2438 2591 SetTroopLoc(-1); … … 2449 2602 SetUnFocus(-1) 2450 2603 else 2451 NextUnit(-1, false);2604 NextUnit(-1, False); 2452 2605 if UnFocus < 0 then 2453 2606 begin … … 2466 2619 end; 2467 2620 2468 procedure TMainScreen.Client(Command, NewPlayer: integer; var Data);2621 procedure TMainScreen.Client(Command, NewPlayer: Integer; var Data); 2469 2622 var 2470 i, j, p1, mix, ToLoc, AnimationSpeed, ShowMoveDomain, cix, ecix: integer;2623 I, J, p1, mix, ToLoc, AnimationSpeed, ShowMoveDomain, cix, ecix: Integer; 2471 2624 Color: TColor; 2472 Name, s: string;2625 Name, S: string; 2473 2626 TribeInfo: TTribeInfo; 2474 2627 mi: TModelInfo; 2475 SkipTurn, IsAlpine, IsTreatyDeal: boolean;2628 SkipTurn, IsAlpine, IsTreatyDeal: Boolean; 2476 2629 begin 2477 2630 case Command of 2478 2631 cTurn, cResume, cContinue, cMovieTurn, scContact, scDipStart .. scDipBreak: 2479 2632 begin 2480 supervising := G.Difficulty[NewPlayer] = 0;2633 Supervising := G.Difficulty[NewPlayer] = 0; 2481 2634 ArrangeMidPanel; 2482 2635 end … … 2484 2637 case Command of 2485 2638 cDebugMessage: 2486 LogDlg.Add(NewPlayer, G.RO[0].Turn, pchar(@Data));2639 LogDlg.Add(NewPlayer, G.RO[0].Turn, PChar(@Data)); 2487 2640 2488 2641 cShowNego: 2489 2642 with TShowNegoData(Data) do 2490 2643 begin 2491 s:= Format('P%d to P%d: ', [pSender, pTarget]);2644 S := Format('P%d to P%d: ', [pSender, pTarget]); 2492 2645 if (Action = scDipOffer) and (Offer.nDeliver + Offer.nCost > 0) then 2493 2646 begin 2494 s := s+ 'Offer ';2495 for i:= 0 to Offer.nDeliver + Offer.nCost - 1 do2647 S := S + 'Offer '; 2648 for I := 0 to Offer.nDeliver + Offer.nCost - 1 do 2496 2649 begin 2497 if i= Offer.nDeliver then2498 s := s+ ' for '2499 else if i> 0 then2500 s := s+ '+';2501 case Offer.Price[ i] and opMask of2650 if I = Offer.nDeliver then 2651 S := S + ' for ' 2652 else if I > 0 then 2653 S := S + '+'; 2654 case Offer.Price[I] and opMask of 2502 2655 opChoose: 2503 s := s+ 'Price of choice';2656 S := S + 'Price of choice'; 2504 2657 opCivilReport: 2505 s := s+ 'State report';2658 S := S + 'State report'; 2506 2659 opMilReport: 2507 s := s+ 'Military report';2660 S := S + 'Military report'; 2508 2661 opMap: 2509 s := s+ 'Map';2662 S := S + 'Map'; 2510 2663 opTreaty: 2511 s := s+ 'Treaty';2664 S := S + 'Treaty'; 2512 2665 opShipParts: 2513 s := s+ 'Ship part';2666 S := S + 'Ship part'; 2514 2667 opMoney: 2515 s := s + IntToStr(Offer.Price[i] and $FFFFFF) + 'o';2668 S := S + IntToStr(Offer.Price[I] and $FFFFFF) + 'o'; 2516 2669 opTribute: 2517 s := s + IntToStr(Offer.Price[i] and $FFFFFF) + 'o tribute';2670 S := S + IntToStr(Offer.Price[I] and $FFFFFF) + 'o tribute'; 2518 2671 opTech: 2519 s := s + Phrases.Lookup('ADVANCES', Offer.Price[i] and $FFFFFF);2672 S := S + Phrases.Lookup('ADVANCES', Offer.Price[I] and $FFFFFF); 2520 2673 opAllTech: 2521 s := s+ 'All advances';2674 S := S + 'All advances'; 2522 2675 opModel: 2523 s := s + Tribe[pSender].ModelName[Offer.Price[i] and $FFFFFF];2676 S := S + Tribe[pSender].ModelName[Offer.Price[I] and $FFFFFF]; 2524 2677 opAllModel: 2525 s := s+ 'All models';2678 S := S + 'All models'; 2526 2679 end; 2527 2680 end; 2528 LogDlg.Add(NewPlayer, G.RO[0].Turn, pchar(s));2681 LogDlg.Add(NewPlayer, G.RO[0].Turn, PChar(S)); 2529 2682 end 2530 2683 else if Action = scDipAccept then 2531 2684 begin 2532 s := s+ '--- ACCEPTED! ---';2533 LogDlg.Add(NewPlayer, G.RO[0].Turn, pchar(s));2685 S := S + '--- ACCEPTED! ---'; 2686 LogDlg.Add(NewPlayer, G.RO[0].Turn, PChar(S)); 2534 2687 end; 2535 2688 end; … … 2538 2691 begin 2539 2692 Server := TInitModuleData(Data).Server; 2540 // AdvisorDlg.Init;2541 2693 InitModule; 2542 2694 TInitModuleData(Data).DataSize := SizeOf(TPersistentData); … … 2552 2704 MainTexture.Age := -1; 2553 2705 Tribes.Init; 2554 HelpDlg.UserLeft := (DpiScreen. width - HelpDlg.width) div 2;2555 HelpDlg.UserTop := (DpiScreen. height - HelpDlg.height) div 2;2706 HelpDlg.UserLeft := (DpiScreen.Width - HelpDlg.Width) div 2; 2707 HelpDlg.UserTop := (DpiScreen.Height - HelpDlg.Height) div 2; 2556 2708 HelpDlg.Difficulty := 0; 2557 2709 if Command = cStartCredits then 2558 HelpDlg.ShowNewContent(wmModal, hkMisc, miscCredits)2710 HelpDlg.ShowNewContent(wmModal, hkMisc, Integer(miscCredits)) 2559 2711 else 2560 HelpDlg.ShowNewContent(wmModal, hkMisc, miscMain);2712 HelpDlg.ShowNewContent(wmModal, hkMisc, Integer(miscMain)); 2561 2713 Tribes.Done; 2562 2714 end; … … 2564 2716 cNewGame, cLoadGame, cMovie, cNewMap: 2565 2717 begin 2566 { if (Command=cNewGame) or (Command=cLoadGame) then2567 AdvisorDlg.NewGame(Data); }2568 2718 GenerateNames := mNames.Checked; 2569 GameOK := true;2719 GameOK := True; 2570 2720 G := TNewGameData(Data); 2571 me := -1;2721 Me := -1; 2572 2722 pLogo := -1; 2573 2723 ClientMode := -1; 2574 2724 SetMapOptions; 2575 2725 MainMap.pDebugMap := -1; 2576 idle := false;2726 Idle := False; 2577 2727 FillChar(Jump, SizeOf(Jump), 0); 2578 2728 if StartRunning then … … 2597 2747 ToldContact := 0; 2598 2748 ToldOwnCredibility := InitialCredibility; 2599 for i:= 0 to nPl - 1 do2600 if G.Difficulty[ i] > 0 then2601 inc(ToldAlive, 1 shl i);2749 for I := 0 to nPl - 1 do 2750 if G.Difficulty[I] > 0 then 2751 Inc(ToldAlive, 1 shl I); 2602 2752 PeaceEvaHappened := 0; 2603 for i:= 0 to nWonder - 1 do2604 with ToldWonders[ i] do2753 for I := 0 to nWonder - 1 do 2754 with ToldWonders[I] do 2605 2755 begin 2606 2756 CityID := -1; 2607 EffectiveOwner := -1 2757 EffectiveOwner := -1; 2608 2758 end; 2609 2759 FillChar(ToldTech, SizeOf(ToldTech), Byte(tsNA)); … … 2612 2762 end; 2613 2763 2614 // arrange dialogs 2615 ListDlg.UserLeft := 8; 2616 ListDlg.UserTop := TopBarHeight + 8; 2617 HelpDlg.UserLeft := DpiScreen.width - HelpDlg.width - 8; 2618 HelpDlg.UserTop := TopBarHeight + 8; 2619 UnitStatDlg.UserLeft := 397; 2620 UnitStatDlg.UserTop := TopBarHeight + 64; 2621 DiaDlg.UserLeft := (DpiScreen.width - DiaDlg.width) div 2; 2622 DiaDlg.UserTop := (DpiScreen.height - DiaDlg.height) div 2; 2623 NatStatDlg.UserLeft := DpiScreen.width - NatStatDlg.width - 8; 2624 NatStatDlg.UserTop := DpiScreen.height - PanelHeight - 2625 NatStatDlg.height - 8; 2626 if NatStatDlg.UserTop < 8 then 2627 NatStatDlg.UserTop := 8; 2764 ArrangeDialogs; 2628 2765 2629 2766 Age := 0; 2630 2767 MovieSpeed := 1; 2631 LogDlg.mSlot.Visible := true;2632 LogDlg.Host := self;2633 HelpDlg.ClearHistory;2634 CityDlg.Reset;2768 LogDlg.mSlot.Visible := True; 2769 LogDlg.Host := Self; 2770 if Assigned(FHelpDlg) then FHelpDlg.ClearHistory; 2771 if Assigned(FCityDlg) then FCityDlg.Reset; 2635 2772 2636 2773 MiniMap.Size := Point(G.lx, G.ly); 2637 for i:= 0 to nPl - 1 do2774 for I := 0 to nPl - 1 do 2638 2775 begin 2639 Tribe[ i] := nil;2640 TribeOriginal[ i] := false;2776 Tribe[I] := nil; 2777 TribeOriginal[I] := False; 2641 2778 end; 2642 2779 ToldSlavery := -1; 2643 RepaintOnResize := false;2644 Closable := false;2645 FirstMovieTurn := true;2780 RepaintOnResize := False; 2781 Closable := False; 2782 FirstMovieTurn := True; 2646 2783 2647 2784 MenuArea.Visible := GameMode <> cMovie; … … 2654 2791 if NewPlayer = 0 then 2655 2792 begin 2656 i:= 0;2793 I := 0; 2657 2794 for p1 := 0 to nPl - 1 do 2658 2795 if (G.Difficulty[p1] > 0) and (Tribe[p1] = nil) then 2659 inc(i);2660 if i> UnusedTribeFiles.Count then2796 Inc(I); 2797 if I > UnusedTribeFiles.Count then 2661 2798 begin 2662 GameOK := false;2799 GameOK := False; 2663 2800 SimpleMessage(Phrases.Lookup('TOOFEWTRIBES')); 2664 2801 end … … 2671 2808 TribeInfo.trix := p1; 2672 2809 TribeNames.Clear; 2673 for j:= 0 to UnusedTribeFiles.Count - 1 do2810 for J := 0 to UnusedTribeFiles.Count - 1 do 2674 2811 begin 2675 GetTribeInfo(UnusedTribeFiles[ j], Name, Color);2812 GetTribeInfo(UnusedTribeFiles[J], Name, Color); 2676 2813 TribeNames.AddObject(Name, TObject(Color)); 2677 2814 end; 2678 assert(TribeNames.Count > 0);2815 Assert(TribeNames.Count > 0); 2679 2816 ModalSelectDlg.ShowNewContent(wmModal, kTribe); 2680 2817 DpiApplication.ProcessMessages; 2681 TribeInfo.FileName := UnusedTribeFiles[ModalSelectDlg. result];2682 UnusedTribeFiles.Delete(ModalSelectDlg. result);2818 TribeInfo.FileName := UnusedTribeFiles[ModalSelectDlg.Result]; 2819 UnusedTribeFiles.Delete(ModalSelectDlg.Result); 2683 2820 2684 2821 if GameMode = cLoadGame then 2685 CreateTribe(TribeInfo.trix, TribeInfo.FileName, false)2822 CreateTribe(TribeInfo.trix, TribeInfo.FileName, False) 2686 2823 else 2687 Server( cSetTribe + (Length(TribeInfo.FileName) + 1 + 7) div 4,2824 Server(CommandWithData(cSetTribe, TribeInfo.GetCommandDataSize), 2688 2825 0, 0, TribeInfo); 2689 2826 end; … … 2693 2830 then 2694 2831 begin // autoselect enemy tribes 2695 j:= ChooseUnusedTribe;2696 TribeInfo.FileName := UnusedTribeFiles[ j];2697 UnusedTribeFiles.Delete( j);2832 J := ChooseUnusedTribe; 2833 TribeInfo.FileName := UnusedTribeFiles[J]; 2834 UnusedTribeFiles.Delete(J); 2698 2835 TribeInfo.trix := p1; 2699 2836 if GameMode = cLoadGame then 2700 CreateTribe(TribeInfo.trix, TribeInfo.FileName, false)2837 CreateTribe(TribeInfo.trix, TribeInfo.FileName, False) 2701 2838 else 2702 Server( cSetTribe + (Length(TribeInfo.FileName) + 1 + 7) div 4,2839 Server(CommandWithData(cSetTribe, TribeInfo.GetCommandDataSize), 2703 2840 0, 0, TribeInfo); 2704 2841 end; … … 2714 2851 SaveSettings; 2715 2852 CityDlg.CloseAction := None; 2716 for i := 0 to DpiScreen.FormCount - 1 do 2717 if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) 2718 then 2719 DpiScreen.Forms[i].Close; 2853 ApplyToVisibleForms(faClose); 2720 2854 if LogDlg.Visible then 2721 2855 LogDlg.Close; 2722 2856 LogDlg.List.Clear; 2723 StartRunning := not idle and (Jump[0] > 0); // AI called Reload2724 me := -1;2725 idle := false;2857 StartRunning := not Idle and (Jump[0] > 0); // AI called Reload 2858 Me := -1; 2859 Idle := False; 2726 2860 ClientMode := -1; 2727 UnitInfoBtn.Visible := false;2728 UnitBtn.Visible := false;2729 TerrainBtn.Visible := false;2730 MovieSpeed1Btn.Visible := false;2731 MovieSpeed2Btn.Visible := false;2732 MovieSpeed3Btn.Visible := false;2733 MovieSpeed4Btn.Visible := false;2734 EOT.Visible := false;2735 for i:= 0 to ControlCount - 1 do2736 if Controls[ i] is TButtonC then2737 Controls[ i].Visible := false;2861 UnitInfoBtn.Visible := False; 2862 UnitBtn.Visible := False; 2863 TerrainBtn.Visible := False; 2864 MovieSpeed1Btn.Visible := False; 2865 MovieSpeed2Btn.Visible := False; 2866 MovieSpeed3Btn.Visible := False; 2867 MovieSpeed4Btn.Visible := False; 2868 EOT.Visible := False; 2869 for I := 0 to ControlCount - 1 do 2870 if Controls[I] is TButtonC then 2871 Controls[I].Visible := False; 2738 2872 sb.Init(0, 1); 2739 2873 for p1 := 0 to nPl - 1 do … … 2741 2875 FreeAndNil(Tribe[p1]); 2742 2876 Tribes.Done; 2743 RepaintOnResize := false;2744 Closable := true;2877 RepaintOnResize := False; 2878 Closable := True; 2745 2879 Close; 2746 { if (GameMode=cNewGame) or (GameMode=cLoadGame) then2747 AdvisorDlg.BreakGame; }2748 2880 end; 2749 2881 … … 2765 2897 Show; 2766 2898 Update; 2767 RepaintOnResize := true;2899 RepaintOnResize := True; 2768 2900 xw := 0; 2769 2901 yw := ywcenter; 2770 if not StayOnTop_Ensured then2771 begin2772 StayOnTop_Ensured := true;2773 CityDlg.StayOnTop_Workaround;2774 CityTypeDlg.StayOnTop_Workaround;2775 DiaDlg.StayOnTop_Workaround;2776 DraftDlg.StayOnTop_Workaround;2777 EnhanceDlg.StayOnTop_Workaround;2778 HelpDlg.StayOnTop_Workaround;2779 NatStatDlg.StayOnTop_Workaround;2780 NegoDlg.StayOnTop_Workaround;2781 ModalSelectDlg.StayOnTop_Workaround;2782 ListDlg.StayOnTop_Workaround;2783 UnitStatDlg.StayOnTop_Workaround;2784 WondersDlg.StayOnTop_Workaround;2785 RatesDlg.StayOnTop_Workaround;2786 end;2787 2902 end; 2788 2903 2789 2904 cShowTurnChange: 2790 2905 begin 2791 if integer(Data) >= 0 then2906 if Integer(Data) >= 0 then 2792 2907 begin 2793 pLogo := integer(Data);2908 pLogo := Integer(Data); 2794 2909 if G.RO[pLogo] = nil then 2795 2910 begin 2796 2911 if AILogo[pLogo] <> nil then 2797 DpiBit Canvas(Canvas, (xRightPanel + 10) - (16 + 64),2912 DpiBitBltCanvas(Canvas, (xRightPanel + 10) - (16 + 64), 2798 2913 ClientHeight - PanelHeight, 64, 64, AILogo[pLogo].Canvas, 2799 2914 0, 0); 2800 end 2801 end 2915 end; 2916 end; 2802 2917 end; 2803 2918 … … 2818 2933 ItsMeAgain(p1); 2819 2934 for mix := 0 to MyRO.nModel - 1 do 2820 if not Assigned(Tribe[ me].ModelPicture[mix].HGr) then2821 InitMyModel(mix, true);2935 if not Assigned(Tribe[Me].ModelPicture[mix].HGr) then 2936 InitMyModel(mix, True); 2822 2937 end; 2823 me := -1;2938 Me := -1; 2824 2939 end; 2825 2940 … … 2830 2945 Jump[pTurn] := 0 2831 2946 else 2832 dec(Jump[pTurn]);2947 Dec(Jump[pTurn]); 2833 2948 SkipTurn := Jump[pTurn] > 0; 2834 2949 if SkipTurn then … … 2839 2954 MiniMapPaint; 2840 2955 InitAllEnemyModels; // necessary for correct replay 2841 if not EndTurn( true) then2842 SkipTurn := false;2956 if not EndTurn(True) then 2957 SkipTurn := False; 2843 2958 end; 2844 2959 if not SkipTurn then … … 2847 2962 NegoDlg.Visible then 2848 2963 NegoDlg.Close; 2849 skipped := false; // always show my moves during my turn2850 idle := true;2964 Skipped := False; // always show my moves during my turn 2965 Idle := True; 2851 2966 InitTurn(NewPlayer); 2852 DipMem[ me].pContact := -1;2853 (* if ( me=0) and (MyRO.Alive and (1 shl me)=0)} then2967 DipMem[Me].pContact := -1; 2968 (* if (Me=0) and (MyRO.Alive and (1 shl Me)=0)} then 2854 2969 begin 2855 2970 if SimpleQuery(Phrases.Lookup('RESIGN'))=mrIgnore then 2856 Server(sResign, me,0,nil^)2857 else Server(sBreak, me,0,nil^)2971 Server(sResign,Me,0,nil^) 2972 else Server(sBreak,Me,0,nil^) 2858 2973 end 2859 2974 else Play('TURNSTART'); *) … … 2866 2981 pTurn := NewPlayer; 2867 2982 pLogo := -1; 2868 skipped := false; // always show my moves during my turn2869 idle := true;2983 Skipped := False; // always show my moves during my turn 2984 Idle := True; 2870 2985 if FirstMovieTurn then 2871 2986 begin 2872 2987 CheckMovieSpeedBtnState; 2873 FirstMovieTurn := false;2988 FirstMovieTurn := False; 2874 2989 end; 2875 2990 InitTurn(NewPlayer); … … 2888 3003 pTurn := -1; 2889 3004 pLogo := -1; 2890 MapValid := false;3005 MapValid := False; 2891 3006 ClientMode := -1; 2892 idle := false;2893 skipped := false;3007 Idle := False; 3008 Skipped := False; 2894 3009 end; 2895 3010 … … 2901 3016 ItsMeAgain(0); 2902 3017 MyData := nil; 2903 UnitInfoBtn.Visible := false;2904 UnitBtn.Visible := false;2905 TerrainBtn.Visible := false;2906 MovieSpeed1Btn.Visible := false;2907 MovieSpeed2Btn.Visible := false;2908 MovieSpeed3Btn.Visible := false;2909 MovieSpeed4Btn.Visible := false;2910 EOT.Visible := false;3018 UnitInfoBtn.Visible := False; 3019 UnitBtn.Visible := False; 3020 TerrainBtn.Visible := False; 3021 MovieSpeed1Btn.Visible := False; 3022 MovieSpeed2Btn.Visible := False; 3023 MovieSpeed3Btn.Visible := False; 3024 MovieSpeed4Btn.Visible := False; 3025 EOT.Visible := False; 2911 3026 HelpDlg.Difficulty := 0; 2912 3027 BrushType := fGrass; 2913 3028 BrushLoc := -1; 2914 Edited := false;3029 Edited := False; 2915 3030 UnFocus := -1; 2916 3031 MarkCityLoc := -1; 2917 Tracking := false;2918 TurnComplete := false;2919 MapValid := false;3032 Tracking := False; 3033 TurnComplete := False; 3034 MapValid := False; 2920 3035 FormResize(nil); // calculate geometrics and paint all 2921 3036 SetTroopLoc(-1); 2922 idle := true;3037 Idle := True; 2923 3038 end; 2924 3039 … … 2930 3045 scContact: 2931 3046 begin 2932 DipMem[NewPlayer].pContact := integer(Data);3047 DipMem[NewPlayer].pContact := Integer(Data); 2933 3048 if Jump[NewPlayer] > 0 then 2934 3049 DipCall(scReject) … … 2937 3052 ClientMode := Command; 2938 3053 InitTurn(NewPlayer); 2939 MyData.ToldContact := MyData.ToldContact or (1 shl integer(Data));3054 MyData.ToldContact := MyData.ToldContact or (1 shl Integer(Data)); 2940 3055 // don't tell about new nation when already contacted by them 2941 3056 with MessgExDlg do 2942 3057 begin 2943 OpenSound := 'CONTACT_' + char(48 + MyRO.EnemyReport[ integer(Data)3058 OpenSound := 'CONTACT_' + char(48 + MyRO.EnemyReport[Integer(Data) 2944 3059 ].Attitude); 2945 MessgText := Tribe[ integer(Data)].TPhrase('FRCONTACT');3060 MessgText := Tribe[Integer(Data)].TPhrase('FRCONTACT'); 2946 3061 Kind := mkYesNo; 2947 3062 IconKind := mikTribe; 2948 IconIndex := integer(Data);3063 IconIndex := Integer(Data); 2949 3064 ShowModal; 2950 3065 if ModalResult = mrOK then 2951 3066 begin 2952 3067 NegoDlg.Respond; 2953 DipMem[ me].DeliveredPrices := [];2954 DipMem[ me].ReceivedPrices := [];3068 DipMem[Me].DeliveredPrices := []; 3069 DipMem[Me].ReceivedPrices := []; 2955 3070 DipCall(scDipStart); 2956 3071 end … … 2980 3095 else if Command = scDipAccept then 2981 3096 begin // remember delivered and received prices 2982 for i := 0 to DipMem[me].SentOffer.nDeliver - 1 do2983 include(DipMem[me].DeliveredPrices,2984 DipMem[ me].SentOffer.Price[i] shr 24);2985 for i := 0 to DipMem[me].SentOffer.nCost - 1 do2986 include(DipMem[me].ReceivedPrices,2987 DipMem[ me].SentOffer.Price[DipMem[me].SentOffer.nDeliver +2988 i] shr 24);2989 IsTreatyDeal := false;2990 for i:= 0 to ReceivedOffer.nDeliver + ReceivedOffer.nCost - 1 do2991 if DipMem[ me].SentOffer.Price[i] and opMask = opTreaty then2992 IsTreatyDeal := true;3097 for I := 0 to DipMem[Me].SentOffer.nDeliver - 1 do 3098 Include(DipMem[Me].DeliveredPrices, 3099 DipMem[Me].SentOffer.Price[I] shr 24); 3100 for I := 0 to DipMem[Me].SentOffer.nCost - 1 do 3101 Include(DipMem[Me].ReceivedPrices, 3102 DipMem[Me].SentOffer.Price[DipMem[Me].SentOffer.nDeliver + 3103 I] shr 24); 3104 IsTreatyDeal := False; 3105 for I := 0 to ReceivedOffer.nDeliver + ReceivedOffer.nCost - 1 do 3106 if DipMem[Me].SentOffer.Price[I] and opMask = opTreaty then 3107 IsTreatyDeal := True; 2993 3108 if IsTreatyDeal then 2994 3109 Play('NEWTREATY') … … 2997 3112 end; 2998 3113 NegoDlg.Start; 2999 idle := true;3114 Idle := True; 3000 3115 end; 3001 3116 … … 3003 3118 if not IsMultiPlayerGame then 3004 3119 begin 3005 case G.RO[NewPlayer].Treaty[ integer(Data)] of3120 case G.RO[NewPlayer].Treaty[Integer(Data)] of 3006 3121 trPeace: 3007 s := Tribe[integer(Data)].TPhrase('FRCANCELBYREJECT_PEACE');3122 S := Tribe[Integer(Data)].TPhrase('FRCANCELBYREJECT_PEACE'); 3008 3123 trFriendlyContact: 3009 s := Tribe[integer(Data)].TPhrase('FRCANCELBYREJECT_FRIENDLY');3124 S := Tribe[Integer(Data)].TPhrase('FRCANCELBYREJECT_FRIENDLY'); 3010 3125 trAlliance: 3011 s := Tribe[integer(Data)].TPhrase('FRCANCELBYREJECT_ALLIANCE');3126 S := Tribe[Integer(Data)].TPhrase('FRCANCELBYREJECT_ALLIANCE'); 3012 3127 end; 3013 TribeMessage( integer(Data), s, 'CANCELTREATY');3128 TribeMessage(Integer(Data), S, 'CANCELTREATY'); 3014 3129 end; 3015 3130 3016 3131 cShowCancelTreatyByAlliance: 3017 if idle and (NewPlayer = me) then3018 TribeMessage( integer(Data), Tribe[integer(Data)3132 if Idle and (NewPlayer = Me) then 3133 TribeMessage(Integer(Data), Tribe[Integer(Data) 3019 3134 ].TPhrase('FRENEMYALLIANCE'), 'CANCELTREATY'); 3020 3135 3021 3136 cShowSupportAllianceAgainst: 3022 3137 if not IsMultiPlayerGame and (Jump[0] = 0) then 3023 TribeMessage( integer(Data) and $F, Tribe[integer(Data) and $F]3024 .TPhrase('FRMYALLIANCE1') + ' ' + Tribe[ integer(Data) shr 4]3138 TribeMessage(Integer(Data) and $F, Tribe[Integer(Data) and $F] 3139 .TPhrase('FRMYALLIANCE1') + ' ' + Tribe[Integer(Data) shr 4] 3025 3140 .TPhrase('FRMYALLIANCE2'), 'CANCELTREATY'); 3026 3141 3027 3142 cShowPeaceViolation: 3028 3143 if not IsMultiPlayerGame and (Jump[0] = 0) then 3029 TribeMessage( integer(Data),3030 Format(Tribe[ integer(Data)].TPhrase('EVIOLATION'),3144 TribeMessage(Integer(Data), 3145 Format(Tribe[Integer(Data)].TPhrase('EVIOLATION'), 3031 3146 [TurnToString(MyRO.Turn + PeaceEvaTurns - 1)]), 'MSG_WITHDRAW'); 3032 3147 … … 3035 3150 3036 3151 cShowUnitChanged, cShowCityChanged, cShowAfterMove, cShowAfterAttack: 3037 if ( idle and (NewPlayer = me) or not idle and not skipped) and3152 if (Idle and (NewPlayer = Me) or not Idle and not skipped) and 3038 3153 not((GameMode = cMovie) and (MovieSpeed = 4)) then 3039 3154 begin 3040 assert(NewPlayer = me);3041 if not idle or (GameMode = cMovie) then3155 Assert(NewPlayer = Me); 3156 if not Idle or (GameMode = cMovie) then 3042 3157 DpiApplication.ProcessMessages; 3043 3158 if Command = cShowCityChanged then 3044 3159 begin 3045 CurrentMoveInfo.DoShow := false;3046 if idle then3047 CurrentMoveInfo.DoShow := true3160 CurrentMoveInfo.DoShow := False; 3161 if Idle then 3162 CurrentMoveInfo.DoShow := True 3048 3163 else if CurrentMoveInfo.IsAlly then 3049 3164 CurrentMoveInfo.DoShow := not mAlNoMoves.Checked … … 3053 3168 else if Command = cShowUnitChanged then 3054 3169 begin 3055 CurrentMoveInfo.DoShow := false;3056 if idle then3170 CurrentMoveInfo.DoShow := False; 3171 if Idle then 3057 3172 CurrentMoveInfo.DoShow := not mEffectiveMovesOnly.Checked 3058 3173 else if CurrentMoveInfo.IsAlly then … … 3068 3183 begin 3069 3184 if Command = cShowCityChanged then 3070 MapValid := false;3071 FocusOnLoc( integer(Data), flImmUpdate);3185 MapValid := False; 3186 FocusOnLoc(Integer(Data), flImmUpdate); 3072 3187 // OldUnFocus:=UnFocus; 3073 3188 // UnFocus:=-1; 3074 3189 if Command = cShowAfterMove then 3075 PaintLoc( integer(Data), CurrentMoveInfo.AfterMovePaintRadius)3190 PaintLoc(Integer(Data), CurrentMoveInfo.AfterMovePaintRadius) 3076 3191 // show discovered areas 3077 3192 else 3078 PaintLoc( integer(Data), 1);3193 PaintLoc(Integer(Data), 1); 3079 3194 // UnFocus:=OldUnFocus; 3080 3195 if (Command = cShowAfterAttack) and … … 3086 3201 Update; // remove message box from screen 3087 3202 end 3088 else if not idle then3203 else if not Idle then 3089 3204 if Command = cShowCityChanged then 3090 3205 Sleep(MoveTime * WaitAfterShowMove div 16) 3091 3206 else if (Command = cShowUnitChanged) and 3092 (MyMap[ integer(Data)] and fUnit <> 0) then3207 (MyMap[Integer(Data)] and fUnit <> 0) then 3093 3208 Sleep(MoveTime * WaitAfterShowMove div 32) 3094 3209 end // if CurrentMoveInfo.DoShow 3095 3210 else 3096 MapValid := false;3211 MapValid := False; 3097 3212 end; 3098 3213 3099 3214 cShowMoving, cShowCapturing: 3100 if ( idle and (NewPlayer = me) or not idle and not skipped and3215 if (Idle and (NewPlayer = Me) or not Idle and not skipped and 3101 3216 (TShowMove(Data).emix <> $FFFF)) and 3102 3217 not((GameMode = cMovie) and (MovieSpeed = 4)) then 3103 3218 begin 3104 assert(NewPlayer = me);3105 if not idle or (GameMode = cMovie) then3219 Assert(NewPlayer = Me); 3220 if not Idle or (GameMode = cMovie) then 3106 3221 DpiApplication.ProcessMessages; 3107 3222 with TShowMove(Data) do 3108 3223 begin 3109 CurrentMoveInfo.DoShow := false;3110 if not idle and (not Assigned(Tribe[Owner].ModelPicture[mix].HGr)) then3224 CurrentMoveInfo.DoShow := False; 3225 if not Idle and (not Assigned(Tribe[Owner].ModelPicture[mix].HGr)) then 3111 3226 InitEnemyModel(emix); 3112 3227 3113 3228 ToLoc := dLoc(FromLoc, dx, dy); 3114 if idle then3229 if Idle then 3115 3230 begin // own unit -- make discovered land visible 3116 assert(Owner = me); // no foreign moves during my turn!3231 Assert(Owner = Me); // no foreign moves during my turn! 3117 3232 CurrentMoveInfo.DoShow := not mEffectiveMovesOnly.Checked or 3118 3233 (Command = cShowCapturing); … … 3147 3262 else 3148 3263 CurrentMoveInfo.AfterMovePaintRadius := 1; 3149 if (MyRO.Wonder[woShinkansen].EffectiveOwner = me) and3264 if (MyRO.Wonder[woShinkansen].EffectiveOwner = Me) and 3150 3265 (Domain = dGround) and 3151 3266 (MyMap[FromLoc] and (fRR or fCity) <> 0) and … … 3162 3277 CurrentMoveInfo.IsAlly := MyRO.Treaty[Owner] = trAlliance; 3163 3278 if GameMode = cMovie then 3164 CurrentMoveInfo.DoShow := true3279 CurrentMoveInfo.DoShow := True 3165 3280 else if CurrentMoveInfo.IsAlly then 3166 3281 CurrentMoveInfo.DoShow := not mAlNoMoves.Checked and … … 3178 3293 cix := MyRO.nCity - 1; 3179 3294 while (cix >= 0) and (MyCity[cix].Loc <> ToLoc) do 3180 dec(cix);3181 s:= CityName(MyCity[cix].ID);3295 Dec(cix); 3296 S := CityName(MyCity[cix].ID); 3182 3297 end 3183 3298 else … … 3185 3300 ecix := MyRO.nEnemyCity - 1; 3186 3301 while (ecix >= 0) and (MyRO.EnemyCity[ecix].Loc <> ToLoc) do 3187 dec(ecix);3188 s:= CityName(MyRO.EnemyCity[ecix].ID);3302 Dec(ecix); 3303 S := CityName(MyRO.EnemyCity[ecix].ID); 3189 3304 end; 3190 3305 TribeMessage(Owner, Format(Tribe[Owner].TPhrase('CAPTURE'), 3191 [ s]), '');3306 [S]), ''); 3192 3307 Update; // remove message box from screen 3193 3308 end; … … 3274 3389 end // if CurrentMoveInfo.DoShow 3275 3390 else 3276 MapValid := false;3391 MapValid := False; 3277 3392 end; 3278 3393 end; 3279 3394 3280 3395 cShowAttacking: 3281 if ( idle and (NewPlayer = me) or not idle and not skipped and3396 if (Idle and (NewPlayer = Me) or not Idle and not skipped and 3282 3397 (TShowMove(Data).emix <> $FFFF)) and 3283 3398 not((GameMode = cMovie) and (MovieSpeed = 4)) then 3284 3399 begin 3285 assert(NewPlayer = me);3286 if not idle or (GameMode = cMovie) then3400 Assert(NewPlayer = Me); 3401 if not Idle or (GameMode = cMovie) then 3287 3402 DpiApplication.ProcessMessages; 3288 3403 with TShowMove(Data) do 3289 3404 begin 3290 3405 CurrentMoveInfo.AfterAttackExpeller := -1; 3291 CurrentMoveInfo.DoShow := false;3292 if idle then3293 CurrentMoveInfo.DoShow := true // own unit -- always show attacks3406 CurrentMoveInfo.DoShow := False; 3407 if Idle then 3408 CurrentMoveInfo.DoShow := True // own unit -- always show attacks 3294 3409 else 3295 3410 begin … … 3311 3426 cix := MyRO.nCity - 1; 3312 3427 while (cix >= 0) and (MyCity[cix].Loc <> ToLoc) do 3313 dec(cix);3428 Dec(cix); 3314 3429 if MyCity[cix].Status and csToldBombard = 0 then 3315 3430 begin 3316 if not supervising then3431 if not Supervising then 3317 3432 MyCity[cix].Status := MyCity[cix].Status or csToldBombard; 3318 s:= CityName(MyCity[cix].ID);3433 S := CityName(MyCity[cix].ID); 3319 3434 SoundMessageEx(Format(Tribe[Owner].TPhrase('BOMBARD'), 3320 [ s]), '');3435 [S]), ''); 3321 3436 Update; // remove message box from screen 3322 3437 end; … … 3327 3442 if Flags and umExpelling <> 0 then 3328 3443 Play('MOVE_EXPEL') 3329 else if Owner = me then3444 else if Owner = Me then 3330 3445 begin 3331 MakeModelInfo( me, mix, MyModel[mix], mi);3446 MakeModelInfo(Me, mix, MyModel[mix], mi); 3332 3447 Play(AttackSound(ModelCode(mi))); 3333 3448 end … … 3354 3469 MoveOnScreen(TShowMove(Data), 10, 0, 16); 3355 3470 end 3356 else if not idle then3471 else if not Idle then 3357 3472 Sleep(MoveTime div 2); 3358 3473 MainMap.AttackEnd; 3359 3474 end // if CurrentMoveInfo.DoShow 3360 3475 else 3361 MapValid := false;3476 MapValid := False; 3362 3477 end; 3363 3478 end; … … 3368 3483 else 3369 3484 begin 3370 s:= Phrases.Lookup('FOREIGNINFO');3485 S := Phrases.Lookup('FOREIGNINFO'); 3371 3486 for p1 := 0 to nPl - 1 do 3372 3487 if 3 shl (p1 * 2) and Cardinal(Data) <> 0 then 3373 s := s+ '\' + Tribe[p1].TPhrase('SHORTNAME');3374 SoundMessageEx( s, '');3488 S := S + '\' + Tribe[p1].TPhrase('SHORTNAME'); 3489 SoundMessageEx(S, ''); 3375 3490 end; 3376 3491 … … 3384 3499 begin 3385 3500 MessgText := Format(Phrases.Lookup('GRLIB_GENERAL'), 3386 [Phrases.Lookup('ADVANCES', integer(Data))]);3501 [Phrases.Lookup('ADVANCES', Integer(Data))]); 3387 3502 OpenSound := 'NEWADVANCE_GRLIB'; 3388 3503 Kind := mkOk; … … 3394 3509 cRefreshDebugMap: 3395 3510 begin 3396 if integer(Data) = MainMap.pDebugMap then3511 if Integer(Data) = MainMap.pDebugMap then 3397 3512 begin 3398 MapValid := false;3513 MapValid := False; 3399 3514 MainOffscreenPaint; 3400 3515 Update; 3401 end 3516 end; 3402 3517 end; 3403 3518 3404 3519 else 3405 3520 if Command >= cClientEx then 3406 case Command and $FFF0 of 3407 3521 case Command and (not Integer(CommandDataElementCountMask)) of 3408 3522 cSetTribe: 3409 with TTribeInfo(Data) do 3410 begin 3411 i := UnusedTribeFiles.Count - 1; 3412 while (i >= 0) and 3413 (AnsiCompareFileName(UnusedTribeFiles[i], FileName) <> 0) do 3414 dec(i); 3415 if i >= 0 then 3416 UnusedTribeFiles.Delete(i); 3417 CreateTribe(trix, FileName, true); 3523 with TTribeInfo(Data) do begin 3524 I := UnusedTribeFiles.Count - 1; 3525 while (I >= 0) and 3526 (AnsiCompareFileName(UnusedTribeFiles[I], FileName) <> 0) do 3527 Dec(I); 3528 if I >= 0 then 3529 UnusedTribeFiles.Delete(I); 3530 CreateTribe(trix, FileName, True); 3418 3531 end; 3419 3420 cSetNewModelPicture, cSetModelPicture: 3532 cSetNewModelPicture: 3421 3533 if TribeOriginal[TModelPictureInfo(Data).trix] then 3422 3534 Tribe[TModelPictureInfo(Data).trix].SetModelPicture 3423 (TModelPictureInfo(Data), Command and 3424 $FFF0 = cSetNewModelPicture); 3425 3426 cSetSlaveIndex and $FFF0: 3427 Tribe[integer(Data) shr 16].mixSlaves := integer(Data) and $FFFF; 3428 3535 (TModelPictureInfo(Data), True); 3536 cSetModelPicture: 3537 if TribeOriginal[TModelPictureInfo(Data).trix] then 3538 Tribe[TModelPictureInfo(Data).trix].SetModelPicture 3539 (TModelPictureInfo(Data), False); 3540 cSetSlaveIndex: 3541 Tribe[Integer(Data) shr 16].mixSlaves := Integer(Data) and $FFFF; 3429 3542 cSetCityName: 3430 3543 with TCityNameInfo(Data) do 3431 3544 if TribeOriginal[ID shr 12] then 3432 3545 Tribe[ID shr 12].SetCityName(ID and $FFF, NewName); 3433 3434 3546 cSetModelName: 3435 3547 with TModelNameInfo(Data) do … … 3444 3556 procedure TMainScreen.FormCreate(Sender: TObject); 3445 3557 var 3446 i, j: integer;3558 I, J: Integer; 3447 3559 begin 3448 3560 NoMap := TIsoMap.Create; … … 3486 3598 3487 3599 // tag-controlled language 3488 for i:= 0 to ComponentCount - 1 do3489 if Components[ i].Tag and $FF <> 0 then3490 if Components[ i] is TDpiMenuItem then begin3491 TDpiMenuItem(Components[ i]).Caption := Phrases.Lookup('CONTROLS',3492 -1 + Components[ i].Tag and $FF);3493 for j:= 0 to Length(SaveOption) - 1 do3494 if Components[ i].Tag and $FF = SaveOption[j] then3495 TDpiMenuItem(Components[ i]).Checked := TSaveOption(j) in OptionChecked;3600 for I := 0 to ComponentCount - 1 do 3601 if Components[I].Tag and $FF <> 0 then 3602 if Components[I] is TDpiMenuItem then begin 3603 TDpiMenuItem(Components[I]).Caption := Phrases.Lookup('CONTROLS', 3604 -1 + Components[I].Tag and $FF); 3605 for J := 0 to Length(SaveOption) - 1 do 3606 if Components[I].Tag and $FF = SaveOption[J] then 3607 TDpiMenuItem(Components[I]).Checked := TSaveOption(J) in OptionChecked; 3496 3608 end else 3497 if Components[ i] is TButtonBase then begin3498 TButtonBase(Components[ i]).Hint := Phrases.Lookup('CONTROLS',3499 -1 + Components[ i].Tag and $FF);3500 if (Components[ i] is TButtonC) and3501 (TButtonC(Components[ i]).ButtonIndex <> 1) then3502 TButtonC(Components[ i]).ButtonIndex :=3503 Integer(MapOptionChecked) shr (Components[ i].Tag shr 8) and 1 + 23609 if Components[I] is TButtonBase then begin 3610 TButtonBase(Components[I]).Hint := Phrases.Lookup('CONTROLS', 3611 -1 + Components[I].Tag and $FF); 3612 if (Components[I] is TButtonC) and 3613 (TButtonC(Components[I]).ButtonIndex <> 1) then 3614 TButtonC(Components[I]).ButtonIndex := 3615 Integer(MapOptionChecked) shr (Components[I].Tag shr 8) and 1 + 2 3504 3616 end; 3505 3617 … … 3514 3626 ManagementArea.Hint := Phrases2.Lookup('BTN_MANAGE'); 3515 3627 end; 3516 for i:= 0 to mRep.Count - 1 do3517 begin 3518 j := mRep[i].Tag shr 8;3519 mRep[ i].Caption := CityEventName(j);3520 mRep[ i].Checked := CityRepMask and (1 shl j) <> 0;3628 for I := 0 to mRep.Count - 1 do 3629 begin 3630 J := mRep[I].Tag shr 8; 3631 mRep[I].Caption := CityEventName(J); 3632 mRep[I].Checked := CityRepMask and (1 shl J) <> 0; 3521 3633 end; 3522 3634 … … 3537 3649 else Buffer.height := 3 * ySizeBig; 3538 3650 Buffer.Canvas.Font.Assign(UniFont[ftSmall]); 3539 for i:= 0 to nPl - 1 do3540 AILogo[ i] := nil;3651 for I := 0 to nPl - 1 do 3652 AILogo[I] := nil; 3541 3653 Canvas.Font.Assign(UniFont[ftSmall]); 3542 3654 InitButtons; … … 3548 3660 I: Integer; 3549 3661 begin 3662 if Assigned(FWondersDlg) then FreeAndNil(FWondersDlg); 3663 if Assigned(FTechTreeDlg) then FreeAndNil(FTechTreeDlg); 3664 if Assigned(FEnhanceDlg) then FreeAndNil(FEnhanceDlg); 3665 if Assigned(FNegoDlg) then FreeAndNil(FNegoDlg); 3666 if Assigned(FCityTypeDlg) then FreeAndNil(FCityTypeDlg); 3667 if Assigned(FDiaDlg) then FreeAndNil(FDiaDlg); 3668 if Assigned(FCityDlg) then FreeAndNil(FCityDlg); 3669 if Assigned(FRatesDlg) then FreeAndNil(FRatesDlg); 3670 if Assigned(FBattleDlg) then FreeAndNil(FBattleDlg); 3671 if Assigned(FNatStatDlg) then FreeAndNil(FNatStatDlg); 3672 if Assigned(FUnitStatDlg) then FreeAndNil(FUnitStatDlg); 3673 if Assigned(FDraftDlg) then FreeAndNil(FDraftDlg); 3674 if Assigned(FModalSelectDlg) then FreeAndNil(FModalSelectDlg); 3675 if Assigned(FListDlg) then FreeAndNil(FListDlg); 3676 if Assigned(FMessgExDlg) then FreeAndNil(FMessgExDlg); 3677 if Assigned(FHelpDlg) then FreeAndNil(FHelpDlg); 3678 3550 3679 MainFormKeyDown := nil; 3551 3680 FreeAndNil(sb); … … 3555 3684 FreeAndNil(Panel); 3556 3685 for I := 0 to nPl - 1 do 3557 if AILogo[ i] <> nil then3686 if AILogo[I] <> nil then 3558 3687 FreeAndNil(AILogo[I]); 3559 3688 FreeAndNil(Offscreen); … … 3586 3715 end; 3587 3716 3717 procedure TMainScreen.mAfforestClick(Sender: TObject); 3718 begin 3719 if UnFocus >= 0 then 3720 with TUn(MyUn[UnFocus]) do 3721 DoJob(jAfforest); 3722 end; 3723 3724 procedure TMainScreen.mAirBaseClick(Sender: TObject); 3725 begin 3726 if UnFocus >= 0 then 3727 with TUn(MyUn[UnFocus]) do 3728 DoJob(jBase); 3729 end; 3730 3731 procedure TMainScreen.mCanalClick(Sender: TObject); 3732 begin 3733 if UnFocus >= 0 then 3734 with TUn(MyUn[UnFocus]) do 3735 DoJob(jCanal); 3736 end; 3737 3738 procedure TMainScreen.mCancelClick(Sender: TObject); 3739 begin 3740 if UnFocus >= 0 then 3741 with MyUn[UnFocus] do begin 3742 DestinationMarkON := False; 3743 PaintDestination; 3744 Status := Status and ($FFFF - usRecover - usGoto - usEnhance); 3745 if Job > jNone then 3746 Server(sStartJob + jNone shl 4, Me, UnFocus, nil^); 3747 end; 3748 end; 3749 3750 procedure TMainScreen.mCentreClick(Sender: TObject); 3751 begin 3752 if UnFocus >= 0 then 3753 with TUn(MyUn[UnFocus]) do begin 3754 Centre(Loc); 3755 PaintAllMaps; 3756 end; 3757 end; 3758 3759 procedure TMainScreen.mcityClick(Sender: TObject); 3760 var 3761 Loc0: Integer; 3762 cix: Integer; 3763 ServerResult: Integer; 3764 begin 3765 if UnFocus >= 0 then 3766 with TUn(MyUn[UnFocus]) do begin 3767 Loc0 := Loc; 3768 if MyMap[Loc] and fCity = 0 then 3769 begin // build city 3770 if DoJob(jCity) = eCity then 3771 begin 3772 MapValid := False; 3773 PaintAll; 3774 ZoomToCity(Loc0, True, chFounded); 3775 end; 3776 end else begin 3777 CityOptimizer_BeforeRemoveUnit(UnFocus); 3778 ServerResult := Server(sAddToCity, Me, UnFocus, nil^); 3779 if ServerResult >= rExecuted then 3780 begin 3781 cix := MyRO.nCity - 1; 3782 while (cix >= 0) and (MyCity[cix].Loc <> Loc0) do 3783 Dec(cix); 3784 Assert(cix >= 0); 3785 CityOptimizer_CityChange(cix); 3786 CityOptimizer_AfterRemoveUnit; // does nothing here 3787 SetTroopLoc(Loc0); 3788 UpdateViews(True); 3789 DestinationMarkON := False; 3790 PaintDestination; 3791 UnFocus := -1; 3792 PaintLoc(Loc0); 3793 NextUnit(UnStartLoc, True); 3794 end 3795 else if ServerResult = eMaxSize then 3796 SimpleMessage(Phrases.Lookup('ADDTOMAXSIZE')); 3797 end; 3798 end; 3799 end; 3800 3801 procedure TMainScreen.mCityStatClick(Sender: TObject); 3802 begin 3803 ListDlg.ShowNewContent(wmPersistent, kCities); 3804 end; 3805 3806 procedure TMainScreen.mCityTypesClick(Sender: TObject); 3807 begin 3808 CityTypeDlg.ShowNewContent(wmModal); 3809 // must be modal because types are not saved before closing 3810 end; 3811 3812 procedure TMainScreen.mClearClick(Sender: TObject); 3813 begin 3814 if UnFocus >= 0 then 3815 with TUn(MyUn[UnFocus]) do 3816 DoJob(jClear); 3817 end; 3818 3819 procedure TMainScreen.mDiagramClick(Sender: TObject); 3820 begin 3821 DiaDlg.ShowNewContent_Charts(wmPersistent); 3822 end; 3823 3824 procedure TMainScreen.mEmpireClick(Sender: TObject); 3825 begin 3826 RatesDlg.ShowNewContent(wmPersistent); 3827 end; 3828 3829 procedure TMainScreen.mEnhanceClick(Sender: TObject); 3830 begin 3831 if UnFocus >= 0 then 3832 with TUn(MyUn[UnFocus]) do 3833 DoJob(-1); 3834 end; 3835 3836 procedure TMainScreen.mEnhanceDefClick(Sender: TObject); 3837 begin 3838 if UnFocus >= 0 then 3839 EnhanceDlg.ShowNewContent(wmPersistent, 3840 MyMap[MyUn[UnFocus].Loc] and fTerrain) 3841 else 3842 EnhanceDlg.ShowNewContent(wmPersistent); 3843 end; 3844 3845 procedure TMainScreen.mEUnitStatClick(Sender: TObject); 3846 begin 3847 if MyRO.nEnemyModel > 0 then 3848 ListDlg.ShowNewContent(wmPersistent, kAllEModels); 3849 end; 3850 3851 procedure TMainScreen.mFarmClick(Sender: TObject); 3852 begin 3853 if UnFocus >= 0 then 3854 with TUn(MyUn[UnFocus]) do 3855 DoJob(jFarm); 3856 end; 3857 3858 procedure TMainScreen.mfortClick(Sender: TObject); 3859 begin 3860 if UnFocus >= 0 then 3861 with TUn(MyUn[UnFocus]) do 3862 DoJob(jFort); 3863 end; 3864 3865 procedure TMainScreen.mGoOnClick(Sender: TObject); 3866 var 3867 Destination: Integer; 3868 begin 3869 if UnFocus >= 0 then 3870 with TUn(MyUn[UnFocus]) do begin 3871 if Status shr 16 = $7FFF then 3872 Destination := maNextCity 3873 else 3874 Destination := Status shr 16; 3875 Status := Status and not(usStay or usRecover) or usWaiting; 3876 MoveToLoc(Destination, True); 3877 end; 3878 end; 3879 3880 procedure TMainScreen.mHelpClick(Sender: TObject); 3881 begin 3882 if ClientMode = cEditMap then 3883 HelpDlg.ShowNewContent(wmPersistent, hkText, HelpDlg.TextIndex('MAPEDIT')) 3884 else 3885 HelpDlg.ShowNewContent(wmPersistent, hkMisc, Integer(miscMain)); 3886 end; 3887 3888 procedure TMainScreen.mhomeClick(Sender: TObject); 3889 var 3890 cixOldHome: Integer; 3891 begin 3892 if UnFocus >= 0 then 3893 with TUn(MyUn[UnFocus]) do begin 3894 if MyMap[Loc] and fCity <> 0 then 3895 begin 3896 cixOldHome := Home; 3897 if Server(sSetUnitHome, Me, UnFocus, nil^) >= rExecuted then 3898 begin 3899 CityOptimizer_CityChange(cixOldHome); 3900 CityOptimizer_CityChange(Home); 3901 UpdateViews(True); 3902 end 3903 else 3904 Play('INVALID'); 3905 end 3906 else 3907 begin 3908 Status := Status and not(usStay or usRecover or usEnhance); 3909 MoveToLoc(maNextCity, True); 3910 end; 3911 end; 3912 end; 3913 3914 procedure TMainScreen.mirrigationClick(Sender: TObject); 3915 begin 3916 if UnFocus >= 0 then 3917 with TUn(MyUn[UnFocus]) do 3918 DoJob(jIrr); 3919 end; 3920 3921 procedure TMainScreen.mirrigationDrawItem(Sender: TObject; ACanvas: TDpiCanvas; 3922 ARect: TRect; AState: TOwnerDrawState); 3923 begin 3924 3925 end; 3926 3927 procedure TMainScreen.mJumpClick(Sender: TObject); 3928 begin 3929 if Supervising then 3930 Jump[0] := 20 3931 else 3932 Jump[Me] := 20; 3933 EndTurn(True); 3934 end; 3935 3936 procedure TMainScreen.mLoadClick(Sender: TObject); 3937 var 3938 I: Integer; 3939 begin 3940 if UnFocus >= 0 then 3941 with MyUn[UnFocus] do begin 3942 I := Server(sLoadUnit, Me, UnFocus, nil^); 3943 if I >= rExecuted then 3944 begin 3945 if MyModel[mix].Domain = dAir then 3946 Play('MOVE_PLANELANDING') 3947 else 3948 Play('MOVE_LOAD'); 3949 DestinationMarkON := False; 3950 PaintDestination; 3951 Status := Status and ($FFFF - usWaiting - usStay - usRecover - usGoto - usEnhance); 3952 NextUnit(UnStartLoc, True); 3953 end 3954 else if I = eNoTime_Load then 3955 if MyModel[mix].Domain = dAir then 3956 SoundMessage(Phrases.Lookup('NOTIMELOADAIR'), 'NOMOVE_TIME') 3957 else 3958 SoundMessage(Format(Phrases.Lookup('NOTIMELOADGROUND'), 3959 [MovementToString(MyModel[mix].speed)]), 'NOMOVE_TIME'); 3960 end; 3961 end; 3962 3963 procedure TMainScreen.mmineClick(Sender: TObject); 3964 begin 3965 if UnFocus >= 0 then 3966 with TUn(MyUn[UnFocus]) do 3967 DoJob(jMine); 3968 end; 3969 3970 procedure TMainScreen.mNationsClick(Sender: TObject); 3971 begin 3972 NatStatDlg.ShowNewContent(wmPersistent); 3973 end; 3974 3975 procedure TMainScreen.mNextUnitClick(Sender: TObject); 3976 begin 3977 if UnFocus >= 0 then 3978 with MyUn[UnFocus] do begin 3979 Status := Status and not usWaiting; 3980 FocusNextUnit(1); 3981 end; 3982 end; 3983 3984 procedure TMainScreen.mnoordersClick(Sender: TObject); 3985 begin 3986 if UnFocus >= 0 then 3987 with MyUn[UnFocus] do begin 3988 Status := Status and not usWaiting; 3989 NextUnit(UnStartLoc, True); 3990 end; 3991 end; 3992 3993 procedure TMainScreen.mPillageClick(Sender: TObject); 3994 begin 3995 DoJob(jPillage); 3996 end; 3997 3998 procedure TMainScreen.mpollutionClick(Sender: TObject); 3999 begin 4000 if UnFocus >= 0 then 4001 with TUn(MyUn[UnFocus]) do 4002 DoJob(jPoll); 4003 end; 4004 4005 procedure TMainScreen.mPrevUnitClick(Sender: TObject); 4006 begin 4007 if UnFocus >= 0 then 4008 with MyUn[UnFocus] do begin 4009 Status := Status and not usWaiting; 4010 FocusNextUnit(-1); 4011 end; 4012 end; 4013 4014 procedure TMainScreen.mRandomMapClick(Sender: TObject); 4015 begin 4016 if not Edited or (SimpleQuery(mkYesNo, Phrases.Lookup('MAP_RANDOM'), '') 4017 = mrOK) then begin 4018 Server(sRandomMap, Me, 0, nil^); 4019 Edited := True; 4020 MapValid := False; 4021 PaintAllMaps; 4022 end; 4023 end; 4024 4025 procedure TMainScreen.mRecoverClick(Sender: TObject); 4026 begin 4027 if UnFocus >= 0 then 4028 with MyUn[UnFocus] do begin 4029 DestinationMarkON := False; 4030 PaintDestination; 4031 Status := Status and ($FFFF - usStay - usGoto - usEnhance) or usRecover; 4032 if Job > jNone then 4033 Server(sStartJob + jNone shl 4, Me, UnFocus, nil^); 4034 NextUnit(UnStartLoc, True); 4035 end; 4036 end; 4037 4038 procedure TMainScreen.mResignClick(Sender: TObject); 4039 var 4040 QueryText: string; 4041 begin 4042 if ClientMode = cEditMap then begin 4043 if Edited then begin 4044 QueryText := Phrases.Lookup('MAP_CLOSE'); 4045 case SimpleQuery(mkYesNoCancel, QueryText, '') of 4046 mrIgnore: Server(sAbandonMap, Me, 0, nil^); 4047 mrOK: Server(sSaveMap, Me, 0, nil^); 4048 end; 4049 end else 4050 Server(sAbandonMap, Me, 0, nil^); 4051 end else begin 4052 if Server(sGetGameChanged, 0, 0, nil^) = eOK then begin 4053 QueryText := Phrases.Lookup('RESIGN'); 4054 case SimpleQuery(mkYesNoCancel, QueryText, '') of 4055 mrIgnore: Server(sResign, 0, 0, nil^); 4056 mrOK: Server(sBreak, 0, 0, nil^); 4057 end; 4058 end else 4059 Server(sResign, 0, 0, nil^); 4060 end; 4061 end; 4062 4063 procedure TMainScreen.mRevolutionClick(Sender: TObject); 4064 var 4065 AltGovs: Boolean; 4066 RevolutionChanged: Boolean; 4067 I: Integer; 4068 begin 4069 AltGovs := False; 4070 for I := 2 to nGov - 1 do 4071 if (GovPreq[I] <> preNA) and 4072 ((GovPreq[I] = preNone) or (MyRO.Tech[GovPreq[I]] >= tsApplicable)) then 4073 AltGovs := True; 4074 4075 if not AltGovs then 4076 SoundMessage(Phrases.Lookup('NOALTGOVS'), 'MSG_DEFAULT') 4077 else 4078 begin 4079 RevolutionChanged := False; 4080 if MyRO.Happened and phChangeGov <> 0 then 4081 begin 4082 ModalSelectDlg.ShowNewContent(wmModal, kGov); 4083 if ModalSelectDlg.Result >= 0 then 4084 begin 4085 Play('NEWGOV'); 4086 Server(sSetGovernment, Me, ModalSelectDlg.Result, nil^); 4087 CityOptimizer_BeginOfTurn; 4088 RevolutionChanged := True; 4089 end; 4090 end 4091 else 4092 with MessgExDlg do 4093 begin // revolution! 4094 MessgExDlg.MessgText := Tribe[Me].TPhrase('REVOLUTION'); 4095 MessgExDlg.Kind := mkYesNo; 4096 MessgExDlg.IconKind := mikPureIcon; 4097 MessgExDlg.IconIndex := 72; // anarchy palace 4098 MessgExDlg.ShowModal; 4099 if ModalResult = mrOK then 4100 begin 4101 Play('REVOLUTION'); 4102 Server(sRevolution, Me, 0, nil^); 4103 RevolutionChanged := True; 4104 if NatStatDlg.Visible then 4105 NatStatDlg.Close; 4106 if CityDlg.Visible then 4107 CityDlg.Close; 4108 end 4109 end; 4110 if RevolutionChanged then 4111 UpdateViews(True); 4112 end; 4113 end; 4114 4115 procedure TMainScreen.mroadClick(Sender: TObject); 4116 begin 4117 if UnFocus >= 0 then 4118 with TUn(MyUn[UnFocus]) do 4119 DoJob(jRoad); 4120 end; 4121 4122 procedure TMainScreen.mRailRoadClick(Sender: TObject); 4123 begin 4124 if UnFocus >= 0 then 4125 with TUn(MyUn[UnFocus]) do 4126 DoJob(jRR); 4127 end; 4128 4129 procedure TMainScreen.mRunClick(Sender: TObject); 4130 begin 4131 if Supervising then 4132 Jump[0] := 999999 4133 else 4134 Jump[Me] := 999999; 4135 EndTurn(True); 4136 end; 4137 4138 procedure TMainScreen.mScienceStatClick(Sender: TObject); 4139 begin 4140 ListDlg.ShowNewContent(wmPersistent, kScience); 4141 end; 4142 4143 procedure TMainScreen.mSelectTransportClick(Sender: TObject); 4144 begin 4145 if UnFocus >= 0 then 4146 with TUn(MyUn[UnFocus]) do 4147 Server(sSelectTransport, Me, UnFocus, nil^); 4148 end; 4149 4150 procedure TMainScreen.mShipsClick(Sender: TObject); 4151 begin 4152 DiaDlg.ShowNewContent_Ship(wmPersistent); 4153 end; 4154 4155 procedure TMainScreen.mstayClick(Sender: TObject); 4156 begin 4157 if UnFocus >= 0 then 4158 with TUn(MyUn[UnFocus]) do begin 4159 DestinationMarkON := False; 4160 PaintDestination; 4161 Status := Status and ($FFFF - usRecover - usGoto - usEnhance) or usStay; 4162 if Job > jNone then 4163 Server(sStartJob + jNone shl 4, Me, UnFocus, nil^); 4164 NextUnit(UnStartLoc, True); 4165 end; 4166 end; 4167 4168 procedure TMainScreen.mTechTreeClick(Sender: TObject); 4169 begin 4170 TechTreeDlg.ShowModal; 4171 end; 4172 4173 procedure TMainScreen.mtransClick(Sender: TObject); 4174 begin 4175 if UnFocus >= 0 then 4176 with TUn(MyUn[UnFocus]) do 4177 DoJob(jTrans); 4178 end; 4179 4180 procedure TMainScreen.mUnitStatClick(Sender: TObject); 4181 var 4182 I: Integer; 4183 begin 4184 if G.Difficulty[Me] > 0 then 4185 ListDlg.ShowNewContent_MilReport(wmPersistent, Me) 4186 else 4187 begin 4188 I := 1; 4189 while (I < nPl) and (1 shl I and MyRO.Alive = 0) do 4190 Inc(I); 4191 if I < nPl then 4192 ListDlg.ShowNewContent_MilReport(wmPersistent, I); 4193 end; 4194 end; 4195 4196 procedure TMainScreen.mUnloadClick(Sender: TObject); 4197 var 4198 I: Integer; 4199 OldMaster: Integer; 4200 NewFocus: Integer; 4201 uix: Integer; 4202 begin 4203 if UnFocus >= 0 then 4204 with MyUn[UnFocus] do begin 4205 if Master >= 0 then begin 4206 OldMaster := Master; 4207 I := Server(sUnloadUnit, Me, UnFocus, nil^); 4208 if I >= rExecuted then 4209 begin 4210 if MyModel[mix].Domain = dAir then 4211 Play('MOVE_PLANESTART') 4212 else if (MyModel[MyUn[OldMaster].mix].Domain = dAir) and 4213 (MyMap[Loc] and fCity = 0) and (MyMap[Loc] and fTerImp <> tiBase) 4214 then 4215 Play('MOVE_PARACHUTE') 4216 else 4217 Play('MOVE_UNLOAD'); 4218 Status := Status and not usWaiting; 4219 if MyModel[mix].Domain <> dAir then 4220 NextUnit(Loc, True) 4221 else 4222 PanelPaint; 4223 end 4224 else if I = eNoTime_Load then 4225 if MyModel[mix].Domain = dAir then 4226 SoundMessage(Phrases.Lookup('NOTIMELOADAIR'), 'NOMOVE_TIME') 4227 else 4228 SoundMessage(Format(Phrases.Lookup('NOTIMELOADGROUND'), 4229 [MovementToString(MyModel[mix].speed)]), 'NOMOVE_TIME'); 4230 end else begin 4231 NewFocus := -1; 4232 uix := UnFocus; 4233 for I := 1 to MyRO.nUn - 1 do 4234 begin 4235 uix := (uix + MyRO.nUn - 1) mod MyRO.nUn; 4236 if (MyUn[uix].Master = UnFocus) and 4237 (MyUn[uix].Movement = Integer(MyModel[MyUn[uix].mix].speed)) then 4238 begin 4239 MyUn[uix].Status := MyUn[uix].Status or usWaiting; 4240 NewFocus := uix; 4241 end; 4242 end; 4243 if NewFocus >= 0 then 4244 begin 4245 SetUnFocus(NewFocus); 4246 SetTroopLoc(Loc); 4247 PanelPaint; 4248 end; 4249 end; 4250 end; 4251 end; 4252 4253 procedure TMainScreen.mwaitClick(Sender: TObject); 4254 begin 4255 if UnFocus >= 0 then 4256 with MyUn[UnFocus] do begin 4257 DestinationMarkON := False; 4258 PaintDestination; 4259 Status := Status and ($FFFF - usStay - usRecover - usGoto - usEnhance) or usWaiting; 4260 end; 4261 NextUnit(-1, False); 4262 end; 4263 4264 procedure TMainScreen.mWebsiteClick(Sender: TObject); 4265 begin 4266 OpenURL(CevoHomepage); 4267 end; 4268 4269 procedure TMainScreen.mWondersClick(Sender: TObject); 4270 begin 4271 WondersDlg.ShowNewContent(wmPersistent); 4272 end; 4273 3588 4274 procedure TMainScreen.FormResize(Sender: TObject); 3589 4275 var 3590 MiniFrame, MaxMapWidth: integer;4276 MiniFrame, MaxMapWidth: Integer; 3591 4277 begin 3592 4278 SmallScreen := ClientWidth < 1024; … … 3666 4352 begin 3667 4353 RectInvalidate(0, TopBarHeight, ClientWidth, TopBarHeight + MapHeight); 3668 MapValid := false;4354 MapValid := False; 3669 4355 PaintAll; 3670 4356 end; 3671 4357 end; 3672 4358 3673 procedure TMainScreen.FormCloseQuery(Sender: TObject; var CanClose: boolean);4359 procedure TMainScreen.FormCloseQuery(Sender: TObject; var CanClose: Boolean); 3674 4360 begin 3675 4361 CanClose := Closable; 3676 if not Closable and idle and (me = 0) and (ClientMode < scContact) then3677 MenuClick(mResign);4362 if not Closable and Idle and (Me = 0) and (ClientMode < scContact) then 4363 mResign.Click; 3678 4364 end; 3679 4365 … … 3696 4382 begin 3697 4383 MessgExDlg.CancelMovie; 3698 Server(sBreak, me, 0, nil^);4384 Server(sBreak, Me, 0, nil^); 3699 4385 end 3700 4386 else if ClientMode < 0 then 3701 skipped := true4387 Skipped := True 3702 4388 else if ClientMode >= scContact then 3703 4389 NegoDlg.ShowNewContent(wmPersistent) … … 3705 4391 begin 3706 4392 Jump[pTurn] := 0; 3707 StartRunning := false;4393 StartRunning := False; 3708 4394 end 3709 4395 else … … 3718 4404 else 3719 4405 with MainMap do begin 3720 if supervising then4406 if Supervising then 3721 4407 xTerrain := xMidPanel + 2 * xxt + 14 3722 4408 else if ClientWidth < 1280 then … … 3725 4411 xTerrain := ClientWidth div 2; 3726 4412 xTroop := xTerrain + 2 * xxt + 12; 3727 if SmallScreen and not supervising then4413 if SmallScreen and not Supervising then 3728 4414 xTroop := xRightPanel + 10 - 3 * 66 - 3729 4415 DpiGetSystemMetrics(SM_CXVSCROLL) - 19 - 4; … … 3734 4420 end; 3735 4421 3736 function TMainScreen.EndTurn(WasSkipped: boolean): boolean;3737 3738 function IsResourceUnused(cix, NeedFood, NeedProd: integer): boolean;4422 function TMainScreen.EndTurn(WasSkipped: Boolean): Boolean; 4423 4424 function IsResourceUnused(cix, NeedFood, NeedProd: Integer): Boolean; 3739 4425 var 3740 dx, dy, fix: integer;4426 dx, dy, fix: Integer; 3741 4427 CityAreaInfo: TCityAreaInfo; 3742 4428 TileInfo: TTileInfo; 3743 4429 begin 3744 Server(sGetCityAreaInfo, me, cix, CityAreaInfo);4430 Server(sGetCityAreaInfo, Me, cix, CityAreaInfo); 3745 4431 for dy := -3 to 3 do 3746 4432 for dx := -3 to 3 do … … 3752 4438 begin 3753 4439 TileInfo.ExplCity := cix; 3754 Server(sGetHypoCityTileInfo, me, dLoc(MyCity[cix].Loc, dx, dy),4440 Server(sGetHypoCityTileInfo, Me, dLoc(MyCity[cix].Loc, dx, dy), 3755 4441 TileInfo); 3756 4442 if (TileInfo.Food >= NeedFood) and (TileInfo.Prod >= NeedProd) then 3757 4443 begin 3758 result := true;3759 exit4444 Result := True; 4445 Exit 3760 4446 end; 3761 4447 end 3762 4448 end; 3763 result := false;4449 Result := False; 3764 4450 end; 3765 4451 3766 4452 var 3767 i, p1, uix, cix, CenterLoc: integer;4453 p1, uix, cix, CenterLoc: Integer; 3768 4454 MsgItem: string; 3769 4455 CityReport: TCityReport; 3770 4456 PlaneReturnData: TPlaneReturnData; 3771 Zoom: boolean;3772 begin 3773 result := false;4457 Zoom: Boolean; 4458 begin 4459 Result := False; 3774 4460 if ClientMode >= scDipOffer then 3775 exit; 3776 3777 if supervising and (me <> 0) then 3778 begin 3779 for i := 0 to DpiScreen.FormCount - 1 do 3780 if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) then 3781 DpiScreen.Forms[i].Close; // close windows 4461 Exit; 4462 4463 if Supervising and (Me <> 0) then begin 4464 ApplyToVisibleForms(faClose); 3782 4465 ItsMeAgain(0); 3783 4466 end; … … 3797 4480 PlaneReturnData.Loc := Loc; 3798 4481 PlaneReturnData.Movement := 0; // end turn without further movement? 3799 if Server(sGetPlaneReturn, me, uix, PlaneReturnData) = eNoWay then4482 if Server(sGetPlaneReturn, Me, uix, PlaneReturnData) = eNoWay then 3800 4483 begin 3801 4484 CenterLoc := Loc + G.lx * 6; 3802 4485 // centering the unit itself would make it covered by the query dialog 3803 4486 while CenterLoc >= G.lx * G.ly do 3804 dec(CenterLoc, G.lx * 2);4487 Dec(CenterLoc, G.lx * 2); 3805 4488 Centre(CenterLoc); 3806 4489 SetTroopLoc(-1); … … 3817 4500 SetTroopLoc(Loc); 3818 4501 PanelPaint; 3819 exit;4502 Exit; 3820 4503 end; 3821 4504 MyUn[uix].Status := MyUn[uix].Status or usToldNoReturn; 3822 end 4505 end; 3823 4506 end; 3824 4507 3825 if not supervising and (MyRO.TestFlags and tfImmImprove = 0) and4508 if not Supervising and (MyRO.TestFlags and tfImmImprove = 0) and 3826 4509 (MyRO.Government <> gAnarchy) and (MyRO.Money + TaxSum < 0) and 3827 4510 (MyRO.TaxRate < 100) then // low funds! … … 3835 4518 ShowModal; 3836 4519 if ModalResult <> mrOK then 3837 exit4520 Exit; 3838 4521 end; 3839 4522 … … 3843 4526 if (Loc >= 0) and (Flags and chCaptured = 0) then 3844 4527 begin 3845 Zoom := false;4528 Zoom := False; 3846 4529 CityReport.HypoTiles := -1; 3847 4530 CityReport.HypoTax := -1; 3848 4531 CityReport.HypoLux := -1; 3849 Server(sGetCityReport, me, cix, CityReport);4532 Server(sGetCityReport, Me, cix, CityReport); 3850 4533 3851 4534 if (CityReport.Working - CityReport.Happy > Size shr 1) and … … 3904 4587 begin // zoom to city 3905 4588 ZoomToCity(Loc); 3906 exit3907 end 4589 Exit; 4590 end; 3908 4591 end; 3909 4592 … … 3911 4594 (MyData.FarTech <> adNexus) then 3912 4595 if not ChooseResearch then 3913 exit;4596 Exit; 3914 4597 end; 3915 4598 … … 3921 4604 3922 4605 CityDlg.CloseAction := None; 3923 if IsMultiPlayerGame then 3924 begin // close windows for next player 3925 for i := 0 to DpiScreen.FormCount - 1 do 3926 if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) then 3927 DpiScreen.Forms[i].Close; 3928 end 3929 else 3930 begin 4606 if IsMultiPlayerGame then begin 4607 // Close windows for next player 4608 ApplyToVisibleForms(faClose); 4609 end else begin 3931 4610 if CityDlg.Visible then 3932 4611 CityDlg.Close; … … 3934 4613 UnitStatDlg.Close; 3935 4614 end; 3936 for i := 0 to DpiScreen.FormCount - 1 do 3937 if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) then 3938 DpiScreen.Forms[i].Enabled := false; 4615 ApplyToVisibleForms(faDisable); 3939 4616 3940 4617 if Server(sTurn, pTurn, 0, nil^) >= rExecuted then … … 3944 4621 else 3945 4622 EOT.Hint := Phrases.Lookup('BTN_SKIP'); 3946 result := true;4623 Result := True; 3947 4624 SetTroopLoc(-1); 3948 4625 pTurn := -1; 3949 4626 pLogo := -1; 3950 UnitInfoBtn.Visible := false;3951 UnitBtn.Visible := false;3952 TerrainBtn.Visible := false;4627 UnitInfoBtn.Visible := False; 4628 UnitBtn.Visible := False; 4629 TerrainBtn.Visible := False; 3953 4630 EOT.ButtonIndex := eotCancel; 3954 EOT.Visible := true;3955 MapValid := false;4631 EOT.Visible := True; 4632 MapValid := False; 3956 4633 PanelPaint; 3957 4634 Update; 3958 4635 ClientMode := -1; 3959 idle := false;3960 skipped := WasSkipped;4636 Idle := False; 4637 Skipped := WasSkipped; 3961 4638 for p1 := 1 to nPl - 1 do 3962 4639 if G.RO[p1] <> nil then 3963 skipped := true; // don't show enemy moves in hotseat mode4640 Skipped := True; // don't show enemy moves in hotseat mode 3964 4641 end 3965 4642 else 3966 PanelPaint 3967 end; // EndTurn4643 PanelPaint; 4644 end; 3968 4645 3969 4646 procedure TMainScreen.EndNego; … … 3971 4648 if NegoDlg.Visible then 3972 4649 NegoDlg.Close; 3973 HaveStrategyAdvice := false; 3974 // AdvisorDlg.HaveStrategyAdvice; 3975 // negotiation might have changed advices 4650 HaveStrategyAdvice := False; 3976 4651 EOT.ButtonIndex := eotCancel; 3977 EOT.Visible := true;4652 EOT.Visible := True; 3978 4653 PanelPaint; 3979 4654 Update; 3980 4655 ClientMode := -1; 3981 idle := false;3982 end; 3983 3984 procedure TMainScreen.ProcessRect(x0, y0, nx, ny, Options: integer);4656 Idle := False; 4657 end; 4658 4659 procedure TMainScreen.ProcessRect(x0, y0, nx, ny, Options: Integer); 3985 4660 var 3986 xs, ys, xl, yl: integer;4661 xs, ys, xl, yl: Integer; 3987 4662 begin 3988 4663 with MainMap do begin … … 3993 4668 while abs(2 * (xs + G.lx * (xxt * 2)) + xl - MapWidth) < 3994 4669 abs(2 * xs + xl - MapWidth) do 3995 inc(xs, G.lx * (xxt * 2));4670 Inc(xs, G.lx * (xxt * 2)); 3996 4671 ys := (y0 - yw) * yyt - yyt; 3997 4672 if xs + xl > MapWidth then … … 4000 4675 yl := MapHeight - ys; 4001 4676 if (xl <= 0) or (yl <= 0) then 4002 exit;4677 Exit; 4003 4678 if Options and prPaint <> 0 then begin 4004 4679 if Options and prAutoBounds <> 0 then … … 4012 4687 end; 4013 4688 4014 procedure TMainScreen.PaintLoc(Loc: integer; Radius: integer = 0);4689 procedure TMainScreen.PaintLoc(Loc: Integer; Radius: Integer = 0); 4015 4690 var 4016 yLoc, x0: integer;4691 yLoc, x0: Integer; 4017 4692 begin 4018 4693 if MapValid then begin 4019 4694 yLoc := (Loc + G.lx * 1024) div G.lx - 1024; 4020 4695 x0 := (Loc + (yLoc and 1 - 2 * Radius + G.lx * 1024) div 2) mod G.lx; 4021 offscreen.Canvas.Font.Assign(UniFont[ftSmall]);4696 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 4022 4697 ProcessRect(x0, yLoc - 2 * Radius, 4 * Radius + 1, 4 * Radius + 1, 4023 4698 prPaint or prAutoBounds or prInvalidate); … … 4026 4701 end; 4027 4702 4028 procedure TMainScreen.PaintLocTemp(Loc: integer; Style: TPaintLocTempStyle);4703 procedure TMainScreen.PaintLocTemp(Loc: Integer; Style: TPaintLocTempStyle); 4029 4704 var 4030 y0, x0, xMap, yMap: integer;4705 y0, x0, xMap, yMap: Integer; 4031 4706 begin 4032 4707 with NoMap do begin 4033 4708 if not MapValid then 4034 exit;4709 Exit; 4035 4710 Buffer.Canvas.Font.Assign(UniFont[ftSmall]); 4036 4711 y0 := Loc div G.lx; … … 4040 4715 while abs(2 * (xMap + G.lx * (xxt * 2)) + 2 * xxt - MapWidth) < 4041 4716 abs(2 * xMap + 2 * xxt - MapWidth) do 4042 inc(xMap, G.lx * (xxt * 2));4717 Inc(xMap, G.lx * (xxt * 2)); 4043 4718 yMap := (y0 - yw) * yyt - yyt; 4044 4719 NoMap.SetOutput(Buffer); … … 4052 4727 // panel protusions are added 4053 4728 // NoMap must be set to buffer and bounds before 4054 procedure TMainScreen.PaintBufferToScreen(xMap, yMap, width, height: integer);4729 procedure TMainScreen.PaintBufferToScreen(xMap, yMap, width, height: Integer); 4055 4730 begin 4056 4731 if xMap + width > MapWidth then … … 4060 4735 if (width <= 0) or (height <= 0) or (width + xMap <= 0) or (height + yMap <= 0) 4061 4736 then 4062 exit;4737 Exit; 4063 4738 4064 4739 NoMap.BitBltBitmap(Panel, -xMap - MapOffset, -yMap + MapHeight - overlap, xMidPanel, … … 4070 4745 begin 4071 4746 if xMap < 0 then 4072 DpiBit Canvas(Canvas, MapOffset, TopBarHeight, width + xMap,4747 DpiBitBltCanvas(Canvas, MapOffset, TopBarHeight, width + xMap, 4073 4748 height + yMap, Buffer.Canvas, -xMap, -yMap) 4074 4749 else 4075 DpiBit Canvas(Canvas, xMap + MapOffset, TopBarHeight, width,4750 DpiBitBltCanvas(Canvas, xMap + MapOffset, TopBarHeight, width, 4076 4751 height + yMap, Buffer.Canvas, 0, -yMap); 4077 4752 end … … 4079 4754 begin 4080 4755 if xMap < 0 then 4081 DpiBit Canvas(Canvas, MapOffset, TopBarHeight + yMap, width + xMap,4756 DpiBitBltCanvas(Canvas, MapOffset, TopBarHeight + yMap, width + xMap, 4082 4757 height, Buffer.Canvas, -xMap, 0) 4083 4758 else 4084 DpiBit Canvas(Canvas, xMap + MapOffset, TopBarHeight + yMap, width,4759 DpiBitBltCanvas(Canvas, xMap + MapOffset, TopBarHeight + yMap, width, 4085 4760 height, Buffer.Canvas, 0, 0); 4086 4761 end; 4087 4762 end; 4088 4763 4089 procedure TMainScreen.PaintLoc_BeforeMove(FromLoc: integer);4764 procedure TMainScreen.PaintLoc_BeforeMove(FromLoc: Integer); 4090 4765 var 4091 yLoc, x0: integer;4766 yLoc, x0: Integer; 4092 4767 begin 4093 4768 if MapValid then … … 4095 4770 yLoc := (FromLoc + G.lx * 1024) div G.lx - 1024; 4096 4771 x0 := (FromLoc + (yLoc and 1 + G.lx * 1024) div 2) mod G.lx; 4097 offscreen.Canvas.Font.Assign(UniFont[ftSmall]);4772 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 4098 4773 ProcessRect(x0, yLoc, 1, 1, prPaint or prAutoBounds); 4099 4774 end … … 4102 4777 procedure TMainScreen.PaintDestination; 4103 4778 var 4104 Destination: integer;4779 Destination: Integer; 4105 4780 begin 4106 4781 if (UnFocus >= 0) and (MyUn[UnFocus].Status and usGoto <> 0) then … … 4112 4787 end; 4113 4788 4114 {$IFDEF LINUX}4789 {$IFDEF UNIX} 4115 4790 // Can't do scrolling of DC under Linux, then fallback into BitBlt. 4116 4791 function DpiScrollDC(Canvas: TDpiCanvas; dx: longint; dy: longint; const lprcScroll:TRect; const lprcClip:TRect; hrgnUpdate:HRGN; lprcUpdate: PRect):Boolean; 4117 4792 begin 4118 Result := DpiBit Canvas(Canvas, lprcScroll.Left + dx, lprcScroll.Top + dy, lprcScroll.Right - lprcScroll.Left, lprcScroll.Bottom - lprcScroll.Top,4793 Result := DpiBitBltCanvas(Canvas, lprcScroll.Left + dx, lprcScroll.Top + dy, lprcScroll.Right - lprcScroll.Left, lprcScroll.Bottom - lprcScroll.Top, 4119 4794 Canvas, lprcScroll.Left, lprcScroll.Top); 4120 4795 end; … … 4123 4798 procedure TMainScreen.MainOffscreenPaint; 4124 4799 var 4125 ProcessOptions: integer;4800 ProcessOptions: Integer; 4126 4801 rec: TRect; 4127 DoInvalidate: boolean;4128 begin 4129 if me < 0 then4130 with offscreen.Canvas do4802 DoInvalidate: Boolean; 4803 begin 4804 if Me < 0 then 4805 with Offscreen.Canvas do 4131 4806 begin 4132 4807 Brush.Color := $000000; … … 4134 4809 Brush.Style := bsClear; 4135 4810 OffscreenUser := self; 4136 exit;4811 Exit; 4137 4812 end; 4138 4813 … … 4145 4820 if MapValid and (xwd = xw) and (ywd = yw) then 4146 4821 MainMap.SetPaintBounds(0, 0, UsedOffscreenWidth, UsedOffscreenHeight); 4147 MapValid := false;4822 MapValid := False; 4148 4823 OffscreenUser := self; 4149 4824 end; … … 4158 4833 (ywd - yw > MapHeight div yyt) then 4159 4834 begin 4160 offscreen.Canvas.Font.Assign(UniFont[ftSmall]);4835 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 4161 4836 ProcessRect(xw, yw, MapWidth div xxt, MapHeight div yyt, 4162 4837 prPaint or prInvalidate); 4163 4838 end else begin 4164 4839 if (xwd = xw) and (ywd = yw) then 4165 exit; { map window not moved }4166 offscreen.Canvas.Font.Assign(UniFont[ftSmall]);4840 Exit; { map window not moved } 4841 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 4167 4842 rec := Rect(0, 0, MapWidth, MapHeight); 4168 4843 {$IFDEF WINDOWS} 4169 DpiScrollDC( offscreen.Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,4844 DpiScrollDC(Offscreen.Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, 4170 4845 rec, rec, 0, nil); 4171 4846 {$ENDIF} 4172 {$IFDEF LINUX}4173 DpiScrollDC( offscreen.Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,4847 {$IFDEF UNIX} 4848 DpiScrollDC(Offscreen.Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, 4174 4849 rec, rec, 0, nil); 4175 4850 {$ENDIF} 4176 for DoInvalidate := false to FastScrolling do begin4851 for DoInvalidate := False to FastScrolling do begin 4177 4852 if DoInvalidate then begin 4178 4853 rec.Bottom := MapHeight - overlap; 4179 4854 {$IFDEF WINDOWS} 4180 DpiScrollDC(Canvas , (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec,4855 DpiScrollDC(Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec, 4181 4856 rec, 0, nil); 4182 4857 {$ENDIF} 4183 {$IFDEF LINUX}4858 {$IFDEF UNIX} 4184 4859 DpiScrollDC(Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, 4185 4860 rec, rec, 0, nil); … … 4231 4906 xwd := xw; 4232 4907 ywd := yw; 4233 MapValid := true;4908 MapValid := True; 4234 4909 end; 4235 4910 … … 4264 4939 begin 4265 4940 with MainMap do begin 4266 DpiBit Canvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly,4941 DpiBitBltCanvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly, 4267 4942 MiniMap.Bitmap.Canvas, 0, 0); 4268 4943 if MarkCityLoc >= 0 then … … 4288 4963 function MovementToString(var Un: TUn): string; 4289 4964 begin 4290 result := ScreenTools.MovementToString(Un.Movement);4965 Result := ScreenTools.MovementToString(Un.Movement); 4291 4966 if Un.Master >= 0 then 4292 result := '(' + result + ')'4967 Result := '(' + Result + ')' 4293 4968 else if (MyModel[Un.mix].Domain = dAir) and 4294 4969 (MyModel[Un.mix].Kind <> mkSpecial_Glider) then 4295 result := Format('%s(%d)', [result, Un.Fuel]);4970 Result := Format('%s(%d)', [Result, Un.Fuel]); 4296 4971 end; 4297 4972 4298 4973 var 4299 i, uix, uixDefender, x, xSrc, ySrc, xSrcBase, ySrcBase, CostFactor, Count,4974 I, uix, uixDefender, X, xSrc, ySrc, xSrcBase, ySrcBase, CostFactor, Count, 4300 4975 mixShow, xTreasurySection, xResearchSection, JobFocus, TrueMoney, 4301 TrueResearch: integer;4976 TrueResearch: Integer; 4302 4977 Tile: Cardinal; 4303 s: string;4978 S: string; 4304 4979 unx: TUn; 4305 4980 UnitInfo: TUnitInfo; 4306 4981 JobProgressData: TJobProgressData; 4307 Prio: boolean;4982 Prio: Boolean; 4308 4983 begin 4309 4984 if not Assigned(MyRO) then Exit; … … 4349 5024 if ClientMode <> cEditMap then 4350 5025 begin 4351 if supervising then5026 if Supervising then 4352 5027 begin 4353 5028 ScreenTools.Frame(Panel.Canvas, ClientWidth - xPalace - 1, yPalace - 1, … … 4357 5032 ClientWidth - xPalace + xSizeBig + 1, yPalace + ySizeBig + 1, 4358 5033 $FFFFFF, $B0B0B0); 4359 DpiBit Canvas(Panel.Canvas, ClientWidth - xPalace, yPalace, xSizeBig,5034 DpiBitBltCanvas(Panel.Canvas, ClientWidth - xPalace, yPalace, xSizeBig, 4360 5035 ySizeBig, HGrSystem2.Data.Canvas, 70, 123); 4361 5036 end … … 4382 5057 CopyMiniToPanel; 4383 5058 if ClientMode <> cEditMap then // MapBtn icons 4384 for i:= 0 to 5 do4385 if i<> 3 then4386 Dump(Panel, HGrSystem, xMini + G.lx - 42 + 16 * i, PanelHeight - 26,4387 8, 8, 121 + i* 9, 61);5059 for I := 0 to 5 do 5060 if I <> 3 then 5061 Dump(Panel, HGrSystem, xMini + G.lx - 42 + 16 * I, PanelHeight - 26, 5062 8, 8, 121 + I * 9, 61); 4388 5063 4389 5064 if ClientMode = cEditMap then 4390 5065 begin 4391 for i:= 0 to TrRow - 1 do4392 trix[ i] := -1;5066 for I := 0 to TrRow - 1 do 5067 trix[I] := -1; 4393 5068 Count := 0; 4394 for i:= 0 to nBrushTypes - 1 do5069 for I := 0 to nBrushTypes - 1 do 4395 5070 begin // display terrain types 4396 5071 if (Count >= TrRow * sb.Position) and (Count < TrRow * (sb.Position + 1)) 4397 5072 then 4398 5073 begin 4399 trix[Count - TrRow * sb.Position] := BrushTypes[ i];4400 x:= (Count - TrRow * sb.Position) * TrPitch;5074 trix[Count - TrRow * sb.Position] := BrushTypes[I]; 5075 X := (Count - TrRow * sb.Position) * TrPitch; 4401 5076 xSrcBase := -1; 4402 case BrushTypes[ i] of5077 case BrushTypes[I] of 4403 5078 0 .. 8: 4404 5079 begin 4405 xSrc := BrushTypes[ i];5080 xSrc := BrushTypes[I]; 4406 5081 ySrc := 0 4407 5082 end; … … 4411 5086 ySrcBase := 2; 4412 5087 xSrc := 0; 4413 ySrc := 2 * integer(BrushTypes[i]) - 155088 ySrc := 2 * Integer(BrushTypes[I]) - 15 4414 5089 end; 4415 5090 fRiver: … … 4444 5119 ySrcBase := 2; 4445 5120 xSrc := 8; 4446 ySrc := 12 + BrushTypes[ i] shr 25;5121 ySrc := 12 + BrushTypes[I] shr 25; 4447 5122 end; 4448 5123 tiIrrigation, tiFarm, tiMine, tiBase: 4449 5124 begin 4450 xSrc := BrushTypes[ i] shr 12 - 1;5125 xSrc := BrushTypes[I] shr 12 - 1; 4451 5126 ySrc := 12 4452 5127 end; … … 4471 5146 with MainMap do begin 4472 5147 if xSrcBase >= 0 then 4473 Sprite(Panel, HGrTerrain, xTroop + 2 + x, yTroop + 9 - yyt, xxt * 2,5148 Sprite(Panel, HGrTerrain, xTroop + 2 + X, yTroop + 9 - yyt, xxt * 2, 4474 5149 yyt * 3, 1 + xSrcBase * (xxt * 2 + 1), 4475 5150 1 + ySrcBase * (yyt * 3 + 1)); 4476 Sprite(Panel, HGrTerrain, xTroop + 2 + x, yTroop + 9 - yyt, xxt * 2,5151 Sprite(Panel, HGrTerrain, xTroop + 2 + X, yTroop + 9 - yyt, xxt * 2, 4477 5152 yyt * 3, 1 + xSrc * (xxt * 2 + 1), 1 + ySrc * (yyt * 3 + 1)); 4478 if BrushTypes[ i] = BrushType then begin4479 ScreenTools.Frame(Panel.Canvas, xTroop + 2 + x,4480 yTroop + 7 - yyt div 2, xTroop + 2 * xxt + x,5153 if BrushTypes[I] = BrushType then begin 5154 ScreenTools.Frame(Panel.Canvas, xTroop + 2 + X, 5155 yTroop + 7 - yyt div 2, xTroop + 2 * xxt + X, 4481 5156 yTroop + 2 * yyt + 11, $000000, $000000); 4482 ScreenTools.Frame(Panel.Canvas, xTroop + 1 + x,4483 yTroop + 6 - yyt div 2, xTroop + 2 * xxt - 1 + x,5157 ScreenTools.Frame(Panel.Canvas, xTroop + 1 + X, 5158 yTroop + 6 - yyt div 2, xTroop + 2 * xxt - 1 + X, 4484 5159 yTroop + 2 * yyt + 10, MainTexture.ColorMark, MainTexture.ColorMark); 4485 5160 end; 4486 5161 end; 4487 5162 end; 4488 inc(Count)5163 Inc(Count) 4489 5164 end; 4490 5165 case BrushType of 4491 5166 fDesert, fPrairie, fTundra, fArctic, fSwamp, fHills, fMountains: 4492 s:= Phrases.Lookup('TERRAIN', BrushType);5167 S := Phrases.Lookup('TERRAIN', BrushType); 4493 5168 fShore: 4494 s:= Format(Phrases.Lookup('TWOTERRAINS'),5169 S := Format(Phrases.Lookup('TWOTERRAINS'), 4495 5170 [Phrases.Lookup('TERRAIN', fOcean), Phrases.Lookup('TERRAIN', 4496 5171 fShore)]); 4497 5172 fGrass: 4498 s:= Format(Phrases.Lookup('TWOTERRAINS'),5173 S := Format(Phrases.Lookup('TWOTERRAINS'), 4499 5174 [Phrases.Lookup('TERRAIN', fGrass), Phrases.Lookup('TERRAIN', 4500 5175 fGrass + 12)]); 4501 5176 fForest: 4502 s:= Format(Phrases.Lookup('TWOTERRAINS'),5177 S := Format(Phrases.Lookup('TWOTERRAINS'), 4503 5178 [Phrases.Lookup('TERRAIN', fForest), Phrases.Lookup('TERRAIN', 4504 5179 fJungle)]); 4505 5180 fRiver: 4506 s:= Phrases.Lookup('RIVER');5181 S := Phrases.Lookup('RIVER'); 4507 5182 fDeadLands, fDeadLands or fCobalt, fDeadLands or fUranium, 4508 5183 fDeadLands or fMercury: 4509 s:= Phrases.Lookup('TERRAIN', 3 * 12 + BrushType shr 25);5184 S := Phrases.Lookup('TERRAIN', 3 * 12 + BrushType shr 25); 4510 5185 fPrefStartPos: 4511 s:= Phrases.Lookup('MAP_PREFSTART');5186 S := Phrases.Lookup('MAP_PREFSTART'); 4512 5187 fStartPos: 4513 s:= Phrases.Lookup('MAP_START');5188 S := Phrases.Lookup('MAP_START'); 4514 5189 fPoll: 4515 s:= Phrases.Lookup('POLL');5190 S := Phrases.Lookup('POLL'); 4516 5191 else // terrain improvements 4517 5192 begin 4518 5193 case BrushType of 4519 5194 fRoad: 4520 i:= 1;5195 I := 1; 4521 5196 fRR: 4522 i:= 2;5197 I := 2; 4523 5198 tiIrrigation: 4524 i:= 4;5199 I := 4; 4525 5200 tiFarm: 4526 i:= 5;5201 I := 5; 4527 5202 tiMine: 4528 i:= 7;5203 I := 7; 4529 5204 fCanal: 4530 i:= 8;5205 I := 8; 4531 5206 tiFort: 4532 i:= 10;5207 I := 10; 4533 5208 tiBase: 4534 i:= 12;5209 I := 12; 4535 5210 end; 4536 s := Phrases.Lookup('JOBRESULT', i);5211 S := Phrases.Lookup('JOBRESULT', I); 4537 5212 end 4538 5213 end; 4539 5214 LoweredTextOut(Panel.Canvas, -1, MainTexture, xTroop + 1, 4540 PanelHeight - 19, s);5215 PanelHeight - 19, S); 4541 5216 end 4542 5217 else if TroopLoc >= 0 then … … 4544 5219 Brush.Style := bsClear; 4545 5220 if UnFocus >= 0 then 4546 with MyUn [UnFocus] do4547 with MyModel [mix] do5221 with MyUn^[UnFocus] do 5222 with MyModel^[mix] do 4548 5223 begin { display info about selected unit } 4549 5224 if Job = jCity then … … 4551 5226 else 4552 5227 mixShow := mix; 4553 with Tribe[ me].ModelPicture[mixShow] do5228 with Tribe[Me].ModelPicture[mixShow] do 4554 5229 begin 4555 5230 Sprite(Panel, HGr, xMidPanel + 7 + 12, yTroop + 1, 64, 48, … … 4561 5236 4562 5237 MakeBlue(Panel, xMidPanel + 7 + 12 + 10, yTroop - 13, 44, 12); 4563 s:= MovementToString(MyUn[UnFocus]);5238 S := MovementToString(MyUn[UnFocus]); 4564 5239 RisedTextOut(Panel.Canvas, xMidPanel + 7 + 12 + 32 - 4565 BiColorTextWidth(Panel.Canvas, s) div 2, yTroop - 16, s);4566 4567 s:= IntToStr(Health) + '%';5240 BiColorTextWidth(Panel.Canvas, S) div 2, yTroop - 16, S); 5241 5242 S := IntToStr(Health) + '%'; 4568 5243 LightGradient(Panel.Canvas, xMidPanel + 7 + 12 + 7, PanelHeight - 22, 4569 5244 (Health + 1) div 2, (ColorOfHealth(Health) and $FEFEFE shr 2) * 3); … … 4572 5247 div 2, PanelHeight - 22, 50 - (Health + 1) div 2, $000000); 4573 5248 RisedTextOut(Panel.Canvas, xMidPanel + 7 + 12 + 32 - 4574 BiColorTextWidth(Panel.Canvas, s) div 2, PanelHeight - 23, s);5249 BiColorTextWidth(Panel.Canvas, S) div 2, PanelHeight - 23, S); 4575 5250 4576 5251 FrameImage(Panel.Canvas, HGrSystem.Data, … … 4578 5253 121 + Exp div ExpCost * 13, 28); 4579 5254 if Job = jCity then 4580 s := Tribe[me].ModelName[-1]5255 S := Tribe[Me].ModelName[-1] 4581 5256 else 4582 s := Tribe[me].ModelName[mix];5257 S := Tribe[Me].ModelName[mix]; 4583 5258 if Home >= 0 then 4584 5259 begin 4585 5260 LoweredTextOut(Panel.Canvas, -1, MainTexture, 4586 xMidPanel + 7 + xUnitText + 18, yTroop + 5, s);5261 xMidPanel + 7 + xUnitText + 18, yTroop + 5, S); 4587 5262 LoweredTextOut(Panel.Canvas, -1, MainTexture, 4588 5263 xMidPanel + 7 + xUnitText + 18, yTroop + 21, … … 4591 5266 else 4592 5267 LoweredTextOut(Panel.Canvas, -1, MainTexture, 4593 xMidPanel + 7 + xUnitText + 18, yTroop + 13, s);5268 xMidPanel + 7 + xUnitText + 18, yTroop + 13, S); 4594 5269 end; 4595 5270 4596 5271 if (UnFocus >= 0) and (MyUn[UnFocus].Loc <> TroopLoc) then 4597 5272 begin // divide panel 4598 if SmallScreen and not supervising then4599 x:= xTroop - 85273 if SmallScreen and not Supervising then 5274 X := xTroop - 8 4600 5275 else 4601 x:= xTroop - 152;5276 X := xTroop - 152; 4602 5277 Pen.Color := MainTexture.ColorBevelShade; 4603 MoveTo( x- 1, PanelHeight - MidPanelHeight + 2);4604 LineTo( x- 1, PanelHeight);5278 MoveTo(X - 1, PanelHeight - MidPanelHeight + 2); 5279 LineTo(X - 1, PanelHeight); 4605 5280 Pen.Color := MainTexture.ColorBevelLight; 4606 MoveTo( x, PanelHeight - MidPanelHeight + 2);4607 LineTo( x, PanelHeight);4608 end; 4609 4610 for i:= 0 to 23 do4611 trix[ i] := -1;5281 MoveTo(X, PanelHeight - MidPanelHeight + 2); 5282 LineTo(X, PanelHeight); 5283 end; 5284 5285 for I := 0 to 23 do 5286 trix[I] := -1; 4612 5287 if MyMap[TroopLoc] and fUnit <> 0 then 4613 5288 begin … … 4619 5294 LoweredTextOut(Panel.Canvas, -1, MainTexture, xTroop + 10, 4620 5295 PanelHeight - 24, Phrases.Lookup('PRESENT')); 4621 Server(sGetDefender, me, TroopLoc, uixDefender);5296 Server(sGetDefender, Me, TroopLoc, uixDefender); 4622 5297 Count := 0; 4623 for Prio := true downto false do5298 for Prio := True downto False do 4624 5299 for uix := 0 to MyRO.nUn - 1 do 4625 5300 if (uix = uixDefender) = Prio then … … 4632 5307 begin 4633 5308 trix[Count - TrRow * sb.Position] := uix; 4634 MakeUnitInfo( me, unx, UnitInfo);4635 x:= (Count - TrRow * sb.Position) * TrPitch;5309 MakeUnitInfo(Me, unx, UnitInfo); 5310 X := (Count - TrRow * sb.Position) * TrPitch; 4636 5311 if uix = UnFocus then 4637 5312 begin 4638 ScreenTools.Frame(Panel.Canvas, xTroop + 4 + x,4639 yTroop + 3, xTroop + 64 + x, yTroop + 47,5313 ScreenTools.Frame(Panel.Canvas, xTroop + 4 + X, 5314 yTroop + 3, xTroop + 64 + X, yTroop + 47, 4640 5315 $000000, $000000); 4641 ScreenTools.Frame(Panel.Canvas, xTroop + 3 + x,4642 yTroop + 2, xTroop + 63 + x, yTroop + 46,5316 ScreenTools.Frame(Panel.Canvas, xTroop + 3 + X, 5317 yTroop + 2, xTroop + 63 + X, yTroop + 46, 4643 5318 MainTexture.ColorMark, MainTexture.ColorMark); 4644 5319 end 4645 5320 else if (unx.Master >= 0) and (unx.Master = UnFocus) then 4646 5321 begin 4647 CFrame(Panel.Canvas, xTroop + 4 + x, yTroop + 3,4648 xTroop + 64 + x, yTroop + 47, 8, $000000);4649 CFrame(Panel.Canvas, xTroop + 3 + x, yTroop + 2,4650 xTroop + 63 + x, yTroop + 46, 8, MainTexture.ColorMark);5322 CFrame(Panel.Canvas, xTroop + 4 + X, yTroop + 3, 5323 xTroop + 64 + X, yTroop + 47, 8, $000000); 5324 CFrame(Panel.Canvas, xTroop + 3 + X, yTroop + 2, 5325 xTroop + 63 + X, yTroop + 46, 8, MainTexture.ColorMark); 4651 5326 end; 4652 5327 NoMapPanel.SetOutput(Panel); 4653 NoMapPanel.PaintUnit(xTroop + 2 + x, yTroop + 1, UnitInfo,5328 NoMapPanel.PaintUnit(xTroop + 2 + X, yTroop + 1, UnitInfo, 4654 5329 unx.Status); 4655 5330 if (ClientMode < scContact) and … … 4657 5332 (unx.Status and (usStay or usRecover or usGoto) <> 0)) 4658 5333 then 4659 Sprite(Panel, HGrSystem, xTroop + 2 + 60 - 20 + x,5334 Sprite(Panel, HGrSystem, xTroop + 2 + 60 - 20 + X, 4660 5335 yTroop + 35, 20, 20, 81, 25); 4661 5336 4662 if not supervising then5337 if not Supervising then 4663 5338 begin 4664 MakeBlue(Panel, xTroop + 2 + 10 + x,5339 MakeBlue(Panel, xTroop + 2 + 10 + X, 4665 5340 yTroop - 13, 44, 12); 4666 s:= MovementToString(unx);5341 S := MovementToString(unx); 4667 5342 RisedTextOut(Panel.Canvas, 4668 xTroop + x + 34 - BiColorTextWidth(Panel.Canvas, s)4669 div 2, yTroop - 16, s);5343 xTroop + X + 34 - BiColorTextWidth(Panel.Canvas, S) 5344 div 2, yTroop - 16, S); 4670 5345 end; 4671 5346 end; 4672 inc(Count)5347 Inc(Count) 4673 5348 end; 4674 5349 end; // for uix:=0 to MyRO.nUn-1 4675 assert(Count = TrCnt);5350 Assert(Count = TrCnt); 4676 5351 end; 4677 5352 end … … 4680 5355 LoweredTextOut(Panel.Canvas, -1, MainTexture, xTroop + 8, 4681 5356 PanelHeight - 24, Phrases.Lookup('PRESENT')); 4682 Server(sGetUnits, me, TroopLoc, Count);4683 for i:= 0 to Count - 1 do4684 if ( i >= TrRow * sb.Position) and (i< TrRow * (sb.Position + 1)) then5357 Server(sGetUnits, Me, TroopLoc, Count); 5358 for I := 0 to Count - 1 do 5359 if (I >= TrRow * sb.Position) and (I < TrRow * (sb.Position + 1)) then 4685 5360 begin // display enemy units 4686 trix[ i - TrRow * sb.Position] := i;4687 x := (i- TrRow * sb.Position) * TrPitch;5361 trix[I - TrRow * sb.Position] := I; 5362 X := (I - TrRow * sb.Position) * TrPitch; 4688 5363 NoMapPanel.SetOutput(Panel); 4689 NoMapPanel.PaintUnit(xTroop + 2 + x, yTroop + 1,4690 MyRO.EnemyUn[MyRO.nEnemyUn + i], 0);5364 NoMapPanel.PaintUnit(xTroop + 2 + X, yTroop + 1, 5365 MyRO.EnemyUn[MyRO.nEnemyUn + I], 0); 4691 5366 end; 4692 5367 end; 4693 5368 end; 4694 if not SmallScreen or supervising then5369 if not SmallScreen or Supervising then 4695 5370 begin // show terrain and improvements 4696 5371 with NoMapPanel do … … 4698 5373 if (UnFocus >= 0) and (MyUn[UnFocus].Job <> jNone) then begin 4699 5374 JobFocus := MyUn[UnFocus].Job; 4700 Server(sGetJobProgress, me, MyUn[UnFocus].Loc, JobProgressData);5375 Server(sGetJobProgress, Me, MyUn[UnFocus].Loc, JobProgressData); 4701 5376 MakeBlue(Panel, xTerrain - 72, 148 - 17, 144, 31); 4702 5377 PaintRelativeProgressBar(Panel.Canvas, 3, xTerrain - 68, 148 + 3, 63, 4703 5378 JobProgressData[JobFocus].Done, 4704 5379 JobProgressData[JobFocus].NextTurnPlus, 4705 JobProgressData[JobFocus].Required, true, MainTexture);4706 s:= Format('%s/%s',5380 JobProgressData[JobFocus].Required, True, MainTexture); 5381 S := Format('%s/%s', 4707 5382 [ScreenTools.MovementToString(JobProgressData[JobFocus].Done), 4708 5383 ScreenTools.MovementToString(JobProgressData[JobFocus].Required)]); 4709 RisedTextOut(Panel.Canvas, xTerrain + 6, 148 - 3, s);5384 RisedTextOut(Panel.Canvas, xTerrain + 6, 148 - 3, S); 4710 5385 Tile := MyMap[MyUn[UnFocus].Loc]; 4711 5386 if (JobFocus = jRoad) and (Tile and fRiver <> 0) then … … 4722 5397 JobFocus := nJob + 4 4723 5398 end; 4724 s:= Phrases.Lookup('JOBRESULT', JobFocus);5399 S := Phrases.Lookup('JOBRESULT', JobFocus); 4725 5400 RisedTextOut(Panel.Canvas, xTerrain - BiColorTextWidth(Panel.Canvas, 4726 s) div 2, 148 - 19, s);5401 S) div 2, 148 - 19, S); 4727 5402 end; 4728 5403 if MyMap[TroopLoc] and (fTerrain or fSpecial) = fGrass or fSpecial1 then 4729 s:= Phrases.Lookup('TERRAIN', fGrass + 12)5404 S := Phrases.Lookup('TERRAIN', fGrass + 12) 4730 5405 else if MyMap[TroopLoc] and fDeadLands <> 0 then 4731 s:= Phrases.Lookup('TERRAIN', 3 * 12)5406 S := Phrases.Lookup('TERRAIN', 3 * 12) 4732 5407 else if (MyMap[TroopLoc] and fTerrain = fForest) and 4733 5408 IsJungle(TroopLoc div G.lx) then 4734 s:= Phrases.Lookup('TERRAIN', fJungle)5409 S := Phrases.Lookup('TERRAIN', fJungle) 4735 5410 else 4736 s:= Phrases.Lookup('TERRAIN', MyMap[TroopLoc] and fTerrain);4737 RisedTextOut(Panel.Canvas, xTerrain - BiColorTextWidth(Panel.Canvas, s)4738 div 2, 99, s);5411 S := Phrases.Lookup('TERRAIN', MyMap[TroopLoc] and fTerrain); 5412 RisedTextOut(Panel.Canvas, xTerrain - BiColorTextWidth(Panel.Canvas, S) 5413 div 2, 99, S); 4739 5414 end; 4740 5415 … … 4747 5422 end; 4748 5423 4749 for i:= 0 to ControlCount - 1 do4750 if Controls[ i] is TButtonB then4751 with TButtonB(Controls[ i]) do5424 for I := 0 to ControlCount - 1 do 5425 if Controls[I] is TButtonB then 5426 with TButtonB(Controls[I]) do 4752 5427 begin 4753 5428 if Visible then … … 4765 5440 if ClientMode <> cEditMap then 4766 5441 begin 4767 for i:= 0 to ControlCount - 1 do4768 if Controls[ i] is TButtonC then4769 with TButtonC(Controls[ i]) do5442 for I := 0 to ControlCount - 1 do 5443 if Controls[I] is TButtonC then 5444 with TButtonC(Controls[I]) do 4770 5445 begin 4771 5446 Dump(Panel, HGrSystem, Left, Top - self.ClientHeight + PanelHeight, … … 4807 5482 TrueMoney := MyRO.Money; 4808 5483 TrueResearch := MyRO.Research; 4809 if supervising then5484 if Supervising then 4810 5485 begin // normalize values from after-turn state 4811 dec(TrueMoney, TaxSum);5486 Dec(TrueMoney, TaxSum); 4812 5487 if TrueMoney < 0 then 4813 5488 TrueMoney := 0; // shouldn't happen 4814 dec(TrueResearch, ScienceSum);5489 Dec(TrueResearch, ScienceSum); 4815 5490 if TrueResearch < 0 then 4816 5491 TrueResearch := 0; // shouldn't happen … … 4820 5495 ImageOp_BCC(TopBar, Templates.Data, Point(xTreasurySection + 8, 1), TreasuryIcon.BoundsRect, 4821 5496 $40A040, $4030C0); 4822 s:= IntToStr(TrueMoney);5497 S := IntToStr(TrueMoney); 4823 5498 LoweredTextOut(TopBar.Canvas, -1, MainTexture, xTreasurySection + 48, 0, 4824 s+ '%c');5499 S + '%c'); 4825 5500 if MyRO.Government <> gAnarchy then 4826 5501 begin … … 4828 5503 $0000C0, $0080C0); 4829 5504 if TaxSum >= 0 then 4830 s:= Format(Phrases.Lookup('MONEYGAINPOS'), [TaxSum])5505 S := Format(Phrases.Lookup('MONEYGAINPOS'), [TaxSum]) 4831 5506 else 4832 s:= Format(Phrases.Lookup('MONEYGAINNEG'), [TaxSum]);5507 S := Format(Phrases.Lookup('MONEYGAINNEG'), [TaxSum]); 4833 5508 LoweredTextOut(TopBar.Canvas, -1, MainTexture, xTreasurySection + 48 + 4834 15, 18, s);5509 15, 18, S); 4835 5510 end; 4836 5511 … … 4852 5527 else 4853 5528 CostFactor := 2; 4854 Server(sGetTechCost, me, 0, i);5529 Server(sGetTechCost, Me, 0, I); 4855 5530 CostFactor := CostFactor * 22; // length of progress bar 4856 5531 PaintRelativeProgressBar(TopBar.Canvas, 2, xResearchSection + 48 + 1, 26, 4857 CostFactor, TrueResearch, ScienceSum, i, true, MainTexture);5532 CostFactor, TrueResearch, ScienceSum, I, True, MainTexture); 4858 5533 4859 5534 if MyRO.ResearchTech < 0 then 4860 s:= Phrases.Lookup('SCIENCE')5535 S := Phrases.Lookup('SCIENCE') 4861 5536 else if MyRO.ResearchTech = adMilitary then 4862 s:= Phrases.Lookup('INITUNIT')5537 S := Phrases.Lookup('INITUNIT') 4863 5538 else 4864 5539 begin 4865 s:= Phrases.Lookup('ADVANCES', MyRO.ResearchTech);5540 S := Phrases.Lookup('ADVANCES', MyRO.ResearchTech); 4866 5541 if MyRO.ResearchTech in FutureTech then 4867 5542 if MyRO.Tech[MyRO.ResearchTech] >= 1 then 4868 s := s+ ' ' + IntToStr(MyRO.Tech[MyRO.ResearchTech] + 1)5543 S := S + ' ' + IntToStr(MyRO.Tech[MyRO.ResearchTech] + 1) 4869 5544 else 4870 s := s+ ' 1';5545 S := S + ' 1'; 4871 5546 end; 4872 5547 if ScienceSum > 0 then 4873 5548 begin 4874 5549 { j:=(i-MyRO.Research-1) div ScienceSum +1; 4875 if j<1 then j:=1;4876 if j>1 then4877 s:=Format(Phrases.Lookup('TECHWAIT'),[s,j]); }5550 if J<1 then J:=1; 5551 if J>1 then 5552 S:=Format(Phrases.Lookup('TECHWAIT'),[S,J]); } 4878 5553 LoweredTextOut(TopBar.Canvas, -1, MainTexture, 4879 xResearchSection + 48, 0, s);5554 xResearchSection + 48, 0, S); 4880 5555 end 4881 5556 else 4882 5557 LoweredTextOut(TopBar.Canvas, -1, MainTexture, 4883 xResearchSection + 48, 0, s);5558 xResearchSection + 48, 0, S); 4884 5559 end 4885 5560 else … … 4889 5564 ImageOp_BCC(TopBar, Templates.Data, Point(xResearchSection + 48 + CostFactor + 11, 4890 5565 22), ChangeIcon.BoundsRect, $0000C0, $0080C0); 4891 s:= Format(Phrases.Lookup('TECHGAIN'), [ScienceSum]);5566 S := Format(Phrases.Lookup('TECHGAIN'), [ScienceSum]); 4892 5567 LoweredTextOut(TopBar.Canvas, -1, MainTexture, xResearchSection + 48 + 4893 CostFactor + 26, 18, s);5568 CostFactor + 26, 18, S); 4894 5569 end; 4895 5570 end; … … 4897 5572 begin 4898 5573 TopBar.Canvas.Font.Assign(UniFont[ftCaption]); 4899 s:= TurnToString(MyRO.Turn);5574 S := TurnToString(MyRO.Turn); 4900 5575 RisedTextOut(TopBar.Canvas, 4901 40 + (xTreasurySection - 40 - BiColorTextWidth(TopBar.Canvas, s))4902 div 2, 6, s);5576 40 + (xTreasurySection - 40 - BiColorTextWidth(TopBar.Canvas, S)) 5577 div 2, 6, S); 4903 5578 TopBar.Canvas.Font.Assign(UniFont[ftNormal]); 4904 5579 end; … … 4908 5583 procedure TMainScreen.FocusNextUnit(Dir: Integer); 4909 5584 var 4910 i, uix, NewFocus: Integer;5585 I, uix, NewFocus: Integer; 4911 5586 begin 4912 5587 if ClientMode >= scContact then … … 4915 5590 PaintDestination; 4916 5591 NewFocus := -1; 4917 for i:= 1 to MyRO.nUn do begin4918 uix := (UnFocus + i* Dir + MyRO.nUn) mod MyRO.nUn;5592 for I := 1 to MyRO.nUn do begin 5593 uix := (UnFocus + I * Dir + MyRO.nUn) mod MyRO.nUn; 4919 5594 if (MyUn[uix].Loc >= 0) and (MyUn[uix].Status and usStay = 0) then begin 4920 5595 NewFocus := uix; … … 4929 5604 end; 4930 5605 4931 procedure TMainScreen.FocusOnLoc(Loc: integer; Options: integer = 0);5606 procedure TMainScreen.FocusOnLoc(Loc: Integer; Options: Integer = 0); 4932 5607 var 4933 dx: integer;4934 Outside, Changed: boolean;5608 dx: Integer; 5609 Outside, Changed: Boolean; 4935 5610 begin 4936 5611 with MainMap do begin … … 4940 5615 (Loc div G.lx >= yw + (MapHeight - 1) div yyt - 2)); 4941 5616 end; 4942 Changed := true;5617 Changed := True; 4943 5618 if Outside then begin 4944 5619 Centre(Loc); … … 4948 5623 PaintAllMaps 4949 5624 else 4950 Changed := false;5625 Changed := False; 4951 5626 if Options and flRepaintPanel <> 0 then 4952 5627 PanelPaint; … … 4958 5633 var 4959 5634 Dist, TestDist: Single; 4960 i, uix, NewFocus: Integer;5635 I, uix, NewFocus: Integer; 4961 5636 GotoOnly: Boolean; 4962 5637 begin … … 4968 5643 for GotoOnly := GoOnPhase downto False do begin 4969 5644 NewFocus := -1; 4970 for i:= 1 to MyRO.nUn do begin4971 uix := (UnFocus + i) mod MyRO.nUn;5645 for I := 1 to MyRO.nUn do begin 5646 uix := (UnFocus + I) mod MyRO.nUn; 4972 5647 if (MyUn[uix].Loc >= 0) and (MyUn[uix].Job = jNone) and 4973 5648 (MyUn[uix].Status and (usStay or usRecover or usWaiting) = usWaiting) … … 5008 5683 end; 5009 5684 5010 procedure TMainScreen.Scroll(dx, dy: integer);5685 procedure TMainScreen.Scroll(dx, dy: Integer); 5011 5686 begin 5012 5687 xw := (xw + G.lx + dx) mod G.lx; … … 5032 5707 procedure TMainScreen.Timer1Timer(Sender: TObject); 5033 5708 var 5034 dx, dy, ScrollSpeed: integer;5035 begin 5036 if idle and (me >= 0) and (GameMode <> cMovie) then5709 dx, dy, ScrollSpeed: Integer; 5710 begin 5711 if Idle and (Me >= 0) and (GameMode <> cMovie) then 5037 5712 if (fsModal in DpiScreen.ActiveForm.FormState) or 5038 5713 (DpiScreen.ActiveForm is TBufferedDrawDlg) and … … 5042 5717 if not BlinkON then 5043 5718 begin 5044 BlinkON := true;5719 BlinkON := True; 5045 5720 if UnFocus >= 0 then 5046 5721 PaintLocTemp(MyUn[UnFocus].Loc) 5047 else if TurnComplete and not supervising then5722 else if TurnComplete and not Supervising then 5048 5723 EOT.SetButtonIndexFast(eotBlinkOn); 5049 5724 end; … … 5057 5732 dx := 0; 5058 5733 dy := 0; 5059 if DpiMouse.CursorPos. y< DpiScreen.height - PanelHeight then5060 if DpiMouse.CursorPos. x= 0 then5734 if DpiMouse.CursorPos.Y < DpiScreen.height - PanelHeight then 5735 if DpiMouse.CursorPos.X = 0 then 5061 5736 dx := -ScrollSpeed // scroll left 5062 else if DpiMouse.CursorPos. x= DpiScreen.width - 1 then5737 else if DpiMouse.CursorPos.X = DpiScreen.width - 1 then 5063 5738 dx := ScrollSpeed; // scroll right 5064 if DpiMouse.CursorPos. y= 0 then5739 if DpiMouse.CursorPos.Y = 0 then 5065 5740 dy := -ScrollSpeed // scroll up 5066 else if (DpiMouse.CursorPos. y= DpiScreen.height - 1) and5067 (DpiMouse.CursorPos. x>= TerrainBtn.Left + TerrainBtn.width) and5068 (DpiMouse.CursorPos. x< xRightPanel + 10 - 8) then5741 else if (DpiMouse.CursorPos.Y = DpiScreen.height - 1) and 5742 (DpiMouse.CursorPos.X >= TerrainBtn.Left + TerrainBtn.width) and 5743 (DpiMouse.CursorPos.X < xRightPanel + 10 - 8) then 5069 5744 dy := ScrollSpeed; // scroll down 5070 5745 if (dx <> 0) or (dy <> 0) then … … 5079 5754 BlinkTime := (BlinkTime + 1) mod (BlinkOnTime + BlinkOffTime); 5080 5755 BlinkON := BlinkTime >= BlinkOffTime; 5081 DestinationMarkON := true;5756 DestinationMarkON := True; 5082 5757 if UnFocus >= 0 then 5083 5758 begin … … 5090 5765 end; 5091 5766 end 5092 else if TurnComplete and not supervising then5767 else if TurnComplete and not Supervising then 5093 5768 begin 5094 5769 if BlinkTime = 0 then … … 5100 5775 end; 5101 5776 5102 procedure TMainScreen.SetMapPos(Loc: integer; MapPos: TPoint);5777 procedure TMainScreen.SetMapPos(Loc: Integer; MapPos: TPoint); 5103 5778 begin 5104 5779 with MainMap do begin … … 5118 5793 end; 5119 5794 5120 procedure TMainScreen.Centre(Loc: integer);5795 procedure TMainScreen.Centre(Loc: Integer); 5121 5796 begin 5122 5797 SetMapPos(Loc, Point(MapWidth div 2, MapHeight div 2)); 5123 5798 end; 5124 5799 5125 function TMainScreen.ZoomToCity(Loc: integer; NextUnitOnClose: boolean = false;5126 ShowEvent: integer = 0): boolean;5127 begin 5128 result := MyMap[Loc] and (fOwned or fSpiedOut) <> 0;5129 if result then5800 function TMainScreen.ZoomToCity(Loc: Integer; NextUnitOnClose: Boolean = False; 5801 ShowEvent: Integer = 0): Boolean; 5802 begin 5803 Result := MyMap[Loc] and (fOwned or fSpiedOut) <> 0; 5804 if Result then 5130 5805 with CityDlg do 5131 5806 begin … … 5153 5828 end; 5154 5829 5155 function TMainScreen.LocationOfScreenPixel( x, y: integer): Integer;5830 function TMainScreen.LocationOfScreenPixel(X, Y: Integer): Integer; 5156 5831 var 5157 qx, qy: integer;5832 qx, qy: Integer; 5158 5833 begin 5159 5834 with MainMap do begin 5160 qx := ( x * (yyt * 2) + y* (xxt * 2) + xxt * yyt * 2) div (xxt * yyt * 4) - 1;5161 qy := ( y * (xxt * 2) - x* (yyt * 2) - xxt * yyt * 2 + 4000 * xxt * yyt)5835 qx := (X * (yyt * 2) + Y * (xxt * 2) + xxt * yyt * 2) div (xxt * yyt * 4) - 1; 5836 qy := (Y * (xxt * 2) - X * (yyt * 2) - xxt * yyt * 2 + 4000 * xxt * yyt) 5162 5837 div (xxt * yyt * 4) - 999; 5163 5838 Result := (xw + (qx - qy + 2048) div 2 - 1024 + G.lx) mod G.lx + G.lx * … … 5173 5848 5174 5849 procedure TMainScreen.MapBoxMouseDown(Sender: TObject; Button: TMouseButton; 5175 Shift: TShiftState; x, y: integer);5850 Shift: TShiftState; X, Y: Integer); 5176 5851 var 5177 i, uix, emix, p1, dx, dy, MouseLoc: integer;5852 I, uix, emix, p1, dx, dy, MouseLoc: Integer; 5178 5853 EditTileData: TEditTileData; 5179 m, m2: TDpiMenuItem;5854 M, m2: TDpiMenuItem; 5180 5855 MoveAdviceData: TMoveAdviceData; 5181 DoCenter: boolean;5856 DoCenter: Boolean; 5182 5857 begin 5183 5858 if GameMode = cMovie then 5184 exit;5185 5186 if CityDlg.Visible then5859 Exit; 5860 5861 if Assigned(FCityDlg) and CityDlg.Visible then 5187 5862 CityDlg.Close; 5188 if UnitStatDlg.Visible then5863 if Assigned(FUnitStatDlg) and UnitStatDlg.Visible then 5189 5864 UnitStatDlg.Close; 5190 MouseLoc := LocationOfScreenPixel( x, y);5865 MouseLoc := LocationOfScreenPixel(X, Y); 5191 5866 if (MouseLoc < 0) or (MouseLoc >= G.lx * G.ly) then 5192 exit;5867 Exit; 5193 5868 if (Button = mbLeft) and not(ssShift in Shift) then 5194 5869 begin 5195 DoCenter := true;5870 DoCenter := True; 5196 5871 if ClientMode = cEditMap then 5197 5872 begin 5198 DoCenter := false;5873 DoCenter := False; 5199 5874 EditTileData.Loc := MouseLoc; 5200 5875 if ssCtrl in Shift then // toggle special resource … … 5234 5909 else 5235 5910 EditTileData.NewTile := MyMap[MouseLoc] xor BrushType; 5236 Server(sEditTile, me, 0, EditTileData);5237 Edited := true;5911 Server(sEditTile, Me, 0, EditTileData); 5912 Edited := True; 5238 5913 BrushLoc := MouseLoc; 5239 5914 PaintLoc(MouseLoc, 2); 5240 5915 MiniMapPaint; 5241 DpiBit Canvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly,5916 DpiBitBltCanvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly, 5242 5917 MiniMap.Bitmap.Canvas, 0, 0); 5243 5918 with MainMap do begin … … 5261 5936 begin 5262 5937 ZoomToCity(MouseLoc); 5263 DoCenter := false;5938 DoCenter := False; 5264 5939 end 5265 5940 else 5266 5941 begin 5267 5942 UnitStatDlg.ShowNewContent_EnemyCity(wmPersistent, MouseLoc); 5268 DoCenter := false;5943 DoCenter := False; 5269 5944 end; 5270 5945 end … … 5272 5947 if MyMap[MouseLoc] and fOwned <> 0 then 5273 5948 begin 5274 DoCenter := false;5275 if not supervising and (ClientMode < scContact) then5949 DoCenter := False; 5950 if not Supervising and (ClientMode < scContact) then 5276 5951 begin // not in negotiation mode 5277 5952 if (UnFocus >= 0) and (MyUn[UnFocus].Loc = MouseLoc) then 5278 5953 begin // rotate 5279 5954 uix := (UnFocus + 1) mod MyRO.nUn; 5280 i:= MyRO.nUn - 1;5281 while i> 0 do5955 I := MyRO.nUn - 1; 5956 while I > 0 do 5282 5957 begin 5283 5958 if (MyUn[uix].Loc = MouseLoc) and (MyUn[uix].Job = jNone) and … … 5285 5960 usWaiting) = usWaiting) then 5286 5961 Break; 5287 dec(i);5962 Dec(I); 5288 5963 uix := (uix + 1) mod MyRO.nUn; 5289 5964 end; 5290 if i= 0 then5965 if I = 0 then 5291 5966 uix := UnFocus; 5292 5967 end 5293 5968 else 5294 Server(sGetDefender, me, MouseLoc, uix);5969 Server(sGetDefender, Me, MouseLoc, uix); 5295 5970 if uix <> UnFocus then 5296 5971 SetUnFocus(uix); 5297 TurnComplete := false;5972 TurnComplete := False; 5298 5973 EOT.ButtonIndex := eotGray; 5299 5974 end; … … 5303 5978 else if (MyMap[MouseLoc] and fSpiedOut <> 0) and not(ssCtrl in Shift) then 5304 5979 begin 5305 DoCenter := false;5980 DoCenter := False; 5306 5981 SetTroopLoc(MouseLoc); 5307 5982 PanelPaint; … … 5309 5984 else 5310 5985 begin 5311 DoCenter := false;5986 DoCenter := False; 5312 5987 UnitStatDlg.ShowNewContent_EnemyLoc(wmPersistent, MouseLoc); 5313 5988 end; … … 5321 5996 not(ssShift in Shift) then 5322 5997 begin 5323 if supervising then5998 if Supervising then 5324 5999 begin 5325 6000 EditLoc := MouseLoc; 5326 Server(sGetModels, me, 0, nil^);6001 Server(sGetModels, Me, 0, nil^); 5327 6002 EmptyMenu(mCreateUnit); 5328 6003 for p1 := 0 to nPl - 1 do 5329 6004 if 1 shl p1 and MyRO.Alive <> 0 then 5330 6005 begin 5331 m:= TDpiMenuItem.Create(mCreateUnit);5332 m.Caption := Tribe[p1].TPhrase('SHORTNAME');6006 M := TDpiMenuItem.Create(mCreateUnit); 6007 M.Caption := Tribe[p1].TPhrase('SHORTNAME'); 5333 6008 for emix := MyRO.nEnemyModel - 1 downto 0 do 5334 6009 if (MyRO.EnemyModel[emix].Owner = p1) and 5335 (Server(sCreateUnit - sExecute + p1 shl 4, me,6010 (Server(sCreateUnit - sExecute + p1 shl 4, Me, 5336 6011 MyRO.EnemyModel[emix].mix, MouseLoc) >= rExecuted) then 5337 6012 begin 5338 6013 if not Assigned(Tribe[p1].ModelPicture[MyRO.EnemyModel[emix].mix].HGr) then 5339 6014 InitEnemyModel(emix); 5340 m2 := TDpiMenuItem.Create( m);6015 m2 := TDpiMenuItem.Create(M); 5341 6016 m2.Caption := Tribe[p1].ModelName[MyRO.EnemyModel[emix].mix]; 5342 6017 m2.Tag := p1 shl 16 + MyRO.EnemyModel[emix].mix; 5343 6018 m2.OnClick := CreateUnitClick; 5344 m.Add(m2);6019 M.Add(m2); 5345 6020 end; 5346 m.Visible := m.Count > 0;5347 mCreateUnit.Add( m);6021 M.Visible := M.Count > 0; 6022 mCreateUnit.Add(M); 5348 6023 end; 5349 6024 if FullScreen then 5350 EditPopup.Popup(Left + x, Top + y)6025 EditPopup.Popup(Left + X, Top + Y) 5351 6026 else 5352 EditPopup.Popup(Left + x+ 4,5353 Top + y+ DpiGetSystemMetrics(SM_CYCAPTION) + 4);6027 EditPopup.Popup(Left + X + 4, 6028 Top + Y + DpiGetSystemMetrics(SM_CYCAPTION) + 4); 5354 6029 end 5355 6030 else if (UnFocus >= 0) and (MyUn[UnFocus].Loc <> MouseLoc) then … … 5362 6037 if abs(dx) + abs(dy) < 3 then 5363 6038 begin 5364 DestinationMarkON := false;6039 DestinationMarkON := False; 5365 6040 PaintDestination; 5366 6041 Status := Status and ($FFFF - usStay - usRecover - usGoto - usEnhance) … … 5375 6050 with MyUn[UnFocus], BattleDlg.Forecast do 5376 6051 begin 5377 pAtt := me;6052 pAtt := Me; 5378 6053 mixAtt := mix; 5379 6054 HealthAtt := Health; … … 5382 6057 end; 5383 6058 BattleDlg.Forecast.Movement := MyUn[UnFocus].Movement; 5384 if (Server(sGetBattleForecastEx, me, MouseLoc, BattleDlg.Forecast)6059 if (Server(sGetBattleForecastEx, Me, MouseLoc, BattleDlg.Forecast) 5385 6060 >= rExecuted) and (BattleDlg.Forecast.EndHealthAtt <= 0) then 5386 6061 begin 5387 6062 BattleDlg.uix := UnFocus; 5388 6063 BattleDlg.ToLoc := MouseLoc; 5389 BattleDlg.IsSuicideQuery := true;6064 BattleDlg.IsSuicideQuery := True; 5390 6065 BattleDlg.ShowModal; 5391 6066 if BattleDlg.ModalResult <> mrOK then 5392 exit;6067 Exit; 5393 6068 end; 5394 6069 end; 5395 DestinationMarkON := false;6070 DestinationMarkON := False; 5396 6071 PaintDestination; 5397 6072 Status := Status and not(usStay or usRecover or usEnhance) or 5398 6073 usWaiting; 5399 MoveToLoc(MouseLoc, false); { goto }6074 MoveToLoc(MouseLoc, False); { goto } 5400 6075 end; 5401 6076 end; … … 5404 6079 (MyModel[MyUn[UnFocus].mix].Kind in [mkSettler, mkSlaves]) then 5405 6080 begin 5406 DestinationMarkON := false;6081 DestinationMarkON := False; 5407 6082 PaintDestination; 5408 6083 MyUn[UnFocus].Status := MyUn[UnFocus].Status and … … 5410 6085 uix := UnFocus; 5411 6086 if MouseLoc <> MyUn[uix].Loc then 5412 MoveToLoc(MouseLoc, true); { goto }6087 MoveToLoc(MouseLoc, True); { goto } 5413 6088 if (UnFocus = uix) and (MyUn[uix].Loc = MouseLoc) then 5414 MenuClick(mEnhance);6089 mEnhance.Click; 5415 6090 end 5416 6091 else if (Button = mbLeft) and (ssShift in Shift) and … … 5423 6098 with MyUn[UnFocus], BattleDlg.Forecast do 5424 6099 begin 5425 pAtt := me;6100 pAtt := Me; 5426 6101 mixAtt := mix; 5427 6102 HealthAtt := Health; … … 5430 6105 end; 5431 6106 BattleDlg.Forecast.Movement := MyUn[UnFocus].Movement; 5432 if Server(sGetBattleForecastEx, me, MouseLoc, BattleDlg.Forecast) >= rExecuted6107 if Server(sGetBattleForecastEx, Me, MouseLoc, BattleDlg.Forecast) >= rExecuted 5433 6108 then 5434 6109 begin 5435 6110 BattleDlg.uix := UnFocus; 5436 6111 BattleDlg.ToLoc := MouseLoc; 5437 BattleDlg.Left := x- BattleDlg.width div 2;6112 BattleDlg.Left := X - BattleDlg.width div 2; 5438 6113 if BattleDlg.Left < 0 then 5439 6114 BattleDlg.Left := 0 5440 6115 else if BattleDlg.Left + BattleDlg.width > DpiScreen.width then 5441 6116 BattleDlg.Left := DpiScreen.width - BattleDlg.width; 5442 BattleDlg.Top := y- BattleDlg.height div 2;6117 BattleDlg.Top := Y - BattleDlg.height div 2; 5443 6118 if BattleDlg.Top < 0 then 5444 6119 BattleDlg.Top := 0 5445 6120 else if BattleDlg.Top + BattleDlg.height > DpiScreen.height then 5446 6121 BattleDlg.Top := DpiScreen.height - BattleDlg.height; 5447 BattleDlg.IsSuicideQuery := false;6122 BattleDlg.IsSuicideQuery := False; 5448 6123 BattleDlg.Show; 5449 6124 end; … … 5451 6126 end; 5452 6127 5453 function TMainScreen.MoveUnit(dx, dy: integer; Options: integer): integer;6128 function TMainScreen.MoveUnit(dx, dy: Integer; Options: Integer): Integer; 5454 6129 // move focused unit to adjacent tile 5455 6130 var 5456 i, cix, uix, euix, FromLoc, ToLoc, DirCode, UnFocus0, Defender, Mission, p1,5457 NewTiles, cixChanged: integer;6131 I, cix, uix, euix, FromLoc, ToLoc, DirCode, UnFocus0, Defender, Mission, p1, 6132 NewTiles, cixChanged: Integer; 5458 6133 OldToTile: Cardinal; 5459 6134 CityCaptured, IsAttack, OldUnrest, NewUnrest, NeedEcoUpdate, NeedRepaintPanel, 5460 ToTransport, ToShip: boolean;6135 ToTransport, ToShip: Boolean; 5461 6136 PlaneReturnData: TPlaneReturnData; 5462 6137 QueryItem: string; 5463 6138 begin 5464 result := eInvalid;6139 Result := eInvalid; 5465 6140 UnFocus0 := UnFocus; 5466 6141 FromLoc := MyUn[UnFocus].Loc; … … 5468 6143 if (ToLoc < 0) or (ToLoc >= G.lx * G.ly) then 5469 6144 begin 5470 result := eInvalid;5471 exit;6145 Result := eInvalid; 6146 Exit; 5472 6147 end; 5473 6148 if MyMap[ToLoc] and fStealthUnit <> 0 then 5474 6149 begin 5475 6150 SoundMessage(Phrases.Lookup('ATTACKSTEALTH'), ''); 5476 exit;6151 Exit; 5477 6152 end; 5478 6153 if MyMap[ToLoc] and fHiddenUnit <> 0 then 5479 6154 begin 5480 6155 SoundMessage(Phrases.Lookup('ATTACKSUB'), ''); 5481 exit;6156 Exit; 5482 6157 end; 5483 6158 … … 5489 6164 begin 5490 6165 SoundMessage(Phrases.Lookup('NOATTACKER'), ''); 5491 exit;6166 Exit; 5492 6167 end; 5493 6168 euix := MyRO.nEnemyUn - 1; 5494 6169 while (euix >= 0) and (MyRO.EnemyUn[euix].Loc <> ToLoc) do 5495 dec(euix);6170 Dec(euix); 5496 6171 end; 5497 6172 5498 6173 DirCode := dx and 7 shl 4 + dy and 7 shl 7; 5499 result := Server(sMoveUnit - sExecute + DirCode, me, UnFocus, nil^);5500 if ( result < rExecuted) and (MyUn[UnFocus].Job > jNone) then5501 Server(sStartJob + jNone shl 4, me, UnFocus, nil^);5502 if ( result < rExecuted) and (result <> eNoTime_Move) then5503 begin 5504 case result of6174 Result := Server(sMoveUnit - sExecute + DirCode, Me, UnFocus, nil^); 6175 if (Result < rExecuted) and (MyUn[UnFocus].Job > jNone) then 6176 Server(sStartJob + jNone shl 4, Me, UnFocus, nil^); 6177 if (Result < rExecuted) and (Result <> eNoTime_Move) then 6178 begin 6179 case Result of 5505 6180 eNoTime_Load: 5506 6181 if MyModel[MyUn[UnFocus].mix].Domain = dAir then … … 5538 6213 (MyMap[ToLoc] and (fUnit or fOwned) = fUnit or fOwned) then 5539 6214 begin // false load attempt 5540 ToShip := false;5541 ToTransport := false;6215 ToShip := False; 6216 ToTransport := False; 5542 6217 for uix := 0 to MyRO.nUn - 1 do 5543 6218 if (MyUn[uix].Loc = ToLoc) and 5544 6219 (MyModel[MyUn[uix].mix].Domain = dSea) then 5545 6220 begin 5546 ToShip := true;6221 ToShip := True; 5547 6222 if MyModel[MyUn[uix].mix].Cap[mcSeaTrans] > 0 then 5548 ToTransport := true;6223 ToTransport := True; 5549 6224 end; 5550 6225 if ToTransport then … … 5561 6236 Play('NOMOVE_DEFAULT'); 5562 6237 end; 5563 exit;5564 end; 5565 5566 if (( result = eWon) or (result = eLost) or (result = eBloody)) and6238 Exit; 6239 end; 6240 6241 if ((Result = eWon) or (Result = eLost) or (Result = eBloody)) and 5567 6242 (MyUn[UnFocus].Movement < 100) and 5568 6243 (MyModel[MyUn[UnFocus].mix].Cap[mcWill] = 0) then … … 5571 6246 [MyUn[UnFocus].Movement]), 'NOMOVE_TIME') <> mrOK then 5572 6247 begin 5573 result := eInvalid;5574 exit;6248 Result := eInvalid; 6249 Exit; 5575 6250 end; 5576 6251 Update; // remove message box from screen 5577 6252 end; 5578 6253 5579 OldUnrest := false;5580 NewUnrest := false;5581 if ( result >= rExecuted) and (result and rUnitRemoved = 0) and6254 OldUnrest := False; 6255 NewUnrest := False; 6256 if (Result >= rExecuted) and (Result and rUnitRemoved = 0) and 5582 6257 (MyMap[ToLoc] and (fUnit or fOwned) <> fUnit) then 5583 6258 begin … … 5589 6264 begin 5590 6265 QueryItem := 'UNREST_NOTOWN'; 5591 p1 := me;6266 p1 := Me; 5592 6267 end 5593 6268 else … … 5606 6281 if ModalResult <> mrOK then 5607 6282 begin 5608 result := eInvalid;5609 exit;6283 Result := eInvalid; 6284 Exit; 5610 6285 end; 5611 6286 end; 5612 6287 Update; // remove message box from screen 5613 end 5614 end; 5615 5616 if ( result >= rExecuted) and (MyModel[MyUn[UnFocus].mix].Domain = dAir) and6288 end; 6289 end; 6290 6291 if (Result >= rExecuted) and (MyModel[MyUn[UnFocus].mix].Domain = dAir) and 5617 6292 (MyUn[UnFocus].Status and usToldNoReturn = 0) then 5618 6293 begin // can plane return? … … 5634 6309 PlaneReturnData.Movement := MyUn[UnFocus].Movement - 150; 5635 6310 end; 5636 if Server(sGetPlaneReturn, me, UnFocus, PlaneReturnData) = eNoWay then6311 if Server(sGetPlaneReturn, Me, UnFocus, PlaneReturnData) = eNoWay then 5637 6312 begin 5638 6313 if MyModel[MyUn[UnFocus].mix].Kind = mkSpecial_Glider then … … 5643 6318 <> mrOK then 5644 6319 begin 5645 result := eInvalid;5646 exit;6320 Result := eInvalid; 6321 Exit; 5647 6322 end; 5648 6323 Update; // remove message box from screen 5649 6324 MyUn[UnFocus].Status := MyUn[UnFocus].Status or usToldNoReturn; 5650 end 5651 end; 5652 5653 if result = eMissionDone then6325 end; 6326 end; 6327 6328 if Result = eMissionDone then 5654 6329 begin 5655 6330 ModalSelectDlg.ShowNewContent(wmModal, kMission); 5656 6331 Update; // dialog still on screen 5657 Mission := ModalSelectDlg. result;6332 Mission := ModalSelectDlg.Result; 5658 6333 if Mission < 0 then 5659 exit;5660 Server(sSetSpyMission + Mission shl 4, me, 0, nil^);5661 end; 5662 5663 CityCaptured := false;5664 if result = eNoTime_Move then6334 Exit; 6335 Server(sSetSpyMission + Mission shl 4, Me, 0, nil^); 6336 end; 6337 6338 CityCaptured := False; 6339 if Result = eNoTime_Move then 5665 6340 Play('NOMOVE_TIME') 5666 6341 else 5667 6342 begin 5668 NeedEcoUpdate := false;5669 DestinationMarkON := false;6343 NeedEcoUpdate := False; 6344 DestinationMarkON := False; 5670 6345 PaintDestination; 5671 if result and rUnitRemoved <> 0 then6346 if Result and rUnitRemoved <> 0 then 5672 6347 CityOptimizer_BeforeRemoveUnit(UnFocus); 5673 IsAttack := ( result = eBombarded) or (result <> eMissionDone) and6348 IsAttack := (Result = eBombarded) or (Result <> eMissionDone) and 5674 6349 (MyMap[ToLoc] and (fUnit or fOwned) = fUnit); 5675 6350 if not IsAttack then … … 5677 6352 cix := MyRO.nCity - 1; { look for own city at dest location } 5678 6353 while (cix >= 0) and (MyCity[cix].Loc <> ToLoc) do 5679 dec(cix);5680 if ( result <> eMissionDone) and (MyMap[ToLoc] and fCity <> 0) and (cix < 0)6354 Dec(cix); 6355 if (Result <> eMissionDone) and (MyMap[ToLoc] and fCity <> 0) and (cix < 0) 5681 6356 then 5682 CityCaptured := true;5683 result := Server(sMoveUnit + DirCode, me, UnFocus, nil^);5684 case result of6357 CityCaptured := True; 6358 Result := Server(sMoveUnit + DirCode, Me, UnFocus, nil^); 6359 case Result of 5685 6360 eHiddenUnit: 5686 6361 begin 5687 6362 Play('NOMOVE_SUBMARINE'); 5688 PaintLoc(ToLoc) 6363 PaintLoc(ToLoc); 5689 6364 end; 5690 6365 eStealthUnit: 5691 6366 begin 5692 6367 Play('NOMOVE_STEALTH'); 5693 PaintLoc(ToLoc) 6368 PaintLoc(ToLoc); 5694 6369 end; 5695 6370 eZOC_EnemySpotted: 5696 6371 begin 5697 6372 Play('NOMOVE_ZOC'); 5698 PaintLoc(ToLoc, 1) 6373 PaintLoc(ToLoc, 1); 5699 6374 end; 5700 rExecuted .. maxint:6375 rExecuted..MaxInt: 5701 6376 begin 5702 if result and rUnitRemoved <> 0 then6377 if Result and rUnitRemoved <> 0 then 5703 6378 UnFocus := -1 // unit died 5704 6379 else 5705 6380 begin 5706 assert(UnFocus >= 0);6381 Assert(UnFocus >= 0); 5707 6382 MyUn[UnFocus].Status := MyUn[UnFocus].Status and 5708 6383 not(usStay or usRecover); … … 5714 6389 begin // borders have moved, unrest might have changed in any city 5715 6390 CityOptimizer_BeginOfTurn; 5716 NeedEcoUpdate := true;6391 NeedEcoUpdate := True; 5717 6392 end 5718 6393 else … … 5724 6399 if MyUn[uix].Master = UnFocus then 5725 6400 CityOptimizer_CityChange(MyUn[uix].Home); 5726 NeedEcoUpdate := true;6401 NeedEcoUpdate := True; 5727 6402 end; 5728 6403 if (MyRO.Government = gDespotism) and … … 5734 6409 while (cixChanged >= 0) and 5735 6410 (MyCity[cixChanged].Loc <> FromLoc) do 5736 dec(cixChanged);5737 assert(cixChanged >= 0);6411 Dec(cixChanged); 6412 Assert(cixChanged >= 0); 5738 6413 if cixChanged >= 0 then 5739 6414 begin 5740 6415 CityOptimizer_CityChange(cixChanged); 5741 NeedEcoUpdate := true;6416 NeedEcoUpdate := True; 5742 6417 end; 5743 6418 end; … … 5747 6422 while (cixChanged >= 0) and 5748 6423 (MyCity[cixChanged].Loc <> ToLoc) do 5749 dec(cixChanged);5750 assert(cixChanged >= 0);6424 Dec(cixChanged); 6425 Assert(cixChanged >= 0); 5751 6426 if cixChanged >= 0 then 5752 6427 begin 5753 6428 CityOptimizer_CityChange(cixChanged); 5754 NeedEcoUpdate := true;6429 NeedEcoUpdate := True; 5755 6430 end; 5756 6431 end; … … 5760 6435 end; 5761 6436 else 5762 assert(false);6437 Assert(False); 5763 6438 end; 5764 6439 SetTroopLoc(ToLoc); … … 5766 6441 else 5767 6442 begin { enemy unit -- attack } 5768 if result = eBombarded then6443 if Result = eBombarded then 5769 6444 Defender := MyRO.Territory[ToLoc] 5770 6445 else … … 5773 6448 if SimpleQuery(mkYesNo,Phrases.Lookup('FRCANCELQUERY_CEASEFIRE'), 5774 6449 'MSG_DEFAULT')<>mrOK then 5775 exit; }5776 if (Options and muNoSuicideCheck = 0) and ( result and rUnitRemoved <> 0)5777 and ( result <> eMissionDone) then6450 Exit; } 6451 if (Options and muNoSuicideCheck = 0) and (Result and rUnitRemoved <> 0) 6452 and (Result <> eMissionDone) then 5778 6453 begin // suicide query 5779 6454 with MyUn[UnFocus], BattleDlg.Forecast do 5780 6455 begin 5781 pAtt := me;6456 pAtt := Me; 5782 6457 mixAtt := mix; 5783 6458 HealthAtt := Health; … … 5786 6461 end; 5787 6462 BattleDlg.Forecast.Movement := MyUn[UnFocus].Movement; 5788 Server(sGetBattleForecastEx, me, ToLoc, BattleDlg.Forecast);6463 Server(sGetBattleForecastEx, Me, ToLoc, BattleDlg.Forecast); 5789 6464 BattleDlg.uix := UnFocus; 5790 6465 BattleDlg.ToLoc := ToLoc; 5791 BattleDlg.IsSuicideQuery := true;6466 BattleDlg.IsSuicideQuery := True; 5792 6467 BattleDlg.ShowModal; 5793 6468 if BattleDlg.ModalResult <> mrOK then 5794 exit;6469 Exit; 5795 6470 end; 5796 6471 5797 6472 cixChanged := -1; 5798 if ( result and rUnitRemoved <> 0) and (MyRO.Government = gDespotism) and6473 if (Result and rUnitRemoved <> 0) and (MyRO.Government = gDespotism) and 5799 6474 (MyModel[MyUn[UnFocus].mix].Kind = mkSpecial_TownGuard) and 5800 6475 (MyMap[FromLoc] and fCity <> 0) then … … 5802 6477 cixChanged := MyRO.nCity - 1; 5803 6478 while (cixChanged >= 0) and (MyCity[cixChanged].Loc <> FromLoc) do 5804 dec(cixChanged);5805 assert(cixChanged >= 0);5806 end; 5807 5808 for i:= 0 to MyRO.nEnemyModel - 1 do5809 LostArmy[ i] := MyRO.EnemyModel[i].Lost;6479 Dec(cixChanged); 6480 Assert(cixChanged >= 0); 6481 end; 6482 6483 for I := 0 to MyRO.nEnemyModel - 1 do 6484 LostArmy[I] := MyRO.EnemyModel[I].Lost; 5810 6485 OldToTile := MyMap[ToLoc]; 5811 result := Server(sMoveUnit + DirCode, me, UnFocus, nil^);6486 Result := Server(sMoveUnit + DirCode, Me, UnFocus, nil^); 5812 6487 nLostArmy := 0; 5813 for i:= 0 to MyRO.nEnemyModel - 1 do6488 for I := 0 to MyRO.nEnemyModel - 1 do 5814 6489 begin 5815 LostArmy[ i] := MyRO.EnemyModel[i].Lost - LostArmy[i];5816 inc(nLostArmy, LostArmy[i])5817 end; 5818 if result and rUnitRemoved <> 0 then6490 LostArmy[I] := MyRO.EnemyModel[I].Lost - LostArmy[I]; 6491 Inc(nLostArmy, LostArmy[I]); 6492 end; 6493 if Result and rUnitRemoved <> 0 then 5819 6494 begin 5820 6495 UnFocus := -1; … … 5825 6500 begin // city was destroyed, borders have moved, unrest might have changed in any city 5826 6501 CityOptimizer_BeginOfTurn; 5827 NeedEcoUpdate := true; 5828 end 5829 else 5830 begin 6502 NeedEcoUpdate := True; 6503 end else begin 5831 6504 if cixChanged >= 0 then 5832 6505 begin 5833 6506 CityOptimizer_CityChange(cixChanged); 5834 NeedEcoUpdate := true;6507 NeedEcoUpdate := True; 5835 6508 end; 5836 if ( result = eWon) or (result = eBloody) or (result = eExpelled) then6509 if (Result = eWon) or (Result = eBloody) or (Result = eExpelled) then 5837 6510 begin 5838 6511 CityOptimizer_TileBecomesAvailable(ToLoc); 5839 NeedEcoUpdate := true;6512 NeedEcoUpdate := True; 5840 6513 end; 5841 6514 end; … … 5849 6522 MyRO.EnemyModel[MyRO.EnemyUn[euix].emix].Domain)); 5850 6523 ShowModal; 5851 end 5852 end 5853 end; 5854 if result and rUnitRemoved <> 0 then6524 end; 6525 end; 6526 end; 6527 if Result and rUnitRemoved <> 0 then 5855 6528 begin 5856 6529 CityOptimizer_AfterRemoveUnit; 5857 6530 ListDlg.RemoveUnit; 5858 NeedEcoUpdate := true;6531 NeedEcoUpdate := True; 5859 6532 end; 5860 6533 if NeedEcoUpdate then 5861 6534 begin 5862 UpdateViews( true);5863 Update 5864 end 5865 end; 5866 5867 if result = eMissionDone then6535 UpdateViews(True); 6536 Update; 6537 end; 6538 end; 6539 6540 if Result = eMissionDone then 5868 6541 begin 5869 6542 p1 := MyRO.Territory[ToLoc]; … … 5871 6544 smStealMap: 5872 6545 begin 5873 MapValid := false;6546 MapValid := False; 5874 6547 PaintAllMaps 5875 6548 end; … … 5884 6557 CheckToldNoReturn(UnFocus); 5885 6558 5886 NeedRepaintPanel := false;5887 if result >= rExecuted then6559 NeedRepaintPanel := False; 6560 if Result >= rExecuted then 5888 6561 begin 5889 6562 if CityCaptured and (MyMap[ToLoc] and fCity = 0) then 5890 6563 begin // city destroyed 5891 for i:= 0 to nWonder - 1 do { tell about destroyed wonders }5892 if (MyRO.Wonder[ i].CityID = WonderDestroyed) and (MyData.ToldWonders[i].CityID <> WonderDestroyed)6564 for I := 0 to nWonder - 1 do { tell about destroyed wonders } 6565 if (MyRO.Wonder[I].CityID = WonderDestroyed) and (MyData.ToldWonders[I].CityID <> WonderDestroyed) 5893 6566 then 5894 6567 with MessgExDlg do 5895 6568 begin 5896 6569 if WondersDlg.Visible then 5897 WondersDlg.SmartUpdateContent( false);6570 WondersDlg.SmartUpdateContent(False); 5898 6571 OpenSound := 'WONDER_DESTROYED'; 5899 6572 MessgText := Format(Phrases.Lookup('WONDERDEST'), 5900 [Phrases.Lookup('IMPROVEMENTS', i)]);6573 [Phrases.Lookup('IMPROVEMENTS', I)]); 5901 6574 Kind := mkOkHelp; 5902 6575 HelpKind := hkImp; 5903 HelpNo := i;6576 HelpNo := I; 5904 6577 IconKind := mikImp; 5905 IconIndex := i;6578 IconIndex := I; 5906 6579 ShowModal; 5907 MyData.ToldWonders[ i] := MyRO.Wonder[i];5908 end 6580 MyData.ToldWonders[I] := MyRO.Wonder[I]; 6581 end; 5909 6582 end; 5910 6583 if CityCaptured and (MyMap[ToLoc] and fCity <> 0) then 5911 6584 begin // city captured 5912 6585 ListDlg.AddCity; 5913 for i:= 0 to nWonder - 1 do { tell about capture of wonders }5914 if MyRO.City[MyRO.nCity - 1].Built[ i] > 0 then6586 for I := 0 to nWonder - 1 do { tell about capture of wonders } 6587 if MyRO.City[MyRO.nCity - 1].Built[I] > 0 then 5915 6588 with MessgExDlg do 5916 6589 begin 5917 6590 if WondersDlg.Visible then 5918 WondersDlg.SmartUpdateContent( false);6591 WondersDlg.SmartUpdateContent(False); 5919 6592 OpenSound := 'WONDER_CAPTURED'; 5920 MessgText := Format(Tribe[ me].TPhrase('WONDERCAPTOWN'),5921 [Phrases.Lookup('IMPROVEMENTS', i)]);6593 MessgText := Format(Tribe[Me].TPhrase('WONDERCAPTOWN'), 6594 [Phrases.Lookup('IMPROVEMENTS', I)]); 5922 6595 Kind := mkOkHelp; 5923 6596 HelpKind := hkImp; 5924 HelpNo := i;6597 HelpNo := I; 5925 6598 IconKind := mikImp; 5926 IconIndex := i;6599 IconIndex := I; 5927 6600 ShowModal; 5928 MyData.ToldWonders[ i] := MyRO.Wonder[i];6601 MyData.ToldWonders[I] := MyRO.Wonder[I]; 5929 6602 end; 5930 6603 … … 5932 6605 begin { Temple of Zeus -- choose advance to steal } 5933 6606 ModalSelectDlg.ShowNewContent(wmModal, kStealTech); 5934 Server(sStealTech, me, ModalSelectDlg.result, nil^);6607 Server(sStealTech, Me, ModalSelectDlg.Result, nil^); 5935 6608 end; 5936 6609 TellNewModels; … … 5938 6611 cix := MyRO.nCity - 1; 5939 6612 while (cix >= 0) and (MyCity[cix].Loc <> ToLoc) do 5940 dec(cix);5941 assert(cix >= 0);6613 Dec(cix); 6614 Assert(cix >= 0); 5942 6615 MyCity[cix].Status := MyCity[cix].Status and not csResourceWeightsMask or 5943 6616 (3 shl 4); 5944 6617 // captured city, set to maximum growth 5945 6618 NewTiles := 1 shl 13; { exploit central tile only } 5946 Server(sSetCityTiles, me, cix, NewTiles);6619 Server(sSetCityTiles, Me, cix, NewTiles); 5947 6620 end 5948 6621 else 5949 NeedRepaintPanel := true;6622 NeedRepaintPanel := True; 5950 6623 end; 5951 6624 TellNewContacts; … … 5961 6634 if Options and (muAutoNoWait or muAutoNext) <> 0 then 5962 6635 begin 5963 if (UnFocus >= 0) and (( result = eNoTime_Move) or UnitExhausted(UnFocus) or6636 if (UnFocus >= 0) and ((Result = eNoTime_Move) or UnitExhausted(UnFocus) or 5964 6637 (MyUn[UnFocus].Master >= 0) or (MyModel[MyUn[UnFocus].mix].Domain = dAir) 5965 6638 and ((MyMap[MyUn[UnFocus].Loc] and fCity <> 0) … … 5975 6648 end 5976 6649 else 5977 NextUnit(UnStartLoc, true);6650 NextUnit(UnStartLoc, True); 5978 6651 end 5979 6652 else if (UnFocus < 0) and (Options and muAutoNext <> 0) then 5980 NextUnit(UnStartLoc, result <> eMissionDone);6653 NextUnit(UnStartLoc, Result <> eMissionDone); 5981 6654 end; 5982 6655 … … 5986 6659 else 5987 6660 begin 5988 assert(result <> eMissionDone);6661 Assert(Result <> eMissionDone); 5989 6662 CheckTerrainBtnVisible; 5990 FocusOnLoc(ToLoc, flRepaintPanel or flImmUpdate) 5991 end; 5992 5993 if ( result >= rExecuted) and CityCaptured and (MyMap[ToLoc] and fCity <> 0)6663 FocusOnLoc(ToLoc, flRepaintPanel or flImmUpdate); 6664 end; 6665 6666 if (Result >= rExecuted) and CityCaptured and (MyMap[ToLoc] and fCity <> 0) 5994 6667 then 5995 6668 ZoomToCity(ToLoc, UnFocus < 0, chCaptured); // show captured city 5996 end; // moveunit6669 end; 5997 6670 5998 6671 procedure TMainScreen.MoveOnScreen(ShowMove: TShowMove; 5999 Step0, Step1, nStep: integer; Restore: boolean = true);6672 Step0, Step1, nStep: Integer; Restore: Boolean = True); 6000 6673 var 6001 6674 ToLoc, xFromLoc, yFromLoc, xToLoc, yToLoc, xFrom, yFrom, xTo, yTo, xMin, yMin, 6002 xRange, yRange, xw1, Step, xMoving, yMoving, SliceCount: integer;6675 xRange, yRange, xw1, Step, xMoving, yMoving, SliceCount: Integer; 6003 6676 UnitInfo: TUnitInfo; 6004 6677 Ticks0, Ticks: TDateTime; 6005 6678 begin 6006 Timer1.Enabled := false;6679 Timer1.Enabled := False; 6007 6680 Ticks0 := NowPrecise; 6008 6681 with ShowMove do … … 6013 6686 UnitInfo.Job := jNone; 6014 6687 UnitInfo.Flags := Flags; 6015 if Owner <> me then6688 if Owner <> Me then 6016 6689 UnitInfo.emix := emix; 6017 6690 … … 6032 6705 * xxt - MapWidth) < abs(((xFromLoc - xw1) * 2 + yFromLoc and 1 + 1) * xxt 6033 6706 * 2 + dx * xxt - MapWidth) do 6034 dec(xw1, G.lx);6707 Dec(xw1, G.lx); 6035 6708 6036 6709 xTo := (xToLoc - xw1) * (xxt * 2) + yToLoc and 1 * xxt + (xxt - xxu); … … 6040 6713 if xFrom < xTo then begin 6041 6714 xMin := xFrom; 6042 xRange := xTo - xFrom 6715 xRange := xTo - xFrom; 6043 6716 end else begin 6044 6717 xMin := xTo; 6045 xRange := xFrom - xTo 6718 xRange := xFrom - xTo; 6046 6719 end; 6047 6720 if yFrom < yTo then begin 6048 6721 yMin := yFrom; 6049 yRange := yTo - yFrom 6722 yRange := yTo - yFrom; 6050 6723 end else begin 6051 6724 yMin := yTo; 6052 yRange := yFrom - yTo 6053 end; 6054 inc(xRange, xxt * 2);6055 inc(yRange, yyt * 3);6725 yRange := yFrom - yTo; 6726 end; 6727 Inc(xRange, xxt * 2); 6728 Inc(yRange, yyt * 3); 6056 6729 end; 6057 6730 … … 6061 6734 for Step := 0 to abs(Step1 - Step0) do 6062 6735 begin 6063 DpiBit Canvas(Buffer.Canvas, 0, 0, xRange, yRange,6064 offscreen.Canvas, xMin, yMin);6736 DpiBitBltCanvas(Buffer.Canvas, 0, 0, xRange, yRange, 6737 Offscreen.Canvas, xMin, yMin); 6065 6738 if Step1 <> Step0 then 6066 6739 begin … … 6079 6752 NoMap.PaintUnit(xMoving - xMin, yMoving - yMin, UnitInfo, 0); 6080 6753 PaintBufferToScreen(xMin, yMin, xRange, yRange); 6081 {$IFDEF LINUX}6082 // TODO: Force animation under linux6754 {$IFDEF UNIX} 6755 // TODO: Force animation under UNIX 6083 6756 DpiApplication.ProcessMessages; 6084 6757 {$ENDIF} … … 6091 6764 < MoveTime) then 6092 6765 begin 6093 if not idle or (GameMode = cMovie) then6766 if not Idle or (GameMode = cMovie) then 6094 6767 DpiApplication.ProcessMessages; 6095 6768 Sleep(1); 6096 inc(SliceCount)6769 Inc(SliceCount) 6097 6770 end; 6098 6771 Ticks := NowPrecise; 6099 6772 until (((Ticks - Ticks0) * 12) / OneMillisecond) >= MoveTime; 6100 Ticks0 := Ticks 6773 Ticks0 := Ticks; 6101 6774 end; 6102 6775 end; 6103 6776 if Restore then 6104 6777 begin 6105 DpiBit Canvas(Buffer.Canvas, 0, 0, xRange, yRange, offscreen.Canvas, xMin, yMin);6778 DpiBitBltCanvas(Buffer.Canvas, 0, 0, xRange, yRange, Offscreen.Canvas, xMin, yMin); 6106 6779 PaintBufferToScreen(xMin, yMin, xRange, yRange); 6107 6780 end; 6108 6781 BlinkTime := -1; 6109 Timer1.Enabled := true;6110 end; 6111 6112 procedure TMainScreen.MoveToLoc(Loc: integer; CheckSuicide: boolean);6782 Timer1.Enabled := True; 6783 end; 6784 6785 procedure TMainScreen.MoveToLoc(Loc: Integer; CheckSuicide: Boolean); 6113 6786 // path finder: move focused unit to loc, start multi-turn goto if too far 6114 6787 var 6115 uix, i, MoveOptions, NextLoc, MoveResult: integer;6788 uix, I, MoveOptions, NextLoc, MoveResult: Integer; 6116 6789 MoveAdviceData: TMoveAdviceData; 6117 6790 StopReason: (None, Arrived, Dead, NoTime, EnemySpotted, MoveError); 6118 6791 begin 6119 6792 if MyUn[UnFocus].Job > jNone then 6120 Server(sStartJob + jNone shl 4, me, UnFocus, nil^);6793 Server(sStartJob + jNone shl 4, Me, UnFocus, nil^); 6121 6794 if GetMoveAdvice(UnFocus, Loc, MoveAdviceData) >= rExecuted then 6122 6795 begin … … 6124 6797 StopReason := None; 6125 6798 repeat 6126 for i:= 0 to MoveAdviceData.nStep - 1 do6799 for I := 0 to MoveAdviceData.nStep - 1 do 6127 6800 begin 6128 if i= MoveAdviceData.nStep - 1 then6801 if I = MoveAdviceData.nStep - 1 then 6129 6802 MoveOptions := muAutoNext 6130 6803 else 6131 6804 MoveOptions := 0; 6132 NextLoc := dLoc(MyUn[uix].Loc, MoveAdviceData.dx[ i],6133 MoveAdviceData.dy[ i]);6805 NextLoc := dLoc(MyUn[uix].Loc, MoveAdviceData.dx[I], 6806 MoveAdviceData.dy[I]); 6134 6807 if (NextLoc = Loc) or (Loc = maNextCity) and 6135 6808 (MyMap[NextLoc] and fCity <> 0) then … … 6137 6810 if not CheckSuicide and (NextLoc = Loc) then 6138 6811 MoveOptions := MoveOptions or muNoSuicideCheck; 6139 MoveResult := MoveUnit(MoveAdviceData.dx[ i], MoveAdviceData.dy[i],6812 MoveResult := MoveUnit(MoveAdviceData.dx[I], MoveAdviceData.dy[I], 6140 6813 MoveOptions); 6141 6814 if MoveResult < rExecuted then … … 6149 6822 end; 6150 6823 if (StopReason = None) and ((MoveAdviceData.nStep < 25) or 6151 (MyRO.Wonder[woShinkansen].EffectiveOwner <> me)) then6824 (MyRO.Wonder[woShinkansen].EffectiveOwner <> Me)) then 6152 6825 StopReason := NoTime; 6153 6826 if StopReason <> None then … … 6155 6828 if GetMoveAdvice(UnFocus, Loc, MoveAdviceData) < rExecuted then 6156 6829 begin 6157 assert(false);6830 Assert(False); 6158 6831 Break; 6159 6832 end; 6160 until false;6833 until False; 6161 6834 6162 6835 case StopReason of 6163 6836 None: 6164 assert(false);6837 Assert(False); 6165 6838 Arrived: 6166 6839 MyUn[uix].Status := MyUn[uix].Status and ($FFFF - usGoto); 6167 6840 Dead: 6168 6841 if UnFocus < 0 then 6169 NextUnit(UnStartLoc, false);6842 NextUnit(UnStartLoc, False); 6170 6843 else 6171 6844 begin // multi-turn goto … … 6180 6853 begin 6181 6854 MyUn[uix].Status := MyUn[uix].Status and not usWaiting; 6182 NextUnit(UnStartLoc, true);6855 NextUnit(UnStartLoc, True); 6183 6856 end; 6184 6857 end; … … 6188 6861 6189 6862 procedure TMainScreen.PanelBoxMouseDown(Sender: TObject; Button: TMouseButton; 6190 Shift: TShiftState; x, y: integer);6863 Shift: TShiftState; X, Y: Integer); 6191 6864 var 6192 i, xMouse, MouseLoc, p1: integer;6865 I, xMouse, MouseLoc, p1: Integer; 6193 6866 begin 6194 6867 if GameMode = cMovie then 6195 exit;6868 Exit; 6196 6869 6197 6870 if Button = mbLeft then 6198 6871 begin 6199 if ( x >= xMini + 2) and (y >= yMini + 2) and (x< xMini + 2 + 2 * G.lx) and6200 ( y< yMini + 2 + G.ly) then6872 if (X >= xMini + 2) and (Y >= yMini + 2) and (X < xMini + 2 + 2 * G.lx) and 6873 (Y < yMini + 2 + G.ly) then 6201 6874 if ssShift in Shift then 6202 6875 begin 6203 6876 with MainMap do 6204 xMouse := (xwMini + ( x- (xMini + 2) + MapWidth div (xxt * 2) + G.lx)6877 xMouse := (xwMini + (X - (xMini + 2) + MapWidth div (xxt * 2) + G.lx) 6205 6878 div 2) mod G.lx; 6206 MouseLoc := xMouse + G.lx * ( y- (yMini + 2));6879 MouseLoc := xMouse + G.lx * (Y - (yMini + 2)); 6207 6880 if MyMap[MouseLoc] and fTerrain <> fUNKNOWN then 6208 6881 begin 6209 6882 p1 := MyRO.Territory[MouseLoc]; 6210 if (p1 = me) or (p1 >= 0) and (MyRO.Treaty[p1] >= trNone) then6883 if (p1 = Me) or (p1 >= 0) and (MyRO.Treaty[p1] >= trNone) then 6211 6884 NatStatDlg.ShowNewContent(wmPersistent, p1); 6212 6885 end; … … 6218 6891 if UnitStatDlg.Visible then 6219 6892 UnitStatDlg.Close; 6220 Tracking := true;6221 PanelBoxMouseMove(Sender, Shift + [ssLeft], x, y);6893 Tracking := True; 6894 PanelBoxMouseMove(Sender, Shift + [ssLeft], X, Y); 6222 6895 end 6223 else if (ClientMode <> cEditMap) and ( x>= ClientWidth - xPalace) and6224 ( y >= yPalace) and (x< ClientWidth - xPalace + xSizeBig) and6225 ( y< yPalace + ySizeBig) then6896 else if (ClientMode <> cEditMap) and (X >= ClientWidth - xPalace) and 6897 (Y >= yPalace) and (X < ClientWidth - xPalace + xSizeBig) and 6898 (Y < yPalace + ySizeBig) then 6226 6899 begin 6227 6900 InitPopup(StatPopup); … … 6234 6907 DpiGetSystemMetrics(SM_CYCAPTION) + 3) 6235 6908 end 6236 (* else if ( x>=xAdvisor-3) and (y>=yAdvisor-3)6237 and ( x<xAdvisor+16+3) and (y<yAdvisor+16+3) and HaveStrategyAdvice then6909 (* else if (X>=xAdvisor-3) and (Y>=yAdvisor-3) 6910 and (X<xAdvisor+16+3) and (Y<yAdvisor+16+3) and HaveStrategyAdvice then 6238 6911 AdviceBtnClick *) 6239 else if ( x >= xTroop + 1) and (y>= yTroop + 1) and6240 ( x < xTroop + TrRow * TrPitch) and (y<= yTroop + 55) then6912 else if (X >= xTroop + 1) and (Y >= yTroop + 1) and 6913 (X < xTroop + TrRow * TrPitch) and (Y <= yTroop + 55) then 6241 6914 begin 6242 i := (x- xTroop - 1) div TrPitch;6243 if trix[ i] >= 0 then6915 I := (X - xTroop - 1) div TrPitch; 6916 if trix[I] >= 0 then 6244 6917 if ClientMode = cEditMap then 6245 6918 begin 6246 BrushType := trix[ i];6247 PanelPaint 6919 BrushType := trix[I]; 6920 PanelPaint; 6248 6921 end 6249 6922 else if (TroopLoc >= 0) then … … 6252 6925 if ssShift in Shift then 6253 6926 UnitStatDlg.ShowNewContent_OwnModel(wmPersistent, 6254 MyUn[trix[ i]].mix)6255 else if not supervising and (ClientMode < scContact) and6256 ( x - xTroop - 1 - i * TrPitch >= 60 - 20) and (y>= yTroop + 35)6257 and ((MyUn[trix[ i]].Job > jNone) or (MyUn[trix[i]].Status and6927 MyUn[trix[I]].mix) 6928 else if not Supervising and (ClientMode < scContact) and 6929 (X - xTroop - 1 - I * TrPitch >= 60 - 20) and (Y >= yTroop + 35) 6930 and ((MyUn[trix[I]].Job > jNone) or (MyUn[trix[I]].Status and 6258 6931 (usStay or usRecover or usGoto) <> 0)) then 6259 6932 begin // wake up 6260 MyUn[trix[ i]].Status := MyUn[trix[i]].Status and6933 MyUn[trix[I]].Status := MyUn[trix[I]].Status and 6261 6934 ($FFFF - usStay - usRecover - usGoto - usEnhance) or usWaiting; 6262 if MyUn[trix[ i]].Job > jNone then6263 Server(sStartJob + jNone shl 4, me, trix[i], nil^);6935 if MyUn[trix[I]].Job > jNone then 6936 Server(sStartJob + jNone shl 4, Me, trix[I], nil^); 6264 6937 if (UnFocus < 0) and not CityDlg.Visible then 6265 6938 begin 6266 SetUnFocus(trix[ i]);6267 SetTroopLoc(MyUn[trix[ i]].Loc);6939 SetUnFocus(trix[I]); 6940 SetTroopLoc(MyUn[trix[I]].Loc); 6268 6941 FocusOnLoc(TroopLoc, flRepaintPanel) 6269 6942 end … … 6271 6944 begin 6272 6945 if CityDlg.Visible and (CityDlg.RestoreUnFocus < 0) then 6273 CityDlg.RestoreUnFocus := trix[ i];6946 CityDlg.RestoreUnFocus := trix[I]; 6274 6947 PanelPaint; 6275 6948 end … … 6277 6950 else if (ClientMode < scContact) then 6278 6951 begin 6279 if supervising then6280 UnitStatDlg.ShowNewContent_OwnUnit(wmPersistent, trix[ i])6952 if Supervising then 6953 UnitStatDlg.ShowNewContent_OwnUnit(wmPersistent, trix[I]) 6281 6954 else if CityDlg.Visible then 6282 6955 begin … … 6284 6957 CityDlg.Close; 6285 6958 SumCities(TaxSum, ScienceSum); 6286 SetUnFocus(trix[ i]);6959 SetUnFocus(trix[I]); 6287 6960 end 6288 6961 else 6289 6962 begin 6290 DestinationMarkON := false;6963 DestinationMarkON := False; 6291 6964 PaintDestination; 6292 UnFocus := trix[ i];6965 UnFocus := trix[I]; 6293 6966 UnStartLoc := TroopLoc; 6294 6967 BlinkTime := 0; 6295 BlinkON := false;6968 BlinkON := False; 6296 6969 PaintLoc(TroopLoc); 6297 6970 end; 6298 6971 if UnFocus >= 0 then 6299 6972 begin 6300 UnitInfoBtn.Visible := true;6301 UnitBtn.Visible := true;6302 TurnComplete := false;6973 UnitInfoBtn.Visible := True; 6974 UnitBtn.Visible := True; 6975 TurnComplete := False; 6303 6976 EOT.ButtonIndex := eotGray; 6304 6977 end; … … 6307 6980 end; 6308 6981 end 6309 else if Server(sGetUnits, me, TroopLoc, TrCnt) >= rExecuted then6982 else if Server(sGetUnits, Me, TroopLoc, TrCnt) >= rExecuted then 6310 6983 if ssShift in Shift then 6311 6984 UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent, 6312 MyRO.EnemyUn[MyRO.nEnemyUn + trix[ i]].emix) // model info6985 MyRO.EnemyUn[MyRO.nEnemyUn + trix[I]].emix) // model info 6313 6986 else 6314 6987 UnitStatDlg.ShowNewContent_EnemyUnit(wmPersistent, 6315 MyRO.nEnemyUn + trix[ i]); // unit info6316 end; 6317 end; 6318 end; 6319 6320 procedure TMainScreen.SetTroopLoc(Loc: integer);6988 MyRO.nEnemyUn + trix[I]); // unit info 6989 end; 6990 end; 6991 end; 6992 6993 procedure TMainScreen.SetTroopLoc(Loc: Integer); 6321 6994 var 6322 trixFocus, uix, uixDefender: integer;6323 Prio: boolean;6995 trixFocus, uix, uixDefender: Integer; 6996 Prio: Boolean; 6324 6997 begin 6325 6998 TroopLoc := Loc; … … 6333 7006 if MyMap[Loc] and fOwned <> 0 then 6334 7007 begin // count own units here 6335 Server(sGetDefender, me, TroopLoc, uixDefender);6336 for Prio := true downto false do7008 Server(sGetDefender, Me, TroopLoc, uixDefender); 7009 for Prio := True downto False do 6337 7010 for uix := 0 to MyRO.nUn - 1 do 6338 7011 if ((uix = uixDefender) = Prio) and (MyUn[uix].Loc = Loc) then … … 6340 7013 if uix = UnFocus then 6341 7014 trixFocus := TrCnt; 6342 inc(TrCnt);7015 Inc(TrCnt); 6343 7016 end; 6344 7017 end 6345 7018 else // count enemy units here 6346 Server(sGetUnits, me, Loc, TrCnt);7019 Server(sGetUnits, Me, Loc, TrCnt); 6347 7020 if TrCnt = 0 then 6348 7021 sb.Init(0, 1) … … 6355 7028 end; 6356 7029 6357 (* procedure TMainScreen.ShowMoveHint(ToLoc: integer; Force: boolean = false);7030 (* procedure TMainScreen.ShowMoveHint(ToLoc: Integer; Force: Boolean = False); 6358 7031 var 6359 Step,Loc,x0,y0,xs,ys: integer;7032 Step,Loc,x0,y0,xs,ys: Integer; 6360 7033 Info: string; 6361 7034 InfoSize: TSize; … … 6370 7043 MoveAdvice.MoreTurns:=0; 6371 7044 MoveAdvice.MaxHostile_MovementLeft:=MyUn[UnFocus].Health-50; 6372 if Server(sGetMoveAdvice, me,UnFocus,MoveAdvice)<rExecuted then7045 if Server(sGetMoveAdvice,Me,UnFocus,MoveAdvice)<rExecuted then 6373 7046 ToLoc:=-1 6374 7047 end; 6375 if (ToLoc=MoveHintToLoc) and not Force then exit;7048 if (ToLoc=MoveHintToLoc) and not Force then Exit; 6376 7049 if (ToLoc<>MoveHintToLoc) and (MoveHintToLoc>=0) then 6377 7050 begin invalidate; update end; // clear old hint from screen 6378 7051 MoveHintToLoc:=ToLoc; 6379 if ToLoc<0 then exit;6380 6381 with canvas do7052 if ToLoc<0 then Exit; 7053 7054 with Canvas do 6382 7055 begin 6383 7056 Pen.Color:=$80C0FF; … … 6390 7063 xs:=(x0-xw)*66+y0 and 1*33-G.lx*66; 6391 7064 while abs(2*(xs+G.lx*66)-MapWidth)<abs(2*xs-MapWidth) do 6392 inc(xs,G.lx*66);7065 Inc(xs,G.lx*66); 6393 7066 ys:=(y0-yw)*16; 6394 7067 if Step=0 then moveto(xs+33,ys+16) … … 6398 7071 end; 6399 7072 Brush.Color:=$80C0FF; 6400 Info:=' '+ inttostr(88)+' ';7073 Info:=' '+IntToStr(88)+' '; 6401 7074 InfoSize:=TextExtent(Info); 6402 7075 TextOut(xs+33-InfoSize.cx div 2, ys+16-InfoSize.cy div 2, Info); … … 6405 7078 end; *) 6406 7079 6407 procedure TMainScreen.SetDebugMap( p: integer);6408 begin 6409 MainMap.pDebugMap := p;7080 procedure TMainScreen.SetDebugMap(P: Integer); 7081 begin 7082 MainMap.pDebugMap := P; 6410 7083 MapOptions := MapOptions - [moLocCodes]; 6411 mLocCodes.Checked := false;6412 MapValid := false;7084 mLocCodes.Checked := False; 7085 MapValid := False; 6413 7086 MainOffscreenPaint; 6414 7087 end; 6415 7088 6416 procedure TMainScreen.SetViewpoint( p: integer);7089 procedure TMainScreen.SetViewpoint(P: Integer); 6417 7090 var 6418 i: Integer; 6419 begin 6420 if supervising and (G.RO[0].Turn > 0) and 6421 ((p = 0) or (1 shl p and G.RO[0].Alive <> 0)) then 6422 begin 6423 for i := 0 to DpiScreen.FormCount - 1 do 6424 if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) then 6425 DpiScreen.Forms[i].Close; // close windows 6426 ItsMeAgain(p); 7091 I: Integer; 7092 begin 7093 if Supervising and (G.RO[0].Turn > 0) and 7094 ((P = 0) or (1 shl P and G.RO[0].Alive <> 0)) then 7095 begin 7096 ApplyToVisibleForms(faClose); 7097 ItsMeAgain(P); 6427 7098 SumCities(TaxSum, ScienceSum); 6428 for i:= 0 to MyRO.nModel - 1 do6429 if not Assigned(Tribe[ me].ModelPicture[i].HGr) then6430 InitMyModel( i, True);7099 for I := 0 to MyRO.nModel - 1 do 7100 if not Assigned(Tribe[Me].ModelPicture[I].HGr) then 7101 InitMyModel(I, True); 6431 7102 6432 7103 SetTroopLoc(-1); … … 6481 7152 MTrans.ShortCut := BTrans.ShortCut; 6482 7153 mPollution.ShortCut := BPollution.ShortCut; 6483 mR R.ShortCut := BRailRoad.ShortCut;7154 mRailRoad.ShortCut := BRailRoad.ShortCut; 6484 7155 mRoad.ShortCut := BRailRoad.ShortCut; 6485 7156 mUnload.ShortCut := BUnload.ShortCut; … … 6516 7187 end; 6517 7188 6518 procedure TMainScreen.FormKeyDown(Sender: TObject; var Key: word;7189 procedure TMainScreen.FormKeyDown(Sender: TObject; var Key: Word; 6519 7190 Shift: TShiftState); 6520 7191 … … 6523 7194 InitPopup(Popup); 6524 7195 if Item.Visible and Item.Enabled then 6525 MenuClick(Item);6526 end; 6527 6528 procedure SetViewpointMe( p: Integer);6529 begin 6530 if p = me then SetViewpoint(p)6531 else SetViewpoint( p);7196 Item.Click; 7197 end; 7198 7199 procedure SetViewpointMe(P: Integer); 7200 begin 7201 if P = Me then SetViewpoint(P) 7202 else SetViewpoint(P); 6532 7203 end; 6533 7204 … … 6558 7229 6559 7230 if ClientMode = cEditMap then begin 6560 if BResign.Test(ShortCut) then MenuClick(mResign)6561 else if BRandomMap.Test(ShortCut) then MenuClick(mRandomMap)6562 else if BHelp.Test(ShortCut) then MenuClick(mHelp);7231 if BResign.Test(ShortCut) then mResign.Click 7232 else if BRandomMap.Test(ShortCut) then mRandomMap.Click 7233 else if BHelp.Test(ShortCut) then mHelp.Click; 6563 7234 (*if Shift = [ssCtrl] then 6564 7235 case char(Key) of 6565 7236 'A': 6566 7237 begin // auto symmetry 6567 Server($7F0, me,0,nil^);6568 MapValid:= false;7238 Server($7F0,Me,0,nil^); 7239 MapValid:=False; 6569 7240 PaintAll; 6570 7241 end; … … 6573 7244 dy:=0; 6574 7245 for dx:=G.lx to G.lx*(G.ly-1)-1 do 6575 if MyMap[dx] and fTerrain>=fGrass then inc(dy);7246 if MyMap[dx] and fTerrain>=fGrass then Inc(dy); 6576 7247 dy:=dy 6577 7248 end; … … 6586 7257 SetFullScreen(FullScreen); 6587 7258 end 6588 else if BHelp.Test(ShortCut) then MenuClick(mHelp)7259 else if BHelp.Test(ShortCut) then mHelp.Click 6589 7260 else if BUnitStat.Test(ShortCut) then MenuClick_Check(StatPopup, mUnitStat) 6590 7261 else if BCityStat.Test(ShortCut) then MenuClick_Check(StatPopup, mCityStat) … … 6608 7279 else if BSetDebugMap9.Test(ShortCut) then SetDebugMap(9) 6609 7280 6610 else if BJump.Test(ShortCut) then MenuClick(mJump)7281 else if BJump.Test(ShortCut) then mJump.Click 6611 7282 else if BDebugMap.Test(ShortCut) then mShowClick(mDebugMap) 6612 7283 else if BLocCodes.Test(ShortCut) then mShowClick(mLocCodes) … … 6617 7288 else if BNames.Test(ShortCut) then mNamesClick(mNames) 6618 7289 else if BResign.Test(ShortCut) then MenuClick_Check(GamePopup, mResign) 6619 else if BRun.Test(ShortCut) then MenuClick(mRun)7290 else if BRun.Test(ShortCut) then mRun.Click 6620 7291 else if BTestMapRepaint.Test(ShortCut) then begin // test map repaint time 6621 7292 Time0 := NowPrecise; … … 6642 7313 else if BMapBtn5.Test(ShortCut) then MapBtnClick(MapBtn5) 6643 7314 else if BMapBtn6.Test(ShortCut) then MapBtnClick(MapBtn6) 6644 else if BTechTree.Test(ShortCut) then MenuClick(mTechTree)6645 else if BWait.Test(ShortCut) then MenuClick(mWait);7315 else if BTechTree.Test(ShortCut) then mTechTree.Click 7316 else if BWait.Test(ShortCut) then mWait.Click; 6646 7317 6647 7318 if UnFocus >= 0 then begin 6648 if BDisbandUnit.Test(ShortCut) then MenuClick(mDisband)7319 if BDisbandUnit.Test(ShortCut) then mDisband.Click 6649 7320 else if BFortify.Test(ShortCut) then MenuClick_Check(TerrainPopup, mFort) 6650 else if BCenterUnit.Test(ShortCut) then MenuClick(mCentre)6651 else if BStay.Test(ShortCut) then MenuClick(mStay)6652 else if BNoOrders.Test(ShortCut) then MenuClick(mNoOrders)6653 else if BPrevUnit.Test(ShortCut) then MenuClick(mPrevUnit)6654 else if BNextUnit.Test(ShortCut) then MenuClick(mNextUnit)7321 else if BCenterUnit.Test(ShortCut) then mCentre.Click 7322 else if BStay.Test(ShortCut) then mStay.Click 7323 else if BNoOrders.Test(ShortCut) then mNoOrders.Click 7324 else if BPrevUnit.Test(ShortCut) then mPrevUnit.Click 7325 else if BNextUnit.Test(ShortCut) then mNextUnit.Click 6655 7326 else if BCancel.Test(ShortCut) then MenuClick_Check(UnitPopup, mCancel) 6656 7327 else if BPillage.Test(ShortCut) then MenuClick_Check(UnitPopup, mPillage) … … 6660 7331 else if BEnhance.Test(ShortCut) then begin 6661 7332 InitPopup(TerrainPopup); 6662 if mEnhance.Visible and mEnhance.Enabled then MenuClick(mEnhance)6663 else MenuClick(mEnhanceDef)7333 if mEnhance.Visible and mEnhance.Enabled then mEnhance.Click 7334 else mEnhanceDef.Click 6664 7335 end 6665 7336 else if BGoOn.Test(ShortCut) then MenuClick_Check(UnitPopup, mGoOn) … … 6667 7338 else if BFarmClearIrrigation.Test(ShortCut) then begin 6668 7339 if JobTest(UnFocus, jFarm, [eTreaty]) then 6669 MenuClick(mFarm)7340 mFarm.Click 6670 7341 else if JobTest(UnFocus, jClear, [eTreaty]) then 6671 MenuClick(mClear)7342 mClear.Click 6672 7343 else MenuClick_Check(TerrainPopup, mIrrigation); 6673 7344 end 6674 7345 else if BLoad.Test(ShortCut) then MenuClick_Check(UnitPopup, mLoad) 6675 7346 else if BAfforestMine.Test(ShortCut) then begin 6676 if JobTest(UnFocus, jAfforest, [eTreaty]) then MenuClick(mAfforest)7347 if JobTest(UnFocus, jAfforest, [eTreaty]) then mAfforest.Click 6677 7348 else MenuClick_Check(TerrainPopup, mMine); 6678 7349 end … … 6681 7352 else if BPollution.Test(ShortCut) then MenuClick_Check(TerrainPopup, mPollution) 6682 7353 else if BRailRoad.Test(ShortCut) then begin 6683 if JobTest(UnFocus, jRR, [eTreaty]) then MenuClick(mRR)7354 if JobTest(UnFocus, jRR, [eTreaty]) then mRailRoad.Click 6684 7355 else MenuClick_Check(TerrainPopup, mRoad); 6685 7356 end … … 6698 7369 end; 6699 7370 6700 procedure TMainScreen.MenuClick(Sender: TObject); 6701 6702 function DoJob(j0: integer): integer; 6703 var 6704 Loc0, Movement0: integer; 6705 begin 6706 with MyUn[UnFocus] do 7371 function TMainScreen.DoJob(j0: Integer): Integer; 7372 var 7373 Loc0, Movement0: Integer; 7374 begin 7375 with MyUn[UnFocus] do 7376 begin 7377 DestinationMarkON := False; 7378 PaintDestination; 7379 Loc0 := Loc; 7380 Movement0 := Movement; 7381 if j0 < 0 then 7382 Result := ProcessEnhancement(UnFocus, MyData.EnhancementJobs) 7383 // terrain enhancement 7384 else 7385 Result := Server(sStartJob + j0 shl 4, Me, UnFocus, nil^); 7386 if Result >= rExecuted then 6707 7387 begin 6708 DestinationMarkON := false; 6709 PaintDestination; 6710 Loc0 := Loc; 6711 Movement0 := Movement; 6712 if j0 < 0 then 6713 result := ProcessEnhancement(UnFocus, MyData.EnhancementJobs) 6714 // terrain enhancement 6715 else 6716 result := Server(sStartJob + j0 shl 4, me, UnFocus, nil^); 6717 if result >= rExecuted then 7388 if Result = eDied then 7389 UnFocus := -1; 7390 PaintLoc(Loc0); 7391 if UnFocus >= 0 then 6718 7392 begin 6719 if result = eDied then 6720 UnFocus := -1; 6721 PaintLoc(Loc0); 6722 if UnFocus >= 0 then 7393 if (j0 < 0) and (Result <> eJobDone) then 7394 // multi-turn terrain enhancement 7395 Status := Status and ($FFFF - usStay - usRecover - usGoto) or 7396 usEnhance 7397 else 7398 Status := Status and 7399 ($FFFF - usStay - usRecover - usGoto - usEnhance); 7400 if (Job <> jNone) or (Movement0 < 100) then 6723 7401 begin 6724 if (j0 < 0) and (result <> eJobDone) then 6725 // multi-turn terrain enhancement 6726 Status := Status and ($FFFF - usStay - usRecover - usGoto) or 6727 usEnhance 6728 else 6729 Status := Status and 6730 ($FFFF - usStay - usRecover - usGoto - usEnhance); 6731 if (Job <> jNone) or (Movement0 < 100) then 6732 begin 6733 Status := Status and not usWaiting; 6734 NextUnit(UnStartLoc, true); 6735 end 6736 else 6737 PanelPaint; 7402 Status := Status and not usWaiting; 7403 NextUnit(UnStartLoc, True); 6738 7404 end 6739 7405 else 6740 NextUnit(UnStartLoc, true); 6741 end; 6742 end; 6743 case result of 6744 eNoBridgeBuilding: 6745 SoundMessage(Phrases.Lookup('NOBB'), 'INVALID'); 6746 eNoCityTerrain: 6747 SoundMessage(Phrases.Lookup('NOCITY'), 'INVALID'); 6748 eTreaty: 6749 SoundMessage(Tribe[MyRO.Territory[Loc0]].TPhrase('PEACE_NOWORK'), 6750 'NOMOVE_TREATY'); 6751 else 6752 if result < rExecuted then 6753 Play('INVALID') 6754 end; 6755 end; 6756 6757 var 6758 i, uix, NewFocus, Loc0, OldMaster, Destination, cix, cixOldHome, 6759 ServerResult: integer; 6760 AltGovs, RevolutionChanged: boolean; 6761 QueryText: string; 6762 6763 begin 6764 if Sender = mResign then 6765 if ClientMode = cEditMap then 6766 begin 6767 if Edited then 6768 begin 6769 QueryText := Phrases.Lookup('MAP_CLOSE'); 6770 case SimpleQuery(mkYesNoCancel, QueryText, '') of 6771 mrIgnore: 6772 Server(sAbandonMap, me, 0, nil^); 6773 mrOK: 6774 Server(sSaveMap, me, 0, nil^); 6775 end 7406 PanelPaint; 6776 7407 end 6777 7408 else 6778 Server(sAbandonMap, me, 0, nil^) 6779 end 7409 NextUnit(UnStartLoc, True); 7410 end; 7411 end; 7412 case Result of 7413 eNoBridgeBuilding: 7414 SoundMessage(Phrases.Lookup('NOBB'), 'INVALID'); 7415 eNoCityTerrain: 7416 SoundMessage(Phrases.Lookup('NOCITY'), 'INVALID'); 7417 eTreaty: 7418 SoundMessage(Tribe[MyRO.Territory[Loc0]].TPhrase('PEACE_NOWORK'), 7419 'NOMOVE_TREATY'); 7420 else 7421 if Result < rExecuted then 7422 Play('INVALID'); 7423 end; 7424 end; 7425 7426 function TMainScreen.GetBattleDlg: TBattleDlg; 7427 begin 7428 if not Assigned(FBattleDlg) then FBattleDlg := TBattleDlg.Create(nil); 7429 Result := FBattleDlg; 7430 end; 7431 7432 function TMainScreen.GetCityDlg: TCityDlg; 7433 begin 7434 if not Assigned(FCityDlg) then begin 7435 FCityDlg := TCityDlg.Create(nil); 7436 FCityDlg.CheckAge; 7437 end; 7438 Result := FCityDlg; 7439 end; 7440 7441 function TMainScreen.GetCityTypeDlg: TCityTypeDlg; 7442 begin 7443 if not Assigned(FCityTypeDlg) then FCityTypeDlg := TCityTypeDlg.Create(nil); 7444 Result := FCityTypeDlg; 7445 end; 7446 7447 function TMainScreen.GetDiaDlg: TDiaDlg; 7448 begin 7449 if not Assigned(FDiaDlg) then begin 7450 FDiaDlg := TDiaDlg.Create(nil); 7451 ArrangeDialog(FDiaDlg); 7452 end; 7453 Result := FDiaDlg; 7454 end; 7455 7456 function TMainScreen.GetDraftDlg: TDraftDlg; 7457 begin 7458 if not Assigned(FDraftDlg) then FDraftDlg := TDraftDlg.Create(nil); 7459 Result := FDraftDlg; 7460 end; 7461 7462 function TMainScreen.GetEnhanceDlg: TEnhanceDlg; 7463 begin 7464 if not Assigned(FEnhanceDlg) then FEnhanceDlg := TEnhanceDlg.Create(nil); 7465 Result := FEnhanceDlg; 7466 end; 7467 7468 function TMainScreen.GetHelpDlg: THelpDlg; 7469 begin 7470 if not Assigned(FHelpDlg) then begin 7471 FHelpDlg := THelpDlg.Create(nil); 7472 ArrangeDialog(FHelpDlg); 7473 FHelpDlg.Difficulty := G.Difficulty[Me]; 7474 end; 7475 Result := FHelpDlg; 7476 end; 7477 7478 function TMainScreen.GetListDlg: TListDlg; 7479 begin 7480 if not Assigned(FListDlg) then begin 7481 FListDlg := TListDlg.Create(nil); 7482 ArrangeDialog(FListDlg); 7483 end; 7484 Result := FListDlg; 7485 end; 7486 7487 function TMainScreen.GetMessgExDlg: TMessgExDlg; 7488 begin 7489 if not Assigned(FMessgExDlg) then FMessgExDlg := TMessgExDlg.Create(nil); 7490 Result := FMessgExDlg; 7491 end; 7492 7493 function TMainScreen.GetModalSelectDlg: TModalSelectDlg; 7494 begin 7495 if not Assigned(FModalSelectDlg) then FModalSelectDlg := TModalSelectDlg.Create(nil); 7496 Result := FModalSelectDlg; 7497 end; 7498 7499 function TMainScreen.GetNatStatDlg: TNatStatDlg; 7500 begin 7501 if not Assigned(FNatStatDlg) then begin 7502 FNatStatDlg := TNatStatDlg.Create(nil); 7503 ArrangeDialog(FNatStatDlg); 7504 FNatStatDlg.CheckAge; 7505 end; 7506 Result := FNatStatDlg; 7507 end; 7508 7509 function TMainScreen.GetNegoDlg: TNegoDlg; 7510 begin 7511 if not Assigned(FNegoDlg) then FNegoDlg := TNegoDlg.Create(nil); 7512 Result := FNegoDlg; 7513 end; 7514 7515 function TMainScreen.GetRatesDlg: TRatesDlg; 7516 begin 7517 if not Assigned(FRatesDlg) then begin 7518 //FRatesDlg := TRatesDlg.Create(nil); 7519 DpiApplication.CreateForm(TRatesDlg, FRatesDlg); 7520 FRatesDlg.Show; 7521 end; 7522 Result := FRatesDlg; 7523 end; 7524 7525 function TMainScreen.GetTechTreeDlg: TTechTreeDlg; 7526 begin 7527 if not Assigned(FTechTreeDlg) then FTechTreeDlg := TTechTreeDlg.Create(nil); 7528 Result := FTechTreeDlg; 7529 end; 7530 7531 procedure TMainScreen.mDisbandOrUtilizeClick(Sender: TObject); 7532 var 7533 Loc0: Integer; 7534 begin 7535 if UnFocus >= 0 then 7536 with TUn(MyUn[UnFocus]) do begin 7537 if (Sender = mUtilize) and 7538 not(Server(sRemoveUnit - sExecute, Me, UnFocus, nil^) = eUtilized) then 7539 begin 7540 SimpleMessage(Phrases2.Lookup('SHIP_UTILIZE')); 7541 // freight for colony ship is the only case in which the command is 7542 // available to player though not valid 7543 Exit; 7544 end; 7545 if (Sender = mUtilize) and (Health < 100) then 7546 if SimpleQuery(mkYesNo, Phrases.Lookup('DAMAGED_UTILIZE'), '') <> mrOK 7547 then 7548 Exit; 7549 Loc0 := Loc; 7550 CityOptimizer_BeforeRemoveUnit(UnFocus); 7551 if Server(sRemoveUnit, Me, UnFocus, nil^) = eUtilized then 7552 Play('CITY_UTILIZE') 6780 7553 else 6781 begin 6782 if Server(sGetGameChanged, 0, 0, nil^) = eOK then 6783 begin 6784 QueryText := Phrases.Lookup('RESIGN'); 6785 case SimpleQuery(mkYesNoCancel, QueryText, '') of 6786 mrIgnore: 6787 Server(sResign, 0, 0, nil^); 6788 mrOK: 6789 Server(sBreak, 0, 0, nil^) 6790 end 6791 end 6792 else 6793 Server(sResign, 0, 0, nil^) 6794 end 6795 else if Sender = mEmpire then 6796 RatesDlg.ShowNewContent(wmPersistent) 6797 else if Sender = mRevolution then 6798 begin 6799 AltGovs := false; 6800 for i := 2 to nGov - 1 do 6801 if (GovPreq[i] <> preNA) and 6802 ((GovPreq[i] = preNone) or (MyRO.Tech[GovPreq[i]] >= tsApplicable)) then 6803 AltGovs := true; 6804 6805 if not AltGovs then 6806 SoundMessage(Phrases.Lookup('NOALTGOVS'), 'MSG_DEFAULT') 6807 else 6808 begin 6809 RevolutionChanged := false; 6810 if MyRO.Happened and phChangeGov <> 0 then 6811 begin 6812 ModalSelectDlg.ShowNewContent(wmModal, kGov); 6813 if ModalSelectDlg.result >= 0 then 6814 begin 6815 Play('NEWGOV'); 6816 Server(sSetGovernment, me, ModalSelectDlg.result, nil^); 6817 CityOptimizer_BeginOfTurn; 6818 RevolutionChanged := true; 6819 end 6820 end 6821 else 6822 with MessgExDlg do 6823 begin // revolution! 6824 MessgExDlg.MessgText := Tribe[me].TPhrase('REVOLUTION'); 6825 MessgExDlg.Kind := mkYesNo; 6826 MessgExDlg.IconKind := mikPureIcon; 6827 MessgExDlg.IconIndex := 72; // anarchy palace 6828 MessgExDlg.ShowModal; 6829 if ModalResult = mrOK then 6830 begin 6831 Play('REVOLUTION'); 6832 Server(sRevolution, me, 0, nil^); 6833 RevolutionChanged := true; 6834 if NatStatDlg.Visible then 6835 NatStatDlg.Close; 6836 if CityDlg.Visible then 6837 CityDlg.Close; 6838 end 6839 end; 6840 if RevolutionChanged then 6841 UpdateViews(true); 6842 end 6843 end 6844 else if Sender = mWebsite then 6845 OpenURL(CevoHomepage) 6846 else if Sender = mRandomMap then 6847 begin 6848 if not Edited or (SimpleQuery(mkYesNo, Phrases.Lookup('MAP_RANDOM'), '') 6849 = mrOK) then 6850 begin 6851 Server(sRandomMap, me, 0, nil^); 6852 Edited := true; 6853 MapValid := false; 6854 PaintAllMaps; 6855 end 6856 end 6857 else if Sender = mJump then 6858 begin 6859 if supervising then 6860 Jump[0] := 20 6861 else 6862 Jump[me] := 20; 6863 EndTurn(true); 6864 end 6865 else if Sender = mRun then 6866 begin 6867 if supervising then 6868 Jump[0] := 999999 6869 else 6870 Jump[me] := 999999; 6871 EndTurn(true); 6872 end 6873 else if Sender = mEnhanceDef then 6874 begin 6875 if UnFocus >= 0 then 6876 EnhanceDlg.ShowNewContent(wmPersistent, 6877 MyMap[MyUn[UnFocus].Loc] and fTerrain) 6878 else 6879 EnhanceDlg.ShowNewContent(wmPersistent) 6880 end 6881 else if Sender = mCityTypes then 6882 CityTypeDlg.ShowNewContent(wmModal) 6883 // must be modal because types are not saved before closing 6884 else if Sender = mUnitStat then 6885 begin 6886 if G.Difficulty[me] > 0 then 6887 ListDlg.ShowNewContent_MilReport(wmPersistent, me) 6888 else 6889 begin 6890 i := 1; 6891 while (i < nPl) and (1 shl i and MyRO.Alive = 0) do 6892 inc(i); 6893 if i < nPl then 6894 ListDlg.ShowNewContent_MilReport(wmPersistent, i); 6895 end; 6896 end 6897 else if Sender = mEUnitStat then 6898 begin 6899 if MyRO.nEnemyModel > 0 then 6900 ListDlg.ShowNewContent(wmPersistent, kAllEModels); 6901 end 6902 else if Sender = mCityStat then 6903 ListDlg.ShowNewContent(wmPersistent, kCities) 6904 else if Sender = mScienceStat then 6905 ListDlg.ShowNewContent(wmPersistent, kScience) 6906 else if Sender = mNations then 6907 NatStatDlg.ShowNewContent(wmPersistent) 6908 else if Sender = mHelp then 6909 if ClientMode = cEditMap then 6910 HelpDlg.ShowNewContent(wmPersistent, hkText, HelpDlg.TextIndex('MAPEDIT')) 6911 else 6912 HelpDlg.ShowNewContent(wmPersistent, hkMisc, miscMain) 6913 else if Sender = mTechTree then 6914 TechTreeDlg.ShowModal 6915 else if Sender = mWonders then 6916 WondersDlg.ShowNewContent(wmPersistent) 6917 else if Sender = mDiagram then 6918 DiaDlg.ShowNewContent_Charts(wmPersistent) 6919 else if Sender = mShips then 6920 DiaDlg.ShowNewContent_Ship(wmPersistent) 6921 else if Sender = mWait then 6922 begin 6923 if UnFocus >= 0 then 6924 begin 6925 DestinationMarkON := false; 6926 PaintDestination; 6927 MyUn[UnFocus].Status := MyUn[UnFocus].Status and 6928 ($FFFF - usStay - usRecover - usGoto - usEnhance) or usWaiting; 6929 end; 6930 NextUnit(-1, false); 6931 end 6932 else if UnFocus >= 0 then 6933 with TUn(MyUn[UnFocus]) do 6934 if Sender = mGoOn then 6935 begin 6936 if Status shr 16 = $7FFF then 6937 Destination := maNextCity 6938 else 6939 Destination := Status shr 16; 6940 Status := Status and not(usStay or usRecover) or usWaiting; 6941 MoveToLoc(Destination, true); 6942 end 6943 else if Sender = mHome then 6944 if MyMap[Loc] and fCity <> 0 then 6945 begin 6946 cixOldHome := Home; 6947 if Server(sSetUnitHome, me, UnFocus, nil^) >= rExecuted then 6948 begin 6949 CityOptimizer_CityChange(cixOldHome); 6950 CityOptimizer_CityChange(Home); 6951 UpdateViews(true); 6952 end 6953 else 6954 Play('INVALID'); 6955 end 6956 else 6957 begin 6958 Status := Status and not(usStay or usRecover or usEnhance); 6959 MoveToLoc(maNextCity, true) 6960 end 6961 else if Sender = mCentre then 6962 begin 6963 Centre(Loc); 6964 PaintAllMaps; 6965 end 6966 else if Sender = mCity then 6967 begin 6968 Loc0 := Loc; 6969 if MyMap[Loc] and fCity = 0 then 6970 begin // build city 6971 if DoJob(jCity) = eCity then 6972 begin 6973 MapValid := false; 6974 PaintAll; 6975 ZoomToCity(Loc0, true, chFounded); 6976 end; 6977 end 6978 else 6979 begin 6980 CityOptimizer_BeforeRemoveUnit(UnFocus); 6981 ServerResult := Server(sAddToCity, me, UnFocus, nil^); 6982 if ServerResult >= rExecuted then 6983 begin 6984 cix := MyRO.nCity - 1; 6985 while (cix >= 0) and (MyCity[cix].Loc <> Loc0) do 6986 dec(cix); 6987 assert(cix >= 0); 6988 CityOptimizer_CityChange(cix); 6989 CityOptimizer_AfterRemoveUnit; // does nothing here 6990 SetTroopLoc(Loc0); 6991 UpdateViews(true); 6992 DestinationMarkON := false; 6993 PaintDestination; 6994 UnFocus := -1; 6995 PaintLoc(Loc0); 6996 NextUnit(UnStartLoc, true); 6997 end 6998 else if ServerResult = eMaxSize then 6999 SimpleMessage(Phrases.Lookup('ADDTOMAXSIZE')); 7000 end 7001 end 7002 else if Sender = mRoad then 7003 DoJob(jRoad) 7004 else if Sender = mRR then 7005 DoJob(jRR) 7006 else if Sender = mClear then 7007 DoJob(jClear) 7008 else if Sender = mIrrigation then 7009 DoJob(jIrr) 7010 else if Sender = mFarm then 7011 DoJob(jFarm) 7012 else if Sender = mAfforest then 7013 DoJob(jAfforest) 7014 else if Sender = mMine then 7015 DoJob(jMine) 7016 else if Sender = mCanal then 7017 DoJob(jCanal) 7018 else if Sender = MTrans then 7019 DoJob(jTrans) 7020 else if Sender = mFort then 7021 DoJob(jFort) 7022 else if Sender = mAirBase then 7023 DoJob(jBase) 7024 else if Sender = mPollution then 7025 DoJob(jPoll) 7026 else if Sender = mPillage then 7027 DoJob(jPillage) 7028 else if Sender = mEnhance then 7029 DoJob(-1) 7030 else if Sender = mStay then 7031 begin 7032 DestinationMarkON := false; 7033 PaintDestination; 7034 Status := Status and ($FFFF - usRecover - usGoto - usEnhance) or usStay; 7035 if Job > jNone then 7036 Server(sStartJob + jNone shl 4, me, UnFocus, nil^); 7037 NextUnit(UnStartLoc, true); 7038 end 7039 else if Sender = mRecover then 7040 begin 7041 DestinationMarkON := false; 7042 PaintDestination; 7043 Status := Status and ($FFFF - usStay - usGoto - usEnhance) or usRecover; 7044 if Job > jNone then 7045 Server(sStartJob + jNone shl 4, me, UnFocus, nil^); 7046 NextUnit(UnStartLoc, true); 7047 end 7048 else if Sender = mNoOrders then 7049 begin 7050 Status := Status and not usWaiting; 7051 NextUnit(UnStartLoc, true); 7052 end 7053 else if Sender = mPrevUnit then 7054 begin 7055 Status := Status and not usWaiting; 7056 FocusNextUnit(-1); 7057 end 7058 else if Sender = mNextUnit then 7059 begin 7060 Status := Status and not usWaiting; 7061 FocusNextUnit(1); 7062 end 7063 else if Sender = mCancel then 7064 begin 7065 DestinationMarkON := false; 7066 PaintDestination; 7067 Status := Status and ($FFFF - usRecover - usGoto - usEnhance); 7068 if Job > jNone then 7069 Server(sStartJob + jNone shl 4, me, UnFocus, nil^); 7070 end 7071 else if (Sender = mDisband) or (Sender = mUtilize) then 7072 begin 7073 if (Sender = mUtilize) and 7074 not(Server(sRemoveUnit - sExecute, me, UnFocus, nil^) = eUtilized) 7075 then 7076 begin 7077 SimpleMessage(Phrases2.Lookup('SHIP_UTILIZE')); 7078 // freight for colony ship is the only case in which the command is 7079 // available to player though not valid 7080 exit 7081 end; 7082 if (Sender = mUtilize) and (Health < 100) then 7083 if SimpleQuery(mkYesNo, Phrases.Lookup('DAMAGED_UTILIZE'), '') <> mrOK 7084 then 7085 exit; 7086 Loc0 := Loc; 7087 CityOptimizer_BeforeRemoveUnit(UnFocus); 7088 if Server(sRemoveUnit, me, UnFocus, nil^) = eUtilized then 7089 Play('CITY_UTILIZE') 7090 else 7091 Play('DISBAND'); 7092 CityOptimizer_AfterRemoveUnit; 7093 SetTroopLoc(Loc0); 7094 UpdateViews(true); 7095 DestinationMarkON := false; 7096 PaintDestination; 7097 UnFocus := -1; 7098 PaintLoc(Loc0); 7099 NextUnit(UnStartLoc, true); 7100 end 7101 else if Sender = mLoad then 7102 begin 7103 i := Server(sLoadUnit, me, UnFocus, nil^); 7104 if i >= rExecuted then 7105 begin 7106 if MyModel[mix].Domain = dAir then 7107 Play('MOVE_PLANELANDING') 7108 else 7109 Play('MOVE_LOAD'); 7110 DestinationMarkON := false; 7111 PaintDestination; 7112 Status := Status and ($FFFF - usWaiting - usStay - usRecover - usGoto 7113 - usEnhance); 7114 NextUnit(UnStartLoc, true); 7115 end 7116 else if i = eNoTime_Load then 7117 if MyModel[mix].Domain = dAir then 7118 SoundMessage(Phrases.Lookup('NOTIMELOADAIR'), 'NOMOVE_TIME') 7119 else 7120 SoundMessage(Format(Phrases.Lookup('NOTIMELOADGROUND'), 7121 [MovementToString(MyModel[mix].speed)]), 'NOMOVE_TIME'); 7122 end 7123 else if Sender = mUnload then 7124 if Master >= 0 then 7125 begin 7126 OldMaster := Master; 7127 i := Server(sUnloadUnit, me, UnFocus, nil^); 7128 if i >= rExecuted then 7129 begin 7130 if MyModel[mix].Domain = dAir then 7131 Play('MOVE_PLANESTART') 7132 else if (MyModel[MyUn[OldMaster].mix].Domain = dAir) and 7133 (MyMap[Loc] and fCity = 0) and (MyMap[Loc] and fTerImp <> tiBase) 7134 then 7135 Play('MOVE_PARACHUTE') 7136 else 7137 Play('MOVE_UNLOAD'); 7138 Status := Status and not usWaiting; 7139 if MyModel[mix].Domain <> dAir then 7140 NextUnit(Loc, true) 7141 else 7142 PanelPaint; 7143 end 7144 else if i = eNoTime_Load then 7145 if MyModel[mix].Domain = dAir then 7146 SoundMessage(Phrases.Lookup('NOTIMELOADAIR'), 'NOMOVE_TIME') 7147 else 7148 SoundMessage(Format(Phrases.Lookup('NOTIMELOADGROUND'), 7149 [MovementToString(MyModel[mix].speed)]), 'NOMOVE_TIME'); 7150 end 7151 else 7152 begin 7153 NewFocus := -1; 7154 uix := UnFocus; 7155 for i := 1 to MyRO.nUn - 1 do 7156 begin 7157 uix := (uix + MyRO.nUn - 1) mod MyRO.nUn; 7158 if (MyUn[uix].Master = UnFocus) and 7159 (MyUn[uix].Movement = integer(MyModel[MyUn[uix].mix].speed)) then 7160 begin 7161 MyUn[uix].Status := MyUn[uix].Status or usWaiting; 7162 NewFocus := uix 7163 end; 7164 end; 7165 if NewFocus >= 0 then 7166 begin 7167 SetUnFocus(NewFocus); 7168 SetTroopLoc(Loc); 7169 PanelPaint 7170 end; 7171 end 7172 else if Sender = mSelectTransport then 7173 Server(sSelectTransport, me, UnFocus, nil^) 7554 Play('DISBAND'); 7555 CityOptimizer_AfterRemoveUnit; 7556 SetTroopLoc(Loc0); 7557 UpdateViews(True); 7558 DestinationMarkON := False; 7559 PaintDestination; 7560 UnFocus := -1; 7561 PaintLoc(Loc0); 7562 NextUnit(UnStartLoc, True); 7563 end; 7174 7564 end; 7175 7565 7176 7566 procedure TMainScreen.InitPopup(Popup: TDpiPopupMenu); 7177 7567 var 7178 i, p1, Tile, Test: integer;7179 NoSuper, extended, Multi, NeedSep, HaveCities: boolean;7180 LastSep, m: TDpiMenuItem;7568 I, p1, Tile, Test: Integer; 7569 NoSuper, Extended, Multi, NeedSep, HaveCities: Boolean; 7570 LastSep, M: TDpiMenuItem; 7181 7571 mox: ^TModel; 7182 7572 begin 7183 NoSuper := not supervising and (1 shl me and MyRO.Alive <> 0);7184 HaveCities := false;7185 for i:= 0 to MyRO.nCity - 1 do7186 if MyCity[ i].Loc >= 0 then7573 NoSuper := not Supervising and (1 shl Me and MyRO.Alive <> 0); 7574 HaveCities := False; 7575 for I := 0 to MyRO.nCity - 1 do 7576 if MyCity[I].Loc >= 0 then 7187 7577 begin 7188 HaveCities := true;7578 HaveCities := True; 7189 7579 Break; 7190 7580 end; … … 7192 7582 begin 7193 7583 mTechTree.Visible := ClientMode <> cEditMap; 7194 mResign.Enabled := supervising or (me = 0) and (ClientMode < scContact);7584 mResign.Enabled := Supervising or (Me = 0) and (ClientMode < scContact); 7195 7585 mRandomMap.Visible := (ClientMode = cEditMap) and 7196 (Server(sMapGeneratorRequest, me, 0, nil^) = eOK);7586 (Server(sMapGeneratorRequest, Me, 0, nil^) = eOK); 7197 7587 mOptions.Visible := ClientMode <> cEditMap; 7198 7588 mManip.Visible := ClientMode <> cEditMap; … … 7208 7598 case SoundMode of 7209 7599 smOff: 7210 mSoundOff.Checked := true;7600 mSoundOff.Checked := True; 7211 7601 smOn: 7212 mSoundOn.Checked := true;7602 mSoundOn.Checked := True; 7213 7603 smOnAlt: 7214 mSoundOnAlt.Checked := true;7215 end; 7216 7217 for i:= 0 to nTestFlags - 1 do7218 mManip[ i].Checked := MyRO.TestFlags and (1 shl i) <> 0;7219 mManip.Enabled := supervising or (me = 0);7220 7221 Multi := false;7604 mSoundOnAlt.Checked := True; 7605 end; 7606 7607 for I := 0 to nTestFlags - 1 do 7608 mManip[I].Checked := MyRO.TestFlags and (1 shl I) <> 0; 7609 mManip.Enabled := Supervising or (Me = 0); 7610 7611 Multi := False; 7222 7612 for p1 := 1 to nPl - 1 do 7223 7613 if G.RO[p1] <> nil then 7224 Multi := true;7614 Multi := True; 7225 7615 mEnemyMovement.Visible := not Multi; 7226 7616 end; … … 7228 7618 if NoSuper and (ClientMode < scContact) then 7229 7619 begin 7230 mCityTypes.Enabled := false;7620 mCityTypes.Enabled := False; 7231 7621 // check if city types already usefull: 7232 7622 if MyRO.nCity > 0 then 7233 for i:= nWonder to nImp - 1 do7234 if ( i <> imTrGoods) and (Imp[i].Kind = ikCommon) and7235 (Imp[ i].Preq <> preNA) and7236 ((Imp[ i].Preq = preNone) or (MyRO.Tech[Imp[i].Preq] >= tsApplicable))7623 for I := nWonder to nImp - 1 do 7624 if (I <> imTrGoods) and (Imp[I].Kind = ikCommon) and 7625 (Imp[I].Preq <> preNA) and 7626 ((Imp[I].Preq = preNone) or (MyRO.Tech[Imp[I].Preq] >= tsApplicable)) 7237 7627 then 7238 7628 begin 7239 mCityTypes.Enabled := true;7629 mCityTypes.Enabled := True; 7240 7630 Break 7241 7631 end; 7242 7632 end; 7243 mViewpoint.Visible := (ClientMode <> cEditMap) and supervising;7633 mViewpoint.Visible := (ClientMode <> cEditMap) and Supervising; 7244 7634 mViewpoint.Enabled := G.RO[0].Turn > 0; 7245 if supervising then7635 if Supervising then 7246 7636 begin 7247 7637 EmptyMenu(mViewpoint); … … 7249 7639 if (p1 = 0) or (1 shl p1 and G.RO[0].Alive <> 0) then 7250 7640 begin 7251 m:= TDpiMenuItem.Create(mViewpoint);7641 M := TDpiMenuItem.Create(mViewpoint); 7252 7642 if p1 = 0 then 7253 m.Caption := Phrases.Lookup('SUPER')7643 M.Caption := Phrases.Lookup('SUPER') 7254 7644 else 7255 m.Caption := Tribe[p1].TString(Phrases2.Lookup('BELONG'));7256 m.Tag := p1;7257 m.OnClick := ViewpointClick;7645 M.Caption := Tribe[p1].TString(Phrases2.Lookup('BELONG')); 7646 M.Tag := p1; 7647 M.OnClick := ViewpointClick; 7258 7648 if p1 < 10 then 7259 m.ShortCut := ShortCut(48 + p1, [ssCtrl]);7260 m.RadioItem := true;7261 if p1 = me then7262 m.Checked := true;7263 mViewpoint.Add( m);7649 M.ShortCut := ShortCut(48 + p1, [ssCtrl]); 7650 M.RadioItem := True; 7651 if p1 = Me then 7652 M.Checked := True; 7653 mViewpoint.Add(M); 7264 7654 end 7265 7655 end; 7266 mDebugMap.Visible := (ClientMode <> cEditMap) and supervising;7267 if supervising then7656 mDebugMap.Visible := (ClientMode <> cEditMap) and Supervising; 7657 if Supervising then 7268 7658 begin 7269 7659 EmptyMenu(mDebugMap); … … 7271 7661 if (p1 = 0) or (1 shl p1 and G.RO[0].Alive <> 0) then 7272 7662 begin 7273 m:= TDpiMenuItem.Create(mDebugMap);7663 M := TDpiMenuItem.Create(mDebugMap); 7274 7664 if p1 = 0 then 7275 m.Caption := Phrases2.Lookup('MENU_DEBUGMAPOFF')7665 M.Caption := Phrases2.Lookup('MENU_DEBUGMAPOFF') 7276 7666 else 7277 m.Caption := Tribe[p1].TString(Phrases2.Lookup('BELONG'));7667 M.Caption := Tribe[p1].TString(Phrases2.Lookup('BELONG')); 7278 7668 if p1 = 0 then 7279 m.Tag := -17669 M.Tag := -1 7280 7670 else 7281 m.Tag := p1;7282 m.OnClick := DebugMapClick;7671 M.Tag := p1; 7672 M.OnClick := DebugMapClick; 7283 7673 if p1 < 10 then 7284 m.ShortCut := ShortCut(48 + p1, [ssAlt]);7285 m.RadioItem := true;7286 if m.Tag = MainMap.pDebugMap then7287 m.Checked := true;7288 mDebugMap.Add( m);7674 M.ShortCut := ShortCut(48 + p1, [ssAlt]); 7675 M.RadioItem := True; 7676 if M.Tag = MainMap.pDebugMap then 7677 M.Checked := True; 7678 mDebugMap.Add(M); 7289 7679 end; 7290 7680 end; … … 7301 7691 (ClientMode < scContact); 7302 7692 mUnitStat.Enabled := NoSuper or (MyRO.Turn > 0); 7303 mCityStat.Visible := 1 shl me and MyRO.Alive <> 0;7693 mCityStat.Visible := 1 shl Me and MyRO.Alive <> 0; 7304 7694 mCityStat.Enabled := HaveCities; 7305 mScienceStat.Visible := true;7695 mScienceStat.Visible := True; 7306 7696 mScienceStat.Enabled := not NoSuper or (MyRO.ResearchTech >= 0) or 7307 7697 (MyRO.Happened and phTech <> 0) or (MyRO.Happened and phGameEnd <> 0) … … 7310 7700 mEUnitStat.Enabled := MyRO.nEnemyModel > 0; 7311 7701 { mWonders.Enabled:= false; 7312 for i:=0 to nWonder - 1 do if MyRO.Wonder[i].CityID <> WonderNotBuiltYet then7313 mWonders.Enabled:= true; }7702 for I:=0 to nWonder - 1 do if MyRO.Wonder[I].CityID <> WonderNotBuiltYet then 7703 mWonders.Enabled:=True; } 7314 7704 mDiagram.Enabled := MyRO.Turn >= 2; 7315 mShips.Enabled := false;7705 mShips.Enabled := False; 7316 7706 for p1 := 0 to nPl - 1 do 7317 7707 if MyRO.Ship[p1].Parts[spComp] + MyRO.Ship[p1].Parts[spPow] + 7318 7708 MyRO.Ship[p1].Parts[spHab] > 0 then 7319 mShips.Enabled := true;7709 mShips.Enabled := True; 7320 7710 end 7321 7711 else if Popup = UnitPopup then … … 7323 7713 mox := @MyModel[MyUn[UnFocus].mix]; 7324 7714 Tile := MyMap[MyUn[UnFocus].Loc]; 7325 extended := Tile and fCity = 0;7326 if extended then7715 Extended := Tile and fCity = 0; 7716 if Extended then 7327 7717 begin 7328 7718 mCity.Caption := Phrases.Lookup('BTN_FOUND'); … … 7335 7725 end; 7336 7726 7337 extended := extended and ((mox.Kind = mkSettler) or (mox.Kind = mkSlaves)7727 Extended := Extended and ((mox.Kind = mkSettler) or (mox.Kind = mkSlaves) 7338 7728 and (MyRO.Wonder[woPyramids].EffectiveOwner >= 0)) and 7339 7729 (MyUn[UnFocus].Master < 0) and (Tile and fDeadLands = 0); 7340 7730 if (mox.Kind = mkFreight) and (Tile and fCity <> 0) and 7341 7731 not Phrases2FallenBackToEnglish or 7342 (Server(sRemoveUnit - sExecute, me, UnFocus, nil^) = eUtilized) then7732 (Server(sRemoveUnit - sExecute, Me, UnFocus, nil^) = eUtilized) then 7343 7733 begin 7344 mDisband.Visible := false;7345 mUtilize.Visible := true;7734 mDisband.Visible := False; 7735 mUtilize.Visible := True; 7346 7736 if mox.Kind = mkFreight then 7347 7737 mUtilize.Caption := Phrases.Lookup('UTILIZE') … … 7351 7741 else 7352 7742 begin 7353 mDisband.Visible := true;7354 mUtilize.Visible := false7743 mDisband.Visible := True; 7744 mUtilize.Visible := False 7355 7745 end; 7356 7746 mGoOn.Visible := MyUn[UnFocus].Status and (usGoto or usWaiting) = usGoto or … … 7359 7749 mRecover.Visible := (MyUn[UnFocus].Health < 100) and 7360 7750 (Tile and fTerrain >= fGrass) and 7361 ((MyRO.Wonder[woGardens].EffectiveOwner = me) or7751 ((MyRO.Wonder[woGardens].EffectiveOwner = Me) or 7362 7752 (Tile and fTerrain <> fArctic) and (Tile and fTerrain <> fDesert)) and 7363 7753 not((mox.Domain = dAir) and (Tile and fCity = 0) and … … 7365 7755 mStay.Visible := not((mox.Domain = dAir) and (Tile and fCity = 0) and 7366 7756 (Tile and fTerImp <> tiBase)); 7367 mCity.Visible := extended and (mox.Kind = mkSettler) or7757 mCity.Visible := Extended and (mox.Kind = mkSettler) or 7368 7758 (Tile and fCity <> 0) and ((mox.Kind in [mkSettler, mkSlaves]) or 7369 7759 (MyUn[UnFocus].Flags and unConscripts <> 0)); … … 7373 7763 (MyUn[UnFocus].Status and (usRecover or usGoto) <> 0); 7374 7764 7375 Test := Server(sLoadUnit - sExecute, me, UnFocus, nil^);7765 Test := Server(sLoadUnit - sExecute, Me, UnFocus, nil^); 7376 7766 mLoad.Visible := (Test >= rExecuted) or (Test = eNoTime_Load); 7377 7767 mUnload.Visible := (MyUn[UnFocus].Master >= 0) or 7378 7768 (MyUn[UnFocus].TroopLoad + MyUn[UnFocus].AirLoad > 0); 7379 mSelectTransport.Visible := Server(sSelectTransport - sExecute, me, UnFocus,7769 mSelectTransport.Visible := Server(sSelectTransport - sExecute, Me, UnFocus, 7380 7770 nil^) >= rExecuted; 7381 7771 end … … 7384 7774 mox := @MyModel[MyUn[UnFocus].mix]; 7385 7775 Tile := MyMap[MyUn[UnFocus].Loc]; 7386 extended := Tile and fCity = 0;7776 Extended := Tile and fCity = 0; 7387 7777 7388 7778 if (Tile and fRiver <> 0) and (MyRO.Tech[adBridgeBuilding] >= tsApplicable) … … 7390 7780 begin 7391 7781 mRoad.Caption := Phrases.Lookup('BTN_BUILDBRIDGE'); 7392 mR R.Caption := Phrases.Lookup('BTN_BUILDRRBRIDGE');7782 mRailRoad.Caption := Phrases.Lookup('BTN_BUILDRRBRIDGE'); 7393 7783 end 7394 7784 else 7395 7785 begin 7396 7786 mRoad.Caption := Phrases.Lookup('BTN_BUILDROAD'); 7397 mR R.Caption := Phrases.Lookup('BTN_BUILDRR');7787 mRailRoad.Caption := Phrases.Lookup('BTN_BUILDRR'); 7398 7788 end; 7399 7789 if Tile and fTerrain = fForest then … … 7404 7794 mClear.Caption := Phrases.Lookup('BTN_DRAIN'); 7405 7795 7406 extended := extended and ((mox.Kind = mkSettler) or (mox.Kind = mkSlaves)7796 Extended := Extended and ((mox.Kind = mkSettler) or (mox.Kind = mkSlaves) 7407 7797 and (MyRO.Wonder[woPyramids].EffectiveOwner >= 0)) and 7408 7798 (MyUn[UnFocus].Master < 0); 7409 if extended then7799 if Extended then 7410 7800 begin 7411 7801 mRoad.Visible := JobTest(UnFocus, jRoad, [eNoBridgeBuilding, eTreaty]); 7412 mR R.Visible := JobTest(UnFocus, jRR, [eNoBridgeBuilding, eTreaty]);7802 mRailRoad.Visible := JobTest(UnFocus, jRR, [eNoBridgeBuilding, eTreaty]); 7413 7803 mClear.Visible := JobTest(UnFocus, jClear, [eTreaty]); 7414 7804 mIrrigation.Visible := JobTest(UnFocus, jIrr, [eTreaty]); … … 7427 7817 else 7428 7818 begin 7429 for i:= 0 to Popup.Items.Count - 1 do7430 Popup.Items[ i].Visible := false;7819 for I := 0 to Popup.Items.Count - 1 do 7820 Popup.Items[I].Visible := False; 7431 7821 end; 7432 7822 end; … … 7434 7824 // set menu seperators 7435 7825 LastSep := nil; 7436 NeedSep := false;7437 for i:= 0 to Popup.Items.Count - 1 do7438 if Popup.Items[ i].Caption = '-' then7826 NeedSep := False; 7827 for I := 0 to Popup.Items.Count - 1 do 7828 if Popup.Items[I].Caption = '-' then 7439 7829 begin 7440 Popup.Items[ i].Visible := NeedSep;7830 Popup.Items[I].Visible := NeedSep; 7441 7831 if NeedSep then 7442 LastSep := Popup.Items[ i];7443 NeedSep := false7832 LastSep := Popup.Items[I]; 7833 NeedSep := False 7444 7834 end 7445 else if Popup.Items[ i].Visible then7446 NeedSep := true;7835 else if Popup.Items[I].Visible then 7836 NeedSep := True; 7447 7837 if (LastSep <> nil) and not NeedSep then 7448 LastSep.Visible := false7838 LastSep.Visible := False 7449 7839 end; 7450 7840 … … 7465 7855 end; 7466 7856 7467 procedure TMainScreen.CityClosed(Activateuix: integer; StepFocus: boolean;7468 SelectFocus: boolean);7469 begin 7470 if supervising then7857 procedure TMainScreen.CityClosed(Activateuix: Integer; StepFocus: Boolean; 7858 SelectFocus: Boolean); 7859 begin 7860 if Supervising then 7471 7861 begin 7472 7862 SetTroopLoc(-1); … … 7485 7875 end 7486 7876 else if StepFocus then 7487 NextUnit(TroopLoc, true)7877 NextUnit(TroopLoc, True) 7488 7878 else 7489 7879 begin … … 7496 7886 procedure TMainScreen.Toggle(Sender: TObject); 7497 7887 begin 7498 TDpiMenuItem(Sender).Checked := not TDpiMenuItem(Sender).Checked 7888 TDpiMenuItem(Sender).Checked := not TDpiMenuItem(Sender).Checked; 7499 7889 end; 7500 7890 7501 7891 procedure TMainScreen.PanelBoxMouseMove(Sender: TObject; Shift: TShiftState; 7502 x, y: integer);7892 X, Y: Integer); 7503 7893 var 7504 xCentre, yCentre: integer;7894 xCentre, yCentre: Integer; 7505 7895 begin 7506 7896 if Tracking and (ssLeft in Shift) then 7507 7897 with MainMap do begin 7508 if ( x >= xMini + 2) and (y >= yMini + 2) and (x< xMini + 2 + 2 * G.lx) and7509 ( y< yMini + 2 + G.ly) then7898 if (X >= xMini + 2) and (Y >= yMini + 2) and (X < xMini + 2 + 2 * G.lx) and 7899 (Y < yMini + 2 + G.ly) then 7510 7900 begin 7511 xCentre := (xwMini + ( x- xMini - 2) div 2 + G.lx div 2 +7901 xCentre := (xwMini + (X - xMini - 2) div 2 + G.lx div 2 + 7512 7902 MapWidth div (xxt * 4)) mod G.lx; 7513 yCentre := ( y- yMini - 2);7903 yCentre := (Y - yMini - 2); 7514 7904 xw := (xCentre - MapWidth div (xxt * 4) + G.lx) mod G.lx; 7515 7905 if ywmax <= 0 then … … 7523 7913 yw := ywmax; 7524 7914 end; 7525 DpiBit Canvas(Buffer.Canvas, 0, 0, G.lx * 2, G.ly, MiniMap.Bitmap.Canvas, 0, 0);7915 DpiBitBltCanvas(Buffer.Canvas, 0, 0, G.lx * 2, G.ly, MiniMap.Bitmap.Canvas, 0, 0); 7526 7916 if ywmax <= 0 then 7527 Frame(Buffer.Canvas, x- xMini - 2 - MapWidth div (xxt * 2), 0,7528 x- xMini - 2 + MapWidth div (xxt * 2) - 1, G.ly - 1,7917 Frame(Buffer.Canvas, X - xMini - 2 - MapWidth div (xxt * 2), 0, 7918 X - xMini - 2 + MapWidth div (xxt * 2) - 1, G.ly - 1, 7529 7919 MainTexture.ColorMark, MainTexture.ColorMark) 7530 7920 else 7531 Frame(Buffer.Canvas, x- xMini - 2 - MapWidth div (xxt * 2), yw,7532 x- xMini - 2 + MapWidth div (xxt * 2) - 1, yw + MapHeight div yyt -7921 Frame(Buffer.Canvas, X - xMini - 2 - MapWidth div (xxt * 2), yw, 7922 X - xMini - 2 + MapWidth div (xxt * 2) - 1, yw + MapHeight div yyt - 7533 7923 2, MainTexture.ColorMark, MainTexture.ColorMark); 7534 DpiBit Canvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly,7924 DpiBitBltCanvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly, 7535 7925 Buffer.Canvas, 0, 0); 7536 7926 MainOffscreenPaint; … … 7542 7932 end 7543 7933 else 7544 Tracking := false;7934 Tracking := False; 7545 7935 end; 7546 7936 7547 7937 procedure TMainScreen.PanelBoxMouseUp(Sender: TObject; Button: TMouseButton; 7548 Shift: TShiftState; x, y: integer);7938 Shift: TShiftState; X, Y: Integer); 7549 7939 begin 7550 7940 if Tracking then 7551 7941 begin 7552 Tracking := false;7942 Tracking := False; 7553 7943 xwMini := xw; 7554 7944 ywMini := yw; … … 7559 7949 7560 7950 procedure TMainScreen.MapBoxMouseMove(Sender: TObject; Shift: TShiftState; 7561 x, y: integer);7951 X, Y: Integer); 7562 7952 var 7563 MouseLoc: integer;7564 begin 7565 xMouse := x;7566 yMouse := y;7953 MouseLoc: Integer; 7954 begin 7955 xMouse := X; 7956 yMouse := Y; 7567 7957 if (ClientMode = cEditMap) and (ssLeft in Shift) and not Tracking then 7568 7958 begin 7569 MouseLoc := LocationOfScreenPixel( x, y);7959 MouseLoc := LocationOfScreenPixel(X, Y); 7570 7960 if MouseLoc <> BrushLoc then 7571 MapBoxMouseDown(nil, mbLeft, Shift, x, y);7961 MapBoxMouseDown(nil, mbLeft, Shift, X, Y); 7572 7962 end 7573 (* else if idle and (UnFocus>=0) then7963 (* else if Idle and (UnFocus>=0) then 7574 7964 begin 7575 7965 qx:=(xMouse*32+yMouse*66+16*66) div(32*66)-1; … … 7584 7974 TDpiMenuItem(Sender).Checked := not TDpiMenuItem(Sender).Checked; 7585 7975 SetMapOptions; 7586 MapValid := false;7976 MapValid := False; 7587 7977 PaintAllMaps; 7588 7978 end; … … 7590 7980 procedure TMainScreen.mNamesClick(Sender: TObject); 7591 7981 var 7592 p1: integer;7982 p1: Integer; 7593 7983 begin 7594 7984 mNames.Checked := not mNames.Checked; … … 7600 7990 else 7601 7991 Tribe[p1].NumberName := p1; 7602 MapValid := false;7992 MapValid := False; 7603 7993 PaintAll; 7604 7994 end; 7605 7995 7606 function TMainScreen.IsPanelPixel( x, y: integer): boolean;7607 begin 7608 result := (y >= TopBarHeight + MapHeight) or (y>= ClientHeight - PanelHeight)7609 and (( x < xMidPanel) or (x>= xRightPanel));7996 function TMainScreen.IsPanelPixel(X, Y: Integer): Boolean; 7997 begin 7998 Result := (Y >= TopBarHeight + MapHeight) or (Y >= ClientHeight - PanelHeight) 7999 and ((X < xMidPanel) or (X >= xRightPanel)); 7610 8000 end; 7611 8001 7612 8002 procedure TMainScreen.FormMouseDown(Sender: TObject; Button: TMouseButton; 7613 Shift: TShiftState; x, y: integer);7614 begin 7615 if idle then7616 if ( x < 40) and (y< 40) then8003 Shift: TShiftState; X, Y: Integer); 8004 begin 8005 if Idle then 8006 if (X < 40) and (Y < 40) then 7617 8007 begin 7618 8008 if GameMode <> cMovie then … … 7626 8016 end; 7627 8017 end 7628 else if IsPanelPixel( x, y) then7629 PanelBoxMouseDown(Sender, Button, Shift, x,7630 y- (ClientHeight - PanelHeight))7631 else if ( y >= TopBarHeight) and (x>= MapOffset) and7632 ( x< MapOffset + MapWidth) then7633 MapBoxMouseDown(Sender, Button, Shift, x - MapOffset, y- TopBarHeight)8018 else if IsPanelPixel(X, Y) then 8019 PanelBoxMouseDown(Sender, Button, Shift, X, 8020 Y - (ClientHeight - PanelHeight)) 8021 else if (Y >= TopBarHeight) and (X >= MapOffset) and 8022 (X < MapOffset + MapWidth) then 8023 MapBoxMouseDown(Sender, Button, Shift, X - MapOffset, Y - TopBarHeight) 7634 8024 end; 7635 8025 7636 8026 procedure TMainScreen.FormMouseMove(Sender: TObject; Shift: TShiftState; 7637 x, y: integer);7638 begin 7639 if idle then7640 if IsPanelPixel( x, y) then7641 PanelBoxMouseMove(Sender, Shift, x, y- (ClientHeight - PanelHeight))7642 else if ( y >= TopBarHeight) and (x>= MapOffset) and7643 ( x< MapOffset + MapWidth) then7644 MapBoxMouseMove(Sender, Shift, x - MapOffset, y- TopBarHeight);8027 X, Y: Integer); 8028 begin 8029 if Idle then 8030 if IsPanelPixel(X, Y) then 8031 PanelBoxMouseMove(Sender, Shift, X, Y - (ClientHeight - PanelHeight)) 8032 else if (Y >= TopBarHeight) and (X >= MapOffset) and 8033 (X < MapOffset + MapWidth) then 8034 MapBoxMouseMove(Sender, Shift, X - MapOffset, Y - TopBarHeight); 7645 8035 end; 7646 8036 7647 8037 procedure TMainScreen.FormMouseUp(Sender: TObject; Button: TMouseButton; 7648 Shift: TShiftState; x, y: integer);7649 begin 7650 if idle then7651 PanelBoxMouseUp(Sender, Button, Shift, x, y- (ClientHeight - PanelHeight));8038 Shift: TShiftState; X, Y: Integer); 8039 begin 8040 if Idle then 8041 PanelBoxMouseUp(Sender, Button, Shift, X, Y - (ClientHeight - PanelHeight)); 7652 8042 end; 7653 8043 … … 7658 8048 with Canvas do 7659 8049 begin // pillarbox, make left and right border black 7660 if me < 0 then8050 if Me < 0 then 7661 8051 Brush.Color := $000000 7662 8052 else … … 7684 8074 Brush.Style := bsClear; 7685 8075 end; 7686 DpiBit Canvas(Canvas, MapOffset, TopBarHeight, MapWidth, MapHeight - overlap,7687 offscreen.Canvas, 0, 0);7688 DpiBit Canvas(Canvas, 0, 0, ClientWidth, TopBarHeight, TopBar.Canvas,8076 DpiBitBltCanvas(Canvas, MapOffset, TopBarHeight, MapWidth, MapHeight - overlap, 8077 Offscreen.Canvas, 0, 0); 8078 DpiBitBltCanvas(Canvas, 0, 0, ClientWidth, TopBarHeight, TopBar.Canvas, 7689 8079 0, 0); 7690 8080 if xMidPanel > MapOffset then 7691 DpiBit Canvas(Canvas, xMidPanel, TopBarHeight + MapHeight - overlap,7692 ClientWidth div 2 - xMidPanel, overlap, offscreen.Canvas,8081 DpiBitBltCanvas(Canvas, xMidPanel, TopBarHeight + MapHeight - overlap, 8082 ClientWidth div 2 - xMidPanel, overlap, Offscreen.Canvas, 7693 8083 xMidPanel - MapOffset, MapHeight - overlap) 7694 8084 else 7695 DpiBit Canvas(Canvas, MapOffset, TopBarHeight + MapHeight - overlap,7696 ClientWidth div 2 - MapOffset, overlap, offscreen.Canvas, 0,8085 DpiBitBltCanvas(Canvas, MapOffset, TopBarHeight + MapHeight - overlap, 8086 ClientWidth div 2 - MapOffset, overlap, Offscreen.Canvas, 0, 7697 8087 MapHeight - overlap); 7698 8088 if xRightPanel < MapOffset + MapWidth then 7699 DpiBit Canvas(Canvas, ClientWidth div 2, TopBarHeight + MapHeight - overlap,7700 xRightPanel - ClientWidth div 2, overlap, offscreen.Canvas,8089 DpiBitBltCanvas(Canvas, ClientWidth div 2, TopBarHeight + MapHeight - overlap, 8090 xRightPanel - ClientWidth div 2, overlap, Offscreen.Canvas, 7701 8091 ClientWidth div 2 - MapOffset, MapHeight - overlap) 7702 8092 else 7703 DpiBit Canvas(Canvas, ClientWidth div 2, TopBarHeight + MapHeight - overlap,8093 DpiBitBltCanvas(Canvas, ClientWidth div 2, TopBarHeight + MapHeight - overlap, 7704 8094 MapOffset + MapWidth - ClientWidth div 2, overlap, 7705 offscreen.Canvas, ClientWidth div 2 - MapOffset,8095 Offscreen.Canvas, ClientWidth div 2 - MapOffset, 7706 8096 MapHeight - overlap); 7707 DpiBit Canvas(Canvas, 0, TopBarHeight + MapHeight - overlap, xMidPanel,8097 DpiBitBltCanvas(Canvas, 0, TopBarHeight + MapHeight - overlap, xMidPanel, 7708 8098 overlap, Panel.Canvas, 0, 0); 7709 DpiBit Canvas(Canvas, xRightPanel, TopBarHeight + MapHeight - overlap,8099 DpiBitBltCanvas(Canvas, xRightPanel, TopBarHeight + MapHeight - overlap, 7710 8100 Panel.width - xRightPanel, overlap, Panel.Canvas, xRightPanel, 0); 7711 DpiBit Canvas(Canvas, 0, TopBarHeight + MapHeight, Panel.width,8101 DpiBitBltCanvas(Canvas, 0, TopBarHeight + MapHeight, Panel.width, 7712 8102 PanelHeight - overlap, Panel.Canvas, 0, overlap); 7713 8103 if (pLogo >= 0) and (G.RO[pLogo] = nil) and (AILogo[pLogo] <> nil) then 7714 DpiBit Canvas(Canvas, xRightPanel + 10 - (16 + 64),8104 DpiBitBltCanvas(Canvas, xRightPanel + 10 - (16 + 64), 7715 8105 ClientHeight - PanelHeight, 64, 64, AILogo[pLogo].Canvas, 0, 0); 7716 8106 end; 7717 8107 7718 procedure TMainScreen.RectInvalidate(Left, Top, Rigth, Bottom: integer);8108 procedure TMainScreen.RectInvalidate(Left, Top, Rigth, Bottom: Integer); 7719 8109 var 7720 8110 r0: HRgn; 7721 8111 begin 7722 8112 r0 := DpiCreateRectRgn(Left, Top, Rigth, Bottom); 7723 InvalidateRgn(Handle, r0, false);8113 InvalidateRgn(Handle, r0, False); 7724 8114 DeleteObject(r0); 7725 8115 end; 7726 8116 7727 procedure TMainScreen.SmartRectInvalidate(Left, Top, Rigth, Bottom: integer);8117 procedure TMainScreen.SmartRectInvalidate(Left, Top, Rigth, Bottom: Integer); 7728 8118 var 7729 i: integer;8119 I: Integer; 7730 8120 r0, r1: HRgn; 7731 8121 begin 7732 8122 r0 := DpiCreateRectRgn(Left, Top, Rigth, Bottom); 7733 for i:= 0 to ControlCount - 1 do7734 if not(Controls[ i] is TArea) and Controls[i].Visible then8123 for I := 0 to ControlCount - 1 do 8124 if not(Controls[I] is TArea) and Controls[I].Visible then 7735 8125 begin 7736 with Controls[ i].BoundsRect do8126 with Controls[I].BoundsRect do 7737 8127 r1 := DpiCreateRectRgn(Left, Top, Right, Bottom); 7738 8128 CombineRgn(r0, r0, r1, RGN_DIFF); 7739 8129 DeleteObject(r1); 7740 8130 end; 7741 InvalidateRgn(Handle, r0, false);8131 InvalidateRgn(Handle, r0, False); 7742 8132 DeleteObject(r0); 7743 8133 end; … … 7804 8194 procedure TMainScreen.FormClose(Sender: TObject; var Action: TCloseAction); 7805 8195 begin 7806 Timer1.Enabled := false;8196 Timer1.Enabled := False; 7807 8197 end; 7808 8198 7809 8199 procedure TMainScreen.Radio(Sender: TObject); 7810 8200 begin 7811 TDpiMenuItem(Sender).Checked := true;8201 TDpiMenuItem(Sender).Checked := True; 7812 8202 end; 7813 8203 7814 8204 procedure TMainScreen.mManipClick(Sender: TObject); 7815 8205 var 7816 Flag: integer;8206 Flag: Integer; 7817 8207 begin 7818 8208 with TDpiMenuItem(Sender) do … … 7826 8216 Play('CHEAT'); 7827 8217 end; 7828 if not supervising then8218 if not Supervising then 7829 8219 begin 7830 8220 if Flag = tfUncover then 7831 8221 begin 7832 MapValid := false;8222 MapValid := False; 7833 8223 PaintAllMaps; 7834 8224 end … … 7854 8244 else 7855 8245 begin 7856 MapValid := false;8246 MapValid := False; 7857 8247 PaintAllMaps; 7858 8248 end; // update main map … … 7873 8263 end; 7874 8264 SetMapOptions; 7875 MapValid := false;8265 MapValid := False; 7876 8266 PaintAllMaps; 7877 8267 end; … … 7891 8281 end; 7892 8282 SetMapOptions; 7893 MapValid := false;8283 MapValid := False; 7894 8284 PaintAllMaps; 7895 8285 end; 7896 8286 7897 procedure TMainScreen.FormKeyUp(Sender: TObject; var Key: word;8287 procedure TMainScreen.FormKeyUp(Sender: TObject; var Key: Word; 7898 8288 Shift: TShiftState); 7899 8289 begin 7900 if idle and (Key = VK_APPS) then8290 if Idle and (Key = VK_APPS) then 7901 8291 begin 7902 8292 InitPopup(GamePopup); … … 7906 8296 GamePopup.Popup(Left + 4, Top + DpiGetSystemMetrics(SM_CYCAPTION) + 4 + 7907 8297 TopBarHeight - 1); 7908 exit;8298 Exit; 7909 8299 end; // windows menu button calls game menu 7910 8300 end; … … 7912 8302 procedure TMainScreen.CreateUnitClick(Sender: TObject); 7913 8303 var 7914 p1, mix: integer;8304 p1, mix: Integer; 7915 8305 begin 7916 8306 p1 := TComponent(Sender).Tag shr 16; 7917 8307 mix := TComponent(Sender).Tag and $FFFF; 7918 if Server(sCreateUnit + p1 shl 4, me, mix, EditLoc) >= rExecuted then8308 if Server(sCreateUnit + p1 shl 4, Me, mix, EditLoc) >= rExecuted then 7919 8309 PaintLoc(EditLoc); 7920 8310 end; … … 7934 8324 SoundMode := smOnAlt; 7935 8325 end; 7936 7937 { procedure TMainScreen.AdviceBtnClick;7938 var7939 OldAdviceLoc: integer;7940 begin7941 DestinationMarkON:=false;7942 PaintDestination;7943 AdvisorDlg.GiveStrategyAdvice;7944 OldAdviceLoc:=MainMap.AdviceLoc;7945 MainMap.AdviceLoc:=-1;7946 PaintLoc(OldAdviceLoc);7947 end; }7948 7949 { procedure TMainScreen.SetAdviceLoc(Loc: integer; AvoidRect: TRect);7950 var7951 OldAdviceLoc,x,y: integer;7952 begin7953 if Loc<>MainMap.AdviceLoc then7954 begin7955 if Loc>=0 then7956 begin // center7957 y:=Loc div G.lx;7958 x:=(Loc+G.lx - AvoidRect.Right div (2*66)) mod G.lx;7959 Centre(y*G.lx+x);7960 PaintAllMaps;7961 end;7962 OldAdviceLoc:=MainMap.AdviceLoc;7963 MainMap.AdviceLoc:=Loc;7964 PaintLoc(OldAdviceLoc);7965 PaintLoc(MainMap.AdviceLoc);7966 end;7967 end; }7968 8326 7969 8327 procedure TMainScreen.UnitInfoBtnClick(Sender: TObject); … … 8004 8362 8005 8363 procedure TMainScreen.SetTileSize(TileSize: TTileSize; Loc: Integer; MapPos: TPoint); 8006 var8007 i: integer;8008 8364 begin 8009 8365 MainMap.TileSize := TileSize; … … 8012 8368 SetMapPos(Loc, MapPos); 8013 8369 PaintAllMaps; 8014 for i := 0 to DpiScreen.FormCount - 1 do 8015 if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) then 8016 TBufferedDrawDlg(DpiScreen.Forms[i]).SmartUpdateContent(false); 8370 ApplyToVisibleForms(faSmartUpdateContent); 8017 8371 end; 8018 8372 8019 8373 procedure TMainScreen.SaveMenuItemsState; 8020 8374 var 8021 i, j: integer;8375 I, J: Integer; 8022 8376 begin 8023 8377 if soTellAI in OptionChecked then OptionChecked := [soTellAI] 8024 8378 else OptionChecked := []; 8025 for i:= 0 to ComponentCount - 1 do8026 if Components[ i] is TDpiMenuItem then8027 for j:= 0 to Length(SaveOption) - 1 do8028 if TDpiMenuItem(Components[ i]).Checked and8029 (TDpiMenuItem(Components[ i]).Tag = SaveOption[j]) then8030 OptionChecked := OptionChecked + [TSaveOption( j)];8379 for I := 0 to ComponentCount - 1 do 8380 if Components[I] is TDpiMenuItem then 8381 for J := 0 to Length(SaveOption) - 1 do 8382 if TDpiMenuItem(Components[I]).Checked and 8383 (TDpiMenuItem(Components[I]).Tag = SaveOption[J]) then 8384 OptionChecked := OptionChecked + [TSaveOption(J)]; 8031 8385 end; 8032 8386 … … 8040 8394 with Reg do 8041 8395 try 8042 OpenKey(AppRegistryKey, true);8396 OpenKey(AppRegistryKey, True); 8043 8397 WriteInteger('TileSize', Integer(MainMap.TileSize)); 8044 8398 WriteInteger('OptionChecked', Integer(OptionChecked)); 8045 8399 WriteInteger('MapOptionChecked', Integer(MapOptionChecked)); 8046 WriteInteger('CityReport', integer(CityRepMask));8400 WriteInteger('CityReport', Integer(CityRepMask)); 8047 8401 finally 8048 8402 Free; … … 8056 8410 end; 8057 8411 8412 procedure TMainScreen.ArrangeDialogs; 8413 begin 8414 ArrangeDialog(FListDlg); 8415 ArrangeDialog(FHelpDlg); 8416 ArrangeDialog(FUnitStatDlg); 8417 ArrangeDialog(FDiaDlg); 8418 ArrangeDialog(FNatStatDlg); 8419 end; 8420 8421 procedure TMainScreen.ArrangeDialog(Form: TBufferedDrawDlg); 8422 begin 8423 if not Assigned(Form) then Exit; 8424 8425 if Form is TListDlg then begin; 8426 ListDlg.UserLeft := 8; 8427 ListDlg.UserTop := TopBarHeight + 8; 8428 end; 8429 if Form is THelpDlg then begin 8430 HelpDlg.UserLeft := DpiScreen.Width - HelpDlg.Width - 8; 8431 HelpDlg.UserTop := TopBarHeight + 8; 8432 end; 8433 if Form is TUnitStatDlg then begin 8434 UnitStatDlg.UserLeft := 397; 8435 UnitStatDlg.UserTop := TopBarHeight + 64; 8436 end; 8437 if Form is TDiaDlg then begin 8438 DiaDlg.UserLeft := (DpiScreen.Width - DiaDlg.Width) div 2; 8439 DiaDlg.UserTop := (DpiScreen.Height - DiaDlg.Height) div 2; 8440 end; 8441 if Form is TNatStatDlg then begin 8442 NatStatDlg.UserLeft := DpiScreen.Width - NatStatDlg.Width - 8; 8443 NatStatDlg.UserTop := DpiScreen.Height - PanelHeight - NatStatDlg.Height - 8; 8444 if NatStatDlg.UserTop < 8 then 8445 NatStatDlg.UserTop := 8; 8446 end; 8447 end; 8448 8058 8449 procedure TMainScreen.ScrollBarUpdate(Sender: TObject); 8059 8450 begin -
branches/highdpi/LocalPlayer/Tribes.pas
r349 r465 6 6 uses 7 7 Protocol, ScreenTools, LazFileUtils, Classes, Graphics, SysUtils, Global, 8 UGraphicSet;8 GraphicSet; 9 9 10 10 type … … 20 20 yShield: Integer; 21 21 end; 22 23 { TModelPictureInfo } 22 24 23 25 TModelPictureInfo = record … … 27 29 Hash: Integer; 28 30 GrName: ShortString; 31 function GetCommandDataSize: Byte; 29 32 end; 30 33 … … 46 49 constructor Create(FileName: string); 47 50 destructor Destroy; override; 48 function GetCityName( i: Integer): string;49 {$IFNDEF SCR} procedure SetCityName( i: Integer; NewName: string); {$ENDIF}51 function GetCityName(I: Integer): string; 52 {$IFNDEF SCR} procedure SetCityName(I: Integer; NewName: string); {$ENDIF} 50 53 {$IFNDEF SCR} function TString(Template: string): string; 51 54 function TPhrase(Item: string): string; {$ENDIF} … … 69 72 function CityName(Founder: Integer): string; 70 73 function ModelCode(const ModelInfo: TModelInfo): Integer; 71 procedure FindStdModelPicture(Code: Integer; var pix: Integer; varName: string);74 procedure FindStdModelPicture(Code: Integer; out pix: Integer; out Name: string); 72 75 function GetTribeInfo(FileName: string; var Name: string; var Color: TColor): Boolean; 73 procedure FindPosition(HGr: TGraphicSet; x, y, xmax, ymax: Integer; Mark: TColor;76 procedure FindPosition(HGr: TGraphicSet; X, Y, xmax, ymax: Integer; Mark: TColor; 74 77 var xp, yp: Integer); 75 78 … … 212 215 function Get: string; 213 216 var 214 p: Integer;217 P: Integer; 215 218 begin 216 219 while (Input <> '') and ((Input[1] = ' ') or (Input[1] = #9)) do 217 220 Delete(Input, 1, 1); 218 p:= Pos(',', Input);219 if p= 0 then220 p:= Length(Input) + 1;221 Result := Copy(Input, 1, p- 1);222 Delete(Input, 1, p);221 P := Pos(',', Input); 222 if P = 0 then 223 P := Length(Input) + 1; 224 Result := Copy(Input, 1, P - 1); 225 Delete(Input, 1, P); 223 226 end; 224 227 225 228 function GetNum: Integer; 226 229 var 227 i: Integer;228 begin 229 Val(Get, Result, i);230 if i<> 0 then230 I: Integer; 231 begin 232 Val(Get, Result, I); 233 if I <> 0 then 231 234 Result := 0; 232 235 end; 233 236 234 procedure FindStdModelPicture(Code: Integer; var pix: Integer; varName: string);235 var 236 i: Integer;237 begin 238 for i:= 0 to StdUnitScript.Count - 1 do237 procedure FindStdModelPicture(Code: Integer; out pix: Integer; out Name: string); 238 var 239 I: Integer; 240 begin 241 for I := 0 to StdUnitScript.Count - 1 do 239 242 begin // look through StdUnits 240 Input := StdUnitScript[ i];243 Input := StdUnitScript[I]; 241 244 pix := GetNum; 242 245 if Code = GetNum then … … 281 284 CloseFile(TribeScript); 282 285 Result := Found = 3; 286 end; 287 288 { TModelPictureInfo } 289 290 function TModelPictureInfo.GetCommandDataSize: Byte; 291 begin 292 Result := SizeOf(trix) + SizeOf(mix) + SizeOf(pix) + SizeOf(Hash) + 1 + 293 Length(GrName); 283 294 end; 284 295 … … 329 340 end; 330 341 331 procedure FindPosition(HGr: TGraphicSet; x, y, xmax, ymax: Integer; Mark: TColor;342 procedure FindPosition(HGr: TGraphicSet; X, Y, xmax, ymax: Integer; Mark: TColor; 332 343 var xp, yp: Integer); 333 344 begin 334 345 xp := 0; 335 while (xp < xmax) and (HGr.Data.Canvas.Pixels[ x + 1 + xp, y] <> Mark) do346 while (xp < xmax) and (HGr.Data.Canvas.Pixels[X + 1 + xp, Y] <> Mark) do 336 347 Inc(xp); 337 348 yp := 0; 338 while (yp < ymax) and (HGr.Data.Canvas.Pixels[ x, y+ 1 + yp] <> Mark) do349 while (yp < ymax) and (HGr.Data.Canvas.Pixels[X, Y + 1 + yp] <> Mark) do 339 350 Inc(yp); 340 351 end; 341 352 342 function TTribe.GetCityName( i: Integer): string;353 function TTribe.GetCityName(I: Integer): string; 343 354 begin 344 355 Result := ''; 345 if nCityLines > ithen346 begin 347 Result := Script[CityLine0 + i];356 if nCityLines > I then 357 begin 358 Result := Script[CityLine0 + I]; 348 359 while (Result <> '') and ((Result[1] = ' ') or (Result[1] = #9)) do 349 360 Delete(Result, 1, 1); … … 351 362 {$IFNDEF SCR} 352 363 else 353 Result := Format(TPhrase('GENCITY'), [ i+ 1]);364 Result := Format(TPhrase('GENCITY'), [I + 1]); 354 365 {$ENDIF} 355 366 end; 356 367 357 368 {$IFNDEF SCR} 358 procedure TTribe.SetCityName( i: Integer; NewName: string);359 begin 360 while nCityLines <= ido369 procedure TTribe.SetCityName(I: Integer; NewName: string); 370 begin 371 while nCityLines <= I do 361 372 begin 362 373 Script.Insert(CityLine0 + nCityLines, Format(TPhrase('GENCITY'), … … 364 375 Inc(nCityLines); 365 376 end; 366 Script[CityLine0 + i] := NewName;377 Script[CityLine0 + I] := NewName; 367 378 end; 368 379 369 380 function TTribe.TString(Template: string): string; 370 381 var 371 p: Integer;382 P: Integer; 372 383 Variant: Char; 373 384 CaseUp: Boolean; 374 385 begin 375 386 repeat 376 p := pos('#', Template);377 if ( p = 0) or (p= Length(Template)) then387 P := Pos('#', Template); 388 if (P = 0) or (P = Length(Template)) then 378 389 Break; 379 Variant := Template[ p+ 1];390 Variant := Template[P + 1]; 380 391 CaseUp := Variant in ['A' .. 'Z']; 381 392 if CaseUp then 382 393 Inc(Variant, 32); 383 Delete(Template, p, 2);394 Delete(Template, P, 2); 384 395 if Variant in ['a' .. 'z'] then 385 396 begin 386 397 if NumberName < 0 then 387 Insert(Name[Variant], Template, p)398 Insert(Name[Variant], Template, P) 388 399 else 389 Insert(Format('P%d', [NumberName]), Template, p);390 if CaseUp and (Length(Template) >= p) and391 (Template[ p] in ['a' .. 'z', #$E0 .. #$FF]) then392 Dec(Template[ p], 32);400 Insert(Format('P%d', [NumberName]), Template, P); 401 if CaseUp and (Length(Template) >= P) and 402 (Template[P] in ['a' .. 'z', #$E0 .. #$FF]) then 403 Dec(Template[P], 32); 393 404 end 394 405 until False; … … 407 418 TLine = array [0 .. 649, 0 .. 2] of Byte; 408 419 var 409 i, x, Gray: Integer;420 I, X, Gray: Integer; 410 421 Item: string; 411 422 begin … … 415 426 with Script do 416 427 begin 417 i:= 0;418 while ( i < Count) and (Copy(Strings[i], 1, 6) <>428 I := 0; 429 while (I < Count) and (Copy(Strings[I], 1, 6) <> 419 430 '#AGE' + char(48 + Age) + ' ') do 420 Inc( i);421 if i< Count then422 begin 423 Input := Strings[ i];431 Inc(I); 432 if I < Count then 433 begin 434 Input := Strings[I]; 424 435 system.Delete(Input, 1, 6); 425 436 Item := Get; … … 430 441 if CompareText(Item, 'stdcities') = 0 then 431 442 case cpix of 432 3: 433 cpix := 0; 434 6: 435 begin 443 3: cpix := 0; 444 6: begin 436 445 cpix := 0; 437 446 Item := 'Nation2'; 438 end 447 end; 439 448 end; 440 449 cHGr := LoadGraphicSet(Item + '.png'); 441 for x := 0 to 3 do 442 with CityPicture[x] do 443 begin 444 FindPosition(cHGr, x * 65, cpix * 49, 63, 47, $00FFFF, 450 for X := 0 to 3 do 451 with CityPicture[X] do begin 452 FindPosition(cHGr, X * 65, cpix * 49, 63, 47, $00FFFF, 445 453 xShield, yShield); 446 454 // FindPosition(cHGr,x*65,cpix*49,$FFFFFF,xf,yf); … … 478 486 procedure TTribe.SetModelPicture(const Info: TModelPictureInfo; IsNew: Boolean); 479 487 var 480 i: Integer;488 I: Integer; 481 489 ok: Boolean; 482 490 begin … … 485 493 if not IsNew then 486 494 begin 487 i:= nPictureList - 1;488 while ( i >= 0) and (PictureList[i].Hash <> Info.Hash) do489 Dec( i);490 assert(i>= 0);491 assert(PictureList[i].HGr = LoadGraphicSet(GrName));492 assert(PictureList[i].pix = pix);493 ModelPicture[mix].HGr := PictureList[ i].HGr;494 ModelPicture[mix].pix := PictureList[ i].pix;495 ModelName[mix] := PictureList[ i].ModelName;495 I := nPictureList - 1; 496 while (I >= 0) and (PictureList[I].Hash <> Info.Hash) do 497 Dec(I); 498 Assert(I >= 0); 499 Assert(PictureList[I].HGr = LoadGraphicSet(GrName)); 500 Assert(PictureList[I].pix = pix); 501 ModelPicture[mix].HGr := PictureList[I].HGr; 502 ModelPicture[mix].pix := PictureList[I].pix; 503 ModelName[mix] := PictureList[I].ModelName; 496 504 end 497 505 else … … 507 515 // read model name from tribe script 508 516 ok := False; 509 for i:= 0 to Script.Count - 1 do510 begin 511 Input := Script[ i];517 for I := 0 to Script.Count - 1 do 518 begin 519 Input := Script[I]; 512 520 if Input = '#UNITS ' + ExtractFileNameOnly(GrName) then 513 521 ok := True … … 523 531 if ModelName[mix] = '' then 524 532 begin // read model name from StdUnits.txt 525 for i:= 0 to StdUnitScript.Count - 1 do533 for I := 0 to StdUnitScript.Count - 1 do 526 534 begin 527 Input := StdUnitScript[ i];535 Input := StdUnitScript[I]; 528 536 if GetNum = pix then 529 537 begin … … 559 567 Code, Turn: Integer; ForceNew: Boolean): Boolean; 560 568 var 561 i: Integer;569 I: Integer; 562 570 Cnt: Integer; 563 571 HGr: TGraphicSet; … … 598 606 if not ForceNew and (Picture.Hash > 0) then 599 607 begin 600 for i:= 0 to nPictureList - 1 do601 if PictureList[ i].Hash = Picture.Hash then602 begin 603 Picture.GrName := PictureList[ i].HGr.Name;604 Picture.pix := PictureList[ i].pix;608 for I := 0 to nPictureList - 1 do 609 if PictureList[I].Hash = Picture.Hash then 610 begin 611 Picture.GrName := PictureList[I].HGr.Name; 612 Picture.pix := PictureList[I].pix; 605 613 Result := False; 606 614 Exit; … … 614 622 TestPic.GrName := 'StdUnits.png'; 615 623 HGr := HGrStdUnits; 616 for i:= 0 to StdUnitScript.Count - 1 do624 for I := 0 to StdUnitScript.Count - 1 do 617 625 begin // look through StdUnits 618 Input := StdUnitScript[ i];626 Input := StdUnitScript[I]; 619 627 Check; 620 628 end; 621 629 622 630 ok := False; 623 for i:= 0 to Script.Count - 1 do631 for I := 0 to Script.Count - 1 do 624 632 begin // look through units defined in tribe script 625 Input := Script[ i];633 Input := Script[I]; 626 634 if Copy(Input, 1, 6) = '#UNITS' then 627 635 begin -
branches/highdpi/LocalPlayer/UnitStat.pas
r405 r465 5 5 6 6 uses 7 UDpiControls, Protocol, ClientTools, Term, ScreenTools, BaseWin, 8 LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, 9 ButtonB, ButtonC, IsoEngine; 7 UDpiControls, Protocol, ClientTools, ScreenTools, BaseWin, LCLIntf, LCLType, SysUtils, 8 Classes, Graphics, Controls, Forms, ButtonB, ButtonC, IsoEngine; 10 9 11 10 type 11 TUnitStatDialogKind = (dkOwnModel, dkOwnUnit, dkEnemyModel, dkEnemyUnit, 12 dkEnemyCityDefense, dkEnemyCity); 13 12 14 TUnitStatDlg = class(TBufferedDrawDlg) 13 15 SwitchBtn: TButtonB; … … 26 28 private 27 29 NoMap: TIsoMap; 30 protected 31 mixShow, // for dkOwnModel 32 uixShow, euixShow, ecixShow, UnitLoc, AgePrepared: Integer; 33 // for dkEnemyUnit, euixShow=-1 -> 34 mox: ^TModelInfo; // for dkEnemyModel 35 Kind: TUnitStatDialogKind; 36 Back: TDpiBitmap; 37 Template: TDpiBitmap; 38 procedure OffscreenPaint; override; 28 39 public 29 40 procedure CheckAge; 30 procedure ShowNewContent_OwnModel(NewMode, mix: integer); 31 procedure ShowNewContent_OwnUnit(NewMode, uix: integer); 32 procedure ShowNewContent_EnemyUnit(NewMode, euix: integer); 33 procedure ShowNewContent_EnemyLoc(NewMode, Loc: integer); 34 procedure ShowNewContent_EnemyModel(NewMode, emix: integer); 35 procedure ShowNewContent_EnemyCity(NewMode, Loc: integer); 36 37 protected 38 mixShow, // for dkOwnModel 39 uixShow, euixShow, ecixShow, UnitLoc, AgePrepared: integer; 40 // for dkEnemyUnit, euixShow=-1 -> 41 mox: ^TModelInfo; // for dkEnemyModel 42 Kind: (dkOwnModel, dkOwnUnit, dkEnemyModel, dkEnemyUnit, dkEnemyCityDefense, 43 dkEnemyCity); 44 Back, Template: TDpiBitmap; 45 procedure OffscreenPaint; override; 46 end; 47 48 var 49 UnitStatDlg: TUnitStatDlg; 41 procedure ShowNewContent_OwnModel(NewMode: TWindowMode; mix: Integer); 42 procedure ShowNewContent_OwnUnit(NewMode: TWindowMode; uix: Integer); 43 procedure ShowNewContent_EnemyUnit(NewMode: TWindowMode; euix: Integer); 44 procedure ShowNewContent_EnemyLoc(NewMode: TWindowMode; Loc: Integer); 45 procedure ShowNewContent_EnemyModel(NewMode: TWindowMode; emix: Integer); 46 procedure ShowNewContent_EnemyCity(NewMode: TWindowMode; Loc: Integer); 47 end; 48 50 49 51 50 implementation 52 51 53 52 uses 54 T ribes, Help, Directories, UTexture;53 Term, Tribes, Help, Directories, Texture; 55 54 56 55 {$R *.lfm} … … 82 81 Back.PixelFormat := pf24bit; 83 82 Back.SetSize(5 * wCommon, hMax); 84 Back.Canvas.FillRect(0, 0, Back.Width, Back.Height);83 Back.Canvas.FillRect(0, 0, Back.Width, Back.Height); 85 84 Template := TDpiBitmap.Create; 86 85 Template.PixelFormat := pf24bit; … … 100 99 if MainTexture.Age <> AgePrepared then begin 101 100 AgePrepared := MainTexture.Age; 102 DpiBit Canvas(Back.Canvas, 0, 0, wCommon, hOwnModel,101 DpiBitBltCanvas(Back.Canvas, 0, 0, wCommon, hOwnModel, 103 102 MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2, 104 103 (MainTexture.Height - hOwnModel) div 2); 105 DpiBit Canvas(Back.Canvas, wCommon, 0, wCommon, hEnemyModel,104 DpiBitBltCanvas(Back.Canvas, wCommon, 0, wCommon, hEnemyModel, 106 105 MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2, 107 106 (MainTexture.Height - hEnemyModel) div 2); 108 DpiBit Canvas(Back.Canvas, 2 * wCommon, 0, wCommon, hEnemyUnit,107 DpiBitBltCanvas(Back.Canvas, 2 * wCommon, 0, wCommon, hEnemyUnit, 109 108 MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2, 110 109 (MainTexture.Height - hEnemyUnit) div 2); 111 DpiBit Canvas(Back.Canvas, 3 * wCommon, 0, wCommon, hEnemyCityDefense,110 DpiBitBltCanvas(Back.Canvas, 3 * wCommon, 0, wCommon, hEnemyCityDefense, 112 111 MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2, 113 112 (MainTexture.Height - hEnemyCityDefense) div 2); 114 DpiBit Canvas(Back.Canvas, 4 * wCommon, 0, wCommon, hEnemyCity,113 DpiBitBltCanvas(Back.Canvas, 4 * wCommon, 0, wCommon, hEnemyCity, 115 114 MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2, 116 115 (MainTexture.Height - hEnemyCity) div 2); … … 121 120 procedure TUnitStatDlg.FormShow(Sender: TObject); 122 121 var 123 owner, mix: integer;124 IsSpecialUnit: boolean;122 Owner, mix: Integer; 123 IsSpecialUnit: Boolean; 125 124 begin 126 125 if Kind in [dkEnemyUnit, dkEnemyCityDefense, dkEnemyCity] then … … 132 131 euixShow := MyRO.nEnemyUn - 1; 133 132 while (euixShow >= 0) and (MyRO.EnemyUn[euixShow].Loc <> UnitLoc) do 134 dec(euixShow);135 assert(euixShow >= 0);133 Dec(euixShow); 134 Assert(euixShow >= 0); 136 135 end; 137 136 with MyRO.EnemyUn[euixShow] do 138 137 begin 139 138 mox := @MyRO.EnemyModel[emix]; 140 if not Assigned(Tribe[ owner].ModelPicture[mix].HGr) then139 if not Assigned(Tribe[Owner].ModelPicture[mix].HGr) then 141 140 InitEnemyModel(emix); 142 end 141 end; 143 142 end 144 143 else … … 148 147 ecixShow := MyRO.nEnemyCity - 1; 149 148 while (ecixShow >= 0) and (MyRO.EnemyCity[ecixShow].Loc <> UnitLoc) do 150 dec(ecixShow);151 assert(ecixShow >= 0);149 Dec(ecixShow); 150 Assert(ecixShow >= 0); 152 151 end; 153 152 end; 154 153 case Kind of 155 dkOwnModel: 156 ClientHeight := hOwnModel; 157 dkOwnUnit: 158 ClientHeight := hEnemyUnit; 159 dkEnemyModel: 160 ClientHeight := hEnemyModel; 161 dkEnemyUnit: 162 ClientHeight := hEnemyUnit; 163 dkEnemyCityDefense: 164 ClientHeight := hEnemyCityDefense; 165 dkEnemyCity: 166 ClientHeight := hEnemyCity; 154 dkOwnModel: ClientHeight := hOwnModel; 155 dkOwnUnit: ClientHeight := hEnemyUnit; 156 dkEnemyModel: ClientHeight := hEnemyModel; 157 dkEnemyUnit: ClientHeight := hEnemyUnit; 158 dkEnemyCityDefense: ClientHeight := hEnemyCityDefense; 159 dkEnemyCity: ClientHeight := hEnemyCity; 167 160 end; 168 161 … … 171 164 Left := UserLeft; 172 165 Top := UserTop; 173 end 174 else 175 begin 166 end else begin 176 167 Left := (DpiScreen.Width - Width) div 2; 177 168 Top := (DpiScreen.Height - Height) div 2; 178 169 end; 179 170 180 SwitchBtn.Visible := not supervising and (Kind = dkOwnModel);181 ConscriptsBtn.Visible := not supervising and (Kind = dkOwnModel) and171 SwitchBtn.Visible := not Supervising and (Kind = dkOwnModel); 172 ConscriptsBtn.Visible := not Supervising and (Kind = dkOwnModel) and 182 173 (MyRO.Tech[adConscription] >= tsApplicable) and 183 174 (MyModel[mixShow].Domain = dGround) and (MyModel[mixShow].Kind < mkScout); 184 IsSpecialUnit := false;175 IsSpecialUnit := False; 185 176 if Kind in [dkEnemyCity, dkEnemyCityDefense] then 186 177 Caption := CityName(MyRO.EnemyCity[ecixShow].ID) … … 188 179 begin 189 180 case Kind of 190 dkOwnModel: 191 begin 192 owner := me; 193 mix := mixShow; 194 IsSpecialUnit := MyModel[mix].Kind >= $10; 195 end; 196 dkOwnUnit: 197 begin 198 owner := me; 199 mix := MyUn[uixShow].mix; 200 IsSpecialUnit := MyModel[mix].Kind >= $10; 201 end 202 else 203 begin 204 owner := mox.owner; 181 dkOwnModel: begin 182 Owner := Me; 183 mix := mixShow; 184 IsSpecialUnit := MyModel[mix].Kind >= $10; 185 end; 186 dkOwnUnit: begin 187 Owner := Me; 188 mix := MyUn[uixShow].mix; 189 IsSpecialUnit := MyModel[mix].Kind >= $10; 190 end; 191 else begin 192 Owner := mox.Owner; 205 193 mix := mox.mix; 206 194 IsSpecialUnit := mox.Kind >= $10; … … 218 206 end; 219 207 220 procedure TUnitStatDlg.ShowNewContent_OwnModel(NewMode , mix: integer);208 procedure TUnitStatDlg.ShowNewContent_OwnModel(NewMode: TWindowMode; mix: Integer); 221 209 begin 222 210 Kind := dkOwnModel; … … 225 213 end; 226 214 227 procedure TUnitStatDlg.ShowNewContent_OwnUnit(NewMode , uix: integer);215 procedure TUnitStatDlg.ShowNewContent_OwnUnit(NewMode: TWindowMode; uix: Integer); 228 216 begin 229 217 Kind := dkOwnUnit; … … 232 220 end; 233 221 234 procedure TUnitStatDlg.ShowNewContent_EnemyUnit(NewMode , euix: integer);222 procedure TUnitStatDlg.ShowNewContent_EnemyUnit(NewMode: TWindowMode; euix: Integer); 235 223 begin 236 224 Kind := dkEnemyUnit; … … 240 228 end; 241 229 242 procedure TUnitStatDlg.ShowNewContent_EnemyLoc(NewMode , Loc: integer);230 procedure TUnitStatDlg.ShowNewContent_EnemyLoc(NewMode: TWindowMode; Loc: Integer); 243 231 begin 244 232 Kind := dkEnemyUnit; … … 248 236 end; 249 237 250 procedure TUnitStatDlg.ShowNewContent_EnemyModel(NewMode , emix: integer);238 procedure TUnitStatDlg.ShowNewContent_EnemyModel(NewMode: TWindowMode; emix: Integer); 251 239 begin 252 240 Kind := dkEnemyModel; … … 255 243 end; 256 244 257 procedure TUnitStatDlg.ShowNewContent_EnemyCity(NewMode , Loc: integer);245 procedure TUnitStatDlg.ShowNewContent_EnemyCity(NewMode: TWindowMode; Loc: Integer); 258 246 begin 259 247 if MyMap[Loc] and fUnit <> 0 then … … 271 259 begin 272 260 UserLeft := Left; 273 UserTop := Top 274 end; 275 if OffscreenUser = self then261 UserTop := Top; 262 end; 263 if OffscreenUser = Self then 276 264 OffscreenUser := nil; 277 265 end; … … 286 274 PPicture: ^TModelPicture; 287 275 288 function IsToCount(emix: integer): boolean;276 function IsToCount(emix: Integer): Boolean; 289 277 var 290 278 PTestPicture: ^TModelPicture; … … 294 282 PTestPicture := @Tribe[MyRO.EnemyModel[emix].owner].ModelPicture 295 283 [MyRO.EnemyModel[emix].mix]; 296 result := (PPicture.HGr = PTestPicture.HGr) and284 Result := (PPicture.HGr = PTestPicture.HGr) and 297 285 (PPicture.pix = PTestPicture.pix) and 298 286 (ModelHash(mox^) = ModelHash(MyRO.EnemyModel[emix])); 299 287 end 300 288 else 301 result := (MyRO.EnemyModel[emix].owner = mox.owner) and289 Result := (MyRO.EnemyModel[emix].owner = mox.owner) and 302 290 (MyRO.EnemyModel[emix].mix = mox.mix); 303 291 end; 304 292 305 procedure FeatureBar(dst: TDpiBitmap; x, y: integer; const mi: TModelInfo;293 procedure FeatureBar(dst: TDpiBitmap; X, Y: Integer; const mi: TModelInfo; 306 294 T: TTexture); 307 295 var 308 i, w, dx, num: integer;309 s: string;310 begin 311 DarkGradient(dst.Canvas, x - 6, y+ 1, 180, 1);296 I, W, dx, num: Integer; 297 S: string; 298 begin 299 DarkGradient(dst.Canvas, X - 6, Y + 1, 180, 1); 312 300 with dst.Canvas do 313 301 if mi.Kind >= $10 then 314 302 begin 315 s:= Phrases.Lookup('UNITSPECIAL');303 S := Phrases.Lookup('UNITSPECIAL'); 316 304 Font.Color := $000000; 317 Textout( x - 1, y + 1, s);305 Textout(X - 1, Y + 1, S); 318 306 Font.Color := $B0B0B0; 319 Textout( x - 2, y, s);307 Textout(X - 2, Y, S); 320 308 end 321 309 else … … 323 311 Font.Color := $000000; 324 312 dx := 2; 325 for i:= 3 to nFeature - 1 do313 for I := 3 to nFeature - 1 do 326 314 begin 327 315 num := 0; 328 case iof316 case I of 329 317 mcSeaTrans: 330 318 if mi.Domain = dSea then … … 342 330 num := mi.TTrans; 343 331 mcFirstNonCap .. nFeature - 1: 344 if mi.Cap and (1 shl ( i- mcFirstNonCap)) <> 0 then345 num := 1 332 if mi.Cap and (1 shl (I - mcFirstNonCap)) <> 0 then 333 num := 1; 346 334 end; 347 335 if (num > 0) and 348 (( i<> mcSE) or (mi.Cap and (1 shl (mcNP - mcFirstNonCap)) = 0))336 ((I <> mcSE) or (mi.Cap and (1 shl (mcNP - mcFirstNonCap)) = 0)) 349 337 then 350 338 begin 351 339 if num > 1 then 352 340 begin 353 s:= IntToStr(num);354 w := TextWidth(s);341 S := IntToStr(num); 342 W := TextWidth(S); 355 343 Brush.Color := $FFFFFF; 356 FillRect(Rect( x - 3 + dx, y + 2, x + w - 1 + dx, y+ 16));344 FillRect(Rect(X - 3 + dx, Y + 2, X + W - 1 + dx, Y + 16)); 357 345 Brush.Style := bsClear; 358 Textout( x - 3 + dx + 1, y, s);359 inc(dx, w + 1)346 Textout(X - 3 + dx + 1, Y, S); 347 Inc(dx, W + 1); 360 348 end; 361 349 Brush.Color := $C0C0C0; 362 FrameRect(Rect( x - 3 + dx, y + 2, x + 11 + dx, y+ 16));350 FrameRect(Rect(X - 3 + dx, Y + 2, X + 11 + dx, Y + 16)); 363 351 Brush.Style := bsClear; 364 Sprite(dst, HGrSystem, x - 1 + dx, y+ 4, 10, 10,365 66 + i mod 11 * 11, 137 + idiv 11 * 11);366 inc(dx, 15)352 Sprite(dst, HGrSystem, X - 1 + dx, Y + 4, 10, 10, 353 66 + I mod 11 * 11, 137 + I div 11 * 11); 354 Inc(dx, 15); 367 355 end; 368 356 end; 369 357 end; 370 end; { featurebar }371 372 procedure NumberBarS(dst: TDpiBitmap; x, y: integer; Cap, s: string; T: TTexture);373 begin 374 DLine(dst.Canvas, x - 2, x + 170, y+ 16, T.ColorBevelShade, T.ColorBevelLight);375 LoweredTextOut(dst.Canvas, -1, T, x - 2, y, Cap);376 RisedTextout(dst.Canvas, x + 170 - BiColorTextWidth(dst.Canvas, s), y, s);358 end; 359 360 procedure NumberBarS(dst: TDpiBitmap; X, Y: Integer; Cap, S: string; T: TTexture); 361 begin 362 DLine(dst.Canvas, X - 2, X + 170, Y + 16, T.ColorBevelShade, T.ColorBevelLight); 363 LoweredTextOut(dst.Canvas, -1, T, X - 2, Y, Cap); 364 RisedTextout(dst.Canvas, X + 170 - BiColorTextWidth(dst.Canvas, S), Y, S); 377 365 end; 378 366 379 367 var 380 i, j, x, y, cix, uix, emix, InProd, Available, Destroyed, Loc, Cnt, yView,381 yTotal, yCaption: integer;382 s: string;368 I, J, X, Y, cix, uix, emix, InProd, Available, Destroyed, Loc, Cnt, yView, 369 yTotal, yCaption: Integer; 370 S: string; 383 371 ui: TUnitInfo; 384 372 mi: TModelInfo; … … 387 375 388 376 case Kind of 389 dkOwnModel: 390 begin 391 DpiBitCanvas(offscreen.Canvas, 0, 0, wCommon, hOwnModel, 392 Back.Canvas, 0, 0); 393 yView := 13; 394 yTotal := 92; 395 end; 396 dkEnemyModel: 397 begin 398 DpiBitCanvas(offscreen.Canvas, 0, 0, wCommon, hEnemyModel, 399 Back.Canvas, wCommon, 0); 400 yView := 13; 401 yTotal := 92; 402 end; 403 dkEnemyUnit, dkOwnUnit: 404 begin 405 DpiBitCanvas(offscreen.Canvas, 0, 0, wCommon, hEnemyUnit, 406 Back.Canvas, 2 * wCommon, 0); 407 yView := 13; 408 yTotal := 123; 409 end; 410 dkEnemyCityDefense: 411 begin 412 DpiBitCanvas(offscreen.Canvas, 0, 0, wCommon, hEnemyCityDefense, 413 Back.Canvas, 3 * wCommon, 0); 414 yView := 171; 415 yTotal := 231; 416 end; 417 dkEnemyCity: 418 begin 419 DpiBitCanvas(offscreen.Canvas, 0, 0, wCommon, hEnemyCity, 420 Back.Canvas, 4 * wCommon, 0); 421 end; 377 dkOwnModel: begin 378 DpiBitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hOwnModel, 379 Back.Canvas, 0, 0); 380 yView := 13; 381 yTotal := 92; 382 end; 383 dkEnemyModel: begin 384 DpiBitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyModel, 385 Back.Canvas, wCommon, 0); 386 yView := 13; 387 yTotal := 92; 388 end; 389 dkEnemyUnit, dkOwnUnit: begin 390 DpiBitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyUnit, 391 Back.Canvas, 2 * wCommon, 0); 392 yView := 13; 393 yTotal := 123; 394 end; 395 dkEnemyCityDefense: begin 396 DpiBitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyCityDefense, 397 Back.Canvas, 3 * wCommon, 0); 398 yView := 171; 399 yTotal := 231; 400 end; 401 dkEnemyCity: begin 402 DpiBitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyCity, 403 Back.Canvas, 4 * wCommon, 0); 404 end; 422 405 end; 423 406 MarkUsedOffscreen(ClientWidth, ClientHeight); … … 427 410 begin // show city defense facilities 428 411 Cnt := 0; 429 for i:= 0 to 3 do430 if MyRO.EnemyCity[ecixShow].Flags and (2 shl i) <> 0 then431 inc(Cnt);432 x:= (wCommon - Cnt * xSizeSmall) div 2 - (Cnt - 1) * 2;433 for i:= 0 to 3 do434 if MyRO.EnemyCity[ecixShow].Flags and (2 shl i) <> 0 then435 begin 436 case iof437 0: j:= imWalls;438 1: j:= imCoastalFort;439 2: j:= imMissileBat;440 3: j := imBunker412 for I := 0 to 3 do 413 if MyRO.EnemyCity[ecixShow].Flags and (2 shl I) <> 0 then 414 Inc(Cnt); 415 X := (wCommon - Cnt * xSizeSmall) div 2 - (Cnt - 1) * 2; 416 for I := 0 to 3 do 417 if MyRO.EnemyCity[ecixShow].Flags and (2 shl I) <> 0 then 418 begin 419 case I of 420 0: J := imWalls; 421 1: J := imCoastalFort; 422 2: J := imMissileBat; 423 3: J := imBunker; 441 424 end; 442 Frame( offscreen.Canvas, x - 1, yImp - 1, x+ xSizeSmall,425 Frame(Offscreen.Canvas, X - 1, yImp - 1, X + xSizeSmall, 443 426 yImp + ySizeSmall, MainTexture.ColorBevelLight, 444 427 MainTexture.ColorBevelShade); 445 DpiBit Canvas(offscreen.Canvas, x, yImp, xSizeSmall, ySizeSmall,446 SmallImp.Canvas, jmod 7 * xSizeSmall,447 ( j+ SystemIconLines * 7) div 7 * ySizeSmall);448 inc(x, xSizeSmall + 4);428 DpiBitBltCanvas(Offscreen.Canvas, X, yImp, xSizeSmall, ySizeSmall, 429 SmallImp.Canvas, J mod 7 * xSizeSmall, 430 (J + SystemIconLines * 7) div 7 * ySizeSmall); 431 Inc(X, xSizeSmall + 4); 449 432 end; 450 433 end; … … 454 437 PPicture := @Tribe[mox.owner].ModelPicture[mox.mix]; 455 438 Available := 0; 456 if G.Difficulty[ me] = 0 then // supervisor -- count stacked units too439 if G.Difficulty[Me] = 0 then // supervisor -- count stacked units too 457 440 for Loc := 0 to G.lx * G.ly - 1 do 458 441 begin 459 442 if MyMap[Loc] and fUnit <> 0 then 460 443 begin 461 Server(sGetUnits, me, Loc, Cnt);444 Server(sGetUnits, Me, Loc, Cnt); 462 445 for uix := 0 to Cnt - 1 do 463 446 if IsToCount(MyRO.EnemyUn[MyRO.nEnemyUn + uix].emix) then 464 inc(Available);447 Inc(Available); 465 448 end; 466 449 end … … 469 452 if (MyRO.EnemyUn[uix].Loc >= 0) and IsToCount(MyRO.EnemyUn[uix].emix) 470 453 then 471 inc(Available);454 Inc(Available); 472 455 Destroyed := 0; 473 456 for emix := 0 to MyRO.nEnemyModel - 1 do 474 457 if IsToCount(emix) then 475 inc(Destroyed, MyRO.EnemyModel[emix].Lost);458 Inc(Destroyed, MyRO.EnemyModel[emix].Lost); 476 459 end 477 460 else … … 480 463 for uix := 0 to MyRO.nUn - 1 do 481 464 if (MyUn[uix].Loc >= 0) and (MyUn[uix].mix = mixShow) then 482 inc(Available);465 Inc(Available); 483 466 InProd := 0; 484 467 for cix := 0 to MyRO.nCity - 1 do 485 468 if (MyCity[cix].Loc >= 0) and 486 469 (MyCity[cix].Project and (cpImp + cpIndex) = mixShow) then 487 inc(InProd);488 end; 489 490 offscreen.Canvas.Font.Assign(UniFont[ftSmall]);470 Inc(InProd); 471 end; 472 473 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 491 474 if Kind in [dkEnemyCityDefense, dkEnemyCity] then 492 475 begin 493 NoMap.SetOutput( offscreen);494 NoMap.PaintCity(ClientWidth div 2, 53, MyRO.EnemyCity[ecixShow], false);495 496 s:= Tribe[MyRO.EnemyCity[ecixShow].owner].TPhrase('UNITOWNER');497 LoweredTextOut( offscreen.Canvas, -1, MainTexture,498 (ClientWidth - BiColorTextWidth( offscreen.Canvas, s)) div 2, 105, s);476 NoMap.SetOutput(Offscreen); 477 NoMap.PaintCity(ClientWidth div 2, 53, MyRO.EnemyCity[ecixShow], False); 478 479 S := Tribe[MyRO.EnemyCity[ecixShow].owner].TPhrase('UNITOWNER'); 480 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, 481 (ClientWidth - BiColorTextWidth(Offscreen.Canvas, S)) div 2, 105, S); 499 482 end; 500 483 … … 502 485 begin // show unit stats 503 486 if Kind = dkOwnModel then 504 MakeModelInfo( me, mixShow, MyModel[mixShow], mi)487 MakeModelInfo(Me, mixShow, MyModel[mixShow], mi) 505 488 else if Kind = dkOwnUnit then 506 489 begin 507 MakeUnitInfo( me, MyUn[uixShow], ui);508 MakeModelInfo( me, MyUn[uixShow].mix, MyModel[MyUn[uixShow].mix], mi);490 MakeUnitInfo(Me, MyUn[uixShow], ui); 491 MakeModelInfo(Me, MyUn[uixShow].mix, MyModel[MyUn[uixShow].mix], mi); 509 492 end 510 493 else … … 522 505 { Frame(offscreen.canvas,xView-1,yView-1,xView+64,yView+48, 523 506 MainTexture.ColorBevelShade,MainTexture.ColorBevelLight); 524 RFrame( offscreen.canvas,xView-2,yView-2,xView+65,yView+49,507 RFrame(Offscreen.Canvas,xView-2,yView-2,xView+65,yView+49, 525 508 MainTexture.ColorBevelShade,MainTexture.ColorBevelLight); } 526 with offscreen.Canvas do509 with Offscreen.Canvas do 527 510 begin 528 511 Brush.Color := HGrSystem.Data.Canvas.Pixels[98, 67]; 529 offscreen.Canvas.FillRect(Rect(xView, yView, xView + 64,512 Offscreen.Canvas.FillRect(Rect(xView, yView, xView + 64, 530 513 yView + 16)); 531 514 Brush.Style := bsClear; … … 534 517 if MyMap[Loc] and fTerrain >= fForest then 535 518 begin 536 x:= 1 + 2 * (xxt * 2 + 1);537 y:= 1 + yyt + 2 * (yyt * 3 + 1);519 X := 1 + 2 * (xxt * 2 + 1); 520 Y := 1 + yyt + 2 * (yyt * 3 + 1); 538 521 end 539 522 else 540 523 begin 541 x := integer(MyMap[Loc] and fTerrain) * (xxt * 2 + 1) + 1;542 y:= 1 + yyt;524 X := Integer(MyMap[Loc] and fTerrain) * (xxt * 2 + 1) + 1; 525 Y := 1 + yyt; 543 526 end; 544 for j:= -1 to 1 do545 for i:= -1 to 1 do546 if ( i + j) and 1 = 0 then527 for J := -1 to 1 do 528 for I := -1 to 1 do 529 if (I + J) and 1 = 0 then 547 530 begin 548 Sprite(Buffer, HGrTerrain, i * xxt, j* yyt, xxt * 2,549 yyt * 2, x, y);531 Sprite(Buffer, HGrTerrain, I * xxt, J * yyt, xxt * 2, 532 yyt * 2, X, Y); 550 533 if MyMap[Loc] and (fTerrain or fSpecial) = fGrass or fSpecial1 551 534 then 552 Sprite(Buffer, HGrTerrain, i * xxt, j* yyt, xxt * 2, yyt * 2,535 Sprite(Buffer, HGrTerrain, I * xxt, J * yyt, xxt * 2, yyt * 2, 553 536 1 + 2 * (xxt * 2 + 1), 1 + yyt + 1 * (yyt * 3 + 1)) 554 537 else if (MyMap[Loc] and fTerrain = fForest) and 555 538 IsJungle(Loc div G.lx) then 556 Sprite(Buffer, HGrTerrain, i * xxt, j* yyt, xxt * 2, yyt * 2,539 Sprite(Buffer, HGrTerrain, I * xxt, J * yyt, xxt * 2, yyt * 2, 557 540 1 + 7 * (xxt * 2 + 1), 1 + yyt + 19 * (yyt * 3 + 1)) 558 541 else if MyMap[Loc] and fTerrain >= fForest then 559 Sprite(Buffer, HGrTerrain, i * xxt, j* yyt, xxt * 2, yyt * 2,542 Sprite(Buffer, HGrTerrain, I * xxt, J * yyt, xxt * 2, yyt * 2, 560 543 1 + 7 * (xxt * 2 + 1), 561 1 + yyt + 2 * integer(2 + MyMap[Loc] and fTerrain - fForest)544 1 + yyt + 2 * Integer(2 + MyMap[Loc] and fTerrain - fForest) 562 545 * (yyt * 3 + 1)); 563 546 end; 564 DpiBit Canvas(offscreen.Canvas, xView, yView + 16, 64, 32,547 DpiBitBltCanvas(Offscreen.Canvas, xView, yView + 16, 64, 32, 565 548 Buffer.Canvas, 1, 0); 566 549 567 550 // show unit, experience and health 568 Sprite( offscreen, HGr, xView, yView, 64, 48, pix mod 10 * 65 + 1,551 Sprite(Offscreen, HGr, xView, yView, 64, 48, pix mod 10 * 65 + 1, 569 552 pix div 10 * 49 + 1); 570 553 if Flags and unFortified <> 0 then 571 Sprite( offscreen, HGrStdUnits, xView, yView, xxu * 2, yyu * 2,554 Sprite(Offscreen, HGrStdUnits, xView, yView, xxu * 2, yyu * 2, 572 555 1 + 6 * (xxu * 2 + 1), 1); 573 FrameImage( offscreen.Canvas, HGrSystem.Data, xView - 20,556 FrameImage(Offscreen.Canvas, HGrSystem.Data, xView - 20, 574 557 yView + 5, 12, 14, 121 + Exp div ExpCost * 13, 28); 575 558 if Health < 100 then 576 559 begin 577 s:= IntToStr(Health) + '%';578 LightGradient( offscreen.Canvas, xView - 45, yView + 24, 38,560 S := IntToStr(Health) + '%'; 561 LightGradient(Offscreen.Canvas, xView - 45, yView + 24, 38, 579 562 (ColorOfHealth(Health) and $FEFEFE shr 2) * 3); 580 RisedTextout( offscreen.Canvas, xView - 45 + 20 -581 BiColorTextWidth( offscreen.Canvas, s) div 2, yView + 23, s);563 RisedTextout(Offscreen.Canvas, xView - 45 + 20 - 564 BiColorTextWidth(Offscreen.Canvas, S) div 2, yView + 23, S); 582 565 end; 583 566 584 567 if Kind = dkEnemyUnit then 585 568 begin 586 s:= Tribe[mox.owner].TPhrase('UNITOWNER');587 LoweredTextOut( offscreen.Canvas, -1, MainTexture,588 (ClientWidth - BiColorTextWidth( offscreen.Canvas, s)) div 2,589 yView + 80, s);569 S := Tribe[mox.owner].TPhrase('UNITOWNER'); 570 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, 571 (ClientWidth - BiColorTextWidth(Offscreen.Canvas, S)) div 2, 572 yView + 80, S); 590 573 end; 591 574 end 592 575 else 593 576 begin 594 FrameImage( offscreen.Canvas, BigImp, xView + 4, yView, 56, 40, 0, 0);595 Sprite( offscreen, HGr, xView, yView - 4, 64, 44, pix mod 10 * 65 + 1,577 FrameImage(Offscreen.Canvas, BigImp, xView + 4, yView, 56, 40, 0, 0); 578 Sprite(Offscreen, HGr, xView, yView - 4, 64, 44, pix mod 10 * 65 + 1, 596 579 pix div 10 * 49 + 1); 597 580 end; 598 581 599 DarkGradient( offscreen.Canvas, xTotal - 6, yTotal + 1, 180, 2);600 RisedTextout( offscreen.Canvas, xTotal - 2, yTotal,582 DarkGradient(Offscreen.Canvas, xTotal - 6, yTotal + 1, 180, 2); 583 RisedTextout(Offscreen.Canvas, xTotal - 2, yTotal, 601 584 Phrases.Lookup('UNITSTRENGTH')); 602 s:= IntToStr(mi.Attack) + '/' + IntToStr(mi.Defense);603 RisedTextout( offscreen.Canvas,604 xTotal + 170 - BiColorTextWidth( offscreen.Canvas, s), yTotal, s);605 FeatureBar( offscreen, xTotal, yTotal + 19, mi, MainTexture);606 NumberBarS( offscreen, xTotal, yTotal + 38, Phrases.Lookup('UNITSPEED'),585 S := IntToStr(mi.Attack) + '/' + IntToStr(mi.Defense); 586 RisedTextout(Offscreen.Canvas, 587 xTotal + 170 - BiColorTextWidth(Offscreen.Canvas, S), yTotal, S); 588 FeatureBar(Offscreen, xTotal, yTotal + 19, mi, MainTexture); 589 NumberBarS(Offscreen, xTotal, yTotal + 38, Phrases.Lookup('UNITSPEED'), 607 590 MovementToString(mi.Speed), MainTexture); 608 LoweredTextOut( offscreen.Canvas, -1, MainTexture, xTotal - 2, yTotal + 57,591 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2, yTotal + 57, 609 592 Phrases.Lookup('UNITCOST')); 610 DLine( offscreen.Canvas, xTotal - 2, xTotal + 170, yTotal + 57 + 16,593 DLine(Offscreen.Canvas, xTotal - 2, xTotal + 170, yTotal + 57 + 16, 611 594 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 612 if G.Difficulty[ me] = 0 then613 s:= IntToStr(mi.cost)595 if G.Difficulty[Me] = 0 then 596 S := IntToStr(mi.cost) 614 597 else 615 s := IntToStr(mi.cost * BuildCostMod[G.Difficulty[me]] div 12);616 RisedTextout( offscreen.Canvas,617 xTotal + 159 - BiColorTextWidth( offscreen.Canvas, s), yTotal + 57, s);618 Sprite( offscreen, HGrSystem, xTotal + 160, yTotal + 57 + 5, 10,598 S := IntToStr(mi.cost * BuildCostMod[G.Difficulty[Me]] div 12); 599 RisedTextout(Offscreen.Canvas, 600 xTotal + 159 - BiColorTextWidth(Offscreen.Canvas, S), yTotal + 57, S); 601 Sprite(Offscreen, HGrSystem, xTotal + 160, yTotal + 57 + 5, 10, 619 602 10, 88, 115); 620 603 … … 624 607 begin 625 608 if MyModel[mixShow].Kind = mkEnemyDeveloped then 626 LoweredTextOut( offscreen.Canvas, -1, MainTexture, xTotal - 2,609 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2, 627 610 (yTotal + StatDown - 19), Phrases.Lookup('UNITADOPT')) 628 611 else 629 LoweredTextOut( offscreen.Canvas, -1, MainTexture, xTotal - 2,612 LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2, 630 613 (yTotal + StatDown - 19), Phrases.Lookup('UNITINTRO')); 631 DLine( offscreen.Canvas, xTotal - 2, xTotal + 170,614 DLine(Offscreen.Canvas, xTotal - 2, xTotal + 170, 632 615 (yTotal + StatDown - 19) + 16, MainTexture.ColorTextShade, 633 616 MainTexture.ColorTextLight); 634 s:= TurnToString(MyModel[mixShow].IntroTurn);635 RisedTextout( offscreen.Canvas,636 xTotal + 170 - BiColorTextWidth( offscreen.Canvas, s),637 (yTotal + StatDown - 19), s);617 S := TurnToString(MyModel[mixShow].IntroTurn); 618 RisedTextout(Offscreen.Canvas, 619 xTotal + 170 - BiColorTextWidth(Offscreen.Canvas, S), 620 (yTotal + StatDown - 19), S); 638 621 end; 639 622 640 NumberBar( offscreen, xTotal, yTotal + StatDown,623 NumberBar(Offscreen, xTotal, yTotal + StatDown, 641 624 Phrases.Lookup('UNITBUILT'), MyModel[mixShow].Built, MainTexture); 642 625 if MyModel[mixShow].Lost > 0 then 643 NumberBar( offscreen, xTotal, yTotal + StatDown + 19,626 NumberBar(Offscreen, xTotal, yTotal + StatDown + 19, 644 627 Phrases.Lookup('UNITLOST'), MyModel[mixShow].Lost, MainTexture); 645 628 if InProd > 0 then 646 NumberBar( offscreen, xTotal, yTotal + StatDown + 57,629 NumberBar(Offscreen, xTotal, yTotal + StatDown + 57, 647 630 Phrases.Lookup('UNITINPROD'), InProd, MainTexture); 648 631 if Available > 0 then 649 NumberBar( offscreen, xTotal, yTotal + StatDown + 38,632 NumberBar(Offscreen, xTotal, yTotal + StatDown + 38, 650 633 Phrases.Lookup('UNITAVAILABLE'), Available, MainTexture); 651 634 … … 674 657 begin 675 658 if Destroyed > 0 then 676 NumberBar( offscreen, xTotal, yTotal + StatDown - 19,659 NumberBar(Offscreen, xTotal, yTotal + StatDown - 19, 677 660 Phrases.Lookup('UNITDESTROYED'), Destroyed, MainTexture); 678 661 if Available > 0 then 679 NumberBar( offscreen, xTotal, yTotal + StatDown,662 NumberBar(Offscreen, xTotal, yTotal + StatDown, 680 663 Phrases.Lookup('UNITKNOWN'), Available, MainTexture); 681 664 end; … … 683 666 end; 684 667 685 offscreen.Canvas.Font.Assign(UniFont[ftNormal]);668 Offscreen.Canvas.Font.Assign(UniFont[ftNormal]); 686 669 case Kind of 687 670 dkOwnModel, dkEnemyModel: … … 692 675 yCaption := 79; 693 676 end; 694 RisedTextout( offscreen.Canvas,695 (ClientWidth - BiColorTextWidth( offscreen.Canvas, Caption)) div 2,677 RisedTextout(Offscreen.Canvas, 678 (ClientWidth - BiColorTextWidth(Offscreen.Canvas, Caption)) div 2, 696 679 yCaption, Caption); 697 end; { OffscreenPaint }680 end; 698 681 699 682 procedure TUnitStatDlg.ModelBoxChange(Sender: TObject); … … 734 717 procedure TUnitStatDlg.HelpBtnClick(Sender: TObject); 735 718 begin 736 HelpDlg.ShowNewContent(wmPersistent, hkModel, 0);719 MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkModel, 0); 737 720 end; 738 721 -
branches/highdpi/LocalPlayer/Wonders.pas
r361 r465 23 23 Selection: Integer; 24 24 Center: TPoint; 25 procedure DarkIcon( i: Integer);26 procedure Glow( i, GlowColor: Integer);25 procedure DarkIcon(I: Integer); 26 procedure Glow(I, GlowColor: Integer); 27 27 procedure PaintBackgroundShape; 28 28 public 29 29 procedure OffscreenPaint; override; 30 procedure ShowNewContent(NewMode: Integer); 31 end; 32 33 var 34 WondersDlg: TWondersDlg; 30 procedure ShowNewContent(NewMode: TWindowMode); 31 end; 35 32 36 33 … … 38 35 39 36 uses 40 Term, ClientTools, Help, Tribes, UPixelPointer;37 Term, ClientTools, Help, Tribes, PixelPointer; 41 38 42 39 {$R *.lfm} … … 76 73 procedure TWondersDlg.FormShow(Sender: TObject); 77 74 begin 75 Caption := Phrases.Lookup('TITLE_WONDERS'); 78 76 Selection := -1; 79 77 OffscreenPaint; 80 78 end; 81 79 82 procedure TWondersDlg.ShowNewContent(NewMode: Integer);80 procedure TWondersDlg.ShowNewContent(NewMode: TWindowMode); 83 81 begin 84 82 inherited ShowNewContent(NewMode); … … 109 107 Height := ScaleToNative(128); 110 108 Offscreen.BeginUpdate; 111 Line[0] := PixelPointer(Offscreen, ScaleToNative(Center.X), ScaleToNative(Center.Y));112 Line[1] := PixelPointer(Offscreen, ScaleToNative(Center.X), ScaleToNative(Center.Y) - 1);113 Line[2] := PixelPointer(Offscreen, ScaleToNative(Center.X) - 1, ScaleToNative(Center.Y));114 Line[3] := PixelPointer(Offscreen, ScaleToNative(Center.X) - 1, ScaleToNative(Center.Y) - 1);109 Line[0] := TPixelPointer.Create(Offscreen, ScaleToNative(Center.X), ScaleToNative(Center.Y)); 110 Line[1] := TPixelPointer.Create(Offscreen, ScaleToNative(Center.X), ScaleToNative(Center.Y) - 1); 111 Line[2] := TPixelPointer.Create(Offscreen, ScaleToNative(Center.X) - 1, ScaleToNative(Center.Y)); 112 Line[3] := TPixelPointer.Create(Offscreen, ScaleToNative(Center.X) - 1, ScaleToNative(Center.Y) - 1); 115 113 for Y := 0 to Height - 1 do begin 116 114 for X := 0 to Width - 1 do begin 117 r:= X * X * ((Height div 4) * (Height div 4)) + Y * Y * ((Width div 4) * (Width div 4));115 R := X * X * ((Height div 4) * (Height div 4)) + Y * Y * ((Width div 4) * (Width div 4)); 118 116 ax := ((1 shl 16 div (Height div 4)) * (Width div 4)) * Y; 119 if ( r< ScaleToNative(8) * Height * Width * Width) and120 (( r>= (Height div 4) * (Height div 2) * (Width div 2) * (Width div 2)) and (ax < amax2 * X) and117 if (R < ScaleToNative(8) * Height * Width * Width) and 118 ((R >= (Height div 4) * (Height div 2) * (Width div 2) * (Width div 2)) and (ax < amax2 * X) and 121 119 ((ax < amax0 * X) or (ax > amin2 * X)) or (ax > amin1 * X) and 122 120 ((ax < amax1 * X) or (ax > amin3 * X))) then begin 123 121 for ch := 0 to 2 do begin 124 c:= Line[0].Pixel^.Planes[ch] - Darken;125 if c< 0 then Line[0].Pixel^.Planes[ch] := 0126 else Line[0].Pixel^.Planes[ch] := c;127 c:= Line[1].Pixel^.Planes[ch] - Darken;128 if c< 0 then Line[1].Pixel^.Planes[ch] := 0129 else Line[1].Pixel^.Planes[ch] := c;130 c:= Line[2].Pixel^.Planes[ch] - Darken;131 if c< 0 then Line[2].Pixel^.Planes[ch] := 0132 else Line[2].Pixel^.Planes[ch] := c;133 c:= Line[3].Pixel^.Planes[ch] - Darken;134 if c< 0 then Line[3].Pixel^.Planes[ch] := 0135 else Line[3].Pixel^.Planes[ch] := c;122 C := Line[0].Pixel^.Planes[ch] - Darken; 123 if C < 0 then Line[0].Pixel^.Planes[ch] := 0 124 else Line[0].Pixel^.Planes[ch] := C; 125 C := Line[1].Pixel^.Planes[ch] - Darken; 126 if C < 0 then Line[1].Pixel^.Planes[ch] := 0 127 else Line[1].Pixel^.Planes[ch] := C; 128 C := Line[2].Pixel^.Planes[ch] - Darken; 129 if C < 0 then Line[2].Pixel^.Planes[ch] := 0 130 else Line[2].Pixel^.Planes[ch] := C; 131 C := Line[3].Pixel^.Planes[ch] - Darken; 132 if C < 0 then Line[3].Pixel^.Planes[ch] := 0 133 else Line[3].Pixel^.Planes[ch] := C; 136 134 end; 137 135 end; … … 149 147 end; 150 148 151 procedure TWondersDlg.DarkIcon( i: Integer);149 procedure TWondersDlg.DarkIcon(I: Integer); 152 150 var 153 X, Y, ch, x0Dst, y0Dst, x0Src, y0Src, darken, c: Integer;151 X, Y, ch, x0Dst, y0Dst, x0Src, y0Src, darken, C: Integer; 154 152 Src, Dst: TPixelPointer; 155 153 begin 156 154 Offscreen.BeginUpdate; 157 x0Dst := ClientWidth div 2 - xSizeBig div 2 + RingPosition[ i].X;158 y0Dst := ClientHeight div 2 - ySizeBig div 2 + RingPosition[ i].Y;159 x0Src := ( imod 7) * xSizeBig;160 y0Src := ( idiv 7 + SystemIconLines) * ySizeBig;161 Src := PixelPointer(BigImp, ScaleToNative(x0Src), ScaleToNative(y0Src));162 Dst := PixelPointer(Offscreen, ScaleToNative(x0Dst), ScaleToNative(y0Dst));155 x0Dst := ClientWidth div 2 - xSizeBig div 2 + RingPosition[I].X; 156 y0Dst := ClientHeight div 2 - ySizeBig div 2 + RingPosition[I].Y; 157 x0Src := (I mod 7) * xSizeBig; 158 y0Src := (I div 7 + SystemIconLines) * ySizeBig; 159 Src := TPixelPointer.Create(BigImp, ScaleToNative(x0Src), ScaleToNative(y0Src)); 160 Dst := TPixelPointer.Create(Offscreen, ScaleToNative(x0Dst), ScaleToNative(y0Dst)); 163 161 for Y := 0 to ScaleToNative(ySizeBig) - 1 do begin 164 162 for X := 0 to ScaleToNative(xSizeBig) - 1 do begin … … 166 164 15 + (255 - Src.Pixel^.R) * 9) div 128; 167 165 for ch := 0 to 2 do begin 168 c:= Dst.Pixel^.Planes[ch] - Darken;169 if c< 0 then Dst.Pixel^.Planes[ch] := 0170 else Dst.Pixel^.Planes[ch] := c;166 C := Dst.Pixel^.Planes[ch] - Darken; 167 if C < 0 then Dst.Pixel^.Planes[ch] := 0 168 else Dst.Pixel^.Planes[ch] := C; 171 169 end; 172 170 Src.NextPixel; … … 179 177 end; 180 178 181 procedure TWondersDlg.Glow( i, GlowColor: Integer);179 procedure TWondersDlg.Glow(I, GlowColor: Integer); 182 180 begin 183 181 GlowFrame(Offscreen, 184 ClientWidth div 2 - xSizeBig div 2 + RingPosition[ i].X,185 ClientHeight div 2 - ySizeBig div 2 + RingPosition[ i].Y,182 ClientWidth div 2 - xSizeBig div 2 + RingPosition[I].X, 183 ClientHeight div 2 - ySizeBig div 2 + RingPosition[I].Y, 186 184 xSizeBig, ySizeBig, GlowColor); 187 185 end; … … 235 233 WonderDestroyed: begin 236 234 HaveWonder := True; 237 DpiBit Canvas(Offscreen.Canvas,235 DpiBitBltCanvas(Offscreen.Canvas, 238 236 Center.X - xSizeBig div 2 + RingPosition[I].X, 239 237 Center.Y - ySizeBig div 2 + RingPosition[I].Y, xSizeBig, … … 243 241 else begin 244 242 HaveWonder := True; 245 DpiBit Canvas(Offscreen.Canvas,243 DpiBitBltCanvas(Offscreen.Canvas, 246 244 Center.X - xSizeBig div 2 + RingPosition[I].X, 247 245 Center.Y - ySizeBig div 2 + RingPosition[I].Y, xSizeBig, ySizeBig, … … 280 278 281 279 MarkUsedOffscreen(ClientWidth, ClientHeight); 282 end; { OffscreenPaint }280 end; 283 281 284 282 procedure TWondersDlg.CloseBtnClick(Sender: TObject); … … 350 348 begin 351 349 if Selection >= 0 then 352 HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp, Selection);350 MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, Selection); 353 351 end; 354 352 -
branches/highdpi/Localization/cs/Help/Help.txt
r464 r465 1 #HELPTITLE_MAIN Manuál1 #HELPTITLE_MAIN Příručka 2 2 #HELPTITLE_QUICKSTART Rychlý start 3 3 #HELPTITLE_CONCEPTS Koncepce hry … … 65 65 #DEFBONUS Bonus k obraně: %d%% 66 66 #JOBCOST -Cena konstrukce: %s MP 67 #JOBCOSTVAR -Cena konstrukce: proměnná (viz okno Vylepšení terénu v Makro managementu)67 #JOBCOSTVAR -Cena konstrukce: proměnná (viz okno Vylepšení terénu v Makro správy) 68 68 #TERIMPEXCLUDE Zavlažování, důl, pevnost a vojenská základna se navzájem vylučují. 69 69 Například pokud postavíte vojenskou základnu na čtverci s pevností, … … 133 133 134 134 !Pokročilé\ 135 ;MACRO Makro Management\135 ;MACRO Makro správa\ 136 136 ;MAPEDIT Editor map\ 137 137 ;AIT Turnaj AI … … 168 168 hře. Nejjednodušším způsobem jak vyvinout vlastní AI je použít šablonu C#. Můžete ji najít ve složce s 169 169 nainstalovanou hrou.\ 170 ::E1 Manuálnávrhu AI\\170 ::E1 Příručka návrhu AI\\ 171 171 172 172 !Systémové požadavky\ … … 175 175 176 176 !Parametry příkazové řádky\ 177 --man ... zobrazí pouze manuál\\177 --man ... zobrazí pouze příručku\\ 178 178 179 179 !Odinstalace\ … … 188 188 -se podívat, zda nebyla uvolněna novější verze programu, než kterou máte. V ní totiž 189 189 může být problém odstraněn, především jedná-li se o významnou chybu.\ 190 -si prečíst příslušnou stránku manuálu. Možná se nejedná o chybu. (Tato hra není190 -si prečíst příslušnou stránku příručky. Možná se nejedná o chybu. (Tato hra není 191 191 klon Civilization II!)\ 192 192 -se ujistit, že se nejedná o problém s instalací nebo s některým doplňkem hry vytvořeným … … 242 242 !!Rychlý start\ 243 243 244 Základní tipy pro zahájení hraní bez čtení manuálu:\\244 Základní tipy pro zahájení hraní bez čtení příručky:\\ 245 245 246 246 -Toto je tahová hra. Zatímco jeden národ vykonává činnosti v rámci svého tahu, všechny ostatní … … 262 262 je stavba městských projektů. Klikněte na obrázek projektu uprostřed okna 263 263 a vyberte nový projekt, např. začněte vyrábět nové Osadníky pro založení nových měst.\ 264 -Na vaš em managementuzávisí, jak rychle města produkují, jak rychle rostou a kolik daní odvádějí264 -Na vaší správě závisí, jak rychle města produkují, jak rychle rostou a kolik daní odvádějí 265 265 do vaší pokladnice, jak rychle probíhá vědecký výzkum.\ 266 266 -Kliknutím na položku se zmáčknutou klávesou Shift zobrazíte nápovědu o dané položce.\\ … … 745 745 746 746 Na konci návrhu je síla útoku, síla obrany a transportní kapacita nové 747 třídy jednotek vypočítána podle vzorce "základní hodnota × modifikátor". Pokud hrajete na nízké 747 třídy jednotek vypočítána podle vzorce "základní hodnota × modifikátor". Pokud hrajete na nízké 748 748 resp. vysoké úrovni obtížnosti, jsou náklady na výrobu jednotek sníženy resp. 749 749 zvýšeny o 25%. … … 851 851 !Obchod\ 852 852 Tento zdroj (symbol: %t) zastupuje vše, co má hodnotu při obchodování. 853 Obchod je 853 Obchod je 854 854 produkován pouze na čtvercích na městském území, ne na samotném čtverci 855 855 s městem - ani v případě, že na tomto čtverci je umístěn zdroj se zlatem. … … 875 875 v dalším tahu.\\ 876 876 877 !Automatick ý managementpopulace\877 !Automatická správa populace\ 878 878 Přidělování skupin městského obyvatelstva ke čtvercům na městském území a 879 do civilní služby se děje automaticky a optimálně. Hráč potřebuje pouze nastavit 879 do civilní služby se děje automaticky a optimálně. Hráč potřebuje pouze nastavit 880 880 priority pomocí primárního přepínače (9). K dispozici je 5 881 881 pozic:\ … … 910 910 911 911 !Plná kontrola\ 912 Pokud z nějakých důvodů nechcete používat automatick ý managementpopulace,912 Pokud z nějakých důvodů nechcete používat automatickou správu populace, 913 913 můžete jej vypnout kliknutím na primární přepínač ve spodní části nebo 914 914 kliknutím na území města. Tím je vám umožněno ručně vybrat čtverce, které se budou … … 919 919 krocích.\\ 920 920 921 Pokud je automatick ý management vypnutý, musíte se starat o vše921 Pokud je automatická správa vypnutá, musíte se starat o vše 922 922 sami: zásobu jídla, podporu jednotek, civilní nepokoje. Můžete narazit na 923 923 problémy, které jste předtím neměli.\\ … … 930 930 podporu, dokud není ve městě nastolen pořádek.\\ 931 931 932 Automatick ý managementpopulace obvykle zabraňuje civilním nepořádkům. Nedokáže932 Automatická správa populace obvykle zabraňuje civilním nepořádkům. Nedokáže 933 933 ale zvládnout situaci, kdy je ve městě už příliš mnoho nespokojenosti. Pokud 934 934 zaznamenáte nepokoje v automaticky spravovaném městě, zmenšete nespokojenost přesunem jednotek 935 935 způsobujících nepokoje do oblasti, kde tento jev zmizí, nebo tyto jednotky rozpusťte.\\ 936 936 937 Pokud vypnete automatick ý management, je pouze na vás, jak udržíte dostatečnou míru spokojenosti937 Pokud vypnete automatickou správu, je pouze na vás, jak udržíte dostatečnou míru spokojenosti 938 938 ve městě. Nejčastější reakcí na potlačení nepokojů je 939 939 posílení policejních sil. … … 946 946 947 947 Korupce ve městě je vypočítávána podle tohoto vzorce:\ 948 @C ORRUPTION\948 @Corruption\ 949 949 -T - obchod produkovaný městem\ 950 950 -C - korupční faktor daný formou vlády\ … … 962 962 !Vzorce pro optimalizaci správy města\ 963 963 964 Pět primárních nastavení automatického managementupopulace964 Pět základních nastavení automatické správy populace 965 965 se z matematického hlediska odlišuje pouze v hodnotě m, která je 966 966 maximalizována. Výpočet hodnoty m bere v úvahu jídlo (f), produkci (p), … … 1053 1053 náhodná budova prodána.\\ 1054 1054 1055 V obrazovce managementuměsta klikněte na tlačítko "Zobrazit vylepšení" a zobrazí se vám seznam vylepšení1055 V obrazovce správy města klikněte na tlačítko "Zobrazit vylepšení" a zobrazí se vám seznam vylepšení 1056 1056 vybudovaných ve městě. Přejete-li si prodat nebo přestavět některé z nich, klikněte na jeho 1057 1057 obrázek. Zisk z prodeje stavby je totožný s produkčními náklady … … 1068 1068 Zpočátku je domovským městem jednotky to město, v němž byla vyrobena. Chcete-li 1069 1069 změnit domovské město, přesuňte jednotku do daného města a zvolte příkaz 1070 "Podpora odtud". V obrazovce managementuměsta klikněte na tlačítko "Zobrazit podporu" a1070 "Podpora odtud". V obrazovce správy města klikněte na tlačítko "Zobrazit podporu" a 1071 1071 zobrazí se seznam jednotek podporovaných daným městem.\\ 1072 1072 … … 1081 1081 1082 1082 #MACRO 1083 $Makro management\1084 1085 !!Makro Management\1086 1087 Hraní této hry by měla být zábava, ne dřina. Makro managementvám pomůže zbavit se1083 $Makro správa\ 1084 1085 !!Makro správa\ 1086 1087 Hraní této hry by měla být zábava, ne dřina. Makro správa vám pomůže zbavit se 1088 1088 opakujících se činností, takže se můžete koncentrovat na strategii. Makro 1089 managementneumožňuje dělat zcela všechny věci, ale1089 správa neumožňuje dělat zcela všechny věci, ale 1090 1090 umožňuje hrát mnohem efektivněji. Není však doporučováno 1091 používat makro managementdříve, než porozumíte základům toho, co1091 používat makro správu dříve, než porozumíte základům toho, co 1092 1092 chcete manažovat.\\ 1093 1093 -
branches/highdpi/Localization/cs/Language.txt
r405 r465 38 38 #UNITSPEED Rychlost 39 39 #UNITSTRENGTH Síla 40 #UNITTRANSPORT Transport40 #UNITTRANSPORT Doprava 41 41 #UNITCOST Cena 42 42 #UNITBUILT Vytvořeno … … 101 101 #RANMAP Náhodná mapa 102 102 #TWOTERRAINS %s / %s 103 #MPMAP Multi Player103 #MPMAP Více Hráčů 104 104 #NOGAMES Žádné knihy 105 105 #AIT_ROUND Kolo %d, … … 140 140 #TITLE_SPYMISSION Špionážní operace 141 141 #TITLE_SUICIDE Sebevražedná mise 142 #TITLE_MESSAGE Sdělení 142 143 #FRMILREP Vojenské hlášení 143 144 … … 186 187 #ZOC Tento typ jednotky se nemůže pohybovat v zónách pod cizí kontrolou. 187 188 #FASTATTACK Chcete útočit se silou pouze %d%%? 188 #NOTIMELOADGROUND Tento typ jednotky potřebuje %s MP bodů, aby mohl být naložen nebo vyložen z transportu.189 #NOTIMELOADGROUND Tento typ jednotky potřebuje %s MP bodů, aby mohl být naložen nebo vyložen z přepravy. 189 190 #NOTIMELOADAIR Letadlo potřebuje 100 MP bodů, aby je bylo možné naložit nebo vyložit z nosiče. 190 191 #NOTIMEBOMBARD Bombardování města vyžaduje 100 MP bodů. … … 192 193 #NOROAD Tato jednotka se může pohybovat jen po cestách nebo železnici. 193 194 #NONAV Tato loď nemá schopnost navigace. 194 #NOTRANSPORT tato loď nemá transportní schopnost.195 #NOTRANSPORT tato loď nemá přepravní schopnost. 195 196 #FULLTRANSPORT Tento transport je plně naložen. 196 197 #LOWFUEL Toto letadlo má nyní nedostatek paliva. Pokud se pohne dále, nebude se moci vrátit do města nebo vojenské základny. Pokračovat? … … 264 265 #MISSDEACT Hráč %d ukončen bez správné deaktivace. 265 266 #CLIENTERROR Nemohu najít klienta %s. 266 #LOADERROR Tato kniha obsahuje interní chybu a nelze pokračovat v jejím hraní.\\Pro posouzení chyby můžete zaslat soubor s knihou autorovi hry.\Chcete otevřít webovou stránku pro hlášení chyb?267 #LOADERROR Tato kniha obsahuje vnitřní chybu a nelze pokračovat v jejím hraní.\\Pro posouzení chyby můžete zaslat soubor s knihou autorovi hry.\Chcete otevřít webovou stránku pro hlášení chyb? 267 268 #NOSTARTPOS Tato mapa nemá definovány žádné startovní pozice. Není možné ji hrát. 268 269 #TOOFEWTRIBES Počet účastníků nemůže převýšit počet nasazených národů ve hře. … … 305 306 #FRBREAK Toto jednání je ztrátou času. Přijděte jindy, až přehodnotíte svůj postoj. 306 307 #FROFFER Nabízíme\-%s\výměnou za\-%s 307 #FRPRESENT Nabízíme vám tento d árek:\-%s308 #FRPRESENT Nabízíme vám tento dar:\-%s 308 309 #FRDEMAND_STRONG Dejte nám\-%s\nebo ponesete následky! 309 310 #FRDONE Chcete mluvit o něčem dalším? … … 317 318 #FRACCEPTDEMAND_STRONG Pro zachování našich dobrých vztahů jsme se rozhodli vyhovět vašim přáním. 318 319 #FRNOTACCEPTOFFER Tato nabídka nám nepřipadá výhodná. 319 #FRNOTACCEPTPRESENT #F nepotřebují takovéto d árky.320 #FRNOTACCEPTPRESENT #F nepotřebují takovéto dary. 320 321 #FRNOTACCEPTDEMAND_STRONG Požadujete příliš mnoho. 321 322 #FRDELCHOICE Zajímá nás\-%s\Co můžeme na oplátku nabídnout? … … 455 456 Pouze terén 456 457 Divy světa 457 Manuál 458 Příručka 458 459 Test 459 460 Vojenské hlášení … … 490 491 Vylepšení terénu 491 492 Kolonizační lodě 492 Makro management493 Makro správa 493 494 Postavit zavlažování 494 495 Postavit farmu … … 497 498 Vytvořit jednotku 498 499 Mřížka 499 AI DebugMapa500 AI Ladící Mapa 500 501 Třídy cizích jednotek 501 502 Politická mapa … … 532 533 Zapnutý (Výchozí implementace) 533 534 Zapnutý (Alternativní implementace) 534 Scrolling 535 Rolování 535 536 Pomalý 536 537 Rychlý -
branches/highdpi/Localization/cs/Language2.txt
r349 r465 8 8 #MENU_DEBUGMAPOFF Vypnuto 9 9 #MENU_TELLAI Jaká AI? 10 #BTN_MENU Hlavní menu11 #BTN_MANAGE Managementříše10 #BTN_MENU Hlavní nabídka 11 #BTN_MANAGE Správa říše 12 12 13 13 'Tooltips … … 29 29 #ACTIONHEADER_CONFIG Konfigurátor 30 30 #ACTION_CONFIG Změna jazyka, přidání map a AI 31 #ACTIONHEADER_MANUAL Manuál31 #ACTIONHEADER_MANUAL Příručka 32 32 #ACTION_MANUAL Popis pravidel a uživatelského rozhraní 33 33 #ACTIONHEADER_CREDITS Autoři -
branches/highdpi/Localization/cs/readme!!!.txt
r64 r465 23 23 3. Obsah tohoto balíku 24 24 ---------------------- 25 Všechny texty jsou přeloženy do češtiny. Včetně dvou obrázků v manuálu.25 Všechny texty jsou přeloženy do češtiny. Včetně dvou obrázků v příručce. 26 26 Dále byla přeložena jména a jednotky národů, které jsou standardně dodávány se hrou. 27 27 Jako bonus byl přidán nový národ Čechů (o něm více na konci tohoto souboru). … … 88 88 8. Autoři 89 89 --------- 90 Autor lokalizace textů a manuálu:90 Autor lokalizace textů a příručky: 91 91 "tyllanthor" <tyl.lanthor@gmail.com> (dříve používající přezdívku "LFK") 92 92 -
branches/highdpi/Localization/de/Help/Help.txt
r464 r465 392 392 Ein Vertrag kann nur während einer diplomatischen Verhandlung aufgelöst werden, es sei denn, die Nation weist die Verhandlung zurück. Mögliche Verträge sind:\ 393 393 394 -Friedensvertrag: 394 -Friedensvertrag: 395 395 Die Einheiten beider Nationen dürfen sich nicht angreifen oder sich in das Gebiet des Vertragspartners begeben.\ 396 396 397 -Freundschaftsvertrag: 397 -Freundschaftsvertrag: 398 398 Zusätzlich zum Friedensvertrag tauschen beide Nationen jede Runde Zivilberichte aus.\ 399 399 400 -Bündnisvertrag: 400 -Bündnisvertrag: 401 401 Wenn zwei Nationen sich verbünden, dürfen sie gegenseitig ihr Gebiet betreten und Kontrollzonen üben keine Wirkung aus. Alliierte teilen alle Informationen (Zivilberichte, Militärberichte, Weltkarten) und kennen die Bewegungen der alliierten Einheiten.\\ 402 402 … … 604 604 -5: Zusammenfassung der neuen Einheitenklasse\\ 605 605 606 Die Eigenschaften einer Einheit hängen von zwei Dingen ab: Erstens davon, welche Fortschritte Du bislang erforscht hast. Manche Fortschritte verbessern eine oder mehrere Waffengattungen durch die Erhöhung des entsprechenden Kampfwertfaktors - und natürlich gibt es auch einen Kostenfaktor. 606 Die Eigenschaften einer Einheit hängen von zwei Dingen ab: Erstens davon, welche Fortschritte Du bislang erforscht hast. Manche Fortschritte verbessern eine oder mehrere Waffengattungen durch die Erhöhung des entsprechenden Kampfwertfaktors - und natürlich gibt es auch einen Kostenfaktor. 607 607 Ebenso gibt es Transportfaktoren, die die Ladekapazität von Einheiten verändern.\\ 608 608 … … 697 697 698 698 Die genaue Formel für die Berechnung der Korruption in einer Stadt sieht folgendermaßen aus:\ 699 @C ORRUPTION\699 @Corruption\ 700 700 -T - Handelseinkommen der Stadt\ 701 701 -C - Korruptionsfaktor der Regierungsform\ … … 718 718 -beschleunigte Produktion: m = sqrt(f) * (8p + 2t + r)\ 719 719 -beschleunigte Forschung: m = sqrt(f) * (r + t + p)\ 720 720 721 721 722 722 … … 796 796 !!Unterhalt von Einheiten\ 797 797 798 In der Regel muss jede Einheit von ihrer Heimatstadt pro Runde mit 1 %p unterstützt werden. Die Heimatstadt ist zunächst die Stadt, in der die Einheit gebildet wurde. Wenn Du den Heimatstandort ändern möchtest, kannst Du die Einheit in die gewünschte Stadt ziehen 798 In der Regel muss jede Einheit von ihrer Heimatstadt pro Runde mit 1 %p unterstützt werden. Die Heimatstadt ist zunächst die Stadt, in der die Einheit gebildet wurde. Wenn Du den Heimatstandort ändern möchtest, kannst Du die Einheit in die gewünschte Stadt ziehen 799 799 und den Befehl 'Hier unterstützen' (H) aus dem Kommandomenü wählen. Klicke auf den Schaltfläche 'Einheiten' um die Einheiten zu sehen, die von einer Stadt unterstützt werden.\\ 800 800 … … 827 827 !!Das Startfenster\ 828 828 829 Das Startfenster hat drei Register, zwischen denen Du mit einem Klick auf die oberen Laschen hin- und herschalten kannst. Um 829 Das Startfenster hat drei Register, zwischen denen Du mit einem Klick auf die oberen Laschen hin- und herschalten kannst. Um 830 830 ein neues Spiel zu beginnen, gehe in's Register 'Neues Buch'. Wähle die Anzahl Gegner und deren Schwierigkeitsgrad. Falls alternative KIs installiert sind, können diese gegen die Standard-KI getauscht werden. Klicke dann auf die Schaltfläche 'Start' .\\ 831 831 832 832 !Auswahl der Spieler\ 833 833 Verwende das Feld 'Gegner' mit den neun Fenstern, um die Art und Anzahl der gegnerischen Spieler genauer festzulegen. Nur dieser Modus erlaubt Multiplayer Spiele, gegen verschiedene KIs zu spielen oder KI-Games als Supervisor oder KI-Tunier zu starten. 834 Klicke auf die Boxen und wähle jeweils einen menschlichen oder einen KI-Gegner aus der Liste. 834 Klicke auf die Boxen und wähle jeweils einen menschlichen oder einen KI-Gegner aus der Liste. 835 835 Die drei linken Boxen haben zusätzlich noch eine Schaltfläche die eine "3" enthält. 836 Hier kann die Auswahl für jeweils 2 oder 3 zusätzlich Gegenspieler getroffen werden, 836 Hier kann die Auswahl für jeweils 2 oder 3 zusätzlich Gegenspieler getroffen werden, 837 837 die die gleiche Konfiguration erhalten. Damit können insgesamt bis zu 14 Nationen am Spiel teilnehmen.\\ 838 838 839 Jedem Gegner wird ein eigener Schwierigkeitsgrad zugewiesen, den Du mit den +/- Tasten links der Fenster 839 Jedem Gegner wird ein eigener Schwierigkeitsgrad zugewiesen, den Du mit den +/- Tasten links der Fenster 840 840 auswählen kannst. Ein Strich steht für den einfachen Level, drei Striche für den schwierigen.\ 841 Wenn Du zum Beispiel gegen die KI spielst und es so schwer wie möglich haben möchtest, 841 Wenn Du zum Beispiel gegen die KI spielst und es so schwer wie möglich haben möchtest, 842 842 setze Deinen eigenen Schwierigkeitsgrad (Lokaler Spieler) auf das Maximum und den der KI-Gegner auf das Minimum.\\ 843 843 844 Ein höherer Schwierigkeitsgrad bedeutet langsamere Entwicklung der Bevölkerung, 844 Ein höherer Schwierigkeitsgrad bedeutet langsamere Entwicklung der Bevölkerung, 845 845 langsamere Produktion und langsamerer Fortschritt bis die Produktions- und Fortschrittskosten und natürlich auch die Grösse des Nahrungsmittelspeichers angewachsen sind.\\ 846 846 … … 848 848 849 849 Alle gespeicherten Spiele erscheinen in der 'Bibliothek'. Wähle eines davon aus und klicke auf 'Öffnen' um weiterzuspielen. 850 Ein Buch enthält alle Runden eines Spiels. Möchtest Du das Spiel zu einem früheren Zeitpunkt fortführen 851 als in der zuletzt gespeicherten Runde, benutze die Jahreszahl rechts 850 Ein Buch enthält alle Runden eines Spiels. Möchtest Du das Spiel zu einem früheren Zeitpunkt fortführen 851 als in der zuletzt gespeicherten Runde, benutze die Jahreszahl rechts 852 852 um den gewünschten Zeitpunkt einzustellen, bevor Du das Spiel öffnest.\\ 853 853 854 854 !Weltkarten\ 855 855 856 Standardmäßig spielst Du auf zufälligen Weltkarten, die automatisch am Anfang eines neuen Spiels 857 generiert werden. Im 'Karten'-Register können zwei 856 Standardmäßig spielst Du auf zufälligen Weltkarten, die automatisch am Anfang eines neuen Spiels 857 generiert werden. Im 'Karten'-Register können zwei 858 858 Parameter eingestellt werden: Größe und Prozentanteil der Landmasse.\\ 859 859 860 Alternativ ist es möglich auf einer editierten Karte zu spielen, die für C-evo 861 entworfen wurde, z.B. eine Karte der Erde. Das Grundpaket enthält keine solcher Karten, 862 jedoch können verschiedene solcher Karten von der Projekt-homepage heruntergeladen werden. 863 Verschiebe die Kartendateien in den 'Maps'-Ordner. Du benötigst die Karte nur zum Starten des Spiels. 860 Alternativ ist es möglich auf einer editierten Karte zu spielen, die für C-evo 861 entworfen wurde, z.B. eine Karte der Erde. Das Grundpaket enthält keine solcher Karten, 862 jedoch können verschiedene solcher Karten von der Projekt-homepage heruntergeladen werden. 863 Verschiebe die Kartendateien in den 'Maps'-Ordner. Du benötigst die Karte nur zum Starten des Spiels. 864 864 Die Karte ist nicht erforderlich um das Spiel später wieder öffnen zu können, da sie im Buch mit abgespeichert wird.\\ 865 865 … … 870 870 !!Der Kartograf\ 871 871 872 Es gibt einen einfachen Karteneditor für Karten in diesem Spiel. Um ihn zu starten, 873 klicke auf 'Karten' im Startfenster. Wähle die gewünschte Karte aus und klicke dann auf 874 die Schaltfläche 'Kartograf'. Möchtest Du eine neue Karte erstellen, 872 Es gibt einen einfachen Karteneditor für Karten in diesem Spiel. Um ihn zu starten, 873 klicke auf 'Karten' im Startfenster. Wähle die gewünschte Karte aus und klicke dann auf 874 die Schaltfläche 'Kartograf'. Möchtest Du eine neue Karte erstellen, 875 875 wähle 'Zufallskarte', stelle Größe und Landmasse ein und starte dann den Kartografen.\\ 876 876 877 Die Bedienung des Editors ist sehr einfach. Wähle eine Landschaft oder ein Objekt 878 aus der Liste unten am Bildschirm und zeichne sie mittels der Maus in die 879 Karte. Die Grenzen zwischen Ozean und Küste und die Verteilung von Ressourcen werden 880 automatisch festgelegt. Vergiss nicht zumindest 881 eine Lagerstelle jeder besonderen Ressource festzulegen, 877 Die Bedienung des Editors ist sehr einfach. Wähle eine Landschaft oder ein Objekt 878 aus der Liste unten am Bildschirm und zeichne sie mittels der Maus in die 879 Karte. Die Grenzen zwischen Ozean und Küste und die Verteilung von Ressourcen werden 880 automatisch festgelegt. Vergiss nicht zumindest 881 eine Lagerstelle jeder besonderen Ressource festzulegen, 882 882 da sonst das Raumschiff nicht gebaut werden kann.\\ 883 883 884 Es ist wichtig die Startpunkte der Nationen zu markieren. Eine Karte kann nicht 885 von mehr Nationen bespielt werden als es Startpositionen gibt. Sind keine Startpositionen vorhanden, 886 ist die Karte leider nicht spielbar. 884 Es ist wichtig die Startpunkte der Nationen zu markieren. Eine Karte kann nicht 885 von mehr Nationen bespielt werden als es Startpositionen gibt. Sind keine Startpositionen vorhanden, 886 ist die Karte leider nicht spielbar. 887 887 Möchtest Du eine besondere Startposition für den oder die menschlichen Spieler, markiere sie durch eine 'Bevorzugte Startposition'.\\ 888 888 889 Karten werden im Startfenster nicht angezeigt. Stattdessen kann ein 890 Symbol eingefügt werden. Dieses muss eine *.bmp-Datei sein und denselben Namen wie die 889 Karten werden im Startfenster nicht angezeigt. Stattdessen kann ein 890 Symbol eingefügt werden. Dieses muss eine *.bmp-Datei sein und denselben Namen wie die 891 891 Karte besitzen. Speichere die Datei im 'Maps'-Ordner. Die maximale Grösse des Symbols beträgt 192 x 96 pixel. 892 892 … … 897 897 !!KI-Wettkampf\ 898 898 899 Hast Du mehrere verschiedene KI-Module installiert, kannst Du sie in einem Wettkampf 899 Hast Du mehrere verschiedene KI-Module installiert, kannst Du sie in einem Wettkampf 900 900 gegeneinander antreten lassen. Wähle hierfür 901 KI-Wettkampf' im zentralen Feld der neun Gegner und klicke 901 KI-Wettkampf' im zentralen Feld der neun Gegner und klicke 902 902 auf 'Start'. Das Spiel selbst wird auf ein kleines Dialogfenster reduziert. 903 Mit dem Klicken auf die Schaltfläche Abspielen' beginnt C-evo eine endlose Reihe an Spielen 904 rundenweise ablaufen zu lassen. Das Ergebnis besteht aus einer einfachen Statistik, die nach jeder 903 Mit dem Klicken auf die Schaltfläche Abspielen' beginnt C-evo eine endlose Reihe an Spielen 904 rundenweise ablaufen zu lassen. Das Ergebnis besteht aus einer einfachen Statistik, die nach jeder 905 905 Runde aktualisiert wird.\\ 906 906 907 907 @AITShot\ 908 908 909 -1: Anzahl der Runden, die diese KI gewonnen hat, was bedeutet, dass sie entweder 909 -1: Anzahl der Runden, die diese KI gewonnen hat, was bedeutet, dass sie entweder 910 910 als erste das Raumschiff fertiggestellt oder alle anderen Nationen beseitigt hat.\ 911 911 -2: Anzahl der Runden, in denen diese Nation zerstört wurde. … … 942 942 !!Militärische Forschung\ 943 943 944 Eine Nation muss militärische Forschung betreiben, um neue Einheitenklassen in Dienst stellen 944 Eine Nation muss militärische Forschung betreiben, um neue Einheitenklassen in Dienst stellen 945 945 zu können.\ 946 946 :CLASSES Einheitenklassen\\ … … 1061 1061 Verhindert, dass die Weltwunder dieser Nation ihre Wirkung verlieren. Veraltete Weltwunder werden wieder aktiv. 1062 1062 Zählt als Wasserkraftwerk in allen Städten.\(Kann nur in Städten an einem Fluss oder einem Gebirge gebaut werden). 1063 Bewegung auf Schienen kostet innerhalb des eigenen Territoriums keine Aktionspunkte mehr. 1063 Bewegung auf Schienen kostet innerhalb des eigenen Territoriums keine Aktionspunkte mehr. 1064 1064 Löst den kalten Krieg aus. In dieser Zeit können keine diplomatischen Verhandlungen geführt werden.\Der kalte Krieg dauert 40 Runden. 1065 1065 Die gesamte Welt wird für eine Runde sichtbar. Zivil- und Militärberichte von allen Nationen werden verfügbar.\\Um dieses Weltwunder zu errichten benötigt die Nation einen\::B66 Weltraumbahnhof -
branches/highdpi/Localization/de/Language.txt
r405 r465 144 144 #TITLE_SPYMISSION Verdeckte Operation 145 145 #TITLE_SUICIDE Himmelfahrtskommando 146 #TITLE_MESSAGE Message 146 147 147 148 'Message Text -
branches/highdpi/Localization/it/Help/Help.txt
r464 r465 132 132 133 133 !Il progetto\ 134 C-evo è un gioco non commerciale, basato sul famoso "Sid Meier's Civilization" della 135 Microprose. L'ambizione del progetto non è competere con i giochi commerciali per la 136 presentazione più entusiasmante. Inoltre, non punta a divertire introducendo un sacco 137 di nuovi, realistici elementi a ogni versione. Invece l'obiettivo è di creare un gioco 138 di pura strategia, che diverta per una cosa soprattutto: la sfida. Quindi l'interesse 134 C-evo è un gioco non commerciale, basato sul famoso "Sid Meier's Civilization" della 135 Microprose. L'ambizione del progetto non è competere con i giochi commerciali per la 136 presentazione più entusiasmante. Inoltre, non punta a divertire introducendo un sacco 137 di nuovi, realistici elementi a ogni versione. Invece l'obiettivo è di creare un gioco 138 di pura strategia, che diverta per una cosa soprattutto: la sfida. Quindi l'interesse 139 139 centrale è la definizione delle regole e delle IA. Per maggiori informazioni, visita:\ 140 140 ::E2 c-evo.org\\ 141 141 142 142 !Licenza d'uso\ 143 C-evo è frutto del lavoro di numerosi autori. Hai il permesso di usare il gioco e 144 distribuirlo gratuitamente anche senza autorizzazione esplicita. Il gioco stesso e 145 tutte le sue parti, eccetto la grafica e i suoni, sono di pubblico dominio. Ovvero puoi farne 146 quello che ti pare. Questo vale anche per il codice binario e i sorgenti, che sono 147 disponibili nel sito del progetto. Per quanto riguarda grafica e suoni, dovresti chiedere 143 C-evo è frutto del lavoro di numerosi autori. Hai il permesso di usare il gioco e 144 distribuirlo gratuitamente anche senza autorizzazione esplicita. Il gioco stesso e 145 tutte le sue parti, eccetto la grafica e i suoni, sono di pubblico dominio. Ovvero puoi farne 146 quello che ti pare. Questo vale anche per il codice binario e i sorgenti, che sono 147 disponibili nel sito del progetto. Per quanto riguarda grafica e suoni, dovresti chiedere 148 148 ai rispettivi autori prima di usarli per un qualunque scopo che non sia giocare.\ 149 149 ::C Ringraziamenti\\ 150 150 151 151 !Programmazione I.A.\ 152 Il gioco ha un'interfaccia aperta per l'intelligenza artificiale, cioè è possibile rimpiazzare 153 l'I.A. ufficiale con altri algoritmi, per tutte o solo per alcune nazioni. 152 Il gioco ha un'interfaccia aperta per l'intelligenza artificiale, cioè è possibile rimpiazzare 153 l'I.A. ufficiale con altri algoritmi, per tutte o solo per alcune nazioni. 154 154 E' possibile giocare con fino a 8 I.A. diverse nella stessa partita. 155 155 Se sei un vero nerd e vuoi programmare un'I.A., il modo più semplice è usare il modello in C# … … 264 264 265 265 Quando il gioco inizia, ti verrà chiesto il primo progresso da ricercare. Per avere aiuto su un certo progresso della lista cliccalo tenendo premuto Shift. 266 La velocità di scoperta dipende dal numero di punti ricerca (%r) che la tua nazione produce. Quando avrai raccolto abbastanza %r scoprirai il progresso e potrai scegliere la ricerca successiva. 266 La velocità di scoperta dipende dal numero di punti ricerca (%r) che la tua nazione produce. Quando avrai raccolto abbastanza %r scoprirai il progresso e potrai scegliere la ricerca successiva. 267 267 C'è sempre una sola ricerca alla volta, e non è possibile cambiare l'oggetto della ricerca una volta scelto. 268 268 Il costo di un progresso aumenta col numero di scoperte che la tua nazione ha già fatto.\\ … … 439 439 !!Combattimento\ 440 440 441 Puoi attaccare le unità nemiche nelle caselle adiacenti usando la tastiera o il mouse, 441 Puoi attaccare le unità nemiche nelle caselle adiacenti usando la tastiera o il mouse, 442 442 esattamente come per entrare nelle caselle. Ma non tutti gli attacchi sono permessi. 443 443 Normalmente, le unità di terra non possono attaccare le navi e viceversa. Le navi non 444 444 possono attaccare direttamente da una città o da un canale. 445 Gli aerei possono essere attaccati solo da altri aerei, eccetto quando si trovano in una 446 città o base militare. L'unità più debole è sempre distrutta in battaglia, la più forte 445 Gli aerei possono essere attaccati solo da altri aerei, eccetto quando si trovano in una 446 città o base militare. L'unità più debole è sempre distrutta in battaglia, la più forte 447 447 rimane danneggiata: maggiore è la superiorità, minore è il danno. Puoi avere una previsione esatta del risultato di un attacco tenendo premuto il tasto shift e cliccando col destro sul bersaglio.\\ 448 448 … … 502 502 -Stendere rapporto militare.\\ 503 503 504 Un trattato di pace tra due nazioni impedisce azioni di spionaggio reciproco. Comunque, gli agenti segreti possono infiltrarsi in ogni territorio, ignorando i trattati. 504 Un trattato di pace tra due nazioni impedisce azioni di spionaggio reciproco. Comunque, gli agenti segreti possono infiltrarsi in ogni territorio, ignorando i trattati. 505 505 506 506 #CLASSES … … 580 580 581 581 !Cibo\ 582 Il cibo (%f) rappresenta ogni tipo di alimenti. Lo stato di questa risorsa è mostrato nel pannello del cibo (4). E' necessario per mantenere la popolazione, poiché ogni gruppo di cittadini consuma 2%f ogni turno. Anche alcune unità come i coloni consumano cibo nella città di appartenenza. Il cibo che manca viene tolto dalle riserve della città. Se le riserve si esauriscono, la città è colpita dalla carestia: un cittadino o un'unità che consuma cibo muore. Ma di solito le città producono più cibo del necessario: quello che avanza viene immagazzinato nelle riserve. 582 Il cibo (%f) rappresenta ogni tipo di alimenti. Lo stato di questa risorsa è mostrato nel pannello del cibo (4). E' necessario per mantenere la popolazione, poiché ogni gruppo di cittadini consuma 2%f ogni turno. Anche alcune unità come i coloni consumano cibo nella città di appartenenza. Il cibo che manca viene tolto dalle riserve della città. Se le riserve si esauriscono, la città è colpita dalla carestia: un cittadino o un'unità che consuma cibo muore. Ma di solito le città producono più cibo del necessario: quello che avanza viene immagazzinato nelle riserve. 583 583 Fanno eccezione le grandi città (dimensione 8 o più) quando hanno 1 solo cibo di avanzo: lo convertono in denaro. Quando le riserve sono piene e la dimensione non ha ancora raggiunto il massimo, la città cresce, ovvero aumenta di 1 gruppo di cittadini.\\ 584 584 … … 587 587 588 588 !Commercio\ 589 Il commercio (simbolo: %t) rappresenta ciò che ha un valore mercantile. 589 Il commercio (simbolo: %t) rappresenta ciò che ha un valore mercantile. 590 590 Solo le caselle intorno alla città producono commercio, non la casella in cui la città stessa è situata, nemmeno se contiene oro. Lo stato del commercio è mostrato nel relativo pannello (8). 591 591 Parte del rendimento del commercio si perde per via della corruzione, che dipende dal tipo di governo e in generale aumenta con la distanda della città dalla capitale. Il resto dei %t viene prima tassato secondo l'attuale rateo di tasse, impostato in "Economia e tasse". Il rimanente viene diviso tra ricerca e ricchezza, come impostato sempre in "Economia e tasse". … … 634 634 635 635 L'ammontare esatto della corruzione si calcola con questa formula:\ 636 @C ORRUPTION\636 @Corruption\ 637 637 -T - Commercio prodotto dalla città\ 638 638 -C - Fattore di corruzione dipendente dal governo\ … … 748 748 I tre riquadri di sinistra hanno ciascuno una ulteriore casellina etichettata "3", che serve per definire 3 nazioni con un solo riquadro, quindi in totale puoi avere fino a 14 avversari.\\ 749 749 750 Ogni partecipante ha il suo livello di difficoltà personale, impostabile sulla sinistra 751 del riquadro. Una linea è il livello più facile, 3 il più difficile. Se ad esempio vuoi 752 che il gioco sia il più duro possibile per te, imposta la tua difficoltà a 3 e quella degli 750 Ogni partecipante ha il suo livello di difficoltà personale, impostabile sulla sinistra 751 del riquadro. Una linea è il livello più facile, 3 il più difficile. Se ad esempio vuoi 752 che il gioco sia il più duro possibile per te, imposta la tua difficoltà a 3 e quella degli 753 753 avversari a 1.\\ 754 754 … … 972 972 Raddoppia l'effetto di fabbrica e stabilimento.\(ogni città può sfruttare un solo tipo di centrale)\Non aumenta l'inquinamento. 973 973 +1%p nelle caselle di mare.\\Questo edificio si può costruire solo in città costiere. 974 Permette di produrre fino a 3%t per casella. 974 Permette di produrre fino a 3%t per casella. 975 975 Aumenta la grandezza massima della città a 30. 976 976 Permette di sfruttare le fattorie. … … 989 989 +12%f nella città. 990 990 Raddoppia l'effetto di tutte le banche. 991 Rendimento delle risorse speciali +100%.\Rende possibile la costruzione dell'astronave. La perdita della base aerospaziale causa la perdita dell'astronave. Quando una nazione che possiede già una base aerospaziale conquista quella di un'altra, si impadronisce anche della sua astronave. 991 Rendimento delle risorse speciali +100%.\Rende possibile la costruzione dell'astronave. La perdita della base aerospaziale causa la perdita dell'astronave. Quando una nazione che possiede già una base aerospaziale conquista quella di un'altra, si impadronisce anche della sua astronave. 992 992 * 993 993 * -
branches/highdpi/Localization/it/Language.txt
r405 r465 140 140 #TITLE_SPYMISSION Servizi segreti 141 141 #TITLE_SUICIDE Missione suicida 142 #TITLE_MESSAGE Message 142 143 #FRMILREP Rapporto militare 143 144 -
branches/highdpi/Localization/ru/Help/Help.txt
r464 r465 70 70 #TERIMPCITY Квадрат с городом автоматически имеет следующие улучшения местности:\-Дорога\-Железная дорога (после открытия знания Жедезная дорога)\-Канал\-Орошение\-Ферма. 71 71 #HOSTILE Это враждебная территория. Юниты, проходящие эту местность получают повреждения, пропорциональные очкам MP. Полный ход по территории дает %d%% повреждений. 72 Враждебность территории может быть нейтрализована рекой, оазисом, каналом, или военной базой. 72 Враждебность территории может быть нейтрализована рекой, оазисом, каналом, или военной базой. 73 73 #DEADLANDS Мертвые земли не могут быть улучшены. 74 74 #RARE На произвольной карте всегда имеется 12 мертвых земель. Половина из них содержат специальные ресурсы, по два ресурса каждого типа. … … 655 655 656 656 Точное вычисление уровня Коррупции в городе производится по такой формуле:\ 657 @C ORRUPTION\657 @Corruption\ 658 658 -T - Торговля, производимая городом\ 659 659 -C - Показатель коррупции текущей формы правления\ … … 778 778 Также можно выбрать для игры специальную карту, созданную кем-то для C-evo, 779 779 например настоящую карту Земли. Стандартная установка не содержит дополнительных 780 карт, но их можно скачать на домашней странице игры. 781 Все карты должны быть расположены в папке "Maps". 780 карт, но их можно скачать на домашней странице игры. 781 Все карты должны быть расположены в папке "Maps". 782 782 Карта нужна только чтобы начать игру, а затем 783 783 сохраняется вместе с ней. … … 789 789 !!Редактор карт\ 790 790 791 Вместе с игрой есть простой редактор для карт. Карту для редактирования 791 Вместе с игрой есть простой редактор для карт. Карту для редактирования 792 792 можно выбрать на закладке "Карты" и нажать кнопку "Редактировать". Или 793 793 можно создать случайную карту, указав её размер и процент суши, и затем … … 798 798 и "обычный участок/особые ресурсы" происходит автоматически, Вы не можете 799 799 на это повлиять. Не забудьте добавить хотябы по одному участку с редкими 800 видами ресурсов, иначе игроки не смогут построить космический 800 видами ресурсов, иначе игроки не смогут построить космический 801 801 корабль.\\ 802 802 … … 821 821 соперника "Компьютер против компьютера" и нажать "Начало". Игра превратится 822 822 в простой диалог, C-evo начнёт бесконечную серию игр (раундов). И в результате 823 после каждого раунда будет выдаваться 823 после каждого раунда будет выдаваться 824 824 статистика:\\ 825 825 … … 1012 1012 Влияние Фабрики и Завода на рост производства увеличивается в два раза.\(Строить более одного Завода в городе бесполезно.)\Не увеличивает загрязнение. 1013 1013 +1%p на прибрежных участках.\\Может быть построена только в городах, имеющих выход к морю. 1014 Позволяет собирать до 3%t с участка. 1014 Позволяет собирать до 3%t с участка. 1015 1015 Размер города может расти больше 12. 1016 1016 Появляется возможность использовать Фермы. -
branches/highdpi/Localization/ru/Language.txt
r405 r465 143 143 #TITLE_SPYMISSION Шпионская операция 144 144 #TITLE_SUICIDE Миссия самоубийства 145 #TITLE_MESSAGE Message 145 146 #FRMILREP Военное сообщение 146 147 -
branches/highdpi/Localization/zh-Hans/Fonts.txt
r464 r465 1 1 #NORMAL 2 ΢ÈíÑźÚ, 152 微软雅黑, 15 3 3 4 4 #SMALL 5 ΢ÈíÑźÚ, 135 微软雅黑, 13 6 6 7 7 #TINY 8 ΢ÈíÑźÚ, 11B8 微软雅黑, 11B 9 9 10 10 #CAPTION 11 ΢ÈíÑźÚ, 1711 微软雅黑, 17 12 12 13 13 #BUTTON 14 ΢ÈíÑźÚ, 17B14 微软雅黑, 17B -
branches/highdpi/Localization/zh-Hans/Help/Help.txt
r464 r465 1 #HELPTITLE_MAIN ÓÎÏ·Ö¸ÄÏ2 #HELPTITLE_QUICKSTART ¿ìËÙÉÏÊÖ3 #HELPTITLE_CONCEPTS ¸ÅÄî½â˵4 #HELPTITLE_TECHLIST ¿Æ¼¼Ò»ÀÀ5 #HELPTITLE_IMPLIST ³ÇÊÐÉèÊ©6 #HELPTITLE_UNIQUELIST ¹ú¼Ò¹¤³Ì7 #HELPTITLE_WONDERLIST ÊÀ½çÆæ¼£8 #HELPTITLE_TERLIST µØÐÎÖÖÀà9 #HELPTITLE_JOBLIST µØÐν¨Éè10 #HELPTITLE_MODELLIST ÌØÊⲿ¶Ó11 #HELPTITLE_FEATURELIST ²¿¶ÓÊôÐÔ12 #HELPTITLE_FEATURE1LIST »ù±¾ÊôÐÔ13 #HELPTITLE_FEATURE2LIST ÌØÊâÊôÐÔ14 #HELPTITLE_FEATURE3LIST ¿Æ¼¼ÊôÐÔ15 #HELPTITLE_GOVLIST ÕþÌåÒ»ÀÀ16 #HELPTITLE_KEYS ¿ì½Ý²Ù×÷17 #HELPTITLE_ABOUT ¹ØÓÚÓÎÏ·18 #HELPTITLE_CREDITS ÖÆ×÷Ãûµ¥19 #HELPTITLE_SEARCHRESULTS ËÑË÷½á¹û20 21 #HELPSPEC_TER ( µØÐÎÖÖÀà)22 #HELPSPEC_ADV ( ¿Æ¼¼³É¹û)23 #HELPSPEC_FUTURE ( δÀ´¿Æ¼¼)24 #HELPSPEC_IMP ( ³ÇÊÐÉèÊ©)25 #HELPSPEC_NAT ( ¹ú¼Ò¹¤³Ì)26 #HELPSPEC_WONDER ( ÊÀ½çÆæ¼£)27 #HELPSPEC_SHIPPART ( ·É´¬²¿¼þ)28 #HELPSPEC_CAP ( ²¿¶Ó»ù±¾ÊôÐÔ)29 #HELPSPEC_FEATURE ( ²¿¶ÓÌØÊâÊôÐÔ)30 #HELPSPEC_STANDARD ( ²¿¶Ó¿Æ¼¼ÊôÐÔ)1 #HELPTITLE_MAIN 游戏指南 2 #HELPTITLE_QUICKSTART 快速上手 3 #HELPTITLE_CONCEPTS 概念解说 4 #HELPTITLE_TECHLIST 科技一览 5 #HELPTITLE_IMPLIST 城市设施 6 #HELPTITLE_UNIQUELIST 国家工程 7 #HELPTITLE_WONDERLIST 世界奇迹 8 #HELPTITLE_TERLIST 地形种类 9 #HELPTITLE_JOBLIST 地形建设 10 #HELPTITLE_MODELLIST 特殊部队 11 #HELPTITLE_FEATURELIST 部队属性 12 #HELPTITLE_FEATURE1LIST 基本属性 13 #HELPTITLE_FEATURE2LIST 特殊属性 14 #HELPTITLE_FEATURE3LIST 科技属性 15 #HELPTITLE_GOVLIST 政体一览 16 #HELPTITLE_KEYS 快捷操作 17 #HELPTITLE_ABOUT 关于游戏 18 #HELPTITLE_CREDITS 制作名单 19 #HELPTITLE_SEARCHRESULTS 搜索结果 20 21 #HELPSPEC_TER (地形种类) 22 #HELPSPEC_ADV (科技成果) 23 #HELPSPEC_FUTURE (未来科技) 24 #HELPSPEC_IMP (城市设施) 25 #HELPSPEC_NAT (国家工程) 26 #HELPSPEC_WONDER (世界奇迹) 27 #HELPSPEC_SHIPPART (飞船部件) 28 #HELPSPEC_CAP (部队基本属性) 29 #HELPSPEC_FEATURE (部队特殊属性) 30 #HELPSPEC_STANDARD (部队科技属性) 31 31 32 32 #TECHFORMULA %.6g*n*EXP(n/%.6g) 33 #PREREQ ÏÈÆÚËùÐè¿Æ¼¼34 #PREREQALT ÏÈÆÚËùÐè¿Æ¼¼ (ÈýÏîÖÐÐè¾ß±¸Á½Ïî)35 #BASETECH ( »®Ê±´ú¿Æ¼¼)36 #STRENGTHUP %s: Õ½¶·Á¦±¶ÔöÒò×Ó+%d37 #COSTUP ( Ôì¼Û±¶ÔöÒò×Ó+%d)38 #COSTMIN ( Ôì¼Û±¶ÔöÒò×Ó ÉÏÉýÖÁ%d)39 #TRANSUP %s: ÔËÊäÁ¦±¶ÔöÒò×Ó+%d40 #ADVEFFECT ¹¦Ð§41 #EFFECT Ч¹û42 #COSTS Ôì¼Û43 #BUILDCOST Éú²úÔì¼Û: %d%%p44 #MAINTCOST ά»¤·ÑÓÃ: ÿ»ØºÏ%d%%c45 #REPLACE ¸üÌæ46 #REPLACETEXT ´ËÉèÊ©½¨³Éºó, ÏÂÁÐÉèÊ©½«×Ô¶¯×÷·Ï, ±äÂôÕÛÏÖ:47 #EXPIRATION ¹ýÆÚ48 #EXPWITH %s ·¢ÏÖÖ®ºó, ¸ÃЧ¹û½«¹ýÆÚ.49 #EXPSLAVE ËùÓÐÅ«Á¥³ÉΪ×ÔÓÉÈË, ²¢Í£Ö¹¹¤×÷.50 #REQUIRED ËùÐè¿Æ¼¼: %s51 #RAREREQUIRED Éú²úÐèÒª%s52 #RESFOOD Á¸Ê³: %d%%f53 #RESPROD Éú²ú: %d%%p54 #RESTRADE óÒ×: %d%%t55 #MOREIRR ( ¹à¸Èºó+%d%%f)56 #MOREMINE ( ²É¿óºó+%d%%p)57 #MOREROAD ( ÐÞ·ºó+%d%%t)58 #SPECIAL ÌØÊâ×ÊÔ´33 #PREREQ 先期所需科技 34 #PREREQALT 先期所需科技 (三项中需具备两项) 35 #BASETECH (划时代科技) 36 #STRENGTHUP %s: 战斗力倍增因子 +%d 37 #COSTUP (造价倍增因子 +%d) 38 #COSTMIN (造价倍增因子 上升至 %d) 39 #TRANSUP %s: 运输力倍增因子 +%d 40 #ADVEFFECT 功效 41 #EFFECT 效果 42 #COSTS 造价 43 #BUILDCOST 生产造价: %d%%p 44 #MAINTCOST 维护费用: 每回合 %d%%c 45 #REPLACE 更替 46 #REPLACETEXT 此设施建成后, 下列设施将自动作废, 变卖折现: 47 #EXPIRATION 过期 48 #EXPWITH %s发现之后, 该效果将过期. 49 #EXPSLAVE 所有奴隶成为自由人, 并停止工作. 50 #REQUIRED 所需科技: %s 51 #RAREREQUIRED 生产需要 %s 52 #RESFOOD 粮食: %d%%f 53 #RESPROD 生产: %d%%p 54 #RESTRADE 贸易: %d%%t 55 #MOREIRR (灌溉后 +%d%%f) 56 #MOREMINE (采矿后 +%d%%p) 57 #MOREROAD (修路后 +%d%%t) 58 #SPECIAL 特殊资源 59 59 #SPECIALFOOD , +%d%%f 60 60 #SPECIALPROD , +%d%%p 61 61 #SPECIALTRADE , +%d%%t 62 #TRAFO µØÐοɱä¸üΪ%s63 #MOVEPLAIN ²¿¶ÓÒƶ¯ÀàÐÍ: ƽ̹µØÐÎ64 #MOVEHEAVY ²¿¶ÓÒƶ¯ÀàÐÍ: Æé᫵ØÐÎ65 #DEFBONUS ·ÀÓù¼Ó³É: %d%%66 #JOBCOST - ½¨ÉèÔì¼Û: %s Ðж¯µã67 #JOBCOSTVAR - ½¨ÉèÔì¼Û: ÇëÔÚÓÎÏ·ÖÐÑ¡Ôñ"ϵͳ²Ëµ¥" - "¿ìËÙºê²Ù×÷" - "µØÐθÄÔì"68 #TERIMPEXCLUDE ¹à¸È¡¢²É¿ó¡¢ÒªÈûºÍ¾üÊ»ùµØ²»¿É¹²´æÓÚͬһµØ¿é. ÀýÈç, ÈôÔÚÒѽ¨ÓÐÒªÈûµÄµØ¿é½¨Éè¾üÊ»ùµØ, ÔòÒªÈû½«Ïûʧ, ¾üÊ»ùµØÈ¡¶ø´úÖ®.69 #TERIMPCITY ³ÇÊÐËùÔڵĵؿé, ͬʱ°üº¬ÒÔÏÂЧ¹û:\-µÀ·\-Ìú· (Ìú·¿Æ¼¼·¢ÏÖºó)\-Ô˺Ó\-¹à¸È\-Å©³¡.70 #HOSTILE ÔÚ¶ñÍÁÉÏͨÐлòפÔúµÄ²¿¶Ó, Æä״̬»áÊܵ½ËðÉË, ÊÜËð±ÈÀýÓëÏûºÄµÄÐж¯µã³ÉÕý±È, פÔúÒ»»ØºÏ, ½«Ëðʧ%d%%µÄ״̬. ºÓÁ÷¡¢ÂÌÖÞ¡¢Ô˺ӻò¾üÊ»ùµØ¿ÉµÖÏû¶ñÍÁµÄ¸ºÃæÓ°Ïì.71 #DEADLANDS ¶ñÍÁÎÞ·¨½øÐÐÈκθÄÔì.72 #RARE ÿһÕÅËæ»úµØͼÉÏ, ¶¼ÓÐ12¿é¶ñÍÁ, ÆäÖÐÒ»°ëÔ̲Ø×ÅÌØÊâ×ÊÔ´, ÿÖÖÌØÊâ×ÊÔ´¸÷ÓÐÁ½´¦.73 #STRENGTH Õ½¶·: %d/%d74 #SPEED »ú¶¯: %s75 #MODELNOTE ( ÔÚ²»Í¬¹ú¼ÒÖÐ, ͬÖÖ²¿¶ÓµÄÍâ¹ÛºÍÃû³Æ¿ÉÄÜÓÐËù²îÒì.)76 #COSTBASE Éú²úÔì¼Û»ùÖµ%s%%p77 #WEIGHT ±àÖÆ%s%%w78 #BUILDALLOW ÐÂÔöÉèÊ©79 #MODELALLOW ¿ÉÕ÷ÌØÊⲿ¶Ó80 #FEATALLOW ÐÂÔöÌØÊâÊôÐÔ81 #FOLLOWADV ºóÐø¿Æ¼¼82 #GOVALLOW ³öÏÖÐÂÉúÕþÌå83 #UPGRADEALLOW ¾üÊÂÓ°Ïì84 #SEEALSO ÁíÇë²ÎÔÄ:85 #FUTURETECHHELP25 ´ú±íÁËδÀ´µÄ¿Æ¼¼ÁìÓò. ÔÚ´ËÁìÓòÏÂ, ÿ¸ö¹ú¼Ò×î¶à¿ÉÑз¢25Ïî¿ÆÑгɹû.\\86 ÿÏîδÀ´¿Æ¼¼ÐèÒªÔÏÈ4±¶µÄÑз¢×ʽð. ÓëÆäËû¿Æ¼¼³É¹û²»Í¬, δÀ´¿Æ¼¼²»¿ÉÓÃ×÷Íâ½»½»ÉæµÄíÀÂë, Ò²ÎÞ·¨´Ó´óͼÊé¹ÝÖÐÖ±½Ó»ñÈ¡.87 #FUTURETECHHELP100 ´ú±íÁËδÀ´µÄ¿Æ¼¼ÁìÓò. ÔÚ´ËÁìÓòÏÂ, ÿ¸ö¹ú¼Ò×î¶à¿ÉÑз¢100Ïî¿ÆÑгɹû.\\88 ÿÏîδÀ´¿Æ¼¼ÐèÒªÔÏÈ4±¶µÄÑз¢×ʽð. ÓëÆäËû¿Æ¼¼³É¹û²»Í¬, δÀ´¿Æ¼¼²»¿ÉÓÃ×÷Íâ½»½»ÉæµÄíÀÂë, Ò²ÎÞ·¨´Ó´óͼÊé¹ÝÖÐÖ±½Ó»ñÈ¡.89 #CRED_CAPSOUND ÉùÒô90 #CRED_CAPAI È˹¤ÖÇÄÜÄ£¿é91 #CRED_CAPLANG ÖÐÎÄ»¯°æ±¾92 #AUTHOR @NAPTID\ ¼òÌåÖÐÎÄ°æÓÉ NapTID(ÎÞÃû) ·ÒëÖÆ×÷.93 #MATCHES ·ûºÏ "%s"µÄËÑË÷½á¹û:94 #NOMATCHES δ·¢ÏÖ°üº¬ "%s" µÄÈκÎËÑË÷½á¹û.62 #TRAFO 地形可变更为 %s 63 #MOVEPLAIN 部队移动类型: 平坦地形 64 #MOVEHEAVY 部队移动类型: 崎岖地形 65 #DEFBONUS 防御加成: %d%% 66 #JOBCOST -建设造价: %s 行动点 67 #JOBCOSTVAR -建设造价: 请在游戏中选择"系统菜单" - "快速宏操作" - "地形改造" 68 #TERIMPEXCLUDE 灌溉、采矿、要塞和军事基地不可共存于同一地块. 例如, 若在已建有要塞的地块建设军事基地, 则要塞将消失, 军事基地取而代之. 69 #TERIMPCITY 城市所在的地块, 同时包含以下效果:\-道路\-铁路 (铁路科技发现后)\-运河\-灌溉\-农场. 70 #HOSTILE 在恶土上通行或驻扎的部队, 其状态会受到损伤, 受损比例与消耗的行动点成正比, 驻扎一回合, 将损失%d%%的状态. 河流、绿洲、运河或军事基地可抵消恶土的负面影响. 71 #DEADLANDS 恶土无法进行任何改造. 72 #RARE 每一张随机地图上, 都有12块恶土, 其中一半蕴藏着特殊资源, 每种特殊资源各有两处. 73 #STRENGTH 战斗: %d/%d 74 #SPEED 机动: %s 75 #MODELNOTE (在不同国家中, 同种部队的外观和名称可能有所差异.) 76 #COSTBASE 生产造价基值 %s%%p 77 #WEIGHT 编制 %s%%w 78 #BUILDALLOW 新增设施 79 #MODELALLOW 可征特殊部队 80 #FEATALLOW 新增特殊属性 81 #FOLLOWADV 后续科技 82 #GOVALLOW 出现新生政体 83 #UPGRADEALLOW 军事影响 84 #SEEALSO 另请参阅: 85 #FUTURETECHHELP25代表了未来的科技领域. 在此领域下, 每个国家最多可研发25项科研成果.\\ 86 每项未来科技需要原先4倍的研发资金. 与其他科技成果不同, 未来科技不可用作外交交涉的砝码, 也无法从大图书馆中直接获取. 87 #FUTURETECHHELP100 代表了未来的科技领域. 在此领域下, 每个国家最多可研发100项科研成果.\\ 88 每项未来科技需要原先4倍的研发资金. 与其他科技成果不同, 未来科技不可用作外交交涉的砝码, 也无法从大图书馆中直接获取. 89 #CRED_CAPSOUND 声音 90 #CRED_CAPAI 人工智能模块 91 #CRED_CAPLANG 中文化版本 92 #AUTHOR @NAPTID\简体中文版由 NapTID(无名) 翻译制作. 93 #MATCHES 符合 "%s"的搜索结果: 94 #NOMATCHES 未发现包含 "%s" 的任何搜索结果. 95 95 96 96 97 97 #CONCEPTS 98 $ ¸ÅÄî½â˵\99 100 ;INTRO ÓÎÏ·½éÉÜ\\101 102 ! ÓÎÏ·½â˵\103 ;BASICS ¸ÅÂÛ\104 ;SCIENCE ¿Æ¼¼\105 ;DIPLOMACY Íâ½»\106 ;SHIP »ñʤ\\107 108 ! ²¿¶Ó½â˵\109 ;MOVEMENT ²¿¶ÓÒƶ¯\110 ;COMMANDS ²¿¶ÓÖ¸Áî\111 ;SETTLE ÒÆÃñ¹¤×÷\112 ;COMBAT Õ½¶·´óÈ«\113 ;SPYMISSIONS ÃØÃÜÐж¯\114 ;CLASSES ²¿¶ÓÑз¢\\115 116 ! ³ÇÊнâ˵\117 ;CITIES ³ÇÊйÜÀí\118 ;PRODUCTION Éú²úÏê½â\119 ;BUILDINGS ½¨Öþ½éÉÜ\120 ;SUPPORT ²¿¶ÓÁ¥Êô\\121 122 ! ÆäËû¸ÅÄî\123 ;MACRO ¿ìËÙºê²Ù×÷\124 ;MAPEDIT µØͼ±à¼Æ÷\125 ;AIT µçÄÔ¶Ô¾ö98 $概念解说\ 99 100 ;INTRO 游戏介绍\\ 101 102 !游戏解说\ 103 ;BASICS 概论\ 104 ;SCIENCE 科技\ 105 ;DIPLOMACY 外交\ 106 ;SHIP 获胜\\ 107 108 !部队解说\ 109 ;MOVEMENT 部队移动\ 110 ;COMMANDS 部队指令\ 111 ;SETTLE 移民工作\ 112 ;COMBAT 战斗大全\ 113 ;SPYMISSIONS 秘密行动\ 114 ;CLASSES 部队研发\\ 115 116 !城市解说\ 117 ;CITIES 城市管理\ 118 ;PRODUCTION 生产详解\ 119 ;BUILDINGS 建筑介绍\ 120 ;SUPPORT 部队隶属\\ 121 122 !其他概念\ 123 ;MACRO 快速宏操作\ 124 ;MAPEDIT 地图编辑器\ 125 ;AIT 电脑对决 126 126 127 127 128 128 #ABOUT 129 $ ¹ØÓÚÓÎÏ·\129 $关于游戏\ 130 130 131 131 &LOGO\\ 132 132 133 ! ÆðÔ´¼°Ä¿±ê\133 !起源及目标\ 134 134 C-evo is a non-commerical game project based on the famous "Sid Meier's 135 135 Civilization" by Microprose. The ambition of C-evo is not, to compete with … … 140 140 ::E2 c-evo.org\\ 141 141 142 ! ËùÓÐȨÐí¿É\142 !所有权许可\ 143 143 C-evo is a compilation of work by a number of authors. You are allowed 144 144 to play the game and to distribute it without explicit permission. The compilation … … 148 148 the graphics, you should ask the author of an item before using it for another 149 149 purpose than to play.\ 150 ::C ²é¿´ÖÆ×÷ÈËÔ±Ãûµ¥\\151 152 !AI Ä£¿é\150 ::C 查看制作人员名单\\ 151 152 !AI模块\ 153 153 The game has an open AI interface, which means the player can replace the standard AI 154 154 contained in the package by other AI algorithms, either for all or for single … … 158 158 you installed the game. Maybe competition will lead us to the first real good AI 159 159 in modern strategy gaming.\ 160 ::E1 AI Ä£¿é¿ª·¢Ö¸ÄÏ\\161 162 ! ϵͳÔËÐÐÐèÇó\163 - Ò»¿é¿ÉÏÔʾ16λɫ»òÒÔÉϵÄÏÔ¿¨\164 - ÍƼö¿ªÆô×ÖÌåƽ»¬¹¦ÄÜ\\165 166 ! ÃüÁîÐÐÔËÐвÎÊý\167 -cevo.exe -man ... ²»ÔËÐÐÓÎÏ·, ½öÏÔʾָÄÏ\\168 169 ! ɾ³ýÓÎÏ·\170 ÇëÔËÐпØÖÆÃæ°åÖеÄɾ³ý³ÌÐòÏòµ¼.\\171 172 ! ´íÎ󱨸æ\160 ::E1 AI模块开发指南\\ 161 162 !系统运行需求\ 163 -一块可显示16位色或以上的显卡\ 164 -推荐开启字体平滑功能\\ 165 166 !命令行运行参数\ 167 -cevo.exe -man ... 不运行游戏, 仅显示指南\\ 168 169 !删除游戏\ 170 请运行控制面板中的删除程序向导.\\ 171 172 !错误报告\ 173 173 174 174 To support the progress of this project, please tell me about problems you have … … 200 200 201 201 #CREDITS 202 $ ÖÆ×÷ÈËÔ±\202 $制作人员\ 203 203 204 204 @@18\\ 205 205 206 ! Éè¼Æ\207 Ô´´ÒâÀ´×ÔSid Meier & Brian ReynoldsÖÆ×÷µÄ 208 "Sid Meier's Civilization" ¼°"Civilization II".\209 ¸ù¾ÝÍæ¼ÒͬºÃµÄÒâ¼û½¨ÒéÐ޸Ķø³É.\\210 211 ! ³ÌÐò\212 Ö÷³ÌÐò: Steffen Gerlach.\213 PNG ͼƬ֧³Ö: Edmund H. Hand\\214 215 ! ²âÊÔ\216 ÎÞÊý²»ÖªÃûµÄ²âÊÔÕß, ¸ÐлÄãÃÇÿһ¸öÈË!\\217 218 ! ÆäËû\219 ijЩÎÆÀíͼƬÀ´×Ô"Mayang's Free Textures".\220 ³ÇÊÐÃûµ¥Ìṩ: Charles Nadolski..\\221 222 ! ÃÀ¹¤\223 ¾ø´ó²¿·ÖͼƬÊÇ´ÓÍøÉÏÁ÷´«µÄ¸÷ÖÖÎÄÃ÷II×ÊÔ´°üÄÚÌáÈ¡µÄ, 224 ÆäÖÐһЩ×÷ÕßÒѲ»¿É¿¼, »¹ÓÐһЩÎÞ·¨ÁªÂç. Èô·¢ÏÖÉÌÒµ 225 °æȨͼƬ, »òÊDz»Ô¸ÄúµÄÀͶ¯³É¹û±»Ãâ·ÑתÓÃ, »òÊÇ×÷Ϊ 226 ͼƬ×÷ÕßµÄÄúÏëÔÚÖÆ×÷ÈËÔ±Ãûµ¥ÖÐÁôÏÂÐÕÃû, ÇëÁªÏµÎÒÃÇ.206 !设计\ 207 原创意来自Sid Meier & Brian Reynolds制作的 208 "Sid Meier's Civilization" 及 "Civilization II".\ 209 根据玩家同好的意见建议修改而成.\\ 210 211 !程序\ 212 主程序: Steffen Gerlach.\ 213 PNG图片支持: Edmund H. Hand\\ 214 215 !测试\ 216 无数不知名的测试者, 感谢你们每一个人!\\ 217 218 !其他\ 219 某些纹理图片来自 "Mayang's Free Textures".\ 220 城市名单提供: Charles Nadolski..\\ 221 222 !美工\ 223 绝大部分图片是从网上流传的各种文明II资源包内提取的, 224 其中一些作者已不可考, 还有一些无法联络. 若发现商业 225 版权图片, 或是不愿您的劳动成果被免费转用, 或是作为 226 图片作者的您想在制作人员名单中留下姓名, 请联系我们. 227 227 228 228 229 229 #QUICK 230 $ ¿ìËÙÉÏÊÖ\231 232 ! ¿ìËÙÉÏÊÖ\233 234 ÒÔÏÂÊÇÓÎÏ·»ù±¾µÄÒªµã, ¹©ÐÂÊÖ¿ìËÙÈëÃÅ:\235 236 - ÕâÊÇÒ»¿î»ØºÏÖÆÓÎÏ·, ÓÎÏ·ºËÐÄÔ´×ÔÎÄÃ÷ϵÁÐ.\237 - µ±ËùÓв¿¶ÓÐж¯½áÊøºó, ÄúµÄ»ØºÏ×Ô¶¯½áÊø. Èç¹ûÓÎÏ·238 Í£Ö¹ÔËÐÐ, Ò²ÐíÊÇϵͳÔÚµÈÄúÊÖ¶¯½áÊø»ØºÏ.\239 - ´ó¶àÊý¿Éµã»÷µÄÏîÄ¿¶¼ÒÔ°×É«Íâ¿ò±íʾ.\240 - ÔÚͬһµØ¿éÉÏ, Ò²ÐíפÓжàÖ§²¿¶Ó, µ«Ö»ÓÐ×îÇ¿´óµÄ²¿¶Ó241 ²Å»áÏÔʾÔÚµØͼÉÏ.\242 - ÓÃÊó±ê×ó¼üµ¥»÷Ñ¡Ôñ²¿¶Ó, . Ñ¡ÖеIJ¿¶Óͼ±ê½«»áÉÁ˸,243 ÆÁĻϷ½´ø¸Ð̾ºÅµÄ°´Å¥, ÊǸò¿¶ÓÏà¹ØµÄ²Ù×÷²Ëµ¥.\244 - ÒªÒƶ¯²¿¶Ó, ÇëʹÓüüÅÌ·½Ïò¼ü¡¢Êý×Ö¼ü»òÊó±êÓÒ¼ü.\245 - Êó±êµ¥»÷³ÇÊÐͼ±ê, ¿ÉÏÔʾ¸Ã³ÇÊеIJÙ×÷´°¿Ú, ÆäÖÐ×î246 ÖØÒªµÄÊÇÉú²ú°´Å¥, µ¥»÷´°¿ÚÖв¿µÄÉú²ú°´Å¥, ¿ÉÑ¡Ôñ 247 еĽ¨ÉèÄ¿±ê, ÀýÈçÑ¡ÔñÍØ»ÄÕß, È¥±ð´¦½¨Á¢ÐµijÇÊÐ.\248 - ³ÇÊн¨Éè¡¢Ôö³¤µÄËÙ¶È, ÒÔ¼°¿ÆÑÐË°ÊյĶàÉÙ,249 È«¶¼È¡¾öÓÚÄãµÄÑ¡Ôñ.\250 - ÔÚ¶àÊýÇé¿öÏÂ, ÔÚÊó±êµã»÷ijÏîÄ¿µÄͬʱ°´×¡Shift¼ü,251 ¿ÉÏÔʾÏà¹ØµÄ°ïÖúÐÅÏ¢.\\\230 $快速上手\ 231 232 !快速上手\ 233 234 以下是游戏基本的要点, 供新手快速入门:\ 235 236 -这是一款回合制游戏, 游戏核心源自文明系列.\ 237 -当所有部队行动结束后, 您的回合自动结束. 如果游戏 238 停止运行, 也许是系统在等您手动结束回合.\ 239 -大多数可点击的项目都以白色外框表示.\ 240 -在同一地块上, 也许驻有多支部队, 但只有最强大的部队 241 才会显示在地图上.\ 242 -用鼠标左键单击选择部队, . 选中的部队图标将会闪烁, 243 屏幕下方带感叹号的按钮, 是该部队相关的操作菜单.\ 244 -要移动部队, 请使用键盘方向键、数字键或鼠标右键.\ 245 -鼠标单击城市图标, 可显示该城市的操作窗口, 其中最 246 重要的是生产按钮, 单击窗口中部的生产按钮, 可选择 247 新的建设目标, 例如选择拓荒者, 去别处建立新的城市.\ 248 -城市建设、增长的速度, 以及科研税收的多少, 249 全都取决于你的选择.\ 250 -在多数情况下, 在鼠标点击某项目的同时按住Shift键, 251 可显示相关的帮助信息.\\\ 252 252 253 253 254 254 @@22\\ 255 ! ÖÂÎÄÃ÷ϵÁеÄÀÏÍæ¼Ò\256 257 ¾ÍµØÐκͲ¿¶ÓͼƬµÄÏàËƳ̶ȶøÑÔ, C-evo(ÎÄÃ÷½ø»¯Ê·)258 ºÜÈÝÒ×±»¿´×÷ÊÇÎÄÃ÷II´ú¾µäµÄ¸´ÖÆ°æ. µ«ÉîÈëÓÎÏ·ºó, 259 Äã¾Í»á·¢ÏÖÁ½ÕßÓÐÐí¶à²»Í¬. Æä²îÒì³Ì¶ÈÉõÖÁ¿ÉÓë 260 ÎÄÃ÷IºÍII´úÖ®¼äµÄ²îÒìÏàÌá²¢ÂÛ. ²é¿´¾ßÌå²îÒì, 261 Çëµã»÷ÏÂÁбêÌâ:\262 :MOVEMENT ²¿¶ÓÒƶ¯\263 ::T µØÐÎÖÖÀà\264 ::B202 Ææ¼£Ó°Ïì\265 ::G ÕþÌåÐÎʽ\266 ::A ¿Æ¼¼ÑÝ»¯\267 :DIPLOMACY ¶ÔÍâ½»Éæ\268 :SHIP Ö³Ãñ·É´¬\\269 270 ³ýÁËÉÏÊö²îÒìÖ®Íâ, »¹ÓÐÒÔÏÂÒªµãÌáÇë¸÷λÍæ¼ÒÁôÒâ:\271 272 -C-evo ²»¿¿Ëæ»úÔËËã×÷ΪÂôµã. ÿһÏî¼Æ»®µÄ½á¹û¶¼¿É273 Ô¤ÆÚ, ³ýÁËÊÀ½çµØͼµÄÉú³ÉºÍÆäËûÊÆÁ¦µÄ¾Ù¶¯Ö®Íâ.\274 - µçÄÔ¼ÆËãËùÒÀ¾ÝµÄ¹æÔòÓëÕæÈËÍæ¼ÒÍêÈ«Ïàͬ. µçÄÔÍæ¼Ò275 ²¢ÎÞ¶îÍâµÄÓÅÊÆ, ÔÚ»ñµÃÇ鱨·½ÃæÒ²Ò»Ñù.\276 - ³ÇÊнṹÓëÎÄÃ÷ϵÁÐÂÔÓгöÈë. ÔÚ³ÇÊÐËùÔڵĵؿé, ÓÐ1¸ö277 ÊÐÃñ¸ºÔðÀͶ¯Éú²ú, µ«²»»á´ÓÊÂÉÌҵóÒ×; ´ËÍâ, ÊÐÃñ½á¹¹ 278 Ò²ÓÐËù¼ò»¯, ÈçÈ¥³ýÁËÒÕÈ˺ÍÊÕË°È˵ȵÈ.\279 - ³ÇÊÐ×îС¹æģΪ2¼¶, Éú²úÒ»Ö§ÍØ»ÄÕß, ÐëºÄ·Ñ2¸öÊÐÃñ.\280 - ³ÇÊÐÁ¸Ê³´¢Á¿ÉÏÏÞ²¢·ÇÓɳÇÊйæÄ£¾ö¶¨, Òò´Ë´ó³ÇÊеÄ281 Ôö³¤ËÙ¶È, ÍùÍùÔ¶¸ßÓÚ½ÏСµÄ³ÇÊÐ.\282 - ÎÞÐèÁÙ½üº£Ñó»òºÓÁ÷, ¼´¿É½øÐйà¸È.\283 - ´ÓÆäËûÊÆÁ¦»ñµÃµÄÏȽø¿Æ¼¼, ÎÞ·¨Ö±½ÓÀûÓÃ, ±ØÐëÏÈÕë¶Ô284 ¸Ã¿Æ¼¼½øÐÐÆÊÎöÐÔÑо¿, Ñо¿ËٶȽ«ÊǶÀ×ÔÑо¿µÄÁ½±¶, 285 ÇÒ²»±ØÑо¿ÏÈÆÚËùÐè¿Æ¼¼.\286 - ijЩ¸ß¼¶×÷Õ½²¿¶ÓÎÞ·¨Ö±½Ó½¨Éè, ±ØÐëÏȽøÐÐÑз¢,287 Ñз¢³É¹¦ºó²ÅÄܽ¨Éè.\288 - ijЩµØÐζԵØÃ沿¶Ó»áÔì³ÉÉ˺¦, Ïê¼û"µØÐÎÖÖÀà"ÖеÄ"¶ñÍÁ".\255 !致文明系列的老玩家\ 256 257 就地形和部队图片的相似程度而言, C-evo(文明进化史) 258 很容易被看作是文明II代经典的复制版. 但深入游戏后, 259 你就会发现两者有许多不同. 其差异程度甚至可与 260 文明I和II代之间的差异相提并论. 查看具体差异, 261 请点击下列标题:\ 262 :MOVEMENT 部队移动\ 263 ::T 地形种类\ 264 ::B202 奇迹影响\ 265 ::G 政体形式\ 266 ::A 科技演化\ 267 :DIPLOMACY 对外交涉\ 268 :SHIP 殖民飞船\\ 269 270 除了上述差异之外, 还有以下要点提请各位玩家留意:\ 271 272 -C-evo不靠随机运算作为卖点. 每一项计划的结果都可 273 预期, 除了世界地图的生成和其他势力的举动之外.\ 274 -电脑计算所依据的规则与真人玩家完全相同. 电脑玩家 275 并无额外的优势, 在获得情报方面也一样.\ 276 -城市结构与文明系列略有出入. 在城市所在的地块, 有1个 277 市民负责劳动生产, 但不会从事商业贸易; 此外, 市民结构 278 也有所简化, 如去除了艺人和收税人等等.\ 279 -城市最小规模为2级, 生产一支拓荒者, 须耗费2个市民.\ 280 -城市粮食储量上限并非由城市规模决定, 因此大城市的 281 增长速度, 往往远高于较小的城市.\ 282 -无需临近海洋或河流, 即可进行灌溉.\ 283 -从其他势力获得的先进科技, 无法直接利用, 必须先针对 284 该科技进行剖析性研究, 研究速度将是独自研究的两倍, 285 且不必研究先期所需科技.\ 286 -某些高级作战部队无法直接建设, 必须先进行研发, 287 研发成功后才能建设.\ 288 -某些地形对地面部队会造成伤害, 详见"地形种类"中的"恶土".\ 289 289 290 290 291 291 #INTRO 292 $ ÓÎÏ·½éÉÜ\292 $游戏介绍\ 293 293 294 294 @@56\ 295 ! »¶Ó½øÈëC-evo(ÎÄÃ÷½ø»¯Ê·)µÄÊÀ½ç\296 297 ±¾ÓÎÏ·´øÄúÁìÂÔÈËÀàÎÄÃ÷µÄ·¢Õ¹Ê·, Äú¿É´øÁìÒ»Ö§ÖÖ×å, 298 Àú¾ÁùǧÄê²×É£±äǨ, ´ÓÈËÀà×î³õµÄ¶¨¾Ó¿ªÊ¼·Ü¶·, ÇóÉú, 299 ½ø»¯, Ö±ÖÁʵÏÖÈËÀàµÄÖÕ¼«ÃÎÏë--Ö³ÃñÍâÐÇ. Ç°½øµÄµÀ· 300 ²¢²»×ÜÊÇÒ»·¬Ì¹Í¾: ¿ÉÓõÄ×ÊÔ´²¢²»³äÔ£, ÐèÒª¾«´òϸËã; 301 ÖÜΧµÄÒ°µØãã, ÉÙ˵ҲµÃ»¨¼¸Ç§Äê²ÅÄܱä³ÉÎÄÃ÷ÀÖÍÁ; 302 ¸ü±ðÌá²»ÆÚ¶øÖÁµÄ¼¢»ÄºÍ±äÂÒÁË, ÌìÔÖÈË»öʼÖÕÊdzÇÊÐ 303 ·±ÈÙ·¢Õ¹µÄ×î´óÍþв..\\304 305 ÖÖÖÖ²»ÀûÒòËØÖ®ÏÂ, ΨÓп¿ÉîıԶÂDzÅÄÜ´øÁìÈËÃñ×ßÏòÐÒ¸£.306 À©Õŵ۹úÁìÍÁ, ·¢Õ¹³ÇÊн¨Éè, ÐÞ±øÓª, °ì´óѧ, Ô칤³§......307 ÔÚ½¨ÉèµÄͬʱ, Ò²±ðºöÊÓÁË¿ÆѧÑо¿, Ñз¢ÐÂʽ²¿¶ÓºÍÎäÆ÷, 308 ÅÉDzÍػIJ¿¶Ó¿ª±ÙеÄÎÖÍÁ, ÒýÁì´¬¶ÓÑ°ÕÒº£Ñó±Ë°¶µÄ´ó½, 309 ½«Õû¸öÊÀ½ç¾¡ÊÕÑÛµ×.\\310 311 ±ðÍüÁË, ÄãµÄ¹ú¼Ò²¢²»ÊÇÕâÊÀ½çÖÐΨһµÄÎÄÃ÷. ÿ¿é´ó½ÉÏ 312 ¶¼Óв»Í¬µÄ²¿Âä, ´æÔÚÏ൱µÄÎÄ»¯²îÒì. Òª¼Çס, ûÓÐÄĸö 313 ÖÖ×åÊÇÌìÃüÓÀ´æµÄ, ÈκÎÒ»¸öµÛ¹ú¶¼ÓпÉÄÜÔÚÒ»Ò¹¼äÇ㸲, 314 ÄãµÄ¹ú¼ÒÒ²²»ÀýÍâ.\\315 316 ÓëËû¹úµÄµÚÒ»´Î½Ó´¥Ò²Ðí²¢²»»áÊÇÒ»´ÎÓä¿ìµÄ¾Àú, µ«Í¨¹ý 317 ²»Ð¸µÄÍâ½»½»Éæ, Ðí¶àÔÏȵIJ»¿ÉÄÜÒ²»á±ä³É¿ÉÄÜ. ÓëÆäËû 318 ÎÄÃ÷½»»»¿Æ¼¼ÖªÊ¶, ÓÃÌõÔ¼±£»¤¸÷×ÔµÄÀûÒæ, »òÊǽ¨Á¢¼á¹Ì 319 µÄÃËÔ¼, ÔÚÏÝÈëÂ鷳ʱÓиö°ïÊÖÓ¦¸Ã²»ÊÇ»µÊÂ. µ«Ò²±ðÌ«¹ý 320 ÒÀÀµÌõÔ¼, ÒòΪÕâ¸öÊÀ½çûÓÐÓÀÔ¶µÄÅóÓÑ, Ö»ÓÐÉú´æµÄ¶ÔÊÖ, 321 ²»ÂÛÊÇÄĸöÖÖ×å, ¶¼ÔÚΪÁËͬһ¸öÄ¿±ê¶ø¾ºÕù: ×îÖÕµÄʤÀû.295 !欢迎进入C-evo(文明进化史)的世界\ 296 297 本游戏带您领略人类文明的发展史, 您可带领一支种族, 298 历经六千年沧桑变迁, 从人类最初的定居开始奋斗, 求生, 299 进化, 直至实现人类的终极梦想--殖民外星. 前进的道路 300 并不总是一番坦途: 可用的资源并不充裕, 需要精打细算; 301 周围的野地茫茫, 少说也得花几千年才能变成文明乐土; 302 更别提不期而至的饥荒和变乱了, 天灾人祸始终是城市 303 繁荣发展的最大威胁..\\ 304 305 种种不利因素之下, 唯有靠深谋远虑才能带领人民走向幸福. 306 扩张帝国领土, 发展城市建设, 修兵营, 办大学, 造工厂...... 307 在建设的同时, 也别忽视了科学研究, 研发新式部队和武器, 308 派遣拓荒部队开辟新的沃土, 引领船队寻找海洋彼岸的大陆, 309 将整个世界尽收眼底.\\ 310 311 别忘了, 你的国家并不是这世界中唯一的文明. 每块大陆上 312 都有不同的部落, 存在相当的文化差异. 要记住, 没有哪个 313 种族是天命永存的, 任何一个帝国都有可能在一夜间倾覆, 314 你的国家也不例外.\\ 315 316 与他国的第一次接触也许并不会是一次愉快的经历, 但通过 317 不懈的外交交涉, 许多原先的不可能也会变成可能. 与其他 318 文明交换科技知识, 用条约保护各自的利益, 或是建立坚固 319 的盟约, 在陷入麻烦时有个帮手应该不是坏事. 但也别太过 320 依赖条约, 因为这个世界没有永远的朋友, 只有生存的对手, 321 不论是哪个种族, 都在为了同一个目标而竞争: 最终的胜利. 322 322 323 323 324 324 #BASICS 325 $ ¸ÅÂÛ\326 327 ! ¸ÅÂÛ\328 329 ¹ú¼ÒµÄ×é³Éµ¥Î»ÊDz¿¶ÓºÍ³ÇÊÐ. ²¿¶ÓµÄÖ°ÔðÊÇ̽Ïպ͹¥ÊØ, 330 ¶ø³ÇÊеÄÖ°ÄÜÊÇÈË¿ÚÔö³¤, Éú²ú½¨ÉèºÍ¿ÆѧÑо¿.\\331 332 ÊÀ½çµØͼÓÉËıßÐεؿé×é³É. ÿ¸öµØ¿é¶¼ÓÐÆäµØÐÎÊôÐÔ, 333 ¸ù¾Ý²»Í¬µÄµØÐÎÖÖÀà, µØ¿éµÄÒÔÏÂÈýÖÖÊôÐÔ»áÓÐËù²»Í¬: 334 ×ÊÔ´²úÁ¿, ·ÀÓù¼Ó³É, ºÍÒƶ¯ÏûºÄ. ͬһµØ¿éÉÏ×î¶àÄܽ¨ 335 Ò»×ù³ÇÊÐ, µ«¿ÉÈÝÄɵÄͬ¹ú²¿¶ÓÊýÁ¿²¢ÎÞÏÞÖÆ. Òª»ñµÃ 336 Ìض¨µØ¿éµÄ°ïÖúÐÅÏ¢, ÇëÔÚµãÑ¡µØ¿éʱ°´×¡Shift¼ü.\337 ::T µØÐÎÖÖÀà\\338 339 ±¾ÓÎÏ·²ÉÓÃÁ˻غÏÖƽøÐз½Ê½£¬ÆäËû¶ÔÊÖ±ØÐëµÈ´ýÄúÈ«²¿ 340 Ðж¯Íê±Ï£¬½áÊø»ØºÏÖ®ºó·½¿ÉÒÀ´ÎÐж¯. ÔÚĬÈÏÅäÖÃÏÂ, 341 ËùÓв¿¶ÓÐж¯Íê³Éºó,»ØºÏ½«×Ô¶¯½áÊø, Èç¹ûÄú¿´µ½"µÈ´ý 342 »ØºÏ½áÊø"µÄÌáʾ,Çëµã»÷ÆÁÄ»ÓÒϽǵĽáÊø»ØºÏ°´Å¥.\\325 $概论\ 326 327 !概论\ 328 329 国家的组成单位是部队和城市. 部队的职责是探险和攻守, 330 而城市的职能是人口增长, 生产建设和科学研究.\\ 331 332 世界地图由四边形地块组成. 每个地块都有其地形属性, 333 根据不同的地形种类, 地块的以下三种属性会有所不同: 334 资源产量, 防御加成, 和移动消耗. 同一地块上最多能建 335 一座城市, 但可容纳的同国部队数量并无限制. 要获得 336 特定地块的帮助信息, 请在点选地块时按住Shift键.\ 337 ::T 地形种类\\ 338 339 本游戏采用了回合制进行方式,其他对手必须等待您全部 340 行动完毕,结束回合之后方可依次行动. 在默认配置下, 341 所有部队行动完成后,回合将自动结束, 如果您看到"等待 342 回合结束"的提示,请点击屏幕右下角的结束回合按钮.\\ 343 343 344 344 345 345 #SCIENCE 346 $ ¿Æ¼¼\346 $科技\ 347 347 348 348 @@46\ 349 ! ¿Æ¼¼\350 351 ÓÎÏ·Öйú¼ÒÒªÏëÐÞ½¨ÐµÄÉèÊ©, ×齨еIJ¿¶Ó, 352 »òÊdzÉÁ¢ÐµÄÕþÌå, ±ØÐëÏÈÑо¿Ïà¹ØµÄ¿Æ¼¼. 353 ³ýÁ˳õʼʱµÄ¼¸Ïî¿Æ¼¼Ö®Íâ, ¾ø´ó²¿·Ö¿Æ¼¼Ðè 354 ÏÈÑо¿1ÖÁ2ÏîÇ°µ¼ÐԿƼ¼, ÏêÇéÇë¿´:\355 ::A ¿Æ¼¼Ò»ÀÀ\\356 357 ÓÎÏ·¿ªÊ¼ºóÒ»»ØºÏ, ϵͳ»áÌáʾÍæ¼ÒÑ¡ÔñÏëÒª 358 Ñо¿µÄµÚÒ»ÏîпƼ¼. Òª»ñÖªÏà¹Ø¿Æ¼¼µÄÏêϸ 359 ÐÅÏ¢, ÇëÔÚµãÑ¡¿Æ¼¼Ãû³ÆµÄͬʱ°´×¡Shift¼ü.360 ¿Æ¼¼Ñо¿µÄ½ø¶ÈÈ¡¾öÓÚ¹ú¼ÒÀÛ»ýµÄ¿Æѧ×ÜÁ¿(%r)361 Èç¹ûÀÛ»ýµÄ%r´ïµ½¹æ¶¨µÄˮƽ, ¾ÍÄÜ»ñµÃÐ嵀 362 ¿ÆÑгɹû. ÿ´ÎÖ»ÄÜÑо¿Ò»Ïî¿Æ¼¼, ¾ö¶¨Ö®ºó, 363 Ñо¿¼Æ»®¾ÍÎÞ·¨¸ü¸ÄÁË. 364 Ëæ×ű¾¹ú¿Æ¼¼³É¹ûµÄ²»¶ÏÍƳö, пƼ¼µÄÑо¿ 365 ËùÐèÒªµÄ¿Æѧ×ÜÁ¿»áÖð²½Ôö¶à, ÏêÇéÇë¿´:\\366 367 ;SCIENCECOST ¿ÆÑзÑÓÃÏê½â349 !科技\ 350 351 游戏中国家要想修建新的设施, 组建新的部队, 352 或是成立新的政体, 必须先研究相关的科技. 353 除了初始时的几项科技之外, 绝大部分科技需 354 先研究1至2项前导性科技, 详情请看:\ 355 ::A 科技一览\\ 356 357 游戏开始后一回合, 系统会提示玩家选择想要 358 研究的第一项新科技. 要获知相关科技的详细 359 信息, 请在点选科技名称的同时按住Shift键. 360 科技研究的进度取决于国家累积的科学总量 (%r) 361 如果累积的%r达到规定的水平, 就能获得新的 362 科研成果. 每次只能研究一项科技, 决定之后, 363 研究计划就无法更改了. 364 随着本国科技成果的不断推出, 新科技的研究 365 所需要的科学总量会逐步增多, 详情请看:\\ 366 367 ;SCIENCECOST 科研费用详解 368 368 369 369 370 370 #SCIENCECOST 371 $ ¿ÆÑзÑÓÃÏê½â\372 373 ! ¿ÆÑзÑÓÃÏê½â\374 375 Ëæ×ſƼ¼Ñз¢ÊýÁ¿µÄÔö¶à, ¿ÆÑзÑÓÃÒ²»áËæÖ®Ìá¸ß. 376 µ±Ç°ÄѶÈÏÂ, ¿ÆÑзÑÓõļÆË㹫ʽΪ:\371 $科研费用详解\ 372 373 !科研费用详解\ 374 375 随着科技研发数量的增多, 科研费用也会随之提高. 376 当前难度下, 科研费用的计算公式为:\ 377 377 &TECHFORMULA\\ 378 ±äÁ¿nµÄ³õʼֵΪ4, ²¢¸ù¾ÝÒÔÏÂÌõ¼þ·¢ÉúÏàÓ¦±ä»¯:\379 - ²¿¶ÓÑз¢²»»áÓ°ÏìnÖµµÄ±ä»¯\380 - µçÄԿƼ¼µÄÑо¿²»»áÓ°ÏìnÖµµÄ±ä»¯\381 - ³É¹¦ÑеôÓÆäËûÊÆÁ¦»ñµÃµÄ¿Æ¼¼, nÖµ+1\382 - ×ÔÐгɹ¦ÑеÃÈκÎÆäËû¿Æ¼¼, °üÀ¨ÈýÖÖδÀ´¿Æ¼¼, nÖµ+2\383 - ´Ó´óͼÊé¹ÝÖÐÖ±½Ó»ñµÃ¿Æ¼¼, nÖµ+1378 变量n的初始值为4, 并根据以下条件发生相应变化:\ 379 -部队研发不会影响n值的变化\ 380 -电脑科技的研究不会影响n值的变化\ 381 -成功研得从其他势力获得的科技, n值+1\ 382 -自行成功研得任何其他科技, 包括三种未来科技, n值+2\ 383 -从大图书馆中直接获得科技, n值+1 384 384 385 385 386 386 #DIPLOMACY 387 $ Íâ½»\388 389 ! ¸ÅÂÛ\390 391 Á½¸öËØδıÃæµÄ¹ú¼ÒÒª½¨Á¢Íâ½»¹Øϵ, ±ØÐëµÈµ½ÆäÖÐÒ»¹ú 392 µÄµØÃ沿¶Ó·¢ÏÖÁíÒ»¹úµÄµØÃ沿¶Ó»ò³ÇÊÐÖ®ºó·½¿É½øÐÐ. 393 ÔÚ¹ú¼ÒÇ鱨»Ãæ, ¿É²é¿´ÒÑÖªÆäËûÊÆÁ¦µÄÏà¹ØÐÅÏ¢. 394 ÔÚ¹ú¼ÒÇ鱨»ÃæÖÐ, ÏÔʾÁËÒ»¸ö¹ú¼ÒµÄÕþÌåÐÎʽ, ÏÖÓÐ×ʽð, 395 Íâ½»Á¢³¡, ÒÔ¼°ÈË¿Ú, ÁìÍÁ, ¿Æ¼¼, ̽Ë÷µÈ¸Å¿ö. \\396 397 ! ½»Éæ\398 µ±Á½¹ú·¢Éú½Ó´¥Ö®ºó, ¿É¿ªÕ¹Íâ½»½»Éæ, ÔÚ½»ÉæÖпɽøÐÐ 399 ½»»»Ã³Ò×»òÇ©ÊðÐÔ¼. Õû¸ö½»Éæ¹ý³ÌÖ÷ÒªÓÉÖƶ¨ÌáÒé, 400 ½ÓÊÜÌáÒé, ÒÔ¼°È¡ÏûÌõÔ¼Èý²¿·Ö×é³É.\\401 402 µ±½»ÉæË«·½¶¼Í£Ö¹ÌáÒéµÄʱºò, ½»Éæ¾Í½«½áÊø. Èç¹ûÒ»·½ 403 Ñ¡ÔñÖÕ̸ֹÅÐ, ½»ÉæÒ²»áÁ¢¼´ÖÕÖ¹.\\404 405 ! ÌáÒé\406 Íâ½»½»ÉæÖ÷ÒªµÄ×é³É²¿·ÖÊǸ÷ÖÖÌáÒé. ÌáÒéµÄÄÚÈÝÖаüº¬ÁË 407 ½»ÉæÒ»·½ÏòÁíÒ»·½Ìá³öµÄÒªÇó, ÒÔ¼°Ô¸ÒâΪ֮¸¶³öµÄÌõ¼þ. 408 ¿ÉÄÜ°üº¬µÄÄÚÈÝÓÐ:\409 - Ò»ÏîÌõÔ¼\410 - ¹ú¼ÒÇ鱨\411 - ¾üÊÂÇ鱨\412 - Ò»±ÊÏÖ½ð\413 - ¿Æ¼¼³É¹û\414 - ²¿¶ÓÑз¢\415 - ̽Ë÷µØͼ\416 - Ö³Ãñ·É´¬²¿¼þ(Ì«¿Õ¸Û½¨³Éºó)\\417 418 Èç¹ûÌáÒéÖÐδ°üº¬Ïò¶Ô·½ÒªÇóµÄÄÚÈÝ, ¾ÍÏ൱ÓÚÒ»·ÝÀñÎï.419 Ö»ÓжԷ½½ÓÊÜ, ÀñÎï²ÅÓÐЧ¹û. ÓëÖ®Ïà·´µÄÇé¿öÊÇ, Èç¹û 420 ÌáÒéÖÐδ°üº¬Ïò¶Ô·½¸¶³öµÄÌõ¼þ, ¾ÍÊdzàÂãÂãµÄË÷È¡.\\421 422 ´ÓÆäËûÊÆÁ¦»ñµÃµÄÏȽø¿Æ¼¼, ÎÞ·¨Ö±½ÓÀûÓÃ, ±ØÐëÏÈÕë¶Ô 423 ¸Ã¿Æ¼¼½øÐÐÆÊÎöÐÔÑо¿, Ñо¿ËٶȽ«ÊǶÀ×ÔÑо¿µÄÁ½±¶, 424 ÇÒ²»±ØÑо¿ÏÈÆÚËùÐè¿Æ¼¼.\\425 426 ! ÌõÔ¼\427 ÌõÔ¼·ÖΪÒÔϼ¸ÖÖ:\\428 429 - ºÍƽÌõÔ¼:430 Á½¹ú²»µÃÏ໥¹¥»÷, Ò²²»µÃ½øÈë¶Ô·½µÄ¹ú¾³. 431 ºÍƽ¹ú¼ÒµÄ²¿¶Ó¶ÔÁíÒ»·½µÄ³ÇÊÐûÓÐΧ¹¥Ð§Ó¦.\\432 433 - ÓѺÃÌõÔ¼:434 ³ýÁ˺ÍƽÌõÔ¼µÄÉÏÊöÔ¼¶¨Ö®Íâ, 435 Á½¹úÿ»ØºÏ½»»»¸÷×ԵĹú¼ÒÇ鱨..\\436 437 - ÃËÔ¼:438 ³ÉΪÃ˹úÖ®ºó, ¼ºÊÆÁ¦²¿¶Ó¿ÉÔÚÃ˹ú¹ú½çÄÚ×ÔÓÉÒƶ¯, 439 ·´Ö®ÒàÈ». ÁíÍâ, Ã˹ú¼ä¹²ÏíËùÓÐÇ鱨 (°üÀ¨µØÇø/¾üÊ 440 ¼°µØͼÇ鱨), ¶Ô·½²¿¶ÓµÄÒ»¾ÙÒ»¶¯Ò²½«È«²¿ÖªÏ¤.\\441 442 ÁíÍâ, ûÓÐÇ©ÊðÈκÎÌõÔ¼µÄÁ½¸ö¹ú¼Ò, ¿ÉÒÔ´ï³ÉÍ£Õ½ÐÒé. 443 Í£Õ½ÐÒé²»ÊôÓÚÌõÔ¼, ½öÊÇÒ»ÖÖÔÝʱ²»¹¥»÷¶Ô·½µÄÔÊŵ. 444 µ±ÆäÖÐÒ»·½¿ªÕ½ºó, ÐÒé×Ô¶¯Ê§Ð§. 445 ×ÛÉÏËùÊö, Á½¹ú¼ä¿ÉÄܵĹØϵÁбíÈçÏÂ:\387 $外交\ 388 389 !概论\ 390 391 两个素未谋面的国家要建立外交关系, 必须等到其中一国 392 的地面部队发现另一国的地面部队或城市之后方可进行. 393 在国家情报画面, 可查看已知其他势力的相关信息. 394 在国家情报画面中, 显示了一个国家的政体形式, 现有资金, 395 外交立场, 以及人口, 领土, 科技, 探索等概况. \\ 396 397 !交涉\ 398 当两国发生接触之后, 可开展外交交涉, 在交涉中可进行 399 交换贸易或签署协约. 整个交涉过程主要由制定提议, 400 接受提议, 以及取消条约三部分组成.\\ 401 402 当交涉双方都停止提议的时候, 交涉就将结束. 如果一方 403 选择终止谈判, 交涉也会立即终止.\\ 404 405 !提议\ 406 外交交涉主要的组成部分是各种提议. 提议的内容中包含了 407 交涉一方向另一方提出的要求, 以及愿意为之付出的条件. 408 可能包含的内容有:\ 409 -一项条约\ 410 -国家情报\ 411 -军事情报\ 412 -一笔现金\ 413 -科技成果\ 414 -部队研发\ 415 -探索地图\ 416 -殖民飞船部件(太空港建成后)\\ 417 418 如果提议中未包含向对方要求的内容, 就相当于一份礼物. 419 只有对方接受, 礼物才有效果. 与之相反的情况是, 如果 420 提议中未包含向对方付出的条件, 就是赤裸裸的索取.\\ 421 422 从其他势力获得的先进科技, 无法直接利用, 必须先针对 423 该科技进行剖析性研究, 研究速度将是独自研究的两倍, 424 且不必研究先期所需科技.\\ 425 426 !条约\ 427 条约分为以下几种:\\ 428 429 -和平条约: 430 两国不得相互攻击, 也不得进入对方的国境. 431 和平国家的部队对另一方的城市没有围攻效应.\\ 432 433 -友好条约: 434 除了和平条约的上述约定之外, 435 两国每回合交换各自的国家情报..\\ 436 437 -盟约: 438 成为盟国之后, 己势力部队可在盟国国界内自由移动, 439 反之亦然. 另外, 盟国间共享所有情报 (包括地区/军事 440 及地图情报), 对方部队的一举一动也将全部知悉.\\ 441 442 另外, 没有签署任何条约的两个国家, 可以达成停战协议. 443 停战协议不属于条约, 仅是一种暂时不攻击对方的允诺. 444 当其中一方开战后, 协议自动失效. 445 综上所述, 两国间可能的关系列表如下:\ 446 446 &TREATIES\\ 447 447 448 Ö»ÓÐÔÚÍâ½»½»ÉæÖÐ, »òÊÇÒ»¹ú¾Ü¾ø½Ó¼û 449 ±ð¹úʹ½ÚµÄʱºò, ·½¿ÉÈ¡ÏûÔÏÈÇ©¶©µÄ 450 ÌõÔ¼. È¡ÏûÌõÔ¼ºó, ÔÚ½ÓÏÂÀ´µÄÈý»ØºÏÄÚ 451 ²»¿ÉÓëͬһ¹ú¼ÒÔÙ´ÎÈ¡ÏûÆäËûÌõÔ¼.452 Èç¹ûA¹úÈ¡ÏûÓëB¹ú¼äµÄºÍƽÌõÔ¼, 453 ÔòB¹úµÄͬÃ˹úÒ²½«¶ÔA¹úÐûÕ½.\\454 455 ! ¿ÉÐų̶È\456 ÒªÅжÏÒ»¸ö¹ú¼ÒÊÇ·ñÑÔ³ö±ØÐÐ, ¿ÉÐŶÈÊÇ 457 ÖØÒª²Î¿¼ÒÀ¾Ý. ¿ÉÐŶȷÖΪÒÔÏÂËĸöµÈ¼¶:\458 - ÑÔ³ö±ØÐÐ (100%¿ÉÐŶÈ)\459 - ÖØŵÊØÐÅ (90%~99%¿ÉÐŶÈ)\460 - ×½Ãþ²»¶¨ (70%~89%¿ÉÐŶÈ)\461 - ÑÔ¶øÎÞÐÅ (¿ÉÐŶȵÍÓÚ70%)\\462 463 ÔÚºÍƽʱÆÚ, ÿ»ØºÏÿ¸ö¹ú¼ÒµÄ¿ÉÐŶÈ+1, Ö±ÖÁ×î´óÖµ. 464 ÓÎÏ·¿ªÊ¼Ê±, ËùÓйú¼ÒµÄ×î´ó¿ÉÐŶÈΪ100, ˺»ÙºÍƽÌõÔ¼ 465 ½«Ê¹µ±Ç°¿ÉÐŶȼõ°ë, ×î´ó¿ÉÐŶÈ-10. ˺»ÙÃËÔ¼½«Ê¹µ±Ç° 466 ¿ÉÐŶȼõÉÙËÄ·ÖÖ®Èý. ÎÞÂÛÊÇ·ñ½¨Á¢¹ýÍâ½»¹Øϵ, Ò»¸ö¹ú¼Ò 467 µÄ¿ÉÐŶÈ, ¶ÔÆäËû¹ú¼Ò¶¼Êǹ«¿ªÍ¸Ã÷µÄ.448 只有在外交交涉中, 或是一国拒绝接见 449 别国使节的时候, 方可取消原先签订的 450 条约. 取消条约后, 在接下来的三回合内 451 不可与同一国家再次取消其他条约. 452 如果A国取消与B国间的和平条约, 453 则B国的同盟国也将对A国宣战.\\ 454 455 !可信程度\ 456 要判断一个国家是否言出必行, 可信度是 457 重要参考依据. 可信度分为以下四个等级:\ 458 -言出必行 (100%可信度)\ 459 -重诺守信 (90%~99%可信度)\ 460 -捉摸不定 (70%~89%可信度)\ 461 -言而无信 (可信度低于70%)\\ 462 463 在和平时期, 每回合每个国家的可信度+1, 直至最大值. 464 游戏开始时, 所有国家的最大可信度为100, 撕毁和平条约 465 将使当前可信度减半, 最大可信度-10. 撕毁盟约将使当前 466 可信度减少四分之三. 无论是否建立过外交关系, 一个国家 467 的可信度, 对其他国家都是公开透明的. 468 468 469 469 470 470 #SHIP 471 $ ÓÎÏ·»ñʤ\472 473 ! »ñʤ·½Ê½\474 475 ÒªÏëÈ¡µÃ×îÖÕʤÀû, Ö»ÓÐÒ»Ìõ;¾¶: ÏòÍâÌ«¿ÕÖ³Ãñ! Èç¹û 476 ÄãµÄÊÆÁ¦³ÉΪÊ׸öÅÉDzֳÃñ·É´¬µÄ¹ú¼Ò, ÄÇÄã¾ÍÊÇ×îºó 477 µÄÓ®¼Ò. Ò»ËÒÖ³Ãñ·É´¬Ðè12¸ö²¿¼þ×éºÏ¶ø³É:\\478 479 ;:B67 6 ¸öÖ³Ãñ·É´¬×é¼þ\480 ;:B68 4 ¸ö¶¯Á¦²Õ\481 ;:B69 2 ¸ö¾Óס²Õ\\482 483 Òª×齨ÒÔÉÏÈýÖÖ·É´¬²¿¼þ, ±ØÐëÒÀ¿¿ÈýÖÖ¶ÔÓ¦µÄÌØÊâ×ÊÔ´. 484 Ö»ÓÐÉú²ú¸ÃÖÖÌØÊâ×ÊÔ´µÄ³ÇÊÐ, ²ÅÄÜ×齨ÏàÓ¦µÄ·É´¬²¿¼þ. 485 ÔÚ×齨·É´¬²¿¼þʱ, ÎÞ·¨½èÖúͨ³£µÄÌáËÙÊֶμӿ콨Éè. 486 ÌØÊâ×ÊÔ´°üÀ¨:\471 $游戏获胜\ 472 473 !获胜方式\ 474 475 要想取得最终胜利, 只有一条途径: 向外太空殖民! 如果 476 你的势力成为首个派遣殖民飞船的国家, 那你就是最后 477 的赢家. 一艘殖民飞船需12个部件组合而成:\\ 478 479 ;:B67 6个殖民飞船组件\ 480 ;:B68 4个动力舱\ 481 ;:B69 2个居住舱\\ 482 483 要组建以上三种飞船部件, 必须依靠三种对应的特殊资源. 484 只有生产该种特殊资源的城市, 才能组建相应的飞船部件. 485 在组建飞船部件时, 无法借助通常的提速手段加快建设. 486 特殊资源包括:\ 487 487 &MODERN\\ 488 488 489 Òª·¢ÏÖÕâЩÌØÊâ×ÊÔ´, ±ØÐëÏÈ»ñµÃÒÔÏ¿Ƽ¼:\490 ::A47 ¹æÄ£Á¿²ú489 要发现这些特殊资源, 必须先获得以下科技:\ 490 ::A47 规模量产 491 491 492 492 493 493 #MOVEMENT 494 $ ²¿¶ÓÒƶ¯\495 496 ! ²¿¶ÓÒƶ¯\497 498 Òª¶Ô²¿¶ÓÏ´ïÃüÁî, ÇëÏÈÑ¡ÖÐÖ´ÐÐÃüÁîµÄ²¿¶Ó. ±»Ñ¡µÄ²¿¶Ó 499 »áÒÔÉÁ˸±íʾѡÖÐ״̬, ͬʱ¸Ã²¿¶ÓµÄÏêϸÇé¿ö»áÏÔʾÔÚ 500 ÆÁĻϷ½. Ó÷½Ïò¼ü, С¼üÅÌÊý×Ö¼ü»òÊó±êÓÒ¼üÖ¸»Ó²¿¶ÓÏò 501 Ä¿±êµØ¿éÒƶ¯.\\502 503 ! Òƶ¯ÏÞÖÆ\504 ͨ³£Çé¿öÏÂ, ²¿¶Ó×ÜÄÜÒƶ¯µ½Áڽӵؿé, µ«ÒÔÏÂÇé¿ö³ýÍâ:\505 - Ä¿±êµØ¿éÉÏÓÐÆäËûÊÆÁ¦µÄ²¿¶Ó.\506 - Òƶ¯²¿¶ÓµÄ»ú¶¯Á¦²»×ã, ÏêÇé¼ûÏÂÎÄ.\507 - µØÃ沿¶Ó²»¿ÉÔÚº£ÃæÒƶ¯, º£Éϲ¿¶Ó²»¿ÉÔÚ½µØÒƶ¯.\508 - ûÓк£Éϵ¼º½ÄÜÁ¦µÄ½¢Ö»²»¿ÉÔÚÔ¶ÑóÒƶ¯.\509 - ²»¿ÉÏòÆäËûÊÆÁ¦µÄ¿ØÖƵØÓòÒƶ¯, ÏêÇé¼ûÏÂÎÄ.\\510 511 ! ¿ÕÖв¿¶Ó\512 ¿ÕÖв¿¶ÓÔÚÿ»ØºÏ½áÊøʱ±ØÐë»Øµ½±¾·½»ùµØ(°üÀ¨±¾·½³ÇÊÐ, 513 ¾üÊ»ùµØ, ¼°Ä¸½¢), Èç¹ûδÄÜ·µ»Ø»ùµØ, ¸Ã²¿¶Ó»á×¹»ÙÕóÍö. 514 ÓÐÒ»ÖÖ·½·¨¿ÉÒÔ±ÜÃâÉÏÊöÇé¿öµÄ·¢Éú:\515 ::F7 ¸ø²¿¶ÓÔö¼ÓȼÓÍ\\516 517 ! »ú¶¯ÏûºÄ\518 ÿ´ÎÒƶ¯¶¼ÐèÏûºÄÒ»¶¨µÄ»ú¶¯Á¦(MP), º£Éϲ¿¶Ó, ¿ÕÖв¿¶Ó, 519 ÒÔ¼°Ïòƽ̹µØÐÎÒƶ¯µÄµØÃ沿¶Ó×÷бÏòÒƶ¯Ê±(ÈçÎ÷±±·½), 520 ÐèÏûºÄµÄ»ú¶¯Á¦Îª1µã; ´¹Ö±»òˮƽ·½ÏòÒƶ¯Ê±(ÈçÕý±±·½), 521 ÐèÏûºÄµÄ»ú¶¯Á¦Îª1.5µã. ÏòÆé᫵ØÐÎÒƶ¯Ê±, »ú¶¯Á¦Îª1.5µÄ 522 µØÃ沿¶Ó, ËùºÄµÄ»ú¶¯Á¦ÊÇƽ̹µØÐεÄ120%, »ú¶¯Á¦ÔÚ1.5µã 523 ÒÔÉϵĵØÃ沿¶Ó, ËùºÄµÄ»ú¶¯Á¦ÊÇƽ̹µØÐεÄ130%. Ïò¸ßɽ 524 µØ¿éÒƶ¯Ê±, µØÃ沿¶ÓÐèÏûºÄÁ½»ØºÏ»ú¶¯Á¦, Òƶ¯Íê³ÉºóµÄ 525 Ò»¸ö»ØºÏ½«ÎÞ·¨Ðж¯..\526 ::T ²é¿´µØÐÎÖÖÀà\\527 528 Òƶ¯ËùºÄ»ú¶¯Á¦µÄʾÒâͼÈçÏÂ:\494 $部队移动\ 495 496 !部队移动\ 497 498 要对部队下达命令, 请先选中执行命令的部队. 被选的部队 499 会以闪烁表示选中状态, 同时该部队的详细情况会显示在 500 屏幕下方. 用方向键, 小键盘数字键或鼠标右键指挥部队向 501 目标地块移动.\\ 502 503 !移动限制\ 504 通常情况下, 部队总能移动到邻接地块, 但以下情况除外:\ 505 -目标地块上有其他势力的部队.\ 506 -移动部队的机动力不足, 详情见下文.\ 507 -地面部队不可在海面移动, 海上部队不可在陆地移动.\ 508 -没有海上导航能力的舰只不可在远洋移动.\ 509 -不可向其他势力的控制地域移动, 详情见下文.\\ 510 511 !空中部队\ 512 空中部队在每回合结束时必须回到本方基地(包括本方城市, 513 军事基地, 及母舰), 如果未能返回基地, 该部队会坠毁阵亡. 514 有一种方法可以避免上述情况的发生:\ 515 ::F7 给部队增加燃油\\ 516 517 !机动消耗\ 518 每次移动都需消耗一定的机动力(MP), 海上部队, 空中部队, 519 以及向平坦地形移动的地面部队作斜向移动时(如西北方), 520 需消耗的机动力为1点; 垂直或水平方向移动时(如正北方), 521 需消耗的机动力为1.5点. 向崎岖地形移动时, 机动力为1.5的 522 地面部队, 所耗的机动力是平坦地形的120%, 机动力在1.5点 523 以上的地面部队, 所耗的机动力是平坦地形的130%. 向高山 524 地块移动时, 地面部队需消耗两回合机动力, 移动完成后的 525 一个回合将无法行动..\ 526 ::T 查看地形种类\\ 527 528 移动所耗机动力的示意图如下:\ 529 529 @MoveShot\ 530 - ×óͼ - ³õʼ»ú¶¯Á¦1.5µÄ²¿¶Ó\531 - ÓÒͼ - ³õʼ»ú¶¯Á¦3µÄ²¿¶Ó\\532 533 Èç¹û²¿¶Ó˳×ŵÀ·, ºÓÁ÷»òÔ˺ÓÒƶ¯, ÎÞÂÛÔʼµØÐÎΪºÎ, 534 »ú¶¯Á¦ÏûºÄ¶¼½«½µÎª0.4(бÏòÒƶ¯)ºÍ0.6(·ÇбÏòÒƶ¯).535 Èç¹û˳×ÅÌú·Òƶ¯, »ú¶¯Á¦ÏûºÄ½«½µÎª³õʼ»ú¶¯Á¦µÄ8%536 ( бÏòÒƶ¯)ºÍ12%(·ÇбÏòÒƶ¯).\\537 лغϿªÊ¼Ê±, ²¿¶ÓÏûºÄµÄ»ú¶¯Á¦½«»Ø¸´µ½³õʼ×î´óÖµ.538 º£Éϲ¿¶ÓÊÜËðºó, »ú¶¯Á¦ÎÞ·¨ÍêÈ«»Ø¸´, µ«²»»áµÍÓÚ2.5.\\539 ÒªÒƶ¯µ½¸üÔ¶´¦, ¿ÉʹÓÃÄ¿±êÒƶ¯¹¦ÄÜ, ÓÒ¼üµ¥»÷Ä¿±êµØ¿é,540 ²¿¶Ó¾Í»áÏò¸ÃµØ¿é³ÖÐøÒƶ¯.\\541 542 ! ¿ØÖƵØÓò\543 ²¿¶Ó·ÖΪÁ½ÖÖ: Ò»ÖÖÓеØÓò¿ØÖÆÄÜÁ¦, ÁíÒ»ÖÖÔòûÓÐ. ÓÐ 544 µØÓò¿ØÖÆÄÜÁ¦µÄ²¿¶ÓÔÚ½Ó½üÆäËûÊÆÁ¦µÄµØÓò¿ØÖƲ¿¶Óʱ,545 ÎÞ·¨Ïò¶Ô·½¿ØÖƵĵØÓòÒƶ¯, ³ý·ÇÄ¿±êµØ¿éÊDZ¾·½³ÇÊÐ,546 »ò¸ÃµØ¿é´æÔÚ±¾·½µÄµØÓò¿ØÖƲ¿¶Ó. º£Éϲ¿¶Ó, ¿ÕÖв¿¶Ó,547 ÌØÖÖ±øÒÔ¼°´¦ÓÚÔËÊä״̬µÄ²¿¶ÓûÓеØÓò¿ØÖÆÄÜÁ¦.\\548 549 ! Õ¼Áì³ÇÊÐ\550 ¹¥»÷Ð͵ØÃ沿¶Ó¿ÉÕ¼Áì²»Éè·ÀµÄµÐ·½³ÇÊÐ. Õ¼ÁìµÐ³Çºó, 551 ¸Ã³ÇÁ¥Êô²¢ÔÚÍâפÔúµÄµÐ¾ü²¿¶Ó½«È«ÊýÏûÍö, Õû¸ö³ÇÊÐ 552 Ò²»áÏÝÈëɧÂÒ״̬, ²¢³ÖÐøÈý¸ö»ØºÏ.530 -左图 - 初始机动力1.5的部队\ 531 -右图 - 初始机动力3的部队\\ 532 533 如果部队顺着道路, 河流或运河移动, 无论原始地形为何, 534 机动力消耗都将降为0.4(斜向移动)和0.6(非斜向移动). 535 如果顺着铁路移动, 机动力消耗将降为初始机动力的8% 536 (斜向移动)和12%(非斜向移动).\\ 537 新回合开始时, 部队消耗的机动力将回复到初始最大值. 538 海上部队受损后, 机动力无法完全回复, 但不会低于2.5.\\ 539 要移动到更远处, 可使用目标移动功能, 右键单击目标地块, 540 部队就会向该地块持续移动.\\ 541 542 !控制地域\ 543 部队分为两种: 一种有地域控制能力, 另一种则没有. 有 544 地域控制能力的部队在接近其他势力的地域控制部队时, 545 无法向对方控制的地域移动, 除非目标地块是本方城市, 546 或该地块存在本方的地域控制部队. 海上部队, 空中部队, 547 特种兵以及处于运输状态的部队没有地域控制能力.\\ 548 549 !占领城市\ 550 攻击型地面部队可占领不设防的敌方城市. 占领敌城后, 551 该城隶属并在外驻扎的敌军部队将全数消亡, 整个城市 552 也会陷入骚乱状态, 并持续三个回合. 553 553 554 554 555 555 #COMMANDS 556 $ ²¿¶ÓÖ¸Áî\556 $部队指令\ 557 557 558 558 @@16\ 559 ! ²¿¶ÓÖ¸Áî\560 561 ²¿¶ÓÖÖÀ಻ͬ, ÒÔ¼°²¿¶ÓËù´¦µØÐβ»Í¬, ²¿¶ÓÖ¸ÁîÒ²ÓвîÒì:\562 563 - ½âÉ¢: ½âÉ¢¸Ã²¿¶Ó\564 - Õû±à: ½«²¿¶Ó±àÖÆ´òÉ¢, ¼ÓÈëµ½µ±Ç°³ÇÊн¨ÉèµÄв¿¶ÓÖÐ\565 - Ä¿±êÒƶ¯: ¼ÌÐøÏòÏÈÇ°É趨µÄÄ¿±êÒƶ¯\566 - ÉÔºóÐж¯: ÔÝʱÌø¹ý, Ñ¡ÔñÏÂÒ»²¿¶Ó\567 - Եصȴý: ±¾»ØºÏ²»ÔÙÐж¯\568 - פÊؾ¯½ä: ³ÖÐø²»Ðж¯, Ö±ÖÁ±»ÔÙ´ÎÊÖ¶¯Ñ¡ÖÐ\569 - »Ö¸´ÐÝÕû: ÊÜË𲿶ÓÔÚÔµØÍ£Áô»Ö¸´×´Ì¬, Ö±ÖÁÍêÈ«¿µ¸´\570 - ¸ÄΪ±¾³Ç²¿¶Ó: ½«ËùÔÚ³ÇÊÐÖ¸¶¨Îª¸Ã²¿¶ÓеÄÁ¥Êô³ÇÊÐ\571 - ·µ»Ø×î½ü³ÇÊÐ: ¾¡¿ì·µ»Ø¾àÀë×î½üµÄ±¾·½³ÇÊÐ\572 - ½çÃæ¾ÓÖÐ: ÒԸò¿¶ÓΪ´°¿ÚÖÐÐÄ, µ÷ÕûÓÎÏ·´°¿Ú\573 - ÂÓ¶á: ´Ý»Ùµ±Ç°µØ¿éµÄµØÐν¨Éè(ÐèºÄ·Ñ1µã»ú¶¯Á¦)559 !部队指令\ 560 561 部队种类不同, 以及部队所处地形不同, 部队指令也有差异:\ 562 563 -解散: 解散该部队\ 564 -整编: 将部队编制打散, 加入到当前城市建设的新部队中\ 565 -目标移动: 继续向先前设定的目标移动\ 566 -稍后行动: 暂时跳过, 选择下一部队\ 567 -原地等待: 本回合不再行动\ 568 -驻守警戒: 持续不行动, 直至被再次手动选中\ 569 -恢复休整: 受损部队在原地停留恢复状态, 直至完全康复\ 570 -改为本城部队: 将所在城市指定为该部队新的隶属城市\ 571 -返回最近城市: 尽快返回距离最近的本方城市\ 572 -界面居中: 以该部队为窗口中心, 调整游戏窗口\ 573 -掠夺: 摧毁当前地块的地形建设(需耗费1点机动力) 574 574 575 575 576 576 #SETTLE 577 $ ÒÆÃñ¹¤×÷\577 $移民工作\ 578 578 579 579 @@29\ 580 ! ÒÆÃñ¹¤×÷\581 582 ÒÆÃñ²¿¶Ó, ÈçÍØ»ÄÕߺ͹¤³Ìʦ, ¿É¶ÔµØÐνøÐиÄÔì:\583 584 - ¶¨¾Ó: ÔÚËùÔڵؿ齨Á¢Ð³ÇÊÐ\585 - Çå³ýÉÁÖ: ¿³·¥ÉÁÖ, ±ÙΪ»ÄµØ\586 - ³é¸ÉÕÓÔó: ½«ÕÓÔó±äΪ²Ý³¡»òƽÔ\587 - Ö²Ê÷ÔìÁÖ: ½«ËùÔÚµØÐαäΪÉÁÖ\588 - ¸ü»»µØÐÎ: ¸ü»»µØÐÎÖÖÀà, Ïê¼ûÏà¹ØµØÐεıä¸üÐÅÏ¢\589 - Çå³ýÎÛȾ: Ïû³ýÒò¹ý¶ÈÉú²úÔì³ÉµÄµØ¿éÎÛȾ\\590 - µØÐν¨Éè: ·ÖΪ¶àÖÖÀàÐÍ, Ïê¼û:\591 ::J µØÐν¨ÉèÒ»ÀÀ\592 593 ¸ÄÔìµØÐÎÐ軨·ÑÒ»¶¨Á¿µÄ»ú¶¯Á¦, ¿ÉÄܳÖÐøÊý¸öÉõÖÁÊýÊ®¸ö 594 »ØºÏ·½ÄÜÍê³É. Ϊ¼Ó¿ì¸ÄÔìËÙ¶È, ¿ÉÒÔÅÉDz¶àÖ§ÒÆÃñ²¿¶ÓÔÚ 595 ͬһµØ¿éÉÏÖ´ÐÐÏàͬµÄ¸ÄÔìÈÎÎñ. Èç¹ûÊ£Óà»ú¶¯Á¦²»×ã1, 596 ¸ÄÔìÈÎÎñ½«ÍƳٵ½Ï»غϲſªÊ¼. ¹¤³ÌʦִÐÐÈÎÎñµÄЧÂÊÓë 597 ÍØ»ÄÕßÏàͬ, µ«ÓÉÓÚ¹¤³ÌʦӵÓиü¸ßµÄ³õʼ»ú¶¯Á¦, Òò´Ë¹¤×÷ 598 ËٶȱÈÍØ»ÄÕ߸ü¿ì.\599 ::T ¿É²Î¿¼: µØÐÎÖÖÀàÒ»ÀÀ580 !移民工作\ 581 582 移民部队, 如拓荒者和工程师, 可对地形进行改造:\ 583 584 -定居: 在所在地块建立新城市\ 585 -清除森林: 砍伐森林, 辟为荒地\ 586 -抽干沼泽: 将沼泽变为草场或平原\ 587 -植树造林: 将所在地形变为森林\ 588 -更换地形: 更换地形种类, 详见相关地形的变更信息\ 589 -清除污染: 消除因过度生产造成的地块污染\\ 590 -地形建设: 分为多种类型, 详见:\ 591 ::J 地形建设一览\ 592 593 改造地形需花费一定量的机动力, 可能持续数个甚至数十个 594 回合方能完成. 为加快改造速度, 可以派遣多支移民部队在 595 同一地块上执行相同的改造任务. 如果剩余机动力不足1, 596 改造任务将推迟到下回合才开始. 工程师执行任务的效率与 597 拓荒者相同, 但由于工程师拥有更高的初始机动力, 因此工作 598 速度比拓荒者更快.\ 599 ::T 可参考: 地形种类一览 600 600 601 601 602 602 #COMBAT 603 $ Õ½¶·´óÈ«\604 605 ! ¹¥ÊظÅÂÛ\606 607 Ó÷½Ïò¼ü»òÊó±ê¿ÉÖ¸»Ó±¾·½²¿¶Ó¹¥»÷Áڽӵĵз½²¿¶Ó, ·½·¨ 608 Ó벿¶ÓÒƶ¯Ïàͬ. µ«¹¥»÷Ò²ÓÐÒ»¶¨µÄ¹æÔò, ͨ³£Çé¿öÏÂ, µØÃæ 609 ²¿¶ÓÎÞ·¨¹¥»÷º£Éϲ¿¶Ó, ·´Ö®ÒàÈ». º£Éϲ¿¶Ó²»ÄÜ´Ó³ÇÊÐÄÚ 610 »òÔ˺ÓÖз¢Æð¹¥»÷; ¿ÕÖв¿¶ÓÖ»Òª²»ÔÚ³ÇÊÐÄÚ»ò¾üÊ»ùµØÖÐ, 611 ¾ÍÖ»Äܱ»ÆäËû¿ÕÖв¿¶Ó¹¥»÷. Õ½¶·ÖÐÈõÊÆÒ»·½»á±»ÏûÃð, Ç¿ÊÆ 612 Ò»·½½«Êܵ½ËðÉË, Ç¿Èõ²î¾àÔ½´ó,Ç¿ÊƲ¿¶ÓÊÜËðԽС. 613 ÒªÔ¤Öª¹¥»÷µÄЧ¹û, Ç밴סShift¼ü, ÓÒ¼üµã»÷Òª¹¥»÷µÄÄ¿±ê.\\614 615 ÿ֧²¿¶ÓµÄÕ½¶·Á¦·ÖΪ¹¥»÷ºÍ·ÀÓùÁ½ÖÖ. ²¿¶ÓÇ鱨ÖÐÏÔʾµÄ 616 75/25, Òâ˼¾ÍÊǹ¥»÷75, ·ÀÓù25. ÔÚÒ»³¡Õ½ÕùÖÐ, »¹ÓÐһЩ617 ÒòËØ»áÓ°Ïìʵ¼ÊµÄÕ½¶·Á¦:\618 - ²¿¶Ó¾Ñé: ¾ÑéÉÏÉýÒ»¼¶, Õ½¶·Á¦¾ÍÌáÉý25%, Ïê¼ûÏÂÎÄ.\619 - µØÐηÀÓù¼Ó³É: ½ö¶Ô±»¹¥»÷Ò»·½ÓÐЧ, Ïê¼ûµØÐÎÀàÐÍÒ»ÀÀ.\620 - ÌØÊâ·ÀÓùÉèÊ©: Èç³Çǽ, ÒªÈûµÈµÈ; ½ö¶Ô±»¹¥»÷Ò»·½ÓÐЧ.\621 - פÊØ״̬: ½ö¶Ô±»¹¥»÷Ò»·½ÓÐЧ; ²»´¦ÓÚÔËÊä״̬µÄ²¿¶Ó,622 ÈôÉϻغÏûÓÐÐж¯, ±¾»ØºÏ×Ô¶¯½øÈëפÊØ״̬, ·ÀÓù+50%.\623 - ÔÚ³ÇÊÐÀï»ò¾üÊ»ùµØÖÐÍ£ÁôµÄ¿ÕÖв¿¶Ó·ÀÓùÁ¦ÎªÁã, ÔÚ624 ³ÇÊÐÀï»òÔ˺ÓÖеĺ£Éϲ¿¶Ó·ÀÓùÁ¦¼õ°ë.\625 ×¢Òâ: ¶àÖÖ·ÀÓùÁ¦¼Ó³ÉµÄЧ¹ûÊÇ»ýÀÛÏà¼Ó, ¶ø²»ÊDZ¶ÊýÏà³Ë.\\626 627 Èô¹¥»÷·½»ú¶¯²»×ã1µã, ÔòÕ¹¿ª¹¥»÷ʱÎÞ·¨Ê¹³öÈ«²¿Õ½¶·Á¦,628 »á¸ù¾ÝÊ£ÓàµÄ»ú¶¯¶øÏàÓ¦Ï÷Èõ.\\629 630 ! ¹¥»÷³ÉȺ²¿¶Ó\631 Èç¹ûÁ½Ö§»òÁ½Ö§ÒÔÉϵIJ¿¶ÓÍ£ÁôÔÚͬһµØ¿é, ÔÚÔâÊܹ¥»÷ʱ, 632 Ö»ÓÐÒ»Ö§²¿¶Ó³öÕó·ÀÊØ, ¾ÍÊÇÏÔʾÔÚµØͼÉϵÄÄÇÖ§²¿¶Ó. 633 ͨ³£Çé¿öÏÂ, ϵͳ»áÌôÑ¡·ÀÓù×îÇ¿µÄ²¿¶Ó, ÏêÇéÇëµã»÷:\\634 635 ;TILEDEF ³ÉȺ²¿¶ÓµÄ·ÀÊØ\\636 637 Èç¹ûÔÚ³ÇÊÐ, ÒªÈû»ò¾üÊ»ùµØÖ®ÍâµÄ³ÉȺ²¿¶ÓÔÚÕ½¶·ÖÐÂä°Ü, 638 ¸ÃµØ¿éÉÏËùÓеIJ¿¶Ó¶¼»á±»ÏûÃð, DZͧºÍÒþÐηɻúÒ²²»ÀýÍâ.\\639 640 ! ¾ÑéµÈ¼¶\641 Ëæ×ÅÔÚÕ½¶·ÖÐÊÜËð״̬µÄ»ýÀÛ, ²¿¶ÓµÄ¾ÑéµÈ¼¶»áÖð¼¶ÌáÉý,642 ÿËðʧ100µã״̬, ²¿¶Ó¾ÑéÌáÉýÒ»¼¶. ¾ÑéµÈ¼¶ÏêÁÐÈçÏÂ:\603 $战斗大全\ 604 605 !攻守概论\ 606 607 用方向键或鼠标可指挥本方部队攻击邻接的敌方部队, 方法 608 与部队移动相同. 但攻击也有一定的规则, 通常情况下, 地面 609 部队无法攻击海上部队, 反之亦然. 海上部队不能从城市内 610 或运河中发起攻击; 空中部队只要不在城市内或军事基地中, 611 就只能被其他空中部队攻击. 战斗中弱势一方会被消灭, 强势 612 一方将受到损伤, 强弱差距越大,强势部队受损越小. 613 要预知攻击的效果, 请按住Shift键, 右键点击要攻击的目标.\\ 614 615 每支部队的战斗力分为攻击和防御两种. 部队情报中显示的 616 75/25, 意思就是攻击75, 防御25. 在一场战争中, 还有一些 617 因素会影响实际的战斗力:\ 618 -部队经验: 经验上升一级, 战斗力就提升25%, 详见下文.\ 619 -地形防御加成: 仅对被攻击一方有效, 详见地形类型一览.\ 620 -特殊防御设施: 如城墙, 要塞等等; 仅对被攻击一方有效.\ 621 -驻守状态: 仅对被攻击一方有效; 不处于运输状态的部队, 622 若上回合没有行动, 本回合自动进入驻守状态, 防御+50%.\ 623 -在城市里或军事基地中停留的空中部队防御力为零, 在 624 城市里或运河中的海上部队防御力减半.\ 625 注意: 多种防御力加成的效果是积累相加, 而不是倍数相乘.\\ 626 627 若攻击方机动不足1点, 则展开攻击时无法使出全部战斗力, 628 会根据剩余的机动而相应削弱.\\ 629 630 !攻击成群部队\ 631 如果两支或两支以上的部队停留在同一地块, 在遭受攻击时, 632 只有一支部队出阵防守, 就是显示在地图上的那支部队. 633 通常情况下, 系统会挑选防御最强的部队, 详情请点击:\\ 634 635 ;TILEDEF 成群部队的防守\\ 636 637 如果在城市, 要塞或军事基地之外的成群部队在战斗中落败, 638 该地块上所有的部队都会被消灭, 潜艇和隐形飞机也不例外.\\ 639 640 !经验等级\ 641 随着在战斗中受损状态的积累, 部队的经验等级会逐级提升, 642 每损失100点状态, 部队经验提升一级. 经验等级详列如下:\ 643 643 &EXPERIENCE\\ 644 644 645 ! ״̬»Ö¸´\646 »ØºÏ½áÊøʱ, ÊÜË𲿶ӻá¸ù¾ÝÊ£ÓàµÄ»ú¶¯ÏàÓ¦»Ö¸´²¿·Ö״̬. 647 Èç¹û±¾»ØºÏδÔøÒƶ¯, ²¿¶ÓµÄ״̬×î´ó»Ö¸´8µã, ÈôÔÚδɧÂÒ 648 ³ÇÊлò¾üÊ»ùµØÖÐ, ״̬×î´ó»Ö¸´20µã. º£ÃæÉϵÄÊÜËð²¿¶Ó 649 ״̬²»»á»Ö¸´. ¿ÕÖв¿¶ÓÖ»ÓÐÔÚ³ÇÊлò¾üÊ»ùµØÖвÅÄָܻ´.\\650 651 ! ºäÕ¨³ÇÊÐ\652 ¾ß±¸ºäÕ¨ÄÜÁ¦µÄº£ÉϺͿÕÖв¿¶Ó¿É¹¥»÷Áڽӵĵз½³ÇÊÐ, 653 ºäÕ¨ÏûºÄ1µã»ú¶¯. ±»ºäÕ¨µÄ³ÇÊйæÄ£¼õÉÙ1¼¶, Ö±ÖÁ±» 654 ÍêÈ«´Ý»Ù. Ö´ÐкäÕ¨µÄ²¿¶Ó²»»áÊÜËð, Ò²ÎÞ·¨»ñµÃ¾ÑéÖµ.655 ºäÕ¨·½·¨Óë¹¥»÷·½·¨Ïàͬ, ÓÃÊó±ê»ò¼üÅÌÖ¸»Ó²¿¶Ó¹¥»÷.\\656 657 ! ÇýÖ𲿶Ó\658 ÄãÒ²¿ÉÒÔÖ¸»ÓÒ»Ö§²¿¶Ó½«ÔÚ¼º·½ÁìÍÁÉÏפÔúµÄºÍÔ¼¹ú²¿¶Ó 659 ÇýÖð³ö¾³. Ö´ÐÐÇýÖðÖ¸ÁîµÄ²¿¶Ó±ØÐëÊǵØÃæ»òº£ÉϵĹ¥»÷ÐÔ 660 ²¿¶Ó, ÇÒÊ£Óà»ú¶¯´óÓÚ1µã. ÇýÖðµÄ·½·¨Óë¹¥»÷·½·¨Ïàͬ.645 !状态恢复\ 646 回合结束时, 受损部队会根据剩余的机动相应恢复部分状态. 647 如果本回合未曾移动, 部队的状态最大恢复8点, 若在未骚乱 648 城市或军事基地中, 状态最大恢复20点. 海面上的受损部队 649 状态不会恢复. 空中部队只有在城市或军事基地中才能恢复.\\ 650 651 !轰炸城市\ 652 具备轰炸能力的海上和空中部队可攻击邻接的敌方城市, 653 轰炸消耗1点机动. 被轰炸的城市规模减少1级, 直至被 654 完全摧毁. 执行轰炸的部队不会受损, 也无法获得经验值. 655 轰炸方法与攻击方法相同, 用鼠标或键盘指挥部队攻击.\\ 656 657 !驱逐部队\ 658 你也可以指挥一支部队将在己方领土上驻扎的和约国部队 659 驱逐出境. 执行驱逐指令的部队必须是地面或海上的攻击性 660 部队, 且剩余机动大于1点. 驱逐的方法与攻击方法相同. 661 661 662 662 663 663 #TILEDEF 664 $ ³ÉȺ²¿¶Ó\665 666 ! ³ÉȺ²¿¶Ó\667 668 Èç¹ûÁ½Ö§»òÁ½Ö§ÒÔÉϵIJ¿¶ÓÍ£ÁôÔÚͬһµØ¿é, ÔÚÔâÊܹ¥»÷ʱ, 669 Ö»ÓзÀÓù×îÇ¿µÄÄÇÖ§²¿¶Ó»á³öÕó·ÀÊØ, µ«Ò²»á³öÏÖÀýÍâÇé¿ö.670 ϵͳÔÚÈ·¶¨·ÀÓù²¿¶Óʱ, ÒÀ´Î×ñÑÈçϹæÔò:\671 - ×îÓÅÏȵĹæÔòÊǸù¾Ý²¿¶ÓµÄÀà±ð. Ê×ÏÈÊǾ߱¸¿ñÈÈ·Ö×ÓÊôÐÔ672 µÄµØÃ沿¶Ó, È»ºóÊǾßÓеØÓò¿ØÖÆÊôÐԵij£¹æµØÃ沿¶Ó, µÚÈý 673 Ñ¡ÔñÊÇûÓеØÓò¿ØÖÆÊôÐԵĵØÃ沿¶Ó, ×îºóÊÇDZͧºÍÒþÐηɻú.674 ÔÚÔËÊä½¢ºÍÔËÊä»úÉϵÄÔËÊ䲿¶ÓÓÀÔ¶²»»á×÷Ϊ·ÀÊز¿¶Ó³öÕó.\675 - Èç¹ûÓÐÁ½Ö§²¿¶ÓÀà±ðÏàͬ, ·ÀÓù½Ï¸ßµÄ²¿¶Ó½«µ£ÈηÀÊØÈÎÎñ.676 ÕâÀïµÄ·ÀÓùÁ¦Ö¸µÄÊǽ«¾ÑéµÈ¼¶, µ±Ç°×´Ì¬ºÍפÊØ״̬µÈÒòËØ 677 ×ۺϿ¼ÂǵĽá¹û. ¶ÔÌض¨²¿¶ÓµÄÌØÊâ·ÀÓù¼Ó³É½«²»×÷¿¼ÂÇ.\678 - Èç¹ûÁ½Ö§»òÁ½Ö§ÒÔÉϾ߱¸ÏàͬµÄ·ÀÓùÁ¦(ÕâÖÖÇé¿ö¼«ÉÙ·¢Éú)679 Ôì¼Û½ÏµÍµÄÄÇÖ§²¿¶Ó½«µ£ÈηÀÊØÈÎÎñ.664 $成群部队\ 665 666 !成群部队\ 667 668 如果两支或两支以上的部队停留在同一地块, 在遭受攻击时, 669 只有防御最强的那支部队会出阵防守, 但也会出现例外情况. 670 系统在确定防御部队时, 依次遵循如下规则:\ 671 -最优先的规则是根据部队的类别. 首先是具备狂热分子属性 672 的地面部队, 然后是具有地域控制属性的常规地面部队, 第三 673 选择是没有地域控制属性的地面部队, 最后是潜艇和隐形飞机. 674 在运输舰和运输机上的运输部队永远不会作为防守部队出阵.\ 675 -如果有两支部队类别相同, 防御较高的部队将担任防守任务. 676 这里的防御力指的是将经验等级, 当前状态和驻守状态等因素 677 综合考虑的结果. 对特定部队的特殊防御加成将不作考虑.\ 678 -如果两支或两支以上具备相同的防御力(这种情况极少发生) 679 造价较低的那支部队将担任防守任务. 680 680 681 681 682 682 #SPYMISSIONS 683 $ ÃØÃÜÐж¯\683 $秘密行动\ 684 684 685 685 @@28\ 686 ! ÃØÃÜÐж¯\687 688 Ö»ÓÐÌØÖÖ±ø²ÅÄÜÖ´ÐÐÃØÃÜÐж¯. ½«ÌØÖÖ±øÅÉDzµ½µÐ·½³ÇÊÐ 689 Ö®ºó, »áµ¯³öÒ»¸öÐж¯²Ëµ¥¹©Íæ¼ÒÑ¡Ôñ, Ñ¡ÏîÈçÏÂ:\690 - ÆÆ»µÉú²ú: ³ÇÊеĽ¨ÉèÉú²úÍ£ÖÍÒ»»ØºÏ.\691 - ÇÔÈ¡µØͼ: »ñµÃµÐ·½×îеÄÊÀ½çµØͼ.\692 - »ñµÃµÚÈý¹úÇ鱨: ´ÓµÐ·½»ñÖªµÚÈý¹úµÄ¹ú¼ÒÇ鱨.\693 - ´òÌý¹ú¼ÒÇ鱨: »ñÖªµÐ·½×îеĹú¼ÒÇ鱨.\694 - ´òÌý¾üÊÂÇ鱨: »ñÖªµÐ·½×îеľüÊÂÇ鱨.\\695 696 Ç©ÊðºÍƽÌõÔ¼µÄÁ½¸ö¹ú¼Ò, ÎÞ·¨ÔÚ¶Ô·½³ÇÊпªÕ¹ÃØÃÜÐж¯.697 µ«ÌØÖÖ±øÒÀÈ»¿ÉDZÈëÈκεØÇø, ÎÞÊÓÌõÔ¼µÄÔ¼Êø.686 !秘密行动\ 687 688 只有特种兵才能执行秘密行动. 将特种兵派遣到敌方城市 689 之后, 会弹出一个行动菜单供玩家选择, 选项如下:\ 690 -破坏生产: 城市的建设生产停滞一回合.\ 691 -窃取地图: 获得敌方最新的世界地图.\ 692 -获得第三国情报: 从敌方获知第三国的国家情报.\ 693 -打听国家情报: 获知敌方最新的国家情报.\ 694 -打听军事情报: 获知敌方最新的军事情报.\\ 695 696 签署和平条约的两个国家, 无法在对方城市开展秘密行动. 697 但特种兵依然可潜入任何地区, 无视条约的约束. 698 698 699 699 700 700 #CLASSES 701 $ ²¿¶ÓÑз¢\702 703 ! ²¿¶ÓÑз¢\704 705 ÓÎÏ·³õʼʱ, ÈκÎÊÆÁ¦¶¼¿ÉÖ±½ÓÉú²úÃñ±øºÍÍØ»ÄÕß, 706 ijЩÌØÊⲿ¶ÓÐëÕÆÎÕÌض¨µÄ¿Æ¼¼»òÆæ¼£, ·½¿ÉÉú²ú.\707 ::S ²Î¼û"ÌØÊⲿ¶Ó"\\708 709 ÒªÉú²úÆäËûµÄÐÂÐͲ¿¶Ó, ±ØÐë½èÖú¿Æ¼¼Ñз¢·½ÄÜ´ï³É. 710 µ±»ñµÃÁËÏà¹ØµÄ¿Æ¼¼ÖªÊ¶Ö®ºó, (ÀýÈçÕÆÎÕÉÐÎäÏ°Ë׺ó, 711 ¿ÉÑз¢ÐµĵØÃ沿¶Ó), ¿ÉÔÚÑз¢´°¿ÚÑ¡Ôñ"²¿¶ÓÑз¢", 712 ´Ó¶ø¿ªÆô²¿¶ÓÑз¢´°¿Ú:\\701 $部队研发\ 702 703 !部队研发\ 704 705 游戏初始时, 任何势力都可直接生产民兵和拓荒者, 706 某些特殊部队须掌握特定的科技或奇迹, 方可生产.\ 707 ::S 参见"特殊部队"\\ 708 709 要生产其他的新型部队, 必须借助科技研发方能达成. 710 当获得了相关的科技知识之后, (例如掌握尚武习俗后, 711 可研发新的地面部队), 可在研发窗口选择"部队研发", 712 从而开启部队研发窗口:\\ 713 713 714 714 @DraftShot\ 715 715 716 ͼÀý:\717 -1: µ±Ç°±àÖÆ\718 -2: ±¶ÔöÒò×Ó\719 -3: Ñ¡ÔñËùÐèµÄÊôÐÔ\720 -4: Ñ¡Ôñ±øÖÖ\721 -5: Ñз¢±øÖÖµÄÖ¸Êý\\722 723 ²¿¶ÓÑз¢µÄ½á¹ûÈ¡¾öÓÚÁ½¸öÒòËØ: Ò»Êǵ±Ç°±¾¹úµÄ¿Æ¼¼·¢Õ¹ 724 ˮƽ. ijЩ¿Æ¼¼³É¹û¿É´øÀ´ÐµIJ¿¶ÓÊôÐÔ, »òÌáÉý»ù±¾ÊôÐÔ 725 µÄ±¶ÔöÒò×Ó, »ù±¾ÊôÐÔ°üÀ¨¹¥»÷, ·ÀÓù, ÔËÊä, Ôì¼ÛµÈµÈ.\\726 727 ÁíÒ»¸öÔòÊÇÍæ¼Ò×ÔÐе÷ÅäµÄ¸÷ÏîÊôÐÔ±ÈÀý¼°ÌØÊâЧ¹û¼Ó³É. 728 ¾ø´ó¶àÊýÊôÐÔÌáÉýʱ, Éú²úÔì¼Û(%p)ºÍ²¿¶Ó±àÖÆ(%w)Ò²»á 729 ÏàÓ¦ÌáÉý. ²¿¶Ó±øÖֺͿƼ¼³É¹û¾ö¶¨×Ų¿¶Ó±àÖƵÄÉÏÏÞ. Òª 730 »ñ֪ijÊôÐÔµÄÏêϸÐÅÏ¢, Ç밴סShift¼üºóµ¥»÷ÊôÐÔÃû³Æ.\731 ::F ²¿¶ÓÊôÐÔ\\732 733 ¸ù¾ÝÓÎÏ·ÄѶȵIJ»Í¬, ¹¥»÷, ·ÀÓùºÍÔËÊäÊôÐÔµÄÌáÉýËù´øÀ´ 734 µÄÔì¼Û±ä»¯Ò²»áÓвîÒì. ÔÚ¼òµ¥ÄѶÈÏÂ, ²¿¶ÓÔì¼Û½«±ÈÕý³£ 735 ÄѶȵÍ25%, ¶øÔÚÀ§ÄÑÄѶÈÏÂ, Ôì¼Û½«±ÈÕý³£ÄѶȸß25%.716 图例:\ 717 -1: 当前编制\ 718 -2: 倍增因子\ 719 -3: 选择所需的属性\ 720 -4: 选择兵种\ 721 -5: 研发兵种的指数\\ 722 723 部队研发的结果取决于两个因素: 一是当前本国的科技发展 724 水平. 某些科技成果可带来新的部队属性, 或提升基本属性 725 的倍增因子, 基本属性包括攻击, 防御, 运输, 造价等等.\\ 726 727 另一个则是玩家自行调配的各项属性比例及特殊效果加成. 728 绝大多数属性提升时, 生产造价(%p)和部队编制(%w)也会 729 相应提升. 部队兵种和科技成果决定着部队编制的上限. 要 730 获知某属性的详细信息, 请按住Shift键后单击属性名称.\ 731 ::F 部队属性\\ 732 733 根据游戏难度的不同, 攻击, 防御和运输属性的提升所带来 734 的造价变化也会有差异. 在简单难度下, 部队造价将比正常 735 难度低25%, 而在困难难度下, 造价将比正常难度高25%. 736 736 737 737 738 738 #CITIES 739 $ ³ÇÊиÅÂÛ\739 $城市概论\ 740 740 741 741 @@43\ 742 ! ³ÇÊиÅÂÛ\743 744 ³ÇÊеĻù±¾¹¦ÄÜÊÇÊÕ¼¯ÁÚ½üµØ¿éµÄ×ÊÔ´, ²¢½«ÊÕ¼¯µÄ×ÊÔ´ 745 ´¦Àíºó, תΪ¿Æ¼¼, Éú²ú, »òÈË¿Ú. 746 ÓÎÏ·³õʼʱ, Ò»¸ö¹ú¼ÒÖ»ÓÐÒ»¸ö³ÇÊÐ, ¸Ã³ÇÒ²Êǹú¼ÒµÄÊ׶¼. 747 ÓÐÁ½ÖÖ·½·¨Ôö¼Ó³ÇÊÐÊýÁ¿, Ò»ÊÇÅÉDzÒÆÃñ²¿¶Ó½¨Á¢Ð³ÇÊÐ, 748 ¶þÊÇÅɱøÕ¼Áì±ð¹úµÄ³ÇÊÐ. ³ÇÊÐÖ»Äܽ¨Á¢Ôڿɹà¸ÈµÄÍÁµØÉÏ 749 ( ²Ý³¡/ƽÔ/»ÄµØ/ÇðÁê/̦Ô).\\750 751 ÿ¸ö³ÇÊÐÓи÷×ÔרÊôµÄ»Ãæ, µ¥»÷µØͼÉϵijÇÊÐͼ±ê, 752 ¼´¿É´ò¿ª¸Ã³ÇÊеÄרÊô»Ãæ: \\742 !城市概论\ 743 744 城市的基本功能是收集邻近地块的资源, 并将收集的资源 745 处理后, 转为科技, 生产, 或人口. 746 游戏初始时, 一个国家只有一个城市, 该城也是国家的首都. 747 有两种方法增加城市数量, 一是派遣移民部队建立新城市, 748 二是派兵占领别国的城市. 城市只能建立在可灌溉的土地上 749 (草场/平原/荒地/丘陵/苔原).\\ 750 751 每个城市有各自专属的画面, 单击地图上的城市图标, 752 即可打开该城市的专属画面: \\ 753 753 754 754 @CityShot\ 755 755 756 ÉÏÊö»ÃæÖÐ, Ö÷Òª°üº¬ÁËÈçϼ¸¸ö´óÏî:\\757 758 ! ÊÐÃñ\759 760 ³ÇÊлÃæ×óÉϽǵÄÈËÁ³´ú±íןóǵÄÊÐÃñ. ³ÇÊйæÄ£µÄ 761 ÏÂÏÞΪ2¼¶, Èç¹û¹æÄ£½µÖÁ2¼¶ÒÔÏÂ, Ôò¸Ã³Ç½«²»¸´´æÔÚ. 762 ĬÈÏÌõ¼þÏÂ, ³ÇÊйæÄ£ÉÏÏÞΪ8¼¶, µ«ÉÏÏÞÖµ¿Éͨ¹ýÌØÊâ 763 µÄ³ÇÊÐÉèÊ©ÌáÉý.\\764 765 ÿ¸öÊÐÃñ¿ÉÊÕ¼¯Ò»¸öµØ¿é(¼ûÉÏͼ1)µÄ×ÊÔ´. Ò»¸öµØ¿éÉÏ 766 ×î¶àÈÝÄÉÒ»ÃûÊÐÃñ. ±»ÆäËû³ÇÊÐÕ¼Óõĵؿ齫±»±êʾΪ 767 ²»¿ÉÓõؿé.\\768 769 δ±»Ö¸¶¨µÄ¿ÕÏÐÊÐÃñ, ½«±»ÓÃ×÷Ϊ³ÇÊнäÑϲ¿¶Ó(¼ûÉÏͼ2)770 ¿ÉÓÃÆäÀ´Î¬³Ö³ÇÊа²¶¨µÄ±ÈÀý, ʹ³ÇÊв»ÖÁÓÚÏÝÈëɧÂÒ.771 ÏêϸÐÅÏ¢Çë²ÎÕÕÏÂÎÄ°ïÖú²¿·Ö.\\772 773 ! °²¶¨\774 775 ³ÇÊлÃæµÄÓÒÉÏ·½ÏÔʾÁ˵±Ç°ÊÐÃñµÄ°²¶¨×´Ì¬. 776 ¸Ã²¿·Ö·ÖΪÈýÐÐ:\777 778 - ÉÝ³Þ (ͼ±ê: %l). Èç¹ûÔÚ"¾¼Ã¼°Ë°ÊÕ"²Ëµ¥ÖÐ779 É趨ÁËÉݳޱÈÀý, Ôòÿ¸ö³ÇÊеÄóÒ×ÊýÖн«ÓÐ 780 Ò»²¿·Öת»¯ÎªÉݳÞ,Ïê¼ûÏÂÎÄÖеÄ"óÒ×"²¿·Ö.\781 - °²¶¨ (%m). ĬÈÏÇé¿öÏÂ, ³ÇÊÐÖÐÓÐËÄÃûÊÐÃñ782 ÊÇ°²¶¨µÄ, ÆäÓàÊÐÃñ¶¼ÊDz»°²µÄ. ½¨ÔìÌض¨µÄ 783 ³ÇÊÐÉèÊ©»òÆæ¼£, ¿ÉÌáÉý°²¶¨ÊÐÃñµÄÊýÁ¿. ÿ×ù 784 Ææ¼£ÄÜʹËùÔÚ³ÇÊÐÖеÄÁ½Ãû²»°²ÊÐÃñ±äΪ°²¶¨.\785 - ½äÑÏ (%o). ÿ֧³ÇÊнäÑϲ¿¶Ó¿ÉʹÁ½Ãû²»°²786 ÊÐÃñ±äΪ°²¶¨. ÁíÍâ, ÌØÊⲿ¶ÓÖеÄÊسÇÎÀ±ø 787 Ò²¿ÉʹµÃ°²¶¨ÊÐÃñµÄÊýÁ¿Ôö¼Ó.\\788 789 Èç¹û²»°²ÊÐÃñÊý³¬Ô½ÁËÉݳÞÊýÓë°²¶¨ÊÐÃñÊý 790 Ö®ºÍ, ÔòÕû¸ö³ÇÊн«ÏÝÈëɧÂÒ.\\791 792 ijЩÌض¨µÄÕþÌåÐÎʽÏÂ, ²»°²Ê¼þµÄ·¢Éú»á½µµÍ 793 ³ÇÊеݲ¶¨Öµ, ÏêϸÐÅÏ¢Çë²Î¿¼\794 ::G ÕþÌåÐÎʽ\\795 796 ! ÐÅÑö\797 ÔÚ×Ú½ÌÖƹú¼Ò,°²¶¨ÖµµÄ¼ÆËãÓëÆäËûÕþÌåÐÎʽ²»Í¬. 798 ÿ¸öÊÐÃñ¶¼ÒòÐÅÑö¶ø±äµÃ°²¶¨, Òò´Ë×Ú½ÌÖƹú¼Ò 799 ÎÞÐèµ£ÐijÇÊеݲ¶¨ÎÊÌâ, ¸ü²»»á³öÏÖ³ÇÊÐɧÂÒ.\\800 801 802 ! ×ÊÔ´ÖÖÀà\803 804 ³ÇÊдÓÖÜΧµØ¿éÖÐÊÕ¼¯µÄ×ÊÔ´, ¸ù¾ÝÀàÐͲ»Í¬ 805 ·ÖΪÈýÖÖ: Á¸Ê³(%f), ÔÁÏ(%p)ºÍóÒ×(%t).756 上述画面中, 主要包含了如下几个大项:\\ 757 758 !市民\ 759 760 城市画面左上角的人脸代表着该城的市民. 城市规模的 761 下限为2级, 如果规模降至2级以下, 则该城将不复存在. 762 默认条件下, 城市规模上限为8级, 但上限值可通过特殊 763 的城市设施提升.\\ 764 765 每个市民可收集一个地块(见上图1)的资源. 一个地块上 766 最多容纳一名市民. 被其他城市占用的地块将被标示为 767 不可用地块.\\ 768 769 未被指定的空闲市民, 将被用作为城市戒严部队(见上图2) 770 可用其来维持城市安定的比例, 使城市不至于陷入骚乱. 771 详细信息请参照下文帮助部分.\\ 772 773 !安定\ 774 775 城市画面的右上方显示了当前市民的安定状态. 776 该部分分为三行:\ 777 778 -奢侈 (图标: %l). 如果在"经济及税收"菜单中 779 设定了奢侈比例, 则每个城市的贸易数中将有 780 一部分转化为奢侈,详见下文中的"贸易"部分.\ 781 -安定 (%m). 默认情况下, 城市中有四名市民 782 是安定的, 其余市民都是不安的. 建造特定的 783 城市设施或奇迹, 可提升安定市民的数量. 每座 784 奇迹能使所在城市中的两名不安市民变为安定.\ 785 -戒严 (%o). 每支城市戒严部队可使两名不安 786 市民变为安定. 另外, 特殊部队中的守城卫兵 787 也可使得安定市民的数量增加.\\ 788 789 如果不安市民数超越了奢侈数与安定市民数 790 之和, 则整个城市将陷入骚乱.\\ 791 792 某些特定的政体形式下, 不安事件的发生会降低 793 城市的安定值, 详细信息请参考\ 794 ::G 政体形式\\ 795 796 !信仰\ 797 在宗教制国家,安定值的计算与其他政体形式不同. 798 每个市民都因信仰而变得安定, 因此宗教制国家 799 无需担心城市的安定问题, 更不会出现城市骚乱.\\ 800 801 802 !资源种类\ 803 804 城市从周围地块中收集的资源, 根据类型不同 805 分为三种: 粮食(%f), 原料(%p)和贸易(%t). 806 806 \\ 807 807 808 ÿ¸öµØ¿é³ö²ú×ÊÔ´µÄ¶àÉÙÈ¡¾öÓÚÒÔÏÂÈý¸öÌõ¼þ:\809 ::T µØÐÎÖÖÀà\810 ::J µØÐθÄÔì\811 ::G ÕþÌåÐÎʽ\\812 813 ! Á¸Ê³\814 Á¸Ê³(·ûºÅΪ%f)´ú±íÁ˸÷ÖÖʳÎï. ³ÇÊÐÁ¸Ê³µÄÉú²úÏûºÄ 815 Çé¿öÏÔʾÔÚÁ¸Ê³Ãæ°åÖÐ(¼ûÉÏͼ4). Á¸Ê³ÊÇÈËÀàÿÈյĸù±¾,816 ÿ¸öÊÐÃñÿ»ØºÏÐèÏûºÄ2%f. »¹ÓÐһЩ²¿¶ÓÐèÒª¶¨Á¿µÄÁ¸Ê³ 817 ×÷Ϊ¹©¸ø, ÈçÁ¸Ê³¹©Ó¦²»×ã, ½«´Ó³ÇÊеĴæÁ¸Öп۳ý. Èç¹û 818 ´æÁ¸ºÄ¾¡, ³ÇÊÐÏÝÈë¼¢»Ä, »áÓÐÒ»ÃûÊÐÃñ»òÒ»Ö§²¿¶ÓÏûʧ. 819 µ«ÔÚͨ³£Çé¿öÏÂ, ³ÇÊÐÉú²úµÄÁ¸Ê³Á¿²»»áµÍÓÚÏûºÄÁ¿. Èç¹û 820 Éú²úµÄÁ¸Ê³ÓÐÊ£Óà, ¶àÓàµÄÁ¸Ê³½«¼ÆÈë´æÁ¸, µ«ÓÐÒ»ÖÖÇé¿ö 821 ÊôÓÚÀýÍâ: ¹æÄ£´ïµ½8µÄ´ó³ÇÊÐÿ»ØºÏÈç¹û¶àÓà1µ¥Î»µÄÁ¸Ê³, 822 ÔòÕâ1µ¥Î»Á¸Ê³½«Ö±½ÓתΪ×ʽð, ²»¼ÆÈë´æÁ¸. Èç¹û´æÁ¸´ïµ½ 823 ÉÏÏÞ, ÇÒ³ÇÊйæģδ´ïÉÏÏÞ, ÄÇôÕâ¸ö³ÇÊеĹæÄ£»áÌáÉý1¼¶, 824 ÊÐÃñÊýÁ¿¼Ó1.\\825 826 ! ÔÁÏ\827 ÔÁÏ (·ûºÅΪ%p)ÊÇÒ»ÖÖ³éÏóµÄ×ÊÔ´, ÊǸ÷ÖÖÀͶ¯Éú²ú×ÊÔ´ 828 Èçľͷ, ¿óʯ, ʯÓ͵ȵÄ×ܳÆ. ³ÇÊÐÔÁϵÄÉú²úÏûºÄÇé¿öÏÔʾ 829 ÔÚÔÁÏÃæ°åÖÐ(¼ûÉÏͼ5). ³ÇÊÐÖÐijЩÁ¥Êô²¿¶ÓÐèÏûºÄÒ»¶¨Á¿ 830 µÄÔÁÏÒÔά³ÖÈÕ³£¹©¸ø, Ê£ÓàÔÁϽ«Í¶Èëµ½Éú²ú½¨ÉèÖ®ÖÐ. 831 Äú¿É¸ü¸Ä³ÇÊе±Ç°½¨ÉèµÄÏîÄ¿(¼ûÉÏͼ6). ³ÇÊеØͼ(¼ûÉÏͼ7)832 ÏÔʾÁ˳ÇÊе±Ç°ÉèÊ©µÄλÖÃ. 833 Óйؽ¨ÉèµÄÏêϸÐÅÏ¢, Çë²Î¿¼ÏÂÒ»Õ½Ú"Éú²úÏê½â".\\834 835 ! óÒ×\836 óÒ×(·ûºÅΪ%t)´ú±í³ÇÊеÄóÒ×ËùµÃ. Ö»ÓгÇÊÐÖÜΧµÄµØ¿é 837 ²ÅÄܽøÐÐóÒ×, ³ÇÊб¾ÉíËùÔڵĵؿ鲻»á¹±Ï×ÈκÎóÒ×Öµ, 838 ¼´±ã³ÇÊн¨ÔÚ½ð¿óÉÏÒ²ÎÞ¼ÃÓÚÊÂ. ³ÇÊÐóÒ×µÄÉú²úÏûºÄÇé¿ö 839 ÏÔʾÔÚóÒ×Ãæ°åÖÐ(¼ûÉÏͼ8). ¸ù¾Ý¹ú¼Òµ±Ç°µÄÕþÌå±ä»¯, 840 ÒÔ¼°ÓëÊ׶¼µÄµØÀí¾àÀë, ³ÇÊÐÖÐÒ»¶¨±ÈÀýµÄóÒ×ËùµÃ»áÒòΪ 841 ¸¯°Ü¶ø°×°×Á÷ʧ, Ê£ÓàµÄ%t½«°´¼Æ»®ÖеıÈÀý·ÖÅäºó, ·Ö±ð 842 ÓÃÓÚ¹ú¼ÒË°ÊÕ, ÉݳÞÏû·ÑºÍ¿ÆѧÑо¿. Ë°ÊÕ²¿·Ö(%c)µÖÏûÖ§³ö 843 Ö®ºóµÄÊ£ÓàËùµÃ½«³äÈë¹ú¿â; ¿ÆÑв¿·Ö(%r)½«ÓÃ×÷¿ÆÑо·Ñ, 844 ¼Ó¿ìµ±Ç°¿ÆÑеĽø¶È; Éݳ޲¿·Ö(%l)¿Éµ÷ÕûÊÐÃñµÄ°²¶¨³Ì¶È. 845 ×¢: Òª»ñµÃóÒ×ÀûÈó, ¸Ã³ÇÖÁÉÙÐëÓµÓÐÒÔϽ¨Öþ:\846 ::B49 ÊÐÕþÌü\\847 848 ;CORRUPTION Ïà¹Ø×ÊÁÏ: ¼ÆË㸯°Ü±ÈÀý\\849 850 ! ×ÊÔ´×Ô¶¯·ÖÅä\851 Ö¸¶¨ÏµÍ³¶Ô²É¼¯×ÊÔ´ÒÔ¼°Ö´ÐнäÑϵÄÊÐÃñ½øÐÐ×Ô¶¯ÓÅ»¯·ÖÅä. 852 Íæ¼ÒÖ»Ðè¸ù¾Ý¸öÈËÄ¿±ê, Ö¸¶¨×îÓÅÒò×Ó(¼ûÉÏͼ9).853 ×Ô¶¯·ÖÅäÓÐÒÔÏÂÎåÖÖģʽ:854 - Ôö³¤×î´ó»¯(ĬÈÏģʽ). È«Á¦±£Ö¤³ÇÊÐÈË¿ÚÔö³¤, ¾¡Ò»ÇпÉÄÜ855 ÊÕ¼¯Ê³Îï×ÊÔ´.\856 - Éú²ú×î´ó»¯. È«Á¦±£Ö¤³ÇÊÐÉèÊ©½¨Éè, ¾¡¿ÉÄÜÊÕ¼¯ÔÁÏ×ÊÔ´.857 ¿¼Âǵ½Íæ¼ÒÔÚ¹ºÂòÉèʩʱÐèÒªÒ»¶¨²ÆÁ¦Ö§³Ö, ´ËģʽҲ²»»á 858 ºöÂÔÁËóÒ××ÊÔ´µÄÊÕ¼¯, ¶øÁ¸Ê³Óë¿ÆÑÐ×ÊÔ´½«±»»ù±¾ºöÂÔ.\859 - ¿ÆÑÐ×î´ó»¯. ×ÅÖØÊÕ¼¯Ã³Ò××ÊÔ´(¼´¿ÆÑм°Ë°ÊÕµÄÀ´Ô´). Á¸Ê³860 ×ÊÔ´½«±»»ù±¾ºöÂÔ.\861 - Éú²úÓÅÏÈ. Ôö³¤¼°ÆäËûÒòËؼæ¹ËµÄģʽ, ÓÅÏÈ¿¼ÂÇÔÁÏÊÕ¼¯.\862 - ¿ÆÑÐÓÅÏÈ. Ôö³¤¼°ÆäËûÒòËؼæ¹ËµÄģʽ, ÓÅÏÈ¿¼ÂÇóÒ×ÊÕ¼¯. \\863 864 ;OPTI Ïà¹Ø×ÊÁÏ: ×ÊÔ´×Ô¶¯·ÖÅ乫ʽ\\865 866 ×¢Òâ, ÔÚijЩÇé¿öÏÂ, ×Ô¶¯·ÖÅä¿ÉÄÜÎÞЧ, ÀýÈç:867 ÔÚ³ÇÊн¨É趨ΪÉÌƷóÒ×ʱѡÔñ"Éú²ú×î´ó»¯";868 ÔÚ³ÇÊйæÄ£·¢Õ¹ÒÑ´ïÉÏÏÞʱѡÔñ"Ôö³¤×î´ó»¯";869 ÔÚ³ÇÊÐÎÞÊÐÕþÌüÊÕ¼¯Ã³Ò×ʱѡÔñ"¿ÆÑÐ×î´ó»¯";870 ÒÔÉÏÇé¿öÏÂ, ÔÚ×Ô¶¯·ÖÅäģʽϵÄϵͳֻÄÜÍ˶ø 871 ÇóÆä´Î, ¿ÉÄܵ¼Öµĺó¹ûÄÑÒÔÔ¤ÁÏ.\\872 873 ÓÐÈýÏîÇ¿ÖÆÌõ¼þµÄÓÅÏȼ¶ÉõÓÚÍæ¼ÒÖ¸¶¨µÄ×îÓÅÒò×Ó, 874 Íæ¼ÒÎÞ·¨¸Ä±äÕâÈýÏîÌõ¼þ:\875 - Ê×ÒªÌõ¼þ: ³ÇÊÐά³Ö°²¶¨, ²»ÖÂÏÝÈëɧÂÒ\876 - ´ÎÒªÌõ¼þ: ±£Ö¤Á¥Êô²¿¶ÓµÄÔÁϹ©¸ø\877 - µÚÈýÌõ¼þ: ±£Ö¤³ÇÊÐÈË¿ÚÒÔ¼°Á¥Êô²¿¶ÓµÄÁ¸Ê³¹©¸ø\\878 879 ! ÊÖ¶¯·ÖÅä\880 Èç¹û²»ÏëʹÓÃ×ÊÔ´×Ô¶¯·ÖÅä, ÓÐÁ½ÖÖ·½Ê½Çл»ÖÁÊÖ¶¯·ÖÅä:881 ¿Éµã»÷Ô²ÐηÖÅä°´Å¥µ×²¿µÄ»ÒÉ«°ë»·; »òÕßÖ±½Óµã»÷ÉÏ·½µÄ 882 ³ÇÊеØͼ. ÔÚÊÖ¶¯Ä£Ê½ÏÂ, Íæ¼Ò¿É×ÔÓÉ·ÖÅäÊÐÃñÔÚÖ¸¶¨µÄµØ¿é 883 ÊÕ¼¯×ÊÔ´, »òÊǸÄΪ³ÇÊнäÑϲ¿¶Ó. µã»÷ÔڵؿéÉϹ¤×÷µÄÊÐÃñ,884 ¿É½«Æä¸ÄΪ³ÇÊнäÑϲ¿¶Ó; µã»÷ÎÞÈ˹¤×÷µÄµØ¿é, ¿É½«Ö´ÐÐ 885 ½äÑϵÄÊÐÃñÖ¸Åɵ½¸ÃµØ¿é¹¤×÷. ½áºÏÒÔÉÏÁ½²½, ¼´¿É½«Ò»¸öµØ¿é 886 ÉϹ¤×÷µÄÊÐÃñתÒÆÖÁÁíÒ»µØ¿é.\\887 888 µ±×ÊÔ´×Ô¶¯·ÖÅäģʽ±»¹Ø±Õºó, ÇëÁôÐÄÒÔϹ©ÇóµÄƽºâ: 889 Á¸Ê³¹©¸ø, ²¿¶ÓÔÁϹ©¸ø, ÒÔ¼°³ÇÊа²¶¨È˿ڵıÈÀý, ·ñÔò 890 ¿ÉÄܳöÏÖÒâÁϲ»µ½µÄºó¹û.\\891 892 ! ³ÇÊÐɧÂÒ\893 Èç¹û³ÇÊеIJ»°²ÈË¿ÚÊý³¬¹ýÁË°²¶¨ÈË¿ÚÊý, Õû¸ö³ÇÊн«ÏÝÈëɧÂÒ,894 ËùÓÐÉú²ú, ¿ÆÑм°Ë°ÊջͣÖÍ. ´ÓɧÂÒ±¬·¢ºóµÄµÚ¶þ»ØºÏ¿ªÊ¼,895 ³ÇÊв»ÔÙ¸øÁ¥ÊôµÄ²¿¶Ó¹©¸ø×ÊÔ´, ÐèÒª×ÊԴά³ÖµÄ²¿¶Ó½«ÖðÖ§ 896 ½âÉ¢, ÿ»ØºÏ¼õÉÙÒ»Ö§, Ö±ÖÁɧÂÒ½áÊø.\\897 898 ÔÚͨ³£Çé¿öÏÂ, ×Ô¶¯·ÖÅäģʽ×ÜÄܱÜÃâ³ÇÊÐɧÂҵķ¢Éú, ³ý·Ç 899 ·¢Éú¹ý¶àµÄ²»°²Ê¼þ. Èç¹ûÓöµ½ÉÏÊöÇé¿ö, Ç뽫µ¼Ö²»°²Ê¼þ 900 µÄ²¿¶Ó³·»Øµ½±¾ÍÁ, »ò½âÉ¢ÕâЩ²¿¶Ó, ¼´¿Éʹ³ÇÊлָ´ÖÈÐò.\\901 902 Èç¹û¹Ø±ÕÁË×Ô¶¯·ÖÅäģʽ, Çë±ðÍüÁË¿ØÖƳÇÊа²¶¨È˿ڵıÈÀý.903 ×î³£Óõķ½·¨Êǽ«¸ü¶àÊÐÃñ¸ÄΪ³ÇÊнäÑϲ¿¶Ó.808 每个地块出产资源的多少取决于以下三个条件:\ 809 ::T 地形种类\ 810 ::J 地形改造\ 811 ::G 政体形式\\ 812 813 !粮食\ 814 粮食(符号为%f)代表了各种食物. 城市粮食的生产消耗 815 情况显示在粮食面板中(见上图4). 粮食是人类每日的根本, 816 每个市民每回合需消耗2%f. 还有一些部队需要定量的粮食 817 作为供给, 如粮食供应不足, 将从城市的存粮中扣除. 如果 818 存粮耗尽, 城市陷入饥荒, 会有一名市民或一支部队消失. 819 但在通常情况下, 城市生产的粮食量不会低于消耗量. 如果 820 生产的粮食有剩余, 多余的粮食将计入存粮, 但有一种情况 821 属于例外: 规模达到8的大城市每回合如果多余1单位的粮食, 822 则这1单位粮食将直接转为资金, 不计入存粮. 如果存粮达到 823 上限, 且城市规模未达上限, 那么这个城市的规模会提升1级, 824 市民数量加1.\\ 825 826 !原料\ 827 原料 (符号为%p)是一种抽象的资源, 是各种劳动生产资源 828 如木头, 矿石, 石油等的总称. 城市原料的生产消耗情况显示 829 在原料面板中(见上图5). 城市中某些隶属部队需消耗一定量 830 的原料以维持日常供给, 剩余原料将投入到生产建设之中. 831 您可更改城市当前建设的项目(见上图6). 城市地图(见上图7) 832 显示了城市当前设施的位置. 833 有关建设的详细信息, 请参考下一章节"生产详解".\\ 834 835 !贸易\ 836 贸易(符号为%t)代表城市的贸易所得. 只有城市周围的地块 837 才能进行贸易, 城市本身所在的地块不会贡献任何贸易值, 838 即便城市建在金矿上也无济于事. 城市贸易的生产消耗情况 839 显示在贸易面板中(见上图8). 根据国家当前的政体变化, 840 以及与首都的地理距离, 城市中一定比例的贸易所得会因为 841 腐败而白白流失, 剩余的%t将按计划中的比例分配后, 分别 842 用于国家税收, 奢侈消费和科学研究. 税收部分(%c)抵消支出 843 之后的剩余所得将充入国库; 科研部分(%r)将用作科研经费, 844 加快当前科研的进度; 奢侈部分(%l)可调整市民的安定程度. 845 注: 要获得贸易利润, 该城至少须拥有以下建筑:\ 846 ::B49 市政厅\\ 847 848 ;CORRUPTION 相关资料: 计算腐败比例\\ 849 850 !资源自动分配\ 851 指定系统对采集资源以及执行戒严的市民进行自动优化分配. 852 玩家只需根据个人目标, 指定最优因子(见上图9). 853 自动分配有以下五种模式: 854 -增长最大化(默认模式). 全力保证城市人口增长, 尽一切可能 855 收集食物资源.\ 856 -生产最大化. 全力保证城市设施建设, 尽可能收集原料资源. 857 考虑到玩家在购买设施时需要一定财力支持, 此模式也不会 858 忽略了贸易资源的收集, 而粮食与科研资源将被基本忽略.\ 859 -科研最大化. 着重收集贸易资源(即科研及税收的来源). 粮食 860 资源将被基本忽略.\ 861 -生产优先. 增长及其他因素兼顾的模式, 优先考虑原料收集.\ 862 -科研优先. 增长及其他因素兼顾的模式, 优先考虑贸易收集. \\ 863 864 ;OPTI 相关资料: 资源自动分配公式\\ 865 866 注意, 在某些情况下, 自动分配可能无效, 例如: 867 在城市建设定为商品贸易时选择"生产最大化"; 868 在城市规模发展已达上限时选择"增长最大化"; 869 在城市无市政厅收集贸易时选择"科研最大化"; 870 以上情况下, 在自动分配模式下的系统只能退而 871 求其次, 可能导致的后果难以预料.\\ 872 873 有三项强制条件的优先级甚于玩家指定的最优因子, 874 玩家无法改变这三项条件:\ 875 -首要条件: 城市维持安定, 不致陷入骚乱\ 876 -次要条件: 保证隶属部队的原料供给\ 877 -第三条件: 保证城市人口以及隶属部队的粮食供给\\ 878 879 !手动分配\ 880 如果不想使用资源自动分配, 有两种方式切换至手动分配: 881 可点击圆形分配按钮底部的灰色半环; 或者直接点击上方的 882 城市地图. 在手动模式下, 玩家可自由分配市民在指定的地块 883 收集资源, 或是改为城市戒严部队. 点击在地块上工作的市民, 884 可将其改为城市戒严部队; 点击无人工作的地块, 可将执行 885 戒严的市民指派到该地块工作. 结合以上两步, 即可将一个地块 886 上工作的市民转移至另一地块.\\ 887 888 当资源自动分配模式被关闭后, 请留心以下供求的平衡: 889 粮食供给, 部队原料供给, 以及城市安定人口的比例, 否则 890 可能出现意料不到的后果.\\ 891 892 !城市骚乱\ 893 如果城市的不安人口数超过了安定人口数, 整个城市将陷入骚乱, 894 所有生产, 科研及税收活动停滞. 从骚乱爆发后的第二回合开始, 895 城市不再给隶属的部队供给资源, 需要资源维持的部队将逐支 896 解散, 每回合减少一支, 直至骚乱结束.\\ 897 898 在通常情况下, 自动分配模式总能避免城市骚乱的发生, 除非 899 发生过多的不安事件. 如果遇到上述情况, 请将导致不安事件 900 的部队撤回到本土, 或解散这些部队, 即可使城市恢复秩序.\\ 901 902 如果关闭了自动分配模式, 请别忘了控制城市安定人口的比例. 903 最常用的方法是将更多市民改为城市戒严部队. 904 904 905 905 906 906 #CORRUPTION 907 $ ¼ÆË㸯°Ü±ÈÀý\908 909 ! ¼ÆË㸯°Ü±ÈÀý\910 911 Ò»¸ö³ÇÊеĸ¯°Ü±ÈÀý, ¸ù¾ÝÒÔϹ«Ê½¼ÆËã:\912 @C ORRUPTION\913 -T - ³ÇÊÐóÒ××ÜÖµ\914 -C - ÕþÌ帯°ÜÒò×Ó\915 -D - ³ÇÊÐÓëÊ׶¼µÄ¾àÀë\916 -Dmax - ÀíÂÛÉÏÏà¸ô×îÔ¶µÄÁ½×ù³ÇÊмäµÄ¾àÀë (¼´ÒÔµØͼ917 È«¸ßÓëµØͼ°ë¿íΪֱ½Ç±ß, ËùµÃµÄÈý½ÇÐÎб±ß³¤¶È)\\918 919 Èç¹ûÒ»¸ö¹ú¼ÒûÓÐÊ׶¼, ÔòÎÞÂÛΪºÎÖÖÕþÌå, ¸Ã¹úËùÓгÇÊÐ 920 Öеĸ¯°Ü±ÈÀýΪ100%, Óз¨ÔºµÄ³ÇÊи¯°Ü±ÈÀýΪ50%.907 $计算腐败比例\ 908 909 !计算腐败比例\ 910 911 一个城市的腐败比例, 根据以下公式计算:\ 912 @Corruption\ 913 -T - 城市贸易总值\ 914 -C - 政体腐败因子\ 915 -D - 城市与首都的距离\ 916 -Dmax - 理论上相隔最远的两座城市间的距离 (即以地图 917 全高与地图半宽为直角边, 所得的三角形斜边长度)\\ 918 919 如果一个国家没有首都, 则无论为何种政体, 该国所有城市 920 中的腐败比例为100%, 有法院的城市腐败比例为50%. 921 921 922 922 923 923 #OPTI 924 $ ×ÊÔ´×Ô¶¯·ÖÅäÌõ¼þ¹«Ê½\925 926 ! ×ÊÔ´×Ô¶¯·ÖÅäÌõ¼þ¹«Ê½\927 928 ×Ô¶¯·ÖÅä×ÊÔ´¹²°üÀ¨ÎåÖÖÇé¿ö, ÆäÖеIJî±ðÔÚÓÚÓÅÏÈÒò×ÓmµÄÈ·¶¨¼°¼ÆËã. ÓÅÏÈÒò×ÓmµÄ¿¼Á¿·¶Î§°üÀ¨ÒÔÏÂËÄÀà: Á¸Ê³(f), ÔÁÏ(p),929 Ë°ÊÕ(t)ºÍ¿ÆÑÐ(r), m2Ϊ´ÎÓÅÒò×Ó, ÒÔ´ËÀàÍÆ\930 - Ôö³¤×î´ó»¯: m = f, m2 = 2p + t + r\931 - Éú²ú×î´ó»¯: m = 4p + t, m2 = r, m3 = f\932 - ¿ÆÑÐ×î´ó»¯: m = 2r + t + p, m2 = f\933 - Éú²úÓÅÏÈ: m = sqrt(f) * (8p + 2t + r)\934 - ¿ÆÑÐÓÅÏÈ: m = sqrt(f) * (r + t + p)924 $资源自动分配条件公式\ 925 926 !资源自动分配条件公式\ 927 928 自动分配资源共包括五种情况, 其中的差别在于优先因子m的确定及计算. 优先因子m的考量范围包括以下四类: 粮食(f), 原料(p), 929 税收(t)和科研(r), m2为次优因子, 以此类推\ 930 -增长最大化: m = f, m2 = 2p + t + r\ 931 -生产最大化: m = 4p + t, m2 = r, m3 = f\ 932 -科研最大化: m = 2r + t + p, m2 = f\ 933 -生产优先: m = sqrt(f) * (8p + 2t + r)\ 934 -科研优先: m = sqrt(f) * (r + t + p) 935 935 936 936 937 937 #PRODUCTION 938 $ Éú²úÏê½â\939 940 ! Éú²úÄ¿±ê\941 942 ½¨Á¢Ð³ǻòÕ¼ÁìµÐ³Çºó, µ±Ç°µÄ½¨ÉèÄ¿±ê½«¶¨Îª "ÉÌƷóÒ×", 943 Òâ¼´½«Éú²úÔÁÏÖ±½Óת»»Îª½ðÇ®ÀûÈó. µã»÷Ä¿±êͼƬ, ¿ÉÑ¡Ôñ 944 ÆäËûÄ¿±ê, Ñ¡Ôñ·¶Î§È¡¾öÓÚ±¾¹úµÄ¿Æ¼¼·¢Õ¹Ë®Æ½. °´×¡Shift¼ü 945 ºóµã»÷ÏîÄ¿, ¿ÉÏÔʾÏà¹Ø°ïÖú. ÓÐ3ÀཨÉèÄ¿±ê¿É¹©Ñ¡Ôñ:\946 - ²¿¶Ó\947 - ³ÇÊÐÉèÊ©\948 - Ææ¼£¼°¹ú¼Ò¹¤³Ì\\949 950 Èç¹û½«³ÇÊе±Ç°µÄ½¨ÉèÄ¿±ê ¸ü¸ÄΪͬÀàÖеÄÆäËûÉèÊ©»ò²¿¶Ó, 951 ÀÛ»ýµÄÉú²úÔÁϽ«ËðʧÈý·ÖÖ®Ò». Èç¹û¸ü¸ÄΪÆäËûÀà±ðµÄÉèÊ© 952 »ò²¿¶Ó, ÔòÀÛ»ýµÄÉú²úÔÁϽ«Ö±½Ó±äÂôΪ½ðÇ®. ÒªÏë¼Ó¿ìÉèÊ© 953 ½¨ÉèµÄËÙ¶È, ¿ÉÑ¡ÔñÒÑÓеÄÉèÊ©, ¶øºóÑ¡ÔñÍƵ¹Öؽ¨, ÔòÔÉèÊ© 954 Èý·ÖÖ®¶þµÄÉú²úÔÁϽ«±»»ØÊÕ, Ö±½ÓÌí¼Óµ½µ±Ç°½¨ÉèÉèÊ©µÄ 955 Éú²úÔÁÏÖÐ; ÒªÏë¼Ó¿ì²¿¶Ó½¨ÉèµÄËÙ¶È (½¨Éè¶Ó³ýÍâ), ¿ÉÑ¡Ôñ 956 ³ÇÄÚפÊصIJ¿¶Ó, ¶øºóÑ¡ÔñÕû±à, ÔòÔ²¿¶ÓÈý·ÖÖ®¶þµÄÈËÔ±½« 957 Ö±½Ó¼ÓÈ뵱ǰ½¨É貿¶ÓÖ®ÖÐ.\\958 959 ! ÒÆÃñ\960 ÍØ»ÄÕß¡¢¹¤³Ìʦ¡¢Å«Á¥ÒÔ¼°Õ÷ļ²¿¶Ó¶¼À´×ÔÓÚÊÐÃñ, Òò´ËÔÚ 961 Éú²úÕâЩ²¿¶Óºó, ³ÇÊйæÄ£½«»áËõС. Éú²úÕ÷ļ²¿¶ÓºÍÅ«Á¥, 962 ¹æÄ£½«ËõСһ¼¶; Éú²úÍØ»ÄÕߺ͹¤³Ìʦ, ³ÇÊйæÄ£½«ËõСÁ½¼¶. 963 ÒÆÃñ¹ý³ÌÊÇ¿ÉÄæµÄ: ½«ÒÔÉϲ¿¶Ó¼ÓÈë³ÇÊÐ, ¿Éʹ³ÇÊйæÄ£À©´ó, 964 Ç°ÌáÊdzÇÊйæģδ´ïµ½ÉÏÏÞ.\\965 966 ! Õ÷ļ\967 ¿ÉÒÔÓÃÕ÷ļµÄ·½Ê½Éú²úÈκÎÒÑÖªµÄµØÃ沿¶Ó. Õ÷ļµÄ²¿¶Ó 968 ½«¶àºÄ·Ñ1%fʳÎï. Õ÷ļµÄºÃ´¦ÔÚÓÚ, ¿É½«²¿¶ÓµÄÉú²úʱ¼ä 969 Ëõ¼õµ½ÔÀ´µÄÈý·ÖÖ®Ò». ÒªÕ÷ļ²¿¶Ó, ÐëÏÈ»ñµÃÒÔÏ¿Ƽ¼:\970 ::A18 Õ÷±øÖƶÈ\\971 972 ! ÂòÂôÉú²úÔÁÏ\973 ҪѸËÙÍê³ÉÉú²ú, ¿É»¨Ç®¹ºÂò, ¹ºÂòºóµÄÄ¿±ê½«ÓÚÏÂ»ØºÏ 974 ¿ªÊ¼Ê±Í깤. ÒªÏë¿ì,µÃ»¨´ó¼ÛÇ®: ÿ¸öδÍê³ÉµÄÔÁÏ%p, 975 ÐèÖ§¸¶4±¶µÄ½ðÇ®. ·´ÑÔÖ®, Ò²¿ÉÒÔ±äÂôÉú²úÔÁÏ, Ö»Ð轫 976 Ä¿±ê¸ÄΪ"ÉÌƷóÒ×"¼´¿É. ÀÛ»ýµÄÉú²úÔÁϽ«×ª»»Îª½ðÇ®.\\977 978 ! ÎÛȾ\979 ÿ1µãÔÁÏÉú²ú¶¼½«Ôì³É1µãÎÛȾ, ¶øÿ¸öÊÐÃñ¿ÉµÖÏû1µãÎÛȾ, 980 ¶àÓàµÄÎÛȾ½«ÂýÂý»ýÀÛΪ·ÏÁÏ, Èç¹û»ýÀ۵ķÏÁÏÊýÁ¿´ïµ½240, 981 ³ÇÊз¶Î§ÄÚ½«³öÏÖÒ»´¦ÎÛȾÇø, ¸ÃµØ¿éµÄ×ÊÔ´²úÁ¿½«½µÎªÔÏÈ 982 µÄÒ»°ë. ÍØ»ÄÕߺ͹¤³Ìʦ¿ÉÒÔÇåÀíÎÛȾ.938 $生产详解\ 939 940 !生产目标\ 941 942 建立新城或占领敌城后, 当前的建设目标将定为 "商品贸易", 943 意即将生产原料直接转换为金钱利润. 点击目标图片, 可选择 944 其他目标, 选择范围取决于本国的科技发展水平. 按住Shift键 945 后点击项目, 可显示相关帮助. 有3类建设目标可供选择:\ 946 -部队\ 947 -城市设施\ 948 -奇迹及国家工程\\ 949 950 如果将城市当前的建设目标 更改为同类中的其他设施或部队, 951 累积的生产原料将损失三分之一. 如果更改为其他类别的设施 952 或部队, 则累积的生产原料将直接变卖为金钱. 要想加快设施 953 建设的速度, 可选择已有的设施, 而后选择推倒重建, 则原设施 954 三分之二的生产原料将被回收, 直接添加到当前建设设施的 955 生产原料中; 要想加快部队建设的速度 (建设队除外), 可选择 956 城内驻守的部队, 而后选择整编, 则原部队三分之二的人员将 957 直接加入当前建设部队之中.\\ 958 959 !移民\ 960 拓荒者、工程师、奴隶以及征募部队都来自于市民, 因此在 961 生产这些部队后, 城市规模将会缩小. 生产征募部队和奴隶, 962 规模将缩小一级; 生产拓荒者和工程师, 城市规模将缩小两级. 963 移民过程是可逆的: 将以上部队加入城市, 可使城市规模扩大, 964 前提是城市规模未达到上限.\\ 965 966 !征募\ 967 可以用征募的方式生产任何已知的地面部队. 征募的部队 968 将多耗费1%f食物. 征募的好处在于, 可将部队的生产时间 969 缩减到原来的三分之一. 要征募部队, 须先获得以下科技:\ 970 ::A18 征兵制度\\ 971 972 !买卖生产原料\ 973 要迅速完成生产, 可花钱购买, 购买后的目标将于下回合 974 开始时完工. 要想快,得花大价钱: 每个未完成的原料%p, 975 需支付4倍的金钱. 反言之, 也可以变卖生产原料, 只需将 976 目标改为"商品贸易"即可. 累积的生产原料将转换为金钱.\\ 977 978 !污染\ 979 每1点原料生产都将造成1点污染, 而每个市民可抵消1点污染, 980 多余的污染将慢慢积累为废料, 如果积累的废料数量达到240, 981 城市范围内将出现一处污染区, 该地块的资源产量将降为原先 982 的一半. 拓荒者和工程师可以清理污染. 983 983 984 984 985 985 #BUILDINGS 986 $ ½¨Öþ½éÉÜ\986 $建筑介绍\ 987 987 988 988 @@67\ 989 ! ½¨Öþ½éÉÜ\990 991 ½¨Öþ»á¶ÔËùÔڵijÇÊÐ, ÉõÖÁÕû¸ö¹ú¼Ò²úÉú»ý¼«µÄ×÷ÓÃ. 992 ¹²ÓÐ3ÖÖ½¨Öþ, ËüÃÇÖ®¼äµÄÇø±ðÔÚÓڿɽ¨ÔìµÄÊýÁ¿:\993 - ³ÇÊÐÉèÊ©: ÿ¸ö³ÇÊж¼¿É½¨Éè.\994 - ¹ú¼Ò¹¤³Ì: ÿÏî¹ú¼Ò¹¤³Ì, ͬһ¸ö¹ú¼ÒÖ»Äܽ¨ÉèÒ»´Î.995 ÈôÔÚеijÇÊн¨ÉèÒÑÓеĹú¼Ò¹¤³Ì, ÔÚн¨ÉèÍ깤ʱ, 996 ÔÓеĹú¼Ò¹¤³Ì½«±»±äÂô.\997 - ÊÀ½çÆæ¼£: È«ÊÀ½çÖ»ÔÊÐíÓµÓÐÒ»×ù. Èç¹ûij¹ú½¨³ÉÁË998 Ææ¼£, ÔòÆäËû¹ú¼Ò²»ÄÜÔÙ½¨ÏàͬµÄÆæ¼£. Èç¹û½¨³ÉµÄ 999 Ææ¼£Ëæ×ÅËùÔÚ³ÇÊÐÒ»Æ𱻵оü´Ý»Ù, ¾Í»áÓÀÔ¶Ïûʧ, 1000 ÎÞ·¨¸´½¨. ³ýÁ˸÷×ÔµÄÌØÊâЧ¹ûÖ®Íâ, ÿ×ùÆæ¼£»¹ÄÜ 1001 ʹËùÔÚ³ÇÊÐÖеÄÒ»Ãû²»°²ÊÐÃñ±äΪ°²¶¨.\\1002 1003 ::B ³ÇÊÐÉèÊ©\1004 ::B201 ¹ú¼Ò¹¤³Ì\1005 ::B202 ÊÀ½çÆæ¼£\\1006 1007 ´ó²¿·Ö³ÇÊÐÉèÊ©ºÍ¹ú¼Ò¹¤³Ì¶¼ÐèÒªÏÖ½ðά³Ö, ÿ»ØºÏ 1008 Ëù»¨·ÑµÄÏÖ½ð½«×Ô¶¯´Ó¹ú¿âÖп۳ý. Èç¹û¹ú¿âºÄ¾¡, 1009 ½«Ëæ»ú±äÂôÒ»ÏîÉèÊ©, ÓÃÒÔµÖÕ®.\\1010 1011 ÔÚ³ÇÊлÃæÖÐ, °´"³ÇÊÐÉèÊ©"°´Å¥, ¿É²é¿´³ÇÊÐÖÐÏÖÓÐµÄ 1012 ÉèÊ©Áбí. Èç¹ûÒª½«Ä³ÏîÉèÊ©±äÂô, »òÍƵ¹Öؽ¨Ä³ÉèÊ©, 1013 ÒԼӿ쵱ǰÉèÊ©µÄ½¨Éè½ø¶È, ×ó¼üµ¥»÷Æäͼ±ê¼´¿É. 1014 ÉèÊ©±äÂôµÄ¼Û¸ñµÈͬÓÚÆäÉú²úÔÁÏ»»Ëã³ÉÏÖ½ðµÄ¼Û¸ñ.989 !建筑介绍\ 990 991 建筑会对所在的城市, 甚至整个国家产生积极的作用. 992 共有3种建筑, 它们之间的区别在于可建造的数量:\ 993 -城市设施: 每个城市都可建设.\ 994 -国家工程: 每项国家工程, 同一个国家只能建设一次. 995 若在新的城市建设已有的国家工程, 在新建设完工时, 996 原有的国家工程将被变卖.\ 997 -世界奇迹: 全世界只允许拥有一座. 如果某国建成了 998 奇迹, 则其他国家不能再建相同的奇迹. 如果建成的 999 奇迹随着所在城市一起被敌军摧毁, 就会永远消失, 1000 无法复建. 除了各自的特殊效果之外, 每座奇迹还能 1001 使所在城市中的一名不安市民变为安定.\\ 1002 1003 ::B 城市设施\ 1004 ::B201 国家工程\ 1005 ::B202 世界奇迹\\ 1006 1007 大部分城市设施和国家工程都需要现金维持, 每回合 1008 所花费的现金将自动从国库中扣除. 如果国库耗尽, 1009 将随机变卖一项设施, 用以抵债.\\ 1010 1011 在城市画面中, 按"城市设施"按钮, 可查看城市中现有的 1012 设施列表. 如果要将某项设施变卖, 或推倒重建某设施, 1013 以加快当前设施的建设进度, 左键单击其图标即可. 1014 设施变卖的价格等同于其生产原料换算成现金的价格. 1015 1015 1016 1016 1017 1017 #SUPPORT 1018 $ ²¿¶ÓÁ¥Êô\1019 1020 ! ²¿¶ÓÁ¥Êô\1021 1022 ÿ֧²¿¶Óÿ»ØºÏÐèÏûºÄ1%pÉú²úÔÁÏ, ÏûºÄÔÁÏ´ÓÁ¥Êô³ÇÊÐ 1023 Öп۳ý. ±àÖÆÔÚ6%wÒÔÉϵĴ¬Ö», ÐèÏûºÄË«±¶µÄÉú²úÔÁÏ. 1024 ²¿¶Ó×î³õÁ¥ÊôÓÚÉú²ú¸Ã²¿¶ÓµÄ³ÇÊÐ. Èç¹ûÏë¸Ä±äÁ¥Êô³ÇÊÐ, 1025 ½«²¿¶ÓÒÆÖÁÒªÁ¥ÊôµÄ³ÇÊкó, Ñ¡Ôñ"¸ÄΪ±¾³Ç²¿¶Ó"¼´¿É. 1026 ³ÇÊлÃæÖÐÑ¡Ôñ"Á¥Êô²¿¶Ó"°´Å¥, ¿É²é¿´¸Ã³ÇµÄÁ¥Êô²¿¶Ó.\\1027 1028 һС²¿·Ö²¿¶Ó²»ÐèÒªÉú²úÔÁϹ©¸ø, ÎÞÐ蹩¸øµÄ²¿·ÖÒÔ 1029 »ÒÉ«(%n)ÏÔʾ, ÐèÒª¹©¸øµÄ²¿·ÖÒÔÁÁÉ«(%p)ÏÔʾ. ÕâÅú 1030 ²¿¶ÓµÄÊýÁ¿È¡¾öÓÚÕþÌåÐÎʽ. Èç¹û³ÇÊÐÎÞ·¨Ìṩ×ã¹»µÄ 1031 Éú²úÔÁϹ©¸ø²¿¶Ó, ÔòÆäÖÐ×îÁ®¼ÛµÄ²¿¶Ó½«±»Ç¿ÐнâÉ¢.\\1032 1033 Èç¹û³ÇÊÐɧÂÒ³¬¹ýÒ»¸ö»ØºÏ, Æ䲿¶Ó¹©¸ø½«È«²¿Í£ÖÍ, 1034 Èç¹û¸Ã³ÇÊдæÔÚÁ¥Êô²¿¶Ó, Ôòÿ»ØºÏ½«ÓÐ1Ö§²¿¶Ó±»½âÉ¢, 1035 Ö±ÖÁɧÂÒ½áÊø.1018 $部队隶属\ 1019 1020 !部队隶属\ 1021 1022 每支部队每回合需消耗1%p生产原料, 消耗原料从隶属城市 1023 中扣除. 编制在6%w以上的船只, 需消耗双倍的生产原料. 1024 部队最初隶属于生产该部队的城市. 如果想改变隶属城市, 1025 将部队移至要隶属的城市后, 选择"改为本城部队"即可. 1026 城市画面中选择"隶属部队"按钮, 可查看该城的隶属部队.\\ 1027 1028 一小部分部队不需要生产原料供给, 无需供给的部分以 1029 灰色(%n)显示, 需要供给的部分以亮色(%p)显示. 这批 1030 部队的数量取决于政体形式. 如果城市无法提供足够的 1031 生产原料供给部队, 则其中最廉价的部队将被强行解散.\\ 1032 1033 如果城市骚乱超过一个回合, 其部队供给将全部停滞, 1034 如果该城市存在隶属部队, 则每回合将有1支部队被解散, 1035 直至骚乱结束. 1036 1036 1037 1037 1038 1038 #MACRO 1039 $ ¿ìËÙºê²Ù×÷\1040 1041 ! ¿ìËÙºê²Ù×÷\1042 1043 ÓÎÏ·ÊÇÒ»ÖÖÀÖȤ, ¶ø²»Êǹ¤×÷. ½èÖú¿ìËÙºê²Ù×÷, ´Ó·±Ëö 1044 µÄÖظ´ÃüÁîÖнâÍÑ, ÌÚ³öÊÖÀ´×¨×¢·¢Õ¹ÓÎÏ·²ßÂÔ°É. 1045 ¿ìËÙºê²Ù×÷²¢·Ç±Ø²»¿ÉÉٵŤ¾ß, µ«ÓÐÖúÓÚ¼ò»¯ÓÎÏ·²Ù×÷. 1046 ½¨ÒéÔÚʹÓÃ֮ǰ, ×îºÃÄÜÏÈÁ˽âÒ»ÏÂÏà¹ØµÄ֪ʶҪµã.\\1047 1048 ! µØÐθÄÔì\1049 Õë¶ÔijһÀàµØÐÎ, ¶¨Òå²Ù×÷µÄ´ÎÐò. ¶¨ÒåÍê³Éºó, ¿ÉÔÚ 1050 ÒÆÃñ²¿¶ÓµÄÐж¯ÃüÁîÖÐÑ¡Ôñ"µØÐθÄÔì"(¿ì½Ý¼ü: E), 1051 ÒÆÃñ²¿¶Ó¾Í»áÒÀ´Î½øÐÐÒÑÉ趨µÄ¸ÄÔì²Ù×÷. Èç¹ûʹÓà 1052 ´øÓÐÖмüµÄÊó±ê, ¿É½áºÏÄ¿±êÒƶ¯ÃüÁîÒ»²¢Ö´ÐÐ. ÔÚÒª 1053 ¸ÄÔìµÄµØÐÎÉϵ¥»÷Êó±êÖмü, ÒÆÃñ²¿¶Ó»áÒԸõØÐÎΪ 1054 Ä¿±êÒƶ¯, µ½´ïºó×Ô¶¯Ö´ÐиÄÔ칤×÷.\\1055 1056 ! ³ÇÊÐÀàÐÍ\1057 Õë¶ÔËÄÖÖ²»Í¬ÀàÐ͵ijÇÊÐ, É趨½¨ÉèÉèÊ©µÄ´ÎÐò. ÓÃÊó±ê 1058 ½«ÁбíÏ·½µÄ½¨ÖþÉèÊ©ÍÏÒ·µ½ÉÏ·½µÄÊý×Ö¿òÄÚ, ÒÔÉ趨 1059 ÏȺó´ÎÐò, È»ºóÔÚ³ÇÊеĽ¨Éè´°¿ÚÖÐÑ¡Ôñ¸Ã³ÇÊÐÀàÐÍ, ¼´ 1060 ¿É°´É趨Á÷³ÌÒÀ´Î½¨Éè. Èç¹ûµ±Ç°ÓÐÉèÊ©ÔÚ½¨, É趨µÄ´ÎÐò 1061 ½«ÔÚÔÚ½¨µÄÉèÊ©½¨³ÉºóÔÙÐÐÆô¶¯. 1039 $快速宏操作\ 1040 1041 !快速宏操作\ 1042 1043 游戏是一种乐趣, 而不是工作. 借助快速宏操作, 从繁琐 1044 的重复命令中解脱, 腾出手来专注发展游戏策略吧. 1045 快速宏操作并非必不可少的工具, 但有助于简化游戏操作. 1046 建议在使用之前, 最好能先了解一下相关的知识要点.\\ 1047 1048 !地形改造\ 1049 针对某一类地形, 定义操作的次序. 定义完成后, 可在 1050 移民部队的行动命令中选择"地形改造"(快捷键: E), 1051 移民部队就会依次进行已设定的改造操作. 如果使用 1052 带有中键的鼠标, 可结合目标移动命令一并执行. 在要 1053 改造的地形上单击鼠标中键, 移民部队会以该地形为 1054 目标移动, 到达后自动执行改造工作.\\ 1055 1056 !城市类型\ 1057 针对四种不同类型的城市, 设定建设设施的次序. 用鼠标 1058 将列表下方的建筑设施拖曳到上方的数字框内, 以设定 1059 先后次序, 然后在城市的建设窗口中选择该城市类型, 即 1060 可按设定流程依次建设. 如果当前有设施在建, 设定的次序 1061 将在在建的设施建成后再行启动. 1062 1062 1063 1063 1064 1064 #START 1065 $ ÓÎÏ·¿ªÊ¼»Ãæ\1066 1067 ! н¨ÓÎÏ·\1068 1069 ÓÎÏ·¿ªÊ¼»Ãæ°üº¬ÁËÈýÕÅÒ³Ãæ, Ҫн¨ÓÎÏ·, ÇëÔÚ"н¨ÓÎÏ·"1070 Ò³ÃæÉ趨¾ºÕùÖÖ×åµÄÊýÁ¿, ÓÎÏ·ÄѶÈ, ÒÔ¼°ÓÎÏ·µÄ×îºóÄêÏÞ. 1071 Èç¹ûÄú°²×°ÁËÆäËûAIÄ£¿é, ¿Éµ¥»÷AI¿ò½øÐÐÉ趨. È«²¿ÉèÖà 1072 ½áÊøºó, °´"¿ªÊ¼"°´Å¥½øÈëÓÎÏ·.\\1073 1074 ! ×Ô¶¨ÒåÍæ¼Ò\1075 ¹´Ñ¡"×Ô¶¨ÒåÍæ¼Ò"¿ò, ´ò¿ª¸ü¶àÏêϸÉèÖÃ. ÔÚ×Ô¶¨Òå»ÃæÖÐ, 1076 ²»½ö¿ÉÒÔ¶Ô¾ºÕùÖÖ×åAI, µçÄÔÓÎÏ·ÄѶÈ, ÈËÀàÍæ¼ÒÊýÁ¿µÈµÈ 1077 ½øÐÐÏêϸÉèÖÃ, Ò²¿ÉÕ¹¿ªµçÄÔAIÄ£¿éµÄ¿ìËÙ¶Ô¾ö, »òÑ¡Ôñ 1078 " ³¬¼¶Óû§"ģʽ, ÒÔÉϵ۵ĽǶȹۿ´Õû¸öÊÀ½çµÄÐÝÆÝÐËË¥.1079 µ¥»÷·½¿ò¿ÉÑ¡ÔñÈËÀàÍæ¼Ò»òµçÄÔAI, ·½¿ò×ó²àµÄ"3"×ÖÈôΪ 1080 ¹´Ñ¡×´Ì¬, ÔòÕâ·½¿ò´ú±íÁË3ÃûÍæ¼ÒµÄ¹²Í¬É趨. ÓÉ´Ë¿ÉÖª, 1081 ÓÎÏ·Íæ¼ÒµÄÉÏÏÞÊýÁ¿Îª15Ãû.\\1082 1083 ·½¿ò×ó²àµÄָʾÌõ´ú±íÁËÍæ¼ÒµÄÓÎÏ·ÄѶÈ, 1Ϊ¼òµ¥, 3ΪÀ§ÄÑ. 1084 Èç¹ûÏ뾡¿ÉÄܵØÌá¸ßÓÎÏ·ÄѶÈ, ¿É½«ÈËÀàÍæ¼ÒµÄÄѶÈÉèΪ×î¸ß, 1085 ²¢½«ËùÓÐAIÍæ¼ÒµÄÄѶÈÉèÖÃΪ×îµÍ.\\1086 1087 ÄѶÈÔ½¸ß, ÈË¿ÚÔö³¤, Éú²úËٶȺÍÑо¿½ø¶È¶¼»á±äÂý, ÐÂÐͱøÖÖ 1088 µÄÔì¼ÛÒ²»á±äµÃ¸üΪ°º¹ó.\\1089 1090 ! ¶ÁÈ¡½ø¶È\1091 1092 ÔÚ¶ÁÈ¡½ø¶ÈÒ³ÃæÖÐ, ¿ÉÑ¡ÔñÔø¾µÄÓÎÏ·½ø¶È, ¼ÌÐøÏÈÇ°µÄÕ÷³Ì.1093 Ñ¡ÔñÐèÒªµÄ½ø¶È, È»ºóµã»÷"¶ÁÈ¡"°´Å¥½øÈëÓÎÏ·. ÿ¸öµ¥¶ÀµÄ 1094 ½ø¶È´æµµÖж¼°üº¬ÁËËùÓеÄÓÎÏ·»ØºÏ, Òò´ËÄú¾¡¿ÉÏÈÑ¡Ôñij¸ö 1095 ¸üÔçµÄÓÎÏ·Äê´ú, ³¢ÊÔÁíÒ»ÖÖ²ßÂÔ, Ò²Ðí»áÓв»Ò»ÑùµÄ½á¹û.\\1096 1097 ! µØͼ±à¼\1098 1099 ĬÈÏÉèÖÃÏÂ, ÓÎÏ·½«ÒÔËæ»úµØͼ¿ªÊ¼; Ò²¿ÉÓÃÓÎÏ·ÄÚÖõıà¼Æ÷ 1100 ×ÔÐд´½¨µØͼ. ÔÚ"µØͼ±à¼"Ò³ÃæÑ¡Ôñ"Ëæ»úµØͼ", È»ºóÉ趨 1101 ÊÀ½ç³ß´çºÍ½µØ±ÈÀý, ÔÙµãÑ¡"±à¼"ÔËÐбà¼Æ÷.\\1102 1103 ºº»¯°æ±¾Öаüº¬ÁËÒ»¿îºº»¯Õß×ÔÐÐÓÅ»¯µÄµØͼ(ÊÀ½ç³ß´ç50%, 1104 ½µØ±ÈÀý30%), ÄãÒ²¿É´Ó¹Ù·½Ö÷Ò³ÏÂÔØÆäËû¸ßÊÖÉè¼ÆµÄµØͼ, 1105 ÏÂÔصØͼ½âѹºó·ÅÖÃÔÚÓÎϷĿ¼µÄMaps×ÓĿ¼Ï¼´¿ÉʹÓÃ. 1065 $游戏开始画面\ 1066 1067 !新建游戏\ 1068 1069 游戏开始画面包含了三张页面, 要新建游戏, 请在"新建游戏" 1070 页面设定竞争种族的数量, 游戏难度, 以及游戏的最后年限. 1071 如果您安装了其他AI模块, 可单击AI框进行设定. 全部设置 1072 结束后, 按"开始"按钮进入游戏.\\ 1073 1074 !自定义玩家\ 1075 勾选"自定义玩家"框, 打开更多详细设置. 在自定义画面中, 1076 不仅可以对竞争种族AI, 电脑游戏难度, 人类玩家数量等等 1077 进行详细设置, 也可展开电脑AI模块的快速对决, 或选择 1078 "超级用户"模式, 以上帝的角度观看整个世界的休戚兴衰. 1079 单击方框可选择人类玩家或电脑AI, 方框左侧的"3"字若为 1080 勾选状态, 则这方框代表了3名玩家的共同设定. 由此可知, 1081 游戏玩家的上限数量为15名.\\ 1082 1083 方框左侧的指示条代表了玩家的游戏难度, 1为简单, 3为困难. 1084 如果想尽可能地提高游戏难度, 可将人类玩家的难度设为最高, 1085 并将所有AI玩家的难度设置为最低.\\ 1086 1087 难度越高, 人口增长, 生产速度和研究进度都会变慢, 新型兵种 1088 的造价也会变得更为昂贵.\\ 1089 1090 !读取进度\ 1091 1092 在读取进度页面中, 可选择曾经的游戏进度, 继续先前的征程. 1093 选择需要的进度, 然后点击"读取"按钮进入游戏. 每个单独的 1094 进度存档中都包含了所有的游戏回合, 因此您尽可先选择某个 1095 更早的游戏年代, 尝试另一种策略, 也许会有不一样的结果.\\ 1096 1097 !地图编辑\ 1098 1099 默认设置下, 游戏将以随机地图开始; 也可用游戏内置的编辑器 1100 自行创建地图. 在"地图编辑"页面选择"随机地图", 然后设定 1101 世界尺寸和陆地比例, 再点选"编辑"运行编辑器.\\ 1102 1103 汉化版本中包含了一款汉化者自行优化的地图(世界尺寸50%, 1104 陆地比例30%), 你也可从官方主页下载其他高手设计的地图, 1105 下载地图解压后放置在游戏目录的Maps子目录下即可使用. 1106 1106 1107 1107 1108 1108 #MAPEDIT 1109 $ µØͼ±à¼Æ÷\1110 1111 ! µØͼ±à¼Æ÷\1112 1113 ÓÎÏ·Öаüº¬ÁËÒ»¿î¼òµ¥µÄµØͼ±à¼Æ÷. ÒªÔËÐеØͼ±à¼Æ÷, 1114 ÔÚÓÎÏ·¿ªÊ¼»ÃæÖеã»÷"µØͼ±à¼"Ò³Ãæ, È»ºóÑ¡ÔñÒª±à¼ 1115 µÄµØͼ, µãÑ¡"±à¼"°´Å¥. Èç¹ûÒª´´½¨ÐµĵØͼ, ÇëÑ¡Ôñ 1116 " Ëæ»úµØͼ", ÔÙÉ趨ÊÀ½ç³ß´çºÍ½µØ±ÈÀý, ÔÙÑ¡"±à¼"°´Å¥.\\1117 1118 ±à¼Æ÷µÄʹÓ÷½·¨·Ç³£¼òµ¥. ÏÈ´ÓÆÁÄ»µ×²¿Ñ¡ÔñËùÐèµØÐÎ 1119 »òÏîÄ¿, È»ºóÓÃÊó±ê×ó¼üµ¥»÷µØͼ, ¼´¿ÉÌí¼ÓËùÑ¡ÏîÄ¿. 1120 ±ðÍüÁ˽«ÈýÖÖÏÖ´ú×ÊÔ´(ÓË/îÜ/Ë®Òø)Ìí¼ÓÔÚµØͼÉÏ, ÿÖÖ 1121 ×ÊÔ´ÖÁÉÙÒ»´¦, ·ñÔò×îÖÕµÄÖ³Ãñ·É´¬½¨ÉèÎÞ·¨Íê³É.\\1122 1123 ÓÐÒ»µãÐë¼Ó×¢Òâ: ±ØÐëÉèÖÃÖÖ×å³õʼλÖÃ(¼´ÏîÄ¿ÁбíÖÐµÄ 1124 ÆðÊ׶þÏî), ÈôÎÞ³õʼλÖÃ, ÕâÕŵØͼÊDz»ÄܽøÐÐÓÎÏ·µÄ. \\1125 1126 ΪÁËʹÄúÖÆ×÷µÄµØͼ¸ü¼ÓÈÝÒ×±æʶ, Äú¿ÉΪµØͼÎļþÌí¼ÓÏàÓ¦ 1127 µÄËõÂÔͼƬ. ËõÂÔͼÐëΪBMP¸ñʽ, ÎļþÃûÓëµØͼÃû³ÆÏàͬ, 1128 ½«Æä·ÅÖÃÔÚÓÎÏ·µÄmaps×ÓĿ¼, ͼƬ³ß´çÉÏÏÞΪ192x96ÏñËØ.1109 $地图编辑器\ 1110 1111 !地图编辑器\ 1112 1113 游戏中包含了一款简单的地图编辑器. 要运行地图编辑器, 1114 在游戏开始画面中点击"地图编辑"页面, 然后选择要编辑 1115 的地图, 点选"编辑"按钮. 如果要创建新的地图, 请选择 1116 "随机地图", 再设定世界尺寸和陆地比例, 再选"编辑"按钮.\\ 1117 1118 编辑器的使用方法非常简单. 先从屏幕底部选择所需地形 1119 或项目, 然后用鼠标左键单击地图, 即可添加所选项目. 1120 别忘了将三种现代资源(铀/钴/水银)添加在地图上, 每种 1121 资源至少一处, 否则最终的殖民飞船建设无法完成.\\ 1122 1123 有一点须加注意: 必须设置种族初始位置(即项目列表中的 1124 起首二项), 若无初始位置, 这张地图是不能进行游戏的. \\ 1125 1126 为了使您制作的地图更加容易辨识, 您可为地图文件添加相应 1127 的缩略图片. 缩略图须为BMP格式, 文件名与地图名称相同, 1128 将其放置在游戏的maps子目录, 图片尺寸上限为192x96像素. 1129 1129 1130 1130 1131 1131 #AIT 1132 $ µçÄÔ¶Ô¾ö\1133 1134 ! µçÄÔ¶Ô¾ö\1135 1136 Èç¹û°²×°Á˶à¸öAIÄ£¿é, Äã¿ÉÒÔÈÃÕâЩģ¿éÔÚͬһƬµØͼÖÐ 1137 Ï໥ØËɱ. ÔÚн¨ÓÎÏ·½çÃæ, Ñ¡Ôñ"×Ô¶¨ÒåÓÎÏ·", È»ºóµ¥»÷ 1138 ÖмäµÄ·½¿é, Ñ¡Ôñ"µçÄÔ¶Ô¾ö"ºó, ¿ªÊ¼ÓÎÏ·. ÕâʱÕû¸öÓÎÏ· 1139 »Ã潫ËõСΪһ¸ö¶Ô»°´°¿Ú, °´¿ªÊ¼ÓÎÏ·, ϵͳ½«×Ô¶¯ÑÝËã 1140 »ØºÏ½á¹û, Ö±ÖÁij¸öAIʤ³ö. ÑÝËã½á¹û½«ÏÔʾ³É¼òµ¥µÄͳ¼Æ 1141 Êý×Ö, ¸ù¾Ý»ØºÏÍƽø¶øͬ²½¸üÐÂ, ÈçÏÂͼËùʾ:\\1132 $电脑对决\ 1133 1134 !电脑对决\ 1135 1136 如果安装了多个AI模块, 你可以让这些模块在同一片地图中 1137 相互厮杀. 在新建游戏界面, 选择"自定义游戏", 然后单击 1138 中间的方块, 选择"电脑对决"后, 开始游戏. 这时整个游戏 1139 画面将缩小为一个对话窗口, 按开始游戏, 系统将自动演算 1140 回合结果, 直至某个AI胜出. 演算结果将显示成简单的统计 1141 数字, 根据回合推进而同步更新, 如下图所示:\\ 1142 1142 1143 1143 @AITShot\ 1144 1144 1145 -1: ¸ÃÑÕÉ«AIÊÆÁ¦Ó®µÃÓÎÏ·µÄ´ÎÊý, »ñʤÔÒò¿ÉÄÜÊÇÖ³Ãñ1146 ·É´¬·¢Éä, Ò²¿ÉÄÜÊÇÏûÃðËùÓÐÆäËûÊÆÁ¦.\1147 -2: ¸ÃÑÕÉ«AIÊÆÁ¦ÓÎϷʧ°ÜµÄ´ÎÊý.1145 -1: 该颜色AI势力赢得游戏的次数, 获胜原因可能是殖民 1146 飞船发射, 也可能是消灭所有其他势力.\ 1147 -2: 该颜色AI势力游戏失败的次数. 1148 1148 1149 1149 1150 1150 #HOTKEYS 1151 $ ¿ì½Ý²Ù×÷\1152 1153 Ö÷»ÃæÖеÄÊó±ê²Ù×÷:\1154 - ×ó¼üµ¥»÷±¾·½²¿¶Ó - Ñ¡Öв¿¶Ó\1155 - ×ó¼üµ¥»÷±¾·½³ÇÊÐ - ´ò¿ª³ÇÊд°¿Ú\1156 - ×ó¼üµ¥»÷Ëû¹ú²¿¶Ó - ²é¿´ÐÅÏ¢\1157 - ×ó¼üµ¥»÷Ëû¹ú³ÇÊÐ - ²é¿´³ÇÊзÀÓù\1158 - ×ó¼üµ¥»÷ÆäËûµØ¿é - ´°¿Ú¾ÓÖÐ\1159 - ÓÒ¼üµ¥»÷ - ½«¸Ã´¦Ö¸¶¨ÎªÑ¡¶¨²¿¶ÓµÄÒƶ¯Ä¿±ê\1160 - ÓÒ¼üµ¥»÷(³¬¼¶Óû§Ä£Ê½ÏÂ) - ´´½¨²¿¶Ó\\1161 1162 Ö÷»ÃæÖеļüÅ̲Ù×÷:\1163 - ·½Ïò¼ü - Òƶ¯Ñ¡¶¨²¿¶Ó\1164 - Êý×Ö¼üÅÌ"+"¼ü - ½áÊø»ØºÏ\1165 - Êý×Ö¼ü1 ~ 7 - СµØͼÅÔÒ»ÅÅ°´Å¥µÄ¶ÔÓ¦¿ì½Ý¼ü\1166 - ÆäËû²Ëµ¥¿ì½Ý¼ü, Çë²Î¼ûÓÎÏ·Öи÷²Ëµ¥1151 $快捷操作\ 1152 1153 主画面中的鼠标操作:\ 1154 -左键单击本方部队 - 选中部队\ 1155 -左键单击本方城市 - 打开城市窗口\ 1156 -左键单击他国部队 - 查看信息\ 1157 -左键单击他国城市 - 查看城市防御\ 1158 -左键单击其他地块 - 窗口居中\ 1159 -右键单击 - 将该处指定为选定部队的移动目标\ 1160 -右键单击(超级用户模式下) - 创建部队\\ 1161 1162 主画面中的键盘操作:\ 1163 -方向键 - 移动选定部队\ 1164 -数字键盘"+"键 - 结束回合\ 1165 -数字键1 ~ 7 - 小地图旁一排按钮的对应快捷键\ 1166 -其他菜单快捷键, 请参见游戏中各菜单 1167 1167 1168 1168 #TRADINGGOODS 1169 $ ÉÌƷóÒ×\1170 1171 ! ÉÌƷóÒ×\1172 1173 Ñ¡ÔñÉÌƷóÒ×, ËùÓÐÉú²úÔÁϽ«±»Ö±½Óת»»ÎªÏÖ½ðÀûÈó.1169 $商品贸易\ 1170 1171 !商品贸易\ 1172 1173 选择商品贸易, 所有生产原料将被直接转换为现金利润. 1174 1174 1175 1175 #MILRES 1176 $ ²¿¶ÓÑз¢\1177 1178 ! ²¿¶ÓÑз¢\1179 1180 ÒªÉú²úÐÂÐ͵ÄÇ¿Á¦²¿¶Ó, ±ØÐëÏȽøÐв¿¶ÓÑз¢.\1181 :CLASSES ²é¿´²¿¶ÓÑз¢µÄÓйØÐÅÏ¢1176 $部队研发\ 1177 1178 !部队研发\ 1179 1180 要生产新型的强力部队, 必须先进行部队研发.\ 1181 :CLASSES 查看部队研发的有关信息 1182 1182 1183 1183 #ADVHELP 1184 ¿ÕÖв¿¶ÓµÄ×î´ó±àÖÆÉÏÉýÖÁ7%w.1185 * 1186 * 1187 * 1188 µØÃ沿¶ÓµÄ×î´ó±àÖÆÉÏÉýÖÁ10%w.1189 * 1190 * 1191 ¿ÉÔÚºÓÁ÷ÉϼÜÇÅÐÞ·.1192 * 1193 * 1194 * 1195 * 1196 * 1197 * 1198 * 1199 * 1200 * 1201 * 1202 Éú²úµØÃ沿¶Óʱ, ¿ÉÖ´ÐÐÕ÷ļ¹¦ÄÜ.1203 ¿É¿ªÊ¼½¨ÔìÒªÈû.\::J ²Î¼û"µØÐν¨Éè".1204 * 1205 * 1206 * 1207 * 1208 * 1209 * 1210 * 1211 * 1212 * 1213 ËùÓн¨ÓеÀ·µÄƽ̹µØÐÎÇøÓò, %t +1.1214 ¿É¸ü»»µØÐÎ, ¿ª±ÙÔ˺Ó.\::J ²Î¼û"µØÐν¨Éè".1215 ¿É¿ªÊ¼Éú²ú¿ÕÖв¿¶Ó.1216 * 1217 * 1218 µØÃ沿¶ÓµÄ×î´ó±àÖÆÉÏÉýÖÁ7%w.1219 * 1220 * 1221 * 1222 * 1223 * 1224 * 1225 * 1226 * 1227 * 1228 * 1229 ËùÓкÓÁ÷;¾µÄµØ¿é, %t +1.\¿É¿ªÊ¼Éú²úº£Éϲ¿¶Ó.1230 * 1231 ¿É¿ª²ÉÏÖ´ú×ÊÔ´.\»®Ê±´ú¿Æ¼¼: µ±Ä³¹úʵÏÖÁ˹æÄ£Á¿²ú, È«ÊÀ½ç¶¼»á»ñϤÕâÒ»ÏûÏ¢.1232 * 1233 ¿É¿ªÊ¼½¨Ôì¾üÊ»ùµØ.\::J ²Î¼û"µØÐν¨Éè".1234 * 1235 * 1236 * 1237 * 1238 * 1239 * 1240 * 1241 * 1242 * 1243 * 1244 * 1245 * 1246 * 1247 * 1248 ¿É¿ª±ÙÅ©³¡.\::J ²Î¼û"µØÐν¨Éè".1249 * 1250 * 1251 * 1252 * 1253 ¿É¿ªÊ¼ÆÌÉèÌú·.\::J ²Î¼û"µØÐν¨Éè".1254 * 1255 ¿É¿ª²É¹¤Òµ»¯×ÊÔ´.\»®Ê±´ú¿Æ¼¼: µ±Ä³¹úʵÏÖÁË¿Æѧ, È«ÊÀ½ç¶¼»á»ñϤÕâÒ»ÏûÏ¢.1256 * 1257 º£Éϲ¿¶ÓµÄ×î´ó±àÖÆÉÏÉýÖÁ7%w.1258 * 1259 * 1260 * 1261 º£Éϲ¿¶ÓµÄ×î´ó±àÖÆÉÏÉýÖÁ 9%w.\×°±¸×°¼×µÄÉÏÏÞÌáÉý1.1262 * 1263 * 1264 * 1265 * 1266 * 1267 »®Ê±´ú¿Æ¼¼: µ±Ä³¹úʵÏÖÁËÐǼÊÖ³Ãñ, È«ÊÀ½ç¶¼»á»ñϤÕâÒ»ÏûÏ¢.1268 * 1269 * 1270 ¿É¿ªÊ¼Éú²úÐÂÐ͵ØÃ沿¶Ó.1271 * 1272 * 1273 * 1274 ½¨ÓдóѧµÄ³ÇÊÐ, ¿Æ¼¼+5%\½¨ÓÐʵÑéÊҵijÇÊÐ, ¿Æ¼¼+10%1275 ½¨Óй¤³§µÄ³ÇÊÐ, Éú²ú+5%\½¨ÓÐÌØÇøµÄ³ÇÊÐ, Éú²ú+10%\(²»»áÔö¼Ó¶îÍâÎÛȾ)1184 空中部队的最大编制上升至 7%w. 1185 * 1186 * 1187 * 1188 地面部队的最大编制上升至 10%w. 1189 * 1190 * 1191 可在河流上架桥修路. 1192 * 1193 * 1194 * 1195 * 1196 * 1197 * 1198 * 1199 * 1200 * 1201 * 1202 生产地面部队时, 可执行征募功能. 1203 可开始建造要塞.\::J 参见"地形建设". 1204 * 1205 * 1206 * 1207 * 1208 * 1209 * 1210 * 1211 * 1212 * 1213 所有建有道路的平坦地形区域, %t +1. 1214 可更换地形, 开辟运河.\::J 参见"地形建设". 1215 可开始生产空中部队. 1216 * 1217 * 1218 地面部队的最大编制上升至 7%w. 1219 * 1220 * 1221 * 1222 * 1223 * 1224 * 1225 * 1226 * 1227 * 1228 * 1229 所有河流途经的地块, %t +1.\可开始生产海上部队. 1230 * 1231 可开采现代资源.\划时代科技: 当某国实现了规模量产, 全世界都会获悉这一消息. 1232 * 1233 可开始建造军事基地.\::J 参见"地形建设". 1234 * 1235 * 1236 * 1237 * 1238 * 1239 * 1240 * 1241 * 1242 * 1243 * 1244 * 1245 * 1246 * 1247 * 1248 可开辟农场.\::J 参见"地形建设". 1249 * 1250 * 1251 * 1252 * 1253 可开始铺设铁路.\::J 参见"地形建设". 1254 * 1255 可开采工业化资源.\划时代科技: 当某国实现了科学, 全世界都会获悉这一消息. 1256 * 1257 海上部队的最大编制上升至 7%w. 1258 * 1259 * 1260 * 1261 海上部队的最大编制上升至 9%w.\装备装甲的上限提升1. 1262 * 1263 * 1264 * 1265 * 1266 * 1267 划时代科技: 当某国实现了星际殖民, 全世界都会获悉这一消息. 1268 * 1269 * 1270 可开始生产新型地面部队. 1271 * 1272 * 1273 * 1274 建有大学的城市, 科技+5%\建有实验室的城市, 科技+10% 1275 建有工厂的城市, 生产+5%\建有特区的城市, 生产+10%\(不会增加额外污染) 1276 1276 * 1277 1277 * 1278 1278 1279 1279 #IMPHELP 1280 ¿ÉÉú²úÌØÊⲿ¶Ó:\\::S7 Å«Á¥À͹¤ 1281 ÿ¹¥Õ¼Ò»´¦³ÇÊÐ, ¾Í¿É»ñµÃÔÊÆÁ¦µÄ¹ú¼ÒÇ鱨, »¹¿É´Ó¸ÃÊÆÁ¦µÄ¿Æ¼¼³É¹ûÖÐÑ¡Ò»ÏîÇÔΪ¼ºÓÐ. ÇԵõĿƼ¼³É¹ûºÍͨ¹ý½»Éæ¶øµÃµÄÒ»Ñù, ÔÚÕÆÎÕÇ°±ØÐë½øÐÐÆÊÎöÐÔÑо¿, Ñо¿ËٶȽ«ÊǶÀ×ÔÑо¿µÄÁ½±¶, ÇÒ²»±ØÑо¿ÏÈÆÚËùÐè¿Æ¼¼.1282 ɳĮµØÐοɸü»»ÎªÆ½Ô»ò²ÝµØ.\ËùÓв¿¶Ó¶Ô¶ñÍÁµÄ¸ºÃæЧ¹ûÃâÒß.1283 Ææ¼£µÄ½¨Ôì³É±¾¼õÉÙËÄ·ÖÖ®Ò».1284 ËùÓнüº£µØ¿éÔö¼Ó 1%p. \\Ö»ÓÐÑغ£³ÇÊвÅÄܽ¨Ôì´ËÆæ¼£.1285 ÓµÓдóͼÊé¹ÝµÄ¹ú¼Ò, ¿É»ñµÃÆäËûÊÆÁ¦ÒÑÑеõĿƼ¼³É¹û, Ìõ¼þÊÇÆäËûÊÆÁ¦ÖÐÒ»°ëÒÔÉÏÒÑÓµÓиóɹû. »ñµÃµÄ¿Æ¼¼³É¹ûºÍͨ¹ý½»Éæ¶øµÃµÄÒ»Ñù, ÔÚÕÆÎÕÇ°±ØÐë½øÐÐÆÊÎöÐÔÑо¿, Ñо¿ËٶȽ«ÊǶÀ×ÔÑо¿µÄÁ½±¶, ÇÒ²»±ØÑо¿ÏÈÆÚËùÐè¿Æ¼¼.1286 ½¨³Éºó, ¶ÔÓÚ±¾¹ú¼°Òѽ¨Á¢½»ÍùµÄ¹ú¼Ò, ÿ»ØºÏ¹ú¿â½«»ñµÃ¶îÍâÊÕÈë, ÊÕÈëÊýÁ¿µÈͬÓڸùúËÂÃíµÄ×ÜÊý.1287 ÒÔÏÂ3Ïî¿Æ¼¼ÊôÐÔÉúЧ:1288 ÎÞÊÓ¿ÆÑÐͶÈë±ÈÀý, ÔÚ½ÓÏÂÀ´µÄÁ½»ØºÏÖÐÁ¬ÐøÍê³ÉÁ½ÏîеĿƼ¼³É¹û. Áí¿ÉÉú²úÌØÊⲿ¶Ó:\\::S8 »¬Ïè»ú 1289 ±¾¹úËùÓк£Éϲ¿¶ÓµÄ»ú¶¯Á¦ +200.\\Ö»ÓÐÑغ£³ÇÊвÅÄܽ¨Ôì´ËÆæ¼£.1290 ÔÚ¹ºÂòδÍê³ÉµÄÉèÊ©»òÆ漣ʱ, ¹ºÂòÒ»µ¥Î»ÔÁϵļ۸ñ½µÖÁ2%c.1291 * 1292 Èç¹ûÕþÌåÊǾýÖ÷ÖÆ, ¿ÆÑнø¶È¼Ó¿ìÒ»±¶.1293 ³ÇÊÐÖеĽÌÌÿÉʹ¶îÍâµÄ2Ãû²»°²ÊÐÃñ±ä³É°²¶¨.1294 * 1295 ÿ¸ö³ÇÊж¼Óи÷×ÔµÄÉݳÞÂÊ, Æäˮƽ×ãÒÔ×èÖ¹³ÇÊÐɧÂҵķ¢Éú.\\Èç¹ûÒ»¸ö³ÇÊеÄóÒ×ËùµÃÌ«ÉÙ, È«²¿Ã³Ò׶»»³ÉÉݳÞÆ·, Ò²²»×ãÒÔ×èֹɧÂҵĻ°, ¸ÃÆæ¼£¶Ô´ËÇé¿öÎÞÄÜΪÁ¦.1296 ËùÓÐÆæ¼£µÄЧ¹ûÓÀÔ¶²»»á¹ýÆÚ. ÒѹýÆÚµÄÆæ¼£ÖØÐÂÉúЧ.1297 Ï൱ÓÚÔÚÿ¸ö³ÇÊÐÖÐÔìÒ»×ùË®µçÕ¾.\\Ö»ÓÐÑغӻò¿¿½ü¸ßɽµÄ³ÇÊвÅÄܽ¨Ôì´ËÆæ¼£.1298 ÑØ×ÅÌú·Òƶ¯Ê±, ÎÞÐèºÄ·ÑÈκÎÐж¯µã.1299 Æô¶¯Àäսʱ´ú. ÀäսʱËùÓйú¼ÒÎÞ·¨¿ªÕ¹¶ÔÍâ½»Éæ. ÀäÕ½¹²³ÖÐø40»ØºÏ.1300 Õû¸öÊÀ½çµØͼ½«È«²¿´ò¿ª, ²¢»ñÖªËùÓв¿¶ÓµÄÐж¯, Ч¹û³ÖÐøÒ»»ØºÏ. »ñµÃËùÓÐÊÆÁ¦µÄ¹ú¼ÒÇ鱨ºÍ¾üÊÂÇ鱨.\\Òª½¨Éè´ËÆæ¼£, ±ØÐëÏȽ¨\::B66 Ì«¿Õ¸Û 1301 * 1302 * 1303 * 1304 * 1305 * 1306 * 1307 * 1308 * 1309 ³ÇÊÐÉú²úµÄµØÃ沿¶ÓÖ±½ÓÉýΪÀúÁ·²¿¶Ó. ÊÜÉ˵ĵØÃ沿¶ÓÔڴ˳ÇÖÐÁôÊØ, ÿ»ØºÏ״̬»Ö¸´Ëٶȼӱ¶. 1310 ³ÇÊйæÄ£Ôö³¤ºó, Á¸Ê³´¢Á¿²»ÊÇÈ«¿Õ, ¶øÊÇ°ëÂú.1280 可生产特殊部队:\\::S7 奴隶劳工 1281 每攻占一处城市, 就可获得原势力的国家情报, 还可从该势力的科技成果中选一项窃为己有. 窃得的科技成果和通过交涉而得的一样, 在掌握前必须进行剖析性研究, 研究速度将是独自研究的两倍, 且不必研究先期所需科技. 1282 沙漠地形可更换为平原或草地.\所有部队对恶土的负面效果免疫. 1283 奇迹的建造成本减少四分之一. 1284 所有近海地块增加 1%p. \\只有沿海城市才能建造此奇迹. 1285 拥有大图书馆的国家, 可获得其他势力已研得的科技成果, 条件是其他势力中一半以上已拥有该成果. 获得的科技成果和通过交涉而得的一样, 在掌握前必须进行剖析性研究, 研究速度将是独自研究的两倍, 且不必研究先期所需科技. 1286 建成后, 对于本国及已建立交往的国家, 每回合国库将获得额外收入, 收入数量等同于该国寺庙的总数. 1287 以下3项科技属性生效: 1288 无视科研投入比例, 在接下来的两回合中连续完成两项新的科技成果. 另可生产特殊部队:\\::S8 滑翔机 1289 本国所有海上部队的机动力 +200.\\只有沿海城市才能建造此奇迹. 1290 在购买未完成的设施或奇迹时, 购买一单位原料的价格降至2%c. 1291 * 1292 如果政体是君主制, 科研进度加快一倍. 1293 城市中的教堂可使额外的2名不安市民变成安定. 1294 * 1295 每个城市都有各自的奢侈率, 其水平足以阻止城市骚乱的发生.\\如果一个城市的贸易所得太少, 全部贸易额都换成奢侈品, 也不足以阻止骚乱的话, 该奇迹对此情况无能为力. 1296 所有奇迹的效果永远不会过期. 已过期的奇迹重新生效. 1297 相当于在每个城市中造一座水电站.\\只有沿河或靠近高山的城市才能建造此奇迹. 1298 沿着铁路移动时, 无需耗费任何行动点. 1299 启动冷战时代. 冷战时所有国家无法开展对外交涉. 冷战共持续40回合. 1300 整个世界地图将全部打开, 并获知所有部队的行动, 效果持续一回合. 获得所有势力的国家情报和军事情报.\\要建设此奇迹, 必须先建\::B66 太空港 1301 * 1302 * 1303 * 1304 * 1305 * 1306 * 1307 * 1308 * 1309 城市生产的地面部队直接升为历练部队. 受伤的地面部队在此城中留守, 每回合状态恢复速度加倍. 1310 城市规模增长后, 粮食储量不是全空, 而是半满. 1311 1311 +2%m. 1312 Ë°ÊÕºÍÉݳÞÉú²ú+50%.1313 ¿ÆѧÉú²ú+50%.1314 ÊÕ¼¯Ã³Ò×ÀûÈó, ÿ¸öµØ¿éµÄóÒ×Á¿Ã»ÓÐÉÏÏÞ, ²¢¼õÉÙ50%µÄ¸¯°Ü.1315 ÊØÎÀ²¿¶ÓÔÚÔâÓöµØÃ沿¶ÓÏ®»÷ʱ, ·ÀÓùÁ¦ +200%. µ±ÊØÎÀ²¿¶Ó±»µÐ·½µØÃ沿¶Ó´Ý»Ùʱ, ³ÇÊÐÈË¿Ú²»»á¼õÉÙ.1316 ³ÇÊйæÄ£ÉÏÏÞ´Ó8±ä³É12.1317 Ë°ÊÕºÍÉݳÞÉú²ú+75%.1312 税收和奢侈生产 +50%. 1313 科学生产 +50%. 1314 收集贸易利润, 每个地块的贸易量没有上限, 并减少50%的腐败. 1315 守卫部队在遭遇地面部队袭击时, 防御力 +200%. 当守卫部队被敌方地面部队摧毁时, 城市人口不会减少. 1316 城市规模上限从8变成12. 1317 税收和奢侈生产 +75%. 1318 1318 +4%m. 1319 ¿ÆѧÉú²ú+75%.1320 ÿ¸ö½üº£µØ¿é +1%f.\\´ËÉèÊ©Ö»Äܽ¨ÔÚÑغ£³ÇÊÐ.1319 科学生产 +75%. 1320 每个近海地块 +1%f.\\此设施只能建在沿海城市. 1321 1321 +4%m. 1322 ÔÁÏÉú²ú +50%, ÎÛȾ+50%.1323 ÔÁÏÉú²ú +50%, ÎÛȾ+50%.1324 ÍêÈ«Ïû³ýÎÛȾÏÖÏó.1325 ·¢µçÉèÊ©, ʹ¹¤³§ºÍÌØÇøµÄÔÁÏÉú²úЧ¹û¼Ó±¶.\(Öظ´½¨Ôì·¢µçÉèÊ©, Ч¹û²»»áµþ¼Ó.)\ÎÛȾ+50%.1326 ·¢µçÉèÊ©, ʹ¹¤³§ºÍÌØÇøµÄÔÁÏÉú²úЧ¹û¼Ó±¶.\(Öظ´½¨Ôì·¢µçÉèÊ©, Ч¹û²»»áµþ¼Ó.)\ÎÛȾ -50%.\\´ËÉèÊ©Ö»Äܽ¨ÔÚÑغӻòÁÙ½ü¸ßɽµÄ³ÇÊÐ.1327 ·¢µçÉèÊ©, ʹ¹¤³§ºÍÌØÇøµÄÔÁÏÉú²úЧ¹û¼Ó±¶.\(Öظ´½¨Ôì·¢µçÉèÊ©, Ч¹û²»»áµþ¼Ó.)\²»»á²úÉúÈκÎÎÛȾ.1328 ÿ¸ö½üº£µØ¿é +1%p.\\´ËÉèÊ©Ö»Äܽ¨ÔÚÑغ£³ÇÊÐ.1329 ÊÕ¼¯³ÇÊÐóÒ×ÀûÈóµÄ»ù´¡ÉèÊ©. ÿ¸öµØ¿é×î¶à³ö²ú3%t.1330 ³ÇÊйæÄ£ÉÏÏÞ´Ó12±ä³É30.1331 Å©³¡Éú²úµÄÁ¸Ê³²úÁ¿+50%.1332 ʹ³µÂÖµÄóÒ×¼Ó³ÉЧ¹ûÔÙ¼Ó±¶.1333 ¿ÆѧÉú²ú+75%.1334 ÊØÎÀ²¿¶ÓÔÚÔâÓö¿ÕÖв¿¶Ó»òºäըϮ»÷ʱ, ·ÀÓùÁ¦+100%.1335 ÊØÎÀ²¿¶ÓÔÚÔâÓöº£Éϲ¿¶Ó»òºäըϮ»÷ʱ, ·ÀÓùÁ¦ +100%.\\´ËÉèÊ©Ö»Äܽ¨ÔÚÑغ£³ÇÊÐ.1336 ³ÇÊÐÉú²úµÄ¿ÕÖв¿¶ÓÖ±½ÓÉýΪÀúÁ·²¿¶Ó. ÊÜÉ˵ĿÕÖв¿¶ÓÔڴ˳ÇÖÐÁôÊØ, ÿ»ØºÏ״̬»Ö¸´Ëٶȼӱ¶.1337 ³ÇÊÐÉú²úµÄº£Éϲ¿¶ÓÖ±½ÓÉýΪÀúÁ·²¿¶Ó. ÊÜÉ˵ĺ£Éϲ¿¶ÓÔڴ˳ÇÖÐÁôÊØ, ÿ»ØºÏ״̬»Ö¸´Ëٶȼӱ¶.1338 ʹËùÔÚ³ÇÊеÄóÒ××ÊÔ´²úÁ¿Ã»ÓÐÉÏÏÞ, ¶øÇÒ²»»á²úÉúÈκθ¯°ÜÏÖÏó. ËùÔÚ³ÇÊÐ×Ô¶¯³ÉΪ¹ú¼ÒÊ׶¼. ÓûÁ˽âÊ׶¼ÓëÆäËû³ÇÊи¯°ÜµÄ¹Øϵ, Çë²Î¼û:\:RESOURCES "×ÊÔ´ÖÖÀà"Ä©½Ú 1339 Ï൱ÓÚÔÚͬһ¿é´ó½ÉϵÄÿ×ù³ÇÊÐÖÐÔìÒ»µÀ³Çǽ.1340 ʹ°²¶¨ÊÐÃñµÄÊýÁ¿Ôö¼Ó, ÔöÖµµÈͬÓÚ³ÇÊеĹæÄ£Öµ.1341 ËùÔÚ³ÇÊеĿÆѧ×ÊÔ´²úÁ¿¼Ó±¶.1342 ËùÔÚ³ÇÊÐÉú²úµÄËùÓеØÃ沿¶ÓÖ±½ÓÉýΪ¾«Ó¢²¿¶Ó. ÊÜÉ˵ĵØÃ沿¶ÓÔڴ˳ÇÖÐÁôÊØ, ÿ»ØºÏ״̬»Ö¸´Ëٶȼӱ¶.1343 ËùÔÚ³ÇÊÐÖÐ, פÊز¿¶Ó·ÀÓùÁ¦+100%.1344 ËùÔÚ³ÇÊÐ+12%f1345 ËùÓÐÒøÐеÄЧ¹û¼Ó±¶.1346 ÌØÊâ×ÊÔ´ +100%.\\¿ÉÒÔ¿ªÊ¼½¨ÔìÖ³Ãñ·É´¬²¿¼þ. Èç¹ûûÓÐÌ«¿Õ¸Û, Ö³Ãñ·É´¬¹¤³Ì½«»¯ÎªÎÚÓÐ. Èç¹ûÌ«¿Õ¸Û±»ÆäËûÓµÓÐÌ«¿Õ¸ÛµÄÊÆÁ¦Õ¼Áì, ÔòÖ³Ãñ·É´¬Ò²½«ÂäÈëÕ¼ÁìÕßµÄÊÖÖÐ.1322 原料生产 +50%, 污染 +50%. 1323 原料生产 +50%, 污染 +50%. 1324 完全消除污染现象. 1325 发电设施, 使工厂和特区的原料生产效果加倍.\(重复建造发电设施, 效果不会叠加.)\污染 +50%. 1326 发电设施, 使工厂和特区的原料生产效果加倍.\(重复建造发电设施, 效果不会叠加.)\污染 -50%.\\此设施只能建在沿河或临近高山的城市. 1327 发电设施, 使工厂和特区的原料生产效果加倍.\(重复建造发电设施, 效果不会叠加.)\不会产生任何污染. 1328 每个近海地块 +1%p.\\此设施只能建在沿海城市. 1329 收集城市贸易利润的基础设施. 每个地块最多出产 3%t. 1330 城市规模上限从12变成30. 1331 农场生产的粮食产量 +50%. 1332 使车轮的贸易加成效果再加倍. 1333 科学生产 +75%. 1334 守卫部队在遭遇空中部队或轰炸袭击时, 防御力 +100%. 1335 守卫部队在遭遇海上部队或轰炸袭击时, 防御力 +100%.\\此设施只能建在沿海城市. 1336 城市生产的空中部队直接升为历练部队. 受伤的空中部队在此城中留守, 每回合状态恢复速度加倍. 1337 城市生产的海上部队直接升为历练部队. 受伤的海上部队在此城中留守, 每回合状态恢复速度加倍. 1338 使所在城市的贸易资源产量没有上限, 而且不会产生任何腐败现象. 所在城市自动成为国家首都. 欲了解首都与其他城市腐败的关系, 请参见:\:RESOURCES "资源种类"末节 1339 相当于在同一块大陆上的每座城市中造一道城墙. 1340 使安定市民的数量增加, 增值等同于城市的规模值. 1341 所在城市的科学资源产量加倍. 1342 所在城市生产的所有地面部队直接升为精英部队. 受伤的地面部队在此城中留守, 每回合状态恢复速度加倍. 1343 所在城市中, 驻守部队防御力 +100%. 1344 所在城市 +12%f 1345 所有银行的效果加倍. 1346 特殊资源 +100%.\\可以开始建造殖民飞船部件. 如果没有太空港, 殖民飞船工程将化为乌有. 如果太空港被其他拥有太空港的势力占领, 则殖民飞船也将落入占领者的手中. 1347 1347 1348 1348 * … … 1351 1351 1352 1352 #FEATUREHELP 1353 ¹¥»÷Á¦»ùÖµ+1.1354 ·ÀÓùÁ¦»ùÖµ +1.\×¢Òâ: µØÃ沿¶Ó×°¼×ÉÏÏÞΪ2µ¥Î», ¿ÕÖкͺ£Éϲ¿¶ÓµÄ×°¼×ÉÏÏÞΪ3µ¥Î».1355 »ú¶¯Á¦+50.1356 µØÃ沿¶ÓÔËÔØ»ùÖµ+1.1357 ¿ÕÖв¿¶ÓÔËÔØ»ùÖµ +1.\ĸ½¢²»ÄÜ´îÔØÔËÊä»ú.\°üº¬ÁËÀ×´ïÉùÄÉÊôÐÔ.1358 »ú¶¯Á¦+200.1359 ·É»úÆ𺽺ó, ¶ÔµØÃæ»òº£Éϲ¿¶ÓʵÐÐÊ״δò»÷ʱ, ¹¥»÷Á¦»ùÖµ+2.1360 ÿÔö¼ÓÒ»µãȼÓÍ, ·É»ú¿ÉÔÚÍâ¶àÍ£ÁôÒ»»ØºÏ, ÎÞÐè·µ»Ø³ÇÊÐ/ĸ½¢/¾üÊ»ùµØ.1361 µØÃ沿¶ÓÔËÔØ»ùÖµ +1.\ĸ½¢²»ÄÜ´îÔØÔËÊä»ú.1362 º£Éϲ¿¶Ó¿ÉÔÚÔ¶Ñóº½ÐÐ.1363 ÊÓÒ°·¶Î§À©¿íΪ2¸ñ, ¿É·¢ÏÖÁÙ½üµÄµÐ·½Ç±Í§.1364 ¾ß±¸Ç±º½ÄÜÁ¦, µÐ·½ÊÆÁ¦²»¿É¼û.1365 ¹¥»÷³ÇÊÐʱ, µÐ·½³ÇǽµÄ·ÀÓù¼Ó³ÉÎÞЧ. µØÃ沿¶Ó¿É¹¥»÷Áڽӵĺ£Éϲ¿¶Ó.\º£Éϲ¿¶Ó¿É¹¥»÷ÁڽӵijÇÊлòµØÃ沿¶Ó.1366 ÔÚ¸÷ÖÖµØÐÎÉÏÒƶ¯Ê±, ÏûºÄÐж¯µãÊýµÈͬÓÚµÀ·Òƶ¯.1367 ÔËÔصIJ¿¶Óÿ»ØºÏ״̬Öð½¥»Ö¸´.1368 ¹¥»÷Á¦¼°·ÀÓùÁ¦»ùÖµ·Ö±ð +1. ÐèÒª³ÇÊÐ2±¶µÄ¹©¸ø. ×°±¸¶îÍ⸺ÖصIJ¿¶Ó, Ö»ÄÜÑØ×ŵÀ·/ºÓÁ÷/Ô˺ÓÒƶ¯, Òƶ¯ÏûºÄÐж¯µãÊýÊÇÆÕͨ²¿¶ÓµÄ2±¶. Ò²¿ÉÑØ×ÅÌú·Òƶ¯, ÏûºÄÐж¯µãÊýµÈͬÓÚÆÕͨ²¿¶Ó. ÎÞ·¨´î³ËÔËÊ乤¾ß.1369 ¶Ô¿ÕÖв¿¶ÓµÄ·ÀÓùÁ¦+100%.1370 ¿ÉÕì²ìÁÚ½ü³ÇÊÐ, ÒÔ¼°Í¬Ò»µØ¿éµÄ¶à¸ö²¿¶Ó (°üÀ¨ÒþÐηɻú).1371 »ú¶¯Á¦+100.1372 »ú¶¯Á¦+100.1373 »ú¶¯Á¦+400.1374 ¾ß±¸ÒþÐÎÄÜÁ¦, µÐ·½ÊÆÁ¦²»¿É¼û.1375 µ±´øÓдËÊôÐԵIJ¿¶ÓÕóÍöʱ, »á¸øµÐÈËÔì³ÉÁ½±¶µÄÉ˺¦.\\ÔÚͬһµØ¿é´æÔÚ¶àÖ§²¿¶Óʱ, ¿ñÈȵĵØÃ沿¶Ó½«ÊÇ·ÀÓùµÄÏÈÍ·Á¦Á¿.\\µ±¹ú¼ÒÕþÌåÊǹ²ºÍÖÆ, ÃñÖ÷ÖÆ»òδÀ´ÖÆʱ, ´ËÊôÐÔʧЧ.1376 µ±²¿¶Ó½«µÐ¾üÒ»¾Ù¼ßÃðʱ, ²¿¶ÓÊܵ½µÄÉ˺¦ÊÇͨ³£µÄ¶þ·ÖÖ®Ò».1377 ¼´Ê¹¹¥»÷ʱʣÓàÐж¯µã²»×ã1µã, ²¿¶ÓÒ²ÄÜʹ³öÈ«²¿µÄ¹¥»÷Á¦.1378 ÊÓÒ°·¶Î§À©¿íΪ2¸ñ, Èç¹û´ýÃüʱÉÐÓàÒ»°ëÐж¯µã, ²¿¶Ó×Ô¶¯×ªÈëפÊØ״̬.1379 Á¬ÐøÉú²úͬÖÖ²¿¶ÓµÄÉú²ú·ÑÓüõ°ë, µ«Èô¸ÄΪÉú²úÆäËû²¿¶Ó, Éú²ú·ÑÓüӱ¶.1353 攻击力基值 +1. 1354 防御力基值 +1.\注意: 地面部队装甲上限为2单位, 空中和海上部队的装甲上限为3单位. 1355 机动力+50. 1356 地面部队运载基值 +1. 1357 空中部队运载基值 +1.\母舰不能搭载运输机.\包含了雷达声纳属性. 1358 机动力+200. 1359 飞机起航后, 对地面或海上部队实行首次打击时, 攻击力基值 +2. 1360 每增加一点燃油, 飞机可在外多停留一回合, 无需返回城市/母舰/军事基地. 1361 地面部队运载基值 +1.\母舰不能搭载运输机. 1362 海上部队可在远洋航行. 1363 视野范围扩宽为2格, 可发现临近的敌方潜艇. 1364 具备潜航能力, 敌方势力不可见. 1365 攻击城市时, 敌方城墙的防御加成无效. 地面部队可攻击邻接的海上部队.\海上部队可攻击邻接的城市或地面部队. 1366 在各种地形上移动时, 消耗行动点数等同于道路移动. 1367 运载的部队每回合状态逐渐恢复. 1368 攻击力及防御力基值分别 +1. 需要城市2倍的供给. 装备额外负重的部队, 只能沿着道路/河流/运河移动, 移动消耗行动点数是普通部队的2倍. 也可沿着铁路移动, 消耗行动点数等同于普通部队. 无法搭乘运输工具. 1369 对空中部队的防御力 +100%. 1370 可侦察邻近城市, 以及同一地块的多个部队 (包括隐形飞机). 1371 机动力+100. 1372 机动力+100. 1373 机动力+400. 1374 具备隐形能力, 敌方势力不可见. 1375 当带有此属性的部队阵亡时, 会给敌人造成两倍的伤害.\\在同一地块存在多支部队时, 狂热的地面部队将是防御的先头力量.\\当国家政体是共和制, 民主制或未来制时, 此属性失效. 1376 当部队将敌军一举歼灭时, 部队受到的伤害是通常的二分之一. 1377 即使攻击时剩余行动点不足1点, 部队也能使出全部的攻击力. 1378 视野范围扩宽为2格, 如果待命时尚余一半行动点, 部队自动转入驻守状态. 1379 连续生产同种部队的生产费用减半, 但若改为生产其他部队, 生产费用加倍. 1380 1380 1381 1381 #GOVHELP 1382 - ËùÓгÇÊÐÏÝÈëɧÂÒ.\-³ÇÊÐÉèÊ©ÎÞÐè×ʽðά³Ö.\-Á¥Êô²¿¶ÓÎÞÐè³ÇÊй©¸ø.\-³ÖÐø3¸ö»ØºÏ.1383 - ÿ¸öµØ¿é×ÊÔ´ÉÏÏÞΪ: 3%f, 2%p, 2%t.\-ÑÏÖظ¯°Ü. (¸¯°ÜÒò×Ó=3)\-ÿ¸öÊÐÃñ¿ÉÖ§³Ö1Ö§ÎÞÐ蹩¸øµÄ²¿¶Ó.\-ûÓÐÎÛȾ.\-ÿ֧ÒÆÃñ²¿¶Óÿ»ØºÏÏûºÄ1%f.1384 - Çá΢¸¯°Ü. (¸¯°ÜÒò×Ó=1)\-ÿ2¸öÊÐÃñ¿ÉÖ§³Ö1Ö§ÎÞÐ蹩¸øµÄ²¿¶Ó.\-ÿ֧ÒÆÃñ²¿¶Óÿ»ØºÏÏûºÄ1%f.1385 - ËùÓÐ>0µÄóÒ××ÊÔ´Ôö¼Ó1µãóÒ×.\-Öеȳ̶ȵĸ¯°Ü. (¸¯°ÜÒò×Ó=2)\-ÔÚ±¾·½»òÃ˾üÊÆÁ¦ÁìÍÁÖ®ÍâµÄ¹¥»÷²¿¶Ó(¹¥»÷Á¦>0), »áʹÁ¥Êô³ÇÊеݲ¶¨ÊÐÃñתΪ²»°², 1Ö§²¿¶ÓÓ°Ïì2λÊÐÃñ.\-ÿ֧ÒÆÃñ²¿¶Óÿ»ØºÏÏûºÄ2%f.1386 - Çá΢¸¯°Ü. (¸¯°ÜÒò×Ó=1)\-ËùÓв¿¶ÓÎÞÐè³ÇÊй©¸ø.\-È«ÃñÐÅÑö, È«ÌåÊÐÃñ´¦ÓÚ°²¶¨×´Ì¬.\-¿ÆÑнø¶È¼õÂýΪÔÏȵÄÒ»°ë.\-ÿ֧ÒÆÃñ²¿¶Óÿ»ØºÏÏûºÄ1%f.1387 - ËùÓÐ>1%pµÄ×ÊÔ´¶îÍâÔö¼Ó1µã.\-ûÓи¯°ÜÏÖÏó.\-ÿ2¸öÊÐÃñ¿ÉÖ§³Ö1Ö§ÎÞÐ蹩¸øµÄ²¿¶Ó.\-ÿ֧ÒÆÃñ²¿¶Óÿ»ØºÏÏûºÄ2%f.1388 - ËùÓÐ>0µÄóÒ××ÊÔ´Ôö¼Ó1µãóÒ×.\-ûÓи¯°ÜÏÖÏó.\-ÔÚ±¾·½»òÃ˾üÊÆÁ¦ÁìÍÁÖ®ÍâµÄ¹¥»÷²¿¶Ó(¹¥»÷Á¦>0), »áʹÁ¥Êô³ÇÊеݲ¶¨ÊÐÃñתΪ²»°², 1Ö§²¿¶ÓÓ°Ïì2λÊÐÃñ.\-ÿ֧ÒÆÃñ²¿¶Óÿ»ØºÏÏûºÄ2%f.1389 - ËùÓÐ>0µÄóÒ××ÊÔ´Ôö¼Ó1µãóÒ×.\-Ñз¢Î´À´¿Æ¼¼Ê±, ½öÐèÆÕͨ¿Æ¼¼µÄ2±¶Ñз¢Ê±¼ä, ¶ø²»ÊÇ4±¶.\-ûÓи¯°ÜÏÖÏó.\-ÔÚ±¾·½»òÃ˾üÊÆÁ¦ÁìÍÁÖ®ÍâµÄ¹¥»÷²¿¶Ó(¹¥»÷Á¦>0), »áʹÁ¥Êô³ÇÊеݲ¶¨ÊÐÃñתΪ²»°², 1Ö§²¿¶ÓÓ°Ïì2λÊÐÃñ.\-¶àÓàµÄÁ¸Ê³½«Ö±½Óת»»³É½ðÇ®.\-³ÇÊÐÈË¿Ú²»ÔÙÔö³¤.\-ÿ֧ÒÆÃñ²¿¶Óÿ»ØºÏÏûºÄ2%f.1382 -所有城市陷入骚乱.\-城市设施无需资金维持.\-隶属部队无需城市供给.\-持续3个回合. 1383 -每个地块资源上限为: 3%f, 2%p, 2%t.\-严重腐败. (腐败因子=3)\-每个市民可支持1支无需供给的部队.\-没有污染.\-每支移民部队每回合消耗 1%f. 1384 -轻微腐败. (腐败因子=1)\-每2个市民可支持1支无需供给的部队.\-每支移民部队每回合消耗 1%f. 1385 -所有>0的贸易资源增加1点贸易.\-中等程度的腐败. (腐败因子=2)\-在本方或盟军势力领土之外的攻击部队(攻击力>0), 会使隶属城市的安定市民转为不安, 1支部队影响2位市民.\-每支移民部队每回合消耗 2%f. 1386 -轻微腐败. (腐败因子=1)\-所有部队无需城市供给.\-全民信仰, 全体市民处于安定状态.\-科研进度减慢为原先的一半.\-每支移民部队每回合消耗 1%f. 1387 -所有>1%p的资源额外增加1点.\-没有腐败现象.\-每2个市民可支持1支无需供给的部队.\-每支移民部队每回合消耗 2%f. 1388 -所有>0的贸易资源增加1点贸易.\-没有腐败现象.\-在本方或盟军势力领土之外的攻击部队(攻击力>0), 会使隶属城市的安定市民转为不安, 1支部队影响2位市民.\-每支移民部队每回合消耗 2%f. 1389 -所有>0的贸易资源增加1点贸易.\-研发未来科技时, 仅需普通科技的2倍研发时间, 而不是4倍.\-没有腐败现象.\-在本方或盟军势力领土之外的攻击部队(攻击力>0), 会使隶属城市的安定市民转为不安, 1支部队影响2位市民.\-多余的粮食将直接转换成金钱.\-城市人口不再增长.\-每支移民部队每回合消耗 2%f. 1390 1390 1391 1391 #TECHAGE 1392 ÔçÆڿƼ¼ 1393 ¹¤Òµ»¯¿Æ¼¼ 1394 ÏÖ´ú¿Æ¼¼ 1395 δÀ´¿Æ¼¼ 1392 早期科技 1393 工业化科技 1394 现代科技 1395 未来科技 1396 1396 1397 1397 #SPECIALMODEL 1398 - ¿ÉÒÔ¸ÄÔìµØÐÎ, ½¨Á¢³ÇÊÐ.\-ÐèÒª³ÇÊй©¸øÁ¸Ê³.1399 - ¿ÉÒÔ¸ÄÔìµØÐÎ, ½¨Á¢³ÇÊÐ.\-ÐèÒª³ÇÊй©¸øÁ¸Ê³.\-¶Ô¶ñÍÁµÄ¸ºÃæЧ¹ûÓÐÃâÒß.1400 * 1401 - ÊسÇʱ·ÀÓùÁ¦ +100%.\-ʼÖÕÐèÒª³ÇÊй©¸øÁ¸Ê³.\-ÔÚÅ«Á¥×¨ÖÆÉç»áÖÐ, ÿ¸öÊسǵÄÎÀ±ø¿ÉµÖÏû2Ãû³ÇÄÚÊÐÃñµÄ²»°².1402 :SPYMISSIONS ¿ÉÖ´ÐÐÃØÃÜÐж¯.\-¿ÉÕì²ìÁÚ½ü³ÇÊÐ, ÒÔ¼°Í¬Ò»µØ¿éµÄ¶à¸ö²¿¶Ó (°üÀ¨ÒþÐηɻú).\-ÊÓÒ°·¶Î§Îª2¸ñ.\-²»¾ß±¸µØÓò¿ØÖƵÄÄÜÁ¦.\-²»»áÔÚÁ¥Êô³ÇÊÐÒýÆðÊÐÃñµÄ²»°².1403 - ½¨Éè¶Ó¿ÉÓÃ"¼ÓÈë³ÇÊÐ"µÄ·½·¨, ½«×ÔÉíÈý·ÖÖ®¶þµÄÉú²úÔÁÏ ¼ÓÈ뵱ǰ³ÇÊеĽ¨ÉèÏîÄ¿Ö®ÖÐ (Ö³Ãñ·É´¬²¿¼þµÄ½¨Éè³ýÍâ).1404 - ¿É´îÔØÔËÊäÁ½Ö§²¿¶Ó.1405 - ¿ÉÒÔ¸ÄÔìµØÐÎ.\-ÎÞÐè³ÇÊй©¸øÁ¸Ê³.1406 - ÔÚ±¾·½»ØºÏÖÐ, ¿ÉÔÚ¿ÕÖзÉÐÐ; ÔÚÆäËûÊÆÁ¦µÄ»ØºÏÖÐ, ½«±»µ±×÷µØÃ沿¶Ó.\-¿ÉÕì²ìÁÚ½ü³ÇÊÐ, ÒÔ¼°Í¬Ò»µØ¿éµÄ¶à¸ö²¿¶Ó.\-Èç¹ûÔÚ±¾·½»ØºÏ½áÊøʱ, »¬Ïè»úÈÔÔÚº£Ãæ, ¾Í»á×¹»Ù.\-²»¿É´îÔؽ¢´¬.1398 -可以改造地形, 建立城市.\-需要城市供给粮食. 1399 -可以改造地形, 建立城市.\-需要城市供给粮食.\-对恶土的负面效果有免疫. 1400 * 1401 -守城时防御力 +100%.\-始终需要城市供给粮食.\-在奴隶专制社会中, 每个守城的卫兵可抵消2名城内市民的不安. 1402 :SPYMISSIONS 可执行秘密行动.\-可侦察邻近城市, 以及同一地块的多个部队 (包括隐形飞机).\-视野范围为2格.\-不具备地域控制的能力.\-不会在隶属城市引起市民的不安. 1403 -建设队可用"加入城市"的方法, 将自身三分之二的生产原料 加入当前城市的建设项目之中 (殖民飞船部件的建设除外). 1404 -可搭载运输两支部队. 1405 -可以改造地形.\-无需城市供给粮食. 1406 -在本方回合中, 可在空中飞行; 在其他势力的回合中, 将被当作地面部队.\-可侦察邻近城市, 以及同一地块的多个部队.\-如果在本方回合结束时, 滑翔机仍在海面, 就会坠毁.\-不可搭载舰船. 1407 1407 1408 1408 #JOBHELP 1409 :MOVEMENT ²¿¶ÓÒƶ¯Ê±ºÄ·Ñ¸üÉÙÐж¯µã, ²¿¶ÓÒƶ¯·¶Î§Ôö´ó.\::A29 ÅäºÏ³µÂֿƼ¼, Ìá¸ßóÒ×ÀûÈó.1410 :MOVEMENT ²¿¶ÓÒƶ¯Ê±ºÄ·Ñ¸üÉÙÐж¯µã, ²¿¶ÓÒƶ¯·¶Î§Ôö´ó.\-ËùÔڵؿéµÄÔÁÏ×ÊÔ´Éú²ú +50%.\-Ö»ÄÜÔÚÒÑÓеÀ·µÄµØ¿éÉÏÆÌÉèÌú·. µÀ·µÄÔÓÐЧ¹ûÒÀÈ»±£Áô.1411 - ʹ´¬Ö»¿ÉͨÐÐÈëÄÚ½.\-¿ÉµÖÏû¶ñÍÁµÄ¸ºÃæЧӦ.\-²»¿ÉÔÚ¸ßɽ»ò±ùÔÉÏ¿ª±ÙÔ˺Ó.1412 - Ôö¼ÓÁ¸Ê³²úÁ¿, Ôö¼Ó·ù¶ÈÒòµØÐζøÒì.1413 ::B51 Óг¬ÊеijÇÊÐÖÐ, Á¸Ê³²úÁ¿ +50%\-Ö»ÄÜÔÚÒѹà¸ÈµÄµØ¿éÉÏ¿ª¿ÑÅ©³¡. ¹à¸ÈµÄÔÓÐЧ¹ûÒÀÈ»±£Áô.1414 - Ôö¼Ó¿ó²Ø²úÁ¿, Ôö¼Ó·ù¶ÈÒòµØÐζøÒì.1415 - ÔÚÄÚפÊصĵØÃ沿¶Ó·ÀÓùÁ¦ +100%.\-ÊÓÒ°·¶Î§ÍØΪ2¸ñ.\:COMBAT ÆäËûЧ¹û,Ïê¼û"Õ½¶·´óÈ«".1416 - ¿ÉµÖÏû¶ñÍÁµÄ¸ºÃæЧӦ.\-ÊÓÒ°·¶Î§ÍØΪ2¸ñ.\:COMBAT Õ½¶·¼°»Ö¸´Ð§¹û, Ïê¼û"Õ½¶·´óÈ«".\::F6 ·É»ú¿ÉÔڴ˼Ó×°Õ¨µ¯.\-ÈôÁÚ½ÓÔ˺Ó, ´¬Ö»¿ÉÔÚ¾üÊ»ùµØÄÚÍ£²´.1417 1409 :MOVEMENT 部队移动时耗费更少行动点, 部队移动范围增大.\::A29 配合车轮科技, 提高贸易利润. 1410 :MOVEMENT 部队移动时耗费更少行动点, 部队移动范围增大.\-所在地块的原料资源生产 +50%.\-只能在已有道路的地块上铺设铁路. 道路的原有效果依然保留. 1411 -使船只可通行入内陆.\-可抵消恶土的负面效应.\-不可在高山或冰原上开辟运河. 1412 -增加粮食产量, 增加幅度因地形而异. 1413 ::B51 有超市的城市中, 粮食产量 +50%\-只能在已灌溉的地块上开垦农场. 灌溉的原有效果依然保留. 1414 -增加矿藏产量, 增加幅度因地形而异. 1415 -在内驻守的地面部队防御力 +100%.\-视野范围拓为2格.\:COMBAT 其他效果,详见"战斗大全". 1416 -可抵消恶土的负面效应.\-视野范围拓为2格.\:COMBAT 战斗及恢复效果, 详见"战斗大全".\::F6 飞机可在此加装炸弹.\-若邻接运河, 船只可在军事基地内停泊. 1417 -
branches/highdpi/Localization/zh-Hans/Language.txt
r464 r465 1 #GAME ½ø¶È%d2 #MAP µØͼ%d3 #BC ¹«ÔªÇ° %d Äê4 #AD ¹«Ôª %d Äê1 #GAME 进度 %d 2 #MAP 地图 %d 3 #BC 公元前 %d 年 4 #AD 公元 %d 年 5 5 #SHARE %d/%d 6 6 #SHORTNAME #S 7 7 #OWNED #A %s 8 8 #GENCITY #S %d 9 #GENMODEL #A Ä£¿é%d9 #GENMODEL #A 模块 %d 10 10 #TILESIZE %dx%d 11 11 12 12 'City Screen Text 13 #HAPPINESS °²¶¨14 #CONTROL ½äÑÏ15 #FAITH ÐÅÑö16 #UNREST ²»°²17 #HAPPINESSDEMAND ÈË¿Ú18 #HAPPINESSPLUS Ê£Óà19 #STORAGE ´æÁ¸20 #FOOD Á¸Ê³21 #DEMAND ÐèÇó22 #SURPLUS ¶àÓà23 #LACK ȱ·¦24 #MATERIAL ÔÁÏ25 #PROD Éú²ú26 #POLL ÎÛȾ27 #SUPPORT ά³Ö28 #PROFIT ÀûÈó29 #TRADE óÒ×30 #CORR ¸¯°Ü31 #SCIENCE ¿ÆÑÐ32 #TAX Ë°ÊÕ33 #LUX ÉݳÞ34 #DUMP ·ÏÁÏ35 #SUPUNITS Á¥Êô²¿¶Ó13 #HAPPINESS 安定 14 #CONTROL 戒严 15 #FAITH 信仰 16 #UNREST 不安 17 #HAPPINESSDEMAND 人口 18 #HAPPINESSPLUS 剩余 19 #STORAGE 存粮 20 #FOOD 粮食 21 #DEMAND 需求 22 #SURPLUS 多余 23 #LACK 缺乏 24 #MATERIAL 原料 25 #PROD 生产 26 #POLL 污染 27 #SUPPORT 维持 28 #PROFIT 利润 29 #TRADE 贸易 30 #CORR 腐败 31 #SCIENCE 科研 32 #TAX 税收 33 #LUX 奢侈 34 #DUMP 废料 35 #SUPUNITS 隶属部队 36 36 37 37 'Class Screen Text 38 38 #UNITOWNER (#A) 39 #UNITSPEED »ú¶¯40 #UNITSTRENGTH Õ½¶·41 #UNITTRANSPORT ÔËÊä42 #UNITCOST Ôì¼Û43 #UNITBUILT ±àÖÆ44 #UNITINTRO ʼ´´ÓÚ45 #UNITADOPT Òý½øÓÚ46 #UNITLOST ÎþÉü47 #UNITDESTROYED ÕóÍö48 #UNITAVAILABLE ÏÖÒÛ49 #UNITINPROD ÔÚ½¨50 #UNITKNOWN ÔÚÒÛ×ܼÆ51 #UNITSPECIAL ÌØÊⲿ¶Ó39 #UNITSPEED 机动 40 #UNITSTRENGTH 战斗 41 #UNITTRANSPORT 运输 42 #UNITCOST 造价 43 #UNITBUILT 编制 44 #UNITINTRO 始创于 45 #UNITADOPT 引进于 46 #UNITLOST 牺牲 47 #UNITDESTROYED 阵亡 48 #UNITAVAILABLE 现役 49 #UNITINPROD 在建 50 #UNITKNOWN 在役总计 51 #UNITSPECIAL 特殊部队 52 52 53 53 'Diplomacy Screen Text 54 #FRSTATGOV ÕþÌå: %s55 #FRSTATPOP ÈË¿Ú: %d°ÙÍò56 #FRSTATTER ÁìÍÁ: %d°ÙÍòƽ·½¹«Àï57 #FRSTATTECH ¿Æ¼¼: %d%%58 #FRSTATEXP ̽Ë÷: %d%%59 #FRLASTCONTACT ÉϴνӴ¥:60 #FRNOCONTACT δÔø½Ó´¥£¬½öƾ´«ÎÅ61 #FRNOVISIT ÉÐδ°Ý·Ã62 #FROLDCIVILREP ( ´Ó%s´¦»ñµÃ)63 #FRNOCIVILREP ( ÉÐÎÞ¹ú¼Ò±¨¸æ)64 #FROURATT ÎÒ·½Ì¬¶È: %s65 #FREXTINCT Ãð¾øÓÚ66 #FRTREATY ¹Øϵ:54 #FRSTATGOV 政体: %s 55 #FRSTATPOP 人口: %d百万 56 #FRSTATTER 领土: %d百万平方公里 57 #FRSTATTECH 科技: %d%% 58 #FRSTATEXP 探索: %d%% 59 #FRLASTCONTACT 上次接触: 60 #FRNOCONTACT 未曾接触,仅凭传闻 61 #FRNOVISIT 尚未拜访 62 #FROLDCIVILREP (从%s处获得) 63 #FRNOCIVILREP (尚无国家报告) 64 #FROURATT 我方态度: %s 65 #FREXTINCT 灭绝于 66 #FRTREATY 关系: 67 67 #FRAND , 68 #FRCREDIBILITY (%d%% ÐÅÓöÈ)69 #FRTREASURY ¹ú¿â: %d%%c70 #FRRELATIONS Ëû¹ú¹Øϵ:68 #FRCREDIBILITY (%d%% 信用度) 69 #FRTREASURY 国库: %d%%c 70 #FRRELATIONS 他国关系: 71 71 72 72 'Other Dialog Text 73 #PRESENT µ±Ç°²¿¶Ó74 #SHOWSTRENGTH Õ½¶·Á¦: %d/%d75 #RIVER ºÓÁ÷76 #INITUNIT ²¿¶ÓÑз¢77 #TECHFOCUS Ä¿±ê£º%s78 #NEXUS Á¬½Ó79 #SCIENCEREPORT_EXTINCT %s ( Ãð¾ø)80 #MODELDRAFT в¿¶ÓÑз¢(%s)81 #TAXRATE Ë°ÊÕ73 #PRESENT 当前部队 74 #SHOWSTRENGTH 战斗力: %d/%d 75 #RIVER 河流 76 #INITUNIT 部队研发 77 #TECHFOCUS 目标:%s 78 #NEXUS 连接 79 #SCIENCEREPORT_EXTINCT %s (灭绝) 80 #MODELDRAFT 新部队研发 (%s) 81 #TAXRATE 税收 82 82 #MONEYGAINPOS +%d%%c 83 83 #MONEYGAINNEG %d%%c 84 84 #TECHGAIN +%d%%r 85 #TECHWAIT %s (%d »ØºÏ)86 #COSTDIFF1 ÈëÃÅÄѶÈ: -25%87 #COSTDIFF2 ÖмäÄѶÈ: ?88 #COSTDIFF3 ±ä̬ÄѶÈ: +25%85 #TECHWAIT %s (%d 回合) 86 #COSTDIFF1 入门难度: -25% 87 #COSTDIFF2 中间难度: ? 88 #COSTDIFF3 变态难度: +25% 89 89 #NATEXISTS (%s) 90 #CONSCRIPTS Õ÷ļ%s90 #CONSCRIPTS 征募 %s 91 91 #WONDEROF %s (%s) 92 92 #WONDEROWNER (#A) 93 #EXPIRED ( ÒѹýÆÚ)94 #DESTROYED ( Òѱ»»Ù)95 #NOWONDER ÉÐÎÞÆæ¼£½¨³É96 #BUILDORDER ÏÈÑ¡¶¨³ÇÊÐÀàÐÍ£¬ÔÙÉ趨½¨Éè´ÎÐò£º97 #BUILDREST ÉÐδÉ趨´ÎÐòµÄÉèÊ©:98 #ENHANCE %s: %s Ðж¯µã99 #SHIPCOMP ·É´¬×é¼þ100 #SHIPPOW ¶¯Á¦²Õ101 #SHIPHAB ¾Óס²Õ102 #SEARCH ËÑË÷103 #RANMAP Ëæ»úµØͼ93 #EXPIRED (已过期) 94 #DESTROYED (已被毁) 95 #NOWONDER 尚无奇迹建成 96 #BUILDORDER 先选定城市类型,再设定建设次序: 97 #BUILDREST 尚未设定次序的设施: 98 #ENHANCE %s: %s 行动点 99 #SHIPCOMP 飞船组件 100 #SHIPPOW 动力舱 101 #SHIPHAB 居住舱 102 #SEARCH 搜索 103 #RANMAP 随机地图 104 104 #TWOTERRAINS %s / %s 105 #MPMAP ¶àÈËģʽ106 #NOGAMES ÉÐÎÞ½ø¶È107 #AIT_ROUND µÚ%d»ØºÏ,105 #MPMAP 多人模式 106 #NOGAMES 尚无进度 107 #AIT_ROUND 第%d回合, 108 108 109 109 'Dialog Titles 110 #TITLE_TRIBE Ñ¡ÔñÖÖ×å111 #TITLE_GOV Ñ¡ÔñÕþ¸®112 #TITLE_TECHSELECT ÇëÖ¸¶¨¿ÆÑÐÏîÄ¿(°´×¡Shiftµ¥»÷¿´°ïÖú)113 #TITLE_FARTECH ÇëÉ趨¿ÆÑÐÄ¿±ê114 #TITLE_CITIES #A ³ÇÊÐ115 #TITLE_EVENTS ÔÚ%s·¢Éúʼþ116 #TITLE_MODELS #A ²¿¶Ó117 #TITLE_DIAGRAMS Àúʷͼ±í118 #TITLE_SHIPS Ö³Ãñ·É´¬119 #TITLE_SHIP #A Ö³Ãñ·É´¬120 #TITLE_EMODELS ÆäËûÊÆÁ¦Ñз¢²¿¶Ó121 #TITLE_EDEFENSE ³ÇÊзÀÓù122 #TITLE_RATES ¾¼Ã123 #TITLE_DRAFT ²¿¶ÓÑз¢124 #TITLE_WONDERS ÊÀ½çÆæ¼£125 #TITLE_ENHANCE µØÐθÄÔì126 #TITLE_CITYTYPES ³ÇÊÐÀàÐÍ127 #TITLE_PROJECT ÇëÖ¸¶¨Òª½¨ÉèµÄµ¥Î»128 #TITLE_CITYNAME ³ÇÊÐÃû³Æ129 #TITLE_MODELNAME ÐÂÐͲ¿¶ÓÃû³Æ130 #TITLE_ERROR ´íÎó131 #TITLE_SCIENCE ¿Æ¼¼±¨¸æ132 #TITLE_OFFERDELIVER Ìí¼ÓÌáÒé133 #TITLE_OFFERCOST Ìí¼ÓÐèÇó134 #TITLE_NUMBER Êý×Ö135 #TITLE_AMOUNT ÊýÁ¿136 #TITLE_CHOOSETECH Ñ¡Ôñ¿Æ¼¼137 #TITLE_CHOOSEMODEL Ñ¡ÔñÉè¼Æµ¥Î»138 #TITLE_CHOOSESHIPPART Ñ¡ÔñÀà±ð139 #TITLE_CHOOSECITY Ñ¡Ôñ³ÇÊÐ140 #TITLE_BOOKNAME ÓÎÏ·Ãû³Æ141 #TITLE_MAPNAME µØͼÃû³Æ110 #TITLE_TRIBE 选择种族 111 #TITLE_GOV 选择政府 112 #TITLE_TECHSELECT 请指定科研项目(按住Shift单击看帮助) 113 #TITLE_FARTECH 请设定科研目标 114 #TITLE_CITIES #A城市 115 #TITLE_EVENTS 在%s发生事件 116 #TITLE_MODELS #A部队 117 #TITLE_DIAGRAMS 历史图表 118 #TITLE_SHIPS 殖民飞船 119 #TITLE_SHIP #A 殖民飞船 120 #TITLE_EMODELS 其他势力研发部队 121 #TITLE_EDEFENSE 城市防御 122 #TITLE_RATES 经济 123 #TITLE_DRAFT 部队研发 124 #TITLE_WONDERS 世界奇迹 125 #TITLE_ENHANCE 地形改造 126 #TITLE_CITYTYPES 城市类型 127 #TITLE_PROJECT 请指定要建设的单位 128 #TITLE_CITYNAME 城市名称 129 #TITLE_MODELNAME 新型部队名称 130 #TITLE_ERROR 错误 131 #TITLE_SCIENCE 科技报告 132 #TITLE_OFFERDELIVER 添加提议 133 #TITLE_OFFERCOST 添加需求 134 #TITLE_NUMBER 数字 135 #TITLE_AMOUNT 数量 136 #TITLE_CHOOSETECH 选择科技 137 #TITLE_CHOOSEMODEL 选择设计单位 138 #TITLE_CHOOSESHIPPART 选择类别 139 #TITLE_CHOOSECITY 选择城市 140 #TITLE_BOOKNAME 游戏名称 141 #TITLE_MAPNAME 地图名称 142 142 #TITLE_NATION #N 143 #TITLE_SPYMISSION ÃØÃÜÐж¯ 144 #TITLE_SUICIDE ×ÔɱÐж¯ 145 #FRMILREP ¾üʱ¨¸æ 143 #TITLE_SPYMISSION 秘密行动 144 #TITLE_SUICIDE 自杀行动 145 #TITLE_MESSAGE Message 146 #FRMILREP 军事报告 146 147 147 148 'Message Text 148 #NOALTAI δ°²×°ÈκÎAIÄ£¿é.\Çëµ½ÓÎÏ·¹Ù·½ÍøÕ¾ÏÂÔØÏà¹ØAIÄ£¿é, »ò×ÔÐд´½¨AIÄ£¿é149 #REVOLUTION ÔÚ½¨Á¢ÐÂÕþÌå֮ǰ, #aµÛ¹ú½«´¦ÓÚÎÞÕþ¸®×´Ì¬, ÕâÊǸïÃüÇ°±Ø¾µÄÕóÍ´, ÊÇ·ñÈ·¶¨¸ïÃü?150 #AUTOREVOLUTION ÐÂÕþÌåÒѾÍê³É: \%s\\ΪÁËת»»ÖÁ¸ÃÕþÌå,±ØÐë·ÏÆúµ±Ç°µÄÕþÌåÐÎʽ, ¾ÀúÒ»¶ÎÎÞÕþ¸®Ê±ÆÚ. ÊÇ·ñ¿ªÊ¼¸ïÃü?151 #NOALTGOVS ·¢¶¯Ò»³¡¸ïÃü, ¿ÉÒÔ½«µ±Ç°µÄÕþÌå ¸ü»»ÎªÆäËûÕþÌå. µ«Ä¿Ç°ÎÒÃÇÖ»ÓµÓÐ Å«Á¥×¨ÖÆÒ»ÖÖÕþÌåÐÎʽ, ÎÞ·¨¸ü»»ÐµÄÕþÌå.152 #AGE0 = %s =\ ʯÆ÷ʱ´úÒѽüβÉù, ΪÁË¿Ë·þÓÎÄÁÉú»îµÄ²»±ã, ÎÒÃǾö¶¨ÔÚÕâƬÎÖÍÁ ÉϽ¨Á¢×Ô¼ºµÄ¼ÒÔ°, ÓÀ¾Ã¶¨¾ÓÓÚ´Ë, ²¢¶¨ÃûΪ%s.153 #AGE1 = %s =\ ǧ°ÙÄêÀ´, ͳÖνײãΪÁ˽ôÎÕÌØȨ, ¹ØÓÚÕâ¸öÊÀ½çµÄ֪ʶ Ò»Ö±ÓÉ×Ú×峤ÀÏ´«ÊÚÖ§Åä. ÏÖÔÚÒ»Çж¼ÒѸıä. ÓÉ×Ú½ÌÐÅÑöÃè»æµÄ¾ÉÊÀ½ç¹Û, Òѱ»¾ÑéºÍÀíÐÔ֪ʶȡ´ú, Õâ¾ÍÊÇ×î³õµÄ"¿Æѧ"154 #AGE2 = %s =\ ´ó¹æÄ£Éú²úµÄ³öÏÖ, ʹµÃ×Ô¹ÅÒÔÀ´È¨¹óÖ÷ÔײƸ»µÄ¹æÂÉ\±»³¹µ×´òÆÆ. Éú²úµÄÃÈÑ¿ËÄ´¦¿ª»¨, ¼±ËÙÀ©ÕŵÄÊг¡½«\´óÁ¿Ãñ¼ä×ʽð¾¡ÊýÄÉÈëÍøÖÐ. Ò»¸öÈ«ÐÂʱ´ú¾Í´Ëµ®Éú.155 #AGE3 = %s =\ ÈËÀà¹ÅÀϵÄÃÎÏëÖÕÓÚ³ÉΪÏÖʵ. \ÎÒÃÇÏÖÔڵļ¼ÊõÒѾ¿ÉÒÔ\½«ÒÆÃñËÍÍùÒ£Ô¶µÄÌìÍâÐÇÇò. \Ñо¿±íÃ÷, ´ËÏîºêΰÏîÄ¿Íê³ÉµÄ¹Ø¼ü\ÊÇÌØÖÖ½ðÊô×ÊÔ´µÄ¿ª·ÅÀûÓÃ.156 #ENDTURN ±¾»ØºÏËùÓв¿¶Ó¶¼ÒѽáÊøÐж¯.\ÇëÑ¡Ôñ½áÊø»ØºÏ, ½øÈëÏÂÒ»»ØºÏ.157 #CREDUP ÎÒ¹úµÄÐÅÓÃÒÑÉý¼¶Îª"%s".158 #CREDDOWN ÎÒ¹úµÄÐÅÓÃÒѽµ¼¶Îª"%s".159 #FOREIGNCITY ×î½üËùÖªÁ¥Êô¹ú:\#N\(×î½üÇ鱨»ñÈ¡ÓÚ%s)160 #EXTINCTCITY ×î½üËùÖªÁ¥Êô¹ú:\Ãð¾ø\(×î½üÇ鱨»ñÈ¡ÓÚ%s)161 #CAPTURE #N Õ¼ÁìÁË%s!162 #BOMBARD #N ÕýÔÚºäÕ¨²»Éè·ÀµÄ%s!163 #EXPEL #a ÁìÍÁÉϵÄÆäËûÊÆÁ¦²¿¶ÓÒѱ»ÇýÖð.164 #DISPOSE %s\\ ½«´Ë½¨ÖþÍƵ¹Öؽ¨£¿165 #SPDESTRUCTQUERY \( ×¢Òâ: Èç¹û²ð³ýÌ«¿Õ¸Û, ´ËµØµÄÖ³Ãñ·É´¬ÏîÄ¿½«±»·Ï³ý!)166 #SELL %s\\ ½«´Ë½¨Öþ±äÂôÌ×ÏÖ£¿167 #LOSEMAT ÈôÍêÈ«¸ü¸Ä½¨ÉèÀàÐÍ, µ±Ç°½¨ÉèÖеÄÏîÄ¿½«±»±äÂô. %d%%p µÄ±äÂô¼Û¸ñΪ%d%%c.168 #LOSEMAT3 ÈôÒª¸ü¸ÄΪͬÀàÐ͵ÄÆäËû½¨ÉèÏîÄ¿, ½«Ëðʧ1/3µÄ½¨Éè½ø¶È. ÊÇ·ñ¼ÌÐø?169 #DOUBLESTATEIMP %s\\%s Òѽ¨ÓдËÏî³ÇÊÐÉèÊ©. ÊÇ·ñ½«ÔÚµ±Ç°µÄ³ÇÊÐÖؽ¨¸ÃÉèÊ©, ½¨³Éºó±äÂôÔÓеÄͬÃûÉèÊ©?170 #READY ¸Ã½¨É轫ÔÚÏ»غϿªÊ¼Ê±Íê³É171 #NOMONEY ÏÖÓнðÇ®²»×ã,\ÎÞ·¨ÌáÇ°Í깤.\(ÐèÒª%d%%c, ÏÖÓÐ%d%%c)172 #BUY Ö§¸¶%d%%c, ÈôËÏîÄ¿ÔÚÏ»غÏÍ깤?173 #EMIGRATE ¼ÌÐøÕ÷ļÒÆÃñ²¿¶Ó, ÓпÉÄܵ¼Ö±¾³ÇÊлķÏ. ÊÇ·ñÔÝ»ºÕ÷ļ¼Æ»®, µÈµ½³ÇÊÐÈË¿ÚÔö³¤µ½ Ò»¶¨¹æÄ£ºóÔÙÐÐÕ÷ļ?174 #ADDTOMAXSIZE ´Ë³ÇÊеĹæÄ£ÒÑ´ïÉÏÏÞ.175 #CITYMANAGEOFF È¡Ïû³ÇÊÐ×ÊÔ´µÄ×Ô¶¯·ÖÅä?176 #GLIDERLOST ÎÒ·½»¬Ïè»úÔÚº£Ãæ×¹»Ù177 #PLANELOST ÎÒ·½·É»úȼÓͺľ¡178 #DAMAGED_UTILIZE Õû±àÊÜËðµÄ²¿¶Ó,Ëù»ñЧ¹û½«ÏàÓ¦½µµÍ. ÊÇ·ñ¼ÌÐø?179 #NOBB ÎÒÃÇÉÐδÕÆÎÕÔÚºÓÁ÷ÉϴÇÅÁºµÄ¿Æ¼¼180 #NOCITY ´ËµØÐβ»Êʺ϶¨¾Ó½¨³Ç. ÁíÃÙÒ»¿é¿É¹à¸ÈµÄÍÁµØ¶¨¾Ó°É.181 #NOCAPTURER ƽÃñµ¥Î»ÎÞ·¨Õ¼ÁìÆäËûÊÆÁ¦µÄ³ÇÊÐ.182 #NOBOMBARDER ûÓÐЯ´øÎäÆ÷, ²»ÄܺäÕ¨³ÇÊÐ.183 #ZOC ¸Ã²¿¶Ó²»ÄÜÔڵз½¿ØÖƵĵØÇøËæÒâÒƶ¯.184 #FASTATTACK ÒÔ%d%%µÄÁ¦Á¿¹¥»÷Ä¿±êô£¿185 #NOTIMELOADGROUND ¸Ã²¿¶ÓËùÊ£Ðж¯µã²»×ã%s, ÎÞ·¨Íê³É×°ÔË/жÔË.186 #NOTIMELOADAIR ¸Ã·É»úËùÊ£Ðж¯µã²»×ã100, ÎÞ·¨ÔÚĸ½¢ÉÏÆð½µ.187 #NOTIMEBOMBARD ºäÕ¨³ÇÊÐÐèÒª100Ðж¯µã.188 #NOTIMEEXPEL ¸Ã²¿¶ÓËùÊ£Ðж¯µã²»×ã100, ÎÞ·¨ÇýÖð.189 #NOROAD ¸Ã²¿¶ÓÖ»ÄÜÑØ×ŵÀ·»òÌú·Òƶ¯.190 #NONAV ¸Ã´¬Ö»Ã»ÓÐÔ¶Ñóº½ÐÐÄÜÁ¦.191 #NOTRANSPORT ¸Ã´¬Ö»Ã»ÓÐÔËÊäÄÜÁ¦.192 #FULLTRANSPORT ¸Ã´¬Ö»µÄÔËÔØ¿Õ¼äÒÑÂú.193 #LOWFUEL Õâ¼Ü·É»úȼÓͼ´½«ºÄ¾¡. Èç¹û¼ÌÐøÇ°ÐÐ, ½«ÎÞ·¨·µº½. ÊÇ·ñ¼ÌÐøÇ°ÐÐ?194 #LOWFUEL_GLIDER Õâ¼Ü»¬Ïè»ú±ØÐëÔڻغϽáÊøʱ»Øµ½Â½µØ, Èç¹û¼ÌÐøÏòÇ°, ÓÐ×¹»ÙµÄΣÏÕ. ÊÇ·ñ¼ÌÐø?195 #UNREST_FOREIGN %s\\ ÕâÀïÒÑÊÇ#aµÄµØ½ç. Èç¹û¼ÌÐøÏòÇ°, ½«µ¼Ö¸ò¿¶ÓÁ¥Êô³ÇÊеľÓÃñ²»°². ÊÇ·ñ¼ÌÐø?196 #UNREST_NOTOWN %s\\ Èç¹ûÀ뿪#sµÄÁìÍÁ, ½«µ¼Ö¸ò¿¶ÓÁ¥Êô³ÇÊеľÓÃñ²»°². ÊÇ·ñ¼ÌÐø?197 #NOATTACKER ´Ë²¿¶Ó²»ÊǾüʵ¥Î», ÎÞ·¨Õ¹¿ª¹¥»÷.198 #ATTACKSUB ÎÞ·¨È·¶¨µÐ·½Ç±Í§µÄλÖÃ.199 #ATTACKSTEALTH ÎÞ·¨È·¶¨µÐ·½ÒþÐηɻúµÄλÖÃ.200 #PEACE_NOATTACK ÎÒÃÇÓë#nÇ©¶©Á˺ÍÔ¼.201 #PEACE_NOMOVE ÎÒÃÇÓë#nÇ©¶©Á˺ÍÔ¼, ²»ÄܽøÈë¶Ô·½ÁìÍÁ.202 #PEACE_NOWORK ÕâÀïÊÇ#aµÄÁìÍÁ!\ÎÒÃǺ͸ùúÇ©ÓкÍÔ¼, ²»µÃÇÖ·¸.203 #NOFOREIGNINFO δ·¢ÏÖеÄÇ鱨.204 #FOREIGNINFO »ñµÃеÄÇ鱨, ÄÚÈÝÈçÏÂ:205 #DOSSIER_PREPARED ÎÒÃÇ»ñµÃÁË#aµÄ¹ú¼ÒÇ鱨,°üÀ¨#aµÄͳ¼Æͼ±íÒÔ¼°¸Ã¹úµ±Ç°µÄ¿ÆÑб¨¸æ.206 #VIOLATION ÎÒ·½²¿¶ÓÇÖ·¸ÁË#aµÄÁìÍÁ!\#NÒªÇóÎÒÃÇÔÚ%s֮ǰ½«²¿¶Ó³·Àë.207 #EVIOLATION #N ÒòÎ¥·´ºÍÔ¼Ìõ¿îһʠÌØÏòÎÒ·½µÀǸ. ËûÃÇ´ðÓ¦ÔÚ%s֮ǰ³·×ß²¿¶Ó.208 #WITHDRAW ÎÒ·½²¿¶Ó±»ÀÕÁî´Ó#aÁìÍÁÉϳ·Àë.209 #WONDERBUILT #N ½¨³ÉÁËеÄÊÀ½çÆæ¼£:\%s210 #WONDERBUILTEXP ij¹ú½¨³ÉÁËеÄÊÀ½çÆæ¼£:\%s\\µ«ÕâÏîÆæ¼£ÒѾ¹ýʱ, ûÓÐÈκÎÏÖʵÒâÒå.211 #WONDERBUILTOWN ÎÒ¹ú½¨³ÉÁËеÄÊÀ½çÆæ¼£:\%s212 #WONDERCAPT #N Õ¼ÁìÁËÒ»ÏîÊÀ½çÆæ¼£:\%s213 #WONDERCAPTOWN ÎÒ¹úÕ¼ÁìÁËÒ»ÏîÊÀ½çÆæ¼£:\%s214 #WONDEREXP ÊÀ½çÆæ¼£: %s µÄЧ¹ûÒѲ»¸´´æÔÚ.215 #WONDERDEST Ò»ÏîÊÀ½çÆæ¼£±»´Ý»ÙÁË:\%s216 #COLDWAR ÓÉÓÚºËÕ½µÄÊÀ½çÐÔÍþв, ËùÓÐÊÆÁ¦µÄÍâ½»Á¢³¡±äµÃÄÑÒÔ¶¯Ò¡, ½»ÉæÒѲ»ÔÙÓÐЧ. È«ÇòÀäÕ½¿ªÊ¼ÁË.217 #COLDWAREND ÀäÕ½½áÊøÁË.218 #SHIPBUILT #N ¸ÕÍê³ÉÁËÖ³Ãñ·É´¬µÄij²¿¼þÉú²ú.219 #SHIPBITRADE1 #S ºÍ220 #SHIPBITRADE2 #s ½»»»Á˸÷×ÔµÄÖ³Ãñ·É´¬²¿¼þ.221 #SHIPUNITRADE1 #N ´Ó #s ´¦»ñµÃÁË222 #SHIPUNITRADE2 ¼þÖ³Ãñ·É´¬²¿¼þ¡£223 #SHIPCAPTURE1 #N ¶áÈ¡ÁË224 #SHIPCAPTURE2 #a µÄÖ³Ãñ·É´¬²¿¼þ!225 #SHIPDESTROYED #N µÄÖ³Ãñ·É´¬ÏîÄ¿±»·Ï³ýÁË226 #LOWFUNDS ¹ú¿âÒѽü¿Ý½ß, Èç¹û²»¾¡¿ì²ÉÈ¡´ëÊ©, ÎÒÃÇÖ»ÄÜ¿¿±äÂô³ÇÊÐÉèÊ©¶ÈÈÕ.\ÊÇ·ñ¼ÌÐøÐж¯?227 #DISORDER %s ½«ÏÝÈëɧÂÒ.\ÊÇ·ñ¼ÌÐøÐж¯?228 #DISORDER_UNREST ÓÉÓÚ³ÇÊв»°²ÈË¿Ú±äΪ¶àÊý, %s½«ÏÝÈëÎÞÕþ¸®×´Ì¬.\ÊÇ·ñ¼ÌÐøÐж¯?229 #FAMINE %s Óб¬·¢¼¢»ÄµÄΣÏÕ.\ÊÇ·ñ¼ÌÐøÐж¯?230 #FAMINE_TILES %s Óб¬·¢¼¢»ÄµÄΣÏÕ. ±¾³ÇËùÊôµØ¿é³ö²úµÄÁ¸Ê³²»×ã.\ÊÇ·ñ¼ÌÐøÐж¯?231 #FAMINE_UNREST %s Óб¬·¢¼¢»ÄµÄΣÏÕ. ΪÁË¿ØÖÆÃñÖÚ²»°²ÇéÐ÷, ²¿·ÖÈË¿Ú´Ó×ÊÔ´Éú²úתΪ³ÇÊнäÑϲ¿¶Ó, ´Ë¾Ù´ë½«Ê¹±¾³ÇËùÊôµØ¿é³ö²úµÄÁ¸Ê³²»×ã.\\ÊÇ·ñ¼ÌÐøÐж¯?232 #LOWSUPPORT ÒÔ%sµÄÉú²úˮƽ, ÎÞ·¨±£Ö¤Á¥Êô²¿¶ÓµÄ×îµÍ¹©¸ø.\ÊÇ·ñ¼ÌÐøÐж¯?233 #LOWSUPPORT_TILES ÒÔ%sµÄÉú²úˮƽ, ÎÞ·¨±£Ö¤Á¥Êô²¿¶ÓµÄ×îµÍ¹©¸ø. ±¾³ÇËùÊôµØ¿é³ö²úµÄÔÁϲ»×ã.\ÊÇ·ñ¼ÌÐøÐж¯?234 #LOWSUPPORT_UNREST ÒÔ%sµÄÉú²úˮƽ, ÎÞ·¨±£Ö¤Á¥Êô²¿¶ÓµÄ×îµÍ¹©¸ø. ΪÁË¿ØÖÆÃñÖÚ²»°²ÇéÐ÷, ²¿·ÖÈË¿Ú´Ó×ÊÔ´Éú²úתΪ³ÇÊнäÑϲ¿¶Ó, ´Ë¾Ù´ë½«Ê¹±¾³ÇËùÊôµØ¿é³ö²úµÄÔÁϲ»×ã.\\ÊÇ·ñ¼ÌÐøÐж¯?235 #RESIGN ¼´½«¹Ø±Õ´ËÓÎÏ·.\ÊÇ·ñ±£´æµ±Ç°µÄ½ø¶È?236 #ENDTOUR ÊÇ·ñ±£´æ½ø¶È, ÒÔ±ã½ñºóÔÚ³¬¼¶Óû§Ä£Ê½ÖÐÖØдò¿ª?237 #MODELAVAILABLE в¿¶ÓÑз¢³É¹¦, ¿ÉËæʱͶÈëÉú²ú.238 #RESEARCH_GENERAL ÎÒ·½×îпÆÑгɹû£º%s£¡239 #GRLIB_GENERAL ´Ó´óͼÊé¹ÝÖУ¬ÎÒÃÇ»ñµÃÁË %s µÄ֪ʶ£¡240 #ORACLEINCOME ÊÕÈë: %d%%c241 #NOSELLAGAIN %s\\ Ò»»ØºÏÄÚ£¬Ã¿×ù³ÇÊÐÖ»ÄܱäÂô »òÖؽ¨Ò»ÖÖ½¨Öþ242 #OUTOFCONTROL %s\\ Õâ×ù³ÇÊÐÉÐδ»Ö¸´Õý³£ÖÈÐò243 #NOCHANGEINANARCHY ÎÒ¹úÕý´¦ÓÚÎÞÕþ¸®×´Ì¬£¬ËùÓгÇÊн¨ÖþÔÝʱʧЧ.244 #EXTINCT = %s =\#n µÛ¹ú»ÙÃðÁË, ËûÃǵĹâ»ÔÎÄÃ÷ ´Ó´Ë±»·â´æÔÚ´«ËµÖÐ.245 #EXTINCTALL \\ ÎÒÃdzÉΪµØÇòÉÏΨһÁô´æµÄÎÄÃ÷246 #GAMEOVER #N ËùÓгÇÊж¼ÒÑʧÊØ\\ÓÎÏ·½áÊø247 #TIMEUP ÓÎϷʱ¼äµ½.\¾¡¹Ü#n¾¼Ã·±ÈÙ, ¿Æ¼¼ÁìÏÈ, ÔÚÊÀ½ç¸÷¹úÖÐÈ¡µÃÁËÒ»¶¨µÄÓ°Ïì, µ«ÖÕ¾¿Ã»ÄÜÕÆÎÕÖÕ¼«ÎÄÃ÷.\\ÓÎÏ·½áÊø248 #TIMEUPSUPER ÓÎϷʱ¼äµ½.\ûÓÐÒ»¸ö¹ú¼ÒÍê³ÉÖ³Ãñ·É´¬µÄ½¨Éè.249 #SPACESHIP1 #N µÄÖ³Ãñ·É´¬ÒÑ·¢ÉäÉý¿Õ.\250 #SPACESHIP2 ÐǼÊÖ³Ãñ¼Æ»®µÄ³É¹¦, Ó¡Ö¤Á˸ùúÎÄÃ÷µÄÈ«ÃæÁìÏÈÓÅÊÆ.\\ÓÎÏ·½áÊø251 #MYSPACESHIP Àú¾ÎÞÊýµÄƶÇîÔÖÄÑ, ÎÞÊýµÄÁ÷ѪÎþÉü, ÎÞÊýµÄʱ´ú¸üµü, ÈËÀà¹ÅÀϵÄÃÎÏëÖÕÓÚÔÚÎÒÃÇÊÖÖбäΪÏÖʵ. ÎÒÃǵķɴ¬Ïò×ÅÌ«¿ÕÖÐδ֪µÄÊÀ½ç·ÉÈ¥, Ϊºó´úµÄÉú»îÑ°ÕÒȫеļÒÔ°.\\¹§Ï²Ó®µÃÓÎϷʤÀû252 #SHAREDWIN ( Óë %s ¹²ÏíʤÀû)149 #NOALTAI 未安装任何AI模块.\请到游戏官方网站下载相关AI模块, 或自行创建AI模块 150 #REVOLUTION 在建立新政体之前, #a帝国将处于无政府状态, 这是革命前必经的阵痛, 是否确定革命? 151 #AUTOREVOLUTION 新政体已经完成: \%s\\为了转换至该政体,必须废弃当前的政体形式, 经历一段无政府时期. 是否开始革命? 152 #NOALTGOVS 发动一场革命, 可以将当前的政体 更换为其他政体. 但目前我们只拥有 奴隶专制一种政体形式, 无法更换新的政体. 153 #AGE0 = %s =\石器时代已近尾声, 为了克服游牧生活的不便, 我们决定在这片沃土 上建立自己的家园, 永久定居于此, 并定名为%s. 154 #AGE1 = %s =\千百年来, 统治阶层为了紧握特权, 关于这个世界的知识 一直由宗族长老传授支配. 现在一切都已改变. 由宗教信仰描绘的旧世界观, 已被经验和理性知识取代, 这就是最初的"科学" 155 #AGE2 = %s =\大规模生产的出现, 使得自古以来权贵主宰财富的规律\被彻底打破. 生产的萌芽四处开花, 急速扩张的市场将\大量民间资金尽数纳入网中. 一个全新时代就此诞生. 156 #AGE3 = %s =\人类古老的梦想终于成为现实. \我们现在的技术已经可以\将移民送往遥远的天外星球. \研究表明, 此项宏伟项目完成的关键\是特种金属资源的开放利用. 157 #ENDTURN 本回合所有部队都已结束行动.\请选择结束回合, 进入下一回合. 158 #CREDUP 我国的信用已升级为 "%s". 159 #CREDDOWN 我国的信用已降级为 "%s". 160 #FOREIGNCITY 最近所知隶属国:\#N\(最近情报获取于%s) 161 #EXTINCTCITY 最近所知隶属国:\灭绝\(最近情报获取于%s) 162 #CAPTURE #N占领了%s! 163 #BOMBARD #N正在轰炸不设防的%s! 164 #EXPEL #a领土上的其他势力部队已被驱逐. 165 #DISPOSE %s\\将此建筑推倒重建? 166 #SPDESTRUCTQUERY \(注意: 如果拆除太空港, 此地的殖民飞船项目将被废除!) 167 #SELL %s\\将此建筑变卖套现? 168 #LOSEMAT 若完全更改建设类型, 当前建设中的项目将被变卖. %d%%p 的变卖价格为 %d%%c. 169 #LOSEMAT3 若要更改为同类型的其他建设项目, 将损失1/3的建设进度. 是否继续? 170 #DOUBLESTATEIMP %s\\%s已建有此项城市设施. 是否将在当前的城市重建该设施, 建成后变卖原有的同名设施? 171 #READY 该建设将在下回合开始时完成 172 #NOMONEY 现有金钱不足,\无法提前完工.\(需要%d%%c, 现有%d%%c) 173 #BUY 支付%d%%c, 让此项目在下回合完工? 174 #EMIGRATE 继续征募移民部队, 有可能导致本城市荒废. 是否暂缓征募计划, 等到城市人口增长到 一定规模后再行征募? 175 #ADDTOMAXSIZE 此城市的规模已达上限. 176 #CITYMANAGEOFF 取消城市资源的自动分配? 177 #GLIDERLOST 我方滑翔机在海面坠毁 178 #PLANELOST 我方飞机燃油耗尽 179 #DAMAGED_UTILIZE 整编受损的部队,所获效果将相应降低. 是否继续? 180 #NOBB 我们尚未掌握在河流上搭建桥梁的科技 181 #NOCITY 此地形不适合定居建城. 另觅一块可灌溉的土地定居吧. 182 #NOCAPTURER 平民单位无法占领其他势力的城市. 183 #NOBOMBARDER 没有携带武器, 不能轰炸城市. 184 #ZOC 该部队不能在敌方控制的地区随意移动. 185 #FASTATTACK 以%d%%的力量攻击目标么? 186 #NOTIMELOADGROUND 该部队所剩行动点不足%s, 无法完成装运/卸运. 187 #NOTIMELOADAIR 该飞机所剩行动点不足100, 无法在母舰上起降. 188 #NOTIMEBOMBARD 轰炸城市需要100行动点. 189 #NOTIMEEXPEL 该部队所剩行动点不足100, 无法驱逐. 190 #NOROAD 该部队只能沿着道路或铁路移动. 191 #NONAV 该船只没有远洋航行能力. 192 #NOTRANSPORT 该船只没有运输能力. 193 #FULLTRANSPORT 该船只的运载空间已满. 194 #LOWFUEL 这架飞机燃油即将耗尽. 如果继续前行, 将无法返航. 是否继续前行? 195 #LOWFUEL_GLIDER 这架滑翔机必须在回合结束时回到陆地, 如果继续向前, 有坠毁的危险. 是否继续? 196 #UNREST_FOREIGN %s\\这里已是#a的地界. 如果继续向前, 将导致该部队隶属城市的居民不安. 是否继续? 197 #UNREST_NOTOWN %s\\如果离开#s的领土, 将导致该部队隶属城市的居民不安. 是否继续? 198 #NOATTACKER 此部队不是军事单位, 无法展开攻击. 199 #ATTACKSUB 无法确定敌方潜艇的位置. 200 #ATTACKSTEALTH 无法确定敌方隐形飞机的位置. 201 #PEACE_NOATTACK 我们与#n签订了和约. 202 #PEACE_NOMOVE 我们与#n签订了和约, 不能进入对方领土. 203 #PEACE_NOWORK 这里是#a的领土!\我们和该国签有和约, 不得侵犯. 204 #NOFOREIGNINFO 未发现新的情报. 205 #FOREIGNINFO 获得新的情报, 内容如下: 206 #DOSSIER_PREPARED 我们获得了#a的国家情报,包括#a的统计图表以及该国当前的科研报告. 207 #VIOLATION 我方部队侵犯了#a的领土!\#N要求我们在%s之前将部队撤离. 208 #EVIOLATION #N因违反和约条款一事 特向我方道歉. 他们答应在%s之前撤走部队. 209 #WITHDRAW 我方部队被勒令从#a领土上撤离. 210 #WONDERBUILT #N建成了新的世界奇迹:\%s 211 #WONDERBUILTEXP 某国建成了新的世界奇迹:\%s\\但这项奇迹已经过时, 没有任何现实意义. 212 #WONDERBUILTOWN 我国建成了新的世界奇迹:\%s 213 #WONDERCAPT #N占领了一项世界奇迹:\%s 214 #WONDERCAPTOWN 我国占领了一项世界奇迹:\%s 215 #WONDEREXP 世界奇迹: %s 的效果已不复存在. 216 #WONDERDEST 一项世界奇迹被摧毁了:\%s 217 #COLDWAR 由于核战的世界性威胁, 所有势力的外交立场变得难以动摇, 交涉已不再有效. 全球冷战开始了. 218 #COLDWAREND 冷战结束了. 219 #SHIPBUILT #N刚完成了殖民飞船的某部件生产. 220 #SHIPBITRADE1 #S 和 221 #SHIPBITRADE2 #s 交换了各自的殖民飞船部件. 222 #SHIPUNITRADE1 #N 从 #s 处获得了 223 #SHIPUNITRADE2 件殖民飞船部件。 224 #SHIPCAPTURE1 #N夺取了 225 #SHIPCAPTURE2 #a的殖民飞船部件! 226 #SHIPDESTROYED #N的殖民飞船项目被废除了 227 #LOWFUNDS 国库已近枯竭, 如果不尽快采取措施, 我们只能靠变卖城市设施度日.\是否继续行动? 228 #DISORDER %s将陷入骚乱.\是否继续行动? 229 #DISORDER_UNREST 由于城市不安人口变为多数, %s将陷入无政府状态.\是否继续行动? 230 #FAMINE %s有爆发饥荒的危险.\是否继续行动? 231 #FAMINE_TILES %s有爆发饥荒的危险. 本城所属地块出产的粮食不足.\是否继续行动? 232 #FAMINE_UNREST %s有爆发饥荒的危险. 为了控制民众不安情绪, 部分人口从资源生产转为城市戒严部队, 此举措将使本城所属地块出产的粮食不足.\\是否继续行动? 233 #LOWSUPPORT 以%s的生产水平, 无法保证隶属部队的最低供给.\是否继续行动? 234 #LOWSUPPORT_TILES 以%s的生产水平, 无法保证隶属部队的最低供给. 本城所属地块出产的原料不足.\是否继续行动? 235 #LOWSUPPORT_UNREST 以%s的生产水平, 无法保证隶属部队的最低供给. 为了控制民众不安情绪, 部分人口从资源生产转为城市戒严部队, 此举措将使本城所属地块出产的原料不足.\\是否继续行动? 236 #RESIGN 即将关闭此游戏.\是否保存当前的进度? 237 #ENDTOUR 是否保存进度, 以便今后在超级用户模式中重新打开? 238 #MODELAVAILABLE 新部队研发成功, 可随时投入生产. 239 #RESEARCH_GENERAL 我方最新科研成果:%s! 240 #GRLIB_GENERAL 从大图书馆中,我们获得了 %s 的知识! 241 #ORACLEINCOME 收入: %d%%c 242 #NOSELLAGAIN %s\\一回合内,每座城市只能变卖 或重建一种建筑 243 #OUTOFCONTROL %s\\这座城市尚未恢复正常秩序 244 #NOCHANGEINANARCHY 我国正处于无政府状态,所有城市建筑暂时失效. 245 #EXTINCT = %s =\#n帝国毁灭了, 他们的光辉文明 从此被封存在传说中. 246 #EXTINCTALL \\我们成为地球上唯一留存的文明 247 #GAMEOVER #N 所有城市都已失守\\游戏结束 248 #TIMEUP 游戏时间到.\尽管#n经济繁荣, 科技领先, 在世界各国中取得了一定的影响, 但终究没能掌握终极文明.\\游戏结束 249 #TIMEUPSUPER 游戏时间到.\没有一个国家完成殖民飞船的建设. 250 #SPACESHIP1 #N的殖民飞船已发射升空.\ 251 #SPACESHIP2 星际殖民计划的成功, 印证了该国文明的全面领先优势.\\游戏结束 252 #MYSPACESHIP 历经无数的贫穷灾难, 无数的流血牺牲, 无数的时代更迭, 人类古老的梦想终于在我们手中变为现实. 我们的飞船向着太空中未知的世界飞去, 为后代的生活寻找全新的家园.\\恭喜赢得游戏胜利 253 #SHAREDWIN (与 %s 共享胜利) 253 254 #SHAREDWIN_CONCAT %s, %s 254 #NOAI δ·¢ÏÖ°²×°µÄAI²å¼þ£¡255 #FILENOTFOUND δ·¢ÏÖÃûΪ "%s" µÄÎļþ.256 #AIEXCEPTION AI ²å¼þ%sÖгöÏÖÑÏÖØ´íÎó£¡257 #LOADERR ´ËÓÎÏ·½ø¶ÈÓ뵱ǰµÄÓÎÏ·°æ±¾²»ÄܼæÈÝ258 #NOFILENAME ÎÞЧµÄÓÎÏ·½ø¶ÈÃû; ²»ÔÊÐí³öÏÖ×Ö·û'%s'259 #DLLERROR %s ÎÞ·¨¶ÁÈ¡260 #AIERROR δ·¢ÏÖÒÔ %s ΪÃûµÄAI²å¼þ261 #MISSDEACT Íæ¼Ò%dÒì³£Í˳ö, ÖÐÖ¹ÁËÓÎÏ·262 #CLIENTERROR ÎÞ·¨ÕÒµ½Óû§%s263 #LOADERROR ¸ÃÓÎÏ·½ø¶È´æÔÚÄÚ²¿´íÎó, ¿ÉÄÜÎÞ·¨Õý³£½øÐÐÓÎÏ·.\\¿É½«´Ë½ø¶È·¢Ë͸øÉè¼ÆÕß, Éϱ¨´íÎó.\ÊÇ·ñµÇ½ÍøÕ¾, ·¢ËÍ´íÎó·´À¡ÐÅÏ¢?264 #NOSTARTPOS ¸ÃµØͼ䶨ÒåÍæ¼ÒÆðʼλÖÃ, ÎÞ·¨ÓÃÆä½øÐÐÓÎÏ·.265 #TOOFEWTRIBES ¾ºÕù¶ÔÊÖµÄÊýÄ¿²»µÃ³¬¹ýÓÎÏ·Öж¨ÒåµÄ¹ú¼ÒÊýÁ¿.266 #DELETEQUERY ÓÎÏ·½ø¶ÈÒÑɾ³ý267 #MAPDELETEQUERY µØͼÒÑɾ³ý255 #NOAI 未发现安装的AI插件! 256 #FILENOTFOUND 未发现名为 "%s" 的文件. 257 #AIEXCEPTION AI插件%s中出现严重错误! 258 #LOADERR 此游戏进度与当前的游戏版本不能兼容 259 #NOFILENAME 无效的游戏进度名; 不允许出现字符'%s' 260 #DLLERROR %s 无法读取 261 #AIERROR 未发现以 %s 为名的AI插件 262 #MISSDEACT 玩家%d异常退出, 中止了游戏 263 #CLIENTERROR 无法找到用户%s 264 #LOADERROR 该游戏进度存在内部错误, 可能无法正常进行游戏.\\可将此进度发送给设计者, 上报错误.\是否登陆网站, 发送错误反馈信息? 265 #NOSTARTPOS 该地图未定义玩家起始位置, 无法用其进行游戏. 266 #TOOFEWTRIBES 竞争对手的数目不得超过游戏中定义的国家数量. 267 #DELETEQUERY 游戏进度已删除 268 #MAPDELETEQUERY 地图已删除 268 269 #TURN #N\%s 269 #SUPERTURN ³¬¼¶Óû§\%s270 #FRNEWNATION ÎÒÃÇÒÑͬ#n½¨Á¢ÁËÍâ½»ÁªÏµ.271 #FRCONTACT #n µÄʹ½ÚÏëêî¼û´óÈË.\ÊÇ·ñ½Ó¼û?272 #FRREJECTED #N ²»Ô¸½Ó¼ûÎÒ·½Ê¹½Ú.273 #FRCANCELQUERY_CEASEFIRE ˺»ÙÍ£»ðÌõÔ¼?274 #FRCANCELQUERY_PEACE Ïò¶Ô·½Ðûսô£¿275 #FRCANCELQUERY_FRIENDLY ÖÕÖ¹Óë¶Ô·½µÄºÍƽÌõÔ¼?276 #FRCANCELQUERY_ALLIANCE ÖÕÖ¹Óë¶Ô·½µÄÃËÔ¼?277 #FRCANCELBYREJECT_PEACE # ʹ½Ú:\ÎÒÃǵÄÄÍÐÄÒѾºÄ¾¡.\×¼±¸ÓÕ½°É!278 #FRCANCELBYREJECT_FRIENDLY # ʹ½Ú:\´Ó½ñÈÕÆð, ºÍƽÌõÔ¼Òѱä³ÉÒ»Ö½¿ÕÎÄ!279 #FRCANCELBYREJECT_ALLIANCE # ʹ½Ú:\¼ÈÈ»Äã·½²»¿ÏºÏ×÷, ÄÇÎÒÃǵÄÃËÔ¼Ò²ÎÞ·¨¼ÌÐøÁË. ÊÇÄãÈÃÎÒÃÇûÁËÑ¡ÔñµÄ.280 #FRMYALLIANCE1 #N ÒÑÏòÎÒ·½ÃËÓÑ¿ªÕ½, ÐûÕ½¶ÔÏóΪ281 #FRMYALLIANCE2 #n. ÎÒÃÇ¿ÉÒÔÑ¡ÔñÖ§³Ö#a, ·´¶ÔÒ°ÂùµÄÕ½ÕùÐÐΪ.282 #FRENEMYALLIANCE #N ¾ö¶¨Ö§³ÖÆäÃËÓÑ, ¼ÓÈëÓëÎÒ·½µÄÕ½Õù. ÎÒ·½ÏÈÇ°Óë#NµÄÌõÔ¼×Ô¶¯Ê§Ð§.283 #FRANARCHY #a ´¦ÓÚÎÞÕþ¸®×´Ì¬, ÎÒ·½Ê¹½ÚÕÒ²»µ½Í¾¾¶Óë¶Ô·½µ±¾Ö½Ó´¥.284 #FRMYANARCHY ÎÒÃÇÕý´¦ÓÚÎÞÕþ¸®×´Ì¬, ±ØÐëµÈµ½¾ÖÊÆÎȶ¨ºó, ²ÅÄÜ¿ªÕ¹Íâ½»»î¶¯.285 #FRCOLDWAR Ä¿Ç°´¦ÓÚÀäÕ½ÆÚ, ÎÞ·¨ÓëÆäËûÊÆÁ¦½»Éæ.286 #MAX2WANTS Ò»»ØºÏ½»ÉæÖÐ×î¶àÌá³öÁ½ÏîÒªÇó.287 #MAX2OFFERS Ò»»ØºÏ½»ÉæÖÐ×î¶à¸ø³öÁ½ÏîÌáÒé.288 #NOOFFER ¸ÃÌáÒéÎÞЧ£¡289 #CANCELTREATYRUSH ÔÚ3¸ö»ØºÏÄÚ£¬Óëͬһ¹ú¼Ò×î¶àÖÕÖ¹Ò»ÏîÍâ½»ÐÒé.290 #NOSPACEPORT ÎÒ·½Ã»ÓÐÌ«¿Õ¸Û, ÎÞ·¨Õý³£½ÓÊÕ¶Ô·½µÄ·É´¬²¿¼þ, ÊÇ·ñÖ´Òâ½ÓÊÕ?291 #SUICIDE ÈÃÕâЩ¿ÉÁ¯µÄ¼Ò»ï\̤ÉÏ»ÆȪ²»¹é·?292 #RATES ÇëÖƶ¨¹úÃñ¾¼ÃµÄ·ÖÅä±ÈÀý293 #NORATES ×ÔÓÉÅ®ÉñÏñ\ÒѾÉúЧ.270 #SUPERTURN 超级用户\%s 271 #FRNEWNATION 我们已同#n建立了外交联系. 272 #FRCONTACT #n的使节想觐见大人.\是否接见? 273 #FRREJECTED #N不愿接见我方使节. 274 #FRCANCELQUERY_CEASEFIRE 撕毁停火条约? 275 #FRCANCELQUERY_PEACE 向对方宣战么? 276 #FRCANCELQUERY_FRIENDLY 终止与对方的和平条约? 277 #FRCANCELQUERY_ALLIANCE 终止与对方的盟约? 278 #FRCANCELBYREJECT_PEACE #使节:\我们的耐心已经耗尽.\准备迎战吧! 279 #FRCANCELBYREJECT_FRIENDLY #使节:\从今日起, 和平条约已变成一纸空文! 280 #FRCANCELBYREJECT_ALLIANCE #使节:\既然你方不肯合作, 那我们的盟约也无法继续了. 是你让我们没了选择的. 281 #FRMYALLIANCE1 #N已向我方盟友开战, 宣战对象为 282 #FRMYALLIANCE2 #n. 我们可以选择支持#a, 反对野蛮的战争行为. 283 #FRENEMYALLIANCE #N决定支持其盟友, 加入与我方的战争. 我方先前与#N的条约自动失效. 284 #FRANARCHY #a处于无政府状态, 我方使节找不到途径与对方当局接触. 285 #FRMYANARCHY 我们正处于无政府状态, 必须等到局势稳定后, 才能开展外交活动. 286 #FRCOLDWAR 目前处于冷战期, 无法与其他势力交涉. 287 #MAX2WANTS 一回合交涉中最多提出两项要求. 288 #MAX2OFFERS 一回合交涉中最多给出两项提议. 289 #NOOFFER 该提议无效! 290 #CANCELTREATYRUSH 在3个回合内,与同一国家最多终止一项外交协议. 291 #NOSPACEPORT 我方没有太空港, 无法正常接收对方的飞船部件, 是否执意接收? 292 #SUICIDE 让这些可怜的家伙\踏上黄泉不归路? 293 #RATES 请制定国民经济的分配比例 294 #NORATES 自由女神像\已经生效. 294 295 295 296 'Diplomatic Statements, do not use '\'! 296 #FRSTART_NOTREATY ½÷´ú±í#nÃñÀ´´ËÓë¹ó¹ú½»Éæ.297 #FRSTART_PEACE ½÷´ú±í#nÏò¸óÏÂÖ¾´, ÓÐЩÊÂÇéÏëÇë¸óÏÂÕå×Ã.298 #FRCANCELTREATY_PEACE ÎÒÃÇÕýʽÏò¹ó¹úÐûÕ½.299 #FRCANCELTREATY_FRIENDLY ÎÒÃÇÒªÓë¹ó¹úÖÕÖ¹ÓѺùØϵ.300 #FRCANCELTREATY_ALLIANCE Á½¹ú¼ÌÐø½áÃËÒѺÁÎÞÒâÒå, ´Ó½ñÆðÕýʽ½â³ýÃËÔ¼.301 #FRNOTICE ÎÒÃÇÔÙÒ²²»Ô¸ÈÌÊÜ ¶ûµÈ·´¸´Ð¡È˵ı°ÁÓÐо¶.302 #FRBREAK û±ØÒª¼ÌÐø̸ÅÐÁË. Ï´ÎÔÙԼʱ¼ä°É.303 #FROFFER ÎÒÃÇÔ¸ÒâÓÃ\-%s\À´½»»»¹ó¹úµÄ\-%s304 #FRPRESENT ÎÒÃÇÔ¸½«:\-%s ·îË͸ø¹ó¹ú×÷ΪÀñÎï.305 #FRDEMAND_STRONG °Ñ\-%s ½»³öÀ´£¬\·ñÔòÓÐÄãÃÇÊܵÄ!306 #FRDONE »¹ÓбðµÄҪ˵ô?307 #FRCEASEFIRE ÎÒÃÇÏëÇ©ÊðÍ£Õ½ÐÒé.308 #FRPEACE Ϊ½â¾öÁ½¹ú¼äÎÞÐÝÖ¹µÄ·×Õù, »¥Ïà³ÐÈ϶Է½µÄ¹ú½ç, ÎÒ·½½¨ÒéÇ©ÊðÒ»·ÝÓÀ¾ÃÐÔºÍƽÌõÔ¼. ÊÇ·ñÔ¸ÒâÇ©×Ö?309 #FRFRIENDLY ÎÒÃǶÔ#a ÏȽøµÄÎÄ»¯¼¼ÊõÑöĽÒѾÃ. ÈÃÎÒÃǹ²ÊðÓѺÃÌõÔ¼, ÔÚÓÑÉƵĻù´¡ÉϽ»Á÷·¢Õ¹°É.310 #FRALLIANCE ΪÁ˼ÓÇ¿Á½¹úÈËÃñµÄ½ôÃܺÏ×÷, ÊÇ·ñÔ¸ÒâÓëÎÒ·½Ç©ÊðͬÃËж¨, ½ñºóÁªÊÖ¶Ô¿¹À´·¸µÄµÐÈË?311 #FRACCEPTCEASEFIRE ÎÒÃǽÓÊÜÄãµÄÌõ¼þ, ÔÝ»ºÐж¯.312 #FRACCEPTTREATY ÎÒÃÇ´ðÓ¦Äã, Ï£ÍûÕâ·ÝÌõÔ¼ÄÜÔÚÁ½¹ú ½»Á÷Ê·ÉÏдÏÂոеÄƪÕÂ.313 #FRNOTACCEPTTREATY ÈôÓë¹ó¹úÇ©ÊðÌõÔ¼, ¶Ô#n¶øÑÔ²¢Î޺ô¦.314 #FRENDTREATY_PEACE ÖÕÖ¹ºÍƽÌõÔ¼315 #FRENDTREATY_FRIENDLY ÖÕÖ¹ÓѺÃÌõÔ¼316 #FRENDTREATY_ALLIANCE ÖÕÖ¹ÃËÔ¼317 #FRACCEPTOFFER ÕâÌõ¼þºÜ¹«Æ½, ÎÒÃÇͬÒâÁË.318 #FRACCEPTPRESENT #N ºÜ¸ßÐËÊÕÏÂÕâ·ÝÀñÎï.319 #FRACCEPTDEMAND_STRONG ΪÁËά³Ö±Ë´ËµÄÓѺùØϵ, ÎÒÃǾö¶¨Í¬ÒâÄãµÄÌõ¼þ.320 #FRNOTACCEPTOFFER ÕâÏîÌáÒé¶ÔÎÒ·½²¢ÎÞÖúÒæ.321 #FRNOTACCEPTPRESENT #N ²»ÐèÒªÕâÑùÒ»·ÝÀñÎï.322 #FRNOTACCEPTDEMAND_STRONG ÄãÌ«Ì°À·, ±ð°×ÈÕ×öÃÎÁË.323 #FRDELCHOICE ÎÒÃǶԹó¹úµÄ\-%s ·Ç³£¸ÐÐËȤ.\ÇëÎʹó¹úµÄ½»»»Ìõ¼þÊÇʲô?324 #FRCOSTCHOICE Èç¹û³ÏÐÄÒªÎÒÃǵÄ\-%s,\ÇëÎʹó¹úÏëÄÃʲôÀ´½»»»ÄØ?325 #FRBYE ÏÖÔÚ²»ÐÐ, ±¾´Î̸ÅоʹËΪֹ. ÔÙ¼û.326 #PRICE_CHOOSE Ñ¡ÔñµÄ¼Û¸ñ327 #PRICE_CIVIL #n µÄ¹ú¼ÒÇ鱨328 #PRICE_MIL #n µÄ¾üÊÂÇ鱨329 #PRICE_MAP #a µÄÊÀ½çµØͼ330 #PRICE_SHIPCOMP %d Ö³Ãñ·É´¬×é¼þ331 #PRICE_SHIPPOW %d ¶¯Á¦²Õ332 #PRICE_SHIPHAB %d ¾Óס²Õ333 #PRICE_TRIBUTE ÿ»ØºÏ%d%%c334 #PRICE_ALLTECH #a ËùÓеĿƼ¼³É¹û335 #PRICE_ALLMODEL #a ËùÓеÄÑз¢²¿¶Ó297 #FRSTART_NOTREATY 谨代表#n民来此与贵国交涉. 298 #FRSTART_PEACE 谨代表#n向阁下致敬, 有些事情想请阁下斟酌. 299 #FRCANCELTREATY_PEACE 我们正式向贵国宣战. 300 #FRCANCELTREATY_FRIENDLY 我们要与贵国终止友好关系. 301 #FRCANCELTREATY_ALLIANCE 两国继续结盟已毫无意义, 从今起正式解除盟约. 302 #FRNOTICE 我们再也不愿忍受 尔等反复小人的卑劣行径. 303 #FRBREAK 没必要继续谈判了. 下次再约时间吧. 304 #FROFFER 我们愿意用\-%s\来交换贵国的\-%s 305 #FRPRESENT 我们愿将:\-%s 奉送给贵国作为礼物. 306 #FRDEMAND_STRONG 把\-%s 交出来,\否则有你们受的! 307 #FRDONE 还有别的要说么? 308 #FRCEASEFIRE 我们想签署停战协议. 309 #FRPEACE 为解决两国间无休止的纷争, 互相承认对方的国界, 我方建议签署一份永久性和平条约. 是否愿意签字? 310 #FRFRIENDLY 我们对#a 先进的文化技术仰慕已久. 让我们共署友好条约, 在友善的基础上交流发展吧. 311 #FRALLIANCE 为了加强两国人民的紧密合作, 是否愿意与我方签署同盟协定, 今后联手对抗来犯的敌人? 312 #FRACCEPTCEASEFIRE 我们接受你的条件, 暂缓行动. 313 #FRACCEPTTREATY 我们答应你, 希望这份条约能在两国 交流史上写下崭新的篇章. 314 #FRNOTACCEPTTREATY 若与贵国签署条约, 对#n而言并无好处. 315 #FRENDTREATY_PEACE 终止和平条约 316 #FRENDTREATY_FRIENDLY 终止友好条约 317 #FRENDTREATY_ALLIANCE 终止盟约 318 #FRACCEPTOFFER 这条件很公平, 我们同意了. 319 #FRACCEPTPRESENT #N很高兴收下这份礼物. 320 #FRACCEPTDEMAND_STRONG 为了维持彼此的友好关系, 我们决定同意你的条件. 321 #FRNOTACCEPTOFFER 这项提议对我方并无助益. 322 #FRNOTACCEPTPRESENT #N不需要这样一份礼物. 323 #FRNOTACCEPTDEMAND_STRONG 你太贪婪, 别白日做梦了. 324 #FRDELCHOICE 我们对贵国的\-%s 非常感兴趣.\请问贵国的交换条件是什么? 325 #FRCOSTCHOICE 如果诚心要我们的\-%s,\请问贵国想拿什么来交换呢? 326 #FRBYE 现在不行, 本次谈判就此为止. 再见. 327 #PRICE_CHOOSE 选择的价格 328 #PRICE_CIVIL #n的国家情报 329 #PRICE_MIL #n的军事情报 330 #PRICE_MAP #a的世界地图 331 #PRICE_SHIPCOMP %d 殖民飞船组件 332 #PRICE_SHIPPOW %d 动力舱 333 #PRICE_SHIPHAB %d 居住舱 334 #PRICE_TRIBUTE 每回合%d%%c 335 #PRICE_ALLTECH #a所有的科技成果 336 #PRICE_ALLMODEL #a所有的研发部队 336 337 #PRICE_CONCAT %s\-%s 337 #PRICECAT_ALLTECH ËùÓпƼ¼³É¹û338 #PRICECAT_ALLMODEL ËùÓв¿¶ÓÑз¢338 #PRICECAT_ALLTECH 所有科技成果 339 #PRICECAT_ALLMODEL 所有部队研发 339 340 340 341 'Button Captions 341 #BTN_OK È·¶¨342 #BTN_CANCEL È¡Ïû343 #BTN_YES ÊÇ344 #BTN_NO ·ñ345 #BTN_INFO °ïÖú342 #BTN_OK 确定 343 #BTN_CANCEL 取消 344 #BTN_YES 是 345 #BTN_NO 否 346 #BTN_INFO 帮助 346 347 #BTN_RESET Reset 347 348 348 349 'Button Tooltips 349 #BTN_SELECT Ñ¡Ôñ350 #BTN_PAGE ÏÂÒ³351 #BTN_SUPPORT Á¥Êô²¿¶Ó352 #BTN_IMPRS ³ÇÊÐÉèÊ©353 #BTN_CLASSES ²¿¶Ó354 #BTN_WONDERS Ææ¼£355 #BTN_BUY ¹ºÂò356 #BTN_DELETE ɾ³ý357 #BTN_RENAME ¸üÃû358 #BTN_OBSOLETE Í£Ö¹Éú²ú359 #BTN_NONOBSOLETE ÔÊÐíÉú²ú360 #BTN_ALLOWCONSCRIPTS ÔÊÐíÕ÷ļ361 #BTN_NOCONSCRIPTS Í£Ö¹Õ÷ļ362 #BTN_ENDTURN ½áÊø»ØºÏ£¡363 #BTN_SKIP ²»ÔÙÏÔʾÆäËûÊÆÁ¦Òƶ¯364 #BTN_NOAUTOMOVE Í£Ö¹ÏòÄ¿±êÒƶ¯365 #BTN_STOP Í£Ö¹366 #BTN_NEGO ¼ÌÐø̸ÅÐ367 #BTN_DIALOG ÁªÂç´Ë¹ú368 #BTN_BREAK ÖÕÖ¹±¾´Î̸ÅÐ369 #BTN_PASS ½áÊø±¾·½ÌáÒé370 #BTN_CNTREATY ˺»ÙÐÒé371 #BTN_ACCEPT ½ÓÊÜÌáÒé372 #BTN_NOTICE ÒÑ»ñϤ¾ö¶¨373 #BTN_REPLAY ÀúÊ·ÖØ·Å374 #BTN_RENGAME ÓÎÏ·¸üÃû375 #BTN_DELGAME ÓÎϷɾ³ý376 #BTN_RENMAP µØͼ¸üÃû377 #BTN_DELMAP µØͼɾ³ý378 #BTN_CONTENTS Ŀ¼379 #BTN_BACK ·µ»Ø380 #BTN_SEARCH ËÑË÷381 #BTN_WANTCEASEFIRE ÒªÇóÍ£»ð382 #BTN_OFFERCEASEFIRE ÌáÒéÍ£»ð383 #BTN_WANTPEACE ÒªÇóºÍƽ384 #BTN_OFFERPEACE ÌáÒéºÍƽ385 #BTN_WANTENDPEACE ÒªÇóÖÐÖ¹ºÍƽ386 #BTN_OFFERENDPEACE ÌáÒéÖÐÖ¹ºÍƽ387 #BTN_WANTFRIENDLY ÒªÇóÓѺÃÏà´¦388 #BTN_OFFERFRIENDLY ÌáÒéÓѺÃÏà´¦389 #BTN_WANTALLIANCE ÒªÇóÁªÃË390 #BTN_OFFERALLIANCE ÌáÒéÁªÃË391 #BTN_WANTENDALLIANCE ÒªÇó½â³ýÁªÃË392 #BTN_OFFERENDALLIANCE ÌáÒé½â³ýÁªÃË393 #BTN_NEGOEARLIER ÔçÏȵIJ¿·Ö394 #BTN_NEGOLATER ºóÀ´µÄ²¿·Ö350 #BTN_SELECT 选择 351 #BTN_PAGE 下页 352 #BTN_SUPPORT 隶属部队 353 #BTN_IMPRS 城市设施 354 #BTN_CLASSES 部队 355 #BTN_WONDERS 奇迹 356 #BTN_BUY 购买 357 #BTN_DELETE 删除 358 #BTN_RENAME 更名 359 #BTN_OBSOLETE 停止生产 360 #BTN_NONOBSOLETE 允许生产 361 #BTN_ALLOWCONSCRIPTS 允许征募 362 #BTN_NOCONSCRIPTS 停止征募 363 #BTN_ENDTURN 结束回合! 364 #BTN_SKIP 不再显示其他势力移动 365 #BTN_NOAUTOMOVE 停止向目标移动 366 #BTN_STOP 停止 367 #BTN_NEGO 继续谈判 368 #BTN_DIALOG 联络此国 369 #BTN_BREAK 终止本次谈判 370 #BTN_PASS 结束本方提议 371 #BTN_CNTREATY 撕毁协议 372 #BTN_ACCEPT 接受提议 373 #BTN_NOTICE 已获悉决定 374 #BTN_REPLAY 历史重放 375 #BTN_RENGAME 游戏更名 376 #BTN_DELGAME 游戏删除 377 #BTN_RENMAP 地图更名 378 #BTN_DELMAP 地图删除 379 #BTN_CONTENTS 目录 380 #BTN_BACK 返回 381 #BTN_SEARCH 搜索 382 #BTN_WANTCEASEFIRE 要求停火 383 #BTN_OFFERCEASEFIRE 提议停火 384 #BTN_WANTPEACE 要求和平 385 #BTN_OFFERPEACE 提议和平 386 #BTN_WANTENDPEACE 要求中止和平 387 #BTN_OFFERENDPEACE 提议中止和平 388 #BTN_WANTFRIENDLY 要求友好相处 389 #BTN_OFFERFRIENDLY 提议友好相处 390 #BTN_WANTALLIANCE 要求联盟 391 #BTN_OFFERALLIANCE 提议联盟 392 #BTN_WANTENDALLIANCE 要求解除联盟 393 #BTN_OFFERENDALLIANCE 提议解除联盟 394 #BTN_NEGOEARLIER 早先的部分 395 #BTN_NEGOLATER 后来的部分 395 396 396 397 'Morphing Menu Entries 397 #SUPER ³¬¼¶Óû§398 #HUMAN ±¾µØÍæ¼Ò399 #AIT µçÄÔ¶Ô¾ö400 #RANDOMAI Ëæ»úÑ¡ÔñAIÄ£¿é401 #BTN_FOUND ¶¨¾Ó402 #BTN_ADD ¼ÓÈë³ÇÊÐ403 #BTN_SETHOME ¸ÄΪ±¾³Ç²¿¶Ó404 #BTN_MOVEHOME ·µ»Ø×î½ü³ÇÊÐ405 #BTN_BUILDROAD ÐÞ½¨µÀ·406 #BTN_BUILDBRIDGE ¼ÜÉèµÀ·ÇÅ407 #BTN_BUILDRR ÐÞ½¨Ìú·408 #BTN_BUILDRRBRIDGE ¼ÜÉèÌú·ÇÅ409 #BTN_CLEAR Çå³ýÉÁÖ410 #BTN_DRAIN ³é¸ÉÕÓÔó411 #BTN_UNDESERT ÕûΪƽÔ412 #FARTECH É趨Ŀ±ê413 #NOFARTECH ûÓÐÄ¿±ê414 #UTILIZE ²Î½¨415 #INTEGRATE Õû±à398 #SUPER 超级用户 399 #HUMAN 本地玩家 400 #AIT 电脑对决 401 #RANDOMAI 随机选择AI模块 402 #BTN_FOUND 定居 403 #BTN_ADD 加入城市 404 #BTN_SETHOME 改为本城部队 405 #BTN_MOVEHOME 返回最近城市 406 #BTN_BUILDROAD 修建道路 407 #BTN_BUILDBRIDGE 架设道路桥 408 #BTN_BUILDRR 修建铁路 409 #BTN_BUILDRRBRIDGE 架设铁路桥 410 #BTN_CLEAR 清除森林 411 #BTN_DRAIN 抽干沼泽 412 #BTN_UNDESERT 整为平原 413 #FARTECH 设定目标 414 #NOFARTECH 没有目标 415 #UTILIZE 参建 416 #INTEGRATE 整编 416 417 #NETWORK_SERVER Network Server 417 418 #NETWORK_CLIENT Network Client 418 419 419 420 'Busy Messages 420 #BUSY_START ´´½¨ÊÀ½ç¡421 #BUSY_MOD %s ÔØÈëÖС422 #BUSY_MODLH ͼÐγõʼ»¯¡423 #BUSY_INIT Íæ¼Ò³õʼ»¯¡424 #BUSY_LOAD ÔØÈëÓÎÏ·½ø¶È¡421 #BUSY_START 创建世界… 422 #BUSY_MOD %s载入中… 423 #BUSY_MODLH 图形初始化… 424 #BUSY_INIT 玩家初始化… 425 #BUSY_LOAD 载入游戏进度… 425 426 426 427 'Map Editor 427 #MAP_START µçÄÔÖÖ×å³õʼλÖÃ428 #MAP_PREFSTART Íæ¼ÒÖÖ×å³õʼλÖÃ429 #MAP_RANDOM ·ÅÆúµ±Ç°µÄµØͼ, ÖØÐÂËæ»úÉú³ÉеĵØͼ£¿430 #MAP_CLOSE Ñ¡Ôñ¹Ø±Õµ±Ç°µÄµØͼ¡£\ÊÇ·ñ±£´æ£¿428 #MAP_START 电脑种族初始位置 429 #MAP_PREFSTART 玩家种族初始位置 430 #MAP_RANDOM 放弃当前的地图, 重新随机生成新的地图? 431 #MAP_CLOSE 选择关闭当前的地图。\是否保存? 431 432 432 433 #STARTCONTROLS 433 Í˳ö 434 ¿ªÊ¼ 435 ¶ÁÈ¡ 436 н¨ÓÎÏ· 437 ¶ÁÈ¡½ø¶È 438 ÊÀ½ç³ß´ç£º 439 ½µØ±ÈÀý£º 440 ×Ô¶¨ÒåÍæ¼Ò 441 Äê´ú£º 442 %s µÄÄѶÈ443 ÄêÏÞ£º 444 µØͼ±à¼ 445 ±à¼ 446 °ïÖú 447 ÄѶȣº 448 ¾ºÕùÖÖ×壺 449 AI Ä£¿é£º434 退出 435 开始 436 读取 437 新建游戏 438 读取进度 439 世界尺寸: 440 陆地比例: 441 自定义玩家 442 年代: 443 %s的难度 444 年限: 445 地图编辑 446 编辑 447 帮助 448 难度: 449 竞争种族: 450 AI模块: 450 451 451 452 #AUTODIFF 452 ÈëÃÅ 453 ¼òµ¥ 454 Õý³£ 455 À§ÄÑ 456 ±ä̬ 453 入门 454 简单 455 正常 456 困难 457 变态 457 458 458 459 #CONTROLS 459 È¡ÏûÃüÁî 460 ¹Ø±Õ 461 ¾¼Ã¼°Ë°ÊÕ¡ 462 ³¤³Ç±£»¤ÇøÓò 463 ²é¿´µØÐÎ 464 ÊÀ½çÆæ¼£¡ 465 ÓÎÏ·Ö¸ÄÏ 466 ²âÊÔ 467 ¾üÊÂÇ鱨¡ 468 AI ²âÊÔÐÅÏ¢¡469 ³ÇÊÐÀàÐÍ¡ 470 ½çÃæ¾ÓÖÐ 471 Ä¿±êÒƶ¯ 472 ²¿¶ÓÃüÁî 473 ²¿¶ÓÐÅÏ¢ 474 ½¨Á¢¾üÊ»ùµØ 475 ¸ü»»µØÐÎ 476 Çå³ýÎÛȾ 477 ÂÓ¶á 478 ½¨ÔìÒªÈû 479 Àúʷͼ±í¡ 480 פ·À¾¯½ä 481 ¿ª±ÙÔËºÓ 482 ´î³ËÔËÊ乤¾ß 483 ÉÔºóÐж¯ 484 Եصȴý 485 ÏÔʾ·½Î»´úÂë 486 µØÐν¨Éè 487 Ñ¡Ïî 488 ²¿¶ÓÒƶ¯ 489 ´°¿ÚģʽÏÔʾ 490 »ØºÏ½áÊøÌáʾ 491 ÊÓÒ°ÍâµØÇø±ä°µ 492 ³ÇÊб¨¸æÑ¡Ïî 493 ³ÇÊÐÃû³Æ 494 ¹ú¼Ò±ß½ç 495 ³ÇÊб¨¸æ¡ 496 ¿ÆÑб¨¸æ¡ 497 µØÐθÄÔì 498 µØÐθÄÔì¡ 499 Ö³Ãñ·É´¬¡ 500 ¿ìËÙºê²Ù×÷ 501 ÒýË®¹à¸È 502 ¿ª±ÙÅ©³¡ 503 Ö²Ê÷ÔìÁÖ 504 ¿ª²É¿ó²Ø 505 ´´½¨²¿¶Ó 506 Íø¸ñ 507 AI ²âÊÔµØͼ508 Íâ¹ú²¿¶Ó¡ 509 ÕþÖΰæͼ 510 Ö»ÏÔʾ¹¥»÷¼°Õ¼ÁìÐж¯ 511 ²»ÏÔʾ 512 Ìø¹ý20»ØºÏ 513 ¹ú¼ÒÇ鱨¡ 514 ×÷±× 515 ËùÓпƼ¼Ñз¢³É¹¦ 516 ÿ»ØºÏÉú²ú¿ìËÙÍ깤 517 ÿ»ØºÏ¿Æ¼¼¿ìËÙÑеà 518 ÿ»ØºÏ³ÇÊгÖÐøÔö³¤ 519 ´ò¿ªËùÓеØͼ 520 ËùÓйú¼ÒÏàʶ 521 ÔËÐÐÖÁÓÎÏ·½áÊø 522 Ëû¹ú³ÇÊС 523 ³ÇÊб¨¸æÁбí 524 ³ÇÊб¨¸æÆÁÄ» 525 Ãû³Æ 526 ÎÞÐèÏÖ´ú×ÊÔ´ 527 »Ö¸´ÐÝÕû 528 ·Å³öÔËÊ䲿¶Ó 529 Ëæ»úµØͼ 530 ½âÉ¢ 531 ×°ÔØÔËÊ䲿¶Ó 532 ¶ÔÊÖÒƶ¯ 533 ÂýËÙ 534 ¿ìËÙ 535 ¼«¿ì 536 ÂýËÙ 537 ¿ìËÙ 538 ÒôЧ 539 ¹Ø±Õ 540 ¿ªÆô(ĬÈÏÒôЧ)541 ¿ªÆô(Ìæ´úÒôЧ)542 ¹öÆÁ 543 ÂýËÙ 544 ¿ìËÙ 545 ¹Ø±Õ 546 ·ÃÎʹٷ½ÍøÕ¾ 547 ·¢¶¯ÕþÌå¸ïÃü£¡ 548 Ã˾üÐж¯ 549 ÂýËÙ 550 ¿ìËÙ 551 ²»ÏÔʾ 552 Ö»ÏÔʾѲÂß¡¢¹¥»÷¼°Õ¼ÁìÐж¯ 553 Ö»ÏÔʾѲÂß¡¢¹¥»÷¼°Õ¼ÁìÐж¯ 554 µØ¿é³ß´ç 460 取消命令 461 关闭 462 经济及税收… 463 长城保护区域 464 查看地形 465 世界奇迹… 466 游戏指南 467 测试 468 军事情报… 469 AI测试信息… 470 城市类型… 471 界面居中 472 目标移动 473 部队命令 474 部队信息 475 建立军事基地 476 更换地形 477 清除污染 478 掠夺 479 建造要塞 480 历史图表… 481 驻防警戒 482 开辟运河 483 搭乘运输工具 484 稍后行动 485 原地等待 486 显示方位代码 487 地形建设 488 选项 489 部队移动 490 窗口模式显示 491 回合结束提示 492 视野外地区变暗 493 城市报告选项 494 城市名称 495 国家边界 496 城市报告… 497 科研报告… 498 地形改造 499 地形改造… 500 殖民飞船… 501 快速宏操作 502 引水灌溉 503 开辟农场 504 植树造林 505 开采矿藏 506 创建部队 507 网格 508 AI测试地图 509 外国部队… 510 政治版图 511 只显示攻击及占领行动 512 不显示 513 跳过20回合 514 国家情报… 515 作弊 516 所有科技研发成功 517 每回合生产快速完工 518 每回合科技快速研得 519 每回合城市持续增长 520 打开所有地图 521 所有国家相识 522 运行至游戏结束 523 他国城市… 524 城市报告列表 525 城市报告屏幕 526 名称 527 无需现代资源 528 恢复休整 529 放出运输部队 530 随机地图 531 解散 532 装载运输部队 533 对手移动 534 慢速 535 快速 536 极快 537 慢速 538 快速 539 音效 540 关闭 541 开启(默认音效) 542 开启(替代音效) 543 滚屏 544 慢速 545 快速 546 关闭 547 访问官方网站 548 发动政体革命! 549 盟军行动 550 慢速 551 快速 552 不显示 553 只显示巡逻、攻击及占领行动 554 只显示巡逻、攻击及占领行动 555 地块尺寸 555 556 Small 556 557 Medium … … 560 561 561 562 #ADVANCES 562 ÖÇÄÜ·ÉÐÐ 563 Á½ÆÜ×÷Õ½ 564 ÌìÎÄѧ 565 Ô×Óѧ˵ 566 Æû³µ 567 µ¯µÀѧ 568 ÒøÐÐÒµ 569 ÇÅÁº½¨Éè 570 ÇàÍÖýÔì 571 ÔáÀñÒÇʽ 572 »¯Ñ§ 573 ÆïÊ¿ÖÆ¶È 574 ¸´ºÏ²ÄÁÏ 575 ·¨ÂÉÌõÎÄ 576 ×éºÏ±øÖÖ 577 ÄÚȼ»ú 578 ¹²²úÖ÷Òå 579 ¼ÆËã»ú 580 Õ÷±øÖÆ¶È 581 ½¨Öþ 582 ÆóÒµ½á¹¹ 583 ÐǼʷÉÐÐ 584 »õ±Ò 585 ÃñÖ÷Ö÷Òå 586 ¾¼Ãѧ 587 ·¢µç 588 µç×Óѧ 589 ¹¤³Ìѧ 590 »·¾³±£»¤ 591 ³µÂÖ 592 Õ¨Ò© 593 ·ÉÐÐ 594 Ç鱨¹¤×÷ 595 »ðÒ© 596 ÆïÊõ 597 Âö³åÇý¶¯ 598 ²úÒµ»¯ 599 ÖÇÄÜÎäÆ÷ 600 ·¢Ã÷ 601 ÖýÌúÒ±Á¶ 602 ¼¤¹â 603 ºËÄÜ 604 ÎÄѧ 605 »¥ÁªÍø 606 µç´Åѧ 607 µØͼ»æÖÆ 608 ÖÆש 609 ¹æÄ£Á¿²ú 610 Êýѧ 611 Ò½Ò© 612 Ò±½ð 613 СÐÍ»¯ 614 »ú¶¯×÷Õ½ 615 ¾ýÖ÷ÕþÖÎ 616 ÉñÃØÖ÷Òå 617 º£Éϵ¼º½ 618 ºËÁѱä 619 ÕÜѧ 620 ÎïÀí 621 ËÜÁÏ 622 Ê«¸è 623 ÖÆÌÕ 624 ÎÞÏßµç 625 ÔÙÑ»· 626 µÍÎÂÀäÈ´ 627 Ò»ÉñÂÛ 628 ¹²ºÍÖ÷Òå 629 »úÆ÷ÈË 630 ÅçÆøÇý¶¯ 631 Ìú· 632 ÎÀÉúÉèÊ© 633 ¿Æѧ 634 Êéд 635 º½º£ 636 Ä£ÄâÉú̬ 637 ÒþÐμ¼Êõ 638 ÕôÆûÒýÇæ 639 ¸ÖÌú 640 ÈËÔìʳƷ 641 Õ½Êõ 642 Éñѧ 643 ÖØÁ¦Ñ§Ëµ 644 óÒ× 645 ÐǼÊÖ³Ãñ 646 ´óѧ 647 ÖÇÄÜ»ð¼ý 648 ÉÐÎäÏ°Ë× 649 ×Öĸ 650 ¶àÉñÂÛ 651 Ìá´¿ 652 µçÄԿƼ¼ 653 ÄÉÃ×¼¼Êõ 654 ²ÄÁÏ¿Æѧ 655 È˹¤ÖÇÄÜ 563 智能飞行 564 两栖作战 565 天文学 566 原子学说 567 汽车 568 弹道学 569 银行业 570 桥梁建设 571 青铜铸造 572 葬礼仪式 573 化学 574 骑士制度 575 复合材料 576 法律条文 577 组合兵种 578 内燃机 579 共产主义 580 计算机 581 征兵制度 582 建筑 583 企业结构 584 星际飞行 585 货币 586 民主主义 587 经济学 588 发电 589 电子学 590 工程学 591 环境保护 592 车轮 593 炸药 594 飞行 595 情报工作 596 火药 597 骑术 598 脉冲驱动 599 产业化 600 智能武器 601 发明 602 铸铁冶炼 603 激光 604 核能 605 文学 606 互联网 607 电磁学 608 地图绘制 609 制砖 610 规模量产 611 数学 612 医药 613 冶金 614 小型化 615 机动作战 616 君主政治 617 神秘主义 618 海上导航 619 核裂变 620 哲学 621 物理 622 塑料 623 诗歌 624 制陶 625 无线电 626 再循环 627 低温冷却 628 一神论 629 共和主义 630 机器人 631 喷气驱动 632 铁路 633 卫生设施 634 科学 635 书写 636 航海 637 模拟生态 638 隐形技术 639 蒸汽引擎 640 钢铁 641 人造食品 642 战术 643 神学 644 重力学说 645 贸易 646 星际殖民 647 大学 648 智能火箭 649 尚武习俗 650 字母 651 多神论 652 提纯 653 电脑科技 654 纳米技术 655 材料科学 656 人工智能 656 657 657 658 #IMPROVEMENTS 658 ½ð×ÖËþ 659 Öæ˹ÉñÃí 660 ¿ÕÖл¨Ô° 661 Ì«ÑôÉñÏñ 662 ¾ÞÐ͵ÆËþ 663 ´óͼÊé¹Ý 664 ÉñÚÍÆôʾ 665 ËïÎäѧԺ 666 ´ï·ÒÆ湤·¿ 667 ÂóÕÜÂ×Ô¶Õ÷ 668 ʥĸÀñ°ÝÌà 669 * 670 Å£¶Ù´óѧ 671 °ÍºÕ´ó½ÌÌà 672 * 673 ×ÔÓÉÅ®ÉñÏñ 674 °£·Æ¶ûÌúËþ 675 ÈýÏ¿´ó°Ó 676 иÉÏßÌØ¿ì 677 Âü¹þ¶Ù¼Æ»® 678 ½üµØ¿Õ¼äÕ¾ 679 * 680 * 681 * 682 * 683 * 684 * 685 * 686 ÉÌƷóÒ× 687 ±øÓª 688 ¹È²Ö 689 ËÂÃí 690 Êг¡ 691 ͼÊé¹Ý 692 ·¨Ôº 693 ³Çǽ 694 Ë®Çþ 695 ÒøÐÐ 696 ½ÌÌà 697 ´óѧ 698 ¸Û¿Ú 699 ¾çÔº 700 ¹¤³§ 701 ÌØÇø 702 »ØÊÕÕ¾ 703 »ðµçÕ¾ 704 Ë®µçÕ¾ 705 ºËµçÕ¾ 706 º£ÉÏƽ̨ 707 ÊÐÕþÌü 708 ÅÅÎÛ¹Ü 709 ³¬ÊÐ 710 Á¢½» 711 ʵÑéÊÒ 712 ·À¿ÕÅÚ 713 µï±¤ 714 »ú³¡ 715 ´¬Îë 716 ¹¬µî 717 ³¤³Ç 718 ´ó¾ç³¡ 719 ÌìÎĄ̈ 720 ¾üÊÂѧУ 721 ×÷Õ½ÑÚÌå 722 Ë®ÔåÅ©³¡ 723 ¹ÉƱ½»Ò× 724 Ì«¿Õ¸Û 725 Ö³Ãñ·É´¬×é¼þ 726 ·É´¬¶¯Á¦²Õ 727 ·É´¬¾Óס²Õ 659 金字塔 660 宙斯神庙 661 空中花园 662 太阳神像 663 巨型灯塔 664 大图书馆 665 神谕启示 666 孙武学院 667 达芬奇工房 668 麦哲伦远征 669 圣母礼拜堂 670 * 671 牛顿大学 672 巴赫大教堂 673 * 674 自由女神像 675 埃菲尔铁塔 676 三峡大坝 677 新干线特快 678 曼哈顿计划 679 近地空间站 680 * 681 * 682 * 683 * 684 * 685 * 686 * 687 商品贸易 688 兵营 689 谷仓 690 寺庙 691 市场 692 图书馆 693 法院 694 城墙 695 水渠 696 银行 697 教堂 698 大学 699 港口 700 剧院 701 工厂 702 特区 703 回收站 704 火电站 705 水电站 706 核电站 707 海上平台 708 市政厅 709 排污管 710 超市 711 立交 712 实验室 713 防空炮 714 碉堡 715 机场 716 船坞 717 宫殿 718 长城 719 大剧场 720 天文台 721 军事学校 722 作战掩体 723 水藻农场 724 股票交易 725 太空港 726 殖民飞船组件 727 飞船动力舱 728 飞船居住舱 728 729 729 730 #FEATURES 730 ÎäÆ÷(¹¥)731 ×°¼×(·À)732 »ú¶¯(ÒÆ)733 º£ÔË 734 ĸ½¢ 735 ÎÐÂÖ 736 ¿ÕÏ® 737 ȼÓÍ 738 ¿ÕÔË 739 º£Éϵ¼º½ 740 À×´ïÉùÄÉ 741 Ë®ÏÂDZº½ 742 Ô¶³ÌÅÚ»÷ 743 ¿ìËÙÐоü 744 ´¬ÉϾÈÉú 745 ¶îÍ⸺ÖØ 746 ·À¿ÕÎäÆ÷ 747 ¼äµý·É»ú 748 ÕôÆû¶¯Á¦ 749 ºË×Ó¶¯Á¦ 750 ÅçÆøÒýÇæ 751 ÒþÐμ¼Êõ 752 ¿ñÈÈ·Ö×Ó 753 Ò»»÷ÖƵР754 ÆøÍ̶·Å£ 755 ¾Ã¾É³³¡ 756 Á÷Ë®×÷Òµ 731 武器(攻) 732 装甲(防) 733 机动(移) 734 海运 735 母舰 736 涡轮 737 空袭 738 燃油 739 空运 740 海上导航 741 雷达声纳 742 水下潜航 743 远程炮击 744 快速行军 745 船上救生 746 额外负重 747 防空武器 748 间谍飞机 749 蒸汽动力 750 核子动力 751 喷气引擎 752 隐形技术 753 狂热分子 754 一击制敌 755 气吞斗牛 756 久经沙场 757 流水作业 757 758 758 759 #TERRAIN 759 Ô¶Ñó 760 ½üº£ 761 ²Ý³¡ 762 ɳĮ 763 »ÄµØ 764 Ì¦Ô 765 ±ùÔ 766 ÕÓÔó 767 ´ÔÁÖ 768 ÉÁÖ 769 ÇðÁê 770 ¸ßɽ 771 * 772 Ó泡 773 Æ½Ô 774 ÂÌÖÞ 775 СÂó 776 »Æ½ð 777 ÊÞƤ 778 ÄàÌ¿ 779 Ë®¹û 780 ÁÔÎï 781 ÃÀ¾Æ 782 Ìú¿ó 783 * 784 ÃÌ¿ó 785 * 786 ʯÓÍ 787 ÂÁÍÁ 788 ȼÆø 789 * 790 * 791 ÎÚľ 792 ¿óȪ 793 ú̿ 794 ×êʯ 795 ¶ñÍÁ 796 îÜ¿ó 797 ÓË¿ó 798 Ë®Òø 760 远洋 761 近海 762 草场 763 沙漠 764 荒地 765 苔原 766 冰原 767 沼泽 768 丛林 769 森林 770 丘陵 771 高山 772 * 773 渔场 774 平原 775 绿洲 776 小麦 777 黄金 778 兽皮 779 泥炭 780 水果 781 猎物 782 美酒 783 铁矿 784 * 785 锰矿 786 * 787 石油 788 铝土 789 燃气 790 * 791 * 792 乌木 793 矿泉 794 煤炭 795 钻石 796 恶土 797 钴矿 798 铀矿 799 水银 799 800 800 801 #DOMAIN 801 ½¾ü 802 º£¾ü 803 ¿Õ¾ü 802 陆军 803 海军 804 空军 804 805 805 806 #EXPERIENCE 806 бø 807 ÊÜѵ 808 ÀúÁ· 809 Àϱø 810 ¾«Èñ 807 新兵 808 受训 809 历练 810 老兵 811 精锐 811 812 812 813 #UNITSTATUS 813 פ·À״̬ 814 ºäըװ±¸ 815 ɽÇøÒƶ¯ 816 Õ÷ļ²¿¶Ó 817 ³·À벿¶Ó 818 * 819 * 820 * 821 ÔËÔز¿¶Ó 822 µ¼Ö²»°² 823 ÔµØÍ£Áô 824 * 825 ÏòÖ¸¶¨Ä¿±êÒƶ¯ 826 µØÐθÄÔì 827 ÊÜËð»Ö¸´ 814 驻防状态 815 轰炸装备 816 山区移动 817 征募部队 818 撤离部队 819 * 820 * 821 * 822 运载部队 823 导致不安 824 原地停留 825 * 826 向指定目标移动 827 地形改造 828 受损恢复 828 829 829 830 #GOVERNMENT 830 ÎÞÕþ¸® 831 Å«Á¥ÖÆ 832 ¾ýÖ÷ÖÆ 833 ¹²ºÍÖÆ 834 ×Ú½ÌÖÆ 835 ¹²²úÖÆ 836 ÃñÖ÷ÖÆ 837 δÀ´ÖÆ 831 无政府 832 奴隶制 833 君主制 834 共和制 835 宗教制 836 共产制 837 民主制 838 未来制 838 839 839 840 #TREATY 840 ½»Õ½ 841 Í£Õ½ 842 ºÍƽ 843 ÓѺà 844 ÁªÃË 841 交战 842 停战 843 和平 844 友好 845 联盟 845 846 846 847 #HAVETREATY 847 Óë#n½¨½» 848 Óë#nÍ£Õ½ 849 Óë#nºÍƽ 850 Óë#nÓѺà 851 # Óë#nÁªÃË848 与#n建交 849 与#n停战 850 与#n和平 851 与#n友好 852 #与#n联盟 852 853 853 854 #ATTITUDE 854 µÐ¶Ô 855 Àäµ 856 ²»ºÏ 857 ÖÐÁ¢ 858 ½ÓÊÜ 859 ÓÑÉÆ 860 ÈÈÇé 855 敌对 856 冷淡 857 不合 858 中立 859 接受 860 友善 861 热情 861 862 862 863 #CREDIBILITY 863 ÑÔ¶øÎÞÐÅ 864 ×½Ãþ²»¶¨ 865 ÖØŵÊØÐÅ 866 ÑÔ³ö±ØÐÐ 864 言而无信 865 捉摸不定 866 重诺守信 867 言出必行 867 868 868 869 #CITYEVENTS 869 ÊÐÃñɧÂÒ 870 Éú²úÍ깤 871 ÈË¿ÚÔö³¤ 872 ÈË¿Ú¼õÉÙ 873 ²¿¶Ó½âÉ¢ 874 ÉèÊ©±äÂô 875 Éú²úÔâ»Ù 876 ´ïµ½ÉÏÏÞ 877 ³öÏÖÎÛȾ 878 ³ÇÊб»Î§ 879 Ææ¼£Öظ´ 880 ÒÆÃñÑÓÆÚ 881 ³ÇÊн¨Á¢ 882 ³ÇÊа²¸´ 883 ³ÇÊб»Õ¼ 884 ÎÞЧ³ÇÊÐÀàÐÍ 870 市民骚乱 871 生产完工 872 人口增长 873 人口减少 874 部队解散 875 设施变卖 876 生产遭毁 877 达到上限 878 出现污染 879 城市被围 880 奇迹重复 881 移民延期 882 城市建立 883 城市安复 884 城市被占 885 无效城市类型 885 886 886 887 #CITYTYPE 887 ÆÕͨÐͳÇÊÐ 888 ¿Æ¼¼ÐͳÇÊÐ 889 ¹¤ÒµÐͳÇÊÐ 890 ³¬¼¶´ó¶¼ÊÐ 888 普通型城市 889 科技型城市 890 工业型城市 891 超级大都市 891 892 892 893 #DIAGRAM 893 ÈË¿Ú 894 ÁìÍÁ 895 ¾üÊ 896 ¿Æ¼¼ 897 ̽Ë÷ 898 ¸û×÷ 894 人口 895 领土 896 军事 897 科技 898 探索 899 耕作 899 900 900 901 #JOBRESULT 901 902 * 902 µÀ· 903 Ìú· 904 Çå³ýÉÁÖ 905 ¹à¸È 906 Å©³¡ 907 Ö²Ê÷ÔìÁÖ 908 ²É¿ó 909 ÔËºÓ 910 µØÐθü¸Ä 911 ÒªÈû 912 Çå³ýÎÛȾ 913 ¾üÊ»ùµØ 914 ÂÓ¶á 915 ¶¨¾Ó 916 µÀ·ÇÅ 917 Ìú·ÇÅ 918 ÒƳýÉèÊ© 919 ±äÎªÆ½Ô 920 ³é¸ÉÕÓÔó 903 道路 904 铁路 905 清除森林 906 灌溉 907 农场 908 植树造林 909 采矿 910 运河 911 地形更改 912 要塞 913 清除污染 914 军事基地 915 掠夺 916 定居 917 道路桥 918 铁路桥 919 移除设施 920 变为平原 921 抽干沼泽 921 922 922 923 #ARMYLOST 923 #A ²¿¶Ó±»¼ßÃð924 #A ½¢¶Ó±»¼ßÃð925 #A ²¿¶Ó¼¯Èº±»¼ßÃð924 #A部队被歼灭 925 #A舰队被歼灭 926 #A部队集群被歼灭 926 927 927 928 #SPYMISSION 928 ÆÆ»µÉú²ú 929 ÇÔÈ¡µØͼ 930 »ñµÃµÚÈý¹úÇ鱨 931 ´òÌý¹ú¼ÒÇ鱨 932 ´òÌý¾üÊÂÇ鱨 929 破坏生产 930 窃取地图 931 获得第三国情报 932 打听国家情报 933 打听军事情报 933 934 934 935 #WANT 935 Ë÷Òª¹ú¼ÒÇ鱨 936 Ë÷Òª¾üÊÂÇ鱨 937 Ë÷ÒªÊÀ½çµØͼ 938 * 939 Ë÷Òª¿Æ¼¼³É¹û 940 Ë÷Òª²¿¶ÓÑз¢ 941 Ë÷ÒªÀñ½ð 942 * 943 * 944 * 945 Ë÷Òª·É´¬²¿¼þ 946 ÈöԷ½×ÔÐгö¼Û 936 索要国家情报 937 索要军事情报 938 索要世界地图 939 * 940 索要科技成果 941 索要部队研发 942 索要礼金 943 * 944 * 945 * 946 索要飞船部件 947 让对方自行出价 947 948 948 949 #OFFER 949 ·îË͹ú¼ÒÇ鱨 950 ·îË;üÊÂÇ鱨 951 ·îËÍÊÀ½çµØͼ 952 * 953 ·îËͿƼ¼³É¹û 954 ·îËͲ¿¶ÓÑз¢ 955 ·îËÍÀñ½ð 956 * 957 * 958 * 959 ·îËÍ·É´¬²¿¼þ 960 ÈöԷ½×ÔÐÐÒª¼Û 950 奉送国家情报 951 奉送军事情报 952 奉送世界地图 953 * 954 奉送科技成果 955 奉送部队研发 956 奉送礼金 957 * 958 * 959 * 960 奉送飞船部件 961 让对方自行要价 961 962 962 963 #CITYMANAGETYPE 963 ÊÖ¶¯·ÖÅä 964 ¿ÆÑÐ×î´ó»¯ 965 ¿ÆÑÐÓÅÏÈ 966 Ôö³¤×î´ó»¯ 967 Éú²úÓÅÏÈ 968 Éú²ú×î´ó»¯ 964 手动分配 965 科研最大化 966 科研优先 967 增长最大化 968 生产优先 969 生产最大化 969 970 970 971 #SETTINGS -
branches/highdpi/Localization/zh-Hans/ReadMe.txt
r124 r465 1 C-EVO( ÎÄÃ÷½ø»¯Ê·)ºº»¯ËµÃ÷1 C-EVO(文明进化史)汉化说明 2 2 3 ÓÎÏ·½éÉÜ£º 4 C-EVO ÊÇÒ»¿î´ÓÎÄÃ÷(Civilization)ϵÁÐÑÜÉú¶ø³öµÄWindowsƽ̨¿ªÔ´×ÔÓÉÓÎÏ·£¬ÔÚ×ñÑÎÄÃ÷ϵÁÐ5 »ù±¾ÔÔòµÄ»ù´¡ÉÏ£¬×öÁËÐí¶àÓд´ÒâºÍÈËÐÔ»¯µÄ¸ïУ¬ÊÇÒ»¿î¾«ÃÀÓÐȤµÄÎÄÃ÷ÀàÓÎÏ·£¬ÎÄÃ÷ÃÔ²»¿É²»Íæ¡£ 6 ¹Ù·½Ö÷Ò³£ºhttp://www.c-evo.org7 Ô°æÓÎÏ·(V1.10£¬¶ÔÓ¦ºº»¯°ü)ÏÂÔØÒ³Ã棺http://www.c-evo.org/files/download.php3 游戏介绍: 4 C-EVO是一款从文明(Civilization)系列衍生而出的Windows平台开源自由游戏,在遵循文明系列 5 基本原则的基础上,做了许多有创意和人性化的革新,是一款精美有趣的文明类游戏,文明迷不可不玩。 6 官方主页:http://www.c-evo.org 7 原版游戏(V1.10,对应汉化包)下载页面:http://www.c-evo.org/files/download.php 8 8 9 ºº»¯°üʹÓ÷½·¨£º 10 °²×°Ô°æÓÎÏ·ºó£¬½«ºº»¯°üÄÚµÄÎļþ½âѹµ½ÓÎÏ·°²×°Ä¿Â¼£¬Îñ±Ø¸²¸ÇÔÎļþ£¨Language.txt, Help\Help.txt£©£¬ 11 È»ºóÖ´ÐÐÓÎÏ·³ÌÐò¡£ 9 汉化包使用方法: 10 安装原版游戏后,将汉化包内的文件解压到游戏安装目录,务必覆盖原文件(Language.txt, Help\Help.txt), 11 然后执行游戏程序。 12 12 13 ºº»¯ËµÃ÷£º 14 1. »ù±¾ÍêÈ«ºº»¯°æ£¬³ýÁËÓÎÏ·¹ØÓÚ²¿·ÖÍâÆäËûÄÚÈÝÎÄ×ÖÈ«²¿ºº»¯£¬°üÀ¨°ïÖúÖ¸ÄÏ£¬ÎÄ×ÖÁ¿Ô¼70KB¡£15 2. ºº»¯°üÖи½´øÁ˺º»¯Õß×ÔÐÐÉè¼ÆµÄÒ»¿îÓÎÏ·µØͼ£¬Ö÷Òª¶ÔÍæ¼ÒµÄÆðʼλÖÃ×öÁËÓÅ»¯¡£16 3. ºº»¯°üÖÐÌí¼ÓÁËÓÎÏ·Ö¸ÄϵĿì½ÝÔËÐз½Ê½£¬·½±ãÍæ¼Ò²éÔÄ¡£17 4. ÓÎÏ·Ö¸ÄÏÖеÄijЩ²¿·Ö£¬Èç¿Æ¼¼¡¢ÉèÊ©¡¢Ææ¼£µÈ°ïÖú´°¿Ú£¬´°¿Ú±êÌâÏ·½µÄÊ×ÐУ¨ÎÄ×ÖÄÚÈÝÓë´°¿Ú±êÌâÏàͬ£©18 ΪÂÒÂ룬Ϊ³ÌÐò¼æÈÝÎÊÌ⣨Ê××Öĸ´óд³ö´í£©£¬ÎÞ·ÁÓÎÏ·£¬ÆäËû´¦ÉÐδ·¢ÏÖÏÔʾ´íÎó¡£ 13 汉化说明: 14 1. 基本完全汉化版,除了游戏关于部分外其他内容文字全部汉化,包括帮助指南,文字量约70KB。 15 2. 汉化包中附带了汉化者自行设计的一款游戏地图,主要对玩家的起始位置做了优化。 16 3. 汉化包中添加了游戏指南的快捷运行方式,方便玩家查阅。 17 4. 游戏指南中的某些部分,如科技、设施、奇迹等帮助窗口,窗口标题下方的首行(文字内容与窗口标题相同) 18 为乱码,为程序兼容问题(首字母大写出错),无妨游戏,其他处尚未发现显示错误。 19 19 20 ÍƼöÓÎÏ·×ÖÌ壺΢ÈíÑźڣ¬×ÖÌåÉèÖÃÎļþÒѸ½ÔÚºº»¯°üÖÐ 20 推荐游戏字体:微软雅黑,字体设置文件已附在汉化包中 21 21 22 V1.10 °æ¸üиÅÒª£º23 1 ¡¢ÓÎÏ·½çÃæ×÷Á˵÷Õû£¬Ð½çÃæ¸üÖ±¹ÛÓѺÃ24 2 ¡¢³ÇÊд°¿ÚÖÐÔöÉèÁË×ÊÔ´×Ô¶¯·ÖÅäģʽ£¬·½±ãÍæ¼Ò¿ìËÙÉèÖ㬼õÉÙÁËÈß·±µÄϸ½Ú²Ù×÷25 3 ¡¢¸ù¾ÝÍæ¼Ò·´À¡£¬ÐÞ¸ÄÁËÈýÏîÆæ¼£µÄЧ¹û26 4 ¡¢µ÷ÕûÁ˳ÇÊа²¶¨ÖµµÄÓ°Ïì²ÎÊýÒÔ¼°³õʼˮƽ27 5 ¡¢Ôö¼ÓÁ˽»Õ½½á¹ûÔ¤²â28 6 ¡¢½»ÉæÖ¸ÁîµÄÉÙÁ¿µ÷Õû£¬È¥³ýÁËÄê¹±²¿·Ö£¬²¢µ÷ÕûÁËÖÕÖ¹ÌõÔ¼µÄ²¿·ÖÉ趨29 7 ¡¢ÆäËû·½ÃæµÄ΢µ÷22 V1.10版更新概要: 23 1、游戏界面作了调整,新界面更直观友好 24 2、城市窗口中增设了资源自动分配模式,方便玩家快速设置,减少了冗繁的细节操作 25 3、根据玩家反馈,修改了三项奇迹的效果 26 4、调整了城市安定值的影响参数以及初始水平 27 5、增加了交战结果预测 28 6、交涉指令的少量调整,去除了年贡部分,并调整了终止条约的部分设定 29 7、其他方面的微调 30 30 31 ºº»¯¸üУº 32 08.06.18 1.10 °æºº»¯°üÖÆ×÷Íê³É£¬¶ÔÓ¦ÐÂÍƳöµÄ1.10Ó¢Îİ棨080526£©33 08.04.18 1.04°æºº»¯°üÖÆ×÷Íê³É£¬¶ÔÓ¦ÔÏȵÄ1.04Ó¢ÎÄ°æ31 汉化更新: 32 08.06.18 1.10版汉化包制作完成,对应新推出的1.10英文版(080526) 33 08.04.18 1.04版汉化包制作完成,对应原先的1.04英文版 34 34 35 ¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª 36 ºº»¯£¨º¹»¯£©²»ÈÝÒ×£¬×ªÔØʱÇë±£Áôºº»¯Õߣ¬Ð»Ð»¡£ 35 ————————————————————————————————————— 36 汉化(汗化)不容易,转载时请保留汉化者,谢谢。 37 37 38 NapTID £¨ÎÞÃû£©2008.06.1838 NapTID(无名)2008.06.18 -
branches/highdpi/Localization/zh-Hans/Tribes/Americans.tribe.txt
r123 r465 1 #CHOOSE ÃÀ¹ú2 #n ÃÀ¹úÈË3 #s ÃÀ¹ú4 #a ÃÀÀû¼á1 #CHOOSE 美国 2 #n 美国人 3 #s 美国 4 #a 美利坚 5 5 #COLOR FFAFAF 6 6 #SYMBOLS Nation1, 48 … … 11 11 12 12 #CITIES 13 »ªÊ¢¶Ù 14 ŦԼ 15 ²¨Ê¿¶Ù 16 ·Ñ³Ç 17 ÑÇÌØÀ¼´ó 18 Ö¥¼Ó¸ç 19 ¾É½ðɽ 20 ²¼·¨ÂÞ 21 ÂåÉ¼í¶ 22 µ×ÌØÂÉ 23 а¶ûÁ¼ 24 °Í¶ûµÄĦ 25 µ¤·ð 26 ÐÁÐÁÄÇÌá 27 ´ïÀ˹ 28 Âõ°¢ÃÜ 29 ¿°Èø˹ 30 Ê¥µü¸ê 31 ÀïÊ¿Âú 32 À˹ά¼Ó˹ 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 13 华盛顿 14 纽约 15 波士顿 16 费城 17 亚特兰大 18 芝加哥 19 旧金山 20 布法罗 21 洛杉矶 22 底特律 23 新奥尔良 24 巴尔的摩 25 丹佛 26 辛辛那提 27 达拉斯 28 迈阿密 29 堪萨斯 30 圣迭戈 31 里士满 32 拉斯维加斯 33 Phoenix 34 Seattle 35 Albuquerque 36 Portland 37 Minneapolis 38 Houston 39 Riverside 40 Anaheim 41 Nassau-Suffolk 42 Tampa 43 Oakland 44 Pittsburgh 45 St. Louis 46 Cleveland 47 Newark 48 Fort Worth 49 San Jose 50 Orlando 51 Sacramento 52 Fort Lauderdale 53 Indianapolis 54 San Antonio 55 Norfolk 56 Columbus 57 Milwaukee 58 Charlotte 59 Paterson 60 Salt Lake City 61 Greensboro 62 Austin 63 Nashville-Davidson 64 Providence 65 Raleigh 66 Hartford 67 New Brunswick 68 Memphis 69 West Palm Beach 70 Long Branch 71 Jacksonville 72 Rochester 73 Grand Rapids 74 Oklahoma City 75 Louisville 76 Greenville 77 Dayton 78 Fresno 79 Birmingham 80 Honolulu 81 Albany 82 Tucson 83 Tulsa 84 Oxnard 85 Syracuse 86 Omaha 87 Tacoma 88 Akron 89 Knoxville 90 El Paso 91 Bakersfield 92 Allentown 93 Gary 94 Harrisburg 95 Scranton 96 Toledo 97 Jersey City 98 Baton Rouge 99 Youngstown 100 Springfield 101 Sarasota 102 Wilmington 103 Little Rock 104 Ann Arbor 105 McAllen 106 Stockton 107 Charleston 108 Wichita 109 New Haven 110 Mobile 111 Columbia 112 Colorado Springs 113 113 114 114 #UNITS StdUnits 115 20, 040, Ãñ±ø 115 20, 040, 民兵 116 116 117 117 #UNITS Nation1 118 8, 134, ÇáÆï±ø 119 18, 136, л¶ûÂü̹¿Ë 120 28, 202, Ìú¼×½¢ 118 8, 134, 轻骑兵 119 18, 136, 谢尔曼坦克 120 28, 202, 铁甲舰 -
branches/highdpi/Localization/zh-Hans/Tribes/Babyl.tribe.txt
r123 r465 1 #CHOOSE °Í±ÈÂ×2 #n °Í±ÈÂ×ÈË3 #s °Í±ÈÂ×4 #a °Í±ÈÂ×1 #CHOOSE 巴比伦 2 #n 巴比伦人 3 #s 巴比伦 4 #a 巴比伦 5 5 #COLOR EFCB47 6 6 #SYMBOLS Nation2, 92 … … 11 11 12 12 #CITIES 13 °Í±ÈÂ× 14 ÎÚ¶û 15 ²¨Î÷ÅÁ 16 ÄáÄá΢ 17 ÑÇÊö 18 °¢¼ÓµÂ 19 ÎÚ³¿Ë 20 °¢¿Ëɳ 21 ¬¼ÓÔú¸ñÎ÷ 22 ÒÀÀû¶¼ 23 ÈøÂíÀ 24 À¼ÓÊ© 25 »ùÊ© 26 ÄáÆÕ¶û 27 Êæ¬°Í¿Ë 28 ˼ÅÁ¶û 29 À¶ûÈö 30 ÔúÄ°¢ 31 µÏ¶ûάÀÑÅ 32 ¶òÄ·Âí 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 13 巴比伦 14 乌尔 15 波西帕 16 尼尼微 17 亚述 18 阿加德 19 乌鲁克 20 阿克沙 21 卢加扎格西 22 依利都 23 萨马拉 24 拉加施 25 基施 26 尼普尔 27 舒卢巴克 28 思帕尔 29 拉尔撒 30 扎穆阿 31 迪尔维拉雅 32 厄姆马 33 Adab 34 Ebla 35 Calah 36 Dur Sharrukin 37 Cunaxa 38 Singara 39 Nisibis 40 Harran 41 Opis 42 Tarsus 43 Gasur 44 Aleppo 45 Basra 46 Charax 47 Hassuna 48 Larak 49 Bad-tibira 50 Cuthah 51 Isin 52 Arpad 53 Guabba 54 Jarmo 55 Tell Halaf 56 Shubat Enlil 57 Mari 58 Dur-Kurigalzu 59 59 60 60 #UNITS Nation2 61 50, 010, ÒÆÃñÕß 62 51, 040, Ãñ±ø 63 52, 101, ³¤Ã¬ÊÖ 64 53, 101, ¼ýÊÖ 65 54, 102, 쵶ÊÖ 66 55, 103, »ðǹÊÖ 67 56, 131, Æï±ø 68 57, 132, Õ½³µ 61 50, 010, 移民者 62 51, 040, 民兵 63 52, 101, 长矛手 64 53, 101, 箭手 65 54, 102, 矛刀手 66 55, 103, 火枪手 67 56, 131, 骑兵 68 57, 132, 战车 -
branches/highdpi/Localization/zh-Hans/Tribes/British.tribe.txt
r123 r465 1 #CHOOSE ²»Áеß2 #n ²»ÁеßÈË3 #s Ó¢¹ú4 #a ´ó²»Áеß1 #CHOOSE 不列颠 2 #n 不列颠人 3 #s 英国 4 #a 大不列颠 5 5 #COLOR 978367 6 6 #SYMBOLS Nation2, 95 … … 11 11 12 12 #CITIES 13 Â×¶Ø 14 Ô¼¿Ë 15 ŵ¶¡ºº 16 ºÚ˹͢˹ 17 ¿²Ìز®À× 18 ¿¼ÎÄ´¹ 19 ÎÖÀï¿Ë 20 Ŧ¿¨Ë¹¶û 21 Å£½ò 22 ÀûÎïÆÖ 23 ¶à·ð 24 ²¼À³¶Ù 25 ŵάÆæ 26 Àû×È 27 À׶¡ 28 ²®Ã÷º² 29 °£¿ËÈûÌØ 30 ½£ÇÅ 31 ˹¿¨²®ÀÕ 32 Âü³¹Ë¹ÌØ 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 13 伦敦 14 约克 15 诺丁汉 16 黑斯廷斯 17 坎特伯雷 18 考文垂 19 沃里克 20 纽卡斯尔 21 牛津 22 利物浦 23 多佛 24 布莱顿 25 诺维奇 26 利兹 27 雷丁 28 伯明翰 29 埃克塞特 30 剑桥 31 斯卡伯勒 32 曼彻斯特 33 Bristol 34 Leicester 35 Carlisle 36 Ipswich 37 Portsmouth 38 Berwick 39 Sheffield 40 Kingston upon Hull 41 Bradford 42 Stoke-on-Trent 43 Wolverhampton 44 Plymouth 45 Derby 46 Southampton 47 Dudley 48 Newcastle upon Tyne 49 Sunderland 50 Northampton 51 Preston 52 Walsall 53 Luton 54 Richmond 55 Southend-on-Sea 56 Bournemouth 57 Middlesbrough 58 West Bromwich 59 Blackpool 60 Oldbury 61 Swindon 62 Huddersfield 63 Bolton 64 Poole 65 Peterborough 66 Stockport 67 Rotherham 68 Watford 69 Slough 70 St Helens 71 Sutton Coldfield 72 Blackburn 73 Oldham 74 Basildon 75 Woking 76 Chelmsford 77 Colchester 78 Worthing 79 Gillingham 80 Eastbourne 81 Solihull 82 Rochdale 83 Birkenhead 84 Cheltenham 85 Halifax 86 Southport 87 Maidstone 88 Grimsby 89 Crawley 90 Hartlepool 91 Darlington 92 Wigan 93 Bath 94 South Shields 95 Stockton-on-Tees 96 Gateshead 97 Warrington 98 Worcester 99 St Albans 100 Lincoln 101 Chester 102 Salford 103 Hemel Hempstead 104 Basingstoke 105 Stevenage 106 Scunthorpe 107 Barnsley 108 Burnley 109 Harlow 110 Wakefield 111 Bedford 112 Newcastle-under-Lyme 113 Redditch 114 Chesterfield 115 Mansfield 116 High Wycombe 117 Chatham 118 118 119 119 #UNITS StdUnits 120 22, 040, Ãñ±ø 120 22, 040, 民兵 121 121 122 122 #UNITS Nation2 123 36, 21, Ìع¤ 124 86, 201, ÈýΦ·«´¬ 125 87, 132, ÆïÊ¿ 123 36, 21, 特工 124 86, 201, 三桅帆船 125 87, 132, 骑士 -
branches/highdpi/Localization/zh-Hans/Tribes/Chinese.tribe.txt
r123 r465 1 #CHOOSE Öйú2 #n ÖйúÈË3 #s Öйú4 #a Öлª1 #CHOOSE 中国 2 #n 中国人 3 #s 中国 4 #a 中华 5 5 #COLOR 00FFFF 6 6 #SYMBOLS Nation1, 41 … … 11 11 12 12 #CITIES 13 ±±¾© 14 ÉϺ£ 15 ¹ãÖÝ 16 ÄϾ© 17 Çൺ 18 º¼ÖÝ 19 ³É¶¼ 20 Ïã¸Û 21 Ìì½ò 22 Î人 23 °ÄÃÅ 24 À¥Ã÷ 25 Î÷°² 26 ¼ÃÄÏ 27 ¸£ÖÝ 28 Äþ²¨ 29 ³¤É³ 30 º£¿Ú 31 ÉòÑô 32 ´óÁ¬ 33 ¹þ¶û±õ 34 ÖØÇì 35 ÀÈø 36 À¼ÖÝ 37 Ö£ÖÝ 38 Äϲý 39 ºÏ·Ê 40 ÄÏÄþ 41 ÎÚ³ľÆë 42 ³¤´º 43 ̨±± 44 Ì«Ô 45 ºôºÍºÆÌØ 46 ¸ßÐÛ 47 ¸§Ë³ 48 °°É½ 49 ´óͬ 50 ÌÆɽ 51 »ù¡ 52 ÆëÆë¹þ¶û 53 ¹óÑô 54 ʯ¼Òׯ 55 °üÍ· 56 ÎÞÎý 57 ͳ·¬ 58 ¿ª·â 59 Òø´¨ 60 ºªµ¦ 61 ÐìÖÝ 62 ±¾Ïª 63 ÈýÑÇ 64 ÏÃÃÅ 65 ȪÖÝ 66 ÂåÑô 67 ·ðɽ 68 ¾Å½ 69 ËÕÖÝ 70 ÑïÖÝ 71 ¹ðÁÖ 72 ´óÇì 73 ÎÂÖÝ 74 »´ÄÏ 75 ÑÓ°² 76 ººÖÐ 77 ¸·Ð 78 ÁøÖÝ 79 ºâÑô 80 ÁÉÑô 81 ĵµ¤½ 82 Î÷Äþ 83 Óª¿Ú 84 °²Çì 85 ÕÅ¼Ò¿Ú 86 µ¤¶« 87 ³£ÖÝ 88 ¿¦Ê² 89 º×¸Ú 90 Ïæ̶ 91 Ïå·® 92 ¿µ¶¨ 93 ÃàÑô 94 ¼Ñľ˹ 95 ¾ÆȪ 96 ÄÏͨ 97 ÎäÍþ 98 ÉîÛÚ 99 Îߺþ 100 ƽ¶¥É½ 101 °ö²º 102 ÖêÖÞ 103 »Æʯ 104 ÅÊÖ¦»¨ 105 ÑĮ̀ 106 ±¦¼¦ 107 ÉÇÍ· 108 ´óÀí 109 ×ñÒå 110 ×Ô¹± 111 Õ¿½ 13 北京 14 上海 15 广州 16 南京 17 青岛 18 杭州 19 成都 20 香港 21 天津 22 武汉 23 澳门 24 昆明 25 西安 26 济南 27 福州 28 宁波 29 长沙 30 海口 31 沈阳 32 大连 33 哈尔滨 34 重庆 35 拉萨 36 兰州 37 郑州 38 南昌 39 合肥 40 南宁 41 乌鲁木齐 42 长春 43 台北 44 太原 45 呼和浩特 46 高雄 47 抚顺 48 鞍山 49 大同 50 唐山 51 基隆 52 齐齐哈尔 53 贵阳 54 石家庄 55 包头 56 无锡 57 吐鲁番 58 开封 59 银川 60 邯郸 61 徐州 62 本溪 63 三亚 64 厦门 65 泉州 66 洛阳 67 佛山 68 九江 69 苏州 70 扬州 71 桂林 72 大庆 73 温州 74 淮南 75 延安 76 汉中 77 阜新 78 柳州 79 衡阳 80 辽阳 81 牡丹江 82 西宁 83 营口 84 安庆 85 张家口 86 丹东 87 常州 88 喀什 89 鹤岗 90 湘潭 91 襄樊 92 康定 93 绵阳 94 佳木斯 95 酒泉 96 南通 97 武威 98 深圳 99 芜湖 100 平顶山 101 蚌埠 102 株洲 103 黄石 104 攀枝花 105 烟台 106 宝鸡 107 汕头 108 大理 109 遵义 110 自贡 111 湛江 112 112 113 113 #UNITS Nation1 114 1, 040, Ãñ±ø 115 11, 104, Óλ÷¶Ó 116 21, 072, Сô®°å 114 1, 040, 民兵 115 11, 104, 游击队 116 21, 072, 小舢板 -
branches/highdpi/Localization/zh-Hans/Tribes/Egyptians.tribe.txt
r123 r465 1 #CHOOSE °£¼°2 #n °£¼°ÈË3 #s °£¼°4 #a °£¼°1 #CHOOSE 埃及 2 #n 埃及人 3 #s 埃及 4 #a 埃及 5 5 #COLOR 37CFAF 6 6 #SYMBOLS Nation1, 42 … … 11 11 12 12 #CITIES 13 µ×±È˹ 14 ÃÏ·Æ˹ 15 º£ÁÒ²¨Àû˹ 16 °£ÀÕ·ÒµÙÄá 17 ÑÇÀúɽ´ó 18 ÅÉÀ÷Î÷˹ 19 ¼ªÈø 20 °Ý±ÈÂå˹ 21 °¬¶û°¢ÂêÄÇ 22 лÀ¿×²¨Àû 23 °¢±È¶à˹ 24 °¬¶û¿À 25 ÑÇÐÞÌØ 26 °¢·¥Àï˹ 27 ÀûÊ©ÌØ 28 ²¼ÍÐ 29 °£µÏ¸¥ 30 ±ÓËÉ 31 ²¼Î÷Àï˹ 32 ¿¨»ë 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 Ikkur 79 80 81 82 83 84 85 86 87 88 13 底比斯 14 孟菲斯 15 海烈波利斯 16 埃勒芬蒂尼 17 亚历山大 18 派拉梅西斯 19 吉萨 20 拜比洛斯 21 艾尔阿玛那 22 谢拉孔波利 23 阿比多斯 24 艾尔凯拉 25 亚修特 26 阿伐里斯 27 利施特 28 布托 29 埃迪弗 30 庇松 31 布西里斯 32 卡浑 33 Athribis 34 Mendes 35 El-Ashmunein 36 Tenis 37 Naukratis 38 Syene 39 Medinet Habu 40 Buhen 41 Hatnub 42 El-Kharga 43 Qift 44 Quessir 45 Fawakhir 46 Deir El-Medina 47 Fayyum 48 Sais 49 Maidum 50 Abusir 51 Zawyet al-Aryan 52 Saqqara 53 Mazghuma 54 Hawara 55 Saylah 56 Dara 57 Tukh 58 El-Kula 59 Karnak 60 Kom Ombo 61 Phile 62 Rosetta 63 Tjel 64 Edwa 65 Gebel el-Tarif 66 Hipponius 67 Dishasha 68 Kafr Hammar 69 Tarkhan 70 Esna 71 Armant 72 Naga ed-Dair 73 Deir el-Bahari 74 Naqada 75 El-Ballas 76 Tentyra 77 Qaw el-Kebir 78 Ikkur 79 Quban 80 Kumma 81 Semma 82 Uronarti 83 Shalfak 84 Mirgissa 85 Faras 86 Abu Simbel 87 Bir Nakhlai 88 Aniba 89 89 90 90 #UNITS Nation1 91 2, 040, Ãñ±ø 92 12, 101, ¼ýÊÖ 93 22, 102, ³¤Ã¬ÊÖ 91 2, 040, 民兵 92 12, 101, 箭手 93 22, 102, 长矛手 -
branches/highdpi/Localization/zh-Hans/Tribes/French.tribe.txt
r123 r465 1 #CHOOSE ·¨À¼Î÷2 #n ·¨À¼Î÷ÈË3 #s ·¨¹ú4 #a ·¨À¼Î÷1 #CHOOSE 法兰西 2 #n 法兰西人 3 #s 法国 4 #a 法兰西 5 5 #COLOR 576FC7 6 6 #SYMBOLS Nation1, 43 … … 11 11 12 12 #CITIES 13 °ÍÀè 14 °Â¶ûÁ¼ 15 Àï°º 16 À¼Ë¹ 17 ͼ¶û 18 ÂíÈü 19 ɳÌضû 20 °¢Î¬ÄáÎÌ 21 ĦÄɸç 22 ³°º 23 ¸ñÀÕŵ²¼¶û 24 µÚÈÖ 25 ÑÇÃß 26 ɪ±¤ 27 ²¨ÍßµÚ¶û 28 ͼ¬×È 29 °ÍÔ¼Ú« 30 ˹ÌØÀ˹±¤ 31 ²¼À×˹ÌØ 32 ²¨¶û¶à 33 Àï¶û 34 Äá˹ 35 ÄÏÌØ 36 Ê¥°£µÙ°² 37 ÃɱËÀû°£ 38 À׶÷ 39 ÀÕ°¢¸¥¶û 40 ÍÁÂ× 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 Chalon-sur-Saône119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 13 巴黎 14 奥尔良 15 里昂 16 兰斯 17 图尔 18 马赛 19 沙特尔 20 阿维尼翁 21 摩纳哥 22 鲁昂 23 格勒诺布尔 24 第戎 25 亚眠 26 瑟堡 27 波瓦第尔 28 图卢兹 29 巴约讷 30 斯特拉斯堡 31 布雷斯特 32 波尔多 33 里尔 34 尼斯 35 南特 36 圣埃蒂安 37 蒙彼利埃 38 雷恩 39 勒阿弗尔 40 土伦 41 Angers 42 Le Mans 43 Clermont-Ferrand 44 Aix-en-Provence 45 Limoges 46 Nimes 47 Villeurbanne 48 Metz 49 Caen 50 Mulhouse 51 Boulogne-Billancourt 52 Perpignan 53 Nancy 54 Roubaix 55 Argenteuil 56 Tourcoing 57 Montreuil 58 Saint-Denis 59 Versailles 60 Nanterre 61 Creteil 62 Aulnay-sous-Bois 63 Pau 64 Vitry-sur-Seine 65 Calais 66 Colombes 67 La Rochelle 68 Asnieres 69 Champigny-sur-Marne 70 Rueil-Malmaison 71 Saint-Maur-des-Fosses 72 Bourges 73 Antibes 74 Dunkerque 75 Courbevoie 76 Beziers 77 Cannes 78 Saint-Nazaire 79 Colmar 80 Villeneuve-d'Ascq 81 Valence 82 Lorient 83 Aubervilliers 84 Drancy 85 Merignac 86 Troyes 87 La Seyne-sur-Mer 88 Quimper 89 Antony 90 Saint-Quentin 91 Neuilly-sur-Seine 92 Noisy-le-Grand 93 Sarcelles 94 Niort 95 Pessac 96 Venissieux 97 Chambery 98 Charleville-Mezieres 99 Beauvais 100 Cergy 101 Levallois-Perret 102 Cholet 103 Issy-les-Moulineaux 104 Montauban 105 Vannes 106 Hyeres 107 Evreux 108 Maisons-Alfort 109 Laval 110 Fontenay-sous-Bois 111 Ivry-sur-Seine 112 Saint-Malo 113 Arles 114 Belfort 115 Annecy 116 Sartrouville 117 Clichy 118 Chalon-sur-Sa鬾e 119 Pantin 120 Chateauroux 121 Meaux 122 La Roche-sur-Yon 123 Blois 124 Brive-la-Gaillarde 125 Evry 126 Clamart 127 Villejuif 128 Chalons-sur-Marne 129 Sevran 130 Le Blanc-Mesnil 131 Bondy 132 Frejus 133 Narbonne 134 Epinay-sur-Seine 135 Tarbes 136 Albi 137 Saint-Brieuc 138 Chelles 139 Boulogne-sur-Mer 140 Bobigny 141 Carcassonne 142 142 143 143 #UNITS StdUnits 144 23, 040, Ãñ±ø 144 23, 040, 民兵 145 145 146 146 #UNITS Nation1 147 3, 103, »ðǹÊÖ 148 13, 104, ¹úÃñÎÀ¶Ó 149 23, 134, ²½Æï±ø 147 3, 103, 火枪手 148 13, 104, 国民卫队 149 23, 134, 步骑兵 -
branches/highdpi/Localization/zh-Hans/Tribes/Germans.tribe.txt
r123 r465 1 #CHOOSE ÈÕ¶úÂü2 #n ÈÕ¶úÂüÈË3 #s µÂ¹ú4 #a ÈÕ¶úÂü1 #CHOOSE 日耳曼 2 #n 日耳曼人 3 #s 德国 4 #a 日耳曼 5 5 #COLOR AFAFAF 6 6 #SYMBOLS Nation1, 44 … … 11 11 12 12 #CITIES 13 °ØÁÖ 14 ¿Æ¡ 15 ÑÇè¡ 16 ·¨À¼¿Ë¸£ 17 ÌØÀï¶û 18 À׸ù˹±¤ 19 ºº±¤ 20 ±ÈÀշƶûµÂ 21 Âüº£Ä· 22 ²¨¶÷ 23 ¶àÌØÃɵ 24 ĽÄáºÚ 25 ²»À³Ã· 26 ŦÂ×±¤ 27 ˹ͼ¼ÓÌØ 28 ¶ÅÈû¶û¶à·ò 29 µÂÀÛ˹¶Ù 30 ººÅµÍþ 31 ¶ÅÒÁ˹±¤ 32 À³±ÈÎý 33 °£É 34 ¿ªÄ·Äá˹ 35 ¿¨¶û˹³¶ò 36 ²¨ºè 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 13 柏林 14 科隆 15 亚琛 16 法兰克福 17 特里尔 18 雷根斯堡 19 汉堡 20 比勒菲尔德 21 曼海姆 22 波恩 23 多特蒙德 24 慕尼黑 25 不莱梅 26 纽伦堡 27 斯图加特 28 杜塞尔多夫 29 德累斯顿 30 汉诺威 31 杜伊斯堡 32 莱比锡 33 埃森 34 开姆尼斯 35 卡尔斯鲁厄 36 波鸿 37 Augsburg 38 Lubeck 39 Munster 40 Konigsberg 41 Stettin 42 Wuppertal 43 Gelsenkirchen 44 Halle 45 Wiesbaden 46 Monchengladbach 47 Braunschweig 48 Krefeld 49 Magdeburg 50 Kiel 51 Oberhausen 52 Rostock 53 Hagen 54 Erfurt 55 Freiburg 56 Kassel 57 Saarbrucken 58 Mainz 59 Hamm 60 Herne 61 Mulheim 62 Osnabruck 63 Ludwigshafen 64 Solingen 65 Leverkusen 66 Oldenburg 67 Neuss 68 Heidelberg 69 Darmstadt 70 Potsdam 71 Paderborn 72 Gottingen 73 Bremerhaven 74 Wurzburg 75 Recklinghausen 76 Wolfsburg 77 Bottrop 78 Heilbronn 79 Remscheid 80 Gera 81 Cottbus 82 Pforzheim 83 Offenbach 84 Ulm 85 Salzgitter 86 Ingolstadt 87 Siegen 88 Schwerin 89 Reutlingen 90 Furth 91 Koblenz 92 Moers 93 Bergisch Gladbach 94 Hildesheim 95 Witten 96 Kaiserslautern 97 Zwickau 98 Erlangen 99 Iserlohn 100 Jena 101 Gutersloh 102 Marl 103 Lunen 104 Velbert 105 Duren 106 Ratingen 107 Esslingen 108 Wilhelmshaven 109 Dessau 110 Hanau 111 Ludwigsburg 112 Flensburg 113 Minden 114 Brandenburg 115 Ludenscheid 116 Neumunster 117 Tubingen 118 Dorsten 119 Villingen-Schwenningen 120 Worms 121 Castrop-Rauxel 122 Gladbeck 123 Arnsberg 124 Delmenhorst 125 Frankfurt/Oder 126 Konstanz 127 Neubrandenburg 128 Viersen 129 Marburg 130 Rheine 131 Detmold 132 Bayreuth 133 Celle 134 Giessen 135 Bocholt 136 Troisdorf 137 Norderstedt 138 Dinslaken 139 Bamberg 140 Herten 141 Neuwied 142 Unna 143 Aschaffenburg 144 Lippstadt 145 Plauen 146 Aalen 147 Luneburg 148 Herford 149 Kempten 150 Grevenbroich 151 Gorlitz 152 Garbsen 153 Stralsund 154 Schwabisch Gmund 155 Kerpen 156 Dormagen 157 Fulda 158 Weimar 159 159 160 160 #UNITS StdUnits 161 20, 040, Ãñ±ø 161 20, 040, 民兵 162 162 163 163 #UNITS Nation1 164 4, 105, ²½±ø 165 14, 106, Í»»÷¶Ó 166 24, 300, ¸£¿ËÕ½¶·»ú 164 4, 105, 步兵 165 14, 106, 突击队 166 24, 300, 福克战斗机 -
branches/highdpi/Localization/zh-Hans/Tribes/Greeks.tribe.txt
r123 r465 1 #CHOOSE ¹ÅÏ£À°2 #n Ï£À°ÈË3 #s Ï£À°4 #a Ï£À°1 #CHOOSE 古希腊 2 #n 希腊人 3 #s 希腊 4 #a 希腊 5 5 #COLOR FF00BF 6 6 #SYMBOLS Nation2, 90 … … 11 11 12 12 #CITIES 13 Ñŵä 14 ˹°Í´ï 15 ¿ÆÁÖ˹ 16 ·¨ÈöÂå˹ 17 µÂ¶ûó 18 ŵË÷˹ 19 ÌØÂåÒÁ 20 ÂõÎýÄá 21 °¢¸ê˹ 22 ÈûĪƤÀ³ 23 ÀÃ×ÑÇ 24 Â޵ 25 °ÂÁÖÆ¥ÑÇ 26 ÎýÀ¿âÔú 27 ÈøÂåÄῨ 28 ÂíÀËÉ 29 °¢²¨ÂÞÄáÑÅ 30 ÂüÌÝÄáÑÇ 31 ÑÇ¿ËÐË 32 ¿¨¶û»ù˹ 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 13 雅典 14 斯巴达 15 科林斯 16 法撒洛斯 17 德尔婓 18 诺索斯 19 特洛伊 20 迈锡尼 21 阿戈斯 22 塞莫皮莱 23 拉米亚 24 罗德 25 奥林匹亚 26 锡拉库扎 27 萨洛尼卡 28 马拉松 29 阿波罗尼雅 30 曼梯尼亚 31 亚克兴 32 卡尔基斯 33 Eretria 34 Herakleia 35 Ephesos 36 Halicarnassos 37 Pergamon 38 Miletos 39 Artemisium 40 Megara 41 Cithera 42 Gythium 43 Sellasia 44 Messene 45 Mothone 46 Pherae 47 Bassae 48 Megalopolis 49 Tegea 50 Stymphalus 51 Philus 52 Tiryns 53 Troezen 54 Aegina 55 Halieis 56 Epidaurus 57 Sicyon 58 Cerynia 59 Elis 60 Brauron 61 Colonus 62 Oropus 63 Decelea 64 Tanagra 65 Ascra 66 Haliartus 67 Thebai 68 Orchomenus 69 Naupactus 70 Stratus 71 Histiaea 72 Carystus 73 Ambracia 74 Dodona 75 Corcyra 76 Buthrotum 77 Iolcus 78 Larissa 79 Gonnus 80 Pydna 81 Aegae 82 Beroea 83 Mieza 84 Pella 85 Stobi 86 Edessa 87 Olynthus 88 Potidaea 89 Acanthus 90 Uranopolis 91 Stagirus 92 Amphipolis 93 Thasos 94 Drerus 95 Gortyna 96 Hierapytna 97 Miletus 98 Ephesus 99 Mytilene 100 Atarneus 101 Pergamum 102 Sigeum 103 Sestus 104 Abdera 105 105 106 106 #UNITS Nation2 107 30, 010, ÒÆÃñÕß 108 31, 040, Ãñ±ø 109 32, 101, ÖØ×°²½±ø 110 33, 102, ·½Õó±ø 111 34, 131, Æï±ø 112 35, 132, Õ½³µ 113 37, 200, Èý½°Õ½´¬ 107 30, 010, 移民者 108 31, 040, 民兵 109 32, 101, 重装步兵 110 33, 102, 方阵兵 111 34, 131, 骑兵 112 35, 132, 战车 113 37, 200, 三桨战船 -
branches/highdpi/Localization/zh-Hans/Tribes/Japanese.tribe.txt
r123 r465 1 #CHOOSE ÈÕ±¾2 #n ÈÕ±¾ÈË3 #s ÈÕ±¾4 #a ÈÕ±¾1 #CHOOSE 日本 2 #n 日本人 3 #s 日本 4 #a 日本 5 5 #COLOR 57AB27 6 6 #SYMBOLS Nation1, 45 … … 11 11 12 12 #CITIES 13 ¾©¶¼ 14 ´óÚæ 15 ¶«¾© 16 ÈøĦ 17 ¹¶ùµº 18 ÄÎÁ¼ 19 Ãû¹ÅÎÝ 20 Éñ»§ 21 ³¤Æé 22 ºá±õ 23 ÏÂ¹Ø 24 ËÉɽ 25 Ôý»Ï 26 º¯¹Ý 27 ÒÁÊÆ 28 ¸»É½ 29 ¸£µº 30 ¸£¸Ô 31 ÏĘ́ 32 ¹ãµº 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 13 京都 14 大阪 15 东京 16 萨摩 17 鹿儿岛 18 奈良 19 名古屋 20 神户 21 长崎 22 横滨 23 下关 24 松山 25 札幌 26 函馆 27 伊势 28 富山 29 福岛 30 福冈 31 仙台 32 广岛 33 Suo 34 Bizen 35 Echizen 36 Izumi 37 Omi 38 Echigo 39 Kozuke 40 Sado 41 Izumo 42 Kawasaki 43 Kitakyushu 44 Chiba 45 Sakai 46 Kumamoto 47 Okayama 48 Sagamihara 49 Hamamatsu 50 Funabashi 51 Higashiosaka 52 Hachioji 53 Niigata 54 Amagasaki 55 Shizuoka 56 Himeji 57 Matsudo 58 Kanazawa 59 Urawa 60 Kawaguchi 61 Ichikawa 62 Utsunomiya 63 Omiya 64 Yokosuka 65 Oita 66 Kurashiki 67 Gifu 68 Hirakata 69 Toyonaka 70 Wakayama 71 Nishinomiya 72 Fukuyama 73 Fujisawa 74 Takatsuki 75 Asahikawa 76 Machida 77 Iwaki 78 Nagano 79 Toyohashi 80 Suita 81 Toyota 82 Takamatsu 83 Koriyama 84 Kawagoe 85 Okazaki 86 Kochi 87 Tokorozawa 88 Kashiwa 89 Akita 90 Naha 91 Miyazaki 92 Koshigaya 93 Aomori 94 Akashi 95 Morioka 96 Yokkaichi 97 Maebashi 98 Kasugai 99 Ichihara 100 Yao 101 Otsu 102 Tokushima 103 Ichinomiya 104 Kakogawa 105 Neyagawa 106 Ibaraki 107 Fukui 108 Yamagata 109 Hiratsuka 110 Mito 111 Sasebo 112 112 113 113 #UNITS Nation1 114 1, 040, Ãñ±ø 115 5, 101, ÎäÊ¿ 116 15, 102, ÈÌÕß 117 25, 300, Áãʽ»ú 114 1, 040, 民兵 115 5, 101, 武士 116 15, 102, 忍者 117 25, 300, 零式机 -
branches/highdpi/Localization/zh-Hans/Tribes/Mongols.tribe.txt
r123 r465 1 #CHOOSE ÃɹÅ2 #n ÃɹÅÈË3 #s ÃɹÅ4 #a ÃɹÅ1 #CHOOSE 蒙古 2 #n 蒙古人 3 #s 蒙古 4 #a 蒙古 5 5 #COLOR 8367B3 6 6 #SYMBOLS Nation2, 91 … … 11 11 12 12 #CITIES 13 ¹þÀºÍÁÖ 14 ÉÐͼ 15 ÒÁ¿Æ¿¨ÔÞ 16 ÎÚÀ¼°ÍÍÐ 17 ÎÚÀ¼Îڵ 18 ¶òµÂÄÚÌØ 19 ´ï¶ûº¹ 20 ¿ÆÒÁ°ÍÉÆ 21 Ī¡ 22 ÎÚÀ¼¸ñÄ· 23 »ô·üµÂ 24 ÎÚÁÐËþÒÁ 25 °ÍÑïºé¸ñ 26 °Â¶û»ùÒÁ 27 ËպϰÍËþ 28 °¢ÍßÒÁл 29 Èû²ßÀ×¼ª 30 É£¶÷É¢µÂ 31 °¢¶ûËþÒÁ 32 °º¶àºº 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 13 哈拉和林 14 尚图 15 伊科卡赞 16 乌兰巴托 17 乌兰乌德 18 厄德内特 19 达尔汗 20 科伊巴善 21 莫隆 22 乌兰格姆 23 霍伏德 24 乌列塔伊 25 巴扬洪格 26 奥尔基伊 27 苏合巴塔 28 阿瓦伊谢 29 塞策雷吉 30 桑恩散德 31 阿尔塔伊 32 昂多汉 33 Bulgan 34 Zuunmod 35 Baruun-Urt 36 Dalanzadgad 37 Mandalgovi 38 Zuunharaa 39 Cojr 40 Batshireet 41 Batsumber 42 Berh 43 Dariganga 44 Dasincilen 45 Hanh 46 Har-Ajrag 47 Hagtal 48 Hutag 49 Nalajh 50 Tes 51 Tosontsengel 52 Tsetserleg 53 Tumentsogt 54 54 55 55 #UNITS Nation2 56 40, 010, ÒÆÃñÕß 57 41, 040, Ãñ±ø 58 42, 102, ¼ýÊÖ 59 43, 102, µ¶ÊÖ 60 44, 103, »ðǹÊÖ 61 45, 131, Âí¹ÊÖ 62 46, 132, ÃɹÅÆï±ø 63 47, 200, ·«´¬ 56 40, 010, 移民者 57 41, 040, 民兵 58 42, 102, 箭手 59 43, 102, 刀手 60 44, 103, 火枪手 61 45, 131, 马弓手 62 46, 132, 蒙古骑兵 63 47, 200, 帆船 -
branches/highdpi/Localization/zh-Hans/Tribes/Persians.tribe.txt
r123 r465 1 #CHOOSE ²¨Ë¹2 #n ²¨Ë¹ÈË3 #s ²¨Ë¹4 #a ²¨Ë¹1 #CHOOSE 波斯 2 #n 波斯人 3 #s 波斯 4 #a 波斯 5 5 #COLOR EB830B 6 6 #SYMBOLS Nation1, 46 … … 11 11 12 12 #CITIES 13 ²¨Ë¹²¨Àû˹ 14 ÒÁ˹·¨º± 15 ËÕÈø 16 ²¼¹þÀ 17 ´ó²»ÀïÊ¿ 18 ¿¦²¼¶û 19 »ô¶ûľ×È 20 ¿Ë¶ûÂü 21 Ëþʲ¸É 22 ÉèÀ×Ó 23 ¿²´ó¹þ 24 °¢ÍßÊ¿ 25 °¢±´À 26 °ÍÊ¿À 27 ÔúºÚµ¤ 28 °¢Ê²¹þ°ÍµÂ 29 °¢°Í˹ 30 ¹þÂíµ¤ 31 ÀʲÌØ 32 ÎÚ¶ûÃ×Ò® 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 13 波斯波利斯 14 伊斯法罕 15 苏萨 16 布哈拉 17 大不里士 18 喀布尔 19 霍尔木兹 20 克尔曼 21 塔什干 22 设拉子 23 坎大哈 24 阿瓦士 25 阿贝拉 26 巴士拉 27 扎黑丹 28 阿什哈巴德 29 阿巴斯 30 哈马丹 31 拉什特 32 乌尔米耶 33 Zanjan 34 Borazjan 35 Artacoana 36 Phrada 37 Dakyanus 38 Bampur 39 Tureng Tepe 40 Nishapur 41 Ctesiphon 42 Hatra 43 Rhagae 44 Hecatompylos 45 Maracanda 46 Khorasan 47 Kyreshata 48 Bisitun 49 Jiruft 50 Darabgird 51 Siraf 52 Gur 53 Shushtar 54 Tepe Hissar 55 Kashan 56 Anshan 57 Dezful 58 Mohammerah 59 Awan 60 Simash 61 Tepe Sialk 62 62 63 63 #UNITS Nation1 64 6, 040, Ãñ±ø 65 16, 101, ³¤Ã¬ÊÖ 66 26, 102, Í䵶ÊÖ 64 6, 040, 民兵 65 16, 101, 长矛手 66 26, 102, 弯刀手 -
branches/highdpi/Localization/zh-Hans/Tribes/Phoenicians.tribe.txt
r123 r465 1 #CHOOSE óÄá»ù2 #n óÄá»ùÈË3 #s óÄá»ù4 #a óÄá»ù1 #CHOOSE 婓尼基 2 #n 婓尼基人 3 #s 婓尼基 4 #a 婓尼基 5 5 #COLOR B3FF00 6 6 #SYMBOLS Nation1, 40 … … 11 11 12 12 #CITIES 13 åÈÌ«»ù 14 ±È²¼Á÷˹ 15 Î÷¶Ù 16 Ìá¶û 17 ±´ÂÞ߯ 18 µÄÀ貨Àï 19 °Í¶û±´¿Ë 20 °¢À¶È˹ 21 Ô¼ÅÁ 22 °¢Ê©¿¦Â× 23 °¢¿ËÀï 24 ÎÚ¼ÓÀûÌØ 25 Î÷Ã×À 26 Èø·¨À¼µÂ 27 ¼ÓµØÑÇ 28 ÎÚÌῨ 29 ÂíÀ¿¦ 30 °ÍÀûÑÇ 31 ¿¨ÄªÄÉ 32 Èü¿ËÎ÷ 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 13 迦太基 14 比布流斯 15 西顿 16 提尔 17 贝罗忒 18 的黎波里 19 巴尔贝克 20 阿拉度斯 21 约帕 22 阿施喀伦 23 阿克里 24 乌加利特 25 西米拉 26 萨法兰德 27 加地亚 28 乌提卡 29 马拉喀 30 巴利亚 31 卡莫纳 32 赛克西 33 Abdera 34 Caralis 35 Panormus 36 Leptis Parva 37 Cartenna 38 Rusicade 39 Rusucurru 40 Girba 41 Leptis Magna 42 Oea 43 Sabratha 44 Carthago Nova 45 Wy't 46 Tinx 47 Rusaddit 48 Theveste 49 Bulla Regia 50 Thugga 51 Hadrumetum 52 Zama Regia 53 Thysdris 54 Madauros 55 Hippou Akra 56 Cirta 57 Cuicul 58 Tipasa 59 Lix 60 Volubilis 61 Ilici 62 Hispalis 63 Eryx 64 Motya 65 Drepanon 66 Lilybaion 67 Icosium 68 Iol 69 Eivissa 70 70 71 71 #UNITS Nation1 72 0, 040, Ãñ±ø 73 10, 131, Ïó±ø 74 20, 201, С·«´¬ 72 0, 040, 民兵 73 10, 131, 象兵 74 20, 201, 小帆船 -
branches/highdpi/Localization/zh-Hans/Tribes/Romans.tribe.txt
r123 r465 1 #CHOOSE ¹ÅÂÞÂí2 #n ÂÞÂíÈË3 #s ÂÞÂí4 #a ÂÞÂí1 #CHOOSE 古罗马 2 #n 罗马人 3 #s 罗马 4 #a 罗马 5 5 #COLOR FFFFFF 6 6 #SYMBOLS Nation1, 49 … … 11 11 12 12 #CITIES 13 ÂÞÂí 14 °Â˹µÙÑÇ 15 ÅÁÒÁ˹ëø 16 ¿¨ÆÕ°¢ 17 Ëþ¿üÄáÑÇ 18 Äá°¢²¨Àû˹ 19 ÅÓÅà 20 ¶ò¿¼ÀÅ© 21 °¢°Í¡¼Ó 22 °¢¿üÀ×ÑÇ 23 ËþÀÎ÷ÄÉ 24 ¿¨Î÷ÄÛ 25 ±´ÄÚÎÄÍÍ 26 ÈøͼÄáÑÇ 27 ¿Ë¬ÐÞ 28 °¢À×Ìï 29 ¿¨Î÷ÀïÄÛ 30 ÈÈŬÑÇ 31 ÷µÏ°ÂÀÅ© 32 Èø°ÍµÙÑÇ 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 13 罗马 14 奥斯蒂亚 15 帕伊斯滕 16 卡普阿 17 塔奎尼亚 18 尼阿波利斯 19 庞培 20 厄考拉农 21 阿巴隆加 22 阿奎雷亚 23 塔拉西纳 24 卡西嫩 25 贝内文屯 26 萨图尼亚 27 克卢修 28 阿雷田 29 卡西里嫩 30 热努亚 31 梅迪奥拉农 32 萨巴蒂亚 33 Asculum 34 Populonia 35 Castrum Novum 36 Fanum Fortunae 37 Venusia 38 Brundisium 39 Canusium 40 Panormus 41 Opitergium 42 Altinum 43 Patavium 44 Regium Lepicum 45 Augusta Taurinorum 46 Cremona 47 Mutina 48 Forum Livi 49 Forum Sempronii 50 Florentia 51 Pisae 52 Reate 53 Amiternum 54 Tarentum 55 Pometia 56 Tusculum 57 Nomentum 58 Lavinium 59 Signia 60 Antium 61 Velitrae 62 Praeneste 63 Aquilonia 64 Bonomia 65 Patavium 66 Volaterrae 67 Vetulonia 68 Potentia 69 Pisaurum 70 Aeclanum 71 Grumentum 72 Liternum 73 Puteoli 74 Fabrateria Nova 75 Sipontum 76 Buxentum 77 Castrum Hannibalis 78 Minervium 79 Augusta Praetoria 80 Brixia 81 Sena Iulia 82 Hispellum 83 83 84 84 #UNITS StdUnits 85 22, 040, Ãñ±ø 85 22, 040, 民兵 86 86 87 87 #UNITS Nation1 88 9, 101, ÂÞÂí²½±ø 89 19, 131, ÂÞÂíÆï±ø 90 29, 200, ¶à½°´¬ 88 9, 101, 罗马步兵 89 19, 131, 罗马骑兵 90 29, 200, 多桨船 -
branches/highdpi/Localization/zh-Hans/Tribes/Russians.tribe.txt
r123 r465 1 #CHOOSE ¶í¹ú2 #n ¶í¹úÈË3 #s ¶í¹ú4 #a ¶íÂÞ˹1 #CHOOSE 俄国 2 #n 俄国人 3 #s 俄国 4 #a 俄罗斯 5 5 #COLOR E70000 6 6 #SYMBOLS Nation2, 94 … … 11 11 12 12 #CITIES 13 Ī˹¿Æ 14 Ê¥±ËµÃ±¤ 15 »ù¸¨ 16 Ã÷˹¿Ë 17 °½µÂÈø 18 ˹ά¶ûµÂÂå·ò˹¿Ë 19 º£²ÎáË 20 ŵ·ò¸çÂ޵ 21 ¹þ¶û¿Æ·ò 22 ¿ËÀ˹ŵÑÇ˹¿Ë 23 ÂÞ˹Íзò 24 ¿â¶û˹¿Ë 25 ÈøÂíÀ 26 Âí¸ñÄáÍиç¶û˹¿Ë 27 ÑÅÂÞ˹ÀÎÖ 28 ÐÂÎ÷²®ÀûÑÇ 29 ¶õľ˹¿Ë 30 ˹ĦÀâ˹¿Ë 31 ±Ë¶ûÄ· 32 ÎÖÂÞÄùʲ 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 13 莫斯科 14 圣彼得堡 15 基辅 16 明斯克 17 敖德萨 18 斯维尔德洛夫斯克 19 海参崴 20 诺夫哥罗德 21 哈尔科夫 22 克拉斯诺亚斯克 23 罗斯托夫 24 库尔斯克 25 萨马拉 26 马格尼托哥尔斯克 27 雅罗斯拉沃 28 新西伯利亚 29 鄂木斯克 30 斯摩棱斯克 31 彼尔姆 32 沃罗涅什 33 Sevastopol 34 Ufa 35 Krivoy Rog 36 Niznij Novgorod 37 Chelabinsk 38 Dnipropetrovsk 39 Donetsk 40 Volgograd 41 Voronezh 42 Saratov 43 Zaporizhzhya 44 Lviv 45 Toljatti 46 Simbirsk 47 Izhevsk 48 Krasnodar 49 Chabarovsk 50 Irkutsk 51 Barnaul 52 Novokuzneck 53 Penza 54 Razan 55 Orenburg 56 Lipeck 57 Naberezhnyje Chelny 58 Mykolayiv 59 Tula 60 Gomel 61 Tumen 62 Kemerovo 63 Mariupol 64 Astrachan 65 Tomsk 66 Kirov 67 Ivanovo 68 Luhansk 69 Bransk 70 Cheboksary 71 Tver 72 Nizhnij Tagil 73 Makiyivka 74 Murmansk 75 Mogilev 76 Kurgan 77 Archangelsk 78 Sochi 79 Vitebsk 80 Vinnytsya 81 Orel 82 Stavropol 83 Simferopol 84 Kaluga 85 Vladimir 86 Belgorod 87 Machachkala 88 Kherson 89 Cherepovec 90 Poltava 91 Saransk 92 Tambov 93 Chita 94 Vladikavkaz 95 Grodno 96 Vologda 97 Chernihiv 98 Komsomolsk-na-Amure 99 Cherkasy 100 Sumy 101 Horlivka 102 Volzhskij 103 Kostroma 104 Taganrog 105 Zhytomyr 106 Petrozavodsk 107 Dzerzhinsk 108 Surgut 109 Orsk 110 Angarsk 111 Sterlitamak 112 112 113 113 #UNITS Nation2 114 70, 010, ÒÆÃñÕß 115 71, 040, Ãñ±ø 116 72, 102, ³¤Ã¬ÊÖ 117 73, 104, ²½Ç¹ÊÖ 118 74, 133, ¸çÈø¿ËÆï±ø 119 75, 134, ÇáÆï±ø 120 76, 135, T-34̹¿Ë 121 77, 301, Ã׸ñ-29114 70, 010, 移民者 115 71, 040, 民兵 116 72, 102, 长矛手 117 73, 104, 步枪手 118 74, 133, 哥萨克骑兵 119 75, 134, 轻骑兵 120 76, 135, T-34坦克 121 77, 301, 米格-29 -
branches/highdpi/Localization/zh-Hans/Tribes/Spanish.tribe.txt
r123 r465 1 #CHOOSE Î÷°àÑÀ2 #n Î÷°àÑÀÈË3 #s Î÷°àÑÀ4 #a Î÷°àÑÀ1 #CHOOSE 西班牙 2 #n 西班牙人 3 #s 西班牙 4 #a 西班牙 5 5 #COLOR FFFF00 6 6 #SYMBOLS Nation1, 47 … … 11 11 12 12 #CITIES 13 ÂíµÂÀï 14 ÈûάÀûÑÇ 15 ÍÐÀ³¶à 16 ¿Æ¶à°Í 17 ÍßÂ×Î÷ÑÇ 18 ÈøÀÂü¿¨ 19 °ÍÈûÂÞÄÇ 20 ÍßÀ¶àÀûµÂ 21 ÈøÀ¸êÈø 22 ¿¨µÏ×È 23 ±Ï¶û°Í¶õ 24 ¸ñÁÖÄÉ´ï 25 ÂíÀ¼Ó 26 ÅËÆÕÂÞÄÇ 27 ά¸ê 28 °¢Î¬À 29 Áаº 30 ĶûÎ÷ÑÇ 31 °ÂάҮ¶à 32 ɣ̹µÂ 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 13 马德里 14 塞维利亚 15 托莱多 16 科多巴 17 瓦伦西亚 18 萨拉曼卡 19 巴塞罗那 20 瓦拉多利德 21 萨拉戈萨 22 卡迪兹 23 毕尔巴鄂 24 格林纳达 25 马拉加 26 潘普罗那 27 维戈 28 阿维拉 29 列昂 30 穆尔西亚 31 奥维耶多 32 桑坦德 33 Burgos 34 Ciudad Rodrigo 35 Calatrava 36 Cartagena 37 Las Palmas 38 Palma de Mallorca 39 Alicante 40 Gijon 41 L'Hospitalet 42 A Coruna 43 Vitoria-Gasteiz 44 Santa Cruz de Tenerife 45 Badalona 46 Elche 47 Mostoles 48 Sabadell 49 Jerez de la Frontera 50 Donostia-San Sebastian 51 Fuenlabrada 52 Terrassa 53 Leganes 54 Alcala de Henares 55 Almeria 56 Getafe 57 Albacete 58 Alcorcon 59 Castellon de la Plana 60 Huelva 61 Badajoz 62 La Laguna 63 Logrono 64 Santa Coloma de Gramanet 65 Tarragona 66 Lleida 67 Jaen 68 Marbella 69 Ourense 70 Mataro 71 Algeciras 72 Dos Hermanas 73 Torrejon de Ardoz 74 Barakaldo 75 Santiago de Compostela 76 Alcobendas 77 Reus 78 Telde 79 Lugo 80 San Fernando 81 Getxo 82 Aviles 83 Caceres 84 Cornella 85 Palencia 86 Ferrol 87 Sant Boi 88 Coslada 89 Parla 90 Lorca 91 El Puerto de Santa Maria 92 Talavera de la Reina 93 Pontevedra 94 Ceuta 95 Girona 96 Melilla 97 Pozuelo de Alarcon 98 Guadalajara 99 Zamora 100 Torrent 101 Manresa 102 Ponferrada 103 El Prat 104 Chiclana de la Frontera 105 Sanlucar de Barrameda 106 Ciudad Real 107 La Linea de la Concepcion 108 Rubi 109 Alcoy 110 Gandia 111 San Sebastian de los Reyes 112 Las Rozas de Madrid 113 Torrevieja 114 Alcala de Guadaira 115 115 116 116 #UNITS StdUnits 117 22, 040, Ãñ±ø 117 22, 040, 民兵 118 118 119 119 #UNITS Nation1 120 7, 103, »ðǹÊÖ 121 17, 133, ÇáÆï±ø 122 27, 201, ¾ü½¢ 120 7, 103, 火枪手 121 17, 133, 轻骑兵 122 27, 201, 军舰 -
branches/highdpi/Localization/zh-Hans/Tribes/StdUnits.txt
r123 r465 1 0, 074, Å«Á¥À͹¤2 1, 075, ×ÔÓÉÃñÖÚ3 3, 071, СDZͧ4 4, 073, »¬Ïè»ú5 7, 064, µ¥Î¦·«´¬6 10, 010, ÍØ»ÄÕß7 11, 011, ¹¤³Ìʦ8 13, 021, ÌØÖÖ±ø9 14, 030, ½¨Éè¶Ó10 16, 017, ½¨³ÇµØ11 17, 041, ÊسÇÎÀ±ø12 20, 100, Âùսʿ13 21, 100, ¹±ø14 22, 100, Âùսʿ15 23, 100, Âùսʿ16 24, 101, ÂÞÂí¾üÍÅ17 25, 101, ³¤Ã¬ÊÖ18 26, 101, ·½Õó±ø19 27, 101, ¼ýÊÖ20 30, 102, ÊØÎÀ21 31, 102, ÊØÎÀ22 32, 102, ÊØÎÀ23 33, 102, ÊØÎÀ24 34, 103, »ðǹÊÖ25 35, 103, »ðǹÊÖ26 36, 103, »ðǹÊÖ27 37, 103, »ðǹÊÖ28 40, 104, ²½Ç¹ÊÖ29 41, 104, ²½Ç¹ÊÖ30 42, 104, ²½Ç¹ÊÖ31 43, 104, ²½Ç¹ÊÖ32 44, 105, ²½±ø33 45, 105, ²½±ø34 46, 105, ²½±ø35 47, 105, ²½±ø36 50, 106, ½ս¶Ó37 51, 106, ½ս¶Ó38 52, 106, ½ս¶Ó39 53, 106, ½ս¶Ó40 54, 110, ×°¼×²½±ø41 55, 110, ×°¼×²½±ø42 56, 110, ×°¼×²½±ø43 57, 110, ×°¼×²½±ø44 60, 130, Æï±ø45 61, 130, Æï±ø46 62, 130, Æï±ø47 63, 130, Æï±ø48 64, 131, Æï±ø49 65, 131, Æï±ø50 66, 131, Æï±ø51 67, 131, Æï±ø52 70, 132, ÆïÊ¿53 71, 132, ÆïÊ¿54 72, 132, ÆïÊ¿55 73, 132, ÆïÊ¿56 74, 133, ÁúÆï±ø57 75, 133, ÁúÆï±ø58 76, 133, ÁúÆï±ø59 77, 133, ÁúÆï±ø60 80, 134, ÇáÆï±ø61 81, 134, ÇáÆï±ø62 82, 134, ÇáÆï±ø63 83, 134, ÇáÆï±ø64 84, 135, ̹¿Ë65 85, 135, ̹¿Ë66 86, 135, ̹¿Ë67 87, 135, ̹¿Ë68 90, 136, ×°¼×³µ69 91, 136, ×°¼×³µ70 92, 136, ×°¼×³µ71 93, 136, ×°¼×³µ72 100, 170, Ͷʯ³µ73 101, 170, ¹¥³ÇËþ74 102, 170, åóÅÚ75 103, 170, åóÅÚ76 104, 171, ¼ÓÅ©ÅÚ77 105, 171, ¼ÓÅ©ÅÚ78 106, 171, ¼ÓÅ©ÅÚ79 107, 171, ¼ÓÅ©ÅÚ80 110, 172, Áñµ¯ÅÚ81 111, 172, Áñµ¯ÅÚ82 112, 172, Áñµ¯ÅÚ83 113, 172, Áñµ¯ÅÚ84 114, 173, »ð¼ýÅÚ85 115, 173, »ð¼ýÅÚ86 116, 173, »ð¼ýÅÚ87 117, 173, »ð¼ýÅÚ88 120, 200, ·«´¬89 121, 200, ·«´¬90 122, 200, ·«´¬91 123, 200, ·«´¬92 124, 201, ´ó·«´¬93 125, 201, ¿ìËÙ·«´¬94 126, 201, »¤ÎÀ½¢95 127, 201, »¤ÎÀ½¢96 130, 202 Ìú¼×½¢97 131, 202, ÇýÖð½¢98 132, 202, ѲÑó½¢99 133, 202, ѲÑó½¢100 134, 203, µ¼µ¯Ñ²Ñó½¢101 135, 203, Õ½Áн¢102 136, 203, Õ½ÁÐѲÑó½¢103 137, 203, Õ½Áн¢104 140, 210, ÔËÊä½¢105 141, 210, ÔËÊä½¢106 142, 210, ÔËÊä½¢107 143, 210, ÔËÊä½¢108 144, 220, º½Ä¸109 145, 220, º½Ä¸110 146, 220, º½Ä¸111 147, 220, º½Ä¸112 150, 240, DZͧ113 151, 240, DZͧ114 152, 240, DZͧ115 153, 240, DZͧ116 160, 300, Õ½¶·»ú117 161, 300, Õ½¶·»ú118 162, 300, Õ½¶·»ú119 163, 300, Õ½¶·»ú120 164, 301, ÅçÆøÕ½¶·»ú121 165, 301, ÅçÆøÕ½¶·»ú122 166, 301, Ö±Éý»ú123 167, 301, ÅçÆøÕ½¶·»ú124 170, 310, ºäÕ¨»ú125 171, 310, ºäÕ¨»ú126 172, 310, ·Éͧ127 173, 310, ºäÕ¨»ú128 174, 311, ÏÖ´úºäÕ¨»ú129 175, 311, ÏÖ´úºäÕ¨»ú130 176, 311, ÏÖ´úºäÕ¨»ú131 177, 311, ÏÖ´úºäÕ¨»ú1 0, 074, 奴隶劳工 2 1, 075, 自由民众 3 3, 071, 小潜艇 4 4, 073, 滑翔机 5 7, 064, 单桅帆船 6 10, 010, 拓荒者 7 11, 011, 工程师 8 13, 021, 特种兵 9 14, 030, 建设队 10 16, 017, 建城地 11 17, 041, 守城卫兵 12 20, 100, 蛮战士 13 21, 100, 弓兵 14 22, 100, 蛮战士 15 23, 100, 蛮战士 16 24, 101, 罗马军团 17 25, 101, 长矛手 18 26, 101, 方阵兵 19 27, 101, 箭手 20 30, 102, 守卫 21 31, 102, 守卫 22 32, 102, 守卫 23 33, 102, 守卫 24 34, 103, 火枪手 25 35, 103, 火枪手 26 36, 103, 火枪手 27 37, 103, 火枪手 28 40, 104, 步枪手 29 41, 104, 步枪手 30 42, 104, 步枪手 31 43, 104, 步枪手 32 44, 105, 步兵 33 45, 105, 步兵 34 46, 105, 步兵 35 47, 105, 步兵 36 50, 106, 陆战队 37 51, 106, 陆战队 38 52, 106, 陆战队 39 53, 106, 陆战队 40 54, 110, 装甲步兵 41 55, 110, 装甲步兵 42 56, 110, 装甲步兵 43 57, 110, 装甲步兵 44 60, 130, 骑兵 45 61, 130, 骑兵 46 62, 130, 骑兵 47 63, 130, 骑兵 48 64, 131, 骑兵 49 65, 131, 骑兵 50 66, 131, 骑兵 51 67, 131, 骑兵 52 70, 132, 骑士 53 71, 132, 骑士 54 72, 132, 骑士 55 73, 132, 骑士 56 74, 133, 龙骑兵 57 75, 133, 龙骑兵 58 76, 133, 龙骑兵 59 77, 133, 龙骑兵 60 80, 134, 轻骑兵 61 81, 134, 轻骑兵 62 82, 134, 轻骑兵 63 83, 134, 轻骑兵 64 84, 135, 坦克 65 85, 135, 坦克 66 86, 135, 坦克 67 87, 135, 坦克 68 90, 136, 装甲车 69 91, 136, 装甲车 70 92, 136, 装甲车 71 93, 136, 装甲车 72 100, 170, 投石车 73 101, 170, 攻城塔 74 102, 170, 弩炮 75 103, 170, 弩炮 76 104, 171, 加农炮 77 105, 171, 加农炮 78 106, 171, 加农炮 79 107, 171, 加农炮 80 110, 172, 榴弹炮 81 111, 172, 榴弹炮 82 112, 172, 榴弹炮 83 113, 172, 榴弹炮 84 114, 173, 火箭炮 85 115, 173, 火箭炮 86 116, 173, 火箭炮 87 117, 173, 火箭炮 88 120, 200, 帆船 89 121, 200, 帆船 90 122, 200, 帆船 91 123, 200, 帆船 92 124, 201, 大帆船 93 125, 201, 快速帆船 94 126, 201, 护卫舰 95 127, 201, 护卫舰 96 130, 202 铁甲舰 97 131, 202, 驱逐舰 98 132, 202, 巡洋舰 99 133, 202, 巡洋舰 100 134, 203, 导弹巡洋舰 101 135, 203, 战列舰 102 136, 203, 战列巡洋舰 103 137, 203, 战列舰 104 140, 210, 运输舰 105 141, 210, 运输舰 106 142, 210, 运输舰 107 143, 210, 运输舰 108 144, 220, 航母 109 145, 220, 航母 110 146, 220, 航母 111 147, 220, 航母 112 150, 240, 潜艇 113 151, 240, 潜艇 114 152, 240, 潜艇 115 153, 240, 潜艇 116 160, 300, 战斗机 117 161, 300, 战斗机 118 162, 300, 战斗机 119 163, 300, 战斗机 120 164, 301, 喷气战斗机 121 165, 301, 喷气战斗机 122 166, 301, 直升机 123 167, 301, 喷气战斗机 124 170, 310, 轰炸机 125 171, 310, 轰炸机 126 172, 310, 飞艇 127 173, 310, 轰炸机 128 174, 311, 现代轰炸机 129 175, 311, 现代轰炸机 130 176, 311, 现代轰炸机 131 177, 311, 现代轰炸机 -
branches/highdpi/Localization/zh-Hans/Tribes/Vikings.tribe.txt
r123 r465 1 #CHOOSE ά¾©2 #n ά¾©ÈË3 #s ά¾©4 #a ά¾©1 #CHOOSE 维京 2 #n 维京人 3 #s 维京 4 #a 维京 5 5 #COLOR 9FBB8B 6 6 #SYMBOLS Nation2, 93 … … 11 11 12 12 #CITIES 13 ÌØ¡ºÕÄ· 14 ÎÚÆÕÈøÀ 15 °Â¶ûºú˹ 16 ά±¤ 17 ÂÞ˹»ùÀÕ 18 Áֵ»ôÄ· 19 ˹¿¨À 20 Å·µÇÈû 21 À¼µÂ 22 ˹µÂ¸ç¶ûĦ 23 °Â˹½ 24 ¸ç±¾¹þ¸ù 25 ¸çµÂ±¤ 26 Âí¶ûĬ 27 ±°¶û¸ù 28 °Â¶û±¤ 29 ºÕ¶ûÐÁ±¤ 30 À׿ËÑÅδ¿Ë 31 °ÂÀײ¼Âå 32 ŵ¶û¿Æƽ 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 13 特隆赫姆 14 乌普萨拉 15 奥尔胡斯 16 维堡 17 罗斯基勒 18 林德霍姆 19 斯卡拉 20 欧登塞 21 兰德 22 斯德哥尔摩 23 奥斯陆 24 哥本哈根 25 哥德堡 26 马尔默 27 卑尔根 28 奥尔堡 29 赫尔辛堡 30 雷克雅未克 31 奥雷布洛 32 诺尔科平 33 Linkoping 34 Vasteras 35 Jonkoping 36 Kaupang 37 Hladir 38 The Udal 39 Jorvik 40 Westness 41 Ravning Enge 42 Birka 43 Jarlshof 44 Sigtuna 45 Larne 46 Hedeby 47 Aldeigjuborg 48 Nonnebakken 49 Stavanger 50 Umea 51 Baerum 52 Boras 53 Sundsvall 54 Gavle 55 Frederiksberg 56 Eskilstuna 57 Halmstad 58 Huddinge 59 Esbjerg 60 Karlstad 61 Sodertalje 62 Nacka 63 Kristianstad 64 Vaxjo 65 Botkyrka 66 Skelleftea 67 Lulea 68 Kristiansand 69 Haninge 70 Gentofte 71 Fredrikstad 72 Kungsbacka 73 Randers 74 Gladsakse 75 Kolding 76 Karlskrona 77 Jarfalla 78 Taby 79 Kalmar 80 Helsingor 81 Ostersund 82 Tromso 83 Sollentuna 84 Herning 85 Gotland 86 Solna 87 Horsens 88 Molndal 89 Ornskoldsvik 90 Falun 91 Drammen 92 Vejle 93 Trollhattan 94 Varberg 95 Norrtalje 96 Silkeborg 97 Sandnes 98 Lyngby-Tarbaek 99 Skien 100 Skovde 101 Hvidovre 102 Nykoping 103 Uddevalla 104 Hassleholm 105 Asker 106 Fredericia 107 Greve 108 Borlange 109 Sarpsborg 110 Naestved 111 Hoje Tastrup 112 Ballerup 113 Svendborg 114 Lillehammer 115 Kopavogur 116 Hafnarfjordur 117 Akureyri 118 Godthab 119 Holsteinsborg 120 120 121 121 #UNITS Nation2 122 60, 010, ÒÆÃñÕß 123 61, 040, Ãñ±ø 124 62, 101, ³¤Ã¬ÊÖ 125 63, 101, Âùսʿ 126 64, 102, ¼ýÊÖ 127 65, 102, ½£Ê¿ 128 66, 102, ½£Ê¿ 129 67, 133, ·çÆï±ø 122 60, 010, 移民者 123 61, 040, 民兵 124 62, 101, 长矛手 125 63, 101, 蛮战士 126 64, 102, 箭手 127 65, 102, 剑士 128 66, 102, 剑士 129 67, 133, 风骑兵 -
branches/highdpi/Localization/zh-Hant/Help/Help.txt
r464 r465 1 #HELPTITLE_MAIN ´åÀ¸«ü«n2 #HELPTITLE_QUICKSTART §Ö³t¤W¤â3 #HELPTITLE_CONCEPTS ·§©À¸Ñ»¡4 #HELPTITLE_TECHLIST ¬ì§Þ¤@Äý5 #HELPTITLE_IMPLIST «°¥«³]¬I6 #HELPTITLE_UNIQUELIST °ê®a¤uµ{7 #HELPTITLE_WONDERLIST ¥@¬É©_¸ñ8 #HELPTITLE_TERLIST ¦a§ÎÏúÃþ9 #HELPTITLE_JOBLIST ¦a§Î«Ø³]10 #HELPTITLE_MODELLIST ¯S®í³¡¶¤11 #HELPTITLE_FEATURELIST ³¡¶¤ÄÝ©Ê12 #HELPTITLE_FEATURE1LIST °ò¥»ÄÝ©Ê13 #HELPTITLE_FEATURE2LIST ¯S®íÄÝ©Ê14 #HELPTITLE_FEATURE3LIST ¬ì§ÞÄÝ©Ê15 #HELPTITLE_GOVLIST ¬FÊ^¤@Äý16 #HELPTITLE_KEYS §Ö±¶¾Þ§@17 #HELPTITLE_ABOUT Ãö¤_´åÀ¸18 #HELPTITLE_CREDITS ¨î§@¦W³æ19 #HELPTITLE_SEARCHRESULTS ·j¯Áµ²ªG20 21 #HELPSPEC_TER ( ¦a§ÎÏúÃþ)22 #HELPSPEC_ADV ( ¬ì§Þ¦¨ªG)23 #HELPSPEC_FUTURE ( ¥¼¨Ó¬ì§Þ)24 #HELPSPEC_IMP ( «°¥«³]¬I)25 #HELPSPEC_NAT ( °ê®a¤uµ{)26 #HELPSPEC_WONDER ( ¥@¬É©_¸ñ)27 #HELPSPEC_SHIPPART ( ¸²î³¡¥ó)28 #HELPSPEC_CAP ( ³¡¶¤°ò¥»ÄÝ©Ê)29 #HELPSPEC_FEATURE ( ³¡¶¤¯S®íÄÝ©Ê)30 #HELPSPEC_STANDARD ( ³¡¶¤¬ì§ÞÄÝ©Ê)1 #HELPTITLE_MAIN 游戲指南 2 #HELPTITLE_QUICKSTART 快速上手 3 #HELPTITLE_CONCEPTS 概念解說 4 #HELPTITLE_TECHLIST 科技一覽 5 #HELPTITLE_IMPLIST 城市設施 6 #HELPTITLE_UNIQUELIST 國家工程 7 #HELPTITLE_WONDERLIST 世界奇跡 8 #HELPTITLE_TERLIST 地形种類 9 #HELPTITLE_JOBLIST 地形建設 10 #HELPTITLE_MODELLIST 特殊部隊 11 #HELPTITLE_FEATURELIST 部隊屬性 12 #HELPTITLE_FEATURE1LIST 基本屬性 13 #HELPTITLE_FEATURE2LIST 特殊屬性 14 #HELPTITLE_FEATURE3LIST 科技屬性 15 #HELPTITLE_GOVLIST 政体一覽 16 #HELPTITLE_KEYS 快捷操作 17 #HELPTITLE_ABOUT 關于游戲 18 #HELPTITLE_CREDITS 制作名單 19 #HELPTITLE_SEARCHRESULTS 搜索結果 20 21 #HELPSPEC_TER (地形种類) 22 #HELPSPEC_ADV (科技成果) 23 #HELPSPEC_FUTURE (未來科技) 24 #HELPSPEC_IMP (城市設施) 25 #HELPSPEC_NAT (國家工程) 26 #HELPSPEC_WONDER (世界奇跡) 27 #HELPSPEC_SHIPPART (飛船部件) 28 #HELPSPEC_CAP (部隊基本屬性) 29 #HELPSPEC_FEATURE (部隊特殊屬性) 30 #HELPSPEC_STANDARD (部隊科技屬性) 31 31 32 32 #TECHFORMULA %.6g*n*EXP(n/%.6g) 33 #PREREQ ¥ý´Á©Ò»Ý¬ì§Þ34 #PREREQALT ¥ý´Á©Ò»Ý¬ì§Þ (¤T¶µ¤¤»Ý¨ã³Æ¨â¶µ)35 #BASETECH ( ¦E®É¥N¬ì§Þ)36 #STRENGTHUP %s: ¾Ô¤æ¤O¿¼W¦]¤l+%d37 #COSTUP ( ³yɲ¿¼W¦]¤l+%d)38 #COSTMIN ( ³yɲ¿¼W¦]¤l ¤W¤É¦Ü%d)39 #TRANSUP %s: ¹B¿é¤O¿¼W¦]¤l+%d40 #ADVEFFECT ¥\®Ä41 #EFFECT ®ÄªG42 #COSTS ³yɲ43 #BUILDCOST ¥Í²£³yɲ: %d%%p44 #MAINTCOST ºûÅ@¶O¥Î: ¨C¦^¦X%d%%c45 #REPLACE §ó´À46 #REPLACETEXT ¦¹³]¬I«Ø¦¨¦Z, ¤U¦C³]¬I±N¦Û°Ê§@¼o, Åܽæ§é²{:47 #EXPIRATION ¹L´Á48 #EXPWITH %s µo²{¤§¦Z, ¸Ó®ÄªG±N¹L´Á.49 #EXPSLAVE ©Ò¦³¥£Æצ¨¬°¦Û¥Ñ¤H, ¦}°±¤î¤u§@.50 #REQUIRED ©Ò»Ý¬ì§Þ: %s51 #RAREREQUIRED ¥Í²£»Ýn%s52 #RESFOOD ³¹: %d%%f53 #RESPROD ¥Í²£: %d%%p54 #RESTRADE ¶T©ö: %d%%t55 #MOREIRR ( Äéµ@¦Z+%d%%f)56 #MOREMINE ( ªöÄq¦Z+%d%%p)57 #MOREROAD ( ׸ô¦Z+%d%%t)58 #SPECIAL ¯S®í¸ê·½33 #PREREQ 先期所需科技 34 #PREREQALT 先期所需科技 (三項中需具備兩項) 35 #BASETECH (划時代科技) 36 #STRENGTHUP %s: 戰斗力倍增因子 +%d 37 #COSTUP (造价倍增因子 +%d) 38 #COSTMIN (造价倍增因子 上升至 %d) 39 #TRANSUP %s: 運輸力倍增因子 +%d 40 #ADVEFFECT 功效 41 #EFFECT 效果 42 #COSTS 造价 43 #BUILDCOST 生產造价: %d%%p 44 #MAINTCOST 維護費用: 每回合 %d%%c 45 #REPLACE 更替 46 #REPLACETEXT 此設施建成后, 下列設施將自動作廢, 變賣折現: 47 #EXPIRATION 過期 48 #EXPWITH %s發現之后, 該效果將過期. 49 #EXPSLAVE 所有奴成為自由人, 并停止工作. 50 #REQUIRED 所需科技: %s 51 #RAREREQUIRED 生產需要 %s 52 #RESFOOD 糧食: %d%%f 53 #RESPROD 生產: %d%%p 54 #RESTRADE 貿易: %d%%t 55 #MOREIRR (灌溉后 +%d%%f) 56 #MOREMINE (采礦后 +%d%%p) 57 #MOREROAD (修路后 +%d%%t) 58 #SPECIAL 特殊資源 59 59 #SPECIALFOOD , +%d%%f 60 60 #SPECIALPROD , +%d%%p 61 61 #SPECIALTRADE , +%d%%t 62 #TRAFO ¦a§Î¥iÅܧó¬°%s63 #MOVEPLAIN ³¡¶¤²¾°ÊÃþ«¬: ¥©Z¦a§Î64 #MOVEHEAVY ³¡¶¤²¾°ÊÃþ«¬: ±T¹ò¦a§Î65 #DEFBONUS ¨¾±s¥[¦¨: %d%%66 #JOBCOST - «Ø³]³yɲ: %s ¦æ°ÊÂI67 #JOBCOSTVAR - «Ø³]³yɲ: ½Ð¦b´åÀ¸¤¤¿ï¾Ü"¨t²Îµæ³æ" - "§Ö³t§»¾Þ§@" - "¦a§Î§ï³y"68 #TERIMPEXCLUDE Äéµ@¡BªöÄq¡Bn¶ë©Mx¨Æ°ò¦a¤£¥i¦@¦s¤_¦P¤@¦a¶ô. ¨Ò¦p, Y¦b¤w«Ø¦³n¶ëªº¦a¶ô«Ø³]x¨Æ°ò¦a, «hn¶ë±N®ø¥¢, x¨Æ°ò¦a¨ú¦Ó¥N¤§.69 #TERIMPCITY «°¥«©Ò¦bªº¦a¶ô, ¦P®É¥]§t¥H¤U®ÄªG:\-¹D¸ô\-ÅK¸ô (ÅK¸ô¬ì§Þµo²{¦Z)\-¹Bªe\-Äéµ@\-¹A³õ.70 #HOSTILE ¦b´c¤g¤W³q¦æ©Î¾n¤ãªº³¡¶¤, ¨äª¬ºA·|¨ü¨ì·l¶Ë, ¨ü·l¤ñ¨ÒÉO®ø¯Óªº¦æ°ÊÂI¦¨¥¿¤ñ, ¾n¤ã¤@¦^¦X, ±N·l¥¢%d%%ªºª¬ºA. ªe¬y¡Bºñ¬w¡B¹Bªe©Îx¨Æ°ò¦a¥i©è®ø´c¤gªºt±¼vÅT.71 #DEADLANDS ´c¤gµLªk¶i¦æ¥ô¦ó§ï³y.72 #RARE ¨C¤@±iÀHÉó¦a¹Ï¤W, ³£¦³12¶ô´c¤g, ¨ä¤¤¤@¥bÄÂõۯS®í¸ê·½, ¨CÏú¯S®í¸ê·½¦U¦³¨â³B.73 #STRENGTH ¾Ô¤æ: %d/%d74 #SPEED Éó°Ê: %s75 #MODELNOTE ( ¦b¤£¦P°ê®a¤¤, ¦PÏú³¡¶¤ªº¥~Æ[©M¦WºÙ¥i¯à¦³©Ò®tÉÝ.)76 #COSTBASE ¥Í²£³yɲ°òÈ%s%%p77 #WEIGHT ½s¨î%s%%w78 #BUILDALLOW ·s¼W³]¬I79 #MODELALLOW ¥i©º¯S®í³¡¶¤80 #FEATALLOW ·s¼W¯S®íÄÝ©Ê81 #FOLLOWADV ¦ZÄò¬ì§Þ82 #GOVALLOW ¥X²{·s¥Í¬FÊ^83 #UPGRADEALLOW x¨Æ¼vÅT84 #SEEALSO ¥t½Ð°Ñ¾\:85 #FUTURETECHHELP25 ¥Nªí¤F¥¼¨Óªº¬ì§Þ»â°ì. ¦b¦¹»â°ì¤U, ¨CÓ°ê®a³Ì¦h¥i¬ãµo25¶µ¬ì¬ã¦¨ªG.\\86 ¨C¶µ¥¼¨Ó¬ì§Þ»Ýnì¥ý4¿ªº¬ãµo¸êª÷. ÉO¨ä¥L¬ì§Þ¦¨ªG¤£¦P, ¥¼¨Ó¬ì§Þ¤£¥i¥Î§@¥~¥æ¥æ¯Aªº¯|½X, ¤]µLªk±q¤j¹Ï®ÑÀ]¤¤ª½±µÀò¨ú.87 #FUTURETECHHELP100 ¥Nªí¤F¥¼¨Óªº¬ì§Þ»â°ì. ¦b¦¹»â°ì¤U, ¨CÓ°ê®a³Ì¦h¥i¬ãµo100¶µ¬ì¬ã¦¨ªG.\\88 ¨C¶µ¥¼¨Ó¬ì§Þ»Ýnì¥ý4¿ªº¬ãµo¸êª÷. ÉO¨ä¥L¬ì§Þ¦¨ªG¤£¦P, ¥¼¨Ó¬ì§Þ¤£¥i¥Î§@¥~¥æ¥æ¯Aªº¯|½X, ¤]µLªk±q¤j¹Ï®ÑÀ]¤¤ª½±µÀò¨ú.89 #CRED_CAPSOUND Ánµ90 #CRED_CAPAI ¤H¤u´¼¯à¼Ò¶ô91 #CRED_CAPLANG ¤¤¤å¤Æª©¥»92 #AUTHOR @NAPTID\ ²Ê^¤¤¤åª©¥Ñ NapTID(µL¦W) ½Ķ¨î§@.93 #MATCHES ²Å¦X "%s"ªº·j¯Áµ²ªG:94 #NOMATCHES ¥¼µo²{¥]§t "%s" ªº¥ô¦ó·j¯Áµ²ªG.62 #TRAFO 地形可變更為 %s 63 #MOVEPLAIN 部隊移動類型: 平坦地形 64 #MOVEHEAVY 部隊移動類型: 崎嶇地形 65 #DEFBONUS 防御加成: %d%% 66 #JOBCOST -建設造价: %s 行動點 67 #JOBCOSTVAR -建設造价: 請在游戲中選擇"系統菜單" - "快速宏操作" - "地形改造" 68 #TERIMPEXCLUDE 灌溉、采礦、要塞和軍事基地不可共存于同一地塊. 例如, 若在已建有要塞的地塊建設軍事基地, 則要塞將消失, 軍事基地取而代之. 69 #TERIMPCITY 城市所在的地塊, 同時包含以下效果:\-道路\-鐵路 (鐵路科技發現后)\-運河\-灌溉\-農場. 70 #HOSTILE 在惡土上通行或駐扎的部隊, 其狀態會受到損傷, 受損比例与消耗的行動點成正比, 駐扎一回合, 將損失%d%%的狀態. 河流、綠洲、運河或軍事基地可抵消惡土的負面影響. 71 #DEADLANDS 惡土無法進行任何改造. 72 #RARE 每一張隨机地圖上, 都有12塊惡土, 其中一半蘊藏著特殊資源, 每种特殊資源各有兩處. 73 #STRENGTH 戰斗: %d/%d 74 #SPEED 机動: %s 75 #MODELNOTE (在不同國家中, 同种部隊的外觀和名稱可能有所差异.) 76 #COSTBASE 生產造价基值 %s%%p 77 #WEIGHT 編制 %s%%w 78 #BUILDALLOW 新增設施 79 #MODELALLOW 可征特殊部隊 80 #FEATALLOW 新增特殊屬性 81 #FOLLOWADV 后續科技 82 #GOVALLOW 出現新生政体 83 #UPGRADEALLOW 軍事影響 84 #SEEALSO 另請參閱: 85 #FUTURETECHHELP25代表了未來的科技領域. 在此領域下, 每個國家最多可研發25項科研成果.\\ 86 每項未來科技需要原先4倍的研發資金. 与其他科技成果不同, 未來科技不可用作外交交涉的砝碼, 也無法從大圖書館中直接獲取. 87 #FUTURETECHHELP100 代表了未來的科技領域. 在此領域下, 每個國家最多可研發100項科研成果.\\ 88 每項未來科技需要原先4倍的研發資金. 与其他科技成果不同, 未來科技不可用作外交交涉的砝碼, 也無法從大圖書館中直接獲取. 89 #CRED_CAPSOUND 聲音 90 #CRED_CAPAI 人工智能模塊 91 #CRED_CAPLANG 中文化版本 92 #AUTHOR @NAPTID\簡体中文版由 NapTID(無名) 翻譯制作. 93 #MATCHES 符合 "%s"的搜索結果: 94 #NOMATCHES 未發現包含 "%s" 的任何搜索結果. 95 95 96 96 97 97 #CONCEPTS 98 $ ·§©À¸Ñ»¡\99 100 ;INTRO ´åÀ¸¤¶²Ð\\101 102 ! ´åÀ¸¸Ñ»¡\103 ;BASICS ·§½×\104 ;SCIENCE ¬ì§Þ\105 ;DIPLOMACY ¥~¥æ\106 ;SHIP ÀòÐ`\\107 108 ! ³¡¶¤¸Ñ»¡\109 ;MOVEMENT ³¡¶¤²¾°Ê\110 ;COMMANDS ³¡¶¤«ü¥O\111 ;SETTLE ²¾¥Á¤u§@\112 ;COMBAT ¾Ô¤æ¤j¥þ\113 ;SPYMISSIONS ¯µ±K¦æ°Ê\114 ;CLASSES ³¡¶¤¬ãµo\\115 116 ! «°¥«¸Ñ»¡\117 ;CITIES «°¥«ºÞ²z\118 ;PRODUCTION ¥Í²£¸Ô¸Ñ\119 ;BUILDINGS «Øµ®¤¶²Ð\120 ;SUPPORT ³¡¶¤Æ×ÄÝ\\121 122 ! ¨ä¥L·§©À\123 ;MACRO §Ö³t§»¾Þ§@\124 ;MAPEDIT ¦a¹Ï½s¿è¾¹\125 ;AIT ¹q¸£¹ï¨M98 $概念解說\ 99 100 ;INTRO 游戲介紹\\ 101 102 !游戲解說\ 103 ;BASICS 概論\ 104 ;SCIENCE 科技\ 105 ;DIPLOMACY 外交\ 106 ;SHIP 獲胜\\ 107 108 !部隊解說\ 109 ;MOVEMENT 部隊移動\ 110 ;COMMANDS 部隊指令\ 111 ;SETTLE 移民工作\ 112 ;COMBAT 戰斗大全\ 113 ;SPYMISSIONS 秘密行動\ 114 ;CLASSES 部隊研發\\ 115 116 !城市解說\ 117 ;CITIES 城市管理\ 118 ;PRODUCTION 生產詳解\ 119 ;BUILDINGS 建筑介紹\ 120 ;SUPPORT 部隊屬\\ 121 122 !其他概念\ 123 ;MACRO 快速宏操作\ 124 ;MAPEDIT 地圖編輯器\ 125 ;AIT 電腦對決 126 126 127 127 128 128 #ABOUT 129 $ Ãö¤_´åÀ¸\129 $關于游戲\ 130 130 131 131 &LOGO\\ 132 132 133 ! °_·½¤Î¥Ø¼Ð\133 !起源及目標\ 134 134 C-evo is a non-commerical game project based on the famous "Sid Meier's 135 135 Civilization" by Microprose. The ambition of C-evo is not, to compete with … … 140 140 ::E2 c-evo.org\\ 141 141 142 ! ©Ò¦³Åv³\¥i\142 !所有權許可\ 143 143 C-evo is a compilation of work by a number of authors. You are allowed 144 144 to play the game and to distribute it without explicit permission. The compilation … … 148 148 the graphics, you should ask the author of an item before using it for another 149 149 purpose than to play.\ 150 ::C ¬d¬Ý¨î§@¤Hû¦W³æ\\151 152 !AI ¼Ò¶ô\150 ::C 查看制作人員名單\\ 151 152 !AI模塊\ 153 153 The game has an open AI interface, which means the player can replace the standard AI 154 154 contained in the package by other AI algorithms, either for all or for single … … 158 158 you installed the game. Maybe competition will lead us to the first real good AI 159 159 in modern strategy gaming.\ 160 ::E1 AI ¼Ò¶ô¶}µo«ü«n\\161 162 ! ¨t²Î¹B¦æ»Ý¨D\163 - ¤@¶ô¥iÅã¥Ü16¦ì¦â©Î¥H¤WªºÅã¥d\164 - ±À¯ò¶}±Ò¦rÊ^¥·Æ¥\¯à\\165 166 ! ©R¥O¦æ¹B¦æ°Ñ¼Æ\167 -cevo.exe -man ... ¤£¹B¦æ´åÀ¸, ¶ÈÅã¥Ü«ü«n\\168 169 ! §R°£´åÀ¸\170 ½Ð¹B¦æ±±¨î±ªO¤¤ªº§R°£µ{§Ç¦V¾É.\\171 172 ! ¿ù»~³ø§i\160 ::E1 AI模塊開發指南\\ 161 162 !系統運行需求\ 163 -一塊可顯示16位色或以上的顯卡\ 164 -推荐開啟字体平滑功能\\ 165 166 !命令行運行參數\ 167 -cevo.exe -man ... 不運行游戲, 僅顯示指南\\ 168 169 !刪除游戲\ 170 請運行控制面板中的刪除程序向導.\\ 171 172 !錯誤報告\ 173 173 174 174 To support the progress of this project, please tell me about problems you have … … 200 200 201 201 #CREDITS 202 $ ¨î§@¤Hû\202 $制作人員\ 203 203 204 204 @@18\\ 205 205 206 ! ³]p\207 ì³Ð·N¨Ó¦ÛSid Meier & Brian Reynolds¨î§@ªº 208 "Sid Meier's Civilization" ¤Î"Civilization II".\209 ®ÚÕuª±®a¦P¦nªº·N¨£«Øijקï¦Ó¦¨.\\210 211 ! µ{§Ç\212 ¥Dµ{§Ç: Steffen Gerlach.\213 PNG ¹Ï¤ù¤ä«ù: Edmund H. Hand\\214 215 ! ´ú¸Õ\216 µL¼Æ¤£ª¾¦Wªº´ú¸ÕªÌ, ·PÁ§ĄC¤@Ó¤H!\\217 218 ! ¨ä¥L\219 ¬Y¨Ç¯¾²z¹Ï¤ù¨Ó¦Û"Mayang's Free Textures".\220 «°¥«¦W³æ´£¨Ñ: Charles Nadolski..\\221 222 ! ¬ü¤u\223 µ´¤j³¡¤À¹Ï¤ù¬O±qÊI¤W¬y¶Çªº¦UÏú¤å©úII¸ê·½¥]¤º´£¨úªº, 224 ¨ä¤¤¤@¨Ç§@ªÌ¤w¤£¥i¦Ò, ÁÙ¦³¤@¨ÇµLªkÁpµ¸. Yµo²{°Ó·~ 225 ª©Åv¹Ï¤ù, ©Î¬O¤£º@±zªº³Ò°Ê¦¨ªG³Q§K¶OÂà¥Î, ©Î¬O§@¬° 226 ¹Ï¤ù§@ªÌªº±z·Q¦b¨î§@¤Hû¦W³æ¤¤¯d¤U©m¦W, ½ÐÁp¨t§ÚÌ.206 !設計\ 207 原創意來自Sid Meier & Brian Reynolds制作的 208 "Sid Meier's Civilization" 及 "Civilization II".\ 209 根据玩家同好的意見建議修改而成.\\ 210 211 !程序\ 212 主程序: Steffen Gerlach.\ 213 PNG圖片支持: Edmund H. Hand\\ 214 215 !測試\ 216 無數不知名的測試者, 感謝你們每一個人!\\ 217 218 !其他\ 219 某些紋理圖片來自 "Mayang's Free Textures".\ 220 城市名單提供: Charles Nadolski..\\ 221 222 !美工\ 223 絕大部分圖片是從网上流傳的各种文明II資源包內提取的, 224 其中一些作者已不可考, 還有一些無法聯絡. 若發現商業 225 版權圖片, 或是不愿您的勞動成果被免費轉用, 或是作為 226 圖片作者的您想在制作人員名單中留下姓名, 請聯系我們. 227 227 228 228 229 229 #QUICK 230 $ §Ö³t¤W¤â\231 232 ! §Ö³t¤W¤â\233 234 ¥H¤U¬O´åÀ¸°ò¥»ªºnÂI, ¨Ñ·s¤â§Ö³t¤Jªù:\235 236 - ³o¬O¤@´Ú¦^¦X¨î´åÀ¸, ´åÀ¸®Ö¤ß·½¦Û¤å©ú¨t¦C.\237 - ·í©Ò¦³³¡¶¤¦æ°Êµ²§ô¦Z, ±zªº¦^¦X¦Û°Êµ²§ô. ¦pªG´åÀ¸238 °±¤î¹B¦æ, ¤]³\¬O¨t²Î¦bµ¥±z¤â°Êµ²§ô¦^¦X.\239 - ¤j¦h¼Æ¥iÂIÀ»ªº¶µ¥Ø³£¥H¥Õ¦â¥~®Øªí¥Ü.\240 - ¦b¦P¤@¦a¶ô¤W, ¤]³\¾n¦³¦h¤ä³¡¶¤, ¦ý¥u¦³³Ì±j¤jªº³¡¶¤241 ¤~·|Åã¥Ü¦b¦a¹Ï¤W.\242 - ¥Î¹«¼Ð¥ªÁä³æÀ»¿ï¾Ü³¡¶¤, . ¿ï¤¤ªº³¡¶¤¹Ï¼Ð±N·|°{Ã{,243 «Ì¹õ¤U¤è±a·P¼Û¸¹ªº«ö¶s, ¬O¸Ó³¡¶¤¬ÛÃöªº¾Þ§@µæ³æ.\244 - n²¾°Ê³¡¶¤, ½Ð¨Ï¥ÎÁä½L¤è¦VÁä¡B¼Æ¦rÁä©Î¹«¼Ð¥kÁä.\245 - ¹«¼Ð³æÀ»«°¥«¹Ï¼Ð, ¥iÅã¥Ü¸Ó«°¥«ªº¾Þ§@µ¡¤f, ¨ä¤¤³Ì246 «nªº¬O¥Í²£«ö¶s, ³æÀ»µ¡¤f¤¤³¡ªº¥Í²£«ö¶s, ¥i¿ï¾Ü 247 ·sªº«Ø³]¥Ø¼Ð, ¨Ò¦p¿ï¾Ü©Ý¯îªÌ, ¥h§O³B«Ø¥ß·sªº«°¥«.\248 - «°¥««Ø³]¡B¼Wªøªº³t«×, ¥H¤Î¬ì¬ãµ|¦¬ªº¦h¤Ö,249 ¥þ³£¨ú¨M¤_§Aªº¿ï¾Ü.\250 - ¦b¦h¼Æ±¡ªp¤U, ¦b¹«¼ÐÂIÀ»¬Y¶µ¥Øªº¦P®É«ö¦íShiftÁä,251 ¥iÅã¥Ü¬ÛÃöªºÀ°§U«H®§.\\\230 $快速上手\ 231 232 !快速上手\ 233 234 以下是游戲基本的要點, 供新手快速入門:\ 235 236 -這是一款回合制游戲, 游戲核心源自文明系列.\ 237 -當所有部隊行動結束后, 您的回合自動結束. 如果游戲 238 停止運行, 也許是系統在等您手動結束回合.\ 239 -大多數可點擊的項目都以白色外框表示.\ 240 -在同一地塊上, 也許駐有多支部隊, 但只有最強大的部隊 241 才會顯示在地圖上.\ 242 -用鼠標左鍵單擊選擇部隊, . 選中的部隊圖標將會閃爍, 243 屏幕下方帶感歎號的按鈕, 是該部隊相關的操作菜單.\ 244 -要移動部隊, 請使用鍵盤方向鍵、數字鍵或鼠標右鍵.\ 245 -鼠標單擊城市圖標, 可顯示該城市的操作窗口, 其中最 246 重要的是生產按鈕, 單擊窗口中部的生產按鈕, 可選擇 247 新的建設目標, 例如選擇拓荒者, 去別處建立新的城市.\ 248 -城市建設、增長的速度, 以及科研稅收的多少, 249 全都取決于你的選擇.\ 250 -在多數情況下, 在鼠標點擊某項目的同時按住Shift鍵, 251 可顯示相關的幫助信息.\\\ 252 252 253 253 254 254 @@22\\ 255 ! P¤å©ú¨t¦Cªº¦Ñª±®a\256 257 ´N¦a§Î©M³¡¶¤¹Ï¤ùªº¬Û¦üµ{«×¦Ó¨¥, C-evo(¤å©ú¶i¤Æ¥v)258 «Ü®e©ö³Q¬Ý§@¬O¤å©úII¥N¸g¨åªºÎ`¨îª©. ¦ý²`¤J´åÀ¸¦Z, 259 §A´N·|µo²{¨âªÌ¦³³\¦h¤£¦P. ¨ä®tÉݵ{«×¬Æ¦Ü¥iÉO 260 ¤å©úI©MII¥N¤§¶¡ªº®tÉݬ۴£¦}½×. ¬d¬Ý¨ãÊ^®tÉÝ, 261 ½ÐÂIÀ»¤U¦C¼ÐÃD:\262 :MOVEMENT ³¡¶¤²¾°Ê\263 ::T ¦a§ÎÏúÃþ\264 ::B202 ©_¸ñ¼vÅT\265 ::G ¬FÊ^§Î¦¡\266 ::A ¬ì§Þºt¤Æ\267 :DIPLOMACY ¹ï¥~¥æ¯A\268 :SHIP ´Þ¥Á¸²î\\269 270 °£¤F¤Wz®tÉݤ§¥~, ÁÙ¦³¥H¤UnÂI´£½Ð¦U¦ìª±®a¯d·N:\271 272 -C-evo ¤£¾aÀHÉó¹Bºâ§@¬°½æÂI. ¨C¤@¶µp¦Eªºµ²ªG³£¥i273 ¹w´Á, °£¤F¥@¬É¦a¹Ïªº¥Í¦¨©M¨ä¥L¶Õ¤OªºÁ|°Ê¤§¥~.\274 - ¹q¸£pºâ©Ò¨ÌÕuªº³W«hÉO¯u¤Hª±®a§¹¥þ¬Û¦P. ¹q¸£ª±®a275 ¦}µLÃB¥~ªºÉ¬¶Õ, ¦bÀò±o±¡³ø¤è±¤]¤@¼Ë.\276 - «°¥«µ²ÌÛÉO¤å©ú¨t¦C²¤¦³¥X¤J. ¦b«°¥«©Ò¦bªº¦a¶ô, ¦³1Ó277 ¥«¥Át³d³Ò°Ê¥Í²£, ¦ý¤£·|±q¨Æ°Ó·~¶T©ö; ¦¹¥~, ¥«¥Áµ²ÌÛ 278 ¤]¦³©Ò²¤Æ, ¦p¥h°£¤FÃÀ¤H©M¦¬µ|¤Hµ¥µ¥.\279 - «°¥«³Ì¤p³W¼Ò¬°2¯Å, ¥Í²£¤@¤ä©Ý¯îªÌ, ¶·¯Ó¶O2Ó¥«¥Á.\280 - «°¥«Â³¹Àx¶q¤W¦}«D¥Ñ«°¥«³W¼Ò¨M©w, ¦]¦¹¤j«°¥«ªº281 ¼Wªø³t«×, ©¹©¹»·°ª¤_¸û¤pªº«°¥«.\282 - µL»ÝÁ{ªñ®ü¬v©Îªe¬y, §Y¥i¶i¦æÄéµ@.\283 - ±q¨ä¥L¶Õ¤OÀò±oªº¥ý¶i¬ì§Þ, µLªkª½±µ§Q¥Î, ¥²¶·¥ý°w¹ï284 ¸Ó¬ì§Þ¶i¦æåªR©Ê¬ã¨s, ¬ã¨s³t«×±N¬O¿W¦Û¬ã¨sªº¨â¿, 285 ¥B¤£¥²¬ã¨s¥ý´Á©Ò»Ý¬ì§Þ.\286 - ¬Y¨Ç°ª¯Å§@¾Ô³¡¶¤µLªkª½±µ«Ø³], ¥²¶·¥ý¶i¦æ¬ãµo,287 ¬ãµo¦¨¥\¦Z¤~¯à«Ø³].\288 - ¬Y¨Ç¦a§Î¹ï¦a±³¡¶¤·|³y¦¨¶Ë®`, ¸Ô¨£"¦a§ÎÏúÃþ"¤¤ªº"´c¤g".\255 !致文明系列的老玩家\ 256 257 就地形和部隊圖片的相似程度而言, C-evo(文明進化史) 258 很容易被看作是文明II代經典的复制版. 但深入游戲后, 259 你就會發現兩者有許多不同. 其差异程度甚至可与 260 文明I和II代之間的差异相提并論. 查看具体差异, 261 請點擊下列標題:\ 262 :MOVEMENT 部隊移動\ 263 ::T 地形种類\ 264 ::B202 奇跡影響\ 265 ::G 政体形式\ 266 ::A 科技演化\ 267 :DIPLOMACY 對外交涉\ 268 :SHIP 殖民飛船\\ 269 270 除了上述差异之外, 還有以下要點提請各位玩家留意:\ 271 272 -C-evo不靠隨机運算作為賣點. 每一項計划的結果都可 273 預期, 除了世界地圖的生成和其他勢力的舉動之外.\ 274 -電腦計算所依据的規則与真人玩家完全相同. 電腦玩家 275 并無額外的优勢, 在獲得情報方面也一樣.\ 276 -城市結构与文明系列略有出入. 在城市所在的地塊, 有1個 277 市民負責勞動生產, 但不會從事商業貿易; 此外, 市民結构 278 也有所簡化, 如去除了藝人和收稅人等等.\ 279 -城市最小規模為2級, 生產一支拓荒者, 須耗費2個市民.\ 280 -城市糧食儲量上限并非由城市規模決定, 因此大城市的 281 增長速度, 往往遠高于較小的城市.\ 282 -無需臨近海洋或河流, 即可進行灌溉.\ 283 -從其他勢力獲得的先進科技, 無法直接利用, 必須先針對 284 該科技進行剖析性研究, 研究速度將是獨自研究的兩倍, 285 且不必研究先期所需科技.\ 286 -某些高級作戰部隊無法直接建設, 必須先進行研發, 287 研發成功后才能建設.\ 288 -某些地形對地面部隊會造成傷害, 詳見"地形种類"中的"惡土".\ 289 289 290 290 291 291 #INTRO 292 $ ´åÀ¸¤¶²Ð\292 $游戲介紹\ 293 293 294 294 @@56\ 295 ! Åwªï¶i¤JC-evo(¤å©ú¶i¤Æ¥v)ªº¥@¬É\296 297 ¥»´åÀ¸±a±z»â²¤¤HÃþ¤å©úªºµo®i¥v, ±z¥i±a»â¤@¤äÏú±Ú, 298 ¾ú¸g¤»¤d¦~·É®áÅܾE, ±q¤HÃþ³Ìªìªº©w©~¶}©l¾Ä¤æ, ¨D¥Í, 299 ¶i¤Æ, ª½¦Ü¹ê²{¤HÃþªº²×Ìå¹Ú·Q--´Þ¥Á¥~¬P. «e¶iªº¹D¸ô 300 ¦}¤£Á`¬O¤@µf©Z³~: ¥i¥Îªº¸ê·½¦}¤£¥R¸Î, »Ýnºë¥´²Óºâ; 301 ©P³òªº³¥¦a¯í¯í, ¤Ö»¡¤]±oªá¤L¤d¦~¤~¯àÅܦ¨¤å©ú¼Ö¤g; 302 §ó§O´£¤£´Á¦Ó¦ÜªºÄȯî©MÅܶäF, ¤Ñ¨a¤Hº×©l²×¬O«°¥« 303 Ácºaµo®iªº³Ì¤j«Â¯Ù..\\304 305 ÏúÏú¤£§Q¦]¯À¤§¤U, °ß¦³¾a²`¿Ñ»·¼{¤~¯à±a»â¤H¥Á¨«¦V©¯ºÖ.306 ÂX±i«Ò°ê»â¤g, µo®i«°¥««Ø³], קLÀç, ¿ì¤j¾Ç, ³y¤uÉD......307 ¦b«Ø³]ªº¦P®É, ¤]§O©¿µø¤F¬ì¾Ç¬ã¨s, ¬ãµo·s¦¡³¡¶¤©MªZ¾¹, 308 ¬£»º©Ý¯î³¡¶¤¶}¹@·sªº¨U¤g, ¤Þ»â²î¶¤´M§ä®ü¬v©¼©¤ªº¤j³°, 309 ±N¾ãÓ¥@¬ÉºÉ¦¬²´©³.\\310 311 §O§Ñ¤F, §Aªº°ê®a¦}¤£¬O³o¥@¬É¤¤°ß¤@ªº¤å©ú. ¨C¶ô¤j³°¤W 312 ³£¦³¤£¦Pªº³¡¸¨, ¦s¦b¬Û·íªº¤å¤Æ®tÉÝ. n°O¦í, ¨S¦³þÓ 313 Ïú±Ú¬O¤Ñ©R¥Ã¦sªº, ¥ô¦ó¤@Ó«Ò°ê³£¦³¥i¯à¦b¤@©]¶¡¶ÉÂÐ, 314 §Aªº°ê®a¤]¤£¨Ò¥~.\\315 316 ÉO¥L°êªº²Ä¤@¦¸±µàD¤]³\¦}¤£·|¬O¤@¦¸´r§Öªº¸g¾ú, ¦ý³q¹L 317 ¤£¾Óªº¥~¥æ¥æ¯A, ³\¦hì¥ýªº¤£¥i¯à¤]·|Åܦ¨¥i¯à. ÉO¨ä¥L 318 ¤å©ú¥æ´«¬ì§Þª¾ÃÑ, ¥Î±ø¬ù«OÅ@¦U¦Ûªº§Q¯q, ©Î¬O«Ø¥ß°í©T 319 ªº·ù¬ù, ¦b³´¤J³Â·Ð®É¦³ÓÀ°¤âÀ³¸Ó¤£¬O§¥¨Æ. ¦ý¤]§O¤Ó¹L 320 ¨Ì¿à±ø¬ù, ¦]¬°³oÓ¥@¬É¨S¦³¥Ã»·ªºªB¤Í, ¥u¦³¥Í¦sªº¹ï¤â, 321 ¤£½×¬OþÓÏú±Ú, ³£¦b¬°¤F¦P¤@ӥؼЦÓÄvª§: ³Ì²×ªºÐ`§Q.295 !歡迎進入C-evo(文明進化史)的世界\ 296 297 本游戲帶您領略人類文明的發展史, 您可帶領一支种族, 298 歷經六千年滄桑變遷, 從人類最初的定居開始奮斗, 求生, 299 進化, 直至實現人類的終极夢想--殖民外星. 前進的道路 300 并不總是一番坦途: 可用的資源并不充裕, 需要精打細算; 301 周圍的野地茫茫, 少說也得花几千年才能變成文明樂土; 302 更別提不期而至的饑荒和變亂了, 天災人禍始終是城市 303 繁榮發展的最大威脅..\\ 304 305 种种不利因素之下, 唯有靠深謀遠慮才能帶領人民走向幸福. 306 擴張帝國領土, 發展城市建設, 修兵營, 辦大學, 造工厂...... 307 在建設的同時, 也別忽視了科學研究, 研發新式部隊和武器, 308 派遣拓荒部隊開辟新的沃土, 引領船隊尋找海洋彼岸的大陸, 309 將整個世界盡收眼底.\\ 310 311 別忘了, 你的國家并不是這世界中唯一的文明. 每塊大陸上 312 都有不同的部落, 存在相當的文化差异. 要記住, 沒有哪個 313 种族是天命永存的, 任何一個帝國都有可能在一夜間傾覆, 314 你的國家也不例外.\\ 315 316 与他國的第一次接触也許并不會是一次愉快的經歷, 但通過 317 不懈的外交交涉, 許多原先的不可能也會變成可能. 与其他 318 文明交換科技知識, 用條約保護各自的利益, 或是建立堅固 319 的盟約, 在陷入麻煩時有個幫手應該不是坏事. 但也別太過 320 依賴條約, 因為這個世界沒有永遠的朋友, 只有生存的對手, 321 不論是哪個种族, 都在為了同一個目標而競爭: 最終的胜利. 322 322 323 323 324 324 #BASICS 325 $ ·§½×\326 327 ! ·§½×\328 329 °ê®aªº²Õ¦¨³æ¦ì¬O³¡¶¤©M«°¥«. ³¡¶¤ªºÂ¾³d¬O±´ÀI©M§ð¦u, 330 ¦Ó«°¥«ªºÂ¾¯à¬O¤H¤f¼Wªø, ¥Í²£«Ø³]©M¬ì¾Ç¬ã¨s.\\331 332 ¥@¬É¦a¹Ï¥Ñ¥|Ãä§Î¦a¶ô²Õ¦¨. ¨CÓ¦a¶ô³£¦³¨ä¦a§ÎÄÝ©Ê, 333 ®ÚÕu¤£¦Pªº¦a§ÎÏúÃþ, ¦a¶ôªº¥H¤U¤TÏúÄÝ©Ê·|¦³©Ò¤£¦P: 334 ¸ê·½²£¶q, ¨¾±s¥[¦¨, ©M²¾°Ê®ø¯Ó. ¦P¤@¦a¶ô¤W³Ì¦h¯à«Ø 335 ¤@®y«°¥«, ¦ý¥i®e¯Çªº¦P°ê³¡¶¤¼Æ¶q¦}µL¨î. nÀò±o 336 ¯S©w¦a¶ôªºÀ°§U«H®§, ½Ð¦bÂI¿ï¦a¶ô®É«ö¦íShiftÁä.\337 ::T ¦a§ÎÏúÃþ\\338 339 ¥»´åÀ¸ªö¥Î¤F¦^¦X¨î¶i¦æ¤è¦¡¡A¨ä¥L¹ï¤â¥²¶·µ¥«Ý±z¥þ³¡ 340 ¦æ°Ê§¹²¦¡Aµ²§ô¦^¦X¤§¦Z¤è¥i¨Ì¦¸¦æ°Ê. ¦bÀq»{°t¸m¤U, 341 ©Ò¦³³¡¶¤¦æ°Ê§¹¦¨¦Z,¦^¦X±N¦Û°Êµ²§ô, ¦pªG±z¬Ý¨ì"µ¥«Ý 342 ¦^¦Xµ²§ô"ªº´£¥Ü,½ÐÂIÀ»«Ì¹õ¥k¤U¨¤ªºµ²§ô¦^¦X«ö¶s.\\325 $概論\ 326 327 !概論\ 328 329 國家的組成單位是部隊和城市. 部隊的職責是探險和攻守, 330 而城市的職能是人口增長, 生產建設和科學研究.\\ 331 332 世界地圖由四邊形地塊組成. 每個地塊都有其地形屬性, 333 根据不同的地形种類, 地塊的以下三种屬性會有所不同: 334 資源產量, 防御加成, 和移動消耗. 同一地塊上最多能建 335 一座城市, 但可容納的同國部隊數量并無限制. 要獲得 336 特定地塊的幫助信息, 請在點選地塊時按住Shift鍵.\ 337 ::T 地形种類\\ 338 339 本游戲采用了回合制進行方式,其他對手必須等待您全部 340 行動完畢,結束回合之后方可依次行動. 在默認配置下, 341 所有部隊行動完成后,回合將自動結束, 如果您看到"等待 342 回合結束"的提示,請點擊屏幕右下角的結束回合按鈕.\\ 343 343 344 344 345 345 #SCIENCE 346 $ ¬ì§Þ\346 $科技\ 347 347 348 348 @@46\ 349 ! ¬ì§Þ\350 351 ´åÀ¸¤¤°ê®an·Q׫طsªº³]¬I, ²Õ«Ø·sªº³¡¶¤, 352 ©Î¬O¦¨¥ß·sªº¬FÊ^, ¥²¶·¥ý¬ã¨s¬ÛÃöªº¬ì§Þ. 353 °£¤Fªì©l®Éªº¤L¶µ¬ì§Þ¤§¥~, µ´¤j³¡¤À¬ì§Þ»Ý 354 ¥ý¬ã¨s1¦Ü2¶µ«e¾É©Ê¬ì§Þ, ¸Ô±¡½Ð¬Ý:\355 ::A ¬ì§Þ¤@Äý\\356 357 ´åÀ¸¶}©l¦Z¤@¦^¦X, ¨t²Î·|´£¥Üª±®a¿ï¾Ü·Qn 358 ¬ã¨sªº²Ä¤@¶µ·s¬ì§Þ. nÀòª¾¬ÛÃö¬ì§Þªº¸Ô²Ó 359 «H®§, ½Ð¦bÂI¿ï¬ì§Þ¦WºÙªº¦P®É«ö¦íShiftÁä.360 ¬ì§Þ¬ã¨sªº¶i«×¨ú¨M¤_°ê®a²Ö¿nªº¬ì¾ÇÁ`¶q(%r)361 ¦pªG²Ö¿nªº%r¹F¨ì³W©wªº¤ô¥, ´N¯àÀò±o·sªº 362 ¬ì¬ã¦¨ªG. ¨C¦¸¥u¯à¬ã¨s¤@¶µ¬ì§Þ, ¨M©w¤§¦Z, 363 ¬ã¨sp¦E´NµLªk§ó§ï¤F. 364 ÀHµÛ¥»°ê¬ì§Þ¦¨ªGªº¤£Â_±À¥X, ·s¬ì§Þªº¬ã¨s 365 ©Ò»Ýnªº¬ì¾ÇÁ`¶q·|³v¨B¼W¦h, ¸Ô±¡½Ð¬Ý:\\366 367 ;SCIENCECOST ¬ì¬ã¶O¥Î¸Ô¸Ñ349 !科技\ 350 351 游戲中國家要想修建新的設施, 組建新的部隊, 352 或是成立新的政体, 必須先研究相關的科技. 353 除了初始時的几項科技之外, 絕大部分科技需 354 先研究1至2項前導性科技, 詳情請看:\ 355 ::A 科技一覽\\ 356 357 游戲開始后一回合, 系統會提示玩家選擇想要 358 研究的第一項新科技. 要獲知相關科技的詳細 359 信息, 請在點選科技名稱的同時按住Shift鍵. 360 科技研究的進度取決于國家累積的科學總量 (%r) 361 如果累積的%r達到規定的水平, 就能獲得新的 362 科研成果. 每次只能研究一項科技, 決定之后, 363 研究計划就無法更改了. 364 隨著本國科技成果的不斷推出, 新科技的研究 365 所需要的科學總量會逐步增多, 詳情請看:\\ 366 367 ;SCIENCECOST 科研費用詳解 368 368 369 369 370 370 #SCIENCECOST 371 $ ¬ì¬ã¶O¥Î¸Ô¸Ñ\372 373 ! ¬ì¬ã¶O¥Î¸Ô¸Ñ\374 375 ÀHµÛ¬ì§Þ¬ãµo¼Æ¶qªº¼W¦h, ¬ì¬ã¶O¥Î¤]·|ÀH¤§´£°ª. 376 ·í«eÃø«×¤U, ¬ì¬ã¶O¥Îªºpºâ¤½¦¡¬°:\371 $科研費用詳解\ 372 373 !科研費用詳解\ 374 375 隨著科技研發數量的增多, 科研費用也會隨之提高. 376 當前難度下, 科研費用的計算公式為:\ 377 377 &TECHFORMULA\\ 378 Åܶqnªºªì©lȬ°4, ¦}®ÚÕu¥H¤U±ø¥óµo¥Í¬ÛÀ³ÅܤÆ:\379 - ³¡¶¤¬ãµo¤£·|¼vÅTnȪºÅܤÆ\380 - ¹q¸£¬ì§Þªº¬ã¨s¤£·|¼vÅTnȪºÅܤÆ\381 - ¦¨¥\¬ã±o±q¨ä¥L¶Õ¤OÀò±oªº¬ì§Þ, nÈ+1\382 - ¦Û¦æ¦¨¥\¬ã±o¥ô¦ó¨ä¥L¬ì§Þ, ¥]¬A¤TÏú¥¼¨Ó¬ì§Þ, nÈ+2\383 - ±q¤j¹Ï®ÑÀ]¤¤ª½±µÀò±o¬ì§Þ, nÈ+1378 變量n的初始值為4, 并根据以下條件發生相應變化:\ 379 -部隊研發不會影響n值的變化\ 380 -電腦科技的研究不會影響n值的變化\ 381 -成功研得從其他勢力獲得的科技, n值+1\ 382 -自行成功研得任何其他科技, 包括三种未來科技, n值+2\ 383 -從大圖書館中直接獲得科技, n值+1 384 384 385 385 386 386 #DIPLOMACY 387 $ ¥~¥æ\388 389 ! ·§½×\390 391 ¨âÓ¯À¥¼¿Ñ±ªº°ê®an«Ø¥ß¥~¥æÃö¨t, ¥²¶·µ¥¨ì¨ä¤¤¤@°ê 392 ªº¦a±³¡¶¤µo²{¥t¤@°êªº¦a±³¡¶¤©Î«°¥«¤§¦Z¤è¥i¶i¦æ. 393 ¦b°ê®a±¡³øµe±, ¥i¬d¬Ý¤wª¾¨ä¥L¶Õ¤Oªº¬ÛÃö«H®§. 394 ¦b°ê®a±¡³øµe±¤¤, Åã¥Ü¤F¤@Ó°ê®aªº¬FÊ^§Î¦¡, ²{¦³¸êª÷, 395 ¥~¥æ¥ß³õ, ¥H¤Î¤H¤f, »â¤g, ¬ì§Þ, ±´¯Áµ¥·§ªp. \\396 397 ! ¥æ¯A\398 ·í¨â°êµo¥Í±µàD¤§¦Z, ¥i¶}®i¥~¥æ¥æ¯A, ¦b¥æ¯A¤¤¥i¶i¦æ 399 ¥æ´«¶T©ö©Îñ¸p¨ó¬ù. ¾ãÓ¥æ¯A¹Lµ{¥Dn¥Ñ¨î©w´£Ä³, 400 ±µ¨ü´£Ä³, ¥H¤Î¨ú®ø±ø¬ù¤T³¡¤À²Õ¦¨.\\401 402 ·í¥æ¯AÂù¤è³£°±¤î´£Ä³ªº®ÉÔ, ¥æ¯A´N±Nµ²§ô. ¦pªG¤@¤è 403 ¿ï¾Ü²×¤î½Í§P, ¥æ¯A¤]·|¥ß§Y²×¤î.\\404 405 ! ´£Ä³\406 ¥~¥æ¥æ¯A¥Dnªº²Õ¦¨³¡¤À¬O¦UÏú´£Ä³. ´£Ä³ªº¤º®e¤¤¥]§t¤F 407 ¥æ¯A¤@¤è¦V¥t¤@¤è´£¥Xªºn¨D, ¥H¤Îº@·N¬°¤§¥I¥Xªº±ø¥ó. 408 ¥i¯à¥]§tªº¤º®e¦³:\409 - ¤@¶µ±ø¬ù\410 - °ê®a±¡³ø\411 - x¨Æ±¡³ø\412 - ¤@µ§²{ª÷\413 - ¬ì§Þ¦¨ªG\414 - ³¡¶¤¬ãµo\415 - ±´¯Á¦a¹Ï\416 - ´Þ¥Á¸²î³¡¥ó(¤ÓªÅ´ä«Ø¦¨¦Z)\\417 418 ¦pªG´£Ä³¤¤¥¼¥]§t¦V¹ï¤èn¨Dªº¤º®e, ´N¬Û·í¤_¤@¥÷§ª«.419 ¥u¦³¹ï¤è±µ¨ü, §ª«¤~¦³®ÄªG. ÉO¤§¬Û¤Ïªº±¡ªp¬O, ¦pªG 420 ´£Ä³¤¤¥¼¥]§t¦V¹ï¤è¥I¥Xªº±ø¥ó, ´N¬O¨ª»r»rªº¯Á¨ú.\\421 422 ±q¨ä¥L¶Õ¤OÀò±oªº¥ý¶i¬ì§Þ, µLªkª½±µ§Q¥Î, ¥²¶·¥ý°w¹ï 423 ¸Ó¬ì§Þ¶i¦æåªR©Ê¬ã¨s, ¬ã¨s³t«×±N¬O¿W¦Û¬ã¨sªº¨â¿, 424 ¥B¤£¥²¬ã¨s¥ý´Á©Ò»Ý¬ì§Þ.\\425 426 ! ±ø¬ù\427 ±ø¬ù¤À¬°¥H¤U¤LÏú:\\428 429 - ©M¥±ø¬ù:430 ¨â°ê¤£±o¬Û¤¬§ðÀ», ¤]¤£±o¶i¤J¹ï¤èªº°ê¹Ò. 431 ©M¥°ê®aªº³¡¶¤¹ï¥t¤@¤èªº«°¥«¨S¦³³ò§ð®ÄÀ³.\\432 433 - ¤Í¦n±ø¬ù:434 °£¤F©M¥±ø¬ùªº¤Wz¬ù©w¤§¥~, 435 ¨â°ê¨C¦^¦X¥æ´«¦U¦Ûªº°ê®a±¡³ø..\\436 437 - ·ù¬ù:438 ¦¨¬°·ù°ê¤§¦Z, ¤v¶Õ¤O³¡¶¤¥i¦b·ù°ê°ê¬É¤º¦Û¥Ñ²¾°Ê, 439 ¤Ï¤§¥çµM. ¥t¥~, ·ù°ê¶¡¦@¨É©Ò¦³±¡³ø (¥]¬A¦a°Ï/x¨Æ 440 ¤Î¦a¹Ï±¡³ø), ¹ï¤è³¡¶¤ªº¤@Á|¤@°Ê¤]±N¥þ³¡ª¾±x.\\441 442 ¥t¥~, ¨S¦³Ã±¸p¥ô¦ó±ø¬ùªº¨âÓ°ê®a, ¥i¥H¹F¦¨°±¾Ô¨óij. 443 °±¾Ô¨óij¤£Äݤ_±ø¬ù, ¶È¬O¤@Ïú¼È®É¤£§ðÀ»¹ï¤èªº¤¹¿Õ. 444 ·í¨ä¤¤¤@¤è¶}¾Ô¦Z, ¨óij¦Û°Ê¥¢®Ä. 445 ºî¤W©Òz, ¨â°ê¶¡¥i¯àªºÃö¨t¦Cªí¦p¤U:\387 $外交\ 388 389 !概論\ 390 391 兩個素未謀面的國家要建立外交關系, 必須等到其中一國 392 的地面部隊發現另一國的地面部隊或城市之后方可進行. 393 在國家情報畫面, 可查看已知其他勢力的相關信息. 394 在國家情報畫面中, 顯示了一個國家的政体形式, 現有資金, 395 外交立場, 以及人口, 領土, 科技, 探索等概況. \\ 396 397 !交涉\ 398 當兩國發生接触之后, 可開展外交交涉, 在交涉中可進行 399 交換貿易或簽署協約. 整個交涉過程主要由制定提議, 400 接受提議, 以及取消條約三部分組成.\\ 401 402 當交涉雙方都停止提議的時候, 交涉就將結束. 如果一方 403 選擇終止談判, 交涉也會立即終止.\\ 404 405 !提議\ 406 外交交涉主要的組成部分是各种提議. 提議的內容中包含了 407 交涉一方向另一方提出的要求, 以及愿意為之付出的條件. 408 可能包含的內容有:\ 409 -一項條約\ 410 -國家情報\ 411 -軍事情報\ 412 -一筆現金\ 413 -科技成果\ 414 -部隊研發\ 415 -探索地圖\ 416 -殖民飛船部件(太空港建成后)\\ 417 418 如果提議中未包含向對方要求的內容, 就相當于一份禮物. 419 只有對方接受, 禮物才有效果. 与之相反的情況是, 如果 420 提議中未包含向對方付出的條件, 就是赤裸裸的索取.\\ 421 422 從其他勢力獲得的先進科技, 無法直接利用, 必須先針對 423 該科技進行剖析性研究, 研究速度將是獨自研究的兩倍, 424 且不必研究先期所需科技.\\ 425 426 !條約\ 427 條約分為以下几种:\\ 428 429 -和平條約: 430 兩國不得相互攻擊, 也不得進入對方的國境. 431 和平國家的部隊對另一方的城市沒有圍攻效應.\\ 432 433 -友好條約: 434 除了和平條約的上述約定之外, 435 兩國每回合交換各自的國家情報..\\ 436 437 -盟約: 438 成為盟國之后, 己勢力部隊可在盟國國界內自由移動, 439 反之亦然. 另外, 盟國間共享所有情報 (包括地區/軍事 440 及地圖情報), 對方部隊的一舉一動也將全部知悉.\\ 441 442 另外, 沒有簽署任何條約的兩個國家, 可以達成停戰協議. 443 停戰協議不屬于條約, 僅是一种暫時不攻擊對方的允諾. 444 當其中一方開戰后, 協議自動失效. 445 綜上所述, 兩國間可能的關系列表如下:\ 446 446 &TREATIES\\ 447 447 448 ¥u¦³¦b¥~¥æ¥æ¯A¤¤, ©Î¬O¤@°ê©Úµ´±µ¨£ 449 §O°ê¨Ï¸`ªº®ÉÔ, ¤è¥i¨ú®øì¥ýñqªº 450 ±ø¬ù. ¨ú®ø±ø¬ù¦Z, ¦b±µ¤U¨Óªº¤T¦^¦X¤º 451 ¤£¥iÉO¦P¤@°ê®a¦A¦¸¨ú®ø¨ä¥L±ø¬ù.452 ¦pªGA°ê¨ú®øÉOB°ê¶¡ªº©M¥±ø¬ù, 453 «hB°êªº¦P·ù°ê¤]±N¹ïA°ê«Å¾Ô.\\454 455 ! ¥i«Hµ{«×\456 n§PÂ_¤@Ó°ê®a¬O§_¨¥¥X¥²¦æ, ¥i«H«×¬O 457 «n°Ñ¦Ò¨ÌÕu. ¥i«H«×¤À¬°¥H¤U¥|Óµ¥¯Å:\458 - ¨¥¥X¥²¦æ (100%¥i«H«×)\459 - «¿Õ¦u«H (90%~99%¥i«H«×)\460 - ®»ºN¤£©w (70%~89%¥i«H«×)\461 - ¨¥¦ÓµL«H (¥i«H«×§C¤_70%)\\462 463 ¦b©M¥®É´Á, ¨C¦^¦X¨CÓ°ê®aªº¥i«H«×+1, ª½¦Ü³Ì¤jÈ. 464 ´åÀ¸¶}©l®É, ©Ò¦³°ê®aªº³Ì¤j¥i«H«×¬°100, ¼¹·´©M¥±ø¬ù 465 ±N¨Ï·í«e¥i«H«×´î¥b, ³Ì¤j¥i«H«×-10. ¼¹·´·ù¬ù±N¨Ï·í«e 466 ¥i«H«×´î¤Ö¥|¤À¤§¤T. µL½×¬O§_«Ø¥ß¹L¥~¥æÃö¨t, ¤@Ó°ê®a 467 ªº¥i«H«×, ¹ï¨ä¥L°ê®a³£¬O¤½¶}³z©úªº.448 只有在外交交涉中, 或是一國拒絕接見 449 別國使節的時候, 方可取消原先簽訂的 450 條約. 取消條約后, 在接下來的三回合內 451 不可与同一國家再次取消其他條約. 452 如果A國取消与B國間的和平條約, 453 則B國的同盟國也將對A國宣戰.\\ 454 455 !可信程度\ 456 要判斷一個國家是否言出必行, 可信度是 457 重要參考依据. 可信度分為以下四個等級:\ 458 -言出必行 (100%可信度)\ 459 -重諾守信 (90%~99%可信度)\ 460 -捉摸不定 (70%~89%可信度)\ 461 -言而無信 (可信度低于70%)\\ 462 463 在和平時期, 每回合每個國家的可信度+1, 直至最大值. 464 游戲開始時, 所有國家的最大可信度為100, 撕毀和平條約 465 將使當前可信度減半, 最大可信度-10. 撕毀盟約將使當前 466 可信度減少四分之三. 無論是否建立過外交關系, 一個國家 467 的可信度, 對其他國家都是公開透明的. 468 468 469 469 470 470 #SHIP 471 $ ´åÀ¸ÀòÐ`\472 473 ! ÀòÐ`¤è¦¡\474 475 n·Q¨ú±o³Ì²×Ð`§Q, ¥u¦³¤@±ø³~®|: ¦V¥~¤ÓªÅ´Þ¥Á! ¦pªG 476 §Aªº¶Õ¤O¦¨¬°ºÓ¬£»º´Þ¥Á¸²îªº°ê®a, ¨º§A´N¬O³Ì¦Z 477 ªºÄ¹®a. ¤@¿´´Þ¥Á¸²î»Ý12Ó³¡¥ó²Õ¦X¦Ó¦¨:\\478 479 ;:B67 6 Ó´Þ¥Á¸²î²Õ¥ó\480 ;:B68 4 ӰʤO¿µ\481 ;:B69 2 Ó©~¦í¿µ\\482 483 n²Õ«Ø¥H¤W¤TÏú¸²î³¡¥ó, ¥²¶·¨Ì¾a¤TÏú¹ïÀ³ªº¯S®í¸ê·½. 484 ¥u¦³¥Í²£¸ÓÏú¯S®í¸ê·½ªº«°¥«, ¤~¯à²Õ«Ø¬ÛÀ³ªº¸²î³¡¥ó. 485 ¦b²Õ«Ø¸²î³¡¥ó®É, µLªkɧU³q±`ªº´£³t¤â¬q¥[§Ö«Ø³]. 486 ¯S®í¸ê·½¥]¬A:\471 $游戲獲胜\ 472 473 !獲胜方式\ 474 475 要想取得最終胜利, 只有一條途徑: 向外太空殖民! 如果 476 你的勢力成為首個派遣殖民飛船的國家, 那你就是最后 477 的贏家. 一艘殖民飛船需12個部件組合而成:\\ 478 479 ;:B67 6個殖民飛船組件\ 480 ;:B68 4個動力艙\ 481 ;:B69 2個居住艙\\ 482 483 要組建以上三种飛船部件, 必須依靠三种對應的特殊資源. 484 只有生產該种特殊資源的城市, 才能組建相應的飛船部件. 485 在組建飛船部件時, 無法借助通常的提速手段加快建設. 486 特殊資源包括:\ 487 487 &MODERN\\ 488 488 489 nµo²{³o¨Ç¯S®í¸ê·½, ¥²¶·¥ýÀò±o¥H¤U¬ì§Þ:\490 ::A47 ³W¼Ò¶q²£489 要發現這些特殊資源, 必須先獲得以下科技:\ 490 ::A47 規模量產 491 491 492 492 493 493 #MOVEMENT 494 $ ³¡¶¤²¾°Ê\495 496 ! ³¡¶¤²¾°Ê\497 498 n¹ï³¡¶¤¤U¹F©R¥O, ½Ð¥ý¿ï¤¤°õ¦æ©R¥Oªº³¡¶¤. ³Q¿ïªº³¡¶¤ 499 ·|¥H°{Ã{ªí¥Ü¿ï¤¤ª¬ºA, ¦P®É¸Ó³¡¶¤ªº¸Ô²Ó±¡ªp·|Åã¥Ü¦b 500 «Ì¹õ¤U¤è. ¥Î¤è¦VÁä, ¤pÁä½L¼Æ¦rÁä©Î¹«¼Ð¥kÁä«ü´§³¡¶¤¦V 501 ¥Ø¼Ð¦a¶ô²¾°Ê.\\502 503 ! ²¾°Ê¨î\504 ³q±`±¡ªp¤U, ³¡¶¤Á`¯à²¾°Ê¨ì¾F±µ¦a¶ô, ¦ý¥H¤U±¡ªp°£¥~:\505 - ¥Ø¼Ð¦a¶ô¤W¦³¨ä¥L¶Õ¤Oªº³¡¶¤.\506 - ²¾°Ê³¡¶¤ªºÉó°Ê¤O¤£¨¬, ¸Ô±¡¨£¤U¤å.\507 - ¦a±³¡¶¤¤£¥i¦b®ü±²¾°Ê, ®ü¤W³¡¶¤¤£¥i¦b³°¦a²¾°Ê.\508 - ¨S¦³®ü¤W¾É¯è¯à¤OªºÄ¥¥u¤£¥i¦b»·¬v²¾°Ê.\509 - ¤£¥i¦V¨ä¥L¶Õ¤Oªº±±¨î¦a°ì²¾°Ê, ¸Ô±¡¨£¤U¤å.\\510 511 ! ªÅ¤¤³¡¶¤\512 ªÅ¤¤³¡¶¤¦b¨C¦^¦Xµ²§ô®É¥²¶·¦^¨ì¥»¤è°ò¦a(¥]¬A¥»¤è«°¥«, 513 x¨Æ°ò¦a, ¤Î¥ÀÄ¥), ¦pªG¥¼¯àªð¦^°ò¦a, ¸Ó³¡¶¤·|¼Y·´°}¤`. 514 ¦³¤@Ïú¤èªk¥i¥HÁקK¤Wz±¡ªpªºµo¥Í:\515 ::F7 µ¹³¡¶¤¼W¥[¿Uªo\\516 517 ! Éó°Ê®ø¯Ó\518 ¨C¦¸²¾°Ê³£»Ý®ø¯Ó¤@©wªºÉó°Ê¤O(MP), ®ü¤W³¡¶¤, ªÅ¤¤³¡¶¤, 519 ¥H¤Î¦V¥©Z¦a§Î²¾°Êªº¦a±³¡¶¤§@±×¦V²¾°Ê®É(¦p¦è¥_¤è), 520 »Ý®ø¯ÓªºÉó°Ê¤O¬°1ÂI; ««ª½©Î¤ô¥¤è¦V²¾°Ê®É(¦p¥¿¥_¤è), 521 »Ý®ø¯ÓªºÉó°Ê¤O¬°1.5ÂI. ¦V±T¹ò¦a§Î²¾°Ê®É, Éó°Ê¤O¬°1.5ªº 522 ¦a±³¡¶¤, ©Ò¯ÓªºÉó°Ê¤O¬O¥©Z¦a§Îªº120%, Éó°Ê¤O¦b1.5ÂI 523 ¥H¤Wªº¦a±³¡¶¤, ©Ò¯ÓªºÉó°Ê¤O¬O¥©Z¦a§Îªº130%. ¦V°ª¤s 524 ¦a¶ô²¾°Ê®É, ¦a±³¡¶¤»Ý®ø¯Ó¨â¦^¦XÉó°Ê¤O, ²¾°Ê§¹¦¨¦Zªº 525 ¤@Ó¦^¦X±NµLªk¦æ°Ê..\526 ::T ¬d¬Ý¦a§ÎÏúÃþ\\527 528 ²¾°Ê©Ò¯ÓÉó°Ê¤Oªº¥Ü·N¹Ï¦p¤U:\494 $部隊移動\ 495 496 !部隊移動\ 497 498 要對部隊下達命令, 請先選中執行命令的部隊. 被選的部隊 499 會以閃爍表示選中狀態, 同時該部隊的詳細情況會顯示在 500 屏幕下方. 用方向鍵, 小鍵盤數字鍵或鼠標右鍵指揮部隊向 501 目標地塊移動.\\ 502 503 !移動限制\ 504 通常情況下, 部隊總能移動到鄰接地塊, 但以下情況除外:\ 505 -目標地塊上有其他勢力的部隊.\ 506 -移動部隊的机動力不足, 詳情見下文.\ 507 -地面部隊不可在海面移動, 海上部隊不可在陸地移動.\ 508 -沒有海上導航能力的艦只不可在遠洋移動.\ 509 -不可向其他勢力的控制地域移動, 詳情見下文.\\ 510 511 !空中部隊\ 512 空中部隊在每回合結束時必須回到本方基地(包括本方城市, 513 軍事基地, 及母艦), 如果未能返回基地, 該部隊會墜毀陣亡. 514 有一种方法可以避免上述情況的發生:\ 515 ::F7 給部隊增加燃油\\ 516 517 !机動消耗\ 518 每次移動都需消耗一定的机動力(MP), 海上部隊, 空中部隊, 519 以及向平坦地形移動的地面部隊作斜向移動時(如西北方), 520 需消耗的机動力為1點; 垂直或水平方向移動時(如正北方), 521 需消耗的机動力為1.5點. 向崎嶇地形移動時, 机動力為1.5的 522 地面部隊, 所耗的机動力是平坦地形的120%, 机動力在1.5點 523 以上的地面部隊, 所耗的机動力是平坦地形的130%. 向高山 524 地塊移動時, 地面部隊需消耗兩回合机動力, 移動完成后的 525 一個回合將無法行動..\ 526 ::T 查看地形种類\\ 527 528 移動所耗机動力的示意圖如下:\ 529 529 @MoveShot\ 530 - ¥ª¹Ï - ªì©lÉó°Ê¤O1.5ªº³¡¶¤\531 - ¥k¹Ï - ªì©lÉó°Ê¤O3ªº³¡¶¤\\532 533 ¦pªG³¡¶¤¶¶µÛ¹D¸ô, ªe¬y©Î¹Bªe²¾°Ê, µL½×ì©l¦a§Î¬°¦ó, 534 Éó°Ê¤O®ø¯Ó³£±N°¬°0.4(±×¦V²¾°Ê)©M0.6(«D±×¦V²¾°Ê).535 ¦pªG¶¶µÛÅK¸ô²¾°Ê, Éó°Ê¤O®ø¯Ó±N°¬°ªì©lÉó°Ê¤Oªº8%536 ( ±×¦V²¾°Ê)©M12%(«D±×¦V²¾°Ê).\\537 ·s¦^¦X¶}©l®É, ³¡¶¤®ø¯ÓªºÉó°Ê¤O±N¦^Î`¨ìªì©l³Ì¤jÈ.538 ®ü¤W³¡¶¤¨ü·l¦Z, Éó°Ê¤OµLªk§¹¥þ¦^Î`, ¦ý¤£·|§C¤_2.5.\\539 n²¾°Ê¨ì§ó»·³B, ¥i¨Ï¥Î¥Ø¼Ð²¾°Ê¥\¯à, ¥kÁä³æÀ»¥Ø¼Ð¦a¶ô,540 ³¡¶¤´N·|¦V¸Ó¦a¶ô«ùÄò²¾°Ê.\\541 542 ! ±±¨î¦a°ì\543 ³¡¶¤¤À¬°¨âÏú: ¤@Ïú¦³¦a°ì±±¨î¯à¤O, ¥t¤@Ïú«h¨S¦³. ¦³ 544 ¦a°ì±±¨î¯à¤Oªº³¡¶¤¦b±µªñ¨ä¥L¶Õ¤Oªº¦a°ì±±¨î³¡¶¤®É,545 µLªk¦V¹ï¤è±±¨îªº¦a°ì²¾°Ê, °£«D¥Ø¼Ð¦a¶ô¬O¥»¤è«°¥«,546 ©Î¸Ó¦a¶ô¦s¦b¥»¤èªº¦a°ì±±¨î³¡¶¤. ®ü¤W³¡¶¤, ªÅ¤¤³¡¶¤,547 ¯SÏú§L¥H¤Î³B¤_¹B¿éª¬ºAªº³¡¶¤¨S¦³¦a°ì±±¨î¯à¤O.\\548 549 ! ¥e»â«°¥«\550 §ðÀ»«¬¦a±³¡¶¤¥i¥e»â¤£³]¨¾ªº¼Ä¤è«°¥«. ¥e»â¼Ä«°¦Z, 551 ¸Ó«°Æ×Äݦ}¦b¥~¾n¤ãªº¼Äx³¡¶¤±N¥þ¼Æ®ø¤`, ¾ãÓ«°¥« 552 ¤]·|³´¤JÄ̶ꬺA, ¦}«ùÄò¤TÓ¦^¦X.530 -左圖 - 初始机動力1.5的部隊\ 531 -右圖 - 初始机動力3的部隊\\ 532 533 如果部隊順著道路, 河流或運河移動, 無論原始地形為何, 534 机動力消耗都將降為0.4(斜向移動)和0.6(非斜向移動). 535 如果順著鐵路移動, 机動力消耗將降為初始机動力的8% 536 (斜向移動)和12%(非斜向移動).\\ 537 新回合開始時, 部隊消耗的机動力將回复到初始最大值. 538 海上部隊受損后, 机動力無法完全回复, 但不會低于2.5.\\ 539 要移動到更遠處, 可使用目標移動功能, 右鍵單擊目標地塊, 540 部隊就會向該地塊持續移動.\\ 541 542 !控制地域\ 543 部隊分為兩种: 一种有地域控制能力, 另一种則沒有. 有 544 地域控制能力的部隊在接近其他勢力的地域控制部隊時, 545 無法向對方控制的地域移動, 除非目標地塊是本方城市, 546 或該地塊存在本方的地域控制部隊. 海上部隊, 空中部隊, 547 特种兵以及處于運輸狀態的部隊沒有地域控制能力.\\ 548 549 !占領城市\ 550 攻擊型地面部隊可占領不設防的敵方城市. 占領敵城后, 551 該城屬并在外駐扎的敵軍部隊將全數消亡, 整個城市 552 也會陷入騷亂狀態, 并持續三個回合. 553 553 554 554 555 555 #COMMANDS 556 $ ³¡¶¤«ü¥O\556 $部隊指令\ 557 557 558 558 @@16\ 559 ! ³¡¶¤«ü¥O\560 561 ³¡¶¤ÏúÃþ¤£¦P, ¥H¤Î³¡¶¤©Ò³B¦a§Î¤£¦P, ³¡¶¤«ü¥O¤]¦³®tÉÝ:\562 563 - ¸Ñ´²: ¸Ñ´²¸Ó³¡¶¤\564 - ¾ã½s: ±N³¡¶¤½s¨î¥´´², ¥[¤J¨ì·í«e«°¥««Ø³]ªº·s³¡¶¤¤¤\565 - ¥Ø¼Ð²¾°Ê: Ä~Äò¦V¥ý«e³]©wªº¥Ø¼Ð²¾°Ê\566 - µy¦Z¦æ°Ê: ¼È®É¸õ¹L, ¿ï¾Ü¤U¤@³¡¶¤\567 - ì¦aµ¥«Ý: ¥»¦^¦X¤£¦A¦æ°Ê\568 - ¾n¦uĵ§Ù: «ùÄò¤£¦æ°Ê, ª½¦Ü³Q¦A¦¸¤â°Ê¿ï¤¤\569 - «ìÎ`¥ð¾ã: ¨ü·l³¡¶¤¦bì¦a°±¯d«ìÎ`ª¬ºA, ª½¦Ü§¹¥þ±dÎ`\570 - §ï¬°¥»«°³¡¶¤: ±N©Ò¦b«°¥««ü©w¬°¸Ó³¡¶¤·sªºÆ×ÄÝ«°¥«\571 - ªð¦^³Ìªñ«°¥«: ºÉ§Öªð¦^¶ZÖó̪ñªº¥»¤è«°¥«\572 - ¬É±©~¤¤: ¥H¸Ó³¡¶¤¬°µ¡¤f¤¤¤ß, ½Õ¾ã´åÀ¸µ¡¤f\573 - ±°¹Ü: ºR·´·í«e¦a¶ôªº¦a§Î«Ø³](»Ý¯Ó¶O1ÂIÉó°Ê¤O)559 !部隊指令\ 560 561 部隊种類不同, 以及部隊所處地形不同, 部隊指令也有差异:\ 562 563 -解散: 解散該部隊\ 564 -整編: 將部隊編制打散, 加入到當前城市建設的新部隊中\ 565 -目標移動: 繼續向先前設定的目標移動\ 566 -稍后行動: 暫時跳過, 選擇下一部隊\ 567 -原地等待: 本回合不再行動\ 568 -駐守警戒: 持續不行動, 直至被再次手動選中\ 569 -恢复休整: 受損部隊在原地停留恢复狀態, 直至完全康复\ 570 -改為本城部隊: 將所在城市指定為該部隊新的屬城市\ 571 -返回最近城市: 盡快返回距离最近的本方城市\ 572 -界面居中: 以該部隊為窗口中心, 調整游戲窗口\ 573 -掠奪: 摧毀當前地塊的地形建設(需耗費1點机動力) 574 574 575 575 576 576 #SETTLE 577 $ ²¾¥Á¤u§@\577 $移民工作\ 578 578 579 579 @@29\ 580 ! ²¾¥Á¤u§@\581 582 ²¾¥Á³¡¶¤, ¦p©Ý¯îªÌ©M¤uµ{®v, ¥i¹ï¦a§Î¶i¦æ§ï³y:\583 584 - ©w©~: ¦b©Ò¦b¦a¶ô«Ø¥ß·s«°¥«\585 - ²M°£´ËªL: ¬å¥ï´ËªL, ¹@¬°¯î¦a\586 - ©â¤zªh¿A: ±Nªh¿AÅܬ°¯ó³õ©Î¥ì\587 - ´Ó¾ð³yªL: ±N©Ò¦b¦a§ÎÅܬ°´ËªL\588 - §ó´«¦a§Î: §ó´«¦a§ÎÏúÃþ, ¸Ô¨£¬ÛÃö¦a§ÎªºÅܧó«H®§\589 - ²M°£¦Ã¬V: ®ø°£¦]¹L«×¥Í²£³y¦¨ªº¦a¶ô¦Ã¬V\\590 - ¦a§Î«Ø³]: ¤À¬°¦hÏúÃþ«¬, ¸Ô¨£:\591 ::J ¦a§Î«Ø³]¤@Äý\592 593 §ï³y¦a§Î»Ýªá¶O¤@©w¶qªºÉó°Ê¤O, ¥i¯à«ùÄò¼ÆӬƦܼƤQÓ 594 ¦^¦X¤è¯à§¹¦¨. ¬°¥[§Ö§ï³y³t«×, ¥i¥H¬£»º¦h¤ä²¾¥Á³¡¶¤¦b 595 ¦P¤@¦a¶ô¤W°õ¦æ¬Û¦Pªº§ï³y¥ô°È. ¦pªG³Ñ§EÉó°Ê¤O¤£¨¬1, 596 §ï³y¥ô°È±N±À¿ð¨ì¤U¦^¦X¤~¶}©l. ¤uµ{®v°õ¦æ¥ô°Èªº®Ä²vÉO 597 ©Ý¯îªÌ¬Û¦P, ¦ý¥Ñ¤_¤uµ{®v¾Ö¦³§ó°ªªºªì©lÉó°Ê¤O, ¦]¦¹¤u§@ 598 ³t«×¤ñ©Ý¯îªÌ§ó§Ö.\599 ::T ¥i°Ñ¦Ò: ¦a§ÎÏúÃþ¤@Äý580 !移民工作\ 581 582 移民部隊, 如拓荒者和工程師, 可對地形進行改造:\ 583 584 -定居: 在所在地塊建立新城市\ 585 -清除森林: 砍伐森林, 辟為荒地\ 586 -抽干沼澤: 將沼澤變為草場或平原\ 587 -植樹造林: 將所在地形變為森林\ 588 -更換地形: 更換地形种類, 詳見相關地形的變更信息\ 589 -清除污染: 消除因過度生產造成的地塊污染\\ 590 -地形建設: 分為多种類型, 詳見:\ 591 ::J 地形建設一覽\ 592 593 改造地形需花費一定量的机動力, 可能持續數個甚至數十個 594 回合方能完成. 為加快改造速度, 可以派遣多支移民部隊在 595 同一地塊上執行相同的改造任務. 如果剩余机動力不足1, 596 改造任務將推遲到下回合才開始. 工程師執行任務的效率与 597 拓荒者相同, 但由于工程師擁有更高的初始机動力, 因此工作 598 速度比拓荒者更快.\ 599 ::T 可參考: 地形种類一覽 600 600 601 601 602 602 #COMBAT 603 $ ¾Ô¤æ¤j¥þ\604 605 ! §ð¦u·§½×\606 607 ¥Î¤è¦VÁä©Î¹«¼Ð¥i«ü´§¥»¤è³¡¶¤§ðÀ»¾F±µªº¼Ä¤è³¡¶¤, ¤èªk 608 ÉO³¡¶¤²¾°Ê¬Û¦P. ¦ý§ðÀ»¤]¦³¤@©wªº³W«h, ³q±`±¡ªp¤U, ¦a± 609 ³¡¶¤µLªk§ðÀ»®ü¤W³¡¶¤, ¤Ï¤§¥çµM. ®ü¤W³¡¶¤¤£¯à±q«°¥«¤º 610 ©Î¹Bªe¤¤µo°_§ðÀ»; ªÅ¤¤³¡¶¤¥un¤£¦b«°¥«¤º©Îx¨Æ°ò¦a¤¤, 611 ´N¥u¯à³Q¨ä¥LªÅ¤¤³¡¶¤§ðÀ». ¾Ô¤æ¤¤®z¶Õ¤@¤è·|³Q®ø·À, ±j¶Õ 612 ¤@¤è±N¨ü¨ì·l¶Ë, ±j®z®t¶Z¶V¤j,±j¶Õ³¡¶¤¨ü·l¶V¤p. 613 n¹wª¾§ðÀ»ªº®ÄªG, ½Ð«ö¦íShiftÁä, ¥kÁäÂIÀ»n§ðÀ»ªº¥Ø¼Ð.\\614 615 ¨C¤ä³¡¶¤ªº¾Ô¤æ¤O¤À¬°§ðÀ»©M¨¾±s¨âÏú. ³¡¶¤±¡³ø¤¤Åã¥Üªº 616 75/25, ·N«ä´N¬O§ðÀ»75, ¨¾±s25. ¦b¤@³õ¾Ôª§¤¤, ÁÙ¦³¤@¨Ç617 ¦]¯À·|¼vÅT¹ê»Úªº¾Ô¤æ¤O:\618 - ³¡¶¤¸gÅç: ¸gÅç¤W¤É¤@¯Å, ¾Ô¤æ¤O´N´£¤É25%, ¸Ô¨£¤U¤å.\619 - ¦a§Î¨¾±s¥[¦¨: ¶È¹ï³Q§ðÀ»¤@¤è¦³®Ä, ¸Ô¨£¦a§ÎÃþ«¬¤@Äý.\620 - ¯S®í¨¾±s³]¬I: ¦p«°Àð, n¶ëµ¥µ¥; ¶È¹ï³Q§ðÀ»¤@¤è¦³®Ä.\621 - ¾n¦uª¬ºA: ¶È¹ï³Q§ðÀ»¤@¤è¦³®Ä; ¤£³B¤_¹B¿éª¬ºAªº³¡¶¤,622 Y¤W¦^¦X¨S¦³¦æ°Ê, ¥»¦^¦X¦Û°Ê¶i¤J¾n¦uª¬ºA, ¨¾±s+50%.\623 - ¦b«°¥«¨½©Îx¨Æ°ò¦a¤¤°±¯dªºªÅ¤¤³¡¶¤¨¾±s¤O¬°¹s, ¦b624 «°¥«¨½©Î¹Bªe¤¤ªº®ü¤W³¡¶¤¨¾±s¤O´î¥b.\625 ª`·N: ¦hÏú¨¾±s¤O¥[¦¨ªº®ÄªG¬O¿n²Ö¬Û¥[, ¦Ó¤£¬O¿¼Æ¬Û¼.\\626 627 Y§ðÀ»¤èÉó°Ê¤£¨¬1ÂI, «h®i¶}§ðÀ»®ÉµLªk¨Ï¥X¥þ³¡¾Ô¤æ¤O,628 ·|®ÚÕu³Ñ§EªºÉó°Ê¦Ó¬ÛÀ³«d®z.\\629 630 ! §ðÀ»¦¨¸s³¡¶¤\631 ¦pªG¨â¤ä©Î¨â¤ä¥H¤Wªº³¡¶¤°±¯d¦b¦P¤@¦a¶ô, ¦b¾D¨ü§ðÀ»®É, 632 ¥u¦³¤@¤ä³¡¶¤¥X°}¨¾¦u, ´N¬OÅã¥Ü¦b¦a¹Ï¤Wªº¨º¤ä³¡¶¤. 633 ³q±`±¡ªp¤U, ¨t²Î·|¬D¿ï¨¾±s³Ì±jªº³¡¶¤, ¸Ô±¡½ÐÂIÀ»:\\634 635 ;TILEDEF ¦¨¸s³¡¶¤ªº¨¾¦u\\636 637 ¦pªG¦b«°¥«, n¶ë©Îx¨Æ°ò¦a¤§¥~ªº¦¨¸s³¡¶¤¦b¾Ô¤æ¤¤¸¨±Ñ, 638 ¸Ó¦a¶ô¤W©Ò¦³ªº³¡¶¤³£·|³Q®ø·À, ¼ç¸¥©MÁô§Î¸Éó¤]¤£¨Ò¥~.\\639 640 ! ¸gÅçµ¥¯Å\641 ÀHµÛ¦b¾Ô¤æ¤¤¨ü·lª¬ºAªº¿n²Ö, ³¡¶¤ªº¸gÅçµ¥¯Å·|³v¯Å´£¤É,642 ¨C·l¥¢100ÂIª¬ºA, ³¡¶¤¸gÅç´£¤É¤@¯Å. ¸gÅçµ¥¯Å¸Ô¦C¦p¤U:\603 $戰斗大全\ 604 605 !攻守概論\ 606 607 用方向鍵或鼠標可指揮本方部隊攻擊鄰接的敵方部隊, 方法 608 与部隊移動相同. 但攻擊也有一定的規則, 通常情況下, 地面 609 部隊無法攻擊海上部隊, 反之亦然. 海上部隊不能從城市內 610 或運河中發起攻擊; 空中部隊只要不在城市內或軍事基地中, 611 就只能被其他空中部隊攻擊. 戰斗中弱勢一方會被消滅, 強勢 612 一方將受到損傷, 強弱差距越大,強勢部隊受損越小. 613 要預知攻擊的效果, 請按住Shift鍵, 右鍵點擊要攻擊的目標.\\ 614 615 每支部隊的戰斗力分為攻擊和防御兩种. 部隊情報中顯示的 616 75/25, 意思就是攻擊75, 防御25. 在一場戰爭中, 還有一些 617 因素會影響實際的戰斗力:\ 618 -部隊經驗: 經驗上升一級, 戰斗力就提升25%, 詳見下文.\ 619 -地形防御加成: 僅對被攻擊一方有效, 詳見地形類型一覽.\ 620 -特殊防御設施: 如城牆, 要塞等等; 僅對被攻擊一方有效.\ 621 -駐守狀態: 僅對被攻擊一方有效; 不處于運輸狀態的部隊, 622 若上回合沒有行動, 本回合自動進入駐守狀態, 防御+50%.\ 623 -在城市里或軍事基地中停留的空中部隊防御力為零, 在 624 城市里或運河中的海上部隊防御力減半.\ 625 注意: 多种防御力加成的效果是積累相加, 而不是倍數相乘.\\ 626 627 若攻擊方机動不足1點, 則展開攻擊時無法使出全部戰斗力, 628 會根据剩余的机動而相應削弱.\\ 629 630 !攻擊成群部隊\ 631 如果兩支或兩支以上的部隊停留在同一地塊, 在遭受攻擊時, 632 只有一支部隊出陣防守, 就是顯示在地圖上的那支部隊. 633 通常情況下, 系統會挑選防御最強的部隊, 詳情請點擊:\\ 634 635 ;TILEDEF 成群部隊的防守\\ 636 637 如果在城市, 要塞或軍事基地之外的成群部隊在戰斗中落敗, 638 該地塊上所有的部隊都會被消滅, 潛艇和隱形飛机也不例外.\\ 639 640 !經驗等級\ 641 隨著在戰斗中受損狀態的積累, 部隊的經驗等級會逐級提升, 642 每損失100點狀態, 部隊經驗提升一級. 經驗等級詳列如下:\ 643 643 &EXPERIENCE\\ 644 644 645 ! ª¬ºA«ìÎ`\646 ¦^¦Xµ²§ô®É, ¨ü·l³¡¶¤·|®ÚÕu³Ñ§EªºÉó°Ê¬ÛÀ³«ìÎ`³¡¤Àª¬ºA. 647 ¦pªG¥»¦^¦X¥¼´¿²¾°Ê, ³¡¶¤ªºª¬ºA³Ì¤j«ìÎ`8ÂI, Y¦b¥¼Ä̶à 648 «°¥«©Îx¨Æ°ò¦a¤¤, ª¬ºA³Ì¤j«ìÎ`20ÂI. ®ü±¤Wªº¨ü·l³¡¶¤ 649 ª¬ºA¤£·|«ìÎ`. ªÅ¤¤³¡¶¤¥u¦³¦b«°¥«©Îx¨Æ°ò¦a¤¤¤~¯à«ìÎ`.\\650 651 ! ÅF¬µ«°¥«\652 ¨ã³ÆÅF¬µ¯à¤Oªº®ü¤W©MªÅ¤¤³¡¶¤¥i§ðÀ»¾F±µªº¼Ä¤è«°¥«, 653 ÅF¬µ®ø¯Ó1ÂIÉó°Ê. ³QÅF¬µªº«°¥«³W¼Ò´î¤Ö1¯Å, ª½¦Ü³Q 654 §¹¥þºR·´. °õ¦æÅF¬µªº³¡¶¤¤£·|¨ü·l, ¤]µLªkÀò±o¸gÅçÈ.655 ÅF¬µ¤èªkÉO§ðÀ»¤èªk¬Û¦P, ¥Î¹«¼Ð©ÎÁä½L«ü´§³¡¶¤§ðÀ».\\656 657 ! ÅX³v³¡¶¤\658 §A¤]¥i¥H«ü´§¤@¤ä³¡¶¤±N¦b¤v¤è»â¤g¤W¾n¤ãªº©M¬ù°ê³¡¶¤ 659 ÅX³v¥X¹Ò. °õ¦æÅX³v«ü¥Oªº³¡¶¤¥²¶·¬O¦a±©Î®ü¤Wªº§ðÀ»©Ê 660 ³¡¶¤, ¥B³Ñ§EÉó°Ê¤j¤_1ÂI. ÅX³vªº¤èªkÉO§ðÀ»¤èªk¬Û¦P.645 !狀態恢复\ 646 回合結束時, 受損部隊會根据剩余的机動相應恢复部分狀態. 647 如果本回合未曾移動, 部隊的狀態最大恢复8點, 若在未騷亂 648 城市或軍事基地中, 狀態最大恢复20點. 海面上的受損部隊 649 狀態不會恢复. 空中部隊只有在城市或軍事基地中才能恢复.\\ 650 651 !轟炸城市\ 652 具備轟炸能力的海上和空中部隊可攻擊鄰接的敵方城市, 653 轟炸消耗1點机動. 被轟炸的城市規模減少1級, 直至被 654 完全摧毀. 執行轟炸的部隊不會受損, 也無法獲得經驗值. 655 轟炸方法与攻擊方法相同, 用鼠標或鍵盤指揮部隊攻擊.\\ 656 657 !驅逐部隊\ 658 你也可以指揮一支部隊將在己方領土上駐扎的和約國部隊 659 驅逐出境. 執行驅逐指令的部隊必須是地面或海上的攻擊性 660 部隊, 且剩余机動大于1點. 驅逐的方法与攻擊方法相同. 661 661 662 662 663 663 #TILEDEF 664 $ ¦¨¸s³¡¶¤\665 666 ! ¦¨¸s³¡¶¤\667 668 ¦pªG¨â¤ä©Î¨â¤ä¥H¤Wªº³¡¶¤°±¯d¦b¦P¤@¦a¶ô, ¦b¾D¨ü§ðÀ»®É, 669 ¥u¦³¨¾±s³Ì±jªº¨º¤ä³¡¶¤·|¥X°}¨¾¦u, ¦ý¤]·|¥X²{¨Ò¥~±¡ªp.670 ¨t²Î¦bÚÌ©w¨¾±s³¡¶¤®É, ¨Ì¦¸¿í´`¦p¤U³W«h:\671 - ³Ìɬ¥ýªº³W«h¬O®ÚÕu³¡¶¤ªºÃþ§O. º¥ý¬O¨ã³Æ¨g¼ö¤À¤lÄÝ©Ê672 ªº¦a±³¡¶¤, µM¦Z¬O¨ã¦³¦a°ì±±¨îÄݩʪº±`³W¦a±³¡¶¤, ²Ä¤T 673 ¿ï¾Ü¬O¨S¦³¦a°ì±±¨îÄݩʪº¦a±³¡¶¤, ³Ì¦Z¬O¼ç¸¥©MÁô§Î¸Éó.674 ¦b¹B¿éÄ¥©M¹B¿éÉó¤Wªº¹B¿é³¡¶¤¥Ã»·¤£·|§@¬°¨¾¦u³¡¶¤¥X°}.\675 - ¦pªG¦³¨â¤ä³¡¶¤Ãþ§O¬Û¦P, ¨¾±s¸û°ªªº³¡¶¤±N¾á¥ô¨¾¦u¥ô°È.676 ³o¨½ªº¨¾±s¤O«üªº¬O±N¸gÅçµ¥¯Å, ·í«eª¬ºA©M¾n¦uª¬ºAµ¥¦]¯À 677 ºî¦X¦Ò¼{ªºµ²ªG. ¹ï¯S©w³¡¶¤ªº¯S®í¨¾±s¥[¦¨±N¤£§@¦Ò¼{.\678 - ¦pªG¨â¤ä©Î¨â¤ä¥H¤W¨ã³Æ¬Û¦Pªº¨¾±s¤O(³oÏú±¡ªpÌå¤Öµo¥Í)679 ³yɲ¸û§Cªº¨º¤ä³¡¶¤±N¾á¥ô¨¾¦u¥ô°È.664 $成群部隊\ 665 666 !成群部隊\ 667 668 如果兩支或兩支以上的部隊停留在同一地塊, 在遭受攻擊時, 669 只有防御最強的那支部隊會出陣防守, 但也會出現例外情況. 670 系統在确定防御部隊時, 依次遵循如下規則:\ 671 -最优先的規則是根据部隊的類別. 首先是具備狂熱分子屬性 672 的地面部隊, 然后是具有地域控制屬性的常規地面部隊, 第三 673 選擇是沒有地域控制屬性的地面部隊, 最后是潛艇和隱形飛机. 674 在運輸艦和運輸机上的運輸部隊永遠不會作為防守部隊出陣.\ 675 -如果有兩支部隊類別相同, 防御較高的部隊將擔任防守任務. 676 這里的防御力指的是將經驗等級, 當前狀態和駐守狀態等因素 677 綜合考慮的結果. 對特定部隊的特殊防御加成將不作考慮.\ 678 -如果兩支或兩支以上具備相同的防御力(這种情況极少發生) 679 造价較低的那支部隊將擔任防守任務. 680 680 681 681 682 682 #SPYMISSIONS 683 $ ¯µ±K¦æ°Ê\683 $秘密行動\ 684 684 685 685 @@28\ 686 ! ¯µ±K¦æ°Ê\687 688 ¥u¦³¯SÏú§L¤~¯à°õ¦æ¯µ±K¦æ°Ê. ±N¯SÏú§L¬£»º¨ì¼Ä¤è«°¥« 689 ¤§¦Z, ·|¼u¥X¤@Ó¦æ°Êµæ³æ¨Ñª±®a¿ï¾Ü, ¿ï¶µ¦p¤U:\690 - ¯}§¥¥Í²£: «°¥«ªº«Ø³]¥Í²£°±º¢¤@¦^¦X.\691 - ÅѨú¦a¹Ï: Àò±o¼Ä¤è³Ì·sªº¥@¬É¦a¹Ï.\692 - Àò±o²Ä¤T°ê±¡³ø: ±q¼Ä¤èÀòª¾²Ä¤T°êªº°ê®a±¡³ø.\693 - ¥´§v°ê®a±¡³ø: Àòª¾¼Ä¤è³Ì·sªº°ê®a±¡³ø.\694 - ¥´§vx¨Æ±¡³ø: Àòª¾¼Ä¤è³Ì·sªºx¨Æ±¡³ø.\\695 696 ñ¸p©M¥±ø¬ùªº¨âÓ°ê®a, µLªk¦b¹ï¤è«°¥«¶}®i¯µ±K¦æ°Ê.697 ¦ý¯SÏú§L¨ÌµM¥i¼ç¤J¥ô¦ó¦a°Ï, µLµø±ø¬ùªº¬ù§ô.686 !秘密行動\ 687 688 只有特种兵才能執行秘密行動. 將特种兵派遣到敵方城市 689 之后, 會彈出一個行動菜單供玩家選擇, 選項如下:\ 690 -破坏生產: 城市的建設生產停滯一回合.\ 691 -竊取地圖: 獲得敵方最新的世界地圖.\ 692 -獲得第三國情報: 從敵方獲知第三國的國家情報.\ 693 -打听國家情報: 獲知敵方最新的國家情報.\ 694 -打听軍事情報: 獲知敵方最新的軍事情報.\\ 695 696 簽署和平條約的兩個國家, 無法在對方城市開展秘密行動. 697 但特种兵依然可潛入任何地區, 無視條約的約束. 698 698 699 699 700 700 #CLASSES 701 $ ³¡¶¤¬ãµo\702 703 ! ³¡¶¤¬ãµo\704 705 ´åÀ¸ªì©l®É, ¥ô¦ó¶Õ¤O³£¥iª½±µ¥Í²£¥Á§L©M©Ý¯îªÌ, 706 ¬Y¨Ç¯S®í³¡¶¤¶·´x´¤¯S©wªº¬ì§Þ©Î©_¸ñ, ¤è¥i¥Í²£.\707 ::S °Ñ¨£"¯S®í³¡¶¤"\\708 709 n¥Í²£¨ä¥Lªº·s«¬³¡¶¤, ¥²¶·É§U¬ì§Þ¬ãµo¤è¯à¹F¦¨. 710 ·íÀò±o¤F¬ÛÃöªº¬ì§Þª¾ÃѤ§¦Z, (¨Ò¦p´x´¤©|ªZ²ß«U¦Z, 711 ¥i¬ãµo·sªº¦a±³¡¶¤), ¥i¦b¬ãµoµ¡¤f¿ï¾Ü"³¡¶¤¬ãµo", 712 ±q¦Ó¶}±Ò³¡¶¤¬ãµoµ¡¤f:\\701 $部隊研發\ 702 703 !部隊研發\ 704 705 游戲初始時, 任何勢力都可直接生產民兵和拓荒者, 706 某些特殊部隊須掌握特定的科技或奇跡, 方可生產.\ 707 ::S 參見"特殊部隊"\\ 708 709 要生產其他的新型部隊, 必須借助科技研發方能達成. 710 當獲得了相關的科技知識之后, (例如掌握尚武習俗后, 711 可研發新的地面部隊), 可在研發窗口選擇"部隊研發", 712 從而開啟部隊研發窗口:\\ 713 713 714 714 @DraftShot\ 715 715 716 ¹Ï¨Ò:\717 -1: ·í«e½s¨î\718 -2: ¿¼W¦]¤l\719 -3: ¿ï¾Ü©Ò»ÝªºÄÝ©Ê\720 -4: ¿ï¾Ü§LÏú\721 -5: ¬ãµo§LÏúªº«ü¼Æ\\722 723 ³¡¶¤¬ãµoªºµ²ªG¨ú¨M¤_¨âÓ¦]¯À: ¤@¬O·í«e¥»°êªº¬ì§Þµo®i 724 ¤ô¥. ¬Y¨Ç¬ì§Þ¦¨ªG¥i±a¨Ó·sªº³¡¶¤ÄÝ©Ê, ©Î´£¤É°ò¥»ÄÝ©Ê 725 ªº¿¼W¦]¤l, °ò¥»ÄÝ©Ê¥]¬A§ðÀ», ¨¾±s, ¹B¿é, ³yɲµ¥µ¥.\\726 727 ¥t¤@Ó«h¬Oª±®a¦Û¦æ½Õ°tªº¦U¶µÄݩʤñ¨Ò¤Î¯S®í®ÄªG¥[¦¨. 728 µ´¤j¦h¼ÆÄÝ©Ê´£¤É®É, ¥Í²£³yɲ(%p)©M³¡¶¤½s¨î(%w)¤]·| 729 ¬ÛÀ³´£¤É. ³¡¶¤§LÏú©M¬ì§Þ¦¨ªG¨M©wµÛ³¡¶¤½s¨îªº¤W. n 730 Àòª¾¬YÄݩʪº¸Ô²Ó«H®§, ½Ð«ö¦íShiftÁä¦Z³æÀ»ÄݩʦWºÙ.\731 ::F ³¡¶¤ÄÝ©Ê\\732 733 ®ÚÕu´åÀ¸Ãø«×ªº¤£¦P, §ðÀ», ¨¾±s©M¹B¿éÄݩʪº´£¤É©Ò±a¨Ó 734 ªº³yɲÅܤƤ]·|¦³®tÉÝ. ¦b²³æÃø«×¤U, ³¡¶¤³yɲ±N¤ñ¥¿±` 735 Ãø«×§C25%, ¦Ó¦b§xÃøÃø«×¤U, ³yɲ±N¤ñ¥¿±`Ãø«×°ª25%.716 圖例:\ 717 -1: 當前編制\ 718 -2: 倍增因子\ 719 -3: 選擇所需的屬性\ 720 -4: 選擇兵种\ 721 -5: 研發兵种的指數\\ 722 723 部隊研發的結果取決于兩個因素: 一是當前本國的科技發展 724 水平. 某些科技成果可帶來新的部隊屬性, 或提升基本屬性 725 的倍增因子, 基本屬性包括攻擊, 防御, 運輸, 造价等等.\\ 726 727 另一個則是玩家自行調配的各項屬性比例及特殊效果加成. 728 絕大多數屬性提升時, 生產造价(%p)和部隊編制(%w)也會 729 相應提升. 部隊兵种和科技成果決定著部隊編制的上限. 要 730 獲知某屬性的詳細信息, 請按住Shift鍵后單擊屬性名稱.\ 731 ::F 部隊屬性\\ 732 733 根据游戲難度的不同, 攻擊, 防御和運輸屬性的提升所帶來 734 的造价變化也會有差异. 在簡單難度下, 部隊造价將比正常 735 難度低25%, 而在困難難度下, 造价將比正常難度高25%. 736 736 737 737 738 738 #CITIES 739 $ «°¥«·§½×\739 $城市概論\ 740 740 741 741 @@43\ 742 ! «°¥«·§½×\743 744 «°¥«ªº°ò¥»¥\¯à¬O¦¬¶°¾Fªñ¦a¶ôªº¸ê·½, ¦}±N¦¬¶°ªº¸ê·½ 745 ³B²z¦Z, Âର¬ì§Þ, ¥Í²£, ©Î¤H¤f. 746 ´åÀ¸ªì©l®É, ¤@Ó°ê®a¥u¦³¤@Ó«°¥«, ¸Ó«°¤]¬O°ê®aªºº³£. 747 ¦³¨âÏú¤èªk¼W¥[«°¥«¼Æ¶q, ¤@¬O¬£»º²¾¥Á³¡¶¤«Ø¥ß·s«°¥«, 748 ¤G¬O¬£§L¥e»â§O°êªº«°¥«. «°¥«¥u¯à«Ø¥ß¦b¥iÄéµ@ªº¤g¦a¤W 749 ( ¯ó³õ/¥ì/¯î¦a/¥C³®/aì).\\750 751 ¨CÓ«°¥«¦³¦U¦Û±MÄݪºµe±, ³æÀ»¦a¹Ï¤Wªº«°¥«¹Ï¼Ð, 752 §Y¥i¥´¶}¸Ó«°¥«ªº±MÄݵe±: \\742 !城市概論\ 743 744 城市的基本功能是收集鄰近地塊的資源, 并將收集的資源 745 處理后, 轉為科技, 生產, 或人口. 746 游戲初始時, 一個國家只有一個城市, 該城也是國家的首都. 747 有兩种方法增加城市數量, 一是派遣移民部隊建立新城市, 748 二是派兵占領別國的城市. 城市只能建立在可灌溉的土地上 749 (草場/平原/荒地/丘陵/苔原).\\ 750 751 每個城市有各自專屬的畫面, 單擊地圖上的城市圖標, 752 即可打開該城市的專屬畫面: \\ 753 753 754 754 @CityShot\ 755 755 756 ¤Wzµe±¤¤, ¥Dn¥]§t¤F¦p¤U¤LÓ¤j¶µ:\\757 758 ! ¥«¥Á\759 760 «°¥«µe±¥ª¤W¨¤ªº¤HÁy¥NªíµÛ¸Ó«°ªº¥«¥Á. «°¥«³W¼Òªº 761 ¤U¬°2¯Å, ¦pªG³W¼Ò°¦Ü2¯Å¥H¤U, «h¸Ó«°±N¤£Î`¦s¦b. 762 Àq»{±ø¥ó¤U, «°¥«³W¼Ò¤W¬°8¯Å, ¦ý¤WÈ¥i³q¹L¯S®í 763 ªº«°¥«³]¬I´£¤É.\\764 765 ¨CÓ¥«¥Á¥i¦¬¶°¤@Ó¦a¶ô(¨£¤W¹Ï1)ªº¸ê·½. ¤@Ó¦a¶ô¤W 766 ³Ì¦h®e¯Ç¤@¦W¥«¥Á. ³Q¨ä¥L«°¥«¥e¥Îªº¦a¶ô±N³Q¼Ð¥Ü¬° 767 ¤£¥i¥Î¦a¶ô.\\768 769 ¥¼³Q«ü©wªºªÅ¶¢¥«¥Á, ±N³Q¥Î§@¬°«°¥«§ÙÄY³¡¶¤(¨£¤W¹Ï2)770 ¥i¥Î¨ä¨Óºû«ù«°¥«¦w©wªº¤ñ¨Ò, ¨Ï«°¥«¤£¦Ü¤_³´¤JÄ̶Ã.771 ¸Ô²Ó«H®§½Ð°Ñ·Ó¤U¤åÀ°§U³¡¤À.\\772 773 ! ¦w©w\774 775 «°¥«µe±ªº¥k¤W¤èÅã¥Ü¤F·í«e¥«¥Áªº¦w©wª¬ºA. 776 ¸Ó³¡¤À¤À¬°¤T¦æ:\777 778 - °ø¨× (¹Ï¼Ð: %l). ¦pªG¦b"¸gÀ٤ε|¦¬"µæ³æ¤¤779 ³]©w¤F°ø¨×¤ñ¨Ò, «h¨CÓ«°¥«ªº¶T©ö¼Æ¤¤±N¦³ 780 ¤@³¡¤ÀÂà¤Æ¬°°ø¨×,¸Ô¨£¤U¤å¤¤ªº"¶T©ö"³¡¤À.\781 - ¦w©w (%m). Àq»{±¡ªp¤U, «°¥«¤¤¦³¥|¦W¥«¥Á782 ¬O¦w©wªº, ¨ä§E¥«¥Á³£¬O¤£¦wªº. «Ø³y¯S©wªº 783 «°¥«³]¬I©Î©_¸ñ, ¥i´£¤É¦w©w¥«¥Áªº¼Æ¶q. ¨C®y 784 ©_¸ñ¯à¨Ï©Ò¦b«°¥«¤¤ªº¨â¦W¤£¦w¥«¥ÁÅܬ°¦w©w.\785 - §ÙÄY (%o). ¨C¤ä«°¥«§ÙÄY³¡¶¤¥i¨Ï¨â¦W¤£¦w786 ¥«¥ÁÅܬ°¦w©w. ¥t¥~, ¯S®í³¡¶¤¤¤ªº¦u«°½Ã§L 787 ¤]¥i¨Ï±o¦w©w¥«¥Áªº¼Æ¶q¼W¥[.\\788 789 ¦pªG¤£¦w¥«¥Á¼Æ¶W¶V¤F°ø¨×¼ÆÉO¦w©w¥«¥Á¼Æ 790 ¤§©M, «h¾ãÓ«°¥«±N³´¤JÄ̶Ã.\\791 792 ¬Y¨Ç¯S©wªº¬FÊ^§Î¦¡¤U, ¤£¦w¨Æ¥óªºµo¥Í·|°§C 793 «°¥«ªº¦w©wÈ, ¸Ô²Ó«H®§½Ð°Ñ¦Ò\794 ::G ¬FÊ^§Î¦¡\\795 796 ! «H¥õ\797 ¦b©v±Ð¨î°ê®a,¦w©wȪºpºâÉO¨ä¥L¬FÊ^§Î¦¡¤£¦P. 798 ¨CÓ¥«¥Á³£¦]«H¥õ¦ÓÅܱo¦w©w, ¦]¦¹©v±Ð¨î°ê®a 799 µL»Ý¾á¤ß«°¥«ªº¦w©w°ÝÃD, §ó¤£·|¥X²{«°¥«Ä̶Ã.\\800 801 802 ! ¸ê·½ÏúÃþ\803 804 «°¥«±q©P³ò¦a¶ô¤¤¦¬¶°ªº¸ê·½, ®ÚÕuÃþ«¬¤£¦P 805 ¤À¬°¤TÏú: ³¹(%f), ì®Æ(%p)©M¶T©ö(%t).756 上述畫面中, 主要包含了如下几個大項:\\ 757 758 !市民\ 759 760 城市畫面左上角的人臉代表著該城的市民. 城市規模的 761 下限為2級, 如果規模降至2級以下, 則該城將不复存在. 762 默認條件下, 城市規模上限為8級, 但上限值可通過特殊 763 的城市設施提升.\\ 764 765 每個市民可收集一個地塊(見上圖1)的資源. 一個地塊上 766 最多容納一名市民. 被其他城市占用的地塊將被標示為 767 不可用地塊.\\ 768 769 未被指定的空閒市民, 將被用作為城市戒嚴部隊(見上圖2) 770 可用其來維持城市安定的比例, 使城市不至于陷入騷亂. 771 詳細信息請參照下文幫助部分.\\ 772 773 !安定\ 774 775 城市畫面的右上方顯示了當前市民的安定狀態. 776 該部分分為三行:\ 777 778 -奢侈 (圖標: %l). 如果在"經濟及稅收"菜單中 779 設定了奢侈比例, 則每個城市的貿易數中將有 780 一部分轉化為奢侈,詳見下文中的"貿易"部分.\ 781 -安定 (%m). 默認情況下, 城市中有四名市民 782 是安定的, 其余市民都是不安的. 建造特定的 783 城市設施或奇跡, 可提升安定市民的數量. 每座 784 奇跡能使所在城市中的兩名不安市民變為安定.\ 785 -戒嚴 (%o). 每支城市戒嚴部隊可使兩名不安 786 市民變為安定. 另外, 特殊部隊中的守城衛兵 787 也可使得安定市民的數量增加.\\ 788 789 如果不安市民數超越了奢侈數与安定市民數 790 之和, 則整個城市將陷入騷亂.\\ 791 792 某些特定的政体形式下, 不安事件的發生會降低 793 城市的安定值, 詳細信息請參考\ 794 ::G 政体形式\\ 795 796 !信仰\ 797 在宗教制國家,安定值的計算与其他政体形式不同. 798 每個市民都因信仰而變得安定, 因此宗教制國家 799 無需擔心城市的安定問題, 更不會出現城市騷亂.\\ 800 801 802 !資源种類\ 803 804 城市從周圍地塊中收集的資源, 根据類型不同 805 分為三种: 糧食(%f), 原料(%p)和貿易(%t). 806 806 \\ 807 807 808 ¨CÓ¦a¶ô¥X²£¸ê·½ªº¦h¤Ö¨ú¨M¤_¥H¤U¤TÓ±ø¥ó:\809 ::T ¦a§ÎÏúÃþ\810 ::J ¦a§Î§ï³y\811 ::G ¬FÊ^§Î¦¡\\812 813 ! ³¹\814 ³¹(²Å¸¹¬°%f)¥Nªí¤F¦UÏú¹ª«. «°¥«Â³¹ªº¥Í²£®ø¯Ó 815 ±¡ªpÅã¥Ü¦b³¹±ªO¤¤(¨£¤W¹Ï4). ³¹¬O¤HÃþ¨C¤éªº®Ú¥»,816 ¨CÓ¥«¥Á¨C¦^¦X»Ý®ø¯Ó2%f. ÁÙ¦³¤@¨Ç³¡¶¤»Ýn©w¶qªºÂ³¹ 817 §@¬°¨Ñµ¹, ¦p³¹¨ÑÀ³¤£¨¬, ±N±q«°¥«ªº¦s³¤¤¦©°£. ¦pªG 818 ¦s³¯ÓºÉ, «°¥«³´¤JÄȯî, ·|¦³¤@¦W¥«¥Á©Î¤@¤ä³¡¶¤®ø¥¢. 819 ¦ý¦b³q±`±¡ªp¤U, «°¥«¥Í²£ªºÂ³¹¶q¤£·|§C¤_®ø¯Ó¶q. ¦pªG 820 ¥Í²£ªºÂ³¹¦³³Ñ§E, ¦h§EªºÂ³¹±Np¤J¦s³, ¦ý¦³¤@Ïú±¡ªp 821 Äݤ_¨Ò¥~: ³W¼Ò¹F¨ì8ªº¤j«°¥«¨C¦^¦X¦pªG¦h§E1³æ¦ìªºÂ³¹, 822 «h³o1³æ¦ì³¹±Nª½±µÂର¸êª÷, ¤£p¤J¦s³. ¦pªG¦s³¹F¨ì 823 ¤W, ¥B«°¥«³W¼Ò¥¼¹F¤W, ¨º¤\³oÓ«°¥«ªº³W¼Ò·|´£¤É1¯Å, 824 ¥«¥Á¼Æ¶q¥[1.\\825 826 ! ì®Æ\827 ì®Æ (²Å¸¹¬°%p)¬O¤@Ïú©â¶Hªº¸ê·½, ¬O¦UÏú³Ò°Ê¥Í²£¸ê·½ 828 ¦p¤ìÀY, Äq¥Û, ¥Ûªoµ¥ªºÁ`ºÙ. «°¥«ì®Æªº¥Í²£®ø¯Ó±¡ªpÅã¥Ü 829 ¦bì®Æ±ªO¤¤(¨£¤W¹Ï5). «°¥«¤¤¬Y¨ÇÆ×Äݳ¡¶¤»Ý®ø¯Ó¤@©w¶q 830 ªºì®Æ¥Hºû«ù¤é±`¨Ñµ¹, ³Ñ§Eì®Æ±N§ë¤J¨ì¥Í²£«Ø³]¤§¤¤. 831 ±z¥i§ó§ï«°¥«·í«e«Ø³]ªº¶µ¥Ø(¨£¤W¹Ï6). «°¥«¦a¹Ï(¨£¤W¹Ï7)832 Åã¥Ü¤F«°¥«·í«e³]¬Iªº¦ì¸m. 833 ¦³Ãö«Ø³]ªº¸Ô²Ó«H®§, ½Ð°Ñ¦Ò¤U¤@³¹¸`"¥Í²£¸Ô¸Ñ".\\834 835 ! ¶T©ö\836 ¶T©ö(²Å¸¹¬°%t)¥Nªí«°¥«ªº¶T©ö©Ò±o. ¥u¦³«°¥«©P³òªº¦a¶ô 837 ¤~¯à¶i¦æ¶T©ö, «°¥«¥»¨©Ò¦bªº¦a¶ô¤£·|°^Äm¥ô¦ó¶T©öÈ, 838 §Y«K«°¥««Ø¦bª÷Äq¤W¤]µLÀÙ¤_¨Æ. «°¥«¶T©öªº¥Í²£®ø¯Ó±¡ªp 839 Åã¥Ü¦b¶T©ö±ªO¤¤(¨£¤W¹Ï8). ®ÚÕu°ê®a·í«eªº¬FÊ^ÅܤÆ, 840 ¥H¤ÎÉOº³£ªº¦a²z¶ZÖÃ, «°¥«¤¤¤@©w¤ñ¨Òªº¶T©ö©Ò±o·|¦]¬° 841 »G±Ñ¦Ó¥Õ¥Õ¬y¥¢, ³Ñ§Eªº%t±N«öp¦E¤¤ªº¤ñ¨Ò¤À°t¦Z, ¤À§O 842 ¥Î¤_°ê®aµ|¦¬, °ø¨×®ø¶O©M¬ì¾Ç¬ã¨s. µ|¦¬³¡¤À(%c)©è®ø¤ä¥X 843 ¤§¦Zªº³Ñ§E©Ò±o±N¥R¤J°ê®w; ¬ì¬ã³¡¤À(%r)±N¥Î§@¬ì¬ã¸g¶O, 844 ¥[§Ö·í«e¬ì¬ãªº¶i«×; °ø¨×³¡¤À(%l)¥i½Õ¾ã¥«¥Áªº¦w©wµ{«×. 845 ª`: nÀò±o¶T©ö§Q¼í, ¸Ó«°¦Ü¤Ö¶·¾Ö¦³¥H¤U«Øµ®:\846 ::B49 ¥«¬FÆU\\847 848 ;CORRUPTION ¬ÛÃö¸ê®Æ: pºâ»G±Ñ¤ñ¨Ò\\849 850 ! ¸ê·½¦Û°Ê¤À°t\851 «ü©w¨t²Î¹ïªö¶°¸ê·½¥H¤Î°õ¦æ§ÙÄYªº¥«¥Á¶i¦æ¦Û°Êɬ¤Æ¤À°t. 852 ª±®a¥u»Ý®ÚÕuÓ¤H¥Ø¼Ð, «ü©w³Ìɬ¦]¤l(¨£¤W¹Ï9).853 ¦Û°Ê¤À°t¦³¥H¤U¤Ïú¼Ò¦¡:854 - ¼Wªø³Ì¤j¤Æ(Àq»{¼Ò¦¡). ¥þ¤O«OÃÒ«°¥«¤H¤f¼Wªø, ºÉ¤@¤Á¥i¯à855 ¦¬¶°¹ª«¸ê·½.\856 - ¥Í²£³Ì¤j¤Æ. ¥þ¤O«OÃÒ«°¥«³]¬I«Ø³], ºÉ¥i¯à¦¬¶°ì®Æ¸ê·½.857 ¦Ò¼{¨ìª±®a¦bÁʶR³]¬I®É»Ýn¤@©w°]¤O¤ä«ù, ¦¹¼Ò¦¡¤]¤£·| 858 ©¿²¤¤F¶T©ö¸ê·½ªº¦¬¶°, ¦Ó³¹ÉO¬ì¬ã¸ê·½±N³Q°ò¥»©¿²¤.\859 - ¬ì¬ã³Ì¤j¤Æ. µÛ«¦¬¶°¶T©ö¸ê·½(§Y¬ì¬ã¤Îµ|¦¬ªº¨Ó·½). ³¹860 ¸ê·½±N³Q°ò¥»©¿²¤.\861 - ¥Í²£É¬¥ý. ¼Wªø¤Î¨ä¥L¦]¯ÀÝÅUªº¼Ò¦¡, ɬ¥ý¦Ò¼{ì®Æ¦¬¶°.\862 - ¬ì¬ãɬ¥ý. ¼Wªø¤Î¨ä¥L¦]¯ÀÝÅUªº¼Ò¦¡, ɬ¥ý¦Ò¼{¶T©ö¦¬¶°. \\863 864 ;OPTI ¬ÛÃö¸ê®Æ: ¸ê·½¦Û°Ê¤À°t¤½¦¡\\865 866 ª`·N, ¦b¬Y¨Ç±¡ªp¤U, ¦Û°Ê¤À°t¥i¯àµL®Ä, ¨Ò¦p:867 ¦b«°¥««Ø³]©w¬°°Ó«~¶T©ö®É¿ï¾Ü"¥Í²£³Ì¤j¤Æ";868 ¦b«°¥«³W¼Òµo®i¤w¹F¤W®É¿ï¾Ü"¼Wªø³Ì¤j¤Æ";869 ¦b«°¥«µL¥«¬FÆU¦¬¶°¶T©ö®É¿ï¾Ü"¬ì¬ã³Ì¤j¤Æ";870 ¥H¤W±¡ªp¤U, ¦b¦Û°Ê¤À°t¼Ò¦¡¤Uªº¨t²Î¥u¯à°h¦Ó 871 ¨D¨ä¦¸, ¥i¯à¾ÉPªº¦ZªGÃø¥H¹w®Æ.\\872 873 ¦³¤T¶µ±j¨î±ø¥óªºÉ¬¥ý¯Å¬Æ¤_ª±®a«ü©wªº³Ìɬ¦]¤l, 874 ª±®aµLªk§ïÅܳo¤T¶µ±ø¥ó:\875 - ºn±ø¥ó: «°¥«ºû«ù¦w©w, ¤£P³´¤JÄ̶Ã\876 - ¦¸n±ø¥ó: «OÃÒÆ×Äݳ¡¶¤ªºì®Æ¨Ñµ¹\877 - ²Ä¤T±ø¥ó: «OÃÒ«°¥«¤H¤f¥H¤ÎÆ×Äݳ¡¶¤ªºÂ³¹¨Ñµ¹\\878 879 ! ¤â°Ê¤À°t\880 ¦pªG¤£·Q¨Ï¥Î¸ê·½¦Û°Ê¤À°t, ¦³¨âÏú¤è¦¡¤Á´«¦Ü¤â°Ê¤À°t:881 ¥iÂIÀ»¶ê§Î¤À°t«ö¶s©³³¡ªº¦Ç¦â¥bÀô; ©ÎªÌª½±µÂIÀ»¤W¤èªº 882 «°¥«¦a¹Ï. ¦b¤â°Ê¼Ò¦¡¤U, ª±®a¥i¦Û¥Ñ¤À°t¥«¥Á¦b«ü©wªº¦a¶ô 883 ¦¬¶°¸ê·½, ©Î¬O§ï¬°«°¥«§ÙÄY³¡¶¤. ÂIÀ»¦b¦a¶ô¤W¤u§@ªº¥«¥Á,884 ¥i±N¨ä§ï¬°«°¥«§ÙÄY³¡¶¤; ÂIÀ»µL¤H¤u§@ªº¦a¶ô, ¥i±N°õ¦æ 885 §ÙÄYªº¥«¥Á«ü¬£¨ì¸Ó¦a¶ô¤u§@. µ²¦X¥H¤W¨â¨B, §Y¥i±N¤@Ó¦a¶ô 886 ¤W¤u§@ªº¥«¥ÁÂಾ¦Ü¥t¤@¦a¶ô.\\887 888 ·í¸ê·½¦Û°Ê¤À°t¼Ò¦¡³QÃö³¬¦Z, ½Ð¯d¤ß¥H¤U¨Ñ¨Dªº¥¿Å: 889 ³¹¨Ñµ¹, ³¡¶¤ì®Æ¨Ñµ¹, ¥H¤Î«°¥«¦w©w¤H¤fªº¤ñ¨Ò, §_«h 890 ¥i¯à¥X²{·N®Æ¤£¨ìªº¦ZªG.\\891 892 ! «°¥«Ä̶Ã\893 ¦pªG«°¥«ªº¤£¦w¤H¤f¼Æ¶W¹L¤F¦w©w¤H¤f¼Æ, ¾ãÓ«°¥«±N³´¤JÄ̶Ã,894 ©Ò¦³¥Í²£, ¬ì¬ã¤Îµ|¦¬¬¡°Ê°±º¢. ±qÄ̶ÃÃzµo¦Zªº²Ä¤G¦^¦X¶}©l,895 «°¥«¤£¦Aµ¹Æ×Äݪº³¡¶¤¨Ñµ¹¸ê·½, »Ýn¸ê·½ºû«ùªº³¡¶¤±N³v¤ä 896 ¸Ñ´², ¨C¦^¦X´î¤Ö¤@¤ä, ª½¦ÜÄ̶õ²§ô.\\897 898 ¦b³q±`±¡ªp¤U, ¦Û°Ê¤À°t¼Ò¦¡Á`¯àÁקK«°¥«Ä̶꺵o¥Í, °£«D 899 µo¥Í¹L¦hªº¤£¦w¨Æ¥ó. ¦pªG¹J¨ì¤Wz±¡ªp, ½Ð±N¾ÉP¤£¦w¨Æ¥ó 900 ªº³¡¶¤ºM¦^¨ì¥»¤g, ©Î¸Ñ´²³o¨Ç³¡¶¤, §Y¥i¨Ï«°¥««ìÎ`¯´§Ç.\\901 902 ¦pªGÃö³¬¤F¦Û°Ê¤À°t¼Ò¦¡, ½Ð§O§Ñ¤F±±¨î«°¥«¦w©w¤H¤fªº¤ñ¨Ò.903 ³Ì±`¥Îªº¤èªk¬O±N§ó¦h¥«¥Á§ï¬°«°¥«§ÙÄY³¡¶¤.808 每個地塊出產資源的多少取決于以下三個條件:\ 809 ::T 地形种類\ 810 ::J 地形改造\ 811 ::G 政体形式\\ 812 813 !糧食\ 814 糧食(符號為%f)代表了各种食物. 城市糧食的生產消耗 815 情況顯示在糧食面板中(見上圖4). 糧食是人類每日的根本, 816 每個市民每回合需消耗2%f. 還有一些部隊需要定量的糧食 817 作為供給, 如糧食供應不足, 將從城市的存糧中扣除. 如果 818 存糧耗盡, 城市陷入饑荒, 會有一名市民或一支部隊消失. 819 但在通常情況下, 城市生產的糧食量不會低于消耗量. 如果 820 生產的糧食有剩余, 多余的糧食將計入存糧, 但有一种情況 821 屬于例外: 規模達到8的大城市每回合如果多余1單位的糧食, 822 則這1單位糧食將直接轉為資金, 不計入存糧. 如果存糧達到 823 上限, 且城市規模未達上限, 那么這個城市的規模會提升1級, 824 市民數量加1.\\ 825 826 !原料\ 827 原料 (符號為%p)是一种抽象的資源, 是各种勞動生產資源 828 如木頭, 礦石, 石油等的總稱. 城市原料的生產消耗情況顯示 829 在原料面板中(見上圖5). 城市中某些屬部隊需消耗一定量 830 的原料以維持日常供給, 剩余原料將投入到生產建設之中. 831 您可更改城市當前建設的項目(見上圖6). 城市地圖(見上圖7) 832 顯示了城市當前設施的位置. 833 有關建設的詳細信息, 請參考下一章節"生產詳解".\\ 834 835 !貿易\ 836 貿易(符號為%t)代表城市的貿易所得. 只有城市周圍的地塊 837 才能進行貿易, 城市本身所在的地塊不會貢獻任何貿易值, 838 即便城市建在金礦上也無濟于事. 城市貿易的生產消耗情況 839 顯示在貿易面板中(見上圖8). 根据國家當前的政体變化, 840 以及与首都的地理距离, 城市中一定比例的貿易所得會因為 841 腐敗而白白流失, 剩余的%t將按計划中的比例分配后, 分別 842 用于國家稅收, 奢侈消費和科學研究. 稅收部分(%c)抵消支出 843 之后的剩余所得將充入國庫; 科研部分(%r)將用作科研經費, 844 加快當前科研的進度; 奢侈部分(%l)可調整市民的安定程度. 845 注: 要獲得貿易利潤, 該城至少須擁有以下建筑:\ 846 ::B49 市政廳\\ 847 848 ;CORRUPTION 相關資料: 計算腐敗比例\\ 849 850 !資源自動分配\ 851 指定系統對采集資源以及執行戒嚴的市民進行自動优化分配. 852 玩家只需根据個人目標, 指定最优因子(見上圖9). 853 自動分配有以下五种模式: 854 -增長最大化(默認模式). 全力保證城市人口增長, 盡一切可能 855 收集食物資源.\ 856 -生產最大化. 全力保證城市設施建設, 盡可能收集原料資源. 857 考慮到玩家在購買設施時需要一定財力支持, 此模式也不會 858 忽略了貿易資源的收集, 而糧食与科研資源將被基本忽略.\ 859 -科研最大化. 著重收集貿易資源(即科研及稅收的來源). 糧食 860 資源將被基本忽略.\ 861 -生產优先. 增長及其他因素兼顧的模式, 优先考慮原料收集.\ 862 -科研优先. 增長及其他因素兼顧的模式, 优先考慮貿易收集. \\ 863 864 ;OPTI 相關資料: 資源自動分配公式\\ 865 866 注意, 在某些情況下, 自動分配可能無效, 例如: 867 在城市建設定為商品貿易時選擇"生產最大化"; 868 在城市規模發展已達上限時選擇"增長最大化"; 869 在城市無市政廳收集貿易時選擇"科研最大化"; 870 以上情況下, 在自動分配模式下的系統只能退而 871 求其次, 可能導致的后果難以預料.\\ 872 873 有三項強制條件的优先級甚于玩家指定的最优因子, 874 玩家無法改變這三項條件:\ 875 -首要條件: 城市維持安定, 不致陷入騷亂\ 876 -次要條件: 保證屬部隊的原料供給\ 877 -第三條件: 保證城市人口以及屬部隊的糧食供給\\ 878 879 !手動分配\ 880 如果不想使用資源自動分配, 有兩种方式切換至手動分配: 881 可點擊圓形分配按鈕底部的灰色半環; 或者直接點擊上方的 882 城市地圖. 在手動模式下, 玩家可自由分配市民在指定的地塊 883 收集資源, 或是改為城市戒嚴部隊. 點擊在地塊上工作的市民, 884 可將其改為城市戒嚴部隊; 點擊無人工作的地塊, 可將執行 885 戒嚴的市民指派到該地塊工作. 結合以上兩步, 即可將一個地塊 886 上工作的市民轉移至另一地塊.\\ 887 888 當資源自動分配模式被關閉后, 請留心以下供求的平衡: 889 糧食供給, 部隊原料供給, 以及城市安定人口的比例, 否則 890 可能出現意料不到的后果.\\ 891 892 !城市騷亂\ 893 如果城市的不安人口數超過了安定人口數, 整個城市將陷入騷亂, 894 所有生產, 科研及稅收活動停滯. 從騷亂爆發后的第二回合開始, 895 城市不再給屬的部隊供給資源, 需要資源維持的部隊將逐支 896 解散, 每回合減少一支, 直至騷亂結束.\\ 897 898 在通常情況下, 自動分配模式總能避免城市騷亂的發生, 除非 899 發生過多的不安事件. 如果遇到上述情況, 請將導致不安事件 900 的部隊撤回到本土, 或解散這些部隊, 即可使城市恢复秩序.\\ 901 902 如果關閉了自動分配模式, 請別忘了控制城市安定人口的比例. 903 最常用的方法是將更多市民改為城市戒嚴部隊. 904 904 905 905 906 906 #CORRUPTION 907 $ pºâ»G±Ñ¤ñ¨Ò\908 909 ! pºâ»G±Ñ¤ñ¨Ò\910 911 ¤@Ó«°¥«ªº»G±Ñ¤ñ¨Ò, ®ÚÕu¥H¤U¤½¦¡pºâ:\912 @C ORRUPTION\913 -T - «°¥«¶T©öÁ`È\914 -C - ¬FÊ^»G±Ñ¦]¤l\915 -D - «°¥«ÉOº³£ªº¶ZÖÃ\916 -Dmax - ²z½×¤W¬Û¹j³Ì»·ªº¨â®y«°¥«¶¡ªº¶ZÖà (§Y¥H¦a¹Ï917 ¥þ°ªÉO¦a¹Ï¥b¼e¬°ª½¨¤Ãä, ©Ò±oªº¤T¨¤§Î±×Ãäªø«×)\\918 919 ¦pªG¤@Ó°ê®a¨S¦³º³£, «hµL½×¬°¦óÏú¬FÊ^, ¸Ó°ê©Ò¦³«°¥« 920 ¤¤ªº»G±Ñ¤ñ¨Ò¬°100%, ¦³ªk°|ªº«°¥«»G±Ñ¤ñ¨Ò¬°50%.907 $計算腐敗比例\ 908 909 !計算腐敗比例\ 910 911 一個城市的腐敗比例, 根据以下公式計算:\ 912 @Corruption\ 913 -T - 城市貿易總值\ 914 -C - 政体腐敗因子\ 915 -D - 城市与首都的距离\ 916 -Dmax - 理論上相隔最遠的兩座城市間的距离 (即以地圖 917 全高与地圖半寬為直角邊, 所得的三角形斜邊長度)\\ 918 919 如果一個國家沒有首都, 則無論為何种政体, 該國所有城市 920 中的腐敗比例為100%, 有法院的城市腐敗比例為50%. 921 921 922 922 923 923 #OPTI 924 $ ¸ê·½¦Û°Ê¤À°t±ø¥ó¤½¦¡\925 926 ! ¸ê·½¦Û°Ê¤À°t±ø¥ó¤½¦¡\927 928 ¦Û°Ê¤À°t¸ê·½¦@¥]¬A¤Ïú±¡ªp, ¨ä¤¤ªº®t§O¦b¤_ɬ¥ý¦]¤lmªºÚÌ©w¤Îpºâ. ɬ¥ý¦]¤lmªº¦Ò¶qS³ò¥]¬A¥H¤U¥|Ãþ: ³¹(f), ì®Æ(p),929 µ|¦¬(t)©M¬ì¬ã(r), m2¬°¦¸É¬¦]¤l, ¥H¦¹Ãþ±À\930 - ¼Wªø³Ì¤j¤Æ: m = f, m2 = 2p + t + r\931 - ¥Í²£³Ì¤j¤Æ: m = 4p + t, m2 = r, m3 = f\932 - ¬ì¬ã³Ì¤j¤Æ: m = 2r + t + p, m2 = f\933 - ¥Í²£É¬¥ý: m = sqrt(f) * (8p + 2t + r)\934 - ¬ì¬ãɬ¥ý: m = sqrt(f) * (r + t + p)924 $資源自動分配條件公式\ 925 926 !資源自動分配條件公式\ 927 928 自動分配資源共包括五种情況, 其中的差別在于优先因子m的确定及計算. 优先因子m的考量范圍包括以下四類: 糧食(f), 原料(p), 929 稅收(t)和科研(r), m2為次优因子, 以此類推\ 930 -增長最大化: m = f, m2 = 2p + t + r\ 931 -生產最大化: m = 4p + t, m2 = r, m3 = f\ 932 -科研最大化: m = 2r + t + p, m2 = f\ 933 -生產优先: m = sqrt(f) * (8p + 2t + r)\ 934 -科研优先: m = sqrt(f) * (r + t + p) 935 935 936 936 937 937 #PRODUCTION 938 $ ¥Í²£¸Ô¸Ñ\939 940 ! ¥Í²£¥Ø¼Ð\941 942 «Ø¥ß·s«°©Î¥e»â¼Ä«°¦Z, ·í«eªº«Ø³]¥Ø¼Ð±N©w¬° "°Ó«~¶T©ö", 943 ·N§Y±N¥Í²£ì®Æª½±µÂà´«¬°ª÷¿ú§Q¼í. ÂIÀ»¥Ø¼Ð¹Ï¤ù, ¥i¿ï¾Ü 944 ¨ä¥L¥Ø¼Ð, ¿ï¾ÜS³ò¨ú¨M¤_¥»°êªº¬ì§Þµo®i¤ô¥. «ö¦íShiftÁä 945 ¦ZÂIÀ»¶µ¥Ø, ¥iÅã¥Ü¬ÛÃöÀ°§U. ¦³3Ãþ«Ø³]¥Ø¼Ð¥i¨Ñ¿ï¾Ü:\946 - ³¡¶¤\947 - «°¥«³]¬I\948 - ©_¸ñ¤Î°ê®a¤uµ{\\949 950 ¦pªG±N«°¥«·í«eªº«Ø³]¥Ø¼Ð §ó§ï¬°¦PÃþ¤¤ªº¨ä¥L³]¬I©Î³¡¶¤, 951 ²Ö¿nªº¥Í²£ì®Æ±N·l¥¢¤T¤À¤§¤@. ¦pªG§ó§ï¬°¨ä¥LÃþ§Oªº³]¬I 952 ©Î³¡¶¤, «h²Ö¿nªº¥Í²£ì®Æ±Nª½±µÅܽ欰ª÷¿ú. n·Q¥[§Ö³]¬I 953 «Ø³]ªº³t«×, ¥i¿ï¾Ü¤w¦³ªº³]¬I, ¦Ó¦Z¿ï¾Ü±ÀË««Ø, «hì³]¬I 954 ¤T¤À¤§¤Gªº¥Í²£ì®Æ±N³Q¦^¦¬, ª½±µ²K¥[¨ì·í«e«Ø³]³]¬Iªº 955 ¥Í²£ì®Æ¤¤; n·Q¥[§Ö³¡¶¤«Ø³]ªº³t«× («Ø³]¶¤°£¥~), ¥i¿ï¾Ü 956 «°¤º¾n¦uªº³¡¶¤, ¦Ó¦Z¿ï¾Ü¾ã½s, «h쳡¶¤¤T¤À¤§¤Gªº¤Hû±N 957 ª½±µ¥[¤J·í«e«Ø³]³¡¶¤¤§¤¤.\\958 959 ! ²¾¥Á\960 ©Ý¯îªÌ¡B¤uµ{®v¡B¥£Æ×¥H¤Î©º¶Ò³¡¶¤³£¨Ó¦Û¤_¥«¥Á, ¦]¦¹¦b 961 ¥Í²£³o¨Ç³¡¶¤¦Z, «°¥«³W¼Ò±N·|ÁY¤p. ¥Í²£©º¶Ò³¡¶¤©M¥£Æ×, 962 ³W¼Ò±NÁY¤p¤@¯Å; ¥Í²£©Ý¯îªÌ©M¤uµ{®v, «°¥«³W¼Ò±NÁY¤p¨â¯Å. 963 ²¾¥Á¹Lµ{¬O¥i°fªº: ±N¥H¤W³¡¶¤¥[¤J«°¥«, ¥i¨Ï«°¥«³W¼ÒÂX¤j, 964 «e´£¬O«°¥«³W¼Ò¥¼¹F¨ì¤W.\\965 966 ! ©º¶Ò\967 ¥i¥H¥Î©º¶Òªº¤è¦¡¥Í²£¥ô¦ó¤wª¾ªº¦a±³¡¶¤. ©º¶Òªº³¡¶¤ 968 ±N¦h¯Ó¶O1%f¹ª«. ©º¶Òªº¦n³B¦b¤_, ¥i±N³¡¶¤ªº¥Í²£®É¶¡ 969 ÁY´î¨ìì¨Óªº¤T¤À¤§¤@. n©º¶Ò³¡¶¤, ¶·¥ýÀò±o¥H¤U¬ì§Þ:\970 ::A18 ©º§L¨î«×\\971 972 ! ¶R½æ¥Í²£ì®Æ\973 n¨³³t§¹¦¨¥Í²£, ¥iªá¿úÁʶR, ÁʶR¦Zªº¥Ø¼Ð±N¤_¤U¦^¦X 974 ¶}©l®É§¹¤u. n·Q§Ö,±oªá¤jɲ¿ú: ¨CÓ¥¼§¹¦¨ªºì®Æ%p, 975 »Ý¤ä¥I4¿ªºª÷¿ú. ¤Ï¨¥¤§, ¤]¥i¥HÅܽæ¥Í²£ì®Æ, ¥u»Ý±N 976 ¥Ø¼Ð§ï¬°"°Ó«~¶T©ö"§Y¥i. ²Ö¿nªº¥Í²£ì®Æ±NÂà´«¬°ª÷¿ú.\\977 978 ! ¦Ã¬V\979 ¨C1ÂIì®Æ¥Í²£³£±N³y¦¨1ÂI¦Ã¬V, ¦Ó¨CÓ¥«¥Á¥i©è®ø1ÂI¦Ã¬V, 980 ¦h§Eªº¦Ã¬V±NºCºC¿n²Ö¬°¼o®Æ, ¦pªG¿n²Öªº¼o®Æ¼Æ¶q¹F¨ì240, 981 «°¥«S³ò¤º±N¥X²{¤@³B¦Ã¬V°Ï, ¸Ó¦a¶ôªº¸ê·½²£¶q±N°¬°ì¥ý 982 ªº¤@¥b. ©Ý¯îªÌ©M¤uµ{®v¥i¥H²M²z¦Ã¬V.938 $生產詳解\ 939 940 !生產目標\ 941 942 建立新城或占領敵城后, 當前的建設目標將定為 "商品貿易", 943 意即將生產原料直接轉換為金錢利潤. 點擊目標圖片, 可選擇 944 其他目標, 選擇范圍取決于本國的科技發展水平. 按住Shift鍵 945 后點擊項目, 可顯示相關幫助. 有3類建設目標可供選擇:\ 946 -部隊\ 947 -城市設施\ 948 -奇跡及國家工程\\ 949 950 如果將城市當前的建設目標 更改為同類中的其他設施或部隊, 951 累積的生產原料將損失三分之一. 如果更改為其他類別的設施 952 或部隊, 則累積的生產原料將直接變賣為金錢. 要想加快設施 953 建設的速度, 可選擇已有的設施, 而后選擇推倒重建, 則原設施 954 三分之二的生產原料將被回收, 直接添加到當前建設設施的 955 生產原料中; 要想加快部隊建設的速度 (建設隊除外), 可選擇 956 城內駐守的部隊, 而后選擇整編, 則原部隊三分之二的人員將 957 直接加入當前建設部隊之中.\\ 958 959 !移民\ 960 拓荒者、工程師、奴以及征募部隊都來自于市民, 因此在 961 生產這些部隊后, 城市規模將會縮小. 生產征募部隊和奴, 962 規模將縮小一級; 生產拓荒者和工程師, 城市規模將縮小兩級. 963 移民過程是可逆的: 將以上部隊加入城市, 可使城市規模擴大, 964 前提是城市規模未達到上限.\\ 965 966 !征募\ 967 可以用征募的方式生產任何已知的地面部隊. 征募的部隊 968 將多耗費1%f食物. 征募的好處在于, 可將部隊的生產時間 969 縮減到原來的三分之一. 要征募部隊, 須先獲得以下科技:\ 970 ::A18 征兵制度\\ 971 972 !買賣生產原料\ 973 要迅速完成生產, 可花錢購買, 購買后的目標將于下回合 974 開始時完工. 要想快,得花大价錢: 每個未完成的原料%p, 975 需支付4倍的金錢. 反言之, 也可以變賣生產原料, 只需將 976 目標改為"商品貿易"即可. 累積的生產原料將轉換為金錢.\\ 977 978 !污染\ 979 每1點原料生產都將造成1點污染, 而每個市民可抵消1點污染, 980 多余的污染將慢慢積累為廢料, 如果積累的廢料數量達到240, 981 城市范圍內將出現一處污染區, 該地塊的資源產量將降為原先 982 的一半. 拓荒者和工程師可以清理污染. 983 983 984 984 985 985 #BUILDINGS 986 $ «Øµ®¤¶²Ð\986 $建筑介紹\ 987 987 988 988 @@67\ 989 ! «Øµ®¤¶²Ð\990 991 «Øµ®·|¹ï©Ò¦bªº«°¥«, ¬Æ¦Ü¾ãÓ°ê®a²£¥Í¿nÌ媺§@¥Î. 992 ¦@¦³3Ïú«Øµ®, ¥¦Ì¤§¶¡ªº°Ï§O¦b¤_¥i«Ø³yªº¼Æ¶q:\993 - «°¥«³]¬I: ¨CÓ«°¥«³£¥i«Ø³].\994 - °ê®a¤uµ{: ¨C¶µ°ê®a¤uµ{, ¦P¤@Ó°ê®a¥u¯à«Ø³]¤@¦¸.995 Y¦b·sªº«°¥««Ø³]¤w¦³ªº°ê®a¤uµ{, ¦b·s«Ø³]§¹¤u®É, 996 즳ªº°ê®a¤uµ{±N³QÅܽæ.\997 - ¥@¬É©_¸ñ: ¥þ¥@¬É¥u¤¹³\¾Ö¦³¤@®y. ¦pªG¬Y°ê«Ø¦¨¤F998 ©_¸ñ, «h¨ä¥L°ê®a¤£¯à¦A«Ø¬Û¦Pªº©_¸ñ. ¦pªG«Ø¦¨ªº 999 ©_¸ñÀHµÛ©Ò¦b«°¥«¤@°_³Q¼ÄxºR·´, ´N·|¥Ã»·®ø¥¢, 1000 µLªkÎ`«Ø. °£¤F¦U¦Ûªº¯S®í®ÄªG¤§¥~, ¨C®y©_¸ñÁÙ¯à 1001 ¨Ï©Ò¦b«°¥«¤¤ªº¤@¦W¤£¦w¥«¥ÁÅܬ°¦w©w.\\1002 1003 ::B «°¥«³]¬I\1004 ::B201 °ê®a¤uµ{\1005 ::B202 ¥@¬É©_¸ñ\\1006 1007 ¤j³¡¤À«°¥«³]¬I©M°ê®a¤uµ{³£»Ýn²{ª÷ºû«ù, ¨C¦^¦X 1008 ©Òªá¶Oªº²{ª÷±N¦Û°Ê±q°ê®w¤¤¦©°£. ¦pªG°ê®w¯ÓºÉ, 1009 ±NÀHÉóÅܽæ¤@¶µ³]¬I, ¥Î¥H©è¶Å.\\1010 1011 ¦b«°¥«µe±¤¤, «ö"«°¥«³]¬I"«ö¶s, ¥i¬d¬Ý«°¥«¤¤²{¦³ªº 1012 ³]¬I¦Cªí. ¦pªGn±N¬Y¶µ³]¬IÅܽæ, ©Î±ÀË««Ø¬Y³]¬I, 1013 ¥H¥[§Ö·í«e³]¬Iªº«Ø³]¶i«×, ¥ªÁä³æÀ»¨ä¹Ï¼Ð§Y¥i. 1014 ³]¬IÅܽ檺ɲ®æµ¥¦P¤_¨ä¥Í²£ì®Æ´«ºâ¦¨²{ª÷ªºÉ²®æ.989 !建筑介紹\ 990 991 建筑會對所在的城市, 甚至整個國家產生積极的作用. 992 共有3种建筑, 它們之間的區別在于可建造的數量:\ 993 -城市設施: 每個城市都可建設.\ 994 -國家工程: 每項國家工程, 同一個國家只能建設一次. 995 若在新的城市建設已有的國家工程, 在新建設完工時, 996 原有的國家工程將被變賣.\ 997 -世界奇跡: 全世界只允許擁有一座. 如果某國建成了 998 奇跡, 則其他國家不能再建相同的奇跡. 如果建成的 999 奇跡隨著所在城市一起被敵軍摧毀, 就會永遠消失, 1000 無法复建. 除了各自的特殊效果之外, 每座奇跡還能 1001 使所在城市中的一名不安市民變為安定.\\ 1002 1003 ::B 城市設施\ 1004 ::B201 國家工程\ 1005 ::B202 世界奇跡\\ 1006 1007 大部分城市設施和國家工程都需要現金維持, 每回合 1008 所花費的現金將自動從國庫中扣除. 如果國庫耗盡, 1009 將隨机變賣一項設施, 用以抵債.\\ 1010 1011 在城市畫面中, 按"城市設施"按鈕, 可查看城市中現有的 1012 設施列表. 如果要將某項設施變賣, 或推倒重建某設施, 1013 以加快當前設施的建設進度, 左鍵單擊其圖標即可. 1014 設施變賣的价格等同于其生產原料換算成現金的价格. 1015 1015 1016 1016 1017 1017 #SUPPORT 1018 $ ³¡¶¤Æ×ÄÝ\1019 1020 ! ³¡¶¤Æ×ÄÝ\1021 1022 ¨C¤ä³¡¶¤¨C¦^¦X»Ý®ø¯Ó1%p¥Í²£ì®Æ, ®ø¯Óì®Æ±qÆ×ÄÝ«°¥« 1023 ¤¤¦©°£. ½s¨î¦b6%w¥H¤Wªº²î¥u, »Ý®ø¯ÓÂù¿ªº¥Í²£ì®Æ. 1024 ³¡¶¤³ÌªìÆ×Äݤ_¥Í²£¸Ó³¡¶¤ªº«°¥«. ¦pªG·Q§ïÅÜÆ×ÄÝ«°¥«, 1025 ±N³¡¶¤²¾¦ÜnÆ×Äݪº«°¥«¦Z, ¿ï¾Ü"§ï¬°¥»«°³¡¶¤"§Y¥i. 1026 «°¥«µe±¤¤¿ï¾Ü"Æ×Äݳ¡¶¤"«ö¶s, ¥i¬d¬Ý¸Ó«°ªºÆ×Äݳ¡¶¤.\\1027 1028 ¤@¤p³¡¤À³¡¶¤¤£»Ýn¥Í²£ì®Æ¨Ñµ¹, µL»Ý¨Ñµ¹ªº³¡¤À¥H 1029 ¦Ç¦â(%n)Åã¥Ü, »Ýn¨Ñµ¹ªº³¡¤À¥H«G¦â(%p)Åã¥Ü. ³o§å 1030 ³¡¶¤ªº¼Æ¶q¨ú¨M¤_¬FÊ^§Î¦¡. ¦pªG«°¥«µLªk´£¨Ñ¨¬°÷ªº 1031 ¥Í²£ì®Æ¨Ñµ¹³¡¶¤, «h¨ä¤¤³Ì·Gɲªº³¡¶¤±N³Q±j¦æ¸Ñ´².\\1032 1033 ¦pªG«°¥«Ä̶öW¹L¤@Ó¦^¦X, ¨ä³¡¶¤¨Ñµ¹±N¥þ³¡°±º¢, 1034 ¦pªG¸Ó«°¥«¦s¦bÆ×Äݳ¡¶¤, «h¨C¦^¦X±N¦³1¤ä³¡¶¤³Q¸Ñ´², 1035 ª½¦ÜÄ̶õ²§ô.1018 $部隊屬\ 1019 1020 !部隊屬\ 1021 1022 每支部隊每回合需消耗1%p生產原料, 消耗原料從屬城市 1023 中扣除. 編制在6%w以上的船只, 需消耗雙倍的生產原料. 1024 部隊最初屬于生產該部隊的城市. 如果想改變屬城市, 1025 將部隊移至要屬的城市后, 選擇"改為本城部隊"即可. 1026 城市畫面中選擇"屬部隊"按鈕, 可查看該城的屬部隊.\\ 1027 1028 一小部分部隊不需要生產原料供給, 無需供給的部分以 1029 灰色(%n)顯示, 需要供給的部分以亮色(%p)顯示. 這批 1030 部隊的數量取決于政体形式. 如果城市無法提供足夠的 1031 生產原料供給部隊, 則其中最廉价的部隊將被強行解散.\\ 1032 1033 如果城市騷亂超過一個回合, 其部隊供給將全部停滯, 1034 如果該城市存在屬部隊, 則每回合將有1支部隊被解散, 1035 直至騷亂結束. 1036 1036 1037 1037 1038 1038 #MACRO 1039 $ §Ö³t§»¾Þ§@\1040 1041 ! §Ö³t§»¾Þ§@\1042 1043 ´åÀ¸¬O¤@Ïú¼Ö½ì, ¦Ó¤£¬O¤u§@. ɧU§Ö³t§»¾Þ§@, ±qÁcº¾ 1044 ªº«Î`©R¥O¤¤¸Ñ²æ, ÄË¥X¤â¨Ó±Mª`µo®i´åÀ¸µ¦²¤§a. 1045 §Ö³t§»¾Þ§@¦}«D¥²¤£¥i¤Öªº¤u¨ã, ¦ý¦³§U¤_²¤Æ´åÀ¸¾Þ§@. 1046 «Øij¦b¨Ï¥Î¤§«e, ³Ì¦n¯à¥ý¤F¸Ñ¤@¤U¬ÛÃöªºª¾ÃÑnÂI.\\1047 1048 ! ¦a§Î§ï³y\1049 °w¹ï¬Y¤@Ãþ¦a§Î, ©w¸q¾Þ§@ªº¦¸§Ç. ©w¸q§¹¦¨¦Z, ¥i¦b 1050 ²¾¥Á³¡¶¤ªº¦æ°Ê©R¥O¤¤¿ï¾Ü"¦a§Î§ï³y"(§Ö±¶Áä: E), 1051 ²¾¥Á³¡¶¤´N·|¨Ì¦¸¶i¦æ¤w³]©wªº§ï³y¾Þ§@. ¦pªG¨Ï¥Î 1052 ±a¦³¤¤Á䪺¹«¼Ð, ¥iµ²¦X¥Ø¼Ð²¾°Ê©R¥O¤@¦}°õ¦æ. ¦bn 1053 §ï³yªº¦a§Î¤W³æÀ»¹«¼Ð¤¤Áä, ²¾¥Á³¡¶¤·|¥H¸Ó¦a§Î¬° 1054 ¥Ø¼Ð²¾°Ê, ¨ì¹F¦Z¦Û°Ê°õ¦æ§ï³y¤u§@.\\1055 1056 ! «°¥«Ãþ«¬\1057 °w¹ï¥|Ïú¤£¦PÃþ«¬ªº«°¥«, ³]©w«Ø³]³]¬Iªº¦¸§Ç. ¥Î¹«¼Ð 1058 ±N¦Cªí¤U¤èªº«Øµ®³]¬I©ì¦²¨ì¤W¤èªº¼Æ¦r®Ø¤º, ¥H³]©w 1059 ¥ý¦Z¦¸§Ç, µM¦Z¦b«°¥«ªº«Ø³]µ¡¤f¤¤¿ï¾Ü¸Ó«°¥«Ãþ«¬, §Y 1060 ¥i«ö³]©w¬yµ{¨Ì¦¸«Ø³]. ¦pªG·í«e¦³³]¬I¦b«Ø, ³]©wªº¦¸§Ç 1061 ±N¦b¦b«Øªº³]¬I«Ø¦¨¦Z¦A¦æ±Ò°Ê. 1039 $快速宏操作\ 1040 1041 !快速宏操作\ 1042 1043 游戲是一种樂趣, 而不是工作. 借助快速宏操作, 從繁瑣 1044 的重复命令中解脫, 騰出手來專注發展游戲策略吧. 1045 快速宏操作并非必不可少的工具, 但有助于簡化游戲操作. 1046 建議在使用之前, 最好能先了解一下相關的知識要點.\\ 1047 1048 !地形改造\ 1049 針對某一類地形, 定義操作的次序. 定義完成后, 可在 1050 移民部隊的行動命令中選擇"地形改造"(快捷鍵: E), 1051 移民部隊就會依次進行已設定的改造操作. 如果使用 1052 帶有中鍵的鼠標, 可結合目標移動命令一并執行. 在要 1053 改造的地形上單擊鼠標中鍵, 移民部隊會以該地形為 1054 目標移動, 到達后自動執行改造工作.\\ 1055 1056 !城市類型\ 1057 針對四种不同類型的城市, 設定建設設施的次序. 用鼠標 1058 將列表下方的建筑設施拖曳到上方的數字框內, 以設定 1059 先后次序, 然后在城市的建設窗口中選擇該城市類型, 即 1060 可按設定流程依次建設. 如果當前有設施在建, 設定的次序 1061 將在在建的設施建成后再行啟動. 1062 1062 1063 1063 1064 1064 #START 1065 $ ´åÀ¸¶}©lµe±\1066 1067 ! ·s«Ø´åÀ¸\1068 1069 ´åÀ¸¶}©lµe±¥]§t¤F¤T±i¶±, n·s«Ø´åÀ¸, ½Ð¦b"·s«Ø´åÀ¸"1070 ¶±³]©wÄvª§Ïú±Úªº¼Æ¶q, ´åÀ¸Ãø«×, ¥H¤Î´åÀ¸ªº³Ì¦Z¦~. 1071 ¦pªG±z¦w¸Ë¤F¨ä¥LAI¼Ò¶ô, ¥i³æÀ»AI®Ø¶i¦æ³]©w. ¥þ³¡³]¸m 1072 µ²§ô¦Z, «ö"¶}©l"«ö¶s¶i¤J´åÀ¸.\\1073 1074 ! ¦Û©w¸qª±®a\1075 ¤Ä¿ï"¦Û©w¸qª±®a"®Ø, ¥´¶}§ó¦h¸Ô²Ó³]¸m. ¦b¦Û©w¸qµe±¤¤, 1076 ¤£¶È¥i¥H¹ïÄvª§Ïú±ÚAI, ¹q¸£´åÀ¸Ãø«×, ¤HÃþª±®a¼Æ¶qµ¥µ¥ 1077 ¶i¦æ¸Ô²Ó³]¸m, ¤]¥i®i¶}¹q¸£AI¼Ò¶ôªº§Ö³t¹ï¨M, ©Î¿ï¾Ü 1078 " ¶W¯Å¥Î¤á"¼Ò¦¡, ¥H¤W«Òªº¨¤«×Æ[¬Ý¾ãÓ¥@¬Éªº¥ð±¿³°I.1079 ³æÀ»¤è®Ø¥i¿ï¾Ü¤HÃþª±®a©Î¹q¸£AI, ¤è®Ø¥ª°¼ªº"3"¦rY¬° 1080 ¤Ä¿ïª¬ºA, «h³o¤è®Ø¥Nªí¤F3¦Wª±®aªº¦@¦P³]©w. ¥Ñ¦¹¥iª¾, 1081 ´åÀ¸ª±®aªº¤W¼Æ¶q¬°15¦W.\\1082 1083 ¤è®Ø¥ª°¼ªº«ü¥Ü±ø¥Nªí¤Fª±®aªº´åÀ¸Ãø«×, 1¬°Â²³æ, 3¬°§xÃø. 1084 ¦pªG·QºÉ¥i¯à¦a´£°ª´åÀ¸Ãø«×, ¥i±N¤HÃþª±®aªºÃø«×³]¬°³Ì°ª, 1085 ¦}±N©Ò¦³AIª±®aªºÃø«×³]¸m¬°³Ì§C.\\1086 1087 Ãø«×¶V°ª, ¤H¤f¼Wªø, ¥Í²£³t«×©M¬ã¨s¶i«×³£·|ÅܺC, ·s«¬§LÏú 1088 ªº³yɲ¤]·|Åܱo§ó¬°©ù¶Q.\\1089 1090 ! Ū¨ú¶i«×\1091 1092 ¦bŪ¨ú¶i«×¶±¤¤, ¥i¿ï¾Ü´¿¸gªº´åÀ¸¶i«×, Ä~Äò¥ý«eªº©ºµ{.1093 ¿ï¾Ü»Ýnªº¶i«×, µM¦ZÂIÀ»"Ū¨ú"«ö¶s¶i¤J´åÀ¸. ¨CÓ³æ¿Wªº 1094 ¶i«×¦sÀɤ¤³£¥]§t¤F©Ò¦³ªº´åÀ¸¦^¦X, ¦]¦¹±zºÉ¥i¥ý¿ï¾Ü¬YÓ 1095 §ó¦ªº´åÀ¸¦~¥N, ¹Á¸Õ¥t¤@Ïúµ¦²¤, ¤]³\·|¦³¤£¤@¼Ëªºµ²ªG.\\1096 1097 ! ¦a¹Ï½s¿è\1098 1099 Àq»{³]¸m¤U, ´åÀ¸±N¥HÀHÉó¦a¹Ï¶}©l; ¤]¥i¥Î´åÀ¸¤º¸mªº½s¿è¾¹ 1100 ¦Û¦æ³Ð«Ø¦a¹Ï. ¦b"¦a¹Ï½s¿è"¶±¿ï¾Ü"ÀHÉó¦a¹Ï", µM¦Z³]©w 1101 ¥@¬É¤Ø¤o©M³°¦a¤ñ¨Ò, ¦AÂI¿ï"½s¿è"¹B¦æ½s¿è¾¹.\\1102 1103 º~¤Æª©¥»¤¤¥]§t¤F¤@´Úº~¤ÆªÌ¦Û¦æɬ¤Æªº¦a¹Ï(¥@¬É¤Ø¤o50%, 1104 ³°¦a¤ñ¨Ò30%), §A¤]¥i±q©x¤è¥D¶¤U¸ü¨ä¥L°ª¤â³]pªº¦a¹Ï, 1105 ¤U¸ü¦a¹Ï¸ÑÀ£¦Z©ñ¸m¦b´åÀ¸¥Ø¿ýªºMaps¤l¥Ø¿ý¤U§Y¥i¨Ï¥Î. 1065 $游戲開始畫面\ 1066 1067 !新建游戲\ 1068 1069 游戲開始畫面包含了三張頁面, 要新建游戲, 請在"新建游戲" 1070 頁面設定競爭种族的數量, 游戲難度, 以及游戲的最后年限. 1071 如果您安裝了其他AI模塊, 可單擊AI框進行設定. 全部設置 1072 結束后, 按"開始"按鈕進入游戲.\\ 1073 1074 !自定義玩家\ 1075 勾選"自定義玩家"框, 打開更多詳細設置. 在自定義畫面中, 1076 不僅可以對競爭种族AI, 電腦游戲難度, 人類玩家數量等等 1077 進行詳細設置, 也可展開電腦AI模塊的快速對決, 或選擇 1078 "超級用戶"模式, 以上帝的角度觀看整個世界的休戚興衰. 1079 單擊方框可選擇人類玩家或電腦AI, 方框左側的"3"字若為 1080 勾選狀態, 則這方框代表了3名玩家的共同設定. 由此可知, 1081 游戲玩家的上限數量為15名.\\ 1082 1083 方框左側的指示條代表了玩家的游戲難度, 1為簡單, 3為困難. 1084 如果想盡可能地提高游戲難度, 可將人類玩家的難度設為最高, 1085 并將所有AI玩家的難度設置為最低.\\ 1086 1087 難度越高, 人口增長, 生產速度和研究進度都會變慢, 新型兵种 1088 的造价也會變得更為昂貴.\\ 1089 1090 !讀取進度\ 1091 1092 在讀取進度頁面中, 可選擇曾經的游戲進度, 繼續先前的征程. 1093 選擇需要的進度, 然后點擊"讀取"按鈕進入游戲. 每個單獨的 1094 進度存檔中都包含了所有的游戲回合, 因此您盡可先選擇某個 1095 更早的游戲年代, 嘗試另一种策略, 也許會有不一樣的結果.\\ 1096 1097 !地圖編輯\ 1098 1099 默認設置下, 游戲將以隨机地圖開始; 也可用游戲內置的編輯器 1100 自行創建地圖. 在"地圖編輯"頁面選擇"隨机地圖", 然后設定 1101 世界尺寸和陸地比例, 再點選"編輯"運行編輯器.\\ 1102 1103 漢化版本中包含了一款漢化者自行优化的地圖(世界尺寸50%, 1104 陸地比例30%), 你也可從官方主頁下載其他高手設計的地圖, 1105 下載地圖解壓后放置在游戲目錄的Maps子目錄下即可使用. 1106 1106 1107 1107 1108 1108 #MAPEDIT 1109 $ ¦a¹Ï½s¿è¾¹\1110 1111 ! ¦a¹Ï½s¿è¾¹\1112 1113 ´åÀ¸¤¤¥]§t¤F¤@´Ú²³æªº¦a¹Ï½s¿è¾¹. n¹B¦æ¦a¹Ï½s¿è¾¹, 1114 ¦b´åÀ¸¶}©lµe±¤¤ÂIÀ»"¦a¹Ï½s¿è"¶±, µM¦Z¿ï¾Ün½s¿è 1115 ªº¦a¹Ï, ÂI¿ï"½s¿è"«ö¶s. ¦pªGn³Ð«Ø·sªº¦a¹Ï, ½Ð¿ï¾Ü 1116 " ÀHÉó¦a¹Ï", ¦A³]©w¥@¬É¤Ø¤o©M³°¦a¤ñ¨Ò, ¦A¿ï"½s¿è"«ö¶s.\\1117 1118 ½s¿è¾¹ªº¨Ï¥Î¤èªk«D±`²³æ. ¥ý±q«Ì¹õ©³³¡¿ï¾Ü©Ò»Ý¦a§Î 1119 ©Î¶µ¥Ø, µM¦Z¥Î¹«¼Ð¥ªÁä³æÀ»¦a¹Ï, §Y¥i²K¥[©Ò¿ï¶µ¥Ø. 1120 §O§Ñ¤F±N¤TÏú²{¥N¸ê·½(¹\/¹W/¤ô»È)²K¥[¦b¦a¹Ï¤W, ¨CÏú 1121 ¸ê·½¦Ü¤Ö¤@³B, §_«h³Ì²×ªº´Þ¥Á¸²î«Ø³]µLªk§¹¦¨.\\1122 1123 ¦³¤@ÂI¶·¥[ª`·N: ¥²¶·³]¸mÏú±Úªì©l¦ì¸m(§Y¶µ¥Ø¦Cªí¤¤ªº 1124 °_º¤G¶µ), YµLªì©l¦ì¸m, ³o±i¦a¹Ï¬O¤£¯à¶i¦æ´åÀ¸ªº. \\1125 1126 ¬°¤F¨Ï±z¨î§@ªº¦a¹Ï§ó¥[®e©ö¿ëÃÑ, ±z¥i¬°¦a¹Ï¤å¥ó²K¥[¬ÛÀ³ 1127 ªºÁY²¤¹Ï¤ù. ÁY²¤¹Ï¶·¬°BMP®æ¦¡, ¤å¥ó¦WÉO¦a¹Ï¦WºÙ¬Û¦P, 1128 ±N¨ä©ñ¸m¦b´åÀ¸ªºmaps¤l¥Ø¿ý, ¹Ï¤ù¤Ø¤o¤W¬°192x96¹³¯À.1109 $地圖編輯器\ 1110 1111 !地圖編輯器\ 1112 1113 游戲中包含了一款簡單的地圖編輯器. 要運行地圖編輯器, 1114 在游戲開始畫面中點擊"地圖編輯"頁面, 然后選擇要編輯 1115 的地圖, 點選"編輯"按鈕. 如果要創建新的地圖, 請選擇 1116 "隨机地圖", 再設定世界尺寸和陸地比例, 再選"編輯"按鈕.\\ 1117 1118 編輯器的使用方法非常簡單. 先從屏幕底部選擇所需地形 1119 或項目, 然后用鼠標左鍵單擊地圖, 即可添加所選項目. 1120 別忘了將三种現代資源(鈾/鈷/水銀)添加在地圖上, 每种 1121 資源至少一處, 否則最終的殖民飛船建設無法完成.\\ 1122 1123 有一點須加注意: 必須設置种族初始位置(即項目列表中的 1124 起首二項), 若無初始位置, 這張地圖是不能進行游戲的. \\ 1125 1126 為了使您制作的地圖更加容易辨識, 您可為地圖文件添加相應 1127 的縮略圖片. 縮略圖須為BMP格式, 文件名与地圖名稱相同, 1128 將其放置在游戲的maps子目錄, 圖片尺寸上限為192x96像素. 1129 1129 1130 1130 1131 1131 #AIT 1132 $ ¹q¸£¹ï¨M\1133 1134 ! ¹q¸£¹ï¨M\1135 1136 ¦pªG¦w¸Ë¤F¦hÓAI¼Ò¶ô, §A¥i¥HÅý³o¨Ç¼Ò¶ô¦b¦P¤@¤ù¦a¹Ï¤¤ 1137 ¬Û¤¬¼r±þ. ¦b·s«Ø´åÀ¸¬É±, ¿ï¾Ü"¦Û©w¸q´åÀ¸", µM¦Z³æÀ» 1138 ¤¤¶¡ªº¤è¶ô, ¿ï¾Ü"¹q¸£¹ï¨M"¦Z, ¶}©l´åÀ¸. ³o®É¾ãÓ´åÀ¸ 1139 µe±±NÁY¤p¬°¤@Ó¹ï¸Üµ¡¤f, «ö¶}©l´åÀ¸, ¨t²Î±N¦Û°Êºtºâ 1140 ¦^¦Xµ²ªG, ª½¦Ü¬YÓAIÐ`¥X. ºtºâµ²ªG±NÅã¥Ü¦¨Â²³æªº²Îp 1141 ¼Æ¦r, ®ÚÕu¦^¦X±À¶i¦Ó¦P¨B§ó·s, ¦p¤U¹Ï©Ò¥Ü:\\1132 $電腦對決\ 1133 1134 !電腦對決\ 1135 1136 如果安裝了多個AI模塊, 你可以讓這些模塊在同一片地圖中 1137 相互廝殺. 在新建游戲界面, 選擇"自定義游戲", 然后單擊 1138 中間的方塊, 選擇"電腦對決"后, 開始游戲. 這時整個游戲 1139 畫面將縮小為一個對話窗口, 按開始游戲, 系統將自動演算 1140 回合結果, 直至某個AI胜出. 演算結果將顯示成簡單的統計 1141 數字, 根据回合推進而同步更新, 如下圖所示:\\ 1142 1142 1143 1143 @AITShot\ 1144 1144 1145 -1: ¸ÓÃC¦âAI¶Õ¤Oűo´åÀ¸ªº¦¸¼Æ, ÀòÐ`ì¦]¥i¯à¬O´Þ¥Á1146 ¸²îµo®g, ¤]¥i¯à¬O®ø·À©Ò¦³¨ä¥L¶Õ¤O.\1147 -2: ¸ÓÃC¦âAI¶Õ¤O´åÀ¸¥¢±Ñªº¦¸¼Æ.1145 -1: 該顏色AI勢力贏得游戲的次數, 獲胜原因可能是殖民 1146 飛船發射, 也可能是消滅所有其他勢力.\ 1147 -2: 該顏色AI勢力游戲失敗的次數. 1148 1148 1149 1149 1150 1150 #HOTKEYS 1151 $ §Ö±¶¾Þ§@\1152 1153 ¥Dµe±¤¤ªº¹«¼Ð¾Þ§@:\1154 - ¥ªÁä³æÀ»¥»¤è³¡¶¤ - ¿ï¤¤³¡¶¤\1155 - ¥ªÁä³æÀ»¥»¤è«°¥« - ¥´¶}«°¥«µ¡¤f\1156 - ¥ªÁä³æÀ»¥L°ê³¡¶¤ - ¬d¬Ý«H®§\1157 - ¥ªÁä³æÀ»¥L°ê«°¥« - ¬d¬Ý«°¥«¨¾±s\1158 - ¥ªÁä³æÀ»¨ä¥L¦a¶ô - µ¡¤f©~¤¤\1159 - ¥kÁä³æÀ» - ±N¸Ó³B«ü©w¬°¿ï©w³¡¶¤ªº²¾°Ê¥Ø¼Ð\1160 - ¥kÁä³æÀ»(¶W¯Å¥Î¤á¼Ò¦¡¤U) - ³Ð«Ø³¡¶¤\\1161 1162 ¥Dµe±¤¤ªºÁä½L¾Þ§@:\1163 - ¤è¦VÁä - ²¾°Ê¿ï©w³¡¶¤\1164 - ¼Æ¦rÁä½L"+"Áä - µ²§ô¦^¦X\1165 - ¼Æ¦rÁä1 ~ 7 - ¤p¦a¹Ï®Ç¤@±Æ«ö¶sªº¹ïÀ³§Ö±¶Áä\1166 - ¨ä¥Lµæ³æ§Ö±¶Áä, ½Ð°Ñ¨£´åÀ¸¤¤¦Uµæ³æ1151 $快捷操作\ 1152 1153 主畫面中的鼠標操作:\ 1154 -左鍵單擊本方部隊 - 選中部隊\ 1155 -左鍵單擊本方城市 - 打開城市窗口\ 1156 -左鍵單擊他國部隊 - 查看信息\ 1157 -左鍵單擊他國城市 - 查看城市防御\ 1158 -左鍵單擊其他地塊 - 窗口居中\ 1159 -右鍵單擊 - 將該處指定為選定部隊的移動目標\ 1160 -右鍵單擊(超級用戶模式下) - 創建部隊\\ 1161 1162 主畫面中的鍵盤操作:\ 1163 -方向鍵 - 移動選定部隊\ 1164 -數字鍵盤"+"鍵 - 結束回合\ 1165 -數字鍵1 ~ 7 - 小地圖旁一排按鈕的對應快捷鍵\ 1166 -其他菜單快捷鍵, 請參見游戲中各菜單 1167 1167 1168 1168 #TRADINGGOODS 1169 $ °Ó«~¶T©ö\1170 1171 ! °Ó«~¶T©ö\1172 1173 ¿ï¾Ü°Ó«~¶T©ö, ©Ò¦³¥Í²£ì®Æ±N³Qª½±µÂà´«¬°²{ª÷§Q¼í.1169 $商品貿易\ 1170 1171 !商品貿易\ 1172 1173 選擇商品貿易, 所有生產原料將被直接轉換為現金利潤. 1174 1174 1175 1175 #MILRES 1176 $ ³¡¶¤¬ãµo\1177 1178 ! ³¡¶¤¬ãµo\1179 1180 n¥Í²£·s«¬ªº±j¤O³¡¶¤, ¥²¶·¥ý¶i¦æ³¡¶¤¬ãµo.\1181 :CLASSES ¬d¬Ý³¡¶¤¬ãµoªº¦³Ãö«H®§1176 $部隊研發\ 1177 1178 !部隊研發\ 1179 1180 要生產新型的強力部隊, 必須先進行部隊研發.\ 1181 :CLASSES 查看部隊研發的有關信息 1182 1182 1183 1183 #ADVHELP 1184 ªÅ¤¤³¡¶¤ªº³Ì¤j½s¨î¤W¤É¦Ü7%w.1185 * 1186 * 1187 * 1188 ¦a±³¡¶¤ªº³Ì¤j½s¨î¤W¤É¦Ü10%w.1189 * 1190 * 1191 ¥i¦bªe¬y¤W¬[¾ô׸ô.1192 * 1193 * 1194 * 1195 * 1196 * 1197 * 1198 * 1199 * 1200 * 1201 * 1202 ¥Í²£¦a±³¡¶¤®É, ¥i°õ¦æ©º¶Ò¥\¯à.1203 ¥i¶}©l«Ø³yn¶ë.\::J °Ñ¨£"¦a§Î«Ø³]".1204 * 1205 * 1206 * 1207 * 1208 * 1209 * 1210 * 1211 * 1212 * 1213 ©Ò¦³«Ø¦³¹D¸ôªº¥©Z¦a§Î°Ï°ì, %t +1.1214 ¥i§ó´«¦a§Î, ¶}¹@¹Bªe.\::J °Ñ¨£"¦a§Î«Ø³]".1215 ¥i¶}©l¥Í²£ªÅ¤¤³¡¶¤.1216 * 1217 * 1218 ¦a±³¡¶¤ªº³Ì¤j½s¨î¤W¤É¦Ü7%w.1219 * 1220 * 1221 * 1222 * 1223 * 1224 * 1225 * 1226 * 1227 * 1228 * 1229 ©Ò¦³ªe¬y³~¸gªº¦a¶ô, %t +1.\¥i¶}©l¥Í²£®ü¤W³¡¶¤.1230 * 1231 ¥i¶}ªö²{¥N¸ê·½.\¦E®É¥N¬ì§Þ: ·í¬Y°ê¹ê²{¤F³W¼Ò¶q²£, ¥þ¥@¬É³£·|Àò±x³o¤@®ø®§.1232 * 1233 ¥i¶}©l«Ø³yx¨Æ°ò¦a.\::J °Ñ¨£"¦a§Î«Ø³]".1234 * 1235 * 1236 * 1237 * 1238 * 1239 * 1240 * 1241 * 1242 * 1243 * 1244 * 1245 * 1246 * 1247 * 1248 ¥i¶}¹@¹A³õ.\::J °Ñ¨£"¦a§Î«Ø³]".1249 * 1250 * 1251 * 1252 * 1253 ¥i¶}©l¾Q³]ÅK¸ô.\::J °Ñ¨£"¦a§Î«Ø³]".1254 * 1255 ¥i¶}ªö¤u·~¤Æ¸ê·½.\¦E®É¥N¬ì§Þ: ·í¬Y°ê¹ê²{¤F¬ì¾Ç, ¥þ¥@¬É³£·|Àò±x³o¤@®ø®§.1256 * 1257 ®ü¤W³¡¶¤ªº³Ì¤j½s¨î¤W¤É¦Ü7%w.1258 * 1259 * 1260 * 1261 ®ü¤W³¡¶¤ªº³Ì¤j½s¨î¤W¤É¦Ü 9%w.\¸Ë³Æ¸Ë¥Òªº¤W´£¤É1.1262 * 1263 * 1264 * 1265 * 1266 * 1267 ¦E®É¥N¬ì§Þ: ·í¬Y°ê¹ê²{¤F¬P»Ú´Þ¥Á, ¥þ¥@¬É³£·|Àò±x³o¤@®ø®§.1268 * 1269 * 1270 ¥i¶}©l¥Í²£·s«¬¦a±³¡¶¤.1271 * 1272 * 1273 * 1274 «Ø¦³¤j¾Çªº«°¥«, ¬ì§Þ+5%\«Ø¦³¹êÅç«Çªº«°¥«, ¬ì§Þ+10%1275 «Ø¦³¤uÉDªº«°¥«, ¥Í²£+5%\«Ø¦³¯S°Ïªº«°¥«, ¥Í²£+10%\(¤£·|¼W¥[ÃB¥~¦Ã¬V)1184 空中部隊的最大編制上升至 7%w. 1185 * 1186 * 1187 * 1188 地面部隊的最大編制上升至 10%w. 1189 * 1190 * 1191 可在河流上架橋修路. 1192 * 1193 * 1194 * 1195 * 1196 * 1197 * 1198 * 1199 * 1200 * 1201 * 1202 生產地面部隊時, 可執行征募功能. 1203 可開始建造要塞.\::J 參見"地形建設". 1204 * 1205 * 1206 * 1207 * 1208 * 1209 * 1210 * 1211 * 1212 * 1213 所有建有道路的平坦地形區域, %t +1. 1214 可更換地形, 開辟運河.\::J 參見"地形建設". 1215 可開始生產空中部隊. 1216 * 1217 * 1218 地面部隊的最大編制上升至 7%w. 1219 * 1220 * 1221 * 1222 * 1223 * 1224 * 1225 * 1226 * 1227 * 1228 * 1229 所有河流途經的地塊, %t +1.\可開始生產海上部隊. 1230 * 1231 可開采現代資源.\划時代科技: 當某國實現了規模量產, 全世界都會獲悉這一消息. 1232 * 1233 可開始建造軍事基地.\::J 參見"地形建設". 1234 * 1235 * 1236 * 1237 * 1238 * 1239 * 1240 * 1241 * 1242 * 1243 * 1244 * 1245 * 1246 * 1247 * 1248 可開辟農場.\::J 參見"地形建設". 1249 * 1250 * 1251 * 1252 * 1253 可開始鋪設鐵路.\::J 參見"地形建設". 1254 * 1255 可開采工業化資源.\划時代科技: 當某國實現了科學, 全世界都會獲悉這一消息. 1256 * 1257 海上部隊的最大編制上升至 7%w. 1258 * 1259 * 1260 * 1261 海上部隊的最大編制上升至 9%w.\裝備裝甲的上限提升1. 1262 * 1263 * 1264 * 1265 * 1266 * 1267 划時代科技: 當某國實現了星際殖民, 全世界都會獲悉這一消息. 1268 * 1269 * 1270 可開始生產新型地面部隊. 1271 * 1272 * 1273 * 1274 建有大學的城市, 科技+5%\建有實驗室的城市, 科技+10% 1275 建有工厂的城市, 生產+5%\建有特區的城市, 生產+10%\(不會增加額外污染) 1276 1276 * 1277 1277 * 1278 1278 1279 1279 #IMPHELP 1280 ¥i¥Í²£¯S®í³¡¶¤:\\::S7 ¥£Æ׳Ҥu 1281 ¨C§ð¥e¤@³B«°¥«, ´N¥iÀò±oì¶Õ¤Oªº°ê®a±¡³ø, ÁÙ¥i±q¸Ó¶Õ¤Oªº¬ì§Þ¦¨ªG¤¤¿ï¤@¶µÅѬ°¤v¦³. Åѱoªº¬ì§Þ¦¨ªG©M³q¹L¥æ¯A¦Ó±oªº¤@¼Ë, ¦b´x´¤«e¥²¶·¶i¦æåªR©Ê¬ã¨s, ¬ã¨s³t«×±N¬O¿W¦Û¬ã¨sªº¨â¿, ¥B¤£¥²¬ã¨s¥ý´Á©Ò»Ý¬ì§Þ.1282 ¨Fºz¦a§Î¥i§ó´«¬°¥ì©Î¯ó¦a.\©Ò¦³³¡¶¤¹ï´c¤gªºt±®ÄªG§K¬Ì.1283 ©_¸ñªº«Ø³y¦¨¥»´î¤Ö¥|¤À¤§¤@.1284 ©Ò¦³ªñ®ü¦a¶ô¼W¥[ 1%p. \\¥u¦³ªu®ü«°¥«¤~¯à«Ø³y¦¹©_¸ñ.1285 ¾Ö¦³¤j¹Ï®ÑÀ]ªº°ê®a, ¥iÀò±o¨ä¥L¶Õ¤O¤w¬ã±oªº¬ì§Þ¦¨ªG, ±ø¥ó¬O¨ä¥L¶Õ¤O¤¤¤@¥b¥H¤W¤w¾Ö¦³¸Ó¦¨ªG. Àò±oªº¬ì§Þ¦¨ªG©M³q¹L¥æ¯A¦Ó±oªº¤@¼Ë, ¦b´x´¤«e¥²¶·¶i¦æåªR©Ê¬ã¨s, ¬ã¨s³t«×±N¬O¿W¦Û¬ã¨sªº¨â¿, ¥B¤£¥²¬ã¨s¥ý´Á©Ò»Ý¬ì§Þ.1286 «Ø¦¨¦Z, ¹ï¤_¥»°ê¤Î¤w«Ø¥ß¥æ©¹ªº°ê®a, ¨C¦^¦X°ê®w±NÀò±oÃB¥~¦¬¤J, ¦¬¤J¼Æ¶qµ¥¦P¤_¸Ó°ê¦x¼qªºÁ`¼Æ.1287 ¥H¤U3¶µ¬ì§ÞÄݩʥͮÄ:1288 µLµø¬ì¬ã§ë¤J¤ñ¨Ò, ¦b±µ¤U¨Óªº¨â¦^¦X¤¤³sÄò§¹¦¨¨â¶µ·sªº¬ì§Þ¦¨ªG. ¥t¥i¥Í²£¯S®í³¡¶¤:\\::S8 ·Æµ¾Éó 1289 ¥»°ê©Ò¦³®ü¤W³¡¶¤ªºÉó°Ê¤O +200.\\¥u¦³ªu®ü«°¥«¤~¯à«Ø³y¦¹©_¸ñ.1290 ¦bÁʶR¥¼§¹¦¨ªº³]¬I©Î©_¸ñ®É, ÁʶR¤@³æ¦ìì®ÆªºÉ²®æ°¦Ü2%c.1291 * 1292 ¦pªG¬FÊ^¬O§g¥D¨î, ¬ì¬ã¶i«×¥[§Ö¤@¿.1293 «°¥«¤¤ªº±Ð°ó¥i¨ÏÃB¥~ªº2¦W¤£¦w¥«¥ÁÅܦ¨¦w©w.1294 * 1295 ¨CÓ«°¥«³£¦³¦U¦Ûªº°ø¨×²v, ¨ä¤ô¥¨¬¥Hªý¤î«°¥«Ä̶꺵o¥Í.\\¦pªG¤@Ó«°¥«ªº¶T©ö©Ò±o¤Ó¤Ö, ¥þ³¡¶T©öÃB³£´«¦¨°ø¨×«~, ¤]¤£¨¬¥Hªý¤îÄ̶꺸Ü, ¸Ó©_¸ñ¹ï¦¹±¡ªpµL¯à¬°¤O.1296 ©Ò¦³©_¸ñªº®ÄªG¥Ã»·¤£·|¹L´Á. ¤w¹L´Áªº©_¸ñ«·s¥Í®Ä.1297 ¬Û·í¤_¦b¨CÓ«°¥«¤¤³y¤@®y¤ô¹q¯¸.\\¥u¦³ªuªe©Î¾aªñ°ª¤sªº«°¥«¤~¯à«Ø³y¦¹©_¸ñ.1298 ªuµÛÅK¸ô²¾°Ê®É, µL»Ý¯Ó¶O¥ô¦ó¦æ°ÊÂI.1299 ±Ò°Ê§N¾Ô®É¥N. §N¾Ô®É©Ò¦³°ê®aµLªk¶}®i¹ï¥~¥æ¯A. §N¾Ô¦@«ùÄò40¦^¦X.1300 ¾ãÓ¥@¬É¦a¹Ï±N¥þ³¡¥´¶}, ¦}Àòª¾©Ò¦³³¡¶¤ªº¦æ°Ê, ®ÄªG«ùÄò¤@¦^¦X. Àò±o©Ò¦³¶Õ¤Oªº°ê®a±¡³ø©Mx¨Æ±¡³ø.\\n«Ø³]¦¹©_¸ñ, ¥²¶·¥ý«Ø\::B66 ¤ÓªÅ´ä 1301 * 1302 * 1303 * 1304 * 1305 * 1306 * 1307 * 1308 * 1309 «°¥«¥Í²£ªº¦a±³¡¶¤ª½±µ¤É¬°¾ú½m³¡¶¤. ¨ü¶Ëªº¦a±³¡¶¤¦b¦¹«°¤¤¯d¦u, ¨C¦^¦Xª¬ºA«ìÎ`³t«×¥[¿. 1310 «°¥«³W¼Ò¼Wªø¦Z, ³¹Àx¶q¤£¬O¥þªÅ, ¦Ó¬O¥bº¡.1280 可生產特殊部隊:\\::S7 奴勞工 1281 每攻占一處城市, 就可獲得原勢力的國家情報, 還可從該勢力的科技成果中選一項竊為己有. 竊得的科技成果和通過交涉而得的一樣, 在掌握前必須進行剖析性研究, 研究速度將是獨自研究的兩倍, 且不必研究先期所需科技. 1282 沙漠地形可更換為平原或草地.\所有部隊對惡土的負面效果免疫. 1283 奇跡的建造成本減少四分之一. 1284 所有近海地塊增加 1%p. \\只有沿海城市才能建造此奇跡. 1285 擁有大圖書館的國家, 可獲得其他勢力已研得的科技成果, 條件是其他勢力中一半以上已擁有該成果. 獲得的科技成果和通過交涉而得的一樣, 在掌握前必須進行剖析性研究, 研究速度將是獨自研究的兩倍, 且不必研究先期所需科技. 1286 建成后, 對于本國及已建立交往的國家, 每回合國庫將獲得額外收入, 收入數量等同于該國寺廟的總數. 1287 以下3項科技屬性生效: 1288 無視科研投入比例, 在接下來的兩回合中連續完成兩項新的科技成果. 另可生產特殊部隊:\\::S8 滑翔机 1289 本國所有海上部隊的机動力 +200.\\只有沿海城市才能建造此奇跡. 1290 在購買未完成的設施或奇跡時, 購買一單位原料的价格降至2%c. 1291 * 1292 如果政体是君主制, 科研進度加快一倍. 1293 城市中的教堂可使額外的2名不安市民變成安定. 1294 * 1295 每個城市都有各自的奢侈率, 其水平足以阻止城市騷亂的發生.\\如果一個城市的貿易所得太少, 全部貿易額都換成奢侈品, 也不足以阻止騷亂的話, 該奇跡對此情況無能為力. 1296 所有奇跡的效果永遠不會過期. 已過期的奇跡重新生效. 1297 相當于在每個城市中造一座水電站.\\只有沿河或靠近高山的城市才能建造此奇跡. 1298 沿著鐵路移動時, 無需耗費任何行動點. 1299 啟動冷戰時代. 冷戰時所有國家無法開展對外交涉. 冷戰共持續40回合. 1300 整個世界地圖將全部打開, 并獲知所有部隊的行動, 效果持續一回合. 獲得所有勢力的國家情報和軍事情報.\\要建設此奇跡, 必須先建\::B66 太空港 1301 * 1302 * 1303 * 1304 * 1305 * 1306 * 1307 * 1308 * 1309 城市生產的地面部隊直接升為歷練部隊. 受傷的地面部隊在此城中留守, 每回合狀態恢复速度加倍. 1310 城市規模增長后, 糧食儲量不是全空, 而是半滿. 1311 1311 +2%m. 1312 µ|¦¬©M°ø¨×¥Í²£+50%.1313 ¬ì¾Ç¥Í²£+50%.1314 ¦¬¶°¶T©ö§Q¼í, ¨CÓ¦a¶ôªº¶T©ö¶q¨S¦³¤W, ¦}´î¤Ö50%ªº»G±Ñ.1315 ¦u½Ã³¡¶¤¦b¾D¹J¦a±³¡¶¤Å§À»®É, ¨¾±s¤O +200%. ·í¦u½Ã³¡¶¤³Q¼Ä¤è¦a±³¡¶¤ºR·´®É, «°¥«¤H¤f¤£·|´î¤Ö.1316 «°¥«³W¼Ò¤W±q8Åܦ¨12.1317 µ|¦¬©M°ø¨×¥Í²£+75%.1312 稅收和奢侈生產 +50%. 1313 科學生產 +50%. 1314 收集貿易利潤, 每個地塊的貿易量沒有上限, 并減少50%的腐敗. 1315 守衛部隊在遭遇地面部隊襲擊時, 防御力 +200%. 當守衛部隊被敵方地面部隊摧毀時, 城市人口不會減少. 1316 城市規模上限從8變成12. 1317 稅收和奢侈生產 +75%. 1318 1318 +4%m. 1319 ¬ì¾Ç¥Í²£+75%.1320 ¨CÓªñ®ü¦a¶ô +1%f.\\¦¹³]¬I¥u¯à«Ø¦bªu®ü«°¥«.1319 科學生產 +75%. 1320 每個近海地塊 +1%f.\\此設施只能建在沿海城市. 1321 1321 +4%m. 1322 ì®Æ¥Í²£ +50%, ¦Ã¬V+50%.1323 ì®Æ¥Í²£ +50%, ¦Ã¬V+50%.1324 §¹¥þ®ø°£¦Ã¬V²{¶H.1325 µo¹q³]¬I, ¨Ï¤uÉD©M¯S°Ïªºì®Æ¥Í²£®ÄªG¥[¿.\(«Î`«Ø³yµo¹q³]¬I, ®ÄªG¤£·|Å|¥[.)\¦Ã¬V+50%.1326 µo¹q³]¬I, ¨Ï¤uÉD©M¯S°Ïªºì®Æ¥Í²£®ÄªG¥[¿.\(«Î`«Ø³yµo¹q³]¬I, ®ÄªG¤£·|Å|¥[.)\¦Ã¬V -50%.\\¦¹³]¬I¥u¯à«Ø¦bªuªe©ÎÁ{ªñ°ª¤sªº«°¥«.1327 µo¹q³]¬I, ¨Ï¤uÉD©M¯S°Ïªºì®Æ¥Í²£®ÄªG¥[¿.\(«Î`«Ø³yµo¹q³]¬I, ®ÄªG¤£·|Å|¥[.)\¤£·|²£¥Í¥ô¦ó¦Ã¬V.1328 ¨CÓªñ®ü¦a¶ô +1%p.\\¦¹³]¬I¥u¯à«Ø¦bªu®ü«°¥«.1329 ¦¬¶°«°¥«¶T©ö§Q¼íªº°ò¦³]¬I. ¨CÓ¦a¶ô³Ì¦h¥X²£3%t.1330 «°¥«³W¼Ò¤W±q12Åܦ¨30.1331 ¹A³õ¥Í²£ªºÂ³¹²£¶q+50%.1332 ¨Ï¨®½üªº¶T©ö¥[¦¨®ÄªG¦A¥[¿.1333 ¬ì¾Ç¥Í²£+75%.1334 ¦u½Ã³¡¶¤¦b¾D¹JªÅ¤¤³¡¶¤©ÎÅF¬µÅ§À»®É, ¨¾±s¤O+100%.1335 ¦u½Ã³¡¶¤¦b¾D¹J®ü¤W³¡¶¤©ÎÅF¬µÅ§À»®É, ¨¾±s¤O +100%.\\¦¹³]¬I¥u¯à«Ø¦bªu®ü«°¥«.1336 «°¥«¥Í²£ªºªÅ¤¤³¡¶¤ª½±µ¤É¬°¾ú½m³¡¶¤. ¨ü¶ËªºªÅ¤¤³¡¶¤¦b¦¹«°¤¤¯d¦u, ¨C¦^¦Xª¬ºA«ìÎ`³t«×¥[¿.1337 «°¥«¥Í²£ªº®ü¤W³¡¶¤ª½±µ¤É¬°¾ú½m³¡¶¤. ¨ü¶Ëªº®ü¤W³¡¶¤¦b¦¹«°¤¤¯d¦u, ¨C¦^¦Xª¬ºA«ìÎ`³t«×¥[¿.1338 ¨Ï©Ò¦b«°¥«ªº¶T©ö¸ê·½²£¶q¨S¦³¤W, ¦Ó¥B¤£·|²£¥Í¥ô¦ó»G±Ñ²{¶H. ©Ò¦b«°¥«¦Û°Ê¦¨¬°°ê®aº³£. ±ý¤F¸Ñº³£ÉO¨ä¥L«°¥«»G±ÑªºÃö¨t, ½Ð°Ñ¨£:\:RESOURCES "¸ê·½ÏúÃþ"¥½¸` 1339 ¬Û·í¤_¦b¦P¤@¶ô¤j³°¤Wªº¨C®y«°¥«¤¤³y¤@¹D«°Àð.1340 ¨Ï¦w©w¥«¥Áªº¼Æ¶q¼W¥[, ¼Wȵ¥¦P¤_«°¥«ªº³W¼ÒÈ.1341 ©Ò¦b«°¥«ªº¬ì¾Ç¸ê·½²£¶q¥[¿.1342 ©Ò¦b«°¥«¥Í²£ªº©Ò¦³¦a±³¡¶¤ª½±µ¤É¬°ºë^³¡¶¤. ¨ü¶Ëªº¦a±³¡¶¤¦b¦¹«°¤¤¯d¦u, ¨C¦^¦Xª¬ºA«ìÎ`³t«×¥[¿.1343 ©Ò¦b«°¥«¤¤, ¾n¦u³¡¶¤¨¾±s¤O+100%.1344 ©Ò¦b«°¥«+12%f1345 ©Ò¦³»È¦æªº®ÄªG¥[¿.1346 ¯S®í¸ê·½ +100%.\\¥i¥H¶}©l«Ø³y´Þ¥Á¸²î³¡¥ó. ¦pªG¨S¦³¤ÓªÅ´ä, ´Þ¥Á¸²î¤uµ{±N¤Æ¬°¯Q¦³. ¦pªG¤ÓªÅ´ä³Q¨ä¥L¾Ö¦³¤ÓªÅ´äªº¶Õ¤O¥e»â, «h´Þ¥Á¸²î¤]±N¸¨¤J¥e»âªÌªº¤â¤¤.1322 原料生產 +50%, 污染 +50%. 1323 原料生產 +50%, 污染 +50%. 1324 完全消除污染現象. 1325 發電設施, 使工厂和特區的原料生產效果加倍.\(重复建造發電設施, 效果不會疊加.)\污染 +50%. 1326 發電設施, 使工厂和特區的原料生產效果加倍.\(重复建造發電設施, 效果不會疊加.)\污染 -50%.\\此設施只能建在沿河或臨近高山的城市. 1327 發電設施, 使工厂和特區的原料生產效果加倍.\(重复建造發電設施, 效果不會疊加.)\不會產生任何污染. 1328 每個近海地塊 +1%p.\\此設施只能建在沿海城市. 1329 收集城市貿易利潤的基礎設施. 每個地塊最多出產 3%t. 1330 城市規模上限從12變成30. 1331 農場生產的糧食產量 +50%. 1332 使車輪的貿易加成效果再加倍. 1333 科學生產 +75%. 1334 守衛部隊在遭遇空中部隊或轟炸襲擊時, 防御力 +100%. 1335 守衛部隊在遭遇海上部隊或轟炸襲擊時, 防御力 +100%.\\此設施只能建在沿海城市. 1336 城市生產的空中部隊直接升為歷練部隊. 受傷的空中部隊在此城中留守, 每回合狀態恢复速度加倍. 1337 城市生產的海上部隊直接升為歷練部隊. 受傷的海上部隊在此城中留守, 每回合狀態恢复速度加倍. 1338 使所在城市的貿易資源產量沒有上限, 而且不會產生任何腐敗現象. 所在城市自動成為國家首都. 欲了解首都与其他城市腐敗的關系, 請參見:\:RESOURCES "資源种類"末節 1339 相當于在同一塊大陸上的每座城市中造一道城牆. 1340 使安定市民的數量增加, 增值等同于城市的規模值. 1341 所在城市的科學資源產量加倍. 1342 所在城市生產的所有地面部隊直接升為精英部隊. 受傷的地面部隊在此城中留守, 每回合狀態恢复速度加倍. 1343 所在城市中, 駐守部隊防御力 +100%. 1344 所在城市 +12%f 1345 所有銀行的效果加倍. 1346 特殊資源 +100%.\\可以開始建造殖民飛船部件. 如果沒有太空港, 殖民飛船工程將化為烏有. 如果太空港被其他擁有太空港的勢力占領, 則殖民飛船也將落入占領者的手中. 1347 1347 1348 1348 * … … 1351 1351 1352 1352 #FEATUREHELP 1353 §ðÀ»¤O°òÈ+1.1354 ¨¾±s¤O°òÈ +1.\ª`·N: ¦a±³¡¶¤¸Ë¥Ò¤W¬°2³æ¦ì, ªÅ¤¤©M®ü¤W³¡¶¤ªº¸Ë¥Ò¤W¬°3³æ¦ì.1355 Éó°Ê¤O+50.1356 ¦a±³¡¶¤¹B¸ü°òÈ+1.1357 ªÅ¤¤³¡¶¤¹B¸ü°òÈ +1.\¥ÀÄ¥¤£¯à·f¸ü¹B¿éÉó.\¥]§t¤F¹p¹FÁn¯ÇÄÝ©Ê.1358 Éó°Ê¤O+200.1359 ¸Éó°_¯è¦Z, ¹ï¦a±©Î®ü¤W³¡¶¤¹ê¦æº¦¸¥´À»®É, §ðÀ»¤O°òÈ+2.1360 ¨C¼W¥[¤@ÂI¿Uªo, ¸Éó¥i¦b¥~¦h°±¯d¤@¦^¦X, µL»Ýªð¦^«°¥«/¥ÀÄ¥/x¨Æ°ò¦a.1361 ¦a±³¡¶¤¹B¸ü°òÈ +1.\¥ÀÄ¥¤£¯à·f¸ü¹B¿éÉó.1362 ®ü¤W³¡¶¤¥i¦b»·¬v¯è¦æ.1363 µø³¥S³òÂX¼e¬°2®æ, ¥iµo²{Á{ªñªº¼Ä¤è¼ç¸¥.1364 ¨ã³Æ¼ç¯è¯à¤O, ¼Ä¤è¶Õ¤O¤£¥i¨£.1365 §ðÀ»«°¥«®É, ¼Ä¤è«°À𪺨¾±s¥[¦¨µL®Ä. ¦a±³¡¶¤¥i§ðÀ»¾F±µªº®ü¤W³¡¶¤.\®ü¤W³¡¶¤¥i§ðÀ»¾F±µªº«°¥«©Î¦a±³¡¶¤.1366 ¦b¦UÏú¦a§Î¤W²¾°Ê®É, ®ø¯Ó¦æ°ÊÂI¼Æµ¥¦P¤_¹D¸ô²¾°Ê.1367 ¹B¸üªº³¡¶¤¨C¦^¦Xª¬ºA³vº¥«ìÎ`.1368 §ðÀ»¤O¤Î¨¾±s¤O°òȤÀ§O +1. »Ýn«°¥«2¿ªº¨Ñµ¹. ¸Ë³ÆÃB¥~t«ªº³¡¶¤, ¥u¯àªuµÛ¹D¸ô/ªe¬y/¹Bªe²¾°Ê, ²¾°Ê®ø¯Ó¦æ°ÊÂI¼Æ¬O´¶³q³¡¶¤ªº2¿. ¤]¥iªuµÛÅK¸ô²¾°Ê, ®ø¯Ó¦æ°ÊÂI¼Æµ¥¦P¤_´¶³q³¡¶¤. µLªk·f¼¹B¿é¤u¨ã.1369 ¹ïªÅ¤¤³¡¶¤ªº¨¾±s¤O+100%.1370 ¥i°»¹î¾Fªñ«°¥«, ¥H¤Î¦P¤@¦a¶ôªº¦hÓ³¡¶¤ (¥]¬AÁô§Î¸Éó).1371 Éó°Ê¤O+100.1372 Éó°Ê¤O+100.1373 Éó°Ê¤O+400.1374 ¨ã³ÆÁô§Î¯à¤O, ¼Ä¤è¶Õ¤O¤£¥i¨£.1375 ·í±a¦³¦¹Äݩʪº³¡¶¤°}¤`®É, ·|µ¹¼Ä¤H³y¦¨¨â¿ªº¶Ë®`.\\¦b¦P¤@¦a¶ô¦s¦b¦h¤ä³¡¶¤®É, ¨g¼öªº¦a±³¡¶¤±N¬O¨¾±sªº¥ýÀY¤O¶q.\\·í°ê®a¬FÊ^¬O¦@©M¨î, ¥Á¥D¨î©Î¥¼¨Ó¨î®É, ¦¹ÄÝ©Ê¥¢®Ä.1376 ·í³¡¶¤±N¼Äx¤@Á|Äè·À®É, ³¡¶¤¨ü¨ìªº¶Ë®`¬O³q±`ªº¤G¤À¤§¤@.1377 §Y¨Ï§ðÀ»®É³Ñ§E¦æ°ÊÂI¤£¨¬1ÂI, ³¡¶¤¤]¯à¨Ï¥X¥þ³¡ªº§ðÀ»¤O.1378 µø³¥S³òÂX¼e¬°2®æ, ¦pªG«Ý©R®É©|§E¤@¥b¦æ°ÊÂI, ³¡¶¤¦Û°ÊÂà¤J¾n¦uª¬ºA.1379 ³sÄò¥Í²£¦PÏú³¡¶¤ªº¥Í²£¶O¥Î´î¥b, ¦ýY§ï¬°¥Í²£¨ä¥L³¡¶¤, ¥Í²£¶O¥Î¥[¿.1353 攻擊力基值 +1. 1354 防御力基值 +1.\注意: 地面部隊裝甲上限為2單位, 空中和海上部隊的裝甲上限為3單位. 1355 机動力+50. 1356 地面部隊運載基值 +1. 1357 空中部隊運載基值 +1.\母艦不能搭載運輸机.\包含了雷達聲納屬性. 1358 机動力+200. 1359 飛机起航后, 對地面或海上部隊實行首次打擊時, 攻擊力基值 +2. 1360 每增加一點燃油, 飛机可在外多停留一回合, 無需返回城市/母艦/軍事基地. 1361 地面部隊運載基值 +1.\母艦不能搭載運輸机. 1362 海上部隊可在遠洋航行. 1363 視野范圍擴寬為2格, 可發現臨近的敵方潛艇. 1364 具備潛航能力, 敵方勢力不可見. 1365 攻擊城市時, 敵方城牆的防御加成無效. 地面部隊可攻擊鄰接的海上部隊.\海上部隊可攻擊鄰接的城市或地面部隊. 1366 在各种地形上移動時, 消耗行動點數等同于道路移動. 1367 運載的部隊每回合狀態逐漸恢复. 1368 攻擊力及防御力基值分別 +1. 需要城市2倍的供給. 裝備額外負重的部隊, 只能沿著道路/河流/運河移動, 移動消耗行動點數是普通部隊的2倍. 也可沿著鐵路移動, 消耗行動點數等同于普通部隊. 無法搭乘運輸工具. 1369 對空中部隊的防御力 +100%. 1370 可偵察鄰近城市, 以及同一地塊的多個部隊 (包括隱形飛机). 1371 机動力+100. 1372 机動力+100. 1373 机動力+400. 1374 具備隱形能力, 敵方勢力不可見. 1375 當帶有此屬性的部隊陣亡時, 會給敵人造成兩倍的傷害.\\在同一地塊存在多支部隊時, 狂熱的地面部隊將是防御的先頭力量.\\當國家政体是共和制, 民主制或未來制時, 此屬性失效. 1376 當部隊將敵軍一舉殲滅時, 部隊受到的傷害是通常的二分之一. 1377 即使攻擊時剩余行動點不足1點, 部隊也能使出全部的攻擊力. 1378 視野范圍擴寬為2格, 如果待命時尚余一半行動點, 部隊自動轉入駐守狀態. 1379 連續生產同种部隊的生產費用減半, 但若改為生產其他部隊, 生產費用加倍. 1380 1380 1381 1381 #GOVHELP 1382 - ©Ò¦³«°¥«³´¤JÄ̶Ã.\-«°¥«³]¬IµL»Ý¸êª÷ºû«ù.\-Æ×Äݳ¡¶¤µL»Ý«°¥«¨Ñµ¹.\-«ùÄò3Ó¦^¦X.1383 - ¨CÓ¦a¶ô¸ê·½¤W¬°: 3%f, 2%p, 2%t.\-ÄY«»G±Ñ. (»G±Ñ¦]¤l=3)\-¨CÓ¥«¥Á¥i¤ä«ù1¤äµL»Ý¨Ñµ¹ªº³¡¶¤.\-¨S¦³¦Ã¬V.\-¨C¤ä²¾¥Á³¡¶¤¨C¦^¦X®ø¯Ó1%f.1384 - »´·L»G±Ñ. (»G±Ñ¦]¤l=1)\-¨C2Ó¥«¥Á¥i¤ä«ù1¤äµL»Ý¨Ñµ¹ªº³¡¶¤.\-¨C¤ä²¾¥Á³¡¶¤¨C¦^¦X®ø¯Ó1%f.1385 - ©Ò¦³>0ªº¶T©ö¸ê·½¼W¥[1ÂI¶T©ö.\-¤¤µ¥µ{«×ªº»G±Ñ. (»G±Ñ¦]¤l=2)\-¦b¥»¤è©Î·ùx¶Õ¤O»â¤g¤§¥~ªº§ðÀ»³¡¶¤(§ðÀ»¤O>0), ·|¨ÏÆ×ÄÝ«°¥«ªº¦w©w¥«¥ÁÂର¤£¦w, 1¤ä³¡¶¤¼vÅT2¦ì¥«¥Á.\-¨C¤ä²¾¥Á³¡¶¤¨C¦^¦X®ø¯Ó2%f.1386 - »´·L»G±Ñ. (»G±Ñ¦]¤l=1)\-©Ò¦³³¡¶¤µL»Ý«°¥«¨Ñµ¹.\-¥þ¥Á«H¥õ, ¥þÊ^¥«¥Á³B¤_¦w©wª¬ºA.\-¬ì¬ã¶i«×´îºC¬°ì¥ýªº¤@¥b.\-¨C¤ä²¾¥Á³¡¶¤¨C¦^¦X®ø¯Ó1%f.1387 - ©Ò¦³>1%pªº¸ê·½ÃB¥~¼W¥[1ÂI.\-¨S¦³»G±Ñ²{¶H.\-¨C2Ó¥«¥Á¥i¤ä«ù1¤äµL»Ý¨Ñµ¹ªº³¡¶¤.\-¨C¤ä²¾¥Á³¡¶¤¨C¦^¦X®ø¯Ó2%f.1388 - ©Ò¦³>0ªº¶T©ö¸ê·½¼W¥[1ÂI¶T©ö.\-¨S¦³»G±Ñ²{¶H.\-¦b¥»¤è©Î·ùx¶Õ¤O»â¤g¤§¥~ªº§ðÀ»³¡¶¤(§ðÀ»¤O>0), ·|¨ÏÆ×ÄÝ«°¥«ªº¦w©w¥«¥ÁÂର¤£¦w, 1¤ä³¡¶¤¼vÅT2¦ì¥«¥Á.\-¨C¤ä²¾¥Á³¡¶¤¨C¦^¦X®ø¯Ó2%f.1389 - ©Ò¦³>0ªº¶T©ö¸ê·½¼W¥[1ÂI¶T©ö.\-¬ãµo¥¼¨Ó¬ì§Þ®É, ¶È»Ý´¶³q¬ì§Þªº2¿¬ãµo®É¶¡, ¦Ó¤£¬O4¿.\-¨S¦³»G±Ñ²{¶H.\-¦b¥»¤è©Î·ùx¶Õ¤O»â¤g¤§¥~ªº§ðÀ»³¡¶¤(§ðÀ»¤O>0), ·|¨ÏÆ×ÄÝ«°¥«ªº¦w©w¥«¥ÁÂର¤£¦w, 1¤ä³¡¶¤¼vÅT2¦ì¥«¥Á.\-¦h§EªºÂ³¹±Nª½±µÂà´«¦¨ª÷¿ú.\-«°¥«¤H¤f¤£¦A¼Wªø.\-¨C¤ä²¾¥Á³¡¶¤¨C¦^¦X®ø¯Ó2%f.1382 -所有城市陷入騷亂.\-城市設施無需資金維持.\-屬部隊無需城市供給.\-持續3個回合. 1383 -每個地塊資源上限為: 3%f, 2%p, 2%t.\-嚴重腐敗. (腐敗因子=3)\-每個市民可支持1支無需供給的部隊.\-沒有污染.\-每支移民部隊每回合消耗 1%f. 1384 -輕微腐敗. (腐敗因子=1)\-每2個市民可支持1支無需供給的部隊.\-每支移民部隊每回合消耗 1%f. 1385 -所有>0的貿易資源增加1點貿易.\-中等程度的腐敗. (腐敗因子=2)\-在本方或盟軍勢力領土之外的攻擊部隊(攻擊力>0), 會使屬城市的安定市民轉為不安, 1支部隊影響2位市民.\-每支移民部隊每回合消耗 2%f. 1386 -輕微腐敗. (腐敗因子=1)\-所有部隊無需城市供給.\-全民信仰, 全体市民處于安定狀態.\-科研進度減慢為原先的一半.\-每支移民部隊每回合消耗 1%f. 1387 -所有>1%p的資源額外增加1點.\-沒有腐敗現象.\-每2個市民可支持1支無需供給的部隊.\-每支移民部隊每回合消耗 2%f. 1388 -所有>0的貿易資源增加1點貿易.\-沒有腐敗現象.\-在本方或盟軍勢力領土之外的攻擊部隊(攻擊力>0), 會使屬城市的安定市民轉為不安, 1支部隊影響2位市民.\-每支移民部隊每回合消耗 2%f. 1389 -所有>0的貿易資源增加1點貿易.\-研發未來科技時, 僅需普通科技的2倍研發時間, 而不是4倍.\-沒有腐敗現象.\-在本方或盟軍勢力領土之外的攻擊部隊(攻擊力>0), 會使屬城市的安定市民轉為不安, 1支部隊影響2位市民.\-多余的糧食將直接轉換成金錢.\-城市人口不再增長.\-每支移民部隊每回合消耗 2%f. 1390 1390 1391 1391 #TECHAGE 1392 ¦´Á¬ì§Þ 1393 ¤u·~¤Æ¬ì§Þ 1394 ²{¥N¬ì§Þ 1395 ¥¼¨Ó¬ì§Þ 1392 早期科技 1393 工業化科技 1394 現代科技 1395 未來科技 1396 1396 1397 1397 #SPECIALMODEL 1398 - ¥i¥H§ï³y¦a§Î, «Ø¥ß«°¥«.\-»Ýn«°¥«¨Ñµ¹Â³¹.1399 - ¥i¥H§ï³y¦a§Î, «Ø¥ß«°¥«.\-»Ýn«°¥«¨Ñµ¹Â³¹.\-¹ï´c¤gªºt±®ÄªG¦³§K¬Ì.1400 * 1401 - ¦u«°®É¨¾±s¤O +100%.\-©l²×»Ýn«°¥«¨Ñµ¹Â³¹.\-¦b¥£Æ×±M¨îªÀ·|¤¤, ¨CÓ¦u«°ªº½Ã§L¥i©è®ø2¦W«°¤º¥«¥Áªº¤£¦w.1402 :SPYMISSIONS ¥i°õ¦æ¯µ±K¦æ°Ê.\-¥i°»¹î¾Fªñ«°¥«, ¥H¤Î¦P¤@¦a¶ôªº¦hÓ³¡¶¤ (¥]¬AÁô§Î¸Éó).\-µø³¥S³ò¬°2®æ.\-¤£¨ã³Æ¦a°ì±±¨îªº¯à¤O.\-¤£·|¦bÆ×ÄÝ«°¥«¤Þ°_¥«¥Áªº¤£¦w.1403 - «Ø³]¶¤¥i¥Î"¥[¤J«°¥«"ªº¤èªk, ±N¦Û¨¤T¤À¤§¤Gªº¥Í²£ì®Æ ¥[¤J·í«e«°¥«ªº«Ø³]¶µ¥Ø¤§¤¤ (´Þ¥Á¸²î³¡¥óªº«Ø³]°£¥~).1404 - ¥i·f¸ü¹B¿é¨â¤ä³¡¶¤.1405 - ¥i¥H§ï³y¦a§Î.\-µL»Ý«°¥«¨Ñµ¹Â³¹.1406 - ¦b¥»¤è¦^¦X¤¤, ¥i¦bªÅ¤¤¸¦æ; ¦b¨ä¥L¶Õ¤Oªº¦^¦X¤¤, ±N³Q·í§@¦a±³¡¶¤.\-¥i°»¹î¾Fªñ«°¥«, ¥H¤Î¦P¤@¦a¶ôªº¦hÓ³¡¶¤.\-¦pªG¦b¥»¤è¦^¦Xµ²§ô®É, ·Æµ¾Éó¤´¦b®ü±, ´N·|¼Y·´.\-¤£¥i·f¸üÄ¥²î.1398 -可以改造地形, 建立城市.\-需要城市供給糧食. 1399 -可以改造地形, 建立城市.\-需要城市供給糧食.\-對惡土的負面效果有免疫. 1400 * 1401 -守城時防御力 +100%.\-始終需要城市供給糧食.\-在奴專制社會中, 每個守城的衛兵可抵消2名城內市民的不安. 1402 :SPYMISSIONS 可執行秘密行動.\-可偵察鄰近城市, 以及同一地塊的多個部隊 (包括隱形飛机).\-視野范圍為2格.\-不具備地域控制的能力.\-不會在屬城市引起市民的不安. 1403 -建設隊可用"加入城市"的方法, 將自身三分之二的生產原料 加入當前城市的建設項目之中 (殖民飛船部件的建設除外). 1404 -可搭載運輸兩支部隊. 1405 -可以改造地形.\-無需城市供給糧食. 1406 -在本方回合中, 可在空中飛行; 在其他勢力的回合中, 將被當作地面部隊.\-可偵察鄰近城市, 以及同一地塊的多個部隊.\-如果在本方回合結束時, 滑翔机仍在海面, 就會墜毀.\-不可搭載艦船. 1407 1407 1408 1408 #JOBHELP 1409 :MOVEMENT ³¡¶¤²¾°Ê®É¯Ó¶O§ó¤Ö¦æ°ÊÂI, ³¡¶¤²¾°ÊS³ò¼W¤j.\::A29 °t¦X¨®½ü¬ì§Þ, ´£°ª¶T©ö§Q¼í.1410 :MOVEMENT ³¡¶¤²¾°Ê®É¯Ó¶O§ó¤Ö¦æ°ÊÂI, ³¡¶¤²¾°ÊS³ò¼W¤j.\-©Ò¦b¦a¶ôªºì®Æ¸ê·½¥Í²£ +50%.\-¥u¯à¦b¤w¦³¹D¸ôªº¦a¶ô¤W¾Q³]ÅK¸ô. ¹D¸ôªºì¦³®ÄªG¨ÌµM«O¯d.1411 - ¨Ï²î¥u¥i³q¦æ¤J¤º³°.\-¥i©è®ø´c¤gªºt±®ÄÀ³.\-¤£¥i¦b°ª¤s©Î¦Bì¤W¶}¹@¹Bªe.1412 - ¼W¥[³¹²£¶q, ¼W¥[´T«×¦]¦a§Î¦ÓÉÝ.1413 ::B51 ¦³¶W¥«ªº«°¥«¤¤, ³¹²£¶q +50%\-¥u¯à¦b¤wÄéµ@ªº¦a¶ô¤W¶}¾Á¹A³õ. Äéµ@ªºì¦³®ÄªG¨ÌµM«O¯d.1414 - ¼W¥[ÄqÂò£¶q, ¼W¥[´T«×¦]¦a§Î¦ÓÉÝ.1415 - ¦b¤º¾n¦uªº¦a±³¡¶¤¨¾±s¤O +100%.\-µø³¥S³ò©Ý¬°2®æ.\:COMBAT ¨ä¥L®ÄªG,¸Ô¨£"¾Ô¤æ¤j¥þ".1416 - ¥i©è®ø´c¤gªºt±®ÄÀ³.\-µø³¥S³ò©Ý¬°2®æ.\:COMBAT ¾Ô¤æ¤Î«ìÎ`®ÄªG, ¸Ô¨£"¾Ô¤æ¤j¥þ".\::F6 ¸Éó¥i¦b¦¹¥[¸Ë¬µ¼u.\-Y¾F±µ¹Bªe, ²î¥u¥i¦bx¨Æ°ò¦a¤º°±ªy.1417 1409 :MOVEMENT 部隊移動時耗費更少行動點, 部隊移動范圍增大.\::A29 配合車輪科技, 提高貿易利潤. 1410 :MOVEMENT 部隊移動時耗費更少行動點, 部隊移動范圍增大.\-所在地塊的原料資源生產 +50%.\-只能在已有道路的地塊上鋪設鐵路. 道路的原有效果依然保留. 1411 -使船只可通行入內陸.\-可抵消惡土的負面效應.\-不可在高山或冰原上開辟運河. 1412 -增加糧食產量, 增加幅度因地形而异. 1413 ::B51 有超市的城市中, 糧食產量 +50%\-只能在已灌溉的地塊上開墾農場. 灌溉的原有效果依然保留. 1414 -增加礦藏產量, 增加幅度因地形而异. 1415 -在內駐守的地面部隊防御力 +100%.\-視野范圍拓為2格.\:COMBAT 其他效果,詳見"戰斗大全". 1416 -可抵消惡土的負面效應.\-視野范圍拓為2格.\:COMBAT 戰斗及恢复效果, 詳見"戰斗大全".\::F6 飛机可在此加裝炸彈.\-若鄰接運河, 船只可在軍事基地內停泊. 1417 -
branches/highdpi/Localization/zh-Hant/Language.txt
r464 r465 1 #GAME ¶i«×%d2 #MAP ¦a¹Ï%d3 #BC ¤½¤¸«e %d ¦~4 #AD ¤½¤¸ %d ¦~1 #GAME 進度 %d 2 #MAP 地圖 %d 3 #BC 公元前 %d 年 4 #AD 公元 %d 年 5 5 #SHARE %d/%d 6 6 #SHORTNAME #S 7 7 #OWNED #A %s 8 8 #GENCITY #S %d 9 #GENMODEL #A ¼Ò¶ô%d9 #GENMODEL #A 模塊 %d 10 10 #TILESIZE %dx%d 11 11 12 12 'City Screen Text 13 #HAPPINESS ¦w©w14 #CONTROL §ÙÄY15 #FAITH «H¥õ16 #UNREST ¤£¦w17 #HAPPINESSDEMAND ¤H¤f18 #HAPPINESSPLUS ³Ñ§E19 #STORAGE ¦s³20 #FOOD ³¹21 #DEMAND »Ý¨D22 #SURPLUS ¦h§E23 #LACK ¯Ê¥F24 #MATERIAL ì®Æ25 #PROD ¥Í²£26 #POLL ¦Ã¬V27 #SUPPORT ºû«ù28 #PROFIT §Q¼í29 #TRADE ¶T©ö30 #CORR »G±Ñ31 #SCIENCE ¬ì¬ã32 #TAX µ|¦¬33 #LUX °ø¨×34 #DUMP ¼o®Æ35 #SUPUNITS Æ×Äݳ¡¶¤13 #HAPPINESS 安定 14 #CONTROL 戒嚴 15 #FAITH 信仰 16 #UNREST 不安 17 #HAPPINESSDEMAND 人口 18 #HAPPINESSPLUS 剩余 19 #STORAGE 存糧 20 #FOOD 糧食 21 #DEMAND 需求 22 #SURPLUS 多余 23 #LACK 缺乏 24 #MATERIAL 原料 25 #PROD 生產 26 #POLL 污染 27 #SUPPORT 維持 28 #PROFIT 利潤 29 #TRADE 貿易 30 #CORR 腐敗 31 #SCIENCE 科研 32 #TAX 稅收 33 #LUX 奢侈 34 #DUMP 廢料 35 #SUPUNITS 屬部隊 36 36 37 37 'Class Screen Text 38 38 #UNITOWNER (#A) 39 #UNITSPEED Éó°Ê40 #UNITSTRENGTH ¾Ô¤æ41 #UNITTRANSPORT ¹B¿é42 #UNITCOST ³yɲ43 #UNITBUILT ½s¨î44 #UNITINTRO ©l³Ð¤_45 #UNITADOPT ¤Þ¶i¤_46 #UNITLOST Ä묹47 #UNITDESTROYED °}¤`48 #UNITAVAILABLE ²{§Ð49 #UNITINPROD ¦b«Ø50 #UNITKNOWN ¦b§ÐÁ`p51 #UNITSPECIAL ¯S®í³¡¶¤39 #UNITSPEED 机動 40 #UNITSTRENGTH 戰斗 41 #UNITTRANSPORT 運輸 42 #UNITCOST 造价 43 #UNITBUILT 編制 44 #UNITINTRO 始創于 45 #UNITADOPT 引進于 46 #UNITLOST 犧牲 47 #UNITDESTROYED 陣亡 48 #UNITAVAILABLE 現役 49 #UNITINPROD 在建 50 #UNITKNOWN 在役總計 51 #UNITSPECIAL 特殊部隊 52 52 53 53 'Diplomacy Screen Text 54 #FRSTATGOV ¬FÊ^: %s55 #FRSTATPOP ¤H¤f: %d¦ÊÉE56 #FRSTATTER »â¤g: %d¦ÊÉE¥¤è¤½¨½57 #FRSTATTECH ¬ì§Þ: %d%%58 #FRSTATEXP ±´¯Á: %d%%59 #FRLASTCONTACT ¤W¦¸±µàD:60 #FRNOCONTACT ¥¼´¿±µàD¡A¶È¾Ì¶Ç»D61 #FRNOVISIT ©|¥¼«ô³X62 #FROLDCIVILREP ( ±q%s³BÀò±o)63 #FRNOCIVILREP ( ©|µL°ê®a³ø§i)64 #FROURATT §Ú¤èºA«×: %s65 #FREXTINCT ·Àµ´¤_66 #FRTREATY Ãö¨t:54 #FRSTATGOV 政体: %s 55 #FRSTATPOP 人口: %d百万 56 #FRSTATTER 領土: %d百万平方公里 57 #FRSTATTECH 科技: %d%% 58 #FRSTATEXP 探索: %d%% 59 #FRLASTCONTACT 上次接触: 60 #FRNOCONTACT 未曾接触,僅憑傳聞 61 #FRNOVISIT 尚未拜訪 62 #FROLDCIVILREP (從%s處獲得) 63 #FRNOCIVILREP (尚無國家報告) 64 #FROURATT 我方態度: %s 65 #FREXTINCT 滅絕于 66 #FRTREATY 關系: 67 67 #FRAND , 68 #FRCREDIBILITY (%d%% «H¥Î«×)69 #FRTREASURY °ê®w: %d%%c70 #FRRELATIONS ¥L°êÃö¨t:68 #FRCREDIBILITY (%d%% 信用度) 69 #FRTREASURY 國庫: %d%%c 70 #FRRELATIONS 他國關系: 71 71 72 72 'Other Dialog Text 73 #PRESENT ·í«e³¡¶¤74 #SHOWSTRENGTH ¾Ô¤æ¤O: %d/%d75 #RIVER ªe¬y76 #INITUNIT ³¡¶¤¬ãµo77 #TECHFOCUS ¥Ø¼Ð¡G%s78 #NEXUS ³s±µ79 #SCIENCEREPORT_EXTINCT %s ( ·Àµ´)80 #MODELDRAFT ·s³¡¶¤¬ãµo(%s)81 #TAXRATE µ|¦¬73 #PRESENT 當前部隊 74 #SHOWSTRENGTH 戰斗力: %d/%d 75 #RIVER 河流 76 #INITUNIT 部隊研發 77 #TECHFOCUS 目標:%s 78 #NEXUS 連接 79 #SCIENCEREPORT_EXTINCT %s (滅絕) 80 #MODELDRAFT 新部隊研發 (%s) 81 #TAXRATE 稅收 82 82 #MONEYGAINPOS +%d%%c 83 83 #MONEYGAINNEG %d%%c 84 84 #TECHGAIN +%d%%r 85 #TECHWAIT %s (%d ¦^¦X)86 #COSTDIFF1 ¤JªùÃø«×: -25%87 #COSTDIFF2 ¤¤¶¡Ãø«×: ?88 #COSTDIFF3 ÅܺAÃø«×: +25%85 #TECHWAIT %s (%d 回合) 86 #COSTDIFF1 入門難度: -25% 87 #COSTDIFF2 中間難度: ? 88 #COSTDIFF3 變態難度: +25% 89 89 #NATEXISTS (%s) 90 #CONSCRIPTS ©º¶Ò%s90 #CONSCRIPTS 征募 %s 91 91 #WONDEROF %s (%s) 92 92 #WONDEROWNER (#A) 93 #EXPIRED ( ¤w¹L´Á)94 #DESTROYED ( ¤w³Q·´)95 #NOWONDER ©|µL©_¸ñ«Ø¦¨96 #BUILDORDER ¥ý¿ï©w«°¥«Ãþ«¬¡A¦A³]©w«Ø³]¦¸§Ç¡G97 #BUILDREST ©|¥¼³]©w¦¸§Çªº³]¬I:98 #ENHANCE %s: %s ¦æ°ÊÂI99 #SHIPCOMP ¸²î²Õ¥ó100 #SHIPPOW °Ê¤O¿µ101 #SHIPHAB ©~¦í¿µ102 #SEARCH ·j¯Á103 #RANMAP ÀHÉó¦a¹Ï93 #EXPIRED (已過期) 94 #DESTROYED (已被毀) 95 #NOWONDER 尚無奇跡建成 96 #BUILDORDER 先選定城市類型,再設定建設次序: 97 #BUILDREST 尚未設定次序的設施: 98 #ENHANCE %s: %s 行動點 99 #SHIPCOMP 飛船組件 100 #SHIPPOW 動力艙 101 #SHIPHAB 居住艙 102 #SEARCH 搜索 103 #RANMAP 隨机地圖 104 104 #TWOTERRAINS %s / %s 105 #MPMAP ¦h¤H¼Ò¦¡106 #NOGAMES ©|µL¶i«×107 #AIT_ROUND ²Ä%d¦^¦X,105 #MPMAP 多人模式 106 #NOGAMES 尚無進度 107 #AIT_ROUND 第%d回合, 108 108 109 109 'Dialog Titles 110 #TITLE_TRIBE ¿ï¾ÜÏú±Ú111 #TITLE_GOV ¿ï¾Ü¬F©²112 #TITLE_TECHSELECT ½Ð«ü©w¬ì¬ã¶µ¥Ø(«ö¦íShift³æÀ»¬ÝÀ°§U)113 #TITLE_FARTECH ½Ð³]©w¬ì¬ã¥Ø¼Ð114 #TITLE_CITIES #A «°¥«115 #TITLE_EVENTS ¦b%sµo¥Í¨Æ¥ó116 #TITLE_MODELS #A ³¡¶¤117 #TITLE_DIAGRAMS ¾ú¥v¹Ïªí118 #TITLE_SHIPS ´Þ¥Á¸²î119 #TITLE_SHIP #A ´Þ¥Á¸²î120 #TITLE_EMODELS ¨ä¥L¶Õ¤O¬ãµo³¡¶¤121 #TITLE_EDEFENSE «°¥«¨¾±s122 #TITLE_RATES ¸gÀÙ123 #TITLE_DRAFT ³¡¶¤¬ãµo124 #TITLE_WONDERS ¥@¬É©_¸ñ125 #TITLE_ENHANCE ¦a§Î§ï³y126 #TITLE_CITYTYPES «°¥«Ãþ«¬127 #TITLE_PROJECT ½Ð«ü©wn«Ø³]ªº³æ¦ì128 #TITLE_CITYNAME «°¥«¦WºÙ129 #TITLE_MODELNAME ·s«¬³¡¶¤¦WºÙ130 #TITLE_ERROR ¿ù»~131 #TITLE_SCIENCE ¬ì§Þ³ø§i132 #TITLE_OFFERDELIVER ²K¥[´£Ä³133 #TITLE_OFFERCOST ²K¥[»Ý¨D134 #TITLE_NUMBER ¼Æ¦r135 #TITLE_AMOUNT ¼Æ¶q136 #TITLE_CHOOSETECH ¿ï¾Ü¬ì§Þ137 #TITLE_CHOOSEMODEL ¿ï¾Ü³]p³æ¦ì138 #TITLE_CHOOSESHIPPART ¿ï¾ÜÃþ§O139 #TITLE_CHOOSECITY ¿ï¾Ü«°¥«140 #TITLE_BOOKNAME ´åÀ¸¦WºÙ141 #TITLE_MAPNAME ¦a¹Ï¦WºÙ110 #TITLE_TRIBE 選擇种族 111 #TITLE_GOV 選擇政府 112 #TITLE_TECHSELECT 請指定科研項目(按住Shift單擊看幫助) 113 #TITLE_FARTECH 請設定科研目標 114 #TITLE_CITIES #A城市 115 #TITLE_EVENTS 在%s發生事件 116 #TITLE_MODELS #A部隊 117 #TITLE_DIAGRAMS 歷史圖表 118 #TITLE_SHIPS 殖民飛船 119 #TITLE_SHIP #A 殖民飛船 120 #TITLE_EMODELS 其他勢力研發部隊 121 #TITLE_EDEFENSE 城市防御 122 #TITLE_RATES 經濟 123 #TITLE_DRAFT 部隊研發 124 #TITLE_WONDERS 世界奇跡 125 #TITLE_ENHANCE 地形改造 126 #TITLE_CITYTYPES 城市類型 127 #TITLE_PROJECT 請指定要建設的單位 128 #TITLE_CITYNAME 城市名稱 129 #TITLE_MODELNAME 新型部隊名稱 130 #TITLE_ERROR 錯誤 131 #TITLE_SCIENCE 科技報告 132 #TITLE_OFFERDELIVER 添加提議 133 #TITLE_OFFERCOST 添加需求 134 #TITLE_NUMBER 數字 135 #TITLE_AMOUNT 數量 136 #TITLE_CHOOSETECH 選擇科技 137 #TITLE_CHOOSEMODEL 選擇設計單位 138 #TITLE_CHOOSESHIPPART 選擇類別 139 #TITLE_CHOOSECITY 選擇城市 140 #TITLE_BOOKNAME 游戲名稱 141 #TITLE_MAPNAME 地圖名稱 142 142 #TITLE_NATION #N 143 #TITLE_SPYMISSION ¯µ±K¦æ°Ê 144 #TITLE_SUICIDE ¦Û±þ¦æ°Ê 145 #FRMILREP x¨Æ³ø§i 143 #TITLE_SPYMISSION 秘密行動 144 #TITLE_SUICIDE 自殺行動 145 #TITLE_MESSAGE Message 146 #FRMILREP 軍事報告 146 147 147 148 'Message Text 148 #NOALTAI ¥¼¦w¸Ë¥ô¦óAI¼Ò¶ô.\½Ð¨ì´åÀ¸©x¤èÊI¯¸¤U¸ü¬ÛÃöAI¼Ò¶ô, ©Î¦Û¦æ³Ð«ØAI¼Ò¶ô149 #REVOLUTION ¦b«Ø¥ß·s¬FÊ^¤§«e, #a«Ò°ê±N³B¤_µL¬F©²ª¬ºA, ³o¬O²©R«e¥²¸gªº°}µh, ¬O§_ÚÌ©w²©R?150 #AUTOREVOLUTION ·s¬FÊ^¤w¸g§¹¦¨: \%s\\¬°¤FÂà´«¦Ü¸Ó¬FÊ^,¥²¶·¼o±ó·í«eªº¬FÊ^§Î¦¡, ¸g¾ú¤@¬qµL¬F©²®É´Á. ¬O§_¶}©l²©R?151 #NOALTGOVS µo°Ê¤@³õ²©R, ¥i¥H±N·í«eªº¬FÊ^ §ó´«¬°¨ä¥L¬FÊ^. ¦ý¥Ø«e§ÚÌ¥u¾Ö¦³ ¥£Æ×±M¨î¤@Ïú¬FÊ^§Î¦¡, µLªk§ó´«·sªº¬FÊ^.152 #AGE0 = %s =\ ¥Û¾¹®É¥N¤wªñ§ÀÁn, ¬°¤F§JªA´åªª¥Í¬¡ªº¤£«K, §Ų́M©w¦b³o¤ù¨U¤g ¤W«Ø¥ß¦Û¤vªº®a¶é, ¥Ã¤[©w©~¤_¦¹, ¦}©w¦W¬°%s.153 #AGE1 = %s =\ ¤d¦Ê¦~¨Ó, ²Îªv¶¥¼h¬°¤Fºò´¤¯SÅv, Ãö¤_³oÓ¥@¬Éªºª¾ÃÑ ¤@ª½¥Ñ©v±Úªø¦Ñ¶Ç±Â¤ä°t. ²{¦b¤@¤Á³£¤w§ïÅÜ. ¥Ñ©v±Ð«H¥õ´yøªºÂÂ¥@¬ÉÆ[, ¤w³Q¸gÅç©M²z©Êª¾ÃѨú¥N, ³o´N¬O³Ìªìªº"¬ì¾Ç"154 #AGE2 = %s =\ ¤j³W¼Ò¥Í²£ªº¥X²{, ¨Ï±o¦Û¥j¥H¨ÓÅv¶Q¥D®_°]´Iªº³W«ß\³Q¹ý©³¥´¯}. ¥Í²£ªºµÞªÞ¥|³B¶}ªá, «æ³tÂX±iªº¥«³õ±N\¤j¶q¥Á¶¡¸êª÷ºÉ¼Æ¯Ç¤JÊI¤¤. ¤@Ó¥þ·s®É¥N´N¦¹½Ï¥Í.155 #AGE3 = %s =\ ¤HÃþ¥j¦Ñªº¹Ú·Q²×¤_¦¨¬°²{¹ê. \§Ú̲{¦bªº§Þ³N¤w¸g¥i¥H\±N²¾¥Á°e©¹»»»·ªº¤Ñ¥~¬P²y. \¬ã¨sªí©ú, ¦¹¶µ§»°¶¶µ¥Ø§¹¦¨ªºÃöÁä\¬O¯SÏúª÷Äݸ귽ªº¶}©ñ§Q¥Î.156 #ENDTURN ¥»¦^¦X©Ò¦³³¡¶¤³£¤wµ²§ô¦æ°Ê.\½Ð¿ï¾Üµ²§ô¦^¦X, ¶i¤J¤U¤@¦^¦X.157 #CREDUP §Ú°êªº«H¥Î¤w¤É¯Å¬°"%s".158 #CREDDOWN §Ú°êªº«H¥Î¤w°¯Å¬°"%s".159 #FOREIGNCITY ³Ìªñ©Òª¾Æ×ÄÝ°ê:\#N\(³Ìªñ±¡³øÀò¨ú¤_%s)160 #EXTINCTCITY ³Ìªñ©Òª¾Æ×ÄÝ°ê:\·Àµ´\(³Ìªñ±¡³øÀò¨ú¤_%s)161 #CAPTURE #N ¥e»â¤F%s!162 #BOMBARD #N ¥¿¦bÅF¬µ¤£³]¨¾ªº%s!163 #EXPEL #a »â¤g¤Wªº¨ä¥L¶Õ¤O³¡¶¤¤w³QÅX³v.164 #DISPOSE %s\\ ±N¦¹«Øµ®±ÀË««Ø¡H165 #SPDESTRUCTQUERY \( ª`·N: ¦pªG©î°£¤ÓªÅ´ä, ¦¹¦aªº´Þ¥Á¸²î¶µ¥Ø±N³Q¼o°£!)166 #SELL %s\\ ±N¦¹«Øµ®Åܽæ®M²{¡H167 #LOSEMAT Y§¹¥þ§ó§ï«Ø³]Ãþ«¬, ·í«e«Ø³]¤¤ªº¶µ¥Ø±N³QÅܽæ. %d%%p ªºÅܽæɲ®æ¬°%d%%c.168 #LOSEMAT3 Yn§ó§ï¬°¦PÃþ«¬ªº¨ä¥L«Ø³]¶µ¥Ø, ±N·l¥¢1/3ªº«Ø³]¶i«×. ¬O§_Ä~Äò?169 #DOUBLESTATEIMP %s\\%s ¤w«Ø¦³¦¹¶µ«°¥«³]¬I. ¬O§_±N¦b·í«eªº«°¥«««Ø¸Ó³]¬I, «Ø¦¨¦ZÅܽæ즳ªº¦P¦W³]¬I?170 #READY ¸Ó«Ø³]±N¦b¤U¦^¦X¶}©l®É§¹¦¨171 #NOMONEY ²{¦³ª÷¿ú¤£¨¬,\µLªk´£«e§¹¤u.\(»Ýn%d%%c, ²{¦³%d%%c)172 #BUY ¤ä¥I%d%%c, Åý¦¹¶µ¥Ø¦b¤U¦^¦X§¹¤u?173 #EMIGRATE Ä~Äò©º¶Ò²¾¥Á³¡¶¤, ¦³¥i¯à¾ÉP¥»«°¥«¯î¼o. ¬O§_¼È½w©º¶Òp¦E, µ¥¨ì«°¥«¤H¤f¼Wªø¨ì ¤@©w³W¼Ò¦Z¦A¦æ©º¶Ò?174 #ADDTOMAXSIZE ¦¹«°¥«ªº³W¼Ò¤w¹F¤W.175 #CITYMANAGEOFF ¨ú®ø«°¥«¸ê·½ªº¦Û°Ê¤À°t?176 #GLIDERLOST §Ú¤è·Æµ¾Éó¦b®ü±¼Y·´177 #PLANELOST §Ú¤è¸Éó¿Uªo¯ÓºÉ178 #DAMAGED_UTILIZE ¾ã½s¨ü·lªº³¡¶¤,©ÒÀò®ÄªG±N¬ÛÀ³°§C. ¬O§_Ä~Äò?179 #NOBB §ÚÌ©|¥¼´x´¤¦bªe¬y¤W·f«Ø¾ô±çªº¬ì§Þ180 #NOCITY ¦¹¦a§Î¤£Óì¦X©w©~«Ø«°. ¥t³V¤@¶ô¥iÄéµ@ªº¤g¦a©w©~§a.181 #NOCAPTURER ¥¥Á³æ¦ìµLªk¥e»â¨ä¥L¶Õ¤Oªº«°¥«.182 #NOBOMBARDER ¨S¦³Äâ±aªZ¾¹, ¤£¯àÅF¬µ«°¥«.183 #ZOC ¸Ó³¡¶¤¤£¯à¦b¼Ä¤è±±¨îªº¦a°ÏÀH·N²¾°Ê.184 #FASTATTACK ¥H%d%%ªº¤O¶q§ðÀ»¥Ø¼Ð¤\¡H185 #NOTIMELOADGROUND ¸Ó³¡¶¤©Ò³Ñ¦æ°ÊÂI¤£¨¬%s, µLªk§¹¦¨¸Ë¹B/¨ø¹B.186 #NOTIMELOADAIR ¸Ó¸Éó©Ò³Ñ¦æ°ÊÂI¤£¨¬100, µLªk¦b¥ÀÄ¥¤W°_°.187 #NOTIMEBOMBARD ÅF¬µ«°¥«»Ýn100¦æ°ÊÂI.188 #NOTIMEEXPEL ¸Ó³¡¶¤©Ò³Ñ¦æ°ÊÂI¤£¨¬100, µLªkÅX³v.189 #NOROAD ¸Ó³¡¶¤¥u¯àªuµÛ¹D¸ô©ÎÅK¸ô²¾°Ê.190 #NONAV ¸Ó²î¥u¨S¦³»·¬v¯è¦æ¯à¤O.191 #NOTRANSPORT ¸Ó²î¥u¨S¦³¹B¿é¯à¤O.192 #FULLTRANSPORT ¸Ó²î¥uªº¹B¸üªÅ¶¡¤wº¡.193 #LOWFUEL ³o¬[¸Éó¿Uªo§Y±N¯ÓºÉ. ¦pªGÄ~Äò«e¦æ, ±NµLªkªð¯è. ¬O§_Ä~Äò«e¦æ?194 #LOWFUEL_GLIDER ³o¬[·Æµ¾É󥲶·¦b¦^¦Xµ²§ô®É¦^¨ì³°¦a, ¦pªGÄ~Äò¦V«e, ¦³¼Y·´ªº¦MÀI. ¬O§_Ä~Äò?195 #UNREST_FOREIGN %s\\ ³o¨½¤w¬O#aªº¦a¬É. ¦pªGÄ~Äò¦V«e, ±N¾ÉP¸Ó³¡¶¤Æ×ÄÝ«°¥«ªº©~¥Á¤£¦w. ¬O§_Ä~Äò?196 #UNREST_NOTOWN %s\\ ¦pªGÖö}#sªº»â¤g, ±N¾ÉP¸Ó³¡¶¤Æ×ÄÝ«°¥«ªº©~¥Á¤£¦w. ¬O§_Ä~Äò?197 #NOATTACKER ¦¹³¡¶¤¤£¬Ox¨Æ³æ¦ì, µLªk®i¶}§ðÀ».198 #ATTACKSUB µLªkÚÌ©w¼Ä¤è¼ç¸¥ªº¦ì¸m.199 #ATTACKSTEALTH µLªkÚÌ©w¼Ä¤èÁô§Î¸É󪺦ì¸m.200 #PEACE_NOATTACK §ÚÌÉO#nñq¤F©M¬ù.201 #PEACE_NOMOVE §ÚÌÉO#nñq¤F©M¬ù, ¤£¯à¶i¤J¹ï¤è»â¤g.202 #PEACE_NOWORK ³o¨½¬O#aªº»â¤g!\§ÚÌ©M¸Ó°êñ¦³©M¬ù, ¤£±o«I¥Ç.203 #NOFOREIGNINFO ¥¼µo²{·sªº±¡³ø.204 #FOREIGNINFO Àò±o·sªº±¡³ø, ¤º®e¦p¤U:205 #DOSSIER_PREPARED §ÚÌÀò±o¤F#aªº°ê®a±¡³ø,¥]¬A#aªº²Îp¹Ïªí¥H¤Î¸Ó°ê·í«eªº¬ì¬ã³ø§i.206 #VIOLATION §Ú¤è³¡¶¤«I¥Ç¤F#aªº»â¤g!\#Nn¨D§Ú̦b%s¤§«e±N³¡¶¤ºMÖÃ.207 #EVIOLATION #N ¦]¹H¤Ï©M¬ù±ø´Ú¤@¨Æ ¯S¦V§Ú¤è¹Dºp. ¥L̵ªÀ³¦b%s¤§«eºM¨«³¡¶¤.208 #WITHDRAW §Ú¤è³¡¶¤³Q°Ç¥O±q#a»â¤g¤WºMÖÃ.209 #WONDERBUILT #N «Ø¦¨¤F·sªº¥@¬É©_¸ñ:\%s210 #WONDERBUILTEXP ¬Y°ê«Ø¦¨¤F·sªº¥@¬É©_¸ñ:\%s\\¦ý³o¶µ©_¸ñ¤w¸g¹L®É, ¨S¦³¥ô¦ó²{¹ê·N¸q.211 #WONDERBUILTOWN §Ú°ê«Ø¦¨¤F·sªº¥@¬É©_¸ñ:\%s212 #WONDERCAPT #N ¥e»â¤F¤@¶µ¥@¬É©_¸ñ:\%s213 #WONDERCAPTOWN §Ú°ê¥e»â¤F¤@¶µ¥@¬É©_¸ñ:\%s214 #WONDEREXP ¥@¬É©_¸ñ: %s ªº®ÄªG¤w¤£Î`¦s¦b.215 #WONDERDEST ¤@¶µ¥@¬É©_¸ñ³QºR·´¤F:\%s216 #COLDWAR ¥Ñ¤_®Ö¾Ôªº¥@¬É©Ê«Â¯Ù, ©Ò¦³¶Õ¤Oªº¥~¥æ¥ß³õÅܱoÃø¥H°Ê·n, ¥æ¯A¤w¤£¦A¦³®Ä. ¥þ²y§N¾Ô¶}©l¤F.217 #COLDWAREND §N¾Ôµ²§ô¤F.218 #SHIPBUILT #N 觹¦¨¤F´Þ¥Á¸²îªº¬Y³¡¥ó¥Í²£.219 #SHIPBITRADE1 #S ©M220 #SHIPBITRADE2 #s ¥æ´«¤F¦U¦Ûªº´Þ¥Á¸²î³¡¥ó.221 #SHIPUNITRADE1 #N ±q #s ³BÀò±o¤F222 #SHIPUNITRADE2 ¥ó´Þ¥Á¸²î³¡¥ó¡C223 #SHIPCAPTURE1 #N ¹Ü¨ú¤F224 #SHIPCAPTURE2 #a ªº´Þ¥Á¸²î³¡¥ó!225 #SHIPDESTROYED #N ªº´Þ¥Á¸²î¶µ¥Ø³Q¼o°£¤F226 #LOWFUNDS °ê®w¤wªñ¬\ºÜ, ¦pªG¤£ºÉ§Öªö¨ú±¹¬I, §ÚÌ¥u¯à¾aÅܽ櫰¥«³]¬I«×¤é.\¬O§_Ä~Äò¦æ°Ê?227 #DISORDER %s ±N³´¤JÄ̶Ã.\¬O§_Ä~Äò¦æ°Ê?228 #DISORDER_UNREST ¥Ñ¤_«°¥«¤£¦w¤H¤fÅܬ°¦h¼Æ, %s±N³´¤JµL¬F©²ª¬ºA.\¬O§_Ä~Äò¦æ°Ê?229 #FAMINE %s ¦³ÃzµoÄȯ¦MÀI.\¬O§_Ä~Äò¦æ°Ê?230 #FAMINE_TILES %s ¦³ÃzµoÄȯ¦MÀI. ¥»«°©ÒÄݦa¶ô¥X²£ªºÂ³¹¤£¨¬.\¬O§_Ä~Äò¦æ°Ê?231 #FAMINE_UNREST %s ¦³ÃzµoÄȯ¦MÀI. ¬°¤F±±¨î¥Á²³¤£¦w±¡ºü, ³¡¤À¤H¤f±q¸ê·½¥Í²£Âର«°¥«§ÙÄY³¡¶¤, ¦¹Á|±¹±N¨Ï¥»«°©ÒÄݦa¶ô¥X²£ªºÂ³¹¤£¨¬.\\¬O§_Ä~Äò¦æ°Ê?232 #LOWSUPPORT ¥H%sªº¥Í²£¤ô¥, µLªk«OÃÒÆ×Äݳ¡¶¤ªº³Ì§C¨Ñµ¹.\¬O§_Ä~Äò¦æ°Ê?233 #LOWSUPPORT_TILES ¥H%sªº¥Í²£¤ô¥, µLªk«OÃÒÆ×Äݳ¡¶¤ªº³Ì§C¨Ñµ¹. ¥»«°©ÒÄݦa¶ô¥X²£ªºì®Æ¤£¨¬.\¬O§_Ä~Äò¦æ°Ê?234 #LOWSUPPORT_UNREST ¥H%sªº¥Í²£¤ô¥, µLªk«OÃÒÆ×Äݳ¡¶¤ªº³Ì§C¨Ñµ¹. ¬°¤F±±¨î¥Á²³¤£¦w±¡ºü, ³¡¤À¤H¤f±q¸ê·½¥Í²£Âର«°¥«§ÙÄY³¡¶¤, ¦¹Á|±¹±N¨Ï¥»«°©ÒÄݦa¶ô¥X²£ªºì®Æ¤£¨¬.\\¬O§_Ä~Äò¦æ°Ê?235 #RESIGN §Y±NÃö³¬¦¹´åÀ¸.\¬O§_«O¦s·í«eªº¶i«×?236 #ENDTOUR ¬O§_«O¦s¶i«×, ¥H«K¤µ¦Z¦b¶W¯Å¥Î¤á¼Ò¦¡¤¤«·s¥´¶}?237 #MODELAVAILABLE ·s³¡¶¤¬ãµo¦¨¥\, ¥iÀH®É§ë¤J¥Í²£.238 #RESEARCH_GENERAL §Ú¤è³Ì·s¬ì¬ã¦¨ªG¡G%s¡I239 #GRLIB_GENERAL ±q¤j¹Ï®ÑÀ]¤¤¡A§ÚÌÀò±o¤F %s ªºª¾ÃÑ¡I240 #ORACLEINCOME ¦¬¤J: %d%%c241 #NOSELLAGAIN %s\\ ¤@¦^¦X¤º¡A¨C®y«°¥«¥u¯àÅÜ½æ ©Î««Ø¤@Ïú«Øµ®242 #OUTOFCONTROL %s\\ ³o®y«°¥«©|¥¼«ìÎ`¥¿±`¯´§Ç243 #NOCHANGEINANARCHY §Ú°ê¥¿³B¤_µL¬F©²ª¬ºA¡A©Ò¦³«°¥««Øµ®¼È®É¥¢®Ä.244 #EXTINCT = %s =\#n «Ò°ê·´·À¤F, ¥L̪º¥ú½÷¤å©ú ±q¦¹³Q«Ê¦s¦b¶Ç»¡¤¤.245 #EXTINCTALL \\ §Ú̦¨¬°¦a²y¤W°ß¤@¯d¦sªº¤å©ú246 #GAMEOVER #N ©Ò¦³«°¥«³£¤w¥¢¦u\\´åÀ¸µ²§ô247 #TIMEUP ´åÀ¸®É¶¡¨ì.\ºÉºÞ#n¸gÀÙÁcºa, ¬ì§Þ»â¥ý, ¦b¥@¬É¦U°ê¤¤¨ú±o¤F¤@©wªº¼vÅT, ¦ý²×¨s¨S¯à´x´¤²×Ìå¤å©ú.\\´åÀ¸µ²§ô248 #TIMEUPSUPER ´åÀ¸®É¶¡¨ì.\¨S¦³¤@Ó°ê®a§¹¦¨´Þ¥Á¸²îªº«Ø³].249 #SPACESHIP1 #N ªº´Þ¥Á¸²î¤wµo®g¤ÉªÅ.\250 #SPACESHIP2 ¬P»Ú´Þ¥Áp¦Eªº¦¨¥\, ¦LÃÒ¤F¸Ó°ê¤å©úªº¥þ±»â¥ýɬ¶Õ.\\´åÀ¸µ²§ô251 #MYSPACESHIP ¾ú¸gµL¼Æªº³h½a¨aÃø, µL¼Æªº¬y¦åÄ묹, µL¼Æªº®É¥N§ó¡, ¤HÃþ¥j¦Ñªº¹Ú·Q²×¤_¦b§Ṳ́⤤Åܬ°²{¹ê. §Ú̪º¸²î¦VµÛ¤ÓªÅ¤¤¥¼ª¾ªº¥@¬É¸¥h, ¬°¦Z¥Nªº¥Í¬¡´M§ä¥þ·sªº®a¶é.\\®¥³ßűo´åÀ¸Ð`§Q252 #SHAREDWIN ( ÉO %s ¦@¨ÉÐ`§Q)149 #NOALTAI 未安裝任何AI模塊.\請到游戲官方网站下載相關AI模塊, 或自行創建AI模塊 150 #REVOLUTION 在建立新政体之前, #a帝國將處于無政府狀態, 這是革命前必經的陣痛, 是否确定革命? 151 #AUTOREVOLUTION 新政体已經完成: \%s\\為了轉換至該政体,必須廢棄當前的政体形式, 經歷一段無政府時期. 是否開始革命? 152 #NOALTGOVS 發動一場革命, 可以將當前的政体 更換為其他政体. 但目前我們只擁有 奴專制一种政体形式, 無法更換新的政体. 153 #AGE0 = %s =\石器時代已近尾聲, 為了克服游牧生活的不便, 我們決定在這片沃土 上建立自己的家園, 永久定居于此, 并定名為%s. 154 #AGE1 = %s =\千百年來, 統治階層為了緊握特權, 關于這個世界的知識 一直由宗族長老傳授支配. 現在一切都已改變. 由宗教信仰描繪的舊世界觀, 已被經驗和理性知識取代, 這就是最初的"科學" 155 #AGE2 = %s =\大規模生產的出現, 使得自古以來權貴主宰財富的規律\被徹底打破. 生產的萌芽四處開花, 急速擴張的市場將\大量民間資金盡數納入网中. 一個全新時代就此誕生. 156 #AGE3 = %s =\人類古老的夢想終于成為現實. \我們現在的技術已經可以\將移民送往遙遠的天外星球. \研究表明, 此項宏偉項目完成的關鍵\是特种金屬資源的開放利用. 157 #ENDTURN 本回合所有部隊都已結束行動.\請選擇結束回合, 進入下一回合. 158 #CREDUP 我國的信用已升級為 "%s". 159 #CREDDOWN 我國的信用已降級為 "%s". 160 #FOREIGNCITY 最近所知屬國:\#N\(最近情報獲取于%s) 161 #EXTINCTCITY 最近所知屬國:\滅絕\(最近情報獲取于%s) 162 #CAPTURE #N占領了%s! 163 #BOMBARD #N正在轟炸不設防的%s! 164 #EXPEL #a領土上的其他勢力部隊已被驅逐. 165 #DISPOSE %s\\將此建筑推倒重建? 166 #SPDESTRUCTQUERY \(注意: 如果拆除太空港, 此地的殖民飛船項目將被廢除!) 167 #SELL %s\\將此建筑變賣套現? 168 #LOSEMAT 若完全更改建設類型, 當前建設中的項目將被變賣. %d%%p 的變賣价格為 %d%%c. 169 #LOSEMAT3 若要更改為同類型的其他建設項目, 將損失1/3的建設進度. 是否繼續? 170 #DOUBLESTATEIMP %s\\%s已建有此項城市設施. 是否將在當前的城市重建該設施, 建成后變賣原有的同名設施? 171 #READY 該建設將在下回合開始時完成 172 #NOMONEY 現有金錢不足,\無法提前完工.\(需要%d%%c, 現有%d%%c) 173 #BUY 支付%d%%c, 讓此項目在下回合完工? 174 #EMIGRATE 繼續征募移民部隊, 有可能導致本城市荒廢. 是否暫緩征募計划, 等到城市人口增長到 一定規模后再行征募? 175 #ADDTOMAXSIZE 此城市的規模已達上限. 176 #CITYMANAGEOFF 取消城市資源的自動分配? 177 #GLIDERLOST 我方滑翔机在海面墜毀 178 #PLANELOST 我方飛机燃油耗盡 179 #DAMAGED_UTILIZE 整編受損的部隊,所獲效果將相應降低. 是否繼續? 180 #NOBB 我們尚未掌握在河流上搭建橋梁的科技 181 #NOCITY 此地形不适合定居建城. 另覓一塊可灌溉的土地定居吧. 182 #NOCAPTURER 平民單位無法占領其他勢力的城市. 183 #NOBOMBARDER 沒有攜帶武器, 不能轟炸城市. 184 #ZOC 該部隊不能在敵方控制的地區隨意移動. 185 #FASTATTACK 以%d%%的力量攻擊目標么? 186 #NOTIMELOADGROUND 該部隊所剩行動點不足%s, 無法完成裝運/卸運. 187 #NOTIMELOADAIR 該飛机所剩行動點不足100, 無法在母艦上起降. 188 #NOTIMEBOMBARD 轟炸城市需要100行動點. 189 #NOTIMEEXPEL 該部隊所剩行動點不足100, 無法驅逐. 190 #NOROAD 該部隊只能沿著道路或鐵路移動. 191 #NONAV 該船只沒有遠洋航行能力. 192 #NOTRANSPORT 該船只沒有運輸能力. 193 #FULLTRANSPORT 該船只的運載空間已滿. 194 #LOWFUEL 這架飛机燃油即將耗盡. 如果繼續前行, 將無法返航. 是否繼續前行? 195 #LOWFUEL_GLIDER 這架滑翔机必須在回合結束時回到陸地, 如果繼續向前, 有墜毀的危險. 是否繼續? 196 #UNREST_FOREIGN %s\\這里已是#a的地界. 如果繼續向前, 將導致該部隊屬城市的居民不安. 是否繼續? 197 #UNREST_NOTOWN %s\\如果离開#s的領土, 將導致該部隊屬城市的居民不安. 是否繼續? 198 #NOATTACKER 此部隊不是軍事單位, 無法展開攻擊. 199 #ATTACKSUB 無法确定敵方潛艇的位置. 200 #ATTACKSTEALTH 無法确定敵方隱形飛机的位置. 201 #PEACE_NOATTACK 我們与#n簽訂了和約. 202 #PEACE_NOMOVE 我們与#n簽訂了和約, 不能進入對方領土. 203 #PEACE_NOWORK 這里是#a的領土!\我們和該國簽有和約, 不得侵犯. 204 #NOFOREIGNINFO 未發現新的情報. 205 #FOREIGNINFO 獲得新的情報, 內容如下: 206 #DOSSIER_PREPARED 我們獲得了#a的國家情報,包括#a的統計圖表以及該國當前的科研報告. 207 #VIOLATION 我方部隊侵犯了#a的領土!\#N要求我們在%s之前將部隊撤离. 208 #EVIOLATION #N因違反和約條款一事 特向我方道歉. 他們答應在%s之前撤走部隊. 209 #WITHDRAW 我方部隊被勒令從#a領土上撤离. 210 #WONDERBUILT #N建成了新的世界奇跡:\%s 211 #WONDERBUILTEXP 某國建成了新的世界奇跡:\%s\\但這項奇跡已經過時, 沒有任何現實意義. 212 #WONDERBUILTOWN 我國建成了新的世界奇跡:\%s 213 #WONDERCAPT #N占領了一項世界奇跡:\%s 214 #WONDERCAPTOWN 我國占領了一項世界奇跡:\%s 215 #WONDEREXP 世界奇跡: %s 的效果已不复存在. 216 #WONDERDEST 一項世界奇跡被摧毀了:\%s 217 #COLDWAR 由于核戰的世界性威脅, 所有勢力的外交立場變得難以動搖, 交涉已不再有效. 全球冷戰開始了. 218 #COLDWAREND 冷戰結束了. 219 #SHIPBUILT #N剛完成了殖民飛船的某部件生產. 220 #SHIPBITRADE1 #S 和 221 #SHIPBITRADE2 #s 交換了各自的殖民飛船部件. 222 #SHIPUNITRADE1 #N 從 #s 處獲得了 223 #SHIPUNITRADE2 件殖民飛船部件。 224 #SHIPCAPTURE1 #N奪取了 225 #SHIPCAPTURE2 #a的殖民飛船部件! 226 #SHIPDESTROYED #N的殖民飛船項目被廢除了 227 #LOWFUNDS 國庫已近枯竭, 如果不盡快采取措施, 我們只能靠變賣城市設施度日.\是否繼續行動? 228 #DISORDER %s將陷入騷亂.\是否繼續行動? 229 #DISORDER_UNREST 由于城市不安人口變為多數, %s將陷入無政府狀態.\是否繼續行動? 230 #FAMINE %s有爆發饑荒的危險.\是否繼續行動? 231 #FAMINE_TILES %s有爆發饑荒的危險. 本城所屬地塊出產的糧食不足.\是否繼續行動? 232 #FAMINE_UNREST %s有爆發饑荒的危險. 為了控制民眾不安情緒, 部分人口從資源生產轉為城市戒嚴部隊, 此舉措將使本城所屬地塊出產的糧食不足.\\是否繼續行動? 233 #LOWSUPPORT 以%s的生產水平, 無法保證屬部隊的最低供給.\是否繼續行動? 234 #LOWSUPPORT_TILES 以%s的生產水平, 無法保證屬部隊的最低供給. 本城所屬地塊出產的原料不足.\是否繼續行動? 235 #LOWSUPPORT_UNREST 以%s的生產水平, 無法保證屬部隊的最低供給. 為了控制民眾不安情緒, 部分人口從資源生產轉為城市戒嚴部隊, 此舉措將使本城所屬地塊出產的原料不足.\\是否繼續行動? 236 #RESIGN 即將關閉此游戲.\是否保存當前的進度? 237 #ENDTOUR 是否保存進度, 以便今后在超級用戶模式中重新打開? 238 #MODELAVAILABLE 新部隊研發成功, 可隨時投入生產. 239 #RESEARCH_GENERAL 我方最新科研成果:%s! 240 #GRLIB_GENERAL 從大圖書館中,我們獲得了 %s 的知識! 241 #ORACLEINCOME 收入: %d%%c 242 #NOSELLAGAIN %s\\一回合內,每座城市只能變賣 或重建一种建筑 243 #OUTOFCONTROL %s\\這座城市尚未恢复正常秩序 244 #NOCHANGEINANARCHY 我國正處于無政府狀態,所有城市建筑暫時失效. 245 #EXTINCT = %s =\#n帝國毀滅了, 他們的光輝文明 從此被封存在傳說中. 246 #EXTINCTALL \\我們成為地球上唯一留存的文明 247 #GAMEOVER #N 所有城市都已失守\\游戲結束 248 #TIMEUP 游戲時間到.\盡管#n經濟繁榮, 科技領先, 在世界各國中取得了一定的影響, 但終究沒能掌握終极文明.\\游戲結束 249 #TIMEUPSUPER 游戲時間到.\沒有一個國家完成殖民飛船的建設. 250 #SPACESHIP1 #N的殖民飛船已發射升空.\ 251 #SPACESHIP2 星際殖民計划的成功, 印證了該國文明的全面領先优勢.\\游戲結束 252 #MYSPACESHIP 歷經無數的貧窮災難, 無數的流血犧牲, 無數的時代更迭, 人類古老的夢想終于在我們手中變為現實. 我們的飛船向著太空中未知的世界飛去, 為后代的生活尋找全新的家園.\\恭喜贏得游戲胜利 253 #SHAREDWIN (与 %s 共享胜利) 253 254 #SHAREDWIN_CONCAT %s, %s 254 #NOAI ¥¼µo²{¦w¸ËªºAI´¡¥ó¡I255 #FILENOTFOUND ¥¼µo²{¦W¬° "%s" ªº¤å¥ó.256 #AIEXCEPTION AI ´¡¥ó%s¤¤¥X²{ÄY«¿ù»~¡I257 #LOADERR ¦¹´åÀ¸¶i«×ÉO·í«eªº´åÀ¸ª©¥»¤£¯àÝ®e258 #NOFILENAME µL®Äªº´åÀ¸¶i«×¦W; ¤£¤¹³\¥X²{¦r²Å'%s'259 #DLLERROR %s µLªkŪ¨ú260 #AIERROR ¥¼µo²{¥H %s ¬°¦WªºAI´¡¥ó261 #MISSDEACT ª±®a%dÉݱ`°h¥X, ¤¤¤î¤F´åÀ¸262 #CLIENTERROR µLªk§ä¨ì¥Î¤á%s263 #LOADERROR ¸Ó´åÀ¸¶i«×¦s¦b¤º³¡¿ù»~, ¥i¯àµLªk¥¿±`¶i¦æ´åÀ¸.\\¥i±N¦¹¶i«×µo°eµ¹³]pªÌ, ¤W³ø¿ù»~.\¬O§_µn³°ÊI¯¸, µo°e¿ù»~¤ÏõX«H®§?264 #NOSTARTPOS ¸Ó¦a¹Ï¥¼©w¸qª±®a°_©l¦ì¸m, µLªk¥Î¨ä¶i¦æ´åÀ¸.265 #TOOFEWTRIBES Ävª§¹ï¤âªº¼Æ¥Ø¤£±o¶W¹L´åÀ¸¤¤©w¸qªº°ê®a¼Æ¶q.266 #DELETEQUERY ´åÀ¸¶i«×¤w§R°£267 #MAPDELETEQUERY ¦a¹Ï¤w§R°£255 #NOAI 未發現安裝的AI插件! 256 #FILENOTFOUND 未發現名為 "%s" 的文件. 257 #AIEXCEPTION AI插件%s中出現嚴重錯誤! 258 #LOADERR 此游戲進度与當前的游戲版本不能兼容 259 #NOFILENAME 無效的游戲進度名; 不允許出現字符'%s' 260 #DLLERROR %s 無法讀取 261 #AIERROR 未發現以 %s 為名的AI插件 262 #MISSDEACT 玩家%d异常退出, 中止了游戲 263 #CLIENTERROR 無法找到用戶%s 264 #LOADERROR 該游戲進度存在內部錯誤, 可能無法正常進行游戲.\\可將此進度發送給設計者, 上報錯誤.\是否登陸网站, 發送錯誤反饋信息? 265 #NOSTARTPOS 該地圖未定義玩家起始位置, 無法用其進行游戲. 266 #TOOFEWTRIBES 競爭對手的數目不得超過游戲中定義的國家數量. 267 #DELETEQUERY 游戲進度已刪除 268 #MAPDELETEQUERY 地圖已刪除 268 269 #TURN #N\%s 269 #SUPERTURN ¶W¯Å¥Î¤á\%s270 #FRNEWNATION §Ṳ́w¦P#n«Ø¥ß¤F¥~¥æÁp¨t.271 #FRCONTACT #n ªº¨Ï¸`·QÂѨ£¤j¤H.\¬O§_±µ¨£?272 #FRREJECTED #N ¤£º@±µ¨£§Ú¤è¨Ï¸`.273 #FRCANCELQUERY_CEASEFIRE ¼¹·´°±¤õ±ø¬ù?274 #FRCANCELQUERY_PEACE ¦V¹ï¤è«Å¾Ô¤\¡H275 #FRCANCELQUERY_FRIENDLY ²×¤îÉO¹ï¤èªº©M¥±ø¬ù?276 #FRCANCELQUERY_ALLIANCE ²×¤îÉO¹ï¤èªº·ù¬ù?277 #FRCANCELBYREJECT_PEACE # ¨Ï¸`:\§Ú̪º@¤ß¤w¸g¯ÓºÉ.\ã³Æªï¾Ô§a!278 #FRCANCELBYREJECT_FRIENDLY # ¨Ï¸`:\±q¤µ¤é°_, ©M¥±ø¬ù¤wÅܦ¨¤@¯ÈªÅ¤å!279 #FRCANCELBYREJECT_ALLIANCE # ¨Ï¸`:\¬JµM§A¤è¤£ªÖ¦X§@, ¨º§Ú̪º·ù¬ù¤]µLªkÄ~Äò¤F. ¬O§AÅý§Ų́S¤F¿ï¾Üªº.280 #FRMYALLIANCE1 #N ¤w¦V§Ú¤è·ù¤Í¶}¾Ô, «Å¾Ô¹ï¶H¬°281 #FRMYALLIANCE2 #n. §ÚÌ¥i¥H¿ï¾Ü¤ä«ù#a, ¤Ï¹ï³¥ÆZªº¾Ôª§¦æ¬°.282 #FRENEMYALLIANCE #N ¨M©w¤ä«ù¨ä·ù¤Í, ¥[¤JÉO§Ú¤èªº¾Ôª§. §Ú¤è¥ý«eÉO#Nªº±ø¬ù¦Û°Ê¥¢®Ä.283 #FRANARCHY #a ³B¤_µL¬F©²ª¬ºA, §Ú¤è¨Ï¸`§ä¤£¨ì³~®|ÉO¹ï¤è·í§½±µàD.284 #FRMYANARCHY §ÚÌ¥¿³B¤_µL¬F©²ª¬ºA, ¥²¶·µ¥¨ì§½¶Õéw¦Z, ¤~¯à¶}®i¥~¥æ¬¡°Ê.285 #FRCOLDWAR ¥Ø«e³B¤_§N¾Ô´Á, µLªkÉO¨ä¥L¶Õ¤O¥æ¯A.286 #MAX2WANTS ¤@¦^¦X¥æ¯A¤¤³Ì¦h´£¥X¨â¶µn¨D.287 #MAX2OFFERS ¤@¦^¦X¥æ¯A¤¤³Ì¦hµ¹¥X¨â¶µ´£Ä³.288 #NOOFFER ¸Ó´£Ä³µL®Ä¡I289 #CANCELTREATYRUSH ¦b3Ó¦^¦X¤º¡AÉO¦P¤@°ê®a³Ì¦h²×¤î¤@¶µ¥~¥æ¨óij.290 #NOSPACEPORT §Ú¤è¨S¦³¤ÓªÅ´ä, µLªk¥¿±`±µ¦¬¹ï¤èªº¸²î³¡¥ó, ¬O§_°õ·N±µ¦¬?291 #SUICIDE Åý³o¨Ç¥iÌ°ªº®a¥ë\½ñ¤W¶À¬u¤£Âk¸ô?292 #RATES ½Ð¨î©w°ê¥Á¸gÀÙªº¤À°t¤ñ¨Ò293 #NORATES ¦Û¥Ñ¤k¯«¹³\¤w¸g¥Í®Ä.270 #SUPERTURN 超級用戶\%s 271 #FRNEWNATION 我們已同#n建立了外交聯系. 272 #FRCONTACT #n的使節想覲見大人.\是否接見? 273 #FRREJECTED #N不愿接見我方使節. 274 #FRCANCELQUERY_CEASEFIRE 撕毀停火條約? 275 #FRCANCELQUERY_PEACE 向對方宣戰么? 276 #FRCANCELQUERY_FRIENDLY 終止与對方的和平條約? 277 #FRCANCELQUERY_ALLIANCE 終止与對方的盟約? 278 #FRCANCELBYREJECT_PEACE #使節:\我們的耐心已經耗盡.\准備迎戰吧! 279 #FRCANCELBYREJECT_FRIENDLY #使節:\從今日起, 和平條約已變成一紙空文! 280 #FRCANCELBYREJECT_ALLIANCE #使節:\既然你方不肯合作, 那我們的盟約也無法繼續了. 是你讓我們沒了選擇的. 281 #FRMYALLIANCE1 #N已向我方盟友開戰, 宣戰對象為 282 #FRMYALLIANCE2 #n. 我們可以選擇支持#a, 反對野蠻的戰爭行為. 283 #FRENEMYALLIANCE #N決定支持其盟友, 加入与我方的戰爭. 我方先前与#N的條約自動失效. 284 #FRANARCHY #a處于無政府狀態, 我方使節找不到途徑与對方當局接触. 285 #FRMYANARCHY 我們正處于無政府狀態, 必須等到局勢穩定后, 才能開展外交活動. 286 #FRCOLDWAR 目前處于冷戰期, 無法与其他勢力交涉. 287 #MAX2WANTS 一回合交涉中最多提出兩項要求. 288 #MAX2OFFERS 一回合交涉中最多給出兩項提議. 289 #NOOFFER 該提議無效! 290 #CANCELTREATYRUSH 在3個回合內,与同一國家最多終止一項外交協議. 291 #NOSPACEPORT 我方沒有太空港, 無法正常接收對方的飛船部件, 是否執意接收? 292 #SUICIDE 讓這些可怜的家伙\踏上黃泉不歸路? 293 #RATES 請制定國民經濟的分配比例 294 #NORATES 自由女神像\已經生效. 294 295 295 296 'Diplomatic Statements, do not use '\'! 296 #FRSTART_NOTREATY ÂÔ¥Nªí#n¥Á¨Ó¦¹ÉO¶Q°ê¥æ¯A.297 #FRSTART_PEACE ÂÔ¥Nªí#n¦V»Õ¤UP·q, ¦³¨Ç¨Æ±¡·Q½Ð»Õ¤U·r°u.298 #FRCANCELTREATY_PEACE §ÚÌ¥¿¦¡¦V¶Q°ê«Å¾Ô.299 #FRCANCELTREATY_FRIENDLY §ÚÌnÉO¶Q°ê²×¤î¤Í¦nÃö¨t.300 #FRCANCELTREATY_ALLIANCE ¨â°êÄ~Äòµ²·ù¤w²@µL·N¸q, ±q¤µ°_¥¿¦¡¸Ñ°£·ù¬ù.301 #FRNOTICE §Ú̦A¤]¤£º@§Ô¨ü º¸µ¥¤ÏÎ`¤p¤Hªº¨õ¦H¦æ®|.302 #FRBREAK ¨S¥²nÄ~Äò½Í§P¤F. ¤U¦¸¦A¬ù®É¶¡§a.303 #FROFFER §Ú̺@·N¥Î\-%s\¨Ó¥æ´«¶Q°êªº\-%s304 #FRPRESENT §Ú̺@±N:\-%s ©^°eµ¹¶Q°ê§@¬°Â§ª«.305 #FRDEMAND_STRONG §â\-%s ¥æ¥X¨Ó¡A\§_«h¦³§Ąüªº!306 #FRDONE ÁÙ¦³§Oªºn»¡¤\?307 #FRCEASEFIRE §ÚÌ·Qñ¸p°±¾Ô¨óij.308 #FRPEACE ¬°¸Ñ¨M¨â°ê¶¡µL¥ð¤îªº¯Éª§, ¤¬¬Û©Ó»{¹ï¤èªº°ê¬É, §Ú¤è«Øijñ¸p¤@¥÷¥Ã¤[©Ê©M¥±ø¬ù. ¬O§_º@·Nñ¦r?309 #FRFRIENDLY §Ú̹ï#a ¥ý¶iªº¤å¤Æ§Þ³N¥õ¼}¤w¤[. Åý§Ú̦@¸p¤Í¦n±ø¬ù, ¦b¤Íµ½ªº°ò¦¤W¥æ¬yµo®i§a.310 #FRALLIANCE ¬°¤F¥[±j¨â°ê¤H¥Áªººò±K¦X§@, ¬O§_º@·NÉO§Ú¤èñ¸p¦P·ù¨ó©w, ¤µ¦ZÁp¤â¹ï§Ü¨Ó¥Çªº¼Ä¤H?311 #FRACCEPTCEASEFIRE §Ú̱µ¨ü§Aªº±ø¥ó, ¼È½w¦æ°Ê.312 #FRACCEPTTREATY §Ú̵ªÀ³§A, §Æ±æ³o¥÷±ø¬ù¯à¦b¨â°ê ¥æ¬y¥v¤W¼g¤U¹ñ·sªº½g³¹.313 #FRNOTACCEPTTREATY YÉO¶Q°êñ¸p±ø¬ù, ¹ï#n¦Ó¨¥¦}µL¦n³B.314 #FRENDTREATY_PEACE ²×¤î©M¥±ø¬ù315 #FRENDTREATY_FRIENDLY ²×¤î¤Í¦n±ø¬ù316 #FRENDTREATY_ALLIANCE ²×¤î·ù¬ù317 #FRACCEPTOFFER ³o±ø¥ó«Ü¤½¥, §Ú̦P·N¤F.318 #FRACCEPTPRESENT #N «Ü°ª¿³¦¬¤U³o¥÷§ª«.319 #FRACCEPTDEMAND_STRONG ¬°¤Fºû«ù©¼¦¹ªº¤Í¦nÃö¨t, §Ų́M©w¦P·N§Aªº±ø¥ó.320 #FRNOTACCEPTOFFER ³o¶µ´£Ä³¹ï§Ú¤è¦}µL§U¯q.321 #FRNOTACCEPTPRESENT #N ¤£»Ýn³o¼Ë¤@¥÷§ª«.322 #FRNOTACCEPTDEMAND_STRONG §A¤Ó³g°ý, §O¥Õ¤é°µ¹Ú¤F.323 #FRDELCHOICE §Ú̹ï¶Q°êªº\-%s «D±`·P¿³½ì.\½Ð°Ý¶Q°êªº¥æ´«±ø¥ó¬O¤°¤\?324 #FRCOSTCHOICE ¦pªG¸Û¤ßn§Ú̪º\-%s,\½Ð°Ý¶Q°ê·Q®³¤°¤\¨Ó¥æ´«©O?325 #FRBYE ²{¦b¤£¦æ, ¥»¦¸½Í§P´N¦¹¬°¤î. ¦A¨£.326 #PRICE_CHOOSE ¿ï¾ÜªºÉ²®æ327 #PRICE_CIVIL #n ªº°ê®a±¡³ø328 #PRICE_MIL #n ªºx¨Æ±¡³ø329 #PRICE_MAP #a ªº¥@¬É¦a¹Ï330 #PRICE_SHIPCOMP %d ´Þ¥Á¸²î²Õ¥ó331 #PRICE_SHIPPOW %d °Ê¤O¿µ332 #PRICE_SHIPHAB %d ©~¦í¿µ333 #PRICE_TRIBUTE ¨C¦^¦X%d%%c334 #PRICE_ALLTECH #a ©Ò¦³ªº¬ì§Þ¦¨ªG335 #PRICE_ALLMODEL #a ©Ò¦³ªº¬ãµo³¡¶¤297 #FRSTART_NOTREATY 謹代表#n民來此与貴國交涉. 298 #FRSTART_PEACE 謹代表#n向閣下致敬, 有些事情想請閣下斟酌. 299 #FRCANCELTREATY_PEACE 我們正式向貴國宣戰. 300 #FRCANCELTREATY_FRIENDLY 我們要与貴國終止友好關系. 301 #FRCANCELTREATY_ALLIANCE 兩國繼續結盟已毫無意義, 從今起正式解除盟約. 302 #FRNOTICE 我們再也不愿忍受 爾等反复小人的卑劣行徑. 303 #FRBREAK 沒必要繼續談判了. 下次再約時間吧. 304 #FROFFER 我們愿意用\-%s\來交換貴國的\-%s 305 #FRPRESENT 我們愿將:\-%s 奉送給貴國作為禮物. 306 #FRDEMAND_STRONG 把\-%s 交出來,\否則有你們受的! 307 #FRDONE 還有別的要說么? 308 #FRCEASEFIRE 我們想簽署停戰協議. 309 #FRPEACE 為解決兩國間無休止的紛爭, 互相承認對方的國界, 我方建議簽署一份永久性和平條約. 是否愿意簽字? 310 #FRFRIENDLY 我們對#a 先進的文化技術仰慕已久. 讓我們共署友好條約, 在友善的基礎上交流發展吧. 311 #FRALLIANCE 為了加強兩國人民的緊密合作, 是否愿意与我方簽署同盟協定, 今后聯手對抗來犯的敵人? 312 #FRACCEPTCEASEFIRE 我們接受你的條件, 暫緩行動. 313 #FRACCEPTTREATY 我們答應你, 希望這份條約能在兩國 交流史上寫下嶄新的篇章. 314 #FRNOTACCEPTTREATY 若与貴國簽署條約, 對#n而言并無好處. 315 #FRENDTREATY_PEACE 終止和平條約 316 #FRENDTREATY_FRIENDLY 終止友好條約 317 #FRENDTREATY_ALLIANCE 終止盟約 318 #FRACCEPTOFFER 這條件很公平, 我們同意了. 319 #FRACCEPTPRESENT #N很高興收下這份禮物. 320 #FRACCEPTDEMAND_STRONG 為了維持彼此的友好關系, 我們決定同意你的條件. 321 #FRNOTACCEPTOFFER 這項提議對我方并無助益. 322 #FRNOTACCEPTPRESENT #N不需要這樣一份禮物. 323 #FRNOTACCEPTDEMAND_STRONG 你太貪婪, 別白日做夢了. 324 #FRDELCHOICE 我們對貴國的\-%s 非常感興趣.\請問貴國的交換條件是什么? 325 #FRCOSTCHOICE 如果誠心要我們的\-%s,\請問貴國想拿什么來交換呢? 326 #FRBYE 現在不行, 本次談判就此為止. 再見. 327 #PRICE_CHOOSE 選擇的价格 328 #PRICE_CIVIL #n的國家情報 329 #PRICE_MIL #n的軍事情報 330 #PRICE_MAP #a的世界地圖 331 #PRICE_SHIPCOMP %d 殖民飛船組件 332 #PRICE_SHIPPOW %d 動力艙 333 #PRICE_SHIPHAB %d 居住艙 334 #PRICE_TRIBUTE 每回合%d%%c 335 #PRICE_ALLTECH #a所有的科技成果 336 #PRICE_ALLMODEL #a所有的研發部隊 336 337 #PRICE_CONCAT %s\-%s 337 #PRICECAT_ALLTECH ©Ò¦³¬ì§Þ¦¨ªG338 #PRICECAT_ALLMODEL ©Ò¦³³¡¶¤¬ãµo338 #PRICECAT_ALLTECH 所有科技成果 339 #PRICECAT_ALLMODEL 所有部隊研發 339 340 340 341 'Button Captions 341 #BTN_OK ÚÌ©w342 #BTN_CANCEL ¨ú®ø343 #BTN_YES ¬O344 #BTN_NO §_345 #BTN_INFO À°§U342 #BTN_OK 确定 343 #BTN_CANCEL 取消 344 #BTN_YES 是 345 #BTN_NO 否 346 #BTN_INFO 幫助 346 347 #BTN_RESET Reset 347 348 348 349 'Button Tooltips 349 #BTN_SELECT ¿ï¾Ü350 #BTN_PAGE ¤U¶351 #BTN_SUPPORT Æ×Äݳ¡¶¤352 #BTN_IMPRS «°¥«³]¬I353 #BTN_CLASSES ³¡¶¤354 #BTN_WONDERS ©_¸ñ355 #BTN_BUY ÁʶR356 #BTN_DELETE §R°£357 #BTN_RENAME §ó¦W358 #BTN_OBSOLETE °±¤î¥Í²£359 #BTN_NONOBSOLETE ¤¹³\¥Í²£360 #BTN_ALLOWCONSCRIPTS ¤¹³\©º¶Ò361 #BTN_NOCONSCRIPTS °±¤î©º¶Ò362 #BTN_ENDTURN µ²§ô¦^¦X¡I363 #BTN_SKIP ¤£¦AÅã¥Ü¨ä¥L¶Õ¤O²¾°Ê364 #BTN_NOAUTOMOVE °±¤î¦V¥Ø¼Ð²¾°Ê365 #BTN_STOP °±¤î366 #BTN_NEGO Ä~Äò½Í§P367 #BTN_DIALOG Ápµ¸¦¹°ê368 #BTN_BREAK ²×¤î¥»¦¸½Í§P369 #BTN_PASS µ²§ô¥»¤è´£Ä³370 #BTN_CNTREATY ¼¹·´¨óij371 #BTN_ACCEPT ±µ¨ü´£Ä³372 #BTN_NOTICE ¤wÀò±x¨M©w373 #BTN_REPLAY ¾ú¥v«©ñ374 #BTN_RENGAME ´åÀ¸§ó¦W375 #BTN_DELGAME ´åÀ¸§R°£376 #BTN_RENMAP ¦a¹Ï§ó¦W377 #BTN_DELMAP ¦a¹Ï§R°£378 #BTN_CONTENTS ¥Ø¿ý379 #BTN_BACK ªð¦^380 #BTN_SEARCH ·j¯Á381 #BTN_WANTCEASEFIRE n¨D°±¤õ382 #BTN_OFFERCEASEFIRE ´£Ä³°±¤õ383 #BTN_WANTPEACE n¨D©M¥384 #BTN_OFFERPEACE ´£Ä³©M¥385 #BTN_WANTENDPEACE n¨D¤¤¤î©M¥386 #BTN_OFFERENDPEACE ´£Ä³¤¤¤î©M¥387 #BTN_WANTFRIENDLY n¨D¤Í¦n¬Û³B388 #BTN_OFFERFRIENDLY ´£Ä³¤Í¦n¬Û³B389 #BTN_WANTALLIANCE n¨DÁp·ù390 #BTN_OFFERALLIANCE ´£Ä³Áp·ù391 #BTN_WANTENDALLIANCE n¨D¸Ñ°£Áp·ù392 #BTN_OFFERENDALLIANCE ´£Ä³¸Ñ°£Áp·ù393 #BTN_NEGOEARLIER ¦¥ýªº³¡¤À394 #BTN_NEGOLATER ¦Z¨Óªº³¡¤À350 #BTN_SELECT 選擇 351 #BTN_PAGE 下頁 352 #BTN_SUPPORT 屬部隊 353 #BTN_IMPRS 城市設施 354 #BTN_CLASSES 部隊 355 #BTN_WONDERS 奇跡 356 #BTN_BUY 購買 357 #BTN_DELETE 刪除 358 #BTN_RENAME 更名 359 #BTN_OBSOLETE 停止生產 360 #BTN_NONOBSOLETE 允許生產 361 #BTN_ALLOWCONSCRIPTS 允許征募 362 #BTN_NOCONSCRIPTS 停止征募 363 #BTN_ENDTURN 結束回合! 364 #BTN_SKIP 不再顯示其他勢力移動 365 #BTN_NOAUTOMOVE 停止向目標移動 366 #BTN_STOP 停止 367 #BTN_NEGO 繼續談判 368 #BTN_DIALOG 聯絡此國 369 #BTN_BREAK 終止本次談判 370 #BTN_PASS 結束本方提議 371 #BTN_CNTREATY 撕毀協議 372 #BTN_ACCEPT 接受提議 373 #BTN_NOTICE 已獲悉決定 374 #BTN_REPLAY 歷史重放 375 #BTN_RENGAME 游戲更名 376 #BTN_DELGAME 游戲刪除 377 #BTN_RENMAP 地圖更名 378 #BTN_DELMAP 地圖刪除 379 #BTN_CONTENTS 目錄 380 #BTN_BACK 返回 381 #BTN_SEARCH 搜索 382 #BTN_WANTCEASEFIRE 要求停火 383 #BTN_OFFERCEASEFIRE 提議停火 384 #BTN_WANTPEACE 要求和平 385 #BTN_OFFERPEACE 提議和平 386 #BTN_WANTENDPEACE 要求中止和平 387 #BTN_OFFERENDPEACE 提議中止和平 388 #BTN_WANTFRIENDLY 要求友好相處 389 #BTN_OFFERFRIENDLY 提議友好相處 390 #BTN_WANTALLIANCE 要求聯盟 391 #BTN_OFFERALLIANCE 提議聯盟 392 #BTN_WANTENDALLIANCE 要求解除聯盟 393 #BTN_OFFERENDALLIANCE 提議解除聯盟 394 #BTN_NEGOEARLIER 早先的部分 395 #BTN_NEGOLATER 后來的部分 395 396 396 397 'Morphing Menu Entries 397 #SUPER ¶W¯Å¥Î¤á398 #HUMAN ¥»¦aª±®a399 #AIT ¹q¸£¹ï¨M400 #RANDOMAI ÀHÉó¿ï¾ÜAI¼Ò¶ô401 #BTN_FOUND ©w©~402 #BTN_ADD ¥[¤J«°¥«403 #BTN_SETHOME §ï¬°¥»«°³¡¶¤404 #BTN_MOVEHOME ªð¦^³Ìªñ«°¥«405 #BTN_BUILDROAD ׫عD¸ô406 #BTN_BUILDBRIDGE ¬[³]¹D¸ô¾ô407 #BTN_BUILDRR ׫ØÅK¸ô408 #BTN_BUILDRRBRIDGE ¬[³]ÅK¸ô¾ô409 #BTN_CLEAR ²M°£´ËªL410 #BTN_DRAIN ©â¤zªh¿A411 #BTN_UNDESERT ¾ã¬°¥ì412 #FARTECH ³]©w¥Ø¼Ð413 #NOFARTECH ¨S¦³¥Ø¼Ð414 #UTILIZE °Ñ«Ø415 #INTEGRATE ¾ã½s398 #SUPER 超級用戶 399 #HUMAN 本地玩家 400 #AIT 電腦對決 401 #RANDOMAI 隨机選擇AI模塊 402 #BTN_FOUND 定居 403 #BTN_ADD 加入城市 404 #BTN_SETHOME 改為本城部隊 405 #BTN_MOVEHOME 返回最近城市 406 #BTN_BUILDROAD 修建道路 407 #BTN_BUILDBRIDGE 架設道路橋 408 #BTN_BUILDRR 修建鐵路 409 #BTN_BUILDRRBRIDGE 架設鐵路橋 410 #BTN_CLEAR 清除森林 411 #BTN_DRAIN 抽干沼澤 412 #BTN_UNDESERT 整為平原 413 #FARTECH 設定目標 414 #NOFARTECH 沒有目標 415 #UTILIZE 參建 416 #INTEGRATE 整編 416 417 #NETWORK_SERVER Network Server 417 418 #NETWORK_CLIENT Network Client 418 419 419 420 'Busy Messages 420 #BUSY_START ³Ð«Ø¥@¬É¡K421 #BUSY_MOD %s ¸ü¤J¤¤¡K422 #BUSY_MODLH ¹Ï§Îªì©l¤Æ¡K423 #BUSY_INIT ª±®aªì©l¤Æ¡K424 #BUSY_LOAD ¸ü¤J´åÀ¸¶i«×¡K421 #BUSY_START 創建世界… 422 #BUSY_MOD %s載入中… 423 #BUSY_MODLH 圖形初始化… 424 #BUSY_INIT 玩家初始化… 425 #BUSY_LOAD 載入游戲進度… 425 426 426 427 'Map Editor 427 #MAP_START ¹q¸£Ïú±Úªì©l¦ì¸m428 #MAP_PREFSTART ª±®aÏú±Úªì©l¦ì¸m429 #MAP_RANDOM ©ñ±ó·í«eªº¦a¹Ï, «·sÀHÉó¥Í¦¨·sªº¦a¹Ï¡H430 #MAP_CLOSE ¿ï¾ÜÃö³¬·í«eªº¦a¹Ï¡C\¬O§_«O¦s¡H428 #MAP_START 電腦种族初始位置 429 #MAP_PREFSTART 玩家种族初始位置 430 #MAP_RANDOM 放棄當前的地圖, 重新隨机生成新的地圖? 431 #MAP_CLOSE 選擇關閉當前的地圖。\是否保存? 431 432 432 433 #STARTCONTROLS 433 °h¥X 434 ¶}©l 435 Ū¨ú 436 ·s«Ø´åÀ¸ 437 Ū¨ú¶i«× 438 ¥@¬É¤Ø¤o¡G 439 ³°¦a¤ñ¨Ò¡G 440 ¦Û©w¸qª±®a 441 ¦~¥N¡G 442 %s ªºÃø«×443 ¦~¡G 444 ¦a¹Ï½s¿è 445 ½s¿è 446 À°§U 447 Ãø«×¡G 448 Ävª§Ïú±Ú¡G 449 AI ¼Ò¶ô¡G434 退出 435 開始 436 讀取 437 新建游戲 438 讀取進度 439 世界尺寸: 440 陸地比例: 441 自定義玩家 442 年代: 443 %s的難度 444 年限: 445 地圖編輯 446 編輯 447 幫助 448 難度: 449 競爭种族: 450 AI模塊: 450 451 451 452 #AUTODIFF 452 ¤Jªù 453 ²³æ 454 ¥¿±` 455 §xÃø 456 ÅܺA 453 入門 454 簡單 455 正常 456 困難 457 變態 457 458 458 459 #CONTROLS 459 ¨ú®ø©R¥O 460 Ãö³¬ 461 ¸gÀ٤ε|¦¬¡K 462 ªø«°«OÅ@°Ï°ì 463 ¬d¬Ý¦a§Î 464 ¥@¬É©_¸ñ¡K 465 ´åÀ¸«ü«n 466 ´ú¸Õ 467 x¨Æ±¡³ø¡K 468 AI ´ú¸Õ«H®§¡K469 «°¥«Ãþ«¬¡K 470 ¬É±©~¤¤ 471 ¥Ø¼Ð²¾°Ê 472 ³¡¶¤©R¥O 473 ³¡¶¤«H®§ 474 «Ø¥ßx¨Æ°ò¦a 475 §ó´«¦a§Î 476 ²M°£¦Ã¬V 477 ±°¹Ü 478 «Ø³yn¶ë 479 ¾ú¥v¹Ïªí¡K 480 ¾n¨¾Äµ§Ù 481 ¶}¹@¹Bªe 482 ·f¼¹B¿é¤u¨ã 483 µy¦Z¦æ°Ê 484 ì¦aµ¥«Ý 485 Åã¥Ü¤è¦ì¥N½X 486 ¦a§Î«Ø³] 487 ¿ï¶µ 488 ³¡¶¤²¾°Ê 489 µ¡¤f¼Ò¦¡Åã¥Ü 490 ¦^¦Xµ²§ô´£¥Ü 491 µø³¥¥~¦a°ÏÅÜ·t 492 «°¥«³ø§i¿ï¶µ 493 «°¥«¦WºÙ 494 °ê®aÃä¬É 495 «°¥«³ø§i¡K 496 ¬ì¬ã³ø§i¡K 497 ¦a§Î§ï³y 498 ¦a§Î§ï³y¡K 499 ´Þ¥Á¸²î¡K 500 §Ö³t§»¾Þ§@ 501 ¤Þ¤ôÄéµ@ 502 ¶}¹@¹A³õ 503 ´Ó¾ð³yªL 504 ¶}ªöÄqÂà 505 ³Ð«Ø³¡¶¤ 506 ÊI®æ 507 AI ´ú¸Õ¦a¹Ï508 ¥~°ê³¡¶¤¡K 509 ¬Fªvª©¹Ï 510 ¥uÅã¥Ü§ðÀ»¤Î¥e»â¦æ°Ê 511 ¤£Åã¥Ü 512 ¸õ¹L20¦^¦X 513 °ê®a±¡³ø¡K 514 §@¹ú 515 ©Ò¦³¬ì§Þ¬ãµo¦¨¥\ 516 ¨C¦^¦X¥Í²£§Ö³t§¹¤u 517 ¨C¦^¦X¬ì§Þ§Ö³t¬ã±o 518 ¨C¦^¦X«°¥««ùÄò¼Wªø 519 ¥´¶}©Ò¦³¦a¹Ï 520 ©Ò¦³°ê®a¬ÛÃÑ 521 ¹B¦æ¦Ü´åÀ¸µ²§ô 522 ¥L°ê«°¥«¡K 523 «°¥«³ø§i¦Cªí 524 «°¥«³ø§i«Ì¹õ 525 ¦WºÙ 526 µL»Ý²{¥N¸ê·½ 527 «ìÎ`¥ð¾ã 528 ©ñ¥X¹B¿é³¡¶¤ 529 ÀHÉó¦a¹Ï 530 ¸Ñ´² 531 ¸Ë¸ü¹B¿é³¡¶¤ 532 ¹ï¤â²¾°Ê 533 ºC³t 534 §Ö³t 535 Ìå§Ö 536 ºC³t 537 §Ö³t 538 µ®Ä 539 Ãö³¬ 540 ¶}±Ò(Àq»{µ®Ä)541 ¶}±Ò(´À¥Nµ®Ä)542 ºu«Ì 543 ºC³t 544 §Ö³t 545 Ãö³¬ 546 ³X°Ý©x¤èÊI¯¸ 547 µo°Ê¬FÊ^²©R¡I 548 ·ùx¦æ°Ê 549 ºC³t 550 §Ö³t 551 ¤£Åã¥Ü 552 ¥uÅã¥Ü¨µÅÞ¡B§ðÀ»¤Î¥e»â¦æ°Ê 553 ¥uÅã¥Ü¨µÅÞ¡B§ðÀ»¤Î¥e»â¦æ°Ê 554 ¦a¶ô¤Ø¤o 460 取消命令 461 關閉 462 經濟及稅收… 463 長城保護區域 464 查看地形 465 世界奇跡… 466 游戲指南 467 測試 468 軍事情報… 469 AI測試信息… 470 城市類型… 471 界面居中 472 目標移動 473 部隊命令 474 部隊信息 475 建立軍事基地 476 更換地形 477 清除污染 478 掠奪 479 建造要塞 480 歷史圖表… 481 駐防警戒 482 開辟運河 483 搭乘運輸工具 484 稍后行動 485 原地等待 486 顯示方位代碼 487 地形建設 488 選項 489 部隊移動 490 窗口模式顯示 491 回合結束提示 492 視野外地區變暗 493 城市報告選項 494 城市名稱 495 國家邊界 496 城市報告… 497 科研報告… 498 地形改造 499 地形改造… 500 殖民飛船… 501 快速宏操作 502 引水灌溉 503 開辟農場 504 植樹造林 505 開采礦藏 506 創建部隊 507 网格 508 AI測試地圖 509 外國部隊… 510 政治版圖 511 只顯示攻擊及占領行動 512 不顯示 513 跳過20回合 514 國家情報… 515 作弊 516 所有科技研發成功 517 每回合生產快速完工 518 每回合科技快速研得 519 每回合城市持續增長 520 打開所有地圖 521 所有國家相識 522 運行至游戲結束 523 他國城市… 524 城市報告列表 525 城市報告屏幕 526 名稱 527 無需現代資源 528 恢复休整 529 放出運輸部隊 530 隨机地圖 531 解散 532 裝載運輸部隊 533 對手移動 534 慢速 535 快速 536 极快 537 慢速 538 快速 539 音效 540 關閉 541 開啟(默認音效) 542 開啟(替代音效) 543 滾屏 544 慢速 545 快速 546 關閉 547 訪問官方网站 548 發動政体革命! 549 盟軍行動 550 慢速 551 快速 552 不顯示 553 只顯示巡邏、攻擊及占領行動 554 只顯示巡邏、攻擊及占領行動 555 地塊尺寸 555 556 Small 556 557 Medium … … 560 561 561 562 #ADVANCES 562 ´¼¯à¸¦æ 563 ¨âÑá§@¾Ô 564 ¤Ñ¤å¾Ç 565 ì¤l¾Ç»¡ 566 ¨T¨® 567 ¼u¹D¾Ç 568 »È¦æ·~ 569 ¾ô±ç«Ø³] 570 «C»Éű³y 571 ¸®Â§»ö¦¡ 572 ¤Æ¾Ç 573 ÃM¤h¨î«× 574 Î`¦X§÷®Æ 575 ªk«ß±ø¤å 576 ²Õ¦X§LÏú 577 ¤º¿UÉó 578 ¦@²£¥D¸q 579 pºâÉó 580 ©º§L¨î«× 581 «Øµ® 582 ¥ø·~µ²ÌÛ 583 ¬P»Ú¸¦æ 584 ³f¹ô 585 ¥Á¥D¥D¸q 586 ¸gÀÙ¾Ç 587 µo¹q 588 ¹q¤l¾Ç 589 ¤uµ{¾Ç 590 Àô¹Ò«OÅ@ 591 ¨®½ü 592 ¬µÃÄ 593 ¸¦æ 594 ±¡³ø¤u§@ 595 ¤õÃÄ 596 ÃM³N 597 ¯ß¨RÅX°Ê 598 ²£·~¤Æ 599 ´¼¯àªZ¾¹ 600 µo©ú 601 űÅK§M·Ò 602 ¿E¥ú 603 ®Ö¯à 604 ¤å¾Ç 605 ¤¬ÁpÊI 606 ¹qºÏ¾Ç 607 ¦a¹Ïø¨î 608 ¨î¿j 609 ³W¼Ò¶q²£ 610 ¼Æ¾Ç 611 ÂåÃÄ 612 §Mª÷ 613 ¤p«¬¤Æ 614 Éó°Ê§@¾Ô 615 §g¥D¬Fªv 616 ¯«¯µ¥D¸q 617 ®ü¤W¾É¯è 618 ®ÖµõÅÜ 619 õ¾Ç 620 ª«²z 621 ¶ì®Æ 622 ¸Öºq 623 ¨î³³ 624 µL½u¹q 625 ¦A´`Àô 626 §C·Å§N«o 627 ¤@¯«½× 628 ¦@©M¥D¸q 629 É󾹤H 630 ¼QÉaÅX°Ê 631 ÅK¸ô 632 ½Ã¥Í³]¬I 633 ¬ì¾Ç 634 ®Ñ¼g 635 ¯è®ü 636 ¼ÒÀÀ¥ÍºA 637 Áô§Î§Þ³N 638 »]¨T¤ÞÀº 639 ¿ûÅK 640 ¤H³y¹«~ 641 ¾Ô³N 642 ¯«¾Ç 643 «¤O¾Ç»¡ 644 ¶T©ö 645 ¬P»Ú´Þ¥Á 646 ¤j¾Ç 647 ´¼¯à¤õ½b 648 ©|ªZ²ß«U 649 ¦r¥À 650 ¦h¯«½× 651 ´£¯Â 652 ¹q¸£¬ì§Þ 653 ¯Ç¦Ì§Þ³N 654 §÷®Æ¬ì¾Ç 655 ¤H¤u´¼¯à 563 智能飛行 564 兩栖作戰 565 天文學 566 原子學說 567 汽車 568 彈道學 569 銀行業 570 橋梁建設 571 青銅鑄造 572 葬禮儀式 573 化學 574 騎士制度 575 复合材料 576 法律條文 577 組合兵种 578 內燃机 579 共產主義 580 計算机 581 征兵制度 582 建筑 583 企業結构 584 星際飛行 585 貨幣 586 民主主義 587 經濟學 588 發電 589 電子學 590 工程學 591 環境保護 592 車輪 593 炸藥 594 飛行 595 情報工作 596 火藥 597 騎術 598 脈沖驅動 599 產業化 600 智能武器 601 發明 602 鑄鐵冶煉 603 激光 604 核能 605 文學 606 互聯网 607 電磁學 608 地圖繪制 609 制磚 610 規模量產 611 數學 612 醫藥 613 冶金 614 小型化 615 机動作戰 616 君主政治 617 神秘主義 618 海上導航 619 核裂變 620 哲學 621 物理 622 塑料 623 詩歌 624 制陶 625 無線電 626 再循環 627 低溫冷卻 628 一神論 629 共和主義 630 机器人 631 噴气驅動 632 鐵路 633 衛生設施 634 科學 635 書寫 636 航海 637 模擬生態 638 隱形技術 639 蒸汽引擎 640 鋼鐵 641 人造食品 642 戰術 643 神學 644 重力學說 645 貿易 646 星際殖民 647 大學 648 智能火箭 649 尚武習俗 650 字母 651 多神論 652 提純 653 電腦科技 654 納米技術 655 材料科學 656 人工智能 656 657 657 658 #IMPROVEMENTS 658 ª÷¦r¶ð 659 ©z´µ¯«¼q 660 ªÅ¤¤ªá¶é 661 ¤Ó¶§¯«¹³ 662 ¥¨«¬¿O¶ð 663 ¤j¹Ï®ÑÀ] 664 ¯«¿Ù±Ò¥Ü 665 ®]ªZ¾Ç°| 666 ¹Fªâ©_¤u©Ð 667 ³ÁõÛ»·©º 668 Éo¥À§«ô°ó 669 * 670 ¤û¹y¤j¾Ç 671 ¤Ú»®¤j±Ð°ó 672 * 673 ¦Û¥Ñ¤k¯«¹³ 674 ®Jµáº¸ÅK¶ð 675 ¤T®l¤jÅò 676 ·s¤z½u¯S§Ö 677 °Ò«¢¹yp¦E 678 ªñ¦aªÅ¶¡¯¸ 679 * 680 * 681 * 682 * 683 * 684 * 685 * 686 °Ó«~¶T©ö 687 §LÀç 688 ¨¦Ü 689 ¦x¼q 690 ¥«³õ 691 ¹Ï®ÑÀ] 692 ªk°| 693 «°Àð 694 ¤ô´ë 695 »È¦æ 696 ±Ð°ó 697 ¤j¾Ç 698 ´ä¤f 699 ¼@°| 700 ¤uÉD 701 ¯S°Ï 702 ¦^¦¬¯¸ 703 ¤õ¹q¯¸ 704 ¤ô¹q¯¸ 705 ®Ö¹q¯¸ 706 ®ü¤W¥¥x 707 ¥«¬FÆU 708 ±Æ¦ÃºÞ 709 ¶W¥« 710 ¥ß¥æ 711 ¹êÅç«Ç 712 ¨¾ªÅ¬¶ 713 ¸M³ù 714 Éó³õ 715 ²î¶õ 716 ®c·µ 717 ªø«° 718 ¤j¼@³õ 719 ¤Ñ¤å¥x 720 x¨Æ¾Ç®Õ 721 §@¾Ô±»Ê^ 722 ¤ôĦ¹A³õ 723 ªÑ²¼¥æ©ö 724 ¤ÓªÅ´ä 725 ´Þ¥Á¸²î²Õ¥ó 726 ¸²î°Ê¤O¿µ 727 ¸²î©~¦í¿µ 659 金字塔 660 宙斯神廟 661 空中花園 662 太陽神像 663 巨型燈塔 664 大圖書館 665 神諭啟示 666 孫武學院 667 達芬奇工房 668 麥哲倫遠征 669 圣母禮拜堂 670 * 671 牛頓大學 672 巴赫大教堂 673 * 674 自由女神像 675 埃菲爾鐵塔 676 三峽大壩 677 新干線特快 678 曼哈頓計划 679 近地空間站 680 * 681 * 682 * 683 * 684 * 685 * 686 * 687 商品貿易 688 兵營 689 谷倉 690 寺廟 691 市場 692 圖書館 693 法院 694 城牆 695 水渠 696 銀行 697 教堂 698 大學 699 港口 700 劇院 701 工厂 702 特區 703 回收站 704 火電站 705 水電站 706 核電站 707 海上平台 708 市政廳 709 排污管 710 超市 711 立交 712 實驗室 713 防空炮 714 碉堡 715 机場 716 船塢 717 宮殿 718 長城 719 大劇場 720 天文台 721 軍事學校 722 作戰掩体 723 水藻農場 724 股票交易 725 太空港 726 殖民飛船組件 727 飛船動力艙 728 飛船居住艙 728 729 729 730 #FEATURES 730 ªZ¾¹(§ð)731 ¸Ë¥Ò(¨¾)732 Éó°Ê(²¾)733 ®ü¹B 734 ¥ÀÄ¥ 735 ´õ½ü 736 ªÅŧ 737 ¿Uªo 738 ªÅ¹B 739 ®ü¤W¾É¯è 740 ¹p¹FÁn¯Ç 741 ¤ô¤U¼ç¯è 742 »·µ{¬¶À» 743 §Ö³t¦æx 744 ²î¤W±Ï¥Í 745 ÃB¥~t« 746 ¨¾ªÅªZ¾¹ 747 ¶¡¿Ò¸Éó 748 »]¨T°Ê¤O 749 ®Ö¤l°Ê¤O 750 ¼QÉa¤ÞÀº 751 Áô§Î§Þ³N 752 ¨g¼ö¤À¤l 753 ¤@À»¨î¼Ä 754 Éa§]¤æ¤û 755 ¤[¸g¨F³õ 756 ¬y¤ô§@·~ 731 武器(攻) 732 裝甲(防) 733 机動(移) 734 海運 735 母艦 736 渦輪 737 空襲 738 燃油 739 空運 740 海上導航 741 雷達聲納 742 水下潛航 743 遠程炮擊 744 快速行軍 745 船上救生 746 額外負重 747 防空武器 748 間諜飛机 749 蒸汽動力 750 核子動力 751 噴气引擎 752 隱形技術 753 狂熱分子 754 一擊制敵 755 气吞斗牛 756 久經沙場 757 流水作業 757 758 758 759 #TERRAIN 759 »·¬v 760 ªñ®ü 761 ¯ó³õ 762 ¨Fºz 763 ¯î¦a 764 aì 765 ¦Bì 766 ªh¿A 767 ÂOªL 768 ´ËªL 769 ¥C³® 770 °ª¤s 771 * 772 º®³õ 773 ¥ì 774 ºñ¬w 775 ¤p³Á 776 ¶Àª÷ 777 Ã~¥Ö 778 ªd¬´ 779 ¤ôªG 780 Âyª« 781 ¬ü°s 782 ÅKÄq 783 * 784 ¿øÄq 785 * 786 ¥Ûªo 787 ¾T¤g 788 ¿UÉa 789 * 790 * 791 ¯Q¤ì 792 Äq¬u 793 ·Ñ¬´ 794 Æp¥Û 795 ´c¤g 796 ¹WÄq 797 ¹\Äq 798 ¤ô»È 760 遠洋 761 近海 762 草場 763 沙漠 764 荒地 765 苔原 766 冰原 767 沼澤 768 叢林 769 森林 770 丘陵 771 高山 772 * 773 漁場 774 平原 775 綠洲 776 小麥 777 黃金 778 獸皮 779 泥炭 780 水果 781 獵物 782 美酒 783 鐵礦 784 * 785 錳礦 786 * 787 石油 788 鋁土 789 燃气 790 * 791 * 792 烏木 793 礦泉 794 煤炭 795 鑽石 796 惡土 797 鈷礦 798 鈾礦 799 水銀 799 800 800 801 #DOMAIN 801 ³°x 802 ®üx 803 ªÅx 802 陸軍 803 海軍 804 空軍 804 805 805 806 #EXPERIENCE 806 ·s§L 807 ¨ü°V 808 ¾ú½m 809 ¦Ñ§L 810 ºë¾U 807 新兵 808 受訓 809 歷練 810 老兵 811 精銳 811 812 812 813 #UNITSTATUS 813 ¾n¨¾ª¬ºA 814 ÅF¬µ¸Ë³Æ 815 ¤s°Ï²¾°Ê 816 ©º¶Ò³¡¶¤ 817 ºMÖ󡶤 818 * 819 * 820 * 821 ¹B¸ü³¡¶¤ 822 ¾ÉP¤£¦w 823 ì¦a°±¯d 824 * 825 ¦V«ü©w¥Ø¼Ð²¾°Ê 826 ¦a§Î§ï³y 827 ¨ü·l«ìÎ` 814 駐防狀態 815 轟炸裝備 816 山區移動 817 征募部隊 818 撤离部隊 819 * 820 * 821 * 822 運載部隊 823 導致不安 824 原地停留 825 * 826 向指定目標移動 827 地形改造 828 受損恢复 828 829 829 830 #GOVERNMENT 830 µL¬F©² 831 ¥£Æרî 832 §g¥D¨î 833 ¦@©M¨î 834 ©v±Ð¨î 835 ¦@²£¨î 836 ¥Á¥D¨î 837 ¥¼¨Ó¨î 831 無政府 832 奴制 833 君主制 834 共和制 835 宗教制 836 共產制 837 民主制 838 未來制 838 839 839 840 #TREATY 840 ¥æ¾Ô 841 °±¾Ô 842 ©M¥ 843 ¤Í¦n 844 Áp·ù 841 交戰 842 停戰 843 和平 844 友好 845 聯盟 845 846 846 847 #HAVETREATY 847 ÉO#n«Ø¥æ 848 ÉO#n°±¾Ô 849 ÉO#n©M¥ 850 ÉO#n¤Í¦n 851 # ÉO#nÁp·ù848 与#n建交 849 与#n停戰 850 与#n和平 851 与#n友好 852 #与#n聯盟 852 853 853 854 #ATTITUDE 854 ¼Ä¹ï 855 §N²H 856 ¤£¦X 857 ¤¤¥ß 858 ±µ¨ü 859 ¤Íµ½ 860 ¼ö±¡ 855 敵對 856 冷淡 857 不合 858 中立 859 接受 860 友善 861 熱情 861 862 862 863 #CREDIBILITY 863 ¨¥¦ÓµL«H 864 ®»ºN¤£©w 865 «¿Õ¦u«H 866 ¨¥¥X¥²¦æ 864 言而無信 865 捉摸不定 866 重諾守信 867 言出必行 867 868 868 869 #CITYEVENTS 869 ¥«¥ÁÄ̶à 870 ¥Í²£§¹¤u 871 ¤H¤f¼Wªø 872 ¤H¤f´î¤Ö 873 ³¡¶¤¸Ñ´² 874 ³]¬IÅܽæ 875 ¥Í²£¾D·´ 876 ¹F¨ì¤W 877 ¥X²{¦Ã¬V 878 «°¥«³Q³ò 879 ©_¸ñ«Î` 880 ²¾¥Á©µ´Á 881 «°¥««Ø¥ß 882 «°¥«¦wÎ` 883 «°¥«³Q¥e 884 µL®Ä«°¥«Ãþ«¬ 870 市民騷亂 871 生產完工 872 人口增長 873 人口減少 874 部隊解散 875 設施變賣 876 生產遭毀 877 達到上限 878 出現污染 879 城市被圍 880 奇跡重复 881 移民延期 882 城市建立 883 城市安复 884 城市被占 885 無效城市類型 885 886 886 887 #CITYTYPE 887 ´¶³q«¬«°¥« 888 ¬ì§Þ«¬«°¥« 889 ¤u·~«¬«°¥« 890 ¶W¯Å¤j³£¥« 888 普通型城市 889 科技型城市 890 工業型城市 891 超級大都市 891 892 892 893 #DIAGRAM 893 ¤H¤f 894 »â¤g 895 x¨Æ 896 ¬ì§Þ 897 ±´¯Á 898 ¯Ñ§@ 894 人口 895 領土 896 軍事 897 科技 898 探索 899 耕作 899 900 900 901 #JOBRESULT 901 902 * 902 ¹D¸ô 903 ÅK¸ô 904 ²M°£´ËªL 905 Äéµ@ 906 ¹A³õ 907 ´Ó¾ð³yªL 908 ªöÄq 909 ¹Bªe 910 ¦a§Î§ó§ï 911 n¶ë 912 ²M°£¦Ã¬V 913 x¨Æ°ò¦a 914 ±°¹Ü 915 ©w©~ 916 ¹D¸ô¾ô 917 ÅK¸ô¾ô 918 ²¾°£³]¬I 919 Åܬ°¥ì 920 ©â¤zªh¿A 903 道路 904 鐵路 905 清除森林 906 灌溉 907 農場 908 植樹造林 909 采礦 910 運河 911 地形更改 912 要塞 913 清除污染 914 軍事基地 915 掠奪 916 定居 917 道路橋 918 鐵路橋 919 移除設施 920 變為平原 921 抽干沼澤 921 922 922 923 #ARMYLOST 923 #A ³¡¶¤³QÄè·À924 #A Ä¥¶¤³QÄè·À925 #A ³¡¶¤¶°¸s³QÄè·À924 #A部隊被殲滅 925 #A艦隊被殲滅 926 #A部隊集群被殲滅 926 927 927 928 #SPYMISSION 928 ¯}§¥¥Í²£ 929 ÅѨú¦a¹Ï 930 Àò±o²Ä¤T°ê±¡³ø 931 ¥´§v°ê®a±¡³ø 932 ¥´§vx¨Æ±¡³ø 929 破坏生產 930 竊取地圖 931 獲得第三國情報 932 打听國家情報 933 打听軍事情報 933 934 934 935 #WANT 935 ¯Án°ê®a±¡³ø 936 ¯Ánx¨Æ±¡³ø 937 ¯Án¥@¬É¦a¹Ï 938 * 939 ¯Án¬ì§Þ¦¨ªG 940 ¯Án³¡¶¤¬ãµo 941 ¯Án§ª÷ 942 * 943 * 944 * 945 ¯Án¸²î³¡¥ó 946 Åý¹ï¤è¦Û¦æ¥Xɲ 936 索要國家情報 937 索要軍事情報 938 索要世界地圖 939 * 940 索要科技成果 941 索要部隊研發 942 索要禮金 943 * 944 * 945 * 946 索要飛船部件 947 讓對方自行出价 947 948 948 949 #OFFER 949 ©^°e°ê®a±¡³ø 950 ©^°ex¨Æ±¡³ø 951 ©^°e¥@¬É¦a¹Ï 952 * 953 ©^°e¬ì§Þ¦¨ªG 954 ©^°e³¡¶¤¬ãµo 955 ©^°e§ª÷ 956 * 957 * 958 * 959 ©^°e¸²î³¡¥ó 960 Åý¹ï¤è¦Û¦ænɲ 950 奉送國家情報 951 奉送軍事情報 952 奉送世界地圖 953 * 954 奉送科技成果 955 奉送部隊研發 956 奉送禮金 957 * 958 * 959 * 960 奉送飛船部件 961 讓對方自行要价 961 962 962 963 #CITYMANAGETYPE 963 ¤â°Ê¤À°t 964 ¬ì¬ã³Ì¤j¤Æ 965 ¬ì¬ãɬ¥ý 966 ¼Wªø³Ì¤j¤Æ 967 ¥Í²£É¬¥ý 968 ¥Í²£³Ì¤j¤Æ 964 手動分配 965 科研最大化 966 科研优先 967 增長最大化 968 生產优先 969 生產最大化 969 970 970 971 #SETTINGS -
branches/highdpi/Localization/zh-Hant/ReadMe.txt
r124 r465 1 C-EVO( ¤å©ú¶i¤Æ¥v)º~¤Æ»¡©ú1 C-EVO(文明進化史)漢化說明 2 2 3 ¹CÀ¸¤¶²Ð¡G 4 C-EVO ¬O¤@´Ú±q¤å©ú(Civilization)¨t¦Cl¥Í¦Ó¥XªºWindows¥¥x¶}·½¦Û¥Ñ¹CÀ¸¡A¦b¿í´`¤å©ú¨t¦C5 °ò¥»ì«hªº°ò¦¤W¡A°µ¤F³\¦h¦³³Ð·N©M¤H©Ê¤Æªº²·s¡A¬O¤@´Úºë¬ü¦³½ìªº¤å©úÃþ¹CÀ¸¡A¤å©ú°g¤£¥i¤£ª±¡C 6 ©x¤è¥D¶¡Ghttp://www.c-evo.org7 쪩¹CÀ¸(V1.10¡A¹ïÀ³º~¤Æ¥])¤U¸ü¶±¡Ghttp://www.c-evo.org/files/download.php3 遊戲介紹: 4 C-EVO是一款從文明(Civilization)系列衍生而出的Windows平台開源自由遊戲,在遵循文明系列 5 基本原則的基礎上,做了許多有創意和人性化的革新,是一款精美有趣的文明類遊戲,文明迷不可不玩。 6 官方主頁:http://www.c-evo.org 7 原版遊戲(V1.10,對應漢化包)下載頁面:http://www.c-evo.org/files/download.php 8 8 9 º~¤Æ¥]¨Ï¥Î¤èªk¡G 10 ¦w¸Ë쪩¹CÀ¸«á¡A±Nº~¤Æ¥]¤ºªº¤å¥ó¸ÑÀ£¨ì¹CÀ¸¦w¸Ë¥Ø¿ý¡A°È¥²Âл\ì¤å¥ó¡]Language.txt, Help\Help.txt¡^¡A 11 µM«á°õ¦æ¹CÀ¸µ{§Ç¡C 9 漢化包使用方法: 10 安裝原版遊戲後,將漢化包內的文件解壓到遊戲安裝目錄,務必覆蓋原文件(Language.txt, Help\Help.txt), 11 然後執行遊戲程序。 12 12 13 º~¤Æ»¡©ú¡G 14 1. °ò¥»§¹¥þº~¤Æª©¡A°£¤F¹CÀ¸Ãö©ó³¡¤À¥~¨ä¥L¤º®e¤å¦r¥þ³¡º~¤Æ¡A¥]¬AÀ°§U«ü«n¡A¤å¦r¶q¬ù70KB¡C15 2. º~¤Æ¥]¤¤ªþ±a¤Fº~¤ÆªÌ¦Û¦æ³]pªº¤@´Ú¹CÀ¸¦a¹Ï¡A¥Dn¹ïª±®aªº°_©l¦ì¸m°µ¤FÀu¤Æ¡C16 3. º~¤Æ¥]¤¤²K¥[¤F¹CÀ¸«ü«nªº§Ö±¶¹B¦æ¤è¦¡¡A¤è«Kª±®a¬d¾\¡C17 4. ¹CÀ¸«ü«n¤¤ªº¬Y¨Ç³¡¤À¡A¦p¬ì§Þ¡B³]¬I¡B©_¸ñµ¥À°§Uµ¡¤f¡Aµ¡¤f¼ÐÃD¤U¤èªºº¦æ¡]¤å¦r¤º®e»Pµ¡¤f¼ÐÃD¬Û¦P¡^18 ¬°¶Ã½X¡A¬°µ{§ÇÝ®e°ÝÃD¡]º¦r¥À¤j¼g¥X¿ù¡^¡AµL§«¹CÀ¸¡FÁcÅ餤¤åª©¤¤«°¥«ªº¦WºÙY¬°¤¤¤å¡A¦b«°¥«µ¡¤f¤¤¥u¯àÅã¥Ü«°¥«¦Wªºº¦r¡A¬G«O¯d^¤å¦W 13 漢化說明: 14 1. 基本完全漢化版,除了遊戲關於部分外其他內容文字全部漢化,包括幫助指南,文字量約70KB。 15 2. 漢化包中附帶了漢化者自行設計的一款遊戲地圖,主要對玩家的起始位置做了優化。 16 3. 漢化包中添加了遊戲指南的快捷運行方式,方便玩家查閱。 17 4. 遊戲指南中的某些部分,如科技、設施、奇跡等幫助窗口,窗口標題下方的首行(文字內容與窗口標題相同) 18 為亂碼,為程序兼容問題(首字母大寫出錯),無妨遊戲;繁體中文版中城市的名稱若為中文,在城市窗口中只能顯示城市名的首字,故保留英文名 19 19 20 V1.10 ª©§ó·s·§n¡G21 1 ¡B¹CÀ¸¬É±§@¤F½Õ¾ã¡A·s¬É±§óª½Æ[¤Í¦n22 2 ¡B«°¥«µ¡¤f¤¤¼W³]¤F¸ê·½¦Û°Ê¤À°t¼Ò¦¡¡A¤è«Kª±®a§Ö³t³]¸m¡A´î¤Ö¤F¤¾Ácªº²Ó¸`¾Þ§@23 3 ¡B®Ú¾Úª±®a¤ÏõX¡Aקï¤F¤T¶µ©_¸ñªº®ÄªG24 4 ¡B½Õ¾ã¤F«°¥«¦w©wȪº¼vÅT°Ñ¼Æ¥H¤Îªì©l¤ô¥25 5 ¡B¼W¥[¤F¥æ¾Ôµ²ªG¹w´ú26 6 ¡B¥æ¯A«ü¥Oªº¤Ö¶q½Õ¾ã¡A¥h°£¤F¦~°^³¡¤À¡A¨Ã½Õ¾ã¤F²×¤î±ø¬ùªº³¡¤À³]©w27 7 ¡B¨ä¥L¤è±ªº·L½Õ20 V1.10版更新概要: 21 1、遊戲界面作了調整,新界面更直觀友好 22 2、城市窗口中增設了資源自動分配模式,方便玩家快速設置,減少了冗繁的細節操作 23 3、根據玩家反饋,修改了三項奇跡的效果 24 4、調整了城市安定值的影響參數以及初始水平 25 5、增加了交戰結果預測 26 6、交涉指令的少量調整,去除了年貢部分,並調整了終止條約的部分設定 27 7、其他方面的微調 28 28 29 º~¤Æ§ó·s¡G 30 08.06.18 1.10 ª©º~¤Æ¥]»s§@§¹¦¨¡A¹ïÀ³·s±À¥Xªº1.10^¤åª©¡]080526¡^31 08.04.18 1.04ª©º~¤Æ¥]»s§@§¹¦¨¡A¹ïÀ³ì¥ýªº1.04^¤åª©29 漢化更新: 30 08.06.18 1.10版漢化包製作完成,對應新推出的1.10英文版(080526) 31 08.04.18 1.04版漢化包製作完成,對應原先的1.04英文版 32 32 33 ¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X 34 º~¤Æ¡]¦½¤Æ¡^¤£®e©ö¡AÂà¸ü®É½Ð«O¯dº~¤ÆªÌ¡AÁÂÁ¡C 33 ————————————————————————————————————— 34 漢化(汗化)不容易,轉載時請保留漢化者,謝謝。 35 35 36 NapTID ¡]µL¦W¡^2008.06.1836 NapTID(無名)2008.06.18 -
branches/highdpi/Localization/zh-Hant/Tribes/Americans.tribe.txt
r123 r465 1 #CHOOSE ¬ü°ê2 #n ¬ü°ê¤H3 #s ¬ü°ê4 #a ¬ü§Q°í1 #CHOOSE 美國 2 #n 美國人 3 #s 美國 4 #a 美利堅 5 5 #COLOR FFAFAF 6 6 #SYMBOLS Nation1, 48 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 13 Washington 14 New York 15 Boston 16 Philadelphia 17 Atlanta 18 Chicago 19 San Francisco 20 Buffalo 21 St. Louis 22 Detroit 23 New Orleans 24 Baltimore 25 Denver 26 Cincinnati 27 Dallas 28 Los Angeles 29 Kansas City 30 San Diego 31 Richmond 32 Las Vegas 33 Phoenix 34 Seattle 35 Albuquerque 36 Portland 37 Minneapolis 38 Houston 39 Riverside 40 Anaheim 41 Nassau-Suffolk 42 Tampa 43 Oakland 44 Pittsburgh 45 St. Louis 46 Cleveland 47 Newark 48 Fort Worth 49 San Jose 50 Orlando 51 Sacramento 52 Fort Lauderdale 53 Indianapolis 54 San Antonio 55 Norfolk 56 Columbus 57 Milwaukee 58 Charlotte 59 Paterson 60 Salt Lake City 61 Greensboro 62 Austin 63 Nashville-Davidson 64 Providence 65 Raleigh 66 Hartford 67 New Brunswick 68 Memphis 69 West Palm Beach 70 Long Branch 71 Jacksonville 72 Rochester 73 Grand Rapids 74 Oklahoma City 75 Louisville 76 Greenville 77 Dayton 78 Fresno 79 Birmingham 80 Honolulu 81 Albany 82 Tucson 83 Tulsa 84 Oxnard 85 Syracuse 86 Omaha 87 Tacoma 88 Akron 89 Knoxville 90 El Paso 91 Bakersfield 92 Allentown 93 Gary 94 Harrisburg 95 Scranton 96 Toledo 97 Jersey City 98 Baton Rouge 99 Youngstown 100 Springfield 101 Sarasota 102 Wilmington 103 Little Rock 104 Ann Arbor 105 McAllen 106 Stockton 107 Charleston 108 Wichita 109 New Haven 110 Mobile 111 Columbia 112 Colorado Springs 113 113 114 114 #UNITS StdUnits 115 20, 040, ¥Á§L 115 20, 040, 民兵 116 116 117 117 #UNITS Nation1 118 8, 134, »´ÃM§L 119 18, 136, Áº¸°Ò©Z§J 120 28, 202, ÅK¥ÒÄ¥ 118 8, 134, 輕騎兵 119 18, 136, 謝爾曼坦克 120 28, 202, 鐵甲艦 -
branches/highdpi/Localization/zh-Hant/Tribes/Babyl.tribe.txt
r123 r465 1 #CHOOSE ¤Ú¤ñÛ2 #n ¤Ú¤ñÛ¤H3 #s ¤Ú¤ñÛ4 #a ¤Ú¤ñÛ1 #CHOOSE 巴比倫 2 #n 巴比倫人 3 #s 巴比倫 4 #a 巴比倫 5 5 #COLOR EFCB47 6 6 #SYMBOLS Nation2, 92 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 13 Babylon 14 Ur 15 Borsippa 16 Nineveh 17 Ashur 18 Agade 19 Uruk 20 Akshak 21 Lugalzagesi 22 Eridu 23 Samarra 24 Lagash 25 Kish 26 Nippur 27 Shuruppak 28 Sippar 29 Larsa 30 Zamua 31 Tell Wilaya 32 Umma 33 Adab 34 Ebla 35 Calah 36 Dur Sharrukin 37 Cunaxa 38 Singara 39 Nisibis 40 Harran 41 Opis 42 Tarsus 43 Gasur 44 Aleppo 45 Basra 46 Charax 47 Hassuna 48 Larak 49 Bad-tibira 50 Cuthah 51 Isin 52 Arpad 53 Guabba 54 Jarmo 55 Tell Halaf 56 Shubat Enlil 57 Mari 58 Dur-Kurigalzu 59 59 60 60 #UNITS Nation2 61 50, 010, ²¾¥ÁªÌ 62 51, 040, ¥Á§L 63 52, 101, ªø¥Ù¤â 64 53, 101, ½b¤â 65 54, 102, ¥Ù¤M¤â 66 55, 103, ¤õºj¤â 67 56, 131, ÃM§L 68 57, 132, ¾Ô¨® 61 50, 010, 移民者 62 51, 040, 民兵 63 52, 101, 長矛手 64 53, 101, 箭手 65 54, 102, 矛刀手 66 55, 103, 火槍手 67 56, 131, 騎兵 68 57, 132, 戰車 -
branches/highdpi/Localization/zh-Hant/Tribes/British.tribe.txt
r123 r465 1 #CHOOSE ¤£¦CÄA2 #n ¤£¦CÄA¤H3 #s ^°ê4 #a ¤j¤£¦CÄA1 #CHOOSE 不列顛 2 #n 不列顛人 3 #s 英國 4 #a 大不列顛 5 5 #COLOR 978367 6 6 #SYMBOLS Nation2, 95 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 13 London 14 York 15 Nottingham 16 Hastings 17 Canterbury 18 Coventry 19 Warwick 20 Newcastle 21 Oxford 22 Liverpool 23 Dover 24 Brighton 25 Norwich 26 Leeds 27 Reading 28 Birmingham 29 Richmond 30 Exeter 31 Cambridge 32 Manchester 33 Bristol 34 Leicester 35 Carlisle 36 Ipswich 37 Portsmouth 38 Berwick 39 Sheffield 40 Kingston upon Hull 41 Bradford 42 Stoke-on-Trent 43 Wolverhampton 44 Plymouth 45 Derby 46 Southampton 47 Dudley 48 Newcastle upon Tyne 49 Sunderland 50 Northampton 51 Preston 52 Walsall 53 Luton 54 Richmond 55 Southend-on-Sea 56 Bournemouth 57 Middlesbrough 58 West Bromwich 59 Blackpool 60 Oldbury 61 Swindon 62 Huddersfield 63 Bolton 64 Poole 65 Peterborough 66 Stockport 67 Rotherham 68 Watford 69 Slough 70 St Helens 71 Sutton Coldfield 72 Blackburn 73 Oldham 74 Basildon 75 Woking 76 Chelmsford 77 Colchester 78 Worthing 79 Gillingham 80 Eastbourne 81 Solihull 82 Rochdale 83 Birkenhead 84 Cheltenham 85 Halifax 86 Southport 87 Maidstone 88 Grimsby 89 Crawley 90 Hartlepool 91 Darlington 92 Wigan 93 Bath 94 South Shields 95 Stockton-on-Tees 96 Gateshead 97 Warrington 98 Worcester 99 St Albans 100 Lincoln 101 Chester 102 Salford 103 Hemel Hempstead 104 Basingstoke 105 Stevenage 106 Scunthorpe 107 Barnsley 108 Burnley 109 Harlow 110 Wakefield 111 Bedford 112 Newcastle-under-Lyme 113 Redditch 114 Chesterfield 115 Mansfield 116 High Wycombe 117 Chatham 118 118 119 119 #UNITS StdUnits 120 22, 040, ¥Á§L 120 22, 040, 民兵 121 121 122 122 #UNITS Nation2 123 36, 21, ¯S¤u 124 86, 201, ¤T®é¦|²î 125 87, 132, ÃM¤h 123 36, 21, 特工 124 86, 201, 三桅帆船 125 87, 132, 騎士 -
branches/highdpi/Localization/zh-Hant/Tribes/Chinese.tribe.txt
r123 r465 1 #CHOOSE ¤¤°ê2 #n ¤¤°ê¤H3 #s ¤¤°ê4 #a ¤¤µØ1 #CHOOSE 中國 2 #n 中國人 3 #s 中國 4 #a 中華 5 5 #COLOR 00FFFF 6 6 #SYMBOLS Nation1, 41 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 13 Beijing 14 Shanghai 15 Guangzhou 16 Nanjing 17 Qingdao 18 Xinjian 19 Chengdu 20 Changchun 21 Tianjin 22 Datong 23 Macao 24 Anyang 25 Shantou 26 Jinan 27 Kaifeng 28 Ningpo 29 Baoding 30 Dongying 31 Shenyang 32 Dalian 33 Harbin 34 Xi'an 35 Jiulong 36 Wuhan 37 T'aipei 38 Taiyuan 39 Kaohsiung 40 Fushun 41 Anshan 42 Lanzhou 43 Zhengzhou 44 Nanchang 45 Changsha 46 Hangzhou 47 Kunming 48 Urumqi 49 Qiqihar 50 Tangshan 51 Jilin 52 Xianggang 53 Guiyang 54 Shijiazhuang 55 Baotou 56 Wuxi 57 T'aichung 58 Fuzhou 59 Zibo 60 Handan 61 Xuzhou 62 Benxi 63 Yichun 64 Hefei 65 Luoyang 66 Nanning 67 T'ainan 68 Suzhou 69 Daqing 70 Huainan 71 Hohhot 72 Jinzhou 73 Jixi 74 Fuxin 75 Liuzhou 76 Hengyang 77 Liaoyang 78 Mudanjiang 79 Xining 80 Yingkou 81 Ningbo 82 Zhangjiakou 83 Dandong 84 Changzhou 85 T'aipeihsien 86 Hegang 87 Xiangtan 88 Xiangfan 89 Xinxiang 90 Sha Tin 91 Jiamusi 92 Hunjiang 93 Nantong 94 Tuen Mun 95 Shenzhen 96 Wuhu 97 Pingdingshan 98 Bengbu 99 Zhuzhou 100 Huangshi 101 Panzhihua 102 Yantai 103 Baoji 104 Wenzhou 105 Shuangyashan 106 Xiamen 107 Chungho 108 Jiaozuo 109 Zigong 110 Zhanjiang 111 Chilung 112 Tonghua 113 113 114 114 #UNITS Nation1 115 1, 040, ¥Á§L 116 11, 104, ´åÀ»¶¤ 117 21, 072, ¤pQªO 115 1, 040, 民兵 116 11, 104, 游擊隊 117 21, 072, 小舢板 -
branches/highdpi/Localization/zh-Hant/Tribes/Egyptians.tribe.txt
r123 r465 1 #CHOOSE ®J¤Î2 #n ®J¤Î¤H3 #s ®J¤Î4 #a ®J¤Î1 #CHOOSE 埃及 2 #n 埃及人 3 #s 埃及 4 #a 埃及 5 5 #COLOR 37CFAF 6 6 #SYMBOLS Nation1, 42 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 Ikkur 79 80 81 82 83 84 85 86 87 88 13 Thebes 14 Memphis 15 Heliopolis 16 Elephantine 17 Alexandria 18 Pi-Ramesses 19 Giza 20 Byblos 21 El-Amarna 22 Hieraconpolis 23 Abydos 24 Al-Qaira 25 Asyut 26 Avaris 27 Lisht 28 Buto 29 Edfu 30 Pithom 31 Busiris 32 Kahun 33 Athribis 34 Mendes 35 El-Ashmunein 36 Tenis 37 Naukratis 38 Syene 39 Medinet Habu 40 Buhen 41 Hatnub 42 El-Kharga 43 Qift 44 Quessir 45 Fawakhir 46 Deir El-Medina 47 Fayyum 48 Sais 49 Maidum 50 Abusir 51 Zawyet al-Aryan 52 Saqqara 53 Mazghuma 54 Hawara 55 Saylah 56 Dara 57 Tukh 58 El-Kula 59 Karnak 60 Kom Ombo 61 Phile 62 Rosetta 63 Tjel 64 Edwa 65 Gebel el-Tarif 66 Hipponius 67 Dishasha 68 Kafr Hammar 69 Tarkhan 70 Esna 71 Armant 72 Naga ed-Dair 73 Deir el-Bahari 74 Naqada 75 El-Ballas 76 Tentyra 77 Qaw el-Kebir 78 Ikkur 79 Quban 80 Kumma 81 Semma 82 Uronarti 83 Shalfak 84 Mirgissa 85 Faras 86 Abu Simbel 87 Bir Nakhlai 88 Aniba 89 89 90 90 #UNITS Nation1 91 2, 040, ¥Á§L 92 12, 101, ½b¤â 93 22, 102, ªø¥Ù¤â 91 2, 040, 民兵 92 12, 101, 箭手 93 22, 102, 長矛手 -
branches/highdpi/Localization/zh-Hant/Tribes/French.tribe.txt
r123 r465 1 #CHOOSE ªkÄõ¦è2 #n ªkÄõ¦è¤H3 #s ªk°ê4 #a ªkÄõ¦è1 #CHOOSE 法蘭西 2 #n 法蘭西人 3 #s 法國 4 #a 法蘭西 5 5 #COLOR 576FC7 6 6 #SYMBOLS Nation1, 43 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 Chalon-sur-SaäÝe119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 13 Paris 14 Orleans 15 Lyon 16 Reims 17 Tours 18 Marseille 19 Chartres 20 Avignon 21 Besancon 22 Rouen 23 Grenoble 24 Dijon 25 Amiens 26 Cherbourg 27 Poitiers 28 Toulouse 29 Bayonne 30 Strasbourg 31 Brest 32 Bordeaux 33 Lille 34 Nice 35 Nantes 36 Saint-Etienne 37 Montpellier 38 Rennes 39 Le Havre 40 Toulon 41 Angers 42 Le Mans 43 Clermont-Ferrand 44 Aix-en-Provence 45 Limoges 46 Nimes 47 Villeurbanne 48 Metz 49 Caen 50 Mulhouse 51 Boulogne-Billancourt 52 Perpignan 53 Nancy 54 Roubaix 55 Argenteuil 56 Tourcoing 57 Montreuil 58 Saint-Denis 59 Versailles 60 Nanterre 61 Creteil 62 Aulnay-sous-Bois 63 Pau 64 Vitry-sur-Seine 65 Calais 66 Colombes 67 La Rochelle 68 Asnieres 69 Champigny-sur-Marne 70 Rueil-Malmaison 71 Saint-Maur-des-Fosses 72 Bourges 73 Antibes 74 Dunkerque 75 Courbevoie 76 Beziers 77 Cannes 78 Saint-Nazaire 79 Colmar 80 Villeneuve-d'Ascq 81 Valence 82 Lorient 83 Aubervilliers 84 Drancy 85 Merignac 86 Troyes 87 La Seyne-sur-Mer 88 Quimper 89 Antony 90 Saint-Quentin 91 Neuilly-sur-Seine 92 Noisy-le-Grand 93 Sarcelles 94 Niort 95 Pessac 96 Venissieux 97 Chambery 98 Charleville-Mezieres 99 Beauvais 100 Cergy 101 Levallois-Perret 102 Cholet 103 Issy-les-Moulineaux 104 Montauban 105 Vannes 106 Hyeres 107 Evreux 108 Maisons-Alfort 109 Laval 110 Fontenay-sous-Bois 111 Ivry-sur-Seine 112 Saint-Malo 113 Arles 114 Belfort 115 Annecy 116 Sartrouville 117 Clichy 118 Chalon-sur-Sa鬾e 119 Pantin 120 Chateauroux 121 Meaux 122 La Roche-sur-Yon 123 Blois 124 Brive-la-Gaillarde 125 Evry 126 Clamart 127 Villejuif 128 Chalons-sur-Marne 129 Sevran 130 Le Blanc-Mesnil 131 Bondy 132 Frejus 133 Narbonne 134 Epinay-sur-Seine 135 Tarbes 136 Albi 137 Saint-Brieuc 138 Chelles 139 Boulogne-sur-Mer 140 Bobigny 141 Carcassonne 142 142 143 143 #UNITS StdUnits 144 23, 040, ¥Á§L 144 23, 040, 民兵 145 145 146 146 #UNITS Nation1 147 3, 103, ¤õºj¤â 148 13, 104, °ê¥Á½Ã¶¤ 149 23, 134, ¨BÃM§L 147 3, 103, 火槍手 148 13, 104, 國民衛隊 149 23, 134, 步騎兵 -
branches/highdpi/Localization/zh-Hant/Tribes/Germans.tribe.txt
r123 r465 1 #CHOOSE ¤é¦Õ°Ò2 #n ¤é¦Õ°Ò¤H3 #s ¼w°ê4 #a ¤é¦Õ°Ò1 #CHOOSE 日耳曼 2 #n 日耳曼人 3 #s 德國 4 #a 日耳曼 5 5 #COLOR AFAFAF 6 6 #SYMBOLS Nation1, 44 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 13 Berlin 14 Koln 15 Aachen 16 Frankfurt 17 Trier 18 Regensburg 19 Hamburg 20 Konigsberg 21 Stettin 22 Dortmund 23 Augsburg 24 Munchen 25 Bremen 26 Nurnberg 27 Lubeck 28 Stuttgart 29 Dusseldorf 30 Dresden 31 Hannover 32 Duisburg 33 Leipzig 34 Essen 35 Chemnitz 36 Karlsruhe 37 Munster 38 Bochum 39 Wuppertal 40 Bielefeld 41 Mannheim 42 Bonn 43 Gelsenkirchen 44 Halle 45 Wiesbaden 46 Monchengladbach 47 Braunschweig 48 Krefeld 49 Magdeburg 50 Kiel 51 Oberhausen 52 Rostock 53 Hagen 54 Erfurt 55 Freiburg 56 Kassel 57 Saarbrucken 58 Mainz 59 Hamm 60 Herne 61 Mulheim 62 Osnabruck 63 Ludwigshafen 64 Solingen 65 Leverkusen 66 Oldenburg 67 Neuss 68 Heidelberg 69 Darmstadt 70 Potsdam 71 Paderborn 72 Gottingen 73 Bremerhaven 74 Wurzburg 75 Recklinghausen 76 Wolfsburg 77 Bottrop 78 Heilbronn 79 Remscheid 80 Gera 81 Cottbus 82 Pforzheim 83 Offenbach 84 Ulm 85 Salzgitter 86 Ingolstadt 87 Siegen 88 Schwerin 89 Reutlingen 90 Furth 91 Koblenz 92 Moers 93 Bergisch Gladbach 94 Hildesheim 95 Witten 96 Kaiserslautern 97 Zwickau 98 Erlangen 99 Iserlohn 100 Jena 101 Gutersloh 102 Marl 103 Lunen 104 Velbert 105 Duren 106 Ratingen 107 Esslingen 108 Wilhelmshaven 109 Dessau 110 Hanau 111 Ludwigsburg 112 Flensburg 113 Minden 114 Brandenburg 115 Ludenscheid 116 Neumunster 117 Tubingen 118 Dorsten 119 Villingen-Schwenningen 120 Worms 121 Castrop-Rauxel 122 Gladbeck 123 Arnsberg 124 Delmenhorst 125 Frankfurt/Oder 126 Konstanz 127 Neubrandenburg 128 Viersen 129 Marburg 130 Rheine 131 Detmold 132 Bayreuth 133 Celle 134 Giessen 135 Bocholt 136 Troisdorf 137 Norderstedt 138 Dinslaken 139 Bamberg 140 Herten 141 Neuwied 142 Unna 143 Aschaffenburg 144 Lippstadt 145 Plauen 146 Aalen 147 Luneburg 148 Herford 149 Kempten 150 Grevenbroich 151 Gorlitz 152 Garbsen 153 Stralsund 154 Schwabisch Gmund 155 Kerpen 156 Dormagen 157 Fulda 158 Weimar 159 159 160 160 #UNITS StdUnits 161 20, 040, ¥Á§L 161 20, 040, 民兵 162 162 163 163 #UNITS Nation1 164 4, 105, ¨B§L 165 14, 106, ¬ðÀ»¶¤ 166 24, 300, ºÖ§J¾Ô¤æÉó 164 4, 105, 步兵 165 14, 106, 突擊隊 166 24, 300, 福克戰斗机 -
branches/highdpi/Localization/zh-Hant/Tribes/Greeks.tribe.txt
r123 r465 1 #CHOOSE ¥j§ÆÛK2 #n §ÆÛK¤H3 #s §ÆÛK4 #a §ÆÛK1 #CHOOSE 古希腊 2 #n 希腊人 3 #s 希腊 4 #a 希腊 5 5 #COLOR FF00BF 6 6 #SYMBOLS Nation2, 90 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 13 Athens 14 Sparta 15 Corinth 16 Pharsalos 17 Delphi 18 Knossos 19 Troy 20 Mycenae 21 Argos 22 Thermopylae 23 Herakleia 24 Ephesos 25 Rhodos 26 Eretria 27 Syracuse 28 Thessalonica 29 Marathon 30 Halicarnassos 31 Pergamon 32 Olympia 33 Miletos 34 Artemisium 35 Apollonia 36 Megara 37 Cithera 38 Gythium 39 Sellasia 40 Messene 41 Mothone 42 Pherae 43 Bassae 44 Megalopolis 45 Tegea 46 Mantinea 47 Stymphalus 48 Philus 49 Tiryns 50 Troezen 51 Aegina 52 Halieis 53 Epidaurus 54 Sicyon 55 Cerynia 56 Elis 57 Brauron 58 Colonus 59 Oropus 60 Decelea 61 Tanagra 62 Ascra 63 Haliartus 64 Thebai 65 Orchomenus 66 Naupactus 67 Stratus 68 Actium 69 Histiaea 70 Chalcis 71 Carystus 72 Ambracia 73 Dodona 74 Corcyra 75 Buthrotum 76 Lamia 77 Iolcus 78 Larissa 79 Gonnus 80 Pydna 81 Aegae 82 Beroea 83 Mieza 84 Pella 85 Stobi 86 Edessa 87 Olynthus 88 Potidaea 89 Acanthus 90 Uranopolis 91 Stagirus 92 Amphipolis 93 Thasos 94 Drerus 95 Gortyna 96 Hierapytna 97 Miletus 98 Ephesus 99 Mytilene 100 Atarneus 101 Pergamum 102 Sigeum 103 Sestus 104 Abdera 105 105 106 106 #UNITS Nation2 107 30, 010, ²¾¥ÁªÌ 108 31, 040, ¥Á§L 109 32, 101, «¸Ë¨B§L 110 33, 102, ¤è°}§L 111 34, 131, ÃM§L 112 35, 132, ¾Ô¨® 113 37, 200, ¤T¼Õ¾Ô²î 107 30, 010, 移民者 108 31, 040, 民兵 109 32, 101, 重裝步兵 110 33, 102, 方陣兵 111 34, 131, 騎兵 112 35, 132, 戰車 113 37, 200, 三槳戰船 -
branches/highdpi/Localization/zh-Hant/Tribes/Japanese.tribe.txt
r123 r465 1 #CHOOSE ¤é¥»2 #n ¤é¥»¤H3 #s ¤é¥»4 #a ¤é¥»1 #CHOOSE 日本 2 #n 日本人 3 #s 日本 4 #a 日本 5 5 #COLOR 57AB27 6 6 #SYMBOLS Nation1, 45 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 13 Kyoto 14 Osaka 15 Edo 16 Satsuma 17 Kagoshima 18 Nara 19 Nagoya 20 Izumo 21 Nagasaki 22 Yokohama 23 Shimonoseki 24 Matsuyama 25 Sapporo 26 Hakodate 27 Ise 28 Toyama 29 Fukushima 30 Suo 31 Bizen 32 Echizen 33 Izumi 34 Omi 35 Echigo 36 Kozuke 37 Sado 38 Tokyo 39 Kobe 40 Fukuoka 41 Kawasaki 42 Hiroshima 43 Kitakyushu 44 Sendai 45 Chiba 46 Sakai 47 Kumamoto 48 Okayama 49 Sagamihara 50 Hamamatsu 51 Funabashi 52 Higashiosaka 53 Hachioji 54 Niigata 55 Amagasaki 56 Shizuoka 57 Himeji 58 Matsudo 59 Kanazawa 60 Urawa 61 Kawaguchi 62 Ichikawa 63 Utsunomiya 64 Omiya 65 Yokosuka 66 Oita 67 Kurashiki 68 Gifu 69 Hirakata 70 Toyonaka 71 Wakayama 72 Nishinomiya 73 Fukuyama 74 Fujisawa 75 Takatsuki 76 Asahikawa 77 Machida 78 Iwaki 79 Nagano 80 Toyohashi 81 Suita 82 Toyota 83 Takamatsu 84 Koriyama 85 Kawagoe 86 Okazaki 87 Kochi 88 Tokorozawa 89 Kashiwa 90 Akita 91 Naha 92 Miyazaki 93 Koshigaya 94 Aomori 95 Akashi 96 Morioka 97 Yokkaichi 98 Maebashi 99 Kasugai 100 Ichihara 101 Yao 102 Otsu 103 Tokushima 104 Ichinomiya 105 Kakogawa 106 Neyagawa 107 Ibaraki 108 Fukui 109 Yamagata 110 Hiratsuka 111 Mito 112 Sasebo 113 113 114 114 #UNITS Nation1 115 1, 040, ¥Á§L 116 5, 101, ªZ¤h 117 15, 102, §ÔªÌ 118 25, 300, ¹s¦¡Éó 115 1, 040, 民兵 116 5, 101, 武士 117 15, 102, 忍者 118 25, 300, 零式机 -
branches/highdpi/Localization/zh-Hant/Tribes/Mongols.tribe.txt
r123 r465 1 #CHOOSE »X¥j2 #n »X¥j¤H3 #s »X¥j4 #a »X¥j1 #CHOOSE 蒙古 2 #n 蒙古人 3 #s 蒙古 4 #a 蒙古 5 5 #COLOR 8367B3 6 6 #SYMBOLS Nation2, 91 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 13 Karakorum 14 Shangtu 15 Iske Kazan 16 Ulan-Bator 17 Ulan-Ude 18 Erdenet 19 Darhan 20 Cojbalsan 21 Moron 22 Ulaangom 23 Hovd 24 Uliastaj 25 Bajanhongor 26 Olgij 27 Suhbaatar 28 Arvajheer 29 Cecerleg 30 Sajnsand 31 Altaj 32 Ondorhaan 33 Bulgan 34 Zuunmod 35 Baruun-Urt 36 Dalanzadgad 37 Mandalgovi 38 Zuunharaa 39 Cojr 40 Batshireet 41 Batsumber 42 Berh 43 Dariganga 44 Dasincilen 45 Hanh 46 Har-Ajrag 47 Hagtal 48 Hutag 49 Nalajh 50 Tes 51 Tosontsengel 52 Tsetserleg 53 Tumentsogt 54 54 55 55 #UNITS Nation2 56 40, 010, ²¾¥ÁªÌ 57 41, 040, ¥Á§L 58 42, 102, ½b¤â 59 43, 102, ¤M¤â 60 44, 103, ¤õºj¤â 61 45, 131, °¨¤}¤â 62 46, 132, »X¥jÃM§L 63 47, 200, ¦|²î 56 40, 010, 移民者 57 41, 040, 民兵 58 42, 102, 箭手 59 43, 102, 刀手 60 44, 103, 火槍手 61 45, 131, 馬弓手 62 46, 132, 蒙古騎兵 63 47, 200, 帆船 -
branches/highdpi/Localization/zh-Hant/Tribes/Persians.tribe.txt
r123 r465 1 #CHOOSE ªi´µ2 #n ªi´µ¤H3 #s ªi´µ4 #a ªi´µ1 #CHOOSE 波斯 2 #n 波斯人 3 #s 波斯 4 #a 波斯 5 5 #COLOR EB830B 6 6 #SYMBOLS Nation1, 46 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 13 Persepolis 14 Pasargadae 15 Susa 16 Arbela 17 Bactra 18 Ecbatana 19 Ergili 20 Dariush Kabir 21 Ghulaman 22 Zohak 23 Istakhr 24 Zanjan 25 Borazjan 26 Artacoana 27 Phrada 28 Dakyanus 29 Bampur 30 Tureng Tepe 31 Bukhara 32 Nishapur 33 Tabriz 34 Kabul 35 Ormuz 36 Khorasan 37 Kerman 38 Ctesiphon 39 Hatra 40 Rhagae 41 Hecatompylos 42 Maracanda 43 Tashkent 44 Kyreshata 45 Bisitun 46 Jiruft 47 Darabgird 48 Siraf 49 Gur 50 Shiraz 51 Shushtar 52 Kandahar 53 Tepe Hissar 54 Kashan 55 Anshan 56 Ahvaz 57 Dezful 58 Mohammerah 59 Awan 60 Simash 61 Tepe Sialk 62 62 63 63 #UNITS Nation1 64 6, 040, ¥Á§L 65 16, 101, ªø¥Ù¤â 66 26, 102, Ås¤M¤â 64 6, 040, 民兵 65 16, 101, 長矛手 66 26, 102, 彎刀手 -
branches/highdpi/Localization/zh-Hant/Tribes/Phoenicians.tribe.txt
r123 r465 1 #CHOOSE ÔÚ¥§°ò2 #n ÔÚ¥§°ò¤H3 #s ÔÚ¥§°ò4 #a ÔÚ¥§°ò1 #CHOOSE 婓尼基 2 #n 婓尼基人 3 #s 婓尼基 4 #a 婓尼基 5 5 #COLOR B3FF00 6 6 #SYMBOLS Nation1, 40 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 13 Carthago 14 Byblus 15 Sidon 16 Tyre 17 Berot 18 Tripolis 19 Baalbeck 20 Aradus 21 Joppa 22 Ashkalon 23 Acre 24 Ugarit 25 Simyra 26 Sarafand 27 Gadir 28 Utica 29 Malaca 30 Baria 31 Carmona 32 Sexi 33 Abdera 34 Caralis 35 Panormus 36 Leptis Parva 37 Cartenna 38 Rusicade 39 Rusucurru 40 Girba 41 Leptis Magna 42 Oea 43 Sabratha 44 Carthago Nova 45 Wy't 46 Tinx 47 Rusaddit 48 Theveste 49 Bulla Regia 50 Thugga 51 Hadrumetum 52 Zama Regia 53 Thysdris 54 Madauros 55 Hippou Akra 56 Cirta 57 Cuicul 58 Tipasa 59 Lix 60 Volubilis 61 Ilici 62 Hispalis 63 Eryx 64 Motya 65 Drepanon 66 Lilybaion 67 Icosium 68 Iol 69 Eivissa 70 70 71 71 #UNITS Nation1 72 0, 040, ¥Á§L 73 10, 131, ¶H§L 74 20, 201, ¤p¦|²î 72 0, 040, 民兵 73 10, 131, 象兵 74 20, 201, 小帆船 -
branches/highdpi/Localization/zh-Hant/Tribes/Romans.tribe.txt
r123 r465 1 #CHOOSE ¥jù°¨2 #n ù°¨¤H3 #s ù°¨4 #a ù°¨1 #CHOOSE 古羅馬 2 #n 羅馬人 3 #s 羅馬 4 #a 羅馬 5 5 #COLOR FFFFFF 6 6 #SYMBOLS Nation1, 49 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 13 Roma 14 Ostia 15 Paestum 16 Capua 17 Tarquinia 18 Neapolis 19 Pompeii 20 Ercolanum 21 Alba Longa 22 Aquileia 23 Tarracina 24 Casinum 25 Beneventum 26 Saturnia 27 Clusium 28 Arretium 29 Casilinum 30 Genua 31 Mediolanum 32 Sabatia 33 Asculum 34 Populonia 35 Castrum Novum 36 Fanum Fortunae 37 Venusia 38 Brundisium 39 Canusium 40 Panormus 41 Opitergium 42 Altinum 43 Patavium 44 Regium Lepicum 45 Augusta Taurinorum 46 Cremona 47 Mutina 48 Forum Livi 49 Forum Sempronii 50 Florentia 51 Pisae 52 Reate 53 Amiternum 54 Tarentum 55 Pometia 56 Tusculum 57 Nomentum 58 Lavinium 59 Signia 60 Antium 61 Velitrae 62 Praeneste 63 Aquilonia 64 Bonomia 65 Patavium 66 Volaterrae 67 Vetulonia 68 Potentia 69 Pisaurum 70 Aeclanum 71 Grumentum 72 Liternum 73 Puteoli 74 Fabrateria Nova 75 Sipontum 76 Buxentum 77 Castrum Hannibalis 78 Minervium 79 Augusta Praetoria 80 Brixia 81 Sena Iulia 82 Hispellum 83 83 84 84 #UNITS StdUnits 85 22, 040, ¥Á§L 85 22, 040, 民兵 86 86 87 87 #UNITS Nation1 88 9, 101, ù°¨¨B§L 89 19, 131, ù°¨ÃM§L 90 29, 200, ¦h¼Õ²î 88 9, 101, 羅馬步兵 89 19, 131, 羅馬騎兵 90 29, 200, 多槳船 -
branches/highdpi/Localization/zh-Hant/Tribes/Russians.tribe.txt
r123 r465 1 #CHOOSE «X°ê2 #n «X°ê¤H3 #s «X°ê4 #a «Xù´µ1 #CHOOSE 俄國 2 #n 俄國人 3 #s 俄國 4 #a 俄羅斯 5 5 #COLOR E70000 6 6 #SYMBOLS Nation2, 94 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 13 Moskva 14 Sankt-Peterburg 15 Kiev 16 Minsk 17 Odesa 18 Sverdlovsk 19 Vladivostok 20 Novgorod 21 Kharkov 22 Krasnojarsk 23 Rostov-na-Donu 24 Kursk 25 Samara 26 Magnitogorsk 27 Jaroslavl 28 Novosibirsk 29 Omsk 30 Smolensk 31 Perm 32 Voronezh 33 Sevastopol 34 Ufa 35 Krivoy Rog 36 Niznij Novgorod 37 Chelabinsk 38 Dnipropetrovsk 39 Donetsk 40 Volgograd 41 Voronezh 42 Saratov 43 Zaporizhzhya 44 Lviv 45 Toljatti 46 Simbirsk 47 Izhevsk 48 Krasnodar 49 Chabarovsk 50 Irkutsk 51 Barnaul 52 Novokuzneck 53 Penza 54 Razan 55 Orenburg 56 Lipeck 57 Naberezhnyje Chelny 58 Mykolayiv 59 Tula 60 Gomel 61 Tumen 62 Kemerovo 63 Mariupol 64 Astrachan 65 Tomsk 66 Kirov 67 Ivanovo 68 Luhansk 69 Bransk 70 Cheboksary 71 Tver 72 Nizhnij Tagil 73 Makiyivka 74 Murmansk 75 Mogilev 76 Kurgan 77 Archangelsk 78 Sochi 79 Vitebsk 80 Vinnytsya 81 Orel 82 Stavropol 83 Simferopol 84 Kaluga 85 Vladimir 86 Belgorod 87 Machachkala 88 Kherson 89 Cherepovec 90 Poltava 91 Saransk 92 Tambov 93 Chita 94 Vladikavkaz 95 Grodno 96 Vologda 97 Chernihiv 98 Komsomolsk-na-Amure 99 Cherkasy 100 Sumy 101 Horlivka 102 Volzhskij 103 Kostroma 104 Taganrog 105 Zhytomyr 106 Petrozavodsk 107 Dzerzhinsk 108 Surgut 109 Orsk 110 Angarsk 111 Sterlitamak 112 112 113 113 #UNITS Nation2 114 70, 010, ²¾¥ÁªÌ 115 71, 040, ¥Á§L 116 72, 102, ªø¥Ù¤â 117 73, 104, ¨Bºj¤â 118 74, 133, ôÂħJÃM§L 119 75, 134, »´ÃM§L 120 76, 135, T-34©Z§J 121 77, 301, ¦Ì®æ-29114 70, 010, 移民者 115 71, 040, 民兵 116 72, 102, 長矛手 117 73, 104, 步槍手 118 74, 133, 哥薩克騎兵 119 75, 134, 輕騎兵 120 76, 135, T-34坦克 121 77, 301, 米格-29 -
branches/highdpi/Localization/zh-Hant/Tribes/Spanish.tribe.txt
r123 r465 1 #CHOOSE ¦è¯Z¤ú2 #n ¦è¯Z¤ú¤H3 #s ¦è¯Z¤ú4 #a ¦è¯Z¤ú1 #CHOOSE 西班牙 2 #n 西班牙人 3 #s 西班牙 4 #a 西班牙 5 5 #COLOR FFFF00 6 6 #SYMBOLS Nation1, 47 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 13 Madrid 14 Sevilla 15 Toledo 16 Cordoba 17 Valencia 18 Salamanca 19 Barcelona 20 Valladolid 21 Zaragoza 22 Cadiz 23 Bilbao 24 Granada 25 Malaga 26 Pamplona 27 Vigo 28 Avila 29 Leon 30 Burgos 31 Oviedo 32 Santander 33 Ciudad Rodrigo 34 Calatrava 35 Cartagena 36 Murcia 37 Las Palmas 38 Palma de Mallorca 39 Alicante 40 Gijon 41 L'Hospitalet 42 A Coruna 43 Vitoria-Gasteiz 44 Santa Cruz de Tenerife 45 Badalona 46 Elche 47 Mostoles 48 Sabadell 49 Jerez de la Frontera 50 Donostia-San Sebastian 51 Fuenlabrada 52 Terrassa 53 Leganes 54 Alcala de Henares 55 Almeria 56 Getafe 57 Albacete 58 Alcorcon 59 Castellon de la Plana 60 Huelva 61 Badajoz 62 La Laguna 63 Logrono 64 Santa Coloma de Gramanet 65 Tarragona 66 Lleida 67 Jaen 68 Marbella 69 Ourense 70 Mataro 71 Algeciras 72 Dos Hermanas 73 Torrejon de Ardoz 74 Barakaldo 75 Santiago de Compostela 76 Alcobendas 77 Reus 78 Telde 79 Lugo 80 San Fernando 81 Getxo 82 Aviles 83 Caceres 84 Cornella 85 Palencia 86 Ferrol 87 Sant Boi 88 Coslada 89 Parla 90 Lorca 91 El Puerto de Santa Maria 92 Talavera de la Reina 93 Pontevedra 94 Ceuta 95 Girona 96 Melilla 97 Pozuelo de Alarcon 98 Guadalajara 99 Zamora 100 Torrent 101 Manresa 102 Ponferrada 103 El Prat 104 Chiclana de la Frontera 105 Sanlucar de Barrameda 106 Ciudad Real 107 La Linea de la Concepcion 108 Rubi 109 Alcoy 110 Gandia 111 San Sebastian de los Reyes 112 Las Rozas de Madrid 113 Torrevieja 114 Alcala de Guadaira 115 115 116 116 #UNITS StdUnits 117 22, 040, ¥Á§L 117 22, 040, 民兵 118 118 119 119 #UNITS Nation1 120 7, 103, ¤õºj¤â 121 17, 133, »´ÃM§L 122 27, 201, xÄ¥ 120 7, 103, 火槍手 121 17, 133, 輕騎兵 122 27, 201, 軍艦 -
branches/highdpi/Localization/zh-Hant/Tribes/StdUnits.txt
r123 r465 1 0, 074, ¥£Æ׳Ҥu2 1, 075, ¦Û¥Ñ¥Á²³3 3, 071, ¤p¼ç¸¥4 4, 073, ·Æµ¾Éó5 7, 064, ³æ®é¦|²î6 10, 010, ©Ý¯îªÌ7 11, 011, ¤uµ{®v8 13, 021, ¯SÏú§L9 14, 030, «Ø³]¶¤10 16, 017, «Ø«°¦a11 17, 041, ¦u«°½Ã§L12 20, 100, ÆZ¾Ô¤h13 21, 100, ¤}§L14 22, 100, ÆZ¾Ô¤h15 23, 100, ÆZ¾Ô¤h16 24, 101, ù°¨x¹Î17 25, 101, ªø¥Ù¤â18 26, 101, ¤è°}§L19 27, 101, ½b¤â20 30, 102, ¦u½Ã21 31, 102, ¦u½Ã22 32, 102, ¦u½Ã23 33, 102, ¦u½Ã24 34, 103, ¤õºj¤â25 35, 103, ¤õºj¤â26 36, 103, ¤õºj¤â27 37, 103, ¤õºj¤â28 40, 104, ¨Bºj¤â29 41, 104, ¨Bºj¤â30 42, 104, ¨Bºj¤â31 43, 104, ¨Bºj¤â32 44, 105, ¨B§L33 45, 105, ¨B§L34 46, 105, ¨B§L35 47, 105, ¨B§L36 50, 106, ³°¾Ô¶¤37 51, 106, ³°¾Ô¶¤38 52, 106, ³°¾Ô¶¤39 53, 106, ³°¾Ô¶¤40 54, 110, ¸Ë¥Ò¨B§L41 55, 110, ¸Ë¥Ò¨B§L42 56, 110, ¸Ë¥Ò¨B§L43 57, 110, ¸Ë¥Ò¨B§L44 60, 130, ÃM§L45 61, 130, ÃM§L46 62, 130, ÃM§L47 63, 130, ÃM§L48 64, 131, ÃM§L49 65, 131, ÃM§L50 66, 131, ÃM§L51 67, 131, ÃM§L52 70, 132, ÃM¤h53 71, 132, ÃM¤h54 72, 132, ÃM¤h55 73, 132, ÃM¤h56 74, 133, ÀsÃM§L57 75, 133, ÀsÃM§L58 76, 133, ÀsÃM§L59 77, 133, ÀsÃM§L60 80, 134, »´ÃM§L61 81, 134, »´ÃM§L62 82, 134, »´ÃM§L63 83, 134, »´ÃM§L64 84, 135, ©Z§J65 85, 135, ©Z§J66 86, 135, ©Z§J67 87, 135, ©Z§J68 90, 136, ¸Ë¥Ò¨®69 91, 136, ¸Ë¥Ò¨®70 92, 136, ¸Ë¥Ò¨®71 93, 136, ¸Ë¥Ò¨®72 100, 170, §ë¥Û¨®73 101, 170, §ð«°¶ð74 102, 170, ©¸¬¶75 103, 170, ©¸¬¶76 104, 171, ¥[¹A¬¶77 105, 171, ¥[¹A¬¶78 106, 171, ¥[¹A¬¶79 107, 171, ¥[¹A¬¶80 110, 172, ºh¼u¬¶81 111, 172, ºh¼u¬¶82 112, 172, ºh¼u¬¶83 113, 172, ºh¼u¬¶84 114, 173, ¤õ½b¬¶85 115, 173, ¤õ½b¬¶86 116, 173, ¤õ½b¬¶87 117, 173, ¤õ½b¬¶88 120, 200, ¦|²î89 121, 200, ¦|²î90 122, 200, ¦|²î91 123, 200, ¦|²î92 124, 201, ¤j¦|²î93 125, 201, §Ö³t¦|²î94 126, 201, Å@½ÃÄ¥95 127, 201, Å@½ÃÄ¥96 130, 202 ÅK¥ÒÄ¥97 131, 202, ÅX³vÄ¥98 132, 202, ¨µ¬vÄ¥99 133, 202, ¨µ¬vÄ¥100 134, 203, ¾É¼u¨µ¬vÄ¥101 135, 203, ¾Ô¦CÄ¥102 136, 203, ¾Ô¦C¨µ¬vÄ¥103 137, 203, ¾Ô¦CÄ¥104 140, 210, ¹B¿éÄ¥105 141, 210, ¹B¿éÄ¥106 142, 210, ¹B¿éÄ¥107 143, 210, ¹B¿éÄ¥108 144, 220, ¯è¥À109 145, 220, ¯è¥À110 146, 220, ¯è¥À111 147, 220, ¯è¥À112 150, 240, ¼ç¸¥113 151, 240, ¼ç¸¥114 152, 240, ¼ç¸¥115 153, 240, ¼ç¸¥116 160, 300, ¾Ô¤æÉó117 161, 300, ¾Ô¤æÉó118 162, 300, ¾Ô¤æÉó119 163, 300, ¾Ô¤æÉó120 164, 301, ¼QÉa¾Ô¤æÉó121 165, 301, ¼QÉa¾Ô¤æÉó122 166, 301, ª½¤ÉÉó123 167, 301, ¼QÉa¾Ô¤æÉó124 170, 310, ÅF¬µÉó125 171, 310, ÅF¬µÉó126 172, 310, ¸¸¥127 173, 310, ÅF¬µÉó128 174, 311, ²{¥NÅF¬µÉó129 175, 311, ²{¥NÅF¬µÉó130 176, 311, ²{¥NÅF¬µÉó131 177, 311, ²{¥NÅF¬µÉó1 0, 074, 奴勞工 2 1, 075, 自由民眾 3 3, 071, 小潛艇 4 4, 073, 滑翔机 5 7, 064, 單桅帆船 6 10, 010, 拓荒者 7 11, 011, 工程師 8 13, 021, 特种兵 9 14, 030, 建設隊 10 16, 017, 建城地 11 17, 041, 守城衛兵 12 20, 100, 蠻戰士 13 21, 100, 弓兵 14 22, 100, 蠻戰士 15 23, 100, 蠻戰士 16 24, 101, 羅馬軍團 17 25, 101, 長矛手 18 26, 101, 方陣兵 19 27, 101, 箭手 20 30, 102, 守衛 21 31, 102, 守衛 22 32, 102, 守衛 23 33, 102, 守衛 24 34, 103, 火槍手 25 35, 103, 火槍手 26 36, 103, 火槍手 27 37, 103, 火槍手 28 40, 104, 步槍手 29 41, 104, 步槍手 30 42, 104, 步槍手 31 43, 104, 步槍手 32 44, 105, 步兵 33 45, 105, 步兵 34 46, 105, 步兵 35 47, 105, 步兵 36 50, 106, 陸戰隊 37 51, 106, 陸戰隊 38 52, 106, 陸戰隊 39 53, 106, 陸戰隊 40 54, 110, 裝甲步兵 41 55, 110, 裝甲步兵 42 56, 110, 裝甲步兵 43 57, 110, 裝甲步兵 44 60, 130, 騎兵 45 61, 130, 騎兵 46 62, 130, 騎兵 47 63, 130, 騎兵 48 64, 131, 騎兵 49 65, 131, 騎兵 50 66, 131, 騎兵 51 67, 131, 騎兵 52 70, 132, 騎士 53 71, 132, 騎士 54 72, 132, 騎士 55 73, 132, 騎士 56 74, 133, 龍騎兵 57 75, 133, 龍騎兵 58 76, 133, 龍騎兵 59 77, 133, 龍騎兵 60 80, 134, 輕騎兵 61 81, 134, 輕騎兵 62 82, 134, 輕騎兵 63 83, 134, 輕騎兵 64 84, 135, 坦克 65 85, 135, 坦克 66 86, 135, 坦克 67 87, 135, 坦克 68 90, 136, 裝甲車 69 91, 136, 裝甲車 70 92, 136, 裝甲車 71 93, 136, 裝甲車 72 100, 170, 投石車 73 101, 170, 攻城塔 74 102, 170, 弩炮 75 103, 170, 弩炮 76 104, 171, 加農炮 77 105, 171, 加農炮 78 106, 171, 加農炮 79 107, 171, 加農炮 80 110, 172, 榴彈炮 81 111, 172, 榴彈炮 82 112, 172, 榴彈炮 83 113, 172, 榴彈炮 84 114, 173, 火箭炮 85 115, 173, 火箭炮 86 116, 173, 火箭炮 87 117, 173, 火箭炮 88 120, 200, 帆船 89 121, 200, 帆船 90 122, 200, 帆船 91 123, 200, 帆船 92 124, 201, 大帆船 93 125, 201, 快速帆船 94 126, 201, 護衛艦 95 127, 201, 護衛艦 96 130, 202 鐵甲艦 97 131, 202, 驅逐艦 98 132, 202, 巡洋艦 99 133, 202, 巡洋艦 100 134, 203, 導彈巡洋艦 101 135, 203, 戰列艦 102 136, 203, 戰列巡洋艦 103 137, 203, 戰列艦 104 140, 210, 運輸艦 105 141, 210, 運輸艦 106 142, 210, 運輸艦 107 143, 210, 運輸艦 108 144, 220, 航母 109 145, 220, 航母 110 146, 220, 航母 111 147, 220, 航母 112 150, 240, 潛艇 113 151, 240, 潛艇 114 152, 240, 潛艇 115 153, 240, 潛艇 116 160, 300, 戰斗机 117 161, 300, 戰斗机 118 162, 300, 戰斗机 119 163, 300, 戰斗机 120 164, 301, 噴气戰斗机 121 165, 301, 噴气戰斗机 122 166, 301, 直升机 123 167, 301, 噴气戰斗机 124 170, 310, 轟炸机 125 171, 310, 轟炸机 126 172, 310, 飛艇 127 173, 310, 轟炸机 128 174, 311, 現代轟炸机 129 175, 311, 現代轟炸机 130 176, 311, 現代轟炸机 131 177, 311, 現代轟炸机 -
branches/highdpi/Localization/zh-Hant/Tribes/Vikings.tribe.txt
r123 r465 1 #CHOOSE ºû¨Ê2 #n ºû¨Ê¤H3 #s ºû¨Ê4 #a ºû¨Ê1 #CHOOSE 維京 2 #n 維京人 3 #s 維京 4 #a 維京 5 5 #COLOR 9FBB8B 6 6 #SYMBOLS Nation2, 93 … … 11 11 12 12 #CITIES 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 13 Trondheim 14 Kaupang 15 Uppsala 16 Hladir 17 Arhus 18 Viborg 19 Roskilde 20 The Udal 21 Lindholm 22 Jorvik 23 Westness 24 Skara 25 Ravning Enge 26 Birka 27 Jarlshof 28 Sigtuna 29 Odense 30 Lund 31 Larne 32 Hedeby 33 Aldeigjuborg 34 Nonnebakken 35 Stockholm 36 Oslo 37 Kobenhavn 38 Goteborg 39 Malmo 40 Bergen 41 Aalborg 42 Linkoping 43 Vasteras 44 Orebro 45 Norrkopping 46 Helsingborg 47 Jonkoping 48 Reykjavik 49 Stavanger 50 Umea 51 Baerum 52 Boras 53 Sundsvall 54 Gavle 55 Frederiksberg 56 Eskilstuna 57 Halmstad 58 Huddinge 59 Esbjerg 60 Karlstad 61 Sodertalje 62 Nacka 63 Kristianstad 64 Vaxjo 65 Botkyrka 66 Skelleftea 67 Lulea 68 Kristiansand 69 Haninge 70 Gentofte 71 Fredrikstad 72 Kungsbacka 73 Randers 74 Gladsakse 75 Kolding 76 Karlskrona 77 Jarfalla 78 Taby 79 Kalmar 80 Helsingor 81 Ostersund 82 Tromso 83 Sollentuna 84 Herning 85 Gotland 86 Solna 87 Horsens 88 Molndal 89 Ornskoldsvik 90 Falun 91 Drammen 92 Vejle 93 Trollhattan 94 Varberg 95 Norrtalje 96 Silkeborg 97 Sandnes 98 Lyngby-Tarbaek 99 Skien 100 Skovde 101 Hvidovre 102 Nykoping 103 Uddevalla 104 Hassleholm 105 Asker 106 Fredericia 107 Greve 108 Borlange 109 Sarpsborg 110 Naestved 111 Hoje Tastrup 112 Ballerup 113 Svendborg 114 Lillehammer 115 Kopavogur 116 Hafnarfjordur 117 Akureyri 118 Godthab 119 Holsteinsborg 120 120 121 121 #UNITS Nation2 122 60, 010, ²¾¥ÁªÌ 123 61, 040, ¥Á§L 124 62, 101, ªø¥Ù¤â 125 63, 101, ÆZ¾Ô¤h 126 64, 102, ½b¤â 127 65, 102, ¼C¤h 128 66, 102, ¼C¤h 129 67, 133, ·ÃM§L 122 60, 010, 移民者 123 61, 040, 民兵 124 62, 101, 長矛手 125 63, 101, 蠻戰士 126 64, 102, 箭手 127 65, 102, 劍士 128 66, 102, 劍士 129 67, 133, 風騎兵 -
branches/highdpi/Log.pas
r412 r465 5 5 6 6 uses 7 UDpiControls, LCLIntf, LCLType, LMessages,Messages, SysUtils, Classes, Graphics, Controls, Forms,7 UDpiControls, LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, 8 8 StdCtrls, Menus; 9 9 … … 27 27 procedure mClearClick(Sender: TObject); 28 28 procedure mSlotClick(Sender: TObject); 29 procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);29 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 30 30 procedure Toggle(Sender: TObject); 31 31 procedure ListMouseDown(Sender: TObject; Button: TMouseButton; 32 32 Shift: TShiftState; X, Y: Integer); 33 procedure FormKeyUp(Sender: TObject; var Key: word; Shift: TShiftState);33 procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 34 34 public 35 35 Host: TDpiForm; 36 procedure Add(Level, Turn: Integer; Text: pchar);36 procedure Add(Level, Turn: Integer; Text: PChar); 37 37 private 38 38 MaxLevel: Integer; … … 61 61 begin 62 62 MaxLevel := TDpiMenuItem(Sender).Tag; 63 TDpiMenuItem(Sender).Checked := true;63 TDpiMenuItem(Sender).Checked := True; 64 64 end; 65 65 66 procedure TLogDlg.Add(Level, Turn: Integer; Text: pchar);66 procedure TLogDlg.Add(Level, Turn: Integer; Text: PChar); 67 67 begin 68 68 if (MaxLevel > 0) and (Level <= MaxLevel) or (Level = 1 shl 16 + 1) and … … 89 89 var 90 90 X, Y: Integer; 91 s: string;91 S: string; 92 92 begin 93 93 for Y := 0 to 2 do 94 94 begin 95 s:= '| ';95 S := '| '; 96 96 for X := 0 to 2 do 97 97 if G.Difficulty[SlotNo[Y, X]] = 0 then 98 s := s+ 'SUP |'98 S := S + 'SUP |' 99 99 else if G.Difficulty[SlotNo[Y, X]] < 0 then 100 s := s+ '--- |'100 S := S + '--- |' 101 101 else 102 102 begin … … 104 104 begin // check multi control 105 105 if G.Difficulty[SlotNo[Y, X] + 3] >= 0 then 106 s := s+ Tribe[SlotNo[Y, X] + 3].TPhrase('SHORTNAME') + '+';106 S := S + Tribe[SlotNo[Y, X] + 3].TPhrase('SHORTNAME') + '+'; 107 107 if G.Difficulty[SlotNo[Y, X] + 6] >= 0 then 108 s := s+ Tribe[SlotNo[Y, X] + 6].TPhrase('SHORTNAME') + '+';108 S := S + Tribe[SlotNo[Y, X] + 6].TPhrase('SHORTNAME') + '+'; 109 109 end; 110 s := s+ Tribe[SlotNo[Y, X]].TPhrase('SHORTNAME') + ' | ';110 S := S + Tribe[SlotNo[Y, X]].TPhrase('SHORTNAME') + ' | '; 111 111 end; 112 List.Lines.Add( s)112 List.Lines.Add(S); 113 113 end; 114 114 PostMessage(List.Handle, WM_VSCROLL, SB_BOTTOM, 0); 115 115 end; 116 116 117 procedure TLogDlg.FormKeyDown(Sender: TObject; var Key: word;117 procedure TLogDlg.FormKeyDown(Sender: TObject; var Key: Word; 118 118 Shift: TShiftState); 119 119 begin … … 134 134 end; 135 135 136 procedure TLogDlg.FormKeyUp(Sender: TObject; var Key: word; Shift: TShiftState);136 procedure TLogDlg.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 137 137 begin 138 138 if Host <> nil then -
branches/highdpi/Messg.pas
r361 r465 53 53 procedure TMessgDlg.FormShow(Sender: TObject); 54 54 begin 55 Button1.Visible := true;55 Button1.Visible := True; 56 56 Button2.Visible := not(Kind in [mkOK]); 57 57 if Button2.Visible then … … 70 70 end; 71 71 72 SplitText( true);72 SplitText(True); 73 73 CorrectHeight; 74 74 end; -
branches/highdpi/MiniMap.pas
r464 r465 1 1 {$INCLUDE Switches.inc} 2 unit UMiniMap;2 unit MiniMap; 3 3 4 4 interface … … 37 37 38 38 uses 39 ScreenTools, UPixelPointer, Global, GameServer, IsoEngine, Tribes;39 ScreenTools, PixelPointer, Global, GameServer, IsoEngine, Tribes; 40 40 41 41 const … … 162 162 procedure TMiniMap.PaintRandom(Brightness, StartLandMass: Integer; WorldSize: TPoint); 163 163 var 164 i, x, y, xm, cm: Integer; 164 i, x, y, xm: Integer; 165 cm: Int64; 165 166 MiniPixel: TPixelPointer; 166 167 Map: ^TTileList; … … 172 173 Bitmap.SetSize(Size.X * 2, Size.Y); 173 174 Bitmap.BeginUpdate; 174 MiniPixel := PixelPointer(Bitmap);175 MiniPixel := TPixelPointer.Create(Bitmap); 175 176 for y := 0 to ScaleToNative(Size.Y) - 1 do begin 176 177 for x := 0 to ScaleToNative(Size.X) - 1 do begin … … 193 194 procedure TMiniMap.PaintFile(SaveMap: TMapArray); 194 195 var 195 i, x, y, xm, cm, Tile, OwnColor, EnemyColor: integer; 196 cm: Int64; 197 i, x, y, xm, Tile, OwnColor, EnemyColor: integer; 196 198 MiniPixel: TPixelPointer; 197 199 PrevMiniPixel: TPixelPointer; … … 203 205 if Mode = mmPicture then begin 204 206 Bitmap.BeginUpdate; 205 MiniPixel := PixelPointer(Bitmap);206 PrevMiniPixel := PixelPointer(Bitmap, 0, -1);207 MiniPixel := TPixelPointer.Create(Bitmap); 208 PrevMiniPixel := TPixelPointer.Create(Bitmap, 0, -1); 207 209 for y := 0 to ScaleToNative(Size.Y) - 1 do begin 208 210 for x := 0 to ScaleToNative(Size.X) - 1 do begin … … 211 213 MiniPixel.SetX(xm); 212 214 Tile := SaveMap[ScaleFromNative(x) + Size.X * ScaleFromNative(y)]; 215 if Tile > 11 then Tile := fUnknown; 213 216 if Tile and fTerrain = fUNKNOWN then 214 217 cm := $000000 … … 264 267 Bitmap.SetSize(Size.X * 2, Size.Y); 265 268 Bitmap.BeginUpdate; 266 MiniPixel := PixelPointer(Bitmap);267 PrevMiniPixel := PixelPointer(Bitmap, 0, -1);269 MiniPixel := TPixelPointer.Create(Bitmap); 270 PrevMiniPixel := TPixelPointer.Create(Bitmap, 0, -1); 268 271 for y := 0 to ScaleToNative(Size.Y) - 1 do begin 269 272 for x := 0 to ScaleToNative(Size.X) - 1 do begin … … 328 331 end; 329 332 330 331 333 end. 332 334 335 336 -
branches/highdpi/Network/NetworkClient.pas
r464 r465 1 unit UNetworkClient; 2 3 {$mode delphi} 1 unit NetworkClient; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils{$IFDEF LINUX}, fpAsync, fpsock{$ENDIF}, Protocol;6 Classes, SysUtils{$IFDEF UNIX}, fpAsync, fpsock{$ENDIF}, Protocol; 9 7 10 {$IFDEF LINUX}8 {$IFDEF UNIX} 11 9 type 12 10 { TTCPClientThread } … … 48 46 49 47 uses 50 LocalPlayer{$IFDEF LINUX}, Global, UNetworkCommon{$ENDIF};48 LocalPlayer{$IFDEF UNIX}, Global, NetworkCommon{$ENDIF}; 51 49 52 50 procedure Client(Command, Player: Integer; var Data); 53 {$IFDEF LINUX}51 {$IFDEF UNIX} 54 52 var 55 53 Cmd: TCommand; 56 54 {$ENDIF} 57 55 begin 58 {$IFDEF LINUX}56 {$IFDEF UNIX} 59 57 Cmd := TCommand(Command); 60 58 case Cmd of … … 73 71 end; 74 72 75 {$IFDEF LINUX}73 {$IFDEF UNIX} 76 74 function LocalServer(Command, Player, Subject: Integer; var Data): Integer; stdcall; 77 75 begin … … 178 176 end. 179 177 178 -
branches/highdpi/Network/NetworkCommon.pas
r464 r465 1 unit UNetworkCommon; 2 3 {$mode delphi} 1 unit NetworkCommon; 4 2 5 3 interface … … 10 8 procedure StreamAppend(Stream: TStream; SourceStream: TStream); 11 9 procedure StreamRemoveRead(Stream: TMemoryStream); 10 12 11 13 12 implementation … … 45 44 end. 46 45 46 -
branches/highdpi/Network/NetworkServer.pas
r464 r465 1 unit UNetworkServer; 2 3 {$mode delphi} 1 unit NetworkServer; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils{$IFDEF LINUX}, fgl, fpAsync, fpsock, fphttpclient{$ENDIF}, Protocol; 9 10 {$IFDEF LINUX} 6 Classes, SysUtils{$IFDEF UNIX}, Generics.Collections, fpAsync, fpsock, 7 fphttpclient{$ENDIF}, Protocol; 8 9 {$IFDEF UNIX} 11 10 type 12 11 TNetworkServer = class; … … 57 56 { TNetworkServerPlayers } 58 57 59 TNetworkServerPlayers = class(T FPGObjectList<TNetworkServerPlayer>)58 TNetworkServerPlayers = class(TObjectList<TNetworkServerPlayer>) 60 59 function SearchById(Id: Integer): TNetworkServerPlayer; 61 60 end; … … 66 65 private 67 66 Players: TNetworkServerPlayers; 68 Connections: T FPGObjectList<TNetworkServerConnection>;67 Connections: TObjectList<TNetworkServerConnection>; 69 68 TCPServerThread: TTCPServerThread; 70 69 ServerEventLoop: TEventLoop; 71 70 procedure ConnectExecute(Sender: TConnectionBasedSocket; AStream: TSocketStream); 72 procedure Client(Command: TCommand; Player: integer; var Data);71 procedure Client(Command: TCommand; Player: Integer; var Data); 73 72 public 74 73 TCPServer: TTCPServer; … … 82 81 {$ENDIF} 83 82 84 procedure Client(Command, Player: integer; var Data); stdcall;83 procedure Client(Command, Player: Integer; var Data); stdcall; 85 84 86 85 87 86 implementation 88 87 89 {$IFDEF LINUX}88 {$IFDEF UNIX} 90 89 uses 91 Global, UNetworkCommon;90 Global, NetworkCommon; 92 91 {$ENDIF} 93 92 94 procedure Client(Command, Player: integer; var Data);95 begin 96 {$IFDEF LINUX}93 procedure Client(Command, Player: Integer; var Data); 94 begin 95 {$IFDEF UNIX} 97 96 if not Assigned(NetworkServer) then begin 98 97 NetworkServer := TNetworkServer.Create; … … 107 106 end; 108 107 109 {$IFDEF LINUX}108 {$IFDEF UNIX} 110 109 111 110 { TNetworkServerPlayers } … … 304 303 Players := TNetworkServerPlayers.Create; 305 304 ServerEventLoop := TEventLoop.Create; 306 Connections := T FPGObjectList<TNetworkServerConnection>.Create;305 Connections := TObjectList<TNetworkServerConnection>.Create; 307 306 TCPServer := TTCPServer.Create(nil); 308 307 with TCPServer do begin … … 339 338 end. 340 339 340 -
branches/highdpi/NoTerm.pas
r378 r465 18 18 procedure FormPaint(Sender: TObject); 19 19 procedure FormCreate(Sender: TObject); 20 procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);20 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 21 21 public 22 procedure Client(Command, Player: integer; var Data);22 procedure Client(Command, Player: Integer; var Data); 23 23 private 24 24 Me: Integer; … … 43 43 procedure NewStat; 44 44 procedure EndPlaying; 45 procedure ShowActive( p: integer; Active: boolean);45 procedure ShowActive(P: Integer; Active: Boolean); 46 46 procedure ShowYear; 47 47 end; … … 50 50 NoTermDlg: TNoTermDlg; 51 51 52 procedure Client(Command, Player: integer; var Data); stdcall; 52 procedure Client(Command, Player: Integer; var Data); stdcall; 53 53 54 54 55 implementation 55 56 56 57 uses 57 GameServer, log;58 GameServer, Log; 58 59 59 60 {$R *.lfm} … … 68 69 dxBrain = 128; 69 70 dyBrain = 128; 70 xBrain: array [0 .. nPlOffered - 1] of integer = (x0Brain, x0Brain,71 xBrain: array [0 .. nPlOffered - 1] of Integer = (x0Brain, x0Brain, 71 72 x0Brain + dxBrain, x0Brain + dxBrain, x0Brain + dxBrain, x0Brain, 72 73 x0Brain - dxBrain, x0Brain - dxBrain, x0Brain - dxBrain); 73 yBrain: array [0 .. nPlOffered - 1] of integer = (y0Brain, y0Brain - dyBrain,74 yBrain: array [0 .. nPlOffered - 1] of Integer = (y0Brain, y0Brain - dyBrain, 74 75 y0Brain - dyBrain, y0Brain, y0Brain + dyBrain, y0Brain + dyBrain, 75 76 y0Brain + dyBrain, y0Brain, y0Brain - dyBrain); 76 xActive: array [0 .. nPlOffered - 1] of integer = (0, 0, 36, 51, 36, 0,77 xActive: array [0 .. nPlOffered - 1] of Integer = (0, 0, 36, 51, 36, 0, 77 78 -36, -51, -36); 78 yActive: array [0 .. nPlOffered - 1] of integer = (0, -51, -36, 0, 36, 51,79 yActive: array [0 .. nPlOffered - 1] of Integer = (0, -51, -36, 0, 36, 51, 79 80 36, 0, -36); 80 81 81 82 var 82 FormsCreated: boolean;83 FormsCreated: Boolean; 83 84 84 85 procedure TNoTermDlg.FormCreate(Sender: TObject); … … 107 108 procedure TNoTermDlg.EndPlaying; 108 109 var 109 EndCommand: integer;110 EndCommand: Integer; 110 111 begin 111 112 NewStat; 112 if G.RO[ me].Turn > 0 then113 if G.RO[Me].Turn > 0 then 113 114 with MessgDlg do 114 115 begin … … 123 124 else 124 125 EndCommand := sResign; 125 Server(EndCommand, me, 0, nil^)126 end; 127 128 procedure TNoTermDlg.ShowActive( p: integer; Active: boolean);129 begin 130 if p< nPlOffered then131 Sprite(Canvas, HGrSystem, x0Brain + 28 + xActive[ p],132 y0Brain + 28 + yActive[ p], 8, 8, 81 + 9 * Byte(Active), 16);126 Server(EndCommand, Me, 0, nil^); 127 end; 128 129 procedure TNoTermDlg.ShowActive(P: Integer; Active: Boolean); 130 begin 131 if P < nPlOffered then 132 Sprite(Canvas, HGrSystem, x0Brain + 28 + xActive[P], 133 y0Brain + 28 + yActive[P], 8, 8, 81 + 9 * Byte(Active), 16); 133 134 end; 134 135 … … 137 138 Fill(State.Canvas, 0, 0, 192, 20, 64, 287 + 138); 138 139 RisedTextOut(State.Canvas, 0, 0, Format(Phrases.Lookup('AIT_ROUND'), [Round]) 139 + ' ' + TurnToString(G.RO[ me].Turn));140 DpiBit Canvas(Canvas, 64, 287 + 138, 192, 20, State.Canvas, 0, 0);141 end; 142 143 procedure TNoTermDlg.Client(Command, Player: integer; var Data);144 var 145 i, x, y, p: integer;146 ActiveDuration: extended;147 ShipComplete: boolean;148 r: TRect;140 + ' ' + TurnToString(G.RO[Me].Turn)); 141 DpiBitBltCanvas(Canvas, 64, 287 + 138, 192, 20, State.Canvas, 0, 0); 142 end; 143 144 procedure TNoTermDlg.Client(Command, Player: Integer; var Data); 145 var 146 I, X, Y, P: Integer; 147 ActiveDuration: Extended; 148 ShipComplete: Boolean; 149 R: TRect; 149 150 nowt: TDateTime; 150 151 begin 151 152 case Command of 152 153 cDebugMessage: 153 LogDlg.Add(Player, G.RO[0].Turn, pchar(@Data));154 LogDlg.Add(Player, G.RO[0].Turn, PChar(@Data)); 154 155 155 156 cInitModule: … … 159 160 Shade := TDpiBitmap.Create; 160 161 Shade.SetSize(64, 64); 161 for x:= 0 to 63 do162 for y:= 0 to 63 do163 if Odd( x + y) then164 Shade.Canvas.Pixels[ x, y] := $FFFFFF162 for X := 0 to 63 do 163 for Y := 0 to 63 do 164 if Odd(X + Y) then 165 Shade.Canvas.Pixels[X, Y] := $FFFFFF 165 166 else 166 Shade.Canvas.Pixels[ x, y] := $000000;167 Shade.Canvas.Pixels[X, Y] := $000000; 167 168 State := TDpiBitmap.Create; 168 169 State.SetSize(192, 20); … … 180 181 cNewGame, cLoadGame: 181 182 begin 182 inc(Round);183 Inc(Round); 183 184 if Mode = rmRunning then 184 185 begin … … 189 190 Show; 190 191 G := TNewGameData(Data); 191 LogDlg.mSlot.Visible := false;192 LogDlg.mSlot.Visible := False; 192 193 LogDlg.Host := nil; 193 ToldAlive := G.RO[ me].Alive;194 ToldAlive := G.RO[Me].Alive; 194 195 Active := -1; 195 196 FillChar(DisallowShowActive, SizeOf(DisallowShowActive), 0); // false … … 212 213 cTurn, cResume, cContinue: 213 214 begin 214 me := Player;215 Me := Player; 215 216 if Active >= 0 then 216 217 begin 217 ShowActive(Active, false);218 ShowActive(Active, False); 218 219 Active := -1; 219 220 end; // should not happen … … 227 228 TurnTime := SecondOf(nowt - LastNewTurn); 228 229 LastNewTurn := nowt; 229 if (G.RO[ me].Alive <> ToldAlive) then230 begin 231 for p:= 1 to nPlOffered - 1 do232 if 1 shl p and (G.RO[me].Alive xor ToldAlive) <> 0 then230 if (G.RO[Me].Alive <> ToldAlive) then 231 begin 232 for P := 1 to nPlOffered - 1 do 233 if 1 shl P and (G.RO[Me].Alive xor ToldAlive) <> 0 then 233 234 begin 234 r := Rect(xBrain[p], yBrain[p] - 16, xBrain[p] + 64,235 yBrain[ p] - 16 + 64);236 InvalidateRect(Handle, @ r, false);235 R := Rect(xBrain[P], yBrain[P] - 16, xBrain[P] + 64, 236 yBrain[P] - 16 + 64); 237 InvalidateRect(Handle, @R, False); 237 238 end; 238 ToldAlive := G.RO[ me].Alive;239 ToldAlive := G.RO[Me].Alive; 239 240 end; 240 241 DpiApplication.ProcessMessages; 241 242 if Mode = rmQuit then 242 243 EndPlaying 243 else if G.RO[ me].Happened and phGameEnd <> 0 then244 else if G.RO[Me].Happened and phGameEnd <> 0 then 244 245 begin // game ended, update statistics 245 for p:= 1 to nPlOffered - 1 do246 if Assigned(PlayersBrain[ p]) then247 if 1 shl p and G.RO[me].Alive = 0 then248 inc(ExtStat[p]) // extinct249 else if G.RO[ me].Alive = 1 shl pthen250 inc(AloneStat[p]) // only player alive246 for P := 1 to nPlOffered - 1 do 247 if Assigned(PlayersBrain[P]) then 248 if 1 shl P and G.RO[Me].Alive = 0 then 249 Inc(ExtStat[P]) // extinct 250 else if G.RO[Me].Alive = 1 shl P then 251 Inc(AloneStat[P]) // only player alive 251 252 else 252 253 begin // alive but not alone -- check colony ship 253 ShipComplete := true;254 for i:= 0 to nShipPart - 1 do255 if G.RO[ me].Ship[p].Parts[i] < ShipNeed[i] then256 ShipComplete := false;254 ShipComplete := True; 255 for I := 0 to nShipPart - 1 do 256 if G.RO[Me].Ship[P].Parts[I] < ShipNeed[I] then 257 ShipComplete := False; 257 258 if ShipComplete then 258 inc(WinStat[p]);259 Inc(WinStat[P]); 259 260 end; 260 261 if Mode = rmRunning then 261 Server(sNextRound, me, 0, nil^);262 Server(sNextRound, Me, 0, nil^); 262 263 end 263 264 else if Mode = rmRunning then 264 Server(sTurn, me, 0, nil^);265 Server(sTurn, Me, 0, nil^); 265 266 if Mode = rmStop then 266 267 begin … … 279 280 TotalStatTime := TotalStatTime + ActiveDuration; 280 281 if not DisallowShowActive[Active] then 281 ShowActive(Active, false);282 ShowActive(Active, False); 282 283 DisallowShowActive[Active] := (ActiveDuration < TurnTime * 0.25) and 283 284 (ActiveDuration < ShowActiveThreshold); … … 285 286 LastShowTurnChange := nowt; 286 287 287 Active := integer(Data);288 Active := Integer(Data); 288 289 if (Active >= 0) and not DisallowShowActive[Active] then 289 ShowActive(Active, true);290 ShowActive(Active, True); 290 291 end; 291 292 end; … … 301 302 GoBtn.ButtonIndex := 23; 302 303 GoBtn.Update; 303 Server(sTurn, me, 0, nil^);304 Server(sTurn, Me, 0, nil^); 304 305 end; 305 306 end; … … 313 314 procedure TNoTermDlg.FormPaint(Sender: TObject); 314 315 var 315 i, TimeShare: integer;316 I, TimeShare: Integer; 316 317 begin 317 318 Fill(Canvas, 3, 3, ClientWidth - 6, ClientHeight - 6, 0, 0); … … 329 330 7, Caption); 330 331 Canvas.Font.Assign(UniFont[ftSmall]); 331 for i:= 1 to nPlOffered - 1 do332 if Assigned(PlayersBrain[ i]) then332 for I := 1 to nPlOffered - 1 do 333 if Assigned(PlayersBrain[I]) then 333 334 begin 334 Frame(Canvas, xBrain[ i] - 24, yBrain[i] - 8 - 16, xBrain[i] - 24 + 111,335 yBrain[ i] - 8 - 16 + 111, MainTexture.ColorBevelShade,335 Frame(Canvas, xBrain[I] - 24, yBrain[I] - 8 - 16, xBrain[I] - 24 + 111, 336 yBrain[I] - 8 - 16 + 111, MainTexture.ColorBevelShade, 336 337 MainTexture.ColorBevelShade); 337 FrameImage(Canvas, PlayersBrain[ i].Picture, xBrain[i],338 yBrain[ i] - 16, 64, 64, 0, 0);339 if 1 shl i and G.RO[me].Alive = 0 then340 DpiBit Canvas(Canvas, xBrain[i], yBrain[i] - 16, 64, 64,338 FrameImage(Canvas, PlayersBrain[I].Picture, xBrain[I], 339 yBrain[I] - 16, 64, 64, 0, 0); 340 if 1 shl I and G.RO[Me].Alive = 0 then 341 DpiBitBltCanvas(Canvas, xBrain[I], yBrain[I] - 16, 64, 64, 341 342 Shade.Canvas, 0, 0, SRCAND); 342 Sprite(Canvas, HGrSystem, xBrain[ i] + 30 - 14, yBrain[i] + 53, 14,343 Sprite(Canvas, HGrSystem, xBrain[I] + 30 - 14, yBrain[I] + 53, 14, 343 344 14, 1, 316); 344 RisedTextOut(Canvas, xBrain[ i] + 30 - 16 - BiColorTextWidth(Canvas,345 IntToStr(WinStat[ i])), yBrain[i] + 51, IntToStr(WinStat[i]));346 Sprite(Canvas, HGrSystem, xBrain[ i] + 34, yBrain[i] + 53, 14, 14,345 RisedTextOut(Canvas, xBrain[I] + 30 - 16 - BiColorTextWidth(Canvas, 346 IntToStr(WinStat[I])), yBrain[I] + 51, IntToStr(WinStat[I])); 347 Sprite(Canvas, HGrSystem, xBrain[I] + 34, yBrain[I] + 53, 14, 14, 347 348 1 + 15, 316); 348 RisedTextOut(Canvas, xBrain[ i] + 34 + 16, yBrain[i] + 51,349 IntToStr(AloneStat[ i]));350 Sprite(Canvas, HGrSystem, xBrain[ i] + 30 - 14, yBrain[i] + 53 + 16, 14,349 RisedTextOut(Canvas, xBrain[I] + 34 + 16, yBrain[I] + 51, 350 IntToStr(AloneStat[I])); 351 Sprite(Canvas, HGrSystem, xBrain[I] + 30 - 14, yBrain[I] + 53 + 16, 14, 351 352 14, 1 + 30, 316); 352 RisedTextOut(Canvas, xBrain[ i] + 30 - 16 - BiColorTextWidth(Canvas,353 IntToStr(ExtStat[ i])), yBrain[i] + 51 + 16, IntToStr(ExtStat[i]));354 Sprite(Canvas, HGrSystem, xBrain[ i] + 34, yBrain[i] + 53 + 16, 14, 14,353 RisedTextOut(Canvas, xBrain[I] + 30 - 16 - BiColorTextWidth(Canvas, 354 IntToStr(ExtStat[I])), yBrain[I] + 51 + 16, IntToStr(ExtStat[I])); 355 Sprite(Canvas, HGrSystem, xBrain[I] + 34, yBrain[I] + 53 + 16, 14, 14, 355 356 1 + 45, 316); 356 357 if TotalStatTime > 0 then 357 358 begin 358 TimeShare := trunc(TimeStat[ i] / TotalStatTime * 100 + 0.5);359 RisedTextOut(Canvas, xBrain[ i] + 34 + 16, yBrain[i] + 51 + 16,359 TimeShare := trunc(TimeStat[I] / TotalStatTime * 100 + 0.5); 360 RisedTextOut(Canvas, xBrain[I] + 34 + 16, yBrain[I] + 51 + 16, 360 361 IntToStr(TimeShare) + '%'); 361 362 end; 362 ShowActive( i, i= Active);363 ShowActive(I, I = Active); 363 364 end; 364 365 Sprite(Canvas, HGrSystem2, x0Brain + 32 - 20, y0Brain + 32 - 20, 40, … … 370 371 end; 371 372 372 procedure Client(Command, Player: integer; var Data);373 procedure Client(Command, Player: Integer; var Data); 373 374 begin 374 375 if not FormsCreated then 375 376 begin 376 FormsCreated := true;377 FormsCreated := True; 377 378 DpiApplication.CreateForm(TNoTermDlg, NoTermDlg); 378 379 end; … … 380 381 end; 381 382 382 procedure TNoTermDlg.FormKeyDown(Sender: TObject; var Key: word;383 procedure TNoTermDlg.FormKeyDown(Sender: TObject; var Key: Word; 383 384 Shift: TShiftState); 384 385 begin -
branches/highdpi/Packages/DpiControls/DpiControls.lpk
r265 r465 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <CONFIG> 3 <Package Version=" 4">3 <Package Version="5"> 4 4 <Name Value="DpiControls"/> 5 5 <Type Value="RunAndDesignTime"/> … … 10 10 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-${BuildMode}"/> 11 11 </SearchPaths> 12 <Parsing> 13 <SyntaxOptions> 14 <SyntaxMode Value="Delphi"/> 15 </SyntaxOptions> 16 </Parsing> 12 17 </CompilerOptions> 13 18 <Description Value="Controls with dimensions independent to screen DPI setting. The controls use internally VCL controls. All positions and sizes are scaled from DPI independent values."/> … … 25 30 </Item2> 26 31 </Files> 32 <CompatibilityMode Value="True"/> 27 33 <RequiredPkgs Count="3"> 28 34 <Item1> -
branches/highdpi/Packages/DpiControls/UDpiControls.pas
r463 r465 1 1 unit UDpiControls; 2 3 {$mode objfpc}{$H+}4 2 5 3 interface … … 7 5 uses 8 6 {$IFDEF WINDOWS}Windows, {$ENDIF}Classes, SysUtils, LCLProc, LResources, Forms, 9 FormEditingIntf, ProjectIntf, Controls, StdCtrls, fgl, Graphics, ComCtrls,10 ExtCtrls, LCLType, GraphType, Types, CustApp, LMessages, LCLIntf, Menus, Math,11 UPixelPointer2, Grids, Spin;7 Generics.Collections, FormEditingIntf, ProjectIntf, Controls, StdCtrls, Graphics, 8 ComCtrls, ExtCtrls, LCLType, GraphType, Types, CustApp, LMessages, LCLIntf, 9 Menus, Math, UPixelPointer2, Grids, Spin; 12 10 13 11 const 14 FixedDpi = -1;12 FixedDpi = 192; 15 13 16 14 type … … 89 87 procedure SetName(AValue: string); 90 88 procedure SetNativeFont(AValue: TFont); 91 procedure SetOnChange(AValue: TNotifyEvent);92 89 procedure SetPixelsPerInch(AValue: Integer); 93 90 procedure SetSize(AValue: Integer); … … 114 111 property PixelsPerInch: Integer read GetPixelsPerInch write SetPixelsPerInch; 115 112 property Height: Integer read GetHeight write SetHeight default 0; 116 property OnChange: TNotifyEvent read FOnChange write SetOnChange;113 property OnChange: TNotifyEvent read FOnChange write FOnChange; 117 114 end; 118 115 … … 189 186 procedure SetFont(AValue: TDpiFont); 190 187 procedure SetHint(AValue: string); 191 procedure SetOnChangeBounds(AValue: TNotifyEvent);192 188 procedure SetOnClick(AValue: TNotifyEvent); 193 189 procedure SetOnDblClick(AValue: TNotifyEvent); 194 procedure SetOnResize(AValue: TNotifyEvent);195 190 procedure SetParentFont(AValue: Boolean); 196 191 procedure SetShowHint(AValue: Boolean); … … 275 270 property Constraints: TDpiSizeConstraints read FConstraints write FConstraints; 276 271 property Cursor: TCursor read GetCursor write SetCursor default crDefault; 277 property OnResize: TNotifyEvent read FOnResize write SetOnResize;278 property OnChangeBounds: TNotifyEvent read FOnChangeBounds write SetOnChangeBounds;272 property OnResize: TNotifyEvent read FOnResize write FOnResize; 273 property OnChangeBounds: TNotifyEvent read FOnChangeBounds write FOnChangeBounds; 279 274 property OnClick: TNotifyEvent read GetOnClick write SetOnClick; 280 275 property OnDblClick: TNotifyEvent read GetOnDblClick write SetOnDblClick; … … 285 280 end; 286 281 287 TDpiControls = specialize TFPGObjectList<TDpiControl>;282 TDpiControls = TObjectList<TDpiControl>; 288 283 289 284 { TDpiControlBorderSpacing } … … 446 441 public 447 442 property NativeCanvas: TCanvas read FNativeCanvas write SetNativeCanvas; 448 procedure RoundRect(const Rect: TRect; RX, RY: Integer); 443 procedure RoundRect(const Rect: TRect; RX, RY: Integer); overload; 449 444 procedure RoundRect(X1, Y1, X2, Y2: Integer; RX,RY: Integer); overload; virtual; 450 445 procedure Polygon(const Points: array of TPoint; Winding: Boolean; 451 StartIndex: Integer = 0; NumPts: Integer = -1); 452 procedure Polygon(Points: PPoint; NumPts: Integer; Winding: Boolean = False); virtual; 453 procedure Polygon(const Points: array of TPoint); 446 StartIndex: Integer = 0; NumPts: Integer = -1); overload; 447 procedure Polygon(Points: PPoint; NumPts: Integer; Winding: Boolean = False); virtual; overload; 448 procedure Polygon(const Points: array of TPoint); overload; 454 449 procedure PolyBezier(const Points: array of TPoint; 455 Filled: Boolean = False; Continuous: boolean = True); 450 Filled: Boolean = False; Continuous: boolean = True); overload; 456 451 procedure PolyBezier(Points: PPoint; NumPts: Integer; 457 Filled: Boolean = False; Continuous: Boolean = True); virtual; 458 procedure Polyline(const Points: array of TPoint); 459 procedure Polyline(Points: PPoint; NumPts: Integer); virtual; 460 procedure Ellipse(x1, y1, x2, y2: Integer); virtual; 461 procedure Ellipse(const ARect: TRect); virtual; 462 procedure StretchDraw(const DestRect: TRect; SrcGraphic: TGraphic); virtual; 452 Filled: Boolean = False; Continuous: Boolean = True); virtual; overload; 453 procedure Polyline(const Points: array of TPoint); overload; 454 procedure Polyline(Points: PPoint; NumPts: Integer); virtual; overload; 455 procedure Ellipse(x1, y1, x2, y2: Integer); virtual; overload; 456 procedure Ellipse(const ARect: TRect); virtual; overload; 457 procedure StretchDraw(const DestRect: TRect; SrcGraphic: TGraphic); virtual; overload; 458 procedure StretchDraw(const DestRect: TRect; SrcGraphic: TDpiGraphic); virtual; overload; 463 459 procedure Pie(EllipseX1, EllipseY1, EllipseX2, EllipseY2, 464 460 StartX, StartY, EndX, EndY: Integer); virtual; 465 procedure StretchDraw(const DestRect: TRect; SrcGraphic: TDpiGraphic); virtual;466 461 procedure FrameRect(Rect: TRect); 467 462 procedure Rectangle(X1, Y1, X2, Y2: Integer); overload; … … 475 470 procedure LineTo(X, Y: Integer); 476 471 procedure Line(const p1, p2: TPoint); 477 procedure FillRect(const ARect: TRect); virtual; 478 procedure FillRect(X1, Y1, X2, Y2: Integer); 472 procedure FillRect(const ARect: TRect); virtual; overload; 473 procedure FillRect(X1, Y1, X2, Y2: Integer); overload; 479 474 procedure Draw(X, Y: Integer; Source: TDpiGraphic); 480 475 procedure CopyRect(Dest: TRect; SrcCanvas: TDpiCanvas; Source: TRect); … … 708 703 end; 709 704 710 TDpiForms = specialize TFPGObjectList<TDpiForm>;705 TDpiForms = TObjectList<TDpiForm>; 711 706 712 707 { TDpiEdit } … … 1242 1237 procedure UpdateScreen; 1243 1238 procedure UpdateActiveFormFromNativeScreen; 1244 function DisableForms(SkipForm: TDpiForm; DisabledList: TList = nil):TList;1245 procedure EnableForms(var AFormList: TList);1239 function DisableForms(SkipForm: TDpiForm; DisabledList: Classes.TList = nil): Classes.TList; 1240 procedure EnableForms(var AFormList: Classes.TList); 1246 1241 property FormCount: Integer read GetFormCount; 1247 1242 property Forms[Index: Integer]: TDpiForm read GetForms; … … 1419 1414 public 1420 1415 NativePopupMenu: TPopupMenu; 1421 procedure PopUp; 1422 procedure PopUp(X, Y: Integer); virtual; 1416 procedure PopUp; overload; 1417 procedure PopUp(X, Y: Integer); virtual; overload; 1423 1418 constructor Create(AOwner: TComponent); override; 1424 1419 destructor Destroy; override; … … 2310 2305 if not Assigned(NativeListView) then begin 2311 2306 NativeListView := TListView.Create(nil); 2312 NativeListView.OnCustomDrawItem := @DoCustomDrawItem;2307 NativeListView.OnCustomDrawItem := DoCustomDrawItem; 2313 2308 end; 2314 2309 Result := NativeListView; … … 2781 2776 NativeMenuItem := TMenuItem.Create(nil); 2782 2777 NativeMenuItem.Name := 'Native' + Name; 2783 NativeMenuItem.OnClick := @OnClickHandler;2778 NativeMenuItem.OnClick := OnClickHandler; 2784 2779 end; 2785 2780 Result := NativeMenuItem; … … 3084 3079 begin 3085 3080 if (FMainForm = nil) 3086 and (FCreatingForm =AForm)3081 and (FCreatingForm = AForm) 3087 3082 //and (not (AppDestroying in FFlags)) 3088 3083 and not (AForm.FormStyle in [fsMDIChild, fsSplash]) … … 3096 3091 var 3097 3092 Instance: TComponent; 3098 ok: Boolean;3093 Ok: Boolean; 3099 3094 AForm: TDpiForm; 3100 3095 begin … … 3105 3100 TComponent(Reference) := Instance; 3106 3101 3107 ok := False;3102 Ok := False; 3108 3103 try 3109 3104 if (FCreatingForm = nil) and (Instance is TDpiForm) then 3110 3105 FCreatingForm := TDpiForm(Instance); 3111 3106 Instance.Create(Self); 3112 ok := true;3107 Ok := true; 3113 3108 finally 3114 if not ok then begin3109 if not Ok then begin 3115 3110 TComponent(Reference) := nil; 3116 3111 if FCreatingForm = Instance then … … 4103 4098 begin 4104 4099 inherited; 4105 TGraphicControlEx(GetNativeGraphicControl).OnPaint := @PaintHandler;4100 TGraphicControlEx(GetNativeGraphicControl).OnPaint := PaintHandler; 4106 4101 end; 4107 4102 … … 4196 4191 begin 4197 4192 Result := NativeFont; 4198 end;4199 4200 procedure TDpiFont.SetOnChange(AValue: TNotifyEvent);4201 begin4202 if FOnChange = AValue then Exit;4203 FOnChange := AValue;4204 4193 end; 4205 4194 … … 4409 4398 begin 4410 4399 inherited; 4411 GetNativeWinControl.OnKeyDown := @KeyDownHandler;4400 GetNativeWinControl.OnKeyDown := KeyDownHandler; 4412 4401 end; 4413 4402 … … 4448 4437 begin 4449 4438 Controls := TDpiControls.Create; 4450 Controls. FreeObjects := False;4439 Controls.OwnsObjects := False; 4451 4440 inherited; 4452 4441 end; … … 4557 4546 end; 4558 4547 4559 function TDpiScreen.DisableForms(SkipForm: TDpiForm; DisabledList: TList4560 ): TList;4548 function TDpiScreen.DisableForms(SkipForm: TDpiForm; DisabledList: Classes.TList 4549 ): Classes.TList; 4561 4550 begin 4562 4551 Result := Screen.DisableForms(SkipForm.GetNativeForm, DisabledList); 4563 4552 end; 4564 4553 4565 procedure TDpiScreen.EnableForms(var AFormList: TList);4554 procedure TDpiScreen.EnableForms(var AFormList: Classes.TList); 4566 4555 begin 4567 4556 Screen.EnableForms(AFormList); … … 4571 4560 begin 4572 4561 FForms := TDpiForms.Create; 4573 FForms. FreeObjects := False;4562 FForms.OwnsObjects := False; 4574 4563 FPrevActiveForms := TDpiForms.Create; 4575 FPrevActiveForms. FreeObjects := False;4564 FPrevActiveForms.OwnsObjects := False; 4576 4565 // Screen.PixelsPerInch is not initialized at this point 4577 4566 Dpi := 96; … … 4651 4640 begin 4652 4641 Font.NativeFont := GetNativeControl.Font; 4653 GetNativeControl.OnResize := @NativeFormResize;4654 GetNativeControl.OnChangeBounds := @NativeChangeBounds;4655 TControlEx(GetNativeControl).OnMouseDown := @MouseDownHandler;4656 TControlEx(GetNativeControl).OnMouseUp := @MouseUpHandler;4657 TControlEx(GetNativeControl).OnMouseMove := @MouseMoveHandler;4658 TControlEx(GetNativeControl).OnMouseEnter := @MouseEnterHandler;4659 TControlEx(GetNativeControl).OnMouseLeave := @MouseLeaveHandler;4660 TControlEx(GetNativeControl).OnMouseWheel := @MouseWheelHandler;4642 GetNativeControl.OnResize := NativeFormResize; 4643 GetNativeControl.OnChangeBounds := NativeChangeBounds; 4644 TControlEx(GetNativeControl).OnMouseDown := MouseDownHandler; 4645 TControlEx(GetNativeControl).OnMouseUp := MouseUpHandler; 4646 TControlEx(GetNativeControl).OnMouseMove := MouseMoveHandler; 4647 TControlEx(GetNativeControl).OnMouseEnter := MouseEnterHandler; 4648 TControlEx(GetNativeControl).OnMouseLeave := MouseLeaveHandler; 4649 TControlEx(GetNativeControl).OnMouseWheel := MouseWheelHandler; 4661 4650 end; 4662 4651 … … 4830 4819 inherited; 4831 4820 FFont := TDpiFont.Create; 4832 FFont.OnChange := @FontChanged;4821 FFont.OnChange := FontChanged; 4833 4822 FConstraints := TDpiSizeConstraints.Create; 4834 4823 if Assigned(TheOwner) and (TheOwner is TDpiWinControl) then … … 5031 5020 end; 5032 5021 5033 procedure TDpiControl.SetOnChangeBounds(AValue: TNotifyEvent);5034 begin5035 if FOnChangeBounds = AValue then Exit;5036 FOnChangeBounds := AValue;5037 end;5038 5039 5022 procedure TDpiControl.SetOnClick(AValue: TNotifyEvent); 5040 5023 begin … … 5045 5028 begin 5046 5029 TControlEx(GetNativeControl).OnDblClick := AValue; 5047 end;5048 5049 procedure TDpiControl.SetOnResize(AValue: TNotifyEvent);5050 begin5051 if FOnResize = AValue then Exit;5052 FOnResize := AValue;5053 5030 end; 5054 5031 … … 5411 5388 if not Assigned(NativeForm) then begin 5412 5389 NativeForm := TFormEx.CreateNew(nil); 5413 (NativeForm as TFormEx).OnMessage := @FormMessageHandler;5390 (NativeForm as TFormEx).OnMessage := FormMessageHandler; 5414 5391 //NativeForm := TForm.Create(nil); 5415 5392 end; … … 5420 5397 begin 5421 5398 inherited; 5422 GetNativeForm.OnActivate := @ActivateHandler;5423 GetNativeForm.OnDeactivate := @DeactivateHandler;5424 GetNativeForm.OnClose := @CloseHandler;5425 GetNativeForm.OnCloseQuery := @CloseQueryHandler;5399 GetNativeForm.OnActivate := ActivateHandler; 5400 GetNativeForm.OnDeactivate := DeactivateHandler; 5401 GetNativeForm.OnClose := CloseHandler; 5402 GetNativeForm.OnCloseQuery := CloseQueryHandler; 5426 5403 GetNativeForm.Name := Name + 'Native'; 5427 5404 end; -
branches/highdpi/Packages/DpiControls/UPixelPointer2.pas
r265 r465 1 1 unit UPixelPointer2; 2 3 {$mode delphi}{$H+}4 2 5 3 interface -
branches/highdpi/Platform.pas
r303 r465 1 1 unit Platform; 2 3 {$mode delphi}{$H+}4 2 5 3 interface 6 4 7 5 uses 8 {$IFDEF W indows}Windows,{$ENDIF}9 {$IFDEF Linux}Unix,{$ENDIF}6 {$IFDEF WINDOWS}Windows,{$ENDIF} 7 {$IFDEF UNIX}Unix,{$ENDIF} 10 8 Classes, SysUtils, DateUtils, SyncObjs; 11 9 12 10 function NowPrecise: TDateTime; 13 11 12 14 13 implementation 15 14 16 {$IFDEF W indows}15 {$IFDEF WINDOWS} 17 16 var 18 17 PerformanceFrequency: Int64; … … 24 23 function NowPrecise: TDateTime; 25 24 var 26 {$IFDEF Linux}T: TimeVal;{$ENDIF}27 {$IFDEF W indows}TimerValue: Int64;{$ENDIF}25 {$IFDEF UNIX}T: TimeVal;{$ENDIF} 26 {$IFDEF WINDOWS}TimerValue: Int64;{$ENDIF} 28 27 begin 29 28 // Result := Now; 30 29 //try 31 30 //NowPreciseLock.Acquire; 32 {$IFDEF W indows}31 {$IFDEF WINDOWS} 33 32 QueryPerformanceCounter(TimerValue); 34 33 //Result := Int64(TimeStampToMSecs(DateTimeToTimeStamp(Now)) * 1000) // an alternative Win32 timebase … … 36 35 {$ENDIF} 37 36 38 {$IFDEF Linux}37 {$IFDEF UNIX} 39 38 fpgettimeofday(@t, nil); 40 39 // Build a 64 bit microsecond tick from the seconds and microsecond longints … … 51 50 initialization 52 51 53 {$IFDEF W indows}52 {$IFDEF WINDOWS} 54 53 QueryPerformanceFrequency(PerformanceFrequency); 55 54 {$ENDIF} … … 62 61 end. 63 62 63 -
branches/highdpi/Protocol.pas
r378 r465 18 18 ExpCost = 50; { received damage required for next experience level } 19 19 MaxFutureTech = 25; 20 // maximum number of future techs of one kind except computing technology20 // Maximum number of future techs of one kind except computing technology 21 21 MaxFutureTech_Computing = 100; 22 // maximum number of computing technology future techs22 // Maximum number of computing technology future techs 23 23 CountryRadius = 9; 24 24 MaxCitySize = 30; … … 36 36 CancelTreatyTurns = 3; 37 37 PeaceEvaTurns = 5; 38 // should be less then 2*CancelTreatyTurns, so that you can't attack an ally without re-entering38 // Should be less then 2*CancelTreatyTurns, so that you can't attack an ally without re-entering 39 39 ColdWarTurns = 40; 40 40 DesertThurst = 20; // damage for turn in desert … … 49 49 InitialCredibility = 95; 50 50 51 // aimodule flags (for TInitModuleData.Flags)51 // AI module flags (for TInitModuleData.Flags) 52 52 aiThreaded = $01; 53 53 54 // difficulty settings54 // Difficulty settings 55 55 MaxDiff = 4; { maximum difficulty level } 56 56 StorageSize: array [1 .. MaxDiff] of Integer = (30, 40, 50, 60); … … 59 59 BuildCostMod: array [1 .. MaxDiff] of Integer = (9, 12, 15, 18); // in 1/12 60 60 61 // test flags61 // Test flags 62 62 nTestFlags = 7; // max. 11 63 63 tfAllTechs = $001; { all nations get all techs } … … 70 70 tfTested = $800; // at least one test flag was set 71 71 72 { server commands72 { Server commands 73 73 IMPORTANT: lowest 4 bits must indicate size in DWORDS of data parameter, 74 74 except for request commands } … … 191 191 sSetCityTiles = $7201; 192 192 193 // free command space193 // Free command space 194 194 sctUnused = $3800; 195 195 196 { client commands }196 { Client commands } 197 197 cInitModule = $0000; 198 198 cReleaseModule = $0100; … … 241 241 cRefreshDebugMap = $3F90; 242 242 243 // diplomacy commands equal to server, see below243 // Diplomacy commands equal to server, see below 244 244 245 245 cDebugMessage = $7000; 246 246 cShowNego = $7010; 247 247 248 // commands same for server and client248 // Commands same for server and client 249 249 scContact = $4900; // + concerned player shl 4 for server call 250 250 scReject = $4A00; … … 256 256 scDipBreak = $4BF0; 257 257 258 { server return codes: flags }258 { Server return codes: flags } 259 259 rExecuted = $40000000; 260 260 rEffective = $20000000; … … 262 262 rEnemySpotted = $08000000; 263 263 264 { server return codes: command executed }265 // note: the same return code might have a different meaning for different server functions!264 { Server return codes: command executed } 265 // Note: the same return code might have a different meaning for different server functions! 266 266 eOK = $60000000; // ok 267 267 eEnemySpotted = $68000000; // unit move ok, new enemy unit/city spotted 268 268 eDied = $70000000; // move executed, unit died due to hostile terrain 269 269 eEnemySpotted_Died = $78000000; 270 // unit move ok, new enemy unit/city spotted, unit died due to hostile terrain270 // Unit move ok, new enemy unit/city spotted, unit died due to hostile terrain 271 271 eLoaded = $60000002; // unit move caused loading to transport ship 272 272 eLost = $70000004; // attack executed, battle lost, unit is dead … … 276 276 eExpelled = $60000007; // friendly unit expelled 277 277 eMissionDone = $70000008; 278 // spy moved into city: mission done, spy no longer exists278 // Spy moved into city: mission done, spy no longer exists 279 279 eJobDone = $60000001; // settler job started and already done 280 280 eJobDone_Died = $70000001; 281 // settler job started and already done, unit died due to hostile terrain281 // Settler job started and already done, unit died due to hostile terrain 282 282 eCity = $70000002; // city founded, settler no more exists 283 283 eRemoved = $70000000; // sRemoveUnit: unit removed … … 285 285 286 286 eNotChanged = $40000000; 287 // ok, but no effect (e.g. current city project set again)288 289 { server return codes: command not executed }287 // Ok, but no effect (e.g. current city project set again) 288 289 { Server return codes: command not executed } 290 290 eHiddenUnit = $20000013; 291 // unit move: not possible, destination tile occupied by hidden foreign submarine291 // Unit move: not possible, destination tile occupied by hidden foreign submarine 292 292 eStealthUnit = $2000001A; 293 // unit move: not possible, destination tile occupied by foreign stealth unit293 // Unit move: not possible, destination tile occupied by foreign stealth unit 294 294 eZOC_EnemySpotted = $28000014; 295 // unit move: not possible, new enemy unit spotted, ZOC violation295 // Unit move: not possible, new enemy unit spotted, ZOC violation 296 296 297 297 eInvalid = $0000; // command not allowed now or parameter out of allowed range … … 308 308 309 309 eDomainMismatch = $0011; 310 // move/attack: action not allowed for this unit domain310 // Move/attack: action not allowed for this unit domain 311 311 eNoCapturer = $0012; 312 // unit move: this type of unit is not allowed to capture a city312 // Unit move: this type of unit is not allowed to capture a city 313 313 eZOC = $0014; // unit move: not possible, ZOC violation 314 314 eTreaty = $0015; // move/attack: not possible, peace treaty violation … … 320 320 321 321 eMaxSize = $0020; 322 // add to city: bigger size not allowed due to missing aqueduct/sewer322 // Add to city: bigger size not allowed due to missing aqueduct/sewer 323 323 eNoCityTerrain = $0022; // found city: not possible in this terrain 324 324 eNoBridgeBuilding = $0023; … … 332 332 eNoWorkerAvailable = $0051; 333 333 eOnlyOnce = $0058; 334 // sell/rebuild city improvement: only once per city and turn!334 // Sell/rebuild city improvement: only once per city and turn! 335 335 eObsolete = $0059; // city project: more advanced improvement already exists 336 336 eOutOfControl = $005A; 337 // buy/sell/rebuild improvement: not in anarchy, not in captured cities337 // Buy/sell/rebuild improvement: not in anarchy, not in captured cities 338 338 339 339 eNoWay = $0100; // sGetMoveAdvice: no way found 340 340 341 // chart types341 // Chart types 342 342 nStat = 6; 343 343 stPop = 0; … … 348 348 stWork = 5; 349 349 350 { tile flags: terrain type }350 { Tile flags: terrain type } 351 351 fTerrain = $1F; // mask for terrain type 352 352 fOcean = $00; … … 363 363 fUNKNOWN = fTerrain; 364 364 365 { tile flags: terrain improvements }365 { Tile flags: terrain improvements } 366 366 fTerImp = $0000F000; // mask for terrain improvement 367 367 tiNone = $00000000; … … 372 372 tiBase = $00005000; 373 373 374 { tile flags: add ons }374 { Tile flags: add ons } 375 375 fSpecial = $00000060; 376 376 fSpecial1 = $00000020; … … 378 378 fRiver = $00000080; 379 379 fRoad = $00000100; 380 fRR = $00000200; 380 fRR = $00000200; // railroad 381 381 fCanal = $00000400; 382 382 fPoll = $00000800; … … 389 389 fMercury = $06000000; 390 390 391 { tile flags: redundant helper info }391 { Tile flags: redundant helper info } 392 392 fGrWall = $00010000; // tile protected by great wall 393 393 fSpiedOut = $00020000; … … 400 400 fOwnZoCUnit = $10000000; // own ZoC unit present at this tile 401 401 fInEnemyZoC = $20000000; 402 // tile is adjacent to known foreign ZoC unit (not allied)402 // Tile is adjacent to known foreign ZoC unit (not allied) 403 403 fPeace = $40000000; 404 404 // tile belongs to territory of nation that we are in peace with but not allied 405 405 406 // city project flags406 // City project flags 407 407 cpIndex = $1FF; 408 408 cpConscripts = $200; // produce unit as conscripts 409 409 cpDisbandCity = $400; 410 // allow to disband city when settlers/conscripts are produced410 // Allow to disband city when settlers/conscripts are produced 411 411 cpImp = $800; // 0: index refers to model, 1: index refers to city improvement 412 412 cpRepeat = $1000; … … 414 414 cpAuto = $F000; // for internal use only 415 415 416 // tech status indicators416 // Tech status indicators 417 417 tsNA = -2; 418 418 tsSeen = -1; … … 422 422 tsApplicable = tsResearched; 423 423 424 // nation treaties424 // Nation treaties 425 425 trNoContact = -1; 426 426 trNone = 0; … … 429 429 trAlliance = 4; 430 430 431 // attitudes431 // Attitudes 432 432 nAttitude = 7; 433 433 atHostile = 0; … … 439 439 atEnth = 6; 440 440 441 // offer prices441 // Offer prices 442 442 opChoose = $00000000; 443 443 opCivilReport = $11000000; // + turn + concerned player shl 16 … … 455 455 opMask = $FF000000; 456 456 457 // improvement kinds457 // Improvement kinds 458 458 ikTrGoods = 0; 459 459 ikCommon = 1; … … 464 464 ikNA = $7F; 465 465 466 { model domains }466 { Model domains } 467 467 nDomains = 3; 468 468 dGround = 0; … … 470 470 dAir = 2; 471 471 472 { model kinds }472 { Model kinds } 473 473 mkSelfDeveloped = $00; 474 474 mkEnemyDeveloped = $01; … … 483 483 mkFreight = $24; 484 484 485 { unit flags }485 { Unit flags } 486 486 unFortified = $01; 487 487 unBombsLoaded = $02; … … 491 491 unMulti = $80; 492 492 493 // unit report flags493 // Unit report flags 494 494 urfAlwaysSupport = $01; 495 495 urfDeployed = $02; 496 496 497 // unit moves497 // Unit moves 498 498 umCapturing = $0100; 499 499 umSpyMission = $0200; … … 505 505 umPlaneUnloading = $8000; 506 506 507 { model flags }507 { Model flags } 508 508 mdZOC = $01; 509 509 mdCivil = $02; 510 510 mdDoubleSupport = $04; 511 511 512 { player happened flags }512 { Player happened flags } 513 513 phTech = $01; 514 514 phStealTech = $02; … … 523 523 phGameEnd = $F000; 524 524 525 { city happened flags }525 { City happened flags } 526 526 chDisorder = $01; 527 527 chProduction = $02; … … 541 541 chImprovementSold = $80000000; 542 542 543 { city info flags }543 { City info flags } 544 544 ciCapital = $01; 545 545 ciWalled = $02; … … 549 549 ciSpacePort = $20; 550 550 551 { city tile available values }551 { City tile available values } 552 552 faAvailable = 0; 553 553 faNotAvailable = 1; … … 556 556 faInvalid = $FF; 557 557 558 // battle history flags558 // Battle history flags 559 559 bhEnemyAttack = $01; 560 560 bhMyUnitLost = $02; 561 561 bhEnemyUnitLost = $04; 562 562 563 { move advice special destinations }563 { Move advice special destinations } 564 564 maNextCity = -1; 565 565 566 { goverment forms }566 { Goverment forms } 567 567 nGov = 8; 568 568 gAnarchy = 0; … … 575 575 gFuture = 7; 576 576 577 // ship change reasons577 // Ship change reasons 578 578 scrProduction = 0; 579 579 scrDestruction = 1; … … 581 581 scrCapture = 3; 582 582 583 { unit jobs }583 { Unit jobs } 584 584 nJob = 15; 585 585 jNone = 0; … … 599 599 jCity = 14; 600 600 601 // job preconditions are:601 // Job preconditions are: 602 602 // technology JobPreq is available, no city, plus the following: 603 603 // jRoad: no river when bridge building unavailable … … 614 614 // jCity, jFort, jBase: none 615 615 616 // spy mission616 // Spy mission 617 617 nSpyMission = 5; 618 618 smSabotageProd = 0; … … 622 622 smStealMilReport = 4; 623 623 624 // resource weights624 // Resource weights 625 625 rwOff = $00000000; 626 626 rwMaxGrowth = $3F514141; // 120*F + 1/8*P + 1/16*T + 1/16*S … … 630 630 rwForceScience = $F1010101; // F^1/2 * (1*P + 1*T + 1*S) 631 631 632 { advances }632 { Advances } 633 633 adAdvancedFlight = 0; 634 634 adAmphibiousWarfare = 1; … … 731 731 adMilitary = $800; // Military Research 732 732 733 { wonders }733 { Wonders } 734 734 woPyramids = 00; 735 735 woZeus = 01; … … 752 752 woMir = 20; 753 753 754 { city improvements }754 { City improvements } 755 755 imTrGoods = 28; 756 756 imBarracks = 29; … … 801 801 // in 1/2*city size 802 802 803 // special prerequisite values803 // Special prerequisite values 804 804 preNone = -1; 805 805 preLighthouse = -2; … … 813 813 adExplosives, adConstruction, preNone, adMedicine, preNone, preNone); 814 814 815 AdvPreq: array [0 .. nAdv - 1, 0 .. 2] of Integer = { advance prerequisites }815 AdvPreq: array [0 .. nAdv - 1, 0 .. 2] of Integer = { Advance prerequisites } 816 816 ((adFlight, adRobotics, preNone), // adAdvancedFlight 817 817 (adNavigation, adTactics, preNone), // adAmphibiousWarfare … … 910 910 (adSmartWeapons, preNone, preNone)); // futMissileTechnology 911 911 912 Imp: array [0 .. nImp - 1] of // city improvements912 Imp: array [0 .. nImp - 1] of // City improvements 913 913 record 914 914 Kind: Integer; … … 916 916 Cost: Integer; 917 917 Maint: Integer; 918 Expiration: integer;918 Expiration: Integer; 919 919 end 920 920 = ((Kind: ikWonder; Preq: adMathematics; Cost: 400; Maint: 0; … … 1019 1019 (NewImp: imMilAcademy; OldImp: imBarracks)); 1020 1020 1021 // colony ship1021 // Colony ship 1022 1022 nShipPart = 3; 1023 1023 spComp = 0; … … 1099 1099 TradeRes: (0, 0, 7); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))); { Mou } 1100 1100 1101 // settler work required MP1101 // Settler work required MP 1102 1102 PillageWork = 100; 1103 1103 CityWork = 900; … … 1112 1112 PollWork = 1800; 1113 1113 1114 // upgrades for new unit models1114 // Upgrades for new unit models 1115 1115 // upgrade[domain,0].preq is domain precondition advance 1116 1116 // cost values accumulate if prerequisite is future tech / are maximized if not 1117 1117 nUpgrade = 15; 1118 upgrade: array [0 .. nDomains - 1, 0 ..nUpgrade - 1] of record1118 Upgrade: array [0..nDomains - 1, 0..nUpgrade - 1] of record 1119 1119 Preq: Integer; 1120 1120 Strength: Integer; 1121 1121 Trans: Integer; 1122 Cost: integer;1122 Cost: Integer; 1123 1123 end 1124 1124 = (((Preq: adWarriorCode; Strength: 4; Trans: 0; Cost: 3), … … 1168 1168 (Preq: preNA; Strength: 0; Trans: 0; Cost: 0))); 1169 1169 1170 { model features }1170 { Model features } 1171 1171 nFeature = 27; 1172 1172 mcWeapons = 0; … … 1200 1200 AutoFeature: set of mcFirstNonCap .. nFeature - 1 = [mcNav, mcSE, mcNP, mcJet, 1201 1201 mcAcademy]; 1202 // unit class advances, automatically applied if available1203 1204 Feature: array [0 .. nFeature - 1] of { unit model features }1202 // Unit class advances, automatically applied if available 1203 1204 Feature: array [0 .. nFeature - 1] of { Unit model features } 1205 1205 record 1206 1206 Domains: Integer; … … 1243 1243 INFIN = 999999; 1244 1244 1245 // for backward compatibility1245 // For backward compatibility 1246 1246 fRare = fDeadLands; 1247 1247 fRare1 = fCobalt; … … 1322 1322 cmRefreshDebugMap = $3F90, 1323 1323 1324 // diplomacy commands equal to server, see below1324 // Diplomacy commands equal to server, see below 1325 1325 1326 1326 cmDebugMessage = $7000, … … 1385 1385 Cost: Word; 1386 1386 MStrength: Word; 1387 // construction time multipliers, only valid if kind is mkSelfDeveloped or mkEnemyDeveloped1387 // Construction time multipliers, only valid if kind is mkSelfDeveloped or mkEnemyDeveloped 1388 1388 MTrans: Byte; 1389 1389 MCost: Byte; 1390 1390 Weight: Byte; 1391 1391 MaxWeight: Byte; 1392 // weight and maximum weight (construction time)1392 // Weight and maximum weight (construction time) 1393 1393 Upgrades: Cardinal; // bitarray indicating all upgrades 1394 1394 Flags: Cardinal; … … 1525 1525 TCityReportNew = record 1526 1526 HypoTiles: Integer; 1527 // tiles that should be considered as exploited (for the current adjustment, set this to -1 or to TCity.Tiles of the city)1527 // Tiles that should be considered as exploited (for the current adjustment, set this to -1 or to TCity.Tiles of the city) 1528 1528 HypoTaxRate: Integer; 1529 1529 HypoLuxuryRate: Integer; 1530 // tax and luxury rate that should be assumed (for current rates, set this to -1 or to RO.TaxRate resp. RO.LuxRate)1530 // Tax and luxury rate that should be assumed (for current rates, set this to -1 or to RO.TaxRate resp. RO.LuxRate) 1531 1531 Morale: Integer; 1532 1532 FoodSupport: Integer; 1533 1533 MaterialSupport: Integer; 1534 // food and material taken for unit support1534 // Food and material taken for unit support 1535 1535 ProjectCost: Integer; // material cost of current project 1536 1536 Storage: Integer; // size of food storage … … 1540 1540 CollectedMaterial: Integer; 1541 1541 CollectedTrade: Integer; 1542 // raw control, food, material and trade as collected by the citizens1542 // Raw control, food, material and trade as collected by the citizens 1543 1543 Working: Integer; // number of exploited tiles including city tile 1544 1544 FoodSurplus: Integer; 1545 1545 Production: Integer; 1546 1546 AddPollution: Integer; 1547 // food surplus, production gain and pollution after all effects1547 // Food surplus, production gain and pollution after all effects 1548 1548 Corruption: Integer; 1549 1549 Tax: Integer; 1550 1550 Science: Integer; 1551 1551 Luxury: Integer; 1552 // corruption, tax, science and wealth after all effects1552 // Corruption, tax, science and wealth after all effects 1553 1553 HappinessBalance: Integer; 1554 1554 // = (Morale+Wealth+Control) - (Size+Unrest), value < 0 means disorder … … 1563 1563 TGetCityData = record 1564 1564 Owner: Integer; 1565 c: TCity;1565 C: TCity; 1566 1566 end; 1567 1567 … … 1600 1600 Movement: Integer; 1601 1601 EndHealthDef: Integer; 1602 EndHealthAtt: Integer; // must be same as in TBattleForecast1602 EndHealthAtt: Integer; // Must be same as in TBattleForecast 1603 1603 AStr: Integer; 1604 1604 DStr: Integer; … … 1644 1644 TCreateUnitData = record 1645 1645 Loc: Integer; 1646 p: Integer;1646 P: Integer; 1647 1647 mix: Integer; 1648 1648 end; … … 1653 1653 TOwnerList = array [0 .. INFIN] of ShortInt; 1654 1654 TByteList = array [0 .. INFIN] of Byte; 1655 TIntList = array [0 .. INFIN] of integer;1655 TIntList = array [0 .. INFIN] of Integer; 1656 1656 TCityList = array [0 .. INFIN] of TCity; 1657 1657 TUnList = array [0 .. INFIN] of TUn; … … 1665 1665 Data: Pointer; 1666 1666 Map: ^TTileList; 1667 { the playground, a list of tiles with index = location, see tile flags }1667 { The playground, a list of tiles with index = location, see tile flags } 1668 1668 MapObservedLast: ^TTileObservedLastList; 1669 // turn in which the tile was observed last, index = location1669 // Turn in which the tile was observed last, index = location 1670 1670 Territory: ^TOwnerList; // nation to which's territory a tile belongs, -1 indicates none 1671 1671 Un: ^TUnList; { units } … … 1695 1695 LuxRate: Integer; 1696 1696 Research: Integer; 1697 { collected research points for currently researched tech }1697 { Collected research points for currently researched tech } 1698 1698 ResearchTech: Integer; // currently researched tech 1699 1699 DevModel: TModel; { unit model currently under development } … … 1730 1730 MaxTurn: Integer; 1731 1731 Difficulty: array [0 .. nPl - 1] of Integer; 1732 { difficulty levels of the players, if it's 0 this player is the supervisor,1732 { Difficulty levels of the players, if it's 0 this player is the supervisor, 1733 1733 -1 for unused slots } 1734 1734 RO: array [0 .. nPl - 1] of ^TPlayerContext; … … 1744 1744 RND: Integer; 1745 1745 Difficulty: array [0 .. nPl - 1] of Integer; 1746 { difficulty levels of the players, if it's 0 this player is the supervisor,1746 { Difficulty levels of the players, if it's 0 this player is the supervisor, 1747 1747 -1 for unused slots } 1748 1748 Controlled: Integer; … … 1757 1757 1758 1758 const 1759 { predefined unit models: }1759 { Predefined unit models: } 1760 1760 nSpecialModel = 9; 1761 1761 SpecialModel: array [0 .. nSpecialModel - 1] of TModel = ((Status: 0; … … 1815 1815 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))); 1816 1816 1817 SpecialModelPreq: array [0 .. nSpecialModel - 1] of integer = (preNone,1817 SpecialModelPreq: array [0 .. nSpecialModel - 1] of Integer = (preNone, 1818 1818 adExplosives, preNone, preNone, (* adWri, *) adIntelligence, adTrade, 1819 1819 (* adTheCorporation,adHorsebackRiding,adAutomobile,adNavigation, … … 1824 1824 DelphiRandSeed: Integer; 1825 1825 1826 procedure MakeUnitInfo( p: Integer; const u: TUn; var ui: TUnitInfo);1827 procedure MakeModelInfo( p, mix: Integer; const m: TModel; var mi: TModelInfo);1826 procedure MakeUnitInfo(P: Integer; const U: TUn; var ui: TUnitInfo); 1827 procedure MakeModelInfo(P, mix: Integer; const M: TModel; var mi: TModelInfo); 1828 1828 function IsSameModel(const mi1, mi2: TModelInfo): Boolean; 1829 1829 function SpecialTile(Loc, TerrType, lx: Integer): Integer; … … 1836 1836 implementation 1837 1837 1838 procedure MakeUnitInfo( p: Integer; const u: TUn; var ui: TUnitInfo);1838 procedure MakeUnitInfo(P: Integer; const U: TUn; var ui: TUnitInfo); 1839 1839 begin 1840 ui.Owner := p;1841 ui.Loc := u.Loc;1842 ui.Health := u.Health;1843 ui.Fuel := u.Fuel;1844 ui.Job := u.Job;1845 ui.Exp := u.Exp;1846 ui.Load := u.TroopLoad + u.AirLoad;1847 ui.mix := u.mix;1848 ui.Flags := u.Flags;1840 ui.Owner := P; 1841 ui.Loc := U.Loc; 1842 ui.Health := U.Health; 1843 ui.Fuel := U.Fuel; 1844 ui.Job := U.Job; 1845 ui.Exp := U.Exp; 1846 ui.Load := U.TroopLoad + U.AirLoad; 1847 ui.mix := U.mix; 1848 ui.Flags := U.Flags; 1849 1849 end; 1850 1850 1851 procedure MakeModelInfo( p, mix: Integer; const m: TModel; var mi: TModelInfo);1851 procedure MakeModelInfo(P, mix: Integer; const M: TModel; var mi: TModelInfo); 1852 1852 var 1853 i: Integer;1853 I: Integer; 1854 1854 begin 1855 mi.Owner := p;1855 mi.Owner := P; 1856 1856 mi.mix := mix; 1857 mi.ID := m.ID;1858 mi.Domain := m.Domain;1859 if m.Kind = mkEnemyDeveloped then1860 mi.Kind := mkSelfDeveloped // important for IsSameModel()1857 mi.ID := M.ID; 1858 mi.Domain := M.Domain; 1859 if M.Kind = mkEnemyDeveloped then 1860 mi.Kind := mkSelfDeveloped // Important for IsSameModel() 1861 1861 else 1862 mi.Kind := m.Kind;1863 mi.Attack := m.Attack;1864 mi.Defense := m.Defense;1865 mi.Speed := m.Speed;1866 mi.Cost := m.Cost;1862 mi.Kind := M.Kind; 1863 mi.Attack := M.Attack; 1864 mi.Defense := M.Defense; 1865 mi.Speed := M.Speed; 1866 mi.Cost := M.Cost; 1867 1867 if mi.Domain = dAir then 1868 1868 begin 1869 mi.TTrans := m.Cap[mcAirTrans] * m.MTrans;1870 mi.ATrans_Fuel := m.Cap[mcFuel];1869 mi.TTrans := M.Cap[mcAirTrans] * M.MTrans; 1870 mi.ATrans_Fuel := M.Cap[mcFuel]; 1871 1871 end 1872 1872 else 1873 1873 begin 1874 mi.TTrans := m.Cap[mcSeaTrans] * m.MTrans;1875 mi.ATrans_Fuel := m.Cap[mcCarrier] * m.MTrans;1876 end; 1877 mi.Bombs := m.Cap[mcBombs] * m.MStrength * 2;1874 mi.TTrans := M.Cap[mcSeaTrans] * M.MTrans; 1875 mi.ATrans_Fuel := M.Cap[mcCarrier] * M.MTrans; 1876 end; 1877 mi.Bombs := M.Cap[mcBombs] * M.MStrength * 2; 1878 1878 mi.Cap := 0; 1879 for i:= mcFirstNonCap to nFeature - 1 do1880 if m.Cap[i] > 0 then1881 mi.Cap := mi.Cap or (1 shl ( i- mcFirstNonCap));1879 for I := mcFirstNonCap to nFeature - 1 do 1880 if M.Cap[I] > 0 then 1881 mi.Cap := mi.Cap or (1 shl (I - mcFirstNonCap)); 1882 1882 mi.MaxUpgrade := 0; 1883 for i:= 1 to nUpgrade - 1 do1884 if m.Upgrades and (1 shl i) <> 0 then1885 mi.MaxUpgrade := i;1886 mi.Weight := m.Weight;1883 for I := 1 to nUpgrade - 1 do 1884 if M.Upgrades and (1 shl I) <> 0 then 1885 mi.MaxUpgrade := I; 1886 mi.Weight := M.Weight; 1887 1887 mi.Lost := 0; 1888 1888 end; … … 1896 1896 Compare1 := @mi1; 1897 1897 Compare2 := @mi2; 1898 result := (Compare1[1] and $FFFF0000 = Compare2[1] and $FFFF0000) and1898 Result := (Compare1[1] and $FFFF0000 = Compare2[1] and $FFFF0000) and 1899 1899 (Compare1[2] = Compare2[2]) and (Compare1[3] = Compare2[3]) and 1900 1900 (Compare1[4] = Compare2[4]) and (Compare1[5] = Compare2[5]) … … 1903 1903 function SpecialTile(Loc, TerrType, lx: Integer): Integer; 1904 1904 var 1905 x, y, qx, qy, a: Integer;1905 X, Y, qx, qy, A: Integer; 1906 1906 begin 1907 1907 if TerrType = fOcean then 1908 result := 01908 Result := 0 1909 1909 else 1910 1910 begin 1911 y:= Loc div lx;1912 x := Loc - y* lx;1913 if TerrType = fGrass then { formula for productive grassland }1914 if Odd((lymax + x - y shr 1) shr 1 + x + (y+ 1) shr 1) then1915 result := 11911 Y := Loc div lx; 1912 X := Loc - Y * lx; 1913 if TerrType = fGrass then { Formula for productive grassland } 1914 if Odd((lymax + X - Y shr 1) shr 1 + X + (Y + 1) shr 1) then 1915 Result := 1 1916 1916 else 1917 result := 01918 else { formula for special resources }1917 Result := 0 1918 else { Formula for special resources } 1919 1919 begin 1920 a := 4 * x - y+ 9980;1921 qx := adiv 10;1922 if (qx * 10 = a) and (qx and 3 <> 0) then1920 A := 4 * X - Y + 9980; 1921 qx := A div 10; 1922 if (qx * 10 = A) and (qx and 3 <> 0) then 1923 1923 begin 1924 qy := ( y + x) div 5;1924 qy := (Y + X) div 5; 1925 1925 if qy and 3 <> qx shr 2 and 1 * 2 then 1926 1926 if (TerrType = fArctic) or (TerrType = fSwamp) then 1927 result := 11927 Result := 1 1928 1928 else if TerrType = fShore then 1929 1929 begin 1930 1930 if (qx + qy) and 1 = 0 then 1931 1931 if qx and 3 = 2 then 1932 result := 21932 Result := 2 1933 1933 else 1934 result := 11934 Result := 1 1935 1935 else 1936 result := 01936 Result := 0 1937 1937 end 1938 1938 else 1939 result := (qx + qy) and 1 + 11939 Result := (qx + qy) and 1 + 1 1940 1940 else 1941 result := 0;1941 Result := 0; 1942 1942 end 1943 1943 else 1944 result := 0;1945 end 1944 Result := 0; 1945 end; 1946 1946 end; 1947 1947 end; -
branches/highdpi/Settings.lfm
r412 r465 5 5 Width = 483 6 6 BorderStyle = bsNone 7 Caption = ' LocaleDlg'7 Caption = 'Settings' 8 8 ClientHeight = 448 9 9 ClientWidth = 483 10 Color = clBtnFace 10 11 DesignTimePPI = 144 11 12 FormStyle = fsStayOnTop … … 16 17 OnShow = FormShow 17 18 Position = poScreenCenter 18 LCLVersion = '2. 0.12.0'19 LCLVersion = '2.2.0.4' 19 20 Scaled = False 20 21 object ListLanguages: TDpiListBox 21 22 Tag = 15360 22 23 Left = 16 23 Height = 26724 Height = 320 24 25 Top = 32 25 26 Width = 144 … … 69 70 object Up2Btn: TButtonC 70 71 Tag = 6912 71 Left = 4 3272 Left = 452 72 73 Height = 12 73 Top = 3 2874 Top = 360 74 75 Width = 12 75 76 Down = False … … 80 81 object Down2Btn: TButtonC 81 82 Tag = 6912 82 Left = 4 3283 Left = 452 83 84 Height = 12 84 Top = 3 4085 Top = 372 85 86 Width = 12 86 87 Down = False … … 92 93 Tag = 15360 93 94 Left = 176 94 Height = 19295 Height = 264 95 96 Top = 32 96 97 Width = 288 … … 113 114 object EditShortCutPrimary: TDpiEdit 114 115 Left = 176 115 Height = 19 116 BorderStyle = bsNone 117 Top = 256 116 Height = 27 117 Top = 325 118 118 Width = 136 119 BorderStyle = bsNone 119 120 Color = clBlack 120 121 Enabled = False 121 Font.Charset = DEFAULT_CHARSET122 122 Font.Color = 4176863 123 123 Font.Height = -15 … … 130 130 object EditShortCutSecondary: TDpiEdit 131 131 Left = 328 132 Height = 19 133 BorderStyle = bsNone 134 Top = 257 132 Height = 27 133 Top = 325 135 134 Width = 136 135 BorderStyle = bsNone 136 136 Color = clBlack 137 137 Enabled = False 138 Font.Charset = DEFAULT_CHARSET139 138 Font.Color = 4176863 140 139 Font.Height = -15 -
branches/highdpi/Settings.pas
r412 r465 1 1 unit Settings; 2 3 {$mode delphi}4 2 5 3 interface … … 7 5 uses 8 6 UDpiControls, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 LCLProc, ScreenTools, Messg, ButtonA, Registry, fgl, Directories, DrawDlg,10 ButtonC, UKeyBindings, ULanguages;7 LCLProc, ScreenTools, Messg, ButtonA, Directories, DrawDlg, ButtonC, 8 KeyBindings, Languages; 11 9 12 10 type … … 58 56 {$R *.lfm} 59 57 58 uses 59 Start; 60 60 61 var 61 62 SFullScreen, SGamma, SRestartMsg, SShortCutPrimary, SShortCutSecondary, … … 77 78 procedure TSettingsDlg.FormCreate(Sender: TObject); 78 79 begin 80 Color := clBlack; 79 81 LocalKeyBindings := TKeyBindings.Create; 80 82 … … 117 119 Shift: TShiftState); 118 120 begin 119 if Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin121 if (Sender is TDpiEdit) and Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin 120 122 CurrentKeyBinding.ShortCut := Key or 121 123 (scShift * Integer(ssShift in Shift)) or … … 131 133 var Key: Word; Shift: TShiftState); 132 134 begin 133 if Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin135 if (Sender is TDpiEdit) and Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin 134 136 CurrentKeyBinding.ShortCut2 := Key or 135 137 (scShift * Integer(ssShift in Shift)) or … … 192 194 procedure TSettingsDlg.FormShow(Sender: TObject); 193 195 begin 196 Caption := Phrases2.Lookup('ACTIONHEADER_CONFIG'); 194 197 ReloadLanguages; 195 Languages.LoadToStrings(ListLanguages.Items);198 StartDlg.Translator.LanguageListToStrings(ListLanguages.Items); 196 199 ListLanguages.Font.Color := MainTexture.ColorMark; 197 200 ListKeyBindings.Font.Color := MainTexture.ColorMark; … … 260 263 procedure TSettingsDlg.LoadData; 261 264 begin 262 ListLanguages.ItemIndex := Languages.Search(LocaleCode); 263 if (ListLanguages.ItemIndex = -1) and (Languages.Count > 0) then 264 ListLanguages.ItemIndex := 0; 265 StartDlg.Translator.Language := StartDlg.Translator.Languages.SearchByCode(LocaleCode); 266 StartDlg.Translator.LanguageListToStrings(ListLanguages.Items, False); 267 ListLanguages.ItemIndex := ListLanguages.Items.IndexOfObject(StartDlg.Translator.Language); 268 if ListLanguages.ItemIndex = -1 then ListLanguages.ItemIndex := 0; 265 269 if FullScreen then ButtonFullscreen.ButtonIndex := 3 266 270 else ButtonFullscreen.ButtonIndex := 2; 267 271 LocalGamma := Gamma; 268 LocalKeyBindings.Assign(KeyBindings );272 LocalKeyBindings.Assign(KeyBindings.KeyBindings); 269 273 end; 270 274 … … 274 278 begin 275 279 NeedRestart := Gamma <> LocalGamma; 276 LocaleCode := Languages[ListLanguages.ItemIndex].ShortName; 280 if ListLanguages.ItemIndex <> -1 then begin 281 StartDlg.Translator.Language := TLanguage(ListLanguages.Items.Objects[ListLanguages.ItemIndex]); 282 LocaleCode := StartDlg.Translator.Language.Code; 283 end else begin 284 StartDlg.Translator.Language := nil; 285 LocaleCode := ''; 286 end; 277 287 FullScreen := (ButtonFullscreen.ButtonIndex and 1) = 1; 278 288 Gamma := LocalGamma; 279 289 if NeedRestart then SimpleMessage(SRestartMsg); 280 KeyBindings. Assign(LocalKeyBindings);290 KeyBindings.KeyBindings.Assign(LocalKeyBindings); 281 291 end; 282 292 283 293 end. 284 294 295 296 -
branches/highdpi/Start.lfm
r378 r465 26 26 OnShow = FormShow 27 27 LCLVersion = '2.0.12.0' 28 ShowInTaskBar = stNever 28 29 Scaled = False 29 30 object StartBtn: TButtonA -
branches/highdpi/Start.pas
r405 r465 7 7 UDpiControls, GameServer, Messg, ButtonBase, ButtonA, ButtonC, ButtonB, Area, Types, 8 8 LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls, 9 Menus, Registry, DrawDlg, fgl, Protocol, UMiniMap, UBrain; 9 Menus, Registry, DrawDlg, Generics.Collections, Protocol, MiniMap, Brain, 10 Translator; 10 11 11 12 type 12 13 13 { TPlayerSlot } 14 14 … … 21 21 end; 22 22 23 TPlayerSlots = class(T FPGObjectList<TPlayerSlot>)23 TPlayerSlots = class(TObjectList<TPlayerSlot>) 24 24 end; 25 25 … … 69 69 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 70 70 procedure FormMouseDown(Sender: TObject; Button: TMouseButton; 71 Shift: TShiftState; x, y: integer);71 Shift: TShiftState; X, Y: Integer); 72 72 procedure FormMouseUp(Sender: TObject; Button: TMouseButton; 73 Shift: TShiftState; x, y: integer);74 procedure FormMouseMove(Sender: TObject; Shift: TShiftState; x, y: integer);73 Shift: TShiftState; X, Y: Integer); 74 procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); 75 75 procedure Up1BtnClick(Sender: TObject); 76 76 procedure Down1BtnClick(Sender: TObject); … … 122 122 MiniMap: TMiniMap; 123 123 LastGame: string; 124 procedure DrawAction( y, IconIndex: integer; HeaderItem, TextItem: string);124 procedure DrawAction(Y, IconIndex: Integer; HeaderItem, TextItem: string); 125 125 procedure InitPopup(PlayerIndex: Integer); 126 126 procedure OfferBrain(Brain: TBrain; FixedLines: Integer); … … 129 129 procedure ChangeTab(NewTab: TStartTab); 130 130 procedure UnlistBackupFile(FileName: string); 131 procedure SmartInvalidate(x0, y0, x1, y1: integer;132 invalidateTab0: boolean = false); overload;131 procedure SmartInvalidate(x0, y0, x1, y1: Integer; 132 invalidateTab0: Boolean = False); overload; 133 133 procedure LoadConfig; 134 134 procedure SaveConfig; 135 procedure LoadLanguages; 135 136 procedure LoadAiBrainsPictures; 136 137 procedure UpdateInterface; … … 138 139 public 139 140 EmptyPicture: TDpiBitmap; 141 Translator: TTranslator; 140 142 procedure UpdateFormerGames; 141 143 procedure UpdateMaps; … … 149 151 150 152 uses 151 Global, Directories, Direct, ScreenTools, Inp, Back, Settings, UKeyBindings; 153 Global, Directories, Direct, ScreenTools, Inp, Back, Settings, KeyBindings, 154 Languages; 152 155 153 156 {$R *.lfm} … … 157 160 // attention: lx*ly+1 must be prime! 158 161 { MaxWorldSize=8; 159 lxpre: array[0..nWorldSize-1] of integer =(30,40,50,60,70,90,110,130);160 lypre: array[0..nWorldSize-1] of integer =(46,52,60,70,84,94,110,130);162 lxpre: array[0..nWorldSize-1] of Integer =(30,40,50,60,70,90,110,130); 163 lypre: array[0..nWorldSize-1] of Integer =(46,52,60,70,84,94,110,130); 161 164 DefaultWorldTiles=4200; } 162 165 MaxWorldSize = 6; … … 189 192 dxBrain = 104; 190 193 dyBrain = 80; 191 xBrain: array [0 .. nPlOffered - 1] of integer = (x0Brain, x0Brain,194 xBrain: array [0 .. nPlOffered - 1] of Integer = (x0Brain, x0Brain, 192 195 x0Brain + dxBrain, x0Brain + dxBrain, x0Brain + dxBrain, x0Brain, 193 196 x0Brain - dxBrain, x0Brain - dxBrain, x0Brain - dxBrain); 194 yBrain: array [0 .. nPlOffered - 1] of integer = (y0Brain, y0Brain - dyBrain,197 yBrain: array [0 .. nPlOffered - 1] of Integer = (y0Brain, y0Brain - dyBrain, 195 198 y0Brain - dyBrain, y0Brain, y0Brain + dyBrain, y0Brain + dyBrain, 196 199 y0Brain + dyBrain, y0Brain, y0Brain - dyBrain); … … 199 202 TabHeight = 40; 200 203 201 InitAlive: array [1 .. nPl] of integer = (1, 1 + 2, 1 + 2 + 32,204 InitAlive: array [1 .. nPl] of Integer = (1, 1 + 2, 1 + 2 + 32, 202 205 1 + 2 + 8 + 128, 1 + 2 + 8 + 32 + 128, 1 + 2 + 8 + 16 + 64 + 128, 203 206 1 + 2 + 4 + 16 + 32 + 64 + 256, 511 - 32, 511, 511 - 32, 511, 511 - 32, 511, 204 207 511 - 32, 511); 205 InitMulti: array [nPlOffered + 1 .. nPl] of integer = (256, 256, 256 + 128,208 InitMulti: array [nPlOffered + 1 .. nPl] of Integer = (256, 256, 256 + 128, 206 209 256 + 128, 256 + 128 + 64, 256 + 128 + 64); 207 210 208 PlayerAutoDiff: array [1 .. 5] of integer = (1, 1, 2, 2, 3);209 EnemyAutoDiff: array [1 .. 5] of integer = (4, 3, 2, 1, 1);211 PlayerAutoDiff: array [1 .. 5] of Integer = (1, 1, 2, 2, 3); 212 EnemyAutoDiff: array [1 .. 5] of Integer = (4, 3, 2, 1, 1); 210 213 211 214 { TStartDlg } … … 213 216 procedure TStartDlg.FormCreate(Sender: TObject); 214 217 var 215 x, i: Integer;218 X, I: Integer; 216 219 PlayerSlot: TPlayerSlot; 217 220 AIBrains: TBrains; … … 226 229 LoadConfig; 227 230 LoadAssets; 231 LoadLanguages; 228 232 229 233 ActionsOffered := [maConfig, maManual, maCredits, maWeb]; … … 232 236 233 237 BrainDefault := nil; 234 for i:= Brains.IndexOf(BrainRandom) to Brains.Count - 1 do235 if AnsiCompareFileName(DefaultAI, Brains[ i].FileName) = 0 then236 BrainDefault := Brains[ i];238 for I := Brains.IndexOf(BrainRandom) to Brains.Count - 1 do 239 if AnsiCompareFileName(DefaultAI, Brains[I].FileName) = 0 then 240 BrainDefault := Brains[I]; 237 241 if (BrainDefault = BrainRandom) and (Brains.GetKindCount(btAI) < 2) then 238 242 BrainDefault := nil; … … 256 260 ReplayBtn.Hint := Phrases.Lookup('BTN_REPLAY'); 257 261 PlayerSlots.Count := nPlOffered; 258 for i:= 0 to PlayerSlots.Count - 1 do259 with PlayerSlots[ i] do begin262 for I := 0 to PlayerSlots.Count - 1 do 263 with PlayerSlots[I] do begin 260 264 DiffUpBtn := TButtonC.Create(self); 261 265 DiffUpBtn.Graphic := HGrSystem.Data; 262 DiffUpBtn.left := xBrain[ i] - 18;263 DiffUpBtn.top := yBrain[ i] + 39;266 DiffUpBtn.left := xBrain[I] - 18; 267 DiffUpBtn.top := yBrain[I] + 39; 264 268 DiffUpBtn.ButtonIndex := 1; 265 269 DiffUpBtn.Parent := self; … … 267 271 DiffDownBtn := TButtonC.Create(self); 268 272 DiffDownBtn.Graphic := HGrSystem.Data; 269 DiffDownBtn.left := xBrain[ i] - 18;270 DiffDownBtn.top := yBrain[ i] + 51;273 DiffDownBtn.left := xBrain[I] - 18; 274 DiffDownBtn.top := yBrain[I] + 51; 271 275 DiffDownBtn.ButtonIndex := 0; 272 276 DiffDownBtn.Parent := self; 273 277 DiffDownBtn.OnClick := DiffBtnClick; 274 278 end; 275 for i:= 6 to 8 do276 with PlayerSlots[ i] do begin279 for I := 6 to 8 do 280 with PlayerSlots[I] do begin 277 281 MultiBtn := TButtonC.Create(self); 278 282 MultiBtn.Graphic := HGrSystem.Data; 279 MultiBtn.left := xBrain[ i] - 18;280 MultiBtn.top := yBrain[ i];283 MultiBtn.left := xBrain[I] - 18; 284 MultiBtn.top := yBrain[I]; 281 285 MultiBtn.Parent := self; 282 286 MultiBtn.OnClick := MultiBtnClick; … … 284 288 end; 285 289 286 x:= BiColorTextWidth(Canvas, Phrases.Lookup('STARTCONTROLS', 7)) div 2;287 CustomizeBtn.left := x0Brain + 32 - 16 - x;290 X := BiColorTextWidth(Canvas, Phrases.Lookup('STARTCONTROLS', 7)) div 2; 291 CustomizeBtn.left := x0Brain + 32 - 16 - X; 288 292 if AutoDiff < 0 then 289 293 CustomizeBtn.ButtonIndex := 3 … … 291 295 CustomizeBtn.ButtonIndex := 2; 292 296 293 BitBltBitmap(BrainNoTerm.Picture, 0, 0, 64, 64, HGrSystem2.Data, 1, 111); 294 BitBltBitmap(BrainSuperVirtual.Picture, 0, 0, 64, 64, HGrSystem2.Data, 66, 111); 295 BitBltBitmap(BrainTerm.Picture, 0, 0, 64, 64, HGrSystem2.Data, 131, 111); 296 BitBltBitmap(BrainRandom.Picture, 0, 0, 64, 64, HGrSystem2.Data, 131, 46); 297 BitBltBitmap(BrainNoTerm.Picture, 0, 0, 64, 64, HGrSystem2.Data, GBrainNoTerm.Left, GBrainNoTerm.Top); 298 BitBltBitmap(BrainSuperVirtual.Picture, 0, 0, 64, 64, HGrSystem2.Data, GBrainSuperVirtual.Left, GBrainSuperVirtual.Top); 299 BitBltBitmap(BrainTerm.Picture, 0, 0, 64, 64, HGrSystem2.Data, GBrainTerm.Left, GBrainTerm.Top); 300 BitBltBitmap(BrainRandom.Picture, 0, 0, 64, 64, HGrSystem2.Data, GBrainRandom.Left, GBrainRandom.Top); 301 297 302 LoadAiBrainsPictures; 298 303 … … 325 330 begin 326 331 SaveConfig; 332 FreeAndNil(Translator); 327 333 FreeAndNil(FormerGames); 328 334 FreeAndNil(Maps); … … 333 339 end; 334 340 335 procedure TStartDlg.SmartInvalidate(x0, y0, x1, y1: integer;336 invalidateTab0: boolean);337 var 338 i: integer;341 procedure TStartDlg.SmartInvalidate(x0, y0, x1, y1: Integer; 342 invalidateTab0: Boolean); 343 var 344 I: Integer; 339 345 r0, r1: HRgn; 340 346 begin 341 347 r0 := DpiCreateRectRgn(x0, y0, x1, y1); 342 for i:= 0 to ControlCount - 1 do343 if not (Controls[ i] is TArea) and Controls[i].Visible then348 for I := 0 to ControlCount - 1 do 349 if not (Controls[I] is TArea) and Controls[I].Visible then 344 350 begin 345 with Controls[ i].BoundsRect do351 with Controls[I].BoundsRect do 346 352 r1 := DpiCreateRectRgn(left, top, Right, Bottom); 347 353 CombineRgn(r0, r0, r1, RGN_DIFF); … … 353 359 DeleteObject(r1); 354 360 end; 355 InvalidateRgn(Handle, r0, false);361 InvalidateRgn(Handle, r0, False); 356 362 DeleteObject(r0); 357 363 end; … … 429 435 end; 430 436 431 KeyBindings. LoadFromRegistry(HKEY_CURRENT_USER, AppRegistryKey + '\KeyBindings');437 KeyBindings.KeyBindings.LoadFromRegistry(HKEY_CURRENT_USER, AppRegistryKey + '\KeyBindings'); 432 438 end; 433 439 … … 453 459 end; 454 460 455 KeyBindings.SaveToRegistry(HKEY_CURRENT_USER, AppRegistryKey + '\KeyBindings'); 461 KeyBindings.KeyBindings.SaveToRegistry(HKEY_CURRENT_USER, AppRegistryKey + '\KeyBindings'); 462 end; 463 464 procedure TStartDlg.LoadLanguages; 465 var 466 I: Integer; 467 begin 468 Translator := TTranslator.Create(nil); 469 with Translator, Languages do begin 470 SearchByCode('').Available := True; 471 472 for I := 1 to Languages.Count - 1 do 473 with Languages[I] do begin 474 Available := DirectoryExists(HomeDir + 'Localization' + DirectorySeparator + Code) or (Code = 'en'); 475 end; 476 end; 456 477 end; 457 478 458 479 procedure TStartDlg.LoadAiBrainsPictures; 459 480 var 460 AIBrains: TBrains; 461 I: Integer; 462 TextSize: TSize; 463 begin 464 AIBrains := TBrains.Create(False); 465 Brains.GetByKind(btAI, AIBrains); 466 for i := 0 to AIBrains.Count - 1 do 467 with AIBrains[I] do begin 468 if not LoadGraphicFile(AIBrains[i].Picture, GetAiDir + DirectorySeparator + 469 FileName + DirectorySeparator + FileName + '.png', [gfNoError]) then begin 470 with AIBrains[i].Picture.Canvas do begin 471 Brush.Color := $904830; 472 FillRect(Rect(0, 0, 64, 64)); 473 Font.Assign(UniFont[ftTiny]); 474 Font.Style := []; 475 Font.Color := $5FDBFF; 476 TextSize := TextExtent(FileName); 477 Textout(32 - TextSize.Width div 2, 478 32 - TextSize.Height div 2, FileName); 479 end; 480 end; 481 end; 482 FreeAndNil(AIBrains); 481 AiBrains: TBrains; 482 begin 483 AiBrains := TBrains.Create(False); 484 try 485 Brains.GetByKind(btAI, AiBrains); 486 AiBrains.LoadPictures; 487 finally 488 FreeAndNil(AiBrains); 489 end; 483 490 end; 484 491 … … 498 505 DeleteObject(r1); 499 506 r1 := DpiCreateRectRgn(QuitBtn.Left, QuitBtn.Top, QuitBtn.Left + QuitBtn.Width, 500 QuitBtn. top + QuitBtn.Height);507 QuitBtn.Top + QuitBtn.Height); 501 508 CombineRgn(r0, r0, r1, RGN_OR); 502 509 DeleteObject(r1); … … 505 512 end else begin 506 513 BoundsRect := Bounds((DpiScreen.Width - Width) div 2, 507 (DpiScreen.Height - Height) div 2, Width, Height) 514 (DpiScreen.Height - Height) div 2, Width, Height); 508 515 end; 509 516 end; … … 521 528 end; 522 529 523 procedure TStartDlg.DrawAction( y, IconIndex: integer; HeaderItem, TextItem: string);530 procedure TStartDlg.DrawAction(Y, IconIndex: Integer; HeaderItem, TextItem: string); 524 531 begin 525 532 Canvas.Font.Assign(UniFont[ftCaption]); 526 533 Canvas.Font.Style := Canvas.Font.Style + [fsUnderline]; 527 RisedTextOut(Canvas, xAction, y- 3, Phrases2.Lookup(HeaderItem));534 RisedTextOut(Canvas, xAction, Y - 3, Phrases2.Lookup(HeaderItem)); 528 535 Canvas.Font.Assign(UniFont[ftNormal]); 529 536 BiColorTextOut(Canvas, Colors.Canvas.Pixels[clkAge0 - 1, cliDimmedText], 530 $000000, xAction, y+ 21, Phrases2.Lookup(TextItem));537 $000000, xAction, Y + 21, Phrases2.Lookup(TextItem)); 531 538 532 539 UnshareBitmap(LogoBuffer); 533 DpiBit Canvas(LogoBuffer.Canvas, 0, 0, 50, 50, Canvas,534 xActionIcon - 2, y- 2);540 DpiBitBltCanvas(LogoBuffer.Canvas, 0, 0, 50, 50, Canvas, 541 xActionIcon - 2, Y - 2); 535 542 GlowFrame(LogoBuffer, 8, 8, 34, 34, $202020); 536 DpiBit Canvas(Canvas, xActionIcon - 2, y- 2, 50, 50,543 DpiBitBltCanvas(Canvas, xActionIcon - 2, Y - 2, 50, 50, 537 544 LogoBuffer.Canvas, 0, 0); 538 DpiBit Canvas(Canvas, xActionIcon, y, 40, 40, BigImp.Canvas,545 DpiBitBltCanvas(Canvas, xActionIcon, Y, 40, 40, BigImp.Canvas, 539 546 (IconIndex mod 7) * xSizeBig + 8, (IconIndex div 7) * ySizeBig); 540 RFrame(Canvas, xActionIcon - 1, y - 1, xActionIcon + 40, y+ 40,547 RFrame(Canvas, xActionIcon - 1, Y - 1, xActionIcon + 40, Y + 40, 541 548 $000000, $000000); 542 549 end; … … 546 553 TabNames: array[TStartTab] of Integer = (0, 11, 3, 4); 547 554 var 548 i, w, h, xMini, yMini, y: integer;549 s: string;555 I, W, H, xMini, yMini, Y: Integer; 556 S: string; 550 557 Tab2: TStartTab; 551 558 MainAction: TMainAction; … … 579 586 580 587 // draw tabs 581 Frame(Canvas, 2, 2 + 2 * integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize - 1,588 Frame(Canvas, 2, 2 + 2 * Integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize - 1, 582 589 TabHeight, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 583 Frame(Canvas, 1, 1 + 2 * integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize,590 Frame(Canvas, 1, 1 + 2 * Integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize, 584 591 TabHeight, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 585 Canvas.Pixels[1, 1 + 2 * integer(Tab <> tbMain)] := MainTexture.ColorBevelShade;592 Canvas.Pixels[1, 1 + 2 * Integer(Tab <> tbMain)] := MainTexture.ColorBevelShade; 586 593 for Tab2 := tbMap to tbPrevious do 587 594 begin 588 Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 2, 2 + 2 * integer(Tab <> Tab2),595 Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 2, 2 + 2 * Integer(Tab <> Tab2), 589 596 TabOffset + (Integer(Tab2) + 1) * TabSize - 1, TabHeight, MainTexture.ColorBevelLight, 590 597 MainTexture.ColorBevelShade); 591 Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * integer(Tab <> Tab2),598 Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * Integer(Tab <> Tab2), 592 599 TabOffset + (Integer(Tab2) + 1) * TabSize, TabHeight, MainTexture.ColorBevelLight, 593 600 MainTexture.ColorBevelShade); 594 Canvas.Pixels[TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * integer(Tab <> Tab2)] :=601 Canvas.Pixels[TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * Integer(Tab <> Tab2)] := 595 602 MainTexture.ColorBevelShade; 596 603 end; … … 598 605 for Tab2 := tbMap to tbPrevious do 599 606 begin 600 s:= Phrases.Lookup('STARTCONTROLS', TabNames[Tab2]);607 S := Phrases.Lookup('STARTCONTROLS', TabNames[Tab2]); 601 608 RisedTextOut(Canvas, TabOffset + Integer(Tab2) * TabSize + 1 + 602 (TabSize - BiColorTextWidth(Canvas, s)) div 2,603 10 + 2 * integer(Tab <> Tab2), s);609 (TabSize - BiColorTextWidth(Canvas, S)) div 2, 610 10 + 2 * Integer(Tab <> Tab2), S); 604 611 end; 605 612 Frame(Canvas, TabOffset + 4 * TabSize + 1, -1, ClientWidth, TabHeight, … … 630 637 // Paint menu logo 631 638 UnshareBitmap(LogoBuffer); 632 DpiBit Canvas(LogoBuffer.Canvas, 0, 0, MenuLogo.Width, MenuLogo.Height, Canvas, 6,633 3 + 2 * integer(Tab <> tbMain));639 DpiBitBltCanvas(LogoBuffer.Canvas, 0, 0, MenuLogo.Width, MenuLogo.Height, Canvas, 6, 640 3 + 2 * Integer(Tab <> tbMain)); 634 641 635 642 ImageOp_BCC(LogoBuffer, Templates.Data, 0, 0, MenuLogo.Left, MenuLogo.Top, … … 637 644 ImageOp_BCC(LogoBuffer, Templates.Data, 10, 27, MenuLogo.Left + 10, 638 645 MenuLogo.Top + 27, MenuLogo.Width - 10, 9, $BFBF20, $4040DF); // logo part 2 639 DpiBit Canvas(Canvas, 6, 3 + 2 * integer(Tab <> tbMain), MenuLogo.Width, MenuLogo.Height,646 DpiBitBltCanvas(Canvas, 6, 3 + 2 * Integer(Tab <> tbMain), MenuLogo.Width, MenuLogo.Height, 640 647 LogoBuffer.Canvas, 0, 0); 641 648 642 649 if Page = pgMain then begin 643 650 if SelectedAction <> maNone then // mark selected action 644 for i:= 0 to (ClientWidth - 2 * ActionSideBorder) div wBuffer + 1 do651 for I := 0 to (ClientWidth - 2 * ActionSideBorder) div wBuffer + 1 do 645 652 begin 646 w := ClientWidth - 2 * ActionSideBorder - i* wBuffer;647 if w> wBuffer then648 w:= wBuffer;649 h:= ActionPitch;650 if yAction + Integer(SelectedAction) * ActionPitch - 8 + h> ClientHeight - ActionBottomBorder653 W := ClientWidth - 2 * ActionSideBorder - I * wBuffer; 654 if W > wBuffer then 655 W := wBuffer; 656 H := ActionPitch; 657 if yAction + Integer(SelectedAction) * ActionPitch - 8 + H > ClientHeight - ActionBottomBorder 651 658 then 652 h:= ClientHeight - ActionBottomBorder -659 H := ClientHeight - ActionBottomBorder - 653 660 (yAction + Integer(SelectedAction) * ActionPitch - 8); 654 661 655 662 UnshareBitmap(LogoBuffer); 656 DpiBit Canvas(LogoBuffer.Canvas, 0, 0, w, h, Canvas,657 ActionSideBorder + i* wBuffer, yAction + Integer(SelectedAction) * ActionPitch663 DpiBitBltCanvas(LogoBuffer.Canvas, 0, 0, W, H, Canvas, 664 ActionSideBorder + I * wBuffer, yAction + Integer(SelectedAction) * ActionPitch 658 665 - 8); 659 MakeBlue(LogoBuffer, 0, 0, w, h);660 DpiBit Canvas(Canvas, ActionSideBorder + i* wBuffer,661 yAction + Integer(SelectedAction) * ActionPitch - 8, w, h,666 MakeBlue(LogoBuffer, 0, 0, W, H); 667 DpiBitBltCanvas(Canvas, ActionSideBorder + I * wBuffer, 668 yAction + Integer(SelectedAction) * ActionPitch - 8, W, H, 662 669 LogoBuffer.Canvas, 0, 0); 663 670 end; 664 y:= yAction;671 Y := yAction; 665 672 for MainAction := Low(TMainActionSet) to High(TMainActionSet) do 666 673 begin 667 674 if MainAction in ActionsOffered then 668 675 case MainAction of 669 maConfig: DrawAction( y, 25, 'ACTIONHEADER_CONFIG', 'ACTION_CONFIG');670 maManual: DrawAction( y, 19, 'ACTIONHEADER_MANUAL', 'ACTION_MANUAL');671 maCredits: DrawAction( y, 22, 'ACTIONHEADER_CREDITS', 'ACTION_CREDITS');672 maAIDev: DrawAction( y, 24, 'ACTIONHEADER_AIDEV', 'ACTION_AIDEV');676 maConfig: DrawAction(Y, 25, 'ACTIONHEADER_CONFIG', 'ACTION_CONFIG'); 677 maManual: DrawAction(Y, 19, 'ACTIONHEADER_MANUAL', 'ACTION_MANUAL'); 678 maCredits: DrawAction(Y, 22, 'ACTIONHEADER_CREDITS', 'ACTION_CREDITS'); 679 maAIDev: DrawAction(Y, 24, 'ACTIONHEADER_AIDEV', 'ACTION_AIDEV'); 673 680 maWeb: 674 681 begin 675 682 Canvas.Font.Assign(UniFont[ftCaption]); 676 683 // Canvas.Font.Style:=Canvas.Font.Style+[fsUnderline]; 677 RisedTextOut(Canvas, xActionIcon + 99, y,684 RisedTextOut(Canvas, xActionIcon + 99, Y, 678 685 Format(Phrases2.Lookup('ACTIONHEADER_WEB'), [CevoHomepageShort])); 679 686 Canvas.Font.Assign(UniFont[ftNormal]); 680 687 681 688 UnshareBitmap(LogoBuffer); 682 DpiBit Canvas(LogoBuffer.Canvas, 0, 0, LinkArrows.Width, LinkArrows.Height, Canvas,683 xActionIcon, y+ 2);689 DpiBitBltCanvas(LogoBuffer.Canvas, 0, 0, LinkArrows.Width, LinkArrows.Height, Canvas, 690 xActionIcon, Y + 2); 684 691 ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), LinkArrows.BoundsRect, 0, 685 692 Colors.Canvas.Pixels[clkAge0 - 1, cliDimmedText]); 686 DpiBit Canvas(Canvas, xActionIcon, y+ 2, LinkArrows.Width, LinkArrows.Height,693 DpiBitBltCanvas(Canvas, xActionIcon, Y + 2, LinkArrows.Width, LinkArrows.Height, 687 694 LogoBuffer.Canvas, 0, 0); 688 695 end; 689 696 end; 690 Inc( y, ActionPitch);697 Inc(Y, ActionPitch); 691 698 end; 692 699 end … … 696 703 TurnToString(MaxTurn), 344, y0Mini + 61, 170); 697 704 698 s:= Phrases.Lookup('STARTCONTROLS', 7);699 w := Canvas.TextWidth(s);700 LoweredTextOut(Canvas, -2, MainTexture, x0Brain + 32 - wdiv 2,701 y0Brain + dyBrain + 69, s);705 S := Phrases.Lookup('STARTCONTROLS', 7); 706 W := Canvas.TextWidth(S); 707 LoweredTextOut(Canvas, -2, MainTexture, x0Brain + 32 - W div 2, 708 y0Brain + dyBrain + 69, S); 702 709 703 710 InitOrnament; 704 711 if AutoDiff < 0 then 705 712 begin 706 for i := 12 to 19 do 707 if (i < 13) or (i > 17) then 708 begin 709 DpiBitCanvas(Canvas, 9 + i * 27, yLogo - 2, Ornament.Width, Ornament.Height, 713 for I := 12 to 19 do 714 if (I < 13) or (I > 17) then begin 715 DpiBitBltCanvas(Canvas, 9 + I * 27, yLogo - 2, Ornament.Width, Ornament.Height, 710 716 HGrSystem2.Mask.Canvas, Ornament.Left, Ornament.Top, SRCAND); 711 DpiBit Canvas(Canvas, 9 + i* 27, yLogo - 2, Ornament.Width, Ornament.Height,717 DpiBitBltCanvas(Canvas, 9 + I * 27, yLogo - 2, Ornament.Width, Ornament.Height, 712 718 HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT); 713 719 end; … … 715 721 MainTexture.ColorBevelShade); 716 722 717 for i:= 0 to nPlOffered - 1 do718 if 1 shl iand SlotAvailable <> 0 then723 for I := 0 to nPlOffered - 1 do 724 if 1 shl I and SlotAvailable <> 0 then 719 725 begin 720 if Assigned(PlayersBrain[ i]) then721 FrameImage(Canvas, PlayersBrain[ i].Picture, xBrain[i], yBrain[i],722 64, 64, 0, 0, true)726 if Assigned(PlayersBrain[I]) then 727 FrameImage(Canvas, PlayersBrain[I].Picture, xBrain[I], yBrain[I], 728 64, 64, 0, 0, True) 723 729 else 724 FrameImage(Canvas, EmptyPicture, xBrain[ i], yBrain[i], 64, 64,725 0, 0, true);726 if Assigned(PlayersBrain[I]) and (PlayersBrain[ i].Kind in [btTerm, btRandom, btAI]) then730 FrameImage(Canvas, EmptyPicture, xBrain[I], yBrain[I], 64, 64, 731 0, 0, True); 732 if Assigned(PlayersBrain[I]) and (PlayersBrain[I].Kind in [btTerm, btRandom, btAI]) then 727 733 begin 728 DpiBit Canvas(Canvas, xBrain[i] - 18, yBrain[i] + 19, 12, 14,729 HGrSystem.Data.Canvas, 134 + (Difficulty[ i] - 1) *734 DpiBitBltCanvas(Canvas, xBrain[I] - 18, yBrain[I] + 19, 12, 14, 735 HGrSystem.Data.Canvas, 134 + (Difficulty[I] - 1) * 730 736 13, 28); 731 Frame(Canvas, xBrain[ i] - 19, yBrain[i] + 18, xBrain[i] - 18 + 12,732 yBrain[ i] + (19 + 14), $000000, $000000);733 RFrame(Canvas, PlayerSlots[ i].DiffUpBtn.left - 1, PlayerSlots[i].DiffUpBtn.top - 1,734 PlayerSlots[ i].DiffUpBtn.left + 12, PlayerSlots[i].DiffUpBtn.top + 24,737 Frame(Canvas, xBrain[I] - 19, yBrain[I] + 18, xBrain[I] - 18 + 12, 738 yBrain[I] + (19 + 14), $000000, $000000); 739 RFrame(Canvas, PlayerSlots[I].DiffUpBtn.left - 1, PlayerSlots[I].DiffUpBtn.top - 1, 740 PlayerSlots[I].DiffUpBtn.left + 12, PlayerSlots[I].DiffUpBtn.top + 24, 735 741 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 736 742 with Canvas do 737 743 begin 738 744 Brush.Color := $000000; 739 FillRect(Rect(xBrain[ i] - 5, yBrain[i] + 25, xBrain[i] - 2,740 yBrain[ i] + 27));745 FillRect(Rect(xBrain[I] - 5, yBrain[I] + 25, xBrain[I] - 2, 746 yBrain[I] + 27)); 741 747 Brush.Style := bsClear; 742 748 end; … … 746 752 PlayerSlots[I].MultiBtn.left + 12, PlayerSlots[I].MultiBtn.top + 12, 747 753 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 748 DpiBit Canvas(Canvas, xBrain[i] - 31, yBrain[i], 13, 12,754 DpiBitBltCanvas(Canvas, xBrain[I] - 31, yBrain[I], 13, 12, 749 755 HGrSystem.Data.Canvas, 88, 47); 750 756 end; 751 757 end; 752 if Assigned(PlayersBrain[ i]) then758 if Assigned(PlayersBrain[I]) then 753 759 begin 754 PlayerSlots[ i].DiffUpBtn.Hint := Format(Phrases.Lookup('STARTCONTROLS', 9),755 [PlayersBrain[ i].Name]);756 PlayerSlots[ i].DiffDownBtn.Hint := PlayerSlots[i].DiffUpBtn.Hint;760 PlayerSlots[I].DiffUpBtn.Hint := Format(Phrases.Lookup('STARTCONTROLS', 9), 761 [PlayersBrain[I].Name]); 762 PlayerSlots[I].DiffDownBtn.Hint := PlayerSlots[I].DiffUpBtn.Hint; 757 763 end; 758 764 end; … … 765 771 yMain + 140 { y0Mini-77 } , Phrases.Lookup('STARTCONTROLS', 15)); 766 772 if Page = pgStartRandom then 767 s:= IntToStr(AutoEnemies)773 S := IntToStr(AutoEnemies) 768 774 else if nMapStartPositions = 0 then 769 s:= '0'775 S := '0' 770 776 else 771 s:= IntToStr(nMapStartPositions - 1);772 RisedTextOut(Canvas, 198 - BiColorTextWidth(Canvas, s), yMain + 140, s);777 S := IntToStr(nMapStartPositions - 1); 778 RisedTextOut(Canvas, 198 - BiColorTextWidth(Canvas, S), yMain + 140, S); 773 779 774 780 DLine(Canvas, 24, xDefault - 6, yMain + 164 + 19, … … 778 784 if AutoDiff = 1 then 779 785 FrameImage(Canvas, Brains.GetBeginner.Picture, xDefault, yDefault, 64, 780 64, 0, 0, false)786 64, 0, 0, False) 781 787 else 782 788 FrameImage(Canvas, BrainDefault.Picture, xDefault, yDefault, 64, 64, 783 0, 0, true);789 0, 0, True); 784 790 DLine(Canvas, 56, 272, y0Mini + 61 + 19, MainTexture.ColorBevelLight, 785 791 MainTexture.ColorBevelShade); … … 787 793 RisedTextOut(Canvas, 56, y0Mini + 61, 788 794 Phrases.Lookup('STARTCONTROLS', 14)); 789 s := Phrases.Lookup('AUTODIFF', AutoDiff - 1); 790 RisedTextOut(Canvas, 272 - BiColorTextWidth(Canvas, s), y0Mini + 61, s); 791 792 for i := 0 to 19 do 793 if (i < 2) or (i > 6) then 794 begin 795 DpiBitCanvas(Canvas, 9 + i * 27, yLogo - 2, Ornament.Width, Ornament.Height, 795 S := Phrases.Lookup('AUTODIFF', AutoDiff - 1); 796 RisedTextOut(Canvas, 272 - BiColorTextWidth(Canvas, S), y0Mini + 61, S); 797 798 for I := 0 to 19 do 799 if (I < 2) or (I > 6) then begin 800 DpiBitBltCanvas(Canvas, 9 + I * 27, yLogo - 2, Ornament.Width, Ornament.Height, 796 801 HGrSystem2.Mask.Canvas, Ornament.Left, Ornament.Top, SRCAND); 797 DpiBit Canvas(Canvas, 9 + i* 27, yLogo - 2, Ornament.Width, Ornament.Height,802 DpiBitBltCanvas(Canvas, 9 + I * 27, yLogo - 2, Ornament.Width, Ornament.Height, 798 803 HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT); 799 804 end; … … 818 823 MainTexture.ColorBevelShade); 819 824 RisedTextOut(Canvas, 344, y0Mini + 61, Phrases.Lookup('STARTCONTROLS', 8)); 820 s:= TurnToString(LoadTurn);821 RisedTextOut(Canvas, 514 - BiColorTextWidth(Canvas, s), y0Mini + 61, s);825 S := TurnToString(LoadTurn); 826 RisedTextOut(Canvas, 514 - BiColorTextWidth(Canvas, S), y0Mini + 61, S); 822 827 end 823 828 else if Page = pgEditRandom then … … 833 838 begin 834 839 // DLine(Canvas,344,514,y0Mini+61+19,MainTexture.ColorBevelLight,MainTexture.ColorBevelShade); 835 s:= Format(Phrases2.Lookup('MAPPROP'),840 S := Format(Phrases2.Lookup('MAPPROP'), 836 841 [(nMapLandTiles * 100 + 556) div 1112, 837 842 // 1112 is typical for world with 100% size and default land mass 838 843 nMapStartPositions]); 839 RisedTextOut(Canvas, x0Mini - BiColorTextWidth(Canvas, s) div 2,840 y0Mini + 61, s);844 RisedTextOut(Canvas, x0Mini - BiColorTextWidth(Canvas, S) div 2, 845 y0Mini + 61, S); 841 846 end; 842 847 … … 881 886 MainTexture.ColorBevelLight); 882 887 883 s:= '';888 S := ''; 884 889 if MiniMap.Mode = mmPicture then 885 890 begin 886 DpiBit Canvas(Canvas, xMini + 2, yMini + 2, MiniMap.Size.X * 2, MiniMap.Size.Y,891 DpiBitBltCanvas(Canvas, xMini + 2, yMini + 2, MiniMap.Size.X * 2, MiniMap.Size.Y, 887 892 MiniMap.Bitmap.Canvas, 0, 0); 888 893 if Page = pgStartRandom then 889 s := Phrases.Lookup('RANMAP')894 S := Phrases.Lookup('RANMAP'); 890 895 end 891 896 else if MiniMap.Mode = mmMultiPlayer then 892 s:= Phrases.Lookup('MPMAP')897 S := Phrases.Lookup('MPMAP') 893 898 else if Page = pgStartMap then 894 s:= Copy(MapFileName, 1, Length(MapFileName) - Length(CevoMapExt))899 S := Copy(MapFileName, 1, Length(MapFileName) - Length(CevoMapExt)) 895 900 else if Page = pgEditMap then 896 s:= List.Items[List.ItemIndex]901 S := List.Items[List.ItemIndex] 897 902 else if Page = pgNoLoad then 898 s:= Phrases.Lookup('NOGAMES');899 if s<> '' then900 RisedTextOut(Canvas, x0Mini + 2 - BiColorTextWidth(Canvas, s) div 2,901 y0Mini - 8, s);903 S := Phrases.Lookup('NOGAMES'); 904 if S <> '' then 905 RisedTextOut(Canvas, x0Mini + 2 - BiColorTextWidth(Canvas, S) div 2, 906 y0Mini - 8, S); 902 907 end; 903 908 end; … … 905 910 procedure TStartDlg.FormShow(Sender: TObject); 906 911 begin 912 {$IFDEF UNIX} 913 ShowInTaskBar := stAlways; 914 {$ENDIF} 907 915 MainTexture.Age := -1; 908 916 List.Font.Color := MainTexture.ColorMark; … … 949 957 begin // load 950 958 FileName := List.Items[List.ItemIndex]; 951 if LoadGame(GetSavedDir + DirectorySeparator, FileName + CevoExt, LoadTurn, false)959 if LoadGame(GetSavedDir + DirectorySeparator, FileName + CevoExt, LoadTurn, False) 952 960 then 953 961 UnlistBackupFile(FileName) … … 969 977 with Reg do 970 978 try 971 OpenKey(AppRegistryKey, true);979 OpenKey(AppRegistryKey, True); 972 980 if ValueExists('GameCount') then GameCount := ReadInteger('GameCount') 973 981 else GameCount := 0; … … 1158 1166 if Assigned(PlayersBrain[I]) and (PlayersBrain[I].Kind = btTerm) then begin 1159 1167 PlayersBrain[I] := nil; 1160 PlayerSlots[I].DiffUpBtn.Visible := false;1168 PlayerSlots[I].DiffUpBtn.Visible := False; 1161 1169 PlayerSlots[I].DiffUpBtn.Tag := 0; 1162 PlayerSlots[I].DiffDownBtn.Visible := false;1170 PlayerSlots[I].DiffDownBtn.Visible := False; 1163 1171 PlayerSlots[I].DiffDownBtn.Tag := 0; 1164 1172 if PlayerSlots[I].OfferMultiple then begin 1165 PlayerSlots[I].MultiBtn.Visible := false;1173 PlayerSlots[I].MultiBtn.Visible := False; 1166 1174 PlayerSlots[I].MultiBtn.Tag := 0; 1167 1175 end; … … 1189 1197 J := FixedLines; 1190 1198 while (J < PopupMenu1.Items.Count) and 1191 (StrIComp( pchar(MenuItem.Caption), pchar(PopupMenu1.Items[J].Caption)) > 0) do1199 (StrIComp(PChar(MenuItem.Caption), PChar(PopupMenu1.Items[J].Caption)) > 0) do 1192 1200 Inc(J); 1193 1201 MenuItem.RadioItem := True; … … 1200 1208 var 1201 1209 I: Integer; 1202 FixedLines: integer;1210 FixedLines: Integer; 1203 1211 MenuItem: TDpiMenuItem; 1204 1212 AIBrains: TBrains; … … 1234 1242 end; 1235 1243 for I := Brains.IndexOf(BrainTerm) downto 0 do // offer game interfaces 1236 if (PlayerPopupIndex = 0) or (Brains[ i].Kind = btTerm) and1244 if (PlayerPopupIndex = 0) or (Brains[I].Kind = btTerm) and 1237 1245 (PlayersBrain[0].Kind <> btNoTerm) then begin 1238 1246 OfferBrain(Brains[I], FixedLines); … … 1258 1266 if (AIBrains[I].Flags and fMultiple <> 0) or (AIBrains[I].Flags and fUsed = 0) 1259 1267 or (Brains[I] = PlayersBrain[PlayerPopupIndex]) then 1260 OfferBrain(AIBrains[ i], FixedLines);1268 OfferBrain(AIBrains[I], FixedLines); 1261 1269 FreeAndNil(AIBrains); 1262 1270 end; … … 1273 1281 repeat 1274 1282 I := FormerGames.Count; 1275 while (I > 0) and (F.Time < integer(FormerGames.Objects[I - 1])) do1283 while (I > 0) and (F.Time < Integer(FormerGames.Objects[I - 1])) do 1276 1284 Dec(I); 1277 1285 FormerGames.InsertObject(I, Copy(F.Name, 1, Length(F.Name) - 5), … … 1287 1295 procedure TStartDlg.UpdateMaps; 1288 1296 var 1289 f: TSearchRec;1297 F: TSearchRec; 1290 1298 begin 1291 1299 Maps.Clear; 1292 if FindFirst(GetMapsDir + DirectorySeparator + '*' + CevoMapExt, $21, f) = 0 then1300 if FindFirst(GetMapsDir + DirectorySeparator + '*' + CevoMapExt, $21, F) = 0 then 1293 1301 repeat 1294 Maps.Add(Copy( f.Name, 1, Length(f.Name) - Length(CevoMapExt)));1295 until FindNext( f) <> 0;1302 Maps.Add(Copy(F.Name, 1, Length(F.Name) - Length(CevoMapExt))); 1303 until FindNext(F) <> 0; 1296 1304 FindClose(F); 1297 1305 Maps.Sort; … … 1304 1312 procedure TStartDlg.ChangePage(NewPage: TStartPage); 1305 1313 var 1306 i, j, p1: integer;1307 s: string;1314 I, J, p1: Integer; 1315 S: string; 1308 1316 Reg: TRegistry; 1309 InvalidateTab0: boolean;1317 InvalidateTab0: Boolean; 1310 1318 begin 1311 1319 InvalidateTab0 := (Page = pgMain) or (NewPage = pgMain); … … 1316 1324 StartBtn.Caption := Phrases.Lookup('STARTCONTROLS', 1); 1317 1325 if Page = pgStartRandom then 1318 i:= nPlOffered1326 I := nPlOffered 1319 1327 else 1320 1328 begin 1321 i:= nMapStartPositions;1322 if i= 0 then1329 I := nMapStartPositions; 1330 if I = 0 then 1323 1331 begin 1324 1332 PlayersBrain[0] := BrainSuperVirtual; … … 1326 1334 end; 1327 1335 if PlayersBrain[0].Kind in [btNoTerm, btSuperVirtual] then 1328 inc(i);1329 if i> nPl then1330 i:= nPl;1331 if i<= nPlOffered then1336 Inc(I); 1337 if I > nPl then 1338 I := nPl; 1339 if I <= nPlOffered then 1332 1340 MultiControl := 0 1333 1341 else 1334 MultiControl := InitMulti[ i];1342 MultiControl := InitMulti[I]; 1335 1343 end; 1336 if InitAlive[ i] <> SlotAvailable then1344 if InitAlive[I] <> SlotAvailable then 1337 1345 if Page = pgStartRandom then 1338 1346 begin // restore AI assignment of last start … … 1343 1351 for p1 := 0 to nPlOffered - 1 do begin 1344 1352 PlayersBrain[p1] := nil; 1345 s:= ReadString('Control' + IntToStr(p1));1353 S := ReadString('Control' + IntToStr(p1)); 1346 1354 Difficulty[p1] := ReadInteger('Diff' + IntToStr(p1)); 1347 if s<> '' then1348 for j:= 0 to Brains.Count - 1 do1349 if AnsiCompareFileName( s, Brains[j].FileName) = 0 then1350 PlayersBrain[p1] := Brains[ j];1355 if S <> '' then 1356 for J := 0 to Brains.Count - 1 do 1357 if AnsiCompareFileName(S, Brains[J].FileName) = 0 then 1358 PlayersBrain[p1] := Brains[J]; 1351 1359 end; 1352 1360 finally … … 1356 1364 else 1357 1365 for p1 := 1 to nPl - 1 do 1358 if 1 shl p1 and InitAlive[ i] <> 0 then1366 if 1 shl p1 and InitAlive[I] <> 0 then 1359 1367 begin 1360 1368 PlayersBrain[p1] := BrainDefault; … … 1363 1371 else 1364 1372 PlayersBrain[p1] := nil; 1365 SlotAvailable := InitAlive[ i];1366 for i:= 0 to nPlOffered - 1 do1367 if (AutoDiff < 0) and Assigned(PlayersBrain[ i]) and1368 (PlayersBrain[ i].Kind in [btTerm, btRandom, btAI]) then1373 SlotAvailable := InitAlive[I]; 1374 for I := 0 to nPlOffered - 1 do 1375 if (AutoDiff < 0) and Assigned(PlayersBrain[I]) and 1376 (PlayersBrain[I].Kind in [btTerm, btRandom, btAI]) then 1369 1377 begin 1370 PlayerSlots[ i].DiffUpBtn.Tag := 768;1371 PlayerSlots[ i].DiffDownBtn.Tag := 768;1378 PlayerSlots[I].DiffUpBtn.Tag := 768; 1379 PlayerSlots[I].DiffDownBtn.Tag := 768; 1372 1380 end 1373 1381 else 1374 1382 begin 1375 PlayerSlots[ i].DiffUpBtn.Tag := 0;1376 PlayerSlots[ i].DiffDownBtn.Tag := 0;1383 PlayerSlots[I].DiffUpBtn.Tag := 0; 1384 PlayerSlots[I].DiffDownBtn.Tag := 0; 1377 1385 end; 1378 for i:= 6 to 8 do1379 if (AutoDiff < 0) and Assigned(PlayersBrain[ i]) and1380 (PlayersBrain[ i].Kind in [btTerm, btRandom, btAI]) then1386 for I := 6 to 8 do 1387 if (AutoDiff < 0) and Assigned(PlayersBrain[I]) and 1388 (PlayersBrain[I].Kind in [btTerm, btRandom, btAI]) then 1381 1389 begin 1382 PlayerSlots[ i].MultiBtn.Tag := 768;1383 PlayerSlots[ i].MultiBtn.ButtonIndex := 2 + (MultiControl shr i) and 1;1384 PlayerSlots[ i].MultiBtn.Enabled := Page = pgStartRandom1390 PlayerSlots[I].MultiBtn.Tag := 768; 1391 PlayerSlots[I].MultiBtn.ButtonIndex := 2 + (MultiControl shr I) and 1; 1392 PlayerSlots[I].MultiBtn.Enabled := Page = pgStartRandom 1385 1393 end 1386 1394 else 1387 PlayerSlots[ i].MultiBtn.Tag := 0;1395 PlayerSlots[I].MultiBtn.Tag := 0; 1388 1396 if (AutoDiff > 0) and (Page <> pgStartMap) then 1389 1397 begin … … 1424 1432 1425 1433 PaintInfo; 1426 for i:= 0 to ControlCount - 1 do1427 Controls[ i].Visible := Controls[i].Tag and (256 shl Integer(Page)) <> 0;1434 for I := 0 to ControlCount - 1 do 1435 Controls[I].Visible := Controls[I].Tag and (256 shl Integer(Page)) <> 0; 1428 1436 if Page = pgLoad then 1429 1437 ReplayBtn.Visible := MiniMap.Mode <> mmMultiPlayer; … … 1469 1477 1470 1478 procedure TStartDlg.FormMouseDown(Sender: TObject; Button: TMouseButton; 1471 Shift: TShiftState; x, y: integer);1479 Shift: TShiftState; X, Y: Integer); 1472 1480 var 1473 1481 I: Integer; 1474 1482 begin 1475 if ( y < TabHeight + 1) and (x- TabOffset < TabSize * 4) and1476 (( x- TabOffset) div TabSize <> Integer(Tab)) then1483 if (Y < TabHeight + 1) and (X - TabOffset < TabSize * 4) and 1484 ((X - TabOffset) div TabSize <> Integer(Tab)) then 1477 1485 begin 1478 1486 // Play('BUTTON_DOWN'); 1479 1487 ListIndex[Tab] := List.ItemIndex; 1480 ChangeTab(TStartTab(( x- TabOffset) div TabSize));1488 ChangeTab(TStartTab((X - TabOffset) div TabSize)); 1481 1489 end 1482 1490 else if Page = pgMain then begin … … 1493 1501 begin 1494 1502 for I := 0 to nPlOffered - 1 do 1495 if (1 shl I and SlotAvailable <> 0) and ( x>= xBrain[I]) and1496 ( y >= yBrain[I]) and (x < xBrain[I] + 64) and (y< yBrain[I] + 64) then1503 if (1 shl I and SlotAvailable <> 0) and (X >= xBrain[I]) and 1504 (Y >= yBrain[I]) and (X < xBrain[I] + 64) and (Y < yBrain[I] + 64) then 1497 1505 begin 1498 1506 InitPopup(I); … … 1504 1512 end 1505 1513 else if (AutoDiff > 1) and ((Page = pgStartRandom) or (Page = pgStartMap)) and 1506 ( x >= xDefault) and (y >= yDefault) and (x< xDefault + 64) and1507 ( y< yDefault + 64) then1514 (X >= xDefault) and (Y >= yDefault) and (X < xDefault + 64) and 1515 (Y < yDefault + 64) then 1508 1516 if Brains.GetKindCount(btAI) < 2 then 1509 1517 SimpleMessage(Phrases.Lookup('NOALTAI')) … … 1513 1521 PopupMenu1.Popup(left + xDefault + 4, top + yDefault + 4); 1514 1522 end 1515 else if (Page = pgLoad) and (LastTurn > 0) and ( y>= yTurnSlider) and1516 ( y < yTurnSlider + 7) and (x>= xTurnSlider) and1517 ( x<= xTurnSlider + wTurnSlider) then1518 begin 1519 LoadTurn := LastTurn * ( x- xTurnSlider) div wTurnSlider;1523 else if (Page = pgLoad) and (LastTurn > 0) and (Y >= yTurnSlider) and 1524 (Y < yTurnSlider + 7) and (X >= xTurnSlider) and 1525 (X <= xTurnSlider + wTurnSlider) then 1526 begin 1527 LoadTurn := LastTurn * (X - xTurnSlider) div wTurnSlider; 1520 1528 SmartInvalidate(xTurnSlider - 2, y0Mini + 61, xTurnSlider + wTurnSlider + 2, 1521 1529 yTurnSlider + 9); … … 1530 1538 if MaxTurn < 1400 then 1531 1539 begin 1532 inc(MaxTurn, 200);1540 Inc(MaxTurn, 200); 1533 1541 SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 82); 1534 1542 end; … … 1536 1544 if LoadTurn < LastTurn then 1537 1545 begin 1538 inc(LoadTurn);1546 Inc(LoadTurn); 1539 1547 SmartInvalidate(xTurnSlider - 2, y0Mini + 61, xTurnSlider + wTurnSlider 1540 1548 + 2, yTurnSlider + 9); … … 1543 1551 if StartLandMass < 96 then 1544 1552 begin 1545 inc(StartLandMass, 5);1553 Inc(StartLandMass, 5); 1546 1554 PaintInfo; 1547 1555 SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 61 + 21); … … 1556 1564 if MaxTurn > 400 then 1557 1565 begin 1558 dec(MaxTurn, 200);1566 Dec(MaxTurn, 200); 1559 1567 SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 82); 1560 1568 end; … … 1562 1570 if LoadTurn > 0 then 1563 1571 begin 1564 dec(LoadTurn);1572 Dec(LoadTurn); 1565 1573 SmartInvalidate(xTurnSlider - 2, y0Mini + 61, xTurnSlider + wTurnSlider 1566 1574 + 2, yTurnSlider + 9); … … 1569 1577 if StartLandMass > 10 then 1570 1578 begin 1571 dec(StartLandMass, 5);1579 Dec(StartLandMass, 5); 1572 1580 PaintInfo; 1573 1581 SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 61 + 21); … … 1624 1632 procedure TStartDlg.RenameBtnClick(Sender: TObject); 1625 1633 var 1626 i: integer;1634 I: Integer; 1627 1635 NewName: string; 1628 f: file;1629 ok: boolean;1636 F: file; 1637 ok: Boolean; 1630 1638 MapPictureFileName: string; 1631 1639 begin … … 1645 1653 (NewName <> List.Items[List.ItemIndex]) then 1646 1654 begin 1647 for i:= 1 to Length(NewName) do1648 if NewName[ i] in ['\', '/', ':', '*', '?', '"', '<', '>', '|'] then1655 for I := 1 to Length(NewName) do 1656 if NewName[I] in ['\', '/', ':', '*', '?', '"', '<', '>', '|'] then 1649 1657 begin 1650 SimpleMessage(Format(Phrases.Lookup('NOFILENAME'), [NewName[ i]]));1658 SimpleMessage(Format(Phrases.Lookup('NOFILENAME'), [NewName[I]])); 1651 1659 Exit; 1652 1660 end; 1653 1661 if Page = pgLoad then 1654 AssignFile( f, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)1662 AssignFile(F, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt) 1655 1663 else 1656 AssignFile( f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +1664 AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] + 1657 1665 CevoMapExt); 1658 ok := true;1666 ok := True; 1659 1667 try 1660 1668 if Page = pgLoad then 1661 Rename( f, GetSavedDir + DirectorySeparator + NewName + CevoExt)1669 Rename(F, GetSavedDir + DirectorySeparator + NewName + CevoExt) 1662 1670 else 1663 Rename( f, GetMapsDir + DirectorySeparator + NewName + CevoMapExt);1671 Rename(F, GetMapsDir + DirectorySeparator + NewName + CevoMapExt); 1664 1672 except 1665 1673 // Play('INVALID'); … … 1672 1680 if FileExists(MapPictureFileName) then 1673 1681 try 1674 AssignFile( f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex]1682 AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] 1675 1683 + CevoMapPictureExt); 1676 Rename( f, GetMapsDir + DirectorySeparator + NewName + CevoMapPictureExt);1684 Rename(F, GetMapsDir + DirectorySeparator + NewName + CevoMapPictureExt); 1677 1685 except 1678 1686 end; … … 1694 1702 procedure TStartDlg.DeleteBtnClick(Sender: TObject); 1695 1703 var 1696 iDel: integer;1697 f: file;1704 iDel: Integer; 1705 F: file; 1698 1706 begin 1699 1707 if List.ItemIndex >= 0 then … … 1708 1716 begin 1709 1717 if Page = pgLoad then 1710 AssignFile( f, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)1718 AssignFile(F, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt) 1711 1719 else 1712 AssignFile( f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +1720 AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] + 1713 1721 CevoMapExt); 1714 Erase( f);1722 Erase(F); 1715 1723 iDel := List.ItemIndex; 1716 1724 if Page = pgLoad then … … 1733 1741 List.Invalidate; 1734 1742 if Page = pgLoad then 1735 TurnValid := false;1743 TurnValid := False; 1736 1744 PaintInfo; 1737 1745 if Page = pgLoad then … … 1832 1840 1833 1841 procedure TStartDlg.FormMouseUp(Sender: TObject; Button: TMouseButton; 1834 Shift: TShiftState; x, y: integer);1842 Shift: TShiftState; X, Y: Integer); 1835 1843 begin 1836 1844 Tracking := False; … … 1838 1846 1839 1847 procedure TStartDlg.FormMouseMove(Sender: TObject; Shift: TShiftState; 1840 x, y: integer);1848 X, Y: Integer); 1841 1849 var 1842 1850 OldLoadTurn: Integer; … … 1845 1853 if Tracking then 1846 1854 begin 1847 x := x- xTurnSlider;1848 if x< 0 then1849 x:= 01850 else if x> wTurnSlider then1851 x:= wTurnSlider;1855 X := X - xTurnSlider; 1856 if X < 0 then 1857 X := 0 1858 else if X > wTurnSlider then 1859 X := wTurnSlider; 1852 1860 OldLoadTurn := LoadTurn; 1853 LoadTurn := LastTurn * xdiv wTurnSlider;1861 LoadTurn := LastTurn * X div wTurnSlider; 1854 1862 if LoadTurn < OldLoadTurn then 1855 1863 begin … … 1869 1877 else if Page = pgMain then 1870 1878 begin 1871 if ( x >= ActionSideBorder) and (x< ClientWidth - ActionSideBorder) and1872 ( y >= yAction - 8) and (y< ClientHeight - ActionBottomBorder) then1879 if (X >= ActionSideBorder) and (X < ClientWidth - ActionSideBorder) and 1880 (Y >= yAction - 8) and (Y < ClientHeight - ActionBottomBorder) then 1873 1881 begin 1874 NewSelectedAction := TMainAction(( y- (yAction - 8)) div ActionPitch);1882 NewSelectedAction := TMainAction((Y - (yAction - 8)) div ActionPitch); 1875 1883 if not (NewSelectedAction in ActionsOffered) then 1876 1884 NewSelectedAction := maNone; … … 1918 1926 end; 1919 1927 1920 1921 1928 end. -
branches/highdpi/UnitProcessing.pas
r303 r465 13 13 TMoveInfo = record 14 14 MoveType: TMoveType; 15 Cost, ToMaster, EndHealth, Defender, Dcix, Duix, EndHealthDef: integer;16 MountainDelay: boolean;15 Cost, ToMaster, EndHealth, Defender, Dcix, Duix, EndHealthDef: Integer; 16 MountainDelay: Boolean; 17 17 end; 18 18 19 19 var 20 uixSelectedTransport: integer;21 Worked: array [0 .. nPl - 1] of integer; { settler work statistics }20 uixSelectedTransport: Integer; 21 Worked: array [0 .. nPl - 1] of Integer; { settler work statistics } 22 22 23 23 // Moving/Combat 24 function HostileDamage( p, mix, Loc, MP: integer): integer;25 function CalculateMove( p, uix, ToLoc, MoveLength: integer; TestOnly: boolean;26 var MoveInfo: TMoveInfo): integer;27 function GetBattleForecast(Loc: integer; var BattleForecast: TBattleForecast;28 var Duix, Dcix, AStr, DStr, ABaseDamage, DBaseDamage: integer): integer;29 function LoadUnit( p, uix: integer; TestOnly: boolean): integer;30 function UnloadUnit( p, uix: integer; TestOnly: boolean): integer;31 procedure Recover( p, uix: integer);32 function GetMoveAdvice( p, uix: integer; var a: TMoveAdviceData): integer;33 function CanPlaneReturn( p, uix: integer;34 PlaneReturnData: TPlaneReturnData): boolean;24 function HostileDamage(P, mix, Loc, MP: Integer): Integer; 25 function CalculateMove(P, uix, ToLoc, MoveLength: Integer; TestOnly: Boolean; 26 var MoveInfo: TMoveInfo): Integer; 27 function GetBattleForecast(Loc: Integer; var BattleForecast: TBattleForecast; 28 var Duix, Dcix, AStr, DStr, ABaseDamage, DBaseDamage: Integer): Integer; 29 function LoadUnit(P, uix: Integer; TestOnly: Boolean): Integer; 30 function UnloadUnit(P, uix: Integer; TestOnly: Boolean): Integer; 31 procedure Recover(P, uix: Integer); 32 function GetMoveAdvice(P, uix: Integer; var A: TMoveAdviceData): Integer; 33 function CanPlaneReturn(P, uix: Integer; 34 PlaneReturnData: TPlaneReturnData): Boolean; 35 35 36 36 // Terrain Improvement 37 function StartJob( p, uix, NewJob: integer; TestOnly: boolean): integer;38 function Work( p, uix: integer): boolean;39 function GetJobProgress( p, Loc: integer;40 var JobProgressData: TJobProgressData): integer;37 function StartJob(P, uix, NewJob: Integer; TestOnly: Boolean): Integer; 38 function Work(P, uix: Integer): Boolean; 39 function GetJobProgress(P, Loc: Integer; 40 var JobProgressData: TJobProgressData): Integer; 41 41 42 42 // Start/End Game 43 43 procedure InitGame; 44 44 procedure ReleaseGame; 45 45 46 46 47 implementation … … 73 74 74 75 type 75 TToWorkList = array [0 .. INFIN, 0 .. nJob - 1] of word;76 TToWorkList = array [0 .. INFIN, 0 .. nJob - 1] of Word; 76 77 77 78 var … … 82 83 ____________________________________________________________________ 83 84 } 84 function HostileDamage( p, mix, Loc, MP: integer): integer;85 var 86 Tile: integer;85 function HostileDamage(P, mix, Loc, MP: Integer): Integer; 86 var 87 Tile: Integer; 87 88 begin 88 89 Tile := RealMap[Loc]; 89 if (RW[ p].Model[mix].Domain >= dSea) or (RW[p].Model[mix].Kind = mkSettler)90 and (RW[ p].Model[mix].Speed >= 200) or90 if (RW[P].Model[mix].Domain >= dSea) or (RW[P].Model[mix].Kind = mkSettler) 91 and (RW[P].Model[mix].Speed >= 200) or 91 92 (Tile and (fCity or fRiver or fCanal) <> 0) or (Tile and fTerImp = tiBase) 92 or (GWonder[woGardens].EffectiveOwner = p) then93 result := 093 or (GWonder[woGardens].EffectiveOwner = P) then 94 Result := 0 94 95 else if (Tile and fTerrain = fDesert) and 95 96 (Tile and fSpecial <> fSpecial1 { Oasis } ) then 96 97 begin 97 assert((Tile and fTerImp <> tiIrrigation) and (Tile and fTerImp <> tiFarm));98 result := (DesertThurst * MP - 1) div RW[p].Model[mix].Speed + 198 Assert((Tile and fTerImp <> tiIrrigation) and (Tile and fTerImp <> tiFarm)); 99 Result := (DesertThurst * MP - 1) div RW[P].Model[mix].Speed + 1 99 100 end 100 101 else if Tile and fTerrain = fArctic then 101 102 begin 102 assert((Tile and fTerImp <> tiIrrigation) and (Tile and fTerImp <> tiFarm));103 result := (ArcticThurst * MP - 1) div RW[p].Model[mix].Speed + 1103 Assert((Tile and fTerImp <> tiIrrigation) and (Tile and fTerImp <> tiFarm)); 104 Result := (ArcticThurst * MP - 1) div RW[P].Model[mix].Speed + 1 104 105 end 105 106 else 106 result := 0107 end; 108 109 function Controlled( p, Loc: integer; IsDest: boolean): integer;107 Result := 0; 108 end; 109 110 function Controlled(P, Loc: Integer; IsDest: Boolean): Integer; 110 111 { whether tile at Loc is in control zone of enemy unit 111 112 returns combination of tile control flags } 112 113 var 113 Loc1, V8: integer;114 Loc1, V8: Integer; 114 115 Adjacent: TVicinity8Loc; 115 116 begin 116 result := 0;117 if IsDest and (Occupant[Loc] = p) and (ZoCMap[Loc] > 0) then118 exit;117 Result := 0; 118 if IsDest and (Occupant[Loc] = P) and (ZoCMap[Loc] > 0) then 119 Exit; 119 120 // destination tile, not controlled if already occupied 120 121 121 if (RealMap[Loc] and fCity = 0) or ( integer(RealMap[Loc] shr 27) <> p) and122 (ServerVersion[ p] >= $000EF0) then122 if (RealMap[Loc] and fCity = 0) or (Integer(RealMap[Loc] shr 27) <> P) and 123 (ServerVersion[P] >= $000EF0) then 123 124 begin // not own city 124 125 V8_to_Loc(Loc, Adjacent); … … 127 128 Loc1 := Adjacent[V8]; 128 129 if (Loc1 >= 0) and (Loc1 < MapSize) and (ZoCMap[Loc1] > 0) and 129 (Occupant[Loc1] >= 0) and (Occupant[Loc1] <> p) and130 (RW[ p].Treaty[Occupant[Loc1]] < trAlliance) then131 if ObserveLevel[Loc1] and (3 shl ( p* 2)) > 0 then130 (Occupant[Loc1] >= 0) and (Occupant[Loc1] <> P) and 131 (RW[P].Treaty[Occupant[Loc1]] < trAlliance) then 132 if ObserveLevel[Loc1] and (3 shl (P * 2)) > 0 then 132 133 begin // p observes tile 133 result := coKnown or coTrue;134 exit134 Result := coKnown or coTrue; 135 Exit; 135 136 end 136 137 else 137 result := coTrue; // p does not observe tile138 end; 139 end 140 end; 141 142 function GetMoveCost( p, mix, FromLoc, ToLoc, MoveLength: integer;143 var MoveCost: integer): integer;138 Result := coTrue; // p does not observe tile 139 end; 140 end; 141 end; 142 143 function GetMoveCost(P, mix, FromLoc, ToLoc, MoveLength: Integer; 144 var MoveCost: Integer): Integer; 144 145 // MoveLength - 2 for short move, 3 for long move 145 146 var 146 FromTile, ToTile: integer;147 begin 148 result := eOK;147 FromTile, ToTile: Integer; 148 begin 149 Result := eOK; 149 150 FromTile := RealMap[FromLoc]; 150 151 ToTile := RealMap[ToLoc]; 151 with RW[ p].Model[mix] do152 with RW[P].Model[mix] do 152 153 begin 153 154 case Domain of … … 159 160 if (FromTile and (fRR or fCity) <> 0) and 160 161 (ToTile and (fRR or fCity) <> 0) then 161 if GWonder[woShinkansen].EffectiveOwner = pthen162 if GWonder[woShinkansen].EffectiveOwner = P then 162 163 MoveCost := 0 163 164 else … … 173 174 MoveCost := 20 174 175 else if Cap[mcOver] > 0 then 175 result := eNoRoad176 Result := eNoRoad 176 177 else 177 178 case Terrain[ToTile and fTerrain].MoveCost of … … 180 181 2: 181 182 begin 182 assert(Speed - 150 <= 600);183 Assert(Speed - 150 <= 600); 183 184 MoveCost := 50 + (Speed - 150) * 13 shr 7; // heavy terrain 184 185 end; … … 186 187 begin 187 188 MoveCost := Speed; 188 result := eMountains;189 exit189 Result := eMountains; 190 Exit; 190 191 end; 191 192 end; … … 193 194 end 194 195 else 195 result := eDomainMismatch;196 Result := eDomainMismatch; 196 197 197 198 dSea: … … 201 202 MoveCost := 50 * MoveLength { valid move } 202 203 else 203 result := eNoNav { navigation required for open sea }204 else 205 result := eDomainMismatch;204 Result := eNoNav { navigation required for open sea } 205 else 206 Result := eDomainMismatch; 206 207 207 208 dAir: 208 209 MoveCost := 50 * MoveLength; { always valid move } 209 end 210 end 211 end; 212 213 function CalculateMove( p, uix, ToLoc, MoveLength: integer; TestOnly: boolean;214 var MoveInfo: TMoveInfo): integer;210 end; 211 end; 212 end; 213 214 function CalculateMove(P, uix, ToLoc, MoveLength: Integer; TestOnly: Boolean; 215 var MoveInfo: TMoveInfo): Integer; 215 216 var 216 217 uix1, p1, FromLoc, DestControlled, AStr, DStr, ABaseDamage, 217 DBaseDamage: integer;218 DBaseDamage: Integer; 218 219 PModel: ^TModel; 219 220 BattleForecast: TBattleForecast; 220 221 begin 221 with RW[ p], Un[uix] do222 with RW[P], Un[uix] do 222 223 begin 223 224 PModel := @Model[mix]; 224 225 FromLoc := Loc; 225 226 226 BattleForecast.pAtt := p;227 BattleForecast.pAtt := P; 227 228 BattleForecast.mixAtt := mix; 228 229 BattleForecast.HealthAtt := Health; … … 230 231 BattleForecast.FlagsAtt := Flags; 231 232 BattleForecast.Movement := Movement; 232 result := GetBattleForecast(ToLoc, BattleForecast, MoveInfo.Duix,233 Result := GetBattleForecast(ToLoc, BattleForecast, MoveInfo.Duix, 233 234 MoveInfo.Dcix, AStr, DStr, ABaseDamage, DBaseDamage); 234 235 235 if result = eHiddenUnit then236 if Result = eHiddenUnit then 236 237 if TestOnly then 237 result := eOK // behave just like unit was moving238 Result := eOK // behave just like unit was moving 238 239 else if Mode > moLoading_Fast then 239 240 Map[ToLoc] := Map[ToLoc] or fHiddenUnit; 240 if result = eStealthUnit then241 if Result = eStealthUnit then 241 242 if TestOnly then 242 result := eOK // behave just like unit was moving243 Result := eOK // behave just like unit was moving 243 244 else if Mode > moLoading_Fast then 244 245 Map[ToLoc] := Map[ToLoc] or fStealthUnit; 245 if result < rExecuted then246 exit;247 248 case result of246 if Result < rExecuted then 247 Exit; 248 249 case Result of 249 250 eOK: 250 251 MoveInfo.MoveType := mtMove; … … 260 261 begin 261 262 p1 := RealMap[ToLoc] shr 27; 262 if (p1 < nPl) and (p1 <> p) and263 if (p1 < nPl) and (p1 <> P) and 263 264 ((RealMap[Loc] shr 27 <> Cardinal(p1)) and (PModel.Kind <> mkDiplomat) 264 265 and (Treaty[p1] >= trPeace) and (Treaty[p1] < trAlliance) or 265 266 (RealMap[ToLoc] and fCity <> 0) and (Treaty[p1] >= trPeace)) then 266 267 begin 267 result := eTreaty;268 exit268 Result := eTreaty; 269 Exit; 269 270 end; // keep peace treaty! 270 271 end; 271 272 if (RealMap[ToLoc] and fCity <> 0) and 272 (RealMap[ToLoc] shr 27 <> Cardinal( p)) then // empty enemy city273 (RealMap[ToLoc] shr 27 <> Cardinal(P)) then // empty enemy city 273 274 if PModel.Kind = mkDiplomat then 274 275 begin … … 279 280 if PModel.Flags and mdCivil <> 0 then 280 281 begin 281 result := eNoCapturer;282 exit282 Result := eNoCapturer; 283 Exit; 283 284 end; 284 285 MoveInfo.MoveType := mtCapture; … … 288 289 if (PModel.Domain = dSea) and (PModel.Cap[mcArtillery] = 0) then 289 290 begin 290 result := eDomainMismatch;291 exit291 Result := eDomainMismatch; 292 Exit; 292 293 end 293 294 else if (PModel.Attack = 0) and … … 295 296 then 296 297 begin 297 result := eNoBombarder;298 exit298 Result := eNoBombarder; 299 Exit; 299 300 end 300 301 else if Movement < 100 then 301 302 begin 302 result := eNoTime_Bombard;303 exit303 Result := eNoTime_Bombard; 304 Exit; 304 305 end; 305 306 MoveInfo.MoveType := mtBombard; 306 result := eBombarded;307 end 308 end; 309 310 MoveInfo.MountainDelay := false;307 Result := eBombarded; 308 end; 309 end; 310 311 MoveInfo.MountainDelay := False; 311 312 if MoveInfo.MoveType in [mtAttack, mtBombard, mtExpel] then 312 313 begin … … 316 317 then 317 318 begin 318 result := eViolation;319 exit319 Result := eViolation; 320 Exit; 320 321 end; 321 322 if MoveInfo.MoveType = mtBombard then … … 328 329 MoveInfo.EndHealth := BattleForecast.EndHealthAtt; 329 330 MoveInfo.EndHealthDef := BattleForecast.EndHealthDef; 330 end 331 end; 331 332 end 332 333 else // if MoveInfo.MoveType in [mtMove,mtCapture,mtSpyMission] then … … 336 337 MoveInfo.Cost := PModel.Speed; 337 338 if RealMap[ToLoc] and fTerrain < fGrass then 338 result := eDomainMismatch;339 Result := eDomainMismatch; 339 340 end 340 341 else 341 342 begin 342 result := GetMoveCost(p, mix, FromLoc, ToLoc, MoveLength,343 Result := GetMoveCost(P, mix, FromLoc, ToLoc, MoveLength, 343 344 MoveInfo.Cost); 344 if result = eMountains then345 begin 346 result := eOK;347 MoveInfo.MountainDelay := true345 if Result = eMountains then 346 begin 347 Result := eOK; 348 MoveInfo.MountainDelay := True 348 349 end; 349 350 end; 350 if ( result >= rExecuted) and (MoveInfo.MoveType = mtSpyMission) then351 result := eMissionDone;351 if (Result >= rExecuted) and (MoveInfo.MoveType = mtSpyMission) then 352 Result := eMissionDone; 352 353 353 354 MoveInfo.ToMaster := -1; 354 if ( result = eDomainMismatch) and (PModel.Domain < dSea) and355 if (Result = eDomainMismatch) and (PModel.Domain < dSea) and 355 356 (PModel.Cap[mcOver] = 0) then 356 357 begin … … 360 361 (TroopLoad < Model[mix].MTrans * Model[mix].Cap[mcSeaTrans]) then 361 362 begin 362 result := eLoaded;363 Result := eLoaded; 363 364 MoveInfo.Cost := PModel.Speed; 364 365 MoveInfo.ToMaster := uix1; … … 377 378 (AirLoad < Model[mix].MTrans * Model[mix].Cap[mcCarrier]) then 378 379 begin // load plane to ship 379 result := eLoaded;380 Result := eLoaded; 380 381 MoveInfo.ToMaster := uix1; 381 382 if (uixSelectedTransport >= 0) and (uix1 = uixSelectedTransport) 382 383 then 383 384 Break; 384 end 385 end; 385 386 end; 386 if result < rExecuted then387 exit;387 if Result < rExecuted then 388 Exit; 388 389 389 390 if (Master < 0) and (MoveInfo.ToMaster < 0) then 390 MoveInfo.EndHealth := Health - HostileDamage( p, mix, ToLoc,391 MoveInfo.EndHealth := Health - HostileDamage(P, mix, ToLoc, 391 392 MoveInfo.Cost) 392 393 else … … 394 395 395 396 if (Mode = moPlaying) and (PModel.Flags and mdZOC <> 0) and (Master < 0) 396 and (MoveInfo.ToMaster < 0) and (Controlled( p, FromLoc, false) >= coTrue)397 and (MoveInfo.ToMaster < 0) and (Controlled(P, FromLoc, False) >= coTrue) 397 398 then 398 399 begin 399 DestControlled := Controlled( p, ToLoc, true);400 DestControlled := Controlled(P, ToLoc, True); 400 401 if DestControlled >= coTrue + coKnown then 401 402 begin 402 result := eZOC;403 exit403 Result := eZOC; 404 Exit; 404 405 end 405 406 else if not TestOnly and (DestControlled >= coTrue) then 406 407 begin 407 result := eZOC_EnemySpotted;408 exit409 end 408 Result := eZOC_EnemySpotted; 409 Exit; 410 end; 410 411 end; 411 if (Movement = 0) and (ServerVersion[ p] >= $0100F1) or412 if (Movement = 0) and (ServerVersion[P] >= $0100F1) or 412 413 (MoveInfo.Cost > Movement) then 413 414 if (Master >= 0) or (MoveInfo.ToMaster >= 0) then 414 415 begin 415 result := eNoTime_Load;416 exit416 Result := eNoTime_Load; 417 Exit; 417 418 end 418 419 else 419 420 begin 420 result := eNoTime_Move;421 exit421 Result := eNoTime_Move; 422 Exit; 422 423 end; 423 424 if (MoveInfo.EndHealth <= 0) or (MoveInfo.MoveType = mtSpyMission) then 424 result := result or rUnitRemoved;425 Result := Result or rUnitRemoved; 425 426 // spy mission or victim of HostileDamage 426 427 … … 433 434 MoveInfo.Defender := RealMap[ToLoc] shr 27; 434 435 SearchCity(ToLoc, MoveInfo.Defender, MoveInfo.Dcix); 435 end 436 end 437 end; // CalculateMove438 439 function GetBattleForecast(Loc: integer; var BattleForecast: TBattleForecast;440 var Duix, Dcix, AStr, DStr, ABaseDamage, DBaseDamage: integer): integer;441 var 442 Time, Defender, ABon, DBon, DCnt, MultiDamage: integer;436 end; 437 end; 438 end; 439 440 function GetBattleForecast(Loc: Integer; var BattleForecast: TBattleForecast; 441 var Duix, Dcix, AStr, DStr, ABaseDamage, DBaseDamage: Integer): Integer; 442 var 443 Time, Defender, ABon, DBon, DCnt, MultiDamage: Integer; 443 444 PModel, DModel: ^TModel; 444 445 begin … … 448 449 if (Defender < 0) or (Defender = pAtt) then 449 450 begin 450 result := eOK;451 exit451 Result := eOK; 452 Exit; 452 453 end; // no attack, simple move 453 454 … … 458 459 EndHealthAtt := HealthAtt; 459 460 EndHealthDef := RW[Defender].Un[Duix].Health; 460 result := eOK;461 exit461 Result := eOK; 462 Exit; 462 463 end; 463 464 … … 469 470 (ObserveLevel[Loc] shr (2 * pAtt) and 3 < lObserveAll) then 470 471 begin 471 result := eHiddenUnit;472 exit;472 Result := eHiddenUnit; 473 Exit; 473 474 end; // attacking submarine not allowed 474 475 if (DModel.Cap[mcStealth] > 0) and 475 476 (ObserveLevel[Loc] shr (2 * pAtt) and 3 <> lObserveSuper) then 476 477 begin 477 result := eStealthUnit;478 exit;478 Result := eStealthUnit; 479 Exit; 479 480 end; // attacking stealth aircraft not allowed 480 481 if (DModel.Domain = dAir) and (DModel.Kind <> mkSpecial_Glider) and 481 482 (PModel.Domain <> dAir) then 482 483 begin 483 result := eDomainMismatch;484 exit484 Result := eDomainMismatch; 485 Exit; 485 486 end; // can't attack plane 486 487 end; … … 491 492 (PModel.Domain = dSea) and (RealMap[Loc] and fTerrain >= fGrass)) then 492 493 begin 493 result := eDomainMismatch;494 exit494 Result := eDomainMismatch; 495 Exit; 495 496 end; 496 497 if (PModel.Attack = 0) and not((PModel.Cap[mcBombs] > 0) and 497 498 (FlagsAtt and unBombsLoaded <> 0) and (DModel.Domain < dAir)) then 498 499 begin 499 result := eInvalid;500 exit500 Result := eInvalid; 501 Exit; 501 502 end; 502 503 503 504 if Movement = 0 then 504 505 begin 505 result := eNoTime_Attack;506 exit507 end; 508 509 {$IFOPT O-} assert(InvalidTreatyMap = 0); {$ENDIF}506 Result := eNoTime_Attack; 507 Exit; 508 end; 509 510 {$IFOPT O-}Assert(InvalidTreatyMap = 0); {$ENDIF} 510 511 if RW[pAtt].Treaty[Defender] >= trPeace then 511 512 begin 512 513 if (PModel.Domain <> dAir) and (PModel.Attack > 0) and 513 ( integer(RealMap[Loc] shr 27) = pAtt) then514 (Integer(RealMap[Loc] shr 27) = pAtt) then 514 515 if Movement >= 100 then 515 516 begin // expel friendly unit 516 517 EndHealthDef := RW[Defender].Un[Duix].Health; 517 518 EndHealthAtt := HealthAtt; 518 result := eExpelled519 Result := eExpelled 519 520 end 520 521 else 521 result := eNoTime_Expel522 Result := eNoTime_Expel 522 523 else 523 result := eTreaty;524 exit;524 Result := eTreaty; 525 Exit; 525 526 end; 526 527 … … 533 534 (Continent[RW[Defender].City[Dcix].Loc] = GrWallContinent[Defender])) 534 535 then 535 inc(DBon, 8)536 Inc(DBon, 8) 536 537 else if (PModel.Domain = dSea) and 537 538 (RW[Defender].City[Dcix].Built[imCoastalFort] = 1) then 538 inc(DBon, 4)539 Inc(DBon, 4) 539 540 else if (PModel.Domain = dAir) and 540 541 (RW[Defender].City[Dcix].Built[imMissileBat] = 1) then 541 inc(DBon, 4);542 Inc(DBon, 4); 542 543 if RW[Defender].City[Dcix].Built[imBunker] = 1 then 543 inc(DBon, 4)544 Inc(DBon, 4) 544 545 end; 545 546 if (PModel.Domain = dAir) and (DModel.Cap[mcAirDef] > 0) then 546 inc(DBon, 4);547 Inc(DBon, 4); 547 548 DStr := DModel.Defense * DBon * 100; 548 549 if (DModel.Domain = dAir) and ((RealMap[Loc] and fCity <> 0) or … … 577 578 DBaseDamage := 1; 578 579 if DBaseDamage > RW[Defender].Un[Duix].Health then 579 DBaseDamage := RW[Defender].Un[Duix].Health 580 DBaseDamage := RW[Defender].Un[Duix].Health; 580 581 end; 581 582 … … 589 590 ABaseDamage := 1; 590 591 if ABaseDamage > HealthAtt then 591 ABaseDamage := HealthAtt 592 ABaseDamage := HealthAtt; 592 593 end; 593 594 … … 621 622 622 623 if EndHealthDef > 0 then 623 result := eLost624 Result := eLost 624 625 else if EndHealthAtt > 0 then 625 result := eWon626 Result := eWon 626 627 else 627 result := eBloody628 end 629 end; // GetBattleForecast630 631 function LoadUnit( p, uix: integer; TestOnly: boolean): integer;632 var 633 uix1, d, Cost, ToMaster: integer;634 begin 635 result := eOK;636 with RW[ p].Un[uix] do637 begin 638 d := RW[p].Model[mix].Domain;639 if (Master >= 0) or ( d= dSea) or640 (RW[ p].Model[mix].Cap[mcAirTrans] + RW[p].Model[mix].Cap[mcOver] > 0) then641 result := eViolation628 Result := eBloody; 629 end; 630 end; 631 632 function LoadUnit(P, uix: Integer; TestOnly: Boolean): Integer; 633 var 634 uix1, D, Cost, ToMaster: Integer; 635 begin 636 Result := eOK; 637 with RW[P].Un[uix] do 638 begin 639 D := RW[P].Model[mix].Domain; 640 if (Master >= 0) or (D = dSea) or 641 (RW[P].Model[mix].Cap[mcAirTrans] + RW[P].Model[mix].Cap[mcOver] > 0) then 642 Result := eViolation 642 643 else 643 644 begin 644 645 ToMaster := -1; 645 for uix1 := 0 to RW[ p].nUn - 1 do646 if RW[ p].Un[uix1].Loc = Loc then647 with RW[ p].Un[uix1], RW[p].Model[mix] do648 if ( d< dSea) and646 for uix1 := 0 to RW[P].nUn - 1 do 647 if RW[P].Un[uix1].Loc = Loc then 648 with RW[P].Un[uix1], RW[P].Model[mix] do 649 if (D < dSea) and 649 650 (TroopLoad < MTrans * (Cap[mcSeaTrans] + Cap[mcAirTrans])) or 650 ( d= dAir) and (AirLoad < MTrans * Cap[mcCarrier]) then651 (D = dAir) and (AirLoad < MTrans * Cap[mcCarrier]) then 651 652 begin { load onto unit uix1 } 652 653 if (uixSelectedTransport < 0) or (uix1 = uixSelectedTransport) … … 654 655 begin 655 656 ToMaster := uix1; 656 Break 657 Break; 657 658 end 658 659 else if ToMaster < 0 then … … 660 661 end; 661 662 if ToMaster < 0 then 662 result := eNoLoadCapacity663 Result := eNoLoadCapacity 663 664 else 664 665 begin 665 if d= dAir then666 if D = dAir then 666 667 Cost := 100 667 668 else 668 Cost := RW[ p].Model[mix].Speed;669 Cost := RW[P].Model[mix].Speed; 669 670 if Movement < Cost then 670 result := eNoTime_Load671 Result := eNoTime_Load 671 672 else if not TestOnly then 672 673 begin 673 FreeUnit( p, uix);674 dec(Movement, Cost);675 if d= dAir then676 inc(RW[p].Un[ToMaster].AirLoad)674 FreeUnit(P, uix); 675 Dec(Movement, Cost); 676 if D = dAir then 677 Inc(RW[P].Un[ToMaster].AirLoad) 677 678 else 678 inc(RW[p].Un[ToMaster].TroopLoad);679 Inc(RW[P].Un[ToMaster].TroopLoad); 679 680 Master := ToMaster; 680 681 UpdateUnitMap(Loc); 681 end 682 end 683 end 684 end 685 end; 686 687 function UnloadUnit( p, uix: integer; TestOnly: boolean): integer;688 var 689 Cost: integer;690 begin 691 result := eOK;692 with RW[ p].Un[uix] do682 end; 683 end; 684 end; 685 end; 686 end; 687 688 function UnloadUnit(P, uix: Integer; TestOnly: Boolean): Integer; 689 var 690 Cost: Integer; 691 begin 692 Result := eOK; 693 with RW[P].Un[uix] do 693 694 if Master < 0 then 694 result := eNotChanged695 else if (RW[ p].Model[mix].Domain < dSea) and695 Result := eNotChanged 696 else if (RW[P].Model[mix].Domain < dSea) and 696 697 (RealMap[Loc] and fTerrain < fGrass) then 697 result := eDomainMismatch698 Result := eDomainMismatch 698 699 // else if (RW[p].Model[mix].Domain<dSea) 699 700 // and (RW[p].Model[mix].Flags and mdCivil<>0) … … 701 702 else 702 703 begin 703 if RW[ p].Model[mix].Domain = dAir then704 if RW[P].Model[mix].Domain = dAir then 704 705 Cost := 100 705 706 else 706 Cost := RW[ p].Model[mix].Speed;707 Cost := RW[P].Model[mix].Speed; 707 708 if Movement < Cost then 708 result := eNoTime_Load709 Result := eNoTime_Load 709 710 else if not TestOnly then 710 711 begin 711 dec(Movement, Cost);712 if RW[ p].Model[mix].Domain = dAir then713 dec(RW[p].Un[Master].AirLoad)714 else 715 begin 716 dec(RW[p].Un[Master].TroopLoad);712 Dec(Movement, Cost); 713 if RW[P].Model[mix].Domain = dAir then 714 Dec(RW[P].Un[Master].AirLoad) 715 else 716 begin 717 Dec(RW[P].Un[Master].TroopLoad); 717 718 // Movement:=0 // no more movement after unload 718 719 end; 719 720 Master := -1; 720 PlaceUnit( p, uix);721 PlaceUnit(P, uix); 721 722 UpdateUnitMap(Loc); 722 723 end; 723 end 724 end; 725 726 procedure Recover( p, uix: integer);727 var 728 cix, Recovery: integer;729 begin 730 with RW[ p], Un[uix] do724 end; 725 end; 726 727 procedure Recover(P, uix: Integer); 728 var 729 cix, Recovery: Integer; 730 begin 731 with RW[P], Un[uix] do 731 732 begin 732 733 if (Master >= 0) and (Model[Un[Master].mix].Cap[mcSupplyShip] > 0) then … … 738 739 cix := nCity - 1; 739 740 while (cix >= 0) and (City[cix].Loc <> Loc) do 740 dec(cix);741 Dec(cix); 741 742 if City[cix].Flags and chDisorder <> 0 then 742 743 Recovery := NoCityRecovery … … 761 762 if Recovery > 100 - Health then 762 763 Recovery := 100 - Health; 763 inc(Health, Recovery);764 Inc(Health, Recovery); 764 765 end; 765 766 end; 766 767 767 function GetMoveAdvice( p, uix: integer; var a: TMoveAdviceData): integer;768 function GetMoveAdvice(P, uix: Integer; var A: TMoveAdviceData): Integer; 768 769 const 769 770 // domains … … 777 778 gmaAlpine = 8; 778 779 var 779 i, FromLoc, EndLoc, T, T1, maxmov, initmov, Loc, Loc1, FromTile, ToTile, V8,780 I, FromLoc, EndLoc, T, T1, maxmov, initmov, Loc, Loc1, FromTile, ToTile, V8, 780 781 MoveInfo, HeavyCost, RailCost, MoveCost, AddDamage, MaxDamage, 781 MovementLeft: integer;782 MovementLeft: Integer; 782 783 Map: ^TTileList; 783 784 Q: TIPQ; 784 785 Adjacent: TVicinity8Loc; 785 From: array [0 .. lxmax * lymax - 1] of integer;786 Time: array [0 .. lxmax * lymax - 1] of integer;787 Damage: array [0 .. lxmax * lymax - 1] of integer;788 MountainDelay, Resistant: boolean;786 From: array [0 .. lxmax * lymax - 1] of Integer; 787 Time: array [0 .. lxmax * lymax - 1] of Integer; 788 Damage: array [0 .. lxmax * lymax - 1] of Integer; 789 MountainDelay, Resistant: Boolean; 789 790 // tt,tt0: int64; 790 791 begin 791 792 // QueryPerformanceCounter(tt0); 792 793 793 MaxDamage := RW[ p].Un[uix].Health - 1;794 if MaxDamage > a.MaxHostile_MovementLeft then795 if a.MaxHostile_MovementLeft >= 0 then796 MaxDamage := a.MaxHostile_MovementLeft794 MaxDamage := RW[P].Un[uix].Health - 1; 795 if MaxDamage > A.MaxHostile_MovementLeft then 796 if A.MaxHostile_MovementLeft >= 0 then 797 MaxDamage := A.MaxHostile_MovementLeft 797 798 else 798 799 MaxDamage := 0; 799 800 800 Map := @(RW[ p].Map^);801 if ( a.ToLoc <> maNextCity) and ((a.ToLoc < 0) or (a.ToLoc >= MapSize)) then802 begin 803 result := eInvalid;804 exit801 Map := @(RW[P].Map^); 802 if (A.ToLoc <> maNextCity) and ((A.ToLoc < 0) or (A.ToLoc >= MapSize)) then 803 begin 804 Result := eInvalid; 805 Exit; 805 806 end; 806 if ( a.ToLoc <> maNextCity) and (Map[a.ToLoc] and fTerrain = fUNKNOWN) then807 begin 808 result := eNoWay;809 exit807 if (A.ToLoc <> maNextCity) and (Map[A.ToLoc] and fTerrain = fUNKNOWN) then 808 begin 809 Result := eNoWay; 810 Exit; 810 811 end; 811 812 812 with RW[ p].Model[RW[p].Un[uix].mix] do813 with RW[P].Model[RW[P].Un[uix].mix] do 813 814 case Domain of 814 815 dGround: 815 if ( a.ToLoc <> maNextCity) and (Map[a.ToLoc] and fTerrain = fOcean) then816 begin 817 result := eDomainMismatch;818 exit816 if (A.ToLoc <> maNextCity) and (Map[A.ToLoc] and fTerrain = fOcean) then 817 begin 818 Result := eDomainMismatch; 819 Exit; 819 820 end 820 821 else … … 825 826 MoveInfo := gmaGround_NoZoC; 826 827 if Cap[mcOver] > 0 then 827 inc(MoveInfo, gmaOver);828 Inc(MoveInfo, gmaOver); 828 829 if Cap[mcAlpine] > 0 then 829 inc(MoveInfo, gmaAlpine);830 Inc(MoveInfo, gmaAlpine); 830 831 HeavyCost := 50 + (Speed - 150) * 13 shr 7; 831 if GWonder[woShinkansen].EffectiveOwner = pthen832 if GWonder[woShinkansen].EffectiveOwner = P then 832 833 RailCost := 0 833 834 else … … 835 836 maxmov := Speed; 836 837 initmov := 0; 837 Resistant := (GWonder[woGardens].EffectiveOwner = p) or838 Resistant := (GWonder[woGardens].EffectiveOwner = P) or 838 839 (Kind = mkSettler) and (Speed >= 200); 839 840 end; 840 841 dSea: 841 if ( a.ToLoc <> maNextCity) and (Map[a.ToLoc] and fTerrain >= fGrass) and842 (Map[ a.ToLoc] and (fCity or fUnit or fCanal) = 0) then843 begin 844 result := eDomainMismatch;845 exit842 if (A.ToLoc <> maNextCity) and (Map[A.ToLoc] and fTerrain >= fGrass) and 843 (Map[A.ToLoc] and (fCity or fUnit or fCanal) = 0) then 844 begin 845 Result := eDomainMismatch; 846 Exit; 846 847 end 847 848 else … … 849 850 MoveInfo := gmaSea; 850 851 if Cap[mcNav] > 0 then 851 inc(MoveInfo, gmaNav);852 maxmov := UnitSpeed( p, RW[p].Un[uix].mix, 100);853 initmov := maxmov - UnitSpeed( p, RW[p].Un[uix].mix,854 RW[ p].Un[uix].Health);852 Inc(MoveInfo, gmaNav); 853 maxmov := UnitSpeed(P, RW[P].Un[uix].mix, 100); 854 initmov := maxmov - UnitSpeed(P, RW[P].Un[uix].mix, 855 RW[P].Un[uix].Health); 855 856 end; 856 857 dAir: … … 859 860 maxmov := Speed; 860 861 initmov := 0; 861 end 862 end; 863 864 FromLoc := RW[ p].Un[uix].Loc;862 end; 863 end; 864 865 FromLoc := RW[P].Un[uix].Loc; 865 866 FillChar(Time, SizeOf(Time), 255); { -1 } 866 867 Damage[FromLoc] := 0; 867 868 Q := TIPQ.Create(MapSize); 868 Q.Put(FromLoc, (maxmov - RW[ p].Un[uix].Movement) shl 8);869 Q.Put(FromLoc, (maxmov - RW[P].Un[uix].Movement) shl 8); 869 870 while Q.Get(Loc, T) do 870 871 begin 871 872 Time[Loc] := T; 872 if T >= ( a.MoreTurns + 1) shl 20 then873 if T >= (A.MoreTurns + 1) shl 20 then 873 874 begin 874 875 Loc := -1; 875 Break 876 Break; 876 877 end; 877 878 FromTile := Map[Loc]; 878 if (Loc = a.ToLoc) or (a.ToLoc = maNextCity) and (FromTile and fCity <> 0)879 if (Loc = A.ToLoc) or (A.ToLoc = maNextCity) and (FromTile and fCity <> 0) 879 880 then 880 881 Break; 881 882 if T and $FFF00 = $FFF00 then 882 inc(T, $100000); // indicates mountain delay883 Inc(T, $100000); // indicates mountain delay 883 884 V8_to_Loc(Loc, Adjacent); 884 885 for V8 := 0 to 7 do … … 888 889 begin 889 890 ToTile := Map[Loc1]; 890 if (Loc1 = a.ToLoc) and (ToTile and (fUnit or fOwned) = fUnit) and891 if (Loc1 = A.ToLoc) and (ToTile and (fUnit or fOwned) = fUnit) and 891 892 not((MoveInfo and 3 = gmaSea) and (FromTile and fTerrain >= fGrass)) 892 893 and not((MoveInfo and 3 = gmaAir) and ((FromTile and fCity <> 0) or … … 897 898 end 898 899 else if (ToTile and fTerrain <> fUNKNOWN) and 899 ((Loc1 = a.ToLoc) or (ToTile and (fCity or fOwned) <> fCity))900 ((Loc1 = A.ToLoc) or (ToTile and (fCity or fOwned) <> fCity)) 900 901 // don't move through enemy cities 901 and ((Loc1 = a.ToLoc) or (ToTile and (fUnit or fOwned) <> fUnit))902 and ((Loc1 = A.ToLoc) or (ToTile and (fUnit or fOwned) <> fUnit)) 902 903 // way is blocked 903 904 and (ToTile and not FromTile and fPeace = 0) and … … 909 910 // calculate move cost, must be identic to GetMoveCost function 910 911 AddDamage := 0; 911 MountainDelay := false;912 MountainDelay := False; 912 913 case MoveInfo of 913 914 … … 955 956 begin 956 957 MoveCost := maxmov; 957 MountainDelay := true;958 MountainDelay := True; 958 959 end; 959 960 end; … … 989 990 if (MoveCost > 0) and not MountainDelay then 990 991 if V8 and 1 <> 0 then 991 inc(MoveCost, MoveCost * 2)992 Inc(MoveCost, MoveCost * 2) 992 993 else 993 inc(MoveCost, MoveCost);994 Inc(MoveCost, MoveCost); 994 995 995 996 if (MoveInfo and 2 <> 0) // ground unit, check transport load/unload … … 1010 1011 if FromTile and (fTerrain or fCity or fRiver or fCanal or 1011 1012 fSpecial1 { Oasis } ) = fDesert then 1012 inc(AddDamage, (DesertThurst * (maxmov - T shr 8 and $FFF) -1013 Inc(AddDamage, (DesertThurst * (maxmov - T shr 8 and $FFF) - 1013 1014 1) div maxmov + 1) 1014 1015 else if FromTile and (fTerrain or fCity or fRiver or fCanal) = fArctic 1015 1016 then 1016 inc(AddDamage, (ArcticThurst * (maxmov - T shr 8 and $FFF) -1017 Inc(AddDamage, (ArcticThurst * (maxmov - T shr 8 and $FFF) - 1017 1018 1) div maxmov + 1); 1018 1019 … … 1029 1030 From[Loc1] := Loc; 1030 1031 Damage[Loc1] := Damage[Loc] + AddDamage; 1031 end 1032 end 1033 end 1034 end 1035 end 1032 end; 1033 end; 1034 end; 1035 end; 1036 end; 1036 1037 end; 1037 1038 FreeAndNil(Q); 1038 if (Loc = a.ToLoc) or (a.ToLoc = maNextCity) and (Loc >= 0) and1039 if (Loc = A.ToLoc) or (A.ToLoc = maNextCity) and (Loc >= 0) and 1039 1040 (Map[Loc] and fCity <> 0) then 1040 1041 begin 1041 a.MoreTurns := T shr 20;1042 A.MoreTurns := T shr 20; 1042 1043 EndLoc := Loc; 1043 a.nStep := 0;1044 A.nStep := 0; 1044 1045 while Loc <> FromLoc do 1045 1046 begin 1046 1047 if Time[Loc] < $100000 then 1047 inc(a.nStep);1048 Inc(A.nStep); 1048 1049 Loc := From[Loc]; 1049 1050 end; 1050 1051 Loc := EndLoc; 1051 i := a.nStep;1052 I := A.nStep; 1052 1053 while Loc <> FromLoc do 1053 1054 begin 1054 1055 if Time[Loc] < $100000 then 1055 1056 begin 1056 dec(i);1057 if i< 25 then1058 begin 1059 a.dx[i] := ((Loc mod lx * 2 + Loc div lx and 1) -1057 Dec(I); 1058 if I < 25 then 1059 begin 1060 A.dx[I] := ((Loc mod lx * 2 + Loc div lx and 1) - 1060 1061 (From[Loc] mod lx * 2 + From[Loc] div lx and 1) + 3 * lx) 1061 1062 mod (2 * lx) - lx; 1062 a.dy[i] := Loc div lx - From[Loc] div lx;1063 A.dy[I] := Loc div lx - From[Loc] div lx; 1063 1064 end 1064 1065 end; 1065 1066 Loc := From[Loc]; 1066 1067 end; 1067 a.MaxHostile_MovementLeft := maxmov - Time[EndLoc] shr 8 and $FFF;1068 if a.nStep > 25 then1069 a.nStep := 25;1070 result := eOK1068 A.MaxHostile_MovementLeft := maxmov - Time[EndLoc] shr 8 and $FFF; 1069 if A.nStep > 25 then 1070 A.nStep := 25; 1071 Result := eOK 1071 1072 end 1072 1073 else 1073 result := eNoWay;1074 Result := eNoWay; 1074 1075 1075 1076 // QueryPerformanceCounter(tt);{time in s is: (tt-tt0)/PerfFreq} 1076 end; // GetMoveAdvice1077 1078 function CanPlaneReturn( p, uix: integer;1079 PlaneReturnData: TPlaneReturnData): boolean;1077 end; 1078 1079 function CanPlaneReturn(P, uix: Integer; 1080 PlaneReturnData: TPlaneReturnData): Boolean; 1080 1081 const 1081 1082 mfEnd = 1; 1082 1083 mfReached = 2; 1083 1084 var 1084 uix1, T, T1, Loc, Loc1, FromTile, ToTile, V8, MoveCost, maxmov: integer;1085 uix1, T, T1, Loc, Loc1, FromTile, ToTile, V8, MoveCost, maxmov: Integer; 1085 1086 Map: ^TTileList; 1086 1087 Q: TIPQ; 1087 1088 Adjacent: TVicinity8Loc; 1088 MapFlags: array [0 .. lxmax * lymax - 1] of byte;1089 begin 1090 Map := @(RW[ p].Map^);1089 MapFlags: array [0 .. lxmax * lymax - 1] of Byte; 1090 begin 1091 Map := @(RW[P].Map^); 1091 1092 1092 1093 // calculate possible return points 1093 1094 FillChar(MapFlags, SizeOf(MapFlags), 0); 1094 if RW[ p].Model[RW[p].Un[uix].mix].Kind = mkSpecial_Glider then1095 if RW[P].Model[RW[P].Un[uix].mix].Kind = mkSpecial_Glider then 1095 1096 begin 1096 1097 for Loc := 0 to MapSize - 1 do … … 1105 1106 (Map[Loc] and (fUnit or fOwned) <> fUnit) then 1106 1107 MapFlags[Loc] := MapFlags[Loc] or mfEnd; 1107 if RW[ p].Model[RW[p].Un[uix].mix].Cap[mcAirTrans] = 0 then1108 if RW[P].Model[RW[P].Un[uix].mix].Cap[mcAirTrans] = 0 then 1108 1109 // plane can land on carriers 1109 for uix1 := 0 to RW[ p].nUn - 1 do1110 with RW[ p].Un[uix1], RW[p].Model[mix] do1110 for uix1 := 0 to RW[P].nUn - 1 do 1111 with RW[P].Un[uix1], RW[P].Model[mix] do 1111 1112 if AirLoad < MTrans * Cap[mcCarrier] then 1112 1113 MapFlags[Loc] := MapFlags[Loc] or mfEnd; 1113 1114 end; 1114 1115 1115 with RW[ p].Un[uix] do1116 with RW[P].Un[uix] do 1116 1117 begin 1117 1118 if Master >= 0 then // can return to same carrier, even if full now 1118 1119 MapFlags[Loc] := MapFlags[Loc] or mfEnd; 1119 maxmov := RW[ p].Model[mix].Speed;1120 maxmov := RW[P].Model[mix].Speed; 1120 1121 end; 1121 1122 1122 result := false;1123 Result := False; 1123 1124 Q := TIPQ.Create(MapSize); 1124 1125 Q.Put(PlaneReturnData.Loc, (maxmov - PlaneReturnData.Movement) shl 8); … … 1128 1129 if T >= (PlaneReturnData.Fuel + 1) shl 20 then 1129 1130 begin 1130 result := false;1131 Break 1131 Result := False; 1132 Break; 1132 1133 end; 1133 1134 if MapFlags[Loc] and mfEnd <> 0 then 1134 1135 begin 1135 result := true;1136 Break 1136 Result := True; 1137 Break; 1137 1138 end; 1138 1139 FromTile := Map[Loc]; … … 1161 1162 T1 := T + MoveCost shl 8; 1162 1163 Q.Put(Loc1, T1); 1163 end 1164 end 1165 end 1164 end; 1165 end; 1166 end; 1166 1167 end; 1167 1168 FreeAndNil(Q); 1168 end; // CanPlaneReturn1169 end; 1169 1170 1170 1171 { … … 1172 1173 ____________________________________________________________________ 1173 1174 } 1174 function CalculateJobWork( p, Loc, Job: integer; var JobWork: integer): integer;1175 var 1176 TerrType: integer;1177 begin 1178 result := eOK;1175 function CalculateJobWork(P, Loc, Job: Integer; var JobWork: Integer): Integer; 1176 var 1177 TerrType: Integer; 1178 begin 1179 Result := eOK; 1179 1180 TerrType := RealMap[Loc] and fTerrain; 1180 1181 with Terrain[TerrType] do … … 1182 1183 jCity: 1183 1184 if RealMap[Loc] and fCity <> 0 then 1184 result := eInvalid1185 Result := eInvalid 1185 1186 else if IrrEff = 0 then 1186 result := eNoCityTerrain1187 Result := eNoCityTerrain 1187 1188 else 1188 1189 JobWork := CityWork; … … 1192 1193 JobWork := MoveCost * RoadWork; 1193 1194 if RealMap[Loc] and fRiver <> 0 then 1194 if RW[ p].Tech[adBridgeBuilding] >= tsApplicable then1195 inc(JobWork, RoadBridgeWork) { across river }1195 if RW[P].Tech[adBridgeBuilding] >= tsApplicable then 1196 Inc(JobWork, RoadBridgeWork) { across river } 1196 1197 else 1197 result := eNoBridgeBuilding1198 Result := eNoBridgeBuilding; 1198 1199 end 1199 1200 else 1200 result := eInvalid;1201 Result := eInvalid; 1201 1202 jRR: 1202 1203 if RealMap[Loc] and fRoad = 0 then 1203 result := eNoPreq1204 Result := eNoPreq 1204 1205 else if RealMap[Loc] and fRR <> 0 then 1205 result := eInvalid1206 Result := eInvalid 1206 1207 else 1207 1208 begin 1208 1209 JobWork := MoveCost * RRWork; 1209 1210 if RealMap[Loc] and fRiver <> 0 then 1210 inc(JobWork, RRBridgeWork); { across river }1211 Inc(JobWork, RRBridgeWork); { across river } 1211 1212 end; 1212 1213 jClear: 1213 if (TerrType = fDesert) and (GWonder[woGardens].EffectiveOwner <> p)1214 if (TerrType = fDesert) and (GWonder[woGardens].EffectiveOwner <> P) 1214 1215 then 1215 result := eInvalid1216 Result := eInvalid 1216 1217 else if ClearTerrain >= 0 then 1217 1218 JobWork := IrrClearWork 1218 1219 else 1219 result := eInvalid;1220 Result := eInvalid; 1220 1221 jIrr: 1221 1222 begin … … 1223 1224 if (IrrEff = 0) or (RealMap[Loc] and fTerImp = tiIrrigation) or 1224 1225 (RealMap[Loc] and fTerImp = tiFarm) then 1225 result := eInvalid1226 Result := eInvalid; 1226 1227 end; 1227 1228 jFarm: 1228 1229 if RealMap[Loc] and fTerImp <> tiIrrigation then 1229 result := eNoPreq1230 Result := eNoPreq 1230 1231 else 1231 1232 begin 1232 1233 JobWork := IrrClearWork * FarmWork; 1233 1234 if (JobWork <= 0) or (RealMap[Loc] and fTerImp = tiFarm) then 1234 result := eInvalid1235 Result := eInvalid; 1235 1236 end; 1236 1237 jAfforest: … … 1238 1239 JobWork := MineAfforestWork 1239 1240 else 1240 result := eInvalid;1241 Result := eInvalid; 1241 1242 jMine: 1242 1243 begin 1243 1244 JobWork := MineAfforestWork; 1244 1245 if (MineEff = 0) or (RealMap[Loc] and fTerImp = tiMine) then 1245 result := eInvalid1246 Result := eInvalid; 1246 1247 end; 1247 1248 jFort: … … 1249 1250 JobWork := MoveCost * FortWork 1250 1251 else 1251 result := eInvalid;1252 Result := eInvalid; 1252 1253 jCanal: 1253 1254 if (RealMap[Loc] and fCanal = 0) and (TerrType in TerrType_Canalable) … … 1255 1256 JobWork := CanalWork 1256 1257 else 1257 result := eInvalid;1258 Result := eInvalid; 1258 1259 jTrans: 1259 1260 begin 1260 1261 JobWork := TransWork; 1261 1262 if JobWork <= 0 then 1262 result := eInvalid1263 Result := eInvalid; 1263 1264 end; 1264 1265 jPoll: … … 1266 1267 JobWork := PollWork 1267 1268 else 1268 result := eInvalid;1269 Result := eInvalid; 1269 1270 jBase: 1270 1271 if RealMap[Loc] and fTerImp <> tiBase then 1271 1272 JobWork := MoveCost * BaseWork 1272 1273 else 1273 result := eInvalid;1274 Result := eInvalid; 1274 1275 jPillage: 1275 1276 if RealMap[Loc] and (fRoad or fRR or fCanal or fTerImp) <> 0 then 1276 1277 JobWork := PillageWork 1277 1278 else 1278 result := eInvalid;1279 end; 1280 end; // CalculateJobWork1281 1282 function StartJob( p, uix, NewJob: integer; TestOnly: boolean): integer;1283 var 1284 JobWork, Loc0, p1, uix1, TerrType: integer;1285 begin 1286 {$IFOPT O-} assert(1 shl pand InvalidTreatyMap = 0); {$ENDIF}1287 result := eOK;1288 with RW[ p].Un[uix] do1279 Result := eInvalid; 1280 end; 1281 end; 1282 1283 function StartJob(P, uix, NewJob: Integer; TestOnly: Boolean): Integer; 1284 var 1285 JobWork, Loc0, p1, uix1, TerrType: Integer; 1286 begin 1287 {$IFOPT O-}Assert(1 shl P and InvalidTreatyMap = 0); {$ENDIF} 1288 Result := eOK; 1289 with RW[P].Un[uix] do 1289 1290 begin 1290 1291 if NewJob = Job then 1291 1292 begin 1292 result := eNotChanged;1293 exit1293 Result := eNotChanged; 1294 Exit; 1294 1295 end; 1295 1296 if NewJob = jNone then … … 1297 1298 if not TestOnly then 1298 1299 Job := jNone; 1299 exit1300 Exit; 1300 1301 end; 1301 1302 Loc0 := Loc; … … 1303 1304 (NewJob <> jRR) then 1304 1305 begin 1305 result := eDeadLands;1306 exit1306 Result := eDeadLands; 1307 Exit; 1307 1308 end; 1308 1309 TerrType := RealMap[Loc0] and fTerrain; 1309 1310 if (RealMap[Loc0] and fCity <> 0) or (TerrType < fGrass) or (Master >= 0) or 1310 not((NewJob = jPillage) and (RW[ p].Model[mix].Domain = dGround) or1311 (RW[ p].Model[mix].Kind = mkSettler) or (NewJob <> jCity) and1312 (RW[ p].Model[mix].Kind = mkSlaves) and (GWonder[woPyramids].EffectiveOwner1311 not((NewJob = jPillage) and (RW[P].Model[mix].Domain = dGround) or 1312 (RW[P].Model[mix].Kind = mkSettler) or (NewJob <> jCity) and 1313 (RW[P].Model[mix].Kind = mkSlaves) and (GWonder[woPyramids].EffectiveOwner 1313 1314 >= 0)) then 1314 1315 begin 1315 result := eInvalid;1316 exit1316 Result := eInvalid; 1317 Exit; 1317 1318 end; 1318 1319 if (JobPreq[NewJob] <> preNone) and 1319 (RW[ p].Tech[JobPreq[NewJob]] < tsApplicable) then1320 begin 1321 result := eNoPreq;1322 exit1323 end; 1324 1325 result := CalculateJobWork(p, Loc0, NewJob, JobWork);1326 if (Mode = moPlaying) and ( result = eOK) and (NewJob <> jPoll) then1320 (RW[P].Tech[JobPreq[NewJob]] < tsApplicable) then 1321 begin 1322 Result := eNoPreq; 1323 Exit; 1324 end; 1325 1326 Result := CalculateJobWork(P, Loc0, NewJob, JobWork); 1327 if (Mode = moPlaying) and (Result = eOK) and (NewJob <> jPoll) then 1327 1328 begin // not allowed in territory of friendly nation 1328 1329 p1 := RealMap[Loc0] shr 27; // owner of territory 1329 if (p1 < nPl) and (p1 <> p) and (RW[p].Treaty[p1] >= trPeace) then1330 result := eTreaty; // keep peace treaty!1331 end; 1332 if TestOnly or ( result < rExecuted) then1333 exit;1330 if (p1 < nPl) and (p1 <> P) and (RW[P].Treaty[p1] >= trPeace) then 1331 Result := eTreaty; // keep peace treaty! 1332 end; 1333 if TestOnly or (Result < rExecuted) then 1334 Exit; 1334 1335 1335 1336 if (ToWork[Loc0, NewJob] = 0) or (ToWork[Loc0, NewJob] > JobWork) then … … 1337 1338 Job := NewJob; 1338 1339 Flags := Flags and not unFortified; 1339 for uix1 := 0 to RW[ p].nUn - 1 do1340 if (RW[ p].Un[uix1].Loc = Loc) and1341 (RW[ p].Un[uix1].Job in ContraJobs[NewJob]) then1342 RW[ p].Un[uix1].Job := jNone; // stop contradictive jobs1343 if ServerVersion[ p] < $000EF0 then1344 if Work( p, uix) then1345 result := eJobDone;1346 if (NewJob = jCity) and ( result = eJobDone) then1347 begin 1348 RemoveUnit_UpdateMap( p, uix);1349 result := eCity1340 for uix1 := 0 to RW[P].nUn - 1 do 1341 if (RW[P].Un[uix1].Loc = Loc) and 1342 (RW[P].Un[uix1].Job in ContraJobs[NewJob]) then 1343 RW[P].Un[uix1].Job := jNone; // stop contradictive jobs 1344 if ServerVersion[P] < $000EF0 then 1345 if Work(P, uix) then 1346 Result := eJobDone; 1347 if (NewJob = jCity) and (Result = eJobDone) then 1348 begin 1349 RemoveUnit_UpdateMap(P, uix); 1350 Result := eCity; 1350 1351 end 1351 1352 else if Health <= 0 then 1352 1353 begin // victim of HostileDamage 1353 RemoveUnit_UpdateMap( p, uix);1354 result := result or rUnitRemoved;1354 RemoveUnit_UpdateMap(P, uix); 1355 Result := Result or rUnitRemoved; 1355 1356 end; 1356 1357 if Mode > moLoading_Fast then 1357 1358 begin 1358 if result = eCity then1359 begin 1360 ObserveLevel[Loc0] := ObserveLevel[Loc0] and not(3 shl (2 * p));1361 Discover21(Loc0, p, lObserveUnhidden, true, true);1359 if Result = eCity then 1360 begin 1361 ObserveLevel[Loc0] := ObserveLevel[Loc0] and not(3 shl (2 * P)); 1362 Discover21(Loc0, P, lObserveUnhidden, True, True); 1362 1363 // CheckContact; 1363 end 1364 end 1365 end; // with1366 end; // StartJob1367 1368 function Work( p, uix: integer): boolean;1369 var 1370 uix1, j0: integer;1371 begin 1372 result := false;1373 with RW[ p].Un[uix] do1364 end; 1365 end; 1366 end; 1367 end; 1368 1369 function Work(P, uix: Integer): Boolean; 1370 var 1371 uix1, j0: Integer; 1372 begin 1373 Result := False; 1374 with RW[P].Un[uix] do 1374 1375 if Movement >= 100 then 1375 1376 begin 1376 assert(ToWork[Loc, Job] < $FFFF); // should have been set by StartJob1377 Assert(ToWork[Loc, Job] < $FFFF); // should have been set by StartJob 1377 1378 if Job >= jRoad then 1378 if integer(Movement) >= integer(ToWork[Loc, Job]) then { work complete }1379 begin 1380 result := true;1379 if Integer(Movement) >= Integer(ToWork[Loc, Job]) then { work complete } 1380 begin 1381 Result := True; 1381 1382 if Job <> jIrr then 1382 Health := Health - HostileDamage( p, mix, Loc, ToWork[Loc, Job]);1383 dec(Movement, ToWork[Loc, Job]);1383 Health := Health - HostileDamage(P, mix, Loc, ToWork[Loc, Job]); 1384 Dec(Movement, ToWork[Loc, Job]); 1384 1385 if not(Job in [jCity, jPillage, jPoll]) then 1385 inc(Worked[p], ToWork[Loc, Job]);1386 Inc(Worked[P], ToWork[Loc, Job]); 1386 1387 if Job = jCity then 1387 1388 begin // found new city 1388 FoundCity( p, Loc);1389 inc(Founded[p]);1390 with RW[ p].City[RW[p].nCity - 1] do1389 FoundCity(P, Loc); 1390 Inc(Founded[P]); 1391 with RW[P].City[RW[P].nCity - 1] do 1391 1392 begin 1392 ID := p shl 12 + Founded[p] - 1;1393 ID := P shl 12 + Founded[P] - 1; 1393 1394 Flags := chFounded; 1394 1395 end; 1395 1396 if Mode = moPlaying then 1396 1397 begin 1397 LogCheckBorders( p, RW[p].nCity - 1);1398 RecalcPeaceMap( p);1398 LogCheckBorders(P, RW[P].nCity - 1); 1399 RecalcPeaceMap(P); 1399 1400 end; 1400 1401 {$IFOPT O-} if Mode < moPlaying then 1401 InvalidTreatyMap := not(1 shl p); {$ENDIF}1402 InvalidTreatyMap := not(1 shl P); {$ENDIF} 1402 1403 // territory should not be considered for the rest of the command 1403 1404 // execution, because during loading a game it's incorrect before 1404 1405 // subsequent sIntExpandTerritory is processed 1405 RW[ p].Un[uix].Health := 0; // causes unit to be removed later1406 RW[P].Un[uix].Health := 0; // causes unit to be removed later 1406 1407 end 1407 1408 else 1408 CompleteJob( p, Loc, Job);1409 CompleteJob(P, Loc, Job); 1409 1410 ToWork[Loc, Job] := 0; 1410 1411 j0 := Job; 1411 for uix1 := 0 to RW[ p].nUn - 1 do1412 if (RW[ p].Un[uix1].Loc = Loc) and (RW[p].Un[uix1].Job = j0) then1413 RW[ p].Un[uix1].Job := jNone1412 for uix1 := 0 to RW[P].nUn - 1 do 1413 if (RW[P].Un[uix1].Loc = Loc) and (RW[P].Un[uix1].Job = j0) then 1414 RW[P].Un[uix1].Job := jNone 1414 1415 end 1415 1416 else 1416 1417 begin 1417 dec(ToWork[Loc, Job], Movement);1418 Dec(ToWork[Loc, Job], Movement); 1418 1419 if not(Job in [jCity, jPillage, jPoll]) then 1419 inc(Worked[p], Movement);1420 Health := Health - HostileDamage( p, mix, Loc, Movement);1420 Inc(Worked[P], Movement); 1421 Health := Health - HostileDamage(P, mix, Loc, Movement); 1421 1422 Movement := 0; 1422 1423 end 1423 1424 end 1424 end; // work1425 1426 function GetJobProgress( p, Loc: integer;1427 var JobProgressData: TJobProgressData): integer;1428 var 1429 Job, JobResult, uix: integer;1425 end; 1426 1427 function GetJobProgress(P, Loc: Integer; 1428 var JobProgressData: TJobProgressData): Integer; 1429 var 1430 Job, JobResult, uix: Integer; 1430 1431 begin 1431 1432 for Job := 0 to nJob - 1 do 1432 1433 begin 1433 JobResult := CalculateJobWork( p, Loc, Job, JobProgressData[Job].Required);1434 JobResult := CalculateJobWork(P, Loc, Job, JobProgressData[Job].Required); 1434 1435 if JobResult = eOK then 1435 1436 begin … … 1438 1439 else 1439 1440 JobProgressData[Job].Done := JobProgressData[Job].Required - 1440 ToWork[Loc, Job] 1441 ToWork[Loc, Job]; 1441 1442 end 1442 1443 else … … 1447 1448 JobProgressData[Job].NextTurnPlus := 0; 1448 1449 end; 1449 for uix := 0 to RW[ p].nUn - 1 do1450 if (RW[ p].Un[uix].Loc = Loc) and (RW[p].Un[uix].Movement >= 100) then1451 inc(JobProgressData[RW[p].Un[uix].Job].NextTurnPlus,1452 RW[ p].Un[uix].Movement);1453 result := eOK;1450 for uix := 0 to RW[P].nUn - 1 do 1451 if (RW[P].Un[uix].Loc = Loc) and (RW[P].Un[uix].Movement >= 100) then 1452 Inc(JobProgressData[RW[P].Un[uix].Job].NextTurnPlus, 1453 RW[P].Un[uix].Movement); 1454 Result := eOK; 1454 1455 end; 1455 1456 -
branches/highdpi/readme.txt
r405 r465 2 2 =================== 3 3 4 * Developed with: Lazarus 2. 0.12(https://www.lazarus-ide.org/)4 * Developed with: Lazarus 2.2.0 (https://www.lazarus-ide.org/) 5 5 * Supported platforms: Windows and Linux 6 6 * Supported architectures: 32-bit and 64-bit x86 … … 24 24 * Home page: https://app.zdechov.net/c-evo/ 25 25 * Source code: https://svn.zdechov.net/c-evo/ 26 * Developed in [http://www.lazarus-ide.org/ Lazarus/FPC] 2. 0.1226 * Developed in [http://www.lazarus-ide.org/ Lazarus/FPC] 2.2.0 27 27 * To build new Windows installer run Install/build.bat. InnoSetup (http://www.jrsoftware.org/isdl.php) needs to be installed). 28 28
Note:
See TracChangeset
for help on using the changeset viewer.