Changeset 465


Ignore:
Timestamp:
Nov 30, 2023, 10:16:14 PM (13 months ago)
Author:
chronos
Message:
  • Modified: Updated high dpi branch from trunk.
  • Modified: Use generics.collections instead of fgl.
  • Modified: Compile with Delphi syntax.
Location:
branches/highdpi
Files:
10 added
1 deleted
108 edited
16 moved

Legend:

Unmodified
Added
Removed
  • branches/highdpi/AI/StdAI/AI.pas

    r349 r465  
    2323
    2424  nResearchOrder = 46;
    25   ResearchOrder: array[0..1, 0..nResearchOrder - 1] of integer =
     25  ResearchOrder: array[0..1, 0..nResearchOrder - 1] of Integer =
    2626    ((adWheel, adWarriorCode, adHorsebackRiding, adCeremonialBurial, adPolytheism,
    2727    adMonarchy, adMysticism, adPoetry, adAstronomy, adMonotheism,
     
    7676
    7777  // 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);
    7979  MaxBuildWorseThanBestModel = 20;
    8080  MaxExistWorseThanBestModel = 50;
     
    8585  nRequestedTechs = 48;
    8686
    87   PlayerHash: array[0..nPl - 1] of integer =
     87  PlayerHash: array[0..nPl - 1] of Integer =
    8888    (7, 6, 0, 2, 10, 8, 12, 14, 4, 1, 3, 5, 9, 11, 13);
    8989
     
    9292
    9393  TPersistentData = record
    94     LastResearchTech, BehaviorFlags, TheologyPartner: integer;
     94    LastResearchTech, BehaviorFlags, TheologyPartner: Integer;
    9595    RejectTurn: array[Suggestion, 0..15] of smallint;
    96     RequestedTechs: array[0..nRequestedTechs - 1] of integer;
     96    RequestedTechs: array[0..nRequestedTechs - 1] of Integer;
    9797    // ad + p shl 8 + Turn shl 16
    9898  end;
    9999
    100100  TAI = class(TBarbarina)
    101     constructor Create(Nation: integer); override;
     101    constructor Create(Nation: Integer); override;
    102102
    103103    procedure SetDataDefaults; override;
     
    106106    Data: ^TPersistentData;
    107107    WarNations, BombardingNations, mixSettlers, mixCaravan, mixTownGuard,
    108     mixSlaves, mixMilitia, mixCruiser, OceanWithShip: integer;
     108    mixSlaves, mixMilitia, mixCruiser, OceanWithShip: Integer;
    109109    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;
    119119    // 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;
    128128
    129129    procedure DoTurn; override;
    130130    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);
    138138    procedure CheckGender;
    139139    procedure AnalyzeMap;
     
    141141    procedure AttackAndPatrol;
    142142    procedure MoveUnitsHome;
    143     procedure CheckAttack(uix: integer);
    144     procedure Patrol(uix: integer);
     143    procedure CheckAttack(uix: Integer);
     144    procedure Patrol(uix: Integer);
    145145    procedure SetCityProduction;
    146146    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}
    149149
    150150    // 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;
    154154
    155155    //terraforming
    156     procedure TileWorkPlan(Loc, cix: integer; var Value, NextJob, TotalWork: integer);
     156    procedure TileWorkPlan(Loc, cix: Integer; var Value, NextJob, TotalWork: Integer);
    157157    procedure ProcessSettlers;
    158158
    159159    // diplomacy
    160     function MostWanted(Nation, adGiveAway: integer): integer;
     160    function MostWanted(Nation, adGiveAway: Integer): Integer;
    161161
    162162  end;
     
    174174
    175175var
    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
     178constructor TAI.Create(Nation: Integer);
    180179begin
    181180  inherited;
    182   Data := pointer(RO.Data);
     181  Data := Pointer(RO.Data);
    183182{$IFDEF DEBUG}
    184183  if Nation = 1 then
     
    193192  begin
    194193    LastResearchTech := -1;
    195     if PlayerHash[me] > 7 then
     194    if PlayerHash[Me] > 7 then
    196195      BehaviorFlags := bFemale
    197196    else
     
    199198    DebugMessage(1, 'Gender:=' + char(48 + BehaviorFlags and bGender));
    200199    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);
    203202  end;
    204203end;
    205204
    206 function TAI.OnNegoRejected_CancelTreaty: boolean;
     205function TAI.OnNegoRejected_CancelTreaty: Boolean;
    207206begin
    208207  Data.RejectTurn[suContact, Opponent] := RO.Turn;
     
    210209end;
    211210
    212 
    213211//-------------------------------
    214212//            RESEARCH
    215213//-------------------------------
    216214
    217 procedure TAI.RateModel(const mi: TModelInfo; var Category, Quality: integer);
     215procedure TAI.RateModel(const mi: TModelInfo; var Category, Quality: Integer);
    218216var
    219   EffectiveTransport: integer;
     217  EffectiveTransport: Integer;
    220218begin
    221219  if mi.Kind >= mkScout then
    222220  begin
    223221    Category := mctNone;
    224     exit;
     222    Exit;
    225223  end;
    226224  case mi.Domain of
     
    294292end;
    295293
    296 procedure TAI.RateMyModel(mix: integer; var Category, Quality: integer);
     294procedure TAI.RateMyModel(mix: Integer; var Category, Quality: Integer);
    297295var
    298296  mi: TModelInfo;
    299297begin
    300   MakeModelInfo(me, mix, MyModel[mix], mi);
     298  MakeModelInfo(Me, mix, MyModel[mix], mi);
    301299  RateModel(mi, Category, Quality);
    302300end;
    303301
    304 function TAI.IsBetterModel(const mi: TModelInfo): boolean;
     302function TAI.IsBetterModel(const mi: TModelInfo): Boolean;
    305303var
    306   mix, Cat, Quality, Cat1, Quality1: integer;
     304  mix, Cat, Quality, Cat1, Quality1: Integer;
    307305begin
    308306  RateModel(mi, Cat, Quality);
     
    314312      begin
    315313        Result := False;
    316         exit;
     314        Exit;
    317315      end;
    318316    end;
     
    320318end;
    321319
    322 function TAI.ChooseResearchAdvance: integer;
     320function TAI.ChooseResearchAdvance: Integer;
    323321var
    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;
    326324  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;
    331329  begin
    332330    if RO.Tech[ad] >= tsApplicable then
     
    375373  end;
    376374
    377   procedure OptimizeDevModel(OptimizeCaps: integer);
     375  procedure OptimizeDevModel(OptimizeCaps: Integer);
    378376  var
    379     f, Cat, OriginalCat, Quality, BestQuality, Best: integer;
     377    F, Cat, OriginalCat, Quality, BestQuality, Best: Integer;
    380378    mi: TModelInfo;
    381379  begin
    382     MakeModelInfo(me, 0, RO.DevModel, mi);
     380    MakeModelInfo(Me, 0, RO.DevModel, mi);
    383381    RateModel(mi, OriginalCat, BestQuality);
    384382    repeat
    385383      Best := -1;
    386       for f := 0 to nFeature - 1 do
    387         if (1 shl f and OptimizeCaps <> 0) and
    388           ((Feature[f].Preq < 0) or IsResearched(Feature[f].Preq)) // check prerequisite
    389           and (RO.DevModel.Weight + Feature[f].Weight <= RO.DevModel.MaxWeight) and
    390           not ((f >= mcFirstNonCap) and (RO.DevModel.Cap[f] > 0)) then
    391         begin
    392           if SetNewModelFeature(f, RO.DevModel.Cap[f] + 1) >= rExecuted then
     384      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
    393391          begin
    394             MakeModelInfo(me, 0, RO.DevModel, mi);
     392            MakeModelInfo(Me, 0, RO.DevModel, mi);
    395393            RateModel(mi, Cat, Quality);
    396             assert(Cat = OriginalCat);
     394            Assert(Cat = OriginalCat);
    397395            if Quality > BestQuality then
    398396            begin
    399               Best := f;
     397              Best := F;
    400398              BestQuality := Quality;
    401399            end;
    402             SetNewModelFeature(f, RO.DevModel.Cap[f] - 1);
     400            SetNewModelFeature(F, RO.DevModel.Cap[F] - 1);
    403401          end;
    404402        end;
     
    408406  end;
    409407
    410   function LeaveOutsMissing(ad: integer): boolean;
     408  function LeaveOutsMissing(ad: Integer): Boolean;
    411409  var
    412     i: integer;
     410    I: Integer;
    413411  begin
    414412    Result := False;
     
    424422        Result := True
    425423      else
    426         for i := 0 to 1 do
    427           if AdvPreq[ad, i] >= 0 then
    428             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]);
    429427  end;
    430428
     
    434432    Result := Barbarina_ChooseResearchAdvance;
    435433    if Result >= 0 then
    436       exit;
     434      Exit;
    437435  end;
    438436
     
    446444      Result := ad;
    447445  if Result >= 0 then
    448     exit;
     446    Exit;
    449447
    450448  if Data.BehaviorFlags and bBarbarina = 0 then
     
    462460      OptimizeDevModel(1 shl mcOffense + 1 shl mcDefense + 1 shl
    463461        mcMob + 1 shl mcLongRange + 1 shl mcFanatic);
    464       MakeModelInfo(me, 0, RO.DevModel, mi);
     462      MakeModelInfo(Me, 0, RO.DevModel, mi);
    465463      if IsBetterModel(mi) then
    466464      begin
    467465        Result := adMilitary;
    468         exit;
     466        Exit;
    469467      end;
    470468
     
    473471      SetNewModelFeature(mcOffense, 1);
    474472      OptimizeDevModel(1 shl mcOffense + 1 shl mcDefense + 1 shl mcFanatic);
    475       MakeModelInfo(me, 0, RO.DevModel, mi);
     473      MakeModelInfo(Me, 0, RO.DevModel, mi);
    476474      if IsBetterModel(mi) then
    477475      begin
    478476        Result := adMilitary;
    479         exit;
     477        Exit;
    480478      end;
    481479    end;
     
    493491        SetNewModelFeature(mcWeapons, 0);
    494492        SetNewModelFeature(mcDefense, 3);
    495         exit;
     493        Exit;
    496494      end;
    497495    end;
     
    508506      OptimizeDevModel(1 shl mcDefense+1 shl mcSeaTrans+1 shl mcTurbines
    509507        +1 shl mcAirDef);
    510       MakeModelInfo(me,0,RO.DevModel,mi);
     508      MakeModelInfo(Me,0,RO.DevModel,mi);
    511509      if IsBetterModel(mi) then
    512         begin result:=adMilitary; exit end;
     510        begin Result:=adMilitary; Exit end;
    513511      end;
    514512
     
    521519      OptimizeDevModel(1 shl mcOffense+1 shl mcDefense
    522520        +1 shl mcLongRange+1 shl mcAirDef+1 shl mcRadar);
    523       MakeModelInfo(me,0,RO.DevModel,mi);
     521      MakeModelInfo(Me,0,RO.DevModel,mi);
    524522      if IsBetterModel(mi) then
    525         begin result:=adMilitary; exit end;
     523        begin Result:=adMilitary; Exit end;
    526524      end
    527525    end;
     
    547545        begin
    548546          ok := True;
    549           break;
     547          Break;
    550548        end;
    551549      if not ok then
     
    590588        begin // 2 of 3 required
    591589          Count := 0;
    592           for i := 0 to 2 do
    593             if RO.Tech[AdvPreq[ad, i]] >= tsApplicable then
     590          for I := 0 to 2 do
     591            if RO.Tech[AdvPreq[ad, I]] >= tsApplicable then
    594592              Inc(Count);
    595593          if Count >= 2 then
    596594          begin
    597595            Result := ad;
    598             exit;
     596            Exit;
    599597          end;
    600598        end
     
    604602        begin
    605603          Result := ad;
    606           exit;
     604          Exit;
    607605        end;
    608606      end;
     
    620618    begin // go for future techs
    621619      Result := -1;
    622       i := 0;
     620      I := 0;
    623621      for ad := nAdv - 4 to nAdv - 1 do
    624622        if (RO.Tech[ad] < MaxFutureTech) and (RO.Tech[AdvPreq[ad, 0]] >=
    625623          tsApplicable) then
    626624        begin
    627           Inc(i);
    628           if random(i) = 0 then
     625          Inc(I);
     626          if random(I) = 0 then
    629627            Result := ad;
    630628        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);
    637635  MarkEntry(NewResearch);
    638636  Result := -1;
     
    640638    if Entry[ad] and ((Result < 0) or (Advancedness[ad] > Advancedness[Result])) then
    641639      Result := ad;
    642   assert(Result >= 0);
     640  Assert(Result >= 0);
    643641end;
    644642
    645 function TAI.ChooseStealAdvance: integer;
     643function TAI.ChooseStealAdvance: Integer;
    646644var
    647   ad: integer;
     645  ad: Integer;
    648646begin
    649647  Result := -1;
     
    654652end;
    655653
    656 
    657654//-------------------------------
    658655//         TERRAFORMING
     
    662659  twpAllowFarmland = $0001;
    663660
    664 procedure TAI.TileWorkPlan(Loc, cix: integer; var Value, NextJob, TotalWork: integer);
     661procedure TAI.TileWorkPlan(Loc, cix: Integer; var Value, NextJob, TotalWork: Integer);
    665662var
    666   OldTile, TerrType: cardinal;
     663  OldTile, TerrType: Cardinal;
    667664  TileInfo: TTileInfo;
    668665begin
     
    672669  begin
    673670    Value := 3 * 8 - 1;
    674     exit;
     671    Exit;
    675672  end; // better than any tile with 2 food
    676673
     
    693690      Map[Loc] := Map[Loc] and not fTerrain or fGrass;
    694691      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);
    696693    end
    697694    else if IsResearched(adExplosives) and
     
    704701      Map[Loc] := Map[Loc] and not fTerrain or fGrass;
    705702      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);
    707704    end;
    708705    if (Terrain[TerrType].MineEff > 0) and (RO.Government <> gDespotism) then
     
    767764    end;
    768765  end;
    769   Server(sGetTileInfo, me, Loc, TileInfo);
     766  Server(sGetTileInfo, Me, Loc, TileInfo);
    770767  Value := TileInfo.Food * 8 + TileInfo.Prod * 2 + TileInfo.Trade;
    771768  Map[Loc] := OldTile;
     
    775772procedure TAI.ProcessSettlers;
    776773var
    777   i, uix, cix, ecix, dtr, Loc, RadiusLoc, Special, Food, Prod, Trade,
     774  I, uix, cix, ecix, dtr, Loc, RadiusLoc, Special, Food, Prod, Trade,
    778775  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;
    782779  Radius: TVicinity21Loc;
    783780  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);
    787784  // set Score=1 for low-priority jobs
    788785  begin
     
    792789  end;
    793790
    794   procedure ReserveCityRadius(Loc: integer);
     791  procedure ReserveCityRadius(Loc: Integer);
    795792  var
    796     V21, RadiusLoc: integer;
     793    V21, RadiusLoc: Integer;
    797794    Radius: TVicinity21Loc;
    798795  begin
     
    811808  procedure ScoreRoadConnections;
    812809  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;
    816813    Adjacent: TVicinity8Loc;
    817814  begin
     
    824821      if ((1 shl (Map[Loc] and fTerrain)) and (1 shl fOcean or 1 shl
    825822        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) and
     823        (RO.Territory[Loc] = Me) and (Map[Loc] and FullyDeveloped = 0) and
    827824        (BridgeOk or (Map[Loc] and fRiver = 0)) then
    828825      begin
     
    838835          Loc1 := Adjacent[V8 and 7];
    839836          History := History shl 1;
    840           if (Loc1 >= 0) and (RO.Territory[Loc1] = me) and
     837          if (Loc1 >= 0) and (RO.Territory[Loc1] = Me) and
    841838            (Map[Loc1] and ConnectMask <> 0) then
    842839          begin
     
    854851                  else if History and 4 <> 0 then
    855852                  begin
    856                     V8_to_ab((V8 - 1) and 7, a, b);
    857                     ab_to_Loc(Loc, a shl 1, b shl 1, Loc1);
     853                    V8_to_ab((V8 - 1) and 7, A, B);
     854                    ab_to_Loc(Loc, A shl 1, B shl 1, Loc1);
    858855                    if (Loc1 >= 0) and (Map[Loc1] and ConnectMask <> 0) then
    859856                      Dec(nFragments);
     
    879876
    880877begin
    881   fillchar(SettlerSurplus, sizeof(SettlerSurplus), 0);
     878  FillChar(SettlerSurplus, SizeOf(SettlerSurplus), 0);
    882879  JobAssignment_Initialize;
    883880
    884881  if (Data.BehaviorFlags and bBarbarina = 0) or (RO.nCity < 3) then
    885882  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);
    888885    for Loc := 0 to MapSize - 1 do
    889886      if Map[Loc] and fTerrain <> fUNKNOWN then
     
    926923
    927924    // rate possible new cities
    928     fillchar(CityScore, MapSize * sizeof(integer), 0);
     925    FillChar(CityScore, MapSize * SizeOf(Integer), 0);
    929926    for Loc := 0 to MapSize - 1 do
    930927    begin
     
    933930        ((RO.Government <> gDespotism) or (Map[Loc] and fSpecial = fSpecial1)) or
    934931        (Map[Loc] and (fTerrain or fSpecial) = fPrairie or fSpecial1));
    935       if FoodOk and ((RO.Territory[Loc] < 0) or (RO.Territory[Loc] = me)) then
     932      if FoodOk and ((RO.Territory[Loc] < 0) or (RO.Territory[Loc] = Me)) then
    936933      begin
    937934        TestScore := 0;
     
    953950        if CityFood >= MinCityFood then // city is worth founding
    954951        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;
    956953          // some unexactness, random but always the same for this tile
    957954          if TestScore > BestNearCityScore then
     
    991988              if not (Map[RadiusLoc] and fTerrain in [fDesert, fArctic]) then
    992989              begin
    993                 assert(RadiusLoc >= 0);
     990                Assert(RadiusLoc >= 0);
    994991                TileWorkPlan(RadiusLoc, cix, Value, NextJob, TotalWork);
    995992                if (NextJob = jRoad) and (Built[imPalace] +
     
    10031000            begin // tile could be exploited
    10041001              RadiusLoc := Radius[V21];
    1005               assert(RadiusLoc >= 0);
     1002              Assert(RadiusLoc >= 0);
    10061003              if not (Map[RadiusLoc] and fTerrain in [fDesert, fArctic]) then
    10071004              begin
     
    10271024  if Data.BehaviorFlags and bBarbarina = 0 then // low priority jobs
    10281025    for Loc := 0 to MapSize - 1 do
    1029       if RO.Territory[Loc] = me then
     1026      if RO.Territory[Loc] = Me then
    10301027      begin
    10311028        Tile := Map[Loc];
     
    10511048  begin
    10521049    for part := 0 to nShipPart - 1 do
    1053       for i := 0 to ColonyShipPlan[part].nLocFoundCity - 1 do
    1054       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];
    10561053        Started := False;
    10571054        for uix := 0 to RO.nUn - 1 do
     
    10591056          begin
    10601057            Started := True;
    1061             break;
     1058            Break;
    10621059          end;
    10631060        if not Started then
     
    11221119            begin // settlers could be added to this city
    11231120              Happy := BasicHappy;
    1124               for i := 0 to nWonder - 1 do
    1125                 if Built[i] > 0 then
     1121              for I := 0 to nWonder - 1 do
     1122                if Built[I] > 0 then
    11261123                  Inc(Happy);
    11271124              if Built[imTemple] > 0 then
     
    11301127              begin
    11311128                Inc(Happy, 2);
    1132                 if RO.Wonder[woBach].EffectiveOwner = me then
     1129                if RO.Wonder[woBach].EffectiveOwner = Me then
    11331130                  Inc(Happy, 1);
    11341131              end;
     
    11451142        end;
    11461143      end;
    1147 end; // ProcessSettlers
    1148 
     1144end;
    11491145
    11501146//-------------------------------
     
    11541150procedure TAI.DoTurn;
    11551151var
    1156   emix, i, p1, TaxSum, ScienceSum, NewTaxRate: integer;
    1157   AllHateMe: boolean;
     1152  emix, I, p1, TaxSum, ScienceSum, NewTaxRate: Integer;
     1153  AllHateMe: Boolean;
    11581154{$IFDEF PERF}
    11591155  PF, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9: int64;
     
    11611157begin
    11621158{$IFDEF DEBUG}
    1163   fillchar(DebugMap, sizeof(DebugMap), 0);
     1159  FillChar(DebugMap, SizeOf(DebugMap), 0);
    11641160{$ENDIF}
    11651161
     
    11731169  WarNations := PresenceUnknown;
    11741170  for p1 := 0 to nPl - 1 do
    1175     if (p1 <> me) and (1 shl p1 and RO.Alive <> 0) and (RO.Treaty[p1] < trPeace) then
     1171    if (p1 <> Me) and (1 shl p1 and RO.Alive <> 0) and (RO.Treaty[p1] < trPeace) then
    11761172      Inc(WarNations, 1 shl p1);
    11771173  BombardingNations := 0;
     
    11891185    CheckGender;
    11901186
    1191   if G.Difficulty[me] < MaxDiff then // not on beginner level
     1187  if G.Difficulty[Me] < MaxDiff then // not on beginner level
    11921188  begin
    11931189    if (Data.LastResearchTech = adHorsebackRiding) and (RO.ResearchTech < 0) and
    11941190      (random(6) = 0) and (HavePort or (ContinentPresence[0] and not
    1195       (1 shl me or PresenceUnknown) <> 0)) then
     1191      (1 shl Me or PresenceUnknown) <> 0)) then
    11961192    begin
    11971193      Data.BehaviorFlags := Data.BehaviorFlags or bBarbarina_Hide;
     
    12101206          begin
    12111207            AllHateMe := False;
    1212             break;
     1208            Break;
    12131209          end;
    12141210      if AllHateMe then
     
    13061302  else
    13071303  begin
    1308     if (RO.TaxRate = 0) or (RO.Money < (TotalPopulation[me] - 4) * 2) then
     1304    if (RO.TaxRate = 0) or (RO.Money < (TotalPopulation[Me] - 4) * 2) then
    13091305      NewTaxRate := RO.TaxRate // don't check decreasing tax
    13101306    else
     
    13131309    begin
    13141310      SumCities(NewTaxRate, TaxSum, ScienceSum);
    1315       if RO.Money + TaxSum >= (TotalPopulation[me] - 4) then
    1316         break; // enough
     1311      if RO.Money + TaxSum >= (TotalPopulation[Me] - 4) then
     1312        Break; // enough
    13171313      Inc(NewTaxRate, 10);
    13181314    end;
     
    13281324    // research completed
    13291325    for p1 := 0 to nPl - 1 do
    1330       if (p1 <> me) and (1 shl p1 and RO.Alive <> 0) and
     1326      if (p1 <> Me) and (1 shl p1 and RO.Alive <> 0) and
    13311327        (RO.EnemyReport[p1].TurnOfCivilReport + TechReportOutdated > RO.Turn) and
    13321328        (RO.EnemyReport[p1].Tech[Data.LastResearchTech] < tsSeen) then
    13331329      begin // latest researched advance might be of interest to this nation
    1334         for i := 0 to nRequestedTechs - 1 do
    1335           if (Data.RequestedTechs[i] >= 0) and
    1336             (Data.RequestedTechs[i] shr 8 and $F = p1) then
    1337             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;
    13381334      end;
    13391335  if RO.ResearchTech = adMilitary then
     
    13411337  else
    13421338    Data.LastResearchTech := RO.ResearchTech;
    1343   for i := 0 to nRequestedTechs - 1 do
    1344     if (Data.RequestedTechs[i] >= 0) and
    1345       (RO.Tech[Data.RequestedTechs[i] and $FF] >= tsSeen) then
    1346       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;
    13471343
    13481344  // prepare negotiation
     
    13501346  SetAdvanceValues;
    13511347
    1352 
    13531348{$IFDEF DEBUG}
    13541349(*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)
    13561351    and (RO.EnemyReport[p1].TurnOfCivilReport>=0) then
    13571352    TraceAdvanceValues(p1);*)
     
    13681363
    13691364{$IFDEF DEBUG}
    1370 procedure TAI.TraceAdvanceValues(Nation: integer);
     1365procedure TAI.TraceAdvanceValues(Nation: Integer);
    13711366var
    1372   ad: integer;
     1367  ad: Integer;
    13731368begin
    13741369  for ad := 0 to nAdv - 1 do
     
    13801375    end;
    13811376end;
    1382 
    13831377{$ENDIF}
    1384 
    13851378
    13861379procedure TAI.CheckGender;
    13871380var
    1388   p1, NewGender: integer;
     1381  p1, NewGender: Integer;
    13891382begin
    13901383  NewGender := -1;
    13911384  for p1 := 0 to nPl - 1 do
    1392     if (p1 <> me) and (1 shl p1 and RO.Alive <> 0) and
     1385    if (p1 <> Me) and (1 shl p1 and RO.Alive <> 0) and
    13931386      (RO.Treaty[p1] >= trFriendlyContact) then
    1394       if PlayerHash[me] > PlayerHash[p1] then
     1387      if PlayerHash[Me] > PlayerHash[p1] then
    13951388      begin
    13961389        if NewGender = bMale then
    13971390        begin
    13981391          NewGender := -2;
    1399           break;
     1392          Break;
    14001393        end; // ambiguous, don't change gender
    14011394        NewGender := bFemale;
     
    14061399        begin
    14071400          NewGender := -2;
    1408           break;
     1401          Break;
    14091402        end; // ambiguous, don't change gender
    14101403        NewGender := bMale;
     
    14171410end;
    14181411
    1419 
    14201412procedure TAI.SetAdvanceValues;
    14211413
    1422   procedure RateResearchAdv(ad, Time: integer);
     1414  procedure RateResearchAdv(ad, Time: Integer);
    14231415  var
    1424     Value: integer;
     1416    Value: Integer;
    14251417  begin
    14261418    if Time = 0 then
     
    14321424  end;
    14331425
    1434   procedure SetPreqValues(ad, Value: integer);
     1426  procedure SetPreqValues(ad, Value: Integer);
    14351427  begin
    14361428    if (RO.Tech[ad] < tsSeen) and (ad <> RO.ResearchTech) then
     
    14551447  end;
    14561448
    1457   procedure RateImpPreq(iix, Value: integer);
     1449  procedure RateImpPreq(iix, Value: Integer);
    14581450  begin
    14591451    if (Value > 0) and (Imp[iix].Preq >= 0) then
     
    14621454
    14631455var
    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;
    14671459begin
    14681460  if AdvanceValuesSet then
    1469     exit;
     1461    Exit;
    14701462  AdvanceValuesSet := True;
    14711463
    1472   fillchar(AdvanceValue, sizeof(AdvanceValue), 0);
     1464  FillChar(AdvanceValue, SizeOf(AdvanceValue), 0);
    14731465
    14741466  // rate techs to ensure research progress
     
    14901482      begin // 2 of 3 required
    14911483        Count := 0;
    1492         for i := 0 to 2 do
    1493           if (AdvPreq[ad, i] = RO.ResearchTech) or
    1494             (RO.Tech[AdvPreq[ad, i]] >= tsSeen) then
     1484        for I := 0 to 2 do
     1485          if (AdvPreq[ad, I] = RO.ResearchTech) or
     1486            (RO.Tech[AdvPreq[ad, I]] >= tsSeen) then
    14951487            Inc(Count);
    14961488        if Count >= 2 then
     
    15001492          if ad <> adMassProduction then // don't score third preq for MP
    15011493          begin
    1502             for i := 0 to 2 do
    1503               if (AdvPreq[ad, i] <> RO.ResearchTech) and
    1504                 (RO.Tech[AdvPreq[ad, i]] < tsSeen) then
    1505                 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);
    15061498          end;
    15071499          Inc(Time, 2 - Count);
     
    15111503      begin
    15121504        Count := 0;
    1513         for i := 0 to 1 do
    1514           if (AdvPreq[ad, i] <> preNone) and (AdvPreq[ad, i] <> RO.ResearchTech) and
    1515             (RO.Tech[AdvPreq[ad, i]] < tsSeen) then
     1505        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
    15161508          begin
    1517             RateResearchAdv(AdvPreq[ad, i], Time);
     1509            RateResearchAdv(AdvPreq[ad, I], Time);
    15181510            Inc(Count);
    15191511          end;
     
    15441536
    15451537  // rate military techs
    1546   for d := 0 to nDomains - 1 do
     1538  for D := 0 to nDomains - 1 do
    15471539  begin
    15481540    CurrentCost := 0;
    15491541    CurrentStrength := 0;
    15501542    for PreView := True downto False do
    1551       for i := 0 to nUpgrade - 1 do
    1552         with Upgrade[d, i] do
     1543      for I := 0 to nUpgrade - 1 do
     1544        with Upgrade[D, I] do
    15531545          if (Preq >= 0) and not (Preq in FutureTech) then
    15541546            if ((Ro.ResearchTech = Preq) or (RO.Tech[Preq] >= tsSeen)) = PreView then
     
    15611553              else
    15621554              begin // rate
    1563                 if (i > 0) and (Trans > 0) then
     1555                if (I > 0) and (Trans > 0) then
    15641556                  Inc(AdvanceValue[Preq], $400);
    15651557                if Cost <= CurrentCost then
    1566                   Inc(AdvanceValue[Preq], (4 - d) * Strength * $400 div
    1567                     (CurrentStrength + Upgrade[d, 0].Strength))
     1558                  Inc(AdvanceValue[Preq], (4 - D) * Strength * $400 div
     1559                    (CurrentStrength + Upgrade[D, 0].Strength))
    15681560                else
    1569                   Inc(AdvanceValue[Preq], (4 - d) * Strength * $200 div
    1570                     (CurrentStrength + Upgrade[d, 0].Strength));
     1561                  Inc(AdvanceValue[Preq], (4 - D) * Strength * $200 div
     1562                    (CurrentStrength + Upgrade[D, 0].Strength));
    15711563              end;
    15721564  end;
     
    16481640procedure TAI.AnalyzeMap;
    16491641var
    1650   cix, Loc, Loc1, V8, f1, p1: integer;
     1642  cix, Loc, Loc1, V8, f1, p1: Integer;
    16511643  Adjacent: TVicinity8Loc;
    16521644begin
     
    16541646
    16551647  // 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);
    16581650  for Loc := 0 to MapSize - 1 do
    16591651  begin
     
    17071699  end;
    17081700
    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);
    17121704
    17131705  // count population
     
    17241716      if Loc >= 0 then
    17251717      begin
    1726         Inc(TotalPopulation[me], Size);
    1727         assert(District[Loc] >= 0);
     1718        Inc(TotalPopulation[Me], Size);
     1719        Assert(District[Loc] >= 0);
    17281720        if District[Loc] < maxCOD then
    17291721          Inc(DistrictPopulation[District[Loc]], Size);
     
    17331725procedure TAI.CollectModelCatStat;
    17341726var
    1735   i, uix, Cat, mix, Quality: integer;
     1727  I, uix, Cat, mix, Quality: Integer;
    17361728begin
    17371729  // categorize models
     
    17791771        if (Loc >= 0) and (mix = mixCruiser) and (Map[Loc] and fTerrain < fGrass) then
    17801772        begin
    1781           i := Formation[Loc];
    1782           if (i >= 0) and (i < maxCOD) then
    1783             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);
    17841776        end;
    17851777end;
    1786 
    17871778
    17881779procedure TAI.MoveUnitsHome;
    17891780const
    17901781  PatrolDestination = lxmax * lymax;
    1791   FirstSurplusLoop: array[mctGroundDefender..mctGroundAttacker] of integer = (2, 1);
     1782  FirstSurplusLoop: array[mctGroundDefender..mctGroundAttacker] of Integer = (2, 1);
    17921783var
    1793   Cat, i, mix, cix, uix, Loop, nModelOrder: integer;
     1784  Cat, I, mix, cix, uix, Loop, nModelOrder: Integer;
    17941785  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;
    18021793  var
    1803     Loc1, V8: integer;
     1794    Loc1, V8: Integer;
    18041795    Adjacent: TVicinity8Loc;
    18051796  begin
     
    18181809          begin
    18191810            Result := True;
    1820             exit;
     1811            Exit;
    18211812          end;
    18221813        end;
     
    18241815  end;
    18251816
    1826   procedure TryUtilize(uix: integer);
     1817  procedure TryUtilize(uix: Integer);
    18271818  var
    1828     cix, ProdCost, UtilizeCost: integer;
     1819    cix, ProdCost, UtilizeCost: Integer;
    18291820  begin
    18301821    if (MyUnit[uix].Health = 100) and (Map[MyUnit[uix].Loc] and
     
    18381829          UtilizeCost := MyModel[MyUnit[uix].mix].Cost;
    18391830          if Prod < (ProdCost - UtilizeCost * 2 div 3) *
    1840             BuildCostMod[G.Difficulty[me]] div 12 then
     1831            BuildCostMod[G.Difficulty[Me]] div 12 then
    18411832            Unit_Disband(uix);
    18421833        end;
     
    18441835  end;
    18451836
    1846   procedure FindDestination(uix: integer);
     1837  procedure FindDestination(uix: Integer);
    18471838  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);
    18521843    Pile.Create(MapSize);
    18531844    with MyUnit[uix] do
     
    18631854        if (District[Loc1] >= 0) and (District[Loc1] < maxCOD) then
    18641855        begin
    1865           assert(DistrictNeed[District[Loc1]] > 0);
     1856          Assert(DistrictNeed[District[Loc1]] > 0);
    18661857          Dec(DistrictNeed[District[Loc1]]);
    18671858        end;
    18681859        Destination[uix] := Loc1;
    1869         break;
     1860        Break;
    18701861      end;
    18711862      Reached[Loc1] := True;
     
    18741865      begin
    18751866        NextLoc := Adjacent[V8];
    1876         if (NextLoc >= 0) and not Reached[NextLoc] and (RO.Territory[NextLoc] = me) then
     1867        if (NextLoc >= 0) and not Reached[NextLoc] and (RO.Territory[NextLoc] = Me) then
    18771868          case CheckStep(MoveStyle, Time, V8 and 1, NextTime, RecoverTurns,
    18781869              Map[Loc1], Map[NextLoc], False) of
     
    18821873              Reached[NextLoc] := True; // don't check moving there again
    18831874            csCheckTerritory:
    1884               assert(False);
     1875              Assert(False);
    18851876          end;
    18861877      end;
     
    18961887          Unit_Disband(uix);
    18971888
    1898   fillchar(UnitLack, sizeof(UnitLack), 0);
    1899   fillchar(Destination, 4 * RO.nUn, $FF);
    1900   for i := 0 to maxCOD - 1 do
    1901     if uixPatrol[i] >= 0 then
    1902       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;
    19031894  for uix := 0 to RO.nUn - 1 do
    19041895    if (MyUnit[uix].mix = mixMilitia) or (MyUnit[uix].mix = mixCruiser) then
     
    19121903      if ModelCat[mix] = Cat then
    19131904      begin
    1914         i := nModelOrder;
    1915         while (i > 0) and (ModelQuality[mix] < ModelQuality[ModelOrder[i - 1]]) do
    1916         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;
    19211912        Inc(nModelOrder);
    19221913      end;
     
    19311922              TryUtilize(uix);
    19321923
    1933       fillchar(LocNeed, MapSize, 0);
    1934       fillchar(DistrictNeed, sizeof(DistrictNeed), 0);
     1924      FillChar(LocNeed, MapSize, 0);
     1925      FillChar(DistrictNeed, SizeOf(DistrictNeed), 0);
    19351926
    19361927      for cix := 0 to RO.nCity - 1 do
     
    19551946        for uix := 0 to RO.nUn - 1 do
    19561947          with MyUnit[uix] do
    1957             if (Loc >= 0) and (Job = jCity) and (RO.Territory[Loc] = me) then
     1948            if (Loc >= 0) and (Job = jCity) and (RO.Territory[Loc] = Me) then
    19581949            begin
    19591950              LocNeed[Loc] := 1;
     
    19631954
    19641955      complete := Loop >= FirstSurplusLoop[Cat];
    1965       for i := nModelOrder - 1 downto 0 do
     1956      for I := nModelOrder - 1 downto 0 do
    19661957      begin
    19671958        for Fortified := True downto False do
    19681959          for uix := 0 to RO.nUn - 1 do
    19691960            with MyUnit[uix] do
    1970               if (mix = ModelOrder[i]) and (Loc >= 0) and
     1961              if (mix = ModelOrder[I]) and (Loc >= 0) and
    19711962                (Destination[uix] < 0) and (Master < 0) and
    19721963                ((Flags and unFortified <> 0) = Fortified) and (LocNeed[Loc] > 0) then
     
    19811972        for uix := 0 to RO.nUn - 1 do
    19821973          with MyUnit[uix] do
    1983             if (mix = ModelOrder[i]) and (Loc >= 0) and (Destination[uix] < 0) and
     1974            if (mix = ModelOrder[I]) and (Loc >= 0) and (Destination[uix] < 0) and
    19841975              (Master < 0) then
    19851976              if (District[Loc] >= 0) and (District[Loc] < maxCOD) and
     
    19981989  // distribute obsolete settlers
    19991990  repeat
    2000     fillchar(LocNeed, MapSize, 0);
    2001     fillchar(DistrictNeed, sizeof(DistrictNeed), 0);
     1991    FillChar(LocNeed, MapSize, 0);
     1992    FillChar(DistrictNeed, SizeOf(DistrictNeed), 0);
    20021993
    20031994    for cix := 0 to RO.nCity - 1 do
     
    20492040  for uix := 0 to RO.nUn - 1 do
    20502041    with MyUnit[uix] do
    2051       if (Loc >= 0) and (RO.Territory[Loc] = me) and (District[Loc] >= 0) and
     2042      if (Loc >= 0) and (RO.Territory[Loc] = Me) and (District[Loc] >= 0) and
    20522043        (District[Loc] < maxCOD) and (ModelQuality[mix] > 0) then
    20532044        case ModelCat[mix] of
     
    20552046            Dec(UnitLack[District[Loc], ModelCat[mix]])
    20562047        end;
    2057 end; // MoveUnitsHome
    2058 
    2059 
    2060 procedure TAI.CheckAttack(uix: integer);
     2048end;
     2049
     2050procedure TAI.CheckAttack(uix: Integer);
    20612051var
    20622052  AttackScore, BestCount, AttackLoc, TestLoc, NextLoc, TestTime, V8,
    20632053  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;
    20672057  Adjacent: TVicinity8Loc;
    2068   Reached: array[0..lxmax * lymax - 1] of boolean;
     2058  Reached: array[0..lxmax * lymax - 1] of Boolean;
    20692059
    20702060begin
     
    20752065      AttackScore := -999999;
    20762066      AttackLoc := -1;
    2077       fillchar(Reached, MapSize, False);
     2067      FillChar(Reached, MapSize, False);
    20782068      Pile.Create(MapSize);
    20792069      Pile.Put(Loc, $800 - Movement);
     
    20872077        if ((Tile and fUnit) <> 0) and ((Tile and fOwned) = 0) then
    20882078        begin // enemy unit
    2089           assert(TestTime < $1000);
     2079          Assert(TestTime < $1000);
    20902080          Unit_FindEnemyDefender(TestLoc, euix);
    20912081          if RO.Treaty[RO.EnemyUn[euix].Owner] < trPeace then
     
    21762166    until Exhausted;
    21772167  end;
    2178 end; // CheckAttack
    2179 
    2180 
    2181 procedure TAI.Patrol(uix: integer);
     2168end;
     2169
     2170procedure TAI.Patrol(uix: Integer);
    21822171const
    21832172  DistanceScore = 4;
    21842173var
    21852174  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;
    21892178  Adjacent: TVicinity8Loc;
    2190   AdjacentUnknown: array[0..lxmax * lymax - 1] of shortint;
     2179  AdjacentUnknown: array[0..lxmax * lymax - 1] of ShortInt;
    21912180
    21922181begin
     
    22072196          // assume a score of 50 is the best achievable
    22082197          or CaptureOnly and (TestTime >= $1000) then
    2209           break;
     2198          Break;
    22102199
    22112200        TestScore := 0;
     
    22822271    until Exhausted;
    22832272  end;
    2284 end; // Patrol
     2273end;
    22852274
    22862275procedure TAI.AttackAndPatrol;
    22872276const
    22882277  nAttackCatOrder = 3;
    2289   AttackCatOrder: array[0..nAttackCatOrder - 1] of integer =
     2278  AttackCatOrder: array[0..nAttackCatOrder - 1] of Integer =
    22902279    (mctGroundAttacker, mctCruiser, mctGroundDefender);
    22912280var
    2292   iCat, uix, uix1: integer;
    2293   IsPatrolUnit, Fortified: boolean;
     2281  iCat, uix, uix1: Integer;
     2282  IsPatrolUnit, Fortified: Boolean;
    22942283begin
    22952284  for uix := 0 to RO.nUn - 1 do
     
    23102299              CheckAttack(uix);
    23112300
    2312   fillchar(uixPatrol, sizeof(uixPatrol), $FF);
     2301  FillChar(uixPatrol, SizeOf(uixPatrol), $FF);
    23132302  for uix := 0 to RO.nUn - 1 do
    23142303    with MyUnit[uix], MyModel[mix] do
     
    23422331          Patrol(uix);
    23432332      end;
    2344 end; // AttackAndPatrol
    2345 
    2346 
    2347 function TAI.HavePort: boolean;
     2333end;
     2334
     2335function TAI.HavePort: Boolean;
    23482336var
    2349   V8, cix, AdjacentLoc, f: integer;
     2337  V8, cix, AdjacentLoc, F: Integer;
    23502338  Adjacent: TVicinity8Loc;
    23512339begin
     
    23612349          if (AdjacentLoc >= 0) and ((Map[AdjacentLoc] and fTerrain) < fGrass) then
    23622350          begin
    2363             f := Formation[AdjacentLoc];
    2364             if (f >= 0) and (f < maxCOD) and (OceanPresence[f] and
    2365               not (1 shl me) <> 0) then
     2351            F := Formation[AdjacentLoc];
     2352            if (F >= 0) and (F < maxCOD) and (OceanPresence[F] and
     2353              not (1 shl Me) <> 0) then
    23662354              Result := True;
    23672355          end;
     
    23692357      end;
    23702358end;
    2371 
    23722359
    23732360procedure TAI.SetCityProduction;
    23742361var
    23752362  uix, cix, iix, dtr, V8, V21, NewImprovement, AdjacentLoc, MaxSettlers,
    2376   maxcount, cixMilAcademy: integer;
    2377   TerrType: cardinal;
     2363  maxcount, cixMilAcademy: Integer;
     2364  TerrType: Cardinal;
    23782365  IsPort, IsNavalBase, NeedCruiser, CheckProd, Destructed, ProduceSettlers,
    2379   ProduceMil: boolean;
     2366  ProduceMil: Boolean;
    23802367  Adjacent: TVicinity8Loc;
    23812368  Radius: TVicinity21Loc;
    23822369  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);
    23872374  begin
    23882375    if (NewImprovement = imTrGoods) // not already improvement of higher priority found
     
    23942381  end;
    23952382
    2396   procedure TryDestruct(Improvement: integer);
     2383  procedure TryDestruct(Improvement: Integer);
    23972384  begin
    23982385    if Destructed or (MyCity[cix].Built[Improvement] = 0) then
    2399       exit;
     2386      Exit;
    24002387    if City_CurrentImprovementProject(cix) >= 0 then
    24012388      City_RebuildImprovement(cix, Improvement)
     
    24052392      and (Imp[CurrentImprovementProject].Kind in [ikCommon,ikNatGlobal,ikNatLocal])
    24062393      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}
    24082395    Destructed := True;
    24092396  end;
    24102397
    2411   function ChooseBuildModel(Cat: integer): integer;
     2398  function ChooseBuildModel(Cat: Integer): Integer;
    24122399  var
    2413     Count, mix: integer;
     2400    Count, mix: Integer;
    24142401  begin
    24152402    Count := 0;
     
    24222409          Result := mix;
    24232410      end;
    2424     assert(Count > 0);
     2411    Assert(Count > 0);
    24252412  end;
    24262413
     
    24282415  // find military production cities
    24292416  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);
    24332420    GetCityProdPotential;
    2434     for d := 0 to maxCOD - 1 do
     2421    for D := 0 to maxCOD - 1 do
    24352422    begin
    24362423      Total := 0;
    24372424      for cix := 0 to RO.nCity - 1 do
    24382425        with MyCity[cix] do
    2439           if (Loc >= 0) and (District[Loc] = d) then
     2426          if (Loc >= 0) and (District[Loc] = D) then
    24402427            Total := Total + CityResult[cix];
    24412428      if Total = 0 then
     
    24462433      for cix := 0 to RO.nCity - 1 do
    24472434        with MyCity[cix] do
    2448           if (Loc >= 0) and (District[Loc] = d) and
     2435          if (Loc >= 0) and (District[Loc] = D) and
    24492436            (Built[imBarracks] + Built[imMilAcademy] > 0) then
    24502437          begin
     
    24612448        for cix := 0 to RO.nCity - 1 do
    24622449          with MyCity[cix] do
    2463             if (Loc >= 0) and (District[Loc] = d) and
     2450            if (Loc >= 0) and (District[Loc] = D) and
    24642451              (Built[imBarracks] + Built[imMilAcademy] = 0) and
    24652452              (Built[imObservatory] = 0) and (CityResult[cix] < Threshold) and
     
    24782465      for cix := 0 to RO.nCity - 1 do
    24792466        with MyCity[cix] do
    2480           if (Loc >= 0) and (District[Loc] = d) and
     2467          if (Loc >= 0) and (District[Loc] = D) and
    24812468            (Built[imBarracks] + Built[imMilAcademy] = 0) and
    24822469            (CityResult[cix] >= Threshold) then
     
    24842471{    if (cixWorst>=0)
    24852472      and (Share-CityResult[cixWorst]*2>=Total*MilProdShare div 100) then
    2486       MilProdCity[cixWorst]:=false;}
     2473      MilProdCity[cixWorst]:=False;}
    24872474    end;
    24882475
     
    24912478    if cixStateImp[imPalace] >= 0 then
    24922479    begin
    2493       d := District[MyCity[cixStateImp[imPalace]].Loc];
    2494       if (d >= 0) and (d < maxCOD) then
     2480      D := District[MyCity[cixStateImp[imPalace]].Loc];
     2481      if (D >= 0) and (D < maxCOD) then
    24952482      begin
    24962483        cixMilAcademy := -1;
    24972484        for cix := 0 to RO.nCity - 1 do
    24982485          with MyCity[cix] do
    2499             if (Loc >= 0) and (District[Loc] = d) and
     2486            if (Loc >= 0) and (District[Loc] = D) and
    25002487              (Built[imObservatory] + Built[imPalace] = 0) and
    25012488              ((cixMilAcademy < 0) or (CityResult[cix] > CityResult[cixMilAcademy])) then
     
    25132500  procedure ChangeHomeCities;
    25142501  var
    2515     uix, NewHome, HomeSupport, NewHomeSupport, SingleSupport: integer;
     2502    uix, NewHome, HomeSupport, NewHomeSupport, SingleSupport: Integer;
    25162503  begin
    25172504    if RO.Government in [gAnarchy, gFundamentalism] then
    2518       exit;
     2505      Exit;
    25192506    for uix := 0 to RO.nUn - 1 do
    25202507      with MyUnit[uix] do
     
    25642551
    25652552begin
    2566   fillchar(HomeCount, 4 * RO.nCity, 0);
     2553  FillChar(HomeCount, 4 * RO.nCity, 0);
    25672554  for uix := 0 to RO.nUn - 1 do
    25682555    with MyUnit[uix] do
     
    27572744                    begin
    27582745                      TryBuild(imHarbor);
    2759                       break;
     2746                      Break;
    27602747                    end;
    27612748                  end;
     
    27752762              TryBuild(imRecycling);
    27762763            if (Report.Trade - Report.Corruption >= 11) and
    2777               (RO.Money < TotalPopulation[me] * 2) then
     2764              (RO.Money < TotalPopulation[Me] * 2) then
    27782765              TryBuild(imBank);
    27792766            if (RO.NatBuilt[imStockEx] = 0) and
     
    28122799
    28132800          // rebuild imps no longer needed
    2814           if (RO.TaxRate = 0) and (RO.Money >= TotalPopulation[me] * 4) then
     2801          if (RO.TaxRate = 0) and (RO.Money >= TotalPopulation[Me] * 4) then
    28152802            TryDestruct(imBank)
    28162803          else if Report.Happy * 2 >= Size + 6 then
     
    28362823
    28372824  ChangeHomeCities;
    2838 end; // SetCityProduction
    2839 
    2840 
    2841 function TAI.ChooseGovernment: integer;
     2825end;
     2826
     2827function TAI.ChooseGovernment: Integer;
    28422828begin
    28432829  if Data.BehaviorFlags and bBarbarina <> 0 then
     
    28562842end;
    28572843
    2858 
    28592844//-------------------------------
    28602845//           DIPLOMACY
    28612846//-------------------------------
    28622847
    2863 function TAI.MostWanted(Nation, adGiveAway: integer): integer;
     2848function TAI.MostWanted(Nation, adGiveAway: Integer): Integer;
    28642849var
    2865   ad: integer;
     2850  ad: Integer;
    28662851begin
    28672852  Result := -1;
     
    28912876end;
    28922877
    2893 procedure TAI.FindBestTrade(Nation: integer; var adWanted, adGiveAway: integer);
     2878procedure TAI.FindBestTrade(Nation: Integer; var adWanted, adGiveAway: Integer);
    28942879var
    2895   i, ad, ead, adTestGiveAway: integer;
     2880  I, ad, ead, adTestGiveAway: Integer;
    28962881begin
    28972882  adWanted := -1;
     
    29032888    begin
    29042889      adTestGiveAway := -1;
    2905       for i := 0 to nRequestedTechs - 1 do
    2906         if (Data.RequestedTechs[i] >= 0) and
    2907           (Data.RequestedTechs[i] and $FFFF = Nation shl 8 + ead) then
     2890      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
    29082893          adTestGiveAway := -2; // already requested before
    29092894      if adTestGiveAway = -1 then
     
    29282913end;
    29292914
    2930 
    2931 function TAI.WantNegotiation(Nation: integer; NegoTime: TNegoTime): boolean;
     2915function TAI.WantNegotiation(Nation: Integer; NegoTime: TNegoTime): Boolean;
    29322916var
    2933   p1, Count, adWanted, adGiveAway: integer;
     2917  p1, Count, adWanted, adGiveAway: Integer;
    29342918begin
    29352919  if Data.BehaviorFlags and bBarbarina = bBarbarina then
    29362920  begin
    29372921    Result := Barbarina_WantNegotiation(Nation, NegoTime);
    2938     exit;
     2922    Exit;
    29392923  end;
    29402924
     
    29442928    begin
    29452929      Result := False;
    2946       exit;
     2930      Exit;
    29472931    end;
    29482932    Count := 0;
    29492933    for p1 := 0 to nPl - 1 do
    2950       if (p1 <> me) and (1 shl p1 and RO.Alive <> 0) and (RO.Treaty[p1] >= trPeace) then
     2934      if (p1 <> Me) and (1 shl p1 and RO.Alive <> 0) and (RO.Treaty[p1] >= trPeace) then
    29512935        Inc(Count);
    29522936    if Count >= 3 then // enough peace made
    29532937    begin
    29542938      Result := False;
    2955       exit;
     2939      Exit;
    29562940    end;
    29572941  end;
     
    29942978procedure TAI.DoNegotiation;
    29952979var
    2996   i, adWanted, adGiveAway, adToGet, Slot: integer;
    2997   BuildFreeOffer: boolean;
     2980  I, adWanted, adGiveAway, adToGet, Slot: Integer;
     2981  BuildFreeOffer: Boolean;
    29982982begin
    29992983  if MyLastAction = scDipOffer then
     
    30263010  begin
    30273011    Barbarina_DoNegotiation;
    3028     exit;
     3012    Exit;
    30293013  end;
    30303014
     
    30323016  begin
    30333017    Barbarina_DoCheckNegotiation;
    3034     exit;
     3018    Exit;
    30353019  end;
    30363020
     
    30473031      (OppoOffer.nDeliver + OppoOffer.nCost = 1) and
    30483032      (OppoOffer.Price[0] and opMask = opTreaty) and
    3049       (integer(OppoOffer.Price[0] - opTreaty) > RO.Treaty[Opponent]) and
     3033      (Integer(OppoOffer.Price[0] - opTreaty) > RO.Treaty[Opponent]) and
    30503034      ((OppoOffer.Price[0] - opTreaty < trAlliance) or
    30513035      (RO.Tech[adScience] >= tsSeen)) then
    30523036      MyAction := scDipAccept // accept all treaties
    30533037    else if (RO.Treaty[Opponent] >= trPeace) and (OppoOffer.nDeliver = 1) and
    3054       (OppoOffer.Price[0] and $FFFF0000 = opCivilReport + cardinal(Opponent) shl 16) and
     3038      (OppoOffer.Price[0] and $FFFF0000 = opCivilReport + Cardinal(Opponent) shl 16) and
    30553039      (OppoOffer.nCost = 1) and (OppoOffer.Price[1] and $FFFF0000 =
    3056       opCivilReport + cardinal(me) shl 16) then
     3040      opCivilReport + Cardinal(Me) shl 16) then
    30573041      MyAction := scDipAccept // accept exchange of civil reports
    30583042    else if (OppoOffer.nDeliver = 1) and (OppoOffer.nCost = 1) and
     
    30843068        adWanted := MostWanted(Opponent, OppoOffer.Price[1] - opTech);
    30853069        if (OppoOffer.Price[0] and opMask = opTech) and
    3086           (cardinal(adWanted) = OppoOffer.Price[0] - opTech) then
     3070          (Cardinal(adWanted) = OppoOffer.Price[0] - opTech) then
    30873071          MyAction := scDipAccept // opponent's offer is already perfect
    30883072        else if adWanted >= 0 then
     
    31403124        MyOffer.Price[1] := opTech + adWanted;
    31413125        MyAction := scDipOffer;
    3142         for i := 0 to nRequestedTechs - 1 do
    3143           if Data.RequestedTechs[i] < 0 then
     3126        for I := 0 to nRequestedTechs - 1 do
     3127          if Data.RequestedTechs[I] < 0 then
    31443128          begin
    3145             Slot := i;
    3146             break;
     3129            Slot := I;
     3130            Break;
    31473131          end
    3148           else if (i = 0) or (Data.RequestedTechs[i] shr 16 <
     3132          else if (I = 0) or (Data.RequestedTechs[I] shr 16 <
    31493133            Data.RequestedTechs[Slot] shr 16) then // find most outdated entry
    3150             Slot := i;
     3134            Slot := I;
    31513135        Data.RequestedTechs[Slot] := RO.Turn shl 16 + Opponent shl 8 + adWanted;
    31523136      end;
    31533137    end;
    31543138  end;
    3155 end; // Negotiation
    3156 
     3139end;
    31573140
    31583141procedure SetLeaveOutValue;
    31593142
    3160   procedure Process(ad: integer);
     3143  procedure Process(ad: Integer);
    31613144  var
    3162     i: integer;
     3145    I: Integer;
    31633146  begin
    31643147    if LeaveOutValue[ad] < 0 then
    31653148    begin
    31663149      LeaveOutValue[ad] := 0;
    3167       for i := 0 to 1 do
    3168         if AdvPreq[ad, i] >= 0 then
    3169         begin
    3170           Process(AdvPreq[ad, i]);
    3171           if AdvPreq[ad, i] in LeaveOutTechs then
    3172             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);
    31733156        end;
    31743157    end;
     
    31763159
    31773160var
    3178   ad: integer;
     3161  ad: Integer;
    31793162begin
    31803163  FillChar(LeaveOutValue, SizeOf(LeaveOutValue), $FF);
     
    31853168
    31863169initialization
    3187   RWDataSize := sizeof(TPersistentData);
     3170  RWDataSize := SizeOf(TPersistentData);
    31883171  SetLeaveOutValue;
    31893172
  • branches/highdpi/AI/StdAI/Barbarina.pas

    r349 r465  
    2525type
    2626  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;
    3232  end;
    3333
    3434  TBarbarina = class(TToolAI)
    35     constructor Create(Nation: integer); override;
     35    constructor Create(Nation: Integer); override;
    3636
    3737  protected
    3838    ColonyShipPlan: TColonyShipPlan;
    39     function Barbarina_GoHidden: boolean; // whether we should prepare for barbarina mode
    40     function Barbarina_Go: boolean; // whether we should switch to barbarina mode now
     39    function Barbarina_GoHidden: Boolean; // whether we should prepare for barbarina mode
     40    function Barbarina_Go: Boolean; // whether we should switch to barbarina mode now
    4141    procedure Barbarina_DoTurn;
    4242    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;
    4545    procedure Barbarina_DoCheckNegotiation;
    46     function Barbarina_WantNegotiation(Nation: integer; NegoTime: TNegoTime): boolean;
     46    function Barbarina_WantNegotiation(Nation: Integer; NegoTime: TNegoTime): Boolean;
    4747    procedure Barbarina_DoNegotiation;
    4848    procedure MakeColonyShipPlan;
    4949
    5050  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;
    5757    NegoCause: (CancelTreaty);
    58     function IsModelAvailable(rmix: integer): boolean;
     58    function IsModelAvailable(rmix: Integer): Boolean;
    5959    procedure FindBestModels;
    6060    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;
    6464    procedure AttackAndPatrol;
    6565  end;
     
    7373type
    7474  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;
    7878  end;
    7979
     
    9393
    9494  nResearchOrder = 40;
    95   ResearchOrder: array[0..nResearchOrder - 1] of integer =
     95  ResearchOrder: array[0..nResearchOrder - 1] of Integer =
    9696    (adBronzeWorking, -adMapMaking, adChivalry, adMonotheism, adIronWorking,
    9797    adGunPowder, adTheology, adConstruction, adCodeOfLaws, -adEngineering,
     
    171171
    172172var
    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;
    175175  euixMap: array[0..lxmax * lymax - 1] of smallint;
    176176  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
     179constructor TBarbarina.Create(Nation: Integer);
    180180begin
    181181  inherited;
     
    184184
    185185// whether one of the existing models matches a specific research model
    186 function TBarbarina.IsModelAvailable(rmix: integer): boolean;
     186function TBarbarina.IsModelAvailable(rmix: Integer): Boolean;
    187187var
    188   i, mix, MStrength: integer;
     188  I, mix, MStrength: Integer;
    189189begin
    190190  Result := False;
     
    199199        Result := MStrength < (MyModel[mix].MStrength * 3) div 2;
    200200        // for future techs: don't count model available if 50% stronger possible
    201         for i := 0 to nFeature - 1 do
    202           if MyModel[mix].Cap[i] < Cap[i] then
     201        for I := 0 to nFeature - 1 do
     202          if MyModel[mix].Cap[I] < Cap[I] then
    203203          begin
    204204            Result := False;
    205             break;
     205            Break;
    206206          end;
    207207        if Result then
    208           break;
     208          Break;
    209209      end;
    210210  end;
    211211end;
    212212
    213 function TBarbarina.Barbarina_GoHidden: boolean;
     213function TBarbarina.Barbarina_GoHidden: Boolean;
    214214var
    215   V21, Loc1, cix: integer;
     215  V21, Loc1, cix: Integer;
    216216  Radius: TVicinity21Loc;
    217217begin
     
    238238end;
    239239
    240 function TBarbarina.Barbarina_Go: boolean;
     240function TBarbarina.Barbarina_Go: Boolean;
    241241begin
    242242  if IsResearched(adMassProduction) then
     
    249249    Result := (RO.nCity >= 3) and IsResearched(adMapMaking) and
    250250      IsModelAvailable(EntryModel_Base);
    251     exit;
     251    Exit;
    252252  end;
    253253  Result := Result and ((RO.nUn >= RO.nCity * 3) or
    254     (RO.Wonder[woZeus].EffectiveOwner = me));
     254    (RO.Wonder[woZeus].EffectiveOwner = Me));
    255255end;
    256256
    257257procedure TBarbarina.AnalyzeMap;
    258258var
    259   Loc, Loc1, V8, f1, p1, cix: integer;
     259  Loc, Loc1, V8, f1, p1, cix: Integer;
    260260  Adjacent: TVicinity8Loc;
    261261begin
    262262  if TurnOfMapAnalysis = RO.Turn then
    263     exit;
     263    Exit;
    264264
    265265  // inherited;
    266266
    267267  // 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);
    272272  for Loc := 0 to MapSize - 1 do
    273273  begin
     
    339339procedure TBarbarina.FindBestModels;
    340340var
    341   i, mix, rmix, cat: integer;
     341  I, mix, rmix, cat: Integer;
    342342begin
    343   for i := 0 to nModelCategory - 1 do
    344     mixBest[i] := -1;
     343  for I := 0 to nModelCategory - 1 do
     344    mixBest[I] := -1;
    345345  for rmix := nResearchModel - 1 downto 0 do
    346346    with ResearchModel[rmix] do
     
    351351          begin
    352352            mixBest[Category] := mix;
    353             for i := 0 to nFeature - 1 do
    354               if MyModel[mix].Cap[i] < Cap[i] then
     353            for I := 0 to nFeature - 1 do
     354              if MyModel[mix].Cap[I] < Cap[I] then
    355355              begin
    356356                mixBest[Category] := -1;
    357                 break;
     357                Break;
    358358              end;
    359359            if mixBest[Category] >= 0 then
    360               break;
     360              Break;
    361361          end;
    362362  for mix := 3 to RO.nModel - 1 do
     
    387387      begin
    388388        mixBest[ctSeaTrans] := mix;
    389         break;
     389        Break;
    390390      end;
    391391end;
     
    406406
    407407// find one unit to destroy each known enemy unit, result in uixAttack
    408 procedure TBarbarina.RateAttack(uix: integer);
     408procedure TBarbarina.RateAttack(uix: Integer);
    409409var
    410410  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;
    413413  Adjacent: TVicinity8Loc;
    414414  Defense: ^TUnitInfo;
    415   Reached: array[0..lxmax * lymax - 1] of boolean;
     415  Reached: array[0..lxmax * lymax - 1] of Boolean;
    416416begin
    417417  with MyUnit[uix] do
     
    419419    begin
    420420      BestScore := 0;
    421       fillchar(Reached, MapSize, False);
     421      FillChar(Reached, MapSize, False);
    422422      MoveStyle := GetMyMoveStyle(mix, Health);
    423423      Pile.Create(MapSize);
     
    494494end;
    495495
    496 function TBarbarina.DoAttack(uix, AttackLoc: integer): boolean;
     496function TBarbarina.DoAttack(uix, AttackLoc: Integer): Boolean;
    497497  // AttackLoc=maNextCity means bombard only
    498498var
    499499  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;
    503503  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;
    506506begin
    507507  Result := False;
     
    516516    else
    517517      Kind := 0;
    518     fillchar(Reached, MapSize, False);
     518    FillChar(Reached, MapSize, False);
    519519    AttackPositionReached := False;
    520520    MoveStyle := GetMyMoveStyle(mix, Health);
     
    524524    begin
    525525      if (TestTime >= $800) or (AttackLoc = maNextCity) and (TestTime > $800 - 100) then
    526         break;
     526        Break;
    527527      Reached[TestLoc] := True;
    528528      V8_to_Loc(TestLoc, Adjacent);
     
    537537          begin
    538538            City_FindEnemyCity(NextLoc, ecix);
    539             assert(ecix >= 0);
     539            Assert(ecix >= 0);
    540540            with RO.EnemyCity[ecix] do
    541541              if (Size > 2) and (Flags and ciCoastalFort = 0) then
     
    547547          begin
    548548            AttackPositionReached := True;
    549             break;
     549            Break;
    550550          end
    551551          else if not Reached[NextLoc] then
     
    572572      begin
    573573        PreLoc[NextLoc] := TestLoc;
    574         break;
     574        Break;
    575575      end;
    576576    end;
    577577    Pile.Free;
    578578    if not AttackPositionReached then
    579       exit;
     579      Exit;
    580580
    581581    TestLoc := AttackLoc;
     
    601601    begin
    602602      City_FindEnemyCity(AttackLoc, ecix);
    603       assert(ecix >= 0);
     603      Assert(ecix >= 0);
    604604      while (Movement >= 100) and (RO.EnemyCity[ecix].Size > 2) do
    605605        Unit_Step(uix, AttackLoc);
     
    611611end;
    612612
    613 function TBarbarina.ProcessMove(uix: integer): boolean;
     613function TBarbarina.ProcessMove(uix: Integer): Boolean;
    614614  // return true if no new enemy spotted
    615615const
     
    618618  PatrolScore, BestCount, PatrolLoc, TestLoc, NextLoc, TestTime, V8,
    619619  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;
    623623  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;
    627627
    628628begin
     
    637637        if Map[Loc] and fCity = 0 then
    638638          Unit_MoveEx(uix, maNextCity);
    639         exit;
     639        Exit;
    640640      end;
    641641
     
    666666          // assume a score of $400 is the best achievable
    667667          or CaptureOnly and (TestTime >= $1000) then
    668           break;
     668          Break;
    669669
    670670        TestScore := 0;
    671671        Tile := Map[TestLoc];
    672         assert(Tile and (fUnit or fOwned) <> fUnit);
     672        Assert(Tile and (fUnit or fOwned) <> fUnit);
    673673        TerrOwner := RO.Territory[TestLoc];
    674674        AdjacentUnknown[TestLoc] := 0;
     
    743743              TestScore := $400 - 14
    744744            else if AdjacentUnknown[TestLoc] > 0 then
    745               if PeaceBorder or (TerrOwner >= 0) and (TerrOwner <> me) and
     745              if PeaceBorder or (TerrOwner >= 0) and (TerrOwner <> Me) and
    746746                (RO.Treaty[TerrOwner] < trPeace) then
    747747                TestScore := $400 - 32 + AdjacentUnknown[TestLoc]
     
    790790        end;
    791791        if PatrolLoc = Loc then
    792           exit;
     792          Exit;
    793793        TestLoc := PatrolLoc;
    794794        NextLoc := PreLoc[TestLoc];
     
    814814            Result := MoveResult and rEnemySpotted = 0;
    815815            done := True;
    816             break;
    817           end;
    818           assert(Loc = NextLoc);
     816            Break;
     817          end;
     818          Assert(Loc = NextLoc);
    819819        end;
    820820        if Loc >= 0 then
     
    833833  if Result then
    834834    Moved[uix] := True;
    835 end; // ProcessMove
     835end;
    836836
    837837procedure TBarbarina.AttackAndPatrol;
     
    839839  procedure SetCityDefenders;
    840840  var
    841     uix, cix, V8, Loc1, Best, uixBest, det: integer;
     841    uix, cix, V8, Loc1, Best, uixBest, det: Integer;
    842842    Adjacent: TVicinity8Loc;
    843     IsPort: boolean;
     843    IsPort: Boolean;
    844844  begin
    845845    for cix := 0 to RO.nCity - 1 do
     
    887887  procedure ProcessSeaTransport;
    888888  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;
    891891    TransportPlan: TGroupTransportPlan;
    892892  begin
    893893    go := False;
    894     for f := 0 to maxCOD - 1 do
    895       if (f < nContinent) and (ContinentPresence[f] and not
    896         (1 shl me or PresenceUnknown) <> 0) then
     894    for F := 0 to maxCOD - 1 do
     895      if (F < nContinent) and (ContinentPresence[F] and not
     896        (1 shl Me or PresenceUnknown) <> 0) then
    897897        go := True; // any enemy island known?
    898898    if not go then
    899       exit;
     899      Exit;
    900900
    901901    SeaTransport_BeginInitialize;
     
    907907            (MyModel[mix].Attack > 0) and (Map[Loc] and fTerrain >= fGrass) then
    908908          begin
    909             f := Formation[Loc];
    910             if (f >= 0) and (f < maxCOD) and (ContinentPresence[f] and
    911               not (1 shl me) = 0) then
     909            F := Formation[Loc];
     910            if (F >= 0) and (F < maxCOD) and (ContinentPresence[F] and
     911              not (1 shl Me) = 0) then
    912912            begin
    913913              go := True;
     
    932932        if Map[Loc1] and fTerrain >= fGrass then
    933933        begin
    934           f := Formation[Loc1];
    935           if (f >= 0) and (f < maxCOD) and (ContinentPresence[f] and
    936             not (1 shl me or PresenceUnknown) <> 0) then
     934          F := Formation[Loc1];
     935          if (F >= 0) and (F < maxCOD) and (ContinentPresence[F] and
     936            not (1 shl Me or PresenceUnknown) <> 0) then
    937937            SeaTransport_AddDestination(Loc1);
    938938        end;
     
    948948      end;
    949949      if ready then
    950         for i := 0 to TransportPlan.nLoad - 1 do
     950        for I := 0 to TransportPlan.nLoad - 1 do
    951951        begin
    952952          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);
    955955        end;
    956956      if ready then
    957957      begin
    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;
     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;
    962962        end;
    963963      end
    964964      else
    965965      begin
    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;
     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;
    970970        end;
    971971      end;
     
    973973  end;
    974974
    975   procedure ProcessUnload(uix: integer);
    976 
    977     procedure Unload(Kind, ToLoc: integer);
     975  procedure ProcessUnload(uix: Integer);
     976
     977    procedure Unload(Kind, ToLoc: Integer);
    978978    var
    979       uix1: integer;
     979      uix1: Integer;
    980980    begin
    981981      for uix1 := 0 to RO.nUn - 1 do
     
    987987            Unit_Step(uix1, ToLoc);
    988988            UnitPresence[ToLoc] := UnitPresence[ToLoc] or Kind;
    989             break;
     989            Break;
    990990          end;
    991991    end;
     
    993993  var
    994994    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;
    997997    Adjacent: TVicinity8Loc;
    998     Reached: array[0..lxmax * lymax - 1] of boolean;
     998    Reached: array[0..lxmax * lymax - 1] of Boolean;
    999999  begin
    10001000    // inventory
     
    10171017        FastUnloadLoc := -1;
    10181018        EndLoc := -1;
    1019         fillchar(Reached, MapSize, False);
     1019        FillChar(Reached, MapSize, False);
    10201020        Pile.Create(MapSize);
    10211021        Pile.Put(Loc, $800 - Movement);
     
    10341034              else if NextTile and fTerrain >= fGrass then
    10351035              begin
    1036                 f := Formation[NextLoc];
    1037                 if (f >= 0) and (f < maxCOD) and
    1038                   (ContinentPresence[f] and not (1 shl me or PresenceUnknown) <> 0) and
     1036                F := Formation[NextLoc];
     1037                if (F >= 0) and (F < maxCOD) and
     1038                  (ContinentPresence[F] and not (1 shl Me or PresenceUnknown) <> 0) and
    10391039                  (NextTile and (fUnit or fOwned) <> fUnit) then
    10401040                begin
     
    10741074
    10751075        if EndLoc < 0 then
    1076           exit;
     1076          Exit;
    10771077        if Loc <> EndLoc then
    10781078          Unit_MoveEx(uix, EndLoc);
    10791079        if Loc <> EndLoc then
    1080           exit;
     1080          Exit;
    10811081        if SlowUnloadLoc >= 0 then
    10821082        begin
     
    10921092        begin
    10931093          Moved[uix] := False;
    1094           exit;
     1094          Exit;
    10951095        end
    10961096      until False;
     
    10991099
    11001100var
    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;
    11041104begin
    1105   fillchar(UnitPresence, MapSize, 0);
     1105  FillChar(UnitPresence, MapSize, 0);
    11061106  for uix := 0 to RO.nUn - 1 do
    11071107    with MyUnit[uix] do
     
    11161116      end;
    11171117
    1118   fillchar(Moved, RO.nUn, False);
     1118  FillChar(Moved, RO.nUn, False);
    11191119  for uix := 0 to RO.nUn - 1 do
    11201120    if (MyUnit[uix].Master >= 0) or (MyUnit[uix].TroopLoad > 0) then
     
    11281128      if RO.nEnemyUn > 0 then
    11291129      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);
    11321132        for euix := 0 to RO.nEnemyUn - 1 do
    11331133          with RO.EnemyUn[euix] do
     
    11401140      end;
    11411141      if not BackToStart then
    1142         break;
     1142        Break;
    11431143
    11441144      for uix := 0 to RO.nUn - 1 do
     
    11551155            euixBest := euix;
    11561156        if euixBest < 0 then
    1157           break;
     1157          Break;
    11581158        uix := uixAttack[euixBest];
    11591159        AttackLoc := RO.EnemyUn[euixBest].Loc;
     
    12021202            begin
    12031203              BackToStart := True;
    1204               break;
     1204              Break;
    12051205            end
    12061206  until not BackToStart;
    1207 end; // AttackAndPatrol
     1207end;
    12081208
    12091209procedure TBarbarina.Barbarina_SetCityProduction;
     
    12141214    1 shl woMagellan + 1 shl woEiffel + 1 shl woLiberty + 1 shl woShinkansen;
    12151215
    1216   function LowPriority(cix: integer): boolean;
     1216  function LowPriority(cix: Integer): Boolean;
    12171217  var
    1218     part, cixHighPriority, TestDistance: integer;
     1218    part, cixHighPriority, TestDistance: Integer;
    12191219  begin
    12201220    Result := False;
     
    12281228        begin
    12291229          Result := True;
    1230           exit;
     1230          Exit;
    12311231        end;
    12321232      end;
     
    12341234  end;
    12351235
    1236   function ChooseWonderToBuild(WonderAvailable: integer; AllowCoastal: boolean): integer;
     1236  function ChooseWonderToBuild(WonderAvailable: Integer; AllowCoastal: Boolean): Integer;
    12371237  var
    1238     Count, iix: integer;
     1238    Count, iix: Integer;
    12391239  begin
    12401240    if (WonderAvailable and PrimeWonder > 0) and (AllowCoastal or
     
    12671267      begin
    12681268        Result := iix;
    1269         exit;
     1269        Exit;
    12701270      end;
    12711271    end;
     
    12731273
    12741274var
    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;
    12791279  //RareLoc: array[0..5] of integer;
    12801280  Adjacent: TVicinity8Loc;
    12811281  IsCoastal, IsPort, IsUnitProjectObsolete, HasSettler, SpezializeShipProduction,
    12821282  AlgaeAvailable, ProjectComplete, DoLowPriority, WillProduceColonyShip,
    1283   ImportantCity: boolean;
     1283  ImportantCity: Boolean;
    12841284  Radius: TVicinity21Loc;
    12851285  Report: TCityReportNew;
     
    12891289  FindBestModels;
    12901290
    1291   fillchar(mixCount, RO.nModel * 4, 0);
     1291  FillChar(mixCount, RO.nModel * 4, 0);
    12921292  for uix := 0 to RO.nUn - 1 do
    12931293    with MyUnit[uix] do
     
    13171317      begin
    13181318        Inc(TotalPop, Size);
    1319         f := Formation[Loc];
    1320         if (f < 0) or (f >= maxCOD) or (ContinentPresence[f] = 1 shl me) then
     1319        F := Formation[Loc];
     1320        if (F < 0) or (F >= maxCOD) or (ContinentPresence[F] = 1 shl Me) then
    13211321          Inc(AlonePop, Size);
    13221322      end;
     
    13581358              if (f1 >= 0) and (f1 < maxCOD) and
    13591359                ((OceanSize[f1] >= 8) or (OceanPresence[f1] and not
    1360                 (1 shl me) <> 0)) then
     1360                (1 shl Me) <> 0)) then
    13611361              begin // prefer non-coastal cities
    13621362                Dec(Score, 18);
    1363                 break;
     1363                Break;
    13641364              end;
    13651365            end;
     
    13901390          (LowPriority(cix) = DoLowPriority) then
    13911391        begin
    1392           f := Formation[Loc];
     1392          F := Formation[Loc];
    13931393          IsCoastal := False;
    13941394          IsPort := False;
     
    14021402              f1 := Formation[Loc1];
    14031403              if (f1 >= 0) and (f1 < maxCOD) and (OceanSize[f1] >= 8) and
    1404                 (OceanPresence[f1] and not (1 shl me) <> 0) then
     1404                (OceanPresence[f1] and not (1 shl Me) <> 0) then
    14051405              begin
    14061406                IsPort := True;
    1407                 break;
     1407                Break;
    14081408              end;
    14091409            end;
     
    14121412            (RO.Model[City_CurrentUnitProject(cix)].Kind <> mkSettler) then
    14131413          begin
    1414             i := nModelCategory - 1;
    1415             while (i >= 0) and (City_CurrentUnitProject(cix) <> mixBest[i]) do
    1416               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;
    14181418          end
    14191419          else
     
    15811581              City_StartImprovement(cix,imMissileBat)}
    15821582                else if IsPort and (not SpezializeShipProduction or
    1583                   (f < 0) or (f >= maxCOD) or (ContinentPresence[f] = 1 shl me)) and
     1583                  (F < 0) or (F >= maxCOD) or (ContinentPresence[F] = 1 shl Me)) and
    15841584                  (Built[imDockyard] = 0) and City_Improvable(cix, imDockyard) then
    15851585                  City_StartImprovement(cix, imDockyard)
    15861586                else if IsPort and (mixShip >= 0) and
    1587                   (not SpezializeShipProduction or (f < 0) or
    1588                   (f >= maxCOD) or (ContinentPresence[f] = 1 shl me)) then
     1587                  (not SpezializeShipProduction or (F < 0) or
     1588                  (F >= maxCOD) or (ContinentPresence[F] = 1 shl Me)) then
    15891589                  City_StartUnitProduction(cix, mixShip)
    15901590                else if (Built[imBarracks] + Built[imMilAcademy] = 0) and
     
    16001600          if (City_CurrentImprovementProject(cix) = imCourt) and
    16011601            (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) *
    16041604            2 div 3) then
    16051605            City_RebuildImprovement(cix, imTownHall)
     
    16141614                if City_RebuildImprovement(cix, iix) < rExecuted then
    16151615                  City_SellImprovement(cix, iix);
    1616                 break;
     1616                Break;
    16171617              end;
    16181618        end;
    16191619end;
    16201620
    1621 function TBarbarina.Barbarina_ChooseResearchAdvance: integer;
     1621function TBarbarina.Barbarina_ChooseResearchAdvance: Integer;
    16221622var
    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;
    16251625  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);
    16291629  var
    1630     i: integer;
    1631     PreqOk: boolean;
     1630    I: Integer;
     1631    PreqOk: Boolean;
    16321632  begin
    1633     assert(RO.Tech[ad] < tsApplicable);
     1633    Assert(RO.Tech[ad] < tsApplicable);
    16341634    if known[ad] = 0 then
    16351635    begin
     
    16371637      PreqOk := True;
    16381638      if not (ad in [adScience, adMassProduction]) and (RO.Tech[ad] < tsSeen) then
    1639         for i := 0 to 1 do
    1640           if (AdvPreq[ad, i] >= 0) and (RO.Tech[AdvPreq[ad, i]] < tsApplicable) then
     1639        for I := 0 to 1 do
     1640          if (AdvPreq[ad, I] >= 0) and (RO.Tech[AdvPreq[ad, I]] < tsApplicable) then
    16411641          begin
    16421642            PreqOk := False;
    1643             ChoosePreq(AdvPreq[ad, i]);
     1643            ChoosePreq(AdvPreq[ad, I]);
    16441644          end;
    16451645      if PreqOk then
     
    16971697        ready := (MaxWeight >= Weight) and (MaxDefense >= Cap[mcDefense]);
    16981698        if ready then
    1699           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
     1699          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
    17021702              ready := False;
    17031703        if ready then
    17041704        begin
    1705           for i := 0 to nUpgrade - 1 do
    1706             if (Upgrades and (1 shl i) <> 0) and not
    1707               IsResearched(Upgrade[Domain, i].Preq) then
     1705          for I := 0 to nUpgrade - 1 do
     1706            if (Upgrades and (1 shl I) <> 0) and not
     1707              IsResearched(Upgrade[Domain, I].Preq) then
    17081708              ready := False;
    17091709        end;
    17101710        if ready then
    17111711        begin
    1712           include(ModelExists, Category);
     1712          Include(ModelExists, Category);
    17131713          if not IsModelAvailable(rmix) then
    17141714            rmixChosen := rmix;
     
    17191719    begin
    17201720      PrepareNewModel(Domain);
    1721       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
     1721      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
    17251725      begin
    17261726        //if Cap[mcWeapons]>=2*Cap[mcArmor] then
     
    17301730      end;
    17311731      Result := adMilitary;
    1732       exit;
     1732      Exit;
    17331733    end;
    17341734
    17351735  NeedSeaUnits := True;
    1736   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
     1736  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
    17411741  begin
    17421742    if random(2) = 1 then
     
    17501750    nPreq := 0;
    17511751    ChosenPreq := -1;
    1752     ChoosePreq(abs(ResearchOrder[i]));
    1753     assert(nPreq > 0);
     1752    ChoosePreq(abs(ResearchOrder[I]));
     1753    Assert(nPreq > 0);
    17541754    Result := ChosenPreq;
    17551755  end;
    17561756end;
    17571757
    1758 function TBarbarina.Barbarina_WantCheckNegotiation(Nation: integer): boolean;
     1758function TBarbarina.Barbarina_WantCheckNegotiation(Nation: Integer): Boolean;
    17591759begin
    17601760  if (RO.Tech[adTheRepublic] < tsSeen) and (RO.Tech[adTheology] >= tsApplicable) and
     
    17691769begin
    17701770  if RO.Tech[adTheRepublic] >= tsSeen then
    1771     exit; // default reaction
     1771    Exit; // default reaction
    17721772  if MyLastAction = scContact then
    17731773  begin
     
    17971797end;
    17981798
    1799 function TBarbarina.Barbarina_WantNegotiation(Nation: integer;
    1800   NegoTime: TNegoTime): boolean;
     1799function TBarbarina.Barbarina_WantNegotiation(Nation: Integer;
     1800  NegoTime: TNegoTime): Boolean;
    18011801var
    1802   uix, TestLoc, V8: integer;
     1802  uix, TestLoc, V8: Integer;
    18031803  Adjacent: TVicinity8Loc;
    18041804begin
     
    18121812      if RO.Turn >= RO.LastCancelTreaty[Nation] + CancelTreatyTurns then
    18131813      begin
    1814         if (RO.Turn and 3 = (Nation + $F - me) and 3) and
     1814        if (RO.Turn and 3 = (Nation + $F - Me) and 3) and
    18151815          (RO.Treaty[Nation] > trPeace) then
    18161816        begin
     
    18381838                    NegoCause := CancelTreaty;
    18391839                    Result := True;
    1840                     exit;
     1840                    Exit;
    18411841                  end;
    18421842                end;
     
    18581858procedure TBarbarina.MakeColonyShipPlan;
    18591859var
    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;
    18641864  Radius, RadiusC: TVicinity21Loc;
    18651865begin
     
    18871887              begin
    18881888                part := (Tile and fModern) shr 25 - 1;
    1889                 if RO.Ship[me].Parts[part] < ShipNeed[part] then
     1889                if RO.Ship[Me].Parts[part] < ShipNeed[part] then
    18901890                  // not enough of this kind already
    18911891                begin
     
    18931893                  if ColonyShipPlan[part].cixProducing >= 0 then
    18941894                  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;
    18961896                    BestValue :=
    18971897                      (MyCity[ColonyShipPlan[part].cixProducing].ID and $FFF) shl
    18981898                      4 + ((MyCity[ColonyShipPlan[part].cixProducing].ID shr 12) +
    1899                       15 - me) and $F;
     1899                      15 - Me) and $F;
    19001900                    if TestValue <= BestValue then
    19011901                      ok := False;
     
    19121912    check := False;
    19131913    for part := 0 to nShipPart - 1 do
    1914       if (RO.Ship[me].Parts[part] < ShipNeed[part]) // not enough of this kind already
     1914      if (RO.Ship[Me].Parts[part] < ShipNeed[part]) // not enough of this kind already
    19151915        and (ColonyShipPlan[part].cixProducing < 0) then // no city to produce
    19161916        check := True;
     
    19311931      end;
    19321932      for part := 0 to nShipPart - 1 do
    1933         if (RO.Ship[me].Parts[part] < ShipNeed[part]) // not enough of this kind already
     1933        if (RO.Ship[Me].Parts[part] < ShipNeed[part]) // not enough of this kind already
    19341934          and (ColonyShipPlan[part].cixProducing < 0) // no city to produce
    19351935          and (ColonyShipPlan[part].nLocResource > 0) then // resource is known
    19361936        begin
    1937           for i := 0 to ColonyShipPlan[part].nLocResource - 1 do
     1937          for I := 0 to ColonyShipPlan[part].nLocResource - 1 do
    19381938          begin
    19391939            BestScore := 0;
    1940             V21_to_Loc(ColonyShipPlan[part].LocResource[i], Radius);
     1940            V21_to_Loc(ColonyShipPlan[part].LocResource[I], Radius);
    19411941            for V21 := 1 to 26 do
    19421942            begin // check all potential cities in range
     
    19841984                      Dec(ProdCount, 5 - FoodCount);
    19851985                    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;
    19871987                    // some unexactness, random but always the same for this tile
    19881988                  end;
  • branches/highdpi/AI/StdAI/CustomAI.pas

    r303 r465  
    1313  TCustomAI = class
    1414  public
    15     procedure Process(Command: integer; var Data);
     15    procedure Process(Command: Integer; var Data);
    1616
    1717    // overridables
    18     constructor Create(Nation: integer); virtual;
     18    constructor Create(Nation: Integer); virtual;
    1919    destructor Destroy; override;
    2020    procedure SetDataDefaults; virtual;
    2121    procedure SetDataRandom; virtual;
    2222    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;
    2525    procedure OnAfterEnemyAttack; virtual;
    2626    procedure OnAfterEnemyCapture; virtual;
    2727
    2828  protected
    29     me: integer; // index of the controlled nation
     29    Me: Integer; // index of the controlled nation
    3030    RO: ^TPlayerContext;
    3131    Map: ^TTileList;
     
    3434    MyModel: ^TModelList;
    3535
    36     cixStateImp: array[imPalace..imSpacePort] of integer;
     36    cixStateImp: array[imPalace..imSpacePort] of Integer;
    3737
    3838    // negotiation
    39     Opponent: integer; // nation i'm in negotiation with, -1 indicates no-negotiation mode
    40     MyAction, MyLastAction, OppoAction: integer;
     39    Opponent: Integer; // nation i'm in negotiation with, -1 indicates no-negotiation mode
     40    MyAction, MyLastAction, OppoAction: Integer;
    4141    MyOffer, MyLastOffer, OppoOffer: TOffer;
    4242
     
    4444    procedure DoTurn; virtual;
    4545    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;
    5151
    5252    // 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;
    6565
    6666    // 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;
    8686
    8787    // 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);
    112112
    113113    // negotiation
    114     function Nego_CheckMyAction: integer;
     114    function Nego_CheckMyAction: Integer;
    115115
    116116  private
    117     HaveTurned: boolean;
     117    HaveTurned: Boolean;
    118118    UnwantedNego: set of 0..nPl - 1;
    119119    Contacted: set of 0..nPl - 1;
     
    125125  Server: TServerCall;
    126126  G: TNewGameData;
    127   RWDataSize, MapSize: integer;
    128   decompose24: cardinal;
    129   nodata: pointer;
     127  RWDataSize, MapSize: Integer;
     128  decompose24: Cardinal;
     129  nodata: Pointer;
    130130
    131131const
     
    139139
    140140type
    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;
    143143
    144144
    145145procedure Init(NewGameData: TNewGameData);
    146146
    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;
     147procedure ab_to_Loc(Loc0, A, B: Integer; var Loc: Integer);
     148procedure Loc_to_ab(Loc0, Loc: Integer; var A, B: Integer);
     149procedure ab_to_V8(A, B: Integer; var V8: Integer);
     150procedure V8_to_ab(V8: Integer; var A, B: Integer);
     151procedure ab_to_V21(A, B: Integer; var V21: Integer);
     152procedure V21_to_ab(V21: Integer; var A, B: Integer);
     153procedure V8_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity8Loc);
     154procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc);
     155function Distance(Loc0, Loc1: Integer): Integer;
    156156
    157157
     
    159159
    160160const
    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
     166procedure ab_to_Loc(Loc0, A, B: Integer; var Loc: Integer);
    167167{relative location from Loc0}
    168168var
    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;
     170begin
     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);
    174174  if Loc >= MapSize then
    175175    Loc := -$1000;
    176176end;
    177177
    178 procedure Loc_to_ab(Loc0, Loc: integer; var a, b: integer);
     178procedure Loc_to_ab(Loc0, Loc: Integer; var A, B: Integer);
    179179{$IFDEF FPC}// freepascal
    180180var
    181   dx, dy: integer;
     181  dx, dy: Integer;
    182182begin
    183183  dx := ((Loc mod G.lx * 2 + Loc div G.lx and 1) - (Loc0 mod G.lx * 2 + Loc0 div
    184184    G.lx and 1) + 3 * G.lx) mod (2 * G.lx) - G.lx;
    185185  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;
    188188end;
    189189
     
    195195// calculate
    196196push ecx
    197 div byte ptr [G]
     197div Byte ptr [G]
    198198xor ebx,ebx
    199199mov bl,ah  // ebx:=Loc0 mod G.lx
     
    201201and ecx,$000000FF // ecx:=Loc0 div G.lx
    202202mov eax,edx
    203 div byte ptr [G]
     203div Byte ptr [G]
    204204xor edx,edx
    205205mov dl,ah // edx:=Loc mod G.lx
     
    218218mov edx,dword ptr [G]
    219219cmp eax,edx
    220 jl @a
     220jl @A
    221221  sub eax,edx
    222222  sub eax,edx
    223223  jmp @ok
    224 @a:
     224@A:
    225225neg edx
    226226cmp eax,edx
     
    235235add eax,ebx
    236236sar edx,1 // edx:=b
    237 mov ebx,[b]
     237mov ebx,[B]
    238238mov [ebx],edx
    239239sar eax,1 // eax:=a
    240 mov [a],eax
     240mov [A],eax
    241241
    242242pop ebx
     
    244244{$ENDIF}
    245245
    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;
     246procedure ab_to_V8(A, B: Integer; var V8: Integer);
     247begin
     248  Assert((abs(A) <= 1) and (abs(B) <= 1) and ((A <> 0) or (B <> 0)));
     249  V8 := ab_v8[2 * B + B + A];
     250end;
     251
     252procedure V8_to_ab(V8: Integer; var A, B: Integer);
     253begin
     254  A := v8_a[V8];
     255  B := V8_b[V8];
     256end;
     257
     258procedure ab_to_V21(A, B: Integer; var V21: Integer);
     259begin
     260  V21 := (A + B + 3) shl 2 + (A - B + 3) shr 1;
     261end;
     262
     263procedure V21_to_ab(V21: Integer; var A, B: Integer);
     264var
     265  dx, dy: Integer;
    266266begin
    267267  dy := V21 shr 2 - 3;
    268268  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;
     271end;
     272
     273procedure V8_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity8Loc);
     274var
     275  x0, y0, lx: Integer;
    276276begin
    277277  lx := G.lx;
    278   y0 := cardinal(Loc0) * decompose24 shr 24;
     278  y0 := Cardinal(Loc0) * decompose24 shr 24;
    279279  x0 := Loc0 - y0 * lx; // Loc0 mod lx;
    280280  VicinityLoc[1] := Loc0 + lx * 2;
     
    323323end;
    324324
    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;
     325procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc);
     326var
     327  dx, dy, bit, y0, xComp, yComp, xComp0, xCompSwitch: Integer;
     328  dst: ^Integer;
     329begin
     330  y0 := Cardinal(Loc0) * decompose24 shr 24;
    331331  xComp0 := Loc0 - y0 * G.lx - 1; // Loc0 mod G.lx -1
    332332  xCompSwitch := xComp0 - 1 + y0 and 1;
     
    368368end;
    369369
    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);
     370function Distance(Loc0, Loc1: Integer): Integer;
     371var
     372  A, B, dx, dy: Integer;
     373begin
     374  Loc_to_ab(Loc0, Loc1, A, B);
     375  dx := abs(A - B);
     376  dy := abs(A + B);
    377377  Result := dx + dy + abs(dx - dy) shr 1;
    378378end;
     
    381381procedure Init(NewGameData: TNewGameData);
    382382{$IFDEF DEBUG}var
    383   Loc: integer;
     383  Loc: Integer;
    384384{$ENDIF}
    385385begin
     
    389389{$IFDEF DEBUG}
    390390  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));
    392392{$ENDIF}
    393393end;
    394394
    395395
    396 constructor TCustomAI.Create(Nation: integer);
     396constructor TCustomAI.Create(Nation: Integer);
    397397begin
    398398  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);
    405405  Opponent := -1;
    406406end;
     
    408408destructor TCustomAI.Destroy;
    409409begin
    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^);
     411end;
     412
     413
     414procedure TCustomAI.Process(Command: Integer; var Data);
     415var
     416  Nation, NewResearch, NewGov, Count, ad, cix, iix: Integer;
    417417  NegoTime: TNegoTime;
    418418begin
     
    420420    cTurn, cContinue:
    421421    begin
    422       if RO.Alive and (1 shl me) = 0 then
     422      if RO.Alive and (1 shl Me) = 0 then
    423423      begin // I'm dead, huhu
    424         Server(sTurn, me, 0, nodata^);
    425         exit;
     424        Server(sTurn, Me, 0, nodata^);
     425        Exit;
    426426      end;
    427427      if Command = cTurn then
    428428      begin
    429         fillchar(cixStateImp, sizeof(cixStateImp), $FF);
     429        FillChar(cixStateImp, SizeOf(cixStateImp), $FF);
    430430        for cix := 0 to RO.nCity - 1 do
    431431          if MyCity[cix].Loc >= 0 then
     
    437437          NewGov := ChooseGovernment;
    438438          if NewGov > gAnarchy then
    439             Server(sSetGovernment, me, NewGov, nodata^);
     439            Server(sSetGovernment, Me, NewGov, nodata^);
    440440        end;
    441441        HaveTurned := False;
     
    446446        if OnNegoRejected_CancelTreaty then
    447447          if RO.Treaty[Opponent] >= trPeace then
    448             if Server(sCancelTreaty, me, 0, nodata^) < rExecuted then
    449               assert(False);
     448            if Server(sCancelTreaty, Me, 0, nodata^) < rExecuted then
     449              Assert(False);
    450450      end
    451451      else
     
    459459        if RO.Government <> gAnarchy then
    460460          for Nation := 0 to nPl - 1 do
    461             if (Nation <> me) and (1 shl Nation and RO.Alive <> 0) and
     461            if (Nation <> Me) and (1 shl Nation and RO.Alive <> 0) and
    462462              (RO.Treaty[Nation] >= trNone) and not (Nation in Contacted) and not
    463463              (Nation in UnwantedNego) and
    464               (Server(scContact - sExecute + Nation shl 4, me, 0, nodata^) >= rExecuted) then
     464              (Server(scContact - sExecute + Nation shl 4, Me, 0, nodata^) >= rExecuted) then
    465465              if WantNegotiation(Nation, NegoTime) then
    466466              begin
    467                 if Server(scContact + Nation shl 4, me, 0, nodata^) >= rExecuted then
     467                if Server(scContact + Nation shl 4, Me, 0, nodata^) >= rExecuted then
    468468                begin
    469                   include(Contacted, Nation);
     469                  Include(Contacted, Nation);
    470470                  Opponent := Nation;
    471471                  MyAction := scContact;
    472                   exit;
     472                  Exit;
    473473                end;
    474474              end
    475475              else
    476                 include(UnwantedNego, Nation);
     476                Include(UnwantedNego, Nation);
    477477        if NegoTime = BeginOfTurn then
    478478        begin
     
    483483        end
    484484        else
    485           break;
     485          Break;
    486486      until False;
    487487      if RO.Happened and phTech <> 0 then
     
    499499            end;
    500500        end;
    501         Server(sSetResearch, me, NewResearch, nodata^);
     501        Server(sSetResearch, Me, NewResearch, nodata^);
    502502      end;
    503       if Server(sTurn, me, 0, nodata^) < rExecuted then
    504         assert(False);
     503      if Server(sTurn, Me, 0, nodata^) < rExecuted then
     504        Assert(False);
    505505    end;
    506506    scContact:
    507       if WantNegotiation(integer(Data), EnemyCalled) then
     507      if WantNegotiation(Integer(Data), EnemyCalled) then
    508508      begin
    509         if Server(scDipStart, me, 0, nodata^) < rExecuted then
    510           assert(False);
    511         Opponent := integer(Data);
     509        if Server(scDipStart, Me, 0, nodata^) < rExecuted then
     510          Assert(False);
     511        Opponent := Integer(Data);
    512512        MyAction := scDipStart;
    513513      end
    514514      else
    515515      begin
    516         if Server(scReject, me, 0, nodata^) < rExecuted then
    517           assert(False);
     516        if Server(scReject, Me, 0, nodata^) < rExecuted then
     517          Assert(False);
    518518      end;
    519519    scDipStart, scDipNotice, scDipAccept, scDipCancelTreaty, scDipOffer, scDipBreak:
     
    538538      end;
    539539      DoNegotiation;
    540       assert((MyAction = scDipNotice) or (MyAction = scDipAccept) or
     540      Assert((MyAction = scDipNotice) or (MyAction = scDipAccept) or
    541541        (MyAction = scDipCancelTreaty) or (MyAction = scDipOffer) or (MyAction = scDipBreak));
    542542      if MyAction = scDipOffer then
    543         Server(MyAction, me, 0, MyOffer)
     543        Server(MyAction, Me, 0, MyOffer)
    544544      else
    545         Server(MyAction, me, 0, nodata^);
     545        Server(MyAction, Me, 0, nodata^);
    546546    end;
    547547    cShowEndContact:
     
    568568
    569569procedure 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);
     571begin
     572end;
     573
     574procedure TCustomAI.OnBeforeEnemyCapture(UnitInfo: TUnitInfo; ToLoc: Integer);
    575575begin
    576576end;
     
    584584end;
    585585
    586 function TCustomAI.ChooseResearchAdvance: integer;
     586function TCustomAI.ChooseResearchAdvance: Integer;
    587587begin
    588588  Result := -1;
    589589end;
    590590
    591 function TCustomAI.ChooseStealAdvance: integer;
     591function TCustomAI.ChooseStealAdvance: Integer;
    592592begin
    593593  Result := -1;
    594594end;
    595595
    596 function TCustomAI.ChooseGovernment: integer;
     596function TCustomAI.ChooseGovernment: Integer;
    597597begin
    598598  Result := gDespotism;
    599599end;
    600600
    601 function TCustomAI.WantNegotiation(Nation: integer; NegoTime: TNegoTime): boolean;
     601function TCustomAI.WantNegotiation(Nation: Integer; NegoTime: TNegoTime): Boolean;
    602602begin
    603603  Result := False;
    604604end;
    605605
    606 function TCustomAI.OnNegoRejected_CancelTreaty: boolean;
     606function TCustomAI.OnNegoRejected_CancelTreaty: Boolean;
    607607begin
    608608  Result := False;
     
    613613procedure TCustomAI.StealAdvance;
    614614var
    615   Steal, ad, Count: integer;
     615  Steal, ad, Count: Integer;
    616616begin
    617617  Steal := ChooseStealAdvance;
     
    628628  end;
    629629  if Steal >= 0 then
    630     Server(sStealTech, me, Steal, nodata^);
     630    Server(sStealTech, Me, Steal, nodata^);
    631631  RO.Happened := RO.Happened and not phStealTech;
    632632end;
    633633
    634 function TCustomAI.IsResearched(Advance: integer): boolean;
     634function TCustomAI.IsResearched(Advance: Integer): Boolean;
    635635begin
    636636  Result := (Advance = preNone) or (Advance <> preNA) and (RO.Tech[Advance] >= tsApplicable);
    637637end;
    638638
    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)^);
     639function TCustomAI.ResearchCost: Integer;
     640begin
     641  Server(sGetTechCost, Me, 0, Result);
     642end;
     643
     644function TCustomAI.ChangeAttitude(Nation, Attitude: Integer): Integer;
     645begin
     646  Result := Server(sSetAttitude + Nation shl 4, Me, Attitude, nodata^);
     647end;
     648
     649function TCustomAI.Revolution: Integer;
     650begin
     651  Result := Server(sRevolution, Me, 0, nodata^);
     652end;
     653
     654function TCustomAI.ChangeRates(Tax, Lux: Integer): Integer;
     655begin
     656  Result := Server(sSetRates, Me, Tax div 10 and $F + Lux div 10 and $F shl 4, nodata^);
     657end;
     658
     659function TCustomAI.PrepareNewModel(Domain: Integer): Integer;
     660begin
     661  Result := Server(sCreateDevModel, Me, Domain, nodata^);
     662end;
     663
     664function TCustomAI.SetNewModelFeature(F, Count: Integer): Integer;
     665begin
     666  Result := Server(sSetDevModelCap + Count shl 4, Me, F, nodata^);
     667end;
     668
     669function TCustomAI.AdvanceResearchable(Advance: Integer): Boolean;
     670begin
     671  Result := Server(sSetResearch - sExecute, Me, Advance, nodata^) >= rExecuted;
     672end;
     673
     674function TCustomAI.AdvanceStealable(Advance: Integer): Boolean;
     675begin
     676  Result := Server(sStealTech - sExecute, Me, Advance, nodata^) >= rExecuted;
     677end;
     678
     679function TCustomAI.GetJobProgress(Loc: Integer;
     680  var JobProgress: TJobProgressData): Boolean;
     681begin
     682  Result := Server(sGetJobProgress, Me, Loc, JobProgress) >= rExecuted;
     683end;
     684
     685function TCustomAI.DebugMessage(Level: Integer; Text: string): Boolean;
     686begin
     687  Text := Copy('P' + char(48 + Me) + ' ' + Text, 1, 254);
     688  Server(sMessage, Me, Level, PChar(Text)^);
    689689
    690690  Result := True;
     
    693693end;
    694694
    695 function TCustomAI.SetDebugMap(var DebugMap): boolean;
    696 begin
    697   Server(sSetDebugMap, me, 0, DebugMap);
     695function TCustomAI.SetDebugMap(var DebugMap): Boolean;
     696begin
     697  Server(sSetDebugMap, Me, 0, DebugMap);
    698698
    699699  Result := True;
     
    702702end;
    703703
    704 procedure TCustomAI.Unit_FindMyDefender(Loc: integer; var uix: integer);
    705 begin
    706   if Server(sGetDefender, me, Loc, uix) < rExecuted then
     704procedure TCustomAI.Unit_FindMyDefender(Loc: Integer; var uix: Integer);
     705begin
     706  if Server(sGetDefender, Me, Loc, uix) < rExecuted then
    707707    uix := -1;
    708708end;
    709709
    710 procedure TCustomAI.Unit_FindEnemyDefender(Loc: integer; var euix: integer);
     710procedure TCustomAI.Unit_FindEnemyDefender(Loc: Integer; var euix: Integer);
    711711begin
    712712  euix := RO.nEnemyUn - 1;
     
    715715end;
    716716
    717 function TCustomAI.Unit_Move(uix, ToLoc: integer): integer;
    718 var
    719   Step: integer;
    720   DestinationReached: boolean;
     717function TCustomAI.Unit_Move(uix, ToLoc: Integer): Integer;
     718var
     719  Step: Integer;
     720  DestinationReached: Boolean;
    721721  Advice: TMoveAdviceData;
    722722begin
    723   assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0)); // is a unit
     723  Assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0)); // is a unit
    724724{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) then
     725Assert((A<>0) or (B<>0));
     726if (A>=-1) and (A<=1) and (B>=-1) and (B<=1) then
    727727  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)
    729729  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;
    732732  Advice.MoreTurns:=0;
    733733  Advice.MaxHostile_MovementLeft:=MyUnit[uix].Movement;
    734   result:=eOK;
     734  Result:=eOK;
    735735  end
    736736else}
     
    739739    Advice.MoreTurns := 9999;
    740740    Advice.MaxHostile_MovementLeft := 100;
    741     Result := Server(sGetMoveAdvice, me, uix, Advice);
     741    Result := Server(sGetMoveAdvice, Me, uix, Advice);
    742742  end;
    743743  if Result = eOk then
     
    755755        begin
    756756          DestinationReached := True;
    757           break;
     757          Break;
    758758        end // stop next to destination
    759759        else if Step = Advice.nStep then
     
    761761
    762762      if (Step = Advice.nStep) or (Result <> eOK) and (Result <> eLoaded) then
    763         break;
     763        Break;
    764764
    765765      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^);
    767767      Inc(Step);
    768768      if RO.Happened and phStealTech <> 0 then
     
    779779end;
    780780
    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^);
     781function TCustomAI.Unit_Step(uix, ToLoc: Integer): Integer;
     782var
     783  A, B: Integer;
     784begin
     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^);
    788788  if RO.Happened and phStealTech <> 0 then
    789789    StealAdvance;
    790790end;
    791791
    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 unit
     792function TCustomAI.Unit_Attack(uix, ToLoc: Integer): Integer;
     793var
     794  A, B: Integer;
     795begin
     796  Assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0) // is a unit
    797797    and ((Map[ToLoc] and (fUnit or fOwned) = fUnit) // is an attack
    798798    or (Map[ToLoc] and (fCity or fOwned) = fCity) and
    799799    (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));
    802802  // 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^);
     804end;
     805
     806function TCustomAI.Unit_DoMission(uix, MissionType, ToLoc: Integer): Integer;
     807var
     808  A, B: Integer;
     809begin
     810  Result := Server(sSetSpyMission + MissionType shl 4, Me, 0, nodata^);
    811811  if Result >= rExecuted then
    812812  begin
    813     assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0) // is a unit
     813    Assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0) // is a unit
    814814      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));
    817817    // 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^);
    819819    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^)
    821821    else if (Result <> eNoTime_Move) and (Result <> eTreaty) and (Result <> eNoTurn) then
    822822      Result := eInvalid; // not a special commando mission!
     
    824824end;
    825825
    826 function TCustomAI.Unit_MoveForecast(uix, ToLoc: integer;
    827   var RemainingMovement: integer): boolean;
     826function TCustomAI.Unit_MoveForecast(uix, ToLoc: Integer;
     827  var RemainingMovement: Integer): Boolean;
    828828var
    829829  Advice: TMoveAdviceData;
    830830begin
    831   assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0)); // is a unit
     831  Assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0)); // is a unit
    832832  Advice.ToLoc := ToLoc;
    833833  Advice.MoreTurns := 0;
    834834  Advice.MaxHostile_MovementLeft := 100;
    835   if Server(sGetMoveAdvice, me, uix, Advice) = eOk then
     835  if Server(sGetMoveAdvice, Me, uix, Advice) = eOk then
    836836  begin
    837837    RemainingMovement := Advice.MaxHostile_MovementLeft;
     
    846846
    847847// negative RemainingHealth is remaining helth of defender if lost
    848 function TCustomAI.Unit_AttackForecast(uix, ToLoc, AttackMovement: integer;
    849   var RemainingHealth: integer): boolean;
     848function TCustomAI.Unit_AttackForecast(uix, ToLoc, AttackMovement: Integer;
     849  var RemainingHealth: Integer): Boolean;
    850850var
    851851  BattleForecast: TBattleForecast;
    852852begin
    853   assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0) // is a unit
     853  Assert((uix >= 0) and (uix < RO.nUn) and (MyUnit[uix].Loc >= 0) // is a unit
    854854    and (Map[ToLoc] and (fUnit or fOwned) = fUnit)); // is an attack
    855855  RemainingHealth := -$100;
     
    858858    with MyUnit[uix] do
    859859    begin
    860       BattleForecast.pAtt := me;
     860      BattleForecast.pAtt := Me;
    861861      BattleForecast.mixAtt := mix;
    862862      BattleForecast.HealthAtt := Health;
     
    864864      BattleForecast.FlagsAtt := Flags;
    865865      BattleForecast.Movement := AttackMovement;
    866       if Server(sGetBattleForecast, me, ToLoc, BattleForecast) >= rExecuted then
     866      if Server(sGetBattleForecast, Me, ToLoc, BattleForecast) >= rExecuted then
    867867      begin
    868868        if BattleForecast.EndHealthAtt > 0 then
     
    875875end;
    876876
    877 function TCustomAI.Unit_DefenseForecast(euix, ToLoc: integer;
    878   var RemainingHealth: integer): boolean;
     877function TCustomAI.Unit_DefenseForecast(euix, ToLoc: Integer;
     878  var RemainingHealth: Integer): Boolean;
    879879var
    880880  BattleForecast: TBattleForecast;
    881881begin
    882   assert((euix >= 0) and (euix < RO.nEnemyUn) and (RO.EnemyUn[euix].Loc >= 0) // is an enemy unit
     882  Assert((euix >= 0) and (euix < RO.nEnemyUn) and (RO.EnemyUn[euix].Loc >= 0) // is an enemy unit
    883883    and (Map[ToLoc] and (fUnit or fOwned) = (fUnit or fOwned))); // is an attack
    884884  RemainingHealth := $100;
     
    892892    BattleForecast.FlagsAtt := Flags;
    893893    BattleForecast.Movement := 100;
    894     if Server(sGetBattleForecast, me, ToLoc, BattleForecast) >= rExecuted then
     894    if Server(sGetBattleForecast, Me, ToLoc, BattleForecast) >= rExecuted then
    895895    begin
    896896      if BattleForecast.EndHealthDef > 0 then
     
    903903end;
    904904
    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);
     905function TCustomAI.Unit_Disband(uix: Integer): Integer;
     906begin
     907  Result := Server(sRemoveUnit, Me, uix, nodata^);
     908end;
     909
     910function TCustomAI.Unit_StartJob(uix, NewJob: Integer): Integer;
     911begin
     912  Result := Server(sStartJob + NewJob shl 4, Me, uix, nodata^);
     913end;
     914
     915function TCustomAI.Unit_SetHomeHere(uix: Integer): Integer;
     916begin
     917  Result := Server(sSetUnitHome, Me, uix, nodata^);
     918end;
     919
     920function TCustomAI.Unit_Load(uix: Integer): Integer;
     921begin
     922  Result := Server(sLoadUnit, Me, uix, nodata^);
     923end;
     924
     925function TCustomAI.Unit_Unload(uix: Integer): Integer;
     926begin
     927  Result := Server(sUnloadUnit, Me, uix, nodata^);
     928end;
     929
     930function TCustomAI.Unit_AddToCity(uix: Integer): Integer;
     931begin
     932  Result := Server(sAddToCity, Me, uix, nodata^);
     933end;
     934
     935function TCustomAI.Unit_SelectTransport(uix: Integer): Integer;
     936begin
     937  Result := Server(sSelectTransport, Me, uix, nodata^);
     938end;
     939
     940
     941procedure TCustomAI.City_FindMyCity(Loc: Integer; var cix: Integer);
    942942begin
    943943  if Map[Loc] and (fCity or fOwned) <> fCity or fOwned then
     
    951951end;
    952952
    953 procedure TCustomAI.City_FindEnemyCity(Loc: integer; var ecix: integer);
     953procedure TCustomAI.City_FindEnemyCity(Loc: Integer; var ecix: Integer);
    954954begin
    955955  if Map[Loc] and (fCity or fOwned) <> fCity then
     
    963963end;
    964964
    965 function TCustomAI.City_HasProject(cix: integer): boolean;
     965function TCustomAI.City_HasProject(cix: Integer): Boolean;
    966966begin
    967967  Result := MyCity[cix].Project and (cpImp + cpIndex) <> cpImp + imTrGoods;
    968968end;
    969969
    970 function TCustomAI.City_CurrentImprovementProject(cix: integer): integer;
     970function TCustomAI.City_CurrentImprovementProject(cix: Integer): Integer;
    971971begin
    972972  if MyCity[cix].Project and cpImp = 0 then
     
    980980end;
    981981
    982 function TCustomAI.City_CurrentUnitProject(cix: integer): integer;
     982function TCustomAI.City_CurrentUnitProject(cix: Integer): Integer;
    983983begin
    984984  if MyCity[cix].Project and cpImp <> 0 then
     
    988988end;
    989989
    990 function TCustomAI.City_GetTileInfo(cix, TileLoc: integer;
    991   var TileInfo: TTileInfo): integer;
     990function TCustomAI.City_GetTileInfo(cix, TileLoc: Integer;
     991  var TileInfo: TTileInfo): Integer;
    992992begin
    993993  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);
     995end;
     996
     997function TCustomAI.City_GetReport(cix: Integer; var Report: TCityReport): Integer;
    998998begin
    999999  Report.HypoTiles := -1;
    10001000  Report.HypoTax := -1;
    10011001  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);
     1003end;
     1004
     1005function TCustomAI.City_GetHypoReport(cix, HypoTiles, HypoTax, HypoLux: Integer;
     1006  var Report: TCityReport): Integer;
    10071007begin
    10081008  Report.HypoTiles := HypoTiles;
    10091009  Report.HypoTax := HypoTax;
    10101010  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);
     1012end;
     1013
     1014function TCustomAI.City_GetReportNew(cix: Integer; var Report: TCityReportNew): Integer;
    10151015begin
    10161016  Report.HypoTiles := -1;
    10171017  Report.HypoTaxRate := -1;
    10181018  Report.HypoLuxuryRate := -1;
    1019   Result := Server(sGetCityReportNew, me, cix, Report);
     1019  Result := Server(sGetCityReportNew, Me, cix, Report);
    10201020end;
    10211021
    10221022function TCustomAI.City_GetHypoReportNew(cix, HypoTiles, HypoTaxRate,
    1023   HypoLuxuryRate: integer; var Report: TCityReportNew): integer;
     1023  HypoLuxuryRate: Integer; var Report: TCityReportNew): Integer;
    10241024begin
    10251025  Report.HypoTiles := HypoTiles;
    10261026  Report.HypoTaxRate := HypoTaxRate;
    10271027  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);
     1029end;
     1030
     1031function TCustomAI.City_GetAreaInfo(cix: Integer; var AreaInfo: TCityAreaInfo): Integer;
     1032begin
     1033  Result := Server(sGetCityAreaInfo, Me, cix, AreaInfo);
     1034end;
     1035
     1036function TCustomAI.City_StartUnitProduction(cix, mix: Integer): Integer;
    10371037begin
    10381038  if (MyCity[cix].Project and (cpImp + cpIndex) <> mix) then
    10391039    // 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);
     1041end;
     1042
     1043function TCustomAI.City_StartEmigration(cix, mix: Integer;
     1044  AllowDisbandCity, AsConscripts: Boolean): Integer;
     1045var
     1046  NewProject: Integer;
    10471047begin
    10481048  NewProject := mix;
     
    10511051  if AsConscripts then
    10521052    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);
     1054end;
     1055
     1056function TCustomAI.City_StartImprovement(cix, iix: Integer): Integer;
     1057var
     1058  NewProject: Integer;
    10591059begin
    10601060  NewProject := iix + cpImp;
    10611061  if (MyCity[cix].Project and (cpImp + cpIndex) <> NewProject) then
    10621062    // 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);
     1064end;
     1065
     1066function TCustomAI.City_Improvable(cix, iix: Integer): Boolean;
     1067var
     1068  NewProject: Integer;
    10691069begin
    10701070  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;
     1072end;
     1073
     1074function TCustomAI.City_StopProduction(cix: Integer): Integer;
     1075var
     1076  NewProject: Integer;
    10771077begin
    10781078  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);
     1080end;
     1081
     1082function TCustomAI.City_BuyProject(cix: Integer): Integer;
     1083begin
     1084  Result := Server(sBuyCityProject, Me, cix, nodata^);
     1085end;
     1086
     1087function TCustomAI.City_SellImprovement(cix, iix: Integer): Integer;
     1088begin
     1089  Result := Server(sSellCityImprovement, Me, cix, iix);
     1090end;
     1091
     1092function TCustomAI.City_RebuildImprovement(cix, iix: Integer): Integer;
     1093begin
     1094  Result := Server(sRebuildCityImprovement, Me, cix, iix);
     1095end;
     1096
     1097function TCustomAI.City_SetTiles(cix, NewTiles: Integer): Integer;
     1098begin
     1099  Result := Server(sSetCityTiles, Me, cix, NewTiles);
     1100end;
     1101
     1102procedure TCustomAI.City_OptimizeTiles(cix: Integer; ResourceWeights: Cardinal);
    11031103var
    11041104  Advice: TCityTileAdviceData;
    11051105begin
    11061106  Advice.ResourceWeights := ResourceWeights;
    1107   Server(sGetCityTileAdvice, me, cix, Advice);
     1107  Server(sGetCityTileAdvice, Me, cix, Advice);
    11081108  City_SetTiles(cix, Advice.Tiles);
    11091109end;
     
    11111111
    11121112// negotiation
    1113 function TCustomAI.Nego_CheckMyAction: integer;
    1114 begin
    1115   assert(Opponent >= 0); // only allowed in negotiation mode
    1116   assert((MyAction = scDipNotice) or (MyAction = scDipAccept) or
     1113function TCustomAI.Nego_CheckMyAction: Integer;
     1114begin
     1115  Assert(Opponent >= 0); // only allowed in negotiation mode
     1116  Assert((MyAction = scDipNotice) or (MyAction = scDipAccept) or
    11171117    (MyAction = scDipCancelTreaty) or (MyAction = scDipOffer) or (MyAction = scDipBreak));
    11181118  if MyAction = scDipOffer then
    1119     Result := Server(MyAction - sExecute, me, 0, MyOffer)
     1119    Result := Server(MyAction - sExecute, Me, 0, MyOffer)
    11201120  else
    1121     Result := Server(MyAction - sExecute, me, 0, nodata^);
     1121    Result := Server(MyAction - sExecute, Me, 0, nodata^);
    11221122end;
    11231123
    11241124
    11251125initialization
    1126   nodata := pointer(0);
     1126  nodata := Pointer(0);
    11271127  RWDataSize := 0;
    11281128
  • branches/highdpi/AI/StdAI/CustomAI_Reload.pas

    r210 r465  
    1313TCustomAI=class
    1414public
    15   procedure Process(Command: integer; var Data);
     15  procedure Process(Command: Integer; var Data);
    1616
    1717  // overridables
    18   constructor Create(Nation: integer); virtual;
     18  constructor Create(Nation: Integer); virtual;
    1919  destructor Destroy; override;
    2020  procedure SetDataDefaults; virtual;
    2121  procedure SetDataRandom; virtual;
    2222  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;
    2525  procedure OnAfterEnemyAttack; virtual;
    2626  procedure OnAfterEnemyCapture; virtual;
    2727
    2828protected
    29   me: integer; // index of the controlled nation
     29  Me: Integer; // index of the controlled nation
    3030  RO: ^TPlayerContext;
    3131  Map: ^TTileList;
     
    3434  MyModel: ^TModelList;
    3535
    36   cixStateImp: array[imPalace..imSpacePort] of integer;
     36  cixStateImp: array[imPalace..imSpacePort] of Integer;
    3737
    3838  // negotiation
    39   Opponent: integer; // nation i'm in negotiation with, -1 indicates no-negotiation mode
    40   MyAction, MyLastAction, OppoAction: integer;
     39  Opponent: Integer; // nation i'm in negotiation with, -1 indicates no-negotiation mode
     40  MyAction, MyLastAction, OppoAction: Integer;
    4141  MyOffer, MyLastOffer, OppoOffer: TOffer;
    4242
     
    4444  procedure DoTurn; virtual;
    4545  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;
    5151
    5252  // 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;
    6464
    6565  // 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;
    8181
    8282  // 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;
    101101
    102102  // negotiation
    103   function Nego_CheckMyAction: integer;
     103  function Nego_CheckMyAction: Integer;
    104104
    105105private
    106   HaveTurned: boolean;
     106  HaveTurned: Boolean;
    107107  UnwantedNego: set of 0..nPl-1;
    108108  Contacted: set of 0..nPl-1;
     
    114114Server: TServerCall;
    115115G: TNewGameData;
    116 RWDataSize, MapSize: integer;
    117 decompose24: cardinal;
    118 nodata: pointer;
     116RWDataSize, MapSize: Integer;
     117decompose24: Cardinal;
     118nodata: Pointer;
    119119
    120120const
     
    126126
    127127type
    128 TVicinity8Loc=array[0..7] of integer;
    129 TVicinity21Loc=array[0..27] of integer;
     128TVicinity8Loc=array[0..7] of Integer;
     129TVicinity21Loc=array[0..27] of Integer;
    130130
    131131
    132132procedure Init(NewGameData: TNewGameData);
    133133
    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);
     134procedure ab_to_Loc(Loc0,A,B: Integer; var Loc: Integer);
     135procedure Loc_to_ab(Loc0,Loc: Integer; var A,B: Integer);
     136procedure ab_to_V8(A,B: Integer; var V8: Integer);
     137procedure V8_to_ab(V8: Integer; var A,B: Integer);
     138procedure ab_to_V21(A,B: Integer; var V21: Integer);
     139procedure V21_to_ab(V21: Integer; var A,B: Integer);
     140procedure V8_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity8Loc);
     141procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc);
    142142
    143143
     
    145145
    146146const
    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);
     147ab_v8: array[-4..4] of Integer = (5,6,7,4,-1,0,3,2,1);
     148v8_a: array[0..7] of Integer = (1,1,0,-1,-1,-1,0,1);
     149v8_b: array[0..7] of Integer = (0,1,1,1,0,-1,-1,-1);
     150
     151
     152procedure ab_to_Loc(Loc0,A,B: Integer; var Loc: Integer);
    153153{relative location from Loc0}
    154154var
    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);
     155y0: Integer;
     156begin
     157Assert((Loc0>=0) and (Loc0<MapSize) and (A-B+G.lx>=0));
     158y0:=Cardinal(Loc0)*decompose24 shr 24;
     159Loc:=(Loc0+(A-B+y0 and 1+G.lx+G.lx) shr 1) mod G.lx +G.lx*(y0+A+B);
    160160if Loc>=MapSize then Loc:=-$1000
    161161end;
    162162
    163 procedure Loc_to_ab(Loc0,Loc: integer; var a,b: integer);
     163procedure Loc_to_ab(Loc0,Loc: Integer; var A,B: Integer);
    164164{$IFDEF FPC} // freepascal
    165165var
    166 dx,dy: integer;
     166dx,dy: Integer;
    167167begin
    168168dx:=((Loc mod G.lx *2 +Loc div G.lx and 1)
    169169  -(Loc0 mod G.lx *2 +Loc0 div G.lx and 1)+3*G.lx) mod (2*G.lx) -G.lx;
    170170dy:=Loc div G.lx-Loc0 div G.lx;
    171 a:=(dx+dy) div 2;
    172 b:=(dy-dx) div 2;
     171A:=(dx+dy) div 2;
     172B:=(dy-dx) div 2;
    173173end;
    174174{$ELSE} // delphi
     
    179179// calculate
    180180push ecx
    181 div byte ptr [G]
     181div Byte ptr [G]
    182182xor ebx,ebx
    183183mov bl,ah  // ebx:=Loc0 mod G.lx
     
    185185and ecx,$000000FF // ecx:=Loc0 div G.lx
    186186mov eax,edx
    187 div byte ptr [G]
     187div Byte ptr [G]
    188188xor edx,edx
    189189mov dl,ah // edx:=Loc mod G.lx
     
    202202mov edx,dword ptr [G]
    203203cmp eax,edx
    204 jl @a
     204jl @A
    205205  sub eax,edx
    206206  sub eax,edx
    207207  jmp @ok
    208 @a:
     208@A:
    209209neg edx
    210210cmp eax,edx
     
    219219add eax,ebx
    220220sar edx,1 // edx:=b
    221 mov ebx,[b]
     221mov ebx,[B]
    222222mov [ebx],edx
    223223sar eax,1 // eax:=a
    224 mov [a],eax
     224mov [A],eax
    225225
    226226pop ebx
     
    228228{$ENDIF}
    229229
    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;
     230procedure ab_to_V8(A,B: Integer; var V8: Integer);
     231begin
     232Assert((abs(A)<=1) and (abs(B)<=1) and ((A<>0) or (B<>0)));
     233V8:=ab_v8[2*B+B+A];
     234end;
     235
     236procedure V8_to_ab(V8: Integer; var A,B: Integer);
     237begin
     238A:=v8_a[V8]; B:=V8_b[V8];
     239end;
     240
     241procedure ab_to_V21(A,B: Integer; var V21: Integer);
     242begin
     243V21:=(A+B+3) shl 2+(A-B+3) shr 1;
     244end;
     245
     246procedure V21_to_ab(V21: Integer; var A,B: Integer);
     247var
     248dx,dy: Integer;
    249249begin
    250250dy:=V21 shr 2-3;
    251251dx:=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;
     252A:=(dx+dy) div 2;
     253B:=(dy-dx) div 2;
     254end;
     255
     256procedure V8_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity8Loc);
     257var
     258x0,y0,lx: Integer;
    259259begin
    260260lx:=G.lx;
    261 y0:=cardinal(Loc0)*decompose24 shr 24;
     261y0:=Cardinal(Loc0)*decompose24 shr 24;
    262262x0:=Loc0-y0*lx; // Loc0 mod lx;
    263263VicinityLoc[1]:=Loc0+lx*2;
     
    265265VicinityLoc[5]:=Loc0-lx*2;
    266266VicinityLoc[7]:=Loc0+1;
    267 inc(Loc0,y0 and 1);
     267Inc(Loc0,y0 and 1);
    268268VicinityLoc[0]:=Loc0+lx;
    269269VicinityLoc[2]:=Loc0+lx-1;
     
    276276  if x0=0 then
    277277    begin
    278     inc(VicinityLoc[3],lx);
     278    Inc(VicinityLoc[3],lx);
    279279    if y0 and 1=0 then
    280280      begin
    281       inc(VicinityLoc[2],lx);
    282       inc(VicinityLoc[4],lx);
     281      Inc(VicinityLoc[2],lx);
     282      Inc(VicinityLoc[4],lx);
    283283      end
    284284    end
     
    286286else
    287287  begin
    288   dec(VicinityLoc[7],lx);
     288  Dec(VicinityLoc[7],lx);
    289289  if y0 and 1=1 then
    290290    begin
    291     dec(VicinityLoc[0],lx);
    292     dec(VicinityLoc[6],lx);
     291    Dec(VicinityLoc[0],lx);
     292    Dec(VicinityLoc[6],lx);
    293293    end
    294294  end;
     
    306306end;
    307307
    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;
     308procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc);
     309var
     310dx,dy,bit,y0,xComp,yComp,xComp0,xCompSwitch: Integer;
     311dst: ^Integer;
     312begin
     313y0:=Cardinal(Loc0)*decompose24 shr 24;
    314314xComp0:=Loc0-y0*G.lx-1; // Loc0 mod G.lx -1
    315315xCompSwitch:=xComp0-1+y0 and 1;
    316 if xComp0<0 then inc(xComp0,G.lx);
    317 if xCompSwitch<0 then inc(xCompSwitch,G.lx);
     316if xComp0<0 then Inc(xComp0,G.lx);
     317if xCompSwitch<0 then Inc(xCompSwitch,G.lx);
    318318xCompSwitch:=xCompSwitch xor xComp0;
    319319yComp:=G.lx*(y0-3);
     
    329329      if bit and $67F7F76<>0 then dst^:=xComp+yComp
    330330      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);
    334334      bit:=bit shl 1;
    335335      end;
    336     inc(yComp,G.lx);
     336    Inc(yComp,G.lx);
    337337    end
    338338  else
    339339    begin
    340340    for dx:=0 to 3 do
    341       begin dst^:=-$1000; inc(dst); end;
     341      begin dst^:=-$1000; Inc(dst); end;
    342342    end
    343343end;
     
    345345
    346346procedure Init(NewGameData: TNewGameData);
    347 {$IFDEF DEBUG}var Loc: integer;{$ENDIF}
     347{$IFDEF DEBUG}var Loc: Integer;{$ENDIF}
    348348begin
    349349G:=NewGameData;
    350350MapSize:=G.lx*G.ly;
    351351decompose24:=(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}
     353end;
     354
     355
     356constructor TCustomAI.Create(Nation: Integer);
    357357begin
    358358inherited 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);
     359Me:=Nation;
     360RO:=Pointer(G.RO[Nation]);
     361Map:=Pointer(RO.Map);
     362MyUnit:=Pointer(RO.Un);
     363MyCity:=Pointer(RO.City);
     364MyModel:=Pointer(RO.Model);
    365365Opponent:=-1;
    366366end;
     
    368368destructor TCustomAI.Destroy;
    369369begin
    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;
     370Server(sSetDebugMap,Me,0,nodata^);
     371end;
     372
     373
     374procedure TCustomAI.Process(Command: Integer; var Data);
     375var
     376Nation,NewResearch,NewGov,count,ad,cix,iix: Integer;
    377377NegoTime: TNegoTime;
    378378begin
     
    380380  cTurn, cContinue:
    381381    begin
    382     if RO.Alive and (1 shl me)=0 then
     382    if RO.Alive and (1 shl Me)=0 then
    383383      begin // I'm dead, huhu
    384       Server(sTurn,me,0,nodata^);
    385       exit
     384      Server(sTurn,Me,0,nodata^);
     385      Exit
    386386      end;
    387387    if Command=cTurn then
    388388      begin
    389       fillchar(cixStateImp, sizeof(cixStateImp), $FF);
     389      FillChar(cixStateImp, SizeOf(cixStateImp), $FF);
    390390      for cix:=0 to RO.nCity-1 do if MyCity[cix].Loc>=0 then
    391391        for iix:=imPalace to imSpacePort do
     
    396396        NewGov:=ChooseGovernment;
    397397        if NewGov>gAnarchy then
    398           Server(sSetGovernment,me,NewGov,nodata^);
     398          Server(sSetGovernment,Me,NewGov,nodata^);
    399399        end;
    400       HaveTurned:=false;
     400      HaveTurned:=False;
    401401      Contacted:=[];
    402402      end;
     
    405405      if OnNegoRejected_CancelTreaty then
    406406        if RO.Treaty[Opponent]>=trPeace then
    407           if Server(sCancelTreaty,me,0,nodata^)<rExecuted then
    408             assert(false)
     407          if Server(sCancelTreaty,Me,0,nodata^)<rExecuted then
     408            Assert(False)
    409409      end
    410410    else UnwantedNego:=[];
     
    415415      if RO.Government<>gAnarchy then
    416416        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)
    418418             and (RO.Treaty[Nation]>=trNone)
    419419             and not (Nation in Contacted) and not (Nation in UnwantedNego)
    420              and (Server(scContact-sExecute + Nation shl 4, me, 0, nodata^)>=rExecuted) then
     420             and (Server(scContact-sExecute + Nation shl 4, Me, 0, nodata^)>=rExecuted) then
    421421             if WantNegotiation(Nation, NegoTime) then
    422422               begin
    423                if Server(scContact + Nation shl 4, me, 0, nodata^)>=rExecuted then
     423               if Server(scContact + Nation shl 4, Me, 0, nodata^)>=rExecuted then
    424424                 begin
    425                  include(Contacted, Nation);
     425                 Include(Contacted, Nation);
    426426                 Opponent:=Nation;
    427427                 MyAction:=scContact;
    428                  exit;
     428                 Exit;
    429429                 end;
    430430               end
    431              else include(UnwantedNego,Nation);
     431             else Include(UnwantedNego,Nation);
    432432      if NegoTime=BeginOfTurn then
    433433        begin
    434434        DoTurn;
    435         HaveTurned:=true;
     435        HaveTurned:=True;
    436436        Contacted:=[];
    437437        UnwantedNego:=[];
    438438        end
    439       else break;
    440     until false;
     439      else Break;
     440    until False;
    441441    if RO.Happened and phTech<>0 then
    442442      begin
     
    446446        count:=0;
    447447        for ad:=0 to nAdv-1 do if AdvanceResearchable(ad) then
    448           begin inc(count); if random(count)=0 then NewResearch:=ad end
     448          begin Inc(count); if random(count)=0 then NewResearch:=ad end
    449449        end;
    450       Server(sSetResearch,me,NewResearch,nodata^)
     450      Server(sSetResearch,Me,NewResearch,nodata^)
    451451      end;
    452     if (me=1) and (RO.Turn=800) then
     452    if (Me=1) and (RO.Turn=800) then
    453453      begin
    454454      count:=0;
    455       Server(sReload,me,0,count)
     455      Server(sReload,Me,0,count)
    456456      end
    457457    else if (RO.Turn>10) and (random(1000)=0) then
    458458      begin
    459459      count:=RO.Turn-10;
    460       Server(sReload,me,0,count)
     460      Server(sReload,Me,0,count)
    461461      end
    462     else if Server(sTurn,me,0,nodata^)<rExecuted then
    463       assert(false);
     462    else if Server(sTurn,Me,0,nodata^)<rExecuted then
     463      Assert(False);
    464464    end;
    465465  scContact:
    466     if WantNegotiation(integer(Data), EnemyCalled) then
     466    if WantNegotiation(Integer(Data), EnemyCalled) then
    467467      begin
    468       if Server(scDipStart, me, 0, nodata^)<rExecuted then
    469         assert(false);
    470       Opponent:=integer(Data);
     468      if Server(scDipStart, Me, 0, nodata^)<rExecuted then
     469        Assert(False);
     470      Opponent:=Integer(Data);
    471471      MyAction:=scDipStart;
    472472      end
    473473    else
    474474      begin
    475       if Server(scReject, me, 0, nodata^)<rExecuted then
    476         assert(false);
     475      if Server(scReject, Me, 0, nodata^)<rExecuted then
     476        Assert(False);
    477477      end;
    478478  scDipStart, scDipNotice, scDipAccept, scDipCancelTreaty, scDipOffer, scDipBreak:
     
    486486    else begin MyAction:=scDipOffer; MyOffer.nDeliver:=0; MyOffer.nCost:=0; end;
    487487    DoNegotiation;
    488     assert((MyAction=scDipNotice) or (MyAction=scDipAccept)
     488    Assert((MyAction=scDipNotice) or (MyAction=scDipAccept)
    489489      or (MyAction=scDipCancelTreaty) or (MyAction=scDipOffer)
    490490      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^);
    493493    end;
    494494  cShowEndContact:
     
    515515
    516516procedure 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);
     518begin
     519end;
     520
     521procedure TCustomAI.OnBeforeEnemyCapture(UnitInfo: TUnitInfo; ToLoc: Integer);
    522522begin
    523523end;
     
    531531end;
    532532
    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;
     533function TCustomAI.ChooseResearchAdvance: Integer;
     534begin
     535Result:=-1
     536end;
     537
     538function TCustomAI.ChooseStealAdvance: Integer;
     539begin
     540Result:=-1
     541end;
     542
     543function TCustomAI.ChooseGovernment: Integer;
     544begin
     545Result:=gDespotism
     546end;
     547
     548function TCustomAI.WantNegotiation(Nation: Integer; NegoTime: TNegoTime): Boolean;
     549begin
     550Result:=False;
     551end;
     552
     553function TCustomAI.OnNegoRejected_CancelTreaty: Boolean;
     554begin
     555Result:=False;
    556556end;
    557557{$HINTS ON}
     
    559559procedure TCustomAI.StealAdvance;
    560560var
    561 Steal, ad, count: integer;
     561Steal, ad, count: Integer;
    562562begin
    563563Steal:=ChooseStealAdvance;
     
    566566  count:=0;
    567567  for ad:=0 to nAdv-1 do if AdvanceStealable(ad) then
    568     begin inc(count); if random(count)=0 then Steal:=ad end
     568    begin Inc(count); if random(count)=0 then Steal:=ad end
    569569  end;
    570 if Steal>=0 then Server(sStealTech,me,Steal,nodata^);
     570if Steal>=0 then Server(sStealTech,Me,Steal,nodata^);
    571571RO.Happened:=RO.Happened and not phStealTech
    572572end;
    573573
    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;
     574function TCustomAI.IsResearched(Advance: Integer): Boolean;
     575begin
     576Result:= RO.Tech[Advance]>=tsApplicable
     577end;
     578
     579function TCustomAI.ResearchCost: Integer;
     580begin
     581Server(sGetTechCost,Me,0,Result)
     582end;
     583
     584function TCustomAI.ChangeAttitude(Nation, Attitude: Integer): Integer;
     585begin
     586Result:=Server(sSetAttitude+Nation shl 4,Me,Attitude,nodata^)
     587end;
     588
     589function TCustomAI.Revolution: Integer;
     590begin
     591Result:=Server(sRevolution,Me,0,nodata^);
     592end;
     593
     594function TCustomAI.ChangeRates(Tax,Lux: Integer): Integer;
     595begin
     596Result:=Server(sSetRates,Me,Tax div 10 and $F+Lux div 10 and $F shl 4,nodata^)
     597end;
     598
     599function TCustomAI.PrepareNewModel(Domain: Integer): Integer;
     600begin
     601Result:=Server(sCreateDevModel,Me,Domain,nodata^);
     602end;
     603
     604function TCustomAI.SetNewModelFeature(F, Count: Integer): Integer;
     605begin
     606Result:=Server(sSetDevModelCap+Count shl 4,Me,F,nodata^)
     607end;
     608
     609function TCustomAI.AdvanceResearchable(Advance: Integer): Boolean;
     610begin
     611Result:= Server(sSetResearch-sExecute,Me,Advance,nodata^)>=rExecuted;
     612end;
     613
     614function TCustomAI.AdvanceStealable(Advance: Integer): Boolean;
     615begin
     616Result:= Server(sStealTech-sExecute,Me,Advance,nodata^)>=rExecuted;
     617end;
     618
     619function TCustomAI.DebugMessage(Level: Integer; Text: string): Boolean;
     620begin
     621Text:=Copy('P'+char(48+Me)+' '+Text,1,254);
     622Server(sMessage,Me,Level,PChar(Text)^);
     623
     624Result:=True;
    625625  // always returns true so that it can be used like
    626626  // "assert(DebugMessage(...));" -> not compiled in release build
    627627end;
    628628
    629 function TCustomAI.SetDebugMap(var DebugMap): boolean;
    630 begin
    631 Server(sSetDebugMap, me, 0, DebugMap);
    632 
    633 result:=true;
     629function TCustomAI.SetDebugMap(var DebugMap): Boolean;
     630begin
     631Server(sSetDebugMap, Me, 0, DebugMap);
     632
     633Result:=True;
    634634  // always returns true so that it can be used like
    635635  // "assert(SetDebugMap(...));" -> not compiled in release build
    636636end;
    637637
    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);
     638procedure TCustomAI.Unit_FindMyDefender(Loc: Integer; var uix: Integer);
     639begin
     640if Server(sGetDefender,Me,Loc,uix)<rExecuted then uix:=-1
     641end;
     642
     643procedure TCustomAI.Unit_FindEnemyDefender(Loc: Integer; var euix: Integer);
    644644begin
    645645euix:=RO.nEnemyUn-1;
    646646while (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);
     648end;
     649
     650function TCustomAI.Unit_Move(uix,ToLoc: Integer): Integer;
     651var
     652Step: Integer;
     653DestinationReached: Boolean;
    654654Advice: TMoveAdviceData;
    655655begin
    656 assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0)); // is a unit
     656Assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0)); // is a unit
    657657{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) then
     658Assert((A<>0) or (B<>0));
     659if (A>=-1) and (A<=1) and (B>=-1) and (B<=1) then
    660660  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)
    662662  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;
    665665  Advice.MoreTurns:=0;
    666666  Advice.MaxHostile_MovementLeft:=MyUnit[uix].Movement;
    667   result:=eOK;
     667  Result:=eOK;
    668668  end
    669669else}
     
    672672  Advice.MoreTurns:=9999;
    673673  Advice.MaxHostile_MovementLeft:=100;
    674   result:=Server(sGetMoveAdvice,me,uix,Advice);
     674  Result:=Server(sGetMoveAdvice,Me,uix,Advice);
    675675  end;
    676 if result=eOk then
     676if Result=eOk then
    677677  begin
    678   DestinationReached:=false;
     678  DestinationReached:=False;
    679679  Step:=0;
    680680  repeat
    681     if result and (rExecuted or rUnitRemoved)=rExecuted then // check if destination reached
     681    if Result and (rExecuted or rUnitRemoved)=rExecuted then // check if destination reached
    682682      if (ToLoc>=0) and (Advice.MoreTurns=0) and (Step=Advice.nStep-1)
    683683        and ((Map[ToLoc] and (fUnit or fOwned)=fUnit) // attack
     
    685685          and ((MyModel[MyUnit[uix].mix].Domain<>dGround) // bombardment
    686686            or (MyModel[MyUnit[uix].mix].Flags and mdCivil<>0))) then // can't capture
    687         begin DestinationReached:=true; break end // stop next to destination
     687        begin DestinationReached:=True; Break end // stop next to destination
    688688      else if Step=Advice.nStep then
    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);
     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);
    697697    if RO.Happened and phStealTech<>0 then StealAdvance;
    698   until false;
     698  until False;
    699699  if DestinationReached then
    700700    if Advice.nStep=25 then
    701       result:=Unit_Move(uix,ToLoc) // Shinkansen
     701      Result:=Unit_Move(uix,ToLoc) // Shinkansen
    702702    else if Advice.MoreTurns=0 then
    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^);
     703      Result:=Result or rLocationReached
     704    else Result:=Result or rMoreTurns;
     705  end
     706end;
     707
     708function TCustomAI.Unit_Step(uix,ToLoc: Integer): Integer;
     709var
     710A,B: Integer;
     711begin
     712Loc_to_ab(MyUnit[uix].Loc, ToLoc, A, B);
     713Assert(((A<>0) or (B<>0)) and (A>=-1) and (A<=1) and (B>=-1) and (B<=1));
     714Result:=Server(sMoveUnit+((A-B) and 7) shl 4 +((A+B) and 7) shl 7, Me, uix, nodata^);
    715715if RO.Happened and phStealTech<>0 then StealAdvance;
    716716end;
    717717
    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 unit
     718function TCustomAI.Unit_Attack(uix,ToLoc: Integer): Integer;
     719var
     720A,B: Integer;
     721begin
     722Assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0) // is a unit
    723723  and ((Map[ToLoc] and (fUnit or fOwned)=fUnit) // is an attack
    724724  or (Map[ToLoc] and (fCity or fOwned)=fCity)
    725725  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 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
     726Loc_to_ab(MyUnit[uix].Loc,ToLoc,A,B);
     727Assert(((A<>0) or (B<>0)) and (A>=-1) and (A<=1) and (B>=-1) and (B<=1)); // attack to adjacent tile
     728Result:=Server(sMoveUnit+(A-B) and 7 shl 4 +(A+B) and 7 shl 7,Me,uix,nodata^);
     729end;
     730
     731function TCustomAI.Unit_DoMission(uix,MissionType,ToLoc: Integer): Integer;
     732var
     733A,B: Integer;
     734begin
     735Result:=Server(sSetSpyMission + MissionType shl 4,Me,0,nodata^);
     736if Result>=rExecuted then
    737737  begin
    738   assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0) // is a unit
     738  Assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0) // is a unit
    739739    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 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;
     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
     748end;
     749
     750function TCustomAI.Unit_MoveForecast(uix,ToLoc: Integer;
     751  var RemainingMovement: Integer): Boolean;
    752752var
    753753Advice: TMoveAdviceData;
    754754begin
    755 assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0)); // is a unit
     755Assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0)); // is a unit
    756756Advice.ToLoc:=ToLoc;
    757757Advice.MoreTurns:=0;
    758758Advice.MaxHostile_MovementLeft:=100;
    759 if Server(sGetMoveAdvice,me,uix,Advice)=eOk then
     759if Server(sGetMoveAdvice,Me,uix,Advice)=eOk then
    760760  begin
    761761  RemainingMovement:=Advice.MaxHostile_MovementLeft;
    762   result:=true
     762  Result:=True
    763763  end
    764764else
    765765  begin
    766766  RemainingMovement:=-1;
    767   result:=false
    768   end
    769 end;
    770 
    771 function TCustomAI.Unit_AttackForecast(uix,ToLoc,AttackMovement: integer;
    772   var RemainingHealth: integer): boolean;
     767  Result:=False
     768  end
     769end;
     770
     771function TCustomAI.Unit_AttackForecast(uix,ToLoc,AttackMovement: Integer;
     772  var RemainingHealth: Integer): Boolean;
    773773var
    774774BattleForecast: TBattleForecast;
    775775begin
    776 assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0) // is a unit
     776Assert((uix>=0) and (uix<RO.nUn) and (MyUnit[uix].Loc>=0) // is a unit
    777777  and (Map[ToLoc] and (fUnit or fOwned)=fUnit)); // is an attack
    778778RemainingHealth:=-$100;
    779 result:=false;
     779Result:=False;
    780780if AttackMovement>=0 then with MyUnit[uix] do
    781781  begin
    782   BattleForecast.pAtt:=me;
     782  BattleForecast.pAtt:=Me;
    783783  BattleForecast.mixAtt:=mix;
    784784  BattleForecast.HealthAtt:=Health;
     
    786786  BattleForecast.FlagsAtt:=Flags;
    787787  BattleForecast.Movement:=AttackMovement;
    788   if Server(sGetBattleForecast,me,ToLoc,BattleForecast)>=rExecuted then
     788  if Server(sGetBattleForecast,Me,ToLoc,BattleForecast)>=rExecuted then
    789789    begin
    790790    if BattleForecast.EndHealthAtt>0 then
    791791      RemainingHealth:=BattleForecast.EndHealthAtt
    792792    else RemainingHealth:=-BattleForecast.EndHealthDef;
    793     result:=true
     793    Result:=True
    794794    end
    795795  end
    796796end;
    797797
    798 function TCustomAI.Unit_DefenseForecast(euix,ToLoc: integer;
    799   var RemainingHealth: integer): boolean;
     798function TCustomAI.Unit_DefenseForecast(euix,ToLoc: Integer;
     799  var RemainingHealth: Integer): Boolean;
    800800var
    801801BattleForecast: TBattleForecast;
    802802begin
    803 assert((euix>=0) and (euix<RO.nEnemyUn) and (RO.EnemyUn[euix].Loc>=0) // is an enemy unit
     803Assert((euix>=0) and (euix<RO.nEnemyUn) and (RO.EnemyUn[euix].Loc>=0) // is an enemy unit
    804804  and (Map[ToLoc] and (fUnit or fOwned)=(fUnit or fOwned))); // is an attack
    805805RemainingHealth:=$100;
    806 result:=false;
     806Result:=False;
    807807with RO.EnemyUn[euix] do
    808808  begin
     
    813813  BattleForecast.FlagsAtt:=Flags;
    814814  BattleForecast.Movement:=100;
    815   if Server(sGetBattleForecast,me,ToLoc,BattleForecast)>=rExecuted then
     815  if Server(sGetBattleForecast,Me,ToLoc,BattleForecast)>=rExecuted then
    816816    begin
    817817    if BattleForecast.EndHealthDef>0 then
    818818      RemainingHealth:=BattleForecast.EndHealthDef
    819819    else RemainingHealth:=-BattleForecast.EndHealthAtt;
    820     result:=true
     820    Result:=True
    821821    end
    822822  end
    823823end;
    824824
    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);
     825function TCustomAI.Unit_Disband(uix: Integer): Integer;
     826begin
     827Result:=Server(sRemoveUnit,Me,uix,nodata^)
     828end;
     829
     830function TCustomAI.Unit_StartJob(uix,NewJob: Integer): Integer;
     831begin
     832Result:=Server(sStartJob+NewJob shl 4,Me,uix,nodata^)
     833end;
     834
     835function TCustomAI.Unit_SetHomeHere(uix: Integer): Integer;
     836begin
     837Result:=Server(sSetUnitHome,Me,uix,nodata^)
     838end;
     839
     840function TCustomAI.Unit_Load(uix: Integer): Integer;
     841begin
     842Result:=Server(sLoadUnit,Me,uix,nodata^)
     843end;
     844
     845function TCustomAI.Unit_Unload(uix: Integer): Integer;
     846begin
     847Result:=Server(sUnloadUnit,Me,uix,nodata^)
     848end;
     849
     850function TCustomAI.Unit_AddToCity(uix: Integer): Integer;
     851begin
     852Result:=Server(sAddToCity,Me,uix,nodata^)
     853end;
     854
     855
     856procedure TCustomAI.City_FindMyCity(Loc: Integer; var cix: Integer);
    857857begin
    858858if Map[Loc] and (fCity or fOwned)<>fCity or fOwned then
     
    862862  cix:=RO.nCity-1;
    863863  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
     866end;
     867
     868procedure TCustomAI.City_FindEnemyCity(Loc: Integer; var ecix: Integer);
    869869begin
    870870if Map[Loc] and (fCity or fOwned)<>fCity then
     
    874874  ecix:=RO.nEnemyCity-1;
    875875  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+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
     876    Dec(ecix);
     877  end
     878end;
     879
     880function TCustomAI.City_HasProject(cix: Integer): Boolean;
     881begin
     882Result:= MyCity[cix].Project and (cpImp+cpIndex)<>cpImp+imTrGoods
     883end;
     884
     885function TCustomAI.City_CurrentImprovementProject(cix: Integer): Integer;
     886begin
     887if MyCity[cix].Project and cpImp=0 then Result:=-1
    888888else
    889889  begin
    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;
     890  Result:=MyCity[cix].Project and cpIndex;
     891  if Result=imTrGoods then Result:=-1
     892  end
     893end;
     894
     895function TCustomAI.City_CurrentUnitProject(cix: Integer): Integer;
     896begin
     897if MyCity[cix].Project and cpImp<>0 then Result:=-1
     898else Result:=MyCity[cix].Project and cpIndex;
     899end;
     900
     901function TCustomAI.City_GetTileInfo(cix,TileLoc: Integer; var TileInfo: TTileInfo): Integer;
    902902begin
    903903TileInfo.ExplCity:=cix;
    904 result:=Server(sGetHypoCityTileInfo,me,TileLoc,TileInfo)
    905 end;
    906 
    907 function TCustomAI.City_GetReport(cix: integer; var Report: TCityReport): integer;
     904Result:=Server(sGetHypoCityTileInfo,Me,TileLoc,TileInfo)
     905end;
     906
     907function TCustomAI.City_GetReport(cix: Integer; var Report: TCityReport): Integer;
    908908begin
    909909Report.HypoTiles:=-1;
    910910Report.HypoTax:=-1;
    911911Report.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;
     912Result:=Server(sGetCityReport,Me,cix,Report)
     913end;
     914
     915function TCustomAI.City_GetHypoReport(cix, HypoTiles, HypoTax, HypoLux: Integer;
     916  var Report: TCityReport): Integer;
    917917begin
    918918Report.HypoTiles:=HypoTiles;
    919919Report.HypoTax:=HypoTax;
    920920Report.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;
     921Result:=Server(sGetCityReport,Me,cix,Report)
     922end;
     923
     924function TCustomAI.City_GetAreaInfo(cix: Integer; var AreaInfo: TCityAreaInfo): Integer;
     925begin
     926Result:=Server(sGetCityAreaInfo,Me,cix,AreaInfo)
     927end;
     928
     929function TCustomAI.City_StartUnitProduction(cix,mix: Integer): Integer;
     930begin
     931Result:=Server(sSetCityProject,Me,cix,mix)
     932end;
     933
     934function TCustomAI.City_StartEmigration(cix,mix: Integer;
     935  AllowDisbandCity, AsConscripts: Boolean): Integer;
     936var
     937NewProject: Integer;
    938938begin
    939939NewProject:=mix;
    940940if AllowDisbandCity then NewProject:=NewProject or cpDisbandCity;
    941941if 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;
     942Result:=Server(sSetCityProject,Me,cix,NewProject)
     943end;
     944
     945function TCustomAI.City_StartImprovement(cix,iix: Integer): Integer;
     946var
     947NewProject: Integer;
    948948begin
    949949NewProject:=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;
     950Result:=Server(sSetCityProject,Me,cix,NewProject)
     951end;
     952
     953function TCustomAI.City_Improvable(cix,iix: Integer): Boolean;
     954var
     955NewProject: Integer;
    956956begin
    957957NewProject:=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;
     958Result:= Server(sSetCityProject-sExecute,Me,cix,NewProject)>=rExecuted;
     959end;
     960
     961function TCustomAI.City_StopProduction(cix: Integer): Integer;
     962var
     963NewProject: Integer;
    964964begin
    965965NewProject:=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)
     966Result:=Server(sSetCityProject,Me,cix,NewProject)
     967end;
     968
     969function TCustomAI.City_BuyProject(cix: Integer): Integer;
     970begin
     971Result:=Server(sBuyCityProject,Me,cix,nodata^)
     972end;
     973
     974function TCustomAI.City_SellImprovement(cix,iix: Integer): Integer;
     975begin
     976Result:=Server(sSellCityImprovement,Me,cix,iix)
     977end;
     978
     979function TCustomAI.City_RebuildImprovement(cix,iix: Integer): Integer;
     980begin
     981Result:=Server(sRebuildCityImprovement,Me,cix,iix)
     982end;
     983
     984function TCustomAI.City_SetTiles(cix,NewTiles: Integer): Integer;
     985begin
     986Result:=Server(sSetCityTiles,Me,cix,NewTiles)
    987987end;
    988988
    989989
    990990// negotiation
    991 function TCustomAI.Nego_CheckMyAction: integer;
    992 begin
    993 assert(Opponent>=0); // only allowed in negotiation mode
    994 assert((MyAction=scDipNotice) or (MyAction=scDipAccept)
     991function TCustomAI.Nego_CheckMyAction: Integer;
     992begin
     993Assert(Opponent>=0); // only allowed in negotiation mode
     994Assert((MyAction=scDipNotice) or (MyAction=scDipAccept)
    995995  or (MyAction=scDipCancelTreaty) or (MyAction=scDipOffer)
    996996  or (MyAction=scDipBreak));
    997 if MyAction=scDipOffer then result:=Server(MyAction-sExecute, me, 0, MyOffer)
    998 else result:=Server(MyAction-sExecute, me, 0, nodata^);
     997if MyAction=scDipOffer then Result:=Server(MyAction-sExecute, Me, 0, MyOffer)
     998else Result:=Server(MyAction-sExecute, Me, 0, nodata^);
    999999end;
    10001000
    10011001
    10021002initialization
    1003 nodata:=pointer(0);
     1003nodata:=Pointer(0);
    10041004RWDataSize:=0;
    10051005
  • branches/highdpi/AI/StdAI/Pile.pas

    r303 r465  
    88interface
    99
    10 procedure Create(Size: integer);
     10procedure Create(Size: Integer);
    1111procedure Free;
    1212procedure Empty;
    13 function Put(Item, Value: integer): boolean;
    14 function TestPut(Item, Value: integer): boolean;
    15 function Get(var Item, Value: integer): boolean;
     13function Put(Item, Value: Integer): Boolean;
     14function TestPut(Item, Value: Integer): Boolean;
     15function Get(var Item, Value: Integer): Boolean;
    1616
    1717
     
    2323type
    2424  TheapItem = record
    25     Item: integer;
    26     Value: integer;
     25    Item: Integer;
     26    Value: Integer;
    2727  end;
    2828
    2929var
    3030  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}
    3434
    3535
    36 procedure Create(Size: integer);
     36procedure Create(Size: Integer);
    3737begin
    3838  {$IFDEF DEBUG}
    39   assert(not InUse, 'Pile is a single instance class, ' +
     39  Assert(not InUse, 'Pile is a single instance class, ' +
    4040    'no multiple usage possible. Always call Pile.Free after use.');
    4141{$ENDIF}
    42   assert(Size <= MaxSize);
    43   if (n <> 0) or (Size > CurrentSize) then
     42  Assert(Size <= MaxSize);
     43  if (N <> 0) or (Size > CurrentSize) then
    4444  begin
    45     FillChar(Ix, Size * sizeOf(integer), 255);
    46     n := 0;
     45    FillChar(Ix, Size * sizeOf(Integer), 255);
     46    N := 0;
    4747  end;
    4848  CurrentSize := Size;
     
    5555begin
    5656        {$IFDEF DEBUG}
    57   assert(InUse);
     57  Assert(InUse);
    5858  InUse := False;
    5959{$ENDIF}
     
    6262procedure Empty;
    6363begin
    64   if n <> 0 then
     64  if N <> 0 then
    6565  begin
    66     FillChar(Ix, CurrentSize * sizeOf(integer), 255);
    67     n := 0;
     66    FillChar(Ix, CurrentSize * sizeOf(Integer), 255);
     67    N := 0;
    6868  end;
    6969end;
    7070
    7171//Parent(i) = (i-1)/2.
    72 function Put(Item, Value: integer): boolean; //O(lg(n))
     72function Put(Item, Value: Integer): Boolean; //O(lg(n))
    7373var
    74   i, j: integer;
     74  I, J: Integer;
    7575begin
    76   assert(Item < CurrentSize);
    77   i := Ix[Item];
    78   if i >= 0 then
     76  Assert(Item < CurrentSize);
     77  I := Ix[Item];
     78  if I >= 0 then
    7979  begin
    80     if bh[i].Value <= Value then
     80    if bh[I].Value <= Value then
    8181    begin
    8282      Result := False;
    83       exit;
     83      Exit;
    8484    end;
    8585  end
    8686  else
    8787  begin
    88     i := n;
    89     Inc(n);
     88    I := N;
     89    Inc(N);
    9090  end;
    9191
    92   while i > 0 do
     92  while I > 0 do
    9393  begin
    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;
     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;
    100100  end;
    101101  //  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;
    105105  Result := True;
    106106end;
    107107
    108 function TestPut(Item, Value: integer): boolean;
     108function TestPut(Item, Value: Integer): Boolean;
    109109var
    110   i: integer;
     110  I: Integer;
    111111begin
    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);
    115115end;
    116116
    117117//Left(i) = 2*i+1.
    118118//Right(i) = 2*i+2 => Left(i)+1
    119 function Get(var Item, Value: integer): boolean; //O(lg(n))
     119function Get(var Item, Value: Integer): Boolean; //O(lg(n))
    120120var
    121   i, j: integer;
    122   last: TheapItem;
     121  I, J: Integer;
     122  Last: TheapItem;
    123123begin
    124   if n = 0 then
     124  if N = 0 then
    125125  begin
    126126    Result := False;
    127     exit;
     127    Exit;
    128128  end;
    129129
     
    133133  Ix[Item] := -1;
    134134
    135   Dec(n);
    136   if n > 0 then
     135  Dec(N);
     136  if N > 0 then
    137137  begin
    138     last := bh[n];
    139     i := 0;
    140     j := 1;
    141     while j < n do
     138    Last := bh[N];
     139    I := 0;
     140    J := 1;
     141    while J < N do
    142142    begin
    143143      //  Right(i) = Left(i)+1
    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;
     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;
    148148
    149       bh[i] := bh[j];
    150       Ix[bh[i].Item] := i;
    151       i := j;
    152       j := j shl 1 + 1;  //Left(j) = 2*j+1
     149      bh[I] := bh[J];
     150      Ix[bh[I].Item] := I;
     151      I := J;
     152      J := J shl 1 + 1;  //Left(j) = 2*j+1
    153153    end;
    154154
    155155    // 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;
    158158  end;
    159159  Result := True;
     
    161161
    162162initialization
    163   n := 0;
     163  N := 0;
    164164  CurrentSize := 0;
    165165        {$IFDEF DEBUG}
  • branches/highdpi/AI/StdAI/Protocol.pas

    r349 r465  
    916916  Cost: Integer;
    917917  Maint: Integer;
    918   Expiration: integer;
     918  Expiration: Integer;
    919919end
    920920= ((Kind: ikWonder; Preq: adMathematics; Cost: 400; Maint: 0;
     
    11201120  Strength: Integer;
    11211121  Trans: Integer;
    1122   Cost: integer;
     1122  Cost: Integer;
    11231123end
    11241124= (((Preq: adWarriorCode; Strength: 4; Trans: 0; Cost: 3),
     
    15101510  TGetCityData = record
    15111511    Owner: Integer;
    1512     c: TCity;
     1512    C: TCity;
    15131513  end;
    15141514
     
    15911591  TCreateUnitData = record
    15921592    Loc: Integer;
    1593     p: Integer;
     1593    P: Integer;
    15941594    mix: Integer;
    15951595  end;
     
    16001600  TOwnerList = array [0 .. INFIN] of ShortInt;
    16011601  TByteList = array [0 .. INFIN] of Byte;
    1602   TIntList = array [0 .. INFIN] of integer;
     1602  TIntList = array [0 .. INFIN] of Integer;
    16031603  TCityList = array [0 .. INFIN] of TCity;
    16041604  TUnList = array [0 .. INFIN] of TUn;
     
    17611761    0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)));
    17621762
    1763   SpecialModelPreq: array [0 .. nSpecialModel - 1] of integer = (preNone,
     1763  SpecialModelPreq: array [0 .. nSpecialModel - 1] of Integer = (preNone,
    17641764    adExplosives, preNone, preNone, (* adWri, *) adIntelligence, adTrade,
    17651765    (* adTheCorporation,adHorsebackRiding,adAutomobile,adNavigation,
     
    17701770  DelphiRandSeed: Integer;
    17711771
    1772 procedure MakeUnitInfo(p: Integer; const u: TUn; var ui: TUnitInfo);
    1773 procedure MakeModelInfo(p, mix: Integer; const m: TModel; var mi: TModelInfo);
     1772procedure MakeUnitInfo(P: Integer; const U: TUn; var ui: TUnitInfo);
     1773procedure MakeModelInfo(P, mix: Integer; const M: TModel; var mi: TModelInfo);
    17741774function IsSameModel(const mi1, mi2: TModelInfo): Boolean;
    17751775function SpecialTile(Loc, TerrType, lx: Integer): Integer;
     
    17811781implementation
    17821782
    1783 procedure MakeUnitInfo(p: Integer; const u: TUn; var ui: TUnitInfo);
     1783procedure MakeUnitInfo(P: Integer; const U: TUn; var ui: TUnitInfo);
    17841784begin
    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;
    17941794end;
    17951795
    1796 procedure MakeModelInfo(p, mix: Integer; const m: TModel; var mi: TModelInfo);
     1796procedure MakeModelInfo(P, mix: Integer; const M: TModel; var mi: TModelInfo);
    17971797var
    1798   i: Integer;
     1798  I: Integer;
    17991799begin
    1800   mi.Owner := p;
     1800  mi.Owner := P;
    18011801  mi.mix := mix;
    1802   mi.ID := m.ID;
    1803   mi.Domain := m.Domain;
    1804   if m.Kind = mkEnemyDeveloped then
     1802  mi.ID := M.ID;
     1803  mi.Domain := M.Domain;
     1804  if M.Kind = mkEnemyDeveloped then
    18051805    mi.Kind := mkSelfDeveloped // important for IsSameModel()
    18061806  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;
    18121812  if mi.Domain = dAir then
    18131813  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];
    18161816  end
    18171817  else
    18181818  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;
    18231823  mi.Cap := 0;
    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));
     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));
    18271827  mi.MaxUpgrade := 0;
    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;
     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;
    18321832  mi.Lost := 0;
    18331833end;
     
    18411841  Compare1 := @mi1;
    18421842  Compare2 := @mi2;
    1843   result := (Compare1[1] and $FFFF0000 = Compare2[1] and $FFFF0000) and
     1843  Result := (Compare1[1] and $FFFF0000 = Compare2[1] and $FFFF0000) and
    18441844    (Compare1[2] = Compare2[2]) and (Compare1[3] = Compare2[3]) and
    18451845    (Compare1[4] = Compare2[4]) and (Compare1[5] = Compare2[5])
     
    18481848function SpecialTile(Loc, TerrType, lx: Integer): Integer;
    18491849var
    1850   x, y, qx, qy, a: Integer;
     1850  X, Y, qx, qy, A: Integer;
    18511851begin
    18521852  if TerrType = fOcean then
    1853     result := 0
     1853    Result := 0
    18541854  else
    18551855  begin
    1856     y := Loc div lx;
    1857     x := Loc - y * lx;
     1856    Y := Loc div lx;
     1857    X := Loc - Y * lx;
    18581858    if TerrType = fGrass then { formula for productive grassland }
    1859       if Odd((lymax + x - y shr 1) shr 1 + x + (y + 1) shr 1) then
    1860         result := 1
     1859      if Odd((lymax + X - Y shr 1) shr 1 + X + (Y + 1) shr 1) then
     1860        Result := 1
    18611861      else
    1862         result := 0
     1862        Result := 0
    18631863    else { formula for special resources }
    18641864    begin
    1865       a := 4 * x - y + 9980;
    1866       qx := a div 10;
    1867       if (qx * 10 = a) and (qx and 3 <> 0) then
     1865      A := 4 * X - Y + 9980;
     1866      qx := A div 10;
     1867      if (qx * 10 = A) and (qx and 3 <> 0) then
    18681868      begin
    1869         qy := (y + x) div 5;
     1869        qy := (Y + X) div 5;
    18701870        if qy and 3 <> qx shr 2 and 1 * 2 then
    18711871          if (TerrType = fArctic) or (TerrType = fSwamp) then
    1872             result := 1
     1872            Result := 1
    18731873          else if TerrType = fShore then
    18741874          begin
    18751875            if (qx + qy) and 1 = 0 then
    18761876              if qx and 3 = 2 then
    1877                 result := 2
     1877                Result := 2
    18781878              else
    1879                 result := 1
     1879                Result := 1
    18801880            else
    1881               result := 0
     1881              Result := 0
    18821882          end
    18831883          else
    1884             result := (qx + qy) and 1 + 1
     1884            Result := (qx + qy) and 1 + 1
    18851885        else
    1886           result := 0;
     1886          Result := 0;
    18871887      end
    18881888      else
    1889         result := 0;
     1889        Result := 0;
    18901890    end
    18911891  end;
  • branches/highdpi/AI/StdAI/StdAI.ai.txt

    r124 r465  
    55#PATH_WIN32 StdAI-win32.dll
    66#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
    911#CREDITS Standard AI by Steffen Gerlach.
  • branches/highdpi/AI/StdAI/StdAI.lpr

    r303 r465  
    1212var
    1313  AIList: array[0..nPl - 1] of TCustomAI;
    14   Defender: integer;
     14  Defender: Integer;
    1515
    1616
    17   procedure Client(Command, Player: integer; var Data); stdcall;
     17  procedure Client(Command, Player: Integer; var Data); stdcall;
    1818  var
    19     p, y0, ToLoc: integer;
     19    P, y0, ToLoc: Integer;
    2020    UnitInfo: TUnitInfo;
    2121  begin
     
    3232{$ENDIF}
    3333        CustomAI.Init(TNewGameData(Data));
    34         for p := nPl - 1 downto 0 do
    35           if G.RO[p] <> nil then
     34        for P := nPl - 1 downto 0 do
     35          if G.RO[P] <> nil then
    3636          begin
    37             AIList[p] := TAI.Create(p);
    38             AIList[p].SetDataDefaults;
     37            AIList[P] := TAI.Create(P);
     38            AIList[P].SetDataDefaults;
    3939          end
    4040          else
    41             AIList[p] := nil;
     41            AIList[P] := nil;
    4242        Defender := -1;
    4343      end;
    4444      cGetReady:
    45         for p := nPl - 1 downto 0 do
    46           if AIList[p] <> nil then
    47             AIList[p].SetDataRandom;
     45        for P := nPl - 1 downto 0 do
     46          if AIList[P] <> nil then
     47            AIList[P].SetDataRandom;
    4848      cBreakGame:
    49         for p := 0 to nPl - 1 do
    50           if AIList[p] <> nil then
    51             AIList[p].Free;
     49        for P := 0 to nPl - 1 do
     50          if AIList[P] <> nil then
     51            AIList[P].Free;
    5252
    5353      cTurn, cContinue, scContact..scDipBreak, cShowEndContact:
  • branches/highdpi/AI/StdAI/ToolAI.pas

    r349 r465  
    1111type
    1212  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;
    1515  end;
    1616
     
    1818  TToolAI = class(TCustomAI)
    1919  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;
    2323    // tile that is in the middle of all own cities
    2424
    25     function CityTaxBalance(cix: integer; const CityReport: TCityReport): integer;
     25    function CityTaxBalance(cix: Integer; const CityReport: TCityReport): Integer;
    2626    // calculates exact difference of income and maintenance cost for a single city
    2727    // positive result = income higher than maintenance
     
    2929    // respects production and food converted to gold
    3030    // CityReport must have been prepared before
    31     procedure SumCities(TaxRate: integer; var TaxSum, ScienceSum: integer);
     31    procedure SumCities(TaxRate: Integer; var TaxSum, ScienceSum: Integer);
    3232    // calculates exact total tax and science income
    3333    // tax is reduced by maintenance (so might be negative)
     
    4646    procedure JobAssignment_Initialize;
    4747    // 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);
    4949    // add job for settlers with certain score
    5050    // jobs include founding cities!
    51     procedure JobAssignment_AddUnit(uix: integer);
     51    procedure JobAssignment_AddUnit(uix: Integer);
    5252    // add a settler unit to do jobs
    5353    procedure JobAssignment_Go;
     
    5757    // starting a job one turn earlier counts the same as 4 points of score
    5858    // function does not cancel jobs that are already started
    59     function JobAssignment_GotJob(uix: integer): boolean;
     59    function JobAssignment_GotJob(uix: Integer): Boolean;
    6060    // can be called after JobAssignment_Go to find out whether
    6161    // a certain settler has been assigned a job to
     
    6464    // calculates formations and districts
    6565
    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;
    6969    // forecast single unit move between adjacent tiles
    7070    // format of TimeBeforeStep and TimeAfterStep: $1000*number of turns + $800-MP left
     
    7474    // CrossCorner=1 for long moves that cross the tile corner, =0 for short ones that don't
    7575
    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;
    7979
    8080    procedure SeaTransport_BeginInitialize;
     
    9090    // - all transports have same capacity
    9191    // - 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;
    9696    // make plan for group of units to transport from a single loading location by a single transport
    9797    // the plan optimizes:
     
    103103    // function returns false if no more transports are possible
    104104
    105     function CurrentMStrength(Domain: integer): integer;
    106   end;
    107 
     105    function CurrentMStrength(Domain: Integer): Integer;
     106  end;
    108107
    109108const
     
    132131  mxAdjacent = $00000001;
    133132
    134 
    135 var
    136   nContinent, nOcean, nDistrict: integer;
    137   Formation: array[0..lxmax * lymax - 1] of integer;
     133var
     134  nContinent, nOcean, nDistrict: Integer;
     135  Formation: array[0..lxmax * lymax - 1] of Integer;
    138136  // water: ocean index, land: continent index, sorted by size
    139137  // 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;
    141139  // 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;
    145143// total number of prerequisites for each advance
    146 
    147144
    148145implementation
     
    152149
    153150type
    154   pinteger = ^integer;
     151  pinteger = ^Integer;
    155152
    156153var
    157154  // 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 job
     155  MaxScore: Integer;
     156  TileJob, TileJobScore: array[0..lxmax * lymax - 1] of Byte;
     157  JobLocOfSettler: array[0..nUmax - 1] of Integer; // ToAssign = find job
    161158
    162159  // 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
     165procedure ReplaceD(Start, Stop: pinteger; Raider, Twix: Integer);
    170166begin
    171167  while Start <> Stop do
     
    177173end;
    178174
    179 function NextZero(Start, Stop: pinteger; Mask: cardinal): pinteger;
     175function NextZero(Start, Stop: pinteger; Mask: Cardinal): pinteger;
    180176begin
    181177  while (Start <> Stop) and (Start^ and Mask <> 0) do
     
    184180end;
    185181
    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;
     182function TToolAI.CenterOfEmpire: Integer;
     183var
     184  cix, Loc, X, Y, sy, N: Integer;
     185  A, su, sv: Double;
     186begin
     187  N := 0;
    193188  sy := 0;
    194189  su := 0;
     
    199194    if Loc >= 0 then
    200195    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 do
    213     Dec(x, G.lx);
    214   while x < 0 do
    215     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;
     212end;
     213
     214function TToolAI.CityTaxBalance(cix: Integer; const CityReport: TCityReport): Integer;
     215var
     216  I: Integer;
    222217begin
    223218  Result := 0;
     
    234229      Inc(Result, CityReport.FoodRep - CityReport.Eaten);
    235230  end;
    236   for i := nWonder to nImp - 1 do
    237     if MyCity[cix].Built[i] > 0 then
    238       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);
     234end;
     235
     236procedure TToolAI.SumCities(TaxRate: Integer; var TaxSum, ScienceSum: Integer);
     237var
     238  cix, p1: Integer;
    244239  CityReport: TCityReport;
    245240begin
     
    247242  ScienceSum := 0;
    248243  if RO.Government = gAnarchy then
    249     exit;
     244    Exit;
    250245  for p1 := 0 to nPl - 1 do
    251246    if RO.Tribute[p1] <= RO.TributePaid[p1] then
     
    263258end;
    264259
    265 
    266260//------------------------------------------------------------------------------
    267261// City Tiles Processing
     
    274268procedure TToolAI.OptimizeCityTiles;
    275269var
    276   cix: integer;
     270  cix: Integer;
    277271begin
    278272  for cix := 0 to RO.nCity - 1 do
     
    284278procedure TToolAI.GetCityProdPotential;
    285279var
    286   cix: integer;
     280  cix: Integer;
    287281  Advice: TCityTileAdviceData;
    288282begin
     
    292286      begin
    293287        Advice.ResourceWeights := rwMaxProd;
    294         Server(sGetCityTileAdvice, me, cix, Advice);
     288        Server(sGetCityTileAdvice, Me, cix, Advice);
    295289        CityResult[cix] := Advice.CityReport.ProdRep; // considers factory, but shouldn't
    296290      end;
     
    299293procedure TToolAI.GetCityTradePotential;
    300294var
    301   cix: integer;
     295  cix: Integer;
    302296  Advice: TCityTileAdviceData;
    303297begin
     
    307301      begin
    308302        Advice.ResourceWeights := rwMaxScience;
    309         Server(sGetCityTileAdvice, me, cix, Advice);
     303        Server(sGetCityTileAdvice, Me, cix, Advice);
    310304        CityResult[cix] := Advice.CityReport.Trade;
    311305      end;
    312306end;
    313 
    314307
    315308//------------------------------------------------------------------------------
     
    321314procedure TToolAI.JobAssignment_Initialize;
    322315begin
    323   fillchar(JobLocOfSettler, RO.nUn * sizeof(integer), $FF); // -1
    324   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);
    326319  MaxScore := 0;
    327320end;
    328321
    329 procedure TToolAI.JobAssignment_AddJob(Loc, Job, Score: integer);
     322procedure TToolAI.JobAssignment_AddJob(Loc, Job, Score: Integer);
    330323begin
    331324  if Score > 255 then
     
    340333end;
    341334
    342 procedure TToolAI.JobAssignment_AddUnit(uix: integer);
    343 begin
    344   assert(MyModel[MyUnit[uix].mix].Kind in [mkSettler, mkSlaves]);
     335procedure TToolAI.JobAssignment_AddUnit(uix: Integer);
     336begin
     337  Assert(MyModel[MyUnit[uix].mix].Kind in [mkSettler, mkSlaves]);
    345338  JobLocOfSettler[uix] := ToAssign;
    346339end;
    347340
    348 function TToolAI.JobAssignment_GotJob(uix: integer): boolean;
     341function TToolAI.JobAssignment_GotJob(uix: Integer): Boolean;
    349342begin
    350343  Result := JobLocOfSettler[uix] >= 0;
     
    354347const
    355348  DistanceScore = 4;
    356   StepSizeByTerrain: array[0..11] of integer =
     349  StepSizeByTerrain: array[0..11] of Integer =
    357350    (0, 0, 1, 2, 1, 1, 0, 1, 0, 1, 1, 2);
    358351  //Oc-Sh-Gr-De-Pr-Tu-Ar-Sw-XX-Fo-Hi-Mo
    359352var
    360353  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;
    363356  Adjacent: TVicinity8Loc;
    364357  SettlerOfJobLoc, DistToLoc: array[0..lxmax * lymax - 1] of smallint;
    365358  // DistToLoc is only defined where SettlerOfJobLoc>=0
    366   TileChecked: array[0..lxmax * lymax - 1] of boolean;
    367 begin
    368   fillchar(SettlerOfJobLoc, MapSize * 2, $FF); // -1
     359  TileChecked: array[0..lxmax * lymax - 1] of Boolean;
     360begin
     361  FillChar(SettlerOfJobLoc, MapSize * 2, $FF); // -1
    369362
    370363  // keep up jobs that are already started
     
    387380        BestJob := jNone;
    388381        BestScore := -999999;
    389         FillChar(TileChecked, MapSize * sizeof(boolean), False);
     382        FillChar(TileChecked, MapSize * SizeOf(Boolean), False);
    390383        Pile.Create(MapSize);
    391384        Pile.Put(MyUnit[uix].Loc, 0); // start search for new job at current location
     
    406399                  and (Map[NextLoc] and (fUnit or fOwned) <> fUnit) // no foreign unit
    407400                  and ((RO.Territory[NextLoc] < 0) or
    408                   (RO.Territory[NextLoc] = me)) // no foreign territory
     401                  (RO.Territory[NextLoc] = Me)) // no foreign territory
    409402                  and (Map[TestLoc] and Map[NextLoc] and fInEnemyZoC = 0) then
    410403                  // move not prevented by ZoC
     
    421414            ((SettlerOfJobLoc[TestLoc] < 0) or (DistToLoc[TestLoc] > TestDistance)) then
    422415          begin
    423             TestScore := integer(TileJobScore[TestLoc]) - DistanceScore * TestDistance;
     416            TestScore := Integer(TileJobScore[TestLoc]) - DistanceScore * TestDistance;
    424417            if TestScore > BestScore then
    425418              BestCount := 0;
     
    469462          Unit_StartJob(uix, TileJob[JobLocOfSettler[uix]]);
    470463      end;
    471 end; // JobAssignment_Go
    472 
     464end;
    473465
    474466//------------------------------------------------------------------------------
     
    477469procedure TToolAI.AnalyzeMap;
    478470var
    479   i, j, Loc, Loc1, V8, Count, Kind, MostIndex: integer;
     471  I, J, Loc, Loc1, V8, Count, Kind, MostIndex: Integer;
    480472  Adjacent: TVicinity8Loc;
    481473  IndexOfID: array[0..lxmax * lymax - 1] of smallint;
    482474  IDOfIndex: array[0..lxmax * lymax div 2 - 1] of smallint;
    483475begin
    484   fillchar(District, MapSize * 4, $FF);
     476  FillChar(District, MapSize * 4, $FF);
    485477  for Loc := 0 to MapSize - 1 do
    486478    if Map[Loc] and fTerrain = fUNKNOWN then
     
    508500              Formation[Loc], Formation[Loc1]);
    509501      end;
    510       if (RO.Territory[Loc] = me) and (Map[Loc] and fTerrain >= fGrass) then
     502      if (RO.Territory[Loc] = Me) and (Map[Loc] and fTerrain >= fGrass) then
    511503      begin
    512504        District[Loc] := Loc;
     
    553545        Inc(Count);
    554546      end;
    555     for i := 0 to Count - 2 do
    556     begin
    557       MostIndex := i;
    558       for j := i + 1 to Count - 1 do
    559         if IndexOfID[IDOfIndex[j]] > IndexOfID[IDOfIndex[MostIndex]] then
    560           MostIndex := j;
    561       if MostIndex <> i then
    562       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 do
    569       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;
    570562
    571563    case Kind of
     
    594586  end;
    595587end;
    596 
    597588
    598589//------------------------------------------------------------------------------
     
    614605// other:  |   Basic   | 0| Speed  |              X X X             | MaxTerrType  |
    615606
    616 function TToolAI.GetMyMoveStyle(mix, Health: integer): integer;
     607function TToolAI.GetMyMoveStyle(mix, Health: Integer): Integer;
    617608begin
    618609  with MyModel[mix] do
     
    623614      begin
    624615        Inc(Result, (50 + (Speed - 150) * 13 shr 7) shl 8); //HeavyCost
    625         if RO.Wonder[woShinkansen].EffectiveOwner <> me then
     616        if RO.Wonder[woShinkansen].EffectiveOwner <> Me then
    626617          Inc(Result, Speed * (4 * 1311) shr 17); // RailCost
    627         if (RO.Wonder[woGardens].EffectiveOwner <> me) or
     618        if (RO.Wonder[woGardens].EffectiveOwner <> Me) or
    628619          (Kind = mkSettler) and (Speed >= 200) then
    629620          Inc(Result, msHostile);
     
    640631      begin
    641632        Result := Speed;
    642         if RO.Wonder[woMagellan].EffectiveOwner = me then
     633        if RO.Wonder[woMagellan].EffectiveOwner = Me then
    643634          Inc(Result, 200);
    644635        if Health < 100 then
     
    655646end;
    656647
    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;
     648function TToolAI.CheckStep(MoveStyle, TimeBeforeStep, CrossCorner: Integer;
     649  var TimeAfterStep, RecoverTurns: Integer; FromTile, ToTile: Integer;
     650  IsCapture: Boolean): Integer;
     651var
     652  MoveCost, RecoverCost: Integer;
    662653begin
    663654  //IsCapture:=true;
    664   assert(((FromTile and fTerrain <= fMountains) or (FromTile and
     655  Assert(((FromTile and fTerrain <= fMountains) or (FromTile and
    665656    fTerrain = fUNKNOWN)) and ((ToTile and fTerrain <= fMountains) or
    666657    (ToTile and fTerrain = fUNKNOWN)));
     
    710701                if ToTile and fPeace <> 0 then
    711702                  Result := csCheckTerritory;
    712                 exit;
     703                Exit;
    713704              end;
    714705            end;
     
    829820          begin
    830821            Result := csForbiddenTile;
    831             exit;
     822            Exit;
    832823          end;
    833824        end
     
    878869              // must wait for next turn
    879870              Result := csOk;
    880               exit;
     871              Exit;
    881872            end;
    882873          end;
     
    898889      Result := csForbiddenTile;
    899890  end;
    900 end; // CheckStep
     891end;
    901892
    902893(*
    903894-------- Pathfinding Reference Implementation --------
    904895var
    905 MoveStyle,V8,Loc,Time,NextLoc,NextTime,RecoverTurns: integer;
     896MoveStyle,V8,Loc,Time,NextLoc,NextTime,RecoverTurns: Integer;
    906897Adjacent: TVicinity8Loc;
    907 Reached: array[0..lxmax*lymax-1] of boolean;
    908 begin
    909 fillchar(Reached, MapSize, false);
     898Reached: array[0..lxmax*lymax-1] of Boolean;
     899begin
     900FillChar(Reached, MapSize, False);
    910901MoveStyle:=GetMyMoveStyle(MyUnit[uix].mix, MyUnit[uix].Health);
    911902Pile.Create(MapSize);
     
    915906  // todo: check exit condition, e.g. whether destination reached
    916907
    917   Reached[Loc]:=true;
     908  Reached[Loc]:=True;
    918909  V8_to_Loc(Loc, Adjacent);
    919910  for V8:=0 to 7 do
     
    925916          Pile.Put(NextLoc, NextTime+RecoverTurns*$1000);
    926917        csForbiddenTile:
    927           Reached[NextLoc]:=true; // don't check moving there again
     918          Reached[NextLoc]:=True; // don't check moving there again
    928919        csCheckTerritory:
    929920          if RO.Territory[NextLoc]=RO.Territory[Loc] then
     
    936927*)
    937928
    938 function TToolAI.Unit_MoveEx(uix, ToLoc: integer; Options: integer): integer;
     929function TToolAI.Unit_MoveEx(uix, ToLoc: Integer; Options: Integer): Integer;
    939930var
    940931  Loc, NextLoc, Temp, FromLoc, EndLoc, Time, V8, MoveResult, RecoverTurns,
    941   NextTime, MoveStyle: integer;
     932  NextTime, MoveStyle: Integer;
    942933  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;
    945936begin
    946937  Result := eOk;
    947938  FromLoc := MyUnit[uix].Loc;
    948939  if FromLoc = ToLoc then
    949     exit;
     940    Exit;
    950941
    951942  FillChar(Reached, MapSize, False);
     
    10121003      begin
    10131004        Result := MoveResult;
    1014         break;
     1005        Break;
    10151006      end;
    10161007    end;
     
    10201011end;
    10211012
    1022 
    10231013//------------------------------------------------------------------------------
    10241014// Oversea Transport
     
    10261016procedure TToolAI.SeaTransport_BeginInitialize;
    10271017begin
    1028   fillchar(TransportAvailable, RO.nUn * sizeof(integer), $FF); // -1
     1018  FillChar(TransportAvailable, RO.nUn * SizeOf(Integer), $FF); // -1
    10291019  InitComplete := False;
    10301020  HaveDestinations := False;
     
    10351025end;
    10361026
    1037 procedure TToolAI.SeaTransport_AddLoad(uix: integer);
    1038 var
    1039   i: integer;
    1040 begin
    1041   assert(not InitComplete); // call order violation!
     1027procedure TToolAI.SeaTransport_AddLoad(uix: Integer);
     1028var
     1029  I: Integer;
     1030begin
     1031  Assert(not InitComplete); // call order violation!
    10421032  if Map[MyUnit[uix].Loc] and fTerrain < fGrass then
    1043     exit;
    1044   for i := 0 to nTransportLoad - 1 do
    1045     if uix = uixTransportLoad[i] then
    1046       exit;
     1033    Exit;
     1034  for I := 0 to nTransportLoad - 1 do
     1035    if uix = uixTransportLoad[I] then
     1036      Exit;
    10471037  uixTransportLoad[nTransportLoad] := uix;
    10481038  Inc(nTransportLoad);
    10491039end;
    10501040
    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);
     1041procedure TToolAI.SeaTransport_AddTransport(uix: Integer);
     1042var
     1043  MoveStyle: Integer;
     1044begin
     1045  Assert(not InitComplete); // call order violation!
     1046  Assert(MyModel[MyUnit[uix].mix].Cap[mcSeaTrans] > 0);
    10571047  TransportAvailable[uix] := 1;
    10581048  with MyModel[MyUnit[uix].mix] do
     
    10681058end;
    10691059
    1070 procedure TToolAI.SeaTransport_AddDestination(Loc: integer);
    1071 begin
    1072   assert(not InitComplete); // call order violation!
     1060procedure TToolAI.SeaTransport_AddDestination(Loc: Integer);
     1061begin
     1062  Assert(not InitComplete); // call order violation!
    10731063  Pile.Put(Loc, $800);
    10741064  HaveDestinations := True;
     
    10771067procedure TToolAI.SeaTransport_EndInitialize;
    10781068var
    1079   Loc0, Time0, V8, Loc1, ArriveTime, RecoverTurns: integer;
     1069  Loc0, Time0, V8, Loc1, ArriveTime, RecoverTurns: Integer;
    10801070  Adjacent: TVicinity8Loc;
    10811071begin
    1082   assert(not InitComplete); // call order violation!
     1072  Assert(not InitComplete); // call order violation!
    10831073  InitComplete := True;
    10841074  if HaveDestinations then
    10851075  begin // calculate TurnsAfterLoad from destination locs
    1086     fillchar(TurnsAfterLoad, MapSize, $FF); // -1
     1076    FillChar(TurnsAfterLoad, MapSize, $FF); // -1
    10871077    while Pile.Get(Loc0, Time0) do
    10881078    begin // search backward
     
    11091099end;
    11101100
    1111 
    11121101function 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;
     1103var
     1104  V8, I, J, iPicked, uix, Loc0, Time0, Loc1, RecoverTurns, MoveStyle,
    11161105  TurnsLoaded, TurnCount, tuix, tuix1, ArriveTime, TotalDelay,
    11171106  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;
    11211110  StartLocPtr, ArrivedEnd: pinteger;
    11221111  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;
    11261115  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;
     1118begin
     1119  Assert(InitComplete); // call order violation!
    11311120
    11321121  if HaveDestinations and (nTransportLoad > 0) then
     
    11391128        for tuix := 0 to nTransportLoad - 1 do
    11401129        begin
    1141           Loc_to_ab(MyUnit[uix].Loc, MyUnit[uixTransportLoad[tuix]].Loc, a, b);
    1142           if (abs(a) <= 1) and (abs(b) <= 1) then
     1130          Loc_to_ab(MyUnit[uix].Loc, MyUnit[uixTransportLoad[tuix]].Loc, A, B);
     1131          if (abs(A) <= 1) and (abs(B) <= 1) then
    11431132          begin
    1144             assert((a <> 0) or (b <> 0));
     1133            Assert((A <> 0) or (B <> 0));
    11451134            Inc(GroupCount);
    11461135          end;
     
    11561145          for tuix := nTransportLoad - 1 downto 0 do
    11571146          begin
    1158             Loc_to_ab(TransportPlan.LoadLoc, MyUnit[uixTransportLoad[tuix]].Loc, a, b);
    1159             if (abs(a) <= 1) and (abs(b) <= 1) then
     1147            Loc_to_ab(TransportPlan.LoadLoc, MyUnit[uixTransportLoad[tuix]].Loc, A, B);
     1148            if (abs(A) <= 1) and (abs(B) <= 1) then
    11601149            begin
    11611150              TransportPlan.uixLoad[TransportPlan.nLoad] := uixTransportLoad[tuix];
     
    11641153              Inc(TransportPlan.nLoad);
    11651154              if TransportPlan.nLoad = TransportCapacity then
    1166                 break;
     1155                Break;
    11671156            end;
    11681157          end;
    11691158          Result := True;
    1170           exit;
     1159          Exit;
    11711160        end;
    11721161      end;
     
    11761165  begin
    11771166    // select units from same continent
    1178     fillchar(Arrived, 4 * nContinent, 0); // misuse Arrived as counter
     1167    FillChar(Arrived, 4 * nContinent, 0); // misuse Arrived as counter
    11791168    for tuix := 0 to nTransportLoad - 1 do
    11801169    begin
    1181       assert(Map[MyUnit[uixTransportLoad[tuix]].Loc] and fTerrain >= fGrass);
    1182       f := Formation[MyUnit[uixTransportLoad[tuix]].Loc];
    1183       if f >= 0 then
    1184         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]);
    11851174    end;
    11861175    OriginContinent := 0;
    1187     for f := 1 to nContinent - 1 do
    1188       if Arrived[f] > Arrived[OriginContinent] then
    1189         OriginContinent := f;
     1176    for F := 1 to nContinent - 1 do
     1177      if Arrived[F] > Arrived[OriginContinent] then
     1178        OriginContinent := F;
    11901179    nSelectedLoad := 0;
    11911180    for tuix := 0 to nTransportLoad - 1 do
     
    11961185        Inc(nSelectedLoad);
    11971186        if nSelectedLoad = 16 then
    1198           break;
     1187          Break;
    11991188      end;
    12001189
    12011190    Pile.Create(MapSize);
    1202     fillchar(ResponsibleTransport, MapSize * 2, $FF); // -1
    1203     fillchar(TurnsBeforeLoad, MapSize, $FF); // -1
     1191    FillChar(ResponsibleTransport, MapSize * 2, $FF); // -1
     1192    FillChar(TurnsBeforeLoad, MapSize, $FF); // -1
    12041193    ok := False;
    12051194    for uix := 0 to RO.nUn - 1 do
     
    12141203      Result := False;
    12151204      Pile.Free;
    1216       exit;
     1205      Exit;
    12171206    end;
    12181207    while Pile.Get(Loc0, Time0) do
     
    12351224    end;
    12361225
    1237     fillchar(Arrived, MapSize * 4, $55); // set NotReachedFlag for all tiles
    1238     fillchar(GroupComplete, MapSize, False);
     1226    FillChar(Arrived, MapSize * 4, $55); // set NotReachedFlag for all tiles
     1227    FillChar(GroupComplete, MapSize, False);
    12391228    BestLoadLoc := -1;
    12401229
     
    12431232    begin
    12441233      uix := uixSelectedLoad[tuix];
    1245       if MyUnit[uix].Movement = integer(MyModel[MyUnit[uix].mix].Speed) then
     1234      if MyUnit[uix].Movement = Integer(MyModel[MyUnit[uix].mix].Speed) then
    12461235      begin
    12471236        NotReachedFlag := 1 shl (2 * tuix);
     
    12571246            if (TurnsBeforeLoad[Loc1] >= 0) and (TurnsAfterLoad[Loc1] >= 0) then
    12581247            begin
    1259               i := 1;
     1248              I := 1;
    12601249              GroupCount := 0;
    12611250              for tuix1 := 0 to nSelectedLoad - 1 do
    12621251              begin
    1263                 if Arrived[loc1] and i = 0 then
     1252                if Arrived[loc1] and I = 0 then
    12641253                  Inc(GroupCount);
    1265                 i := i shl 2;
     1254                I := I shl 2;
    12661255              end;
    1267               assert(GroupCount <= TransportCapacity);
     1256              Assert(GroupCount <= TransportCapacity);
    12681257              if (GroupCount = TransportCapacity) or (GroupCount = nSelectedLoad) then
    12691258                GroupComplete[loc1] := True;
     
    13031292          begin
    13041293            Pile.Put(MyUnit[uix].Loc, $1800 - MyUnit[uix].Movement);
    1305             if MyUnit[uix].Movement = integer(MyModel[MyUnit[uix].mix].Speed) then
     1294            if MyUnit[uix].Movement = Integer(MyModel[MyUnit[uix].mix].Speed) then
    13061295              FullMovementLoc := MyUnit[uix].Loc;
    13071296            // surrounding tiles can be loaded immediately
     
    13191308            if StartLocPtr <> ArrivedEnd then
    13201309            begin
    1321               Loc0 := (integer(StartLocPtr) - integer(@Arrived)) shr 2;
     1310              Loc0 := (Integer(StartLocPtr) - Integer(@Arrived)) shr 2;
    13221311              Inc(StartLocPtr);
    13231312              Time0 := $800;
     
    13271316              if IsFirstLoc then
    13281317                ContinueUnit := ContinueUnit and not (1 shl tuix);
    1329               break;
     1318              Break;
    13301319            end;
    13311320            IsFirstLoc := False;
     
    13341323            if not GroupComplete[Loc0] and (Map[Loc0] and fTerrain <> fMountains) then
    13351324            begin // check whether group complete -- no mountains because complete flag might be faked there
    1336               i := 1;
     1325              I := 1;
    13371326              GroupCount := 0;
    13381327              for tuix1 := 0 to nSelectedLoad - 1 do
    13391328              begin
    1340                 if Arrived[Loc0] and i = 0 then
     1329                if Arrived[Loc0] and I = 0 then
    13411330                  Inc(GroupCount);
    1342                 i := i shl 2;
     1331                I := I shl 2;
    13431332              end;
    1344               assert(GroupCount <= TransportCapacity);
     1333              Assert(GroupCount <= TransportCapacity);
    13451334              if (GroupCount = TransportCapacity) or (GroupCount = nSelectedLoad) then
    13461335                GroupComplete[Loc0] := True;
     
    13641353                if (TurnsBeforeLoad[Loc1] >= 0) and (TurnsAfterLoad[Loc1] >= 0) then
    13651354                begin
    1366                   i := 1;
     1355                  I := 1;
    13671356                  GroupCount := 0;
    13681357                  for tuix1 := 0 to nSelectedLoad - 1 do
    13691358                  begin
    1370                     if Arrived[loc1] and i = 0 then
     1359                    if Arrived[loc1] and I = 0 then
    13711360                      Inc(GroupCount);
    1372                     i := i shl 2;
     1361                    I := I shl 2;
    13731362                  end;
    1374                   assert(GroupCount <= TransportCapacity);
     1363                  Assert(GroupCount <= TransportCapacity);
    13751364                  if (GroupCount = TransportCapacity) or
    13761365                    (GroupCount = nSelectedLoad) then
     
    14471436        if 1 shl (2 * tuix) and Arrived[BestLoadLoc] = 0 then
    14481437        begin
    1449           assert(uixTransportLoad[tuixSelectedLoad[tuix]] = uixSelectedLoad[tuix]);
     1438          Assert(uixTransportLoad[tuixSelectedLoad[tuix]] = uixSelectedLoad[tuix]);
    14501439          TransportPlan.uixLoad[TransportPlan.nLoad] := uixSelectedLoad[tuix];
    14511440          uixTransportLoad[tuixSelectedLoad[tuix]] :=
     
    14551444        end;
    14561445      Result := True;
    1457       exit;
     1446      Exit;
    14581447    end;
    14591448
     
    14621451    for tuix := nSelectedLoad - 1 downto 0 do
    14631452    begin
    1464       assert(uixTransportLoad[tuixSelectedLoad[tuix]] = uixSelectedLoad[tuix]);
     1453      Assert(uixTransportLoad[tuixSelectedLoad[tuix]] = uixSelectedLoad[tuix]);
    14651454      uixTransportLoad[tuixSelectedLoad[tuix]] :=
    14661455        uixTransportLoad[nTransportLoad - 1];
     
    14721461end;
    14731462
    1474 
    14751463//------------------------------------------------------------------------------
    14761464// Misc
    14771465
    1478 function TToolAI.CurrentMStrength(Domain: integer): integer;
    1479 var
    1480   i: integer;
     1466function TToolAI.CurrentMStrength(Domain: Integer): Integer;
     1467var
     1468  I: Integer;
    14811469begin
    14821470  Result := 0;
    1483   for i := 0 to nUpgrade - 1 do
    1484     with upgrade[Domain, i] do
     1471  for I := 0 to nUpgrade - 1 do
     1472    with upgrade[Domain, I] do
    14851473      if (Preq = preNone) or (Preq >= 0) and
    14861474        ((RO.Tech[Preq] >= tsApplicable) or (Preq in FutureTech) and
     
    14941482end;
    14951483
    1496 
    14971484//------------------------------------------------------------------------------
    14981485
    14991486procedure SetAdvancedness;
    15001487var
    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);
    15051492  var
    1506     i: integer;
     1493    I: Integer;
    15071494  begin
    15081495    if known[ad] = 0 then
    15091496    begin
    15101497      known[ad] := 1;
    1511       for i := 0 to 2 do
    1512         if AdvPreq[ad, i] >= 0 then
    1513           MarkPreqs(AdvPreq[ad, i]);
     1498      for I := 0 to 2 do
     1499        if AdvPreq[ad, I] >= 0 then
     1500          MarkPreqs(AdvPreq[ad, I]);
    15141501    end;
    15151502  end;
     
    15211508    FillChar(known, SizeOf(known), 0);
    15221509    MarkPreqs(ad);
    1523     for j := 0 to nAdv - 1 do
    1524       if known[j] > 0 then
     1510    for J := 0 to nAdv - 1 do
     1511      if known[J] > 0 then
    15251512        Inc(Advancedness[ad]);
    15261513  end;
  • branches/highdpi/Back.lfm

    r246 r465  
    88  Caption = 'C-evo'
    99  Color = clBlack
     10  DesignTimePPI = 144
    1011  Font.Color = clWindowText
    11   Font.Height = -13
     12  Font.Height = -30
    1213  Font.Name = 'MS Sans Serif'
    1314  OnClose = FormClose
     
    1617  OnPaint = FormPaint
    1718  OnShow = FormShow
    18   LCLVersion = '1.6.2.0'
    19   WindowState = wsMaximized
    20   PixelsPerInch = 96
     19  ShowInTaskBar = stNever
     20  LCLVersion = '2.2.0.4'
    2121  Scaled = False
     22  WindowState = wsFullScreen
    2223end
  • branches/highdpi/Back.pas

    r349 r465  
    5151begin
    5252  if Assigned(Img) then
    53     DpiBitCanvas(Canvas, DpiScreen.Width - Img.Width - (DpiScreen.Width - 800) *
     53    DpiBitBltCanvas(Canvas, DpiScreen.Width - Img.Width - (DpiScreen.Width - 800) *
    5454      3 div 8, (DpiScreen.Height - 600) div 3, Img.Width, Img.Height,
    5555      Img.Canvas, 0, 0);
     
    7070      if FileExists(FileName) then begin
    7171        Img := TDpiBitmap.Create;
    72         LoadGraphicFile(img, FileName);
     72        LoadGraphicFile(Img, FileName);
     73        Repaint;
    7374      end;
    7475    end;
  • branches/highdpi/Brain.pas

    r464 r465  
    1 unit UBrain;
    2 
    3 {$mode delphi}
     1unit Brain;
    42
    53interface
    64
    75uses
    8   UDpiControls, Classes, SysUtils, fgl, Graphics, Protocol, LazFileUtils, dynlibs;
     6  UDpiControls, Classes, SysUtils, Generics.Collections, Graphics, Protocol, LazFileUtils,
     7  dynlibs, Types;
    98
    109const
     
    3534    Picture: TDpiBitmap;
    3635    Beginner: Boolean;
     36    procedure LoadPicture;
    3737    procedure LoadFromFile(AIFileName: string);
    3838    constructor Create;
     
    4242  { TBrains }
    4343
    44   TBrains = class(TFPGObjectList<TBrain>)
     44  TBrains = class(TObjectList<TBrain>)
    4545    function AddNew: TBrain;
    4646    function GetKindCount(Kind: TBrainType): Integer;
    4747    procedure GetByKind(Kind: TBrainType; Brains: TBrains);
    4848    function GetBeginner: TBrain;
     49    procedure LoadPictures;
    4950  end;
    5051
     
    5354
    5455uses
    55   ScreenTools;
     56  ScreenTools, Directories;
    5657
    5758{ TBrain }
     59
     60procedure TBrain.LoadPicture;
     61var
     62  TextSize: TSize;
     63begin
     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;
     76end;
    5877
    5978procedure TBrain.LoadFromFile(AIFileName: string);
     
    106125      DLLName := BasePath + DirectorySeparator + Value
    107126    {$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
    114141      DLLName := BasePath + DirectorySeparator + Value
    115142    {$ENDIF}{$ENDIF}
     
    177204end;
    178205
     206procedure TBrains.LoadPictures;
     207var
     208  I: Integer;
     209begin
     210  for I := 0 to Count - 1 do
     211    with Items[I] do LoadPicture;
     212end;
     213
    179214end.
    180215
     216
     217
  • branches/highdpi/CityProcessing.pas

    r349 r465  
    88
    99// 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;
     10procedure GetCityAreaInfo(P, Loc: Integer; var CityAreaInfo: TCityAreaInfo);
     11function CanCityGrow(P, cix: Integer): Boolean;
     12function GetCityReport(P, cix: Integer; var CityReport: TCityReport): Integer;
     13function GetCityReportNew(P, cix: Integer;
     14  var CityReportNew: TCityReportNew): Integer;
    1515
    1616// 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);
     17function AddBestCityTile(P, cix: Integer): Boolean;
     18procedure CityGrowth(P, cix: Integer);
     19procedure CityShrink(P, cix: Integer);
     20procedure Pollute(P, cix: Integer);
    2121
    2222// Turn Processing
    23 procedure PayCityMaintenance(p, cix: integer);
    24 procedure CollectCityResources(p, cix: integer);
    25 function CityTurn(p, cix: integer): boolean;
     23procedure PayCityMaintenance(P, cix: Integer);
     24procedure CollectCityResources(P, cix: Integer);
     25function CityTurn(P, cix: Integer): Boolean;
    2626
    2727// Tile Access
    28 function SetCityTiles(p, cix, NewTiles: integer;
    29   TestOnly: boolean = false): integer;
    30 procedure GetCityTileAdvice(p, cix: integer; var Advice: TCityTileAdviceData);
     28function SetCityTiles(P, cix, NewTiles: Integer;
     29  TestOnly: Boolean = False): Integer;
     30procedure GetCityTileAdvice(P, cix: Integer; var Advice: TCityTileAdviceData);
    3131
    3232// Start/End Game
     
    3434procedure ReleaseGame;
    3535
     36
    3637implementation
    3738
    3839type
    3940  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;
    4449  end;
    4550
    4651  TProdProcessing = record
    47     ProdBonus, PollBonus, FutProdBonus, PollThreshold: integer;
     52    ProdBonus: Integer;
     53    PollBonus: Integer;
     54    FutProdBonus: Integer;
     55    PollThreshold: Integer;
    4856  end;
    4957
     
    5159
    5260  TCityReportEx = record
    53     BaseHappiness, BaseControl, Material: integer;
     61    BaseHappiness: Integer;
     62    BaseControl: Integer;
     63    Material: Integer;
    5464    ProdProcessing: TProdProcessing;
    5565    TradeProcessing: TTradeProcessing;
     
    5767
    5868var
    59   MaxDist: integer;
    60 
    61   {
    62     Reporting
    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}
     75procedure GetCityAreaInfo(P, Loc: Integer; var CityAreaInfo: TCityAreaInfo);
     76var
     77  V21, Loc1, p1: Integer;
    6878  Radius: TVicinity21Loc;
    6979begin
    70 {$IFOPT O-}assert(1 shl p and InvalidTreatyMap = 0); {$ENDIF}
     80{$IFOPT O-}Assert(1 shl P and InvalidTreatyMap = 0); {$ENDIF}
    7181  with CityAreaInfo do
    7282  begin
     
    8090      begin
    8191        p1 := RealMap[Loc1] shr 27;
    82         if (p1 < nPl) and (p1 <> p) and (RW[p].Treaty[p1] >= trPeace) then
     92        if (p1 < nPl) and (p1 <> P) and (RW[P].Treaty[p1] >= trPeace) then
    8393          Available[V21] := faTreaty
    84         else if (ZoCMap[Loc1] > 0) and (Occupant[Loc1] <> p) and
    85           (RW[p].Treaty[Occupant[Loc1]] < trAlliance) then
     94        else if (ZoCMap[Loc1] > 0) and (Occupant[Loc1] <> P) and
     95          (RW[P].Treaty[Occupant[Loc1]] < trAlliance) then
    8696          Available[V21] := faSiege
    8797        else if (UsedByCity[Loc1] <> -1) and (UsedByCity[Loc1] <> Loc) then
    8898          Available[V21] := faNotAvailable
    8999        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] do
    99     result := (Size < MaxCitySize) and
     100          Available[V21] := faAvailable;
     101      end;
     102    end;
     103  end;
     104end;
     105
     106function CanCityGrow(P, cix: Integer): Boolean;
     107begin
     108  with RW[P].City[cix] do
     109    Result := (Size < MaxCitySize) and
    100110      ((Size < NeedAqueductSize) or (Built[imAqueduct] = 1) and
    101111      (Size < NeedSewerSize) or (Built[imSewer] = 1));
    102112end;
    103113
    104 procedure DetermineCityProdProcessing(p, cix: integer;
     114procedure DetermineCityProdProcessing(P, cix: Integer;
    105115  var ProdProcessing: TProdProcessing);
    106116begin
    107   with RW[p].City[cix], ProdProcessing do
     117  with RW[P].City[cix], ProdProcessing do
    108118  begin
    109119    ProdBonus := 0;
    110120    PollBonus := 0;
    111121    if Built[imFactory] = 1 then
    112       inc(ProdBonus);
     122      Inc(ProdBonus);
    113123    if Built[imMfgPlant] = 1 then
    114       inc(ProdBonus);
     124      Inc(ProdBonus);
    115125    if (Built[imPower] = 1) or (Built[imHydro] = 1) or (Built[imNuclear] = 1) or
    116       (GWonder[woHoover].EffectiveOwner = p) then
     126      (GWonder[woHoover].EffectiveOwner = P) then
    117127      ProdBonus := ProdBonus * 2;
    118128    if Built[imFactory] = 1 then
    119       inc(PollBonus);
     129      Inc(PollBonus);
    120130    if Built[imMfgPlant] = 1 then
    121       inc(PollBonus);
     131      Inc(PollBonus);
    122132    if (Built[imFactory] + Built[imMfgPlant] > 0) then
    123       if (Built[imHydro] > 0) or (GWonder[woHoover].EffectiveOwner = p) then
    124         dec(PollBonus)
     133      if (Built[imHydro] > 0) or (GWonder[woHoover].EffectiveOwner = P) then
     134        Dec(PollBonus)
    125135      else if (Built[imNuclear] = 0) and (Built[imPower] = 1) then
    126         inc(PollBonus);
    127     if (RW[p].Government <= gDespotism) or (Built[imRecycling] = 1) then
     136        Inc(PollBonus);
     137    if (RW[P].Government <= gDespotism) or (Built[imRecycling] = 1) then
    128138      PollBonus := -2; // no pollution
    129139    PollThreshold := Size;
    130140    FutProdBonus := 0;
    131     if RW[p].Tech[futProductionTechnology] > 0 then
     141    if RW[P].Tech[futProductionTechnology] > 0 then
    132142    begin // future tech benefits
    133143      if Built[imFactory] = 1 then
    134         inc(FutProdBonus, FactoryFutureBonus * RW[p].Tech
     144        Inc(FutProdBonus, FactoryFutureBonus * RW[P].Tech
    135145          [futProductionTechnology]);
    136146      if Built[imMfgPlant] = 1 then
    137         inc(FutProdBonus, MfgPlantFutureBonus * RW[p].Tech
     147        Inc(FutProdBonus, MfgPlantFutureBonus * RW[P].Tech
    138148          [futProductionTechnology]);
    139149    end;
     
    141151end;
    142152
    143 procedure BoostProd(BaseProd: integer; ProdProcessing: TProdProcessing;
    144   var Prod, Poll: integer);
     153procedure BoostProd(BaseProd: Integer; ProdProcessing: TProdProcessing;
     154  var Prod, Poll: Integer);
    145155begin
    146156  Poll := BaseProd * (2 + ProdProcessing.PollBonus) shr 1;
     
    148158    Poll := 0
    149159  else
    150     dec(Poll, ProdProcessing.PollThreshold);
     160    Dec(Poll, ProdProcessing.PollThreshold);
    151161  if ProdProcessing.FutProdBonus > 0 then
    152162    Prod := BaseProd * (100 + ProdProcessing.ProdBonus * 50 +
     
    156166end;
    157167
    158 procedure DetermineCityTradeProcessing(p, cix, HappinessBeforeLux: integer;
     168procedure DetermineCityTradeProcessing(P, cix, HappinessBeforeLux: Integer;
    159169  var TradeProcessing: TTradeProcessing);
    160170var
    161   i, Dist: integer;
    162 begin
    163   with RW[p].City[cix], TradeProcessing do
     171  I, Dist: Integer;
     172begin
     173  with RW[P].City[cix], TradeProcessing do
    164174  begin
    165175    TaxBonus := 0;
    166176    ScienceBonus := 0;
    167177    if Built[imMarket] = 1 then
    168       inc(TaxBonus, 2);
     178      Inc(TaxBonus, 2);
    169179    if Built[imBank] = 1 then
    170180    begin
    171       inc(TaxBonus, 3);
    172       if RW[p].NatBuilt[imStockEx] = 1 then
    173         inc(TaxBonus, 3);
     181      Inc(TaxBonus, 3);
     182      if RW[P].NatBuilt[imStockEx] = 1 then
     183        Inc(TaxBonus, 3);
    174184    end;
    175185    LuxBonus := TaxBonus;
    176186    if Built[imLibrary] = 1 then
    177       inc(ScienceBonus, 2);
     187      Inc(ScienceBonus, 2);
    178188    if Built[imUniversity] = 1 then
    179       inc(ScienceBonus, 3);
     189      Inc(ScienceBonus, 3);
    180190    if Built[imResLab] = 1 then
    181       inc(ScienceBonus, 3);
     191      Inc(ScienceBonus, 3);
    182192    ScienceDoubling := 0;
    183193    if Built[imNatObs] > 0 then
    184       inc(ScienceDoubling);
    185     if RW[p].Government = gFundamentalism then
    186       dec(ScienceDoubling)
    187     else if (GWonder[woNewton].EffectiveOwner = p) and
    188       (RW[p].Government = gMonarchy) then
    189       inc(ScienceDoubling);
    190     FlexibleLuxury := ((ServerVersion[p] >= $0100F1) and
    191       (GWonder[woLiberty].EffectiveOwner = p) or (ServerVersion[p] < $0100F1)
    192       and (GWonder[woMich].EffectiveOwner = p)) and
    193       (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);
    194204    FutResBonus := 0;
    195     if RW[p].Tech[futResearchTechnology] > 0 then
     205    if RW[P].Tech[futResearchTechnology] > 0 then
    196206    begin // future tech benefits
    197207      if Built[imUniversity] = 1 then
    198         inc(FutResBonus, UniversityFutureBonus * RW[p].Tech
     208        Inc(FutResBonus, UniversityFutureBonus * RW[P].Tech
    199209          [futResearchTechnology]);
    200210      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) then
     211        Inc(FutResBonus, ResLabFutureBonus * RW[P].Tech[futResearchTechnology]);
     212    end;
     213    if (RW[P].NatBuilt[imPalace] > 0) or (ServerVersion[P] < $010000) then
    204214    begin // calculate corruption
    205215      Dist := MaxDist;
    206       for i := 0 to RW[p].nCity - 1 do
    207         if (RW[p].City[i].Loc >= 0) and (RW[p].City[i].Built[imPalace] = 1) then
    208           Dist := Distance(Loc, RW[p].City[i].Loc);
    209       if (Dist = 0) or (CorrLevel[RW[p].Government] = 0) then
     216      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
    210220        RelCorr := 0.0
    211221      else
    212222      begin
    213223        RelCorr := Dist / MaxDist;
    214         if CorrLevel[RW[p].Government] > 1 then
    215           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]);
    216226        if Built[imCourt] = 1 then
    217227          RelCorr := RelCorr / 2;
     
    224234      RelCorr := 1.0;
    225235    HappyBase := Size + HappinessBeforeLux;
    226   end
    227 end;
    228 
    229 procedure SplitTrade(Trade, TaxRate, LuxRate, Working: integer;
     236  end;
     237end;
     238
     239procedure SplitTrade(Trade, TaxRate, LuxRate, Working: Integer;
    230240  TradeProcessing: TTradeProcessing; var Corruption, Tax, Lux,
    231   Science: integer);
    232 var
    233   plus: integer;
     241  Science: Integer);
     242var
     243  plus: Integer;
    234244begin
    235245  Corruption := Trunc(Trade * TradeProcessing.RelCorr);
     
    266276end;
    267277
    268 function GetProjectCost(p, cix: integer): integer;
    269 var
    270   i: integer;
    271 begin
    272   with RW[p].City[cix] do
     278function GetProjectCost(P, cix: Integer): Integer;
     279var
     280  I: Integer;
     281begin
     282  with RW[P].City[cix] do
    273283  begin
    274284    if Project and cpImp = 0 then
    275285    begin
    276       result := RW[p].Model[Project and cpIndex].Cost; { unit project }
     286      Result := RW[P].Model[Project and cpIndex].Cost; { unit project }
    277287      if Project and cpConscripts <> 0 then
    278288      begin
    279         i := RW[p].Model[Project and cpIndex].MCost;
    280         result := result - 3 * i;
    281         if result <= 0 then
    282           result := i
     289        I := RW[P].Model[Project and cpIndex].MCost;
     290        Result := Result - 3 * I;
     291        if Result <= 0 then
     292          Result := I;
    283293      end
    284       else if RW[p].Model[Project and cpIndex].Cap[mcLine] > 0 then
     294      else if RW[P].Model[Project and cpIndex].Cap[mcLine] > 0 then
    285295        if Project0 and (not cpAuto or cpRepeat) = Project and not cpAuto or cpRepeat
    286296        then
    287           result := result shr 1
     297          Result := Result shr 1
    288298        else
    289           result := result * 2
     299          Result := Result * 2;
    290300    end
    291301    else
    292302    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)
    295305      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;
     310end;
     311
     312function GetSmallCityReport(P, cix: Integer; var CityReport: TCityReport;
     313  PCityReportEx: PCityReportEx = nil): Integer;
     314var
     315  I, uix, V21, Loc1, ForcedSupport, BaseHappiness, Control: Integer;
    306316  ProdProcessing: TProdProcessing;
    307317  TradeProcessing: TTradeProcessing;
    308318  Radius: TVicinity21Loc;
    309319  UnitReport: TUnitReport;
    310   RareOK: array [0 .. 3] of integer;
     320  RareOK: array [0 .. 3] of Integer;
    311321  TileInfo: TTileInfo;
    312322begin
    313   with RW[p].City[cix], CityReport do
     323  with RW[P].City[cix], CityReport do
    314324  begin
    315325    if HypoTiles <= 0 then
    316326      HypoTiles := Tiles;
    317327    if HypoTax < 0 then
    318       HypoTax := RW[p].TaxRate;
     328      HypoTax := RW[P].TaxRate;
    319329    if HypoLux < 0 then
    320       HypoLux := RW[p].LuxRate;
    321 
    322     if (Flags and chCaptured <> 0) or (RW[p].Government = gAnarchy) then
     330      HypoLux := RW[P].LuxRate;
     331
     332    if (Flags and chCaptured <> 0) or (RW[P].Government = gAnarchy) then
    323333    begin
    324334      Working := 0;
    325335      for V21 := 1 to 26 do
    326336        if HypoTiles and (1 shl V21) <> 0 then
    327           inc(Working); // for backward compatibility
    328 
    329       if RW[p].Government = gFundamentalism then
     337          Inc(Working); // for backward compatibility
     338
     339      if RW[P].Government = gFundamentalism then
    330340      begin
    331341        Happy := Size;
    332         Control := Size
     342        Control := Size;
    333343      end // !!! old bug, kept for compatibility
    334344      else
    335345      begin
    336346        Happy := 0;
    337         Control := 0
     347        Control := 0;
    338348      end;
    339349
     
    370380          BaseHappiness := Size;
    371381      end;
    372       for i := 0 to nWonder - 1 do
    373         if Built[i] = 1 then
     382      for I := 0 to nWonder - 1 do
     383        if Built[I] = 1 then
    374384        begin
    375           inc(Happy);
    376           inc(BaseHappiness, 2)
     385          Inc(Happy);
     386          Inc(BaseHappiness, 2);
    377387        end;
    378388      if Built[imTemple] = 1 then
    379389      begin
    380         inc(Happy);
    381         inc(BaseHappiness, 2)
     390        Inc(Happy);
     391        Inc(BaseHappiness, 2);
    382392      end;
    383393      if Built[imCathedral] = 1 then
    384394      begin
    385         inc(Happy, 2);
    386         inc(BaseHappiness, 4);
    387         if GWonder[woBach].EffectiveOwner = p then
     395        Inc(Happy, 2);
     396        Inc(BaseHappiness, 4);
     397        if GWonder[woBach].EffectiveOwner = P then
    388398        begin
    389           inc(Happy);
    390           inc(BaseHappiness, 2)
     399          Inc(Happy);
     400          Inc(BaseHappiness, 2);
    391401        end;
    392402      end;
    393403      if Built[imTheater] > 0 then
    394404      begin
    395         inc(Happy, 2);
    396         inc(BaseHappiness, 4)
     405        Inc(Happy, 2);
     406        Inc(BaseHappiness, 4);
    397407      end;
    398408
    399409      // calculate unit support
    400 {$IFOPT O-}assert(InvalidTreatyMap = 0); {$ENDIF}
     410{$IFOPT O-}Assert(InvalidTreatyMap = 0); {$ENDIF}
    401411      Support := 0;
    402412      ForcedSupport := 0;
    403413      Eaten := Size * 2;
    404414      Deployed := 0;
    405       for uix := 0 to RW[p].nUn - 1 do
    406         with RW[p].Un[uix] do
     415      for uix := 0 to RW[P].nUn - 1 do
     416        with RW[P].Un[uix] do
    407417          if (Loc >= 0) and (Home = cix) then
    408418          begin
    409             GetUnitReport(p, uix, UnitReport);
    410             inc(Eaten, UnitReport.FoodSupport);
     419            GetUnitReport(P, uix, UnitReport);
     420            Inc(Eaten, UnitReport.FoodSupport);
    411421            if UnitReport.ReportFlags and urfAlwaysSupport <> 0 then
    412               inc(ForcedSupport, UnitReport.ProdSupport)
     422              Inc(ForcedSupport, UnitReport.ProdSupport)
    413423            else
    414               inc(Support, UnitReport.ProdSupport);
     424              Inc(Support, UnitReport.ProdSupport);
    415425            if UnitReport.ReportFlags and urfDeployed <> 0 then
    416               inc(Deployed);
     426              Inc(Deployed);
    417427          end;
    418428      if Deployed >= Happy then
    419429        Happy := 0
    420430      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);
    423433      if Support < 0 then
    424434        Support := 0;
    425       inc(Support, ForcedSupport);
     435      Inc(Support, ForcedSupport);
    426436
    427437      { control }
    428       case RW[p].Government of
     438      case RW[P].Government of
    429439        gDespotism:
    430           for uix := 0 to RW[p].nUn - 1 do
    431             if (RW[p].Un[uix].Loc = Loc) and
    432               (RW[p].Model[RW[p].Un[uix].mix].Kind = mkSpecial_TownGuard) then
     440          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
    433443            begin
    434               inc(Happy);
    435               inc(Control, 2)
     444              Inc(Happy);
     445              Inc(Control, 2);
    436446            end;
    437447        gFundamentalism:
     
    439449            BaseHappiness := 0; // done by control
    440450            Happy := Size;
    441             Control := Size
     451            Control := Size;
    442452          end;
    443453      end;
    444454
    445455      // 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 *
    448458        Deployed, TradeProcessing);
    449459
     
    462472          // HypoTiles go beyond map border!
    463473          begin
    464             result := eInvalid;
    465             exit
     474            Result := eInvalid;
     475            Exit;
    466476          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);
    471481          if (RealMap[Loc1] and fModern <> 0) and
    472             (RW[p].Tech[adMassProduction] >= tsApplicable) then
    473             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);
    475485        end;
    476486      if Built[imAlgae] = 1 then
    477         inc(FoodRep, 12);
     487        Inc(FoodRep, 12);
    478488
    479489      if PCityReportEx <> nil then
     
    500510    end;
    501511  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;
     513end;
     514
     515function GetCityReport(P, cix: Integer; var CityReport: TCityReport): Integer;
     516begin
     517  Result := GetSmallCityReport(P, cix, CityReport);
     518  CityReport.Storage := StorageSize[Difficulty[P]];
     519  CityReport.ProdCost := GetProjectCost(P, cix);
     520end;
     521
     522function GetCityReportNew(P, cix: Integer;
     523  var CityReportNew: TCityReportNew): Integer;
    514524var
    515525  CityReport: TCityReport;
     
    521531    CityReport.HypoTax := HypoTaxRate;
    522532    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;
    525535    MaterialSupport := CityReport.Support;
    526     ProjectCost := GetProjectCost(p, cix);
    527     Storage := StorageSize[Difficulty[p]];
     536    ProjectCost := GetProjectCost(P, cix);
     537    Storage := StorageSize[Difficulty[P]];
    528538    Deployed := CityReport.Deployed;
    529539    Morale := CityReportEx.BaseHappiness;
    530540    CollectedControl := CityReportEx.BaseControl +
    531       (RW[p].City[cix].Size - CityReport.Working) * 2;
     541      (RW[P].City[cix].Size - CityReport.Working) * 2;
    532542    CollectedFood := CityReport.FoodRep;
    533543    CollectedMaterial := CityReportEx.Material;
     
    541551    Luxury := CityReport.Lux;
    542552    FoodSurplus := CityReport.FoodRep - CityReport.Eaten;
    543     HappinessBalance := Morale + Luxury + CollectedControl - RW[p].City[cix]
     553    HappinessBalance := Morale + Luxury + CollectedControl - RW[P].City[cix]
    544554      .Size - 2 * Deployed;
    545555  end;
     
    550560  ____________________________________________________________________
    551561}
    552 procedure NextBest(p, cix: integer; var SelectedLoc, SelectedV21: integer);
     562procedure NextBest(P, cix: Integer; var SelectedLoc, SelectedV21: Integer);
    553563{ best tile unused but available by city cix }
    554564var
    555   Resources, Most, Loc1, p1, V21: integer;
     565  Resources, Most, Loc1, p1, V21: Integer;
    556566  TileInfo: TTileInfo;
    557567  Radius: TVicinity21Loc;
    558568begin
    559 {$IFOPT O-}assert(1 shl p and InvalidTreatyMap = 0); {$ENDIF}
     569{$IFOPT O-}Assert(1 shl P and InvalidTreatyMap = 0); {$ENDIF}
    560570  Most := 0;
    561571  SelectedLoc := -1;
    562572  SelectedV21 := -1;
    563   with RW[p].City[cix] do
     573  with RW[P].City[cix] do
    564574  begin
    565575    V21_to_Loc(Loc, Radius);
     
    570580      begin
    571581        p1 := RealMap[Loc1] shr 27;
    572         if ((p1 = nPl) or (p1 = p) or (RW[p].Treaty[p1] < trPeace)) and
    573           ((ZoCMap[Loc1] = 0) or (Occupant[Loc1] = p) or
    574           (RW[p].Treaty[Occupant[Loc1]] = trAlliance)) then
     582        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
    575585        begin
    576           GetTileInfo(p, cix, Loc1, TileInfo);
     586          GetTileInfo(P, cix, Loc1, TileInfo);
    577587          Resources := TileInfo.Food shl 16 + TileInfo.Prod shl 8 +
    578588            TileInfo.Trade;
     
    582592            SelectedLoc := Loc1;
    583593            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;
     600end;
     601
     602procedure NextWorst(P, cix: Integer; var SelectedLoc, SelectedV21: Integer);
    593603{ worst tile used by city cix }
    594604var
    595   Resources, Least, Loc1, V21: integer;
     605  Resources, Least, Loc1, V21: Integer;
    596606  Radius: TVicinity21Loc;
    597607  TileInfo: TTileInfo;
     
    600610  SelectedLoc := -1;
    601611  SelectedV21 := -1;
    602   with RW[p].City[cix] do
     612  with RW[P].City[cix] do
    603613  begin
    604614    V21_to_Loc(Loc, Radius);
     
    609619        if (Loc1 >= 0) and (Loc1 < MapSize) and (1 shl V21 and Tiles <> 0) then
    610620        begin
    611           GetTileInfo(p, cix, Loc1, TileInfo);
     621          GetTileInfo(P, cix, Loc1, TileInfo);
    612622          Resources := TileInfo.Food shl 16 + TileInfo.Prod shl 8 +
    613623            TileInfo.Trade;
     
    617627            SelectedLoc := Loc1;
    618628            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;
     634end;
     635
     636function NextPoll(P, cix: Integer): Integer;
     637var
     638  Resources, Best, dx, dy, Loc1, Dist, BestDist, V21, pTerr: Integer;
    629639  Radius: TVicinity21Loc;
    630640  TileInfo: TTileInfo;
    631641begin
    632642  BestDist := MaxInt;
    633 {$IFOPT O-}assert(1 shl p and InvalidTreatyMap = 0); {$ENDIF}
     643{$IFOPT O-}Assert(1 shl P and InvalidTreatyMap = 0); {$ENDIF}
    634644  Best := 0;
    635   result := -1;
    636   with RW[p].City[cix] do
     645  Result := -1;
     646  with RW[P].City[cix] do
    637647  begin
    638648    V21_to_Loc(Loc, Radius);
     
    646656        begin
    647657          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)
    649659          then
    650660          begin
    651             GetTileInfo(p, cix, Loc1, TileInfo);
     661            GetTileInfo(P, cix, Loc1, TileInfo);
    652662            Resources := TileInfo.Prod shl 16 + TileInfo.Trade shl 8 +
    653663              TileInfo.Food;
     
    659669            then
    660670            begin
    661               result := Loc1;
     671              Result := Loc1;
    662672              Best := Resources;
    663673              BestDist := Dist;
     
    669679end;
    670680
    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 then
    678     with RW[p].City[cix] do
    679     begin
    680       assert(1 shl V21 and Tiles = 0);
     681function AddBestCityTile(P, cix: Integer): Boolean;
     682var
     683  TileLoc, V21: Integer;
     684begin
     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);
    681691      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;
     694end;
     695
     696procedure CityGrowth(P, cix: Integer);
     697var
     698  TileLoc, V21: Integer;
    689699  AltCityReport: TCityReport;
    690700begin
    691   with RW[p].City[cix] do
     701  with RW[P].City[cix] do
    692702  begin
    693     inc(Size);
    694     NextBest(p, cix, TileLoc, V21);
     703    Inc(Size);
     704    NextBest(P, cix, TileLoc, V21);
    695705    if TileLoc >= 0 then
    696706    begin { test whether exploitation of tile would lead to disorder }
     
    698708      AltCityReport.HypoTax := -1;
    699709      AltCityReport.HypoLux := -1;
    700       GetSmallCityReport(p, cix, AltCityReport);
     710      GetSmallCityReport(P, cix, AltCityReport);
    701711      if AltCityReport.Working - AltCityReport.Happy <= Size shr 1 then
    702712      // !!! change to new style disorder
    703713      begin { no disorder -- exploit tile }
    704         assert(1 shl V21 and Tiles = 0);
     714        Assert(1 shl V21 and Tiles = 0);
    705715        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;
     720end;
     721
     722procedure CityShrink(P, cix: Integer);
     723var
     724  TileLoc, V21, Working: Integer;
    715725  AltCityReport: TCityReport;
    716726begin
    717   with RW[p].City[cix] do
     727  with RW[P].City[cix] do
    718728  begin
    719729    Working := 0;
    720730    for V21 := 1 to 26 do
    721731      if Tiles and (1 shl V21) <> 0 then
    722         inc(Working);
    723     dec(Size);
    724     if Food > StorageSize[Difficulty[p]] then
    725       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);
    727737    if Working > Size then
    728738    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);
    730740      Tiles := Tiles and not(1 shl V21);
    731       UsedByCity[TileLoc] := -1
     741      UsedByCity[TileLoc] := -1;
    732742    end
    733743    else { test whether exploitation of tile would lead to disorder }
     
    736746      AltCityReport.HypoTax := -1;
    737747      AltCityReport.HypoLux := -1;
    738       GetSmallCityReport(p, cix, AltCityReport);
     748      GetSmallCityReport(P, cix, AltCityReport);
    739749      if AltCityReport.Working - AltCityReport.Happy > Size shr 1 then
    740750      // !!! change to new style disorder
    741751      begin { disorder -- don't exploit tile }
    742         assert(1 shl V21 and Tiles <> 0);
     752        Assert(1 shl V21 and Tiles <> 0);
    743753        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] do
     754        UsedByCity[TileLoc] := -1;
     755      end;
     756    end;
     757  end;
     758end;
     759
     760procedure Pollute(P, cix: Integer);
     761var
     762  PollutionLoc: Integer;
     763begin
     764  with RW[P].City[cix] do
    755765  begin
    756766    Pollution := Pollution - MaxPollution;
    757     PollutionLoc := NextPoll(p, cix);
     767    PollutionLoc := NextPoll(P, cix);
    758768    if PollutionLoc >= 0 then
    759769    begin
    760       inc(Flags, chPollution);
     770      Inc(Flags, chPollution);
    761771      RealMap[PollutionLoc] := RealMap[PollutionLoc] or fPoll;
    762     end
     772    end;
    763773  end;
    764774end;
     
    768778  ____________________________________________________________________
    769779}
    770 procedure PayCityMaintenance(p, cix: integer);
    771 var
    772   i: integer;
    773 begin
    774   with RW[p], City[cix] do
    775     for i := nWonder to nImp - 1 do
    776       if (Built[i] > 0) and (Project0 and (cpImp or cpIndex) <> (cpImp or i))
     780procedure PayCityMaintenance(P, cix: Integer);
     781var
     782  I: Integer;
     783begin
     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))
    777787      then // don't pay maintenance when just completed
    778788      begin
    779         dec(Money, Imp[i].Maint);
     789        Dec(Money, Imp[I].Maint);
    780790        if Money < 0 then
    781791        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 then
     792          Inc(Money, Imp[I].Cost * BuildCostMod[Difficulty[P]] div 12);
     793          Built[I] := 0;
     794          if Imp[I].Kind <> ikCommon then
    785795          begin
    786             assert(i <> imSpacePort);
     796            Assert(I <> imSpacePort);
    787797            // never sell automatically! (solution: no maintenance)
    788             NatBuilt[i] := 0;
    789             if i = imGrWall then
    790               GrWallContinent[p] := -1;
     798            NatBuilt[I] := 0;
     799            if I = imGrWall then
     800              GrWallContinent[P] := -1;
    791801          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;
     805end;
     806
     807procedure CollectCityResources(P, cix: Integer);
     808var
     809  CityStorage, CityProjectCost: Integer;
    800810  CityReport: TCityReportNew;
    801   Disorder: boolean;
    802 begin
    803   with RW[p], City[cix], CityReport do
     811  Disorder: Boolean;
     812begin
     813  with RW[P], City[cix], CityReport do
    804814    if Flags and chCaptured <> 0 then
    805815    begin
    806816      Flags := Flags and not chDisorder;
    807       dec(Flags, $10000);
     817      Dec(Flags, $10000);
    808818      if Flags and chCaptured = 0 then
    809819        Flags := Flags or chAfterCapture;
     
    816826      HypoTaxRate := -1;
    817827      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);
    821831
    822832      Disorder := (HappinessBalance < 0);
     
    830840      if not Disorder and ((Government = gFuture) or (Size >= NeedAqueductSize)
    831841        and (FoodSurplus < 2)) and (FoodSurplus > 0) then
    832         inc(Money, FoodSurplus)
     842        Inc(Money, FoodSurplus)
    833843      else if not(Disorder and (FoodSurplus > 0)) then
    834844      begin { calculate new food storage }
     
    839849          (Project and (cpImp + cpIndex) <> cpImp + imAqueduct) and
    840850          (Project and (cpImp + cpIndex) <> cpImp + imSewer) and
    841           not CanCityGrow(p, cix) then
    842           inc(Flags, chNoGrowthWarning);
     851          not CanCityGrow(P, cix) then
     852          Inc(Flags, chNoGrowthWarning);
    843853      end;
    844854
    845855      if Prod > CityProjectCost then
    846856      begin
    847         inc(Money, Prod - CityProjectCost);
    848         Prod := CityProjectCost
     857        Inc(Money, Prod - CityProjectCost);
     858        Prod := CityProjectCost;
    849859      end;
    850860      if Production < 0 then
     
    852862      else if not Disorder and (Flags and chProductionSabotaged = 0) then
    853863        if Project and (cpImp + cpIndex) = cpImp + imTrGoods then
    854           inc(Money, Production)
     864          Inc(Money, Production)
    855865        else
    856           inc(Prod, Production);
     866          Inc(Prod, Production);
    857867
    858868      if not Disorder then
    859869      begin
    860870        { sum research points and taxes }
    861         inc(Research, Science);
    862         inc(Money, Tax);
     871        Inc(Research, Science);
     872        Inc(Money, Tax);
    863873        Pollution := Pollution + AddPollution;
    864874      end;
     
    866876end;
    867877
    868 function CityTurn(p, cix: integer): boolean;
     878function CityTurn(P, cix: Integer): Boolean;
    869879// return value: whether city keeps existing
    870880var
    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] do
     881  I, uix, cix2, p1, SizeMod, CityStorage, CityProjectCost, NewImp, Det,
     882    TestDet: Integer;
     883  LackOfMaterial, CheckGrow, DoProd, IsActive: Boolean;
     884begin
     885  with RW[P], City[cix] do
    876886  begin
    877887    SizeMod := 0;
    878     CityStorage := StorageSize[Difficulty[p]];
    879     CityProjectCost := GetProjectCost(p, cix);
     888    CityStorage := StorageSize[Difficulty[P]];
     889    CityProjectCost := GetProjectCost(P, cix);
    880890
    881891    LackOfMaterial := Flags and chUnitLost <> 0;
     
    887897    if CheckGrow and (GTestFlags and tfImmGrow <> 0) then { fast growth }
    888898    begin
    889       if CanCityGrow(p, cix) then
    890         inc(SizeMod)
     899      if CanCityGrow(P, cix) then
     900        Inc(SizeMod);
    891901    end
    892902    else if CheckGrow and (Food >= CityStorage) then { normal growth }
    893903    begin
    894       if CanCityGrow(p, cix) then
     904      if CanCityGrow(P, cix) then
    895905      begin
    896906        if Built[imGranary] = 1 then
    897           dec(Food, CityStorage shr 1)
     907          Dec(Food, CityStorage shr 1)
    898908        else
    899           dec(Food, CityStorage);
    900         inc(SizeMod)
    901       end
     909          Dec(Food, CityStorage);
     910        Inc(SizeMod);
     911      end;
    902912    end
    903913    else if Food < 0 then { famine }
     
    906916      // check if settlers or conscripts there to disband
    907917      uix := -1;
    908       for i := 0 to nUn - 1 do
    909         if (Un[i].Loc >= 0) and (Un[i].Home = cix) and
    910           ((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)
    911921          { and (GWonder[woFreeSettlers].EffectiveOwner<>p) }
    912           or (Un[i].Flags and unConscripts <> 0)) and
    913           ((uix = -1) or (Model[Un[i].mix].Cost < Model[Un[uix].mix].Cost) or
    914           (Model[Un[i].mix].Cost = Model[Un[uix].mix].Cost) and
    915           (Un[i].Exp < Un[uix].Exp)) then
    916           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;
    917927
    918928      if uix >= 0 then
    919929      begin
    920         RemoveUnit_UpdateMap(p, uix);
    921         inc(Flags, chUnitLost);
     930        RemoveUnit_UpdateMap(P, uix);
     931        Inc(Flags, chUnitLost);
    922932      end
    923933      else
    924934      begin
    925         dec(SizeMod);
    926         inc(Flags, chPopDecrease)
     935        Dec(SizeMod);
     936        Inc(Flags, chPopDecrease);
    927937      end
    928938    end;
     
    936946        uix := -1;
    937947        Det := MaxInt;
    938         for i := 0 to nUn - 1 do
    939           if (Un[i].Loc >= 0) and (Un[i].Home = cix) then
    940             with Model[Un[i].mix] do
     948        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
    941951            begin
    942952              if Kind = mkSpecial_TownGuard then
    943                 TestDet := Un[i].Health + Un[i].Exp shl 8
     953                TestDet := Un[I].Health + Un[I].Exp shl 8
    944954                // disband townguards first
    945955              else
    946956              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;
    948958                // value of unit
    949959                if Flags and mdDoubleSupport <> 0 then
     
    953963              if TestDet < Det then
    954964              begin
    955                 uix := i;
    956                 Det := TestDet
     965                uix := I;
     966                Det := TestDet;
    957967              end;
    958968            end;
    959969        if uix >= 0 then
    960970        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;
    965975    end;
    966976
     
    974984      (GWonder[Project and cpIndex].CityID <> WonderNotBuiltYet) then
    975985    begin
    976       inc(Flags, chOldWonder);
    977       DoProd := false;
     986      Inc(Flags, chOldWonder);
     987      DoProd := False;
    978988    end;
    979989
     
    985995      (Project and cpConscripts <> 0))) then
    986996    begin
    987       inc(Flags, chNoSettlerProd);
    988       DoProd := false;
     997      Inc(Flags, chNoSettlerProd);
     998      DoProd := False;
    989999    end;
    9901000
    9911001    if DoProd then
    9921002    begin { project complete }
    993       dec(Prod, CityProjectCost);
     1003      Dec(Prod, CityProjectCost);
    9941004      if Project and cpImp = 0 then { produce unit }
    9951005      begin
    9961006        if nUn < numax then
    9971007        begin
    998           CreateUnit(p, Project and cpIndex);
     1008          CreateUnit(P, Project and cpIndex);
    9991009          Un[nUn - 1].Loc := Loc;
    10001010          with Un[nUn - 1] do
     
    10081018              Exp := ExpCost * 2; { vet }
    10091019            if Project and cpConscripts <> 0 then
    1010               Flags := Flags or unConscripts
     1020              Flags := Flags or unConscripts;
    10111021          end;
    1012           PlaceUnit(p, nUn - 1);
     1022          PlaceUnit(P, nUn - 1);
    10131023          UpdateUnitMap(Loc);
    10141024          if Model[Project and cpIndex].Kind = mkSettler then
    1015             dec(SizeMod, 2) { settler produced - city shrink }
     1025            Dec(SizeMod, 2) { settler produced - city shrink }
    10161026          else if (Model[Project and cpIndex].Kind = mkSlaves) or
    10171027            (Project and cpConscripts <> 0) then
    1018             dec(SizeMod); { slaves/conscripts produced - city shrink }
     1028            Dec(SizeMod); { slaves/conscripts produced - city shrink }
    10191029        end;
    10201030        Project0 := Project or cpRepeat or cpCompleted;
     
    10221032      else if Imp[Project and cpIndex].Kind = ikShipPart then
    10231033      begin { produce ship parts }
    1024         inc(GShip[p].Parts[Project and cpIndex - imShipComp]);
     1034        Inc(GShip[P].Parts[Project and cpIndex - imShipComp]);
    10251035        Project0 := Project or cpCompleted;
    10261036      end
     
    10281038      begin
    10291039        NewImp := Project and cpIndex;
    1030         inc(Money, Prod); { change rest to money }
     1040        Inc(Money, Prod); { change rest to money }
    10311041        Project0 := Project or cpCompleted;
    10321042        Project := cpImp + imTrGoods;
     
    10351045        if Imp[NewImp].Kind in [ikNatLocal, ikNatGlobal] then
    10361046        begin // nat. project
    1037           for i := 0 to nCity - 1 do
    1038             if (City[i].Loc >= 0) and (City[i].Built[NewImp] = 1) then
     1047          for I := 0 to nCity - 1 do
     1048            if (City[I].Loc >= 0) and (City[I].Built[NewImp] = 1) then
    10391049            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;
    10421052            end;
    10431053          NatBuilt[NewImp] := 1;
     
    10461056          case NewImp of
    10471057            imGrWall:
    1048               GrWallContinent[p] := Continent[Loc];
     1058              GrWallContinent[P] := Continent[Loc];
    10491059          end;
    10501060        end;
     
    10531063        begin // wonder
    10541064          GWonder[NewImp].CityID := ID;
    1055           GWonder[NewImp].EffectiveOwner := p;
     1065          GWonder[NewImp].EffectiveOwner := P;
    10561066          CheckExpiration(NewImp);
    10571067
     
    10601070            woEiffel:
    10611071              begin // reactivate wonders
    1062                 for i := 0 to nWonder - 1 do
    1063                   if Imp[i].Expiration >= 0 then
     1072                for I := 0 to nWonder - 1 do
     1073                  if Imp[I].Expiration >= 0 then
    10641074                    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)
    10661076                      then
    1067                         GWonder[i].EffectiveOwner := p
     1077                        GWonder[I].EffectiveOwner := P;
    10681078              end;
    10691079            woLighthouse:
    1070               CheckSpecialModels(p, preLighthouse);
     1080              CheckSpecialModels(P, preLighthouse);
    10711081            woLeo:
    10721082              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);
    10761086              end;
    10771087            woPyramids:
    1078               CheckSpecialModels(p, preBuilder);
     1088              CheckSpecialModels(P, preBuilder);
    10791089            woMir:
    10801090              begin
    10811091                for p1 := 0 to nPl - 1 do
    1082                   if (p1 <> p) and (1 shl p1 and GAlive <> 0) then
     1092                  if (p1 <> P) and (1 shl p1 and GAlive <> 0) then
    10831093                  begin
    1084                     if RW[p].Treaty[p1] = trNoContact then
    1085                       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);
    10881098                  end;
    1089               end
     1099              end;
    10901100          end;
    10911101        end;
    10921102
    1093         for i := 0 to nImpReplacement - 1 do // sell obsolete buildings
    1094           if (ImpReplacement[i].NewImp = NewImp) and
    1095             (Built[ImpReplacement[i].OldImp] > 0) then
     1103        for I := 0 to nImpReplacement - 1 do // sell obsolete buildings
     1104          if (ImpReplacement[I].NewImp = NewImp) and
     1105            (Built[ImpReplacement[I].OldImp] > 0) then
    10961106          begin
    1097             inc(RW[p].Money, Imp[ImpReplacement[i].OldImp].Cost * BuildCostMod
    1098               [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;
    11001110          end;
    11011111
    11021112        if NewImp in [imPower, imHydro, imNuclear] then
    1103           for i := 0 to nImp - 1 do
    1104             if (i <> NewImp) and (i in [imPower, imHydro, imNuclear]) and
    1105               (Built[i] > 0) then
     1113          for I := 0 to nImp - 1 do
     1114            if (I <> NewImp) and (I in [imPower, imHydro, imNuclear]) and
     1115              (Built[I] > 0) then
    11061116            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]
    11081118                ] div 12);
    1109               Built[i] := 0;
     1119              Built[I] := 0;
    11101120            end;
    11111121
     
    11131123      end;
    11141124      Prod0 := Prod;
    1115       inc(Flags, chProduction)
     1125      Inc(Flags, chProduction);
    11161126    end
    11171127    else
     
    11251135    if SizeMod > 0 then
    11261136    begin
    1127       CityGrowth(p, cix);
    1128       inc(Flags, chPopIncrease);
    1129     end;
    1130     result := Size + SizeMod >= 2;
    1131     if result then
     1137      CityGrowth(P, cix);
     1138      Inc(Flags, chPopIncrease);
     1139    end;
     1140    Result := Size + SizeMod >= 2;
     1141    if Result then
    11321142      while SizeMod < 0 do
    11331143      begin
    1134         CityShrink(p, cix);
    1135         inc(SizeMod)
    1136       end;
    1137   end
    1138 end; // CityTurn
     1144        CityShrink(P, cix);
     1145        Inc(SizeMod);
     1146      end;
     1147  end;
     1148end;
    11391149
    11401150{
     
    11421152  ____________________________________________________________________
    11431153}
    1144 function SetCityTiles(p, cix, NewTiles: integer;
    1145   TestOnly: boolean = false): integer;
    1146 var
    1147   V21, Working, ChangeTiles, AddTiles, Loc1: integer;
     1154function SetCityTiles(P, cix, NewTiles: Integer;
     1155  TestOnly: Boolean = False): Integer;
     1156var
     1157  V21, Working, ChangeTiles, AddTiles, Loc1: Integer;
    11481158  CityAreaInfo: TCityAreaInfo;
    11491159  Radius: TVicinity21Loc;
    11501160begin
    1151   with RW[p].City[cix] do
     1161  with RW[P].City[cix] do
    11521162  begin
    1153     ChangeTiles := NewTiles xor integer(Tiles);
     1163    ChangeTiles := NewTiles xor Integer(Tiles);
    11541164    AddTiles := NewTiles and not Tiles;
    11551165    if Mode = moPlaying then
     
    11571167      if NewTiles and not $67F7F76 <> 0 then
    11581168      begin
    1159         result := eInvalid;
    1160         exit
     1169        Result := eInvalid;
     1170        Exit
    11611171      end; // invalid tile index included
    11621172      if NewTiles and (1 shl 13) = 0 then
    11631173      begin
    1164         result := eViolation;
    1165         exit
     1174        Result := eViolation;
     1175        Exit
    11661176      end; // city tile must be exploited
    11671177      if ChangeTiles = 0 then
    11681178      begin
    1169         result := eNotChanged;
    1170         exit
     1179        Result := eNotChanged;
     1180        Exit
    11711181      end;
    11721182      if AddTiles <> 0 then
    11731183      begin
    11741184        // check if new tiles possible
    1175         GetCityAreaInfo(p, Loc, CityAreaInfo);
     1185        GetCityAreaInfo(P, Loc, CityAreaInfo);
    11761186        for V21 := 1 to 26 do
    11771187          if AddTiles and (1 shl V21) <> 0 then
    11781188            if CityAreaInfo.Available[V21] <> faAvailable then
    11791189            begin
    1180               result := eTileNotAvailable;
    1181               exit
     1190              Result := eTileNotAvailable;
     1191              Exit;
    11821192            end;
    11831193        // not more tiles than inhabitants
     
    11851195        for V21 := 1 to 26 do
    11861196          if NewTiles and (1 shl V21) <> 0 then
    1187             inc(Working);
     1197            Inc(Working);
    11881198        if Working > Size then
    11891199        begin
    1190           result := eNoWorkerAvailable;
    1191           exit
    1192         end;
    1193       end;
    1194     end;
    1195     result := eOk;
     1200          Result := eNoWorkerAvailable;
     1201          Exit;
     1202        end;
     1203      end;
     1204    end;
     1205    Result := eOk;
    11961206    if not TestOnly then
    11971207    begin
     
    12011211        begin
    12021212          Loc1 := Radius[V21];
    1203           assert((Loc1 >= 0) and (Loc1 < MapSize));
     1213          Assert((Loc1 >= 0) and (Loc1 < MapSize));
    12041214          if NewTiles and (1 shl V21) <> 0 then
    12051215            UsedByCity[Loc1] := Loc // employ tile
    12061216          else if UsedByCity[Loc1] <> Loc then
    1207             assert(Mode < moPlaying)
     1217            Assert(Mode < moPlaying)
    12081218            // should only happen during loading, because of wrong sSetCityTiles command order
    12091219          else
    1210             UsedByCity[Loc1] := -1 // unemploy tile
    1211         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;
     1225end;
     1226
     1227procedure GetCityTileAdvice(P, cix: Integer; var Advice: TCityTileAdviceData);
    12181228const
    12191229  oFood = 0;
     
    12231233type
    12241234  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;
     1241var
     1242  I, V21, Loc1, nHierarchy, iH, iT, iH_Switch, MinWorking, MaxWorking,
    12291243    WantedProd, MinFood, MinProd, count, Take, MaxTake, AreaSize, FormulaCode,
    12301244    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;
    12371251  TileInfo, BaseTileInfo: TTileInfo;
    12381252  Radius, Radius1: TVicinity21Loc;
     
    12411255  CityAreaInfo: TCityAreaInfo;
    12421256  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;
     1260begin
     1261  if (RW[P].Government = gAnarchy) or (RW[P].City[cix].Flags and chCaptured <> 0)
    12481262  then
    12491263  begin
     
    12511265    Advice.Tiles := 1 shl CityOwnTile;
    12521266    Advice.CityReport.HypoTiles := 1 shl CityOwnTile;
    1253     exit;
    1254   end;
    1255 
    1256   for i := oFood to oScience do
     1267    Exit;
     1268  end;
     1269
     1270  for I := oFood to oScience do
    12571271  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;
    12601274    if FormulaCode and $40 <> 0 then
    1261       ValueFormula_Weight[i] := (FormulaCode and $0F) *
     1275      ValueFormula_Weight[I] := (FormulaCode and $0F) *
    12621276        (1 shl (FormulaCode and $30 shr 4)) / 16
    12631277    else
    1264       ValueFormula_Weight[i] := (FormulaCode and $0F) *
     1278      ValueFormula_Weight[I] := (FormulaCode and $0F) *
    12651279        (1 shl (FormulaCode and $30 shr 4));
    12661280  end;
     
    12691283  TestReport.HypoTax := -1;
    12701284  TestReport.HypoLux := -1;
    1271   GetSmallCityReport(p, cix, TestReport, @CityReportEx);
    1272   with RW[p].City[cix] do
     1285  GetSmallCityReport(P, cix, TestReport, @CityReportEx);
     1286  with RW[P].City[cix] do
    12731287  begin
    12741288    V21_to_Loc(Loc, Radius);
    1275     FoodToTax := RW[p].Government = gFuture;
     1289    FoodToTax := RW[P].Government = gFuture;
    12761290    ProdToTax := Project and (cpImp + cpIndex) = cpImp + imTrGoods;
    1277     FoodWasted := not FoodToTax and (Food = StorageSize[Difficulty[p]]) and
    1278       not CanCityGrow(p, cix);
     1291    FoodWasted := not FoodToTax and (Food = StorageSize[Difficulty[P]]) and
     1292      not CanCityGrow(P, cix);
    12791293
    12801294    // sub criteria
     
    12861300          V21 xor $15;
    12871301    end;
    1288     for cix1 := 0 to RW[p].nCity - 1 do
     1302    for cix1 := 0 to RW[P].nCity - 1 do
    12891303      if cix1 <> cix then
    12901304      begin
    1291         Loc1 := RW[p].City[cix1].Loc;
     1305        Loc1 := RW[P].City[cix1].Loc;
    12921306        if Loc1 >= 0 then
    12931307        begin
     
    13021316              begin
    13031317                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);
    13051319              end;
    13061320            end;
     
    13091323      end;
    13101324
    1311     GetCityAreaInfo(p, Loc, CityAreaInfo);
     1325    GetCityAreaInfo(P, Loc, CityAreaInfo);
    13121326    AreaSize := 0;
    13131327    for V21 := 1 to 26 do
    13141328      if CityAreaInfo.Available[V21] = faAvailable then
    1315         inc(AreaSize);
    1316 
    1317     if RW[p].Government = gFundamentalism then
     1329        Inc(AreaSize);
     1330
     1331    if RW[P].Government = gFundamentalism then
    13181332    begin
    13191333      MinWorking := Size;
     
    13251339      if MinWorking > Size then
    13261340        MinWorking := Size;
    1327       if (RW[p].LuxRate = 0) and not CityReportEx.TradeProcessing.FlexibleLuxury
     1341      if (RW[P].LuxRate = 0) and not CityReportEx.TradeProcessing.FlexibleLuxury
    13281342      then
    13291343        MaxWorking := MinWorking
     
    13621376        Loc1 := Radius[V21];
    13631377        if (Loc1 >= 0) and (Loc1 < MapSize) and
    1364           (RealMap[Loc1] and fModern = cardinal(NeedRare)) then
     1378          (RealMap[Loc1] and fModern = Cardinal(NeedRare)) then
    13651379          RareTiles := RareTiles or (1 shl V21);
    1366       end
     1380      end;
    13671381    end;
    13681382
     
    13741388      begin
    13751389        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);
    13781392        if V21 = CityOwnTile then
    13791393          BaseTileInfo := TileInfo
     
    13911405              (TileInfo.Trade = Hierarchy[iH, iT].Trade) and
    13921406              (SubCriterion[V21] >= SubCriterion[Hierarchy[iH, iT].V21])) do
    1393               inc(iT);
     1407              Inc(iT);
    13941408            if (iT = nTile[iH]) // new worst tile in this hierarchy
    13951409              or ((TileInfo.Food >= Hierarchy[iH, iT].Food)
     
    13971411              and (TileInfo.Prod >= Hierarchy[iH, iT].Prod) and
    13981412              (TileInfo.Trade >= Hierarchy[iH, iT].Trade)) then
    1399               break; // insert position found!
    1400             inc(iH);
     1413              Break; // insert position found!
     1414            Inc(iH);
    14011415          end;
    14021416          if iH = nHierarchy then
    14031417          begin // need to start new hierarchy
    14041418            nTile[iH] := 0;
    1405             inc(nHierarchy);
     1419            Inc(nHierarchy);
    14061420            iT := 0;
    14071421          end;
    1408           move(Hierarchy[iH, iT], Hierarchy[iH, iT + 1],
     1422          Move(Hierarchy[iH, iT], Hierarchy[iH, iT + 1],
    14091423            (nTile[iH] - iT) * SizeOf(TTileData));
    1410           inc(nTile[iH]);
     1424          Inc(nTile[iH]);
    14111425          Hierarchy[iH, iT].V21 := V21;
    14121426          Hierarchy[iH, iT].Food := TileInfo.Food;
     
    14241438        begin
    14251439          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);
    14281442          if iH = nHierarchy then
    14291443          begin // need to start new hierarchy
    14301444            nTile[iH] := 0;
    1431             inc(nHierarchy);
     1445            Inc(nHierarchy);
    14321446            iT := 0;
    14331447          end
    14341448          else
    14351449            iT := nTile[iH];
    1436           inc(nTile[iH]);
     1450          Inc(nTile[iH]);
    14371451          Hierarchy[iH, iT].V21 := V21;
    14381452          Hierarchy[iH, iT].Food := TileInfo.Food; // = 0
     
    14431457    end;
    14441458    if Built[imAlgae] > 0 then
    1445       inc(BaseTileInfo.Food, 12);
     1459      Inc(BaseTileInfo.Food, 12);
    14461460
    14471461    // step 2: summarize resources
    14481462    for iH := 0 to nHierarchy - 1 do
    14491463    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));
    14511465      Hierarchy[iH, 0].Food := 0;
    14521466      Hierarchy[iH, 0].Prod := 0;
     
    14561470      for iT := 1 to nTile[iH] do
    14571471      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);
    14621476        Hierarchy[iH, iT].V21 := 1 shl Hierarchy[iH, iT].V21 +
    14631477          Hierarchy[iH, iT - 1].V21;
     
    14871501        (ProdBeforeBoost < WantedProd)) do
    14881502      begin
    1489         assert(nSelection[iH] = 0);
     1503        Assert(nSelection[iH] = 0);
    14901504        Take := MinWorking - TestReport.Working;
    14911505        if Take > nTile[iH] then
     
    15001514          while (Take < MaxTake) and
    15011515            (TestReport.FoodRep + Hierarchy[iH, Take].Food < MinFood) do
    1502             inc(Take);
     1516            Inc(Take);
    15031517          while (Take < MaxTake) and
    15041518            (ProdBeforeBoost + Hierarchy[iH, Take].Prod < MinProd) do
    1505             inc(Take);
     1519            Inc(Take);
    15061520        end;
    15071521        nSelection[iH] := Take;
    1508         inc(TestReport.Working, Take);
     1522        Inc(TestReport.Working, Take);
    15091523        with Hierarchy[iH, Take] do
    15101524        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) and
     1525          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
    15191533        (TestReport.Working <= MaxWorking));
    15201534      if (TestReport.FoodRep >= MinFood) and (ProdBeforeBoost >= MinProd) then
    15211535      begin
    1522         SplitTrade(TestReport.Trade, RW[p].TaxRate, RW[p].LuxRate,
     1536        SplitTrade(TestReport.Trade, RW[P].TaxRate, RW[P].LuxRate,
    15231537          TestReport.Working, CityReportEx.TradeProcessing,
    15241538          TestReport.Corruption, TestReport.Tax, TestReport.Lux,
     
    15291543          TestReport.Deployed >= Size then
    15301544        begin // city is not in disorder -- evaluate combination
    1531           inc(count);
     1545          Inc(count);
    15321546          if (MinProd < WantedProd) and (ProdBeforeBoost > MinProd) then
    15331547          begin // no combination reached wanted prod yet
     
    15771591              then
    15781592              begin
    1579                 inc(Output[oTax], Output[oFood]);
     1593                Inc(Output[oTax], Output[oFood]);
    15801594                Output[oFood] := 0;
    15811595              end;
     
    15891603              if NeedRare > 0 then
    15901604              begin
    1591                 RareOK := false;
     1605                RareOK := False;
    15921606                for iH := 0 to nHierarchy - 1 do
    15931607                  if Hierarchy[iH, nSelection[iH]].V21 and RareTiles <> 0 then
    1594                     RareOK := true;
     1608                    RareOK := True;
    15951609                if not RareOK then
    15961610                  TestReport.ProdRep := TestReport.Support;
     
    15991613              if ProdToTax then
    16001614              begin
    1601                 inc(Output[oTax], Output[oProd]);
     1615                Inc(Output[oTax], Output[oProd]);
    16021616                Output[oProd] := 0;
    16031617              end;
    16041618            end;
    16051619
    1606             NeedStep2 := false;
     1620            NeedStep2 := False;
    16071621            Value := 0;
    1608             for i := oFood to oScience do
    1609               if ValueFormula_Multiply[i] then
    1610                 NeedStep2 := true
     1622            for I := oFood to oScience do
     1623              if ValueFormula_Multiply[I] then
     1624                NeedStep2 := True
    16111625              else
    1612                 Value := Value + ValueFormula_Weight[i] * Output[i];
     1626                Value := Value + ValueFormula_Weight[I] * Output[I];
    16131627            if NeedStep2 then
    16141628            begin
    16151629              if Value > 0 then
    16161630                Value := ln(Value) + 123;
    1617               for i := oFood to oScience do
    1618                 if ValueFormula_Multiply[i] and (Output[i] > 0) then
    1619                   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);
    16211635            end;
    16221636
     
    16291643              for iH := 0 to nHierarchy - 1 do
    16301644              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);
    16331647              end;
    1634               IsBest := true;
     1648              IsBest := True;
    16351649              if (SuperPlus = 0) and (ValuePlus = 0.0) then
    16361650              begin
    16371651                SubPlus := SubValue - BestSubValue;
    16381652                if SubPlus < 0 then
    1639                   IsBest := false
     1653                  IsBest := False
    16401654                else if SubPlus = 0 then
    16411655                begin
    1642                   assert(TestTiles <> BestTiles);
     1656                  Assert(TestTiles <> BestTiles);
    16431657                  IsBest := TestTiles > BestTiles
    16441658                end
     
    16541668                  TestReport.Lux shr 1;
    16551669                Advice.CityReport := TestReport;
    1656               end
    1657             end // if (SuperPlus>0) or (ValuePlus>=0.0)
    1658           end // if SuperPlus>=0
    1659         end
     1670              end;
     1671            end; // if (SuperPlus>0) or (ValuePlus>=0.0)
     1672          end; // if SuperPlus>=0
     1673        end;
    16601674      end;
    16611675
     
    16651679        with Hierarchy[iH_Switch, nSelection[iH_Switch]] do
    16661680        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);
    16731687        if (nSelection[iH_Switch] <= nTile[iH_Switch]) and
    16741688          (TestReport.Working <= MaxWorking) then
     
    16761690          with Hierarchy[iH_Switch, nSelection[iH_Switch]] do
    16771691          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);
    16811695          end;
    1682           break;
    1683         end;
    1684         dec(TestReport.Working, nSelection[iH_Switch]);
     1696          Break;
     1697        end;
     1698        Dec(TestReport.Working, nSelection[iH_Switch]);
    16851699        nSelection[iH_Switch] := 0;
    1686         inc(iH_Switch);
     1700        Inc(iH_Switch);
    16871701      until iH_Switch = nHierarchy;
    16881702    until iH_Switch = nHierarchy; // everything tested -- done
    16891703  end;
    1690   assert(BestSuperValue > 0); // advice should always be possible
     1704  Assert(BestSuperValue > 0); // advice should always be possible
    16911705  Advice.Tiles := BestTiles;
    16921706  Advice.CityReport.HypoTiles := BestTiles;
    1693 end; // GetCityTileAdvice
     1707end;
    16941708
    16951709{
     
    16991713procedure InitGame;
    17001714var
    1701   p, i, mixTownGuard: integer;
     1715  P, I, mixTownGuard: Integer;
    17021716begin
    17031717  MaxDist := Distance(0, MapSize - lx shr 1);
    1704   for p := 0 to nPl - 1 do
    1705     if (1 shl p and GAlive <> 0) then
    1706       with RW[p] do
     1718  for P := 0 to nPl - 1 do
     1719    if (1 shl P and GAlive <> 0) then
     1720      with RW[P] do
    17071721      begin // initialize capital
    17081722        mixTownGuard := 0;
    17091723        while Model[mixTownGuard].Kind <> mkSpecial_TownGuard do
    1710           inc(mixTownGuard);
     1724          Inc(mixTownGuard);
    17111725        with City[0] do
    17121726        begin
    17131727          Built[imPalace] := 1;
    17141728          Size := 4;
    1715           for i := 2 to Size do
    1716             AddBestCityTile(p, 0);
     1729          for I := 2 to Size do
     1730            AddBestCityTile(P, 0);
    17171731          Project := mixTownGuard;
    17181732        end;
  • branches/highdpi/CmdList.pas

    r361 r465  
    55
    66uses
    7   Classes;
     7  Classes, SysUtils, Math;
    88
    99const
    1010  MaxDataSize = 1024;
     11  CommandDataElementSize = 4;
     12  CommandDataElementCountMask = $F;
     13  CommandDataMaxSize = CommandDataElementSize * CommandDataElementCountMask;
    1114
    1215type
     
    2427    constructor Create;
    2528    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);
    3437    procedure Cut;
    35     function Progress: integer;
     38    function Progress: Integer;
    3639  private
    37     LogAlloc: integer; { allocated size of LogData in bytes }
     40    LogAlloc: Integer; { allocated size of LogData in bytes }
    3841    LogData: ^TLogData;
    3942    FState: TCmdListState;
    40     procedure PutData(Data: pointer; Length: integer);
     43    procedure PutData(Data: Pointer; Length: Integer);
    4144    procedure CompleteMoveCode;
    4245  public
     
    4447  end;
    4548
     49  function CommandWithData(Command: Integer; DataSize: Byte): Integer;
     50
     51resourcestring
     52  SCommandDataSizeError = 'Command data size %d out of range (0-%d).';
     53
     54
    4655implementation
    4756
     
    5362
    5463type
    55   TData = array [0 .. MaxDataSize - 1] of Cardinal;
     64  TData = array [0..MaxDataSize - 1] of Cardinal;
    5665  PData = ^TData;
     66
     67function CommandWithData(Command: Integer; DataSize: Byte): Integer;
     68var
     69  DataElementCount: Byte;
     70begin
     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);
     75end;
    5776
    5877constructor TCmdList.Create;
     
    7392end;
    7493
    75 procedure TCmdList.Get(var Command, Player, Subject: integer; var Data: pointer);
     94procedure TCmdList.Get(var Command, Player, Subject: Integer; var Data: Pointer);
    7695var
    7796  DirCode: Cardinal;
     
    108127  else
    109128  begin
    110     code := Cardinal((@LogData[FState.LoadPos])^);
    111     if code and 3 = 0 then
     129    Code := Cardinal((@LogData[FState.LoadPos])^);
     130    if Code and 3 = 0 then
    112131    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 then
     132      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
    119138    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;
    122141      Subject := 0;
    123       inc(FState.LoadPos, 3);
     142      Inc(FState.LoadPos, 3);
    124143    end
    125144    else
    126145    begin // move command shortcut
    127       if (code and 1 = 1) and (code and (7 shl 4) <> 6 shl 4) then
     146      if (Code and 1 = 1) and (Code and (7 shl 4) <> 6 shl 4) then
    128147      begin
    129         FState.LoadMoveCode := code and $FF;
    130         inc(FState.LoadPos);
     148        FState.LoadMoveCode := Code and $FF;
     149        Inc(FState.LoadPos);
    131150      end
    132151      else
    133152      begin
    134         FState.LoadMoveCode := code and $FFFFFF;
    135         inc(FState.LoadPos, 3);
     153        FState.LoadMoveCode := Code and $FFFFFF;
     154        Inc(FState.LoadPos, 3);
    136155      end;
    137156      Get(Command, Player, Subject, Data);
     
    139158    end;
    140159
    141     if Command and $F = 0 then
     160    if Command and CommandDataElementCountMask = 0 then
    142161      Data := nil
    143162    else
    144163    begin
    145164      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;
     168end;
     169
     170procedure TCmdList.GetDataChanges(Data: Pointer; DataSize: Integer);
    152171var
    153   b0, b1: integer;
     172  b0, b1: Integer;
    154173  Map0, Map1: Cardinal;
    155174begin
    156175  Map0 := Cardinal((@LogData[FState.LoadPos])^);
    157   inc(FState.LoadPos, 4);
     176  Inc(FState.LoadPos, 4);
    158177  b0 := 0;
    159178  while Map0 > 0 do begin
    160179    if Map0 and 1 <> 0 then begin
    161180      Map1 := Cardinal((@LogData[FState.LoadPos])^);
    162       inc(FState.LoadPos, 4);
     181      Inc(FState.LoadPos, 4);
    163182      for b1 := 0 to 31 do
    164183        if 1 shl b1 and Map1 <> 0 then begin
    165184          if b0 * 32 + b1 < DataSize then
    166185            PData(Data)[b0 * 32 + b1] := Cardinal((@LogData[FState.LoadPos])^);
    167           inc(FState.LoadPos, 4);
     186          Inc(FState.LoadPos, 4);
    168187        end;
    169188    end;
    170     inc(b0);
     189    Inc(b0);
    171190    Map0 := Map0 shr 1;
    172191  end;
    173192end;
    174193
    175 procedure TCmdList.Put(Command, Player, Subject: integer; Data: pointer);
     194procedure TCmdList.Put(Command, Player, Subject: Integer; Data: Pointer);
    176195var
    177   DirCode, code: Cardinal;
     196  DirCode, Code: Cardinal;
    178197begin
    179198  if Command and $FC00 = sMoveUnit then
     
    190209    end;
    191210    if Subject = FState.LastMovingUnit then
    192       code := 1 + DirCode shl 1
    193     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;
    195214    if FState.MoveCode = 0 then
    196       FState.MoveCode := code
     215      FState.MoveCode := Code
    197216    else if FState.MoveCode and 1 = 1 then
    198217    begin // FM + this
    199       FState.MoveCode := FState.MoveCode + code shl 4;
    200       if code and 1 = 1 then
     218      FState.MoveCode := FState.MoveCode + Code shl 4;
     219      if Code and 1 = 1 then
    201220        PutData(@FState.MoveCode, 1) // FM + FM
    202221      else
     
    204223      FState.MoveCode := 0;
    205224    end
    206     else if code and 1 = 1 then
     225    else if Code and 1 = 1 then
    207226    begin // M + FM
    208       FState.MoveCode := FState.MoveCode + code shl 18;
     227      FState.MoveCode := FState.MoveCode + Code shl 18;
    209228      PutData(@FState.MoveCode, 3);
    210229      FState.MoveCode := 0;
     
    213232    begin
    214233      PutData(@FState.MoveCode, 3);
    215       FState.MoveCode := code;
     234      FState.MoveCode := Code;
    216235    end;
    217236    FState.LastMovingUnit := Subject;
     
    222241    if Command >= cClientEx then
    223242    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 +
    230249        Cardinal(Subject) shl 20;
    231       PutData(@code, 4);
    232     end;
    233   end;
    234   if Command and $F <> 0 then
    235     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);
     255end;
     256
     257procedure TCmdList.PutDataChanges(Command, Player: Integer;
     258  OldData, NewData: Pointer; DataSize: Integer);
    240259var
    241   MapPos, LogPos, b0, b1, RowEnd: integer;
    242   Map0, Map1, code: Cardinal;
     260  MapPos, LogPos, b0, b1, RowEnd: Integer;
     261  Map0, Map1, Code: Cardinal;
    243262begin
    244263  if DataSize <= 0 then
    245     exit;
     264    Exit;
    246265  if DataSize > MaxDataSize then
    247266    DataSize := MaxDataSize;
     
    254273    if LogPos + 4 * 32 > LogAlloc then
    255274    begin
    256       inc(LogAlloc, LogGrow);
     275      Inc(LogAlloc, LogGrow);
    257276      ReallocMem(LogData, LogAlloc);
    258277    end;
     
    268287      begin
    269288        Cardinal((@LogData[LogPos])^) := PData(NewData)[b1];
    270         inc(LogPos, 4);
    271         inc(Map1, $80000000);
     289        Inc(LogPos, 4);
     290        Inc(Map1, $80000000);
    272291      end;
    273292    end;
     
    277296      Cardinal((@LogData[MapPos])^) := Map1;
    278297      MapPos := LogPos;
    279       inc(LogPos, 4);
    280       inc(Map0, $80000000);
     298      Inc(LogPos, 4);
     299      Inc(Map0, $80000000);
    281300    end;
    282301  end;
    283302  if Map0 = 0 then
    284     exit; // no changes
     303    Exit; // no changes
    285304
    286305  Map0 := Map0 shr (31 - (DataSize - 1) div 32);
    287306  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;
    290309  FState.nLog := MapPos;
    291310end;
    292311
    293 procedure TCmdList.PutData(Data: pointer; Length: integer);
     312procedure TCmdList.PutData(Data: Pointer; Length: Integer);
    294313begin
    295314  if FState.nLog + Length > LogAlloc then
    296315  begin
    297     inc(LogAlloc, LogGrow);
     316    Inc(LogAlloc, LogGrow);
    298317    ReallocMem(LogData, LogAlloc);
    299318  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);
    302321end;
    303322
     
    314333end;
    315334
    316 procedure TCmdList.LoadFromFile(const f: TFileStream);
    317 begin
    318   f.read(FState.nLog, 4);
     335procedure TCmdList.LoadFromFile(const F: TFileStream);
     336begin
     337  F.Read(FState.nLog, 4);
    319338  LogData := nil;
    320339  LogAlloc := ((FState.nLog + 2) div LogGrow + 1) * LogGrow;
    321340  ReallocMem(LogData, LogAlloc);
    322   f.read(LogData^, FState.nLog);
     341  F.Read(LogData^, FState.nLog);
    323342  FState.LoadPos := 0;
    324343end;
    325344
    326 procedure TCmdList.SaveToFile(const f: TFileStream);
     345procedure TCmdList.SaveToFile(const F: TFileStream);
    327346begin
    328347  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);
     350end;
     351
     352procedure TCmdList.AppendToFile(const F: TFileStream;
    334353  const OldState: TCmdListState);
    335354begin
    336355  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);
    340359end;
    341360
     
    345364end;
    346365
    347 function TCmdList.Progress: integer;
     366function TCmdList.Progress: Integer;
    348367begin
    349368  if (FState.LoadPos = FState.nLog) and (FState.LoadMoveCode = 0) then
    350     result := 1000 // loading complete
     369    Result := 1000 // loading complete
    351370  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)
    353372  else
    354     result := FState.LoadPos * 999 div FState.nLog;
     373    Result := FState.LoadPos * 999 div FState.nLog;
    355374end;
    356375
     
    360379  Byte3    Byte2    Byte1    Byte0
    361380  ssssssss sssspppp cccccccc cccccc00
    362   (c = Command-sExecute, p = Player, s = Subject)
     381  (C = Command-sExecute, P = Player, S = Subject)
    363382
    364383  ClientEx-Command:
    365384  Byte2    Byte1    Byte0
    366385  0ppppccc cccccccc ccccc010
    367   (c = Command, p = Player)
     386  (C = Command, P = Player)
    368387
    369388  Single Move:
    370389  Byte2    Byte1    Byte0
    371390  000000ss ssssssss ssaaa110
    372   (a = Direction, s = Subject)
     391  (A = Direction, S = Subject)
    373392
    374393  Move + Follow Move:
    375394  Byte2    Byte1    Byte0
    376395  00bbb1ss ssssssss ssaaa110
    377   (a = Direction 1, s = Subject 1, b = Direction 2)
     396  (A = Direction 1, S = Subject 1, B = Direction 2)
    378397
    379398  Follow Move + Move:
    380399  Byte2    Byte1    Byte0
    381400  00ssssss ssssssbb b110aaa1
    382   (a = Direction 1, b = Direction 2, s = Subject 2)
     401  (A = Direction 1, B = Direction 2, S = Subject 2)
    383402
    384403  Single Follow Move:
    385404  Byte0
    386405  0000aaa1
    387   (a = Direction)
     406  (A = Direction)
    388407
    389408  Double Follow Move:
    390409  Byte0
    391410  bbb1aaa1
    392   (a = Direction 1, b = Direction 2)
     411  (A = Direction 1, B = Direction 2)
    393412}
    394413
  • branches/highdpi/Database.pas

    r349 r465  
    2626
    2727  nStartUn = 1;
    28   StartUn: array [0 .. nStartUn - 1] of integer = (0); // mix of start units
     28  StartUn: array [0 .. nStartUn - 1] of Integer = (0); // mix of start units
    2929
    3030  CityOwnTile = 13;
     
    5050  Mode: TGameMode;
    5151  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;
    5454  CL: TCmdList;
    5555{$IFDEF TEXTLOG}CmdInfo: string;
     
    5858  // map data
    5959  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;
    6161  { continent id for each tile }
    6262  Occupant: array [0 .. lxmax * lymax - 1] of ShortInt;
     
    6565  ObserveLevel: array [0 .. lxmax * lymax - 1] of Cardinal;
    6666  { 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;
    6868  { location of exploiting city for
    6969    each tile, =-1 if not exploited }
     
    7171  // player data
    7272  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;
    7474  GShip: array [0 .. nPl - 1] of TShipInfo;
    7575  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;
    7878  LastValidStat, Researched, Discovered, // number of tiles discovered
    79   GrWallContinent: array [0 .. nPl - 1] of integer;
     79  GrWallContinent: array [0 .. nPl - 1] of Integer;
    8080  RWemix: array [0 .. nPl - 1, 0 .. nPl - 1, 0 .. nmmax - 1] of SmallInt;
    8181  // [p1,p2,mix] -> index of p2's model mix in p1's enemy model list
    8282  Destroyed: array [0 .. nPl - 1, 0 .. nPl - 1, 0 .. nmmax - 1] of SmallInt;
    8383  // [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 }
    8585  // NewContact: array[0..nPl-1,0..nPl-1] of boolean;
    8686
    8787type
    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
     91procedure MaskD(var X: array of Cardinal; Count, Mask: Cardinal);
     92procedure IntServer(Command, Player, Subject: Integer; var Data);
     93procedure CompactLists(P: Integer);
     94procedure ClearTestFlags(ClearFlags: Integer);
     95procedure SetTestFlags(P, SetFlags: Integer);
    9696
    9797// 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);
     98function TechBaseCost(nTech, diff: Integer): Integer;
     99function TechCost(P: Integer): Integer;
     100procedure CalculateModel(var M: TModel);
     101procedure CheckSpecialModels(P, pre: Integer);
     102procedure EnableDevModel(P: Integer);
     103procedure SeeTech(P, ad: Integer);
     104procedure DiscoverTech(P, ad: Integer);
     105procedure CheckExpiration(Wonder: Integer);
    106106
    107107// 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);
     108function dLoc(Loc, dx, dy: Integer): Integer;
     109procedure dxdy(Loc0, Loc1: Integer; var dx, dy: Integer);
     110function Distance(Loc0, Loc1: Integer): Integer;
     111procedure V8_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity8Loc);
     112procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc);
    113113
    114114// Game Initialization
    115115procedure InitRandomGame;
    116 procedure InitMapGame(Human: integer);
     116procedure InitMapGame(Human: Integer);
    117117procedure ReleaseGame;
    118118
    119119// Map Editor
    120 function MapGeneratorAvailable: boolean;
     120function MapGeneratorAvailable: Boolean;
    121121procedure CreateElevation;
    122 procedure CreateMap(preview: boolean);
     122procedure CreateMap(preview: Boolean);
    123123procedure InitMapEditor;
    124124procedure ReleaseMapEditor;
    125 procedure EditTile(Loc, NewTile: integer);
     125procedure EditTile(Loc, NewTile: Integer);
    126126
    127127// 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);
     128function GetTileInfo(P, cix, Loc: Integer; var Info: TTileInfo): Integer;
     129procedure Strongest(Loc: Integer; var uix, Strength, Bonus, Cnt: Integer);
     130function UnitSpeed(P, mix, Health: Integer): Integer;
     131procedure GetUnitReport(P, uix: Integer; var UnitReport: TUnitReport);
     132procedure SearchCity(Loc: Integer; var P, cix: Integer);
     133procedure TellAboutModel(P, taOwner, tamix: Integer);
     134function emixSafe(P, taOwner, tamix: Integer): Integer;
     135function Discover9(Loc, P, Level: Integer;
     136  TellAllied, EnableContact: Boolean): Boolean;
     137function Discover21(Loc, P, AdjacentLevel: Integer;
     138  TellAllied, EnableContact: Boolean): Boolean;
     139procedure DiscoverAll(P, Level: Integer);
     140procedure DiscoverViewAreas(P: Integer);
     141function GetUnitStack(P, Loc: Integer): Integer;
     142procedure UpdateUnitMap(Loc: Integer; CityChange: Boolean = False);
     143procedure RecalcV8ZoC(P, Loc: Integer);
     144procedure RecalcMapZoC(P: Integer);
     145procedure RecalcPeaceMap(P: Integer);
    146146
    147147// Territory Calculation
    148 procedure CheckBorders(OriginLoc: integer; PlayerLosingCity: integer = -1);
    149 procedure LogCheckBorders(p, cix: integer; PlayerLosingCity: integer = -1);
     148procedure CheckBorders(OriginLoc: Integer; PlayerLosingCity: Integer = -1);
     149procedure LogCheckBorders(P, cix: Integer; PlayerLosingCity: Integer = -1);
    150150
    151151// 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);
     152procedure CreateUnit(P, mix: Integer);
     153procedure FreeUnit(P, uix: Integer);
     154procedure PlaceUnit(P, uix: Integer);
     155procedure RemoveUnit(P, uix: Integer; Enemy: Integer = -1);
     156procedure RemoveUnit_UpdateMap(P, uix: Integer);
     157procedure RemoveAllUnits(P, Loc: Integer; Enemy: Integer = -1);
     158procedure RemoveDomainUnits(D, P, Loc: Integer);
     159procedure FoundCity(P, FoundLoc: Integer);
     160procedure DestroyCity(P, cix: Integer; SaveUnits: Boolean);
     161procedure ChangeCityOwner(pOld, cixOld, pNew: Integer);
     162procedure CompleteJob(P, Loc, Job: Integer);
    163163
    164164// 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;
     165procedure IntroduceEnemy(p1, p2: Integer);
     166procedure GiveCivilReport(P, pAbout: Integer);
     167procedure GiveMilReport(P, pAbout: Integer);
     168procedure ShowPrice(pSender, pTarget, Price: Integer);
     169function PayPrice(pSender, pTarget, Price: Integer; execute: Boolean): Boolean;
     170procedure CancelTreaty(P, pWith: Integer; DecreaseCredibility: Boolean = True);
     171function DoSpyMission(P, pCity, cix, Mission: Integer): Cardinal;
     172
    172173
    173174implementation
     
    179180
    180181var
    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
     184procedure MaskD(var X: array of Cardinal; Count, Mask: Cardinal);
    184185var
    185186  I: Integer;
    186187begin
    187188  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;
     190end;
     191
     192procedure CompactLists(P: Integer);
     193var
     194  uix, uix1, cix: Integer;
     195{$IFOPT O-}V21: Integer;
    195196  Radius: TVicinity21Loc; {$ENDIF}
    196197begin
    197   with RW[p] do
     198  with RW[P] do
    198199  begin
    199200    // compact unit list
     
    202203      if Un[uix].Loc < 0 then
    203204      begin
    204         dec(nUn);
     205        Dec(nUn);
    205206        Un[uix] := Un[nUn]; { replace removed unit by last }
    206207        if (Un[uix].TroopLoad > 0) or (Un[uix].AirLoad > 0) then
     
    211212      end
    212213      else
    213         inc(uix);
     214        Inc(uix);
    214215
    215216    // compact city list
     
    218219      if City[cix].Loc < 0 then
    219220      begin
    220         dec(nCity);
     221        Dec(nCity);
    221222        City[cix] := City[nCity]; { replace city by last }
    222223        for uix1 := 0 to nUn - 1 do
     
    226227      end
    227228      else
    228         inc(cix);
     229        Inc(cix);
    229230
    230231    // compact enemy city list
     
    233234      if EnemyCity[cix].Loc < 0 then
    234235      begin
    235         dec(nEnemyCity);
     236        Dec(nEnemyCity);
    236237        EnemyCity[cix] := EnemyCity[nEnemyCity]; { replace city by last }
    237238      end
    238239      else
    239         inc(cix);
     240        Inc(cix);
    240241
    241242{$IFOPT O-}
     
    246247        for V21 := 1 to 26 do
    247248          if Tiles and (1 shl V21) <> 0 then
    248             assert(UsedByCity[Radius[V21]] = Loc);
    249       end
     249            Assert(UsedByCity[Radius[V21]] = Loc);
     250      end;
    250251{$ENDIF}
    251252  end;
    252 end; // CompactLists
     253end;
    253254
    254255{
     
    256257  ____________________________________________________________________
    257258}
    258 function TechBaseCost(nTech, diff: integer): integer;
    259 var
    260   c0: single;
     259function TechBaseCost(nTech, diff: Integer): Integer;
     260var
     261  c0: Single;
    261262begin
    262263  c0 := TechFormula_M[diff] * (nTech + 4) *
    263264    exp((nTech + 4) / TechFormula_D[diff]);
    264265  if c0 >= $10000000 then
    265     result := $10000000
     266    Result := $10000000
    266267  else
    267     result := trunc(c0)
    268 end;
    269 
    270 function TechCost(p: integer): integer;
    271 begin
    272   with RW[p] do
    273   begin
    274     result := TechBaseCost(nTech[p], Difficulty[p]);
     268    Result := trunc(c0);
     269end;
     270
     271function TechCost(P: Integer): Integer;
     272begin
     273  with RW[P] do
     274  begin
     275    Result := TechBaseCost(nTech[P], Difficulty[P]);
    275276    if ResearchTech >= 0 then
    276277      if (ResearchTech = adMilitary) or (Tech[ResearchTech] = tsSeen) then
    277         result := result shr 1
     278        Result := Result shr 1
    278279      else if ResearchTech in FutureTech then
    279280        if Government = gFuture then
    280           result := result * 2
     281          Result := Result * 2
    281282        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) then
    290     m.Flags := m.Flags or mdZOC;
    291   if (m.Kind = mkDiplomat) or (m.Attack + m.Cap[mcBombs] = 0) then
    292     m.Flags := m.Flags or mdCivil;
    293   if (m.Cap[mcOver] > 0) or (m.Domain = dSea) and (m.Weight >= 6) then
    294     m.Flags := m.Flags or mdDoubleSupport;
    295 end;
    296 
    297 procedure CalculateModel(var m: TModel);
     283          Result := Result * 4;
     284  end;
     285end;
     286
     287procedure SetModelFlags(var M: TModel);
     288begin
     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;
     296end;
     297
     298procedure CalculateModel(var M: TModel);
    298299{ calculate attack, defense, cost... of a model by features }
    299300var
    300   i: integer;
    301 begin
    302   with m do
     301  I: Integer;
     302begin
     303  with M do
    303304  begin
    304305    Attack := (Cap[mcOffense] + Cap[mcOver]) * MStrength;
     
    311312          Speed := 350 + 200 * Cap[mcNP] + 200 * Cap[mcTurbines];
    312313          if Cap[mcNP] = 0 then
    313             inc(Speed, 100 * Cap[mcSE]);
     314            Inc(Speed, 100 * Cap[mcSE]);
    314315        end;
    315316      dAir:
     
    317318    end;
    318319    Cost := 0;
    319     for i := 0 to nFeature - 1 do
    320       if 1 shl Domain and Feature[i].Domains <> 0 then
    321         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);
    322323    Cost := Cost * MCost;
    323324    Weight := 0;
    324     for i := 0 to nFeature - 1 do
    325       if 1 shl Domain and Feature[i].Domains <> 0 then
    326         if (Domain = dGround) and (i = mcDefense) then
    327           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)
    328329        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);
     333end;
     334
     335procedure CheckSpecialModels(P, pre: Integer);
     336var
     337  I, mix1: Integer;
     338  HasAlready: Boolean;
     339begin
     340  for I := 0 to nSpecialModel -
    340341    1 do { check whether new special model available }
    341     if (SpecialModelPreq[i] = pre) and (RW[p].nModel < nmmax) then
    342     begin
    343       HasAlready := false;
    344       for mix1 := 0 to RW[p].nModel - 1 do
    345         if (RW[p].Model[mix1].Kind = SpecialModel[i].Kind) and
    346           (RW[p].Model[mix1].Attack = SpecialModel[i].Attack) and
    347           (RW[p].Model[mix1].Speed = SpecialModel[i].Speed) then
    348           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;
    349350      if not HasAlready then
    350351      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] do
     352        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
    354355        begin
    355356          Status := 0;
     
    358359          Built := 0;
    359360          Lost := 0;
    360           ID := p shl 12 + RW[p].nModel;
    361           if (Kind = mkSpecial_Boat) and (ServerVersion[p] < $000EF0) then
     361          ID := P shl 12 + RW[P].nModel;
     362          if (Kind = mkSpecial_Boat) and (ServerVersion[P] < $000EF0) then
    362363            Speed := 350; // old longboat
    363364        end;
    364         inc(RW[p].nModel);
    365       end
    366     end;
    367 end;
    368 
    369 procedure EnableDevModel(p: integer);
    370 begin
    371   with RW[p] do
     365        Inc(RW[P].nModel);
     366      end;
     367    end;
     368end;
     369
     370procedure EnableDevModel(P: Integer);
     371begin
     372  with RW[P] do
    372373    if nModel < nmmax then
    373374    begin
     
    380381        Built := 0;
    381382        Lost := 0;
    382         ID := p shl 12 + nModel
    383       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;
     388end;
     389
     390procedure SeeTech(P, ad: Integer);
     391begin
     392{$IFDEF TEXTLOG}CmdInfo := CmdInfo + Format(' P%d:A%d', [P, ad]); {$ENDIF}
     393  RW[P].Tech[ad] := tsSeen;
    393394  // inc(nTech[p]);
    394   inc(Researched[p])
     395  Inc(Researched[P]);
    395396end;
    396397
    397398procedure FreeSlaves;
    398399var
    399   p1, uix: integer;
     400  p1, uix: Integer;
    400401begin
    401402  for p1 := 0 to nPl - 1 do
     
    403404      for uix := 0 to RW[p1].nUn - 1 do
    404405        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;
     407end;
     408
     409procedure DiscoverTech(P, ad: Integer);
     410
     411  procedure TellAboutKeyTech(P, Source: Integer);
    411412  var
    412     i, p1: integer;
    413   begin
    414     for i := 1 to 3 do
    415       if ad = AgePreq[i] then
     413    I, p1: Integer;
     414  begin
     415    for I := 1 to 3 do
     416      if ad = AgePreq[I] then
    416417        for p1 := 0 to nPl - 1 do
    417           if (p1 <> p) and ((GAlive or GWatching) and (1 shl p1) <> 0) then
    418             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
     422var
     423  I: Integer;
    423424begin
    424425  if ad in FutureTech then
    425426  begin
    426     if RW[p].Tech[ad] < tsApplicable then
    427       RW[p].Tech[ad] := 1
     427    if RW[P].Tech[ad] < tsApplicable then
     428      RW[P].Tech[ad] := 1
    428429    else
    429       inc(RW[p].Tech[ad]);
     430      Inc(RW[P].Tech[ad]);
    430431    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 then
    437   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]);
    440441  end
    441442  else
    442443  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);
    449450  if ad = adScience then
    450     ResourceMask[p] := ResourceMask[p] or fSpecial2;
     451    ResourceMask[P] := ResourceMask[P] or fSpecial2;
    451452  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) and
    456       (Imp[i].Expiration = ad) then
    457     begin
    458       GWonder[i].EffectiveOwner := -1;
    459       if i = woPyramids then
     453    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
    460461        FreeSlaves;
    461462    end;
    462463end;
    463464
    464 procedure CheckExpiration(Wonder: integer);
     465procedure CheckExpiration(Wonder: Integer);
    465466// GWonder[Wonder].EffectiveOwner must be set before!
    466467var
    467   p: integer;
     468  P: Integer;
    468469begin
    469470  if (Imp[Wonder].Expiration >= 0) and
    470471    (GWonder[woEiffel].EffectiveOwner <> GWonder[Wonder].EffectiveOwner) then
    471     for p := 0 to nPl - 1 do // check if already expired
    472       if (1 shl p and GAlive <> 0) and
    473         (RW[p].Tech[Imp[Wonder].Expiration] >= tsApplicable) then
     472    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
    474475      begin
    475476        GWonder[Wonder].EffectiveOwner := -1;
    476477        if Wonder = woPyramids then
    477           FreeSlaves
    478       end
     478          FreeSlaves;
     479      end;
    479480end;
    480481
     
    483484  ____________________________________________________________________
    484485}
    485 function dLoc(Loc, dx, dy: integer): integer;
     486function dLoc(Loc, dx, dy: Integer): Integer;
    486487{ relative location, dx in hor and dy in ver direction from Loc }
    487488var
    488   y0: integer;
     489  y0: Integer;
    489490begin
    490491  if not (Loc >= 0) and (Loc < MapSize) and (dx + lx >= 0) then
    491492    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));
    493494  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) then
    496     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;
     498end;
     499
     500procedure dxdy(Loc0, Loc1: Integer; var dx, dy: Integer);
    500501begin
    501502  dx := ((Loc1 mod lx * 2 + Loc1 div lx and 1) -
     
    504505end;
    505506
    506 function Distance(Loc0, Loc1: integer): integer;
    507 var
    508   dx, dy: integer;
     507function Distance(Loc0, Loc1: Integer): Integer;
     508var
     509  dx, dy: Integer;
    509510begin
    510511  dxdy(Loc0, Loc1, dx, dy);
    511512  dx := abs(dx);
    512513  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;
     515end;
     516
     517procedure V8_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity8Loc);
     518var
     519  x0, y0, lx0: Integer;
    519520begin
    520521  lx0 := lx; // put in register!
     
    526527  VicinityLoc[5] := Loc0 - lx0 * 2;
    527528  VicinityLoc[7] := Loc0 + 1;
    528   inc(Loc0, y0);
     529  Inc(Loc0, y0);
    529530  VicinityLoc[0] := Loc0 + lx0;
    530531  VicinityLoc[2] := Loc0 + lx0 - 1;
     
    537538    if x0 = 0 then
    538539    begin
    539       inc(VicinityLoc[3], lx0);
     540      Inc(VicinityLoc[3], lx0);
    540541      if y0 = 0 then
    541542      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;
    546547  end
    547548  else
    548549  begin
    549     dec(VicinityLoc[7], lx0);
     550    Dec(VicinityLoc[7], lx0);
    550551    if y0 = 1 then
    551552    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;
     557end;
     558
     559procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc);
     560var
     561  dx, dy, bit, y0, xComp, yComp, xComp0, xCompSwitch: Integer;
     562  dst: ^Integer;
    562563begin
    563564  y0 := Loc0 div lx;
     
    565566  xCompSwitch := xComp0 - 1 + y0 and 1;
    566567  if xComp0 < 0 then
    567     inc(xComp0, lx);
     568    Inc(xComp0, lx);
    568569  if xCompSwitch < 0 then
    569     inc(xCompSwitch, lx);
     570    Inc(xCompSwitch, lx);
    570571  xCompSwitch := xCompSwitch xor xComp0;
    571572  yComp := lx * (y0 - 3);
     
    582583      else
    583584        dst^ := -1;
    584       inc(xComp);
     585      Inc(xComp);
    585586      if xComp >= lx then
    586         dec(xComp, lx);
    587       inc(dst);
     587        Dec(xComp, lx);
     588      Inc(dst);
    588589      bit := bit shl 1;
    589590    end;
    590     inc(yComp, lx);
     591    Inc(yComp, lx);
    591592  end;
    592593end;
     
    597598}
    598599var
    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 }
    601602  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 }
    603604
    604605procedure CalculatePrimitive;
    605606var
    606   i, j: integer;
     607  I, J: Integer;
    607608begin
    608609  primitive := 1;
    609   i := 2;
    610   while i * i <= MapSize + 1 do // test whether prime
    611   begin
    612     if (MapSize + 1) mod i = 0 then
     610  I := 2;
     611  while I * I <= MapSize + 1 do // test whether prime
     612  begin
     613    if (MapSize + 1) mod I = 0 then
    613614      primitive := 0;
    614     inc(i)
     615    Inc(I);
    615616  end;
    616617
    617618  if primitive > 0 then
    618619    repeat
    619       inc(primitive);
    620       i := 1;
    621       j := 0;
     620      Inc(primitive);
     621      I := 1;
     622      J := 0;
    622623      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;
     628end;
     629
     630function MapGeneratorAvailable: Boolean;
     631begin
     632  Result := (primitive > 0) and (lx >= 20) and (ly >= 40);
    632633end;
    633634
    634635procedure CreateElevation;
    635636const
    636   d = 64;
     637  D = 64;
    637638  Smooth = 0.049; { causes low amplitude of short waves }
    638639  Detail = 0.095; { causes short period of short waves }
     
    641642
    642643var
    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 }
    648649  var
    649     i: integer;
    650   begin
    651     result := 0;
    652     for i := 1 to d do
    653       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];
    655656    { x values effectively multiplied with 2 to get 2 horizantal periods
    656657      of the prime waves }
     
    658659
    659660begin
    660   for x := 1 to d do { prepare formula parameters }
    661   begin
    662 {$IFNDEF SCR} if x = 1 then
    663       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);
    669670  end;
    670671
     
    672673  FillChar(ElCount, SizeOf(ElCount), 0);
    673674  maxv := 0;
    674   for x := 0 to lx - 1 do
    675     for y := 0 to ly - 1 do
    676     begin
    677       v := Value(x, y);
    678       if x * 2 < imerge then
    679         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 then
    682         maxv := v;
    683 
    684       if v < -4 then
    685         Elevation[x + lx * y] := 0
    686       else if v > 8.75 then
    687         Elevation[x + lx * y] := 255
     675  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
    688689      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]]);
    691692    end;
    692693end;
     
    694695procedure FindContinents;
    695696
    696   procedure ReplaceCont(a, b, Stop: integer);
     697  procedure ReplaceCont(A, B, Stop: Integer);
    697698  { replace continent name a by b }
    698699  // make sure always continent[loc]<=loc
    699700  var
    700     i: integer;
    701   begin
    702     if a < b then
    703     begin
    704       i := a;
    705       a := b;
    706       b := i
    707     end;
    708     if a > b then
    709       for i := a to Stop do
    710         if Continent[i] = a then
    711           Continent[i] := b
    712   end;
    713 
    714 var
    715   x, y, Loc, Wrong: integer;
    716 begin
    717   for y := 1 to ly - 2 do
    718     for x := 0 to lx - 1 do
    719     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
     715var
     716  X, Y, Loc, Wrong: Integer;
     717begin
     718  for Y := 1 to ly - 2 do
     719    for X := 0 to lx - 1 do
     720    begin
     721      Loc := X + lx * Y;
    721722      Continent[Loc] := -1;
    722723      if RealMap[Loc] and fTerrain >= fGrass then
    723724      begin
    724         if (y - 2 >= 1) and (RealMap[Loc - 2 * lx] and fTerrain >= fGrass) then
     725        if (Y - 2 >= 1) and (RealMap[Loc - 2 * lx] and fTerrain >= fGrass) then
    725726          Continent[Loc] := Continent[Loc - 2 * lx];
    726         if (x - 1 + y and 1 >= 0) and (y - 1 >= 1) and
    727           (RealMap[Loc - 1 + y and 1 - lx] and fTerrain >= fGrass) then
    728           Continent[Loc] := Continent[Loc - 1 + y and 1 - lx];
    729         if (x + y and 1 < lx) and (y - 1 >= 1) and
    730           (RealMap[Loc + y and 1 - lx] and fTerrain >= fGrass) then
    731           Continent[Loc] := Continent[Loc + y and 1 - lx];
    732         if (x - 1 >= 0) and (RealMap[Loc - 1] and fTerrain >= fGrass) then
     727        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
    733734          if Continent[Loc] = -1 then
    734735            Continent[Loc] := Continent[Loc - 1]
     
    736737            ReplaceCont(Continent[Loc - 1], Continent[Loc], Loc);
    737738        if Continent[Loc] = -1 then
    738           Continent[Loc] := Loc
    739       end
     739          Continent[Loc] := Loc;
     740      end;
    740741    end;
    741742
    742743  { connect continents due to round earth }
    743   for y := 1 to ly - 2 do
    744     if RealMap[lx * y] and fTerrain >= fGrass then
     744  for Y := 1 to ly - 2 do
     745    if RealMap[lx * Y] and fTerrain >= fGrass then
    745746    begin
    746747      Wrong := -1;
    747       if RealMap[lx - 1 + lx * y] and fTerrain >= fGrass then
    748         Wrong := Continent[lx - 1 + lx * y];
    749       if (y and 1 = 0) and (y - 1 >= 1) and
    750         (RealMap[lx - 1 + lx * (y - 1)] and fTerrain >= fGrass) then
    751         Wrong := Continent[lx - 1 + lx * (y - 1)];
    752       if (y and 1 = 0) and (y + 1 < ly - 1) and
    753         (RealMap[lx - 1 + lx * (y + 1)] and fTerrain >= fGrass) then
    754         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)];
    755756      if Wrong >= 0 then
    756         ReplaceCont(Wrong, Continent[lx * y], MapSize - 1)
     757        ReplaceCont(Wrong, Continent[lx * Y], MapSize - 1);
    757758    end;
    758759end;
     
    762763// must be done after FindContinents
    763764var
    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;
    769770  Adjacent: TVicinity8Loc;
    770771begin
     
    772773  repeat
    773774    FillChar(AreaCount, SizeOf(AreaCount), 0);
    774     for y := 1 to ly - 2 do
    775     begin
    776       yBlock := y * 5 div ly;
    777       if yBlock = (y + 1) * 5 div ly then
    778         for x := 0 to lx - 1 do
    779         begin
    780           xBlock := x * 8 div lx;
    781           if xBlock = (x + 1) * 8 div lx then
     775    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
    782783          begin
    783             Loc0 := x + lx * y;
     784            Loc0 := X + lx * Y;
    784785            if RealMap[Loc0] and fTerrain >= fGrass then
    785786            begin
     
    791792                if (Loc1 >= 0) and (Loc1 < MapSize) and
    792793                  (RealMap[Loc1] and fTerrain < fGrass) then
    793                   inc(Cnt); // count adjacent water
     794                  Inc(Cnt); // count adjacent water
    794795              end;
    795796              if Cnt <= RareMaxWater then // inner land
    796797              begin
    797                 inc(AreaCount[xBlock, yBlock]);
     798                Inc(AreaCount[xBlock, yBlock]);
    798799                if DelphiRandom(AreaCount[xBlock, yBlock]) = 0 then
    799                   RareByArea[xBlock, yBlock] := Loc0
    800               end
     800                  RareByArea[xBlock, yBlock] := Loc0;
     801              end;
    801802            end;
    802803          end;
    803         end
     804        end;
    804805    end;
    805806    totalrare := 0;
    806     for x := 0 to 7 do
    807       for y := 0 to 4 do
    808         if AreaCount[x, y] > 0 then
    809           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);
    811812  until totalrare >= 12;
    812813
     
    814815  begin // remove rarebyarea resources too close to each other
    815816    FillChar(RareAdjacent, SizeOf(RareAdjacent), 0);
    816     for x := 0 to 7 do
    817       for y := 0 to 4 do
    818         if AreaCount[x, y] > 0 then
    819         begin
    820           if (AreaCount[(x + 1) mod 8, y] > 0) and
    821             (Continent[RareByArea[x, y]] = Continent
    822             [RareByArea[(x + 1) mod 8, y]]) then
     817    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
    823824          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]);
    826827          end;
    827           if y < 4 then
     828          if Y < 4 then
    828829          begin
    829             if (AreaCount[x, y + 1] > 0) and
    830               (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]])
    831832            then
    832833            begin
    833               inc(RareAdjacent[x, y]);
    834               inc(RareAdjacent[x, y + 1]);
     834              Inc(RareAdjacent[X, Y]);
     835              Inc(RareAdjacent[X, Y + 1]);
    835836            end;
    836             if (AreaCount[(x + 1) mod 8, y + 1] > 0) and
    837               (Continent[RareByArea[x, y]] = Continent[RareByArea[(x + 1) mod 8,
    838               y + 1]]) then
     837            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
    839840            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]);
    842843            end;
    843             if (AreaCount[(x + 7) mod 8, y + 1] > 0) and
    844               (Continent[RareByArea[x, y]] = Continent[RareByArea[(x + 7) mod 8,
    845               y + 1]]) then
     844            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
    846847            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]);
    849850            end;
    850           end
     851          end;
    851852        end;
    852853    xworst := 0;
    853854    yworst := 0;
    854855    Cnt := 0;
    855     for x := 0 to 7 do
    856       for y := 0 to 4 do
    857         if AreaCount[x, y] > 0 then
    858         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])
    860861          then
    861862          begin
    862             xworst := x;
    863             yworst := y;
    864             Cnt := 1
     863            xworst := X;
     864            yworst := Y;
     865            Cnt := 1;
    865866          end
    866           else if (RareAdjacent[x, y] = RareAdjacent[xworst, yworst]) then
     867          else if (RareAdjacent[X, Y] = RareAdjacent[xworst, yworst]) then
    867868          begin
    868             inc(Cnt);
     869            Inc(Cnt);
    869870            if DelphiRandom(Cnt) = 0 then
    870871            begin
    871               xworst := x;
    872               yworst := y;
    873             end
     872              xworst := X;
     873              yworst := Y;
     874            end;
    874875          end;
    875876        end;
    876877    AreaCount[xworst, yworst] := 0;
    877     dec(totalrare)
     878    Dec(totalrare);
    878879  end;
    879880
    880881  Cnt := 0;
    881   for x := 0 to 7 do
    882     for y := 0 to 4 do
    883       if AreaCount[x, y] > 0 then
    884       begin
    885         RareLoc[Cnt] := RareByArea[x, y];
    886         inc(Cnt)
    887       end;
    888   for i := 0 to 11 do
    889   begin
    890     RealMap[RareLoc[i]] := RealMap[RareLoc[i]] and not(fTerrain or fSpecial) or
     882  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
    891892      (fDesert or fDeadLands);
    892893    for dy := -1 to 1 do
     
    894895        if (dx + dy) and 1 = 0 then
    895896        begin
    896           Loc1 := dLoc(RareLoc[i], dx, dy);
     897          Loc1 := dLoc(RareLoc[I], dx, dy);
    897898          if (Loc1 >= 0) and (RealMap[Loc1] and fTerrain = fMountains) then
    898899            RealMap[Loc1] := RealMap[Loc1] and not fTerrain or fHills;
    899         end
    900   end;
    901   for i := 0 to 11 do
    902     for j := 0 to 11 do
    903       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]);
    904905
    905906  ibest := 0;
     
    909910  begin
    910911    Cnt := 0;
    911     for i := 0 to 11 do
    912       if RareLoc[i] >= 0 then
    913         for j := 0 to 11 do
    914           if RareLoc[j] >= 0 then
     912    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
    915916            if (Cnt > 0) and (Dist[iBest, jbest] >= MinDist) then
    916917            begin
    917               if Dist[i, j] >= MinDist then
     918              if Dist[I, J] >= MinDist then
    918919              begin
    919                 inc(Cnt);
     920                Inc(Cnt);
    920921                if DelphiRandom(Cnt) = 0 then
    921922                begin
    922                   iBest := i;
    923                   jbest := j
    924                 end
    925               end
     923                  iBest := I;
     924                  jbest := J;
     925                end;
     926              end;
    926927            end
    927             else if (Cnt = 0) or (Dist[i, j] > Dist[iBest, jbest]) then
     928            else if (Cnt = 0) or (Dist[I, J] > Dist[iBest, jbest]) then
    928929            begin
    929               iBest := i;
    930               jbest := j;
     930              iBest := I;
     931              jbest := J;
    931932              Cnt := 1;
    932933            end;
     
    938939    RareLoc[jbest] := -1;
    939940  end;
    940 end; // RarePositions
    941 
    942 function CheckShore(Loc: integer): boolean;
    943 var
    944   Loc1, OldTile, V21: integer;
     941end;
     942
     943function CheckShore(Loc: Integer): Boolean;
     944var
     945  Loc1, OldTile, V21: Integer;
    945946  Radius: TVicinity21Loc;
    946947begin
    947   result := false;
     948  Result := False;
    948949  OldTile := RealMap[Loc];
    949950  if OldTile and fTerrain < fGrass then
     
    960961    end;
    961962    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;
     965end;
     966
     967function ActualSpecialTile(Loc: Integer): Cardinal;
     968begin
     969  Result := SpecialTile(Loc, RealMap[Loc] and fTerrain, lx);
     970end;
     971
     972procedure CreateMap(preview: Boolean);
    972973const
    973974  ShHiHills = 6; { of land }
     
    980981  hotunification = 50; // min. 25
    981982
    982   Zone: array [0 .. 3, 2 .. 9] of single = { terrain distribution }
     983  Zone: array [0 .. 3, 2 .. 9] of Single = { terrain distribution }
    983984    ((0.25, 0, 0, 0.4, 0, 0, 0, 0.35), (0.55, 0, 0.1, 0, 0, 0, 0, 0.35),
    984985    (0.4, 0, 0.35, 0, 0, 0, 0, 0.25), (0, 0.7, 0, 0, 0, 0, 0, 0.3));
    985986  { Grs  Dst  Pra  Tun  - - - For }
    986987
    987   function RndLow(y: integer): Cardinal;
     988  function RndLow(Y: Integer): Cardinal;
    988989  { random lowland appropriate to climate }
    989990  var
    990     z0, i: integer;
    991     p, p0, ZPlus: single;
    992   begin
    993     if ly - 1 - y > y then
    994     begin
    995       z0 := 6 * y div 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;
    997998    end
    998999    else
    9991000    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;
    10021003    end;
    10031004    p0 := 1;
    1004     for i := 2 to 9 do
    1005     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;
    10071008      { weight between zones z0 and z0+1 }
    1008       if DelphiRandom * p0 < p then
    1009       begin
    1010         RndLow := i;
     1009      if DelphiRandom * p0 < P then
     1010      begin
     1011        RndLow := I;
    10111012        Break;
    10121013      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;
    10181019  { runs river from start point Loc0; return value: length }
    10191020  var
    1020     Dir, T, Loc, Loc1, Cost: integer;
     1021    Dir, T, Loc, Loc1, Cost: Integer;
    10211022    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;
    10251026  begin
    10261027    FillChar(Time, SizeOf(Time), 255); { -1 }
     
    10311032      if (RealMap[Loc] and fTerrain < fGrass) then
    10321033      begin
    1033         OneTileLake := true;
     1034        OneTileLake := True;
    10341035        for Dir := 0 to 3 do
    10351036        begin
    10361037          Loc1 := dLoc(Loc, Dir and 1 * 2 - 1, Dir shr 1 * 2 - 1);
    10371038          if (Loc1 >= 0) and (RealMap[Loc1] and fTerrain < fGrass) then
    1038             OneTileLake := false;
     1039            OneTileLake := False;
    10391040        end;
    10401041        if not OneTileLake then
     
    10611062    end;
    10621063    Loc1 := Loc;
    1063     result := 0;
     1064    Result := 0;
    10641065    while Loc <> Loc0 do
    10651066    begin
    10661067      Loc := From[Loc];
    1067       inc(result);
    1068     end;
    1069     if (result > 1) and ((result >= MinRivLen) or
     1068      Inc(Result);
     1069    end;
     1070    if (Result > 1) and ((Result >= MinRivLen) or
    10701071      (RealMap[Loc1] and fTerrain >= fGrass)) then
    10711072    begin
     
    10811082    end
    10821083    else
    1083       result := 0;
     1084      Result := 0;
    10841085    FreeAndNil(Q);
    10851086  end;
    10861087
    10871088var
    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;
    10901091  Adjacent: TVicinity8Loc;
    10911092
     
    10961097  while plus < MapSize * LandMass * ShMountains div 10000 do
    10971098  begin
    1098     dec(bMountains);
    1099     inc(plus, ElCount[bMountains])
     1099    Dec(bMountains);
     1100    Inc(plus, ElCount[bMountains]);
    11001101  end;
    11011102  Count := plus;
     
    11041105  while plus < MapSize * LandMass * ShHiHills div 10000 do
    11051106  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);
    11101111  bLand := bHills;
    11111112  while Count < MapSize * LandMass div 100 do
    11121113  begin
    1113     dec(bLand);
    1114     inc(Count, ElCount[bLand])
     1114    Dec(bLand);
     1115    Inc(Count, ElCount[bLand]);
    11151116  end;
    11161117
     
    11351136          (RealMap[Loc1] and fTerrain < fGrass) or
    11361137          (RealMap[Loc1] and fTerrain = fArctic) then
    1137           inc(Count); // count adjacent water
     1138          Inc(Count); // count adjacent water
    11381139      end;
    11391140      if Count = 8 then
    1140         RealMap[Loc0] := fOcean
     1141        RealMap[Loc0] := fOcean;
    11411142    end;
    11421143
     
    11471148      plus := MapSize;
    11481149    Loc0 := DelphiRandom(MapSize);
    1149     for n := 0 to plus - 1 do
     1150    for N := 0 to plus - 1 do
    11501151    begin
    11511152      if (RealMap[Loc0] and fTerrain >= fGrass) and (Loc0 >= lx) and
     
    11641165    CopyFrom[Loc0] := Loc0;
    11651166
    1166   for n := 0 to unification * MapSize div 100 do
    1167   begin
    1168     y := DelphiRandom(ly);
    1169     if abs(y - (ly shr 1)) > ly div 4 + DelphiRandom(ly * hotunification div 100) then
    1170       if y < ly shr 1 then
    1171         y := ly shr 1 - y
     1167  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
    11721173      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);
    11751176    if RealMap[Loc0] and fTerrain = fGrass then
    11761177    begin
     
    12021203        Loc1 := CopyFrom[Loc1];
    12031204      RealMap[Loc0] := RealMap[Loc0] and not fTerrain or
    1204         RealMap[Loc1] and fTerrain
     1205        RealMap[Loc1] and fTerrain;
    12051206    end;
    12061207
     
    12251226          if Loc1 >= 0 then
    12261227            if RealMap[Loc1] and fTerrain < fGrass then
    1227               inc(Count, 2)
     1228              Inc(Count, 2);
    12281229        end;
    12291230      end;
    12301231      if Count >= 4 then
    1231         RealMap[Loc0] := RealMap[Loc0] and not fTerrain or fPrairie
     1232        RealMap[Loc0] := RealMap[Loc0] and not fTerrain or fPrairie;
    12321233    end;
    12331234
     
    12411242        if Loc1 >= 0 then
    12421243          if RealMap[Loc1] and fTerrain <> fDesert then
    1243             inc(Count)
     1244            Inc(Count);
    12441245      end;
    12451246      if Count >= 4 then
    1246         RealMap[Loc0] := RealMap[Loc0] and not fTerrain or fPrairie
     1247        RealMap[Loc0] := RealMap[Loc0] and not fTerrain or fPrairie;
    12471248    end;
    12481249
    12491250  for Loc0 := 0 to MapSize - 1 do
    12501251    CheckShore(Loc0); // change ocean to shore
    1251   for x := 0 to lx - 1 do
    1252   begin
    1253     RealMap[x + lx * 0] := fArctic;
    1254     if RealMap[x + lx * 1] >= fGrass then
    1255       RealMap[x + lx * 1] := RealMap[x + lx * 1] and not fTerrain or fTundra;
    1256     if RealMap[x + lx * (ly - 2)] >= fGrass then
    1257       RealMap[x + lx * (ly - 2)] := RealMap[x + lx * (ly - 2)] and
     1252  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
    12581259        not fTerrain or fTundra;
    1259     RealMap[x + lx * (ly - 1)] := fArctic
     1260    RealMap[X + lx * (ly - 1)] := fArctic;
    12601261  end;
    12611262
     
    12781279  CountGood: (cgBest, cgFlat, cgLand);
    12791280
    1280   function IsGoodTile(Loc: integer): boolean;
     1281  function IsGoodTile(Loc: Integer): Boolean;
    12811282  var
    1282     xLoc, yLoc: integer;
     1283    xLoc, yLoc: Integer;
    12831284  begin
    12841285    xLoc := Loc mod lx;
    12851286    yLoc := Loc div lx;
    12861287    if RealMap[Loc] and fDeadLands <> 0 then
    1287       result := false
     1288      Result := False
    12881289    else
    12891290      case CountGood of
    12901291        cgBest:
    1291           result := (RealMap[Loc] and fTerrain in [fGrass, fPrairie, fTundra,
     1292          Result := (RealMap[Loc] and fTerrain in [fGrass, fPrairie, fTundra,
    12921293            fSwamp, fForest]) and Odd((lymax + xLoc - yLoc shr 1) shr 1 + xLoc +
    12931294            (yLoc + 1) shr 1);
    12941295        cgFlat:
    1295           result := (RealMap[Loc] and fTerrain in [fGrass, fPrairie, fTundra,
     1296          Result := (RealMap[Loc] and fTerrain in [fGrass, fPrairie, fTundra,
    12961297            fSwamp, fForest]);
    12971298        cgLand:
    1298           result := RealMap[Loc] and fTerrain >= fGrass;
     1299          Result := RealMap[Loc] and fTerrain >= fGrass;
    12991300      end;
    13001301  end;
     
    13041305
    13051306var
    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,
    13071308    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;
    13161317  Radius: TVicinity21Loc;
    13171318  Adjacent: TVicinity8Loc;
    1318   ok: boolean;
     1319  ok: Boolean;
    13191320
    13201321begin
     
    13221323  for p1 := 0 to nPl - 1 do
    13231324    if 1 shl p1 and GAlive <> 0 then
    1324       inc(nAlive);
     1325      Inc(nAlive);
    13251326  if nAlive = 0 then
    1326     exit;
     1327    Exit;
    13271328
    13281329  { count good tiles }
     
    13311332    if RealMap[Loc] and fTerrain = fGrass then
    13321333      if ActualSpecialTile(Loc) = 1 then
    1333         inc(ccount[Continent[Loc]], 3)
     1334        Inc(ccount[Continent[Loc]], 3)
    13341335      else
    1335         inc(ccount[Continent[Loc]], 2)
     1336        Inc(ccount[Continent[Loc]], 2)
    13361337    else if RealMap[Loc] and fTerrain in [fPrairie, fSwamp, fForest, fHills]
    13371338    then
    1338       inc(ccount[Continent[Loc]]);
     1339      Inc(ccount[Continent[Loc]]);
    13391340
    13401341  Loc := 0;
    13411342  while ccount[Loc] > 0 do
    1342     inc(Loc);
    1343   for i := 1 to nAlive do
    1344   begin
    1345     sc[i] := Loc;
    1346     sccount[i] := 1
     1343    Inc(Loc);
     1344  for I := 1 to nAlive do
     1345  begin
     1346    sc[I] := Loc;
     1347    sccount[I] := 1
    13471348  end;
    13481349  { init with zero size start continents, then search bigger ones }
     
    13551356        if p1 < nAlive + 1 then
    13561357          sc[p1] := sc[p1 - 1];
    1357         dec(p1)
     1358        Dec(p1);
    13581359      end;
    13591360      if p1 < nAlive + 1 then
     
    13621363  nsc := nAlive;
    13631364  repeat
    1364     c := 1; // search least crowded continent after smallest
    1365     for i := 2 to nsc - 1 do
    1366       if ccount[sc[i]] * (2 * sccount[c] + 1) > ccount[sc[c]] *
    1367         (2 * sccount[i] + 1) then
    1368         c := i;
    1369     if ccount[sc[nsc]] * (2 * sccount[c] + 1) > ccount[sc[c]] then
     1365    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
    13701371      Break; // even least crowded continent is more crowded than smallest
    1371     inc(sccount[c]);
    1372     dec(nsc)
     1372    Inc(sccount[C]);
     1373    Dec(nsc);
    13731374  until sccount[nsc] > 1;
    13741375
     
    13761377  CountGood := cgBest;
    13771378  repeat
    1378     dec(MinGood);
     1379    Dec(MinGood);
    13791380    if (MinGood = 3) and (CountGood < cgLand) then // too demanding!
    13801381    begin
    1381       inc(CountGood);
    1382       MinGood := 6
     1382      Inc(CountGood);
     1383      MinGood := 6;
    13831384    end;
    13841385    FillChar(nCityLoc, SizeOf(nCityLoc), 0);
    13851386    Loc := DelphiRandom(MapSize);
    1386     for i := 0 to MapSize - 1 do
     1387    for I := 0 to MapSize - 1 do
    13871388    begin
    13881389      if ((Loc >= 4 * lx) and (Loc < MapSize - 4 * lx) or (CountGood >= cgLand))
    13891390        and IsGoodTile(Loc) then
    13901391      begin
    1391         c := nsc;
    1392         while (c > 0) and (Continent[Loc] <> sc[c]) do
    1393           dec(c);
    1394         if (c > 0) and (nCityLoc[c] < MaxCityLoc) then
     1392        C := nsc;
     1393        while (C > 0) and (Continent[Loc] <> sc[C]) do
     1394          Dec(C);
     1395        if (C > 0) and (nCityLoc[C] < MaxCityLoc) then
    13951396        begin
    13961397          CntGood := 1;
     
    14011402              Loc1 := Radius[V21];
    14021403              if (Loc1 >= 0) and (Loc1 < MapSize) and IsGoodTile(Loc1) then
    1403                 inc(CntGood)
     1404                Inc(CntGood);
    14041405            end;
    14051406          if CntGood >= MinGood then
    14061407          begin
    1407             CityLoc[c, nCityLoc[c]] := Loc;
    1408             inc(nCityLoc[c])
     1408            CityLoc[C, nCityLoc[C]] := Loc;
     1409            Inc(nCityLoc[C]);
    14091410          end;
    14101411        end;
     
    14131414    end;
    14141415
    1415     ok := true;
    1416     for c := 1 to nsc do
    1417       if nCityLoc[c] < sccount[c] * (8 - MinGood) div (7 - MinGood) then
    1418         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;
    14191420  until ok;
    14201421
    14211422  FineDistSQR := MapSize * LandMass * 9 div (nAlive * 100);
    14221423  p1 := 1;
    1423   for c := 1 to nsc do
     1424  for C := 1 to nsc do
    14241425  begin // for all start continents
    1425     if sccount[c] = 1 then
    1426       StartLoc0[p1] := CityLoc[c, DelphiRandom(nCityLoc[c])]
     1426    if sccount[C] = 1 then
     1427      StartLoc0[p1] := CityLoc[C, DelphiRandom(nCityLoc[C])]
    14271428    else
    14281429    begin
    14291430      BestDist := 0;
    1430       n := 1 shl sccount[c] * 32; // number of tries to find good distribution
    1431       if n > 1 shl 12 then
    1432         n := 1 shl 12;
    1433       while (n > 0) and (BestDist * BestDist < FineDistSQR) do
     1431      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
    14341435      begin
    14351436        MinDist := MaxInt;
    1436         nRest := nCityLoc[c];
    1437         for i := 0 to nRest - 1 do
    1438           RestLoc[i] := CityLoc[c, i];
    1439         for i := 0 to sccount[c] - 1 do
     1437        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
    14401441        begin
    14411442          if nRest = 0 then
    14421443            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 do
     1444          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
    14481449          begin
    1449             TestDist := Distance(TestStartLoc[i], TestStartLoc[j]);
     1450            TestDist := Distance(TestStartLoc[I], TestStartLoc[J]);
    14501451            if TestDist < MinDist then
    1451               MinDist := TestDist
     1452              MinDist := TestDist;
    14521453          end;
    1453           if i = sccount[c] - 1 then
     1454          if I = sccount[C] - 1 then
    14541455          begin
    1455             assert(MinDist > BestDist);
     1456            Assert(MinDist > BestDist);
    14561457            BestDist := MinDist;
    1457             for j := 0 to sccount[c] - 1 do
    1458               StartLoc0[p1 + j] := TestStartLoc[j];
     1458            for J := 0 to sccount[C] - 1 do
     1459              StartLoc0[p1 + J] := TestStartLoc[J];
    14591460          end
    14601461          else if BestDist > 0 then
    14611462          begin
    1462             j := 0;
    1463             while j < nRest do
     1463            J := 0;
     1464            while J < nRest do
    14641465            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]);
    14661467              if TestDist <= BestDist then
    14671468              begin
    1468                 RestLoc[j] := RestLoc[nRest - 1];
    1469                 dec(nRest);
     1469                RestLoc[J] := RestLoc[nRest - 1];
     1470                Dec(nRest);
    14701471              end
    14711472              else
    1472                 inc(j);
     1473                Inc(J);
    14731474            end;
    14741475          end;
    14751476        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]
    14801481  end;
    14811482
     
    14941495        if (Loc1 >= 0) and (Loc1 < MapSize) and IsGoodTile(Loc1) then
    14951496          if RealMap[Loc1] and fTerrain = fGrass then
    1496             inc(CntGoodGrass)
     1497            Inc(CntGoodGrass)
    14971498          else
    1498             inc(CntGood);
     1499            Inc(CntGood);
    14991500      end;
    15001501    for V21 := 1 to 26 do
     
    15281529        begin
    15291530          IrrLoc[nIrrLoc] := Loc1;
    1530           inc(nIrrLoc);
    1531         end;
    1532       end;
    1533     i := 2;
    1534     if i > nIrrLoc then
    1535       i := nIrrLoc;
    1536     while i > 0 do
    1537     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);
    15431544    end;
    15441545  end;
     
    15491550    begin
    15501551      repeat
    1551         i := DelphiRandom(nAlive) + 1
    1552       until StartLoc0[i] >= 0;
    1553       StartLoc[p1] := StartLoc0[i];
    1554       StartLoc0[i] := -1
     1552        I := DelphiRandom(nAlive) + 1
     1553      until StartLoc0[I] >= 0;
     1554      StartLoc[p1] := StartLoc0[I];
     1555      StartLoc0[I] := -1
    15551556    end;
    15561557  SaveMapCenterLoc := StartLoc[0];
     
    15851586          StartLoc2[p1] := Loc1;
    15861587          BestDist := TestDist;
    1587           n := 1;
     1588          N := 1;
    15881589        end
    15891590        else if TestDist = BestDist then
    15901591        begin
    1591           inc(n);
    1592           if DelphiRandom(n) = 0 then
     1592          Inc(N);
     1593          if DelphiRandom(N) = 0 then
    15931594            StartLoc2[p1] := Loc1;
    15941595        end;
    15951596      end;
    15961597    end;
    1597 end; { StartPositions }
    1598 
    1599 procedure PredefinedStartPositions(Human: integer);
     1598end;
     1599
     1600procedure PredefinedStartPositions(Human: Integer);
    16001601// use predefined nation start positions
    16011602var
    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;
    16051606begin
    16061607  nAlive := 0;
    16071608  for p1 := 0 to nPl - 1 do
    16081609    if 1 shl p1 and GAlive <> 0 then
    1609       inc(nAlive);
     1610      Inc(nAlive);
    16101611  if nAlive = 0 then
    1611     exit;
     1612    Exit;
    16121613
    16131614  for I := 0 to Length(StartLoc0) - 1 do
     
    16221623      StartLoc0[nStartLoc0] := StartLoc0[nPrefStartLoc0];
    16231624      StartLoc0[nPrefStartLoc0] := Loc1;
    1624       inc(nPrefStartLoc0);
    1625       inc(nStartLoc0);
     1625      Inc(nPrefStartLoc0);
     1626      Inc(nStartLoc0);
    16261627      RealMap[Loc1] := RealMap[Loc1] and not fPrefStartPos;
    16271628    end
     
    16291630    begin
    16301631      StartLoc0[nStartLoc0] := Loc1;
    1631       inc(nStartLoc0);
     1632      Inc(nStartLoc0);
    16321633      RealMap[Loc1] := RealMap[Loc1] and not fStartPos;
    16331634    end;
    1634   assert(nStartLoc0 >= nAlive);
     1635  Assert(nStartLoc0 >= nAlive);
    16351636
    16361637  StartLoc[0] := 0;
    1637   for ishuman := true downto false do
     1638  for ishuman := True downto False do
    16381639    for p1 := 0 to nPl - 1 do
    16391640      if (1 shl p1 and GAlive <> 0) and ((1 shl p1 and Human <> 0) = ishuman)
    16401641      then
    16411642      begin
    1642         dec(nStartLoc0);
     1643        Dec(nStartLoc0);
    16431644        imax := nStartLoc0;
    16441645        if nPrefStartLoc0 > 0 then
    16451646        begin
    1646           dec(nPrefStartLoc0);
     1647          Dec(nPrefStartLoc0);
    16471648          imax := nPrefStartLoc0;
    16481649        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];
    16531654        StartLoc0[imax] := StartLoc0[nStartLoc0];
    16541655      end;
    16551656  SaveMapCenterLoc := StartLoc[0];
    1656 end; { PredefinedStartPositions }
     1657end;
    16571658
    16581659procedure InitGame;
    16591660var
    1660   i, p, p1, uix, Loc1: integer;
     1661  I, P, p1, uix, Loc1: Integer;
    16611662begin
    16621663  {$IFDEF FastContact}
     
    16701671    if RealMap[Loc1] and fterrain>=fGrass then
    16711672    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;}
    16731674    {random Road and Railroad }
    16741675  { !!!for Loc1:=0 to MapSize-1 do
     
    16821683  GTestFlags := 0;
    16831684  GInitialized := GAlive or GWatching;
    1684   for p := 0 to nPl - 1 do
    1685     if 1 shl p and GInitialized <> 0 then
    1686       with RW[p] do
    1687       begin
    1688         Researched[p] := 0;
    1689         Discovered[p] := 0;
    1690         TerritoryCount[p] := 0;
    1691         nTech[p] := 0;
    1692         if Difficulty[p] = 0 then
    1693           ResourceMask[p] := $FFFFFFFF
     1685  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
    16941695        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;
    16971698
    16981699        GetMem(Map, 4 * MapSize);
     
    17121713          if 1 shl p1 and GInitialized <> 0 then
    17131714          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);
    17161717          end;
    17171718          Attitude[p1] := atNeutral;
     
    17211722          Tribute[p1] := 0;
    17221723          TributePaid[p1] := 0;
    1723           if (p1 <> p) and (1 shl p1 and GAlive <> 0) then
     1724          if (p1 <> P) and (1 shl p1 and GAlive <> 0) then
    17241725          begin // initialize enemy report
    17251726            GetMem(EnemyReport[p1], SizeOf(TEnemyReport) - 2 *
     
    17311732            EnemyReport[p1].Attitude := atNeutral;
    17321733            EnemyReport[p1].Government := gDespotism;
    1733             if 1 shl p and GAlive = 0 then
     1734            if 1 shl P and GAlive = 0 then
    17341735              Treaty[p1] := trNone // supervisor
    17351736          end
     
    17531754
    17541755  // create initial models and units
    1755   for p := 0 to nPl - 1 do
    1756     if (1 shl p and GAlive <> 0) then
    1757       with RW[p] do
     1756  for P := 0 to nPl - 1 do
     1757    if (1 shl P and GAlive <> 0) then
     1758      with RW[P] do
    17581759      begin
    17591760        nModel := 0;
    1760         for i := 0 to nSpecialModel - 1 do
    1761           if SpecialModelPreq[i] = preNone then
     1761        for I := 0 to nSpecialModel - 1 do
     1762          if SpecialModelPreq[I] = preNone then
    17621763          begin
    1763             Model[nModel] := SpecialModel[i];
     1764            Model[nModel] := SpecialModel[I];
    17641765            Model[nModel].Status := 0;
    17651766            Model[nModel].IntroTurn := 0;
    17661767            Model[nModel].Built := 0;
    17671768            Model[nModel].Lost := 0;
    1768             Model[nModel].ID := p shl 12 + nModel;
     1769            Model[nModel].ID := P shl 12 + nModel;
    17691770            SetModelFlags(Model[nModel]);
    1770             inc(nModel)
     1771            Inc(nModel);
    17711772          end;
    17721773        nUn := 0;
    1773         UnBuilt[p] := 0;
     1774        UnBuilt[P] := 0;
    17741775        for uix := 0 to nStartUn - 1 do
    17751776        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]); // capital
    1782         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;
    17831784        with City[0] do
    17841785        begin
    1785           ID := p shl 12;
     1786          ID := P shl 12;
    17861787          Flags := chFounded;
    17871788        end;
     
    17901791  TerritoryCount[nPl] := MapSize;
    17911792  // fillchar(NewContact, sizeof(NewContact), false);
    1792 end; // InitGame
     1793end;
    17931794
    17941795procedure InitRandomGame;
     
    17971798  CalculatePrimitive;
    17981799  CreateElevation;
    1799   CreateMap(false);
     1800  CreateMap(False);
    18001801  StartPositions;
    18011802  InitGame;
    18021803end;
    18031804
    1804 procedure InitMapGame(Human: integer);
     1805procedure InitMapGame(Human: Integer);
    18051806begin
    18061807  DelphiRandSeed := RND;
     
    18121813procedure ReleaseGame;
    18131814var
    1814   p1, p2: integer;
     1815  p1, p2: Integer;
    18151816begin
    18161817  for p1 := 0 to nPl - 1 do
     
    18341835procedure InitMapEditor;
    18351836var
    1836   p1: integer;
     1837  p1: Integer;
    18371838begin
    18381839  CalculatePrimitive;
     
    18711872end;
    18721873
    1873 procedure EditTile(Loc, NewTile: integer);
    1874 var
    1875   Loc1, V21: integer;
     1874procedure EditTile(Loc, NewTile: Integer);
     1875var
     1876  Loc1, V21: Integer;
    18761877  Radius: TVicinity21Loc;
    18771878begin
     
    18971898    if (NewTile and fTerImp = tiIrrigation) or (NewTile and fTerImp = tiFarm)
    18981899    then
    1899       NewTile := NewTile and not fTerImp
     1900      NewTile := NewTile and not fTerImp;
    19001901  end;
    19011902  if (Terrain[NewTile and fTerrain].MineEff = 0) and
     
    19211922      RealMap[Loc1] := RealMap[Loc1] or ($F shl 27);
    19221923      RW[0].Map[Loc1] := RealMap[Loc1] and $07FFFFFF or fObserved;
    1923     end
     1924    end;
    19241925  end;
    19251926  // RealMap[Loc]:=RealMap[Loc] and not fSpecial;
     
    19311932  ____________________________________________________________________
    19321933}
    1933 function GetTileInfo(p, cix, Loc: integer; var Info: TTileInfo): integer;
     1934function GetTileInfo(P, cix, Loc: Integer; var Info: TTileInfo): Integer;
    19341935// cix>=0 - known city index of player p -- only core internal!
    19351936// cix=-1 - search city, player unknown, only if permission for p
    19361937// cix=-2 - don't search city, don't calculate city benefits, just government of player p
    19371938var
    1938   p0, Tile, special: integer;
     1939  p0, Tile, special: Integer;
    19391940begin
    19401941  with Info do
    19411942  begin
    1942     p0 := p;
     1943    p0 := P;
    19431944    if cix >= 0 then
    19441945      Tile := RealMap[Loc]
    19451946    else
    19461947    begin
    1947       Tile := RW[p].Map[Loc];
     1948      Tile := RW[P].Map[Loc];
    19481949      if Tile and fTerrain = fUNKNOWN then
    19491950      begin
    1950         result := eNoPreq;
    1951         exit;
     1951        Result := eNoPreq;
     1952        Exit;
    19521953      end;
    19531954    end;
     
    19551956    if (cix = -1) and (UsedByCity[Loc] >= 0) then
    19561957    begin // search exploiting player and city
    1957       SearchCity(UsedByCity[Loc], p, cix);
    1958       if not((p = p0) or (ObserveLevel[UsedByCity[Loc]] shr (2 * p0) and
     1958      SearchCity(UsedByCity[Loc], P, cix);
     1959      if not((P = p0) or (ObserveLevel[UsedByCity[Loc]] shr (2 * p0) and
    19591960        3 = lObserveSuper)) then
    19601961        cix := -1
     
    19621963    if cix = -1 then
    19631964    begin
    1964       result := eInvalid;
    1965       exit;
     1965      Result := eInvalid;
     1966      Exit;
    19661967    end; // no city found here
    19671968
    1968     special := Tile and fSpecial and ResourceMask[p] shr 5;
     1969    special := Tile and fSpecial and ResourceMask[P] shr 5;
    19691970    with Terrain[Tile and fTerrain] do
    19701971    begin
     
    19731974      Trade := TradeRes[special];
    19741975      if (special > 0) and (Tile and fTerrain <> fGrass) and
    1975         (RW[p].NatBuilt[imSpacePort] > 0) then
     1976        (RW[P].NatBuilt[imSpacePort] > 0) then
    19761977      begin // GeoSat effect
    19771978        Food := 2 * Food - FoodRes[0];
     
    19821983      if (Tile and fTerImp = tiIrrigation) or (Tile and fTerImp = tiFarm) or
    19831984        (Tile and fCity <> 0) then
    1984         inc(Food, IrrEff); { irrigation effect }
     1985        Inc(Food, IrrEff); { irrigation effect }
    19851986      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)
    19881989      then
    1989         inc(Trade); { river effect }
     1990        Inc(Trade); { river effect }
    19901991      if (Tile and (fRoad or fRR) <> 0) and (MoveCost = 1) and
    1991         (RW[p].Tech[adWheel] >= tsApplicable) then
    1992         inc(Trade); { road effect }
     1992        (RW[P].Tech[adWheel] >= tsApplicable) then
     1993        Inc(Trade); { road effect }
    19931994      if (Tile and (fRR or fCity) <> 0) and
    1994         (RW[p].Tech[adRailroad] >= tsApplicable) then
    1995         inc(Prod, Prod shr 1); { railroad effect }
     1995        (RW[P].Tech[adRailroad] >= tsApplicable) then
     1996        Inc(Prod, Prod shr 1); { railroad effect }
    19961997
    19971998      ExplCity := -1;
    1998       if (cix >= 0) and (p = p0) then
     1999      if (cix >= 0) and (P = p0) then
    19992000        ExplCity := cix;
    20002001      if cix >= 0 then
     
    20022003        begin
    20032004          if ((Tile and fTerImp = tiFarm) or (Tile and fCity <> 0)) and
    2004             (RW[p].City[cix].Built[imSupermarket] > 0) then
    2005             inc(Food, Food shr 1); { farmland effect }
     2005            (RW[P].City[cix].Built[imSupermarket] > 0) then
     2006            Inc(Food, Food shr 1); { farmland effect }
    20062007          if (Tile and (fRoad or fRR) <> 0) and (MoveCost = 1) and
    2007             (RW[p].City[cix].Built[imHighways] > 0) then
    2008             inc(Trade, 1); { superhighway effect }
     2008            (RW[P].City[cix].Built[imHighways] > 0) then
     2009            Inc(Trade, 1); { superhighway effect }
    20092010        end
    20102011        else
    20112012        begin
    2012           if RW[p].City[cix].Built[imHarbor] > 0 then
    2013             inc(Food); { harbour effect }
    2014           if RW[p].City[cix].Built[imPlatform] > 0 then
    2015             inc(Prod); { oil platform effect }
    2016           if GWonder[woLighthouse].EffectiveOwner = p then
    2017             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);
    20182019        end;
    20192020    end;
    20202021
    20212022    { 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)
    20232024    then
    2024       inc(Trade);
    2025     if (RW[p].Government = gCommunism) and (Prod > 1) then
    2026       inc(Prod);
    2027 
    2028     if RW[p].Government in [gAnarchy, gDespotism] then
     2025      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
    20292030    begin { bad government influence }
    20302031      if Food > 3 then
     
    20382039    if Tile and (fTerrain or fPoll) > fPoll then
    20392040    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);
    20432044    end;
    20442045
    20452046    if Tile and fCity <> 0 then
    20462047      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]
    20482049      .Built[imPalace] = 0) then
    2049       if RW[p].City[cix].Built[imTownHall] = 0 then
     2050      if RW[P].City[cix].Built[imTownHall] = 0 then
    20502051        Trade := 0
    20512052      else if Trade > 3 then
    20522053        Trade := 3;
    20532054  end;
    2054   result := eOK;
    2055 end; { GetTileInfo }
    2056 
    2057 procedure Strongest(Loc: integer; var uix, Strength, Bonus, Cnt: integer);
     2055  Result := eOK;
     2056end;
     2057
     2058procedure Strongest(Loc: Integer; var uix, Strength, Bonus, Cnt: Integer);
    20582059{ find strongest defender at Loc }
    20592060var
    20602061  Defender, uix1, Det, Cost, TestStrength, TestBonus, TestDet, TestCost,
    2061     Domain: integer;
     2062    Domain: Integer;
    20622063  PUn: ^TUn;
    20632064  PModel: ^TModel;
     
    20772078    if PUn.Loc = Loc then
    20782079    begin
    2079       inc(Cnt);
     2080      Inc(Cnt);
    20802081      if PUn.Master < 0 then
    20812082      begin
     
    20842085          TestBonus := Terrain[RealMap[Loc] and fTerrain].Defense;
    20852086          if RealMap[Loc] and fTerImp = tiFort then
    2086             inc(TestBonus, 4);
     2087            Inc(TestBonus, 4);
    20872088          if PUn.Flags and unFortified <> 0 then
    2088             inc(TestBonus, 2);
     2089            Inc(TestBonus, 2);
    20892090          if (PModel.Kind = mkSpecial_TownGuard) and
    20902091            (RealMap[Loc] and fCity <> 0) then
    2091             inc(TestBonus, 4);
     2092            Inc(TestBonus, 4);
    20922093        end
    20932094        else
    20942095          TestBonus := 4;
    2095         inc(TestBonus, PUn.exp div ExpCost);
     2096        Inc(TestBonus, PUn.exp div ExpCost);
    20962097        TestStrength := PModel.Defense * TestBonus * PUn.Health;
    20972098        if (Domain = dAir) and ((RealMap[Loc] and fCity <> 0) or
     
    21032104        if PModel.Cap[mcStealth] > 0 then
    21042105        else if PModel.Cap[mcSub] > 0 then
    2105           inc(TestDet, 1 shl 28)
     2106          Inc(TestDet, 1 shl 28)
    21062107        else if (Domain = dGround) and (PModel.Cap[mcFanatic] > 0) and
    21072108          not(RW[Defender].Government in [gRepublic, gDemocracy, gFuture]) then
    2108           inc(TestDet, 4 shl 28) // fanatic ground units always defend
     2109          Inc(TestDet, 4 shl 28) // fanatic ground units always defend
    21092110        else if PModel.Flags and mdZOC <> 0 then
    2110           inc(TestDet, 3 shl 28)
     2111          Inc(TestDet, 3 shl 28)
    21112112        else
    2112           inc(TestDet, 2 shl 28);
     2113          Inc(TestDet, 2 shl 28);
    21132114        TestCost := RW[Defender].Model[PUn.mix].Cost;
    21142115        if (TestDet > Det) or (TestDet = Det) and (TestCost < Cost) then
     
    21252126end;
    21262127
    2127 function UnitSpeed(p, mix, Health: integer): integer;
    2128 begin
    2129   with RW[p].Model[mix] do
    2130   begin
    2131     result := Speed;
     2128function UnitSpeed(P, mix, Health: Integer): Integer;
     2129begin
     2130  with RW[P].Model[mix] do
     2131  begin
     2132    Result := Speed;
    21322133    if Domain = dSea then
    21332134    begin
    2134       if GWonder[woMagellan].EffectiveOwner = p then
    2135         inc(result, 200);
     2135      if GWonder[woMagellan].EffectiveOwner = P then
     2136        Inc(Result, 200);
    21362137      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;
     2141end;
     2142
     2143procedure GetUnitReport(P, uix: Integer; var UnitReport: TUnitReport);
     2144var
     2145  TerrOwner: Integer;
    21452146  PModel: ^TModel;
    21462147begin
     
    21482149  UnitReport.ProdSupport := 0;
    21492150  UnitReport.ReportFlags := 0;
    2150   if RW[p].Government <> gAnarchy then
    2151     with RW[p].Un[uix] do
    2152     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];
    21542155      if (PModel.Kind = mkSettler)
    21552156      { and (GWonder[woFreeSettlers].EffectiveOwner<>p) } then
    2156         UnitReport.FoodSupport := SettlerFood[RW[p].Government]
     2157        UnitReport.FoodSupport := SettlerFood[RW[P].Government]
    21572158      else if Flags and unConscripts <> 0 then
    21582159        UnitReport.FoodSupport := 1;
    21592160
    2160       if RW[p].Government <> gFundamentalism then
     2161      if RW[P].Government <> gFundamentalism then
    21612162      begin
    21622163        if GTestFlags and tfImmImprove = 0 then
     
    21732174        begin
    21742175          TerrOwner := RealMap[Loc] shr 27;
    2175           case RW[p].Government of
     2176          case RW[P].Government of
    21762177            gRepublic, gFuture:
    2177               if (TerrOwner <> p) and (TerrOwner < nPl) and
    2178                 (RW[p].Treaty[TerrOwner] < trAlliance) then
     2178              if (TerrOwner <> P) and (TerrOwner < nPl) and
     2179                (RW[P].Treaty[TerrOwner] < trAlliance) then
    21792180                UnitReport.ReportFlags := UnitReport.ReportFlags or urfDeployed;
    21802181            gDemocracy:
    2181               if (TerrOwner >= nPl) or (TerrOwner <> p) and
    2182                 (RW[p].Treaty[TerrOwner] < trAlliance) then
     2182              if (TerrOwner >= nPl) or (TerrOwner <> P) and
     2183                (RW[P].Treaty[TerrOwner] < trAlliance) then
    21832184                UnitReport.ReportFlags := UnitReport.ReportFlags or urfDeployed;
    21842185          end;
     
    21882189end;
    21892190
    2190 procedure SearchCity(Loc: integer; var p, cix: integer);
     2191procedure SearchCity(Loc: Integer; var P, cix: Integer);
    21912192// set p to supposed owner before call
    21922193var
    2193   i: integer;
     2194  I: Integer;
    21942195begin
    21952196  if RealMap[Loc] < nPl shl 27 then
    2196     p := RealMap[Loc] shr 27;
    2197   for i := 0 to nPl - 1 do
    2198   begin
    2199     if 1 shl p and GAlive <> 0 then
    2200       with RW[p] do
     2197    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
    22012202      begin
    22022203        cix := nCity - 1;
    22032204        while (cix >= 0) and (City[cix].Loc <> Loc) do
    2204           dec(cix);
     2205          Dec(cix);
    22052206        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] do
     2207          Exit;
     2208      end;
     2209    Assert(I < nPl - 1);
     2210    P := (P + 1) mod nPl;
     2211  end;
     2212end;
     2213
     2214procedure MakeCityInfo(P, cix: Integer; var ci: TCityInfo);
     2215begin
     2216  Assert((P >= 0) and (P < nPl));
     2217  Assert((cix >= 0) and (cix < RW[P].nCity));
     2218  with RW[P].City[cix] do
    22182219  begin
    22192220    ci.Loc := Loc;
    22202221    ci.ID := ID;
    2221     ci.Owner := p;
     2222    ci.Owner := P;
    22222223    ci.Size := Size;
    22232224    ci.Flags := 0;
    22242225    if Built[imPalace] > 0 then
    2225       inc(ci.Flags, ciCapital);
    2226     if (Built[imWalls] > 0) or (Continent[Loc] = GrWallContinent[p]) then
    2227       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);
    22282229    if Built[imCoastalFort] > 0 then
    2229       inc(ci.Flags, ciCoastalFort);
     2230      Inc(ci.Flags, ciCoastalFort);
    22302231    if Built[imMissileBat] > 0 then
    2231       inc(ci.Flags, ciMissileBat);
     2232      Inc(ci.Flags, ciMissileBat);
    22322233    if Built[imBunker] > 0 then
    2233       inc(ci.Flags, ciBunker);
     2234      Inc(ci.Flags, ciBunker);
    22342235    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) then
    2244     exit;
    2245   i := 0;
    2246   while (i < RW[p].nEnemyModel) and ((RW[p].EnemyModel[i].Owner <> taOwner) or
    2247     (RW[p].EnemyModel[i].mix <> tamix)) do
    2248     inc(i);
    2249   if i = RW[p].nEnemyModel then
    2250     IntServer(sIntTellAboutModel + p shl 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 then
     2236      Inc(ci.Flags, ciSpacePort);
     2237  end;
     2238end;
     2239
     2240procedure TellAboutModel(P, taOwner, tamix: Integer);
     2241var
     2242  I: Integer;
     2243begin
     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^);
     2252end;
     2253
     2254function emixSafe(P, taOwner, tamix: Integer): Integer;
     2255begin
     2256  Result := RWemix[P, taOwner, tamix];
     2257  if Result < 0 then
    22572258  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;
     2262end;
     2263
     2264procedure IntroduceEnemy(p1, p2: Integer);
    22642265begin
    22652266  RW[p1].Treaty[p2] := trNone;
     
    22672268end;
    22682269
    2269 function DiscoverTile(Loc, p, pTell, Level: integer; EnableContact: boolean;
    2270   euix: integer = -2): boolean;
     2270function DiscoverTile(Loc, P, pTell, Level: Integer; EnableContact: Boolean;
     2271  euix: Integer = -2): Boolean;
    22712272// euix = -2: full discover
    22722273// euix = -1: unit and city only, append units in EnemyUn
    22732274// euix >= 0: unit and city only, replace EnemyUn[euix]
    22742275
    2275   procedure SetContact(p1, p2: integer);
     2276  procedure SetContact(p1, p2: Integer);
    22762277  begin
    22772278    if (Mode < moPlaying) or (p1 = p2) or (RW[p1].Treaty[p2] > trNoContact) then
    2278       exit;
     2279      Exit;
    22792280    IntServer(sIntTellAboutNation, p1, p2, nil^);
    22802281    // NewContact[p1,p2]:=true
     
    22822283
    22832284var
    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;
    22862287  Tile, AddFlags: Cardinal;
    22872288  Adjacent: TVicinity8Loc;
     
    22892290  mox: ^TModel;
    22902291begin
    2291   result := false;
     2292  Result := False;
    22922293  with RW[pTell] do
    22932294  begin
     
    23052306        AddFlags := AddFlags or fGrWall;
    23062307      if (Mode = moPlaying) and ((Tile and (nPl shl 27) <> nPl shl 27) and
    2307         (pTell = p)) then
     2308        (pTell = P)) then
    23082309      begin // set fPeace flag?
    23092310        TerrOwner := Tile shr 27;
     
    23142315            (1 shl trPeace or 1 shl TrFriendlyContact) <> 0 then
    23152316            AddFlags := AddFlags or fPeace;
    2316         end
     2317        end;
    23172318      end;
    23182319
     
    23322333          unx := @RW[Occupant[Loc]].Un[uix];
    23332334          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));
    23352336          if (mox.Cap[mcStealth] > 0) and (Tile and fCity = 0) and
    23362337            (Tile and fTerImp <> tiBase) then
     
    23482349            begin
    23492350              uix := nEnemyUn;
    2350               inc(nEnemyUn);
    2351               assert(nEnemyUn < neumax);
     2351              Inc(nEnemyUn);
     2352              Assert(nEnemyUn < neumax);
    23522353            end;
    23532354            MakeUnitInfo(Occupant[Loc], unx^, EnemyUn[uix]);
    23542355            if Cnt > 1 then
    23552356              EnemyUn[uix].Flags := EnemyUn[uix].Flags or unMulti;
    2356             if (mox.Flags and mdZOC <> 0) and (pTell = p) and
     2357            if (mox.Flags and mdZOC <> 0) and (pTell = P) and
    23572358              (Treaty[Occupant[Loc]] < trAlliance) then
    23582359            begin // set fInEnemyZoC flags of surrounding tiles
     
    23632364                if (Loc1 >= 0) and (Loc1 < MapSize) then
    23642365                  Map[Loc1] := Map[Loc1] or fInEnemyZoC
    2365               end
     2366              end;
    23662367            end;
    23672368            if EnableContact and (mox.Domain = dGround) then
     
    23732374            end;
    23742375            // Level:=lObserveSuper; // don't discover unit twice
    2375             if (pTell = p) and
     2376            if (pTell = P) and
    23762377              ((Tile and fCity = 0) or (1 shl pTell and GAI <> 0)) then
    2377               result := true;
     2378              Result := True;
    23782379          end
    23792380          else
     
    23972398          while (cixFoundCity >= 0) and
    23982399            (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) do
    2403             inc(i);
    2404           if i = nEnemyCity then
     2400            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
    24052406          begin
    2406             inc(nEnemyCity);
    2407             assert(nEnemyCity < necmax);
    2408             EnemyCity[i].Status := 0;
    2409             EnemyCity[i].SavedStatus := 0;
    2410             if pTell = p then
    2411               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;
    24122413          end;
    2413           MakeCityInfo(pFoundCity, cixFoundCity, EnemyCity[i]);
     2414          MakeCityInfo(pFoundCity, cixFoundCity, EnemyCity[I]);
    24142415        end;
    24152416      end
     
    24202421
    24212422    if Map[Loc] and fTerrain = fUNKNOWN then
    2422       inc(Discovered[pTell]);
     2423      Inc(Discovered[pTell]);
    24232424    if euix >= -1 then
    24242425      Map[Loc] := Map[Loc] and not(fUnit or fCity or fOwned or fOwnZoCUnit) or
     
    24372438      Cardinal(Level) shl (2 * pTell);
    24382439  end;
    2439 end; // DiscoverTile
    2440 
    2441 function Discover9(Loc, p, Level: integer;
    2442   TellAllied, EnableContact: boolean): boolean;
    2443 var
    2444   V9, Loc1, pTell, OldLevel: integer;
     2440end;
     2441
     2442function Discover9(Loc, P, Level: Integer;
     2443  TellAllied, EnableContact: Boolean): Boolean;
     2444var
     2445  V9, Loc1, pTell, OldLevel: Integer;
    24452446  Radius: TVicinity8Loc;
    24462447begin
    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;
    24492450  V8_to_Loc(Loc, Radius);
    24502451  for V9 := 0 to 8 do
     
    24582459      begin
    24592460        for pTell := 0 to nPl - 1 do
    2460           if (pTell = p) or (1 shl pTell and GAlive <> 0) and
    2461             (RW[p].Treaty[pTell] = trAlliance) then
     2461          if (pTell = P) or (1 shl pTell and GAlive <> 0) and
     2462            (RW[P].Treaty[pTell] = trAlliance) then
    24622463          begin
    24632464            OldLevel := ObserveLevel[Loc1] shr (2 * pTell) and 3;
    24642465            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;
    24672468          end;
    24682469      end
    24692470      else
    24702471      begin
    2471         OldLevel := ObserveLevel[Loc1] shr (2 * p) and 3;
     2472        OldLevel := ObserveLevel[Loc1] shr (2 * P) and 3;
    24722473        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;
     2477end;
     2478
     2479function Discover21(Loc, P, AdjacentLevel: Integer;
     2480  TellAllied, EnableContact: Boolean): Boolean;
     2481var
     2482  V21, Loc1, pTell, Level, OldLevel, AdjacentFlags: Integer;
    24822483  Radius: TVicinity21Loc;
    24832484begin
    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;
    24862487  AdjacentFlags := $00267620 shr 1;
    24872488  V21_to_Loc(Loc, Radius);
     
    24982499      begin
    24992500        for pTell := 0 to nPl - 1 do
    2500           if (pTell = p) or (1 shl pTell and GAlive <> 0) and
    2501             (RW[p].Treaty[pTell] = trAlliance) then
     2501          if (pTell = P) or (1 shl pTell and GAlive <> 0) and
     2502            (RW[P].Treaty[pTell] = trAlliance) then
    25022503          begin
    25032504            OldLevel := ObserveLevel[Loc1] shr (2 * pTell) and 3;
    25042505            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;
    25072508          end;
    25082509      end
    25092510      else
    25102511      begin
    2511         OldLevel := ObserveLevel[Loc1] shr (2 * p) and 3;
     2512        OldLevel := ObserveLevel[Loc1] shr (2 * P) and 3;
    25122513        if Level > OldLevel then
    2513           result := DiscoverTile(Loc1, p, p, Level, EnableContact) or result;
     2514          Result := DiscoverTile(Loc1, P, P, Level, EnableContact) or Result;
    25142515      end;
    25152516    end;
     
    25182519end;
    25192520
    2520 procedure DiscoverAll(p, Level: integer);
     2521procedure DiscoverAll(P, Level: Integer);
    25212522{ player p discovers complete playground (for supervisor) }
    25222523var
    2523   Loc, OldLevel: integer;
    2524 begin
    2525   assert((Mode > moLoading_Fast) or (RW[p].nEnemyUn = 0));
     2524  Loc, OldLevel: Integer;
     2525begin
     2526  Assert((Mode > moLoading_Fast) or (RW[P].nEnemyUn = 0));
    25262527  for Loc := 0 to MapSize - 1 do
    25272528  begin
    2528     OldLevel := ObserveLevel[Loc] shr (2 * p) and 3;
     2529    OldLevel := ObserveLevel[Loc] shr (2 * P) and 3;
    25292530    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;
     2533end;
     2534
     2535procedure DiscoverViewAreas(P: Integer);
     2536var
     2537  pTell, uix, cix, ecix, Loc, RealOwner: Integer;
    25372538  PModel: ^TModel;
    25382539begin // discover unit and city view areas
    25392540  for pTell := 0 to nPl - 1 do
    2540     if (pTell = p) or (RW[p].Treaty[pTell] = trAlliance) then
     2541    if (pTell = P) or (RW[P].Treaty[pTell] = trAlliance) then
    25412542    begin
    25422543      for uix := 0 to RW[pTell].nUn - 1 do
     
    25462547            PModel := @RW[pTell].Model[mix];
    25472548            if (PModel.Kind = mkDiplomat) or (PModel.Cap[mcSpy] > 0) then
    2548               Discover21(Loc, p, lObserveSuper, false, true)
     2549              Discover21(Loc, P, lObserveSuper, False, True)
    25492550            else if (PModel.Cap[mcRadar] + PModel.Cap[mcCarrier] > 0) or
    25502551              (PModel.Domain = dAir) then
    2551               Discover21(Loc, p, lObserveAll, false, false)
     2552              Discover21(Loc, P, lObserveAll, False, False)
    25522553            else if (RealMap[Loc] and fTerrain = fMountains) or
    25532554              (RealMap[Loc] and fTerImp = tiFort) or
    25542555              (RealMap[Loc] and fTerImp = tiBase) or (PModel.Cap[mcAcademy] > 0)
    25552556            then
    2556               Discover21(Loc, p, lObserveUnhidden, false,
     2557              Discover21(Loc, P, lObserveUnhidden, False,
    25572558                PModel.Domain = dGround)
    25582559            else
    2559               Discover9(Loc, p, lObserveUnhidden, false,
     2560              Discover9(Loc, P, lObserveUnhidden, False,
    25602561                PModel.Domain = dGround);
    25612562          end;
    25622563      for cix := 0 to RW[pTell].nCity - 1 do
    25632564        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);
    25652566      for ecix := 0 to RW[pTell].nEnemyCity - 1 do
    25662567      begin // players know territory, so no use in hiding city owner
     
    25742575          begin
    25752576            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;
    25772578          end;
    25782579        end;
     
    25812582end;
    25822583
    2583 function GetUnitStack(p, Loc: integer): integer;
    2584 var
    2585   uix: integer;
     2584function GetUnitStack(P, Loc: Integer): Integer;
     2585var
     2586  uix: Integer;
    25862587  unx: ^TUn;
    25872588begin
    2588   result := 0;
     2589  Result := 0;
    25892590  if Occupant[Loc] < 0 then
    2590     exit;
     2591    Exit;
    25912592  for uix := 0 to RW[Occupant[Loc]].nUn - 1 do
    25922593  begin
     
    25942595    if unx.Loc = Loc then
    25952596    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;
     2604end;
     2605
     2606procedure UpdateUnitMap(Loc: Integer; CityChange: Boolean = False);
    26062607// update maps and enemy units of all players after unit change
    26072608var
    2608   p, euix, OldLevel: integer;
     2609  P, euix, OldLevel: Integer;
    26092610  AddFlags, ClearFlags: Cardinal;
    26102611begin
    26112612  if (Mode = moLoading_Fast) and not CityChange then
    2612     exit;
    2613   for p := 0 to nPl - 1 do
    2614     if 1 shl p and (GAlive or GWatching) <> 0 then
    2615     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;
    26172618      if OldLevel > lNoObserve then
    26182619      begin
    2619         if RW[p].Map[Loc] and (fUnit or fOwned) = fUnit then
     2620        if RW[P].Map[Loc] and (fUnit or fOwned) = fUnit then
    26202621        begin
    26212622          // replace unit located here in EnemyUn
    26222623          // do not just set loc:=-1 because total number would be unlimited
    2623           euix := RW[p].nEnemyUn - 1;
     2624          euix := RW[P].nEnemyUn - 1;
    26242625          while euix >= 0 do
    26252626          begin
    2626             if RW[p].EnemyUn[euix].Loc = Loc then
     2627            if RW[P].EnemyUn[euix].Loc = Loc then
    26272628            begin
    2628               RW[p].EnemyUn[euix].Loc := -1;
     2629              RW[P].EnemyUn[euix].Loc := -1;
    26292630              Break;
    26302631            end;
    2631             dec(euix);
     2632            Dec(euix);
    26322633          end;
    2633           RW[p].Map[Loc] := RW[p].Map[Loc] and not fUnit
     2634          RW[P].Map[Loc] := RW[P].Map[Loc] and not fUnit
    26342635        end
    26352636        else
    26362637        begin // look for empty slot in EnemyUn
    2637           euix := RW[p].nEnemyUn - 1;
    2638           while (euix >= 0) and (RW[p].EnemyUn[euix].Loc >= 0) do
    2639             dec(euix);
     2638          euix := RW[P].nEnemyUn - 1;
     2639          while (euix >= 0) and (RW[P].EnemyUn[euix].Loc >= 0) do
     2640            Dec(euix);
    26402641        end;
    26412642        if (Occupant[Loc] < 0) and not CityChange then
     
    26442645          if RealMap[Loc] and fCity = 0 then
    26452646            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;
    26472648        end
    2648         else if (Occupant[Loc] <> p) or CityChange then
     2649        else if (Occupant[Loc] <> P) or CityChange then
    26492650        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);
    26522653        end
    26532654        else { if (Occupant[Loc]=p) and not CityChange then }
     
    26592660          else
    26602661            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;
     2666end;
     2667
     2668procedure RecalcV8ZoC(P, Loc: Integer);
    26682669// recalculate fInEnemyZoC flags around single tile
    26692670var
    2670   V8, V8V8, Loc1, Loc2, p1, ObserveMask: integer;
     2671  V8, V8V8, Loc1, Loc2, p1, ObserveMask: Integer;
    26712672  Tile1: ^Cardinal;
    26722673  Adjacent, AdjacentAdjacent: TVicinity8Loc;
    26732674begin
    26742675  if Mode = moLoading_Fast then
    2675     exit;
    2676   ObserveMask := 3 shl (2 * p);
     2676    Exit;
     2677  ObserveMask := 3 shl (2 * P);
    26772678  V8_to_Loc(Loc, Adjacent);
    26782679  for V8 := 0 to 7 do
     
    26812682    if (Loc1 >= 0) and (Loc1 < MapSize) then
    26822683    begin
    2683       Tile1 := @RW[p].Map[Loc1];
     2684      Tile1 := @RW[P].Map[Loc1];
    26842685      Tile1^ := Tile1^ and not fInEnemyZoC;
    26852686      V8_to_Loc(Loc1, AdjacentAdjacent);
     
    26912692        begin
    26922693          p1 := Occupant[Loc2];
    2693           assert(p1 <> nPl);
    2694           if (p1 <> p) and (RW[p].Treaty[p1] < trAlliance) then
     2694          Assert(p1 <> nPl);
     2695          if (p1 <> P) and (RW[P].Treaty[p1] < trAlliance) then
    26952696          begin
    26962697            Tile1^ := Tile1^ or fInEnemyZoC;
    2697             Break
     2698            Break;
    26982699          end;
    26992700        end;
     
    27032704end;
    27042705
    2705 procedure RecalcMapZoC(p: integer);
     2706procedure RecalcMapZoC(P: Integer);
    27062707// recalculate fInEnemyZoC flags for the whole map
    27072708var
    2708   Loc, Loc1, V8, p1, ObserveMask: integer;
     2709  Loc, Loc1, V8, p1, ObserveMask: Integer;
    27092710  Adjacent: TVicinity8Loc;
    27102711begin
    27112712  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);
    27152716  for Loc := 0 to MapSize - 1 do
    27162717    if (ZoCMap[Loc] > 0) and (ObserveLevel[Loc] and ObserveMask <> 0) then
    27172718    begin
    27182719      p1 := Occupant[Loc];
    2719       assert(p1 <> nPl);
    2720       if (p1 <> p) and (RW[p].Treaty[p1] < trAlliance) then
     2720      Assert(p1 <> nPl);
     2721      if (p1 <> P) and (RW[P].Treaty[p1] < trAlliance) then
    27212722      begin // this non-allied enemy ZoC unit is known to this player -- set flags!
    27222723        V8_to_Loc(Loc, Adjacent);
     
    27252726          Loc1 := Adjacent[V8];
    27262727          if (Loc1 >= 0) and (Loc1 < MapSize) then
    2727             RW[p].Map[Loc1] := RW[p].Map[Loc1] or fInEnemyZoC
    2728         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;
     2732end;
     2733
     2734procedure RecalcPeaceMap(P: Integer);
    27342735// recalculate fPeace flags for the whole map
    27352736var
    2736   Loc, p1: integer;
    2737   PeacePlayer: array [-1 .. nPl - 1] of boolean;
     2737  Loc, p1: Integer;
     2738  PeacePlayer: array [-1 .. nPl - 1] of Boolean;
    27382739begin
    27392740  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)));
    27422743  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]);
    27452746  for Loc := 0 to MapSize - 1 do
    2746     if PeacePlayer[RW[p].Territory[Loc]] then
    2747       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;
    27482749end;
    27492750
     
    27552756  BorderChanges: array [0 .. sIntExpandTerritory and $F - 1] of Cardinal;
    27562757
    2757 procedure ChangeTerritory(Loc, p: integer);
    2758 var
    2759   p1: integer;
    2760 begin
    2761   Assert(p >= 0); // no player's territory indicated by p=nPl
     2758procedure ChangeTerritory(Loc, P: Integer);
     2759var
     2760  p1: Integer;
     2761begin
     2762  Assert(P >= 0); // no player's territory indicated by p=nPl
    27622763  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 then
    2766     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;
    27672768  for p1 := 0 to nPl - 1 do
    27682769    if 1 shl p1 and (GAlive or GWatching) <> 0 then
    27692770      if RW[p1].Map[Loc] and fTerrain <> fUNKNOWN then
    27702771      begin
    2771         RW[p1].Territory[Loc] := p;
    2772         if (p < nPl) and (p <> p1) and (1 shl p and GAlive <> 0) and
    2773           (RW[p1].Treaty[p] in [trPeace, TrFriendlyContact]) then
     2772        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
    27742775          RW[p1].Map[Loc] := RW[p1].Map[Loc] or fPeace
    27752776        else
     
    27782779end;
    27792780
    2780 procedure ExpandTerritory(OriginLoc: integer);
    2781 var
    2782   i, dx, dy, dxMax, dyMax, Loc, NewOwner: integer;
     2781procedure ExpandTerritory(OriginLoc: Integer);
     2782var
     2783  I, dx, dy, dxMax, dyMax, Loc, NewOwner: Integer;
    27832784begin
    27842785  if OriginLoc = -1 then
    27852786    raise Exception.Create('Location error');
    2786   i := 0;
     2787  I := 0;
    27872788  dyMax := 0;
    27882789  while (dyMax + 1) + (dyMax + 1) shr 1 <= CountryRadius do
    2789     inc(dyMax);
     2790    Inc(dyMax);
    27902791  for dy := -dyMax to dyMax do
    27912792  begin
     
    27932794    while abs(dy) + (dxMax + 2) + abs(abs(dy) - (dxMax + 2)) shr 1 <=
    27942795      CountryRadius do
    2795       inc(dxMax, 2);
     2796      Inc(dxMax, 2);
    27962797    for dx := -dxMax to dxMax do
    27972798      if (dy + dx) and 1 = 0 then
    27982799      begin
    2799         NewOwner := BorderChanges[i div 8] shr (i mod 8 * 4) and $F;
     2800        NewOwner := BorderChanges[I div 8] shr (I mod 8 * 4) and $F;
    28002801        Loc := dLoc(OriginLoc, dx, dy);
    28012802        if (Loc >= 0) and (Cardinal(NewOwner) <> RealMap[Loc] shr 27) then
    28022803          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;
     2807end;
     2808
     2809procedure CheckBorders(OriginLoc, PlayerLosingCity: Integer);
    28092810// OriginLoc: only changes in CountryRadius around this location possible,
    28102811// -1 for complete map, -2 for double-check (no more changes allowed)
     
    28122813// player's territory, -1 for full border recalculation
    28132814var
    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;
    28152816  NewOwner: Cardinal;
    28162817  Adjacent: TVicinity8Loc;
    2817   AtPeace: array [0 .. nPl, 0 .. nPl] of boolean;
     2818  AtPeace: array [0 .. nPl, 0 .. nPl] of Boolean;
    28182819  Country, FormerCountry, { to who's country a tile belongs }
    28192820  Dist, FormerDist, StolenDist: array [0 .. lxmax * lymax - 1] of ShortInt;
     
    28272828        StolenDist[RW[PlayerLosingCity].City[cix].Loc] := 0;
    28282829
    2829     for r := 1 to CountryRadius shr 1 do
    2830     begin
    2831       move(StolenDist, FormerDist, MapSize);
     2830    for R := 1 to CountryRadius shr 1 do
     2831    begin
     2832      Move(StolenDist, FormerDist, MapSize);
    28322833      for Loc := 0 to MapSize - 1 do
    28332834        if (FormerDist[Loc] <= CountryRadius - 2)
     
    28612862        end;
    28622863
    2863   for r := 1 to CountryRadius shr 1 do
    2864   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);
    28672868    for Loc := 0 to MapSize - 1 do
    28682869      if (FormerDist[Loc] <= CountryRadius - 2) // use same conditions as above!
     
    28702871        (1 shl fShore + 1 shl fMountains + 1 shl fArctic) = 0) then
    28712872      begin
    2872         assert(FormerCountry[Loc] >= 0);
     2873        Assert(FormerCountry[Loc] >= 0);
    28732874        V8_to_Loc(Loc, Adjacent);
    28742875        for V8 := 0 to 7 do
     
    28852886  end;
    28862887
    2887   FillChar(AtPeace, SizeOf(AtPeace), false);
     2888  FillChar(AtPeace, SizeOf(AtPeace), False);
    28882889  for p1 := 0 to nPl - 1 do
    28892890    if 1 shl p1 and GAlive <> 0 then
     
    28912892        if (p2 <> p1) and (1 shl p2 and GAlive <> 0) and
    28922893          (RW[p1].Treaty[p2] >= trPeace) then
    2893           AtPeace[p1, p2] := true;
     2894          AtPeace[p1, p2] := True;
    28942895
    28952896  if OriginLoc >= 0 then
    28962897  begin // update area only
    2897     i := 0;
     2898    I := 0;
    28982899    FillChar(BorderChanges, SizeOf(BorderChanges), 0);
    28992900    dyMax := 0;
    29002901    while (dyMax + 1) + (dyMax + 1) shr 1 <= CountryRadius do
    2901       inc(dyMax);
     2902      Inc(dyMax);
    29022903    for dy := -dyMax to dyMax do
    29032904    begin
     
    29052906      while abs(dy) + (dxMax + 2) + abs(abs(dy) - (dxMax + 2)) shr 1 <=
    29062907        CountryRadius do
    2907         inc(dxMax, 2);
     2908        Inc(dxMax, 2);
    29082909      for dx := -dxMax to dxMax do
    29092910        if (dy + dx) and 1 = 0 then
     
    29212922              else
    29222923                ChangeTerritory(Loc, NewOwner);
    2923             BorderChanges[i shr 3] := BorderChanges[i shr 3] or
    2924               ((NewOwner shl ((i and 7) * 4)) and $ffffffff);
     2924            BorderChanges[I shr 3] := BorderChanges[I shr 3] or
     2925              ((NewOwner shl ((I and 7) * 4)) and $ffffffff);
    29252926          end;
    2926           inc(i);
     2927          Inc(I);
    29272928        end;
    29282929    end;
     
    29372938      then
    29382939      begin
    2939         assert(OriginLoc <> -2); // test if border saving works
     2940        Assert(OriginLoc <> -2); // test if border saving works
    29402941        ChangeTerritory(Loc, NewOwner);
    29412942      end;
     
    29442945{$IFOPT O-} if OriginLoc <> -2 then
    29452946    CheckBorders(-2); {$ENDIF} // check: single pass should do!
    2946 end; // CheckBorders
    2947 
    2948 procedure LogCheckBorders(p, cix, PlayerLosingCity: integer);
    2949 begin
    2950   CheckBorders(RW[p].City[cix].Loc, PlayerLosingCity);
    2951   IntServer(sIntExpandTerritory, p, cix, BorderChanges);
     2947end;
     2948
     2949procedure LogCheckBorders(P, cix, PlayerLosingCity: Integer);
     2950begin
     2951  CheckBorders(RW[P].City[cix].Loc, PlayerLosingCity);
     2952  IntServer(sIntExpandTerritory, P, cix, BorderChanges);
    29522953end;
    29532954
     
    29572958}
    29582959
    2959 procedure CreateUnit(p, mix: integer);
    2960 begin
    2961   with RW[p] do
     2960procedure CreateUnit(P, mix: Integer);
     2961begin
     2962  with RW[P] do
    29622963  begin
    29632964    Un[nUn].mix := mix;
    29642965    with Un[nUn] do
    29652966    begin
    2966       ID := UnBuilt[p];
    2967       inc(UnBuilt[p]);
     2967      ID := UnBuilt[P];
     2968      Inc(UnBuilt[P]);
    29682969      Status := 0;
    29692970      SavedStatus := 0;
    2970       inc(Model[mix].Built);
     2971      Inc(Model[mix].Built);
    29712972      Home := -1;
    29722973      Health := 100;
     
    29762977      begin
    29772978        Fuel := Model[mix].Cap[mcFuel];
    2978         Flags := Flags or unBombsLoaded
     2979        Flags := Flags or unBombsLoaded;
    29792980      end;
    29802981      Job := jNone;
     
    29842985      Master := -1;
    29852986    end;
    2986     inc(nUn);
     2987    Inc(nUn);
    29872988  end
    29882989end;
    29892990
    2990 procedure FreeUnit(p, uix: integer);
     2991procedure FreeUnit(P, uix: Integer);
    29912992// loc or master should be set after call
    29922993// implementation is critical for loading performance, change carefully
    29932994var
    2994   Loc0, uix1: integer;
    2995   Occ, ZoC: boolean;
    2996 begin
    2997   with RW[p].Un[uix] do
     2995  Loc0, uix1: Integer;
     2996  Occ, ZoC: Boolean;
     2997begin
     2998  with RW[P].Un[uix] do
    29982999  begin
    29993000    Job := jNone;
    30003001    Flags := Flags and not(unFortified or unMountainDelay);
    3001     Loc0 := Loc
     3002    Loc0 := Loc;
    30023003  end;
    30033004  if Occupant[Loc0] >= 0 then
    30043005  begin
    3005     assert(Occupant[Loc0] = p);
    3006     Occ := false;
    3007     ZoC := false;
    3008     for uix1 := 0 to RW[p].nUn - 1 do
    3009       with RW[p].Un[uix1] do
     3006    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
    30103011        if (Loc = Loc0) and (Master < 0) and (uix1 <> uix) then
    30113012        begin
    3012           Occ := true;
    3013           if RW[p].Model[mix].Flags and mdZOC <> 0 then
     3013          Occ := True;
     3014          if RW[P].Model[mix].Flags and mdZOC <> 0 then
    30143015          begin
    3015             ZoC := true;
    3016             Break
    3017           end
     3016            ZoC := True;
     3017            Break;
     3018          end;
    30183019        end;
    30193020    if not Occ then
     
    30243025end;
    30253026
    3026 procedure PlaceUnit(p, uix: integer);
    3027 begin
    3028   with RW[p].Un[uix] do
    3029   begin
    3030     Occupant[Loc] := p;
    3031     if RW[p].Model[mix].Flags and mdZOC <> 0 then
     3027procedure PlaceUnit(P, uix: Integer);
     3028begin
     3029  with RW[P].Un[uix] do
     3030  begin
     3031    Occupant[Loc] := P;
     3032    if RW[P].Model[mix].Flags and mdZOC <> 0 then
    30323033      ZoCMap[Loc] := 1;
    30333034  end;
    30343035end;
    30353036
    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);
     3037procedure CountLost(P, mix, Enemy: Integer);
     3038begin
     3039  Inc(RW[P].Model[mix].Lost);
     3040  TellAboutModel(Enemy, P, mix);
     3041  Inc(Destroyed[Enemy, P, mix]);
     3042end;
     3043
     3044procedure RemoveUnit(P, uix: Integer; Enemy: Integer = -1);
    30443045// use enemy only from inside sMoveUnit if attack
    30453046var
    3046   uix1: integer;
    3047 begin
    3048   with RW[p].Un[uix] do
    3049   begin
    3050     assert((Loc >= 0) or (RW[p].Model[mix].Kind = mkDiplomat));
     3047  uix1: Integer;
     3048begin
     3049  with RW[P].Un[uix] do
     3050  begin
     3051    Assert((Loc >= 0) or (RW[P].Model[mix].Kind = mkDiplomat));
    30513052    // already freed when spy mission
    30523053    if Loc >= 0 then
    3053       FreeUnit(p, uix);
     3054      FreeUnit(P, uix);
    30543055    if Master >= 0 then
    3055       if RW[p].Model[mix].Domain = dAir then
    3056         dec(RW[p].Un[Master].AirLoad)
     3056      if RW[P].Model[mix].Domain = dAir then
     3057        Dec(RW[P].Un[Master].AirLoad)
    30573058      else
    3058         dec(RW[p].Un[Master].TroopLoad);
     3059        Dec(RW[P].Un[Master].TroopLoad);
    30593060    if (TroopLoad > 0) or (AirLoad > 0) then
    3060       for uix1 := 0 to RW[p].nUn - 1 do
    3061         if (RW[p].Un[uix1].Loc >= 0) and (RW[p].Un[uix1].Master = uix) then
     3061      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
    30623063        { unit mastered by removed unit -- remove too }
    30633064        begin
    3064           RW[p].Un[uix1].Loc := -1;
     3065          RW[P].Un[uix1].Loc := -1;
    30653066          if Enemy >= 0 then
    3066             CountLost(p, RW[p].Un[uix1].mix, Enemy);
     3067            CountLost(P, RW[P].Un[uix1].mix, Enemy);
    30673068        end;
    30683069    Loc := -1;
    30693070    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;
     3073end;
     3074
     3075procedure RemoveUnit_UpdateMap(P, uix: Integer);
    30753076var
    30763077  Loc0: Integer;
    30773078begin
    3078   Loc0 := RW[p].Un[uix].Loc;
    3079   RemoveUnit(p, uix);
     3079  Loc0 := RW[P].Un[uix].Loc;
     3080  RemoveUnit(P, uix);
    30803081  if Mode > moLoading_Fast then
    30813082    UpdateUnitMap(Loc0);
    30823083end;
    30833084
    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 do
    3089     if RW[p].Un[uix].Loc = Loc then
     3085procedure RemoveAllUnits(P, Loc: Integer; Enemy: Integer = -1);
     3086var
     3087  uix: Integer;
     3088begin
     3089  for uix := 0 to RW[P].nUn - 1 do
     3090    if RW[P].Un[uix].Loc = Loc then
    30903091    begin
    30913092      if Enemy >= 0 then
    3092         CountLost(p, RW[p].Un[uix].mix, Enemy);
    3093       RW[p].Un[uix].Loc := -1
     3093        CountLost(P, RW[P].Un[uix].mix, Enemy);
     3094      RW[P].Un[uix].Loc := -1;
    30943095    end;
    30953096  Occupant[Loc] := -1;
     
    30973098end;
    30983099
    3099 procedure RemoveDomainUnits(d, p, Loc: integer);
    3100 var
    3101   uix: integer;
    3102 begin
    3103   for uix := 0 to RW[p].nUn - 1 do
    3104     if (RW[p].Model[RW[p].Un[uix].mix].Domain = d) and (RW[p].Un[uix].Loc = Loc)
     3100procedure RemoveDomainUnits(D, P, Loc: Integer);
     3101var
     3102  uix: Integer;
     3103begin
     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)
    31053106    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 then
    3114     exit;
    3115   inc(RW[p].nCity);
    3116   with RW[p].City[RW[p].nCity - 1] do
     3107      RemoveUnit(P, uix);
     3108end;
     3109
     3110procedure FoundCity(P, FoundLoc: Integer);
     3111var
     3112  p1, cix1, V21, dx, dy: Integer;
     3113begin
     3114  if RW[P].nCity = ncmax then
     3115    Exit;
     3116  Inc(RW[P].nCity);
     3117  with RW[P].City[RW[P].nCity - 1] do
    31173118  begin
    31183119    Size := 2;
     
    31303131    if UsedByCity[FoundLoc] >= 0 then
    31313132    begin { central tile is exploited - toggle in exploiting city }
    3132       p1 := p;
     3133      p1 := P;
    31333134      SearchCity(UsedByCity[FoundLoc], p1, cix1);
    31343135      dxdy(UsedByCity[FoundLoc], FoundLoc, dx, dy);
     
    31413142      (fTerrain or fSpecial or fRiver or nPl shl 27) or fCity;
    31423143
    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 do
    3152     if RW[p].City[cix].Built[i] = 1 then
    3153     begin
    3154       GWonder[i].EffectiveOwner := -1;
    3155       if i = woPyramids then
     3144    ChangeTerritory(Loc, P);
     3145  end;
     3146end;
     3147
     3148procedure StealCity(P, cix: Integer; SaveUnits: Boolean);
     3149var
     3150  I, J, uix1, cix1, nearest: Integer;
     3151begin
     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
    31563157        FreeSlaves;
    3157       if i = woEiffel then // deactivate expired wonders
    3158         for j := 0 to nWonder - 1 do
    3159           if GWonder[j].EffectiveOwner = p then
    3160             CheckExpiration(j);
    3161     end;
    3162   for i := nWonder to nImp - 1 do
    3163     if (Imp[i].Kind <> ikCommon) and (RW[p].City[cix].Built[i] > 0) then
     3158      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
    31643165    begin { destroy national projects }
    3165       RW[p].NatBuilt[i] := 0;
    3166       if i = imGrWall then
    3167         GrWallContinent[p] := -1;
    3168     end;
    3169 
    3170   for uix1 := 0 to RW[p].nUn - 1 do
    3171     with RW[p].Un[uix1] do
     3166      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
    31723173      if (Loc >= 0) and (Home = cix) then
    31733174        if SaveUnits then
    31743175        begin // support units by nearest other city
    31753176          nearest := -1;
    3176           for cix1 := 0 to RW[p].nCity - 1 do
    3177             if (cix1 <> cix) and (RW[p].City[cix1].Loc >= 0) and
    3178               ((nearest < 0) or (Distance(RW[p].City[cix1].Loc, Loc) <
    3179               Distance(RW[p].City[nearest].Loc, Loc))) then
     3177          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
    31803181              nearest := cix1;
    3181           Home := nearest
     3182          Home := nearest;
    31823183        end
    31833184        else
    3184           RemoveUnit(p, uix1); // destroy supported units
    3185 end;
    3186 
    3187 procedure DestroyCity(p, cix: integer; SaveUnits: boolean);
    3188 var
    3189   i, V21: integer;
     3185          RemoveUnit(P, uix1); // destroy supported units
     3186end;
     3187
     3188procedure DestroyCity(P, cix: Integer; SaveUnits: Boolean);
     3189var
     3190  I, V21: Integer;
    31903191  Radius: TVicinity21Loc;
    31913192begin
    3192   StealCity(p, cix, SaveUnits);
    3193   with RW[p].City[cix] do begin
    3194     for i := 0 to nWonder - 1 do
    3195       if Built[i] > 0 then
    3196         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;
    31973198    V21_to_Loc(Loc, Radius);
    31983199    for V21 := 1 to 26 do
     
    32003201        UsedByCity[Radius[V21]] := -1;
    32013202    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;
     3205end;
     3206
     3207procedure ChangeCityOwner(pOld, cixOld, pNew: Integer);
     3208var
     3209  I, J, cix1, Loc1, V21: Integer;
    32093210  Radius: TVicinity21Loc;
    32103211begin
    3211   inc(RW[pNew].nCity);
     3212  Inc(RW[pNew].nCity);
    32123213  RW[pNew].City[RW[pNew].nCity - 1] := RW[pOld].City[cixOld];
    3213   StealCity(pOld, cixOld, false);
     3214  StealCity(pOld, cixOld, False);
    32143215  RW[pOld].City[cixOld].Loc := -1;
    32153216  with RW[pNew].City[(RW[pNew].nCity - 1)] do
     
    32303231      begin
    32313232        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));
    32333234        if (ZoCMap[Loc1] > 0) and (Occupant[Loc1] <> pNew) and
    32343235          (RW[pNew].Treaty[Occupant[Loc1]] < trAlliance) then
     
    32423243    Built[imTownHall] := 0;
    32433244    Built[imCourt] := 0;
    3244     for i := nWonder to nImp - 1 do
    3245       if Imp[i].Kind <> ikCommon then
    3246         Built[i] := 0; { destroy national projects }
    3247     for i := 0 to nWonder - 1 do
    3248       if Built[i] = 1 then
     3245    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
    32493250      begin // new wonder owner!
    3250         GWonder[i].EffectiveOwner := pNew;
    3251         if i = woEiffel then // reactivate expired wonders
    3252         begin
    3253           for j := 0 to nWonder - 1 do
    3254             if Imp[j].Expiration >= 0 then
     3251        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
    32553256              for cix1 := 0 to (RW[pNew].nCity - 1) do
    3256                 if RW[pNew].City[cix1].Built[j] = 1 then
    3257                   GWonder[j].EffectiveOwner := pNew;
     3257                if RW[pNew].City[cix1].Built[J] = 1 then
     3258                  GWonder[J].EffectiveOwner := pNew;
    32583259        end
    32593260        else
    3260           CheckExpiration(i);
    3261         case i of
     3261          CheckExpiration(I);
     3262        case I of
    32623263          woLighthouse:
    32633264            CheckSpecialModels(pNew, preLighthouse);
     
    32733274    cix1 := RW[pNew].nEnemyCity - 1;
    32743275    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);
    32773278    RW[pNew].EnemyCity[cix1].Loc := -1;
    32783279
     
    32813282end;
    32823283
    3283 procedure CompleteJob(p, Loc, Job: integer);
    3284 var
    3285   ChangedTerrain, p1: integer;
    3286 begin
    3287   assert(Job <> jCity);
     3284procedure CompleteJob(P, Loc, Job: Integer);
     3285var
     3286  ChangedTerrain, p1: Integer;
     3287begin
     3288  Assert(Job <> jCity);
    32883289  ChangedTerrain := -1;
    32893290  case Job of
     
    33273328        if not(RealMap[Loc] and fTerrain in TerrType_Canalable) then
    33283329        begin
    3329           RemoveDomainUnits(dSea, p, Loc);
     3330          RemoveDomainUnits(dSea, P, Loc);
    33303331          RealMap[Loc] := RealMap[Loc] and not fCanal;
    33313332        end;
     
    33393340      begin
    33403341        if RealMap[Loc] and fTerImp = tiBase then
    3341           RemoveDomainUnits(dAir, p, Loc);
     3342          RemoveDomainUnits(dAir, P, Loc);
    33423343        RealMap[Loc] := RealMap[Loc] and not fTerImp
    33433344      end
    33443345      else if RealMap[Loc] and fCanal <> 0 then
    33453346      begin
    3346         RemoveDomainUnits(dSea, p, Loc);
     3347        RemoveDomainUnits(dSea, P, Loc);
    33473348        RealMap[Loc] := RealMap[Loc] and not fCanal
    33483349      end
     
    33743375          fPoll) or RealMap[Loc] and (fTerrain or fSpecial or fTerImp or
    33753376          fRoad or fRR or fCanal or fPoll);
    3376 end; // CompleteJob
     3377end;
    33773378
    33783379{
     
    33803381  ____________________________________________________________________
    33813382}
    3382 procedure GiveCivilReport(p, pAbout: integer);
    3383 begin
    3384   with RW[p].EnemyReport[pAbout]^ do
     3383procedure GiveCivilReport(P, pAbout: Integer);
     3384begin
     3385  with RW[P].EnemyReport[pAbout]^ do
    33853386  begin
    33863387    // general info
    33873388    TurnOfCivilReport := LastValidStat[pAbout];
    3388     move(RW[pAbout].Treaty, Treaty, SizeOf(Treaty));
     3389    Move(RW[pAbout].Treaty, Treaty, SizeOf(Treaty));
    33893390    Government := RW[pAbout].Government;
    33903391    Money := RW[pAbout].Money;
     
    33953396    if ResearchDone > 100 then
    33963397      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]^ do
     3398    Move(RW[pAbout].Tech, Tech, nAdv);
     3399  end;
     3400end;
     3401
     3402procedure GiveMilReport(P, pAbout: Integer);
     3403var
     3404  uix, mix: Integer;
     3405begin
     3406  with RW[P].EnemyReport[pAbout]^ do
    34063407  begin
    34073408    TurnOfMilReport := LastValidStat[pAbout];
     
    34093410    for mix := 0 to RW[pAbout].nModel - 1 do
    34103411    begin
    3411       TellAboutModel(p, pAbout, mix);
     3412      TellAboutModel(P, pAbout, mix);
    34123413      UnCount[mix] := 0
    34133414    end;
    34143415    for uix := 0 to RW[pAbout].nUn - 1 do
    34153416      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;
     3419end;
     3420
     3421procedure ShowPrice(pSender, pTarget, Price: Integer);
    34213422begin
    34223423  case Price and opMask of
     
    34333434end;
    34343435
    3435 function CopyCivilReport(pSender, pTarget, pAbout: integer): boolean;
    3436 var
    3437   i: integer;
     3436function CopyCivilReport(pSender, pTarget, pAbout: Integer): Boolean;
     3437var
     3438  I: Integer;
    34383439  rSender, rTarget: ^TEnemyReport;
    34393440begin // copy third nation civil report
    3440   result := false;
     3441  Result := False;
    34413442  if RW[pTarget].Treaty[pAbout] = trNoContact then
    34423443    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]);
    34453446  if rSender.TurnOfCivilReport > rTarget.TurnOfCivilReport then
    34463447  begin // only if newer than current information
     
    34513452    rTarget.ResearchTech := rSender.ResearchTech;
    34523453    rTarget.ResearchDone := rSender.ResearchDone;
    3453     result := true;
    3454   end;
    3455   for i := 0 to nAdv - 1 do
    3456     if rTarget.Tech[i] < rSender.Tech[i] then
    3457     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;
     3462end;
     3463
     3464function CopyMilReport(pSender, pTarget, pAbout: Integer): Boolean;
     3465var
     3466  mix: Integer;
    34663467  rSender, rTarget: ^TEnemyReport;
    34673468begin // copy third nation military report
    3468   result := false;
     3469  Result := False;
    34693470  if RW[pTarget].Treaty[pAbout] = trNoContact then
    34703471    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]);
    34733474  if rSender.TurnOfMilReport > rTarget.TurnOfMilReport then
    34743475  begin // only if newer than current information
    34753476    rTarget.TurnOfMilReport := rSender.TurnOfMilReport;
    34763477    rTarget.nModelCounted := rSender.nModelCounted;
    3477     move(rSender.UnCount, rTarget.UnCount, 2 * rSender.nModelCounted);
     3478    Move(rSender.UnCount, rTarget.UnCount, 2 * rSender.nModelCounted);
    34783479    for mix := 0 to rTarget.nModelCounted - 1 do
    34793480      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;
     3483end;
     3484
     3485procedure CopyModel(pSender, pTarget, mix: Integer);
     3486var
     3487  I: Integer;
    34873488  miSender, miTarget: TModelInfo;
    3488   ok: boolean;
     3489  ok: Boolean;
    34893490begin
    34903491  // only if target doesn't already have a model like this
    34913492  ok := RW[pTarget].nModel < nmmax;
    34923493  MakeModelInfo(pSender, mix, RW[pSender].Model[mix], miSender);
    3493   for i := 0 to RW[pTarget].nModel - 1 do
    3494   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);
    34963497    if IsSameModel(miSender, miTarget) then
    3497       ok := false;
     3498      ok := False;
    34983499  end;
    34993500  if ok then
     
    35103511      Lost := 0;
    35113512    end;
    3512     inc(RW[pTarget].nModel);
    3513     inc(Researched[pTarget]);
     3513    Inc(RW[pTarget].nModel);
     3514    Inc(Researched[pTarget]);
    35143515    TellAboutModel(pSender, pTarget, RW[pTarget].nModel - 1);
    35153516  end;
    35163517end;
    35173518
    3518 procedure CopyMap(pSender, pTarget: integer);
    3519 var
    3520   Loc, i, cix: integer;
     3519procedure CopyMap(pSender, pTarget: Integer);
     3520var
     3521  Loc, I, cix: Integer;
    35213522  Tile: Cardinal;
    35223523begin
     
    35283529      if Tile and fCity <> 0 then
    35293530      begin
    3530         i := 0;
    3531         while (i < RW[pTarget].nEnemyCity) and
    3532           (RW[pTarget].EnemyCity[i].Loc <> Loc) do
    3533           inc(i);
    3534         if i = RW[pTarget].nEnemyCity then
    3535         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;
    35403541        end;
    35413542        if Tile and fOwned <> 0 then
     
    35433544          cix := RW[pSender].nCity - 1;
    35443545          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]);
    35473548        end
    35483549        else // city not owned by sender -- copy old info
     
    35503551          cix := RW[pSender].nEnemyCity - 1;
    35513552          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];
    35543555        end;
    35553556      end
     
    35653566
    35663567      if RW[pTarget].Map[Loc] and fTerrain = fUNKNOWN then
    3567         inc(Discovered[pTarget]);
     3568        Inc(Discovered[pTarget]);
    35683569      RW[pTarget].Map[Loc] := RW[pTarget].Map[Loc] and fInEnemyZoC
    35693570      // always preserve this flag!
     
    35813582end;
    35823583
    3583 function PayPrice(pSender, pTarget, Price: integer; execute: boolean): boolean;
    3584 var
    3585   pSubject, i, n, NewTreaty: integer;
    3586 begin
    3587   result := true;
     3584function PayPrice(pSender, pTarget, Price: Integer; execute: Boolean): Boolean;
     3585var
     3586  pSubject, I, N, NewTreaty: Integer;
     3587begin
     3588  Result := True;
    35883589  case Price and opMask of
    35893590    opCivilReport: // + turn + concerned player shl 16
     
    35913592        pSubject := Price shr 16 and $F;
    35923593        if pTarget = pSubject then
    3593           result := false
     3594          Result := False
    35943595        else if pSender = pSubject then
    35953596        begin
    35963597          if execute then
    3597             GiveCivilReport(pTarget, pSender)
     3598            GiveCivilReport(pTarget, pSender);
    35983599        end
    35993600        else if RW[pSender].EnemyReport[pSubject].TurnOfCivilReport < 0 then
    3600           result := false
     3601          Result := False
    36013602        else if execute then
    36023603          CopyCivilReport(pSender, pTarget, pSubject);
     
    36063607        pSubject := Price shr 16 and $F;
    36073608        if pTarget = pSubject then
    3608           result := false
     3609          Result := False
    36093610        else if pSender = pSubject then
    36103611        begin
    36113612          if execute then
    3612             GiveMilReport(pTarget, pSender)
     3613            GiveMilReport(pTarget, pSender);
    36133614        end
    36143615        else if RW[pSender].EnemyReport[pSubject].TurnOfMilReport < 0 then
    3615           result := false
     3616          Result := False
    36163617        else if execute then
    3617           CopyMilReport(pSender, pTarget, pSubject)
     3618          CopyMilReport(pSender, pTarget, pSubject);
    36183619      end;
    36193620    opMap:
     
    36283629        begin // agreed treaty end
    36293630          if execute then
    3630             CancelTreaty(pSender, pTarget, false)
     3631            CancelTreaty(pSender, pTarget, False);
    36313632        end
    36323633        else
     
    36393640            NewTreaty := trPeace;
    36403641          if NewTreaty < 0 then
    3641             result := false
     3642            Result := False
    36423643          else if execute then
    36433644          begin
    3644             assert(NewTreaty > RW[pSender].Treaty[pTarget]);
     3645            Assert(NewTreaty > RW[pSender].Treaty[pTarget]);
    36453646            RW[pSender].Treaty[pTarget] := NewTreaty;
    36463647            RW[pTarget].Treaty[pSender] := NewTreaty;
     
    36713672    opShipParts: // + number + part type shl 16
    36723673      begin
    3673         n := Price and $FFFF; // number
    3674         i := Price shr 16 and $F; // type
    3675         if (i < nShipPart) and (GShip[pSender].Parts[i] >= n) then
     3674        N := Price and $FFFF; // number
     3675        I := Price shr 16 and $F; // type
     3676        if (I < nShipPart) and (GShip[pSender].Parts[I] >= N) then
    36763677        begin
    36773678          if execute then
    36783679          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];
    36823683            if RW[pTarget].NatBuilt[imSpacePort] > 0 then
    36833684            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];
    36873688            end;
    36883689          end;
    36893690        end
    36903691        else
    3691           result := false;
     3692          Result := False;
    36923693      end;
    36933694    opMoney: // + value
     
    36973698        if execute then
    36983699        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);
    37013702        end;
    37023703      end
    37033704      else
    3704         result := false;
     3705        Result := False;
    37053706    opTribute: // + value
    37063707      if execute then
     
    37173718      end
    37183719      else
    3719         result := false;
     3720        Result := False;
    37203721    opAllTech:
    37213722      if execute then
    3722         for i := 0 to nAdv - 1 do
    3723           if (RW[pSender].Tech[i] >= tsApplicable) and
    3724             (RW[pTarget].Tech[i] = tsNA) then
     3723        for I := 0 to nAdv - 1 do
     3724          if (RW[pSender].Tech[I] >= tsApplicable) and
     3725            (RW[pTarget].Tech[I] = tsNA) then
    37253726          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;
    37293730          end;
    37303731    opModel: // + model index
     
    37323733      begin
    37333734        if execute then
    3734           CopyModel(pSender, pTarget, Price - opModel)
     3735          CopyModel(pSender, pTarget, Price - opModel);
    37353736      end
    37363737      else
    3737         result := false;
     3738        Result := False;
    37383739    opAllModel:
    37393740      if execute then
    3740         for i := 0 to RW[pSender].nModel - 1 do
    3741         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);
    37443745        end;
    37453746    { opCity: // + city ID
    37463747      begin
    3747       result:=false
     3748      Result:=False
    37483749      end; }
    3749   end
    3750 end;
    3751 
    3752 procedure CancelTreaty(p, pWith: integer; DecreaseCredibility: boolean);
     3750  end;
     3751end;
     3752
     3753procedure CancelTreaty(P, pWith: Integer; DecreaseCredibility: Boolean);
    37533754// side effect: PeaceEnded := bitarray of players with which peace treaty was canceled
    37543755var
    3755   p1, OldTreaty: integer;
    3756 begin
    3757   OldTreaty := RW[p].Treaty[pWith];
     3756  p1, OldTreaty: Integer;
     3757begin
     3758  OldTreaty := RW[P].Treaty[pWith];
    37583759  PeaceEnded := 0;
    37593760  if OldTreaty >= trPeace then
    3760     RW[p].LastCancelTreaty[pWith] := GTurn;
     3761    RW[P].LastCancelTreaty[pWith] := GTurn;
    37613762  if DecreaseCredibility then
    37623763  begin
     
    37643765      trPeace:
    37653766        begin
    3766           RW[p].Credibility := RW[p].Credibility shr 1;
    3767           if RW[p].MaxCredibility > 0 then
    3768             dec(RW[p].MaxCredibility, 10);
    3769           if RW[p].Credibility > RW[p].MaxCredibility then
    3770             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;
    37713772        end;
    37723773      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;
    37763777  end;
    37773778
     
    37793780  begin
    37803781    for p1 := 0 to nPl - 1 do
    3781       if (p1 = pWith) or DecreaseCredibility and (p1 <> p) and
    3782         (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)
    37833784      then
    37843785      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);
    37903791      end;
    37913792    CheckBorders(-1);
    37923793    if (Mode > moLoading_Fast) and (PeaceEnded > 0) then
    3793       RecalcMapZoC(p);
     3794      RecalcMapZoC(P);
    37943795  end
    37953796  else
    37963797  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;
    37993800    if OldTreaty = TrFriendlyContact then
    38003801    begin // necessary for loading
    3801       GiveCivilReport(p, pWith);
    3802       GiveCivilReport(pWith, p);
     3802      GiveCivilReport(P, pWith);
     3803      GiveCivilReport(pWith, P);
    38033804    end
    38043805    else if OldTreaty = trAlliance then
    38053806    begin // necessary for loading
    3806       GiveMilReport(p, pWith);
    3807       GiveMilReport(pWith, p);
     3807      GiveMilReport(P, pWith);
     3808      GiveMilReport(pWith, P);
    38083809    end;
    38093810    if (Mode > moLoading_Fast) and (OldTreaty = trAlliance) then
    38103811    begin
    3811       RecalcMapZoC(p);
     3812      RecalcMapZoC(P);
    38123813      RecalcMapZoC(pWith);
    38133814    end;
     
    38153816  if OldTreaty in [trPeace, trAlliance] then
    38163817  begin
    3817     RecalcPeaceMap(p);
     3818    RecalcPeaceMap(P);
    38183819    RecalcPeaceMap(pWith);
    38193820  end;
    38203821end;
    38213822
    3822 function DoSpyMission(p, pCity, cix, Mission: integer): Cardinal;
    3823 var
    3824   p1: integer;
    3825 begin
    3826   result := 0;
     3823function DoSpyMission(P, pCity, cix, Mission: Integer): Cardinal;
     3824var
     3825  p1: Integer;
     3826begin
     3827  Result := 0;
    38273828  case Mission of
    38283829    smSabotageProd:
     
    38313832    smStealMap:
    38323833      begin
    3833         CopyMap(pCity, p);
    3834         RecalcPeaceMap(p);
     3834        CopyMap(pCity, P);
     3835        RecalcPeaceMap(P);
    38353836      end;
    38363837    smStealCivilReport:
    38373838      begin
    3838         if RW[p].Treaty[pCity] = trNoContact then
    3839           IntroduceEnemy(p, pCity);
    3840         GiveCivilReport(p, pCity);
     3839        if RW[P].Treaty[pCity] = trNoContact then
     3840          IntroduceEnemy(P, pCity);
     3841        GiveCivilReport(P, pCity);
    38413842      end;
    38423843    smStealMilReport:
    38433844      begin
    3844         if RW[p].Treaty[pCity] = trNoContact then
    3845           IntroduceEnemy(p, pCity);
    3846         GiveMilReport(p, pCity);
     3845        if RW[P].Treaty[pCity] = trNoContact then
     3846          IntroduceEnemy(P, pCity);
     3847        GiveMilReport(P, pCity);
    38473848      end;
    38483849    smStealForeignReports:
    38493850      begin
    38503851        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)
    38523853          then
    38533854          begin
    38543855            if RW[pCity].EnemyReport[p1].TurnOfCivilReport >= 0 then
    3855               if CopyCivilReport(pCity, p, p1) then
    3856                 result := result or (1 shl (2 * p1));
     3856              if CopyCivilReport(pCity, P, p1) then
     3857                Result := Result or (1 shl (2 * p1));
    38573858            if RW[pCity].EnemyReport[p1].TurnOfMilReport >= 0 then
    3858               if CopyMilReport(pCity, p, p1) then
    3859                 result := result or (2 shl (2 * p1));
     3859              if CopyMilReport(pCity, P, p1) then
     3860                Result := Result or (2 shl (2 * p1));
    38603861          end;
    38613862      end;
     
    38673868  ____________________________________________________________________
    38683869}
    3869 procedure ClearTestFlags(ClearFlags: integer);
    3870 var
    3871   p1: integer;
     3870procedure ClearTestFlags(ClearFlags: Integer);
     3871var
     3872  p1: Integer;
    38723873begin
    38733874  GTestFlags := GTestFlags and (not ClearFlags or tfTested or tfAllTechs or
     
    38783879end;
    38793880
    3880 procedure SetTestFlags(p, SetFlags: integer);
    3881 var
    3882   i, p1, p2, MoreFlags: integer;
     3881procedure SetTestFlags(P, SetFlags: Integer);
     3882var
     3883  I, p1, p2, MoreFlags: Integer;
    38833884begin
    38843885  MoreFlags := SetFlags and not GTestFlags;
     
    38953896          begin // make p1 and p2 know each other
    38963897            if RW[p1].Treaty[p2] = trNoContact then
    3897               IntroduceEnemy(p1, p2)
     3898              IntroduceEnemy(p1, p2);
    38983899          end;
    38993900
     
    39043905      if 1 shl p1 and GAlive <> 0 then
    39053906      begin
    3906         for i := 0 to nAdv - 1 do // give all techs to player p1
    3907           if not(i in FutureTech) and (RW[p1].Tech[i] < tsApplicable) then
     3907        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
    39083909          begin
    3909             RW[p1].Tech[i] := tsCheat;
    3910             CheckSpecialModels(p1, i);
     3910            RW[p1].Tech[I] := tsCheat;
     3911            CheckSpecialModels(p1, I);
    39113912          end;
    39123913        for p2 := 0 to nPl - 1 do
    39133914          if (p2 <> p1) and (1 shl p2 and (GAlive or GWatching) <> 0) then
    3914             for i := 1 to 3 do
    3915               if RW[p2].EnemyReport[p1].Tech[AgePreq[i]] < tsApplicable then
    3916                 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;
    39173918      end;
    39183919    end;
     
    39203921  if MoreFlags and tfUncover <> 0 then
    39213922  begin
    3922     DiscoverAll(p, lObserveSuper);
     3923    DiscoverAll(P, lObserveSuper);
    39233924    for p1 := 0 to nPl - 1 do
    39243925      if 1 shl p1 and GAlive <> 0 then
    39253926      begin
    39263927        ResourceMask[p1] := $FFFFFFFF;
    3927         if p1 <> p then
    3928         begin
    3929           GiveCivilReport(p, p1);
    3930           GiveMilReport(p, p1);
     3928        if p1 <> P then
     3929        begin
     3930          GiveCivilReport(P, p1);
     3931          GiveMilReport(P, p1);
    39313932        end;
    39323933      end;
     
    39383939  ____________________________________________________________________
    39393940}
    3940 procedure IntServer(Command, Player, Subject: integer; var Data);
    3941 var
    3942   i, p1: integer;
    3943 
     3941procedure IntServer(Command, Player, Subject: Integer; var Data);
     3942var
     3943  I, p1: Integer;
    39443944begin
    39453945  if Mode = moPlaying then
     
    39513951      begin
    39523952{$IFDEF TEXTLOG}CmdInfo := Format('IntTellAboutNation P%d+P%d', [Player, Subject]); {$ENDIF}
    3953         assert((Player >= 0) and (Player < nPl) and (Subject >= 0) and
     3953        Assert((Player >= 0) and (Player < nPl) and (Subject >= 0) and
    39543954          (Subject < nPl));
    39553955        IntroduceEnemy(Player, Subject);
     
    39593959      begin
    39603960{$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);
    39623962        RW[Player].EnemyReport[Subject].TurnOfContact := GTurn;
    39633963        RW[Subject].EnemyReport[Player].TurnOfContact := GTurn;
     
    39813981        p1 := (Command - sIntTellAboutModel) shr 4; // told player
    39823982{$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));
    39853985        MakeModelInfo(Player, Subject, RW[Player].Model[Subject],
    39863986          RW[p1].EnemyModel[RW[p1].nEnemyModel]);
    39873987        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);
    39903990      end;
    39913991
    39923992    sIntDiscoverZOC:
    39933993      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);
    39963996      end;
    39973997
     
    40004000      begin
    40014001{$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));
    40034003        ExpandTerritory(RW[Player].City[Subject].Loc);
    40044004      end;
     
    40074007      with RW[Player].City[Subject] do
    40084008      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));
    40114011        if (GWonder[woMich].EffectiveOwner = Player) and (Project and cpImp <> 0)
    40124012        then
    4013           inc(Prod, integer(Data) div 2)
     4013          Inc(Prod, Integer(Data) div 2)
    40144014        else
    4015           inc(Prod, integer(Data) div 4);
     4015          Inc(Prod, Integer(Data) div 4);
    40164016        if Project0 and not cpAuto <> Project and not cpAuto then
    40174017          Project0 := Project;
     
    40224022      begin
    40234023{$IFDEF TEXTLOG}CmdInfo := Format('IntPayPrices P%d+P%d', [Player, Subject]); {$ENDIF}
    4024         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
     4024        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
    40274027          PayPrice(Subject, Player, TOffer(Data).Price[TOffer(Data).nDeliver
    4028             + i], true);
    4029         for i := 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do
    4030           if TOffer(Data).Price[i] = opTreaty + trAlliance then
     4028            + I], True);
     4029        for I := 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do
     4030          if TOffer(Data).Price[I] = opTreaty + trAlliance then
    40314031          begin // add view area of allied player
    40324032            DiscoverViewAreas(Player);
    40334033            DiscoverViewAreas(Subject);
    4034             Break
    4035           end
     4034            Break;
     4035          end;
    40364036      end;
    40374037
    40384038    sIntSetDevModel:
    40394039      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);
    40414041
    40424042    sIntSetModelStatus:
     
    40454045{$IFDEF TEXTLOG}CmdInfo := Format('IntSetModelStatus P%d', [Player]);
    40464046        {$ENDIF}
    4047         RW[Player].Model[Subject].Status := integer(Data);
     4047        RW[Player].Model[Subject].Status := Integer(Data);
    40484048      end;
    40494049
     
    40534053{$IFDEF TEXTLOG}CmdInfo := Format('IntSetUnitStatus P%d', [Player]);
    40544054        {$ENDIF}
    4055         RW[Player].Un[Subject].Status := integer(Data);
     4055        RW[Player].Un[Subject].Status := Integer(Data);
    40564056      end;
    40574057
     
    40614061{$IFDEF TEXTLOG}CmdInfo := Format('IntSetCityStatus P%d', [Player]);
    40624062        {$ENDIF}
    4063         RW[Player].City[Subject].Status := integer(Data);
     4063        RW[Player].City[Subject].Status := Integer(Data);
    40644064      end;
    40654065
     
    40694069{$IFDEF TEXTLOG}CmdInfo := Format('IntSetECityStatus P%d', [Player]);
    40704070        {$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;
     4074end;
    40764075
    40774076end.
  • branches/highdpi/Direct.lfm

    r246 r465  
    88  Caption = 'C-evo'
    99  Color = clBtnFace
    10   DesignTimePPI = 125
     10  DesignTimePPI = 144
    1111  Font.Color = clWindowText
    12   Font.Height = -13
     12  Font.Height = -20
    1313  Font.Name = 'MS Sans Serif'
    1414  FormStyle = fsStayOnTop
     
    1717  OnPaint = FormPaint
    1818  OnShow = FormShow
    19   LCLVersion = '1.8.0.6'
    20   PixelsPerInch = 96
     19  ShowInTaskBar = stNever
     20  LCLVersion = '2.2.6.0'
    2121  Scaled = False
    2222end
  • branches/highdpi/Direct.pas

    r405 r465  
    77  UDpiControls, Messg,
    88
    9   LCLIntf, LCLType, {$IFDEF Linux}LMessages, {$ENDIF}Messages, SysUtils, Classes,
     9  LCLIntf, LCLType, {$IFDEF UNIX}LMessages, {$ENDIF}Messages, SysUtils, Classes,
    1010  Graphics, Controls, Forms, DrawDlg, GameServer;
    1111
     
    2929    Gone: Boolean;
    3030    Quick: Boolean;
    31     procedure SetInfo(x: string);
    32     procedure SetState(x: integer);
     31    procedure SetInfo(X: string);
     32    procedure SetState(X: Integer);
    3333    procedure OnGo(var Msg: TMessage); message WM_GO;
    3434    procedure OnChangeClient(var Msg: TMessage); message WM_CHANGECLIENT;
     
    4040  DirectDlg: TDirectDlg;
    4141
     42
    4243implementation
    4344
    4445uses
    45   ScreenTools, Protocol, Start, LocalPlayer, NoTerm, Back, Global, UNetworkServer,
    46   UNetworkClient;
     46  ScreenTools, Protocol, Start, LocalPlayer, NoTerm, Back, Global, NetworkServer,
     47  NetworkClient;
    4748
    4849{$R *.lfm}
     
    5758//  hMem: Cardinal;
    5859//  p: pointer;
    59   s: string;
     60  S: string;
    6061Begin
    6162  case ID of
     
    7273      if visible then
    7374      begin
    74         s := Format(Phrases.Lookup('BUSY_MOD'), [Brains[Index].Name]);
    75         while BiColorTextWidth(Canvas, s) + 64 > ClientWidth do
    76           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);
    7879      end;
    7980    ntCreateWorld:
     
    111112          hMem := GlobalAlloc(GMEM_MOVEABLE or GMEM_DDESHARE,
    112113            Length(NotifyMessage));
    113           p := GlobalLock(hMem);
    114           if p <> nil then
    115             move(NotifyMessage[1], p^, Length(NotifyMessage));
     114          P := GlobalLock(hMem);
     115          if P <> nil then
     116            Move(NotifyMessage[1], P^, Length(NotifyMessage));
    116117          GlobalUnlock(hMem);
    117118          SetClipboardData(CF_TEXT, hMem);
     
    153154        State := -1;
    154155        Show;
    155         {$IFDEF LINUX}
    156         // Force shown window repaint on Gtk2 widgetset
    157         Sleep(1);
    158         DpiApplication.ProcessMessages;
    159         {$ENDIF}
     156        Gtk2Fix;
    160157        Invalidate;
    161158        Update;
     
    183180  BrainTerm.Name := Phrases.Lookup('HUMAN');
    184181  if NetworkEnabled then begin
    185     BrainNetworkServer.Client := UNetworkServer.Client;
     182    BrainNetworkServer.Client := NetworkServer.Client;
    186183    BrainNetworkServer.Name := Phrases.Lookup('NETWORK_SERVER');
    187     BrainNetworkClient.Client := UNetworkClient.Client;
     184    BrainNetworkClient.Client := NetworkClient.Client;
    188185    BrainNetworkClient.Name := Phrases.Lookup('NETWORK_CLIENT');
    189186  end;
     
    198195  begin
    199196    PostMessage(Handle, WM_GO, 0, 0);
    200     Gone := true;
     197    Gone := True;
    201198  end;
    202199end;
     
    209206procedure TDirectDlg.OnGo(var Msg: TMessage);
    210207var
    211   i: integer;
    212   s: string;
     208  I: Integer;
     209  S: string;
    213210  FileName: string;
    214211begin
     
    220217    Exit;
    221218  end;
    222   Quick := false;
     219  Quick := False;
    223220  if ParamCount > 0 then
    224221  begin
    225     s := ParamStr(1);
    226     if (s[1] = '-') {$IFDEF WINDOWS}or (s[1] = '/'){$ENDIF} then
     222    S := ParamStr(1);
     223    if (S[1] = '-') {$IFDEF WINDOWS}or (S[1] = '/'){$ENDIF} then
    227224    begin // special mode
    228       Delete(s, 1, 1);
    229       for i := 1 to Length(s) do
    230         if s[i] in ['a' .. 'z'] then
    231           dec(s[i], 32);
    232       if s = 'MAN' then
     225      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
    233230      begin
    234         Quick := true;
     231        Quick := True;
    235232        DirectHelp(cHelpOnly);
    236233        Close;
     
    242239        Quick := True;
    243240        if not LoadGame(ExtractFilePath(ParamStr(1)), ExtractFileName(ParamStr(1)
    244         ), -1, false) then begin
     241        ), -1, False) then begin
    245242          SimpleMessage(Phrases.Lookup('LOADERR'));
    246243          Close;
     
    280277procedure TDirectDlg.FormPaint(Sender: TObject);
    281278begin
    282   PaintBackground(self, 3, 3, ClientWidth - 6, ClientHeight - 6);
     279  PaintBackground(Self, 3, 3, ClientWidth - 6, ClientHeight - 6);
    283280  Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0);
    284281  Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2,
     
    297294end;
    298295
    299 procedure TDirectDlg.SetInfo(x: string);
    300 begin
    301   Info := x;
     296procedure TDirectDlg.SetInfo(X: string);
     297begin
     298  Info := X;
    302299  Invalidate;
    303300  Update;
    304   {$IFDEF LINUX}
     301  {$IFDEF UNIX}
    305302  DpiApplication.ProcessMessages;
    306303  {$ENDIF}
    307304end;
    308305
    309 procedure TDirectDlg.SetState(x: integer);
    310 begin
    311   if (x < 0) <> (State < 0) then begin
    312     State := x;
     306procedure TDirectDlg.SetState(X: Integer);
     307begin
     308  if (X < 0) <> (State < 0) then begin
     309    State := X;
    313310    Invalidate;
    314311    Update;
    315312  end
    316   else if x <> State then begin
    317     State := x;
     313  else if X <> State then begin
     314    State := X;
    318315    PaintProgressBar(Canvas, 6, ClientWidth div 2 - 64, 40, State, 128 - State,
    319316      128, MainTexture);
  • branches/highdpi/GameServer.pas

    r405 r465  
    77
    88uses
    9   Protocol, Database, dynlibs, Platform, dateutils, fgl, LazFileUtils,
    10   Graphics, UBrain, Global;
     9  Protocol, Database, dynlibs, Platform, dateutils, LazFileUtils, Graphics,
     10  Brain, Global;
    1111
    1212const
     
    4949  // PARAMETERS
    5050  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;
    5252  { difficulty }
    5353
     
    7070
    7171procedure 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);
     73function LoadGame(const Path, FileName: string; Turn: Integer;
     74  MovieMode: Boolean): Boolean;
     75procedure EditMap(const Map: string; Newlx, Newly, NewLandMass: Integer);
     76procedure DirectHelp(Command: Integer);
    7777
    7878procedure ChangeClient;
    7979procedure NextPlayer;
    80 function PreviewMap(lm: integer): pointer;
     80function PreviewMap(lm: Integer): Pointer;
    8181
    8282
     
    112112  MapField: ^Cardinal; // predefined map
    113113  LastOffer: TOffer;
    114   CCData: array [0 .. 14] of integer;
     114  CCData: array [0 .. 14] of Integer;
    115115  bix: TBrains; { brain of the players }
    116116  DevModelTurn: array [0 .. nPl - 1] of Integer; { turn of last call to sResetModel }
    117117  OriginalDataVersion: array [0 .. nPl - 1] of Integer;
    118118  SavedTiles { , SavedResourceWeights } : array [0 .. ncmax - 1] of Cardinal;
    119   SavedData: array [0 .. nPl - 1] of pointer;
     119  SavedData: array [0 .. nPl - 1] of Pointer;
    120120  LogFileName: string;
    121121  SavePath: string; { name of file for saving the current game }
     
    135135  PreviewRND = 41601260; { randseed for preview map }
    136136
    137 function Server(Command, Player, Subject: integer; var Data): integer;
     137function Server(Command, Player, Subject: Integer; var Data): Integer;
    138138  stdcall; forward;
    139139
    140 procedure CallPlayer(Command, p: integer; var Data);
     140procedure CallPlayer(Command, P: Integer; var Data);
    141141begin
    142   if ((Mode <> moMovie) or (p = 0)) then
     142  if ((Mode <> moMovie) or (P = 0)) then
    143143  begin
    144144{$IFOPT O-}
    145     HandoverStack[nHandoverStack] := p;
     145    HandoverStack[nHandoverStack] := P;
    146146    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);
    150150{$ELSE}
    151151    try
    152       bix[p].Client(Command, p, Data);
     152      bix[P].Client(Command, P, Data);
    153153    except
    154       Notify(ntException + bix[p]);
     154      Notify(ntException + bix[P]);
    155155    end;
    156156{$ENDIF}
    157   end
     157  end;
    158158end;
    159159
     
    167167end;
    168168
    169 procedure CallClient(bix, Command: integer; var Data);
     169procedure CallClient(bix, Command: Integer; var Data);
    170170begin
    171171  if ((Mode <> moMovie) or (bix = Brains.IndexOf(GameServer.bix[0]))) then
     
    174174    HandoverStack[nHandoverStack] := bix;
    175175    HandoverStack[nHandoverStack + 1] := Command;
    176     inc(nHandoverStack, 2);
     176    Inc(nHandoverStack, 2);
    177177    Brains[bix].Client(Command, -1, Data);
    178     dec(nHandoverStack, 2);
     178    Dec(nHandoverStack, 2);
    179179{$ELSE}
    180180    try
     
    189189procedure Init(NotifyFunction: TNotifyFunction);
    190190var
    191   f: TSearchRec;
     191  F: TSearchRec;
    192192  BasePath: string;
    193193  NewBrain: TBrain;
     
    195195begin
    196196  Notify := NotifyFunction;
    197   PreviewElevation := false;
     197  PreviewElevation := False;
    198198  PlayersBrain := TBrains.Create(False);
    199199  PlayersBrain.Count := nPl;
     
    246246  end;
    247247
    248   if FindFirst(GetAiDir + DirectorySeparator + '*', faDirectory or faArchive or faReadOnly, f) = 0 then
     248  if FindFirst(GetAiDir + DirectorySeparator + '*', faDirectory or faArchive or faReadOnly, F) = 0 then
    249249  repeat
    250     BasePath := GetAiDir + DirectorySeparator + f.Name;
    251     if (f.Name <> '.') and (f.Name <> '..') and DirectoryExists(BasePath) then begin
     250    BasePath := GetAiDir + DirectorySeparator + F.Name;
     251    if (F.Name <> '.') and (F.Name <> '..') and DirectoryExists(BasePath) then begin
    252252      NewBrain := Brains.AddNew;
    253253      NewBrain.Kind := btAI;
     
    258258        end else Brains.Delete(Brains.Count - 1);
    259259    end;
    260   until FindNext(f) <> 0;
     260  until FindNext(F) <> 0;
    261261  FindClose(F);
    262262
     
    281281end;
    282282
    283 function PreviewMap(lm: integer): pointer;
     283function PreviewMap(lm: Integer): Pointer;
    284284begin
    285285  lx := lxmax;
     
    291291  begin
    292292    CreateElevation;
    293     PreviewElevation := true;
     293    PreviewElevation := True;
    294294  end;
    295   CreateMap(true);
     295  CreateMap(True);
    296296  Result := @RealMap;
    297297end;
    298298
    299 procedure ChangeClientWhenDone(Command, Player: integer; var Data;
    300   DataSize: integer);
     299procedure ChangeClientWhenDone(Command, Player: Integer; var Data;
     300  DataSize: Integer);
    301301begin
    302302  CCCommand := Command;
    303303  CCPlayer := Player;
    304304  if DataSize > 0 then
    305     move(Data, CCData, DataSize);
     305    Move(Data, CCData, DataSize);
    306306  Notify(ntChangeClient);
    307307end;
    308308
    309 procedure PutMessage(Level: integer; Text: string);
     309procedure PutMessage(Level: Integer; Text: string);
    310310begin
    311   bix[0].Client(cDebugMessage, Level, pchar(Text)^);
     311  bix[0].Client(cDebugMessage, Level, PChar(Text)^);
    312312end;
    313313
     
    336336// hand over control to other client (as specified by CC...)
    337337var
    338   p: integer;
     338  P: Integer;
    339339  T: TDateTime;
    340340begin
     
    346346    [CCPlayer, bix[CCPlayer].Name]));
    347347  if CCCommand = cTurn then
    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;
     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;
    353353  CCPlayer := -1;
    354   CallPlayer(CCCommand, p, CCData);
    355   if (Mode = moPlaying) and (bix[p].Flags and aiThreaded = 0) and
     354  CallPlayer(CCCommand, P, CCData);
     355  if (Mode = moPlaying) and (bix[P].Flags and aiThreaded = 0) and
    356356    (CCPlayer < 0) then
    357357  begin
    358     Notify(ntDeactivationMissing, p);
     358    Notify(ntDeactivationMissing, P);
    359359    ForceClientDeactivation;
    360360  end;
    361361end;
    362362
    363 procedure Inform(p: integer);
     363procedure Inform(P: Integer);
    364364var
    365   i, p1: integer;
     365  I, p1: Integer;
    366366begin
    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));
     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));
    375375  for p1 := 0 to nPl - 1 do
    376     if (p1 <> p) and Assigned(bix[p1]) and (Difficulty[p1] > 0) then
    377       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;
    378378  for p1 := 0 to nPl - 1 do
    379     if (p1 <> p) and (1 shl p1 and GAlive <> 0) then
     379    if (p1 <> P) and (1 shl p1 and GAlive <> 0) then
    380380    begin
    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)
     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)
    387387    end;
    388   for i := 0 to RW[p].nEnemyModel - 1 do
    389     with RW[p].EnemyModel[i] do
    390       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];
    391391end;
    392392
    393393procedure LogChanges;
    394394var
    395   p, ix: integer;
     395  P, ix: Integer;
    396396begin
    397   for p := 0 to nPl - 1 do
    398     if (1 shl p and GWatching <> 0) and ProcessClientData[p] then
     397  for P := 0 to nPl - 1 do
     398    if (1 shl P and GWatching <> 0) and ProcessClientData[P] then
    399399    begin
    400400      // log unit status changes
    401       for ix := 0 to RW[p].nUn - 1 do
    402         with RW[p].Un[ix] do
     401      for ix := 0 to RW[P].nUn - 1 do
     402        with RW[P].Un[ix] do
    403403          if (Loc >= 0) and (SavedStatus <> Status) then
    404404          begin
    405             CL.Put(sIntSetUnitStatus, p, ix, @Status);
     405            CL.Put(sIntSetUnitStatus, P, ix, @Status);
    406406            SavedStatus := Status;
    407407          end;
    408408      // log city status changes
    409       for ix := 0 to RW[p].nCity - 1 do
    410         with RW[p].City[ix] do
     409      for ix := 0 to RW[P].nCity - 1 do
     410        with RW[P].City[ix] do
    411411          if (Loc >= 0) and (SavedStatus <> Status) then
    412412          begin
    413             CL.Put(sIntSetCityStatus, p, ix, @Status);
     413            CL.Put(sIntSetCityStatus, P, ix, @Status);
    414414            SavedStatus := Status;
    415415          end;
    416416      // log model status changes
    417       for ix := 0 to RW[p].nModel - 1 do
    418         with RW[p].Model[ix] do
     417      for ix := 0 to RW[P].nModel - 1 do
     418        with RW[P].Model[ix] do
    419419          if SavedStatus <> Status then
    420420          begin
    421             CL.Put(sIntSetModelStatus, p, ix, @Status);
     421            CL.Put(sIntSetModelStatus, P, ix, @Status);
    422422            SavedStatus := Status;
    423423          end;
    424424      // log enemy city status changes
    425       for ix := 0 to RW[p].nEnemyCity - 1 do
    426         with RW[p].EnemyCity[ix] do
     425      for ix := 0 to RW[P].nEnemyCity - 1 do
     426        with RW[P].EnemyCity[ix] do
    427427          if (Loc >= 0) and (SavedStatus <> Status) then
    428428          begin
    429             CL.Put(sIntSetECityStatus, p, ix, @Status);
     429            CL.Put(sIntSetECityStatus, P, ix, @Status);
    430430            SavedStatus := Status;
    431431          end;
    432432      // log data changes
    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);
     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);
    438438      end;
    439439    end;
     
    442442procedure NoLogChanges;
    443443var
    444   p, ix: integer;
     444  P, ix: Integer;
    445445begin
    446   for p := 0 to nPl - 1 do
    447     if (1 shl p and GWatching <> 0) and ProcessClientData[p] then
     446  for P := 0 to nPl - 1 do
     447    if (1 shl P and GWatching <> 0) and ProcessClientData[P] then
    448448    begin
    449       for ix := 0 to RW[p].nUn - 1 do
    450         with RW[p].Un[ix] do
     449      for ix := 0 to RW[P].nUn - 1 do
     450        with RW[P].Un[ix] do
    451451          SavedStatus := Status;
    452       for ix := 0 to RW[p].nCity - 1 do
    453         with RW[p].City[ix] do
     452      for ix := 0 to RW[P].nCity - 1 do
     453        with RW[P].City[ix] do
    454454          SavedStatus := Status;
    455       for ix := 0 to RW[p].nModel - 1 do
    456         with RW[p].Model[ix] do
     455      for ix := 0 to RW[P].nModel - 1 do
     456        with RW[P].Model[ix] do
    457457          SavedStatus := Status;
    458       for ix := 0 to RW[p].nEnemyCity - 1 do
    459         with RW[p].EnemyCity[ix] do
     458      for ix := 0 to RW[P].nEnemyCity - 1 do
     459        with RW[P].EnemyCity[ix] do
    460460          SavedStatus := Status;
    461       if bix[p].DataSize > 0 then
    462         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);
    463463    end;
    464464end;
    465465
    466 function HasChanges(p: integer): boolean;
     466function HasChanges(P: Integer): Boolean;
    467467type
    468468  TDWordList = array [0 .. INFIN] of Cardinal;
    469469  PDWortList = ^TDWordList;
    470470var
    471   ix: integer;
     471  ix: Integer;
    472472begin
    473473  Result := False;
    474   for ix := 0 to RW[p].nUn - 1 do
    475     with RW[p].Un[ix] do
     474  for ix := 0 to RW[P].nUn - 1 do
     475    with RW[P].Un[ix] do
    476476      if (Loc >= 0) and (SavedStatus <> Status) then
    477477        Result := True;
    478   for ix := 0 to RW[p].nCity - 1 do
    479     with RW[p].City[ix] do
     478  for ix := 0 to RW[P].nCity - 1 do
     479    with RW[P].City[ix] do
    480480      if (Loc >= 0) and (SavedStatus <> Status) then
    481481        Result := True;
    482   for ix := 0 to RW[p].nModel - 1 do
    483     with RW[p].Model[ix] do
     482  for ix := 0 to RW[P].nModel - 1 do
     483    with RW[P].Model[ix] do
    484484      if SavedStatus <> Status then
    485485        Result := True;
    486   for ix := 0 to RW[p].nEnemyCity - 1 do
    487     with RW[p].EnemyCity[ix] do
     486  for ix := 0 to RW[P].nEnemyCity - 1 do
     487    with RW[P].EnemyCity[ix] do
    488488      if (Loc >= 0) and (SavedStatus <> Status) then
    489489        Result := True;
    490   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
     490  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
    493493        Result := True;
    494494end;
     
    498498  InitModuleData: TInitModuleData;
    499499begin
    500   assert(bix.Kind <> btSuperVirtual);
     500  Assert(bix.Kind <> btSuperVirtual);
    501501  with bix do begin
    502502    if Initialized then
    503       exit;
     503      Exit;
    504504    if Kind = btAI then
    505505    begin { get client function }
     
    509509      else
    510510      begin
    511         hm := LoadLibrary(pchar(DLLName));
     511        hm := LoadLibrary(PChar(DLLName));
    512512        if hm = 0 then
    513513        begin
     
    525525    if @Client <> nil then
    526526    begin
    527       Initialized := true;
     527      Initialized := True;
    528528      InitModuleData.Server := @Server;
    529529      InitModuleData.DataVersion := 0;
     
    542542procedure SaveMap(FileName: string);
    543543var
    544   i: integer;
     544  I: Integer;
    545545  MapFile: TFileStream;
    546   s: string[255];
     546  S: string[255];
    547547begin
    548548  MapFile := TFileStream.Create(GetMapsDir + DirectorySeparator + FileName,
     
    550550  try
    551551    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);
    560560  finally
    561561    FreeAndNil(MapFile);
     
    563563end;
    564564
    565 function LoadMap(FileName: string): boolean;
     565function LoadMap(FileName: string): Boolean;
    566566var
    567   i, Loc1: integer;
     567  I, Loc1: Integer;
    568568  MapFile: TFileStream;
    569   s: string[255];
     569  S: string[255];
    570570begin
    571   result := false;
     571  Result := False;
    572572  MapFile := nil;
    573573  try
    574574    MapFile := TFileStream.Create(FileName, fmOpenRead or fmShareExclusive);
    575575    MapFile.Position := 0;
    576     MapFile.read(s[1], 8); { file id }
    577     MapFile.read(i, 4); { format id }
    578     if i = 0 then
     576    MapFile.Read(S[1], 8); { file id }
     577    MapFile.Read(I, 4); { format id }
     578    if I = 0 then
    579579    begin
    580       MapFile.read(i, 4); // MaxTurn
    581       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);
    583583      ly := ly and not 1;
    584584      if lx > lxmax then
     
    587587        ly := lymax;
    588588      MapSize := lx * ly;
    589       MapFile.read(RealMap, MapSize * 4);
     589      MapFile.Read(RealMap, MapSize * 4);
    590590      for Loc1 := 0 to MapSize - 1 do
    591591      begin
     
    600600            or fDesert;
    601601      end;
    602       result := true;
     602      Result := True;
    603603    end;
    604604    FreeAndNil(MapFile);
     
    609609end;
    610610
    611 procedure SaveGame(FileName: string; auto: boolean);
     611procedure SaveGame(FileName: string; Auto: Boolean);
    612612var
    613   x, y, i, zero, Tile, nLocal: integer;
     613  X, Y, I, zero, Tile, nLocal: Integer;
    614614  LogFile: TFileStream;
    615   s: string[255];
     615  S: string[255];
    616616  SaveMap: array [0 .. lxmax * lymax - 1] of Byte;
    617617begin
    618618  nLocal := 0;
    619   for i := 0 to nPl - 1 do
    620     if Assigned(bix[i]) and (bix[i].Kind = btTerm) then
    621       inc(nLocal);
     619  for I := 0 to nPl - 1 do
     620    if Assigned(bix[I]) and (bix[I].Kind = btTerm) then
     621      Inc(nLocal);
    622622  if Difficulty[0] = 0 then
    623623    nLocal := 0;
    624624  if nLocal <= 1 then
    625     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
     625    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
    630630          (fCity or fUnit or fOwned) shr 16;
    631631      end;
    632632
    633   if auto and AutoSaveExists then // append to existing file
     633  if Auto and AutoSaveExists then // append to existing file
    634634    LogFile := TFileStream.Create(SavePath + FileName, fmOpenReadWrite or
    635635      fmShareExclusive)
     
    640640  zero := 0;
    641641  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);
    650650  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);
    656656  if nLocal > 1 then // multiplayer game -- no quick view
    657657  begin
    658     i := $80;
    659     LogFile.write(i, 4);
     658    I := $80;
     659    LogFile.Write(I, 4);
    660660  end
    661661  else
    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)
     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)
    666666    else
    667667    begin
    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);
     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);
    679679    end;
    680680
    681   if auto and AutoSaveExists then
     681  if Auto and AutoSaveExists then
    682682    CL.AppendToFile(LogFile, AutoSaveState)
    683683  else
    684684    CL.SaveToFile(LogFile);
    685685  FreeAndNil(LogFile);
    686   if auto then
     686  if Auto then
    687687  begin
    688688    AutoSaveState := CL.State;
    689     AutoSaveExists := true;
     689    AutoSaveExists := True;
    690690  end
    691691end;
     
    693693procedure StartGame;
    694694var
    695   i, p, p1, Human, nAlive, bixUni: integer;
     695  I, P, p1, Human, nAlive, bixUni: Integer;
    696696  Game: TNewGameData;
    697697  // GameEx: TNewGameExData;
     
    722722
    723723  BrainUsed := [];
    724   for p := 0 to nPl - 1 do
    725     if Assigned(bix[p]) and ((Mode <> moMovie) or (p = 0)) then
     724  for P := 0 to nPl - 1 do
     725    if Assigned(bix[P]) and ((Mode <> moMovie) or (P = 0)) then
    726726    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]);
    729729      if Mode = moPlaying then
    730730      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;
    733733      end
    734734      else // loading game, compare with data version read from file
    735         ProcessClientData[p] := ProcessClientData[p] and
    736           (OriginalDataVersion[p] = bix[p].DataVersion);
    737       if @bix[p].Client = nil then // client function not found
     735        ProcessClientData[P] := ProcessClientData[P] and
     736          (OriginalDataVersion[P] = bix[P].DataVersion);
     737      if @bix[P].Client = nil then // client function not found
    738738        if bix[0].Kind = btNoTerm then
    739           bix[p] := nil
     739          bix[P] := nil
    740740        else
    741741        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;
    745745        end;
    746       if Assigned(bix[p]) then
    747         include(BrainUsed, Brains.IndexOf(bix[p]));
     746      if Assigned(bix[P]) then
     747        Include(BrainUsed, Brains.IndexOf(bix[P]));
    748748    end;
    749749
     
    760760    begin
    761761      if Mode <> moMovie then
    762         inc(GWatching, 1 shl p1);
     762        Inc(GWatching, 1 shl p1);
    763763      if bix[p1].Kind = btAI then
    764         inc(GAI, 1 shl p1);
     764        Inc(GAI, 1 shl p1);
    765765      if Difficulty[p1] > 0 then
    766766      begin
    767         inc(GAlive, 1 shl p1);
    768         inc(nAlive);
     767        Inc(GAlive, 1 shl p1);
     768        Inc(nAlive);
    769769      end;
    770770      ServerVersion[p1] := bix[p1].ServerVersion;
     
    779779
    780780  GTurn := 0;
    781   for i := 0 to nWonder - 1 do
    782     with GWonder[i] do
     781  for I := 0 to nWonder - 1 do
     782    with GWonder[I] do
    783783    begin
    784784      CityID := -1;
     
    787787  FillChar(GShip, SizeOf(GShip), 0);
    788788
    789   for p := 0 to nPl - 1 do
    790     if 1 shl p and (GAlive or GWatching) <> 0 then
    791       with RW[p] do
     789  for P := 0 to nPl - 1 do
     790    if 1 shl P and (GAlive or GWatching) <> 0 then
     791      with RW[P] do
    792792      begin
    793793        Government := gDespotism;
     
    799799        AnarchyStart := -AnarchyTurns - 1;
    800800        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;
    805805        OracleIncome := 0;
    806806
    807         if bix[p].DataSize > 0 then
     807        if bix[P].DataSize > 0 then
    808808        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);
    813813        end
    814814        else
    815815        begin
    816816          Data := nil;
    817           SavedData[p] := nil
     817          SavedData[P] := nil;
    818818        end;
    819819        nBattleHistory := 0;
     
    825825          end
    826826          else } BorderHelper := nil;
    827         for i := 0 to nStat - 1 do
    828           GetMem(Stat[i, p], 4 * (MaxTurn + 1));
    829         if bix[p].Flags and fDotNet <> 0 then
     827        for I := 0 to nStat - 1 do
     828          GetMem(Stat[I, P], 4 * (MaxTurn + 1));
     829        if bix[P].Flags and fDotNet <> 0 then
    830830        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;
    834834        end
    835835        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); }
    839839      end;
    840840
     
    842842  begin // random map
    843843    InitRandomGame;
    844     PreviewElevation := false;
     844    PreviewElevation := False;
    845845    MapField := nil;
    846846  end
     
    850850      LoadMap(MapFileName); // new game -- load map from file
    851851    GetMem(MapField, MapSize * 4);
    852     move(RealMap, MapField^, MapSize * 4);
     852    Move(RealMap, MapField^, MapSize * 4);
    853853    Human := 0;
    854854    for p1 := 0 to nPl - 1 do
    855855      if Assigned(bix[p1]) and (bix[p1].Kind = btTerm) then
    856         inc(Human, 1 shl p1);
     856        Inc(Human, 1 shl p1);
    857857    InitMapGame(Human);
    858858  end;
    859859  CityProcessing.InitGame;
    860860  UnitProcessing.InitGame;
    861   for p := 0 to nPl - 1 do
    862     if 1 shl p and (GAlive or GWatching) <> 0 then
    863       Inform(p);
     861  for P := 0 to nPl - 1 do
     862    if 1 shl P and (GAlive or GWatching) <> 0 then
     863      Inform(P);
    864864
    865865  pTurn := -1;
     
    870870  Game.LandMass := LandMass;
    871871  Game.MaxTurn := MaxTurn;
    872   move(Difficulty, Game.Difficulty, SizeOf(Difficulty));
     872  Move(Difficulty, Game.Difficulty, SizeOf(Difficulty));
    873873  // GameEx.lx:=lx; GameEx.ly:=ly; GameEx.LandMass:=LandMass;
    874874  // GameEx.MaxTurn:=MaxTurn; GameEx.RND:=RND;
    875875  // move(Difficulty,GameEx.Difficulty,SizeOf(Difficulty));
    876876  AICredits := '';
    877   for i := 0 to Brains.Count - 1 do
     877  for I := 0 to Brains.Count - 1 do
    878878  with Brains[I] do begin
    879879    if Initialized then
    880       if i in BrainUsed then
     880      if I in BrainUsed then
    881881      begin
    882882        if Kind = btAI then
    883883          Notify(ntInitPlayers);
    884         for p := 0 to nPl - 1 do
     884        for P := 0 to nPl - 1 do
    885885        begin
    886           if Brains.IndexOf(bix[p]) = i then
    887             Game.RO[p] := @RW[p]
     886          if Brains.IndexOf(bix[P]) = I then
     887            Game.RO[P] := @RW[P]
    888888          else
    889             Game.RO[p] := nil;
    890           if (Kind = btTerm) and (Difficulty[0] = 0) and Assigned(bix[p]) then
    891             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]
    892892          else
    893             Game.SuperVisorRO[p] := nil;
     893            Game.SuperVisorRO[P] := nil;
    894894        end;
    895895        if Flags and fDotNet > 0 then
    896896        begin
    897897          Path := DLLName;
    898           move(Path[1], Game.AssemblyPath, Length(Path));
     898          Move(Path[1], Game.AssemblyPath, Length(Path));
    899899          Game.AssemblyPath[Length(Path)] := #0;
    900900        end
     
    903903        case Mode of
    904904          moLoading, moLoading_Fast:
    905             CallClient(i, cLoadGame, Game);
     905            CallClient(I, cLoadGame, Game);
    906906          moMovie:
    907             CallClient(i, cMovie, Game);
     907            CallClient(I, cMovie, Game);
    908908          moPlaying:
    909             CallClient(i, cNewGame, Game);
     909            CallClient(I, cNewGame, Game);
    910910        end;
    911911        if (Kind = btAI) and (Credits <> '') then
     
    917917      else
    918918      begin { module no longer used -- unload }
    919         CallClient(i, cReleaseModule, nil^);
     919        CallClient(I, cReleaseModule, nil^);
    920920        if Kind = btAI then
    921921        begin
     
    924924          Client := nil;
    925925        end;
    926         Initialized := false;
     926        Initialized := False;
    927927      end;
    928928  end;
     
    952952  CheckBorders(-1);
    953953{$IFOPT O-}InvalidTreatyMap := 0; {$ENDIF}
    954   AutoSaveExists := false;
     954  AutoSaveExists := False;
    955955  pDipActive := -1;
    956956  pTurn := 0;
     
    958958  if Mode >= moMovie then
    959959    Notify(ntEndInfo);
    960 end; { StartGame }
     960end;
    961961
    962962procedure EndGame;
    963963var
    964   i, p1: integer;
     964  I, p1: Integer;
    965965begin
    966966  if LandMass = 0 then
     
    969969    if Assigned(bix[p1]) then
    970970    begin
    971       for i := 0 to nStat - 1 do
    972         FreeMem(Stat[i, p1]);
     971      for I := 0 to nStat - 1 do
     972        FreeMem(Stat[I, p1]);
    973973      if RW[p1].BattleHistory <> nil then
    974974        FreeMem(RW[p1].BattleHistory);
     
    985985end;
    986986
    987 procedure GenerateStat(p: integer);
     987procedure GenerateStat(P: Integer);
    988988var
    989   cix, uix: integer;
     989  cix, uix: Integer;
    990990begin
    991   if Difficulty[p] > 0 then
    992     with RW[p] do
     991  if Difficulty[P] > 0 then
     992    with RW[P] do
    993993    begin
    994       Stat[stPop, p, GTurn] := 0;
     994      Stat[stPop, P, GTurn] := 0;
    995995      for cix := 0 to nCity - 1 do
    996996        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) then
    1000         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;
    10031003      for uix := 0 to nUn - 1 do
    10041004        if Un[uix].Loc >= 0 then
     
    10061006          begin
    10071007            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 *
    10091009                Un[uix].Health div 100)
    10101010            else if Domain = dGround then
    1011               inc(Stat[stMil, p, GTurn], (Attack + 2 * Defense) *
     1011              Inc(Stat[stMil, P, GTurn], (Attack + 2 * Defense) *
    10121012                Un[uix].Health div 100)
    10131013            else
    1014               inc(Stat[stMil, p, GTurn], (Attack + Defense) *
     1014              Inc(Stat[stMil, P, GTurn], (Attack + Defense) *
    10151015                Un[uix].Health div 100);
    10161016            case Kind of
    10171017              mkSlaves:
    1018                 inc(Stat[stPop, p, GTurn]);
     1018                Inc(Stat[stPop, P, GTurn]);
    10191019              mkSettler:
    1020                 inc(Stat[stPop, p, GTurn], 2);
     1020                Inc(Stat[stPop, P, GTurn], 2);
    10211021            end;
    10221022          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;
    10281028    end;
    10291029end;
     
    10311031procedure LogCityTileChanges;
    10321032var
    1033   cix: integer;
     1033  cix: Integer;
    10341034begin
    10351035  for cix := 0 to RW[pTurn].nCity - 1 do
     
    10521052procedure NoLogCityTileChanges;
    10531053var
    1054   cix: integer;
     1054  cix: Integer;
    10551055begin
    10561056  for cix := 0 to RW[pTurn].nCity - 1 do
     
    10631063end;
    10641064
    1065 function HasCityTileChanges: boolean;
     1065function HasCityTileChanges: Boolean;
    10661066var
    1067   cix: integer;
     1067  cix: Integer;
    10681068begin
    1069   result := false;
     1069  Result := False;
    10701070  for cix := 0 to RW[pTurn].nCity - 1 do
    10711071    with RW[pTurn].City[cix] do
     
    10741074        // if SavedResourceWeights[cix]<>ResourceWeights then result:=true;
    10751075        if SavedTiles[cix] <> Tiles then
    1076           result := true;
     1076          Result := True;
    10771077      end;
    10781078end;
     
    10801080procedure BeforeTurn0;
    10811081var
    1082   p1, uix: integer;
     1082  p1, uix: Integer;
    10831083begin
    10841084  for uix := 0 to RW[pTurn].nUn - 1 do { init movement points for first turn }
     
    11011101end;
    11021102
    1103 function LoadGame(const Path, FileName: string; Turn: integer;
    1104   MovieMode: boolean): boolean;
     1103function LoadGame(const Path, FileName: string; Turn: Integer;
     1104  MovieMode: Boolean): Boolean;
    11051105var
    11061106  J: TBrain;
    1107   i, ix, d, p1, Command, Subject: integer;
     1107  I, ix, D, p1, Command, Subject: Integer;
    11081108  K: Integer;
    1109 {$IFDEF TEXTLOG}LoadPos0: integer; {$ENDIF}
    1110   Data: pointer;
     1109{$IFDEF TEXTLOG}LoadPos0: Integer; {$ENDIF}
     1110  Data: Pointer;
    11111111  LogFile: TFileStream;
    11121112  FormerCLState: TCmdListState;
    1113   s: string[255];
     1113  S: string[255];
    11141114  SaveMap: array [0 .. lxmax * lymax - 1] of Byte;
    1115   Started, StatRequest: boolean;
     1115  Started, StatRequest: Boolean;
    11161116begin
    11171117  SavePath := Path;
     
    11211121    fmShareExclusive);
    11221122  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 }
    11251125  LogFile.Read(J, 4); { exe time }
    11261126
    1127   if (i >= FirstBookCompatibleVersion) and (i <= CevoVersion) then
     1127  if (I >= FirstBookCompatibleVersion) and (I <= CevoVersion) then
    11281128  begin
    1129     result := true;
     1129    Result := True;
    11301130    LogFile.Read(lx, 4);
    11311131    LogFile.Read(ly, 4);
     
    11391139    LogFile.Read(SaveMap, 4);
    11401140    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);
    11421142    for p1 := 0 to nPl - 1 do
    11431143    begin
    1144       LogFile.Read(s[0], 4);
    1145       if s[0] = #0 then
     1144      LogFile.Read(S[0], 4);
     1145      if S[0] = #0 then
    11461146        PlayersBrain[p1] := nil
    11471147      else
    11481148      begin
    1149         LogFile.Read(s[4], Byte(s[0]) div 4 * 4);
     1149        LogFile.Read(S[4], Byte(S[0]) div 4 * 4);
    11501150        LogFile.Read(OriginalDataVersion[p1], 4);
    1151         LogFile.Read(d, 4); { behavior }
     1151        LogFile.Read(D, 4); { behavior }
    11521152        LogFile.Read(Difficulty[p1], 4);
    11531153        J := Brains.Last;
    1154         while Assigned(J) and (AnsiCompareFileName(J.FileName, s) <> 0) do begin
     1154        while Assigned(J) and (AnsiCompareFileName(J.FileName, S) <> 0) do begin
    11551155          K := Brains.IndexOf(J) - 1;
    11561156          if K >= 0 then J := Brains[K]
     
    11591159        if not Assigned(J) then
    11601160        begin // ai not found -- replace by local player
    1161           ProcessClientData[p1] := false;
    1162           NotifyMessage := s;
     1161          ProcessClientData[p1] := False;
     1162          NotifyMessage := S;
    11631163          Notify(ntAIError);
    11641164          J := BrainTerm;
    11651165        end
    11661166        else
    1167           ProcessClientData[p1] := true;
    1168         if j.Kind = btNoTerm then
    1169           j := BrainSuperVirtual;
     1167          ProcessClientData[p1] := True;
     1168        if J.Kind = btNoTerm then
     1169          J := BrainSuperVirtual;
    11701170        // crashed tournament -- load as supervisor
    1171         PlayersBrain[p1] := j;
     1171        PlayersBrain[p1] := J;
    11721172      end;
    11731173    end;
    11741174  end
    11751175  else
    1176     Result := false;
     1176    Result := False;
    11771177
    11781178  if Result then begin
     
    11811181  end;
    11821182  FreeAndNil(LogFile);
    1183   if not result then
     1183  if not Result then
    11841184    Exit;
    11851185
     
    11951195{$IFDEF TEXTLOG}AssignFile(TextLog, SavePath + LogFileName + '.txt');
    11961196  Rewrite(TextLog); {$ENDIF}
    1197   LoadOK := true;
     1197  LoadOK := True;
    11981198  StartGame;
    11991199  if MovieMode then
     
    12051205    Notify(ntLoadBegin);
    12061206
    1207   started := false;
    1208   StatRequest := false;
    1209   MovieStopped := false;
     1207  started := False;
     1208  StatRequest := False;
     1209  MovieStopped := False;
    12101210{$IFDEF LOADPERF}QueryPerformanceCounter(time_total0);
    12111211  time_a := 0;
     
    12221222    begin
    12231223      GenerateStat(pTurn);
    1224       StatRequest := false;
     1224      StatRequest := False;
    12251225    end;
    12261226    // complete all internal commands following an sTurn before generating statistics
     
    12371237        CallPlayer(cMovieTurn, 0, nil^);
    12381238      end;
    1239       StatRequest := true;
    1240       started := true;
     1239      StatRequest := True;
     1240      started := True;
    12411241    end
    12421242    else if (Command = sTurn) and (pTurn = 0) and (GTurn = LoadTurn) then
    12431243    begin
    1244       assert(CL.State.LoadPos = FormerCLState.LoadPos + 4); // size of sTurn
     1244      Assert(CL.State.LoadPos = FormerCLState.LoadPos + 4); // size of sTurn
    12451245      CL.State := FormerCLState;
    12461246      CL.Cut;
     
    12781278    EndGame;
    12791279    Notify(ntStartGo);
    1280     result := false;
    1281     exit;
     1280    Result := False;
     1281    Exit;
    12821282  end;
    12831283
    12841284  if StatRequest then
    12851285    GenerateStat(pTurn);
    1286   assert(started);
     1286  Assert(started);
    12871287{$IFDEF TEXTLOG}CloseFile(TextLog); {$ENDIF}
    12881288{$IFDEF LOADPERF}QueryPerformanceCounter(time_total); { time in s is: (time_total-time_total0)/PerfFreq }{$ENDIF}
     
    13241324  Inform(pTurn);
    13251325  ChangeClientWhenDone(cResume, 0, nil^, 0);
    1326 end; // LoadGame
     1326end;
    13271327
    13281328procedure InsertTerritoryUpdateCommands;
    13291329var
    1330   p1, Command, Subject: integer;
    1331   Data: pointer;
     1330  p1, Command, Subject: Integer;
     1331  Data: Pointer;
    13321332  FormerCLState: TCmdListState;
    13331333begin
     
    13511351
    13521352procedure StartNewGame(const Path, FileName, Map: string;
    1353   Newlx, Newly, NewLandMass, NewMaxTurn: integer);
     1353  Newlx, Newly, NewLandMass, NewMaxTurn: Integer);
    13541354var
    13551355  I: Integer;
     
    13951395end;
    13961396
    1397 procedure DirectHelp(Command: integer);
     1397procedure DirectHelp(Command: Integer);
    13981398begin
    13991399  InitBrain(BrainTerm);
     
    14021402end;
    14031403
    1404 procedure EditMap(const Map: string; Newlx, Newly, NewLandMass: integer);
     1404procedure EditMap(const Map: string; Newlx, Newly, NewLandMass: Integer);
    14051405var
    1406   p1, Loc1: integer;
     1406  p1, Loc1: Integer;
    14071407  Game: TNewGameData;
    14081408begin
     
    14461446end;
    14471447
    1448 procedure DestroySpacePort_TellPlayers(p, pCapturer: integer);
     1448procedure DestroySpacePort_TellPlayers(P, pCapturer: Integer);
    14491449var
    1450   cix, i, p1: integer;
     1450  cix, I, p1: Integer;
    14511451  ShowShipChange: TShowShipChange;
    14521452begin
    14531453  // stop ship part production
    1454   for cix := 0 to RW[p].nCity - 1 do
    1455     with RW[p].City[cix] do
     1454  for cix := 0 to RW[P].nCity - 1 do
     1455    with RW[P].City[cix] do
    14561456      if (Loc >= 0) and (Project and cpImp <> 0) and
    14571457        ((Project and cpIndex = woMIR) or
    14581458        (Imp[Project and cpIndex].Kind = ikShipPart)) then
    14591459      begin
    1460         inc(RW[p].Money, Prod0);
     1460        Inc(RW[P].Money, Prod0);
    14611461        Prod := 0;
    14621462        Prod0 := 0;
     
    14661466
    14671467  // destroy ship
    1468   with GShip[p] do
     1468  with GShip[P] do
    14691469    if Parts[0] + Parts[1] + Parts[2] > 0 then
    14701470    begin
    1471       for i := 0 to nShipPart - 1 do
    1472       begin
    1473         ShowShipChange.Ship1Change[i] := -Parts[i];
     1471      for I := 0 to nShipPart - 1 do
     1472      begin
     1473        ShowShipChange.Ship1Change[I] := -Parts[I];
    14741474        if pCapturer >= 0 then
    14751475        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]);
    14781478        end;
    1479         Parts[i] := 0;
     1479        Parts[I] := 0;
    14801480      end;
    14811481      if Mode >= moMovie then
     
    14851485        else
    14861486          ShowShipChange.Reason := scrDestruction;
    1487         ShowShipChange.Ship1Owner := p;
     1487        ShowShipChange.Ship1Owner := P;
    14881488        ShowShipChange.Ship2Owner := pCapturer;
    14891489        for p1 := 0 to nPl - 1 do
    14901490          if 1 shl p1 and (GAlive or GWatching) <> 0 then
    14911491          begin
    1492             move(GShip, RW[p1].Ship, SizeOf(GShip));
     1492            Move(GShip, RW[p1].Ship, SizeOf(GShip));
    14931493            if 1 shl p1 and GWatching <> 0 then
    14941494              CallPlayer(cShowShipChange, p1, ShowShipChange);
     
    14981498end;
    14991499
    1500 procedure DestroyCity_TellPlayers(p, cix: integer; SaveUnits: boolean);
     1500procedure DestroyCity_TellPlayers(P, cix: Integer; SaveUnits: Boolean);
    15011501begin
    1502   if RW[p].City[cix].built[imSpacePort] > 0 then
    1503     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);
    15051505end;
    15061506
    1507 procedure ChangeCityOwner_TellPlayers(pOld, cixOld, pNew: integer);
     1507procedure ChangeCityOwner_TellPlayers(pOld, cixOld, pNew: Integer);
    15081508begin
    15091509  if RW[pOld].City[cixOld].built[imSpacePort] > 0 then
     
    15151515end;
    15161516
    1517 procedure CheckWin(p: integer);
     1517procedure CheckWin(P: Integer);
    15181518var
    1519   i: integer;
    1520   ShipComplete: boolean;
     1519  I: Integer;
     1520  ShipComplete: Boolean;
    15211521begin
    1522   ShipComplete := true;
    1523   for i := 0 to nShipPart - 1 do
    1524     if GShip[p].Parts[i] < ShipNeed[i] then
    1525       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;
    15261526  if ShipComplete then
    1527     GWinner := GWinner or 1 shl p; // game won!
     1527    GWinner := GWinner or 1 shl P; // game won!
    15281528end;
    15291529
    15301530procedure BeforeTurn;
    15311531var
    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;
    15351535  Radius: TVicinity21Loc;
    15361536  ShowShipChange: TShowShipChange;
    1537   TribeExtinct, JobDone, MirBuilt: boolean;
     1537  TribeExtinct, JobDone, MirBuilt: Boolean;
    15381538begin
    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);
    15411541  if (1 shl pTurn and GAlive = 0) and (Difficulty[pTurn] > 0) then
    1542     exit;
     1542    Exit;
    15431543
    15441544  if (GWonder[woGrLibrary].EffectiveOwner = pTurn) and (GWinner = 0) then
     
    15471547    for p1 := 0 to nPl - 1 do
    15481548      if 1 shl p1 and GAlive <> 0 then
    1549         inc(nAlive);
     1549        Inc(nAlive);
    15501550    ad := 0;
    15511551    while ad <= (nAdv - 5) do begin
     
    15561556          if (p1 <> pTurn) and (1 shl p1 and GAlive <> 0) and
    15571557            (RW[p1].Tech[ad] >= tsApplicable) then
    1558             inc(nAppliers);
     1558            Inc(nAppliers);
    15591559        if nAppliers * 2 > nAlive then
    15601560        begin
    15611561          SeeTech(pTurn, ad);
    1562           inc(nTech[pTurn]);
     1562          Inc(nTech[pTurn]);
    15631563          if Mode >= moMovie then
    15641564            CallPlayer(cShowGreatLibTech, pTurn, ad);
     
    15771577  RW[pTurn].nEnemyUn := 0;
    15781578
    1579   MirBuilt := false;
     1579  MirBuilt := False;
    15801580  if (Difficulty[pTurn] > 0) and (GWinner = 0) then
    15811581    with RW[pTurn] do
     
    16001600                  begin // transport unload
    16011601                    if Model[mix].Domain = dAir then
    1602                       dec(Un[Master].AirLoad)
     1602                      Dec(Un[Master].AirLoad)
    16031603                    else
    1604                       dec(Un[Master].TroopLoad);
     1604                      Dec(Un[Master].TroopLoad);
    16051605                    Master := -1;
    16061606                  end
     
    16221622      if Mode >= moMovie then
    16231623        FillChar(ShowShipChange, SizeOf(ShowShipChange), 0);
    1624       TribeExtinct := true;
     1624      TribeExtinct := True;
    16251625      nUpdateLoc := 0;
    16261626      for cix := 0 to nCity - 1 do
     
    16381638              begin
    16391639                Loc1 := Radius[V21];
    1640                 assert((Loc1 >= 0) and (Loc1 < MapSize) and
     1640                Assert((Loc1 >= 0) and (Loc1 < MapSize) and
    16411641                  (UsedByCity[Loc1] = Loc));
    16421642                p1 := RealMap[Loc1] shr 27;
     
    16491649                  UsedByCity[Loc1] := -1;
    16501650                  Flags := Flags or chSiege;
    1651                   inc(SiegedTiles);
     1651                  Inc(SiegedTiles);
    16521652                end;
    16531653              end;
     
    16561656              if not AddBestCityTile(pTurn, cix) then
    16571657                Break;
    1658               dec(SiegedTiles);
     1658              Dec(SiegedTiles);
    16591659            end;
    16601660
     
    16641664
    16651665              if CityTurn(pTurn, cix) then
    1666                 TribeExtinct := false
     1666                TribeExtinct := False
    16671667              else
    16681668              begin // city is erased
     
    16711671                Map[Loc] := Map[Loc] and not fCity; // !!! do this in inner core
    16721672                UpdateLoc[nUpdateLoc] := Loc;
    1673                 inc(nUpdateLoc);
    1674                 DestroyCity_TellPlayers(pTurn, cix, true);
     1673                Inc(nUpdateLoc);
     1674                DestroyCity_TellPlayers(pTurn, cix, True);
    16751675              end;
    16761676
     
    16791679              begin
    16801680                if Project0 and cpIndex = woMIR then // MIR completed
    1681                   MirBuilt := true
     1681                  MirBuilt := True
    16821682                else if Project0 and cpIndex = woManhattan then
    16831683                  GColdWarStart := GTurn
    16841684                else if Imp[Project0 and cpIndex].Kind = ikShipPart
    16851685                then { ship parts produced }
    1686                   inc(ShowShipChange.Ship1Change[Project0 and cpIndex -
     1686                  Inc(ShowShipChange.Ship1Change[Project0 and cpIndex -
    16871687                    imShipComp]);
    16881688              end;
     
    16921692      begin
    16931693        CheckBorders(-1, pTurn);
    1694         for i := 0 to nUpdateLoc - 1 do
    1695           UpdateUnitMap(UpdateLoc[i], true);
     1694        for I := 0 to nUpdateLoc - 1 do
     1695          UpdateUnitMap(UpdateLoc[I], True);
    16961696        if Mode >= moMovie then
    16971697          for p1 := 0 to nPl - 1 do
    16981698            if (1 shl p1 and GWatching <> 0) and (p1 <> pTurn) then
    1699               for i := 0 to nUpdateLoc - 1 do
    1700                 if ObserveLevel[UpdateLoc[i]] shr (2 * p1) and 3 >= lObserveUnhidden
     1699              for I := 0 to nUpdateLoc - 1 do
     1700                if ObserveLevel[UpdateLoc[I]] shr (2 * p1) and 3 >= lObserveUnhidden
    17011701                then
    1702                   CallPlayer(cShowCityChanged, p1, UpdateLoc[i]);
     1702                  CallPlayer(cShowCityChanged, p1, UpdateLoc[I]);
    17031703      end;
    17041704
     
    17181718              Movement := UnitSpeed(pTurn, mix, Health); { refresh movement }
    17191719
    1720             assert(Loc >= 0);
     1720            Assert(Loc >= 0);
    17211721            if Model[mix].Kind <> mkDiplomat then
    17221722            begin // check treaty violation
     
    17621762              begin
    17631763                AddBestCityTile(pTurn, RW[pTurn].nCity - 1);
    1764                 UpdateUnitMap(Loc1, true);
     1764                UpdateUnitMap(Loc1, True);
    17651765                if Mode >= moMovie then // tell enemies
    17661766                  for p1 := 0 to nPl - 1 do
     
    18101810            end;
    18111811          end;
    1812         exit
     1812        Exit;
    18131813      end;
    18141814
     
    18241824          DiscoverTech(pTurn, ResearchTech);
    18251825
    1826         dec(Research, Cost);
     1826        Dec(Research, Cost);
    18271827        Happened := Happened or phTech;
    1828         ResearchTech := -1
     1828        ResearchTech := -1;
    18291829      end
    18301830      else if (ResearchTech = -2) and (nCity > 0) then
     
    18391839            (Treaty[p1] >= trPeace) then
    18401840          begin
    1841             inc(Credibility);
     1841            Inc(Credibility);
    18421842            Break;
    18431843          end;
     
    18561856          if (p1 <> pTurn) and (1 shl p1 and (GAlive or GWatching) <> 0) then
    18571857          begin
    1858             move(GShip, RW[p1].Ship, SizeOf(GShip));
     1858            Move(GShip, RW[p1].Ship, SizeOf(GShip));
    18591859            if 1 shl p1 and GWatching <> 0 then
    18601860              CallPlayer(cShowShipChange, p1, ShowShipChange);
    1861           end
     1861          end;
    18621862      end;
    18631863      if WinOnAlone and (GAlive and not(1 shl pTurn or 1) = 0) then
     
    18711871          if (p1 <> pTurn) and ((GAlive or GWatching) and (1 shl p1) <> 0) then
    18721872            RW[p1].EnemyReport[pTurn].Government := gDespotism;
    1873         inc(Happened, phChangeGov)
     1873        Inc(Happened, phChangeGov);
    18741874      end;
    18751875    end; // if Difficulty[pTurn]>0
     
    19081908  end;
    19091909  // CheckContact;
    1910 end; { BeforeTurn }
     1910end;
    19111911
    19121912procedure AfterTurn;
    19131913var
    1914   cix, uix, p1, Loc1, Job0: integer;
    1915   JobDone: boolean;
     1914  cix, uix, p1, Loc1, Job0: Integer;
     1915  JobDone: Boolean;
    19161916begin
    19171917  with RW[pTurn] do
     
    19251925      end;
    19261926
    1927     inc(Money, OracleIncome);
     1927    Inc(Money, OracleIncome);
    19281928    OracleIncome := 0;
    19291929    if GWonder[woOracle].EffectiveOwner = pTurn then
     
    19351935            if (RW[p1].City[cix].Loc >= 0) and
    19361936              (RW[p1].City[cix].built[imTemple] > 0) then
    1937               inc(OracleIncome);
     1937              Inc(OracleIncome);
    19381938    end;
    19391939
     
    19621962            begin
    19631963              AddBestCityTile(pTurn, RW[pTurn].nCity - 1);
    1964               UpdateUnitMap(Loc1, true);
     1964              UpdateUnitMap(Loc1, True);
    19651965              if Mode >= moMovie then // tell enemies
    19661966                for p1 := 0 to nPl - 1 do
     
    19931993            else
    19941994            begin
    1995               dec(Fuel);
     1995              Dec(Fuel);
    19961996              if Fuel < 0 then
    19971997              begin
     
    20132013        Flags := Flags and not unWithdrawn;
    20142014        if (Loc >= 0) and (Model[mix].Domain = dGround) and (Master < 0) and
    2015           ((integer(Movement) = Model[mix].Speed) or
     2015          ((Integer(Movement) = Model[mix].Speed) or
    20162016          (Model[mix].Cap[mcAcademy] > 0) and (Movement * 2 >= Model[mix].Speed))
    20172017        then
     
    20352035          CheckWin(p1);
    20362036  end;
    2037 end; // Afterturn
     2037end;
    20382038
    20392039procedure NextPlayer;
     
    20492049end;
    20502050
    2051 function ExecuteMove(p, uix, ToLoc: integer; var MoveInfo: TMoveInfo;
    2052   ShowMove: TShowMove): integer;
     2051function ExecuteMove(P, uix, ToLoc: Integer; var MoveInfo: TMoveInfo;
     2052  ShowMove: TShowMove): Integer;
    20532053var
    2054   i, p1, FromLoc, uix1, nUpdateLoc: integer;
     2054  I, p1, FromLoc, uix1, nUpdateLoc: Integer;
    20552055  MinLevel, MissionResult: Cardinal;
    20562056  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;
    20592059begin
    2060   result := 0;
    2061   with RW[p], Un[uix] do
     2060  Result := 0;
     2061  with RW[P], Un[uix] do
    20622062  begin
    20632063    PModel := @Model[mix];
     
    20652065
    20662066    if Master < 0 then
    2067       FreeUnit(p, uix);
     2067      FreeUnit(P, uix);
    20682068    if (MoveInfo.MoveType in [mtMove, mtCapture]) and MoveInfo.MountainDelay
    20692069    then
     
    20732073    Loc := -2;
    20742074    if TroopLoad + AirLoad > 0 then
    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;
     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;
    20782078    UpdateUnitMap(FromLoc);
    20792079
     
    20932093          ShowMove.Flags := ShowMove.Flags or umShipLoading;
    20942094      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))
    20962096        then
    20972097        begin
     
    21022102          else
    21032103            MinLevel := lObserveUnhidden;
    2104           SeeFrom := (p1 = p) or (ObserveLevel[FromLoc] shr (2 * p1) and
     2104          SeeFrom := (p1 = P) or (ObserveLevel[FromLoc] shr (2 * p1) and
    21052105            3 >= MinLevel);
    2106           SeeTo := (p1 = p) or (ObserveLevel[ToLoc] shr (2 * p1) and
     2106          SeeTo := (p1 = P) or (ObserveLevel[ToLoc] shr (2 * p1) and
    21072107            3 >= MinLevel);
    21082108          if SeeFrom and SeeTo then
    21092109          begin
    2110             TellAboutModel(p1, p, mix);
    2111             if p1 = p then
     2110            TellAboutModel(p1, P, mix);
     2111            if p1 = P then
    21122112              ShowMove.emix := -1
    21132113            else
    2114               ShowMove.emix := emixSafe(p1, p, mix);
     2114              ShowMove.emix := emixSafe(p1, P, mix);
    21152115            if MoveInfo.MoveType = mtCapture then
    21162116              CallPlayer(cShowCapturing, p1, ShowMove)
     
    21262126      Loc := ToLoc;
    21272127    if TroopLoad + AirLoad > 0 then
    2128       for i := 0 to nUn - 1 do
    2129         if Un[i].Loc = -2 then
    2130           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;
    21332133    nUpdateLoc := 0;
    21342134    if MoveInfo.MoveType = mtCapture then
    21352135    begin
    2136       assert(Occupant[ToLoc] < 0);
     2136      Assert(Occupant[ToLoc] < 0);
    21372137      for uix1 := 0 to RW[MoveInfo.Defender].nUn - 1 do
    21382138        with RW[MoveInfo.Defender].Un[uix1] do
     
    21402140          begin
    21412141            UpdateLoc[nUpdateLoc] := Loc;
    2142             inc(nUpdateLoc);
     2142            Inc(nUpdateLoc);
    21432143          end;
    21442144      // unit will be removed -- remember position and update for all players
     
    21472147      then
    21482148      begin // city captured
    2149         ChangeCityOwner_TellPlayers(MoveInfo.Defender, MoveInfo.Dcix, p);
     2149        ChangeCityOwner_TellPlayers(MoveInfo.Defender, MoveInfo.Dcix, P);
    21502150        City[nCity - 1].Flags := CaptureTurns shl 16;
    2151         CityShrink(p, nCity - 1);
     2151        CityShrink(P, nCity - 1);
    21522152        if Mode = moPlaying then
    2153           with RW[p].City[nCity - 1] do
     2153          with RW[P].City[nCity - 1] do
    21542154          begin
    21552155            // SavedResourceWeights[nCity-1]:=ResourceWeights;
    21562156            SavedTiles[nCity - 1] := Tiles;
    21572157          end;
    2158         ExtDiscover := true;
     2158        ExtDiscover := True;
    21592159
    21602160        // Temple of Zeus effect
    2161         if GWonder[woZeus].EffectiveOwner = p then
     2161        if GWonder[woZeus].EffectiveOwner = P then
    21622162        begin
    2163           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
     2163          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
    21672167            begin
    21682168              Happened := Happened or phStealTech;
     
    21722172        end;
    21732173        if Mode = moPlaying then
    2174           LogCheckBorders(p, nCity - 1, MoveInfo.Defender);
     2174          LogCheckBorders(P, nCity - 1, MoveInfo.Defender);
    21752175{$IFOPT O-} if Mode < moPlaying then
    2176           InvalidTreatyMap := not(1 shl p); {$ENDIF}
     2176          InvalidTreatyMap := not(1 shl P); {$ENDIF}
    21772177        // territory should not be considered for the rest of the command
    21782178        // execution, because during loading a game it's incorrect before
     
    21812181      else // city destroyed
    21822182      begin
    2183         DestroyCity_TellPlayers(MoveInfo.Defender, MoveInfo.Dcix, false);
     2183        DestroyCity_TellPlayers(MoveInfo.Defender, MoveInfo.Dcix, False);
    21842184        CheckBorders(ToLoc, MoveInfo.Defender);
    21852185      end;
    2186       RecalcPeaceMap(p);
     2186      RecalcPeaceMap(P);
    21872187      if Mode >= moMovie then
    2188         move(GWonder, Wonder, SizeOf(GWonder));
     2188        Move(GWonder, Wonder, SizeOf(GWonder));
    21892189    end; { if MoveInfo.MoveType=mtCapture }
    21902190
    21912191    if MoveInfo.MoveType = mtSpyMission then
    21922192    begin
    2193       MissionResult := DoSpyMission(p, MoveInfo.Defender, MoveInfo.Dcix,
     2193      MissionResult := DoSpyMission(P, MoveInfo.Defender, MoveInfo.Dcix,
    21942194        SpyMission);
    21952195      if (Mode = moPlaying) and (SpyMission = smStealForeignReports) then
    2196         CallPlayer(cShowMissionResult, p, MissionResult);
     2196        CallPlayer(cShowMissionResult, P, MissionResult);
    21972197    end;
    21982198
    21992199    Health := MoveInfo.EndHealth;
    2200     dec(Movement, MoveInfo.Cost);
     2200    Dec(Movement, MoveInfo.Cost);
    22012201    // transport unload
    22022202    if Master >= 0 then
    22032203    begin
    22042204      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);
    22102210      end;
    22112211      Master := -1;
     
    22132213
    22142214    if (Health <= 0) or (MoveInfo.MoveType = mtSpyMission) then
    2215       RemoveUnit(p, uix) // spy mission or victim of HostileDamage
     2215      RemoveUnit(P, uix) // spy mission or victim of HostileDamage
    22162216    else
    22172217    begin // transport load
     
    22202220      begin
    22212221        if PModel.Domain = dAir then
    2222           inc(Un[MoveInfo.ToMaster].AirLoad)
     2222          Inc(Un[MoveInfo.ToMaster].AirLoad)
    22232223        else
    2224           inc(Un[MoveInfo.ToMaster].TroopLoad);
     2224          Inc(Un[MoveInfo.ToMaster].TroopLoad);
    22252225      end
    22262226      else
    2227         PlaceUnit(p, uix);
     2227        PlaceUnit(P, uix);
    22282228    end;
    22292229
    22302230    if (MoveInfo.MoveType = mtCapture) and (nUpdateLoc > 0) then
    2231       RecalcMapZoC(p);
     2231      RecalcMapZoC(P);
    22322232    UpdateUnitMap(ToLoc, MoveInfo.MoveType = mtCapture);
    2233     for i := 0 to nUpdateLoc - 1 do
    2234       UpdateUnitMap(UpdateLoc[i]);
     2233    for I := 0 to nUpdateLoc - 1 do
     2234      UpdateUnitMap(UpdateLoc[I]);
    22352235    // tell about lost units of defender
    22362236
     
    22422242        (RealMap[ToLoc] and fTerImp = tiFort) or
    22432243        (RealMap[ToLoc] and fTerImp = tiBase) then
    2244         ExtDiscover := true;
     2244        ExtDiscover := True;
    22452245      if (PModel.Kind = mkDiplomat) or (PModel.Cap[mcSpy] > 0) then
    2246         i := lObserveSuper
     2246        I := lObserveSuper
    22472247      else if (PModel.Domain = dAir) or
    22482248        (PModel.Cap[mcRadar] + PModel.Cap[mcCarrier] > 0) then
    2249         i := lObserveAll
    2250       else
    2251         i := lObserveUnhidden;
     2249        I := lObserveAll
     2250      else
     2251        I := lObserveUnhidden;
    22522252      if ExtDiscover then
    22532253      begin
    2254         if Discover21(ToLoc, p, i, true, PModel.Domain = dGround) then
    2255           result := result or rEnemySpotted;
     2254        if Discover21(ToLoc, P, I, True, PModel.Domain = dGround) then
     2255          Result := Result or rEnemySpotted;
    22562256      end
    22572257      else
    22582258      begin
    2259         if Discover9(ToLoc, p, i, true, PModel.Domain = dGround) then
    2260           result := result or rEnemySpotted;
     2259        if Discover9(ToLoc, P, I, True, PModel.Domain = dGround) then
     2260          Result := Result or rEnemySpotted;
    22612261      end;
    22622262    end;
     
    22642264    if Mode >= moMovie then { show after-move in interface modules }
    22652265      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))
    22672267        then
    22682268        begin
     
    22732273          else
    22742274            MinLevel := lObserveUnhidden;
    2275           SeeFrom := (p1 = p) or (ObserveLevel[FromLoc] shr (2 * p1) and
     2275          SeeFrom := (p1 = P) or (ObserveLevel[FromLoc] shr (2 * p1) and
    22762276            3 >= MinLevel);
    2277           SeeTo := (p1 = p) or (ObserveLevel[ToLoc] shr (2 * p1) and
     2277          SeeTo := (p1 = P) or (ObserveLevel[ToLoc] shr (2 * p1) and
    22782278            3 >= MinLevel);
    22792279          if SeeTo and (MoveInfo.MoveType = mtCapture) then
     
    22832283          else if (MoveInfo.MoveType <> mtSpyMission) and SeeTo then
    22842284            CallPlayer(cShowUnitChanged, p1, ToLoc);
    2285           for i := 0 to nUpdateLoc - 1 do
    2286             if ObserveLevel[UpdateLoc[i]] shr (2 * p1) and 3 >= lObserveUnhidden
     2285          for I := 0 to nUpdateLoc - 1 do
     2286            if ObserveLevel[UpdateLoc[I]] shr (2 * p1) and 3 >= lObserveUnhidden
    22872287            then
    2288               CallPlayer(cShowUnitChanged, p1, UpdateLoc[i]);
     2288              CallPlayer(cShowUnitChanged, p1, UpdateLoc[I]);
    22892289        end;
    22902290  end;
    2291 end; // ExecuteMove
    2292 
    2293 function ExecuteAttack(p, uix, ToLoc: integer; var MoveInfo: TMoveInfo;
    2294   ShowMove: TShowMove): integer;
     2291end;
     2292
     2293function ExecuteAttack(P, uix, ToLoc: Integer; var MoveInfo: TMoveInfo;
     2294  ShowMove: TShowMove): Integer;
    22952295
    22962296  procedure WriteBattleHistory(ToLoc, FromLoc, Attacker, Defender, mixAttacker,
    2297     mixDefender: integer; AttackerLost, DefenderLost: boolean);
     2297    mixDefender: Integer; AttackerLost, DefenderLost: Boolean);
    22982298  var
    22992299    AttackerBattle, DefenderBattle: ^TBattle;
     
    23072307        ReallocMem(BattleHistory, nBattleHistory * (2 * SizeOf(TBattle)));
    23082308      AttackerBattle := @BattleHistory[nBattleHistory];
    2309       inc(nBattleHistory);
     2309      Inc(nBattleHistory);
    23102310    end;
    23112311    with RW[Defender] do
     
    23172317        ReallocMem(BattleHistory, nBattleHistory * (2 * SizeOf(TBattle)));
    23182318      DefenderBattle := @BattleHistory[nBattleHistory];
    2319       inc(nBattleHistory);
     2319      Inc(nBattleHistory);
    23202320    end;
    23212321    AttackerBattle.Enemy := Defender;
     
    23462346
    23472347var
    2348   i, p1, FromLoc, uix1, nUpdateLoc, ExpGain, ExpelToLoc, cix1: integer;
     2348  I, p1, FromLoc, uix1, nUpdateLoc, ExpGain, ExpelToLoc, cix1: Integer;
    23492349  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;
    23522352begin
    2353   result := 0;
    2354   with RW[p].Un[uix] do
     2353  Result := 0;
     2354  with RW[P].Un[uix] do
    23552355  begin
    2356     PModel := @RW[p].Model[mix];
     2356    PModel := @RW[P].Model[mix];
    23572357    FromLoc := Loc;
    23582358
     
    23602360    ShowMove.EndHealthDef := MoveInfo.EndHealthDef;
    23612361    if MoveInfo.MoveType = mtAttack then
    2362       WriteBattleHistory(ToLoc, FromLoc, p, MoveInfo.Defender, mix,
     2362      WriteBattleHistory(ToLoc, FromLoc, P, MoveInfo.Defender, mix,
    23632363        RW[MoveInfo.Defender].Un[MoveInfo.Duix].mix, MoveInfo.EndHealth <= 0,
    23642364        MoveInfo.EndHealthDef <= 0);
     
    23672367      begin
    23682368      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)
    23712371      end; }
    23722372    if Mode >= moMovie then { show attack in interface modules }
    23732373      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))
    23752375        then
    23762376        begin
     
    23802380          if SeeFrom and SeeTo then
    23812381          begin
    2382             TellAboutModel(p1, p, mix);
    2383             if p1 = p then
     2382            TellAboutModel(p1, P, mix);
     2383            if p1 = P then
    23842384              ShowMove.emix := -1
    23852385            else
    2386               ShowMove.emix := emixSafe(p1, p, mix);
     2386              ShowMove.emix := emixSafe(p1, P, mix);
    23872387            CallPlayer(cShowAttacking, p1, ShowMove);
    23882388          end;
    23892389        end;
    23902390
    2391     LoseCityPop := false;
     2391    LoseCityPop := False;
    23922392    if (RealMap[ToLoc] and fCity <> 0) and
    23932393      ((MoveInfo.MoveType = mtAttack) and (MoveInfo.EndHealthDef <= 0) or
     
    24112411    if MoveInfo.MoveType = mtBombard then
    24122412    begin
    2413       assert(Movement >= 100);
     2413      Assert(Movement >= 100);
    24142414      if PModel.Attack = 0 then
    24152415        Flags := Flags and not unBombsLoaded;
    2416       dec(Movement, 100);
     2416      Dec(Movement, 100);
    24172417    end
    24182418    else if MoveInfo.MoveType = mtExpel then
    24192419    begin
    2420       assert(Movement >= 100);
     2420      Assert(Movement >= 100);
    24212421      Job := jNone;
    24222422      Flags := Flags and not unFortified;
    2423       dec(Movement, 100);
     2423      Dec(Movement, 100);
    24242424    end
    24252425    else
    24262426    begin
    2427       assert(MoveInfo.MoveType = mtAttack);
     2427      Assert(MoveInfo.MoveType = mtAttack);
    24282428      if MoveInfo.EndHealth = 0 then
    2429         RemoveUnit(p, uix, MoveInfo.Defender) // destroy attacker
     2429        RemoveUnit(P, uix, MoveInfo.Defender) // destroy attacker
    24302430      else
    24312431      begin // update attacker
     
    24342434          Exp := (nExp - 1) * ExpCost
    24352435        else
    2436           inc(Exp, ExpGain);
     2436          Inc(Exp, ExpGain);
    24372437        Health := MoveInfo.EndHealth;
    24382438        Job := jNone;
     
    24422442        Flags := Flags and not unFortified;
    24432443        if Movement > 100 then
    2444           dec(Movement, 100)
     2444          Dec(Movement, 100)
    24452445        else
    24462446          Movement := 0;
     
    24482448    end;
    24492449
    2450     ZoCDefenderDestroyed := false;
     2450    ZoCDefenderDestroyed := False;
    24512451    nUpdateLoc := 0;
    24522452    if MoveInfo.MoveType = mtExpel then
     
    24692469          PlaceUnit(MoveInfo.Defender, MoveInfo.Duix);
    24702470          UpdateLoc[nUpdateLoc] := Loc;
    2471           inc(nUpdateLoc);
     2471          Inc(nUpdateLoc);
    24722472          Flags := Flags or unWithdrawn;
    24732473        end;
     
    24802480          Exp := (nExp - 1) * ExpCost
    24812481        else
    2482           inc(Exp, ExpGain);
     2482          Inc(Exp, ExpGain);
    24832483        Health := MoveInfo.EndHealthDef;
    24842484      end
     
    24932493          (RealMap[ToLoc] and fTerImp <> tiFort)) or LoseCityPop and
    24942494          (RW[MoveInfo.Defender].City[MoveInfo.Dcix].Size = 2) then
    2495           RemoveAllUnits(MoveInfo.Defender, ToLoc, p)
     2495          RemoveAllUnits(MoveInfo.Defender, ToLoc, P)
    24962496          { no city, base or fortress }
    24972497        else
    2498           RemoveUnit(MoveInfo.Defender, MoveInfo.Duix, p);
     2498          RemoveUnit(MoveInfo.Defender, MoveInfo.Duix, P);
    24992499      end;
    25002500
     
    25092509              begin
    25102510                UpdateLoc[nUpdateLoc] := Loc;
    2511                 inc(nUpdateLoc);
     2511                Inc(nUpdateLoc);
    25122512              end;
    25132513          // 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);
    25152515          CheckBorders(ToLoc, MoveInfo.Defender);
    2516           RecalcPeaceMap(p);
     2516          RecalcPeaceMap(P);
    25172517        end;
    25182518    end;
    25192519
    25202520    if CityDestroyed and (nUpdateLoc > 0) then
    2521       RecalcMapZoC(p)
     2521      RecalcMapZoC(P)
    25222522    else if ZoCDefenderDestroyed then
    2523       RecalcV8ZoC(p, ToLoc);
     2523      RecalcV8ZoC(P, ToLoc);
    25242524    UpdateUnitMap(FromLoc);
    25252525    UpdateUnitMap(ToLoc, LoseCityPop);
    2526     for i := 0 to nUpdateLoc - 1 do
    2527       UpdateUnitMap(UpdateLoc[i]);
     2526    for I := 0 to nUpdateLoc - 1 do
     2527      UpdateUnitMap(UpdateLoc[I]);
    25282528    // tell about lost units of defender
    25292529
    25302530    if Mode >= moMovie then
    25312531    begin
    2532       for i := 0 to RW[p].nEnemyModel - 1 do
    2533         with RW[p].EnemyModel[i] do
    2534           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];
    25352535      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))
    25372537        then
    25382538        begin
     
    25592559    end;
    25602560  end;
    2561 end; // ExecuteAttack
    2562 
    2563 function MoveUnit(p, uix, dx, dy: integer; TestOnly: boolean): integer;
     2561end;
     2562
     2563function MoveUnit(P, uix, dx, dy: Integer; TestOnly: Boolean): Integer;
    25642564var
    2565   ToLoc: integer;
     2565  ToLoc: Integer;
    25662566  MoveInfo: TMoveInfo;
    25672567  ShowMove: TShowMove;
    25682568begin
    2569 {$IFOPT O-}assert(1 shl p and InvalidTreatyMap = 0); {$ENDIF}
    2570   with RW[p].Un[uix] do
     2569{$IFOPT O-}Assert(1 shl P and InvalidTreatyMap = 0); {$ENDIF}
     2570  with RW[P].Un[uix] do
    25712571  begin
    25722572    ToLoc := dLoc(Loc, dx, dy);
    25732573    if (ToLoc < 0) or (ToLoc >= MapSize) then
    25742574    begin
    2575       result := eInvalid;
    2576       exit;
     2575      Result := eInvalid;
     2576      Exit;
    25772577    end;
    2578     result := CalculateMove(p, uix, ToLoc, 3 - dy and 1, TestOnly, MoveInfo);
    2579     if result = eZOC_EnemySpotted then
     2578    Result := CalculateMove(P, uix, ToLoc, 3 - dy and 1, TestOnly, MoveInfo);
     2579    if Result = eZOC_EnemySpotted then
    25802580      ZOCTile := ToLoc;
    2581     if (result >= rExecuted) and not TestOnly then
     2581    if (Result >= rExecuted) and not TestOnly then
    25822582    begin
    25832583      ShowMove.dx := dx;
     
    25892589      ShowMove.Exp := Exp;
    25902590      ShowMove.Load := TroopLoad + AirLoad;
    2591       ShowMove.Owner := p;
     2591      ShowMove.Owner := P;
    25922592      if (TroopLoad > 0) or (AirLoad > 0) then
    25932593        ShowMove.Flags := unMulti
     
    26062606      case MoveInfo.MoveType of
    26072607        mtMove, mtCapture, mtSpyMission:
    2608           result := ExecuteMove(p, uix, ToLoc, MoveInfo, ShowMove) or result;
     2608          Result := ExecuteMove(P, uix, ToLoc, MoveInfo, ShowMove) or Result;
    26092609        mtAttack, mtBombard, mtExpel:
    2610           result := ExecuteAttack(p, uix, ToLoc, MoveInfo, ShowMove) or result;
     2610          Result := ExecuteAttack(P, uix, ToLoc, MoveInfo, ShowMove) or Result;
    26112611      end;
    26122612    end;
    2613   end; // with
    2614 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;
     2614end;
     2615
     2616function Server(Command, Player, Subject: Integer; var Data): Integer; stdcall;
     2617
     2618  function CountPrice(const Offer: TOffer; PriceType: Integer): Integer;
    26192619  var
    2620     i: integer;
     2620    I: Integer;
    26212621  begin
    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);
     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);
    26262626  end;
    26272627
    26282628{ procedure UpdateBorderHelper;
    26292629  var
    2630   x, y, Loc, Loc1, dx, dy, ObserveMask: integer;
     2630  X, Y, Loc, Loc1, dx, dy, ObserveMask: Integer;
    26312631  begin
    26322632  ObserveMask:=3 shl (2*pTurn);
    2633   for x:=0 to lx-1 do for y:=0 to ly shr 1-1 do
     2633  for X:=0 to lx-1 do for Y:=0 to ly shr 1-1 do
    26342634  begin
    2635   Loc:=lx*(y*2)+x;
     2635  Loc:=lx*(Y*2)+X;
    26362636  if ObserveLevel[Loc] and ObserveMask<>0 then
    26372637  begin
    26382638  for dy:=0 to 1 do for dx:=0 to 1 do
    26392639  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);
    26412641  if (Loc1>=0) and (Loc1<MapSize)
    26422642  and (ObserveLevel[Loc1] and ObserveMask<>0) then
     
    26662666  ptInvalid = 8;
    26672667
    2668   function ProjectType(Project: integer): integer;
     2668  function ProjectType(Project: Integer): Integer;
    26692669  begin
    26702670    if Project and cpCompleted <> 0 then
    2671       result := ptSelect
     2671      Result := ptSelect
    26722672    else if Project and (cpImp + cpIndex) = cpImp + imTrGoods then
    2673       result := ptTrGoods
     2673      Result := ptTrGoods
    26742674    else if Project and cpImp = 0 then
    26752675      if RW[Player].Model[Project and cpIndex].Kind = mkCaravan then
    2676         result := ptCaravan
    2677       else
    2678         result := ptUn
     2676        Result := ptCaravan
     2677      else
     2678        Result := ptUn
    26792679    else if Project and cpIndex >= nImp then
    2680       result := ptInvalid
     2680      Result := ptInvalid
    26812681    else if Imp[Project and cpIndex].Kind = ikWonder then
    2682       result := ptWonder
     2682      Result := ptWonder
    26832683    else if Imp[Project and cpIndex].Kind = ikShipPart then
    2684       result := ptShip
     2684      Result := ptShip
    26852685    else
    2686       result := ptImp;
     2686      Result := ptImp;
    26872687  end;
    26882688
    26892689var
    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,
    26912691    MaxCap, CapWeight, Cost, NextProd, Preq, TotalFood, TotalProd, CheckSum,
    26922692    StopTurn, FutureMCost, NewProject, OldImp, mix, V8, V21, AStr, DStr,
    2693     ABaseDamage, DBaseDamage: integer;
     2693    ABaseDamage, DBaseDamage: Integer;
    26942694  CityReport: TCityReport;
    26952695  FormerCLState: TCmdListState;
     
    26982698  ShowShipChange: TShowShipChange;
    26992699  ShowNegoData: TShowNegoData;
    2700   logged, ok, HasShipChanged, AllHumansDead, OfferFullySupported: boolean;
    2701 
    2702 begin { >>>server }
     2700  logged, ok, HasShipChanged, AllHumansDead, OfferFullySupported: Boolean;
     2701begin
    27032702  if Command = sTurn then
    27042703  begin
     
    27092708  end;
    27102709
    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);
    27132712  // not for internal commands
    27142713  if (Command < 0) or (Command >= $10000) then
    27152714  begin
    2716     result := eUnknown;
    2717     exit;
     2715    Result := eUnknown;
     2716    Exit;
    27182717  end;
    27192718
     
    27222721    ((Subject < 0) or (Subject >= $1000))) then
    27232722  begin
    2724     result := eInvalid;
    2725     exit;
     2723    Result := eInvalid;
     2724    Exit;
    27262725  end;
    27272726
     
    27322731  begin
    27332732    PutMessage(1 shl 16 + 1, Format('NOT Alive: %d', [Player]));
    2734     result := eNoTurn;
    2735     exit;
     2733    Result := eNoTurn;
     2734    Exit;
    27362735  end;
    27372736
    2738   result := eOK;
     2737  Result := eOK;
    27392738
    27402739  // check if command allowed now
     
    27592758    PutMessage(1 shl 16 + 1, Format('No Turn: %d calls %x',
    27602759      [Player, Command shr 4]));
    2761     result := eNoTurn;
    2762     exit;
     2760    Result := eNoTurn;
     2761    Exit;
    27632762  end;
    27642763
     
    27682767  HandoverStack[nHandoverStack] := Player + $1000;
    27692768  HandoverStack[nHandoverStack + 1] := Command;
    2770   inc(nHandoverStack, 2);
     2769  Inc(nHandoverStack, 2);
    27712770
    27722771  InvalidTreatyMap := 0;
     
    27812780    FormerCLState := CL.State;
    27822781    CL.Put(Command, Player, Subject, @Data);
    2783     logged := true;
     2782    logged := True;
    27842783  end
    27852784  else
    2786     logged := false;
     2785    logged := False;
    27872786
    27882787  case Command of
     
    27992798
    28002799    sGetDebugMap:
    2801       pointer(Data) := DebugMap[Subject];
     2800      Pointer(Data) := DebugMap[Subject];
    28022801
    28032802    { sChangeSuperView:
    28042803      if Difficulty[Player]=0 then
    28052804      begin
    2806       for i:=0 to nBrain-1 do if Brain[i].Initialized then
    2807       CallClient(i, cShowSuperView, Subject)
     2805      for I:=0 to nBrain-1 do if Brain[I].Initialized then
     2806      CallClient(I, cShowSuperView, Subject)
    28082807      end
    2809       else result:=eInvalid; }
     2808      else Result:=eInvalid; }
    28102809
    28112810    sRefreshDebugMap:
     
    28302829          else
    28312830            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));
    28342833        FillChar(TChart(Data)[StopTurn], (GTurn - StopTurn) *
    2835           SizeOf(integer), 0);
     2834          SizeOf(Integer), 0);
    28362835      end
    28372836      else
    2838         result := eInvalid;
     2837        Result := eInvalid;
    28392838
    28402839    sGetTechCost:
    2841       integer(Data) := TechCost(Player);
     2840      Integer(Data) := TechCost(Player);
    28422841
    28432842    sGetAIInfo:
    28442843      if AIInfo[Subject] = '' then
    2845         pchar(Data) := nil
    2846       else
    2847         pchar(Data) := @AIInfo[Subject][1];
     2844        PChar(Data) := nil
     2845      else
     2846        PChar(Data) := @AIInfo[Subject][1];
    28482847
    28492848    sGetAICredits:
    28502849      if AICredits = '' then
    2851         pchar(Data) := nil
    2852       else
    2853         pchar(Data) := @AICredits[1];
     2850        PChar(Data) := nil
     2851      else
     2852        PChar(Data) := @AICredits[1];
    28542853
    28552854    sGetVersion:
    2856       integer(Data) := CevoVersion;
     2855      Integer(Data) := CevoVersion;
    28572856
    28582857    sGetGameChanged:
    28592858      if Player <> 0 then
    2860         result := eInvalid
     2859        Result := eInvalid
    28612860      else if (CL <> nil) and (CL.State.nLog = nLogOpened) and
    28622861        (CL.State.MoveCode = 0) and not HasCityTileChanges and
    28632862        not HasChanges(Player) then
    2864         result := eNotChanged;
     2863        Result := eNotChanged;
    28652864
    28662865    sGetTileInfo:
    28672866      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;
    28712870
    28722871    sGetCityTileInfo:
    28732872      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;
    28772876
    28782877    sGetHypoCityTileInfo:
     
    28812880        if (TTileInfo(Data).ExplCity < 0) or
    28822881          (TTileInfo(Data).ExplCity >= RW[Player].nCity) then
    2883           result := eInvalid
     2882          Result := eInvalid
    28842883        else if ObserveLevel[Subject] shr (Player * 2) and 3 = 0 then
    2885           result := eNoPreq
     2884          Result := eNoPreq
    28862885        else
    2887           result := GetTileInfo(Player, TTileInfo(Data).ExplCity, Subject,
     2886          Result := GetTileInfo(Player, TTileInfo(Data).ExplCity, Subject,
    28882887            TTileInfo(Data));
    28892888      end
    28902889      else
    2891         result := eInvalid;
     2890        Result := eInvalid;
    28922891
    28932892    sGetJobProgress:
     
    28952894      begin
    28962895        if ObserveLevel[Subject] shr (Player * 2) and 3 = 0 then
    2897           result := eNoPreq
     2896          Result := eNoPreq
    28982897        else
    2899           result := GetJobProgress(Player, Subject, TJobProgressData(Data));
     2898          Result := GetJobProgress(Player, Subject, TJobProgressData(Data));
    29002899      end
    29012900      else
    2902         result := eInvalid;
     2901        Result := eInvalid;
    29032902
    29042903    sGetModels:
     
    29122911      end
    29132912      else
    2914         result := eInvalid;
     2913        Result := eInvalid;
    29152914
    29162915    sGetUnits:
    29172916      if (Subject >= 0) and (Subject < MapSize) and
    29182917        (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;
    29222921
    29232922    sGetDefender:
    29242923      if (Subject >= 0) and (Subject < MapSize) and (Occupant[Subject] = Player)
    29252924      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;
    29292928
    29302929    sGetBattleForecast, sGetBattleForecastEx:
     
    29362935            ((pAtt = Player) or (RWemix[Player, pAtt, mixAtt] >= 0)) then
    29372936          begin
    2938             result := GetBattleForecast(Subject, TBattleForecast(Data), uix1,
     2937            Result := GetBattleForecast(Subject, TBattleForecast(Data), uix1,
    29392938              cix1, AStr, DStr, ABaseDamage, DBaseDamage);
    29402939            if Command = sGetBattleForecastEx then
     
    29452944              TBattleForecastEx(Data).DBaseDamage := DBaseDamage;
    29462945            end;
    2947             if result = eOK then
    2948               result := eInvalid; // no enemy unit there!
     2946            if Result = eOK then
     2947              Result := eInvalid; // no enemy unit there!
    29492948          end
    29502949          else
    2951             result := eInvalid
    2952       else
    2953         result := eInvalid;
     2950            Result := eInvalid
     2951      else
     2952        Result := eInvalid;
    29542953
    29552954    sGetUnitReport:
    29562955      if (Subject < 0) or (Subject >= RW[Player].nUn) or
    29572956        (RW[Player].Un[Subject].Loc < 0) then
    2958         result := eInvalid
     2957        Result := eInvalid
    29592958      else
    29602959        GetUnitReport(Player, Subject, TUnitReport(Data));
     
    29632962      if (Subject < 0) or (Subject >= RW[Player].nUn) or
    29642963        (RW[Player].Un[Subject].Loc < 0) then
    2965         result := eInvalid
    2966       else
    2967         result := GetMoveAdvice(Player, Subject, TMoveAdviceData(Data));
     2964        Result := eInvalid
     2965      else
     2966        Result := GetMoveAdvice(Player, Subject, TMoveAdviceData(Data));
    29682967
    29692968    sGetPlaneReturn:
     
    29712970        (RW[Player].Un[Subject].Loc < 0) or
    29722971        (RW[Player].Model[RW[Player].Un[Subject].mix].Domain <> dAir) then
    2973         result := eInvalid
     2972        Result := eInvalid
    29742973      else
    29752974      begin
    29762975        if CanPlaneReturn(Player, Subject, TPlaneReturnData(Data)) then
    2977           result := eOK
     2976          Result := eOK
    29782977        else
    2979           result := eNoWay;
     2978          Result := eNoWay;
    29802979      end;
    29812980
     
    29882987          Owner := Player;
    29892988          SearchCity(Subject, Owner, cix1);
    2990           c := RW[Owner].City[cix1];
    2991           if (Owner <> Player) and (c.Project and cpImp = 0) then
    2992             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);
    29932992        end
    29942993      else
    2995         result := eInvalid;
     2994        Result := eInvalid;
    29962995
    29972996    sGetCityReport:
    29982997      if (Subject < 0) or (Subject >= RW[Player].nCity) or
    29992998        (RW[Player].City[Subject].Loc < 0) then
    3000         result := eInvalid
    3001       else
    3002         result := GetCityReport(Player, Subject, TCityReport(Data));
     2999        Result := eInvalid
     3000      else
     3001        Result := GetCityReport(Player, Subject, TCityReport(Data));
    30033002
    30043003    sGetCityReportNew:
    30053004      if (Subject < 0) or (Subject >= RW[Player].nCity) or
    30063005        (RW[Player].City[Subject].Loc < 0) then
    3007         result := eInvalid
     3006        Result := eInvalid
    30083007      else
    30093008        GetCityReportNew(Player, Subject, TCityReportNew(Data));
     
    30123011      if (Subject < 0) or (Subject >= RW[Player].nCity) or
    30133012        (RW[Player].City[Subject].Loc < 0) then
    3014         result := eInvalid
     3013        Result := eInvalid
    30153014      else
    30163015        GetCityAreaInfo(Player, RW[Player].City[Subject].Loc,
     
    30323031      end
    30333032      else
    3034         result := eInvalid;
     3033        Result := eInvalid;
    30353034
    30363035    sGetEnemyCityReportNew:
     
    30493048      end
    30503049      else
    3051         result := eInvalid;
     3050        Result := eInvalid;
    30523051
    30533052    sGetEnemyCityAreaInfo:
     
    30633062      end
    30643063      else
    3065         result := eInvalid;
     3064        Result := eInvalid;
    30663065
    30673066    sGetCityTileAdvice:
    30683067      if (Subject < 0) or (Subject >= RW[Player].nCity) or
    30693068        (RW[Player].City[Subject].Loc < 0) then
    3070         result := eInvalid
     3069        Result := eInvalid
    30713070      else
    30723071        GetCityTileAdvice(Player, Subject, TCityTileAdviceData(Data));
     
    30813080          EditTile(Loc, NewTile)
    30823081      else
    3083         result := eInvalid;
     3082        Result := eInvalid;
    30843083
    30853084    sRandomMap:
     
    30873086      begin
    30883087        CreateElevation;
    3089         PreviewElevation := false;
    3090         CreateMap(false);
     3088        PreviewElevation := False;
     3089        CreateMap(False);
    30913090        FillChar(ObserveLevel, MapSize * 4, 0);
    30923091        DiscoverAll(Player, lObserveSuper);
    30933092      end
    30943093      else
    3095         result := eInvalid;
     3094        Result := eInvalid;
    30963095
    30973096    sMapGeneratorRequest:
    30983097      if not MapGeneratorAvailable then
    3099         result := eInvalid;
     3098        Result := eInvalid;
    31003099
    31013100    {
     
    31053104    sTurn, sTurn - sExecute:
    31063105      begin
    3107         AllHumansDead := true;
     3106        AllHumansDead := True;
    31083107        for p1 := 0 to nPl - 1 do
    31093108          if (1 shl p1 and GAlive <> 0) and (bix[p1].Kind = btTerm) then
    3110             AllHumansDead := false;
     3109            AllHumansDead := False;
    31113110        if (pDipActive >= 0) // still in negotiation mode
    31123111          or (pTurn = 0) and ((GWinner > 0) or (GTurn = MaxTurn) or
    31133112          (Difficulty[0] > 0) and AllHumansDead) then // game end reached
    3114           result := eViolation
     3113          Result := eViolation
    31153114        else if Command >= sExecute then
    31163115        begin
     
    31233122            begin
    31243123              LogChanges;
    3125               SaveGame('~' + LogFileName, true);
     3124              SaveGame('~' + LogFileName, True);
    31263125            end;
    31273126{$ENDIF}
     
    31383137            TotalFood := 0;
    31393138            TotalProd := 0;
    3140             for i := 0 to RW[pTurn].nCity - 1 do
    3141               if RW[pTurn].City[i].Loc >= 0 then
     3139            for I := 0 to RW[pTurn].nCity - 1 do
     3140              if RW[pTurn].City[I].Loc >= 0 then
    31423141              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);
    31453144              end;
    31463145            CheckSum := TotalFood and 7 + TotalProd and 7 shl 3 +
     
    31533152          begin
    31543153            if CheckSum <> Subject then
    3155               LoadOK := false;
     3154              LoadOK := False;
    31563155          end
    31573156          else // save checksum
     
    31803179            pTurn := (pTurn + 1) mod nPl;
    31813180            if pTurn = 0 then
    3182               inc(GTurn);
     3181              Inc(GTurn);
    31833182            if Assigned(bix[pTurn]) and ((1 shl pTurn) and GAlive = 0) then
    31843183            begin // already made extinct -- continue statistics
     
    32193218    sBreak, sResign, sNextRound, sReload:
    32203219      if Mode = moMovie then
    3221         MovieStopped := true
     3220        MovieStopped := True
    32223221      else
    32233222      begin
     
    32253224        begin
    32263225          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);
    32283227          for p1 := 1 to nPl - 1 do
    32293228            if bix[p1].Kind = btTerm then
    3230               ok := false;
     3229              ok := False;
    32313230          // allow reload in AI-only games only
    32323231        end
     
    32373236          if (Command = sBreak) or (Command = sResign) then
    32383237            Notify(ntBackOn);
    3239           for i := 0 to Brains.Count - 1 do
    3240             if Brains[i].Initialized then
     3238          for I := 0 to Brains.Count - 1 do
     3239            if Brains[I].Initialized then
    32413240            begin
    3242               if Brains[i].Kind = btAI then
    3243                 Notify(ntDeinitModule, i);
    3244               CallClient(i, cBreakGame, nil^);
     3241              if Brains[I].Kind = btAI then
     3242                Notify(ntDeinitModule, I);
     3243              CallClient(I, cBreakGame, nil^);
    32453244            end;
    32463245          Notify(ntEndInfo);
     
    32493248            LogCityTileChanges;
    32503249            LogChanges;
    3251             SaveGame(LogFileName, false);
     3250            SaveGame(LogFileName, False);
    32523251          end;
    32533252          DeleteFile(SavePath + '~' + LogFileName);
     
    32623261                LandMass, MaxTurn);
    32633262            sReload:
    3264               LoadGame(SavePath, LogFileName, integer(Data), false);
     3263              LoadGame(SavePath, LogFileName, Integer(Data), False);
    32653264          end;
    32663265        end
    32673266        else
    3268           result := eInvalid;
     3267          Result := eInvalid;
    32693268      end;
    32703269
     
    32833282      end
    32843283      else
    3285         result := eInvalid;
     3284        Result := eInvalid;
    32863285
    32873286    scContact .. scContact + (nPl - 1) shl 4, scContact - sExecute .. scContact
    32883287      - sExecute + (nPl - 1) shl 4:
    32893288      if (pDipActive >= 0) or (1 shl (Command shr 4 and $F) and GAlive = 0) then
    3290         result := eInvalid
     3289        Result := eInvalid
    32913290      else if GWinner > 0 then
    3292         result := eViolation // game end reached
     3291        Result := eViolation // game end reached
    32933292      else if RW[Player].Treaty[Command shr 4 and $F] = trNoContact then
    3294         result := eNoPreq
     3293        Result := eNoPreq
    32953294      else if GTurn < GColdWarStart + ColdWarTurns then
    3296         result := eColdWar
     3295        Result := eColdWar
    32973296      else if RW[Player].Government = gAnarchy then
    3298         result := eAnarchy
     3297        Result := eAnarchy
    32993298      else if RW[Command shr 4 and $F].Government = gAnarchy then
    33003299      begin
    3301         result := eAnarchy;
     3300        Result := eAnarchy;
    33023301        LastEndClientCommand := scReject; // enable cancel treaty
    33033302        pContacted := Command shr 4 and $F;
     
    33073306        pContacted := Command shr 4 and $F;
    33083307        pDipActive := pContacted;
    3309         assert(Mode = moPlaying);
     3308        Assert(Mode = moPlaying);
    33103309        Inform(pDipActive);
    33113310        ChangeClientWhenDone(scContact, pDipActive, pTurn, 4);
     
    33183317        begin // contact requested and not accepted yet
    33193318          pDipActive := -1;
    3320           assert(Mode = moPlaying);
     3319          Assert(Mode = moPlaying);
    33213320          ChangeClientWhenDone(cContinue, pTurn, nil^, 0);
    33223321        end;
    33233322      end
    33243323      else
    3325         result := eInvalid;
     3324        Result := eInvalid;
    33263325
    33273326    scDipStart, scDipStart - sExecute:
     
    33343333            RW[pTurn].Credibility;
    33353334          pDipActive := pTurn;
    3336           assert(Mode = moPlaying);
     3335          Assert(Mode = moPlaying);
    33373336          IntServer(sIntHaveContact, pTurn, pContacted, nil^);
    33383337          ChangeClientWhenDone(scDipStart, pDipActive, nil^, 0);
     
    33403339      end
    33413340      else
    3342         result := eInvalid;
     3341        Result := eInvalid;
    33433342
    33443343    scDipNotice, scDipAccept, scDipCancelTreaty, scDipBreak,
     
    33473346      if pDipActive >= 0 then
    33483347      begin
    3349         assert(Mode = moPlaying);
     3348        Assert(Mode = moPlaying);
    33503349        if pDipActive = pTurn then
    33513350          p1 := pContacted
     
    33633362            // check if offer can be accepted
    33643363            if nDeliver + nCost = 0 then
    3365               result := eOfferNotAcceptable;
    3366             for i := 0 to nDeliver + nCost - 1 do
    3367               if Price[i] = opChoose then
    3368                 result := eOfferNotAcceptable;
    3369             for i := 0 to nCost - 1 do
    3370               if not PayPrice(pDipActive, p1, Price[nDeliver + i], false) then
    3371                 result := eOfferNotAcceptable;
    3372             if (Command >= sExecute) and (result >= rExecuted) then
     3364              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
    33733372            begin
    33743373              IntServer(sIntPayPrices + nDeliver + nCost, p1, pDipActive,
     
    33773376
    33783377              // tell other players about ship part trades
    3379               HasShipChanged := false;
     3378              HasShipChanged := False;
    33803379              FillChar(ShowShipChange, SizeOf(ShowShipChange), 0);
    3381               for i := 0 to nDeliver + nCost - 1 do
    3382                 if Price[i] and opMask = opShipParts then
     3380              for I := 0 to nDeliver + nCost - 1 do
     3381                if Price[I] and opMask = opShipParts then
    33833382                begin
    3384                   HasShipChanged := true;
    3385                   if i >= nDeliver then
     3383                  HasShipChanged := True;
     3384                  if I >= nDeliver then
    33863385                  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);
    33913390                  end
    33923391                  else
    33933392                  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);
    33983397                  end;
    33993398                end;
     
    34073406                    (1 shl p2 and (GAlive or GWatching) <> 0) then
    34083407                  begin
    3409                     move(GShip, RW[p2].Ship, SizeOf(GShip));
     3408                    Move(GShip, RW[p2].Ship, SizeOf(GShip));
    34103409                    if 1 shl p2 and GWatching <> 0 then
    34113410                      CallPlayer(cShowShipChange, p2, ShowShipChange);
     
    34203419            (GTurn < RW[pDipActive].LastCancelTreaty[p1] + CancelTreatyTurns)
    34213420          then
    3422             result := eCancelTreatyRush
     3421            Result := eCancelTreatyRush
    34233422          else if Command >= sExecute then
    34243423          begin
     
    34273426              if (p2 <> p1) and (1 shl p2 and PeaceEnded <> 0) then
    34283427              begin
    3429                 i := p1 shl 4 + pDipActive;
    3430                 CallPlayer(cShowSupportAllianceAgainst, p2, i);
     3428                I := p1 shl 4 + pDipActive;
     3429                CallPlayer(cShowSupportAllianceAgainst, p2, I);
    34313430              end;
    34323431            for p2 := 0 to nPl - 1 do
    34333432              if (p2 <> p1) and (1 shl p2 and PeaceEnded <> 0) then
    34343433              begin
    3435                 i := p2;
    3436                 CallPlayer(cShowCancelTreatyByAlliance, pDipActive, i);
     3434                I := p2;
     3435                CallPlayer(cShowCancelTreatyByAlliance, pDipActive, I);
    34373436              end;
    34383437          end;
    34393438        end
    34403439        else
    3441           result := eInvalid;
    3442         if (Command >= sExecute) and (result >= rExecuted) then
     3440          Result := eInvalid;
     3441        if (Command >= sExecute) and (Result >= rExecuted) then
    34433442          if LastEndClientCommand = scDipBreak then
    34443443          begin // break negotiation
     
    34623461      end
    34633462      else
    3464         result := eInvalid;
     3463        Result := eInvalid;
    34653464
    34663465    scDipOffer, scDipOffer - sExecute:
     
    34753474            pDipActive := -1;
    34763475            CallPlayer(cShowEndContact, pContacted, nil^);
    3477             assert(Mode = moPlaying);
     3476            Assert(Mode = moPlaying);
    34783477            ChangeClientWhenDone(cContinue, pTurn, nil^, 0);
    34793478          end;
     
    34883487          if RW[pDipActive].Treaty[p1] < trPeace then
    34893488          begin // no tribute allowed!
    3490             for i := 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do
    3491               if (TOffer(Data).Price[i] and opMask = opTribute) then
    3492                 result := eInvalidOffer;
    3493             for i := 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do
    3494               if (TOffer(Data).Price[i] = opTreaty + trPeace) then
    3495                 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;
    34963495          end;
    3497           for i := 0 to TOffer(Data).nDeliver - 1 do
    3498             if (TOffer(Data).Price[i] <> opChoose) and
    3499               not PayPrice(pDipActive, p1, TOffer(Data).Price[i], false) then
    3500               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;
    35013500          if CountPrice(TOffer(Data), opTreaty) > 1 then
    3502             result := eInvalidOffer;
    3503           for i := 0 to nShipPart - 1 do
    3504             if CountPrice(TOffer(Data), opShipParts + i shl 16) > 1 then
    3505               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;
    35063505          if CountPrice(TOffer(Data), opMoney) > 1 then
    3507             result := eInvalidOffer;
     3506            Result := eInvalidOffer;
    35083507          if CountPrice(TOffer(Data), opTribute) > 1 then
    3509             result := eInvalidOffer;
     3508            Result := eInvalidOffer;
    35103509          case CountPrice(TOffer(Data), opChoose) of
    35113510            0:
     
    35133512            1:
    35143513              if (TOffer(Data).nCost = 0) or (TOffer(Data).nDeliver = 0) then
    3515                 result := eInvalidOffer;
     3514                Result := eInvalidOffer;
    35163515          else
    3517             result := eInvalidOffer;
     3516            Result := eInvalidOffer;
    35183517          end;
    35193518
    35203519          // !!! check here if cost can be demanded
    35213520
    3522           if (Command >= sExecute) and (result >= rExecuted) then
     3521          if (Command >= sExecute) and (Result >= rExecuted) then
    35233522          begin
    35243523            OfferFullySupported := (TOffer(Data).nDeliver <= 2) and
    35253524              (TOffer(Data).nCost <= 2); // >2 no more allowed
    3526             for i := 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do
     3525            for I := 0 to TOffer(Data).nDeliver + TOffer(Data).nCost - 1 do
    35273526            begin
    3528               if TOffer(Data).Price[i] and opMask = opTribute then
    3529                 OfferFullySupported := false;
     3527              if TOffer(Data).Price[I] and opMask = opTribute then
     3528                OfferFullySupported := False;
    35303529              // tribute no more part of the game
    3531               if (TOffer(Data).Price[i] and opMask = opTreaty) and
    3532                 (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])
    35333532              then
    3534                 OfferFullySupported := false;
     3533                OfferFullySupported := False;
    35353534              // agreed treaty end no more part of the game
    3536               if TOffer(Data).Price[i] = opTreaty + trCeaseFire then
    3537                 OfferFullySupported := false;
     3535              if TOffer(Data).Price[I] = opTreaty + trCeaseFire then
     3536                OfferFullySupported := False;
    35383537              // ceasefire no more part of the game
    35393538            end;
     
    35603559              LastOffer := TOffer(Data);
    35613560              // show offered things to receiver
    3562               for i := 0 to LastOffer.nDeliver - 1 do
    3563                 ShowPrice(pDipActive, p1, LastOffer.Price[i]);
     3561              for I := 0 to LastOffer.nDeliver - 1 do
     3562                ShowPrice(pDipActive, p1, LastOffer.Price[I]);
    35643563              pDipActive := p1;
    3565               assert(Mode = moPlaying);
     3564              Assert(Mode = moPlaying);
    35663565              ChangeClientWhenDone(scDipOffer, pDipActive, LastOffer,
    35673566                SizeOf(LastOffer));
    3568             end
    3569           end
     3567            end;
     3568          end;
    35703569        end
    35713570      else
    3572         result := eInvalid;
     3571        Result := eInvalid;
    35733572
    35743573    {
     
    35833582      end
    35843583      else
    3585         result := eInvalid;
     3584        Result := eInvalid;
    35863585
    35873586    sSetTestFlag:
     
    35933592      end
    35943593      else
    3595         result := eInvalid;
     3594        Result := eInvalid;
    35963595
    35973596    sSetGovernment, sSetGovernment - sExecute:
     
    35993598{$IFDEF TEXTLOG}CmdInfo := Format('SetGovernment P%d: %d', [Player, Subject]); {$ENDIF}
    36003599        if RW[Player].Happened and phChangeGov = 0 then
    3601           result := eViolation
     3600          Result := eViolation
    36023601        else if RW[Player].Government = Subject then
    3603           result := eNotChanged
     3602          Result := eNotChanged
    36043603        else if (Subject >= nGov) then
    3605           result := eInvalid
     3604          Result := eInvalid
    36063605        else if (Subject >= gMonarchy) and
    36073606          (RW[Player].Tech[GovPreq[Subject]] < tsApplicable) then
    3608           result := eNoPreq
     3607          Result := eNoPreq
    36093608        else if Command >= sExecute then
    36103609        begin
     
    36143613            then
    36153614              RW[p1].EnemyReport[Player].Government := Subject;
    3616         end
     3615        end;
    36173616      end;
    36183617
     
    36213620{$IFDEF TEXTLOG}CmdInfo := Format('SetRates P%d: %d/%d', [Player, Subject and $F * 10, Subject shr 4 * 10]); {$ENDIF}
    36223621        if Subject and $F + Subject shr 4 > 10 then
    3623           result := eInvalid
     3622          Result := eInvalid
    36243623        else if (RW[Player].TaxRate = Subject and $F * 10) and
    36253624          (RW[Player].LuxRate = Subject shr 4 * 10) then
    3626           result := eNotChanged
     3625          Result := eNotChanged
    36273626        else if Command >= sExecute then
    36283627        begin
    36293628          RW[Player].TaxRate := Subject and $F * 10;
    36303629          RW[Player].LuxRate := Subject shr 4 * 10;
    3631         end
     3630        end;
    36323631      end;
    36333632
     
    36363635{$IFDEF TEXTLOG}CmdInfo := Format('Revolution P%d', [Player]); {$ENDIF}
    36373636        if RW[Player].Government = gAnarchy then
    3638           result := eInvalid
     3637          Result := eInvalid
    36393638        else
    36403639        begin
     
    36583657          if (Mode = moPlaying) and (Subject = adMilitary) and
    36593658            (DevModelTurn[Player] <> GTurn) then
    3660             result := eNoModel
     3659            Result := eNoModel
    36613660          else if Subject <> adMilitary then
    36623661          begin
     
    36643663            begin
    36653664              if Tech[Subject] >= MaxFutureTech_Computing then
    3666                 result := eInvalid;
     3665                Result := eInvalid;
    36673666            end
    36683667            else if Subject in FutureTech then
    36693668            begin
    36703669              if Tech[Subject] >= MaxFutureTech then
    3671                 result := eInvalid;
     3670                Result := eInvalid;
    36723671            end
    36733672            else if Tech[Subject] >= tsApplicable then
    3674               result := eInvalid; // already discovered
     3673              Result := eInvalid; // already discovered
    36753674            if Tech[Subject] <> tsSeen then // look if preqs met
    36763675              if AdvPreq[Subject, 2] <> preNone then
    36773676              begin // 2 of 3 required
    3678                 i := 0;
    3679                 for j := 0 to 2 do
    3680                   if Tech[AdvPreq[Subject, j]] >= tsApplicable then
    3681                     inc(i);
    3682                 if i < 2 then
    3683                   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;
    36843683              end
    36853684              else if (AdvPreq[Subject, 0] <> preNone) and
     
    36873686                (AdvPreq[Subject, 1] <> preNone) and
    36883687                (Tech[AdvPreq[Subject, 1]] < tsApplicable) then
    3689                 result := eNoPreq;
     3688                Result := eNoPreq;
    36903689          end;
    3691           if (result = eOK) and (Command >= sExecute) then
     3690          if (Result = eOK) and (Command >= sExecute) then
    36923691          begin
    36933692            if (Mode = moPlaying) and (Subject = adMilitary) then
     
    36983697        end
    36993698        else
    3700           result := eViolation;
     3699          Result := eViolation;
    37013700      end;
    37023701
     
    37063705        {$ENDIF}
    37073706        if RW[Player].Happened and phStealTech = 0 then
    3708           result := eInvalid
     3707          Result := eInvalid
    37093708        else if (Subject >= nAdv) or (Subject in FutureTech) or
    37103709          (RW[Player].Tech[Subject] >= tsSeen) or
    37113710          (RW[GStealFrom].Tech[Subject] < tsApplicable) then
    3712           result := eInvalid
     3711          Result := eInvalid
    37133712        else if Command >= sExecute then
    37143713        begin
    37153714          SeeTech(Player, Subject);
    3716           dec(RW[Player].Happened, phStealTech);
     3715          Dec(RW[Player].Happened, phStealTech);
    37173716        end;
    37183717      end;
     
    37253724        if (Subject >= nAttitude) or (p1 >= nPl) or
    37263725          (RW[Player].EnemyReport[p1] = nil) then
    3727           result := eInvalid
     3726          Result := eInvalid
    37283727        else if RW[Player].Treaty[p1] = trNoContact then
    3729           result := eNoPreq
     3728          Result := eNoPreq
    37303729        else if RW[Player].Attitude[p1] = Subject then
    3731           result := eNotChanged
     3730          Result := eNotChanged
    37323731        else if Command >= sExecute then
    37333732        begin
     
    37403739      if (LastEndClientCommand <> scReject) or
    37413740        (RW[Player].Treaty[pContacted] < trPeace) then
    3742         result := eInvalid
     3741        Result := eInvalid
    37433742      else if (ServerVersion[Player] >= $010100) and
    37443743        (GTurn < RW[Player].LastCancelTreaty[pContacted] + CancelTreatyTurns)
    37453744      then
    3746         result := eCancelTreatyRush
     3745        Result := eCancelTreatyRush
    37473746      else if Command >= sExecute then
    37483747      begin
     
    37523751          if (p2 <> pContacted) and (1 shl p2 and PeaceEnded <> 0) then
    37533752          begin
    3754             i := pContacted shl 4 + Player;
    3755             CallPlayer(cShowSupportAllianceAgainst, p2, i);
     3753            I := pContacted shl 4 + Player;
     3754            CallPlayer(cShowSupportAllianceAgainst, p2, I);
    37563755          end;
    37573756        for p2 := 0 to nPl - 1 do
    37583757          if (p2 <> pContacted) and (1 shl p2 and PeaceEnded <> 0) then
    37593758          begin
    3760             i := p2;
    3761             CallPlayer(cShowCancelTreatyByAlliance, Player, i);
     3759            I := p2;
     3760            CallPlayer(cShowCancelTreatyByAlliance, Player, I);
    37623761          end;
    37633762        LastEndClientCommand := sTurn;
     
    37723771{$IFDEF TEXTLOG}CmdInfo := Format('CreateDevModel P%d', [Player]); {$ENDIF}
    37733772        if Subject >= 4 then
    3774           result := eInvalid
     3773          Result := eInvalid
    37753774        else if (upgrade[Subject, 0].Preq <> preNone) and
    37763775          (RW[Player].Tech[upgrade[Subject, 0].Preq] < tsApplicable) then
    3777           result := eNoPreq
     3776          Result := eNoPreq
    37783777        else if Command >= sExecute then
    37793778        begin
     
    37863785            Upgrades := 0;
    37873786            FutureMCost := 0;
    3788             for i := 0 to nUpgrade - 1 do
    3789               with upgrade[Domain, i] do
     3787            for I := 0 to nUpgrade - 1 do
     3788              with upgrade[Domain, I] do
    37903789                if (Preq = preNone) or (Preq >= 0) and
    37913790                  ((RW[Player].Tech[Preq] >= tsApplicable) or
     
    37943793                  if Preq in FutureTech then
    37953794                  begin
    3796                     j := RW[Player].Tech[Preq];
    3797                     inc(FutureMCost, j * Cost);
     3795                    J := RW[Player].Tech[Preq];
     3796                    Inc(FutureMCost, J * Cost);
    37983797                  end
    37993798                  else
    38003799                  begin
    3801                     j := 1;
     3800                    J := 1;
    38023801                    if Cost > MCost then
    38033802                      MCost := Cost;
    38043803                  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);
    38083807                end;
    3809             inc(MCost, FutureMCost);
     3808            Inc(MCost, FutureMCost);
    38103809            FillChar(Cap, SizeOf(Cap), 0);
    38113810            Cap[mcOffense] := 2;
    38123811            Cap[mcDefense] := 1;
    3813             for i := 0 to nFeature - 1 do
    3814               with Feature[i] do
     3812            for I := 0 to nFeature - 1 do
     3813              with Feature[I] do
    38153814                if (1 shl Domain and Domains <> 0) and
    38163815                  ((Preq = preNone) or (Preq = preSun) and
    38173816                  (GWonder[woSun].EffectiveOwner = Player) or (Preq >= 0) and
    3818                   (RW[Player].Tech[Preq] >= tsApplicable)) and (i in AutoFeature)
     3817                  (RW[Player].Tech[Preq] >= tsApplicable)) and (I in AutoFeature)
    38193818                then
    3820                   Cap[i] := 1;
     3819                  Cap[I] := 1;
    38213820            MaxWeight := 5;
    38223821            if (WeightPreq7[Domain] <> preNA) and
     
    38403839{$IFDEF TEXTLOG}CmdInfo := Format('SetDevModelCap P%d', [Player]); {$ENDIF}
    38413840        if Subject >= nFeature then
    3842           result := eInvalid
     3841          Result := eInvalid
    38433842        else if DevModelTurn[Player] = GTurn then
    38443843        begin
     
    38463845          with RW[Player].DevModel do
    38473846            if 1 shl Domain and Feature[Subject].Domains = 0 then
    3848               result := eDomainMismatch
     3847              Result := eDomainMismatch
    38493848            else if not((Feature[Subject].Preq = preNone) or
    38503849              (Feature[Subject].Preq = preSun) and
     
    38523851              (Feature[Subject].Preq >= 0) and
    38533852              (RW[Player].Tech[Feature[Subject].Preq] >= tsApplicable)) then
    3854               result := eNoPreq
     3853              Result := eNoPreq
    38553854            else
    38563855            begin
     
    38683867                  MaxCap := 3;
    38693868                if RW[Player].Tech[adSteel] >= tsApplicable then
    3870                   inc(MaxCap);
     3869                  Inc(MaxCap);
    38713870              end
    38723871              else
     
    38783877              if (NewCap < MinCap) or (NewCap > MaxCap) or
    38793878                (Weight + (NewCap - Cap[Subject]) * CapWeight > MaxWeight) then
    3880                 result := eViolation
     3879                Result := eViolation
    38813880              else if Command >= sExecute then
    38823881              begin
     
    39213920        end
    39223921        else
    3923           result := eNoModel;
     3922          Result := eNoModel;
    39243923      end;
    39253924
     
    39323931{$IFDEF TEXTLOG}CmdInfo := Format('RemoveUnit P%d Mod%d Loc%d', [Player, RW[Player].Un[Subject].mix, RW[Player].Un[Subject].Loc]); {$ENDIF}
    39333932        if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then
    3934           result := eInvalid
     3933          Result := eInvalid
    39353934        else
    39363935        begin
    3937           result := eRemoved;
     3936          Result := eRemoved;
    39383937          Loc0 := RW[Player].Un[Subject].Loc;
    39393938          if RealMap[Loc0] and fCity <> 0 then { check utilize }
     
    39473946                (Project and cpImp = 0) and
    39483947                (RW[Player].Model[Project and cpIndex].Kind <> mkCaravan) then
    3949                 result := eUtilized;
     3948                Result := eUtilized;
    39503949              if Command >= sExecute then
    39513950              begin
    3952                 if result = eUtilized then
     3951                if Result = eUtilized then
    39533952                begin
    39543953                  with RW[Player].Un[Subject] do
    39553954                  begin
    3956                     Cost := integer(RW[Player].Model[mix].Cost) * Health *
     3955                    Cost := Integer(RW[Player].Model[mix].Cost) * Health *
    39573956                      BuildCostMod[Difficulty[Player]] div 1200;
    39583957                    if RW[Player].Model[mix].Cap[mcLine] > 0 then
     
    39603959                  end;
    39613960                  if Project and (cpImp + cpIndex) = cpImp + imTrGoods then
    3962                     inc(RW[Player].Money, Cost)
     3961                    Inc(RW[Player].Money, Cost)
    39633962                  else
    39643963                  begin
    3965                     inc(Prod, Cost * 2 div 3);
     3964                    Inc(Prod, Cost * 2 div 3);
    39663965                    Project0 := Project0 and not cpCompleted;
    39673966                    if Project0 and not cpAuto <> Project and not cpAuto then
     
    39833982{$IFDEF TEXTLOG}CmdInfo := Format('SetUnitHome P%d Mod%d Loc%d', [Player, RW[Player].Un[Subject].mix, RW[Player].Un[Subject].Loc]); {$ENDIF}
    39843983        if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then
    3985           result := eInvalid
     3984          Result := eInvalid
    39863985        else
    39873986        begin
    39883987          Loc0 := RW[Player].Un[Subject].Loc;
    39893988          if RealMap[Loc0] and fCity = 0 then
    3990             result := eInvalid
     3989            Result := eInvalid
    39913990          else
    39923991          begin
    39933992            SearchCity(Loc0, Player, cix1);
    39943993            if RW[Player].City[cix1].Flags and chCaptured <> 0 then
    3995               result := eViolation
     3994              Result := eViolation
    39963995            else if Command >= sExecute then
    39973996              RW[Player].Un[Subject].Home := cix1;
     
    40104009{$IFDEF TEXTLOG}CmdInfo := Format('LoadUnit P%d Mod%d Loc%d', [Player, RW[Player].Un[Subject].mix, RW[Player].Un[Subject].Loc]); {$ENDIF}
    40114010        if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then
    4012           result := eInvalid
     4011          Result := eInvalid
    40134012        else
    4014           result := LoadUnit(Player, Subject, Command < sExecute);
     4013          Result := LoadUnit(Player, Subject, Command < sExecute);
    40154014      end;
    40164015
     
    40194018{$IFDEF TEXTLOG}CmdInfo := Format('UnloadUnit P%d Mod%d Loc%d', [Player, RW[Player].Un[Subject].mix, RW[Player].Un[Subject].Loc]); {$ENDIF}
    40204019        if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then
    4021           result := eInvalid
     4020          Result := eInvalid
    40224021        else
    4023           result := UnloadUnit(Player, Subject, Command < sExecute);
     4022          Result := UnloadUnit(Player, Subject, Command < sExecute);
    40244023      end;
    40254024
    40264025    sSelectTransport, sSelectTransport - sExecute:
    40274026      if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then
    4028         result := eInvalid
     4027        Result := eInvalid
    40294028      else
    40304029        with RW[Player].Model[RW[Player].Un[Subject].mix] do
    40314030        begin
    40324031          if Cap[mcSeaTrans] + Cap[mcAirTrans] + Cap[mcCarrier] = 0 then
    4033             result := eInvalid
     4032            Result := eInvalid
    40344033          else if Command >= sExecute then
    40354034            uixSelectedTransport := Subject;
     
    40424041      begin
    40434042        p1 := Command shr 4 and $F;
    4044         Loc1 := integer(Data);
     4043        Loc1 := Integer(Data);
    40454044        if (Occupant[Loc1] >= 0) and (p1 <> Occupant[Loc1]) or
    40464045          (RealMap[Loc1] and fCity <> 0) and
    40474046          (RealMap[Loc1] shr 27 <> Cardinal(p1)) or
    40484047          (RW[p1].Model[Subject].Domain < dAir) and
    4049           ((RW[p1].Model[Subject].Domain = dSea) <> (RealMap[integer(Data)] and
     4048          ((RW[p1].Model[Subject].Domain = dSea) <> (RealMap[Integer(Data)] and
    40504049          fTerrain < fGrass)) then
    4051           result := eViolation
     4050          Result := eViolation
    40524051        else if Command >= sExecute then
    40534052        begin
    40544053          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);
    40564055          PlaceUnit(p1, RW[p1].nUn - 1);
    4057           UpdateUnitMap(integer(Data));
     4056          UpdateUnitMap(Integer(Data));
    40584057        end;
    40594058      end
    40604059      else
    4061         result := eInvalid;
     4060        Result := eInvalid;
    40624061
    40634062    sMoveUnit + (0 + 6 * 8) * 16, sMoveUnit + (1 + 7 * 8) * 16,
     
    40764075{$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}
    40774076        if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then
    4078           result := eInvalid
     4077          Result := eInvalid
    40794078        else
    4080           result := MoveUnit(Player, Subject, dx, dy, Command < sExecute);
     4079          Result := MoveUnit(Player, Subject, dx, dy, Command < sExecute);
    40814080      end;
    40824081
     
    40894088{$IFDEF TEXTLOG}CmdInfo := Format('AddToCity P%d Mod%d Loc%d', [Player, RW[Player].Un[Subject].mix, RW[Player].Un[Subject].Loc]); {$ENDIF}
    40904089        if (Subject >= RW[Player].nUn) or (RW[Player].Un[Subject].Loc < 0) then
    4091           result := eInvalid
     4090          Result := eInvalid
    40924091        else if not(RW[Player].Model[RW[Player].Un[Subject].mix].Kind
    40934092          in [mkSettler, mkSlaves]) and
    40944093          (RW[Player].Un[Subject].Flags and unConscripts = 0) then
    4095           result := eViolation
     4094          Result := eViolation
    40964095        else
    40974096        begin
    40984097          Loc0 := RW[Player].Un[Subject].Loc;
    40994098          if RealMap[Loc0] and fCity = 0 then
    4100             result := eInvalid
     4099            Result := eInvalid
    41014100          else
    41024101          begin
     
    41044103            with RW[Player].City[cix1] do
    41054104              if not CanCityGrow(Player, cix1) then
    4106                 result := eMaxSize
     4105                Result := eMaxSize
    41074106              else if Command >= sExecute then
    41084107              begin { add to city }
     
    41244123      begin
    41254124        Loc0 := RW[Player].Un[Subject].Loc;
    4126         i := Command shr 4 and $3F; // new job
    4127 {$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}
    41284127        if (Subject >= RW[Player].nUn) or (Loc0 < 0) then
    4129           result := eInvalid
    4130         else if i >= nJob then
    4131           result := eInvalid
     4128          Result := eInvalid
     4129        else if I >= nJob then
     4130          Result := eInvalid
    41324131        else
    41334132        begin
    4134           result := StartJob(Player, Subject, i, Command < sExecute);
    4135           if result = eCity then
     4133          Result := StartJob(Player, Subject, I, Command < sExecute);
     4134          if Result = eCity then
    41364135          begin // new city
    41374136            cix1 := RW[Player].nCity - 1;
     
    41584157    sSetCityProject, sSetCityProject - sExecute:
    41594158      begin
    4160         NewProject := integer(Data) and not cpAuto;
     4159        NewProject := Integer(Data) and not cpAuto;
    41614160{$IFDEF TEXTLOG}CmdInfo := Format('SetCityProject P%d Loc%d: %d', [Player, RW[Player].City[Subject].Loc, NewProject]); {$ENDIF}
    41624161        if (Subject >= RW[Player].nCity) or (RW[Player].City[Subject].Loc < 0)
    41634162        then
    4164           result := eInvalid
     4163          Result := eInvalid
    41654164        else
    41664165          with RW[Player].City[Subject] do
    41674166          begin
    41684167            if NewProject = Project then
    4169               result := eNotChanged
     4168              Result := eNotChanged
    41704169            else
    41714170            begin
     
    41754174              begin
    41764175                if NewProject and cpIndex >= RW[Player].nModel then
    4177                   result := eInvalid
     4176                  Result := eInvalid
    41784177                else if (NewProject and cpConscripts <> 0) and
    41794178                  not((RW[Player].Tech[adConscription] >= tsApplicable) and
     
    41814180                  and (RW[Player].Model[NewProject and cpIndex].Kind < mkScout))
    41824181                then
    4183                   result := eViolation
     4182                  Result := eViolation
    41844183                  // else if (RW[Player].Model[NewProject and cpIndex].Kind=mkSlaves)
    41854184                  // and (GWonder[woPyramids].EffectiveOwner<>Player) then
     
    41874186              end
    41884187              else if NewProject and cpIndex >= nImp then
    4189                 result := eInvalid
     4188                Result := eInvalid
    41904189              else
    41914190              begin
    41924191                Preq := Imp[NewProject and cpIndex].Preq;
    4193                 for i := 0 to nImpReplacement - 1 do
    4194                   if (ImpReplacement[i].OldImp = NewProject and cpIndex) and
    4195                     (built[ImpReplacement[i].NewImp] > 0) then
    4196                     result := eObsolete;
    4197                 if result = eObsolete then
     4192                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
    41984197                else if Preq = preNA then
    4199                   result := eInvalid
     4198                  Result := eInvalid
    42004199                else if (Preq >= 0) and (RW[Player].Tech[Preq] < tsApplicable)
    42014200                then
    4202                   result := eNoPreq
     4201                  Result := eNoPreq
    42034202                else if built[NewProject and cpIndex] > 0 then
    4204                   result := eInvalid
     4203                  Result := eInvalid
    42054204                else if (NewProject and cpIndex < nWonder) and
    42064205                  (GWonder[NewProject and cpIndex].CityID <> WonderNotBuiltYet) then
    4207                   result := eViolation // wonder already exists
     4206                  Result := eViolation // wonder already exists
    42084207                else if (NewProject and cpIndex = imSpacePort) and
    42094208                  (RW[Player].NatBuilt[imSpacePort] > 0) then
    4210                   result := eViolation // space port already exists
     4209                  Result := eViolation // space port already exists
    42114210                else if (NewProject = cpImp + imBank) and (built[imMarket] = 0)
    42124211                  or (NewProject = cpImp + imUniversity) and
     
    42144213                  (built[imUniversity] = 0) or (NewProject = cpImp + imMfgPlant)
    42154214                  and (built[imFactory] = 0) then
    4216                   result := eNoPreq;
     4215                  Result := eNoPreq;
    42174216                case NewProject - cpImp of
    42184217                  woLighthouse, woMagellan, imCoastalFort, imHarbor, imPlatform:
     
    42254224                        if (Loc1 >= 0) and (Loc1 < MapSize) and
    42264225                          (RealMap[Loc1] and fTerrain = fShore) then
    4227                           inc(Preq);
     4226                          Inc(Preq);
    42284227                      end;
    42294228                      if Preq = 0 then
    4230                         result := eNoPreq;
     4229                        Result := eNoPreq;
    42314230                    end;
    42324231                  woHoover, imHydro:
     
    42404239                          ((RealMap[Loc1] and fTerrain = fMountains) or
    42414240                          (RealMap[Loc1] and fRiver <> 0)) then
    4242                           inc(Preq);
     4241                          Inc(Preq);
    42434242                      end;
    42444243                      if Preq = 0 then
    4245                         result := eNoPreq;
     4244                        Result := eNoPreq;
    42464245                    end;
    42474246                  woMIR, imShipComp, imShipPow, imShipHab:
    42484247                    if RW[Player].NatBuilt[imSpacePort] = 0 then
    4249                       result := eNoPreq;
     4248                      Result := eNoPreq;
    42504249                end;
    42514250                if (GTestFlags and tfNoRareNeed = 0) and
    42524251                  (Imp[NewProject and cpIndex].Kind = ikShipPart) then
    42534252                  if RW[Player].Tech[adMassProduction] < tsApplicable then
    4254                     result := eNoPreq
     4253                    Result := eNoPreq
    42554254                  else
    42564255                  begin // check for rare resources
    42574256                    if NewProject and cpIndex = imShipComp then
    4258                       j := 1
     4257                      J := 1
    42594258                    else if NewProject and cpIndex = imShipPow then
    4260                       j := 2
     4259                      J := 2
    42614260                    else { if NewProject and cpIndex=imShipHab then }
    4262                       j := 3;
     4261                      J := 3;
    42634262                    // j = rare resource required
    42644263                    Preq := 0;
     
    42684267                      Loc1 := Radius[V21];
    42694268                      if (Loc1 >= 0) and (Loc1 < MapSize) and
    4270                         (RealMap[Loc1] shr 25 and 3 = Cardinal(j)) then
    4271                         inc(Preq);
     4269                        (RealMap[Loc1] shr 25 and 3 = Cardinal(J)) then
     4270                        Inc(Preq);
    42724271                    end;
    42734272                    if Preq = 0 then
    4274                       result := eNoPreq;
     4273                      Result := eNoPreq;
    42754274                  end;
    42764275              end;
    42774276
    4278               if (Command >= sExecute) and (result >= rExecuted) then
     4277              if (Command >= sExecute) and (Result >= rExecuted) then
    42794278              begin
    42804279                if pt0 <> ptSelect then
     
    42854284                    and (pt0 <> ptCaravan) then
    42864285                  begin
    4287                     inc(RW[Player].Money, Prod0);
     4286                    Inc(RW[Player].Money, Prod0);
    42884287                    Prod := 0;
    42894288                    Prod0 := 0;
     
    42924291                  else
    42934292                    Prod := Prod0 * 2 div 3;
    4294                 Project := NewProject
     4293                Project := NewProject;
    42954294              end;
    42964295            end;
     
    43034302        if (Subject >= RW[Player].nCity) or (RW[Player].City[Subject].Loc < 0)
    43044303        then
    4305           result := eInvalid
     4304          Result := eInvalid
    43064305        else
    43074306          with RW[Player].City[Subject] do
    43084307            if (RW[Player].Government = gAnarchy) or (Flags and chCaptured <> 0)
    43094308            then
    4310               result := eOutOfControl
     4309              Result := eOutOfControl
    43114310            else if (Project and cpImp <> 0) and
    43124311              ((Project and cpIndex = imTrGoods) or
    43134312              (Imp[Project and cpIndex].Kind = ikShipPart)) then
    4314               result := eInvalid // don't buy colony ship
     4313              Result := eInvalid // don't buy colony ship
    43154314            else
    43164315            begin
     
    43314330                Cost := Cost * 4;
    43324331              if Cost <= 0 then
    4333                 result := eNotChanged
     4332                Result := eNotChanged
    43344333              else if Cost > RW[Player].Money then
    4335                 result := eViolation
     4334                Result := eViolation
    43364335              else if Command >= sExecute then
    43374336                IntServer(sIntBuyMaterial, Player, Subject, Cost);
     
    43464345        if (Subject >= RW[Player].nCity) or (RW[Player].City[Subject].Loc < 0)
    43474346        then
    4348           result := eInvalid
     4347          Result := eInvalid
    43494348        else if Command >= sExecute then
    43504349          with RW[Player].City[Subject] do
    43514350          begin
    4352             inc(RW[Player].Money, Prod0);
     4351            Inc(RW[Player].Money, Prod0);
    43534352            Prod := 0;
    43544353            Prod0 := 0;
     
    43584357    sSellCityImprovement, sSellCityImprovement - sExecute:
    43594358      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}
    43614360        if (Subject >= RW[Player].nCity) or (RW[Player].City[Subject].Loc < 0)
    43624361        then
    4363           result := eInvalid
     4362          Result := eInvalid
    43644363        else
    43654364          with RW[Player].City[Subject] do
    4366             if built[integer(Data)] = 0 then
    4367               result := eInvalid
     4365            if built[Integer(Data)] = 0 then
     4366              Result := eInvalid
    43684367            else if (RW[Player].Government = gAnarchy) or
    43694368              (Flags and chCaptured <> 0) then
    4370               result := eOutOfControl
     4369              Result := eOutOfControl
    43714370            else if Flags and chImprovementSold <> 0 then
    4372               result := eOnlyOnce
     4371              Result := eOnlyOnce
    43734372            else if Command >= sExecute then
    43744373            begin
    4375               inc(RW[Player].Money, Imp[integer(Data)].Cost * BuildCostMod
     4374              Inc(RW[Player].Money, Imp[Integer(Data)].Cost * BuildCostMod
    43764375                [Difficulty[Player]] div 12);
    4377               built[integer(Data)] := 0;
    4378               if Imp[integer(Data)].Kind in [ikNatLocal, ikNatGlobal] then
     4376              built[Integer(Data)] := 0;
     4377              if Imp[Integer(Data)].Kind in [ikNatLocal, ikNatGlobal] then
    43794378              begin
    4380                 RW[Player].NatBuilt[integer(Data)] := 0;
    4381                 case integer(Data) of
     4379                RW[Player].NatBuilt[Integer(Data)] := 0;
     4380                case Integer(Data) of
    43824381                  imGrWall:
    43834382                    GrWallContinent[Player] := -1;
     
    43864385                end;
    43874386              end;
    4388               inc(Flags, chImprovementSold);
     4387              Inc(Flags, chImprovementSold);
    43894388            end;
    43904389      end;
     
    43924391    sRebuildCityImprovement, sRebuildCityImprovement - sExecute:
    43934392      begin
    4394         OldImp := integer(Data);
     4393        OldImp := Integer(Data);
    43954394{$IFDEF TEXTLOG}CmdInfo := Format('RebuildCityImprovement P%d Loc%d: %d', [Player, RW[Player].City[Subject].Loc, OldImp]); {$ENDIF}
    43964395        if (Subject >= RW[Player].nCity) or (RW[Player].City[Subject].Loc < 0)
    43974396        then
    4398           result := eInvalid
     4397          Result := eInvalid
    43994398        else
    44004399        begin
    44014400          if (OldImp < 0) or (OldImp >= nImp) or
    44024401            not(Imp[OldImp].Kind in [ikCommon, ikNatLocal, ikNatGlobal]) then
    4403             result := eInvalid
     4402            Result := eInvalid
    44044403          else
    44054404            with RW[Player].City[Subject] do
     
    44074406                not(Imp[Project and cpIndex].Kind in [ikCommon, ikNatLocal,
    44084407                ikNatGlobal]) then
    4409                 result := eInvalid
     4408                Result := eInvalid
    44104409              else if (RW[Player].Government = gAnarchy) or
    44114410                (Flags and chCaptured <> 0) then
    4412                 result := eOutOfControl
     4411                Result := eOutOfControl
    44134412              else if Flags and chImprovementSold <> 0 then
    4414                 result := eOnlyOnce
     4413                Result := eOnlyOnce
    44154414              else if Command >= sExecute then
    44164415              begin
    4417                 inc(Prod, Imp[OldImp].Cost * BuildCostMod[Difficulty[Player]]
     4416                Inc(Prod, Imp[OldImp].Cost * BuildCostMod[Difficulty[Player]]
    44184417                  div 12 * 2 div 3);
    44194418                Project0 := Project0 and not cpCompleted;
     
    44324431                  end;
    44334432                end;
    4434                 inc(Flags, chImprovementSold);
     4433                Inc(Flags, chImprovementSold);
    44354434              end;
    44364435        end;
     
    44394438    sSetCityTiles, sSetCityTiles - sExecute:
    44404439      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}
    44424441        if (Subject >= RW[Player].nCity) or (RW[Player].City[Subject].Loc < 0)
    44434442        then
    4444           result := eInvalid
     4443          Result := eInvalid
    44454444        else
    4446           result := SetCityTiles(Player, Subject, integer(Data),
     4445          Result := SetCityTiles(Player, Subject, Integer(Data),
    44474446            Command < sExecute);
    44484447      end;
     
    44614460    end
    44624461    else
    4463       result := eUnknown;
     4462      Result := eUnknown;
    44644463  end; { case command }
    44654464
    44664465  // do not log invalid and non-relevant commands
    4467   if result = eZOC_EnemySpotted then
     4466  if Result = eZOC_EnemySpotted then
    44684467  begin
    4469     assert(Mode = moPlaying);
     4468    Assert(Mode = moPlaying);
    44704469    CL.State := FormerCLState;
    44714470    IntServer(sIntDiscoverZOC, Player, 0, ZOCTile);
    44724471  end
    4473   else if result and rEffective = 0 then
     4472  else if Result and rEffective = 0 then
    44744473    if Mode < moPlaying then
    44754474    begin
    4476 {$IFDEF TEXTLOG}CmdInfo := Format('***ERROR (%x) ', [result]) + CmdInfo;
     4475{$IFDEF TEXTLOG}CmdInfo := Format('***ERROR (%x) ', [Result]) + CmdInfo;
    44774476      {$ENDIF}
    4478       LoadOK := false;
     4477      LoadOK := False;
    44794478    end
    44804479    else
     
    44824481      if logged then
    44834482        CL.State := FormerCLState;
    4484       if (result < rExecuted) and (Command >= sExecute) then
     4483      if (Result < rExecuted) and (Command >= sExecute) then
    44854484        PutMessage(1 shl 16 + 1, Format('INVALID: %d calls %x (%d)',
    44864485          [Player, Command, Subject]));
     
    44884487
    44894488  if (Command and (cClientEx or sExecute or sctMask) = sExecute or sctEndClient)
    4490     and (result >= rExecuted) then
     4489    and (Result >= rExecuted) then
    44914490    LastEndClientCommand := Command;
    4492 {$IFOPT O-}dec(nHandoverStack, 2); {$ENDIF}
    4493 end; { <<<server }
     4491{$IFOPT O-}Dec(nHandoverStack, 2); {$ENDIF}
     4492end;
    44944493
    44954494
  • branches/highdpi/Global.pas

    r412 r465  
    2424    ((CevoVersionBugFix and $ff) shl 0);
    2525
    26 
    2726implementation
    2827
    2928end.
    3029
     30
  • branches/highdpi/Graphics/System2.grs

    r349 r465  
    99      <Height>26</Height>
    1010    </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>
    1139  </Items>
    1240</GraphicSet>
  • branches/highdpi/IPQ.pas

    r303 r465  
    11{ binary heap priority queue
    2   code contributed by Rassim Eminli }
     2  Code contributed by Rassim Eminli }
    33
    44{$INCLUDE Switches.inc}
     
    88
    99type
    10 
    11   TIntegerArray = array [0 .. $40000000 div sizeof(integer)] of integer;
     10  TIntegerArray = array [0 .. $40000000 div SizeOf(Integer)] of Integer;
    1211  PIntegerArray = ^TIntegerArray;
    1312
    1413  TheapItem = record
    15     Item: integer;
    16     Value: integer;
     14    Item: Integer;
     15    Value: Integer;
    1716  end;
    1817
    19   TItemArray = array [0 .. $40000000 div sizeof(TheapItem)] of TheapItem;
     18  TItemArray = array [0 .. $40000000 div SizeOf(TheapItem)] of TheapItem;
    2019  PItemArray = ^TItemArray;
    2120
    2221  TIPQ = class
    23     constructor Create(max: integer);
     22    constructor Create(Max: Integer);
    2423    destructor Destroy; override;
    2524    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;
    2928  private
    3029    // n - is the size of the heap.
    3130    // fmax - is the max size of the heap.
    32     n, fmax: integer;
     31    N, fmax: Integer;
    3332
    3433    // bh - stores (Value, Item) pairs of the heap.
     
    4039implementation
    4140
    42 constructor TIPQ.Create(max: integer);
     41constructor TIPQ.Create(Max: Integer);
    4342begin
    4443  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;
    4948  Empty;
    5049end;
     
    5958procedure TIPQ.Empty;
    6059begin
    61   if n <> 0 then
     60  if N <> 0 then
    6261  begin
    63     FillChar(Ix^, fmax * sizeof(integer), 255);
    64     n := 0;
     62    FillChar(Ix^, fmax * SizeOf(Integer), 255);
     63    N := 0;
    6564  end;
    6665end;
    6766
    6867// Parent(i) = (i-1)/2.
    69 function TIPQ.Put(Item, Value: integer): boolean; // O(lg(n))
     68function TIPQ.Put(Item, Value: Integer): Boolean; // O(lg(n))
    7069var
    71   i, j: integer;
     70  I, J: Integer;
    7271  lbh: PItemArray;
    7372  lIx: PIntegerArray;
     
    7574  lIx := Ix;
    7675  lbh := bh;
    77   i := lIx[Item];
    78   if i >= 0 then
     76  I := lIx[Item];
     77  if I >= 0 then
    7978  begin
    80     if lbh[i].Value <= Value then
     79    if lbh[I].Value <= Value then
    8180    begin
    82       result := False;
    83       exit;
     81      Result := False;
     82      Exit;
    8483    end;
    8584  end
    8685  else
    8786  begin
    88     i := n;
    89     Inc(n);
     87    I := N;
     88    Inc(N);
    9089  end;
    9190
    92   while i > 0 do
     91  while I > 0 do
    9392  begin
    94     j := (i - 1) shr 1; // Parent(i) = (i-1)/2
    95     if Value >= lbh[j].Value then
    96       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;
    10099  end;
    101100  // 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;
    106105end;
    107106
    108 function TIPQ.TestPut(Item, Value: integer): boolean;
     107function TIPQ.TestPut(Item, Value: Integer): Boolean;
    109108var
    110   i: integer;
     109  I: Integer;
    111110begin
    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);
    114113end;
    115114
    116115// Left(i) = 2*i+1.
    117116// Right(i) = 2*i+2 => Left(i)+1
    118 function TIPQ.Get(var Item, Value: integer): boolean; // O(lg(n))
     117function TIPQ.Get(var Item, Value: Integer): Boolean; // O(lg(n))
    119118var
    120   i, j: integer;
    121   last: TheapItem;
     119  I, J: Integer;
     120  Last: TheapItem;
    122121  lbh: PItemArray;
    123122begin
    124   if n = 0 then
     123  if N = 0 then
    125124  begin
    126     result := False;
    127     exit;
     125    Result := False;
     126    Exit;
    128127  end;
    129128
     
    134133  Ix[Item] := -1;
    135134
    136   dec(n);
    137   if n > 0 then
     135  Dec(N);
     136  if N > 0 then
    138137  begin
    139     last := lbh[n];
    140     i := 0;
    141     j := 1;
    142     while j < n do
     138    Last := lbh[N];
     139    I := 0;
     140    J := 1;
     141    while J < N do
    143142    begin
    144143      // Right(i) = Left(i)+1
    145       if (j < n - 1) and (lbh[j].Value > lbh[j + 1].Value) then
    146         Inc(j);
    147       if last.Value <= lbh[j].Value then
    148         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;
    149148
    150       lbh[i] := lbh[j];
    151       Ix[lbh[i].Item] := i;
    152       i := j;
    153       j := j shl 1 + 1; // Left(j) = 2*j+1
     149      lbh[I] := lbh[J];
     150      Ix[lbh[I].Item] := I;
     151      I := J;
     152      J := J shl 1 + 1; // Left(j) = 2*j+1
    154153    end;
    155154
    156155    // 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;
    159158  end;
    160   result := True
     159  Result := True;
    161160end;
    162161
  • branches/highdpi/Inp.pas

    r412 r465  
    2121    procedure CenterToRect(Rect: TRect);
    2222  private
    23     Center: boolean;
     23    Center: Boolean;
    2424  end;
    2525
    2626var
    2727  InputDlg: TInputDlg;
     28
    2829
    2930implementation
     
    5354    9, Caption);
    5455  { 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); }
    5859end;
    5960
  • branches/highdpi/Install/rpm/c-evo.spec

    r405 r465  
    1111Requires:       sox
    1212
    13 #BuildRequires:  lazarus
     13BuildRequires:  lazarus >= 2.0.12
    1414
    1515%description
    16 Turn-based empire building game inspired by Civilization.
     16A turn-based empire building game inspired by Civilization.
    1717
    1818%global debug_package %{nil}
     
    7272/usr/bin/c-evo
    7373/usr/share/applications/c-evo.desktop
    74 /usr/share/c-evo/*
     74/usr/share/c-evo/
    7575/usr/share/pixmaps/c-evo.png
    7676
  • branches/highdpi/Install/snap/local/build.sh

    r405 r465  
    44
    55pushd ../../..
    6 snapcraft --debug --use-lxd
     6snapcraft --debug --use-lxd $@
    77popd
    88
  • branches/highdpi/Install/snap/snapcraft.yaml

    r405 r465  
    55description: |
    66  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.
    88  * Zoomable map by mouse wheel with three tile sizes
    99  * Many sample maps included
    10   * All available localizations include
     10  * Multiple localizations included
     11  * Support for user defined key mapping
    1112  * Many other small improvements
    12 confinement: strict
    13 base: core20
     13confinement: devmode
     14base: core22
    1415grade: stable
    1516icon: Graphics/c-evo_64x64.png
    1617license: NLPL
    1718
    18 environment:
    19   LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio
     19environment: 
     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
    2021  PULSE_SERVER: unix:/run/user/1000/pulse/native
    2122
    2223layout:
    2324  /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:
    24     bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox   
     25    bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox
    2526 
    2627parts:
     
    2930    source: .
    3031    source-type: local
    31     build-packages:
    32     - fpc
    33     - lazarus
    34     - lcl
    35     - lcl-utils
    36     stage-packages:   
     32    after: [lazarus]
     33    stage-packages:
    3734    - sox
    3835    - libsox-fmt-mp3
     
    7269    override-build: |
    7370      snapcraftctl build
    74       (cd AI/StdAI &&lazbuild --build-mode=Release StdAI.lpi)
     71      (cd AI/StdAI &&lazbuild --build-mode=Debug StdAI.lpi)
    7572      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
    10399    stage:
    104100      - etc
     
    107103      - usr/share/applications/c-evo.desktop
    108104      - 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   
    110120apps:
    111121  c-evo:
    112122    command: usr/share/c-evo/c-evo
    113     desktop: usr/share/applications/c-evo.desktop   
     123    desktop: usr/share/applications/c-evo.desktop
    114124    plugs:
    115125      - home
  • branches/highdpi/Integrated.lpi

    r405 r465  
    22<CONFIG>
    33  <ProjectOptions>
    4     <Version Value="11"/>
     4    <Version Value="12"/>
    55    <PathDelim Value="\"/>
    66    <General>
     
    99        <MainUnitHasCreateFormStatements Value="False"/>
    1010        <MainUnitHasTitleStatement Value="False"/>
     11        <CompatibilityMode Value="True"/>
    1112      </Flags>
    1213      <SessionStorage Value="InProjectDir"/>
    13       <MainUnit Value="0"/>
    1414      <Title Value="Integrated"/>
    1515      <UseAppBundle Value="False"/>
     
    5959            <Debugging>
    6060              <GenerateDebugInfo Value="False"/>
     61              <DebugInfoType Value="dsDwarf2Set"/>
    6162            </Debugging>
    6263            <LinkSmart Value="True"/>
     
    106107      </Item4>
    107108    </RequiredPackages>
    108     <Units Count="48">
     109    <Units Count="47">
    109110      <Unit0>
    110111        <Filename Value="Integrated.lpr"/>
     
    344345      </Unit40>
    345346      <Unit41>
    346         <Filename Value="LocalPlayer\UKeyBindings.pas"/>
     347        <Filename Value="LocalPlayer\KeyBindings.pas"/>
    347348        <IsPartOfProject Value="True"/>
    348349      </Unit41>
    349350      <Unit42>
    350         <Filename Value="UMiniMap.pas"/>
     351        <Filename Value="MiniMap.pas"/>
    351352        <IsPartOfProject Value="True"/>
    352353      </Unit42>
    353354      <Unit43>
    354         <Filename Value="UBrain.pas"/>
     355        <Filename Value="Brain.pas"/>
    355356        <IsPartOfProject Value="True"/>
    356357      </Unit43>
    357358      <Unit44>
    358         <Filename Value="Network\UNetworkServer.pas"/>
     359        <Filename Value="Network\NetworkServer.pas"/>
    359360        <IsPartOfProject Value="True"/>
    360361      </Unit44>
    361362      <Unit45>
    362         <Filename Value="Network\UNetworkClient.pas"/>
     363        <Filename Value="Network\NetworkClient.pas"/>
    363364        <IsPartOfProject Value="True"/>
    364365      </Unit45>
    365366      <Unit46>
    366         <Filename Value="Network\UNetworkCommon.pas"/>
     367        <Filename Value="Network\NetworkCommon.pas"/>
    367368        <IsPartOfProject Value="True"/>
    368369      </Unit46>
    369       <Unit47>
    370         <Filename Value="ULanguages.pas"/>
    371         <IsPartOfProject Value="True"/>
    372       </Unit47>
    373370    </Units>
    374371  </ProjectOptions>
     
    404401    <Linking>
    405402      <Debugging>
     403        <DebugInfoType Value="dsDwarf2Set"/>
     404        <UseHeaptrc Value="True"/>
    406405        <UseExternalDbgSyms Value="True"/>
    407406      </Debugging>
  • branches/highdpi/Integrated.lpr

    r405 r465  
    66  cthreads, clocale,
    77  {$ENDIF}
    8   UDpiControls, Forms, Interfaces, SysUtils, Protocol, GameServer, Direct, Start, Messg, Inp,
     8  Forms, Interfaces, SysUtils, Protocol, GameServer, Direct, Start, Messg, Inp,
    99  Back, Log, LocalPlayer, ClientTools, Tribes, IsoEngine, Term, CityScreen, Nego,
    10   NoTerm, ScreenTools, Directories;
     10  NoTerm, ScreenTools, Directories, UDpiControls;
    1111
    1212{$if declared(UseHeapTrace)}
     
    2626  DotNetClient := nil;
    2727  DpiApplication.Initialize;
    28   DpiApplication.Title := 'c-evo';
     28  DpiApplication.Title := 'C-evo';
     29  DpiApplication.TaskBarBehavior := tbMultiButton;
    2930  Directories.UnitInit;
    3031  ScreenTools.UnitInit;
  • branches/highdpi/Language.txt

    r405 r465  
    140140#TITLE_SPYMISSION Covert Operation
    141141#TITLE_SUICIDE Suicide Mission
     142#TITLE_MESSAGE Message
    142143#FRMILREP Military Report
    143144
  • branches/highdpi/LocalPlayer/Battle.pas

    r361 r465  
    3232    uix, ToLoc: Integer;
    3333    Forecast: TBattleForecastEx;
    34     IsSuicideQuery: boolean;
    35   end;
    36 
    37 var
    38   BattleDlg: TBattleDlg;
     34    IsSuicideQuery: Boolean;
     35  end;
     36
    3937
    4038implementation
     
    6260  TextSize: TSize;
    6361  LabelText: string;
    64   FirstStrike: boolean;
     62  FirstStrike: Boolean;
    6563begin
    6664  MaxBar := 65;
     
    112110    VLightGradient(ca, xm - 8, ym + 8 + LABaseDamage, LADamage - LABaseDamage,
    113111      FanaticColor);
    114   DpiBitCanvas(ca, xm - 12, ym - 12, 24, 24,
     112  DpiBitBltCanvas(ca, xm - 12, ym - 12, 24, 24,
    115113    HGrSystem.Mask.Canvas, 26, 146, SRCAND);
    116   DpiBitCanvas(ca, xm - 12, ym - 12, 24, 24,
     114  DpiBitBltCanvas(ca, xm - 12, ym - 12, 24, 24,
    117115    HGrSystem.Data.Canvas, 26, 146, SRCPAINT);
    118116
     
    137135  if Forecast.EndHealthDef <= 0 then
    138136  begin
    139     DpiBitCanvas(ca, xm + 9 + LDDamage - 7, ym - 6, 14, 17,
     137    DpiBitBltCanvas(ca, xm + 9 + LDDamage - 7, ym - 6, 14, 17,
    140138      HGrSystem.Mask.Canvas, 51, 153, SRCAND);
    141     DpiBitCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17,
     139    DpiBitBltCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17,
    142140      HGrSystem.Mask.Canvas, 51, 153, SRCAND);
    143     DpiBitCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17,
     141    DpiBitBltCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17,
    144142      HGrSystem.Data.Canvas, 51, 153, SRCPAINT);
    145143  end;
     
    149147  begin
    150148    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);
    152150  end
    153151  else
     
    157155  if Forecast.EndHealthAtt <= 0 then
    158156  begin
    159     DpiBitCanvas(ca, xm - 6, ym + 9 + LADamage - 7, 14, 17,
     157    DpiBitBltCanvas(ca, xm - 6, ym + 9 + LADamage - 7, 14, 17,
    160158      HGrSystem.Mask.Canvas, 51, 153, SRCAND);
    161     DpiBitCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17,
     159    DpiBitBltCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17,
    162160      HGrSystem.Mask.Canvas, 51, 153, SRCAND);
    163     DpiBitCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17,
     161    DpiBitBltCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17,
    164162      HGrSystem.Data.Canvas, 51, 153, SRCPAINT);
    165163  end;
     
    171169    if Forecast.EndHealthAtt > 0 then
    172170      RisedTextOut(ca, xm - (TextSize.cx + 1) div 2, ym + 8 + LAAvoidedDamage,
    173         LabelText)
     171        LabelText);
    174172  end
    175173  else
     
    178176
    179177  IsoMap.SetOutput(Buffer);
    180   DpiBitCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm + 8 + 4,
     178  DpiBitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm + 8 + 4,
    181179    ym - 8 - 12 - 48);
    182180  { if TerrType<fForest then
     
    190188    end; }
    191189  IsoMap.PaintUnit(1, 0, UnitInfo, 0);
    192   DpiBitCanvas(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,
    193191    0, 0);
    194192
    195   DpiBitCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm - 8 - 4 - 66,
     193  DpiBitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm - 8 - 4 - 66,
    196194    ym + 8 + 12);
    197   MakeUnitInfo(me, MyUn[uix], UnitInfo);
     195  MakeUnitInfo(Me, MyUn[uix], UnitInfo);
    198196  UnitInfo.Flags := UnitInfo.Flags and not unFortified;
    199197  IsoMap.PaintUnit(1, 0, UnitInfo, 0);
    200   DpiBitCanvas(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);
     199end;
    202200
    203201procedure TBattleDlg.FormCreate(Sender: TObject);
     
    215213    ClientWidth := 300;
    216214    ClientHeight := 288;
    217     OKBtn.Visible := true;
    218     CancelBtn.Visible := true;
     215    OKBtn.Visible := True;
     216    CancelBtn.Visible := True;
    219217    Left := (DpiScreen.Width - ClientWidth) div 2; // center on screen
    220218    Top := (DpiScreen.Height - ClientHeight) div 2;
     
    224222    ClientWidth := 178;
    225223    ClientHeight := 178;
    226     OKBtn.Visible := false;
    227     CancelBtn.Visible := false;
     224    OKBtn.Visible := False;
     225    CancelBtn.Visible := False;
    228226  end;
    229227end;
     
    231229procedure TBattleDlg.FormPaint(Sender: TObject);
    232230var
    233   ym, cix, p: Integer;
    234   s, s1: string;
     231  ym, cix, P: Integer;
     232  S, s1: string;
    235233begin
    236234  with Canvas do
     
    240238    Brush.Style := bsClear;
    241239    PaintBackground(self, 3 + Border, 3 + Border,
    242       ClientWidth - (6 + 2 * Border), ClientHeight - (6 + 2 * Border))
     240      ClientWidth - (6 + 2 * Border), ClientHeight - (6 + 2 * Border));
    243241  end;
    244242  Frame(Canvas, Border + 1, Border + 1, ClientWidth - (2 + Border),
     
    252250  begin
    253251    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);
    257255    Canvas.Font.Assign(UniFont[ftNormal]);
    258     s := Phrases.Lookup('SUICIDE');
    259     p := pos('\', s);
    260     if p = 0 then
    261       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)
    263261    else
    264262    begin
    265       s1 := copy(s, 1, p - 1);
     263      s1 := Copy(S, 1, P - 1);
    266264      RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, s1)) div 2,
    267265        205 - MessageLineSpacing div 2, s1);
    268       s1 := copy(s, p + 1, 255);
     266      s1 := Copy(S, P + 1, 255);
    269267      RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, s1)) div 2,
    270268        205 + (MessageLineSpacing - MessageLineSpacing div 2), s1);
    271269    end;
    272     ym := 110
     270    ym := 110;
    273271  end
    274272  else
     
    297295begin
    298296  if not IsSuicideQuery then
    299     Close
     297    Close;
    300298end;
    301299
     
    309307    if Key <> VK_ESCAPE then
    310308      MainScreen.FormKeyDown(Sender, Key, Shift);
    311   end
     309  end;
    312310end;
    313311
  • branches/highdpi/LocalPlayer/CityScreen.pas

    r405 r465  
    55
    66uses
    7   UDpiControls, {$IFDEF LINUX}LMessages,{$ENDIF}
    8   Protocol, ClientTools, Term, ScreenTools, IsoEngine, BaseWin,
    9   LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
    10   ButtonA, 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;
    1111
    1212const
     
    3939    procedure FormDestroy(Sender: TObject);
    4040    procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
    41       Shift: TShiftState; x, y: integer);
     41      Shift: TShiftState; X, Y: Integer);
    4242    procedure BuyClick(Sender: TObject);
    4343    procedure CloseBtnClick(Sender: TObject);
     
    4949    procedure PrevCityBtnClick(Sender: TObject);
    5050    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    51     // procedure AdviceBtnClick(Sender: TObject);
    5251    procedure PageUpBtnClick(Sender: TObject);
    5352    procedure PageDownBtnClick(Sender: TObject);
    5453  private
    55     c: TCity;
     54    C: TCity;
    5655    Report: TCityReportNew;
    5756    cOwner: Integer;
     
    7069    Optimize_cixTileChange: Integer;
    7170    Optimize_TilesBeforeChange: Integer;
    72     Happened: cardinal;
    73     imix: array [0 .. 15] of integer;
     71    Happened: Cardinal;
     72    imix: array [0 .. 15] of Integer;
    7473    CityAreaInfo: TCityAreaInfo;
    7574    AreaMap: TIsoMap;
     
    8988    procedure InitZoomCityMap;
    9089    procedure ChooseProject;
    91     procedure ChangeCity(d: integer);
    92     procedure ChangeResourceWeights(iResourceWeights: integer);
     90    procedure ChangeCity(D: Integer);
     91    procedure ChangeResourceWeights(iResourceWeights: Integer);
    9392    procedure OnPlaySound(var Msg: TMessage); message WM_PLAYSOUND;
    9493  public
    95     RestoreUnFocus: integer;
     94    RestoreUnFocus: Integer;
    9695    CloseAction: TCityCloseAction;
    9796    procedure OffscreenPaint; override;
    98     procedure ShowNewContent(NewMode, Loc: integer; ShowEvent: cardinal);
     97    procedure ShowNewContent(NewMode: TWindowMode; Loc: Integer; ShowEvent: Cardinal);
    9998    procedure Reset;
    10099    procedure CheckAge;
    101100  end;
    102101
    103 var
    104   CityDlg: TCityDlg;
    105 
    106102
    107103implementation
    108104
    109105uses
    110   Select, Messg, MessgEx, Help, Tribes, Directories, Math, Sound;
     106  Select, Messg, MessgEx, Help, Tribes, Directories, Math, Sound, Term;
    111107
    112108{$R *.lfm}
     
    148144  wZoomEnvironment = 68;
    149145
    150   ImpPosition: array [28 .. nImp - 1] of integer = (-1, // imTrGoods
     146  ImpPosition: array [28 .. nImp - 1] of Integer = (
     147    -1, // imTrGoods
    151148    21, // imBarracks
    152149    6, // imGranary
     
    192189
    193190var
    194   ImpSorted: array [0 .. nImp - 1] of integer;
     191  ImpSorted: array [0 .. nImp - 1] of Integer;
    195192
    196193procedure TCityDlg.FormCreate(Sender: TObject);
     
    201198  NoMap := TIsoMap.Create;
    202199  AreaMap := TIsoMap.Create;
    203   AreaMap.SetOutput(offscreen);
     200  AreaMap.SetOutput(Offscreen);
    204201  AreaMap.SetPaintBounds(xmArea - 192, ymArea - 96 - 32, xmArea + 192,
    205202    ymArea + 96);
    206   SmallMapMode := smImprovements;
    207   ZoomArea := 1;
    208   ProdHint := false;
     203  Reset;
     204  ProdHint := False;
    209205  RestoreUnFocus := -1;
    210206  OpenSoundEvent := -1;
     
    279275
    280276    UnshareBitmap(Back);
    281     DpiBitCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight,
     277    DpiBitBltCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight,
    282278      MainTexture.Image.Canvas, 0, 0);
    283279    ImageOp_B(Back, Template, 0, 0, 0, 0, ClientWidth, ClientHeight);
     
    292288procedure TCityDlg.InitSmallCityMap;
    293289var
    294   i, iix, cli1, Color0, Color1, Color2: integer;
     290  I, iix, cli1, Color0, Color1, Color2: Integer;
    295291begin
    296292  if cix >= 0 then
    297     c := MyCity[cix];
     293    C := MyCity[cix];
    298294  case MyMap[cLoc] and fTerrain of
    299295    fPrairie: cli1 := cliPrairie;
     
    307303  Color2 := Colors.Canvas.Pixels[clkAge0 + Age, cliHouse];
    308304  SmallCityMap.Canvas.FillRect(0, 0, SmallCityMap.Width, SmallCityMap.Height);
    309   DpiBitCanvas(SmallCityMap.Canvas, 0, 0, 83, hSmallMap,
     305  DpiBitBltCanvas(SmallCityMap.Canvas, 0, 0, 83, hSmallMap,
    310306    SmallCityMapTemplate.Canvas, 83 * SizeClass, 0);
    311307  if IsPort then
    312308  begin
    313     DpiBitCanvas(SmallCityMap.Canvas, 83, 0, 15, hSmallMap,
     309    DpiBitBltCanvas(SmallCityMap.Canvas, 83, 0, 15, hSmallMap,
    314310      SmallCityMapTemplate.Canvas, 332 + 15, 0);
    315311    ImageOp_CCC(SmallCityMap, 0, 0, 83, hSmallMap, Color0, Color1, Color2);
     
    319315  else
    320316  begin
    321     DpiBitCanvas(SmallCityMap.Canvas, 83, 0, 15, hSmallMap,
     317    DpiBitBltCanvas(SmallCityMap.Canvas, 83, 0, 15, hSmallMap,
    322318      SmallCityMapTemplate.Canvas, 332, 0);
    323319    ImageOp_CCC(SmallCityMap, 0, 0, wSmallMap, hSmallMap, Color0,
     
    328324  begin
    329325    Brush.Color := ScreenTools.Colors.Canvas.Pixels[clkAge0 + Age, cliImp];
    330     for i := 0 to 29 do
     326    for I := 0 to 29 do
    331327    begin
    332328      for iix := nWonder to nImp - 1 do
    333         if (ImpPosition[iix] = i) and (c.Built[iix] > 0) then
     329        if (ImpPosition[iix] = I) and (C.Built[iix] > 0) then
    334330        begin
    335           FillRect(Rect(5 + 16 * (i mod 3) + 48 * (i div 18),
    336             3 + 12 * (i mod 18 div 3), 13 + 16 * (i mod 3) + 48 * (i div 18),
    337             11 + 12 * (i mod 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;
    339335        end;
    340336    end;
    341     i := 30;
     337    I := 30;
    342338    for iix := 0 to nImp do
    343       if (c.Built[iix] > 0) and ((iix < nWonder) or (ImpPosition[iix] < 0)) then
     339      if (C.Built[iix] > 0) and ((iix < nWonder) or (ImpPosition[iix] < 0)) then
    344340      begin
    345         FillRect(Rect(5 + 16 * (i mod 3) + 48 * (i div 18),
    346           3 + 12 * (i mod 18 div 3), 13 + 16 * (i mod 3) + 48 * (i div 18),
    347           11 + 12 * (i mod 18 div 3)));
    348         inc(i);
    349         if i = 36 then
    350           break; // area is full
     341        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
    351347      end;
    352     if c.Project and cpImp <> 0 then
    353     begin
    354       iix := c.Project and cpIndex;
     348    if C.Project and cpImp <> 0 then
     349    begin
     350      iix := C.Project and cpIndex;
    355351      if iix <> imTrGoods then
    356352      begin
    357353        if (iix >= nWonder) and (ImpPosition[iix] >= 0) then
    358           i := ImpPosition[iix];
    359         if i < 36 then
     354          I := ImpPosition[iix];
     355        if I < 36 then
    360356        begin
    361           brush.Color := ScreenTools.Colors.Canvas.Pixels[clkAge0 + Age, cliImpProject];
    362           FillRect(Rect(5 + 16 * (i mod 3) + 48 * (i div 18),
    363             3 + 12 * (i mod 18 div 3), 13 + 16 * (i mod 3) + 48 * (i div 18),
    364             11 + 12 * (i mod 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)));
    365361        end;
    366362      end;
    367363    end;
    368     brush.style := bsClear;
     364    Brush.style := bsClear;
    369365  end;
    370366end;
     
    373369begin
    374370  UnshareBitmap(ZoomCityMap);
    375   DpiBitCanvas(ZoomCityMap.Canvas, 0, 0, wZoomMap, hZoomMap,
     371  DpiBitBltCanvas(ZoomCityMap.Canvas, 0, 0, wZoomMap, hZoomMap,
    376372    Back.Canvas, xZoomMap, yZoomMap);
    377373  if SmallMapMode = smImprovements then begin
     
    383379        112 * (ZoomArea - 3), wZoomMap - wZoomEnvironment, hZoomMap);
    384380      ImageOp_B(ZoomCityMap, CityMapTemplate, wZoomMap - wZoomEnvironment, 0,
    385         1504 + wZoomEnvironment * byte(IsPort), 112 * (ZoomArea - 3),
     381        1504 + wZoomEnvironment * Byte(IsPort), 112 * (ZoomArea - 3),
    386382        wZoomEnvironment, hZoomMap);
    387383    end;
     
    391387procedure TCityDlg.OffscreenPaint;
    392388
    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);
    395391  begin
    396392    BarTex.Assign(MainTexture);
     
    399395      BarTex.ColorBevelShade := BarTex.ColorBevelLight;
    400396    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);
    406402  var
    407     d, i, Total, xGr, yGr: integer;
     403    D, I, Total, xGr, yGr: Integer;
    408404    TileInfo: TTileInfo;
    409     rare: boolean;
     405    rare: Boolean;
    410406  begin
    411407    with AreaMap do begin
    412     if Server(sGetCityTileInfo, me, Loc, TileInfo) <> eOk then
    413     begin
    414       assert(cix < 0);
    415       exit
     408    if Server(sGetCityTileInfo, Me, Loc, TileInfo) <> eOk then
     409    begin
     410      Assert(cix < 0);
     411      Exit
    416412    end;
    417413    Total := TileInfo.Food + TileInfo.Prod + TileInfo.Trade;
    418414    rare := MyMap[Loc] and $06000000 > 0;
    419415    if rare then
    420       inc(Total);
     416      Inc(Total);
    421417    if Add4Happy then
    422       inc(Total, 4);
     418      Inc(Total, 4);
    423419    if Total > 1 then
    424       d := (xxt - 11) div (Total - 1);
    425     if d < 1 then
    426       d := 1;
    427     if d > 4 then
    428       d := 4;
    429     for i := 0 to Total - 1 do
     420      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
    430426    begin
    431427      yGr := 115;
    432       if Add4Happy and (i >= Total - 4) then
     428      if Add4Happy and (I >= Total - 4) then
    433429      begin
    434430        xGr := 132;
    435431        yGr := 126
    436432      end
    437       else if rare and (i = Total - 1) then
     433      else if rare and (I = Total - 1) then
    438434        xGr := 66 + 110
    439       else if i >= TileInfo.Food + TileInfo.Prod then
     435      else if I >= TileInfo.Food + TileInfo.Prod then
    440436        xGr := 66 + 44
    441       else if i >= TileInfo.Prod then
     437      else if I >= TileInfo.Prod then
    442438        xGr := 66
    443439      else
    444440        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);
    447443    end;
    448444    end;
    449445  end;
    450446var
    451   line, MessageCount: integer;
    452 
    453   procedure CheckMessage(Flag: integer);
     447  Line, MessageCount: Integer;
     448
     449  procedure CheckMessage(Flag: Integer);
    454450  var
    455     i, test: integer;
    456     s: string;
     451    I, Test: Integer;
     452    S: string;
    457453  begin
    458454    if Happened and Flag <> 0 then
    459455    begin
    460       i := 0;
    461       test := 1;
    462       while test < Flag do
     456      I := 0;
     457      Test := 1;
     458      while Test < Flag do
    463459      begin
    464         inc(i);
    465         inc(test, test)
     460        Inc(I);
     461        Inc(Test, Test);
    466462      end;
    467463
    468464      if AllowChange and (Sounds <> nil) and (OpenSoundEvent = -1) then
    469465      begin
    470         s := CityEventSoundItem[i];
    471         if s <> '' then
    472           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] <> '[')
    474470        then
    475           OpenSoundEvent := i
     471          OpenSoundEvent := I;
    476472      end;
    477473
    478       s := CityEventName(i);
     474      S := CityEventName(I);
    479475      { if Flag=chNoGrowthWarning then
    480         if c.Built[imAqueduct]=0 then
    481         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);
    486482    end;
    487483  end;
    488484
    489485var
    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;
    494490  UnitInfo: TUnitInfo;
    495491  UnitReport: TUnitReport;
    496   IsCityAlive, CanGrow: boolean;
     492  IsCityAlive, CanGrow: Boolean;
    497493begin
    498494  inherited;
    499495  if cix >= 0 then
    500     c := MyCity[cix];
     496    C := MyCity[cix];
    501497  Report.HypoTiles := -1;
    502498  Report.HypoTaxRate := -1;
    503499  Report.HypoLuxuryRate := -1;
    504500  if cix >= 0 then
    505     Server(sGetCityReportNew, me, cix, Report) // own city
     501    Server(sGetCityReportNew, Me, cix, Report) // own city
    506502  else
    507     Server(sGetEnemyCityReportNew, me, cLoc, Report); // enemy city
    508   TrueFood := c.Food;
    509   TrueProd := c.Prod;
    510   TruePoll := c.Pollution;
    511   if supervising or (cix < 0) then
     503    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
    512508  begin // normalize city from after-turn state
    513     dec(TrueFood, Report.FoodSurplus);
     509    Dec(TrueFood, Report.FoodSurplus);
    514510    if TrueFood < 0 then
    515511      TrueFood := 0; // shouldn't happen
    516     dec(TrueProd, Report.Production);
     512    Dec(TrueProd, Report.Production);
    517513    if TrueProd < 0 then
    518514      TrueProd := 0; // shouldn't happen
    519     dec(TruePoll, Report.AddPollution);
     515    Dec(TruePoll, Report.AddPollution);
    520516    if TruePoll < 0 then
    521517      TruePoll := 0; // shouldn't happen
    522518  end;
    523   IsCityAlive := (cGov <> gAnarchy) and (c.Flags and chCaptured = 0);
     519  IsCityAlive := (cGov <> gAnarchy) and (C.Flags and chCaptured = 0);
    524520  if not IsCityAlive then
    525     Report.Working := c.Size;
     521    Report.Working := C.Size;
    526522
    527523  RedTex.Assign(MainTexture);
     
    531527  RedTex.ColorTextShade := $0000FF;
    532528
    533   DpiBitCanvas(offscreen.Canvas, 0, 0, 640, 480, Back.Canvas, 0, 0);
     529  DpiBitBltCanvas(Offscreen.Canvas, 0, 0, 640, 480, Back.Canvas, 0, 0);
    534530
    535531  Offscreen.Canvas.Font.Assign(UniFont[ftCaption]);
    536   RisedTextOut(offscreen.Canvas, 42, 7, Caption);
    537   with offscreen.Canvas do
     532  RisedTextOut(Offscreen.Canvas, 42, 7, Caption);
     533  with Offscreen.Canvas do
    538534  begin // city size
    539     brush.Color := $000000;
     535    Brush.Color := $000000;
    540536    FillRect(Rect(8 + 1, 7 + 1, 36 + 1, 32 + 1));
    541     brush.Color := $FFFFFF;
     537    Brush.Color := $FFFFFF;
    542538    FillRect(Rect(8, 7, 36, 32));
    543     brush.style := bsClear;
     539    Brush.style := bsClear;
    544540    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);
    547543  end;
    548544  Offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
     
    552548    MakeRed(Offscreen, 18, 280, 298, 40);
    553549    if cGov = gAnarchy then
    554       s := Phrases.Lookup('GOVERNMENT', gAnarchy)
     550      S := Phrases.Lookup('GOVERNMENT', gAnarchy)
    555551    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);
    559555  end
    560556  else if AllowChange then
    561557  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,
    564560      1 + OptiType mod 3 * 64, 217 + OptiType div 3 * 64);
    565561
    566562    { display messages now }
    567563    MessageCount := 0;
    568     for i := 0 to 31 do
    569       if Happened and ($FFFFFFFF - chCaptured) and (1 shl i) <> 0 then
    570         inc(MessageCount);
     564    for I := 0 to 31 do
     565      if Happened and ($FFFFFFFF - chCaptured) and (1 shl I) <> 0 then
     566        Inc(MessageCount);
    571567    if MessageCount > 3 then
    572568      MessageCount := 3;
    573569    if MessageCount > 0 then
    574570    begin
    575       MakeBlue(offscreen, 74, 280, 242, 40);
    576       line := 0;
    577       for i := 0 to nCityEventPriority - 1 do
    578         if line < MessageCount then
    579           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]);
    580576    end
    581577    else
    582578    begin
    583       s := Phrases.Lookup('CITYMANAGETYPE', OptiType);
    584       j := pos('\', s);
    585       if j = 0 then
    586         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)
    588584      else
    589585      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));
    594590      end;
    595591    end;
     
    601597    AreaMap.Paint(xmArea - xxt * 2 * rx, ymArea - yyt * 2 * ry - 3 * yyt,
    602598      dLoc(cLoc, -2 * rx + 1, -2 * ry - 1), 4 * rx - 1, 4 * ry + 1, cLoc, cOwner,
    603       false, AllowChange and IsCityAlive and
    604       (c.Status and csResourceWeightsMask = 0));
    605     DpiBitCanvas(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,
    606602      xmArea + 102, 42);
    607603
     
    615611              ((Loc1 < 0) or (Loc1 >= G.lx * G.ly) or (MyMap[Loc1] and fCity = 0))
    616612            then
    617               Sprite(offscreen, HGrTerrain, xmArea - xxt + xxt * dx,
     613              Sprite(Offscreen, HGrTerrain, xmArea - xxt + xxt * dx,
    618614                ymArea - yyt + yyt * dy, xxt * 2, yyt * 2, 1 + 5 * (xxt * 2 + 1),
    619615                1 + yyt + 15 * (yyt * 3 + 1));
    620             if (1 shl ((dy + 3) shl 2 + (dx + 3) shr 1) and c.Tiles <> 0) then
     616            if (1 shl ((dy + 3) shl 2 + (dx + 3) shr 1) and C.Tiles <> 0) then
    621617              PaintResources(xmArea - xxt + xxt * dx, ymArea - yyt + yyt * dy,
    622618                Loc1, (dx = 0) and (dy = 0));
     
    625621
    626622  if Report.Working > 1 then
    627     d := (xService - (xmArea - 192) - 8 - 32) div (Report.Working - 1);
    628   if d > 28 then
    629     d := 28;
    630   for i := Report.Working - 1 downto 0 do
     623    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
    631627  begin
    632628    if IsCityAlive then
     
    634630    else
    635631      xGr := 141;
    636     DpiBitCanvas(offscreen.Canvas, xmArea - 192 + 5 + i * d, ymArea - 96 - 29,
     632    DpiBitBltCanvas(Offscreen.Canvas, xmArea - 192 + 5 + I * D, ymArea - 96 - 29,
    637633      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,
    639635      30, xGr, 171);
    640636  end;
    641   if c.Size - Report.Working > 1 then
    642     d := (xmArea + 192 - xService - 32) div (c.Size - Report.Working - 1);
    643   if d > 28 then
    644     d := 28;
    645   for i := 0 to c.Size - Report.Working - 1 do
     637  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
    646642  begin
    647643    xGr := 1 + 112;
    648     DpiBitCanvas(offscreen.Canvas, xmArea + 192 - 27 + 1 - i * d, 29 + 1, 27,
     644    DpiBitBltCanvas(Offscreen.Canvas, xmArea + 192 - 27 + 1 - I * D, 29 + 1, 27,
    649645      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,
    651647      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,
    653649      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,
    655651      10, 121, 126);
    656652    // Sprite(offscreen,HGrSystem,xmArea+192-31+18-i*d,ymArea-96-80+32,10,10,88,115);
    657653  end;
    658654
    659   if c.Project and cpImp = 0 then
    660     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]
    661657  else
    662     PrName := Phrases.Lookup('IMPROVEMENTS', c.Project and cpIndex);
     658    PrName := Phrases.Lookup('IMPROVEMENTS', C.Project and cpIndex);
    663659  PrCost := Report.ProjectCost;
    664660
     
    667663  begin
    668664    if cGov = gFundamentalism then
    669       CountBar(offscreen, xHapp, yHapp + dyBar, wBar, 17,
     665      CountBar(Offscreen, xHapp, yHapp + dyBar, wBar, 17,
    670666        Phrases.Lookup('FAITH'), Report.CollectedControl, MainTexture)
    671667    else
    672668    begin
    673       CountBar(offscreen, xHapp, yHapp + dyBar, wBar, 17,
     669      CountBar(Offscreen, xHapp, yHapp + dyBar, wBar, 17,
    674670        Phrases.Lookup('HAPPINESS'), Report.Morale, MainTexture);
    675       CountBar(offscreen, xHapp, yHapp + 2 * dyBar, wBar, 16,
     671      CountBar(Offscreen, xHapp, yHapp + 2 * dyBar, wBar, 16,
    676672        Phrases.Lookup('CONTROL'), Report.CollectedControl, MainTexture);
    677673    end;
    678     CountBar(offscreen, xHapp, yHapp, wBar, 8, Phrases.Lookup('LUX'),
     674    CountBar(Offscreen, xHapp, yHapp, wBar, 8, Phrases.Lookup('LUX'),
    679675      Report.Luxury, MainTexture);
    680     CountBar(offscreen, xHapp + dxBar, yHapp, wBar, 19,
     676    CountBar(Offscreen, xHapp + dxBar, yHapp, wBar, 19,
    681677      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);
    684680    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,
    686682        Phrases.Lookup('HAPPINESSPLUS'), Report.HappinessBalance, MainTexture)
    687683    else
    688684    begin
    689685      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,
    691687        Phrases.Lookup('LACK'), -Report.HappinessBalance, RedTex);
    692688    end;
     
    696692  if IsCityAlive then
    697693  begin
    698     CountBar(offscreen, xFood, yFood + dyBar div 2, wBar, 0,
     694    CountBar(Offscreen, xFood, yFood + dyBar div 2, wBar, 0,
    699695      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,
    703699      Phrases.Lookup('SUPPORT'), Report.FoodSupport, MainTexture);
    704700    if Report.FoodSurplus >= 0 then
    705       if (cGov = gFuture) or (c.Size >= NeedAqueductSize) and
     701      if (cGov = gFuture) or (C.Size >= NeedAqueductSize) and
    706702        (Report.FoodSurplus < 2) then
    707         CountBar(offscreen, xFood + dxBar, yFood + 2 * dyBar, wBar, 6,
     703        CountBar(Offscreen, xFood + dxBar, yFood + 2 * dyBar, wBar, 6,
    708704          Phrases.Lookup('PROFIT'), Report.FoodSurplus, MainTexture)
    709705      else
    710         CountBar(offscreen, xFood + dxBar, yFood + 2 * dyBar, wBar, 0,
     706        CountBar(Offscreen, xFood + dxBar, yFood + 2 * dyBar, wBar, 0,
    711707          Phrases.Lookup('SURPLUS'), Report.FoodSurplus, MainTexture)
    712708    else
    713709    begin
    714710      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,
    716712        Phrases.Lookup('LACK'), -Report.FoodSurplus, RedTex);
    717713    end;
    718714  end;
    719   CanGrow := (c.Size < MaxCitySize) and (cGov <> gFuture) and
    720     (Report.FoodSurplus > 0) and ((c.Size < NeedAqueductSize) or
    721     (c.Built[imAqueduct] = 1) and (c.Size < NeedSewerSize) or
    722     (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));
    723719  FillBar(xFood + 3, yFood + 102, TrueFood,
    724     CutCityFoodSurplus(Report.FoodSurplus, IsCityAlive, cGov, c.Size),
     720    CutCityFoodSurplus(Report.FoodSurplus, IsCityAlive, cGov, C.Size),
    725721    Report.Storage, 1, CanGrow);
    726   LoweredTextout(offscreen.Canvas, -1, MainTexture, xFood + 3 - 5,
     722  LoweredTextout(Offscreen.Canvas, -1, MainTexture, xFood + 3 - 5,
    727723    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,
    729725    Phrases.Lookup('STORAGE'));
    730726
     
    732728  if IsCityAlive then
    733729  begin
    734     CountBar(offscreen, xProd, yProd, wBar, 2, Phrases.Lookup('MATERIAL'),
     730    CountBar(Offscreen, xProd, yProd, wBar, 2, Phrases.Lookup('MATERIAL'),
    735731      Report.CollectedMaterial, MainTexture);
    736     CountBar(offscreen, xProd + dxBar, yProd, wBar, 2,
     732    CountBar(Offscreen, xProd + dxBar, yProd, wBar, 2,
    737733      Phrases.Lookup('SUPPORT'), Report.MaterialSupport, MainTexture);
    738734    if Report.Production >= 0 then
    739       if c.Project and (cpImp + cpIndex) = cpImp + imTrGoods then
    740         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,
    741737          Phrases.Lookup('PROFIT'), Report.Production, MainTexture)
    742738      else
    743         CountBar(offscreen, xProd + dxBar, yProd + dyBar + 16, wBar, 2,
     739        CountBar(Offscreen, xProd + dxBar, yProd + dyBar + 16, wBar, 2,
    744740          Phrases.Lookup('PROD'), Report.Production, MainTexture)
    745741    else
    746742    begin
    747743      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,
    749745        Phrases.Lookup('LACK'), -Report.Production, RedTex);
    750746    end;
    751747  end;
    752   if c.Project and (cpImp + cpIndex) <> cpImp + imTrGoods then
    753     with offscreen.Canvas do
    754     begin
    755       i := Report.Production;
    756       if (i < 0) or not IsCityAlive then
    757         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,
    760756        yProd + 16 + 43, Format('%d/%d', [TrueProd, PrCost]));
    761       if BiColorTextWidth(offscreen.Canvas, PrName) > wBar + dxBar then
     757      if BiColorTextWidth(Offscreen.Canvas, PrName) > wBar + dxBar then
    762758      begin
    763759        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;
    766762        PrName := PrName + '.'
    767763      end;
    768764    end;
    769   RisedTextOut(offscreen.Canvas, xProd - 2, yProd + 36, PrName);
     765  RisedTextOut(Offscreen.Canvas, xProd - 2, yProd + 36, PrName);
    770766
    771767  // pollution section
     
    773769  begin
    774770    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,
    777773      Phrases.Lookup('POLL'));
    778774  end;
     
    781777  if IsCityAlive and (Report.CollectedTrade > 0) then
    782778  begin
    783     CountBar(offscreen, xTrade, yTrade + dyBar div 2, wBar, 4,
     779    CountBar(Offscreen, xTrade, yTrade + dyBar div 2, wBar, 4,
    784780      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,
    786782      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'),
    788784      Report.Tax, MainTexture);
    789     CountBar(offscreen, xTrade + dxBar, yTrade + dyBar, wBar, 12,
     785    CountBar(Offscreen, xTrade + dxBar, yTrade + dyBar, wBar, 12,
    790786      Phrases.Lookup('SCIENCE'), Report.Science, MainTexture);
    791787  end;
    792788
    793789  // small map
    794   DpiBitCanvas(offscreen.Canvas, xSmallMap, ySmallMap, wSmallMap, hSmallMap,
     790  DpiBitBltCanvas(Offscreen.Canvas, xSmallMap, ySmallMap, wSmallMap, hSmallMap,
    795791    SmallCityMap.Canvas, 0, 0);
    796792  if SmallMapMode = smImprovements then
    797     Frame(offscreen.Canvas, xSmallMap + 48 * (ZoomArea div 3),
     793    Frame(Offscreen.Canvas, xSmallMap + 48 * (ZoomArea div 3),
    798794      ySmallMap + 24 * (ZoomArea mod 3), xSmallMap + 48 * (ZoomArea div 3) + 49,
    799795      ySmallMap + 24 * (ZoomArea mod 3) + 25, MainTexture.ColorMark,
    800796      MainTexture.ColorMark);
    801   Frame(offscreen.Canvas, xSmallMap - 1, ySmallMap - 1, xSmallMap + wSmallMap,
     797  Frame(Offscreen.Canvas, xSmallMap - 1, ySmallMap - 1, xSmallMap + wSmallMap,
    802798    ySmallMap + hSmallMap, $B0B0B0, $FFFFFF);
    803   RFrame(offscreen.Canvas, xSmallMap - 2, ySmallMap - 2, xSmallMap + wSmallMap +
     799  RFrame(Offscreen.Canvas, xSmallMap - 2, ySmallMap - 2, xSmallMap + wSmallMap +
    804800    1, ySmallMap + hSmallMap + 1, $FFFFFF, $B0B0B0);
    805801
    806   Frame(offscreen.Canvas, xSupport - 1, ySupport - 1, xSupport + wSupport,
     802  Frame(Offscreen.Canvas, xSupport - 1, ySupport - 1, xSupport + wSupport,
    807803    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,
    809805    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;
    812808  if SmallMapMode = smSupportedUnits then
    813809  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   DpiBitCanvas(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,
    823819    ZoomCityMap.Canvas, 0, 0);
    824820
    825   for i := 0 to 5 do
    826     imix[i] := -1;
     821  for I := 0 to 5 do
     822    imix[I] := -1;
    827823  if SmallMapMode = smImprovements then
    828824  begin
     
    831827      Cnt := 0;
    832828      for iix := 0 to nImp - 1 do
    833         if ((iix < nWonder) or (ImpPosition[iix] < 0)) and (c.Built[iix] > 0) then
     829        if ((iix < nWonder) or (ImpPosition[iix] < 0)) and (C.Built[iix] > 0) then
    834830        begin
    835           i := Cnt - Page * 6;
    836           if (i >= 0) and (i < 6) then
    837             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);
    839835        end;
    840836      PageCount := (Cnt + 5) div 6;
     
    844840      for iix := nWonder to nImp - 1 do
    845841      begin
    846         i := ImpPosition[iix] - 6 * ZoomArea;
    847         if (i >= 0) and (i < 6) and (c.Built[iix] > 0) then
    848           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;
    849845      end;
    850846      PageCount := 0;
    851847    end;
    852     for i := 0 to 5 do
    853       if imix[i] >= 0 then
     848    for I := 0 to 5 do
     849      if imix[I] >= 0 then
    854850      begin
    855         iix := imix[i];
    856         x := xZoomMap + 14 + 72 * (i mod 3);
    857         y := yZoomMap + 14 + 56 * (i div 3);
    858         ImpImage(offscreen.Canvas, x, y, iix, cGov, AllowChange and
     851        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
    859855          (ClientMode < scContact));
    860856        if IsCityAlive then
     
    862858          if iix = imColosseum then
    863859          begin
    864             Sprite(offscreen, HGrSystem, x + 46, y, 14, 14, 82, 100);
     860            Sprite(Offscreen, HGrSystem, X + 46, Y, 14, 14, 82, 100);
    865861          end
    866862          else
     
    880876            if HappyGain > 1 then
    881877            begin
    882               d := 30 div (HappyGain - 1);
    883               if d > 10 then
    884                 d := 10
     878              D := 30 div (HappyGain - 1);
     879              if D > 10 then
     880                D := 10
    885881            end;
    886             for j := 0 to HappyGain - 1 do
    887               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);
    888884          end;
    889           for j := 0 to Imp[iix].Maint - 1 do
    890             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,
    891887              132, 115);
    892888        end
     
    919915  else { if SmallMapMode = smSupportedUnits then }
    920916  begin
    921     LoweredTextout(offscreen.Canvas, -1, MainTexture, xZoomMap + 6,
     917    LoweredTextout(Offscreen.Canvas, -1, MainTexture, xZoomMap + 6,
    922918      yZoomMap + 2, Phrases.Lookup('SUPUNITS'));
    923     FreeSupp := c.Size * SupportFree[cGov] shr 1;
     919    FreeSupp := C.Size * SupportFree[cGov] shr 1;
    924920    Cnt := 0;
    925     for i := 0 to MyRO.nUn - 1 do
    926       if (MyUn[i].Loc >= 0) and (MyUn[i].Home = cix) then
    927         with MyModel[MyUn[i].mix] do
     921    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
    928924        begin
    929           Server(sGetUnitReport, me, i, UnitReport);
     925          Server(sGetUnitReport, Me, I, UnitReport);
    930926          if (Cnt >= 6 * Page) and (Cnt < 6 * (Page + 1)) then
    931927          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 do
    940               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,
    941937                10, 66, 115);
    942             for j := 0 to UnitReport.ProdSupport - 1 do
     938            for J := 0 to UnitReport.ProdSupport - 1 do
    943939            begin
    944940              if (FreeSupp > 0) and
    945941                (UnitReport.ReportFlags and urfAlwaysSupport = 0) then
    946942              begin
    947                 Sprite(offscreen, HGrSystem, x + 16 - 11 * j, y + 40, 10,
     943                Sprite(Offscreen, HGrSystem, X + 16 - 11 * J, Y + 40, 10,
    948944                  10, 143, 115);
    949                 dec(FreeSupp);
     945                Dec(FreeSupp);
    950946              end
    951947              else
    952                 Sprite(offscreen, HGrSystem, x + 16 - 11 * j, y + 40, 10,
     948                Sprite(Offscreen, HGrSystem, X + 16 - 11 * J, Y + 40, 10,
    953949                  10, 88, 115);
    954950            end;
    955951            if UnitReport.ReportFlags and urfDeployed <> 0 then
    956               for j := 0 to 1 do
    957                 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,
    958954                  10, 154, 126)
    959955          end // unit visible in display
    960956          else
    961             dec(FreeSupp, UnitReport.ProdSupport);
    962           inc(Cnt);
     957            Dec(FreeSupp, UnitReport.ProdSupport);
     958          Inc(Cnt);
    963959        end;
    964960    PageCount := (Cnt + 5) div 6;
     
    973969  PageDownBtn.Visible := PageCount > 1;
    974970
    975   with offscreen.Canvas do
     971  with Offscreen.Canvas do
    976972  begin
    977973    { 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,
    979975      yProd + dyBar + 16, $FFFFFF, $B0B0B0);
    980976    if ProdHint then
    981977    begin
    982       ScreenTools.Frame(offscreen.Canvas, xView + 9 - 1, yView + 5 - 1,
     978      ScreenTools.Frame(Offscreen.Canvas, xView + 9 - 1, yView + 5 - 1,
    983979        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,
    985981        xView + 9 + xSizeBig + 1, yView + 5 + ySizeBig + 1, $FFFFFF, $B0B0B0);
    986       with offscreen.Canvas do
     982      with Offscreen.Canvas do
    987983      begin
    988         brush.Color := $000000;
     984        Brush.Color := $000000;
    989985        FillRect(Rect(xView + 9, yView + 5, xView + 1 + 72 - 8,
    990986          yView + 5 + 40));
    991         brush.style := bsClear;
     987        Brush.style := bsClear;
    992988      end;
    993989    end
    994     else if AllowChange and (c.Status and 7 <> 0) then
     990    else if AllowChange and (C.Status and 7 <> 0) then
    995991    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) and
     992      FrameImage(Offscreen.Canvas, bigimp, xView + 9, yView + 5, xSizeBig,
     993        ySizeBig, (C.Status and 7 - 1 + 3) * xSizeBig, 0, (cix >= 0) and
    998994        (ClientMode < scContact));
    999995    end
    1000     else if c.Project and cpImp = 0 then
     996    else if C.Project and cpImp = 0 then
    1001997    begin // project is unit
    1002       FrameImage(offscreen.Canvas, bigimp, xView + 9, yView + 5, xSizeBig,
     998      FrameImage(Offscreen.Canvas, bigimp, xView + 9, yView + 5, xSizeBig,
    1003999        ySizeBig, 0, 0, AllowChange and (ClientMode < scContact));
    1004       with Tribe[cOwner].ModelPicture[c.Project and cpIndex] do
    1005         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,
    10061002          pix mod 10 * 65 + 1, pix div 10 * 49 + 1);
    10071003    end
     
    10091005    begin // project is building
    10101006      if ProdHint then
    1011         Paintiix := c.Project0 and cpIndex
     1007        Paintiix := C.Project0 and cpIndex
    10121008      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,
    10151011        AllowChange and (ClientMode < scContact));
    10161012    end;
     
    10191015  if AllowChange and (ClientMode < scContact) then
    10201016  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);
    10231019  end
    10241020  else
    1025     BuyBtn.Visible := false;
     1021    BuyBtn.Visible := False;
    10261022
    10271023  MarkUsedOffscreen(ClientWidth, ClientHeight);
    1028 end; { OffscreenPaint }
     1024end;
    10291025
    10301026procedure TCityDlg.FormShow(Sender: TObject);
    10311027var
    1032   dx, dy, Loc1: integer;
     1028  dx, dy, Loc1: Integer;
    10331029  GetCityData: TGetCityData;
    10341030begin
     
    10361032  if cix >= 0 then
    10371033  begin { own city }
    1038     c := MyCity[cix];
    1039     cOwner := me;
     1034    C := MyCity[cix];
     1035    cOwner := Me;
    10401036    cGov := MyRO.Government;
    10411037    ProdHint := (cGov <> gAnarchy) and
    10421038      (Happened and (chProduction or chFounded or chCaptured or
    10431039      chAllImpsMade) <> 0);
    1044     Server(sGetCityAreaInfo, me, cix, CityAreaInfo);
     1040    Server(sGetCityAreaInfo, Me, cix, CityAreaInfo);
    10451041    NextCityBtn.Visible := WindowMode = wmPersistent;
    10461042    PrevCityBtn.Visible := WindowMode = wmPersistent;
     
    10491045  begin
    10501046    SmallMapMode := smImprovements;
    1051     Server(sGetCity, me, cLoc, GetCityData);
    1052     c := GetCityData.c;
     1047    Server(sGetCity, Me, cLoc, GetCityData);
     1048    C := GetCityData.C;
    10531049    cOwner := GetCityData.Owner;
    10541050    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 then
     1051    Happened := C.Flags and $7FFFFFFF;
     1052    ProdHint := False;
     1053    Server(sGetEnemyCityAreaInfo, Me, cLoc, CityAreaInfo);
     1054
     1055    if C.Project and cpImp = 0 then
    10601056    begin
    10611057      emix := MyRO.nEnemyModel - 1;
    10621058      while (emix > 0) and ((MyRO.EnemyModel[emix].Owner <> cOwner) or
    1063         (integer(MyRO.EnemyModel[emix].mix) <> c.Project and cpIndex)) do
    1064         dec(emix);
    1065       if not Assigned(Tribe[cOwner].ModelPicture[c.Project and cpIndex].HGr) then
     1059        (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
    10661062        InitEnemyModel(emix);
    10671063    end;
    10681064
    1069     NextCityBtn.Visible := false;
    1070     PrevCityBtn.Visible := false;
     1065    NextCityBtn.Visible := False;
     1066    PrevCityBtn.Visible := False;
    10711067  end;
    10721068  Page := 0;
    10731069
    1074   if c.Size < 5 then
     1070  if C.Size < 5 then
    10751071    SizeClass := 0
    1076   else if c.Size < 9 then
     1072  else if C.Size < 9 then
    10771073    SizeClass := 1
    1078   else if c.Size < 13 then
     1074  else if C.Size < 13 then
    10791075    SizeClass := 2
    10801076  else
     
    10821078
    10831079  // check if port
    1084   IsPort := false;
     1080  IsPort := False;
    10851081  for dx := -2 to 2 do
    10861082    for dy := -2 to 2 do
    1087       if abs(dx) + abs(dy) = 2 then
     1083      if Abs(dx) + Abs(dy) = 2 then
    10881084      begin
    10891085        Loc1 := dLoc(cLoc, dx, dy);
    10901086        if (Loc1 >= 0) and (Loc1 < G.lx * G.ly) and
    10911087          (MyMap[Loc1] and fTerrain < fGrass) then
    1092           IsPort := true;
     1088          IsPort := True;
    10931089      end;
    10941090
     
    10991095  end;
    11001096
    1101   Caption := CityName(c.ID);
     1097  Caption := CityName(C.ID);
    11021098
    11031099  InitSmallCityMap;
     
    11051101  OpenSoundEvent := -1;
    11061102  OffscreenPaint;
    1107   Timer1.Enabled := true;
    1108 end;
    1109 
    1110 procedure TCityDlg.ShowNewContent(NewMode, Loc: integer; ShowEvent: cardinal);
     1103  Timer1.Enabled := True;
     1104end;
     1105
     1106procedure TCityDlg.ShowNewContent(NewMode: TWindowMode; Loc: Integer; ShowEvent: Cardinal);
    11111107begin
    11121108  if MyMap[Loc] and fOwned <> 0 then
     
    11141110    cix := MyRO.nCity - 1;
    11151111    while (cix >= 0) and (MyCity[cix].Loc <> Loc) do
    1116       dec(cix);
    1117     assert(cix >= 0);
     1112      Dec(cix);
     1113    Assert(cix >= 0);
    11181114    if (Optimize_cixTileChange >= 0) and
    11191115      (Optimize_TilesBeforeChange and not MyCity[Optimize_cixTileChange].Tiles
     
    11311127  else
    11321128    cix := -1;
    1133   AllowChange := not supervising and (cix >= 0);
     1129  AllowChange := not Supervising and (cix >= 0);
    11341130  cLoc := Loc;
    11351131  Happened := ShowEvent;
     
    11381134
    11391135procedure TCityDlg.FormMouseDown(Sender: TObject; Button: TMouseButton;
    1140   Shift: TShiftState; x, y: integer);
     1136  Shift: TShiftState; X, Y: Integer);
    11411137var
    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) and
    1146     (y >= ySmallMap) and (y < ySmallMap + hSmallMap) then
     1138  I, qx, qy, dx, dy, fix, NewTiles, Loc1, iix, SellResult: Integer;
     1139  Rebuild: Boolean;
     1140begin
     1141  if (ssLeft in Shift) and (X >= xSmallMap) and (X < xSmallMap + wSmallMap) and
     1142    (Y >= ySmallMap) and (Y < ySmallMap + hSmallMap) then
    11471143  begin
    11481144    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);
    11511147    Page := 0;
    11521148    InitZoomCityMap;
    11531149    SmartUpdateContent;
    1154     exit;
    1155   end;
    1156   if (ssLeft in Shift) and (x >= xSupport) and (x < xSupport + wSupport) and
    1157     (y >= ySupport) and (y < ySupport + hSupport) then
     1150    Exit;
     1151  end;
     1152  if (ssLeft in Shift) and (X >= xSupport) and (X < xSupport + wSupport) and
     1153    (Y >= ySupport) and (Y < ySupport + hSupport) then
    11581154  begin
    11591155    SmallMapMode := smSupportedUnits;
     
    11611157    InitZoomCityMap;
    11621158    SmartUpdateContent;
    1163     exit;
     1159    Exit;
    11641160  end;
    11651161  if not AllowChange then
    1166     exit; // not an own city
     1162    Exit; // Not an own city
    11671163
    11681164  if (ssLeft in Shift) then
    1169     if (ClientMode < scContact) and (x >= xView) and (y >= yView) and
    1170       (x < xView + 73) and (y < yView + 50) then
     1165    if (ClientMode < scContact) and (X >= xView) and (Y >= yView) and
     1166      (X < xView + 73) and (Y < yView + 50) then
    11711167      if cGov = gAnarchy then
    1172         with MessgExDlg do
     1168        with MainScreen.MessgExDlg do
    11731169        begin
    11741170          { MessgText:=Phrases.Lookup('OUTOFCONTROL');
    1175             if c.Project and cpImp=0 then
    1176             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)]); }
    11781174          MessgText := Phrases.Lookup('NOCHANGEINANARCHY');
    11791175          Kind := mkOk;
     
    11841180        if ProdHint then
    11851181        begin
    1186           ProdHint := false;
     1182          ProdHint := False;
    11871183          SmartUpdateContent
    11881184        end;
    11891185        ChooseProject;
    11901186      end
    1191     else if (SmallMapMode = smImprovements) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and
    1192       (y >= yZoomMap) and (y < yZoomMap + hZoomMap) then
    1193     begin
    1194       i := 5;
    1195       while (i >= 0) and not((x >= xZoomMap + 14 + 72 * (i mod 3)) and
    1196         (x < xZoomMap + 14 + 56 + 72 * (i mod 3)) and
    1197         (y >= yZoomMap + 14 + 56 * (i div 3)) and
    1198         (y < yZoomMap + 14 + 40 + 56 * (i div 3))) do
    1199         dec(i);
    1200       if i >= 0 then
     1187    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
    12011197      begin
    1202         iix := imix[i];
     1198        iix := imix[I];
    12031199        if iix >= 0 then
    12041200          if ssShift in Shift then
    1205             HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp, iix)
     1201            MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, iix)
    12061202          else if (ClientMode < scContact) then
    1207             with MessgExDlg do
     1203            with MainScreen.MessgExDlg do
    12081204            begin
    12091205              IconKind := mikImp;
     
    12201216              else
    12211217              begin
    1222                 SellResult := Server(sSellCityImprovement - sExecute, me,
     1218                SellResult := Server(sSellCityImprovement - sExecute, Me,
    12231219                  cix, iix);
    12241220                if SellResult < rExecuted then
     
    12351231                else
    12361232                begin
    1237                   if Server(sRebuildCityImprovement - sExecute, me, cix, iix) < rExecuted
     1233                  if Server(sRebuildCityImprovement - sExecute, Me, cix, iix) < rExecuted
    12381234                  then
    12391235                  begin // no rebuild possible, ask for sell only
    1240                     Rebuild := false;
     1236                    Rebuild := False;
    12411237                    MessgText := Phrases.Lookup('IMPROVEMENTS', iix);
    12421238                    if not Phrases2FallenBackToEnglish then
    12431239                      MessgText := Format(Phrases2.Lookup('SELL2'),
    12441240                        [MessgText, Imp[iix].Cost * BuildCostMod
    1245                         [G.Difficulty[me]] div 12])
     1241                        [G.Difficulty[Me]] div 12])
    12461242                    else
    12471243                      MessgText := Format(Phrases.Lookup('SELL'), [MessgText]);
    12481244                    if iix = imSpacePort then
    1249                       with MyRO.Ship[me] do
     1245                      with MyRO.Ship[Me] do
    12501246                        if Parts[0] + Parts[1] + Parts[2] > 0 then
    12511247                          MessgText := MessgText + ' ' +
     
    12581254                  else
    12591255                  begin
    1260                     Rebuild := true;
     1256                    Rebuild := True;
    12611257                    MessgText := Phrases.Lookup('IMPROVEMENTS', iix);
    12621258                    if not Phrases2FallenBackToEnglish then
    12631259                      MessgText := Format(Phrases2.Lookup('DISPOSE2'),
    12641260                        [MessgText, Imp[iix].Cost * BuildCostMod
    1265                         [G.Difficulty[me]] div 12 * 2 div 3])
     1261                        [G.Difficulty[Me]] div 12 * 2 div 3])
    12661262                    else
    12671263                      MessgText := Format(Phrases.Lookup('DISPOSE'),
    12681264                        [MessgText]);
    12691265                    if iix = imSpacePort then
    1270                       with MyRO.Ship[me] do
     1266                      with MyRO.Ship[Me] do
    12711267                        if Parts[0] + Parts[1] + Parts[2] > 0 then
    12721268                          MessgText := MessgText + ' ' +
     
    12821278                    begin
    12831279                      Play('CITY_REBUILDIMP');
    1284                       Server(sRebuildCityImprovement, me, cix, iix);
     1280                      Server(sRebuildCityImprovement, Me, cix, iix);
    12851281                    end
    12861282                    else
    12871283                    begin
    12881284                      Play('CITY_SELLIMP');
    1289                       Server(sSellCityImprovement, me, cix, iix);
     1285                      Server(sSellCityImprovement, Me, cix, iix);
    12901286                    end;
    12911287                    CityOptimizer_CityChange(cix);
     
    13001296      end;
    13011297    end
    1302     else if (SmallMapMode = smSupportedUnits) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and
    1303       (y >= yZoomMap) and (y < yZoomMap + hZoomMap) then
    1304     begin
    1305       i := 5;
    1306       while (i >= 0) and not((x >= xZoomMap + 64 * (i mod 3)) and
    1307         (x < xZoomMap + 64 + 64 * (i mod 3)) and
    1308         (y >= yZoomMap + 20 + 48 * (i div 3)) and
    1309         (y < yZoomMap + 20 + 52 + 48 * (i div 3))) do
    1310         dec(i);
    1311       if (i >= 0) and (imix[i] >= 0) then
     1298    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
    13121308        if ssShift in Shift then
    13131309        else if (cix >= 0) and (ClientMode < scContact) and
     
    13161312          CloseAction := None;
    13171313          Close;
    1318           MainScreen.CityClosed(imix[i], false, true);
     1314          MainScreen.CityClosed(imix[I], False, True);
    13191315        end;
    13201316    end
    1321     else if (x >= xmArea - 192) and (x < xmArea + 192) and (y >= ymArea - 96)
    1322       and (y < ymArea + 96) then
     1317    else if (X >= xmArea - 192) and (X < xmArea + 192) and (Y >= ymArea - 96)
     1318      and (Y < ymArea + 96) then
    13231319    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)
    13251321        * (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)
    13271323        * (yyt * 2)) div (xxt * yyt * 4) - 1000;
    13281324      dx := qx - qy;
     
    13341330          Loc1 := dLoc(cLoc, dx, dy);
    13351331          if (Loc1 >= 0) and (Loc1 < G.lx * G.ly) then
    1336             HelpOnTerrain(Loc1, FWindowMode or wmPersistent)
     1332            HelpOnTerrain(Loc1, WindowModeMakePersistent(FWindowMode))
    13371333        end
    13381334        else if (ClientMode < scContact) and (cGov <> gAnarchy) and
    1339           (c.Flags and chCaptured = 0) then
     1335          (C.Flags and chCaptured = 0) then
    13401336        begin // toggle exploitation
    1341           assert(not supervising);
    1342           if c.Status and csResourceWeightsMask <> 0 then
     1337          Assert(not Supervising);
     1338          if C.Status and csResourceWeightsMask <> 0 then
    13431339          begin
    1344             with MessgExDlg do
     1340            with MainScreen.MessgExDlg do
    13451341            begin
    13461342              MessgText := Phrases.Lookup('CITYMANAGEOFF');
     
    13501346              ShowModal;
    13511347            end;
    1352             if MessgExDlg.ModalResult = mrOK then
     1348            if MainScreen.MessgExDlg.ModalResult = mrOK then
    13531349            begin
    13541350              MyCity[cix].Status := MyCity[cix].Status and
    13551351                not csResourceWeightsMask; // off
    1356               c.Status := MyCity[cix].Status;
     1352              C.Status := MyCity[cix].Status;
    13571353              SmartUpdateContent;
    13581354            end;
    1359             exit;
     1355            Exit;
    13601356          end;
    13611357          fix := (dy + 3) shl 2 + (dx + 3) shr 1;
    13621358          NewTiles := MyCity[cix].Tiles xor (1 shl fix);
    1363           if Server(sSetCityTiles, me, cix, NewTiles) >= rExecuted then
     1359          if Server(sSetCityTiles, Me, cix, NewTiles) >= rExecuted then
    13641360          begin
    13651361            SmartUpdateContent;
     
    13701366    end
    13711367    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) then
    1374     begin
    1375       i := sqr(x - xmOpt) + sqr(y - ymOpt); // click radius
    1376       if i <= 32 * 32 then
     1368      (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
    13771373      begin
    1378         if i < 16 * 16 then // inner area clicked
    1379           if c.Status and csResourceWeightsMask <> 0 then
    1380             i := (c.Status shr 4 and $0F) mod 5 + 1 // rotate except off
     1374        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
    13811377          else
    1382             i := 3 // rwGrowth
     1378            I := 3 // rwGrowth
    13831379        else
    1384           case trunc(arctan2(x - xmOpt, ymOpt - y) * 180 / pi) of
     1380          case trunc(arctan2(X - xmOpt, ymOpt - Y) * 180 / pi) of
    13851381            - 25 - 52 * 2 .. -26 - 52:
    1386               i := 1;
     1382              I := 1;
    13871383            -25 - 52 .. -26:
    1388               i := 2;
     1384              I := 2;
    13891385            -25 .. 25:
    1390               i := 3;
     1386              I := 3;
    13911387            26 .. 25 + 52:
    1392               i := 4;
     1388              I := 4;
    13931389            26 + 52 .. 25 + 52 * 2:
    1394               i := 5;
     1390              I := 5;
    13951391            180 - 26 .. 180, -180 .. -180 + 26:
    1396               i := 0;
     1392              I := 0;
    13971393          else
    1398             i := -1;
     1394            I := -1;
    13991395          end;
    1400         if i >= 0 then
     1396        if I >= 0 then
    14011397        begin
    1402           ChangeResourceWeights(i);
     1398          ChangeResourceWeights(I);
    14031399          SmartUpdateContent;
    14041400          if WindowMode <> wmModal then
     
    14071403      end;
    14081404    end;
    1409 end; { FormMouseDown }
     1405end;
    14101406
    14111407procedure TCityDlg.ChooseProject;
     
    14221418  );
    14231419
    1424   function ProjectType(Project: integer): TProjectType;
     1420  function ProjectType(Project: Integer): TProjectType;
    14251421  begin
    14261422    if Project and cpCompleted <> 0 then
     
    14441440
    14451441var
    1446   NewProject, OldMoney, cix1: integer;
     1442  NewProject, OldMoney, cix1: Integer;
    14471443  pt0, pt1: TProjectType;
    1448   QueryOk: boolean;
    1449 begin
    1450   Assert(not supervising);
    1451   ModalSelectDlg.ShowNewContent_CityProject(wmModal, cix);
    1452   if ModalSelectDlg.result <> -1 then
    1453   begin
    1454     if ModalSelectDlg.result and cpType <> 0 then
     1444  QueryOk: Boolean;
     1445begin
     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
    14551451    begin
    14561452      MyCity[cix].Status := MyCity[cix].Status and not 7 or
    1457         (1 + ModalSelectDlg.result and cpIndex);
    1458       AutoBuild(cix, MyData.ImpOrder[ModalSelectDlg.result and cpIndex]);
     1453        (1 + MainScreen.ModalSelectDlg.Result and cpIndex);
     1454      AutoBuild(cix, MyData.ImpOrder[MainScreen.ModalSelectDlg.Result and cpIndex]);
    14591455    end
    14601456    else
    14611457    begin
    1462       NewProject := ModalSelectDlg.Result;
     1458      NewProject := MainScreen.ModalSelectDlg.Result;
    14631459      QueryOk := True;
    14641460      if (NewProject and cpImp <> 0) and (NewProject and cpIndex >= 28) and
    14651461        (MyRO.NatBuilt[NewProject and cpIndex] > 0) then
    1466         with MessgExDlg do
     1462        with MainScreen.MessgExDlg do
    14671463        begin
    14681464          cix1 := MyRO.nCity - 1;
     
    15211517        then
    15221518          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;
    15251521      if MyRO.Money > OldMoney then
    15261522        Play('CITY_SELLIMP');
     
    15371533procedure TCityDlg.BuyClick(Sender: TObject);
    15381534var
    1539   NextProd, Cost: integer;
     1535  NextProd, Cost: Integer;
    15401536begin
    15411537  if (cix < 0) or (ClientMode >= scContact) then
    1542     exit;
    1543   with MyCity[cix], MessgExDlg do
     1538    Exit;
     1539  with MyCity[cix], MainScreen.MessgExDlg do
    15441540  begin
    15451541    Cost := Report.ProjectCost;
     
    15481544      NextProd := 0;
    15491545    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)
    15511547    then
    15521548      Cost := Cost * 2
     
    15721568    if (Kind = mkYesNo) and (ModalResult = mrOK) then
    15731569    begin
    1574       if Server(sBuyCityProject, me, cix, nil^) >= rExecuted then
     1570      if Server(sBuyCityProject, Me, cix, nil^) >= rExecuted then
    15751571      begin
    15761572        Play('CITY_BUYPROJECT');
     
    15851581procedure TCityDlg.FormClose(Sender: TObject; var Action: TCloseAction);
    15861582begin
    1587   Timer1.Enabled := false;
    1588   ProdHint := false;
     1583  Timer1.Enabled := False;
     1584  ProdHint := False;
    15891585  MarkCityLoc := -1;
    15901586  if Optimize_cixTileChange >= 0 then
     
    16151611      with Canvas do
    16161612      begin
    1617         DpiBitCanvas(Canvas, xView + 5, yView + 1, 64, 2, Back.Canvas,
     1613        DpiBitBltCanvas(Canvas, xView + 5, yView + 1, 64, 2, Back.Canvas,
    16181614          xView + 5, yView + 1);
    1619         DpiBitCanvas(Canvas, xView + 5, yView + 3, 2, 42, Back.Canvas,
     1615        DpiBitBltCanvas(Canvas, xView + 5, yView + 3, 2, 42, Back.Canvas,
    16201616          xView + 5, yView + 3);
    1621         DpiBitCanvas(Canvas, xView + 5 + 62, yView + 3, 2, 42,
     1617        DpiBitBltCanvas(Canvas, xView + 5 + 62, yView + 3, 2, 42,
    16221618          Back.Canvas, xView + 5 + 62, yView + 3);
    16231619        ScreenTools.Frame(Canvas, xView + 9 - 1, yView + 5 - 1, xView + 9 + xSizeBig,
     
    16321628    else if BlinkTime = 6 then
    16331629    begin
    1634       if AllowChange and (c.Status and 7 <> 0) then
     1630      if AllowChange and (C.Status and 7 <> 0) then
    16351631      begin // city type autobuild
    16361632        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);
    16381634      end
    1639       else if c.Project and cpImp = 0 then
     1635      else if C.Project and cpImp = 0 then
    16401636      begin // project is unit
    1641         DpiBitCanvas(Canvas, xView + 9, yView + 5, xSizeBig, ySizeBig,
     1637        DpiBitBltCanvas(Canvas, xView + 9, yView + 5, xSizeBig, ySizeBig,
    16421638          Bigimp.Canvas, 0, 0);
    1643         with Tribe[cOwner].ModelPicture[c.Project and cpIndex] do
     1639        with Tribe[cOwner].ModelPicture[C.Project and cpIndex] do
    16441640          Sprite(Canvas, HGr, xView + 5, yView + 1, 64, 44, pix mod 10 * 65 + 1,
    16451641            pix div 10 * 49 + 1);
    16461642      end
    16471643      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);
    16501646    end;
    16511647  end;
     
    16631659  if 1 shl OpenSoundEvent = chProduction then
    16641660  begin
    1665     if c.Project0 and cpImp <> 0 then
    1666     begin
    1667       if c.Project0 and cpIndex >= 28 then
     1661    if C.Project0 and cpImp <> 0 then
     1662    begin
     1663      if C.Project0 and cpIndex >= 28 then
    16681664      // wonders have already extra message with sound
    1669         if Imp[c.Project0 and cpIndex].Kind = ikShipPart then
     1665        if Imp[C.Project0 and cpIndex].Kind = ikShipPart then
    16701666          Play('SHIP_BUILT')
    16711667        else
     
    16811677end;
    16821678
    1683 function Prio(iix: integer): integer;
     1679function Prio(iix: Integer): Integer;
    16841680begin
    16851681  case Imp[iix].Kind of
    16861682    ikWonder:
    1687       result := iix + 10000;
     1683      Result := iix + 10000;
    16881684    ikNatLocal, ikNatGlobal:
    16891685      case iix of
    16901686        imPalace:
    1691           result := 0;
     1687          Result := 0;
    16921688      else
    1693         result := iix + 20000;
     1689        Result := iix + 20000;
    16941690      end;
    16951691  else
    16961692    case iix of
    16971693      imTownHall, imCourt:
    1698         result := iix + 30000;
     1694        Result := iix + 30000;
    16991695      imAqueduct, imSewer:
    1700         result := iix + 40000;
     1696        Result := iix + 40000;
    17011697      imTemple, imTheater, imCathedral:
    1702         result := iix + 50000;
    1703     else
    1704       result := iix + 90000;
     1698        Result := iix + 50000;
     1699    else
     1700      Result := iix + 90000;
    17051701    end;
    17061702  end;
     
    17171713end;
    17181714
    1719 procedure TCityDlg.ChangeCity(d: integer);
     1715procedure TCityDlg.ChangeCity(D: Integer);
    17201716var
    1721   cixNew: integer;
     1717  cixNew: Integer;
    17221718begin
    17231719  cixNew := cix;
    17241720  repeat
    1725     cixNew := (cixNew + MyRO.nCity + d) mod MyRO.nCity;
     1721    cixNew := (cixNew + MyRO.nCity + D) mod MyRO.nCity;
    17261722  until (MyCity[cixNew].Loc >= 0) or (cixNew = cix);
    17271723  if cixNew <> cix then
     
    17421738end;
    17431739
    1744 { procedure TCityDlg.AdviceBtnClick(Sender: TObject);
    1745   begin
    1746   AdvisorDlg.GiveCityAdvice(cix);
    1747   end; }
    1748 
    17491740procedure TCityDlg.PageUpBtnClick(Sender: TObject);
    17501741begin
    17511742  if Page > 0 then
    17521743  begin
    1753     dec(Page);
     1744    Dec(Page);
    17541745    SmartUpdateContent;
    17551746  end;
     
    17601751  if Page < PageCount - 1 then
    17611752  begin
    1762     inc(Page);
     1753    Inc(Page);
    17631754    SmartUpdateContent;
    17641755  end;
    17651756end;
    17661757
    1767 procedure TCityDlg.ChangeResourceWeights(iResourceWeights: integer);
     1758procedure TCityDlg.ChangeResourceWeights(iResourceWeights: Integer);
    17681759var
    17691760  Advice: TCityTileAdviceData;
    17701761begin
    1771   assert(not supervising);
    1772   assert(cix >= 0);
     1762  Assert(not Supervising);
     1763  Assert(cix >= 0);
    17731764  MyCity[cix].Status := MyCity[cix].Status and not csResourceWeightsMask or
    17741765    (iResourceWeights shl 4);
    1775   c.Status := MyCity[cix].Status;
     1766  C.Status := MyCity[cix].Status;
    17761767  if iResourceWeights > 0 then
    17771768  begin
    17781769    Advice.ResourceWeights := OfferedResourceWeights[iResourceWeights];
    1779     Server(sGetCityTileAdvice, me, cix, Advice);
     1770    Server(sGetCityTileAdvice, Me, cix, Advice);
    17801771    if Advice.Tiles <> MyCity[cix].Tiles then
    1781       Server(sSetCityTiles, me, cix, Advice.Tiles);
     1772      Server(sSetCityTiles, Me, cix, Advice.Tiles);
    17821773  end;
    17831774end;
     
    17851776procedure SortImprovements;
    17861777var
    1787   i, j, k: integer;
    1788 begin
    1789   for i := 0 to nImp - 1 do
    1790     ImpSorted[i] := i;
    1791   for i := 0 to nImp - 2 do
    1792     for j := i + 1 to nImp - 1 do
    1793       if Prio(ImpSorted[i]) > Prio(ImpSorted[j]) then begin
    1794         k := ImpSorted[i];
    1795         ImpSorted[i] := ImpSorted[j];
    1796         ImpSorted[j] := k;
     1778  I, J, K: Integer;
     1779begin
     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;
    17971788      end;
    17981789end;
  • branches/highdpi/LocalPlayer/CityType.pas

    r361 r465  
    55
    66uses
    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;
    109
    1110type
     
    1817    procedure FormShow(Sender: TObject);
    1918    procedure PaintBox1MouseDown(Sender: TObject; Button: TMouseButton;
    20       Shift: TShiftState; x, y: integer);
     19      Shift: TShiftState; X, Y: Integer);
    2120    procedure PaintBox1MouseUp(Sender: TObject; Button: TMouseButton;
    22       Shift: TShiftState; x, y: integer);
     21      Shift: TShiftState; X, Y: Integer);
    2322    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    2423    procedure DeleteBtnClick(Sender: TObject);
    2524  public
    26     procedure ShowNewContent(NewMode: integer);
     25    procedure ShowNewContent(NewMode: TWindowMode);
    2726  protected
    2827    procedure OffscreenPaint; override;
    2928  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;
    3231    listed: Set of 0 .. nImp;
    33     Changed: boolean;
    34     procedure LoadType(NewType: integer);
     32    Changed: Boolean;
     33    procedure LoadType(NewType: Integer);
    3534    procedure SaveType;
    3635  end;
    3736
    38 var
    39   CityTypeDlg: TCityTypeDlg;
    4037
    4138implementation
    4239
    43 uses Help;
     40uses
     41  Help, Term;
    4442
    4543{$R *.lfm}
     
    8280procedure TCityTypeDlg.OffscreenPaint;
    8381var
    84   i, iix: integer;
    85   s: string;
     82  I, iix: Integer;
     83  S: string;
    8684begin
    8785  inherited;
    88   offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
     86  Offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
    8987  FillOffscreen(xList - 7, yList, 42 * nListCol + 14, 32 * nListRow);
    9088  FillOffscreen(xPool - 7, yPool, 42 * nPoolCol + 14, 32 * nPoolRow);
     
    9290    yPool - yList - 32 * nListRow);
    9391
    94   Frame(offscreen.Canvas, 0, yList + 32 * nListRow, InnerWidth - 255,
     92  Frame(Offscreen.Canvas, 0, yList + 32 * nListRow, InnerWidth - 255,
    9593    yPool - 23, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    96   Frame(offscreen.Canvas, InnerWidth - 254, yList + 32 * nListRow,
     94  Frame(Offscreen.Canvas, InnerWidth - 254, yList + 32 * nListRow,
    9795    InnerWidth - 89, yPool - 23, MainTexture.ColorBevelLight,
    9896    MainTexture.ColorBevelShade);
    99   Frame(offscreen.Canvas, InnerWidth - 88, yList + 32 * nListRow,
     97  Frame(Offscreen.Canvas, InnerWidth - 88, yList + 32 * nListRow,
    10098    InnerWidth - 1, yPool - 23, MainTexture.ColorBevelLight,
    10199    MainTexture.ColorBevelShade);
    102   Frame(offscreen.Canvas, 0, yPool - 22, InnerWidth - 1, yPool - 1,
     100  Frame(Offscreen.Canvas, 0, yPool - 22, InnerWidth - 1, yPool - 1,
    103101    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    104   for i := 0 to nCityType - 1 do
    105   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,
    107105      ySwitch + 23, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    108     if i = ctype then
    109       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,
    111109        MainTexture.ColorBevelLight)
    112110    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,
    115113        MainTexture.ColorBevelShade);
    116     DpiBitCanvas(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,
    120118    Phrases.Lookup('BUILDORDER'));
    121   RisedTextOut(offscreen.Canvas, 8, ySwitch + 26,
     119  RisedTextOut(Offscreen.Canvas, 8, ySwitch + 26,
    122120    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 do
    129   begin
    130     for i := 1 to nListRow - 1 do
    131       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 do
    134     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);
    136134      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 do
    144   begin
    145     RFrame(offscreen.Canvas, xList + 20 - xSizeSmall div 2 + i mod nListCol *
    146       42, yList + 15 - ySizeSmall div 2 + i div nListCol * 32,
    147       xList + 21 + xSizeSmall div 2 + i mod nListCol * 42,
    148       yList + 16 + ySizeSmall div 2 + i div 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,
    149147      MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    150     DpiBitCanvas(offscreen.Canvas, xList + 21 - xSizeSmall div 2 +
    151       i mod nListCol * 42, yList + 16 - ySizeSmall div 2 + i div 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,
    152150      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 *
    155153      ySizeSmall);
    156     inc(i);
     154    Inc(I);
    157155  end;
    158156
     
    165163    begin
    166164      Pooliix[nPool] := iix;
    167       RFrame(offscreen.Canvas, xPool + 20 - xSizeSmall div 2 +
     165      RFrame(Offscreen.Canvas, xPool + 20 - xSizeSmall div 2 +
    168166        nPool mod nPoolCol * 42, yPool + 15 - ySizeSmall div 2 +
    169167        nPool div nPoolCol * 32, xPool + 21 + xSizeSmall div 2 +
     
    171169        nPool div nPoolCol * 32, MainTexture.ColorBevelLight,
    172170        MainTexture.ColorBevelShade);
    173       DpiBitCanvas(offscreen.Canvas, xPool + 21 - xSizeSmall div 2 +
     171      DpiBitBltCanvas(Offscreen.Canvas, xPool + 21 - xSizeSmall div 2 +
    174172        nPool mod nPoolCol * 42, yPool + 16 - ySizeSmall div 2 +
    175173        nPool div nPoolCol * 32, xSizeSmall, ySizeSmall, SmallImp.Canvas,
    176174        iix mod 7 * xSizeSmall, (iix + SystemIconLines * 7) div 7 *
    177175        ySizeSmall);
    178       inc(nPool);
     176      Inc(nPool);
    179177    end;
    180178  DeleteBtn.Visible := MyData.ImpOrder[ctype, 0] >= 0;
     
    182180  if dragiix >= 0 then
    183181  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);
    189187  end;
    190188  MarkUsedOffscreen(InnerWidth, InnerHeight);
    191 end; { MainPaint }
    192 
    193 procedure TCityTypeDlg.LoadType(NewType: integer);
    194 var
    195   i: integer;
     189end;
     190
     191procedure TCityTypeDlg.LoadType(NewType: Integer);
     192var
     193  I: Integer;
    196194begin
    197195  ctype := NewType;
    198196  listed := [];
    199   i := 0;
    200   while MyData.ImpOrder[ctype, i] >= 0 do
    201   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;
    206204end;
    207205
    208206procedure TCityTypeDlg.SaveType;
    209207var
    210   cix: integer;
     208  cix: Integer;
    211209begin
    212210  if Changed then
     
    215213      if (MyCity[cix].Loc >= 0) and (MyCity[cix].Status and 7 = ctype + 1) then
    216214        AutoBuild(cix, MyData.ImpOrder[ctype]);
    217     Changed := false;
     215    Changed := False;
    218216  end;
    219217end;
     
    226224end;
    227225
    228 procedure TCityTypeDlg.ShowNewContent(NewMode: integer);
     226procedure TCityTypeDlg.ShowNewContent(NewMode: TWindowMode);
    229227begin
    230228  inherited ShowNewContent(NewMode);
     
    232230
    233231procedure 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) and
    242     (x > xList + 2 + i mod nListCol * 42) and
    243     (y > yList + 5 + i div nListCol * 32) and
    244     (x < xList + 3 + 36 + i mod nListCol * 42) and
    245     (y < yList + 6 + 20 + i div nListCol * 32) then
     232  Shift: TShiftState; X, Y: Integer);
     233var
     234  I: Integer;
     235begin
     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
    246244  begin
    247245    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])
    250248    else
    251249    begin
    252       dragiix := MyData.ImpOrder[ctype, i];
     250      dragiix := MyData.ImpOrder[ctype, I];
    253251      DpiScreen.Cursor := crImpDrag;
    254252      SmartUpdateContent;
    255253    end;
    256     exit;
    257   end;
    258   i := (x - xPool) div 42 + (y - yPool) div 32 * nPoolCol;
    259   if (i < nPool) and (x > xPool + 2 + i mod nPoolCol * 42) and
    260     (y > yPool + 5 + i div nPoolCol * 32) and
    261     (x < xPool + 3 + 36 + i mod nPoolCol * 42) and
    262     (y < yPool + 6 + 20 + i div nPoolCol * 32) then
     254    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
    263261  begin
    264262    if ssShift in Shift then
    265       HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp, Pooliix[i])
     263      MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, Pooliix[I])
    266264    else
    267265    begin
    268       dragiix := Pooliix[i];
     266      dragiix := Pooliix[I];
    269267      DpiScreen.Cursor := crImpDrag;
    270268      SmartUpdateContent;
    271269    end;
    272     exit;
    273   end;
    274   i := (x - xSwitch) div 42;
    275   if (i < nCityType) and (x > xSwitch + 2 + i * 42) and
    276     (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)
    277275  then
    278276  begin
    279277    SaveType;
    280     LoadType(i);
     278    LoadType(I);
    281279    SmartUpdateContent;
    282280  end;
     
    284282
    285283procedure 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);
    289287  var
    290     i: integer;
    291   begin
    292     i := 0;
    293     while (MyData.ImpOrder[ctype, i] >= 0) and
    294       (MyData.ImpOrder[ctype, i] <> iix) do
    295       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);
    298296    Exclude(listed, iix);
    299297  end;
    300298
    301299var
    302   i: integer;
    303 begin
    304   x := x - SideFrame;
    305   y := y - WideFrame;
     300  I: Integer;
     301begin
     302  X := X - SideFrame;
     303  Y := Y - WideFrame;
    306304  if dragiix >= 0 then
    307305  begin
    308     if (x >= xList) and (x < xList + nListCol * 42) and (y >= yList) and
    309       (y < yList + nListRow * 32) then
     306    if (X >= xList) and (X < xList + nListCol * 42) and (Y >= yList) and
     307      (Y < yList + nListRow * 32) then
    310308    begin
    311309      if dragiix in listed then
    312310        UnList(dragiix);
    313       i := (x - xList) div 42 + (y - yList) div 32 * nListCol;
    314       while (i > 0) and (MyData.ImpOrder[ctype, i - 1] < 0) do
    315         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;
    321319    end
    322     else if (dragiix in listed) and (x >= xPool) and (x < xPool + nPoolCol * 42)
    323       and (y >= yPool) and (y < yPool + nPoolRow * 32) then
     320    else if (dragiix in listed) and (X >= xPool) and (X < xPool + nPoolCol * 42)
     321      and (Y >= yPool) and (Y < yPool + nPoolRow * 32) then
    324322    begin
    325323      UnList(dragiix);
    326       Changed := true;
     324      Changed := True;
    327325    end;
    328326    dragiix := -1;
     
    340338procedure TCityTypeDlg.DeleteBtnClick(Sender: TObject);
    341339begin
    342   fillchar(MyData.ImpOrder[ctype], sizeof(MyData.ImpOrder[ctype]), Byte(-1));
     340  FillChar(MyData.ImpOrder[ctype], SizeOf(MyData.ImpOrder[ctype]), Byte(-1));
    343341  listed := [];
    344   Changed := true;
     342  Changed := True;
    345343  SmartUpdateContent;
    346344end;
  • branches/highdpi/LocalPlayer/ClientTools.pas

    r405 r465  
    99const
    1010  nOfferedResourceWeights = 6;
    11   OfferedResourceWeights: array [0 .. nOfferedResourceWeights - 1] of cardinal =
     11  OfferedResourceWeights: array [0 .. nOfferedResourceWeights - 1] of Cardinal =
    1212    (rwOff, rwMaxScience, rwForceScience, rwMaxGrowth, rwForceProd, rwMaxProd);
    1313
    1414type
    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;
    1717  JobResultSet = set of 0 .. 39;
    1818
     
    3636  Server: TServerCall;
    3737  G: TNewGameData;
    38   me: integer;
     38  Me: Integer;
    3939  MyRO: ^TPlayerContext;
    4040  MyMap: ^TTileList;
     
    4343  MyModel: ^TModelList;
    4444
    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
     47function dLoc(Loc, dx, dy: Integer): Integer;
     48function Distance(Loc0, Loc1: Integer): Integer;
     49function UnrestAtLoc(uix, Loc: Integer): Boolean;
     50function GetMoveAdvice(uix, ToLoc: Integer;
     51  var MoveAdviceData: TMoveAdviceData): Integer;
     52function ColorOfHealth(Health: Integer): Integer;
     53function IsMultiPlayerGame: Boolean;
     54procedure ItsMeAgain(P: Integer);
     55function GetAge(P: Integer): Integer;
     56function IsCivilReportNew(Enemy: Integer): Boolean;
     57function IsMilReportNew(Enemy: Integer): Boolean;
     58function CutCityFoodSurplus(FoodSurplus: Integer; IsCityAlive: Boolean;
     59  gov, size: Integer): Integer;
     60function CityTaxBalance(cix: Integer; const CityReport: TCityReportNew): Integer;
     61procedure SumCities(var TaxSum, ScienceSum: Integer);
     62function JobTest(uix, Job: Integer; IgnoreResults: JobResultSet = []): Boolean;
     63procedure GetUnitInfo(Loc: Integer; var uix: Integer; var UnitInfo: TUnitInfo);
     64procedure GetCityInfo(Loc: Integer; var cix: Integer; var CityInfo: TCityInfo);
     65function UnitExhausted(uix: Integer): Boolean;
     66function ModelHash(const ModelInfo: TModelInfo): Integer;
     67function ProcessEnhancement(uix: Integer; const Jobs: TEnhancementJobs): Integer;
     68function AutoBuild(cix: Integer; const ImpOrder: TImpOrder): Boolean;
     69procedure DebugMessage(Level: Integer; Text: string);
    7070procedure 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);
     71procedure CityOptimizer_CityChange(cix: Integer);
     72procedure CityOptimizer_TileBecomesAvailable(Loc: Integer);
     73procedure CityOptimizer_ReleaseCityTiles(cix, ReleasedTiles: Integer);
     74procedure CityOptimizer_BeforeRemoveUnit(uix: Integer);
    7575procedure CityOptimizer_AfterRemoveUnit;
    7676procedure CityOptimizer_EndOfTurn;
     
    8484
    8585var
    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
     88function dLoc(Loc, dx, dy: Integer): Integer;
     89var
     90  y0: Integer;
    9191begin
    9292  y0 := (Loc + G.lx * 1024) div G.lx - 1024;
     
    9494end;
    9595
    96 function Distance(Loc0, Loc1: integer): integer;
    97 var
    98   dx, dy: integer;
     96function Distance(Loc0, Loc1: Integer): Integer;
     97var
     98  dx, dy: Integer;
    9999begin
    100100  Inc(Loc0, G.lx * 1024);
     
    106106end;
    107107
    108 function UnrestAtLoc(uix, Loc: integer): boolean;
    109 var
    110   uix1: integer;
     108function UnrestAtLoc(uix, Loc: Integer): Boolean;
     109var
     110  uix1: Integer;
    111111begin
    112112  Result := False;
     
    114114    case MyRO.Government of
    115115      gRepublic, gFuture:
    116         Result := (MyRO.Territory[Loc] >= 0) and (MyRO.Territory[Loc] <> me) and
     116        Result := (MyRO.Territory[Loc] >= 0) and (MyRO.Territory[Loc] <> Me) and
    117117          (MyRO.Treaty[MyRO.Territory[Loc]] < trAlliance);
    118118      gDemocracy:
    119         Result := (MyRO.Territory[Loc] < 0) or (MyRO.Territory[Loc] <> me) and
     119        Result := (MyRO.Territory[Loc] < 0) or (MyRO.Territory[Loc] <> Me) and
    120120          (MyRO.Treaty[MyRO.Territory[Loc]] < trAlliance);
    121121    end;
     
    127127end;
    128128
    129 function GetMoveAdvice(uix, ToLoc: integer;
    130   var MoveAdviceData: TMoveAdviceData): integer;
    131 var
    132   MinEndHealth: integer;
     129function GetMoveAdvice(uix, ToLoc: Integer;
     130  var MoveAdviceData: TMoveAdviceData): Integer;
     131var
     132  MinEndHealth: Integer;
    133133begin
    134134  if MyModel[MyUn[uix].mix].Domain = dGround then
     
    142142      MoveAdviceData.MoreTurns := 999;
    143143      MoveAdviceData.MaxHostile_MovementLeft := MyUn[uix].Health - MinEndHealth;
    144       Result := Server(sGetMoveAdvice, me, uix, MoveAdviceData);
     144      Result := Server(sGetMoveAdvice, Me, uix, MoveAdviceData);
    145145      if (MinEndHealth <= 1) or (Result <> eNoWay) then
    146         exit;
     146        Exit;
    147147    end;
    148148    case MinEndHealth of
     
    159159end;
    160160
    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;
     161function ColorOfHealth(Health: Integer): Integer;
     162var
     163  Red, Green: Integer;
     164begin
     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;
     172end;
     173
     174function IsMultiPlayerGame: Boolean;
     175var
     176  p1: Integer;
    177177begin
    178178  Result := False;
     
    182182end;
    183183
    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])
     184procedure ItsMeAgain(P: Integer);
     185begin
     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])
    190190  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 begin
     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);
     197end;
     198
     199function GetAge(P: Integer): Integer;
     200var
     201  I: Integer;
     202begin
     203  if P = Me then begin
    204204    Result := 0;
    205     for i := 1 to 3 do
    206       if MyRO.Tech[AgePreq[i]] >= tsApplicable then
    207         Result := i;
     205    for I := 1 to 3 do
     206      if MyRO.Tech[AgePreq[I]] >= tsApplicable then
     207        Result := I;
    208208  end else begin
    209209    Result := 0;
    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;
     210    for I := 1 to 3 do
     211      if MyRO.EnemyReport[P].Tech[AgePreq[I]] >= tsApplicable then
     212        Result := I;
     213  end;
     214end;
     215
     216function IsCivilReportNew(Enemy: Integer): Boolean;
     217var
     218  I: Integer;
     219begin
     220  Assert(Enemy <> Me);
     221  I := MyRO.EnemyReport[Enemy].TurnOfCivilReport;
     222  Result := (I = MyRO.Turn) or (I = MyRO.Turn - 1) and (Enemy > Me);
     223end;
     224
     225function IsMilReportNew(Enemy: Integer): Boolean;
     226var
     227  I: Integer;
     228begin
     229  Assert(Enemy <> Me);
     230  I := MyRO.EnemyReport[Enemy].TurnOfMilReport;
     231  Result := (I = MyRO.Turn) or (I = MyRO.Turn - 1) and (Enemy > Me);
     232end;
     233
     234function CutCityFoodSurplus(FoodSurplus: Integer; IsCityAlive: Boolean;
     235  gov, size: Integer): Integer;
    236236begin
    237237  Result := FoodSurplus;
     
    241241end;
    242242
    243 function CityTaxBalance(cix: integer; const CityReport: TCityReportNew): integer;
    244 var
    245   i: integer;
     243function CityTaxBalance(cix: Integer; const CityReport: TCityReportNew): Integer;
     244var
     245  I: Integer;
    246246begin
    247247  Result := 0;
     
    258258      Inc(Result, CityReport.FoodSurplus);
    259259  end;
    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;
     260  for I := nWonder to nImp - 1 do
     261    if MyCity[cix].Built[I] > 0 then
     262      Dec(Result, Imp[I].Maint);
     263end;
     264
     265procedure SumCities(var TaxSum, ScienceSum: Integer);
     266var
     267  cix: Integer;
    268268  CityReport: TCityReportNew;
    269269begin
     
    271271  ScienceSum := 0;
    272272  if MyRO.Government = gAnarchy then
    273     exit;
     273    Exit;
    274274  for cix := 0 to MyRO.nCity - 1 do
    275275    if MyCity[cix].Loc >= 0 then
     
    278278      CityReport.HypoTaxRate := -1;
    279279      CityReport.HypoLuxuryRate := -1;
    280       Server(sGetCityReportNew, me, cix, CityReport);
     280      Server(sGetCityReportNew, Me, cix, CityReport);
    281281      if (CityReport.HappinessBalance >= 0) { no disorder } and
    282282        (MyCity[cix].Flags and chCaptured = 0) then // not captured
     
    286286end;
    287287
    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^);
     288function JobTest(uix, Job: Integer; IgnoreResults: JobResultSet): Boolean;
     289var
     290  Test: Integer;
     291begin
     292  Test := Server(sStartJob + Job shl 4 - sExecute, Me, uix, nil^);
    293293  Result := (Test >= rExecuted) or (Test in IgnoreResults);
    294294end;
    295295
    296 procedure GetUnitInfo(Loc: integer; var uix: integer; var UnitInfo: TUnitInfo);
    297 var
    298   i, Cnt: integer;
     296procedure GetUnitInfo(Loc: Integer; var uix: Integer; var UnitInfo: TUnitInfo);
     297var
     298  I, Cnt: Integer;
    299299begin
    300300  if MyMap[Loc] and fOwned <> 0 then
    301301  begin
    302     Server(sGetDefender, me, Loc, uix);
     302    Server(sGetDefender, Me, Loc, uix);
    303303    Cnt := 0;
    304     for i := 0 to MyRO.nUn - 1 do
    305       if MyUn[i].Loc = Loc then
     304    for I := 0 to MyRO.nUn - 1 do
     305      if MyUn[I].Loc = Loc then
    306306        Inc(Cnt);
    307     MakeUnitInfo(me, MyUn[uix], UnitInfo);
     307    MakeUnitInfo(Me, MyUn[uix], UnitInfo);
    308308    if Cnt > 1 then
    309309      UnitInfo.Flags := UnitInfo.Flags or unMulti;
     
    316316    UnitInfo := MyRO.EnemyUn[uix];
    317317  end;
    318 end; { GetUnitInfo }
    319 
    320 procedure GetCityInfo(Loc: integer; var cix: integer; var CityInfo: TCityInfo);
     318end;
     319
     320procedure GetCityInfo(Loc: Integer; var cix: Integer; var CityInfo: TCityInfo);
    321321begin
    322322  if MyMap[Loc] and fOwned <> 0 then
     
    328328    with CityInfo do
    329329    begin
    330       Owner := me;
     330      Owner := Me;
    331331      ID := MyCity[cix].ID;
    332332      size := MyCity[cix].size;
     
    356356end;
    357357
    358 function UnitExhausted(uix: integer): boolean;
     358function UnitExhausted(uix: Integer): Boolean;
    359359  // check if another move of this unit is still possible
    360360var
    361   dx, dy: integer;
     361  dx, dy: Integer;
    362362begin
    363363  Result := True;
    364364  if (MyUn[uix].Movement > 0) or
    365     (MyRO.Wonder[woShinkansen].EffectiveOwner = me) then
     365    (MyRO.Wonder[woShinkansen].EffectiveOwner = Me) then
    366366    if (MyUn[uix].Movement >= 100) or
    367367      ((MyModel[MyUn[uix].mix].Kind = mkCaravan) and
     
    373373          if abs(dx) + abs(dy) = 2 then
    374374            if Server(sMoveUnit - sExecute + dx and 7 shl 4 + dy and
    375               7 shl 7, me, uix, nil^) >= rExecuted then
     375              7 shl 7, Me, uix, nil^) >= rExecuted then
    376376              Result := False;
    377377end;
    378378
    379 function ModelHash(const ModelInfo: TModelInfo): integer;
    380 var
    381   i, FeatureCode, Hash1, Hash2, Hash2r, d: cardinal;
     379function ModelHash(const ModelInfo: TModelInfo): Integer;
     380var
     381  I, FeatureCode, Hash1, Hash2, Hash2r, D: Cardinal;
    382382begin
    383383  with ModelInfo do
    384384    if Kind > mkEnemyDeveloped then
    385       Result := integer($C0000000 + Speed div 50 + Kind shl 8)
     385      Result := Integer($C0000000 + Speed div 50 + Kind shl 8)
    386386    else
    387387    begin
    388388      FeatureCode := 0;
    389       for i := mcFirstNonCap to nFeature - 1 do
    390         if 1 shl Domain and Feature[i].Domains <> 0 then
     389      for I := mcFirstNonCap to nFeature - 1 do
     390        if 1 shl Domain and Feature[I].Domains <> 0 then
    391391        begin
    392392          FeatureCode := FeatureCode * 2;
    393           if 1 shl (i - mcFirstNonCap) <> 0 then
     393          if 1 shl (I - mcFirstNonCap) <> 0 then
    394394            Inc(FeatureCode);
    395395        end;
     
    397397        dGround:
    398398        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);
    403403          Hash1 := (Attack * 2273 + Defense) * 9 + (Speed - 150) div 50;
    404404          Hash2 := FeatureCode * 1611 + Cost;
     
    406406        dSea:
    407407        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);
    412412          Hash1 := ((Attack * 6097 + Defense) * 5 +
    413413            (Speed - 350) div 100) * 2;
     
    419419        dAir:
    420420        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);
    426426          Hash1 := (Attack * 1605 + Defense) shl 5 + FeatureCode;
    427427          Hash2 := ((Bombs * 7 + ATrans_Fuel) * 4 + TTrans) * 2089 + Cost;
     
    429429      end;
    430430      Hash2r := 0;
    431       for i := 0 to 7 do
     431      for I := 0 to 7 do
    432432      begin
    433433        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;
    437437      end;
    438       Result := integer(Domain shl 30 + Hash1 xor Hash2r);
     438      Result := Integer(Domain shl 30 + Hash1 xor Hash2r);
    439439    end;
    440440end;
    441441
    442 function ProcessEnhancement(uix: integer; const Jobs: TEnhancementJobs): integer;
     442function ProcessEnhancement(uix: Integer; const Jobs: TEnhancementJobs): Integer;
    443443  { return values:
    444444    eJobDone - all applicable jobs done
     
    446446    eDied - job done and died (thurst) }
    447447var
    448   stage, NextJob, Tile: integer;
     448  stage, NextJob, Tile: Integer;
    449449  Done: set of jNone .. jPoll;
    450450begin
     
    452452  Tile := MyMap[MyUn[uix].Loc];
    453453  if Tile and fRoad <> 0 then
    454     include(Done, jRoad);
     454    Include(Done, jRoad);
    455455  if Tile and fRR <> 0 then
    456     include(Done, jRR);
     456    Include(Done, jRR);
    457457  if (Tile and fTerImp = tiIrrigation) or (Tile and fTerImp = tiFarm) then
    458     include(Done, jIrr);
     458    Include(Done, jIrr);
    459459  if Tile and fTerImp = tiFarm then
    460     include(Done, jFarm);
     460    Include(Done, jFarm);
    461461  if Tile and fTerImp = tiMine then
    462     include(Done, jMine);
     462    Include(Done, jMine);
    463463  if Tile and fPoll = 0 then
    464     include(Done, jPoll);
     464    Include(Done, jPoll);
    465465
    466466  if MyUn[uix].Job = jNone then
     
    485485      Break;
    486486    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;
     490end;
     491
     492function AutoBuild(cix: Integer; const ImpOrder: TImpOrder): Boolean;
     493var
     494  I, NewProject: Integer;
    495495begin
    496496  Result := False;
     
    498498    (MyCity[cix].Flags and chProduction <> 0) then
    499499  begin
    500     i := 0;
     500    I := 0;
    501501    repeat
    502       while (ImpOrder[i] >= 0) and (MyCity[cix].Built[ImpOrder[i]] > 0) do
    503         Inc(i);
    504       if ImpOrder[i] < 0 then
     502      while (ImpOrder[I] >= 0) and (MyCity[cix].Built[ImpOrder[I]] > 0) do
     503        Inc(I);
     504      if ImpOrder[I] < 0 then
    505505        Break;
    506       assert(i < nImp);
    507       NewProject := cpImp + ImpOrder[i];
    508       if Server(sSetCityProject, me, cix, NewProject) >= rExecuted then
     506      Assert(I < nImp);
     507      NewProject := cpImp + ImpOrder[I];
     508      if Server(sSetCityProject, Me, cix, NewProject) >= rExecuted then
    509509      begin
    510510        Result := True;
     
    512512        Break;
    513513      end;
    514       Inc(i);
     514      Inc(I);
    515515    until False;
    516516  end;
     
    519519procedure CalculateAdvValues;
    520520var
    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 then
     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 then
    527527    begin
    528       known[i] := 1;
    529       if (i <> adScience) and (i <> adMassProduction) then
     528      known[I] := 1;
     529      if (I <> adScience) and (I <> adMassProduction) then
    530530      begin
    531         if (AdvPreq[i, 0] >= 0) then
    532           MarkPreqs(AdvPreq[i, 0]);
    533         if (AdvPreq[i, 1] >= 0) then
    534           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]);
    535535      end;
    536536    end;
     
    539539begin
    540540  FillChar(AdvValue, SizeOf(AdvValue), 0);
    541   for i := 0 to nAdv - 1 do
     541  for I := 0 to nAdv - 1 do
    542542  begin
    543543    FillChar(known, SizeOf(known), 0);
    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)
     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)
    550550    else if known[adMassProduction] > 0 then
    551       Inc(AdvValue[i], 2000)
     551      Inc(AdvValue[I], 2000)
    552552    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;
     555end;
     556
     557procedure DebugMessage(Level: Integer; Text: string);
     558begin
     559  Server(sMessage, Me, Level, PChar(Text)^);
     560end;
     561
     562function MarkCitiesAround(Loc, cixExcept: Integer): Boolean;
    563563  // return whether a city was marked
    564564var
    565   cix: integer;
     565  cix: Integer;
    566566begin
    567567  Result := False;
     
    576576end;
    577577
    578 procedure OptimizeCities(CheckOnly: boolean);
    579 var
    580   cix, fix, dx, dy, Loc1, OptiType: integer;
    581   Done: boolean;
     578procedure OptimizeCities(CheckOnly: Boolean);
     579var
     580  cix, fix, dx, dy, Loc1, OptiType: Integer;
     581  Done: Boolean;
    582582  Advice: TCityTileAdviceData;
    583583begin
     
    591591        begin
    592592          Advice.ResourceWeights := OfferedResourceWeights[OptiType];
    593           Server(sGetCityTileAdvice, me, cix, Advice);
     593          Server(sGetCityTileAdvice, Me, cix, Advice);
    594594          if Advice.Tiles <> MyCity[cix].Tiles then
    595595            if CheckOnly then
     
    611611                    Done := False;
    612612                end;
    613               Server(sSetCityTiles, me, cix, Advice.Tiles);
     613              Server(sSetCityTiles, Me, cix, Advice.Tiles);
    614614            end;
    615615        end;
     
    621621procedure CityOptimizer_BeginOfTurn;
    622622var
    623   cix: integer;
     623  cix: Integer;
    624624begin
    625625  FillChar(CityNeedsOptimize, MyRO.nCity - 1, 0); // false
     
    634634end;
    635635
    636 procedure CityOptimizer_CityChange(cix: integer);
     636procedure CityOptimizer_CityChange(cix: Integer);
    637637begin
    638638  if (MyRO.Government <> gAnarchy) and (cix <> -1) and (MyCity[cix].Flags and
     
    644644end;
    645645
    646 procedure CityOptimizer_TileBecomesAvailable(Loc: integer);
     646procedure CityOptimizer_TileBecomesAvailable(Loc: Integer);
    647647begin
    648648  if (MyRO.Government <> gAnarchy) and MarkCitiesAround(Loc, -1) then
     
    650650end;
    651651
    652 procedure CityOptimizer_ReleaseCityTiles(cix, ReleasedTiles: integer);
    653 var
    654   fix, dx, dy, Loc1: integer;
    655   Done: boolean;
     652procedure CityOptimizer_ReleaseCityTiles(cix, ReleasedTiles: Integer);
     653var
     654  fix, dx, dy, Loc1: Integer;
     655  Done: Boolean;
    656656begin
    657657  if (MyRO.Government <> gAnarchy) and (ReleasedTiles <> 0) then
     
    672672end;
    673673
    674 procedure CityOptimizer_BeforeRemoveUnit(uix: integer);
    675 var
    676   uix1: integer;
     674procedure CityOptimizer_BeforeRemoveUnit(uix: Integer);
     675var
     676  uix1: Integer;
    677677begin
    678678  if MyRO.Government <> gAnarchy then
     
    698698// all cities should already be optimized here -- only check this
    699699var
    700   cix: integer;
     700  cix: Integer;
    701701begin
    702702{$IFOPT O-}
  • branches/highdpi/LocalPlayer/Diagram.pas

    r361 r465  
    99
    1010type
     11  TDiagramKind = (dkChart, dkShip);
     12
    1113  TDiaDlg = class(TFramedDlg)
    1214    CloseBtn: TButtonB;
     
    1921    procedure ToggleBtnClick(Sender: TObject);
    2022    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);
    2324  public
    2425    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);
    2828  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
     34procedure PaintColonyShip(Canvas: TDpiCanvas; Player, Left, Width, Top: Integer);
     35
    3736
    3837implementation
     
    4544const
    4645  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);
    4847
    4948  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
     56procedure PaintColonyShip(Canvas: TDpiCanvas; Player, Left, Width, Top: Integer);
    5857var
    59   i, x, r, nComp, nPow, nHab: integer;
     58  I, X, R, nComp, nPow, nHab: Integer;
    6059begin
    6160  Canvas.Brush.Color := $000000;
    6261  Canvas.FillRect(Rect(Left, Top, Left + Width, Top + 200));
    6362  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,
    6564      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,
    6766      MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    6867
    6968    // stars
    7069    DelphiRandSeed := Player * 11111;
    71     for i := 1 to Width - 16 do
     70    for I := 1 to Width - 16 do
    7271    begin
    73       x := DelphiRandom((Width - 16) * 200);
    74       r := DelphiRandom(13) + 28;
    75       Canvas.Pixels[x div 200 + 8, x mod 200 + Top] :=
    76         (r * r * r * r div 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;
    7776    end;
    7877
     
    8685    if nHab > 2 then
    8786      nHab := 2;
    88     for i := 0 to nHab - 1 do
    89       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 do
    92       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);
    9493    if nComp > 0 then
    95       for i := 3 downto nPow do
    96         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 do
    99       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);
    101100    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,
    103102        Top + 100 + 7 + yComp[2], 16, 27, 1, 82);
    104103    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,
    106105        Top + 100 + 7 + yComp[2], 16, 27, 18, 82);
    107106    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,
    109108        Top + 100 + 46 + yComp[3], 16, 27, 1, 82);
    110109    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,
    112111        Top + 100 + 46 + yComp[3], 16, 27, 18, 82);
    113112    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],
    115114        Top + 100 + 7 + yComp[nComp], 16, 27, 18, 82);
    116115    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],
    118117        Top + 100 + 46 + yComp[nComp], 16, 27, 18, 82);
    119118    if nComp = 2 then
    120       Sprite(canvas, HGrSystem2, Left + Width div 2 + xComp[3],
     119      Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[3],
    121120        Top + 100 + 7 + yComp[3], 16, 27, 18, 82);
    122121    if nComp = 3 then
    123       Sprite(canvas, HGrSystem2, Left + Width div 2 + xComp[4],
     122      Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[4],
    124123        Top + 100 + 7 + yComp[4], 16, 27, 18, 82);
    125124end;
     
    142141procedure TDiaDlg.OffscreenPaint;
    143142var
    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;
    146145  List: ^TChart;
    147146
    148   function Round(T: integer): integer;
     147  function Round(T: Integer): Integer;
    149148  var
    150     n, i: integer;
     149    N, I: Integer;
    151150  begin
    152151    if T < RoundRange then
    153       n := T
     152      N := T
    154153    else
    155       n := RoundRange;
    156     result := 0;
    157     for i := T - n to T do
    158       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,
    166165      MainTexture.ColorTextLight);
    167166    if val0 > 0 then
    168       s := Format(Phrases.Lookup('SHARE'), [val0, val1])
     167      S := Format(Phrases.Lookup('SHARE'), [val0, val1])
    169168    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);
    173172  end;
    174173
     
    176175  inherited;
    177176  if Kind = dkChart then
    178     with offscreen.canvas do
     177    with Offscreen.Canvas do
    179178    begin
    180179      Font.Assign(UniFont[ftTiny]);
     
    186185      GetMem(List, 4 * (MyRO.Turn + 2));
    187186      if Mode = stExplore then
    188         max := G.lx * G.ly
     187        Max := G.lx * G.ly
    189188      else
    190189      begin
    191         max := -1;
    192         for p := 0 to nPl - 1 do
    193           if (G.Difficulty[p] > 0) and
    194             (Server(sGetChart + Mode shl 4, me, p, List^) >= rExecuted) then
     190        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
    195194            for T := 0 to MyRO.Turn - 1 do
    196195            begin
    197               r := Round(T);
    198               if r > max then
    199                 max := r;
     196              R := Round(T);
     197              if R > Max then
     198                Max := R;
    200199            end;
    201200      end;
     
    215214      for T := 0 to (MyRO.Turn - 1) div LineStep do
    216215      begin
    217         x := Border + (InnerWidth - 2 * Border) * T *
     216        X := Border + (InnerWidth - 2 * Border) * T *
    218217          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);
    223222      end;
    224223
    225224      y0 := 0;
    226       if max > 0 then
     225      if Max > 0 then
    227226      begin
    228         for p := 0 to nPl - 1 do
    229           if (G.Difficulty[p] > 0) and
    230             (Server(sGetChart + Mode shl 4, me, p, List^) >= rExecuted) then
     227        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
    231230          begin
    232             Pen.Color := Tribe[p].Color;
     231            Pen.Color := Tribe[P].Color;
    233232            Stop := MyRO.Turn - 1;
    234233            while (Stop > 0) and (List[Stop] = 0) do
    235               dec(Stop);
     234              Dec(Stop);
    236235            for T := 0 to Stop do
    237236            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;
    242241              if T = 0 then
    243                 MoveTo(x, y)
     242                MoveTo(X, Y)
    244243                // else if Mode=stTerritory then
    245244                // begin LineTo(x,y0); LineTo(x,y) end
    246245              else if RoundPixels[Mode] = 0 then
    247246              begin
    248                 if (y <> y0) or (T = Stop) then
    249                   LineTo(x, y)
     247                if (Y <> y0) or (T = Stop) then
     248                  LineTo(X, Y)
    250249              end
    251250              else
    252                 LineTo(x, y);
    253               y0 := y;
     251                LineTo(X, Y);
     252              y0 := Y;
    254253            end;
    255254          end;
     
    258257    end
    259258  else
    260     with offscreen.canvas do
     259    with Offscreen.Canvas do
    261260    begin
    262261      Font.Assign(UniFont[ftSmall]);
    263262      FillOffscreen(0, 0, InnerWidth, InnerHeight);
    264263
    265       PaintColonyShip(offscreen.canvas, Player, 8, InnerWidth - 16, yArea);
     264      PaintColonyShip(Offscreen.Canvas, Player, 8, InnerWidth - 16, yArea);
    266265
    267266      ShareBar(InnerWidth div 2 - 85, InnerHeight - 62,
     
    273272    end;
    274273  MarkUsedOffscreen(InnerWidth, InnerHeight);
    275 end; // OffscreenPaint
     274end;
    276275
    277276procedure TDiaDlg.FormPaint(Sender: TObject);
    278277var
    279   s: string;
     278  S: string;
    280279begin
    281280  inherited;
    282   canvas.Font.Assign(UniFont[ftNormal]);
     281  Canvas.Font.Assign(UniFont[ftNormal]);
    283282  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);
    289288end;
    290289
     
    299298end;
    300299
    301 procedure TDiaDlg.ShowNewContent_Charts(NewMode: integer);
     300procedure TDiaDlg.ShowNewContent_Charts(NewMode: TWindowMode);
    302301begin
    303302  Kind := dkChart;
     
    309308end;
    310309
    311 procedure TDiaDlg.ShowNewContent_Ship(NewMode, p: integer);
     310procedure TDiaDlg.ShowNewContent_Ship(NewMode: TWindowMode; P: Integer);
    312311begin
    313312  Kind := dkShip;
    314   if p < 0 then
    315   begin
    316     Player := me;
     313  if P < 0 then
     314  begin
     315    Player := Me;
    317316    while MyRO.Ship[Player].Parts[spComp] + MyRO.Ship[Player].Parts[spPow] +
    318317      MyRO.Ship[Player].Parts[spHab] = 0 do
     
    320319  end
    321320  else
    322     Player := p;
     321    Player := P;
    323322  ToggleBtn.ButtonIndex := 28;
    324323  ToggleBtn.Hint := Phrases.Lookup('BTN_SELECT');
     
    329328procedure TDiaDlg.ToggleBtnClick(Sender: TObject);
    330329var
    331   p1: integer;
    332   m: TDpiMenuItem;
     330  p1: Integer;
     331  M: TDpiMenuItem;
    333332begin
    334333  if Kind = dkChart then
     
    345344        MyRO.Ship[p1].Parts[spHab] > 0 then
    346345      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;
    352351        if p1 = Player then
    353           m.Checked := true;
    354         Popup.Items.Add(m);
     352          M.Checked := True;
     353        Popup.Items.Add(M);
    355354      end;
    356355    Popup.Popup(Left + ToggleBtn.Left, Top + ToggleBtn.Top + ToggleBtn.Height);
     
    363362end;
    364363
    365 procedure TDiaDlg.FormKeyDown(Sender: TObject; var Key: word;
     364procedure TDiaDlg.FormKeyDown(Sender: TObject; var Key: Word;
    366365  Shift: TShiftState);
    367366begin
  • branches/highdpi/LocalPlayer/Diplomacy.pas

    r210 r465  
    77
    88function DipCommandToString(pSender, pTarget, Treaty, OppCommand,
    9   Command: integer; const OppOffer, Offer: TOffer): string;
     9  Command: Integer; const OppOffer, Offer: TOffer): string;
    1010
    1111implementation
     
    1616function DipCommandToString;
    1717
    18   function PriceToString(p, Price: integer): string;
     18  function PriceToString(P, Price: Integer): string;
    1919  begin
    2020    case Price and opMask of
    2121      opChoose:
    22         result := Phrases.Lookup('PRICE_CHOOSE');
     22        Result := Phrases.Lookup('PRICE_CHOOSE');
    2323      opCivilReport:
    24         result := Tribe[p].TPhrase('PRICE_CIVIL');
     24        Result := Tribe[P].TPhrase('PRICE_CIVIL');
    2525      opMilReport:
    26         result := Tribe[p].TPhrase('PRICE_MIL');
     26        Result := Tribe[P].TPhrase('PRICE_MIL');
    2727      opMap:
    28         result := Tribe[p].TPhrase('PRICE_MAP');
     28        Result := Tribe[P].TPhrase('PRICE_MAP');
    2929      opTreaty:
    3030        { if Price-opTreaty<Treaty then
    3131          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);
    3737      opShipParts:
    3838        case Price shr 16 and $F of
    3939          0:
    40             result := Format(Phrases.Lookup('PRICE_SHIPCOMP'),
     40            Result := Format(Phrases.Lookup('PRICE_SHIPCOMP'),
    4141              [Price and $FFFF]);
    4242          1:
    43             result := Format(Phrases.Lookup('PRICE_SHIPPOW'),
     43            Result := Format(Phrases.Lookup('PRICE_SHIPPOW'),
    4444              [Price and $FFFF]);
    4545          2:
    46             result := Format(Phrases.Lookup('PRICE_SHIPHAB'),
     46            Result := Format(Phrases.Lookup('PRICE_SHIPHAB'),
    4747              [Price and $FFFF]);
    4848        end;
    4949      opMoney:
    50         result := Format('%d%%c', [Price - opMoney]);
     50        Result := Format('%d%%c', [Price - opMoney]);
    5151      opTribute:
    52         result := Format(Phrases.Lookup('PRICE_TRIBUTE'), [Price - opTribute]);
     52        Result := Format(Phrases.Lookup('PRICE_TRIBUTE'), [Price - opTribute]);
    5353      opTech:
    54         result := Phrases.Lookup('ADVANCES', Price - opTech);
     54        Result := Phrases.Lookup('ADVANCES', Price - opTech);
    5555      opAllTech:
    56         result := Tribe[p].TPhrase('PRICE_ALLTECH');
     56        Result := Tribe[P].TPhrase('PRICE_ALLTECH');
    5757      opModel:
    58         result := Tribe[p].ModelName[Price - opModel];
     58        Result := Tribe[P].ModelName[Price - opModel];
    5959      opAllModel:
    60         result := Tribe[p].TPhrase('PRICE_ALLMODEL');
     60        Result := Tribe[P].TPhrase('PRICE_ALLMODEL');
    6161      { opCity:
    62         result:=Format(TPhrase('PRICE_CITY',p),[CityName(Price-opCity)]); }
     62        Result:=Format(TPhrase('PRICE_CITY',P),[CityName(Price-opCity)]); }
    6363    end
    6464  end;
    6565
    6666var
    67   i: integer;
     67  I: Integer;
    6868  sAdd, sDeliver, sCost: string;
    69   DoIntro: boolean;
     69  DoIntro: Boolean;
    7070begin
    7171  DoIntro := OppCommand = scDipStart;
     
    7575        case Treaty of
    7676          trPeace:
    77             result := Phrases.Lookup('FRCANCELTREATY_PEACE');
     77            Result := Phrases.Lookup('FRCANCELTREATY_PEACE');
    7878          trFriendlyContact:
    79             result := Phrases.Lookup('FRCANCELTREATY_FRIENDLY');
     79            Result := Phrases.Lookup('FRCANCELTREATY_FRIENDLY');
    8080          trAlliance:
    81             result := Phrases.Lookup('FRCANCELTREATY_ALLIANCE');
    82         end;
    83         DoIntro := false;
     81            Result := Phrases.Lookup('FRCANCELTREATY_ALLIANCE');
     82        end;
     83        DoIntro := False;
    8484      end;
    8585    scDipNotice:
    86       result := Phrases.Lookup('FRNOTICE');
     86      Result := Phrases.Lookup('FRNOTICE');
    8787    scDipAccept:
    8888      begin
    8989        if (OppOffer.nDeliver + OppOffer.nCost = 1) and
    9090          (OppOffer.Price[0] and opMask = opTreaty) and
    91           (integer(OppOffer.Price[0] - opTreaty) > Treaty) then
     91          (Integer(OppOffer.Price[0] - opTreaty) > Treaty) then
    9292        // simple treaty offer
    9393          { 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')
    9696        else if OppOffer.nDeliver = 0 then
    97           result := Tribe[pSender].TPhrase('FRACCEPTDEMAND_STRONG')
     97          Result := Tribe[pSender].TPhrase('FRACCEPTDEMAND_STRONG')
    9898        else if OppOffer.nCost = 0 then
    99           result := Tribe[pSender].TPhrase('FRACCEPTPRESENT')
     99          Result := Tribe[pSender].TPhrase('FRACCEPTPRESENT')
    100100        else
    101           result := Tribe[pSender].TPhrase('FRACCEPTOFFER');
     101          Result := Tribe[pSender].TPhrase('FRACCEPTOFFER');
    102102      end;
    103103    scDipBreak:
    104104      begin
    105         result := Tribe[pTarget].TPhrase('FRBREAK');
    106         DoIntro := false;
     105        Result := Tribe[pTarget].TPhrase('FRBREAK');
     106        DoIntro := False;
    107107      end;
    108108    scDipOffer:
    109109      begin
    110         result := '';
     110        Result := '';
    111111        if (OppCommand = scDipOffer) and
    112112          ((OppOffer.nDeliver > 0) or (OppOffer.nCost > 0)) and
     
    115115          if (OppOffer.nDeliver + OppOffer.nCost = 1) and
    116116            (OppOffer.Price[0] and opMask = opTreaty) and
    117             (integer(OppOffer.Price[0] - opTreaty) > Treaty) then
     117            (Integer(OppOffer.Price[0] - opTreaty) > Treaty) then
    118118          // simple treaty offer
    119             result := Tribe[pSender].TPhrase('FRNOTACCEPTTREATY') + '\'
     119            Result := Tribe[pSender].TPhrase('FRNOTACCEPTTREATY') + '\'
    120120          else if OppOffer.nDeliver = 0 then
    121             result := Tribe[pSender].TPhrase('FRNOTACCEPTDEMAND_STRONG') + '\'
     121            Result := Tribe[pSender].TPhrase('FRNOTACCEPTDEMAND_STRONG') + '\'
    122122          else if OppOffer.nCost = 0 then
    123             result := Tribe[pSender].TPhrase('FRNOTACCEPTPRESENT') + '\';
     123            Result := Tribe[pSender].TPhrase('FRNOTACCEPTPRESENT') + '\';
    124124        end;
    125125
    126126        sDeliver := '';
    127         for i := 0 to Offer.nDeliver - 1 do
    128         begin
    129           sAdd := PriceToString(pSender, Offer.Price[i]);
    130           if i = 0 then
     127        for I := 0 to Offer.nDeliver - 1 do
     128        begin
     129          sAdd := PriceToString(pSender, Offer.Price[I]);
     130          if I = 0 then
    131131            sDeliver := sAdd
    132132          else
     
    134134        end;
    135135        sCost := '';
    136         for i := 0 to Offer.nCost - 1 do
    137         begin
    138           sAdd := PriceToString(pTarget, Offer.Price[Offer.nDeliver + i]);
    139           if i = 0 then
     136        for I := 0 to Offer.nCost - 1 do
     137        begin
     138          sAdd := PriceToString(pTarget, Offer.Price[Offer.nDeliver + I]);
     139          if I = 0 then
    140140            sCost := sAdd
    141141          else
     
    147147          if (OppCommand = scDipOffer) and
    148148            ((OppOffer.nDeliver = 0) and (OppOffer.nCost = 0)) then
    149             result := Tribe[pTarget].TPhrase('FRBYE')
     149            Result := Tribe[pTarget].TPhrase('FRBYE')
    150150          else
    151151          begin
    152             if (result = '') and (OppCommand = scDipOffer) and
     152            if (Result = '') and (OppCommand = scDipOffer) and
    153153              ((OppOffer.nDeliver > 0) or (OppOffer.nCost > 0)) then
    154154            begin
    155155              if (OppOffer.nDeliver = 1) and (OppOffer.Price[0] = opChoose) and
    156156                not Phrases2FallenBackToEnglish then
    157                 result := Tribe[pSender].TString
     157                Result := Tribe[pSender].TString
    158158                  (Phrases2.Lookup('FRNOTACCEPTANYOFFER')) + ' '
    159159              else if (OppOffer.nCost = 1) and
    160160                (OppOffer.Price[OppOffer.nDeliver] = opChoose) and not Phrases2FallenBackToEnglish
    161161              then
    162                 result := Tribe[pSender].TString
     162                Result := Tribe[pSender].TString
    163163                  (Phrases2.Lookup('FRNOTACCEPTANYWANT')) + ' '
    164164              else
    165                 result := Tribe[pSender].TPhrase('FRNOTACCEPTOFFER') + ' ';
     165                Result := Tribe[pSender].TPhrase('FRNOTACCEPTOFFER') + ' ';
    166166            end;
    167             result := result + Phrases.Lookup('FRDONE');
    168             DoIntro := false
     167            Result := Result + Phrases.Lookup('FRDONE');
     168            DoIntro := False
    169169          end
    170170        end
    171171        else if (Offer.nDeliver + Offer.nCost = 1) and
    172172          (Offer.Price[0] and opMask = opTreaty) and
    173           (integer(Offer.Price[0] - opTreaty) > Treaty) then
     173          (Integer(Offer.Price[0] - opTreaty) > Treaty) then
    174174        // simple treaty offer
    175175        begin
     
    177177            // trCeaseFire: result:=result+Tribe[pTarget].TPhrase('FRCEASEFIRE');
    178178            trPeace:
    179               result := result + Tribe[pTarget].TPhrase('FRPEACE');
     179              Result := Result + Tribe[pTarget].TPhrase('FRPEACE');
    180180            trFriendlyContact:
    181               result := result + Tribe[pTarget].TPhrase('FRFRIENDLY');
     181              Result := Result + Tribe[pTarget].TPhrase('FRFRIENDLY');
    182182            trAlliance:
    183               result := result + Tribe[pTarget].TPhrase('FRALLIANCE');
     183              Result := Result + Tribe[pTarget].TPhrase('FRALLIANCE');
    184184          end
    185185        end
     
    188188          if (Treaty >= trFriendlyContact) and not Phrases2FallenBackToEnglish
    189189          then
    190             result := result +
     190            Result := Result +
    191191              Format(Tribe[pTarget].TString(Phrases2.Lookup('FRDEMAND_SOFT')
    192192              ), [sCost])
    193193          else
    194194          begin
    195             result := result +
     195            Result := Result +
    196196              Format(Tribe[pTarget].TPhrase('FRDEMAND_STRONG'), [sCost]);
    197             DoIntro := false
     197            DoIntro := False
    198198          end
    199199        end
    200200        else if Offer.nCost = 0 then // present
    201           result := result + Format(Tribe[pTarget].TPhrase('FRPRESENT'),
     201          Result := Result + Format(Tribe[pTarget].TPhrase('FRPRESENT'),
    202202            [sDeliver])
    203203        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])
    205205        else if (Offer.nCost = 1) and (Offer.Price[Offer.nDeliver] = opChoose)
    206206        then
    207           result := result + Format(Phrases.Lookup('FRCOSTCHOICE'), [sDeliver])
     207          Result := Result + Format(Phrases.Lookup('FRCOSTCHOICE'), [sDeliver])
    208208        else
    209           result := result + Format(Phrases.Lookup('FROFFER'),
     209          Result := Result + Format(Phrases.Lookup('FROFFER'),
    210210            [sDeliver, sCost]);
    211211      end;
     
    213213  if DoIntro then
    214214    if Treaty < trPeace then
    215       result := Tribe[pSender].TPhrase('FRSTART_NOTREATY') + ' ' + result
     215      Result := Tribe[pSender].TPhrase('FRSTART_NOTREATY') + ' ' + Result
    216216    else
    217       result := Tribe[pSender].TPhrase('FRSTART_PEACE') + ' ' + result
     217      Result := Tribe[pSender].TPhrase('FRSTART_PEACE') + ' ' + Result
    218218end;
    219219
  • branches/highdpi/LocalPlayer/Draft.pas

    r361 r465  
    55
    66uses
    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;
    129
    1310type
     
    2320    procedure CloseBtnClick(Sender: TObject);
    2421    procedure PaintBox1MouseDown(Sender: TObject; Button: TMouseButton;
    25       Shift: TShiftState; x, y: integer);
     22      Shift: TShiftState; X, Y: Integer);
    2623    procedure OKBtnClick(Sender: TObject);
    2724    procedure PaintBox1MouseUp(Sender: TObject; Button: TMouseButton;
    28       Shift: TShiftState; x, y: integer);
     25      Shift: TShiftState; X, Y: Integer);
    2926  public
    30     procedure ShowNewContent(NewMode: integer);
     27    procedure ShowNewContent(NewMode: TWindowMode);
    3128  protected
    3229    procedure OffscreenPaint; override;
    3330  private
    3431    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;
    3734    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
    4439
    4540implementation
    4641
    47 uses Help, Tribes, Directories;
     42uses
     43  Term, Help, Tribes, Directories;
    4844
    4945{$R *.lfm}
     
    109105procedure TDraftDlg.OffscreenPaint;
    110106
    111   function DomainAvailable(d: integer): boolean;
    112   begin
    113     result := (upgrade[d, 0].Preq = preNone) or
    114       (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);
    115111  end;
    116112
    117113  procedure PaintTotalBars;
    118114  var
    119     i, y, dx, num, w: integer;
    120     s: string;
    121   begin
    122     with offscreen.Canvas do
     115    I, Y, dx, num, W: Integer;
     116    S: string;
     117  begin
     118    with Offscreen.Canvas do
    123119    begin
    124120      // 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,
    129125        Phrases.Lookup('UNITSTRENGTH'));
    130       RisedTextOut(offscreen.Canvas, xTotal + 112 + 30, y,
     126      RisedTextOut(Offscreen.Canvas, xTotal + 112 + 30, Y,
    131127        '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) + '/' +
    134130        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);
    137133
    138134      // transport bar
    139135      if MyRO.DevModel.MTrans > 0 then
    140136      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,
    145141          Phrases.Lookup('UNITTRANSPORT'));
    146         RisedTextOut(offscreen.Canvas, xTotal + 112 + 30, y,
     142        RisedTextOut(Offscreen.Canvas, xTotal + 112 + 30, Y,
    147143          'x' + IntToStr(MyRO.DevModel.MTrans));
    148         RisedTextOut(offscreen.Canvas, xTotal2 + 148 + 30, y, '=');
     144        RisedTextOut(Offscreen.Canvas, xTotal2 + 148 + 30, Y, '=');
    149145
    150146        Font.Color := $000000;
    151147        dx := -237 - 30;
    152         for i := mcFirstNonCap - 1 downto 3 do
    153           if i in [mcSeaTrans, mcCarrier, mcAirTrans] then
     148        for I := mcFirstNonCap - 1 downto 3 do
     149          if I in [mcSeaTrans, mcCarrier, mcAirTrans] then
    154150          begin
    155             num := MyRO.DevModel.Cap[i] * MyRO.DevModel.MTrans;
     151            num := MyRO.DevModel.Cap[I] * MyRO.DevModel.MTrans;
    156152            if num > 0 then
    157153            begin
    158               inc(dx, 15);
     154              Inc(dx, 15);
    159155              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));
    162158              Brush.Style := bsClear;
    163               Sprite(offscreen, HGrSystem, xTotal2 - 1 - dx, y + 4, 10, 10,
    164                 66 + i mod 11 * 11, 137 + i div 11 * 11);
     159              Sprite(Offscreen, HGrSystem, xTotal2 - 1 - dx, Y + 4, 10, 10,
     160                66 + I mod 11 * 11, 137 + I div 11 * 11);
    165161              if num > 1 then
    166162              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);
    170166                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));
    173169                Brush.Style := bsClear;
    174                 Textout(xTotal2 - 3 - dx + 1, y, s);
     170                Textout(xTotal2 - 3 - dx + 1, Y, S);
    175171              end;
    176172            end;
    177           end
     173          end;
    178174      end;
    179175
    180176      // 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,
    183179        Phrases.Lookup('UNITSPEED'));
    184       DLine(offscreen.Canvas, xTotal - 2, xTotal + 174, y + 16,
     180      DLine(Offscreen.Canvas, xTotal - 2, xTotal + 174, Y + 16,
    185181        MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    186       DLine(offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, y + 16,
     182      DLine(Offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, Y + 16,
    187183        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);
    191187
    192188      // 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,
    195191        Phrases.Lookup('UNITCOST'));
    196       LoweredTextOut(offscreen.Canvas, -1, MainTexture, xTotal + 112 + 30, y,
     192      LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal + 112 + 30, Y,
    197193        '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,
    201197        MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    202       DLine(offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, y + 16,
     198      DLine(Offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, Y + 16,
    203199        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,
    208204        10, 88, 115);
    209205
    210       if G.Difficulty[me] <> 2 then
     206      if G.Difficulty[Me] <> 2 then
    211207      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,
    218214          MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    219         DLine(offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, y + 16,
     215        DLine(Offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, Y + 16,
    220216          MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    221         s := IntToStr(MyRO.DevModel.Cost * BuildCostMod
    222           [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,
    226222          10, 88, 115);
    227223      end;
     
    230226
    231227var
    232   i, j, x, d, n, TextColor, CapWeight, DomainCount: integer;
     228  I, J, X, D, N, TextColor, CapWeight, DomainCount: Integer;
    233229begin
    234230  inherited;
     
    239235  // assemble background from 2 texture tiles
    240236  begin
    241     DpiBitCanvas(Back.Canvas, 0, 0, ClientWidth, 64,
     237    DpiBitBltCanvas(Back.Canvas, 0, 0, ClientWidth, 64,
    242238      MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2,
    243239      MainTexture.Height - 64);
    244     DpiBitCanvas(Back.Canvas, 0, 64, ClientWidth, ClientHeight - 64,
     240    DpiBitBltCanvas(Back.Canvas, 0, 64, ClientWidth, ClientHeight - 64,
    245241      MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2,
    246242      0);
    247243  end
    248244  else
    249     DpiBitCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight,
     245    DpiBitBltCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight,
    250246      MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2,
    251247      (MainTexture.Height - ClientHeight) div 2);
     
    254250    Template.Height - 64 - Cut);
    255251
    256   DpiBitCanvas(offscreen.Canvas, 0, 0, ClientWidth, ClientHeight,
     252  DpiBitBltCanvas(Offscreen.Canvas, 0, 0, ClientWidth, ClientHeight,
    257253    Back.Canvas, 0, 0);
    258254
    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]);
    262258
    263259  with MyRO.DevModel do
    264260  begin
    265261    DomainCount := 0;
    266     for d := 0 to nDomains - 1 do
    267       if DomainAvailable(d) then
    268         inc(DomainCount);
     262    for D := 0 to nDomains - 1 do
     263      if DomainAvailable(D) then
     264        Inc(DomainCount);
    269265    if DomainCount > 1 then
    270266    begin
    271       for d := 0 to nDomains - 1 do
    272         if DomainAvailable(d) then
     267      for D := 0 to nDomains - 1 do
     268        if DomainAvailable(D) then
    273269        begin
    274           x := xDomain + d * DomainPitch;
    275           if d = Domain then
    276             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,
    277273              36, 0, $00C0FF)
    278274          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,
    280276              36, 0, $606060);
    281277        end;
    282       Frame(offscreen.Canvas, xDomain - 11, yDomain - 3,
     278      Frame(Offscreen.Canvas, xDomain - 11, yDomain - 3,
    283279        xDomain + 2 * DomainPitch + 46, yDomain + 38, $B0B0B0, $FFFFFF);
    284       RFrame(offscreen.Canvas, xDomain - 12, yDomain - 4,
     280      RFrame(Offscreen.Canvas, xDomain - 12, yDomain - 4,
    285281        xDomain + 2 * DomainPitch + 47, yDomain + 39, $FFFFFF, $B0B0B0);
    286282    end;
     
    295291
    296292    // display weight
    297     with offscreen.Canvas do
    298     begin
    299       for i := 0 to MaxWeight - 1 do
    300         if i < Weight then
    301           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),
    302298            WeightOn.BoundsRect, 0, $949494)
    303299        else
    304           ImageOp_BCC(offscreen, Templates.Data, Point(xWeight + 20 * i, yWeight),
     300          ImageOp_BCC(Offscreen, Templates.Data, Point(xWeight + 20 * I, yWeight),
    305301            WeightOff.BoundsRect, 0, $949494);
    306302    end;
    307303
    308     with offscreen.Canvas do
    309       for i := 0 to Lines - 1 do
     304    with Offscreen.Canvas do
     305      for I := 0 to Lines - 1 do
    310306      begin
    311         if not(code[i] in AutoFeature) then
     307        if not(Code[I] in AutoFeature) then
    312308        begin
    313309          // paint +/- butttons
    314           if code[i] < mcFirstNonCap then
     310          if Code[I] < mcFirstNonCap then
    315311          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,
    323319              MainTexture.ColorBevelLight);
    324320          end
    325321          else
    326322          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,
    332328              MainTexture.ColorBevelLight);
    333329          end;
    334330
    335331          // paint cost
    336           LightGradient(offscreen.Canvas, xFeature + 34,
    337             yFeature + LinePitch * i, 50, HGrSystem.Data.Canvas.Pixels
     332          LightGradient(Offscreen.Canvas, xFeature + 34,
     333            yFeature + LinePitch * I, 50, HGrSystem.Data.Canvas.Pixels
    338334            [187, 137]);
    339           if (Domain = dGround) and (code[i] = mcDefense) then
     335          if (Domain = dGround) and (Code[I] = mcDefense) then
    340336            CapWeight := 2
    341337          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 do
    346             dec(d);
    347           for j := 0 to n - 1 do
    348             if j < CapWeight then
    349               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)
    351347            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);
    354350        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,
    359355          $C0C0C0, $C0C0C0);
    360         Sprite(offscreen, HGrSystem, xFeature + 20, yFeature + 2 + 1 + LinePitch
    361           * i, 10, 10, 66 + code[i] mod 11 * 11, 137 + code[i] div 11 * 11);
    362 
    363         if MyRO.DevModel.Cap[code[i]] > 0 then
     356        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
    364360          TextColor := MainTexture.ColorLitText
    365361        else
    366362          TextColor := -1;
    367363
    368         if code[i] < mcFirstNonCap then
    369           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]));
    373369      end;
    374370  end;
    375371
    376372  // free features
    377   j := 0;
    378   for i := 0 to nFeature - 1 do
    379     if (i in AutoFeature) and (1 shl Domain and Feature[i].Domains <> 0) and
    380       (Feature[i].Preq <> preNA) and
    381       ((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) and
     373  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
    384380      (MyRO.Tech[adNuclearPower] >= tsApplicable)) then
    385381    begin
    386       DarkGradient(offscreen.Canvas, xWeight + 4, yWeight + 32 + LinePitch
    387         * 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 + i div 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] do
    398   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,
    400396      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,
    402398      pix div 10 * 49 + 1);
    403399  end;
    404400  MarkUsedOffscreen(ClientWidth, ClientHeight);
    405 end; { MainPaint }
    406 
    407 procedure TDraftDlg.SetDomain(d: integer);
    408 
    409   function Prio(fix: integer): integer;
     401end;
     402
     403procedure TDraftDlg.SetDomain(D: Integer);
     404
     405  function Prio(fix: Integer): Integer;
    410406  var
    411     FeaturePreq: integer;
     407    FeaturePreq: Integer;
    412408  begin
    413409    FeaturePreq := Feature[fix].Preq;
    414     assert(FeaturePreq <> preNA);
     410    Assert(FeaturePreq <> preNA);
    415411    if fix < mcFirstNonCap then
    416       result := 10000 + fix
     412      Result := 10000 + fix
    417413    else if FeaturePreq = preNone then
    418       result := 20000
     414      Result := 20000
    419415    else if FeaturePreq < 0 then
    420       result := 40000
     416      Result := 40000
    421417    else
    422       result := 30000 + AdvValue[FeaturePreq];
     418      Result := 30000 + AdvValue[FeaturePreq];
    423419    if not(fix in AutoFeature) then
    424       inc(result, 90000);
     420      Inc(Result, 90000);
    425421  end;
    426422
    427423var
    428   i, j, x: integer;
    429 begin
    430   Domain := d;
     424  I, J, X: Integer;
     425begin
     426  Domain := D;
    431427  Lines := 0;
    432   for i := 0 to nFeature - 1 do
    433     if IsFeatureInList(Domain, i) then
    434     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);
    437433    end;
    438434  yFeature := yFeature0 + (MaxLines - Lines) * LinePitch div 2;
    439435
    440436  // sort features
    441   for i := 0 to Lines - 2 do
    442     for j := i + 1 to Lines - 1 do
    443       if Prio(code[i]) > Prio(code[j]) then
     437  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
    444440      begin // exchange
    445         x := code[i];
    446         code[i] := code[j];
    447         code[j] := x
     441        X := Code[I];
     442        Code[I] := Code[J];
     443        Code[J] := X;
    448444      end;
    449445end;
    450446
    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) and
    454     (Feature[i].Preq <> preNA) and
    455     ((Feature[i].Preq = preNone) or (Feature[i].Preq = preSun) and
    456     (MyRO.Wonder[woSun].EffectiveOwner = me) or (Feature[i].Preq >= 0) and
    457     (MyRO.Tech[Feature[i].Preq] >= tsApplicable));
     447function TDraftDlg.IsFeatureInList(D, I: Integer): Boolean;
     448begin
     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));
    458454end;
    459455
    460456procedure TDraftDlg.FormShow(Sender: TObject);
    461457var
    462   count, d, i: integer;
     458  count, D, I: Integer;
    463459begin
    464460  Domain := dGround;
    465461  while (Domain < dAir) and (upgrade[Domain, 0].Preq <> preNone) and
    466462    (MyRO.Tech[upgrade[Domain, 0].Preq] < tsApplicable) do
    467     inc(Domain);
     463    Inc(Domain);
    468464
    469465  // count max number of features in any domain
    470466  MaxLines := 0;
    471   for d := 0 to nDomains - 1 do
    472     if (upgrade[d, 0].Preq = preNone) or
    473       (MyRO.Tech[upgrade[d, 0].Preq] >= tsApplicable) then
     467  for D := 0 to nDomains - 1 do
     468    if (upgrade[D, 0].Preq = preNone) or
     469      (MyRO.Tech[upgrade[D, 0].Preq] >= tsApplicable) then
    474470    begin
    475471      count := 0;
    476       for i := 0 to nFeature - 1 do
    477         if IsFeatureInList(d, i) then
    478           inc(count);
     472      for I := 0 to nFeature - 1 do
     473        if IsFeatureInList(D, I) then
     474          Inc(count);
    479475      if count > MaxLines then
    480476        MaxLines := count;
     
    494490
    495491  SetDomain(Domain);
    496   Server(sCreateDevModel, me, Domain, nil^);
     492  Server(sCreateDevModel, Me, Domain, nil^);
    497493  MyModel[MyRO.nModel] := MyRO.DevModel;
    498   InitMyModel(MyRO.nModel, false);
     494  InitMyModel(MyRO.nModel, False);
    499495  OffscreenPaint;
    500496  IncCap := -1;
     
    502498end;
    503499
    504 procedure TDraftDlg.ShowNewContent(NewMode: integer);
     500procedure TDraftDlg.ShowNewContent(NewMode: TWindowMode);
    505501begin
    506502  inherited ShowNewContent(NewMode);
     
    508504
    509505procedure TDraftDlg.PaintBox1MouseDown(Sender: TObject; Button: TMouseButton;
    510   Shift: TShiftState; x, y: integer);
     506  Shift: TShiftState; X, Y: Integer);
    511507var
    512   i, d: integer;
     508  I, D: Integer;
    513509begin
    514510  if Button = mbLeft then
    515511  begin
    516     for d := 0 to nDomains - 1 do
    517       if (d <> Domain) and ((upgrade[d, 0].Preq = preNone) or
    518         (MyRO.Tech[upgrade[d, 0].Preq] >= tsApplicable)) and
    519         (x >= xDomain + d * DomainPitch) and
    520         (x < xDomain + d * DomainPitch + 36) and (y >= yDomain) and
    521         (y < yDomain + 36) then
     512    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
    522518      begin
    523         SetDomain(d);
    524         Server(sCreateDevModel, me, Domain, nil^);
     519        SetDomain(D);
     520        Server(sCreateDevModel, Me, Domain, nil^);
    525521        MyModel[MyRO.nModel] := MyRO.DevModel;
    526         InitMyModel(MyRO.nModel, false);
     522        InitMyModel(MyRO.nModel, False);
    527523        SmartUpdateContent;
    528524      end;
    529525
    530     if (y >= yFeature) and (y < yFeature + LinePitch * Lines) then
    531     begin
    532       i := (y - yFeature) div LinePitch;
    533       if (x >= xFeature - 21) and (x < ClientWidth) and (ssShift in Shift) then
    534         HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkFeature, code[i])
    535       else if not(code[i] in AutoFeature) then
     526    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
    536532      begin
    537         if (code[i] < mcFirstNonCap) and (x >= xFeature - 21) and
    538           (x < xFeature - 21 + 12) then
     533        if (Code[I] < mcFirstNonCap) and (X >= xFeature - 21) and
     534          (X < xFeature - 21 + 12) then
    539535        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);
    543539          SmartInvalidate;
    544540        end
    545         else if (x >= xFeature - 9) and (x < xFeature - 9 + 12) then
     541        else if (X >= xFeature - 9) and (X < xFeature - 9 + 12) then
    546542        begin
    547           DecCap := code[i];
    548           if code[i] < mcFirstNonCap then
    549             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)
    551547          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]]);
    554550          SmartInvalidate;
    555551        end;
    556       end
    557     end
    558   end
     552      end;
     553    end;
     554  end;
    559555end;
    560556
    561557procedure TDraftDlg.PaintBox1MouseUp(Sender: TObject; Button: TMouseButton;
    562   Shift: TShiftState; x, y: integer);
     558  Shift: TShiftState; X, Y: Integer);
    563559var
    564   NewValue: integer;
     560  NewValue: Integer;
    565561begin
    566562  if IncCap >= 0 then
    567563  begin
    568564    NewValue := MyRO.DevModel.Cap[IncCap] + 1;
    569     Server(sSetDevModelCap + NewValue shl 4, me, IncCap, nil^);
     565    Server(sSetDevModelCap + NewValue shl 4, Me, IncCap, nil^);
    570566    MyModel[MyRO.nModel] := MyRO.DevModel;
    571     InitMyModel(MyRO.nModel, false);
     567    InitMyModel(MyRO.nModel, False);
    572568    SmartUpdateContent;
    573569    IncCap := -1;
     
    580576      if DecCap >= mcFirstNonCap then
    581577        NewValue := -NewValue;
    582       Server(sSetDevModelCap + NewValue shl 4, me, DecCap, nil^);
     578      Server(sSetDevModelCap + NewValue shl 4, Me, DecCap, nil^);
    583579      MyModel[MyRO.nModel] := MyRO.DevModel;
    584       InitMyModel(MyRO.nModel, false);
     580      InitMyModel(MyRO.nModel, False);
    585581    end;
    586582    SmartUpdateContent;
  • branches/highdpi/LocalPlayer/Enhance.pas

    r361 r465  
    55
    66uses
    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;
    119
    1210type
     
    3937    NoMap: TIsoMap;
    4038  public
    41     procedure ShowNewContent(NewMode: integer; TerrType: integer = -1);
     39    procedure ShowNewContent(NewMode: TWindowMode; TerrType: Integer = -1);
    4240  protected
    43     Page: integer;
     41    Page: Integer;
    4442    procedure OffscreenPaint; override;
    4543  end;
    4644
    47 var
    48   EnhanceDlg: TEnhanceDlg;
    49 
    5045
    5146implementation
    5247
    5348uses
    54   Help, UKeyBindings;
     49  Help, KeyBindings, Term;
    5550
    5651{$R *.lfm}
     
    5853procedure TEnhanceDlg.FormCreate(Sender: TObject);
    5954var
    60   TerrType: integer;
    61   m: TDpiMenuItem;
     55  TerrType: Integer;
     56  M: TDpiMenuItem;
    6257begin
    6358  inherited;
     
    7368    if TerrType <> fJungle then
    7469    begin
    75       m := TDpiMenuItem.Create(Popup);
    76       m.RadioItem := true;
     70      M := TDpiMenuItem.Create(Popup);
     71      M.RadioItem := True;
    7772      if TerrType = fGrass then
    78         m.Caption := Format(Phrases.Lookup('TWOTERRAINS'),
     73        M.Caption := Format(Phrases.Lookup('TWOTERRAINS'),
    7974          [Phrases.Lookup('TERRAIN', fGrass), Phrases.Lookup('TERRAIN',
    8075          fGrass + 12)])
    8176      else if TerrType = fForest then
    82         m.Caption := Format(Phrases.Lookup('TWOTERRAINS'),
     77        M.Caption := Format(Phrases.Lookup('TWOTERRAINS'),
    8378          [Phrases.Lookup('TERRAIN', fForest), Phrases.Lookup('TERRAIN',
    8479          fJungle)])
    8580      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);
    9085    end;
    9186end;
     
    9893procedure TEnhanceDlg.FormPaint(Sender: TObject);
    9994var
    100   i: integer;
     95  I: Integer;
    10196begin
    10297  inherited;
     
    105100  BtnFrame(Canvas, Rect(job3.Left, job3.Top, job9.Left + job9.Width,
    106101    job3.Top + job3.Height), MainTexture);
    107   for i := 0 to ControlCount - 1 do
    108     if Controls[i] is TButtonC then
    109       DpiBitCanvas(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);
    112107end;
    113108
     
    117112end;
    118113
    119 procedure TEnhanceDlg.ShowNewContent(NewMode, TerrType: integer);
     114procedure TEnhanceDlg.ShowNewContent(NewMode: TWindowMode; TerrType: Integer);
    120115begin
    121116  if (TerrType < fGrass) or (TerrType > fMountains) then
     
    128123procedure TEnhanceDlg.OffscreenPaint;
    129124var
    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;
    134129begin
    135130  OffscreenUser := self;
    136   offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
     131  Offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
    137132  FillOffscreen(0, 0, InnerWidth, InnerHeight);
    138133
    139134  EndStage := 0;
    140135  while (EndStage < 5) and (MyData.EnhancementJobs[Page, EndStage] <> jNone) do
    141     inc(EndStage);
     136    Inc(EndStage);
    142137  with NoMap do
    143     x := InnerWidth div 2 - xxt - (xxt + 3) * EndStage;
     138    X := InnerWidth div 2 - xxt - (xxt + 3) * EndStage;
    144139
    145140  TerrType := Page;
     
    151146    if stage > 0 then
    152147    begin
    153       Sprite(offscreen, HGrSystem, x - 10, 66, 14, 14, 80, 1);
     148      Sprite(Offscreen, HGrSystem, X - 10, 66, 14, 14, 80, 1);
    154149      case MyData.EnhancementJobs[Page, stage - 1] of
    155150        jRoad:
    156151          begin
    157             inc(Cost, Terrain[TerrType].MoveCost * RoadWork);
     152            Inc(Cost, Terrain[TerrType].MoveCost * RoadWork);
    158153            TileImp := TileImp or fRoad;
    159154          end;
    160155        jRR:
    161156          begin
    162             inc(Cost, Terrain[TerrType].MoveCost * RRWork);
     157            Inc(Cost, Terrain[TerrType].MoveCost * RRWork);
    163158            TileImp := TileImp or fRR;
    164159          end;
    165160        jIrr:
    166161          begin
    167             inc(Cost, Terrain[TerrType].IrrClearWork);
     162            Inc(Cost, Terrain[TerrType].IrrClearWork);
    168163            TileImp := TileImp and not fTerImp or tiIrrigation;
    169164          end;
    170165        jFarm:
    171166          begin
    172             inc(Cost, Terrain[TerrType].IrrClearWork * FarmWork);
     167            Inc(Cost, Terrain[TerrType].IrrClearWork * FarmWork);
    173168            TileImp := TileImp and not fTerImp or tiFarm;
    174169          end;
    175170        jMine:
    176171          begin
    177             inc(Cost, Terrain[TerrType].MineAfforestWork);
     172            Inc(Cost, Terrain[TerrType].MineAfforestWork);
    178173            TileImp := TileImp and not fTerImp or tiMine;
    179174          end;
    180175        jClear:
    181176          begin
    182             inc(Cost, Terrain[TerrType].IrrClearWork);
     177            Inc(Cost, Terrain[TerrType].IrrClearWork);
    183178            TerrType := Terrain[TerrType].ClearTerrain;
    184179          end;
    185180        jAfforest:
    186181          begin
    187             inc(Cost, Terrain[TerrType].MineAfforestWork);
     182            Inc(Cost, Terrain[TerrType].MineAfforestWork);
    188183            TerrType := Terrain[TerrType].AfforestTerrain;
    189184          end;
    190185        jTrans:
    191186          begin
    192             inc(Cost, Terrain[TerrType].TransWork);
     187            Inc(Cost, Terrain[TerrType].TransWork);
    193188            TerrType := Terrain[TerrType].TransTerrain;
    194189          end;
    195190      end;
    196       include(Done, MyData.EnhancementJobs[Page, stage - 1]);
     191      Include(Done, MyData.EnhancementJobs[Page, stage - 1]);
    197192    end;
    198193
    199194    with NoMap do begin
    200195      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,
    202197          1 + TerrType * (xxt * 2 + 1), 1 + yyt)
    203198      else
    204199      begin
    205         Sprite(offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2,
     200        Sprite(Offscreen, HGrTerrain, X, 64 - yyt, xxt * 2, yyt * 2,
    206201          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,
    208203          1 + 7 * (xxt * 2 + 1), 1 + yyt + 2 * (2 + TerrType - fForest) *
    209204          (yyt * 3 + 1));
    210205      end;
    211206      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,
    213208          1 + (xxt * 2 + 1), 1 + yyt + 12 * (yyt * 3 + 1))
    214209      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,
    216211          1 + yyt + 12 * (yyt * 3 + 1));
    217212      if TileImp and fRR <> 0 then
    218213      begin
    219         Sprite(offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2,
     214        Sprite(Offscreen, HGrTerrain, X, 64 - yyt, xxt * 2, yyt * 2,
    220215          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,
    222217          1 + 2 * (xxt * 2 + 1), 1 + yyt + 10 * (yyt * 3 + 1));
    223218      end
    224219      else if TileImp and fRoad <> 0 then
    225220      begin
    226         Sprite(offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2,
     221        Sprite(Offscreen, HGrTerrain, X, 64 - yyt, xxt * 2, yyt * 2,
    227222          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,
    229224          1 + 2 * (xxt * 2 + 1), 1 + yyt + 9 * (yyt * 3 + 1));
    230225      end;
    231226      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,
    233228          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 do
    239     if Popup.Items[i].Tag = Page then
    240       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;
    241236  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);
    245240
    246241  if EndStage > 0 then
     
    291286    (Terrain[TerrType].MineEff > 0);
    292287  job3.Visible := not TypeChanged and (Terrain[TerrType].ClearTerrain >= 0) and
    293     ((TerrType <> fDesert) or (MyRO.Wonder[woGardens].EffectiveOwner = me)) or
     288    ((TerrType <> fDesert) or (MyRO.Wonder[woGardens].EffectiveOwner = Me)) or
    294289    (LastJob = jClear);
    295290  job6.Visible := not TypeChanged and (Terrain[TerrType].AfforestTerrain >= 0)
     
    299294
    300295  MarkUsedOffscreen(InnerWidth, InnerHeight);
    301 end; { OffscreenPaint }
     296end;
    302297
    303298procedure TEnhanceDlg.CloseBtnClick(Sender: TObject);
     
    308303procedure TEnhanceDlg.ToggleBtnClick(Sender: TObject);
    309304var
    310   i: integer;
    311 begin
    312   for i := 0 to Popup.Items.Count - 1 do
    313     Popup.Items[i].Checked := Popup.Items[i].Tag = Page;
     305  I: Integer;
     306begin
     307  for I := 0 to Popup.Items.Count - 1 do
     308    Popup.Items[I].Checked := Popup.Items[I].Tag = Page;
    314309  Popup.Popup(Left + ToggleBtn.Left, Top + ToggleBtn.Top + ToggleBtn.Height);
    315310end;
     
    323318procedure TEnhanceDlg.JobClick(Sender: TObject);
    324319var
    325   stage, NewJob: integer;
     320  Stage, NewJob: Integer;
    326321  Done: Set of jNone .. jTrans;
    327322
    328   procedure RemoveJob(j: integer);
     323  procedure RemoveJob(J: Integer);
    329324  begin // remove job
    330     stage := 0;
    331     while (stage < 5) and (MyData.EnhancementJobs[Page, stage] <> jNone) do
    332     begin
    333       if (MyData.EnhancementJobs[Page, stage] = j) or (j = jRoad) and
    334         (MyData.EnhancementJobs[Page, stage] = jRR) or (j = jIrr) and
    335         (MyData.EnhancementJobs[Page, stage] = jFarm) then
     325    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
    336331      begin
    337         if stage < 4 then
    338           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);
    340335        MyData.EnhancementJobs[Page, 4] := jNone;
    341336      end
    342337      else
    343         inc(stage);
     338        Inc(Stage);
    344339    end;
    345340  end;
     
    348343  NewJob := TButtonC(Sender).Tag;
    349344  Done := [];
    350   stage := 0;
    351   while (stage < 5) and (MyData.EnhancementJobs[Page, stage] <> jNone) do
     345  Stage := 0;
     346  while (Stage < 5) and (MyData.EnhancementJobs[Page, Stage] <> jNone) do
    352347  begin
    353     include(Done, MyData.EnhancementJobs[Page, stage]);
    354     inc(stage);
     348    Include(Done, MyData.EnhancementJobs[Page, Stage]);
     349    Inc(Stage);
    355350  end;
    356351  if NewJob in Done then
     
    364359    if (NewJob = jRR) and not(jRoad in Done) then
    365360    begin
    366       MyData.EnhancementJobs[Page, stage] := jRoad;
    367       inc(stage);
     361      MyData.EnhancementJobs[Page, Stage] := jRoad;
     362      Inc(Stage);
    368363    end;
    369364    if (NewJob = jFarm) and not(jIrr in Done) then
    370365    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;
    375370  end;
    376371  SmartUpdateContent;
     
    384379  ShortCut := KeyToShortCut(Key, Shift);
    385380  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'))
    388383end;
    389384
  • branches/highdpi/LocalPlayer/Help.pas

    r412 r465  
    77  UDpiControls, Protocol, ScreenTools, BaseWin, StringTables, Math, LCLIntf, LCLType,
    88  Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
    9   ButtonB, PVSB, Types, fgl, IsoEngine;
     9  ButtonB, PVSB, Types, Generics.Collections, IsoEngine;
    1010
    1111const
    1212  MaxHist = 16;
    1313
    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
    3615
    3716type
     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);
    3864
    3965  { THyperText }
     
    4167  THyperText = class(TStringList)
    4268  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);
    4571    procedure LineFeed;
    4672    procedure AppendList(Source: THyperText);
    47     destructor Destroy; override;
    4873  end;
    4974
     
    5176
    5277  THistItem = class
    53     Kind: Integer;
     78    Kind: TLinkCategory;
    5479    No: Integer;
    5580    Pos: Integer;
     
    6085  { THistItems }
    6186
    62   THistItems = class(TFPGObjectList<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;
    6489  end;
    6590
     
    78103    procedure CloseBtnClick(Sender: TObject);
    79104    procedure PaintBox1MouseMove(Sender: TObject; Shift: TShiftState;
    80       x, y: integer);
     105      X, Y: Integer);
    81106    procedure PaintBox1MouseDown(Sender: TObject; Button: TMouseButton;
    82       Shift: TShiftState; x, y: integer);
     107      Shift: TShiftState; X, Y: Integer);
    83108    procedure BackBtnClick(Sender: TObject);
    84109    procedure TopBtnClick(Sender: TObject);
     
    89114    procedure OffscreenPaint; override;
    90115  private
    91     Kind: Integer;
    92     no: Integer;
     116    Kind: TLinkCategory;
     117    No: Integer;
    93118    Sel: Integer;
    94119    CaptionColor: Integer;
     
    100125    SearchResult: THyperText;
    101126    HelpText: TStringTable;
    102     ExtPic, TerrIcon: TDpiBitmap;
     127    ExtPic: TDpiBitmap;
     128    TerrIcon: TDpiBitmap;
    103129    ScrollBar: TPVScrollbar;
    104130    NoMap: TIsoMap;
    105131    x0: array [-2..180] of Integer;
    106     procedure PaintTerrIcon(x, y, xSrc, ySrc: Integer);
     132    procedure PaintTerrIcon(X, Y, xSrc, ySrc: Integer);
    107133    procedure ScrollBarUpdate(Sender: TObject);
    108     procedure Line(ca: TDpiCanvas; i: Integer; lit: Boolean);
     134    procedure Line(ACanvas: TDpiCanvas; I: Integer; Lit: Boolean);
    109135    procedure Prepare(sbPos: Integer = 0);
    110     procedure ShowNewContentProcExecute(NewMode: Integer; HelpContext: string);
     136    procedure ShowNewContentProcExecute(NewMode: TWindowMode; HelpContext: string);
    111137    procedure WaterSign(x0, y0, iix: Integer);
    112138    procedure Search(SearchString: string);
     
    117143    Difficulty: Integer;
    118144    procedure ClearHistory;
    119     procedure ShowNewContent(NewMode, Category, Index: Integer);
     145    procedure ShowNewContent(NewMode: TWindowMode; Category: TLinkCategory; Index: Integer);
    120146    function TextIndex(Item: string): Integer;
    121147  end;
    122148
    123 var
    124   HelpDlg: THelpDlg;
    125 
    126149
    127150implementation
    128151
    129152uses
    130   Directories, ClientTools, Term, Tribes, Inp, Messg, UPixelPointer, Global,
    131   UKeyBindings;
     153  Directories, ClientTools, Term, Tribes, Inp, Messg, PixelPointer, Global,
     154  KeyBindings;
    132155
    133156{$R *.lfm}
     
    138161
    139162  THelpLineInfo = class
    140     Format: Byte;
     163    Format: TTextFormat;
    141164    Picpix: Byte;
    142     Link: Word;
     165    Category: TLinkCategory;
     166    Index: Integer;
     167    CrossLink: Boolean;
    143168    procedure Assign(Source: THelpLineInfo);
    144169  end;
    145170
    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;
    213177
    214178const
    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;
    250180    SeeNo: mcArtillery), (Kind: hkImp; no: imHydro; SeeKind: hkImp;
    251181    SeeNo: woHoover), (Kind: hkImp; no: imWalls; SeeKind: hkImp;
     
    262192    SeeKind: hkFeature; SeeNo: mcDefense));
    263193
    264   nTerrainHelp = 14;
    265   TerrainHelp: array [0 .. nTerrainHelp - 1] of integer = (fGrass, fGrass + 12,
     194  TerrainHelp: array[0..13] of Integer = (fGrass, fGrass + 12,
    266195    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,
    271199    jFarm, jMine, jFort, jBase);
    272200
     201{ THelpLineInfo }
     202
     203procedure THelpLineInfo.Assign(Source: THelpLineInfo);
     204begin
     205  Format := Source.Format;
     206  PicPix := Source.PicPix;
     207  Category := Source.Category;
     208  Index := Source.Index;
     209end;
     210
     211{ THistItem }
     212
     213procedure THistItem.Assign(Source: THistItem);
     214begin
     215  Kind := Source.Kind;
     216  No := Source.No;
     217  Pos := Source.Pos;
     218  SearchContent := Source.SearchContent;
     219end;
     220
     221{ THistItems }
     222
     223function THistItems.AddNew(Kind: TLinkCategory; No, Pos: Integer; SearchContent: string
     224  ): THistItem;
     225begin
     226  Result := THistItem.Create;
     227  Result.Kind := Kind;
     228  Result.No := No;
     229  Result.Pos := Pos;
     230  Result.SearchContent := SearchContent;
     231  Add(Result);
     232end;
     233
     234procedure THyperText.AddLine(S: String; Format: TTextFormat; Picpix: Integer;
     235  LinkCategory: TLinkCategory = hkNoLink; LinkIndex: Integer = 0;
     236  CrossLink: Boolean = False);
     237var
     238  HelpLineInfo: THelpLineInfo;
     239begin
     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);
     247end;
     248
     249procedure THyperText.LineFeed;
     250begin
     251  AddLine;
     252end;
     253
     254procedure THyperText.AppendList(Source: THyperText);
     255var
     256  I: Integer;
     257  HelpLineInfo: THelpLineInfo;
     258begin
     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;
     264end;
     265
    273266procedure THelpDlg.FormCreate(Sender: TObject);
    274267begin
    275   inherited;
    276268  NoMap := TIsoMap.Create;
    277269
     
    280272  CaptionLeft := BackBtn.Left + BackBtn.Width;
    281273  CaptionRight := SearchBtn.Left;
    282   inc(ModalFrameIndent, 29);
     274  Inc(ModalFrameIndent, 29);
    283275  MainText := THyperText.Create;
    284276  MainText.OwnsObjects := True;
     
    290282
    291283  HelpText := TStringTable.Create;
    292   HelpText.LoadFromFile(LocalizedFilePath('Help' + DirectorySeparator + 'help.txt'));
     284  HelpText.LoadFromFile(LocalizedFilePath('Help' + DirectorySeparator + 'Help.txt'));
    293285  hADVHELP := HelpText.Gethandle('ADVHELP');
    294286  hIMPHELP := HelpText.Gethandle('IMPHELP');
     
    316308end;
    317309
    318 procedure THelpDlg.ShowNewContentProcExecute(NewMode: Integer;
     310procedure THelpDlg.ShowNewContentProcExecute(NewMode: TWindowMode;
    319311  HelpContext: string);
    320312begin
    321   HelpDlg.ShowNewContent(NewMode, hkText,
    322     HelpDlg.TextIndex(HelpContext))
     313  ShowNewContent(NewMode, hkText, TextIndex(HelpContext));
    323314end;
    324315
     
    356347  if ScrollBar.Process(Msg) then begin
    357348    Sel := -1;
    358     SmartUpdateContent(true)
     349    SmartUpdateContent(True)
    359350  end;
    360351  }
     
    364355begin
    365356  if Sel <> -1 then begin
    366     Line(Canvas, Sel, false);
    367     Sel := -1
     357    Line(Canvas, Sel, False);
     358    Sel := -1;
    368359  end;
    369360end;
     
    380371end;
    381372
    382 procedure THelpDlg.Line(ca: TDpiCanvas; i: Integer; lit: Boolean);
     373procedure THelpDlg.Line(ACanvas: TDpiCanvas; I: Integer; Lit: Boolean);
    383374var
    384   TextColor, x, y: Integer;
     375  TextColor: TColor;
     376  X, Y: Integer;
    385377  TextSize: TSize;
    386   s: string;
    387 begin
    388   s := MainText[ScrollBar.Position + i];
    389   if s = '' then
     378  S: string;
     379begin
     380  S := MainText[ScrollBar.Position + I];
     381  if S = '' then
    390382    Exit;
    391   x := x0[i];
    392   y := 2 + i * 24;
    393   if ca = Canvas then
    394   begin
    395     x := x + SideFrame;
    396     y := y + WideFrame
    397   end;
    398   if THelpLineInfo(MainText.Objects[ScrollBar.Position + i]).Format
     383  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
    399391    in [pkCaption, pkBigTer, pkRightIcon, pkBigFeature] then
    400392  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     DpiBitCanvas(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,
    408400      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]);
    413405  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]);
    420411  end
    421412  else
    422413  begin
    423     if (Kind = hkMisc) and (no = miscMain) then
    424       ca.Font.Assign(CaptionFont);
     414    if (Kind = hkMisc) and (No = Integer(miscMain)) then
     415      ACanvas.Font.Assign(CaptionFont);
    425416    TextColor := Colors.Canvas.Pixels[clkMisc, cliPaperText];
    426     if ca = Canvas then
     417    if ACanvas = Canvas then
    427418    begin
    428       TextSize.cx := BiColorTextWidth(ca, s);
    429       TextSize.cy := ca.TextHeight(s);
    430       if y + TextSize.cy >= WideFrame + InnerHeight then
    431         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,
    433424        ScrollBar.Position * 24 - WideFrame, Paper);
    434425    end;
    435     BiColorTextOut(ca, TextColor, $7F007F, x, y, s);
     426    BiColorTextOut(ACanvas, TextColor, $7F007F, X, Y, S);
    436427    if lit then
    437       with ca do
     428      with ACanvas do
    438429      begin
    439         Assert(ca = Canvas);
     430        Assert(ACanvas = Canvas);
    440431        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);
    443434      end;
    444     if (Kind = hkMisc) and (no = miscMain) then
    445       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;
     438end;
     439
     440procedure THelpDlg.WaterSign(x0, y0, iix: Integer);
    450441const
    451442  nHeaven = 28;
    452443  MaxSum = 9 * 9 * 255 * 75 div 100;
    453444var
    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;
    456447  PaintPtr: TPixelPointer;
    457448  CoalPtr: TPixelPointer;
     
    467458  xSrc := iix mod 7 * xSizeBig;
    468459  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));
    471462  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 begin
    474     if ((ScaleToNative(y0) + y) >= 0) and ((ScaleToNative(y0) + y) < ScaleToNative(InnerHeight)) then begin
     463    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
    475466      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)) then
    477           ImpPtr[dy].SetXY(0, Max(y + ScaleToNative(dy), 0) shr 1);
    478       for x := 0 to ScaleToNative(xSizeBig * 2) - 1 do begin
     467        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
    479470        Sum := 0;
    480471        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;
    482473          for dy := -1 to 1 do begin
    483474            ImpPtr[dy].SetX(xx);
    484             if ((y + ScaleToNative(dy)) shr 1 < 0) or ((y + ScaleToNative(dy)) shr 1 >= ScaleToNative(ySizeBig)) or
    485               ((x + ScaleToNative(dx)) shr 1 < 0) or ((x + ScaleToNative(dx)) shr 1 >= ScaleToNative(xSizeBig)) or
    486               ((y + ScaleToNative(dy)) shr 1 < ScaleToNative(nHeaven)) and
     475            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
    487478              (ImpPtr[dy].Pixel^.B shl 16 + ImpPtr[dy].Pixel^.G shl 8 +
    488               ImpPtr[dy].Pixel^.R = Heaven[(ScaleFromNative(y + ScaleToNative(dy))) shr 1]) then
     479              ImpPtr[dy].Pixel^.R = Heaven[(ScaleFromNative(Y + ScaleToNative(dy))) shr 1]) then
    489480              Sum := Sum + 9 * 255
    490481            else
     
    493484          end;
    494485        end;
    495         if Sum < MaxSum then begin // no saturation
     486        if Sum < MaxSum then begin // No saturation
    496487          Sum := 1 shl 22 - (MaxSum - Sum) * (256 - CoalPtr.Pixel^.B * 2);
    497488          PaintPtr.Pixel^.B := Min(PaintPtr.Pixel^.B * Sum shr 22, 255);
     
    510501end;
    511502
    512 procedure THelpDlg.PaintTerrIcon(x, y, xSrc, ySrc: integer);
     503procedure THelpDlg.PaintTerrIcon(X, Y, xSrc, ySrc: Integer);
    513504begin
    514505  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,
    516507      $000000, $000000);
    517508    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,
    520511        xSrc, ySrc);
    521512    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,
    527518      xSrc, ySrc);
    528519  end;
     
    531522procedure THelpDlg.OffscreenPaint;
    532523var
    533   i, j, yl, srcno, ofs, cnt, y: Integer;
    534   s: string;
     524  I, J, yl, srcno, ofs, cnt, Y: Integer;
     525  S: string;
    535526  HelpLineInfo: THelpLineInfo;
    536527begin
     
    542533  begin
    543534    Font.Assign(UniFont[ftNormal]);
    544     for i := -ScrollBar.Position to InnerHeight div 24 do
    545       if ScrollBar.Position + i < MainText.Count then
     535    for I := -ScrollBar.Position to InnerHeight div 24 do
     536      if ScrollBar.Position + I < MainText.Count then
    546537      begin
    547         HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + i]);
     538        HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + I]);
    548539        if HelpLineInfo.Format = pkExternal then
    549540        begin
    550541          yl := ExtPic.Height;
    551           if 4 + i * 24 + yl > InnerHeight then
    552             yl := InnerHeight - (4 + i * 24);
    553           DpiBitCanvas(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,
    554545            0, 0);
    555546        end;
    556547      end;
    557     for i := -2 to InnerHeight div 24 do
    558       if (ScrollBar.Position + i >= 0) and (ScrollBar.Position + i < MainText.Count) then
     548    for I := -2 to InnerHeight div 24 do
     549      if (ScrollBar.Position + I >= 0) and (ScrollBar.Position + I < MainText.Count) then
    559550      begin
    560         HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + i]);
    561         if HelpLineInfo.Link <> 0 then
     551        HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + I]);
     552        if (HelpLineInfo.Category <> hkNoLink) or (HelpLineInfo.Index <> 0) then
    562553        begin
    563           if (Kind = hkMisc) and (no = miscSearchResult) then
    564             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)
    565556          else if HelpLineInfo.Format in [pkSmallIcon_AsPreq, pkAdvIcon_AsPreq]
    566557          then
    567             Sprite(OffScreen, HGrSystem, 12, i * 24 + 5, 14, 14, 65, 20)
    568           else if HelpLineInfo.Link and (hkCrossLink shl 8) <> 0 then
    569             Sprite(OffScreen, HGrSystem, 12, i * 24 + 5, 14, 14, 80, 1)
    570           else if not((Kind = hkMisc) and (no = miscMain)) then
    571             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;
    573564        end
    574565        else
    575           x0[i] := 0;
     566          x0[I] := 0;
    576567        case HelpLineInfo.Format of
    577568          pkLogo:
    578569            begin
    579               Server(sGetVersion, 0, 0, j);
    580               s := Format('%d.%d.%d', [j shr 16 and $FF, j shr 8 and $FF,
    581                 j and $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,
    583574                HGrSystem.Data.Canvas.Pixels[95, 1], $000000);
    584575              Font.Assign(UniFont[ftSmall]);
    585576              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);
    587578              Font.Assign(UniFont[ftNormal]);
    588579            end;
    589580          pkSmallIcon, pkSmallIcon_AsPreq:
    590581            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);
    593584              if HelpLineInfo.Picpix = imPalace then
    594                 DpiBitCanvas(OffScreen.Canvas, 8 + x0[i], 2 + i * 24,
     585                DpiBitBltCanvas(OffScreen.Canvas, 8 + x0[I], 2 + I * 24,
    595586                  xSizeSmall, ySizeSmall, SmallImp.Canvas,
    596587                  0 * xSizeSmall, 1 * ySizeSmall)
    597588              else
    598                 DpiBitCanvas(OffScreen.Canvas, 8 + x0[i], 2 + i * 24,
     589                DpiBitBltCanvas(OffScreen.Canvas, 8 + x0[I], 2 + I * 24,
    599590                  xSizeSmall, ySizeSmall, SmallImp.Canvas,
    600591                  HelpLineInfo.Picpix mod 7 * xSizeSmall,
    601592                  (HelpLineInfo.Picpix + SystemIconLines * 7) div 7 *
    602593                  ySizeSmall);
    603               x0[i] := x0[i] + (8 + 8 + 36);
     594              x0[I] := x0[I] + (8 + 8 + 36);
    604595            end;
    605596          pkBigIcon:
    606597            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,
    608599                40, HelpLineInfo.Picpix mod 7 * xSizeBig,
    609600                HelpLineInfo.Picpix div 7 * ySizeBig);
    610               x0[i] := 64 + 8 + 8 + x0[i];
     601              x0[I] := 64 + 8 + 8 + x0[I];
    611602            end;
    612603          pkSpecialIcon:
     
    615606                0:
    616607                  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);
    618609                1:
    619610                  with NoMap do begin
    620                     PaintTerrIcon(12 + x0[i], -7 + i * 24,
     611                    PaintTerrIcon(12 + x0[I], -7 + I * 24,
    621612                      1 + 3 * (xxt * 2 + 1), 1 + yyt);
    622613                    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,
    624615                        56, 2 * yyt, 1 + 3 * (xxt * 2 + 1) + xxt - 28,
    625616                        1 + yyt + 1 * (yyt * 3 + 1))
    626617                    else
    627                       Sprite(OffScreen, HGrTerrain, 12 + x0[i],
    628                         -7 + 4 + i * 24 - 4, 56, 40, 1 + 3 * (xxt * 2 + 1) + xxt
     618                      Sprite(OffScreen, HGrTerrain, 12 + x0[I],
     619                        -7 + 4 + I * 24 - 4, 56, 40, 1 + 3 * (xxt * 2 + 1) + xxt
    629620                        - 28, 1 + yyt + 1 * (yyt * 3 + 1) + yyt - 20);
    630621                  end;
    631622                2:
    632623                  with NoMap do begin
    633                     PaintTerrIcon(12 + x0[i], -7 + i * 24,
     624                    PaintTerrIcon(12 + x0[I], -7 + I * 24,
    634625                      1 + 7 * (xxt * 2 + 1), 1 + yyt + 4 * (yyt * 3 + 1));
    635626                    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,
    637628                        56, 32, 1 + 4 * (xxt * 2 + 1) + xxt - 28,
    638629                        1 + yyt + 12 * (yyt * 3 + 1) + yyt - 16)
    639630                    else
    640                       Sprite(OffScreen, HGrTerrain, 12 + x0[i], -7 + 4 + i * 24,
     631                      Sprite(OffScreen, HGrTerrain, 12 + x0[I], -7 + 4 + I * 24,
    641632                        56, 32, 1 + 4 * (xxt * 2 + 1) + xxt - 28,
    642633                        1 + yyt + 12 * (yyt * 3 + 1) + yyt - 16)
    643634                  end;
    644635              end;
    645               x0[i] := 64 + 8 + 8 + x0[i];
     636              x0[I] := 64 + 8 + 8 + x0[I];
    646637            end;
    647638          pkDomain:
    648639            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,
    652643                75 + HelpLineInfo.Picpix * 37, 295);
    653               x0[i] := x0[i] + (8 + 8 + 36);
     644              x0[I] := x0[I] + (8 + 8 + 36);
    654645            end;
    655646          pkAdvIcon, pkAdvIcon_AsPreq:
    656647            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,
    659650                $000000, $000000);
    660651              if AdvIcon[HelpLineInfo.Picpix] < 84 then
    661                 DpiBitCanvas(OffScreen.Canvas, 8 + x0[i], 2 + i * 24,
     652                DpiBitBltCanvas(OffScreen.Canvas, 8 + x0[I], 2 + I * 24,
    662653                  xSizeSmall, ySizeSmall, SmallImp.Canvas,
    663654                  (AdvIcon[HelpLineInfo.Picpix] + SystemIconLines * 7) mod 7 *
     
    665656                  7) div 7 * ySizeSmall)
    666657              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,
    668659                  1 + (AdvIcon[HelpLineInfo.Picpix] - 84) mod 8 * 37,
    669660                  295 + (AdvIcon[HelpLineInfo.Picpix] - 84) div 8 * 21);
    670               j := AdvValue[HelpLineInfo.Picpix] div 1000;
    671               DpiBitCanvas(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);
    676667            end;
    677668          pkRightIcon:
    678669            begin
    679670              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,
    681672                  HelpLineInfo.Picpix, gDespotism)
    682673              else
    683                 WaterSign(InnerWidth - (40 + 2 * xSizeBig), i * 24 - 8,
     674                WaterSign(InnerWidth - (40 + 2 * xSizeBig), I * 24 - 8,
    684675                  HelpLineInfo.Picpix + 7);
    685               x0[i] := x0[i] + 8;
     676              x0[I] := x0[I] + 8;
    686677            end;
    687678          pkIllu:
    688             WaterSign(8, i * 24 - 8, HelpLineInfo.Picpix);
     679            WaterSign(8, I * 24 - 8, HelpLineInfo.Picpix);
    689680          pkBigFeature:
    690681            begin
    691682              cnt := 0;
    692               for j := nDomains - 1 downto 0 do
    693                 if 1 shl j and Feature[HelpLineInfo.Picpix].Domains <> 0 then
     683              for J := nDomains - 1 downto 0 do
     684                if 1 shl J and Feature[HelpLineInfo.Picpix].Domains <> 0 then
    694685                begin
    695                   inc(cnt);
     686                  Inc(cnt);
    696687                  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);
    700691                end;
    701692              DarkGradient(OffScreen.Canvas, InnerWidth - 38 - 38 * cnt,
    702                 i * 24 + 23, cnt * 38 - 2, 1);
     693                I * 24 + 23, cnt * 38 - 2, 1);
    703694              ofs := InnerWidth - (39 + 7) - 19 * cnt;
    704695              with OffScreen.Canvas do
    705696              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));
    709700                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,
    711702                  66 + HelpLineInfo.Picpix mod 11 * 11,
    712703                  137 + HelpLineInfo.Picpix div 11 * 11);
    713704              end;
    714               x0[i] := x0[i] + 8;
     705              x0[I] := x0[I] + 8;
    715706            end;
    716707          pkTer, pkBigTer:
    717708            with NoMap do begin
    718709              if HelpLineInfo.Format = pkBigTer then
    719                 y := i * 24 - 3 + yyt
     710                Y := I * 24 - 3 + yyt
    720711              else
    721                 y := i * 24 + 13;
     712                Y := I * 24 + 13;
    722713              if HelpLineInfo.Picpix >= 3 * 12 then
    723714                srcno := 2 * 9 + 6
     
    730721              if HelpLineInfo.Format = pkTer then
    731722              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;
    734725              end
    735726              else
    736727              begin
    737728                ofs := InnerWidth - (2 * xxt + 38);
    738                 x0[i] := x0[i] + 8;
     729                x0[I] := x0[I] + 8;
    739730              end;
    740731              if srcno >= fJungle then
    741732              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,
    743734                  yyt * 2 - 4, 5 + 2 * (xxt * 2 + 1),
    744735                  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,
    746737                  yyt * 3 - 2, 1 + srcno mod 9 * (xxt * 2 + 1),
    747738                  1 + srcno div 9 * (yyt * 3 + 1));
    748739              end
    749740              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,
    751742                  yyt * 2 - 4, 5 + srcno mod 9 * (xxt * 2 + 1),
    752743                  3 + yyt + srcno div 9 * (yyt * 3 + 1));
    753744              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,
    755746                  yyt * 3, 1 + 8 * (xxt * 2 + 1),
    756747                  1 + (HelpLineInfo.Picpix - 2 * 12) * (yyt * 3 + 1))
     
    764755                  srcno := 18 + 8 + (HelpLineInfo.Picpix mod 12 - 9) * 18;
    765756                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,
    767758                  yyt * 3, 1 + srcno mod 9 * (xxt * 2 + 1),
    768759                  1 + srcno div 9 * (yyt * 3 + 1));
     
    774765              if HelpLineInfo.Picpix = 5 then
    775766              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,
    777768                  xxt * 2 - 8, yyt * 2 - 4, 5 + 2 * (xxt * 2 + 1),
    778769                  3 + yyt + 2 * (yyt * 3 + 1));
     
    781772              else
    782773                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,
    784775                xxt * 2 - 8, yyt * 2 - 4, 5 + srcno mod 9 * (xxt * 2 + 1),
    785776                3 + yyt + srcno div 9 * (yyt * 3 + 1));
    786777              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,
    788779                  yyt * 2, 1 + 5 * (xxt * 2 + 1), 1 + yyt + 13 * (yyt * 3 + 1))
    789780              else if HelpLineInfo.Picpix >= 3 then { improvement 2 }
    790781              begin
    791782                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,
    793784                    xxt * 2, yyt * 3, 1 + 7 * (xxt * 2 + 1),
    794785                    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,
    796787                  xxt * 2, yyt * 3, 1 + (HelpLineInfo.Picpix - 3) *
    797788                  (xxt * 2 + 1), 1 + 12 * (yyt * 3 + 1))
     
    799790              else { improvement 1 }
    800791              begin
    801                 Sprite(OffScreen, HGrTerrain, ofs, i * 24 + 11 - 2 * yyt,
     792                Sprite(OffScreen, HGrTerrain, ofs, I * 24 + 11 - 2 * yyt,
    802793                  xxt * 2, yyt * 3, 1 + 2 * (xxt * 2 + 1),
    803794                  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,
    805796                  xxt * 2, yyt * 3, 1 + 5 * (xxt * 2 + 1),
    806797                  1 + (9 + HelpLineInfo.Picpix) * (yyt * 3 + 1))
    807798              end;
    808               x0[i] := x0[i] + 8;
     799              x0[I] := x0[I] + 8;
    809800            end;
    810801          pkModel:
    811802            begin
    812               FrameImage(OffScreen.Canvas, BigImp, x0[i] + 12, i * 24 - 7,
     803              FrameImage(OffScreen.Canvas, BigImp, x0[I] + 12, I * 24 - 7,
    813804                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,
    815806                1 + HelpLineInfo.Picpix mod 10 * 65,
    816807                1 + HelpLineInfo.Picpix div 10 * 49);
    817               x0[i] := 64 + 8 + 8 + x0[i];
     808              x0[I] := 64 + 8 + 8 + x0[I];
    818809            end;
    819810          pkFeature:
    820811            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,
    826817                66 + HelpLineInfo.Picpix mod 11 * 11,
    827818                137 + HelpLineInfo.Picpix div 11 * 11);
    828               x0[i] := x0[i] + 8 + 8 + 2 + 13;
     819              x0[I] := x0[I] + 8 + 8 + 2 + 13;
    829820            end;
    830821          pkExp:
    831822            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,
    835826                121 + HelpLineInfo.Picpix * 13, 28);
    836               x0[i] := 20 + 8 + 11;
     827              x0[I] := 20 + 8 + 11;
    837828            end;
    838829          pkAITStat:
    839830            begin
    840               Sprite(OffScreen, HGrSystem, 20, 6 + i * 24, 14, 14,
     831              Sprite(OffScreen, HGrSystem, 20, 6 + I * 24, 14, 14,
    841832                1 + HelpLineInfo.Picpix * 15, 316);
    842               x0[i] := 20 + 8 + 11;
     833              x0[I] := 20 + 8 + 11;
    843834            end;
    844835          pkGov:
    845836            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               DpiBitCanvas(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,
    849840                ySizeSmall, SmallImp.Canvas, (HelpLineInfo.Picpix - 1) *
    850841                xSizeSmall, ySizeSmall);
    851               x0[i] := x0[i] + (8 + 8 + 36);
     842              x0[I] := x0[I] + (8 + 8 + 36);
    852843            end;
    853844          pkDot:
    854845            begin
    855               Sprite(OffScreen, HGrSystem, x0[i] + 18, 9 + i * 24, 8,
     846              Sprite(OffScreen, HGrSystem, x0[I] + 18, 9 + I * 24, 8,
    856847                8, 81, 16);
    857               x0[i] := 20 + 8 + 4;
     848              x0[I] := 20 + 8 + 4;
    858849            end;
    859850          pkNormal_Dot:
    860             x0[i] := 20 + 8 + 4;
     851            x0[I] := 20 + 8 + 4;
    861852          pkNormal_64:
    862             x0[i] := 64 + 8 + 8;
     853            x0[I] := 64 + 8 + 8;
    863854        else
    864           x0[i] := x0[i] + 8;
     855          x0[I] := x0[I] + 8;
    865856        end;
    866         Self.Line(OffScreen.Canvas, i, False)
     857        Self.Line(OffScreen.Canvas, I, False)
    867858      end;
    868859  end;
     
    873864begin
    874865  Sel := -1;
    875   SmartUpdateContent(true)
    876 end;
    877 
    878 procedure THelpDlg.Prepare(sbPos: integer = 0);
     866  SmartUpdateContent(True);
     867end;
     868
     869procedure THelpDlg.Prepare(sbPos: Integer = 0);
    879870var
    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;
    883874  List: THyperText;
    884875  CheckSeeAlso: Boolean;
    885876
    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);
    911902  begin
    912903    if MainText.Count > 1 then
     
    914905      MainText.LineFeed;
    915906    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);
    926917  var
    927     pix: integer;
     918    pix: Integer;
    928919    Name: string;
    929920  begin
    930921    if MainText.Count > 1 then
    931922      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);
    934925  end;
    935926
    936927  procedure AddStandardBlock(Item: string);
    937928  var
    938     i: integer;
     929    I: Integer;
    939930  begin
    940931    with MainText do
     
    947938      else if Item = 'TECHFORMULA' then
    948939      begin
    949         i := Difficulty;
    950         if i = 0 then
    951           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]]));
    954945      end
    955946      else if Item = 'EXPERIENCE' then
    956         for i := 0 to nExp - 1 do
    957           AddLine(Phrases.Lookup('EXPERIENCE', i), pkExp, i)
     947        for I := 0 to nExp - 1 do
     948          AddLine(Phrases.Lookup('EXPERIENCE', I), pkExp, I)
    958949      else if Item = 'MODERN' then
    959         for i := 1 to 3 do
     950        for I := 1 to 3 do
    960951        begin
    961952          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);
    963954        end
    964955      else if Item = 'SAVED' then
    965956        AddLine(DataDir + 'Saved', pkNormal)
    966957      else if Item = 'AITSTAT' then
    967         for i := 0 to 3 do
    968           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);
    973964  var
    974     i: Integer;
    975   begin
    976     if (Length(s) > 0) and (s[1] = ':') then begin
     965    I: Integer;
     966  begin
     967    if (Length(S) > 0) and (S[1] = ':') then begin
    977968      Category := hkMisc;
    978969      Index := 0;
    979       for i := 3 to length(s) do
    980         Index := Index * 10 + Ord(s[i]) - 48;
    981       case s[2] of
     970      for I := 3 to Length(S) do
     971        Index := Index * 10 + Ord(S[I]) - 48;
     972      case S[2] of
    982973        'A': Category := hkAdv;
    983974        'B': Category := hkImp;
     
    986977        'E': Category := hkInternet;
    987978        '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);
    991982      end;
    992983      if (Category <> hkMisc) and (Index = 0) then
     
    994985    end else begin
    995986      Category := hkText;
    996       Index := HelpText.Gethandle(Copy(s, 1, 255));
     987      Index := HelpText.GetHandle(Copy(S, 1, 255));
    997988    end;
    998989  end;
    999990
    1000   procedure AddTextual(s: string);
     991  procedure AddTextual(S: string);
    1001992  var
    1002     i: Integer;
    1003     p: Integer;
    1004     l: Integer;
     993    I: Integer;
     994    P: Integer;
     995    L: Integer;
    1005996    ofs: Integer;
    1006     CurrentFormat: Integer;
    1007     FollowFormat: Integer;
     997    CurrentFormat: TTextFormat;
     998    FollowFormat: TTextFormat;
    1008999    Picpix: Integer;
    1009     LinkCategory: Integer;
     1000    LinkCategory: TLinkCategory;
     1001    CrossLink: Boolean;
    10101002    LinkIndex: Integer;
    10111003    RightMargin: Integer;
     
    10131005    Text: string;
    10141006  begin
     1007    CrossLink := False;
    10151008    RightMargin := InnerWidth - 16 - DpiGetSystemMetrics(SM_CXVSCROLL);
    10161009    FollowFormat := pkNormal;
    1017     while s <> '' do
     1010    while S <> '' do
    10181011    begin
    10191012      Picpix := 0;
    1020       LinkCategory := 0;
     1013      LinkCategory := hkNoLink;
    10211014      LinkIndex := 0;
    1022       if s[1] = '$' then
    1023       begin // window caption
    1024         p := 1;
     1015      if S[1] = '$' then
     1016      begin // Window caption
     1017        P := 1;
    10251018        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);
    10301023      end
    1031       else if s[1] = '&' then
    1032       begin // standard block
    1033         p := 1;
     1024      else if S[1] = '&' then
     1025      begin // Standard block
     1026        P := 1;
    10341027        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);
    10391032      end
    1040       else if s[1] = '@' then
    1041       begin // image
    1042         if (Length(s) >= 2) and (s[2] = '@') then
    1043         begin // generate from icon
     1033      else if S[1] = '@' then
     1034      begin // Image
     1035        if (Length(S) >= 2) and (S[2] = '@') then
     1036        begin // Generate from icon
    10441037          Picpix := 0;
    1045           p := 3;
    1046           while (p <= Length(s)) and (s[p] <> '\') do
     1038          P := 3;
     1039          while (P <= Length(S)) and (S[P] <> '\') do
    10471040          begin
    1048             Picpix := Picpix * 10 + Ord(s[p]) - 48;
    1049             inc(p)
     1041            Picpix := Picpix * 10 + Ord(S[P]) - 48;
     1042            Inc(P);
    10501043          end;
    10511044          if (Picpix < 0) or (Picpix >= nImp) then
     
    10571050        else
    10581051        begin // external image
    1059           p := 1;
     1052          P := 1;
    10601053          repeat
    1061             Inc(p)
    1062           until (p > Length(s)) or (s[p] = '\');
     1054            Inc(P);
     1055          until (P > Length(S)) or (S[P] = '\');
    10631056          if LoadGraphicFile(ExtPic, LocalizedFilePath('Help' +
    1064             DirectorySeparator + Copy(s, 2, p - 2)) + '.png') then
     1057            DirectorySeparator + Copy(S, 2, P - 2)) + '.png') then
    10651058          begin
    10661059            MainText.AddLine('', pkExternal);
    1067             for i := 0 to (ExtPic.Height - 12) div 24 do
     1060            for I := 0 to (ExtPic.Height - 12) div 24 do
    10681061              MainText.LineFeed;
    10691062          end;
    10701063        end;
    1071         Delete(s, 1, p);
     1064        Delete(S, 1, P);
    10721065      end
    10731066      else
    10741067      begin
    1075         case s[1] of
     1068        case S[1] of
    10761069          ':', ';':
    10771070            begin // link
    1078               p := 1;
     1071              P := 1;
    10791072              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;
    10841077              if (LinkCategory <> hkText) and (LinkIndex < 200) then
    10851078              // show icon
     
    10881081                    begin
    10891082                      CurrentFormat := pkAdvIcon;
    1090                       Picpix := LinkIndex
     1083                      Picpix := LinkIndex;
    10911084                    end;
    10921085                  hkImp:
    10931086                    begin
    10941087                      CurrentFormat := pkSmallIcon;
    1095                       Picpix := LinkIndex
     1088                      Picpix := LinkIndex;
    10961089                    end;
    10971090                  hkTer:
     
    11031096                    begin
    11041097                      CurrentFormat := pkFeature;
    1105                       Picpix := LinkIndex
     1098                      Picpix := LinkIndex;
    11061099                    end;
    11071100                  hkModel:
     
    11121105                    end;
    11131106                end;
    1114               if s[1] = ':' then
    1115                 LinkCategory := LinkCategory + hkCrossLink;
    1116               if (p > Length(s)) or (s[p] = ' ') then
    1117                 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)
    11181111              else
    1119                 Delete(s, 1, p - 1)
    1120             end;
    1121           '!': // highlited
    1122             if (Length(s) >= 2) and (s[2] = '!') then
     1112                Delete(S, 1, P - 1)
     1113            end;
     1114          '!': // highlighted
     1115            if (Length(S) >= 2) and (S[2] = '!') then
    11231116            begin
    11241117              if MainText.Count > 1 then
     
    11261119              FollowFormat := pkCaption;
    11271120              CurrentFormat := pkCaption;
    1128               Delete(s, 1, 2);
     1121              Delete(S, 1, 2);
    11291122            end
    11301123            else
     
    11321125              FollowFormat := pkSection;
    11331126              CurrentFormat := pkSection;
    1134               Delete(s, 1, 1);
     1127              Delete(S, 1, 1);
    11351128            end;
    11361129          '-':
     
    11381131              FollowFormat := pkNormal_Dot;
    11391132              CurrentFormat := pkDot;
    1140               Delete(s, 1, 1);
     1133              Delete(S, 1, 1);
    11411134            end;
    11421135        else
     
    11471140        else
    11481141          ofs := 8;
    1149         p := 0;
     1142        P := 0;
    11501143        repeat
    11511144          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)) <=
    11551148            RightMargin - ofs) then
    1156             l := p - 1
     1149            L := P - 1
    11571150          else
    11581151            Break;
    1159         until (p >= Length(s)) or (s[l + 1] = '\');
    1160         Text := Copy(s, 1, l);
    1161         if LinkCategory and $3f = hkInternet then begin
     1152        until (P >= Length(S)) or (S[L + 1] = '\');
     1153        Text := Copy(S, 1, L);
     1154        if LinkCategory = hkInternet then begin
    11621155          if LinkIndex = 1 then Text := AITemplateManual
    11631156          else if LinkIndex = 2 then Text := CevoHomepageShort
     
    11651158        end;
    11661159        MainText.AddLine(Text, CurrentFormat, Picpix, LinkCategory,
    1167           LinkIndex);
    1168         if (l < Length(s)) and (s[l + 1] = '\') then
     1160          LinkIndex, CrossLink);
     1161        if (L < Length(S)) and (S[L + 1] = '\') then
    11691162          FollowFormat := pkNormal;
    1170         Delete(s, 1, l + 1);
    1171       end
    1172     end
     1163        Delete(S, 1, L + 1);
     1164      end;
     1165    end;
    11731166  end;
    11741167
     
    11781171  end;
    11791172
    1180   procedure AddModelText(i: Integer);
     1173  procedure AddModelText(I: Integer);
    11811174  var
    11821175    pix: Integer;
    1183     s: string;
     1176    S: string;
    11841177  begin
    11851178    with MainText do begin
     
    11881181        LineFeed;
    11891182      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);
    11941187      AddLine(Format(HelpText.Lookup('SPEED'),
    1195         [MovementToString(SpecialModel[i].Speed)]), pkModel, pix);
     1188        [MovementToString(SpecialModel[I].Speed)]), pkModel, pix);
    11961189      if Difficulty = 0 then
    1197         AddLine(Format(HelpText.Lookup('BUILDCOST'), [SpecialModel[i].Cost]),
     1190        AddLine(Format(HelpText.Lookup('BUILDCOST'), [SpecialModel[I].Cost]),
    11981191          pkNormal_64)
    11991192      else
    12001193        AddLine(Format(HelpText.Lookup('BUILDCOST'),
    1201           [SpecialModel[i].Cost * BuildCostMod[Difficulty] div 12]),
     1194          [SpecialModel[I].Cost * BuildCostMod[Difficulty] div 12]),
    12021195          pkNormal_64);
    1203       s := HelpText.LookupByHandle(hSPECIALMODEL, i);
    1204       if (s <> '') and (s <> '*') then
    1205         AddTextual(s);
    1206       if SpecialModelPreq[i] >= 0 then
    1207         AddPreqAdv(SpecialModelPreq[i])
    1208       else if SpecialModelPreq[i] = preLighthouse then
     1196      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
    12091202        AddPreqImp(woLighthouse)
    1210       else if SpecialModelPreq[i] = preBuilder then
     1203      else if SpecialModelPreq[I] = preBuilder then
    12111204        AddPreqImp(woPyramids)
    1212       else if SpecialModelPreq[i] = preLeo then
     1205      else if SpecialModelPreq[I] = preLeo then
    12131206        AddPreqImp(woLeo);
    1214       if SpecialModelPreq[i] <> preNone then
     1207      if SpecialModelPreq[I] <> preNone then
    12151208        MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'),
    12161209          [MainText[Count - 1]]);
     
    12201213  procedure AddJobList;
    12211214  var
    1222     i, JobCost: Integer;
     1215    I, JobCost: Integer;
    12231216  begin
    12241217    with MainText do begin
    1225       for i := 0 to nJobHelp - 1 do begin
    1226         if i > 0 then begin
     1218      for I := 0 to Length(JobHelp) - 1 do begin
     1219        if I > 0 then begin
    12271220          LineFeed;
    12281221          LineFeed;
    12291222        end;
    1230         AddLine(Phrases.Lookup('JOBRESULT', JobHelp[i]), pkSection);
     1223        AddLine(Phrases.Lookup('JOBRESULT', JobHelp[I]), pkSection);
    12311224        AddLine;
    1232         AddLine('', pkTerImp, i);
     1225        AddLine('', pkTerImp, I);
    12331226        AddLine;
    1234         AddTextual(HelpText.LookupByHandle(hJOBHELP, i));
     1227        AddTextual(HelpText.LookupByHandle(hJOBHELP, I));
    12351228        JobCost := -1;
    1236         case JobHelp[i] of
     1229        case JobHelp[I] of
    12371230          jCanal: JobCost := CanalWork;
    12381231          jFort: JobCost := FortWork;
     
    12441237        else
    12451238          AddTextual(HelpText.Lookup('JOBCOSTVAR'));
    1246         if JobPreq[JobHelp[i]] <> preNone then begin
    1247           AddPreqAdv(JobPreq[JobHelp[i]]);
     1239        if JobPreq[JobHelp[I]] <> preNone then begin
     1240          AddPreqAdv(JobPreq[JobHelp[I]]);
    12481241          MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'),
    12491242            [MainText[Count - 1]]);
     
    12551248  procedure AddGraphicCredits;
    12561249  var
    1257     i: Integer;
    1258     s: string;
     1250    I: Integer;
     1251    S: string;
    12591252    sr: TSearchRec;
    12601253    List, Plus: TStringList;
     
    12711264
    12721265    List.Sort;
    1273     i := 1;
    1274     while i < List.Count do
    1275       if List[i] = List[i - 1] then
    1276         List.Delete(i)
     1266    I := 1;
     1267    while I < List.Count do
     1268      if List[I] = List[I - 1] then
     1269        List.Delete(I)
    12771270      else
    1278         Inc(i);
    1279 
    1280     for i := 0 to List.Count - 1 do begin
    1281       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 -
    12831276        DpiGetSystemMetrics(SM_CXVSCROLL) do
    1284         Delete(s, length(s), 1);
    1285       MainText.AddLine(s);
     1277        Delete(S, Length(S), 1);
     1278      MainText.AddLine(S);
    12861279    end;
    12871280    FreeAndNil(List);
     
    12901283  procedure AddSoundCredits;
    12911284  var
    1292     i: Integer;
    1293     s: string;
     1285    I: Integer;
     1286    S: string;
    12941287    List: TStringList;
    12951288  begin
    12961289    List := TStringList.Create;
    12971290    List.LoadFromFile(GetSoundsDir + DirectorySeparator + 'sound.credits.txt');
    1298     for i := 0 to List.Count - 1 do begin
    1299       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 -
    13011294        DpiGetSystemMetrics(SM_CXVSCROLL) do
    1302         Delete(s, length(s), 1);
    1303       MainText.AddLine(s);
     1295        Delete(S, Length(S), 1);
     1296      MainText.AddLine(S);
    13041297    end;
    13051298    FreeAndNil(List);
     
    13231316    Clear;
    13241317    Headline := -1;
    1325     if (no >= 200) or not(Kind in [hkAdv, hkImp, hkTer, hkFeature]) then
     1318    if (No >= 200) or not (Kind in [hkAdv, hkImp, hkTer, hkFeature]) then
    13261319      LineFeed;
    13271320    case Kind of
    13281321      hkText:
    1329         AddTextual(HelpText.LookupByHandle(no));
     1322        AddTextual(HelpText.LookupByHandle(No));
    13301323      hkMisc:
    13311324        begin
    1332           case no of
    1333             miscMain:
     1325          case No of
     1326            Integer(miscMain):
    13341327              begin
    13351328                Caption := HelpText.Lookup('HELPTITLE_MAIN');
    13361329                AddLine(HelpText.Lookup('HELPTITLE_QUICKSTART'), pkSpecialIcon,
    1337                   0, { pkBigIcon,22, } hkText, HelpText.Gethandle('QUICK'));
     1330                  0, { pkBigIcon,22, } hkText, HelpText.GetHandle('QUICK'));
    13381331                LineFeed;
    13391332                AddLine(HelpText.Lookup('HELPTITLE_CONCEPTS'), pkBigIcon, 6,
     
    13441337                LineFeed;
    13451338                AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkSpecialIcon, 2,
    1346                   hkMisc, miscJobList);
     1339                  hkMisc, Integer(miscJobList));
    13471340                LineFeed;
    13481341                AddLine(HelpText.Lookup('HELPTITLE_TECHLIST'), pkBigIcon, 39,
    13491342                  hkAdv, 200);
    13501343                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,
    13531346                  hkModel, 0);
    13541347                LineFeed;
     
    13661359                LineFeed;
    13671360                AddLine(HelpText.Lookup('HELPTITLE_GOVLIST'), pkBigIcon,
    1368                   gDemocracy + 6, hkMisc, miscGovList);
     1361                  gDemocracy + 6, hkMisc, Integer(miscGovList));
    13691362                LineFeed;
    13701363                AddLine(HelpText.Lookup('HELPTITLE_KEYS'), pkBigIcon, 2, hkText,
     
    13751368                LineFeed;
    13761369                AddLine(HelpText.Lookup('HELPTITLE_CREDITS'), pkBigIcon, 22,
    1377                   hkMisc, miscCredits);
     1370                  hkMisc, Integer(miscCredits));
    13781371              end;
    1379             miscCredits:
     1372            Integer(miscCredits):
    13801373              begin
    13811374                AddItem('CREDITS');
     
    13901383                AddItem('AUTHOR');
    13911384              end;
    1392             miscJobList:
     1385            Integer(miscJobList):
    13931386              begin
    13941387                Caption := HelpText.Lookup('HELPTITLE_JOBLIST');
     
    13991392                AddItem('TERIMPCITY');
    14001393              end;
    1401             miscGovList:
     1394            Integer(miscGovList):
    14021395              begin
    14031396                Caption := HelpText.Lookup('HELPTITLE_GOVLIST');
    1404                 for i := 1 to nGov do
     1397                for I := 1 to nGov do
    14051398                begin
    1406                   AddLine(Phrases.Lookup('GOVERNMENT', i mod nGov), pkSection);
     1399                  AddLine(Phrases.Lookup('GOVERNMENT', I mod nGov), pkSection);
    14071400                  LineFeed;
    1408                   if i = nGov then
     1401                  if I = nGov then
    14091402                    AddLine('', pkBigIcon, 7 * SystemIconLines + imPalace)
    14101403                  else
    1411                     AddLine('', pkBigIcon, i + 6);
     1404                    AddLine('', pkBigIcon, I + 6);
    14121405                  LineFeed;
    1413                   AddTextual(HelpText.LookupByHandle(hGOVHELP, i mod nGov));
    1414                   if i mod nGov >= 2 then
     1406                  AddTextual(HelpText.LookupByHandle(hGOVHELP, I mod nGov));
     1407                  if I mod nGov >= 2 then
    14151408                  begin
    1416                     AddPreqAdv(GovPreq[i mod nGov]);
     1409                    AddPreqAdv(GovPreq[I mod nGov]);
    14171410                    MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'),
    14181411                      [MainText[Count - 1]]);
    14191412                  end;
    1420                   if i < nGov then
     1413                  if I < nGov then
    14211414                  begin
    14221415                    LineFeed;
     
    14251418                end;
    14261419              end;
    1427             miscSearchResult:
     1420            Integer(miscSearchResult):
    14281421              begin
    14291422                Caption := HelpText.Lookup('HELPTITLE_SEARCHRESULTS');
     
    14311424                MainText.AppendList(SearchResult);
    14321425              end;
    1433           end; // case no
     1426          end; // case No
    14341427        end;
    14351428
    14361429      hkAdv:
    1437         if no = 200 then
     1430        if No = 200 then
    14381431        begin // complete advance list
    14391432          Caption := HelpText.Lookup('HELPTITLE_TECHLIST');
    14401433          List := THyperText.Create;
    14411434          List.OwnsObjects := True;
    1442           for j := 0 to 3 do
     1435          for J := 0 to 3 do
    14431436          begin
    1444             if j > 0 then
     1437            if J > 0 then
    14451438            begin
    14461439              LineFeed;
    14471440              LineFeed;
    14481441            end;
    1449             AddLine(HelpText.Lookup('TECHAGE', j), pkSection);
    1450             if j = 1 then
     1442            AddLine(HelpText.Lookup('TECHAGE', J), pkSection);
     1443            if J = 1 then
    14511444              AddLine(Phrases.Lookup('ADVANCES', adScience) + ' ' +
    14521445                HelpText.Lookup('BASETECH'), pkAdvIcon, adScience, hkAdv,
    14531446                adScience);
    1454             if j = 2 then
     1447            if J = 2 then
    14551448              AddLine(Phrases.Lookup('ADVANCES', adMassProduction) + ' ' +
    14561449                HelpText.Lookup('BASETECH'), pkAdvIcon, adMassProduction, hkAdv,
    14571450                adMassProduction);
    14581451            List.Clear;
    1459             for i := 0 to nAdv - 1 do
    1460               if (i <> adScience) and (i <> adMassProduction) and
    1461                 (AdvValue[i] div 1000 = j) then
    1462                 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);
    14641457            List.Sort;
    14651458            AppendList(List);
     
    14691462        else // single advance
    14701463        begin
    1471           Caption := Phrases.Lookup('ADVANCES', no);
     1464          Caption := Phrases.Lookup('ADVANCES', No);
    14721465          LineFeed;
    1473           AddLine(Phrases.Lookup('ADVANCES', no), pkCaption);
    1474           if no in FutureTech then
     1466          AddLine(Phrases.Lookup('ADVANCES', No), pkCaption);
     1467          if No in FutureTech then
    14751468          begin
    14761469            AddLine(HelpText.Lookup('HELPSPEC_FUTURE'));
    14771470            LineFeed;
    1478             if no = futResearchTechnology then
     1471            if No = futResearchTechnology then
    14791472              AddItem('FUTURETECHHELP100')
    14801473            else
     
    14831476          else
    14841477            AddLine(HelpText.Lookup('HELPSPEC_ADV'));
    1485           if AdvPreq[no, 2] <> preNone then
     1478          if AdvPreq[No, 2] <> preNone then
    14861479            NextSection('PREREQALT')
    14871480          else
    14881481            NextSection('PREREQ');
    1489           for i := 0 to 2 do
    1490             if AdvPreq[no, i] <> preNone then
    1491               AddPreqAdv(AdvPreq[no, i]);
     1482          for I := 0 to 2 do
     1483            if AdvPreq[No, I] <> preNone then
     1484              AddPreqAdv(AdvPreq[No, I]);
    14921485          NextSection('GOVALLOW');
    1493           for i := 2 to nGov - 1 do
    1494             if GovPreq[i] = no then
    1495               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);
    14971490          NextSection('BUILDALLOW');
    1498           for i := 0 to nWonder - 1 do
    1499             if Imp[i].Preq = no then
    1500               AddImprovement(i);
    1501           for i := nWonder to nImp - 1 do
    1502             if (Imp[i].Preq = no) and (Imp[i].Kind <> ikCommon) then
    1503               AddImprovement(i);
    1504           for i := nWonder to nImp - 1 do
    1505             if (Imp[i].Preq = no) and (Imp[i].Kind = ikCommon) then
    1506               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);
    15071500          NextSection('MODELALLOW');
    1508           for i := 0 to nSpecialModel - 1 do
    1509             if SpecialModelPreq[i] = no then
    1510               AddModel(i);
     1501          for I := 0 to nSpecialModel - 1 do
     1502            if SpecialModelPreq[I] = No then
     1503              AddModel(I);
    15111504          NextSection('FEATALLOW');
    1512           for i := 0 to nFeature - 1 do
    1513             if Feature[i].Preq = no then
    1514               AddFeature(i);
     1505          for I := 0 to nFeature - 1 do
     1506            if Feature[I].Preq = No then
     1507              AddFeature(I);
    15151508          NextSection('FOLLOWADV');
    1516           for i := 0 to nAdv - 1 do
    1517             if (AdvPreq[i, 0] = no) or (AdvPreq[i, 1] = no) or
    1518               (AdvPreq[i, 2] = no) then
    1519               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);
    15201513          NextSection('UPGRADEALLOW');
    15211514          for Domain := 0 to nDomains - 1 do
    1522             for i := 1 to nUpgrade - 1 do
    1523               if upgrade[Domain, i].Preq = no then
     1515            for I := 1 to nUpgrade - 1 do
     1516              if upgrade[Domain, I].Preq = No then
    15241517              begin
    1525                 if upgrade[Domain, i].Strength > 0 then
     1518                if upgrade[Domain, I].Strength > 0 then
    15261519                  AddLine(Format(HelpText.Lookup('STRENGTHUP'),
    15271520                    [Phrases.Lookup('DOMAIN', Domain), upgrade[Domain,
    1528                     i].Strength]), pkDomain, Domain);
    1529                 if upgrade[Domain, i].Trans > 0 then
     1521                    I].Strength]), pkDomain, Domain);
     1522                if upgrade[Domain, I].Trans > 0 then
    15301523                  AddLine(Format(HelpText.Lookup('TRANSUP'),
    1531                     [Phrases.Lookup('DOMAIN', Domain), upgrade[Domain, i].Trans]
     1524                    [Phrases.Lookup('DOMAIN', Domain), upgrade[Domain, I].Trans]
    15321525                    ), pkDomain, Domain);
    1533                 if no in FutureTech then
     1526                if No in FutureTech then
    15341527                  AddLine(Format(HelpText.Lookup('COSTUP'),
    1535                     [upgrade[Domain, i].Cost]), pkNormal_Dot)
     1528                    [upgrade[Domain, I].Cost]), pkNormal_Dot)
    15361529                else
    15371530                  AddLine(Format(HelpText.Lookup('COSTMIN'),
    1538                     [upgrade[Domain, i].Cost]), pkNormal_Dot)
     1531                    [upgrade[Domain, I].Cost]), pkNormal_Dot)
    15391532              end;
    15401533          NextSection('EXPIRATION');
    1541           for i := 0 to nWonder - 1 do
    1542             if (Imp[i].Preq <> preNA) and (Imp[i].Expiration = no) then
    1543               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);
    15441537          NextSection('ADVEFFECT');
    1545           s := HelpText.LookupByHandle(hADVHELP, no);
    1546           if s <> '*' then
    1547             AddTextual(s);
     1538          S := HelpText.LookupByHandle(hADVHELP, No);
     1539          if S <> '*' then
     1540            AddTextual(S);
    15481541          NextSection('SEEALSO');
    1549           CheckSeeAlso := true
     1542          CheckSeeAlso := True;
    15501543        end;
    15511544
    15521545      hkImp:
    1553         if no = 200 then
     1546        if No = 200 then
    15541547        begin // complete city improvement list
    15551548          Caption := HelpText.Lookup('HELPTITLE_IMPLIST');
     
    15571550          List := THyperText.Create;
    15581551          List.OwnsObjects := True;
    1559           for i := nWonder to nImp - 1 do
    1560             if (i <> imTrGoods) and (Imp[i].Preq <> preNA) and
    1561               (Imp[i].Kind = ikCommon) then
    1562               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);
    15641557          List.Sort;
    15651558          AppendList(List);
    15661559          FreeAndNil(List);
    15671560        end
    1568         else if no = 201 then
     1561        else if No = 201 then
    15691562        begin // complete nat. project list
    15701563          Caption := HelpText.Lookup('HELPTITLE_UNIQUELIST');
    15711564          // AddLine(HelpText.Lookup('HELPTITLE_UNIQUELIST'),pkSection);
    1572           for i := nWonder to nImp - 1 do
    1573             if (Imp[i].Preq <> preNA) and
    1574               ((Imp[i].Kind = ikNatLocal) or (Imp[i].Kind = ikNatGlobal)) then
    1575               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);
    15771570          { LineFeed;
    15781571            LineFeed;
    15791572            AddLine(HelpText.Lookup('HELPTITLE_SHIPPARTLIST'),pkSection);
    1580             for i:= nWonder to nImp-1 do
    1581             if (Imp[i].Preq<>preNA) and (Imp[i].Kind=ikShipPart) then
    1582             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); }
    15831576        end
    1584         else if no = 202 then
     1577        else if No = 202 then
    15851578        begin // complete wonder list
    15861579          Caption := HelpText.Lookup('HELPTITLE_WONDERLIST');
    15871580          // AddLine(HelpText.Lookup('HELPTITLE_WONDERLIST'),pkSection);
    1588           for i := 0 to nWonder - 1 do
    1589             if Imp[i].Preq <> preNA then
    1590               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);
    15921585        end
    15931586        else
    15941587        begin // single building
    1595           Caption := Phrases.Lookup('IMPROVEMENTS', no);
     1588          Caption := Phrases.Lookup('IMPROVEMENTS', No);
    15961589          LineFeed;
    1597           AddLine(Phrases.Lookup('IMPROVEMENTS', no), pkRightIcon, no);
    1598           case Imp[no].Kind of
     1590          AddLine(Phrases.Lookup('IMPROVEMENTS', No), pkRightIcon, No);
     1591          case Imp[No].Kind of
    15991592            ikWonder: AddLine(HelpText.Lookup('HELPSPEC_WONDER'));
    16001593            ikCommon: AddLine(HelpText.Lookup('HELPSPEC_IMP'));
     
    16031596            AddLine(HelpText.Lookup('HELPSPEC_NAT'))
    16041597          end;
    1605           if Imp[no].Kind <> ikShipPart then begin
     1598          if Imp[No].Kind <> ikShipPart then begin
    16061599            NextSection('EFFECT');
    1607             AddTextual(HelpText.LookupByHandle(hIMPHELP, no));
     1600            AddTextual(HelpText.LookupByHandle(hIMPHELP, No));
    16081601          end;
    1609           if no = woSun then begin
     1602          if No = woSun then begin
    16101603            AddFeature(mcFirst);
    16111604            AddFeature(mcWill);
    16121605            AddFeature(mcAcademy);
    16131606          end;
    1614           if (no < nWonder) and not Phrases2FallenBackToEnglish then
     1607          if (No < nWonder) and not Phrases2FallenBackToEnglish then
    16151608          begin
    16161609            LineFeed;
    1617             if Imp[no].Expiration >= 0 then
     1610            if Imp[No].Expiration >= 0 then
    16181611              AddTextual(Phrases2.Lookup('HELP_WONDERMORALE1'))
    16191612            else
    16201613              AddTextual(Phrases2.Lookup('HELP_WONDERMORALE2'));
    16211614          end;
    1622           if Imp[no].Preq <> preNone then
     1615          if Imp[No].Preq <> preNone then
    16231616          begin
    16241617            NextSection('PREREQ');
    1625             AddPreqAdv(Imp[no].Preq);
     1618            AddPreqAdv(Imp[No].Preq);
    16261619          end;
    16271620          NextSection('COSTS');
    16281621          if Difficulty = 0 then
    1629             s := Format(HelpText.Lookup('BUILDCOST'), [Imp[no].Cost])
     1622            S := Format(HelpText.Lookup('BUILDCOST'), [Imp[No].Cost])
    16301623          else
    1631             s := Format(HelpText.Lookup('BUILDCOST'),
    1632               [Imp[no].Cost * BuildCostMod[Difficulty] div 12]);
    1633           AddLine(s);
    1634           if Imp[no].Maint > 0 then
    1635             AddLine(Format(HelpText.Lookup('MAINTCOST'), [Imp[no].Maint]));
    1636           j := 0;
    1637           for i := 0 to nImpReplacement - 1 do
    1638             if ImpReplacement[i].NewImp = no then
    1639             begin
    1640               if j = 0 then
     1624            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
    16411634              begin
    16421635                NextSection('REPLACE');
    16431636                AddItem('REPLACETEXT');
    1644                 j := 1;
     1637                J := 1;
    16451638              end;
    1646               AddImprovement(ImpReplacement[i].OldImp);
    1647             end;
    1648           if Imp[no].Kind = ikShipPart then
     1639              AddImprovement(ImpReplacement[I].OldImp);
     1640            end;
     1641          if Imp[No].Kind = ikShipPart then
    16491642          begin
    16501643            LineFeed;
    1651             if no = imShipComp then
    1652               i := 1
    1653             else if no = imShipPow then
    1654               i := 2
    1655             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;
    16571650            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);
    16591652          end;
    1660           if (no < nWonder) and (Imp[no].Expiration >= 0) then
     1653          if (No < nWonder) and (Imp[No].Expiration >= 0) then
    16611654          begin
    16621655            NextSection('EXPIRATION');
    1663             s := Format(HelpText.Lookup('EXPWITH'),
    1664               [Phrases.Lookup('ADVANCES', Imp[no].Expiration)]);
    1665             if no = woPyramids then
    1666               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);
    16681661          end;
    16691662          NextSection('SEEALSO');
    1670           if (no < nWonder) and (Imp[no].Expiration >= 0) then
     1663          if (No < nWonder) and (Imp[No].Expiration >= 0) then
    16711664            AddImprovement(woEiffel);
    1672           for i := 0 to nImpReplacement - 1 do
    1673             if ImpReplacement[i].OldImp = no then
    1674               AddImprovement(ImpReplacement[i].NewImp);
    1675           if no = imSupermarket then
     1665          for I := 0 to nImpReplacement - 1 do
     1666            if ImpReplacement[I].OldImp = No then
     1667              AddImprovement(ImpReplacement[I].NewImp);
     1668          if No = imSupermarket then
    16761669            AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkNormal, 0,
    1677               hkMisc + hkCrossLink, miscJobList);
    1678           CheckSeeAlso := true;
     1670              hkMisc, Integer(miscJobList), True);
     1671          CheckSeeAlso := True;
    16791672        end;
    16801673
    16811674      hkTer:
    1682         if no = 200 then
     1675        if No = 200 then
    16831676        begin // complete terrain type list
    16841677          Caption := HelpText.Lookup('HELPTITLE_TERLIST');
    16851678          // AddLine(HelpText.Lookup('HELPTITLE_TERLIST'),pkSection);
    1686           for i := 0 to nTerrainHelp - 1 do
    1687             AddTerrain(TerrainHelp[i]);
     1679          for I := 0 to Length(TerrainHelp) - 1 do
     1680            AddTerrain(TerrainHelp[I]);
    16881681        end
    16891682        else
    16901683        begin // sigle terrain type
    1691           TerrType := no mod 12;
     1684          TerrType := No mod 12;
    16921685          if TerrType = fJungle then
    16931686            TerrType := fForest;
    1694           TerrSubType := no div 12;
    1695           if no = 3 * 12 then
     1687          TerrSubType := No div 12;
     1688          if No = 3 * 12 then
    16961689          begin
    16971690            TerrType := fDesert;
     
    17001693          with Terrain[TerrType] do
    17011694          begin
    1702             Caption := Phrases.Lookup('TERRAIN', no);
     1695            Caption := Phrases.Lookup('TERRAIN', No);
    17031696            LineFeed;
    1704             AddLine(Phrases.Lookup('TERRAIN', no), pkBigTer, no);
     1697            AddLine(Phrases.Lookup('TERRAIN', No), pkBigTer, No);
    17051698            AddLine(HelpText.Lookup('HELPSPEC_TER'));
    17061699            LineFeed;
     
    17081701              AddLine(Format(HelpText.Lookup('RESPROD'),
    17091702                [ProdRes[TerrSubType]]));
    1710             if (no < 3 * 12) and (MineEff > 0) then
     1703            if (No < 3 * 12) and (MineEff > 0) then
    17111704              MainText[Count - 1] := MainText[Count - 1] + ' ' +
    17121705                Format(HelpText.Lookup('MOREMINE'), [MineEff]);
     
    17141707              AddLine(Format(HelpText.Lookup('RESFOOD'),
    17151708                [FoodRes[TerrSubType]]));
    1716             if (no < 3 * 12) and (IrrEff > 0) then
     1709            if (No < 3 * 12) and (IrrEff > 0) then
    17171710              MainText[Count - 1] := MainText[Count - 1] + ' ' +
    17181711                Format(HelpText.Lookup('MOREIRR'), [IrrEff]);
     
    17281721              else
    17291722                AddLine(HelpText.Lookup('MOVEPLAIN'));
    1730             if no = 3 * 12 then
     1723            if No = 3 * 12 then
    17311724            begin
    17321725              LineFeed;
    17331726              AddTextual(HelpText.Lookup('DEADLANDS'));
    17341727            end;
    1735             if (TerrType = fDesert) and (no <> fDesert + 12) then
     1728            if (TerrType = fDesert) and (No <> fDesert + 12) then
    17361729            begin
    17371730              LineFeed;
     
    17431736              AddTextual(Format(HelpText.Lookup('HOSTILE'), [ArcticThurst]));
    17441737            end;
    1745             if (no < 3 * 12) and (TransTerrain >= 0) then
     1738            if (No < 3 * 12) and (TransTerrain >= 0) then
    17461739            begin
    17471740              LineFeed;
    1748               i := TransTerrain;
    1749               if (TerrType <> fGrass) and (i <> fGrass) then
    1750                 i := i + TerrSubType * 12;
     1741              I := TransTerrain;
     1742              if (TerrType <> fGrass) and (I <> fGrass) then
     1743                I := I + TerrSubType * 12;
    17511744              // trafo to same Special resource group
    17521745              AddLine(Format(HelpText.Lookup('TRAFO'),
    1753                 [Phrases.Lookup('TERRAIN', i)]), pkTer, i,
    1754                 hkTer + hkCrossLink, i);
    1755               if no = fSwamp + 12 then
     1746                [Phrases.Lookup('TERRAIN', I)]), pkTer, I,
     1747                hkTer, I, True);
     1748              if No = fSwamp + 12 then
    17561749              begin
    17571750                LineFeed;
    17581751                AddLine(Format(HelpText.Lookup('TRAFO'),
    17591752                  [Phrases.Lookup('TERRAIN', TransTerrain + 24)]), pkTer,
    1760                   TransTerrain + 24, hkTer + hkCrossLink, TransTerrain + 24);
     1753                  TransTerrain + 24, hkTer, TransTerrain + 24, True);
    17611754              end
    1762               else if i = fGrass then
     1755              else if I = fGrass then
    17631756              begin
    17641757                LineFeed;
    17651758                AddLine(Format(HelpText.Lookup('TRAFO'),
    17661759                  [Phrases.Lookup('TERRAIN', fGrass + 12)]), pkTer, fGrass + 12,
    1767                   hkTer + hkCrossLink, fGrass + 12);
     1760                  hkTer, fGrass + 12, True);
    17681761              end;
    17691762            end;
    17701763            NextSection('SPECIAL');
    1771             if no = 3 * 12 then
     1764            if No = 3 * 12 then
    17721765            begin
    17731766              LineFeed;
     
    17801773              end;
    17811774            end
    1782             else if (no < 12) and (no <> fGrass) and (no <> fOcean) then
     1775            else if (No < 12) and (No <> fGrass) and (No <> fOcean) then
    17831776            begin
    17841777              LineFeed;
    17851778              for Special := 1 to 2 do
    1786                 if (no <> fArctic) and (no <> fSwamp) or (Special < 2) then
     1779                if (No <> fArctic) and (No <> fSwamp) or (Special < 2) then
    17871780                begin
    17881781                  if Special > 1 then
    17891782                    LineFeed;
    1790                   AddLine(Phrases.Lookup('TERRAIN', no + Special * 12), pkTer,
    1791                     no + Special * 12);
    1792                   i := FoodRes[Special] - FoodRes[0];
    1793                   if i <> 0 then
     1783                  AddLine(Phrases.Lookup('TERRAIN', No + Special * 12), pkTer,
     1784                    No + Special * 12);
     1785                  I := FoodRes[Special] - FoodRes[0];
     1786                  if I <> 0 then
    17941787                    MainText[Count - 1] := MainText[Count - 1] +
    1795                       Format(HelpText.Lookup('SPECIALFOOD'), [i]);
    1796                   i := ProdRes[Special] - ProdRes[0];
    1797                   if i <> 0 then
     1788                      Format(HelpText.Lookup('SPECIALFOOD'), [I]);
     1789                  I := ProdRes[Special] - ProdRes[0];
     1790                  if I <> 0 then
    17981791                    MainText[Count - 1] := MainText[Count - 1] +
    1799                       Format(HelpText.Lookup('SPECIALPROD'), [i]);
    1800                   i := TradeRes[Special] - TradeRes[0];
    1801                   if i <> 0 then
     1792                      Format(HelpText.Lookup('SPECIALPROD'), [I]);
     1793                  I := TradeRes[Special] - TradeRes[0];
     1794                  if I <> 0 then
    18021795                    MainText[Count - 1] := MainText[Count - 1] +
    1803                       Format(HelpText.Lookup('SPECIALTRADE'), [i]);
     1796                      Format(HelpText.Lookup('SPECIALTRADE'), [I]);
    18041797                end;
    18051798            end;
    1806             if no = 3 * 12 then
     1799            if No = 3 * 12 then
    18071800            begin
    18081801              LineFeed;
    18091802              AddTextual(HelpText.Lookup('RARE'));
    18101803            end;
    1811             if (no < 3 * 12) and (TerrType in [fDesert, fArctic]) then
     1804            if (No < 3 * 12) and (TerrType in [fDesert, fArctic]) then
    18121805            begin
    18131806              NextSection('SEEALSO');
    18141807              AddImprovement(woGardens);
    1815               CheckSeeAlso := true
     1808              CheckSeeAlso := True;
    18161809            end;
    18171810          end;
     
    18191812
    18201813      hkFeature:
    1821         if no = 200 then
     1814        if No = 200 then
    18221815        begin // complete feature list
    18231816          Caption := HelpText.Lookup('HELPTITLE_FEATURELIST');
     
    18371830            end;
    18381831            List.Clear;
    1839             for i := 0 to nFeature - 1 do
    1840               if Feature[i].Preq <> preNA then
     1832            for I := 0 to nFeature - 1 do
     1833              if Feature[I].Preq <> preNA then
    18411834              begin
    1842                 if i < mcFirstNonCap then
    1843                   j := 0
    1844                 else if i in AutoFeature then
    1845                   j := 2
     1835                if I < mcFirstNonCap then
     1836                  J := 0
     1837                else if I in AutoFeature then
     1838                  J := 2
    18461839                else
    1847                   j := 1;
    1848                 if j = Special then
    1849                   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);
    18511844              end;
    18521845            List.Sort;
     
    18571850        else
    18581851        begin // single feature
    1859           Caption := Phrases.Lookup('FEATURES', no);
     1852          Caption := Phrases.Lookup('FEATURES', No);
    18601853          LineFeed;
    1861           AddLine(Phrases.Lookup('FEATURES', no), pkBigFeature, no);
    1862           if no < mcFirstNonCap then
     1854          AddLine(Phrases.Lookup('FEATURES', No), pkBigFeature, No);
     1855          if No < mcFirstNonCap then
    18631856            AddLine(HelpText.Lookup('HELPSPEC_CAP'))
    1864           else if no in AutoFeature then
     1857          else if No in AutoFeature then
    18651858            AddLine(HelpText.Lookup('HELPSPEC_STANDARD'))
    18661859          else
    18671860            AddLine(HelpText.Lookup('HELPSPEC_FEATURE'));
    18681861          NextSection('EFFECT');
    1869           AddTextual(HelpText.LookupByHandle(hFEATUREHELP, no));
    1870           if (Feature[no].Weight <> 0) or (Feature[no].Cost <> 0) then
     1862          AddTextual(HelpText.LookupByHandle(hFEATUREHELP, No));
     1863          if (Feature[No].Weight <> 0) or (Feature[No].Cost <> 0) then
    18711864          begin
    18721865            NextSection('COSTS');
    1873             s := IntToStr(Feature[no].Cost);
    1874             if Feature[no].Cost >= 0 then
    1875               s := '+' + s;
    1876             AddLine(Format(HelpText.Lookup('COSTBASE'), [s]));
    1877             if Feature[no].Weight > 0 then
     1866            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
    18781871            begin
    18791872              AddLine(Format(HelpText.Lookup('WEIGHT'),
    1880                 ['+' + IntToStr(Feature[no].Weight)]));
    1881               if no = mcDefense then
     1873                ['+' + IntToStr(Feature[No].Weight)]));
     1874              if No = mcDefense then
    18821875                AddLine(Format(HelpText.Lookup('WEIGHT'), ['+2']),
    18831876                  pkDomain, dGround);
    18841877            end;
    18851878          end;
    1886           if Feature[no].Preq <> preNone then
     1879          if Feature[No].Preq <> preNone then
    18871880          begin
    18881881            LineFeed;
    1889             if Feature[no].Preq = preSun then
     1882            if Feature[No].Preq = preSun then
    18901883              AddPreqImp(woSun) // sun tsu feature
    18911884            else
    1892               AddPreqAdv(Feature[no].Preq);
     1885              AddPreqAdv(Feature[No].Preq);
    18931886            MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'),
    18941887              [MainText[Count - 1]]);
     
    19011894        begin
    19021895          Caption := HelpText.Lookup('HELPTITLE_MODELLIST');
    1903           for i := 0 to nSpecialModel - 1 do
    1904             if i <> 2 then
    1905               AddModelText(i);
     1896          for I := 0 to nSpecialModel - 1 do
     1897            if I <> 2 then
     1898              AddModelText(I);
    19061899          LineFeed;
    19071900          AddItem('MODELNOTE');
     
    19101903    end;
    19111904    if CheckSeeAlso then
    1912       for i := 0 to nSeeAlso - 1 do
    1913         if (SeeAlso[i].Kind = Kind) and (SeeAlso[i].no = no) then
    1914           case SeeAlso[i].SeeKind of
    1915             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);
    19181911          end;
    19191912    if (Headline >= 0) and (Count = Headline + 1) then
     
    19261919    ScrollBar.SetPos(sbPos);
    19271920    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));
    19291922    Sel := -1;
    19301923  end; // with MainText
    19311924end;
    19321925
    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
     1926procedure THelpDlg.ShowNewContent(NewMode: TWindowMode; Category: TLinkCategory;
     1927  Index: Integer);
     1928begin
     1929  if (Category <> Kind) or (Index <> No) or (Category = hkMisc) and
     1930    (Index = Integer(miscSearchResult)) then begin
    19371931    if HistItems.Count = MaxHist then HistItems.Delete(0);
    19381932    if HistItems.Count = 0 then
     
    19411935  end;
    19421936  Kind := Category;
    1943   no := Index;
     1937  No := Index;
    19441938  SearchContent := NewSearchContent;
    19451939  Prepare;
     
    19491943
    19501944procedure THelpDlg.PaintBox1MouseMove(Sender: TObject; Shift: TShiftState;
    1951   x, y: integer);
     1945  X, Y: Integer);
    19521946var
    19531947  i0, Sel0: Integer;
    19541948begin
    1955   y := y - WideFrame;
     1949  Y := Y - WideFrame;
    19561950  i0 := ScrollBar.Position;
    19571951  Sel0 := Sel;
    1958   if (x >= SideFrame) and (x < SideFrame + InnerWidth) and (y >= 0) and
    1959     (y < InnerHeight) and (y mod 24 >= 8) then
    1960     Sel := y div 24
     1952  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
    19611955  else
    19621956    Sel := -1;
    19631957  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
    19651960    Sel := -1;
    19661961  if Sel <> Sel0 then
     
    19741969
    19751970procedure THelpDlg.PaintBox1MouseDown(Sender: TObject; Button: TMouseButton;
    1976   Shift: TShiftState; x, y: integer);
     1971  Shift: TShiftState; X, Y: Integer);
    19771972begin
    19781973  if Sel >= 0 then
    19791974    with THelpLineInfo(MainText.Objects[Sel + ScrollBar.Position]) do
    1980       if Link shr 8 and $3F = hkInternet then
    1981         case Link and $FF of
     1975      if Category = hkInternet then
     1976        case Index of
    19821977          1: OpenDocument(HomeDir + AITemplateFileName);
    19831978          2: OpenURL(CevoHomepage);
     
    19861981      else
    19871982      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);
    19941985      end;
    19951986end;
     
    20031994    HistItem.Assign(HistItems.Last);
    20041995    HistItems.Delete(HistItems.Count - 1);
    2005     if (HistItem.Kind = hkMisc) and (HistItem.No = miscSearchResult) and
     1996    if (HistItem.Kind = hkMisc) and (HistItem.No = Integer(miscSearchResult)) and
    20061997      (HistItem.SearchContent <> SearchContent) then
    20071998    begin
     
    20102001    end;
    20112002    Kind := HistItem.Kind;
    2012     no := HistItem.No;
     2003    No := HistItem.No;
    20132004    Prepare(HistItem.Pos);
    20142005    OffscreenPaint;
     
    20222013  while HistItems.Count > 1 do HistItems.Delete(HistItems.Count - 1);
    20232014  Kind := hkMisc;
    2024   no := miscMain;
     2015  No := Integer(miscMain);
    20252016  Prepare;
    20262017  OffscreenPaint;
     
    20362027function THelpDlg.TextIndex(Item: string): Integer;
    20372028begin
    2038   Result := HelpText.Gethandle(Item);
     2029  Result := HelpText.GetHandle(Item);
    20392030end;
    20402031
     
    20642055      1:
    20652056        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
    20722059        NewSearchContent := InputDlg.EInput.Text;
    2073         ShowNewContent(FWindowMode, hkMisc, miscSearchResult);
     2060        ShowNewContent(FWindowMode, hkMisc, Integer(miscSearchResult));
    20742061      end;
    20752062    end;
     
    20792066procedure THelpDlg.Search(SearchString: string);
    20802067var
    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;
    20842071  bGOVHELP, bSPECIALMODEL, bJOBHELP: Boolean;
    20852072begin
     
    20922079  bJOBHELP := False;
    20932080
    2094   // search in generic reference
     2081  // Search in generic reference
    20952082  SearchString := UpperCase(SearchString);
    2096   for i := 0 to 35 + 4 do begin
    2097     s := Phrases.Lookup('TERRAIN', i);
    2098     if pos(SearchString, UpperCase(s)) > 0 then
    2099       if i < 36 then
    2100         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)
    21022089      else
    21032090      begin
    21042091        SearchResult.AddLine(Phrases.Lookup('TERRAIN', 36) + ' ' +
    21052092          HelpText.Lookup('HELPSPEC_TER'), pkNormal, 0,
    2106           hkTer + hkCrossLink, 36);
    2107         if i > 36 then
     2093          hkTer, 36, True);
     2094        if I > 36 then
    21082095          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);
    21112098        Break;
    21122099      end;
    21132100  end;
    2114   for i := 0 to nJobHelp - 1 do
    2115     if pos(SearchString, UpperCase(Phrases.Lookup('JOBRESULT', JobHelp[i]))) > 0
     2101  for I := 0 to Length(JobHelp) - 1 do
     2102    if Pos(SearchString, UpperCase(Phrases.Lookup('JOBRESULT', JobHelp[I]))) > 0
    21162103    then
    21172104    begin
    21182105      SearchResult.AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkNormal, 0,
    2119         hkMisc + hkCrossLink, miscJobList);
     2106        hkMisc, Integer(miscJobList), True);
    21202107      bJOBHELP := True;
    21212108      Break;
    21222109    end;
    2123   for i := 0 to nAdv - 1 do
    2124   begin
    2125     s := Phrases.Lookup('ADVANCES', i);
    2126     if pos(SearchString, UpperCase(s)) > 0 then
     2110  for I := 0 to nAdv - 1 do
     2111  begin
     2112    S := Phrases.Lookup('ADVANCES', I);
     2113    if Pos(SearchString, UpperCase(S)) > 0 then
    21272114    begin
    2128       if i in FutureTech then
    2129         s := s + ' ' + HelpText.Lookup('HELPSPEC_FUTURE')
     2115      if I in FutureTech then
     2116        S := S + ' ' + HelpText.Lookup('HELPSPEC_FUTURE')
    21302117      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);
    21342121    end;
    21352122  end;
    2136   for i := 0 to nSpecialModel - 1 do
    2137   begin
    2138     FindStdModelPicture(SpecialModelPictureCode[i], h, s);
    2139     if pos(SearchString, UpperCase(s)) > 0 then
     2123  for I := 0 to nSpecialModel - 1 do
     2124  begin
     2125    FindStdModelPicture(SpecialModelPictureCode[I], H, S);
     2126    if Pos(SearchString, UpperCase(S)) > 0 then
    21402127    begin
    21412128      SearchResult.AddLine(HelpText.Lookup('HELPTITLE_MODELLIST'), pkNormal, 0,
    2142         hkModel + hkCrossLink, 0);
     2129        hkModel, 0, True);
    21432130      bSPECIALMODEL := True;
    21442131      Break;
    21452132    end;
    21462133  end;
    2147   for i := 0 to nFeature - 1 do
    2148   begin
    2149     s := Phrases.Lookup('FEATURES', i);
    2150     if Pos(SearchString, UpperCase(s)) > 0 then
     2134  for I := 0 to nFeature - 1 do
     2135  begin
     2136    S := Phrases.Lookup('FEATURES', I);
     2137    if Pos(SearchString, UpperCase(S)) > 0 then
    21512138    begin
    2152       if i < mcFirstNonCap then
    2153         s := s + ' ' + HelpText.Lookup('HELPSPEC_CAP')
    2154       else if i in AutoFeature then
    2155         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')
    21562143      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);
    21602147    end;
    21612148  end;
    2162   for i := 0 to nImp - 1 do
    2163   begin
    2164     s := Phrases.Lookup('IMPROVEMENTS', i);
    2165     if Pos(SearchString, UpperCase(s)) > 0 then
     2149  for I := 0 to nImp - 1 do
     2150  begin
     2151    S := Phrases.Lookup('IMPROVEMENTS', I);
     2152    if Pos(SearchString, UpperCase(S)) > 0 then
    21662153    begin
    2167       case Imp[i].Kind of
     2154      case Imp[I].Kind of
    21682155        ikWonder:
    2169           s := s + ' ' + HelpText.Lookup('HELPSPEC_WONDER');
     2156          S := S + ' ' + HelpText.Lookup('HELPSPEC_WONDER');
    21702157        ikCommon:
    2171           s := s + ' ' + HelpText.Lookup('HELPSPEC_IMP');
     2158          S := S + ' ' + HelpText.Lookup('HELPSPEC_IMP');
    21722159        ikShipPart:
    2173           s := s + ' ' + HelpText.Lookup('HELPSPEC_SHIPPART');
     2160          S := S + ' ' + HelpText.Lookup('HELPSPEC_SHIPPART');
    21742161      else
    2175         s := s + ' ' + HelpText.Lookup('HELPSPEC_NAT')
     2162        S := S + ' ' + HelpText.Lookup('HELPSPEC_NAT')
    21762163      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);
    21792166    end
    21802167  end;
    2181   for i := 0 to nGov - 1 do
    2182     if Pos(SearchString, UpperCase(Phrases.Lookup('GOVERNMENT', i))) > 0 then
     2168  for I := 0 to nGov - 1 do
     2169    if Pos(SearchString, UpperCase(Phrases.Lookup('GOVERNMENT', I))) > 0 then
    21832170    begin
    21842171      SearchResult.AddLine(HelpText.Lookup('HELPTITLE_GOVLIST'), pkNormal, 0,
    2185         hkMisc + hkCrossLink, miscGovList);
     2172        hkMisc, Integer(miscGovList), True);
    21862173      bGOVHELP := True;
    21872174      Break;
    21882175    end;
    21892176
    2190   // full text search
    2191   h := -1;
     2177  // Full text search
     2178  H := -1;
    21922179  repeat
    2193     PrevHandle := h;
    2194     PrevIndex := i;
    2195     if not HelpText.Search(SearchString, h, i) then
     2180    PrevHandle := H;
     2181    PrevIndex := I;
     2182    if not HelpText.Search(SearchString, H, I) then
    21962183      Break;
    2197     if h = hADVHELP then
     2184    if H = hADVHELP then
    21982185    begin
    2199       if (i >= 0) and ((i <> PrevIndex) or (h <> PrevHandle)) and
    2200         not(i in mADVHELP) then
     2186      if (I >= 0) and ((I <> PrevIndex) or (H <> PrevHandle)) and
     2187        not(I in mADVHELP) then
    22012188      begin
    2202         s := Phrases.Lookup('ADVANCES', i);
    2203         if i in FutureTech then
    2204           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')
    22052192        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);
    22082195      end;
    22092196    end
    2210     else if h = hIMPHELP then
     2197    else if H = hIMPHELP then
    22112198    begin
    2212       if (i >= 0) and ((i <> PrevIndex) or (h <> PrevHandle)) and
    2213         not(i in mIMPHELP) then
     2199      if (I >= 0) and ((I <> PrevIndex) or (H <> PrevHandle)) and
     2200        not(I in mIMPHELP) then
    22142201      begin
    2215         s := Phrases.Lookup('IMPROVEMENTS', i);
    2216         case Imp[i].Kind of
     2202        S := Phrases.Lookup('IMPROVEMENTS', I);
     2203        case Imp[I].Kind of
    22172204          ikWonder:
    2218             s := s + ' ' + HelpText.Lookup('HELPSPEC_WONDER');
     2205            S := S + ' ' + HelpText.Lookup('HELPSPEC_WONDER');
    22192206          ikCommon:
    2220             s := s + ' ' + HelpText.Lookup('HELPSPEC_IMP');
     2207            S := S + ' ' + HelpText.Lookup('HELPSPEC_IMP');
    22212208          ikShipPart:
    2222             s := s + ' ' + HelpText.Lookup('HELPSPEC_SHIPPART');
     2209            S := S + ' ' + HelpText.Lookup('HELPSPEC_SHIPPART');
    22232210        else
    2224           s := s + ' ' + HelpText.Lookup('HELPSPEC_NAT')
     2211          S := S + ' ' + HelpText.Lookup('HELPSPEC_NAT')
    22252212        end;
    2226         SearchResult.AddLine(s, pkNormal, 0, hkImp + hkCrossLink, i)
     2213        SearchResult.AddLine(S, pkNormal, 0, hkImp, I, True);
    22272214      end;
    22282215    end
    2229     else if h = hFEATUREHELP then
     2216    else if H = hFEATUREHELP then
    22302217    begin
    2231       if (i >= 0) and ((i <> PrevIndex) or (h <> PrevHandle)) and
    2232         not(i in mFEATUREHELP) then
     2218      if (I >= 0) and ((I <> PrevIndex) or (H <> PrevHandle)) and
     2219        not(I in mFEATUREHELP) then
    22332220      begin
    2234         s := Phrases.Lookup('FEATURES', i);
    2235         if i < mcFirstNonCap then
    2236           s := s + ' ' + HelpText.Lookup('HELPSPEC_CAP')
    2237         else if i in AutoFeature then
    2238           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')
    22392226        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);
    22422229      end;
    22432230    end
    2244     else if h = hGOVHELP then
     2231    else if H = hGOVHELP then
    22452232    begin
    2246       if (i >= 0) and (h <> PrevHandle) and not bGOVHELP then
     2233      if (I >= 0) and (H <> PrevHandle) and not bGOVHELP then
    22472234        SearchResult.AddLine(HelpText.Lookup('HELPTITLE_GOVLIST'), pkNormal, 0,
    2248           hkMisc + hkCrossLink, miscGovList)
     2235          hkMisc, Integer(miscGovList), True);
    22492236    end
    2250     else if h = hSPECIALMODEL then
     2237    else if H = hSPECIALMODEL then
    22512238    begin
    2252       if (i >= 0) and (h <> PrevHandle) and not bSPECIALMODEL then
     2239      if (I >= 0) and (H <> PrevHandle) and not bSPECIALMODEL then
    22532240        SearchResult.AddLine(HelpText.Lookup('HELPTITLE_MODELLIST'), pkNormal,
    2254           0, hkModel + hkCrossLink, 0)
     2241          0, hkModel, 0, True);
    22552242    end
    2256     else if h = hJOBHELP then
     2243    else if H = hJOBHELP then
    22572244    begin
    2258       if (i >= 0) and (h <> PrevHandle) and not bJOBHELP then
     2245      if (I >= 0) and (H <> PrevHandle) and not bJOBHELP then
    22592246        SearchResult.AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkNormal, 0,
    2260           hkMisc + hkCrossLink, miscJobList)
     2247          hkMisc, Integer(miscJobList), True);
    22612248    end
    2262     else if { (h<>hMAIN) and } (h <> PrevHandle) then
     2249    else if { (h<>hMAIN) and } (H <> PrevHandle) then
    22632250    begin
    2264       s := HelpText.LookupByHandle(h);
    2265       p := Pos('$', s);
    2266       if p > 0 then
     2251      S := HelpText.LookupByHandle(H);
     2252      P := Pos('$', S);
     2253      if P > 0 then
    22672254      begin
    2268         s := Copy(s, p + 1, maxint);
    2269         p := Pos('\', s);
    2270         if p > 0 then
    2271           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);
    22732260      end;
    22742261    end;
    2275     until False;
    2276 
    2277     // cut lines to fit to window
    2278     RightMargin := InnerWidth - 16 - DpiGetSystemMetrics(SM_CXVSCROLL);
    2279     OffScreen.Canvas.Font.Assign(UniFont[ftNormal]);
    2280     for i := 0 to SearchResult.Count - 1 do
    2281     begin
    2282       while BiColorTextWidth(OffScreen.Canvas, SearchResult[i]) >
    2283         RightMargin - 32 do
    2284         SearchResult[i] := copy(SearchResult[i], 1, length(SearchResult[i]) - 1)
    2285     end;
    2286   end;
     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;
     2273end;
    22872274
    22882275end.
  • branches/highdpi/LocalPlayer/IsoEngine.pas

    r405 r465  
    55
    66uses
    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;
    99
    1010const
     
    1313
    1414type
    15   TInitEnemyModelEvent = function(emix: integer): boolean;
     15  TInitEnemyModelEvent = function(emix: Integer): Boolean;
    1616  TTileSize = (tsSmall, tsMedium, tsBig);
    1717
     
    3333      Dirx: array [0..7] of Integer = (1, 2, 1, 0, -1, -2, -1, 0);
    3434      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;
    3737    procedure MakeDark(Line: PPixelPointer; Length: Integer);
    3838    procedure SetTileSize(AValue: TTileSize);
    39     procedure ShadeOutside(x0, y0, Width, Height, xm, ym: integer);
     39    procedure ShadeOutside(x0, y0, Width, Height, xm, ym: Integer);
    4040  protected
    4141    FOutput: TDpiBitmap;
     
    6565    ShowDebug: Boolean;
    6666    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);
    7979    procedure ApplyTileSize(ATileSize: TTileSize);
    8080  public
     
    8989    procedure Reset;
    9090    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);
    100100    procedure AttackBegin(const ShowMove: TShowMove);
    101101    procedure AttackEffect(const ShowMove: TShowMove);
    102102    procedure AttackEnd;
    103103    procedure ReduceTerrainIconsSize;
    104     property AdviceLoc: integer read FAdviceLoc write FAdviceLoc;
     104    property AdviceLoc: Integer read FAdviceLoc write FAdviceLoc;
    105105    property TileSize: TTileSize read FTileSize write SetTileSize;
    106106  end;
     
    127127    (X: 72; Y: 36));
    128128
    129 function IsJungle(y: integer): boolean;
     129function IsJungle(Y: Integer): Boolean;
    130130procedure Init(InitEnemyModelHandler: TInitEnemyModelEvent);
    131131
     
    173173  IsoMapCache: array[TTileSize] of TIsoMapCache;
    174174
    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)
     175function IsJungle(Y: Integer): Boolean;
     176begin
     177  Result := (Y > (G.ly - 2) div 4) and (G.ly - 1 - Y > (G.ly - 2) div 4)
    178178end;
    179179
     
    254254  Mask24.BeginUpdate;
    255255  for ySrc := 0 to TerrainIconLines - 1 do begin
    256     for i := 0 to yyt * 3 - 1 do
    257       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));
    259259    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;
    262262      repeat
    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;
     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;
    267267        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;
    271271      repeat
    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;
     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;
    276276        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;
    280280      repeat
    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;
     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;
    285285        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;
    289289      repeat
    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;
     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;
    294294        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);
    297297    end;
    298298  end;
     
    303303procedure TIsoMap.ApplyTileSize(ATileSize: TTileSize);
    304304var
    305   x: Integer;
    306   y: Integer;
     305  X: Integer;
     306  Y: Integer;
    307307  xSrc: Integer;
    308308  ySrc: Integer;
     
    357357  DitherMask.SetSize(xxt * 2, yyt * 2);
    358358  DitherMask.Canvas.FillRect(0, 0, DitherMask.Width, DitherMask.Height);
    359   DpiBitCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2,
     359  DpiBitBltCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2,
    360360    HGrTerrain.Mask.Canvas, 1 + 7 * (xxt * 2 + 1),
    361361    1 + yyt + 15 * (yyt * 3 + 1), SRCAND);
    362362
    363   for x := -1 to 6 do begin
    364     if x = -1 then begin
     363  for X := -1 to 6 do begin
     364    if X = -1 then begin
    365365      xSrc := ShoreDither * (xxt * 2 + 1) + 1;
    366366      ySrc := 1 + yyt;
    367367    end
    368     else if x = 6 then begin
     368    else if X = 6 then begin
    369369      xSrc := 1 + (xxt * 2 + 1) * 2;
    370370      ySrc := 1 + yyt + (yyt * 3 + 1) * 2;
    371371    end else begin
    372       xSrc := (x + 2) * (xxt * 2 + 1) + 1;
     372      xSrc := (X + 2) * (xxt * 2 + 1) + 1;
    373373      ySrc := 1 + yyt;
    374374    end;
    375     for y := -1 to 6 do
    376       DpiBitCanvas(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,
    377377        xxt * 2, yyt, HGrTerrain.Data.Canvas, xSrc, ySrc);
    378     for y := -2 to 6 do
    379       DpiBitCanvas(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,
    380380        yyt, HGrTerrain.Data.Canvas, xSrc + xxt, ySrc + yyt,
    381381        SRCPAINT);
    382     for y := -2 to 6 do
    383       DpiBitCanvas(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,
    384384        xxt, yyt, HGrTerrain.Data.Canvas, xSrc, ySrc + yyt,
    385385        SRCPAINT);
    386     for y := -2 to 6 do
    387       DpiBitCanvas(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,
    388388        yyt, DitherMask.Canvas, xxt, yyt, SRCAND);
    389     for y := -2 to 6 do
    390       DpiBitCanvas(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,
    391391        xxt, yyt, DitherMask.Canvas, 0, yyt, SRCAND);
    392392  end;
    393393
    394   for y := -1 to 6 do begin
    395     if y = -1 then begin
     394  for Y := -1 to 6 do begin
     395    if Y = -1 then begin
    396396      xSrc := ShoreDither * (xxt * 2 + 1) + 1;
    397397      ySrc := 1 + yyt;
    398398    end
    399     else if y = 6 then begin
     399    else if Y = 6 then begin
    400400      xSrc := 1 + 2 * (xxt * 2 + 1);
    401401      ySrc := 1 + yyt + 2 * (yyt * 3 + 1);
    402402    end else begin
    403       xSrc := (y + 2) * (xxt * 2 + 1) + 1;
     403      xSrc := (Y + 2) * (xxt * 2 + 1) + 1;
    404404      ySrc := 1 + yyt;
    405405    end;
    406     for x := -2 to 6 do
    407       DpiBitCanvas(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,
    408408        xxt * 2, yyt, HGrTerrain.Data.Canvas, xSrc, ySrc);
    409     DpiBitCanvas(LandMore.Canvas, xxt * 2, (y + 2) * yyt, xxt, yyt,
     409    DpiBitBltCanvas(LandMore.Canvas, xxt * 2, (Y + 2) * yyt, xxt, yyt,
    410410      HGrTerrain.Data.Canvas, xSrc + xxt, ySrc + yyt, SRCPAINT);
    411     for x := 0 to 7 do
    412       DpiBitCanvas(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,
    413413        xxt * 2, yyt, HGrTerrain.Data.Canvas, xSrc, ySrc + yyt,
    414414        SRCPAINT);
    415     for x := -2 to 6 do
    416       DpiBitCanvas(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,
    417417        xxt * 2, yyt, DitherMask.Canvas, 0, 0, SRCAND);
    418418  end;
    419419
    420   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
     420  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
    423423      else
    424         xSrc := (x mod 2) * (xxt * 2 + 1) + 1;
     424        xSrc := (X mod 2) * (xxt * 2 + 1) + 1;
    425425      ySrc := 1 + yyt;
    426       if (x >= 1) = (y >= 2) then
    427         DpiBitCanvas(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,
    428428          HGrTerrain.Data.Canvas, xSrc, ySrc);
    429       if (x >= 1) and ((y < 2) or (x >= 2)) then
     429      if (X >= 1) and ((Y < 2) or (X >= 2)) then
    430430      begin
    431         DpiBitCanvas(OceanPatch.Canvas, x * (xxt * 2), y * yyt, xxt, yyt,
     431        DpiBitBltCanvas(OceanPatch.Canvas, X * (xxt * 2), Y * yyt, xxt, yyt,
    432432          HGrTerrain.Data.Canvas, xSrc + xxt, ySrc + yyt,
    433433          SRCPAINT);
    434         DpiBitCanvas(OceanPatch.Canvas, x * (xxt * 2) + xxt, y * yyt, xxt, yyt,
     434        DpiBitBltCanvas(OceanPatch.Canvas, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt,
    435435          HGrTerrain.Data.Canvas, xSrc, ySrc + yyt, SRCPAINT);
    436436      end;
    437       DpiBitCanvas(OceanPatch.Canvas, x * (xxt * 2), y * yyt, xxt, yyt,
     437      DpiBitBltCanvas(OceanPatch.Canvas, X * (xxt * 2), Y * yyt, xxt, yyt,
    438438        DitherMask.Canvas, xxt, yyt, SRCAND);
    439       DpiBitCanvas(OceanPatch.Canvas, x * (xxt * 2) + xxt, y * yyt, xxt, yyt,
     439      DpiBitBltCanvas(OceanPatch.Canvas, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt,
    440440        DitherMask.Canvas, 0, yyt, SRCAND);
    441441    end;
    442442  end;
    443443
    444   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
     444  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
    447447      else
    448         xSrc := (y mod 2) * (xxt * 2 + 1) + 1;
     448        xSrc := (Y mod 2) * (xxt * 2 + 1) + 1;
    449449      ySrc := 1 + yyt;
    450       if (x < 1) or (y >= 2) then
    451         DpiBitCanvas(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,
    452452          HGrTerrain.Data.Canvas, xSrc, ySrc);
    453       if (x = 1) and (y < 2) or (x >= 2) and (y >= 1) then
     453      if (X = 1) and (Y < 2) or (X >= 2) and (Y >= 1) then
    454454      begin
    455         DpiBitCanvas(OceanMore.Canvas, x * (xxt * 2), y * yyt, xxt, yyt,
     455        DpiBitBltCanvas(OceanMore.Canvas, X * (xxt * 2), Y * yyt, xxt, yyt,
    456456          HGrTerrain.Data.Canvas, xSrc + xxt, ySrc + yyt,
    457457          SRCPAINT);
    458         DpiBitCanvas(OceanMore.Canvas, x * (xxt * 2) + xxt, y * yyt, xxt, yyt,
     458        DpiBitBltCanvas(OceanMore.Canvas, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt,
    459459          HGrTerrain.Data.Canvas, xSrc, ySrc + yyt, SRCPAINT);
    460460      end;
    461       DpiBitCanvas(OceanMore.Canvas, x * (xxt * 2), y * yyt, xxt * 2, yyt,
     461      DpiBitBltCanvas(OceanMore.Canvas, X * (xxt * 2), Y * yyt, xxt * 2, yyt,
    462462        DitherMask.Canvas, 0, 0, SRCAND);
    463463    end;
    464464  end;
    465465
    466   DpiBitCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2,
     466  DpiBitBltCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2,
    467467    DitherMask.Canvas, 0, 0, DSTINVERT); { invert dither mask }
    468   DpiBitCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2,
     468  DpiBitBltCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2,
    469469    HGrTerrain.Mask.Canvas, 1, 1 + yyt, SRCPAINT);
    470470
    471   for x := -1 to 6 do
    472     for y := -2 to 6 do
    473       DpiBitCanvas(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,
    474474        xxt * 2, yyt, DitherMask.Canvas, 0, 0, SRCAND);
    475475
    476   for y := -1 to 6 do
    477     for x := -2 to 7 do
    478       DpiBitCanvas(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,
    479479        xxt * 2, yyt, DitherMask.Canvas, 0, yyt, SRCAND);
    480480
    481   DpiBitCanvas(LandPatch.Canvas, 0, 0, (xxt * 2) * 9, yyt * 9,
     481  DpiBitBltCanvas(LandPatch.Canvas, 0, 0, (xxt * 2) * 9, yyt * 9,
    482482    LandMore.Canvas, 0, 0, SRCPAINT);
    483483
    484   for x := 0 to 3 do
    485     for y := 0 to 3 do
    486       DpiBitCanvas(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,
    487487        DitherMask.Canvas, 0, 0, SRCAND);
    488488
    489   for y := 0 to 3 do
    490     for x := 0 to 4 do
    491       DpiBitCanvas(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,
    492492        yyt, DitherMask.Canvas, 0, yyt, SRCAND);
    493493
    494   DpiBitCanvas(OceanPatch.Canvas, 0, 0, (xxt * 2) * 4, yyt * 4,
     494  DpiBitBltCanvas(OceanPatch.Canvas, 0, 0, (xxt * 2) * 4, yyt * 4,
    495495    OceanMore.Canvas, 0, 0, SRCPAINT);
    496496
     
    499499    FillRect(Rect(0, 0, xxt * 2, yyt));
    500500  end;
    501   DpiBitCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt,
     501  DpiBitBltCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt,
    502502    HGrTerrain.Mask.Canvas, 1, 1 + yyt);
    503503
    504   for x := 0 to 6 do
    505     DpiBitCanvas(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,
    506506      DitherMask.Canvas, 0, 0, SRCAND);
    507   DpiBitCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt, DitherMask.Canvas,
     507  DpiBitBltCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt, DitherMask.Canvas,
    508508    0, 0, DSTINVERT);
    509509
    510   for y := 0 to 6 do
    511     DpiBitCanvas(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,
    512512      DitherMask.Canvas, 0, 0, SRCAND);
    513513
     
    555555end;
    556556
    557 procedure TIsoMap.SetPaintBounds(Left, Top, Right, Bottom: integer);
     557procedure TIsoMap.SetPaintBounds(Left, Top, Right, Bottom: Integer);
    558558begin
    559559  FLeft := Left;
     
    563563end;
    564564
    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;
     565procedure TIsoMap.FillRect(X, Y, Width, Height, Color: Integer);
     566begin
     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;
    581581  if (Width <= 0) or (Height <= 0) then
    582     exit;
     582    Exit;
    583583
    584584  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));
    586586  FOutput.Canvas.Brush.Style := bsClear;
    587587end;
    588588
    589 procedure TIsoMap.Textout(x, y, Color: integer; const s: string);
     589procedure TIsoMap.Textout(X, Y, Color: Integer; const S: string);
    590590begin
    591591  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 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;
     592  FOutput.Canvas.TextRect(Rect(FLeft, FTop, FRight, FBottom), X, Y, S)
     593end;
     594
     595procedure TIsoMap.BitBltBitmap(Src: TDpiBitmap; X, Y, Width, Height, xSrc, ySrc,
     596  Rop: Integer);
     597begin
     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;
    614614  if (Width <= 0) or (Height <= 0) then
    615     exit;
    616 
    617   DpiBitCanvas(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);
     618end;
     619
     620procedure TIsoMap.Sprite(HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);
    621621begin
    622622  BitBltBitmap(HGr.Mask, xDst, yDst, Width, Height, xGr, yGr, SRCAND);
     
    624624end;
    625625
    626 procedure TIsoMap.TSprite(xDst, yDst, grix: integer;
    627   PureBlack: boolean = false);
     626procedure TIsoMap.TSprite(xDst, yDst, grix: Integer;
     627  PureBlack: Boolean = False);
    628628var
    629629  Width: Integer;
    630630  Height: Integer;
    631631  xSrc: Integer;
    632   ySrc: integer;
     632  ySrc: Integer;
    633633begin
    634634  Width := TSpriteSize[grix].Right - TSpriteSize[grix].Left;
     
    653653    Height := FBottom - yDst;
    654654  if (Width <= 0) or (Height <= 0) then
    655     exit;
    656 
    657   DpiBitCanvas(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);
    658658  if not PureBlack then
    659     DpiBitCanvas(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);
     660end;
     661
     662procedure TIsoMap.PaintUnit(X, Y: Integer; const UnitInfo: TUnitInfo;
     663  Status: Integer);
     664var
     665  xsh, ysh, xGr, yGr, J, mixShow: Integer;
    666666begin
    667667  with UnitInfo do
    668     if (Owner = me) or (emix <> $FFFF) then
     668    if (Owner = Me) or (emix <> $FFFF) then
    669669    begin
    670670      if Job = jCity then
     
    675675        (@OnInitEnemyModel <> nil) then
    676676        if not OnInitEnemyModel(emix) then
    677           exit;
     677          Exit;
    678678      xsh := Tribe[Owner].ModelPicture[mixShow].xShield;
    679679      ysh := Tribe[Owner].ModelPicture[mixShow].yShield;
    680680{$IFNDEF SCR} if Status and usStay <> 0 then
    681         j := 19
     681        J := 19
    682682      else if Status and usRecover <> 0 then
    683         j := 16
     683        J := 16
    684684      else if Status and (usGoto or usEnhance) = usGoto or usEnhance then
    685         j := 18
     685        J := 18
    686686      else if Status and usEnhance <> 0 then
    687         j := 17
     687        J := 17
    688688      else if Status and usGoto <> 0 then
    689         j := 20
     689        J := 20
    690690      else {$ENDIF} if Job = jCity then
    691           j := jNone
     691          J := jNone
    692692        else
    693           j := Job;
     693          J := Job;
    694694      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,
    696696          33 + Tribe[Owner].sympix mod 10 * 65,
    697697          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,
    699699        18 + Tribe[Owner].sympix mod 10 * 65,
    700700        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,
    702702        ColorOfHealth(Health));
    703       if j > 0 then
     703      if J > 0 then
    704704      begin
    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,
     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,
    708708          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);
    710710      end;
    711711      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);
    713713      if Flags and unFortified <> 0 then
    714714      begin
    715715        { DataCanvas:=HGrTerrain.Data.Canvas;
    716716          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);
    719719      end;
    720720    end;
    721 end; { PaintUnit }
    722 
    723 procedure TIsoMap.PaintCity(x, y: integer; const CityInfo: TCityInfo;
    724   accessory: boolean);
     721end;
     722
     723procedure TIsoMap.PaintCity(X, Y: Integer; const CityInfo: TCityInfo;
     724  accessory: Boolean);
    725725var
    726726  age: Integer;
     
    733733  LabelLength: Integer;
    734734  cpic: TCityPicture;
    735   s: string;
     735  S: string;
    736736begin
    737737  age := GetAge(CityInfo.Owner);
     
    752752      (cHGr.Data.Canvas.Pixels[(xGr + 4) * 65, cpix * 49 + 48] = $00FFFF)
    753753    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,
    755755        xGr * (xxc * 2 + 1) + 1, 1 + cpix * (yyc * 3 + 1));
    756756    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,
    758758        (xGr + 4) * (xxc * 2 + 1) + 1, 1 + cpix * (yyc * 3 + 1));
    759759  end
     
    761761  begin
    762762    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,
    764764        (xGr + 4) * (2 * xxt + 1) + 1, 1 + (age - 2) * (3 * yyt + 1))
    765765    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,
    767767        xGr * (2 * xxt + 1) + 1, 1 + (age - 2) * (3 * yyt + 1));
    768768  end;
    769769
    770770  if not accessory then
    771     exit;
     771    Exit;
    772772
    773773  { 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,
    775775    1+Tribe[CityInfo.Owner].sympix mod 10 *65,
    776776    1+Tribe[CityInfo.Owner].sympix div 10 *49); {capital -- paint flag }
     
    781781    begin
    782782      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;
    785785    end
    786786    else
    787787    begin
    788788      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;
    791791    end;
    792     s := IntToStr(CityInfo.size);
    793     LabelLength := FOutput.Canvas.TextWidth(s);
     792    S := IntToStr(CityInfo.size);
     793    LabelLength := FOutput.Canvas.TextWidth(S);
    794794    FillRect(xShield, yShield, LabelLength + 4, 16, $000000);
    795795    if MyMap[CityInfo.Loc] and (fUnit or fObserved) = fObserved then
     
    802802      LabelTextColor := $000000;
    803803    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;
     806end;
     807
     808function PoleTile(Loc: Integer): Integer;
    809809begin { virtual pole tile }
    810   result := fUNKNOWN;
     810  Result := fUNKNOWN;
    811811  if Loc < -2 * G.lx then
    812812  else if Loc < -G.lx then
     
    815815      (MyMap[dLoc(Loc, -2, 2)] and fTerrain <> fUNKNOWN) and
    816816      (MyMap[dLoc(Loc, 2, 2)] and fTerrain <> fUNKNOWN) then
    817       result := fArctic;
     817      Result := fArctic;
    818818    if (MyMap[dLoc(Loc, 0, 2)] and fObserved <> 0) and
    819819      (MyMap[dLoc(Loc, -2, 2)] and fObserved <> 0) and
    820820      (MyMap[dLoc(Loc, 2, 2)] and fObserved <> 0) then
    821       result := result or fObserved;
     821      Result := Result or fObserved;
    822822  end
    823823  else if Loc < 0 then
     
    825825    if (MyMap[dLoc(Loc, -1, 1)] and fTerrain <> fUNKNOWN) and
    826826      (MyMap[dLoc(Loc, 1, 1)] and fTerrain <> fUNKNOWN) then
    827       result := fArctic;
     827      Result := fArctic;
    828828    if (MyMap[dLoc(Loc, -1, 1)] and fObserved <> 0) and
    829829      (MyMap[dLoc(Loc, 1, 1)] and fObserved <> 0) then
    830       result := result or fObserved;
     830      Result := Result or fObserved;
    831831  end
    832832  else if Loc < G.lx * (G.ly + 1) then
     
    834834    if (MyMap[dLoc(Loc, -1, -1)] and fTerrain <> fUNKNOWN) and
    835835      (MyMap[dLoc(Loc, 1, -1)] and fTerrain <> fUNKNOWN) then
    836       result := fArctic;
     836      Result := fArctic;
    837837    if (MyMap[dLoc(Loc, -1, -1)] and fObserved <> 0) and
    838838      (MyMap[dLoc(Loc, 1, -1)] and fObserved <> 0) then
    839       result := result or fObserved;
     839      Result := Result or fObserved;
    840840  end
    841841  else if Loc < G.lx * (G.ly + 2) then
     
    844844      (MyMap[dLoc(Loc, -2, -2)] and fTerrain <> fUNKNOWN) and
    845845      (MyMap[dLoc(Loc, 2, -2)] and fTerrain <> fUNKNOWN) then
    846       result := fArctic;
     846      Result := fArctic;
    847847    if (MyMap[dLoc(Loc, 0, -2)] and fObserved <> 0) and
    848848      (MyMap[dLoc(Loc, -2, -2)] and fObserved <> 0) and
    849849      (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;
     852end;
     853
     854function TIsoMap.Connection4(Loc, Mask, Value: Integer): Integer;
     855begin
     856  Result := 0;
    857857  if dLoc(Loc, 1, -1) >= 0 then
    858858  begin
    859859    if MyMap[dLoc(Loc, 1, -1)] and Mask = Cardinal(Value) then
    860       inc(result, 1);
     860      Inc(Result, 1);
    861861    if MyMap[dLoc(Loc, -1, -1)] and Mask = Cardinal(Value) then
    862       inc(result, 8);
     862      Inc(Result, 8);
    863863  end;
    864864  if dLoc(Loc, 1, 1) < G.lx * G.ly then
    865865  begin
    866866    if MyMap[dLoc(Loc, 1, 1)] and Mask = Cardinal(Value) then
    867       inc(result, 2);
     867      Inc(Result, 2);
    868868    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;
     871end;
     872
     873function TIsoMap.Connection8(Loc, Mask: Integer): Integer;
    874874var
    875875  Dir: Integer;
    876876  ConnLoc: Integer;
    877877begin
    878   result := 0;
     878  Result := 0;
    879879  for Dir := 0 to 7 do
    880880  begin
     
    882882    if (ConnLoc >= 0) and (ConnLoc < G.lx * G.ly) and
    883883      (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;
     886end;
     887
     888function TIsoMap.OceanConnection(Loc: Integer): Integer;
    889889var
    890890  Dir: Integer;
    891891  ConnLoc: Integer;
    892892begin
    893   result := 0;
     893  Result := 0;
    894894  for Dir := 0 to 7 do
    895895  begin
     
    897897    if (ConnLoc < 0) or (ConnLoc >= G.lx * G.ly) or
    898898      ((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;
     901end;
     902
     903procedure TIsoMap.PaintShore(X, Y, Loc: Integer);
    904904var
    905905  Conn: Integer;
    906906  Tile: Integer;
    907907begin
    908   if (y <= FTop - yyt * 2) or (y > FBottom) or (x <= FLeft - xxt * 2) or
    909     (x > FRight) then
    910     exit;
     908  if (Y <= FTop - yyt * 2) or (Y > FBottom) or (X <= FLeft - xxt * 2) or
     909    (X > FRight) then
     910    Exit;
    911911  if (Loc < 0) or (Loc >= G.lx * G.ly) then
    912     exit;
     912    Exit;
    913913  Tile := MyMap[Loc];
    914914  if Tile and fTerrain >= fGrass then
    915     exit;
     915    Exit;
    916916  Conn := OceanConnection(Loc);
    917917  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,
    921921    1 + (Conn shr 6 + Conn and 1 shl 2) * (xxt * 2 + 1),
    922922    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,
    924924    1 + (Conn and 7) * (xxt * 2 + 1) + xxt,
    925925    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,
    927927    1 + (Conn shr 2 and 7) * (xxt * 2 + 1) + xxt,
    928928    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,
    930930    1 + (Conn shr 4 and 7) * (xxt * 2 + 1),
    931931    1 + yyt * 2 + (16 + Tile and fTerrain) * (yyt * 3 + 1), SRCPAINT);
    932932  Conn := Connection4(Loc, fTerrain, fUNKNOWN); { dither to black }
    933933  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) +
    935935      xxt, 1 + yyt + 15 * (yyt * 3 + 1), SRCAND);
    936936  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,
    938938      1 + 7 * (xxt * 2 + 1) + xxt, 1 + yyt * 2 + 15 * (yyt * 3 + 1), SRCAND);
    939939  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),
    941941      1 + yyt * 2 + 15 * (yyt * 3 + 1), SRCAND);
    942942  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),
    944944      1 + yyt + 15 * (yyt * 3 + 1), SRCAND);
    945945end;
    946946
    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;
     947procedure TIsoMap.PaintTileExtraTerrain(X, Y, Loc: Integer);
     948var
     949  Dir, Conn, RRConn, yGr, Tile, yLoc: Integer;
     950begin
     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;
    954954  Tile := MyMap[Loc];
    955955  if Tile and fTerrain = fForest then
     
    966966    then
    967967      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);
    969969  end
    970970  else if Tile and fTerrain in [fHills, fMountains, fForest] then
     
    972972    yGr := 3 + 2 * (Tile and fTerrain - fForest);
    973973    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);
    975975  end
    976976  else if Tile and fDeadLands <> 0 then
    977     TSprite(x, y, spRow2);
     977    TSprite(X, Y, spRow2);
    978978
    979979  if ShowObjects then
    980980  begin
    981981    if Tile and fTerImp = tiFarm then
    982       TSprite(x, y, spFarmLand)
     982      TSprite(X, Y, spFarmLand)
    983983    else if Tile and fTerImp = tiIrrigation then
    984       TSprite(x, y, spIrrigation);
     984      TSprite(X, Y, spIrrigation);
    985985  end;
    986986  if Tile and fRiver <> 0 then
     
    989989      Connection4(Loc, fTerrain, fShore) or Connection4(Loc, fTerrain,
    990990      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);
    992992  end;
    993993
     
    997997    for Dir := 0 to 3 do
    998998      if Conn and (1 shl Dir) <> 0 then { river mouths }
    999         TSprite(x, y, spRiverMouths + Dir);
     999        TSprite(X, Y, spRiverMouths + Dir);
    10001000    if ShowObjects then
    10011001    begin
     
    10031003      for Dir := 0 to 7 do
    10041004        if Conn and (1 shl Dir) <> 0 then { canal mouths }
    1005           TSprite(x, y, spCanalMouths + 1 + Dir);
     1005          TSprite(X, Y, spCanalMouths + 1 + Dir);
    10061006    end;
    10071007  end;
     
    10151015      if Conn = 0 then begin
    10161016        if Tile and fCanal <> 0 then
    1017           TSprite(x, y, spCanal);
     1017          TSprite(X, Y, spCanal);
    10181018      end
    10191019      else
    10201020        for Dir := 0 to 7 do
    10211021          if (1 shl Dir) and Conn <> 0 then
    1022             TSprite(x, y, spCanal + 1 + Dir);
     1022            TSprite(X, Y, spCanal + 1 + Dir);
    10231023    end;
    10241024
     
    10321032      Conn := Connection8(Loc, fRoad or fRR or fCity) and not RRConn;
    10331033      if (Conn = 0) and (Tile and (fRR or fCity) = 0) then
    1034         TSprite(x, y, spRoad)
     1034        TSprite(X, Y, spRoad)
    10351035      else if Conn > 0 then
    10361036        for Dir := 0 to 7 do
    10371037          if (1 shl Dir) and Conn <> 0 then
    1038             TSprite(x, y, spRoad + 1 + Dir);
     1038            TSprite(X, Y, spRoad + 1 + Dir);
    10391039    end;
    10401040
    10411041    // Paint railroad connections
    10421042    if (Tile and fRR <> 0) and (RRConn = 0) then
    1043       TSprite(x, y, spRailRoad)
     1043      TSprite(X, Y, spRailRoad)
    10441044    else if RRConn > 0 then begin
    10451045      for Dir := 0 to 7 do
    10461046        if (1 shl Dir) and RRConn <> 0 then
    1047           TSprite(x, y, spRailRoad + 1 + Dir);
     1047          TSprite(X, Y, spRailRoad + 1 + Dir);
    10481048    end;
    10491049  end;
     
    10511051
    10521052// (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;
     1053procedure TIsoMap.PaintTileObjects(X, Y, Loc, CityLoc, CityOwner: Integer;
     1054  UseBlink: Boolean);
     1055var
     1056  p1, p2, uix, cix, dy, Loc1, Tile, Multi, Destination: Integer;
    10571057  CityInfo: TCityInfo;
    10581058  UnitInfo: TUnitInfo;
    1059   fog: boolean;
     1059  fog: Boolean;
    10601060  SpecialRow: Integer;
    10611061  SpecialCol: Integer;
     
    10631063  procedure NameCity;
    10641064  var
    1065     cix, xs, w: integer;
     1065    cix, xs, W: Integer;
    10661066    BehindCityInfo: TCityInfo;
    1067     s: string;
    1068     IsCapital: boolean;
     1067    S: string;
     1068    IsCapital: Boolean;
    10691069  begin
    10701070    BehindCityInfo.Loc := Loc - 2 * G.lx;
     
    10761076      IsCapital := BehindCityInfo.Flags and ciCapital <> 0;
    10771077      { 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;
    10811081      if IsCapital then
    10821082        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);
    10851085      if IsCapital then
    10861086        FOutput.Canvas.Font.Style := FOutput.Canvas.Font.Style - [fsUnderline];
     
    10921092    if ShowObjects and not (moEditMode in MapOptions) and
    10931093      (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);
    10951095  end;
    10961096
    10971097  procedure PaintBorder;
    10981098  var
    1099     dx, dy: integer;
     1099    dx, dy: Integer;
    11001100  begin
    11011101    if ShowBorder and (Loc >= 0) and (Loc < G.lx * G.ly) and
    11021102      (Tile and fTerrain <> fUNKNOWN) then begin
    11031103      p1 := MyRO.Territory[Loc];
    1104       if (p1 >= 0) and (ShowMyBorder or (p1 <> me)) then begin
     1104      if (p1 >= 0) and (ShowMyBorder or (p1 <> Me)) then begin
    11051105        if BordersOK^ and (1 shl p1) = 0 then begin
    11061106          UnshareBitmap(Borders);
    1107           DpiBitCanvas(Borders.Canvas, 0, p1 * (yyt * 2), xxt * 2,
     1107          DpiBitBltCanvas(Borders.Canvas, 0, p1 * (yyt * 2), xxt * 2,
    11081108            yyt * 2, HGrTerrain.Data.Canvas,
    11091109            1 + 8 * (xxt * 2 + 1), 1 + yyt + 16 * (yyt * 3 + 1));
     
    11231123              if p2 <> p1 then
    11241124              begin
    1125                 BitBltBitmap(HGrTerrain.Mask, x + dx * xxt, y + dy * yyt, xxt,
     1125                BitBltBitmap(HGrTerrain.Mask, X + dx * xxt, Y + dy * yyt, xxt,
    11261126                  yyt, 1 + 8 * (xxt * 2 + 1) + dx * xxt,
    11271127                  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,
    11291129                  p1 * (yyt * 2) + dy * yyt, SRCPAINT);
    11301130              end;
     
    11431143    (Tile and fCity <> 0) then
    11441144    GetCityInfo(Loc, cix, CityInfo);
    1145   if (y <= FTop - yyt * 2) or (y > FBottom) or (x <= FLeft - xxt * 2) or
    1146     (x > FRight) then
     1145  if (Y <= FTop - yyt * 2) or (Y > FBottom) or (X <= FLeft - xxt * 2) or
     1146    (X > FRight) then
    11471147  begin
    11481148    NameCity;
    11491149    ShowSpacePort;
    1150     exit;
     1150    Exit;
    11511151  end;
    11521152  if Tile and fTerrain = fUNKNOWN then
     
    11541154    NameCity;
    11551155    ShowSpacePort;
    1156     exit;
     1156    Exit;
    11571157  end; { square not discovered }
    11581158
     
    11611161
    11621162  if (Loc >= 0) and (Loc < G.lx * G.ly) and (Loc = FAdviceLoc) then
    1163     TSprite(x, y, spPlain);
     1163    TSprite(X, Y, spPlain);
    11641164
    11651165  if (Loc >= 0) and (Loc < G.lx * G.ly) and (Tile and fSpecial <> 0)
     
    11701170    SpecialRow := Tile and fSpecial shr 5;
    11711171    if SpecialCol < fForest then
    1172       TSprite(x, y, SpecialCol + SpecialRow * TerrainIconCols)
     1172      TSprite(X, Y, SpecialCol + SpecialRow * TerrainIconCols)
    11731173    else if (SpecialCol = fForest) and IsJungle(dy) then
    1174       TSprite(x, y, spJungle - 1 + SpecialRow * TerrainIconCols)
     1174      TSprite(X, Y, spJungle - 1 + SpecialRow * TerrainIconCols)
    11751175    else
    1176       TSprite(x, y, spForest - 1 + ((SpecialCol - fForest) * 2 + SpecialRow) * TerrainIconCols);
     1176      TSprite(X, Y, spForest - 1 + ((SpecialCol - fForest) * 2 + SpecialRow) * TerrainIconCols);
    11771177  end;
    11781178
     
    11801180  begin
    11811181    if Tile and fTerImp = tiMine then
    1182       TSprite(x, y, spMine);
     1182      TSprite(X, Y, spMine);
    11831183    if Tile and fTerImp = tiBase then
    1184       TSprite(x, y, spBase);
     1184      TSprite(X, Y, spBase);
    11851185    if Tile and fPoll <> 0 then
    1186       TSprite(x, y, spPollution);
     1186      TSprite(X, Y, spPollution);
    11871187    if Tile and fTerImp = tiFort then
    11881188    begin
    1189       TSprite(x, y, spFortBack);
     1189      TSprite(X, Y, spFortBack);
    11901190      if Tile and fObserved = 0 then
    1191         TSprite(x, y, spFortFront);
     1191        TSprite(X, Y, spFortFront);
    11921192    end;
    11931193  end;
    11941194  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);
    11961196
    11971197  if moEditMode in MapOptions then
     
    12051205  if fog and ShowObjects then
    12061206    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),
    12081208        1 + yyt * 2 + 15 * (yyt * 3 + 1))
    12091209    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),
    12111211        1 + yyt + 15 * (yyt * 3 + 1))
    12121212    else
    1213       TSprite(x, y, spGrid, xxt <> 33);
     1213      TSprite(X, Y, spGrid, xxt <> 33);
    12141214
    12151215  if FoW and (Tile and fObserved = 0) then
     
    12241224    if (Destination = Loc) and (Destination <> MyUn[UnFocus].Loc) then
    12251225      if not UseBlink or BlinkOn then
    1226         TSprite(x, y, spBlink1)
     1226        TSprite(X, Y, spBlink1)
    12271227      else
    1228         TSprite(x, y, spBlink2)
     1228        TSprite(X, Y, spBlink2)
    12291229  end;
    12301230{$ENDIF}
     
    12321232  begin
    12331233    if Tile and fPrefStartPos <> 0 then
    1234       TSprite(x, y, spPrefStartPos)
     1234      TSprite(X, Y, spPrefStartPos)
    12351235    else if Tile and fStartPos <> 0 then
    1236       TSprite(x, y, spStartPos);
     1236      TSprite(X, Y, spStartPos);
    12371237  end
    12381238  else if ShowObjects then
    12391239  begin
    12401240    { 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); }
    12431243
    12441244    NameCity;
    12451245    ShowSpacePort;
    12461246    if Tile and fCity <> 0 then
    1247       PaintCity(x + xxt, y + yyt, CityInfo, CityOwner < 0);
     1247      PaintCity(X + xxt, Y + yyt, CityInfo, CityOwner < 0);
    12481248
    12491249    if (Tile and fUnit <> 0) and (Loc <> AttLoc) and
     
    12591259        UnitInfo.Health := DefHealth;
    12601260      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))
    12621262      then
    12631263{$IFNDEF SCR} if (UnFocus >= 0) and (Loc = MyUn[UnFocus].Loc) then { active unit }
    12641264        begin
    12651265          Multi := UnitInfo.Flags and unMulti;
    1266           MakeUnitInfo(me, MyUn[UnFocus], UnitInfo);
     1266          MakeUnitInfo(Me, MyUn[UnFocus], UnitInfo);
    12671267          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,
    12691269            MyUn[UnFocus].Status);
    12701270        end
    1271         else if UnitInfo.Owner = me then
     1271        else if UnitInfo.Owner = Me then
    12721272        begin
    12731273          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)
    12751275            // status is not set with precise timing during loading
    12761276          else
    1277             PaintUnit(x + (xxt - xxu), y + (yyt - yyu_anchor), UnitInfo,
     1277            PaintUnit(X + (xxt - xxu), Y + (yyt - yyu_anchor), UnitInfo,
    12781278              MyUn[uix].Status);
    12791279          // if Showuix then Textout(x+16,y+5,$80FF00,IntToStr(uix));
    12801280        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);
    12821282    end
    12831283    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,
    12851285        yyu * 2, 1 + 5 * (xxu * 2 + 1), 1)
    12861286    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,
    12881288        yyu * 2, 1 + 5 * (xxu * 2 + 1), 1 + 1 * (yyu * 2 + 1))
    12891289  end;
     
    12911291  if ShowObjects and (Tile and fTerImp = tiFort) and (Tile and fObserved <> 0)
    12921292  then
    1293     TSprite(x, y, spFortFront);
     1293    TSprite(X, Y, spFortFront);
    12941294
    12951295  if (Loc >= 0) and (Loc < G.lx * G.ly) then
    12961296    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))
    12981298    else if ShowDebug and (DebugMap <> nil) and (Loc >= 0) and
    12991299      (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])))
     1302end;
     1303
     1304procedure TIsoMap.PaintGrid(X, Y, nx, ny: Integer);
     1305
     1306  procedure ClippedLine(dx0, dy0: Integer; mirror: Boolean);
    13071307  var
    1308     x0, x1, dxmin, dymin, dxmax, dymax, n: integer;
     1308    x0, x1, dxmin, dymin, dxmax, dymax, N: Integer;
    13091309  begin
    13101310    with FOutput.Canvas do
    13111311    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;
    13171317      if mirror then
    13181318      begin
    1319         if dx0 - dxmin < n then
    1320           n := dx0 - dxmin;
     1319        if dx0 - dxmin < N then
     1320          N := dx0 - dxmin;
    13211321        if dx0 > dxmax then
    13221322        begin
    1323           n := n - (dx0 - dxmax);
     1323          N := N - (dx0 - dxmax);
    13241324          dy0 := dy0 + (dx0 - dxmax);
    13251325          dx0 := dxmax
     
    13271327        if dy0 < dymin then
    13281328        begin
    1329           n := n - (dymin - dy0);
     1329          N := N - (dymin - dy0);
    13301330          dx0 := dx0 - (dymin - dy0);
    13311331          dy0 := dymin
     
    13341334      else
    13351335      begin
    1336         if dxmax - dx0 < n then
    1337           n := dxmax - dx0;
     1336        if dxmax - dx0 < N then
     1337          N := dxmax - dx0;
    13381338        if dx0 < dxmin then
    13391339        begin
    1340           n := n - (dxmin - dx0);
     1340          N := N - (dxmin - dx0);
    13411341          dy0 := dy0 + (dxmin - dx0);
    13421342          dx0 := dxmin
     
    13441344        if dy0 < dymin then
    13451345        begin
    1346           n := n - (dymin - dy0);
     1346          N := N - (dymin - dy0);
    13471347          dx0 := dx0 + (dymin - dy0);
    13481348          dy0 := dymin
    13491349        end;
    13501350      end;
    1351       if n <= 0 then
    1352         exit;
     1351      if N <= 0 then
     1352        Exit;
    13531353      if mirror then
    13541354      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;
    13571357      end
    13581358      else
    13591359      begin
    1360         x0 := x + dx0 * xxt;
    1361         x1 := x + (dx0 + n) * xxt;
     1360        x0 := X + dx0 * xxt;
     1361        x1 := X + (dx0 + N) * xxt;
    13621362      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);
    13651365    end;
    13661366  end;
    13671367
    13681368var
    1369   i: integer;
     1369  I: Integer;
    13701370begin
    13711371  FOutput.Canvas.pen.Color := $000000; // $FF shl (8*random(3));
    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;
     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;
     1381end;
     1382
     1383function TIsoMap.IsShoreTile(Loc: Integer): Boolean;
    13841384var
    13851385  Dir: Integer;
    1386   ConnLoc: integer;
    1387 begin
    1388   result := false;
     1386  ConnLoc: Integer;
     1387begin
     1388  Result := False;
    13891389  for Dir := 0 to 7 do
    13901390  begin
     
    13921392    if (ConnLoc < 0) or (ConnLoc >= G.lx * G.ly) or
    13931393      ((MyMap[ConnLoc] - 2) and fTerrain < 13) then
    1394       result := true;
     1394      Result := True;
    13951395  end;
    13961396end;
     
    14011401begin
    14021402  for I := 0 to Length - 1 do begin
    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;
     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;
    14061406    Line^.NextPixel;
    14071407  end;
     
    14151415end;
    14161416
    1417 procedure TIsoMap.ShadeOutside(x0, y0, Width, Height, xm, ym: integer);
     1417procedure TIsoMap.ShadeOutside(x0, y0, Width, Height, xm, ym: Integer);
    14181418const
    14191419  rShade = 3.75;
    14201420var
    1421   y, wBright: integer;
    1422   y_n, w_n: single;
     1421  Y, wBright: Integer;
     1422  y_n, w_n: Single;
    14231423  Line: TPixelPointer;
    14241424begin
    14251425  FOutput.BeginUpdate;
    1426   Line := PixelPointer(FOutput, ScaleToNative(x0), ScaleToNative(y0));
    1427   for y := 0 to ScaleToNative(Height) - 1 do begin
    1428     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;
    14291429    if abs(y_n) < rShade then begin
    14301430      // Darken left and right parts of elipsis
     
    14451445end;
    14461446
    1447 procedure TIsoMap.CityGrid(xm, ym: integer; CityAllowClick: Boolean);
    1448 var
    1449   i: integer;
     1447procedure TIsoMap.CityGrid(xm, ym: Integer; CityAllowClick: Boolean);
     1448var
     1449  I: Integer;
    14501450begin
    14511451  with FOutput.Canvas do
     
    14561456      pen.Color := $000000;
    14571457    pen.Width := 1;
    1458     for i := 0 to 3 do
     1458    for I := 0 to 3 do
    14591459    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));
    14641464    end;
    14651465    moveto(xm - xxt * 4, ym + yyt * 1);
     
    14751475end;
    14761476
    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;
     1477procedure TIsoMap.Paint(X, Y, Loc, nx, ny, CityLoc, CityOwner: Integer;
     1478  UseBlink: Boolean; CityAllowClick: Boolean);
     1479var
     1480  dx, dy, xm, ym, ALoc, BLoc, ATer, BTer, Aix, bix: Integer;
     1481begin
     1482  FoW := True;
    14831483  ShowLoc := moLocCodes in MapOptions;
    14841484  ShowDebug := pDebugMap >= 0;
     
    14861486  ShowCityNames := ShowObjects and (CityOwner < 0) and
    14871487    (moCityNames in MapOptions);
    1488   ShowBorder := true;
     1488  ShowBorder := True;
    14891489  ShowMyBorder := CityOwner < 0;
    14901490  ShowGrWall := (CityOwner < 0) and (moGreatWall in MapOptions);
    14911491  if ShowDebug then
    1492     Server(sGetDebugMap, me, pDebugMap, DebugMap)
     1492    Server(sGetDebugMap, Me, pDebugMap, DebugMap)
    14931493  else
    14941494    DebugMap := nil;
    14951495  with FOutput.Canvas do
    14961496  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) +
    14991499      3) * yyt;
    15001500    Brush.Color := EmptySpaceColor;
     
    15731573                  bix := 0;
    15741574                end;
    1575               BitBltBitmap(OceanPatch, x + dx * xxt, y + dy * yyt, xxt, yyt,
     1575              BitBltBitmap(OceanPatch, X + dx * xxt, Y + dy * yyt, xxt, yyt,
    15761576                Aix * (xxt * 2) + (dx + dy + 1) and 1 * xxt, bix * yyt, SRCCOPY)
    15771577            end
     
    16211621                bix := Aix;
    16221622            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,
    16241624                yyt, 1 + 6 * (xxt * 2 + 1) + (dx + dy + 1) and 1 * xxt, 1 + yyt,
    16251625                SRCCOPY) // arctic <-> ocean
    16261626            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,
    16281628                yyt, 1 + 6 * (xxt * 2 + 1) + xxt - (dx + dy + 1) and 1 * xxt,
    16291629                1 + yyt * 2, SRCCOPY) // arctic <-> ocean
    16301630            else
    1631               BitBltBitmap(LandPatch, x + dx * xxt, y + dy * yyt, xxt, yyt,
     1631              BitBltBitmap(LandPatch, X + dx * xxt, Y + dy * yyt, xxt, yyt,
    16321632                Aix * (xxt * 2) + (dx + dy + 1) and 1 * xxt, bix * yyt, SRCCOPY)
    16331633          end;
     
    16391639    for dx := -1 to nx do
    16401640      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));
    16421642  for dy := -2 to ny + 1 do
    16431643    for dx := -1 to nx do
    16441644      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,
    16461646          dLoc(Loc, dx, dy));
    16471647  if CityOwner >= 0 then
     
    16531653          ALoc := dLoc(Loc, dx, dy);
    16541654          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,
    16561656              CityOwner, UseBlink);
    16571657        end;
     
    16601660      * G.lx) mod (2 * G.lx) - G.lx;
    16611661    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;
    16641664    ShadeOutside(FLeft, FTop, FRight - FLeft, FBottom - FTop, xm, ym);
    16651665    CityGrid(xm, ym, CityAllowClick);
     
    16701670          ALoc := dLoc(Loc, dx, dy);
    16711671          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,
    16731673              CityOwner, UseBlink);
    16741674        end;
     
    16781678    if ShowLoc or (moEditMode in MapOptions) or
    16791679      (moGrid in MapOptions) then
    1680       PaintGrid(x, y, nx, ny);
     1680      PaintGrid(X, Y, nx, ny);
    16811681    for dy := -2 to ny + 1 do
    16821682      for dx := -2 to nx + 1 do
    16831683        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),
    16851685            CityLoc, CityOwner, UseBlink);
    16861686  end;
    16871687
    16881688  // frame(FOutput.Canvas,x+1,y+1,x+nx*33+33-2,y+ny*16+32-2,$FFFF,$FFFF);
    1689 end; { Paint }
     1689end;
    16901690
    16911691procedure TIsoMap.AttackBegin(const ShowMove: TShowMove);
  • branches/highdpi/LocalPlayer/KeyBindings.pas

    r464 r465  
    1 unit UKeyBindings;
    2 
    3 {$mode delphi}
     1unit KeyBindings;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, fgl, LCLProc, LCLType, Menus, Registry;
     6  Classes, SysUtils, Generics.Collections, Generics.Defaults, LCLProc, LCLType,
     7  Menus, Registry;
    98
    109type
     
    2625  { TKeyBindings }
    2726
    28   TKeyBindings = class(TFPGObjectList<TKeyBinding>)
     27  TKeyBindings = class(TObjectList<TKeyBinding>)
    2928  private
    3029  public
     
    3837    procedure ResetToDefault;
    3938    procedure RemoveShortCut(ShortCut: TShortCut);
     39    procedure SortAlpha;
    4040  end;
    4141
     
    241241  Text: string;
    242242begin
    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);
    251257    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;
    255260  end;
    256261end;
     
    284289    if Items[I].ShortCut2 = ShortCut then Items[I].ShortCut2 := 0;
    285290  end;
     291end;
     292
     293function CompareAlpha(constref Item1, Item2: TKeyBinding): Integer;
     294begin
     295  Result := CompareStr(Item1.FullName, Item2.FullName);
     296end;
     297
     298procedure TKeyBindings.SortAlpha;
     299begin
     300  Sort(TComparer<TKeyBinding>.Construct(CompareAlpha));
    286301end;
    287302
     
    372387  BMoveLeftUp := AddItem('MoveLeftUp', 'Move unit left-up', 'Num7', 'Home');
    373388  BMoveLeft := AddItem('MoveLeft', 'Move unit left', 'Num4', 'Left');
     389  SortAlpha;
    374390end;
    375391
     
    381397end.
    382398
     399
  • branches/highdpi/LocalPlayer/LocalPlayer.pas

    r378 r465  
    44interface
    55
    6 procedure Client(Command, Player: integer; var Data); stdcall;
    7 procedure SetAIName(p: integer; Name: string);
     6procedure Client(Command, Player: Integer; var Data); stdcall;
     7procedure SetAIName(P: Integer; Name: string);
    88
    99implementation
    1010
    1111uses
    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;
    1413
    1514var
    16   FormsCreated: boolean;
     15  FormsCreated: Boolean;
    1716
    18 procedure Client(Command, Player: integer; var Data);
     17procedure Client(Command, Player: Integer; var Data);
    1918begin
    2019  if not FormsCreated then
    2120  begin
    22     FormsCreated := true;
     21    FormsCreated := True;
    2322    // TODO: Changing application name in runtime will cause change of Linux XML registry file path
    24 //    DpiApplication.MainForm := MainScreen;
     23//    Application.MainForm := MainScreen;
    2524    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);
    4325  end;
    4426  MainScreen.Client(Command, Player, Data);
    4527end;
    4628
    47 procedure SetAIName(p: integer; Name: string);
     29procedure SetAIName(P: Integer; Name: string);
    4830begin
    49   MainScreen.SetAIName(p, Name);
     31  MainScreen.SetAIName(P, Name);
    5032end;
    5133
    5234initialization
    5335
    54 FormsCreated := false;
     36FormsCreated := False;
    5537
    5638end.
  • branches/highdpi/LocalPlayer/MessgEx.lfm

    r349 r465  
    66  BorderIcons = []
    77  BorderStyle = bsNone
    8   Caption = 'C-evo'
     8  Caption = 'Message'
    99  ClientHeight = 134
    1010  ClientWidth = 418
     
    1212  DesignTimePPI = 144
    1313  Font.Color = clWindowText
    14   Font.Height = -13
     14  Font.Height = -20
    1515  Font.Name = 'MS Sans Serif'
    1616  FormStyle = fsStayOnTop
     
    2020  OnPaint = FormPaint
    2121  OnShow = FormShow
    22   LCLVersion = '2.0.12.0'
     22  LCLVersion = '2.2.2.0'
    2323  Scaled = False
    2424  object Button1: TButtonA
     
    6161  object EInput: TDpiEdit
    6262    Left = 125
    63     Height = 26
     63    Height = 27
    6464    Top = 64
    6565    Width = 168
  • branches/highdpi/LocalPlayer/MessgEx.pas

    r412 r465  
    55
    66uses
    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;
    1010
    1111type
     
    1313    mikPureIcon, mikMyArmy, mikEnemyArmy, mikFullControl, mikShip, mikBigIcon,
    1414    mikEnemyShipComplete);
     15
     16  { TMessgExDlg }
    1517
    1618  TMessgExDlg = class(TBaseMessgDlg)
     
    3234    Kind: TMessageKind;
    3335    IconIndex: Integer;
    34     HelpKind: Integer;
     36    HelpKind: TLinkCategory;
    3537    HelpNo: Integer;
    3638    CenterTo: Integer;
    3739    IconKind: TMessageIconKind;
    3840    OpenSound: string;
    39     function ShowModal: integer; override;
     41    function ShowModal: Integer; override;
    4042    procedure CancelMovie;
    4143  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);
    4446    procedure PaintMyArmy;
    4547    procedure PaintEnemyArmy;
     
    4749  end;
    4850
    49 var
    50   MessgExDlg: TMessgExDlg;
    5151
    5252procedure SoundMessageEx(SimpleText, SoundItem: string);
    53 procedure TribeMessage(p: integer; SimpleText, SoundItem: string);
     53procedure TribeMessage(P: Integer; SimpleText, SoundItem: string);
    5454function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string)
    55   : integer;
     55  : Integer;
    5656procedure ContextMessage(SimpleText, SoundItem: string;
    57   ContextKind, ContextNo: integer);
     57  ContextKind: TLinkCategory; ContextNo: Integer);
     58
    5859
    5960implementation
    6061
    6162uses
    62   ClientTools, BaseWin, Term, Help, UnitStat, Tribes, UPixelPointer,
    63   IsoEngine, Diagram, Sound;
     63  ClientTools, BaseWin, Term, UnitStat, Tribes, PixelPointer,
     64  Diagram, Sound;
    6465
    6566{$R *.lfm}
     
    7879procedure TMessgExDlg.FormShow(Sender: TObject);
    7980var
    80   i: integer;
     81  I: Integer;
    8182begin
    8283  if IconKind = mikEnemyArmy then
     
    147148  end;
    148149
    149   SplitText(true);
     150  SplitText(True);
    150151  ClientHeight := 72 + Border + TopSpace + Lines * MessageLineSpacing;
    151152  if GameMode = cMovie then
     
    178179      end;
    179180  end;
    180   for i := 0 to ControlCount - 1 do
    181     Controls[i].Top := ClientHeight - (34 + Border);
     181  for I := 0 to ControlCount - 1 do
     182    Controls[I].Top := ClientHeight - (34 + Border);
    182183  if Kind = mkModel then
    183184    EInput.Top := ClientHeight - (76 + Border);
    184185end;
    185186
    186 function TMessgExDlg.ShowModal: integer;
     187function TMessgExDlg.ShowModal: Integer;
    187188var
    188189  Ticks0: TDateTime;
    189190  Ticks: TDateTime;
    190191begin
     192  Caption := Phrases.Lookup('TITLE_MESSAGE');
    191193  if GameMode = cMovie then
    192194  begin
    193195    if not((GameMode = cMovie) and (MovieSpeed = 4)) then
    194196    begin
    195       MovieCancelled := false;
     197      MovieCancelled := False;
    196198      Show;
    197199      Ticks0 := NowPrecise;
     
    203205      Hide;
    204206    end;
    205     result := mrOk;
     207    Result := mrOk;
    206208  end
    207209  else
    208     result := inherited;
     210    Result := inherited;
     211  //Gtk2Fix;
    209212end;
    210213
    211214procedure TMessgExDlg.CancelMovie;
    212215begin
    213   MovieCancelled := true;
    214 end;
    215 
    216 procedure TMessgExDlg.PaintBook(ca: TDpiCanvas; x, y, clPage, clCover: integer);
     216  MovieCancelled := True;
     217end;
     218
     219procedure TMessgExDlg.PaintBook(ca: TDpiCanvas; X, Y, clPage, clCover: Integer);
    217220const
    218221  xScrewed = 77;
     
    220223  wScrewed = 43;
    221224  hScrewed = 27;
     225type
     226  TScrewed = array [0 .. wScrewed - 1, 0 .. hScrewed - 1, 0 .. 3] of Single;
    222227var
    223   ix, iy, xDst, yDst, dx, dy, xIcon, yIcon: integer;
     228  ix, iy, xDst, yDst, dx, dy, xIcon, yIcon: Integer;
    224229  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;
    227232  SrcPtr: TPixelPointer;
    228233  Width: Integer;
     
    235240    yIcon := (IconIndex + SystemIconLines * 7) div 7 * ySizeBig;
    236241    // prepare screwed icon
    237     FillChar(Screwed, sizeof(Screwed), 0);
     242    Screwed := Default(TScrewed);
    238243    BigImp.BeginUpdate;
    239     SrcPtr := PixelPointer(BigImp, ScaleToNative(xIcon), ScaleToNative(yIcon));
     244    SrcPtr := TPixelPointer.Create(BigImp, ScaleToNative(xIcon), ScaleToNative(yIcon));
    240245    for iy := 0 to ScaleToNative(Height) - 1 do begin
    241246      for ix := 0 to ScaleToNative(Width) - 1 do begin
     
    277282    BookRect := SmallBook.BoundsRect;
    278283  end;
    279   x := x - BookRect.Width div 2;
     284  X := X - BookRect.Width div 2;
    280285
    281286  // paint
    282287  UnshareBitmap(LogoBuffer);
    283   DpiBitCanvas(LogoBuffer.Canvas, 0, 0, BookRect.Width, BookRect.Height, ca, x, y);
     288  DpiBitBltCanvas(LogoBuffer.Canvas, 0, 0, BookRect.Width, BookRect.Height, ca, X, Y);
    284289
    285290  if IconIndex >= 0 then
     
    294299  ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), BookRect, clCover, clPage);
    295300
    296   DpiBitCanvas(ca, x, y, BookRect.Width, BookRect.Height, LogoBuffer.Canvas, 0, 0);
     301  DpiBitBltCanvas(ca, X, Y, BookRect.Width, BookRect.Height, LogoBuffer.Canvas, 0, 0);
    297302end;
    298303
     
    303308procedure TMessgExDlg.PaintEnemyArmy;
    304309var
    305   emix, ix, iy, x, y, count, UnitsInLine: integer;
     310  emix, ix, iy, X, Y, count, UnitsInLine: Integer;
    306311begin
    307312  ix := 0;
     
    314319    for count := 0 to LostArmy[emix] - 1 do
    315320    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;
    318323      with MyRO.EnemyModel[emix], Tribe[Owner].ModelPicture[mix] do
    319324      begin
    320         DpiBitCanvas(Canvas, x, y, 64, 48, HGr.Mask.Canvas,
     325        DpiBitBltCanvas(Canvas, X, Y, 64, 48, HGr.Mask.Canvas,
    321326          pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCAND);
    322         DpiBitCanvas(Canvas, x, y, 64, 48, HGr.Data.Canvas,
     327        DpiBitBltCanvas(Canvas, X, Y, 64, 48, HGr.Data.Canvas,
    323328          pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCPAINT);
    324329      end;
    325330
    326331      // next position
    327       inc(ix);
     332      Inc(ix);
    328333      if ix = LostUnitsPerLine then
    329334      begin // next line
    330335        ix := 0;
    331         inc(iy);
     336        Inc(iy);
    332337        if iy = 6 then
    333           exit;
     338          Exit;
    334339        UnitsInLine := nLostArmy - LostUnitsPerLine * iy;
    335340        if UnitsInLine > LostUnitsPerLine then
     
    341346procedure TMessgExDlg.FormPaint(Sender: TObject);
    342347var
    343   p1, clSaveTextLight, clSaveTextShade: integer;
     348  p1, clSaveTextLight, clSaveTextShade: Integer;
    344349begin
    345350  if (IconKind = mikImp) and (IconIndex = 27) then
     
    362367        p1 := MyRO.Wonder[IconIndex].EffectiveOwner;
    363368        UnshareBitmap(Buffer);
    364         DpiBitCanvas(Buffer.Canvas, 0, 0, xSizeBig + 2 * GlowRange,
     369        DpiBitBltCanvas(Buffer.Canvas, 0, 0, xSizeBig + 2 * GlowRange,
    365370          ySizeBig + 2 * GlowRange, Canvas,
    366371          ClientWidth div 2 - (28 + GlowRange), 24 - GlowRange);
    367         DpiBitCanvas(Buffer.Canvas, GlowRange, GlowRange, xSizeBig, ySizeBig,
     372        DpiBitBltCanvas(Buffer.Canvas, GlowRange, GlowRange, xSizeBig, ySizeBig,
    368373          BigImp.Canvas, IconIndex mod 7 * xSizeBig,
    369374          (IconIndex + SystemIconLines * 7) div 7 * ySizeBig);
     
    373378          GlowFrame(Buffer, GlowRange, GlowRange, xSizeBig, ySizeBig,
    374379            Tribe[p1].Color);
    375         DpiBitCanvas(Canvas, ClientWidth div 2 - (28 + GlowRange),
     380        DpiBitBltCanvas(Canvas, ClientWidth div 2 - (28 + GlowRange),
    376381          24 - GlowRange, xSizeBig + 2 * GlowRange, ySizeBig + 2 * GlowRange,
    377382          Buffer.Canvas, 0, 0);
     
    387392      end;
    388393    mikModel:
    389       with Tribe[me].ModelPicture[IconIndex] do
     394      with Tribe[Me].ModelPicture[IconIndex] do
    390395      begin
    391396        FrameImage(Canvas, BigImp, ClientWidth div 2 - 28, 24, xSizeBig,
    392397          ySizeBig, 0, 0);
    393         DpiBitCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44,
     398        DpiBitBltCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44,
    394399          HGr.Mask.Canvas, pix mod 10 * 65 + 1,
    395400          pix div 10 * 49 + 1, SRCAND);
    396         DpiBitCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44,
     401        DpiBitBltCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44,
    397402          HGr.Data.Canvas, pix mod 10 * 65 + 1,
    398403          pix div 10 * 49 + 1, SRCPAINT);
     
    406411        Frame(Canvas, ClientWidth div 2 - 32 - 1, 24 - 1,
    407412          ClientWidth div 2 + 32, 24 + 48, $000000, $000000);
    408         DpiBitCanvas(Canvas, ClientWidth div 2 - 32, 24, 64, 48,
     413        DpiBitBltCanvas(Canvas, ClientWidth div 2 - 32, 24, 64, 48,
    409414          Tribe[IconIndex].faceHGr.Data.Canvas,
    410415          1 + Tribe[IconIndex].facepix mod 10 * 65,
     
    420425    mikEnemyShipComplete:
    421426      begin
    422         DpiBitCanvas(Buffer.Canvas, 0, 0, 140, 120, Canvas,
     427        DpiBitBltCanvas(Buffer.Canvas, 0, 0, 140, 120, Canvas,
    423428          (ClientWidth - 140) div 2, 24);
    424429        ImageOp_BCC(Buffer, Templates.Data, Point(0, 0), StarshipDeparted.BoundsRect, 0, $FFFFFF);
    425         DpiBitCanvas(Canvas, (ClientWidth - 140) div 2, 24, 140, 120,
     430        DpiBitBltCanvas(Canvas, (ClientWidth - 140) div 2, 24, 140, 120,
    426431          Buffer.Canvas, 0, 0);
    427432      end;
     
    451456begin
    452457  if Kind = mkOkHelp then
    453     HelpDlg.ShowNewContent(wmSubmodal, HelpKind, HelpNo)
     458    MainScreen.HelpDlg.ShowNewContent(wmSubmodal, HelpKind, HelpNo)
    454459  else if Kind = mkModel then
    455     UnitStatDlg.ShowNewContent_OwnModel(wmSubmodal, IconIndex)
     460    MainScreen.UnitStatDlg.ShowNewContent_OwnModel(wmSubmodal, IconIndex)
    456461  else
    457462    ModalResult := mrIgnore;
     
    482487// because Messg.SoundMessage not capable of movie mode
    483488begin
    484   with MessgExDlg do
     489  with MainScreen.MessgExDlg do
    485490  begin
    486491    MessgText := SimpleText;
     
    491496end;
    492497
    493 procedure TribeMessage(p: integer; SimpleText, SoundItem: string);
    494 begin
    495   with MessgExDlg do
     498procedure TribeMessage(P: Integer; SimpleText, SoundItem: string);
     499begin
     500  with MainScreen.MessgExDlg do
    496501  begin
    497502    OpenSound := SoundItem;
     
    499504    Kind := mkOk;
    500505    IconKind := mikTribe;
    501     IconIndex := p;
     506    IconIndex := P;
    502507    ShowModal;
    503508  end;
     
    505510
    506511function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string)
    507   : integer;
    508 begin
    509   with MessgExDlg do
     512  : Integer;
     513begin
     514  with MainScreen.MessgExDlg do
    510515  begin
    511516    MessgText := SimpleText;
     
    513518    Kind := QueryKind;
    514519    ShowModal;
    515     result := ModalResult;
     520    Result := ModalResult;
    516521  end;
    517522end;
    518523
    519524procedure ContextMessage(SimpleText, SoundItem: string;
    520   ContextKind, ContextNo: integer);
    521 begin
    522   with MessgExDlg do
     525  ContextKind: TLinkCategory; ContextNo: Integer);
     526begin
     527  with MainScreen.MessgExDlg do
    523528  begin
    524529    MessgText := SimpleText;
     
    543548end;
    544549
    545 
    546 initialization
    547 
    548550end.
  • branches/highdpi/LocalPlayer/NatStat.pas

    r361 r465  
    55
    66uses
    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;
    119
    1210type
     
    2725    procedure ToggleBtnClick(Sender: TObject);
    2826    procedure PlayerClick(Sender: TObject);
    29     procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);
     27    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    3028    procedure FormDestroy(Sender: TObject);
    3129    procedure ScrollUpBtnClick(Sender: TObject);
    3230    procedure ScrollDownBtnClick(Sender: TObject);
    3331    procedure TellAIBtnClick(Sender: TObject);
    34 
    3532  public
    3633    procedure CheckAge;
    37     procedure ShowNewContent(NewMode: integer; p: integer = -1);
     34    procedure ShowNewContent(NewMode: TWindowMode; P: Integer = -1);
    3835    procedure EcoChange;
    39 
    4036  protected
    4137    procedure OffscreenPaint; override;
    42 
    4338  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;
    4848    ReportText: TStringList;
    4949    procedure GenerateReportText;
    5050  end;
    5151
    52 var
    53   NatStatDlg: TNatStatDlg;
    5452
    5553implementation
     
    5856
    5957uses
    60   Messg, Tribes, Directories;
     58  Term, Messg, Tribes, Directories;
    6159
    6260const
     
    109107  if MainTexture.Age <> AgePrepared then begin
    110108    AgePrepared := MainTexture.Age;
    111     DpiBitCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight,
     109    DpiBitBltCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight,
    112110      MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2,
    113111      (MainTexture.Height - ClientHeight) div 2);
     
    118116procedure TNatStatDlg.FormShow(Sender: TObject);
    119117begin
    120   if pView = me then
     118  if pView = Me then
    121119  begin
    122120    SelfReport.TurnOfCivilReport := MyRO.Turn;
    123121    SelfReport.TurnOfMilReport := MyRO.Turn;
    124     move(MyRO.Treaty, SelfReport.Treaty, SizeOf(SelfReport.Treaty));
     122    Move(MyRO.Treaty, SelfReport.Treaty, SizeOf(SelfReport.Treaty));
    125123    SelfReport.Government := MyRO.Government;
    126124    SelfReport.Money := MyRO.Money;
    127     CurrentReport := pointer(SelfReport);
     125    CurrentReport := Pointer(SelfReport);
    128126  end
    129127  else
    130     CurrentReport := pointer(MyRO.EnemyReport[pView]);
     128    CurrentReport := Pointer(MyRO.EnemyReport[pView]);
    131129  if CurrentReport.TurnOfCivilReport >= 0 then
    132130    GenerateReportText;
    133   ShowContact := (pView <> me) and (not supervising or (me <> 0));
    134   ContactEnabled := ShowContact and not supervising and
     131  ShowContact := (pView <> Me) and (not Supervising or (Me <> 0));
     132  ContactEnabled := ShowContact and not Supervising and
    135133    (1 shl pView and MyRO.Alive <> 0);
    136134  ContactBtn.Visible := ContactEnabled and (MyRO.Happened and phGameEnd = 0) and
     
    150148end;
    151149
    152 procedure TNatStatDlg.ShowNewContent(NewMode, p: integer);
    153 begin
    154   if p < 0 then
     150procedure TNatStatDlg.ShowNewContent(NewMode: TWindowMode; P: Integer);
     151begin
     152  if P < 0 then
    155153    if ClientMode >= scContact then
    156       pView := DipMem[me].pContact
     154      pView := DipMem[Me].pContact
    157155    else
    158156    begin
     
    160158      while (pView < nPl) and ((MyRO.Treaty[pView] < trNone) or
    161159        (1 shl pView and MyRO.Alive = 0)) do
    162         inc(pView);
     160        Inc(pView);
    163161      if pView >= nPl then
    164         pView := me;
     162        pView := Me;
    165163    end
    166164  else
    167     pView := p;
     165    pView := P;
    168166  inherited ShowNewContent(NewMode);
    169167end;
     
    178176  List: ^TChart;
    179177
    180   function StatText(no: integer): string;
     178  function StatText(no: Integer): string;
    181179  var
    182     i: integer;
     180    I: Integer;
    183181  begin
    184182    if (CurrentReport.TurnOfCivilReport >= 0) and
    185       (Server(sGetChart + no shl 4, me, pView, List^) >= rExecuted) then
     183      (Server(sGetChart + no shl 4, Me, pView, List^) >= rExecuted) then
    186184    begin
    187       i := List[CurrentReport.TurnOfCivilReport];
     185      I := List[CurrentReport.TurnOfCivilReport];
    188186      case no of
    189187        stPop:
    190           result := Format(Phrases.Lookup('FRSTATPOP'), [i]);
     188          Result := Format(Phrases.Lookup('FRSTATPOP'), [I]);
    191189        stTerritory:
    192           result := Format(Phrases.Lookup('FRSTATTER'), [i]);
     190          Result := Format(Phrases.Lookup('FRSTATTER'), [I]);
    193191        stScience:
    194           result := Format(Phrases.Lookup('FRSTATTECH'), [i div nAdv]);
     192          Result := Format(Phrases.Lookup('FRSTATTECH'), [I div nAdv]);
    195193        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)]);
    198196      end;
    199     end
     197    end;
    200198  end;
    201199
    202200var
    203   p1, Treaty: integer;
    204   s: string;
    205   HasContact, ExtinctPart: boolean;
     201  p1, Treaty: Integer;
     202  S: string;
     203  HasContact, ExtinctPart: Boolean;
    206204begin
    207205  GetMem(List, 4 * (MyRO.Turn + 2));
     
    212210    (1 shl pView and MyRO.Alive <> 0) then
    213211  begin
    214     s := Format(Phrases.Lookup('FROLDCIVILREP'),
     212    S := Format(Phrases.Lookup('FROLDCIVILREP'),
    215213      [TurnToString(CurrentReport.TurnOfCivilReport)]);
    216     ReportText.Add('C' + s);
     214    ReportText.Add('C' + S);
    217215    ReportText.Add('');
    218216  end;
     
    227225  ReportText.Add('S' + StatText(stScience));
    228226  ReportText.Add('E' + StatText(stExplore));
    229   HasContact := false;
     227  HasContact := False;
    230228  for p1 := 0 to nPl - 1 do
    231     if (p1 <> me) and (CurrentReport.Treaty[p1] > trNoContact) then
    232       HasContact := true;
     229    if (p1 <> Me) and (CurrentReport.Treaty[p1] > trNoContact) then
     230      HasContact := True;
    233231  if HasContact then
    234232  begin
    235233    ReportText.Add('');
    236234    ReportText.Add(' ' + Phrases.Lookup('FRRELATIONS'));
    237     for ExtinctPart := false to true do
     235    for ExtinctPart := False to True do
    238236      for Treaty := trAlliance downto trNone do
    239237        for p1 := 0 to nPl - 1 do
    240           if (p1 <> me) and (CurrentReport.Treaty[p1] = Treaty) and
     238          if (p1 <> Me) and (CurrentReport.Treaty[p1] = Treaty) and
    241239            ((1 shl p1 and MyRO.Alive = 0) = ExtinctPart) then
    242240          begin
    243             s := Tribe[p1].TString(Phrases.Lookup('HAVETREATY', Treaty));
     241            S := Tribe[p1].TString(Phrases.Lookup('HAVETREATY', Treaty));
    244242            if ExtinctPart then
    245               s := '(' + s + ')';
    246             ReportText.Add(char(48 + Treaty) + s);
     243              S := '(' + S + ')';
     244            ReportText.Add(char(48 + Treaty) + S);
    247245          end;
    248246  end;
     
    254252procedure TNatStatDlg.OffscreenPaint;
    255253var
    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;
    261258begin
    262259  inherited;
     
    264261  Extinct := 1 shl pView and MyRO.Alive = 0;
    265262
    266   DpiBitCanvas(offscreen.Canvas, 0, 0, ClientWidth, ClientHeight,
     263  DpiBitBltCanvas(Offscreen.Canvas, 0, 0, ClientWidth, ClientHeight,
    267264    Back.Canvas, 0, 0);
    268265
    269   offscreen.Canvas.Font.Assign(UniFont[ftCaption]);
    270   RisedTextout(offscreen.Canvas,
     266  Offscreen.Canvas.Font.Assign(UniFont[ftCaption]);
     267  RisedTextout(Offscreen.Canvas,
    271268    40 { (ClientWidth-BiColorTextWidth(offscreen.canvas,caption)) div 2 } ,
    272269    7, Caption);
    273270
    274   offscreen.Canvas.Font.Assign(UniFont[ftNormal]);
    275 
    276   with offscreen do
     271  Offscreen.Canvas.Font.Assign(UniFont[ftNormal]);
     272
     273  with Offscreen do
    277274  begin
    278275    // show leader picture
     
    280277    if Assigned(Tribe[pView].faceHGr) then
    281278    begin
    282       Dump(offscreen, Tribe[pView].faceHGr, 18, yIcon - 4, 64, 48,
     279      Dump(Offscreen, Tribe[pView].faceHGr, 18, yIcon - 4, 64, 48,
    283280        1 + Tribe[pView].facepix mod 10 * 65,
    284281        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,
    286283        $000000, $000000);
    287284    end;
    288285
    289     if (pView = me) or not Extinct then
     286    if (pView = Me) or not Extinct then
    290287      LoweredTextOut(Canvas, -1, MainTexture, xAttrib, yAttrib,
    291288        Phrases.Lookup('GOVERNMENT', CurrentReport.Government) +
    292289        Phrases.Lookup('FRAND'));
    293     if pView = me then
     290    if pView = Me then
    294291    begin
    295292      LoweredTextOut(Canvas, -1, MainTexture, xAttrib, yAttrib + 19,
     
    305302          Phrases.Lookup('FREXTINCT'));
    306303        LoweredTextOut(Canvas, -1, MainTexture, xAttrib, yAttrib + 28,
    307           TurnToString(CurrentReport.TurnOfCivilReport))
     304          TurnToString(CurrentReport.TurnOfCivilReport));
    308305      end
    309306      else
     
    318315      if MyRO.Treaty[pView] = trNoContact then
    319316      begin
    320         s := Phrases.Lookup('FRNOCONTACT');
     317        S := Phrases.Lookup('FRNOCONTACT');
    321318        LoweredTextOut(Canvas, -1, MainTexture,
    322           (ClientWidth - BiColorTextWidth(Canvas, s)) div 2, yRelation + 9, s)
     319          (ClientWidth - BiColorTextWidth(Canvas, S)) div 2, yRelation + 9, S);
    323320      end
    324321      else if ShowContact then
     
    344341        FrameImage(Canvas, BigImp, xIcon, yIcon, xSizeBig, ySizeBig, 0, 200)
    345342        { 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,
    347344          ContactEnabled and (MyRO.Happened and phGameEnd=0) and (ClientMode<scContact))
    348345          else
    349           FrameImage(canvas,BigImp,xIcon,yIcon,xSizeBig,ySizeBig,
     346          FrameImage(Canvas,BigImp,xIcon,yIcon,xSizeBig,ySizeBig,
    350347          56*(CurrentReport.Government-1),40,
    351348          ContactEnabled and (MyRO.Happened and phGameEnd=0) and (ClientMode<scContact)) };
     
    365362      end;
    366363
    367       y := 0;
    368       for i := 0 to ReportText.Count - 1 do
    369       begin
    370         if (i >= LinesDown) and (i < LinesDown + ReportLines) then
     364      Y := 0;
     365      for I := 0 to ReportText.Count - 1 do
     366      begin
     367        if (I >= LinesDown) and (I < LinesDown + ReportLines) then
    371368        begin
    372           s := ReportText[i];
    373           if s <> '' then
     369          S := ReportText[I];
     370          if S <> '' then
    374371          begin
    375372            // LineType:=s[1];
    376             delete(s, 1, 1);
     373            Delete(S, 1, 1);
    377374            BiColorTextOut(Canvas, Colors.Canvas.Pixels[clkMisc, cliPaperText],
    378               $7F007F, xReport + 8, yReport + LineSpacing * y, s);
     375              $7F007F, xReport + 8, yReport + LineSpacing * Y, S);
    379376          end;
    380           inc(y);
    381         end
     377          Inc(Y);
     378        end;
    382379      end;
    383380    end
    384381    else
    385382    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);
    389386    end;
    390387
    391388    if soTellAI in OptionChecked then begin
    392       Server(sGetAIInfo, me, pView, ps);
     389      Server(sGetAIInfo, Me, pView, ps);
    393390      LoweredTextOut(Canvas, -1, MainTexture, 42, 445, ps);
    394391    end else
     
    396393        Phrases2.Lookup('MENU_TELLAI'));
    397394  end;
    398   ContactBtn.SetBack(offscreen.Canvas, ContactBtn.Left, ContactBtn.Top);
     395
     396  ContactBtn.SetBack(Offscreen.Canvas, ContactBtn.Left, ContactBtn.Top);
    399397
    400398  MarkUsedOffscreen(ClientWidth, ClientHeight);
    401 end; { OffscreenPaint }
     399end;
    402400
    403401procedure TNatStatDlg.CloseBtnClick(Sender: TObject);
    404402begin
    405   Close
     403  Close;
    406404end;
    407405
    408406procedure TNatStatDlg.DialogBtnClick(Sender: TObject);
    409407var
    410   ContactResult: integer;
     408  ContactResult: Integer;
    411409begin
    412410  ContactResult := MainScreen.DipCall(scContact + pView shl 4);
     
    416414      SoundMessage(Phrases.Lookup('FRCOLDWAR'), 'MSG_DEFAULT')
    417415    else if MyRO.Government = gAnarchy then
    418       SoundMessage(Tribe[me].TPhrase('FRMYANARCHY'), 'MSG_DEFAULT')
     416      SoundMessage(Tribe[Me].TPhrase('FRMYANARCHY'), 'MSG_DEFAULT')
    419417    else if ContactResult = eAnarchy then
    420418      if MyRO.Treaty[pView] >= trPeace then
    421419      begin
    422420        if MainScreen.ContactRefused(pView, 'FRANARCHY') then
    423           SmartUpdateContent
     421          SmartUpdateContent;
    424422      end
    425423      else
     
    427425  end
    428426  else
    429     Close
     427    Close;
    430428end;
    431429
    432430procedure TNatStatDlg.ToggleBtnClick(Sender: TObject);
    433431var
    434   p1, StartCount: integer;
    435   m: TDpiMenuItem;
    436   ExtinctPart: boolean;
     432  p1, StartCount: Integer;
     433  M: TDpiMenuItem;
     434  ExtinctPart: Boolean;
    437435begin
    438436  EmptyMenu(Popup.Items);
    439437
    440438  // own nation
    441   if G.Difficulty[me] <> 0 then
    442   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 then
    449       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);
    451449  end;
    452450
    453451  // foreign nations
    454   for ExtinctPart := false to true do
     452  for ExtinctPart := False to True do
    455453  begin
    456454    StartCount := Popup.Items.Count;
     
    460458        (1 shl p1 and MyRO.Alive <> 0) and (MyRO.Treaty[p1] >= trNone) then
    461459      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');
    465463        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;
    469467        if p1 = pView then
    470           m.Checked := true;
    471         Popup.Items.Add(m);
     468          M.Checked := True;
     469        Popup.Items.Add(M);
    472470      end;
    473471    if (StartCount > 0) and (Popup.Items.Count > StartCount) then
    474472    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);
    478476    end;
    479477  end;
     
    482480end;
    483481
    484 procedure TNatStatDlg.FormKeyDown(Sender: TObject; var Key: word;
     482procedure TNatStatDlg.FormKeyDown(Sender: TObject; var Key: Word;
    485483  Shift: TShiftState);
    486484var
    487   i: integer;
     485  I: Integer;
    488486begin
    489487  if Key = VK_F9 then // my key
    490488  begin // toggle nation
    491     i := 0;
     489    I := 0;
    492490    repeat
    493491      pView := (pView + 1) mod nPl;
    494       inc(i);
    495     until (i >= nPl) or (1 shl pView and MyRO.Alive <> 0) and
     492      Inc(I);
     493    until (I >= nPl) or (1 shl pView and MyRO.Alive <> 0) and
    496494      (MyRO.Treaty[pView] >= trNone);
    497     if i >= nPl then
    498       pView := me;
     495    if I >= nPl then
     496      pView := Me;
    499497    Tag := pView;
    500498    PlayerClick(self); // no, this is not nice
    501499  end
    502500  else
    503     inherited
     501    inherited;
    504502end;
    505503
    506504procedure TNatStatDlg.EcoChange;
    507505begin
    508   if Visible and (pView = me) then
     506  if Visible and (pView = Me) then
    509507  begin
    510508    SelfReport.Government := MyRO.Government;
    511509    SelfReport.Money := MyRO.Money;
    512     SmartUpdateContent
    513   end
     510    SmartUpdateContent;
     511  end;
    514512end;
    515513
     
    518516  if LinesDown > 0 then
    519517  begin
    520     dec(LinesDown);
     518    Dec(LinesDown);
    521519    SmartUpdateContent;
    522   end
     520  end;
    523521end;
    524522
     
    527525  if LinesDown + ReportLines < ReportText.Count then
    528526  begin
    529     inc(LinesDown);
     527    Inc(LinesDown);
    530528    SmartUpdateContent;
    531   end
     529  end;
    532530end;
    533531
     
    540538  else
    541539    TellAIBtn.ButtonIndex := 2;
    542   SmartUpdateContent
     540  SmartUpdateContent;
    543541end;
    544542
  • branches/highdpi/LocalPlayer/Nego.pas

    r361 r465  
    55
    66uses
    7   UDpiControls, ScreenTools, BaseWin, Protocol, Term, LCLType, SysUtils, Classes, Graphics,
     7  UDpiControls, ScreenTools, BaseWin, Protocol, LCLType, SysUtils, Classes, Graphics,
    88  Controls, Forms, ButtonA, ButtonB, ButtonN;
    99
     
    1515type
    1616  THistory = record
    17     n: Integer;
     17    N: Integer;
    1818    Text: array[0 .. MaxHistory - 1] of ansistring;
    1919  end;
    2020
    2121  TCommandAllowedEnum = scDipNoticeStart..scDipBreakStart;
     22  TPriceSet = set of $00..$FF;
    2223
    2324  { TNegoDlg }
     
    5960    procedure FormDestroy(Sender: TObject);
    6061    procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
    61       Shift: TShiftState; X, Y: integer);
     62      Shift: TShiftState; X, Y: Integer);
    6263    procedure OkBtnClick(Sender: TObject);
    6364    procedure BwdBtnClick(Sender: TObject);
     
    6970    procedure OfferClick(Sender: TObject);
    7071    procedure FastBtnClick(Sender: TObject);
    71 
    7272  public
    7373    procedure Initiate; // first turn of negotiation, initiate
     
    7575    procedure Start; // next turn of negotiation
    7676    procedure OffscreenPaint; override;
    77     procedure ShowNewContent(NewMode: integer);
    78 
     77    procedure ShowNewContent(NewMode: TWindowMode);
    7978  private
    80     Page, DipCommand: integer;
     79    Page, DipCommand: Integer;
    8180    CurrentOffer: TOffer;
    8281    MyAllowed, OppoAllowed: TPriceSet;
     
    8483    History: array [0 .. nPl - 1] of THistory;
    8584    RomanFont: TDpiFont;
    86     Costs, Delivers: array [0 .. 11] of cardinal;
     85    Costs, Delivers: array [0 .. 11] of Cardinal;
    8786    procedure ResetCurrentOffer;
    8887    procedure BuildCurrentOffer;
    8988    procedure FindAllowed;
    9089    procedure SplitText(Text: string; Bounds: TRect);
    91     procedure PaintNationPicture(X, Y, p: integer);
     90    procedure PaintNationPicture(X, Y, P: Integer);
    9291    procedure SetButtonStates;
    9392  end;
    9493
    95 var
    96   NegoDlg: TNegoDlg;
    9794
    9895implementation
    9996
    10097uses
    101   Messg, ClientTools, Diplomacy, Inp, Select, NatStat, Tribes, MessgEx;
     98  Messg, ClientTools, Diplomacy, Inp, Select, NatStat, Tribes, MessgEx, Term;
    10299
    103100{$R *.lfm}
     
    136133    'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI');
    137134
    138   ButtonPrice: array [0 .. 11] of cardinal = (opChoose, opCivilReport,
     135  ButtonPrice: array [0 .. 11] of Cardinal = (opChoose, opCivilReport,
    139136    opMilReport, opMap, opAllTech, opAllTech, opAllModel, opMoney, opTreaty,
    140137    opLowTreaty, opShipParts, opShipParts);
     
    142139procedure TNegoDlg.FormCreate(Sender: TObject);
    143140var
    144   cix: integer;
     141  cix: Integer;
    145142begin
    146143  InitButtons;
     
    153150        BackGraphic := HGrSystem2.Data;
    154151        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);
    159154        end;
    160155      end;
    161156
    162   fillchar(History, sizeof(History), 0);
     157  FillChar(History, SizeOf(History), 0);
    163158  RomanFont := TDpiFont.Create;
    164159  RomanFont.Name := 'Times New Roman';
     
    184179procedure TNegoDlg.ResetCurrentOffer;
    185180var
    186   i: integer;
     181  I: Integer;
    187182begin
    188183  CurrentOffer.nDeliver := 0;
    189184  CurrentOffer.nCost := 0;
    190   for i := 0 to 11 do
    191     Costs[i] := $FFFFFFFF;
    192   for i := 0 to 11 do
    193     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;
     189end;
     190
     191procedure TNegoDlg.ShowNewContent(NewMode: TWindowMode);
    197192begin
    198193  inherited ShowNewContent(NewMode);
     
    202197  else
    203198    PassBtn.SmartHint := Phrases.Lookup('BTN_PASS');
    204   case MyRO.Treaty[DipMem[me].pContact] of
     199  case MyRO.Treaty[DipMem[Me].pContact] of
    205200    trNone:
    206201      begin
     
    238233begin
    239234  if ClientMode <> scDipStart then
    240     with History[me] do
    241     begin
    242       if n = MaxHistory then
    243       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);
    246241      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);
    251246    end;
    252   assert(History[me].n mod 2 = 1);
    253 
    254   Page := History[me].n;
     247  Assert(History[Me].N mod 2 = 1);
     248
     249  Page := History[Me].N;
    255250  FindAllowed;
    256251  ResetCurrentOffer;
     
    284279procedure TNegoDlg.SplitText(Text: string; Bounds: TRect);
    285280var
    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;
    289284begin
    290285  nLines := 0;
    291   for preview := true downto false do
     286  for preview := True downto False do
    292287  begin
    293288    Start := 1;
     
    296291    while Start < Length(Text) do
    297292    begin
    298       Dot := false;
     293      Dot := False;
    299294      if (Start = 1) or (Text[Start - 1] = '\') then
    300295        if Text[Start] = '-' then
    301296        begin
    302297          Indent := ListIndent;
    303           inc(Start);
     298          Inc(Start);
    304299          if Start = Length(Text) then
    305             break;
    306           Dot := true;
     300            Break;
     301          Dot := True;
    307302        end
    308303        else
     
    311306      while (Stop < Length(Text)) and (Text[Stop] <> '\') do
    312307      begin
    313         inc(Stop);
     308        Inc(Stop);
    314309        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 -
    316311          PaperBorder_Left - PaperBorder_Right - Indent then
    317312        begin
    318           dec(Stop);
    319           break
     313          Dec(Stop);
     314          Break
    320315        end;
    321316      end;
     
    325320        while (Text[OrdinaryStop + 1] <> ' ') and
    326321          (Text[OrdinaryStop + 1] <> '\') do
    327           dec(OrdinaryStop);
     322          Dec(OrdinaryStop);
    328323        if (OrdinaryStop + 1 - Start) * 2 >= Stop - Start then
    329324          Stop := OrdinaryStop
     
    335330          Sprite(Offscreen, HGrSystem, Bounds.Left + PaperBorder_Left +
    336331            (ListIndent - 14), Y + 7, 8, 8, 90, 16);
    337         s := copy(Text, Start, Stop - Start + 1);
     332        S := Copy(Text, Start, Stop - Start + 1);
    338333        BiColorTextOut(Offscreen.Canvas, Colors.Canvas.Pixels[clkMisc,
    339334          cliPaperText], $7F007F, Bounds.Left + PaperBorder_Left +
    340           Indent, Y, s);
     335          Indent, Y, S);
    341336      end;
    342       inc(Line);
     337      Inc(Line);
    343338      Start := Stop + 2;
    344339    end;
     
    349344procedure TNegoDlg.FindAllowed;
    350345var
    351   i: integer;
     346  I: Integer;
    352347begin
    353348  CommandAllowed := [scDipOffer - scDipStart];
    354349  if ClientMode <> scDipBreak then
    355     include(CommandAllowed, scDipBreak - scDipStart);
    356   if MyRO.Treaty[DipMem[me].pContact] >= trPeace then
    357     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^)
    359354    >= rExecuted) then
    360     include(CommandAllowed, scDipAccept - scDipStart);
     355    Include(CommandAllowed, scDipAccept - scDipStart);
    361356
    362357  MyAllowed := [opChoose shr 24, opMoney shr 24];
    363358  OppoAllowed := [opChoose shr 24, opMoney shr 24];
    364   if not IsCivilReportNew(DipMem[me].pContact) then
     359  if not IsCivilReportNew(DipMem[Me].pContact) then
    365360  begin // no up-to-date civil report
    366361    MyAllowed := MyAllowed + [opCivilReport shr 24];
    367     for i := 0 to nAdv - 1 do
    368       if MyRO.Tech[i] >= tsApplicable then
     362    for I := 0 to nAdv - 1 do
     363      if MyRO.Tech[I] >= tsApplicable then
    369364      begin
    370365        MyAllowed := MyAllowed + [opAllTech shr 24];
    371         break
     366        Break
    372367      end;
    373368    OppoAllowed := OppoAllowed + [opCivilReport shr 24, opAllTech shr 24];
     
    375370  else
    376371  begin // check techs
    377     for i := 0 to nAdv - 1 do
    378       if not(i in FutureTech) then
    379         if (MyRO.Tech[i] < tsSeen) and
    380           (MyRO.EnemyReport[DipMem[me].pContact].Tech[i] >= tsApplicable) then
     372    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
    381376          OppoAllowed := OppoAllowed + [opAllTech shr 24]
    382         else if (MyRO.EnemyReport[DipMem[me].pContact].Tech[i] < tsSeen) and
    383           (MyRO.Tech[i] >= tsApplicable) then
     377        else if (MyRO.EnemyReport[DipMem[Me].pContact].Tech[I] < tsSeen) and
     378          (MyRO.Tech[I] >= tsApplicable) then
    384379          MyAllowed := MyAllowed + [opAllTech shr 24];
    385380  end;
    386   if not IsMilReportNew(DipMem[me].pContact) then
     381  if not IsMilReportNew(DipMem[Me].pContact) then
    387382  begin // no up-to-date military report
    388383    MyAllowed := MyAllowed + [opMilReport shr 24];
     
    393388  else
    394389  begin
    395     if ModalSelectDlg.OnlyChoice(kChooseModel) <> mixAll then
     390    if MainScreen.ModalSelectDlg.OnlyChoice(kChooseModel) <> mixAll then
    396391      MyAllowed := MyAllowed + [opAllModel shr 24];
    397     if ModalSelectDlg.OnlyChoice(kChooseEModel) <> mixAll then
     392    if MainScreen.ModalSelectDlg.OnlyChoice(kChooseEModel) <> mixAll then
    398393      OppoAllowed := OppoAllowed + [opAllModel shr 24];
    399394  end;
    400   if MyRO.Treaty[DipMem[me].pContact] < trAlliance then
     395  if MyRO.Treaty[DipMem[Me].pContact] < trAlliance then
    401396  begin
    402397    MyAllowed := MyAllowed + [opTreaty shr 24, opMap shr 24];
     
    408403    OppoAllowed:=OppoAllowed+[opLowTreaty shr 24];
    409404    end; }
    410   for i := 0 to nShipPart - 1 do
    411   begin
    412     if MyRO.Ship[me].Parts[i] > 0 then
    413       include(MyAllowed, opShipParts shr 24);
    414     if MyRO.Ship[DipMem[me].pContact].Parts[i] > 0 then
    415       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 *
    418413    [opAllTech shr 24, opAllModel shr 24, opCivilReport shr 24,
    419414    opMilReport shr 24, opMap shr 24];
    420   OppoAllowed := OppoAllowed - DipMem[me].ReceivedPrices *
     415  OppoAllowed := OppoAllowed - DipMem[Me].ReceivedPrices *
    421416    [opAllTech shr 24, opAllModel shr 24, opCivilReport shr 24,
    422417    opMilReport shr 24, opMap shr 24];
    423418end;
    424419
    425 procedure TNegoDlg.PaintNationPicture(X, Y, p: integer);
     420procedure TNegoDlg.PaintNationPicture(X, Y, P: Integer);
    426421begin
    427422  with Offscreen.Canvas do
    428423  begin
    429424    Pen.Color := $000000;
    430     Brush.Color := Tribe[p].Color;
     425    Brush.Color := Tribe[P].Color;
    431426    Rectangle(X - 6, Y - 1, X + 70, Y + 49);
    432427    Brush.Color := $000000;
    433     Tribe[p].InitAge(GetAge(p));
    434     if Assigned(Tribe[p].faceHGr) then
    435       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)
    437432    else
    438433      FillRect(Rect(X, Y, X + 64, Y + 48));
     
    444439procedure TNegoDlg.SetButtonStates;
    445440var
    446   cix: integer;
    447   IsActionPage: boolean;
    448 begin
    449   IsActionPage := Page = History[me].n;
     441  cix: Integer;
     442  IsActionPage: Boolean;
     443begin
     444  IsActionPage := Page = History[Me].N;
    450445
    451446  AcceptBtn.Possible := IsActionPage and
     
    478473                (ButtonPrice[Tag and $FF] shr 24 in MyAllowed);
    479474              Lit := Delivers[Tag and $FF] <> $FFFFFFFF;
    480             end
     475            end;
    481476        end;
    482477end;
     
    484479procedure TNegoDlg.OffscreenPaint;
    485480var
    486   i, cred: integer;
    487   s: string;
    488   OkEnabled: boolean;
     481  I, cred: Integer;
     482  S: string;
     483  OkEnabled: Boolean;
    489484begin
    490485  if (OffscreenUser <> nil) and (OffscreenUser <> self) then
     
    493488  OffscreenUser := self;
    494489
    495   if (DipCommand >= 0) and (Page = History[me].n) then
    496     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,
    499494      CurrentOffer), 1, 255);
    500495
    501   FwdBtn.Visible := Page < History[me].n;
     496  FwdBtn.Visible := Page < History[Me].N;
    502497  BwdBtn.Visible := Page >= 2;
    503   if Page < History[me].n then
    504     OkEnabled := false
     498  if Page < History[Me].N then
     499    OkEnabled := False
    505500  else if DipCommand = scDipOffer then
    506     OkEnabled := Server(scDipOffer - sExecute, me, 0, CurrentOffer) >= rExecuted
     501    OkEnabled := Server(scDipOffer - sExecute, Me, 0, CurrentOffer) >= rExecuted
    507502  else
    508503    OkEnabled := DipCommand >= 0;
     
    533528    yPad1 + 41 + 42 * 2, $FFFFFF, $B0B0B0);
    534529
    535   PaintNationPicture(xNationPicture0, yNationPicture, DipMem[me].pContact);
    536   PaintNationPicture(xNationPicture1, yNationPicture, me);
    537 
    538   if History[me].Text[Page - 1] <> '' then
     530  PaintNationPicture(xNationPicture0, yNationPicture, DipMem[Me].pContact);
     531  PaintNationPicture(xNationPicture1, yNationPicture, Me);
     532
     533  if History[Me].Text[Page - 1] <> '' then
    539534  begin
    540535    FillSeamless(Offscreen.Canvas, xText0, yText0, wText, hText, 0, 0, Paper);
    541     i := Page - 1;
    542     if History[me].Text[0] = '' then
    543       dec(i);
    544     if i < 16 then
     536    I := Page - 1;
     537    if History[Me].Text[0] = '' then
     538      Dec(I);
     539    if I < 16 then
    545540    begin
    546541      Offscreen.Canvas.Font.Assign(RomanFont);
    547542      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]);
    551546    end
    552547  end;
    553548  FillSeamless(Offscreen.Canvas, xText1, yText1, wText, hText, 0, 0, Paper);
    554   i := Page;
    555   if History[me].Text[0] = '' then
    556     dec(i);
    557   if i < 16 then
     549  I := Page;
     550  if History[Me].Text[0] = '' then
     551    Dec(I);
     552  if I < 16 then
    558553  begin
    559554    Offscreen.Canvas.Font.Assign(RomanFont);
    560555    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]);
    564559  end;
    565560  with Offscreen.Canvas do
    566561  begin
    567562    Brush.Color := MainTexture.ColorBevelShade;
    568     if History[me].Text[Page - 1] <> '' then
     563    if History[Me].Text[Page - 1] <> '' then
    569564    begin
    570565      FillRect(Rect(xText0 + wText, yText0 + PaperShade,
     
    584579  { if Page=History[me].n then
    585580    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);
    587582    //LoweredTextOut(Offscreen.Canvas,-1,MainTexture,
    588583    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]);
    591586    //LoweredTextOut(Offscreen.Canvas,-1,MainTexture,
    592587    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);
    594589    end; }
    595590
    596   if History[me].Text[Page - 1] <> '' then
    597     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,
    598593      yText0 + hText));
    599   if (Page < History[me].n) or OkEnabled then
    600     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,
    601596      yText1 + hText));
    602597
    603598  // show credibility
    604599  Offscreen.Canvas.Font.Assign(UniFont[ftTiny]);
    605   cred := MyRO.EnemyReport[DipMem[me].pContact].Credibility;
     600  cred := MyRO.EnemyReport[DipMem[Me].pContact].Credibility;
    606601  case cred of
    607602    0 .. 49:
    608       i := 3;
     603      I := 3;
    609604    50 .. 90:
    610       i := 0;
     605      I := 0;
    611606    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,
    615610    0, 20, MainTexture);
    616   s := IntToStr(cred);
     611  S := IntToStr(cred);
    617612  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);
    619614  case MyRO.Credibility of
    620615    0 .. 49:
    621       i := 3;
     616      I := 3;
    622617    50 .. 90:
    623       i := 0;
     618      I := 0;
    624619    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,
    628623    (MyRO.Credibility + 2) div 5, 0, 20, MainTexture);
    629   s := IntToStr(MyRO.Credibility);
     624  S := IntToStr(MyRO.Credibility);
    630625  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);
    632627
    633628  MarkUsedOffscreen(ClientWidth, ClientHeight);
    634 end; { OffscreenPaint }
     629end;
    635630
    636631procedure TNegoDlg.Initiate;
    637632begin
    638   History[me].n := 1;
    639   History[me].Text[0] := '';
     633  History[Me].N := 1;
     634  History[Me].Text[0] := '';
    640635end;
    641636
    642637procedure TNegoDlg.Respond;
    643638begin
    644   History[me].n := 0;
     639  History[Me].N := 0;
    645640end;
    646641
    647642procedure TNegoDlg.FormMouseDown(Sender: TObject; Button: TMouseButton;
    648   Shift: TShiftState; X, Y: integer);
     643  Shift: TShiftState; X, Y: Integer);
    649644begin
    650645  if (X >= xNationPicture0) and (X < xNationPicture0 + 64) and
    651646    (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)
    653648  else if (X >= xNationPicture1) and (X < xNationPicture1 + 64) and
    654649    (Y >= yNationPicture) and (Y < yNationPicture + 48) then
    655     NatStatDlg.ShowNewContent(FWindowMode or wmPersistent, me)
     650    MainScreen.NatStatDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), Me)
    656651end;
    657652
    658653procedure TNegoDlg.BwdBtnClick(Sender: TObject);
    659654begin
    660   dec(Page, 2);
     655  Dec(Page, 2);
    661656  SetButtonStates;
    662657  SmartUpdateContent;
     
    665660procedure TNegoDlg.FwdBtnClick(Sender: TObject);
    666661begin
    667   inc(Page, 2);
     662  Inc(Page, 2);
    668663  SetButtonStates;
    669664  SmartUpdateContent;
     
    672667procedure TNegoDlg.OkBtnClick(Sender: TObject);
    673668begin
    674   inc(History[me].n);
     669  Inc(History[Me].N);
    675670  if DipCommand = scDipOffer then
    676671    MainScreen.OfferCall(CurrentOffer)
     
    698693procedure TNegoDlg.BuildCurrentOffer;
    699694var
    700   i: integer;
     695  I: Integer;
    701696begin
    702697  CurrentOffer.nDeliver := 0;
    703698  CurrentOffer.nCost := 0;
    704   for i := 0 to 11 do
    705     if Delivers[i] <> $FFFFFFFF then
    706     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);
    709704    end;
    710   for i := 0 to 11 do
    711     if Costs[i] <> $FFFFFFFF then
     705  for I := 0 to 11 do
     706    if Costs[I] <> $FFFFFFFF then
    712707    begin
    713708      CurrentOffer.Price[CurrentOffer.nDeliver + CurrentOffer.nCost] :=
    714         Costs[i];
    715       inc(CurrentOffer.nCost);
     709        Costs[I];
     710      Inc(CurrentOffer.nCost);
    716711    end;
    717712end;
     
    719714procedure TNegoDlg.WantClick(Sender: TObject);
    720715var
    721   a, i, max: integer;
    722   Price: cardinal;
    723 begin
    724   if (Page <> History[me].n) or (ClientMode = scDipCancelTreaty) or
     716  A, I, Max: Integer;
     717  Price: Cardinal;
     718begin
     719  if (Page <> History[Me].N) or (ClientMode = scDipCancelTreaty) or
    725720    (ClientMode = scDipBreak) then
    726     exit;
     721    Exit;
    727722  if Costs[TButtonN(Sender).Tag and $FF] <> $FFFFFFFF then
    728723    Price := $FFFFFFFF // toggle off
     
    732727    begin
    733728      SimpleMessage(Phrases.Lookup('MAX2WANTS'));
    734       exit
     729      Exit;
    735730    end;
    736731    Price := ButtonPrice[TButtonN(Sender).Tag and $FF];
    737732    if not(Price shr 24 in OppoAllowed) then
    738       exit;
     733      Exit;
    739734    case Price of
    740735      opCivilReport, opMilReport:
    741         inc(Price, DipMem[me].pContact shl 16 + MyRO.Turn);
     736        Inc(Price, DipMem[Me].pContact shl 16 + MyRO.Turn);
    742737        // !!! choose player and year!
    743738      opMoney:
     
    748743          InputDlg.ShowModal;
    749744          if InputDlg.ModalResult <> mrOK then
    750             exit;
    751           val(InputDlg.EInput.Text, a, i);
    752           if (i <> 0) or (a <= 0) or (a >= MaxMoneyPrice) then
    753             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);
    755750        end;
    756751      opShipParts:
    757752        begin // choose type and number
    758753          if MyRO.NatBuilt[imSpacePort] = 0 then
    759             with MessgExDlg do
     754            with MainScreen.MessgExDlg do
    760755            begin
    761756              OpenSound := 'WARNING_LOWSUPPORT';
     
    766761              ShowModal;
    767762              if ModalResult <> mrOK then
    768                 exit
     763                Exit;
    769764            end;
    770           ModalSelectDlg.ShowNewContent(wmModal, kEShipPart);
    771           if ModalSelectDlg.result < 0 then
    772             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];
    775770          InputDlg.Caption := Phrases.Lookup('TITLE_NUMBER');
    776771          InputDlg.EInput.Text := '';
     
    778773          InputDlg.ShowModal;
    779774          if InputDlg.ModalResult <> mrOK then
    780             exit;
    781           val(InputDlg.EInput.Text, a, i);
    782           if (i <> 0) or (a <= 0) then
    783             exit;
    784           if a > max then
    785             a := max;
    786           if a > MaxShipPartPrice then
    787             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);
    789784        end;
    790785      opAllTech:
    791786        begin // choose technology
    792           ModalSelectDlg.ShowNewContent(wmModal, kChooseETech);
    793           if ModalSelectDlg.result < 0 then
    794             exit;
    795           if ModalSelectDlg.result = adAll then
     787          MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kChooseETech);
     788          if MainScreen.ModalSelectDlg.Result < 0 then
     789            Exit;
     790          if MainScreen.ModalSelectDlg.Result = adAll then
    796791            Price := opAllTech
    797792          else
    798             Price := OpTech + ModalSelectDlg.result;
     793            Price := OpTech + MainScreen.ModalSelectDlg.Result;
    799794        end;
    800795      opAllModel:
    801796        begin // choose model
    802           ModalSelectDlg.ShowNewContent(wmModal, kChooseEModel);
    803           if ModalSelectDlg.result < 0 then
    804             exit;
    805           if ModalSelectDlg.result = mixAll then
     797          MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kChooseEModel);
     798          if MainScreen.ModalSelectDlg.Result < 0 then
     799            Exit;
     800          if MainScreen.ModalSelectDlg.Result = mixAll then
    806801            Price := opAllModel
    807802          else
    808             Price := OpModel + MyRO.EnemyModel[ModalSelectDlg.result].mix;
     803            Price := OpModel + MyRO.EnemyModel[MainScreen.ModalSelectDlg.Result].mix;
    809804        end;
    810805      opTreaty:
    811806        begin
    812           if MyRO.Treaty[DipMem[me].pContact] < trPeace then
     807          if MyRO.Treaty[DipMem[Me].pContact] < trPeace then
    813808            Price := opTreaty + trPeace
    814809          else
    815             Price := opTreaty + MyRO.Treaty[DipMem[me].pContact] + 1;
     810            Price := opTreaty + MyRO.Treaty[DipMem[Me].pContact] + 1;
    816811        end;
    817812      { opLowTreaty:
    818813        begin
    819         if MyRO.Treaty[DipMem[me].pContact]=trNone then Price:=opTreaty+trCeaseFire
    820         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;
    821816        end }
    822817    end;
     
    832827procedure TNegoDlg.OfferClick(Sender: TObject);
    833828var
    834   a, i, max: integer;
    835   Price: cardinal;
    836 begin
    837   if (Page <> History[me].n) or (ClientMode = scDipCancelTreaty) or
     829  A, I, Max: Integer;
     830  Price: Cardinal;
     831begin
     832  if (Page <> History[Me].N) or (ClientMode = scDipCancelTreaty) or
    838833    (ClientMode = scDipBreak) then
    839     exit;
     834    Exit;
    840835  if Delivers[TButtonN(Sender).Tag and $FF] <> $FFFFFFFF then
    841836    Price := $FFFFFFFF // toggle off
     
    845840    begin
    846841      SimpleMessage(Phrases.Lookup('MAX2OFFERS'));
    847       exit
     842      Exit;
    848843    end;
    849844    Price := ButtonPrice[TButtonN(Sender).Tag and $FF];
    850845    if not(Price shr 24 in MyAllowed) then
    851       exit;
     846      Exit;
    852847    case Price of
    853848      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!
    855850      opMoney:
    856851        begin // choose amount
     
    860855          InputDlg.ShowModal;
    861856          if InputDlg.ModalResult <> mrOK then
    862             exit;
    863           val(InputDlg.EInput.Text, a, i);
    864           if (i <> 0) or (a <= 0) or (a >= MaxMoneyPrice) then
    865             exit;
    866           if (Price = opMoney) and (a > MyRO.Money) then
    867             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);
    869864        end;
    870865      opShipParts:
    871866        begin // choose type and number
    872           ModalSelectDlg.ShowNewContent(wmModal, kShipPart);
    873           if ModalSelectDlg.result < 0 then
    874             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];
    877872          InputDlg.Caption := Phrases.Lookup('TITLE_NUMBER');
    878873          InputDlg.EInput.Text := '';
     
    880875          InputDlg.ShowModal;
    881876          if InputDlg.ModalResult <> mrOK then
    882             exit;
    883           val(InputDlg.EInput.Text, a, i);
    884           if (i <> 0) or (a <= 0) then
    885             exit;
    886           if a > max then
    887             a := max;
    888           if a > MaxShipPartPrice then
    889             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);
    891886        end;
    892887      opAllTech:
    893888        begin // choose technology
    894           ModalSelectDlg.ShowNewContent(wmModal, kChooseTech);
    895           if ModalSelectDlg.result < 0 then
    896             exit;
    897           if ModalSelectDlg.result = adAll then
     889          MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kChooseTech);
     890          if MainScreen.ModalSelectDlg.Result < 0 then
     891            Exit;
     892          if MainScreen.ModalSelectDlg.Result = adAll then
    898893            Price := opAllTech
    899894          else
    900             Price := OpTech + ModalSelectDlg.result;
     895            Price := OpTech + MainScreen.ModalSelectDlg.Result;
    901896        end;
    902897      opAllModel:
    903898        begin // choose model
    904           ModalSelectDlg.ShowNewContent(wmModal, kChooseModel);
    905           if ModalSelectDlg.result < 0 then
    906             exit;
    907           if ModalSelectDlg.result = mixAll then
     899          MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kChooseModel);
     900          if MainScreen.ModalSelectDlg.Result < 0 then
     901            Exit;
     902          if MainScreen.ModalSelectDlg.Result = mixAll then
    908903            Price := opAllModel
    909904          else
    910             Price := OpModel + ModalSelectDlg.result
     905            Price := OpModel + MainScreen.ModalSelectDlg.Result;
    911906        end;
    912907      opTreaty:
    913908        begin
    914           if MyRO.Treaty[DipMem[me].pContact] < trPeace then
     909          if MyRO.Treaty[DipMem[Me].pContact] < trPeace then
    915910            Price := opTreaty + trPeace
    916911          else
    917             Price := opTreaty + MyRO.Treaty[DipMem[me].pContact] + 1;
     912            Price := opTreaty + MyRO.Treaty[DipMem[Me].pContact] + 1;
    918913        end;
    919914      { opLowTreaty:
    920915        begin
    921         if MyRO.Treaty[DipMem[me].pContact]=trNone then Price:=opTreaty+trCeaseFire
    922         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;
    923918        end }
    924919    end;
     
    934929procedure TNegoDlg.FastBtnClick(Sender: TObject);
    935930var
    936   NewCommand: cardinal;
    937 begin
    938   if Page <> History[me].n then
    939     exit;
     931  NewCommand: Cardinal;
     932begin
     933  if Page <> History[Me].N then
     934    Exit;
    940935  NewCommand := TButtonN(Sender).Tag and $FF + scDipStart;
    941936  if not(NewCommand - scDipStart in CommandAllowed) then
    942     exit;
     937    Exit;
    943938  if (NewCommand = scDipCancelTreaty) and
    944     (MyRO.Turn < MyRO.LastCancelTreaty[DipMem[me].pContact] + CancelTreatyTurns)
     939    (MyRO.Turn < MyRO.LastCancelTreaty[DipMem[Me].pContact] + CancelTreatyTurns)
    945940  then
    946941  begin
    947942    SimpleMessage(Phrases.Lookup('CANCELTREATYRUSH'));
    948     exit;
     943    Exit;
    949944  end;
    950945  if (NewCommand = scDipOffer) and ((ClientMode = scDipCancelTreaty) or
  • branches/highdpi/LocalPlayer/PVSB.pas

    r349 r465  
    55
    66uses
    7   UDpiControls, {$IFDEF WINDOWS}
    8   Windows,
    9   {$ENDIF}
     7  UDpiControls, {$IFDEF WINDOWS}Windows,{$ENDIF}
    108  Classes, Controls, Forms, LCLIntf, LCLType, LMessages, Messages, SysUtils,
    119  StdCtrls, Math;
     
    3230    procedure Init(Max, PageSize: Integer);
    3331    procedure SetPos(Pos: Integer);
    34     function Process(const Msg: TMessage): boolean;
     32    function Process(const Msg: TMessage): Boolean;
    3533    function ProcessMouseWheel(Delta: Integer): Boolean;
    36     procedure Show(Visible: boolean);
     34    procedure Show(Visible: Boolean);
    3735    procedure EndSB;
    3836    procedure SetBorderSpacing(Top, Right, Bottom: Integer);
     
    6563end;
    6664
    67 function TPVScrollBar.Process(const Msg: TMessage): boolean;
     65function TPVScrollBar.Process(const Msg: TMessage): Boolean;
    6866var
    69   NewPos: integer;
     67  NewPos: Integer;
    7068begin
    7169    if Max < ScrollBar.PageSize then
    72       result := false
     70      Result := False
    7371    else
    7472    begin
    7573      if (Msg.wParam and $ffff) in [SB_THUMBPOSITION, SB_THUMBTRACK] then
    7674      begin
    77         result := ((Msg.wParam shr 16) and $ffff) <> ScrollBar.Position;
     75        Result := ((Msg.wParam shr 16) and $ffff) <> ScrollBar.Position;
    7876        ScrollBar.Position := (Msg.wParam shr 16) and $ffff;
    7977      end else begin
     
    9492        if NewPos > Max - ScrollBar.PageSize + 1 then
    9593          NewPos := Max - ScrollBar.PageSize + 1;
    96         result := NewPos <> ScrollBar.Position;
     94        Result := NewPos <> ScrollBar.Position;
    9795        if (NewPos <> ScrollBar.Position) or ((Msg.wParam and $ffff) = SB_ENDSCROLL) then
    9896        begin
     
    105103function TPVScrollBar.ProcessMouseWheel(Delta: Integer): Boolean;
    106104var
    107   NewPos: integer;
     105  NewPos: Integer;
    108106begin
    109107    if Max < ScrollBar.PageSize then Result := False
     
    120118end;
    121119
    122 procedure TPVScrollBar.Show(Visible: boolean);
     120procedure TPVScrollBar.Show(Visible: Boolean);
    123121begin
    124122  if not Visible or (Max < ScrollBar.PageSize) then
  • branches/highdpi/LocalPlayer/Rates.pas

    r361 r465  
    55
    66uses
    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;
    119
    1210type
     
    2321  public
    2422    procedure OffscreenPaint; override;
    25     procedure ShowNewContent(NewMode: integer);
    26   end;
    27 
    28 var
    29   RatesDlg: TRatesDlg;
     23    procedure ShowNewContent(NewMode: TWindowMode);
     24  end;
     25
    3026
    3127implementation
     
    4743procedure TRatesDlg.OffscreenPaint;
    4844var
    49   p, x, y, current, max, i: integer;
    50   s, s1: string;
     45  P, X, Y, current, Max, I: Integer;
     46  S, s1: string;
    5147begin
    5248  if (OffscreenUser <> nil) and (OffscreenUser <> self) then
     
    6561  BtnFrame(Offscreen.Canvas, CloseBtn.BoundsRect, MainTexture);
    6662  Offscreen.Canvas.Font.Assign(UniFont[ftCaption]);
    67   s := Phrases.Lookup('TITLE_RATES');
     63  S := Phrases.Lookup('TITLE_RATES');
    6864  RisedTextOut(Offscreen.Canvas,
    69     (ClientWidth - BiColorTextWidth(Offscreen.Canvas, s)) div 2 - 1, 7, s);
    70 
    71   if MyRO.Wonder[woLiberty].EffectiveOwner = me then
    72     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');
    7571  Offscreen.Canvas.Font.Assign(UniFont[ftNormal]);
    76   p := pos('\', s);
    77   if p = 0 then
    78     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);
    8379    RisedTextOut(Offscreen.Canvas,
    8480      (ClientWidth - BiColorTextWidth(Offscreen.Canvas, s1)) div 2,
    8581      114 - MessageLineSpacing div 2, s1);
    86     s1 := copy(s, p + 1, 255);
     82    s1 := Copy(S, P + 1, 255);
    8783    RisedTextOut(Offscreen.Canvas,
    8884      (ClientWidth - BiColorTextWidth(Offscreen.Canvas, s1)) div 2,
     
    9187  Offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
    9288
    93   if MyRO.Wonder[woLiberty].EffectiveOwner = me then
     89  if MyRO.Wonder[woLiberty].EffectiveOwner = Me then
    9490  begin
    9591    GlowFrame(Offscreen, ClientWidth div 2 - xSizeBig div 2, 52, xSizeBig,
    96       ySizeBig, Tribe[me].Color);
    97     DpiBitCanvas(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,
    9894      xSizeBig, ySizeBig, BigImp.Canvas, (woLiberty mod 7) * xSizeBig,
    9995      (woLiberty div 7 + SystemIconLines) * ySizeBig);
     
    10399    // ImageOp_CBC(Offscreen,Templates,260,40,145,112,36,36,$404000,$8B8BEB);
    104100
    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);
    111107    // PaintProgressBar(Offscreen.Canvas,2,16,81,(100-MyRO.LuxRate-MyRO.TaxRate)*120 div 100,0,120,MainTexture);
    112108
    113109    // reverse progress bar for science
    114     x := 16;
    115     y := 81;
     110    X := 16;
     111    Y := 81;
    116112    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,
    120116      MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    121117    with Offscreen.Canvas do
    122118    begin
    123       for i := 0 to current div 8 - 1 do
    124         DpiBitCanvas(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,
    125121          HGrSystem.Data.Canvas, 104, 9 + 8 * 2);
    126       DpiBitCanvas(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,
    127123        HGrSystem.Data.Canvas, 104, 9 + 8 * 2);
    128124      Brush.Color := $000000;
    129       FillRect(Rect(x, y, x + max - current, y + 7));
     125      FillRect(Rect(X, Y, X + Max - current, Y + 7));
    130126      Brush.Style := bsClear;
    131127    end;
    132128
    133129    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);
    137133    PaintProgressBar(Offscreen.Canvas, 5, 16 + 160, 81,
    138134      MyRO.LuxRate * 120 div 100, 0, 120, MainTexture);
     
    145141    MainTexture.ColorBevelLight);
    146142  RisedTextOut(Offscreen.Canvas, 16 + 80, 164, Phrases.Lookup('TAXRATE'));
    147   s := Format('%d%%', [MyRO.TaxRate]);
     143  S := Format('%d%%', [MyRO.TaxRate]);
    148144  RisedTextOut(Offscreen.Canvas,
    149     16 + 80 { +120-BiColorTextWidth(Offscreen.Canvas,s) } , 180, s);
     145    16 + 80 { +120-BiColorTextWidth(Offscreen.Canvas,s) } , 180, S);
    150146  PaintProgressBar(Offscreen.Canvas, 0, 16 + 80, 201,
    151147    MyRO.TaxRate * 120 div 100, 0, 120, MainTexture);
     
    157153end;
    158154
    159 procedure TRatesDlg.ShowNewContent(NewMode: integer);
     155procedure TRatesDlg.ShowNewContent(NewMode: TWindowMode);
    160156begin
    161157  inherited ShowNewContent(NewMode);
     
    164160procedure TRatesDlg.FormShow(Sender: TObject);
    165161begin
    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;
    170167  end
    171168  else
    172169  begin
    173     ScienceBtn.Visible := true;
    174     LuxBtn.Visible := true;
     170    ScienceBtn.Visible := True;
     171    LuxBtn.Visible := True;
    175172  end;
    176173  OffscreenPaint;
     
    184181procedure TRatesDlg.TaxLuxBtnClick(Sender: TObject);
    185182var
    186   NewTax, NewLux: integer;
     183  NewTax, NewLux: Integer;
    187184begin
    188185  NewTax := MyRO.TaxRate div 10;
     
    191188  begin
    192189    if NewTax < 10 then
    193       inc(NewTax);
     190      Inc(NewTax);
    194191    if NewTax + NewLux > 10 then
    195       dec(NewLux);
     192      Dec(NewLux);
    196193  end
    197194  else if (Sender = TaxDownBtn) and (NewTax > 0) then
    198     dec(NewTax)
     195    Dec(NewTax)
    199196  else if (Sender = ScienceBtn) and (NewLux > 0) then
    200     dec(NewLux)
     197    Dec(NewLux)
    201198  else if (Sender = LuxBtn) and (NewLux + NewTax < 100) then
    202     inc(NewLux);
    203   if Server(sSetRates, me, NewTax + NewLux shl 4, nil^) <> eNotChanged then
     199    Inc(NewLux);
     200  if Server(sSetRates, Me, NewTax + NewLux shl 4, nil^) <> eNotChanged then
    204201  begin
    205202    CityOptimizer_BeginOfTurn;
    206203    SmartUpdateContent;
    207     MainScreen.UpdateViews(true);
     204    MainScreen.UpdateViews(True);
    208205  end;
    209206end;
  • branches/highdpi/LocalPlayer/Select.lfm

    r246 r465  
    11object ListDlg: TListDlg
    22  Left = 290
     3  Height = 262
    34  Top = 145
     5  Width = 381
    46  BorderIcons = []
    57  BorderStyle = bsNone
     
    79  ClientWidth = 381
    810  Color = clBtnFace
    9   Font.Charset = DEFAULT_CHARSET
     11  DesignTimePPI = 144
    1012  Font.Color = clWindowText
    11   Font.Height = -13
     13  Font.Height = -20
    1214  Font.Name = 'MS Sans Serif'
    13   Font.Style = []
    1415  FormStyle = fsStayOnTop
    1516  OnCloseQuery = FormCloseQuery
     
    1718  OnDestroy = FormDestroy
    1819  OnKeyDown = FormKeyDown
    19   OnMouseWheel = FormMouseWheel
    2020  OnMouseDown = PaintBox1MouseDown
    2121  OnMouseMove = PaintBox1MouseMove
     22  OnMouseWheel = FormMouseWheel
    2223  OnPaint = FormPaint
    2324  OnShow = FormShow
    24   PixelsPerInch = 96
     25  LCLVersion = '2.2.2.0'
    2526  Scaled = False
    2627  object CloseBtn: TButtonB
    2728    Left = 343
     29    Height = 25
    2830    Top = 6
    2931    Width = 25
    30     Height = 25
    3132    Down = False
    3233    Permanent = False
     
    3738    Tag = 2
    3839    Left = 344
     40    Height = 25
    3941    Top = 224
    4042    Width = 25
    41     Height = 25
    4243    Down = False
    4344    Permanent = True
     
    4849    Tag = 1
    4950    Left = 312
     51    Height = 25
    5052    Top = 224
    5153    Width = 25
    52     Height = 25
    5354    Down = False
    5455    Permanent = True
     
    5859  object Layer0Btn: TButtonB
    5960    Left = 280
     61    Height = 25
    6062    Top = 224
    6163    Width = 25
    62     Height = 25
    6364    Down = False
    6465    Permanent = True
     
    6869  object ToggleBtn: TButtonB
    6970    Left = 13
     71    Height = 25
    7072    Top = 6
    7173    Width = 25
    72     Height = 25
    7374    Down = False
    7475    Permanent = False
  • branches/highdpi/LocalPlayer/Select.pas

    r378 r465  
    55
    66uses
    7   UDpiControls, Protocol, ClientTools, Term, ScreenTools, IsoEngine, PVSB, BaseWin,
     7  UDpiControls, Protocol, ClientTools, ScreenTools, PVSB, BaseWin,
    88  LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    99  ExtCtrls, ButtonB, ButtonBase, Menus, Types;
     
    2727    ToggleBtn: TButtonB;
    2828    Popup: TDpiPopupMenu;
     29    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    2930    procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
    3031      WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
    3132    procedure PaintBox1MouseMove(Sender: TObject; Shift: TShiftState;
    32       x, y: integer);
     33      X, Y: Integer);
    3334    procedure FormCreate(Sender: TObject);
    3435    procedure FormDestroy(Sender: TObject);
    3536    procedure PaintBox1MouseDown(Sender: TObject; Button: TMouseButton;
    36       Shift: TShiftState; x, y: integer);
     37      Shift: TShiftState; X, Y: Integer);
    3738    procedure FormPaint(Sender: TObject);
    3839    procedure CloseBtnClick(Sender: TObject);
    39     procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
     40    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    4041    procedure FormShow(Sender: TObject);
    4142    procedure ModeBtnClick(Sender: TObject);
    4243    procedure ToggleBtnClick(Sender: TObject);
    43     procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);
     44    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    4445    procedure PlayerClick(Sender: TObject);
    4546  private
     
    4950    cixProject: Integer;
    5051    pView: Integer;
    51     Sel: Integer;
     52    Selected: Integer;
    5253    DispLines: Integer;
    5354    Layer: Integer;
     
    5556    TechNameSpace: Integer;
    5657    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;
    6163    Closable: Boolean;
    6264    MultiPage: Boolean;
     
    6466    procedure ScrollBarUpdate(Sender: TObject);
    6567    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;
    6971    procedure OnScroll(var Msg: TMessage); message WM_VSCROLL;
    7072    procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;
    7173  public
    72     result: integer;
    73     function OnlyChoice(TestKind: TListKind): integer;
     74    Result: Integer;
     75    function OnlyChoice(TestKind: TListKind): Integer;
    7476    // -2=empty, -1=ambiguous, other=only choice
    7577    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);
    7981    procedure EcoChange;
    8082    procedure TechChange;
     
    9092  adAll = $10000;
    9193
    92 var
    93   ListDlg: TListDlg;
    94   ModalSelectDlg: TModalSelectDlg;
    95 
    9694
    9795implementation
    9896
    9997uses
    100   CityScreen, Help, UnitStat, Tribes, Inp;
     98  Term, CityScreen, Help, UnitStat, Tribes, Inp, CmdList;
    10199
    102100{$R *.lfm}
     
    111109  inherited;
    112110  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;
    116114  InitButtons;
    117115  Kind := kMission;
     
    127125procedure TListDlg.FormDestroy(Sender: TObject);
    128126begin
    129   FreeAndNil(sb);
     127  FreeAndNil(ScrollBar);
    130128  FreeAndNil(ScienceNationDotBuffer);
    131129end;
     
    133131procedure TListDlg.CloseBtnClick(Sender: TObject);
    134132begin
    135   Closable := true;
     133  Closable := True;
    136134  Close;
    137135end;
    138136
    139 procedure TListDlg.FormCloseQuery(Sender: TObject; var CanClose: boolean);
     137procedure TListDlg.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    140138begin
    141139  CanClose := Closable or not(Kind in MustChooseKind);
     
    145143begin
    146144  { TODO: Handled by MouseWheel event
    147   if sb.Process(Msg) then  begin
    148     Sel := -2;
    149     SmartUpdateContent(true);
     145  if ScrollBar.Process(Msg) then  begin
     146    Selected := -2;
     147    SmartUpdateContent(True);
    150148  end;
    151149  }
     
    154152procedure TListDlg.OnMouseLeave(var Msg: TMessage);
    155153begin
    156   if not Closable and (Sel <> -2) then
    157   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;
    160158  end;
    161159end;
     
    163161procedure TListDlg.FormPaint(Sender: TObject);
    164162var
    165   s: string;
     163  S: string;
    166164begin
    167165  inherited;
    168166  Canvas.Font.Assign(UniFont[ftNormal]);
    169   if Sel <> -2 then
    170     line(Canvas, Sel, false, true);
    171   s := '';
     167  if Selected <> -2 then
     168    Line(Canvas, Selected, False, True);
     169  S := '';
    172170  if (Kind = kAdvance) and (MyData.FarTech <> adNone) then
    173     s := Format(Phrases.Lookup('TECHFOCUS'),
     171    S := Format(Phrases.Lookup('TECHFOCUS'),
    174172      [Phrases.Lookup('ADVANCES', MyData.FarTech)])
    175173  else if Kind = kModels then
    176     s := Tribe[me].TPhrase('SHORTNAME')
     174    S := Tribe[Me].TPhrase('SHORTNAME')
    177175  else if Kind = kEModels then
    178     s := Tribe[pView].TPhrase('SHORTNAME') + ' (' +
     176    S := Tribe[pView].TPhrase('SHORTNAME') + ' (' +
    179177      TurnToString(MyRO.EnemyReport[pView].TurnOfMilReport) + ')';
    180   if s <> '' then
     178  if S <> '' then
    181179    LoweredTextOut(Canvas, -1, MainTexture,
    182       (ClientWidth - BiColorTextWidth(Canvas, s)) div 2, 31, s);
     180      (ClientWidth - BiColorTextWidth(Canvas, S)) div 2, 31, S);
    183181  if not MultiPage and (Kind in [kProject, kAdvance, kFarAdvance]) and not Phrases2FallenBackToEnglish
    184182  then
    185183  begin
    186     s := Phrases2.Lookup('SHIFTCLICK');
     184    S := Phrases2.Lookup('SHIFTCLICK');
    187185    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;
     188end;
     189
     190procedure TListDlg.Line(ca: TDpiCanvas; L: Integer; NonText, lit: Boolean);
    193191// paint a line
    194192
    195   procedure DisplayProject(x, y, pix: integer);
     193  procedure DisplayProject(X, Y, pix: Integer);
    196194  begin
    197195    if pix and (cpType or cpImp) = 0 then
    198       with Tribe[me].ModelPicture[pix and cpIndex] do
    199         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,
    200198          pix div 10 * 49 + 1)
    201199    else
    202200    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,
    205203        MainTexture.ColorBevelShade);
    206204      if pix and cpType = 0 then
    207205        if (pix and cpIndex = imPalace) and (MyRO.Government <> gAnarchy) then
    208           DpiBitCanvas(offscreen.Canvas, x + 16, y + (16 - 1), xSizeSmall,
     206          DpiBitBltCanvas(Offscreen.Canvas, X + 16, Y + (16 - 1), xSizeSmall,
    209207            ySizeSmall, SmallImp.Canvas, (MyRO.Government - 1) *
    210208            xSizeSmall, ySizeSmall)
    211209        else
    212           DpiBitCanvas(offscreen.Canvas, x + 16, y + (16 - 1), xSizeSmall,
     210          DpiBitBltCanvas(Offscreen.Canvas, X + 16, Y + (16 - 1), xSizeSmall,
    213211            ySizeSmall, SmallImp.Canvas, pix and cpIndex mod 7 *
    214212            xSizeSmall, (pix and cpIndex + SystemIconLines * 7) div 7 *
    215213            ySizeSmall)
    216214      else
    217         DpiBitCanvas(offscreen.Canvas, x + 16, y + (16 - 1), xSizeSmall,
     215        DpiBitBltCanvas(Offscreen.Canvas, X + 16, Y + (16 - 1), xSizeSmall,
    218216          ySizeSmall, SmallImp.Canvas, (3 + pix and cpIndex) *
    219217          xSizeSmall, 0);
     
    221219  end;
    222220
    223   procedure ReplaceText(x, y, Color: integer; s: string);
     221  procedure ReplaceText(X, Y, Color: Integer; S: string);
    224222  var
    225223    TextSize: TSize;
     
    227225    if ca = Canvas then
    228226    begin
    229       TextSize.cx := BiColorTextWidth(ca, s);
    230       TextSize.cy := ca.TextHeight(s);
    231       if y + TextSize.cy >= TitleHeight + InnerHeight then
    232         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)
    234232        div 2, (Maintexture.Height - ClientHeight) div 2);
    235233    end;
    236     LoweredTextOut(ca, Color, MainTexture, x, y, s);
     234    LoweredTextOut(ca, Color, MainTexture, X, Y, S);
    237235  end;
    238236
    239237var
    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;
    242240  CityReport: TCityReportNew;
    243241  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] then
    250     ofs := (sb.Position + l - FirstShrinkedLine[Layer]) and 1 * 33
     242  S, number: string;
     243  CanGrow: Boolean;
     244begin
     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
    251249  else { if FirstShrinkedLine[Layer]<Lines[Layer] then }
    252250    ofs := 33;
     
    255253    with MyCity[lix] do
    256254    begin
    257       x := 104 - 76;
    258       y := y0;
     255      X := 104 - 76;
     256      Y := y0;
    259257      if ca = Canvas then
    260258      begin
    261         x := x + SideFrame;
    262         y := y + TitleHeight;
     259        X := X + SideFrame;
     260        Y := Y + TitleHeight;
    263261      end;
    264262      if lit then
     
    266264      else
    267265        TextColor := -1;
    268       s := CityName(ID);
    269       while BiColorTextWidth(ca, s) > CityNameSpace do
    270         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);
    272270
    273271      if NonText then
    274         with offscreen.Canvas do
     272        with Offscreen.Canvas do
    275273        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;
    281279          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);
    284282        end;
    285283
     
    287285      begin
    288286        first := -1;
    289         for j := 0 to nCityEventPriority - 1 do
    290           if (Flags and CityRepMask and CityEventPriority[j] <> 0) then
    291           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;
    294292          end;
    295293        if first >= 0 then
    296294        begin
    297           i := 0;
    298           test := 1;
    299           while test < CityEventPriority[first] do
    300           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);
    305303          { if CityEventPriority[first]=chNoGrowthWarning then
    306304            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);
    310308          if NonText then
    311309          begin
    312             Sprite(offscreen, HGrSystem, 105 - 76 + CityNameSpace + 4 + 40,
    313               y0 + 1, 18, 18, 1 + i mod 3 * 19, 1 + i div 3 * 19);
    314             x := InnerWidth - 26;
    315             for j := nCityEventPriority - 1 downto first + 1 do
    316               if (Flags and CityRepMask and CityEventPriority[j] <> 0) then
     310            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
    317315              begin
    318                 i := 0;
    319                 test := 1;
    320                 while test < CityEventPriority[j] do
     316                I := 0;
     317                Test := 1;
     318                while Test < CityEventPriority[J] do
    321319                begin
    322                   inc(i);
    323                   inc(test, test)
     320                  Inc(I);
     321                  Inc(Test, Test);
    324322                end;
    325                 if (CityEventPriority[j] = chNoGrowthWarning) and
     323                if (CityEventPriority[J] = chNoGrowthWarning) and
    326324                  (Built[imAqueduct] > 0) then
    327                   i := 17;
    328                 Sprite(offscreen, HGrSystem, x, y0 + 1, 18, 18,
    329                   1 + i mod 3 * 19, 1 + i div 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;
    334332      end
    335333      else
     
    338336        CityReport.HypoTaxRate := -1;
    339337        CityReport.HypoLuxuryRate := -1;
    340         Server(sGetCityReportNew, me, lix, CityReport);
     338        Server(sGetCityReportNew, Me, lix, CityReport);
    341339        TrueFood := Food;
    342340        TrueProd := Prod;
    343         if supervising then
     341        if Supervising then
    344342        begin // normalize city from after-turn state
    345           dec(TrueFood, CityReport.FoodSurplus);
     343          Dec(TrueFood, CityReport.FoodSurplus);
    346344          if TrueFood < 0 then
    347345            TrueFood := 0; // shouldn't happen
    348           dec(TrueProd, CityReport.Production);
     346          Dec(TrueProd, CityReport.Production);
    349347          if TrueProd < 0 then
    350348            TrueProd := 0; // shouldn't happen
    351349        end;
    352350
    353         s := ''; // disorder info
     351        S := ''; // disorder info
    354352        if Flags and chCaptured <> 0 then
    355           s := Phrases.Lookup('CITYEVENTS', 14)
     353          S := Phrases.Lookup('CITYEVENTS', 14)
    356354        else if CityReport.HappinessBalance < 0 then
    357           s := Phrases.Lookup('CITYEVENTS', 0);
    358         if s <> '' then
     355          S := Phrases.Lookup('CITYEVENTS', 0);
     356        if S <> '' then
    359357        begin { disorder }
    360358          if NonText then
    361359          begin
    362             DarkGradient(offscreen.Canvas, 99 + 31 + CityNameSpace + 4,
     360            DarkGradient(Offscreen.Canvas, 99 + 31 + CityNameSpace + 4,
    363361              y0 + 2, 131, 3);
    364362            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);
    367365            ca.Font.Assign(UniFont[ftNormal]);
    368           end
     366          end;
    369367        end
    370368        else
    371369        begin
    372370          { 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);
    380378          if NonText then
    381379          begin
    382380            // 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,
    386384              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);
    392390        // if Project and (cpImp+cpIndex)<>cpImp+imTrGoods then
    393391        // ReplaceText(x+CityNameSpace+4+333+1,y,TextColor,Format('%d/%d',[TrueProd,CityReport.ProjectCost]));
    394392        if NonText then
    395393        begin
    396           Sprite(offscreen, HGrSystem, x + CityNameSpace + 4 + 370 + 1, y + 6,
     394          Sprite(Offscreen, HGrSystem, X + CityNameSpace + 4 + 370 + 1, Y + 6,
    397395            10, 10, 132, 115);
    398396
     
    402400            ((Size < NeedAqueductSize) or (Built[imAqueduct] = 1) and
    403401            (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,
    406404            (MyRO.Government <> gAnarchy) and (Flags and chCaptured = 0),
    407405            MyRO.Government, Size), CityReport.Storage, CanGrow, MainTexture);
     
    409407          if Project <> cpImp + imTrGoods then
    410408          begin
    411             DisplayProject(ofs + 104 - 76 + x - 28 + CityNameSpace + 4 + 206 -
     409            DisplayProject(ofs + 104 - 76 + X - 28 + CityNameSpace + 4 + 206 -
    412410              60, y0 - 15, Project);
    413411
     
    417415              (Flags and chCaptured <> 0) then
    418416              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;
    424422      end;
    425423    end
    426424  else if Kind in [kModels, kEModels] then
    427425  begin
    428     x := 104;
    429     y := y0;
     426    X := 104;
     427    Y := y0;
    430428    if ca = Canvas then
    431429    begin
    432       x := x + SideFrame;
    433       y := y + TitleHeight
     430      X := X + SideFrame;
     431      Y := Y + TitleHeight;
    434432    end;
    435433    if lit then
     
    440438    begin
    441439      Available := 0;
    442       for j := 0 to MyRO.nUn - 1 do
    443         if (MyUn[j].Loc >= 0) and (MyUn[j].mix = lix) then
    444           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);
    445443      if MainScreen.mNames.Checked then
    446         s := Tribe[me].ModelName[lix]
     444        S := Tribe[Me].ModelName[lix]
    447445      else
    448         s := Format(Tribe[me].TPhrase('GENMODEL'), [lix]);
     446        S := Format(Tribe[Me].TPhrase('GENMODEL'), [lix]);
    449447      if NonText then
    450448        DisplayProject(8 + ofs, y0 - 15, lix);
     
    454452      Available := MyRO.EnemyReport[pView].UnCount[lix];
    455453      if MainScreen.mNames.Checked then
    456         s := Tribe[pView].ModelName[lix]
     454        S := Tribe[pView].ModelName[lix]
    457455      else
    458         s := Format(Tribe[pView].TPhrase('GENMODEL'), [lix]);
     456        S := Format(Tribe[pView].TPhrase('GENMODEL'), [lix]);
    459457      if NonText then
    460458        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,
    462460            pix div 10 * 49 + 1);
    463461    end;
    464462    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);
    468466  end
    469467  else
     
    472470      kAllEModels, kChooseEModel:
    473471        if lix = mixAll then
    474           s := Phrases.Lookup('PRICECAT_ALLMODEL')
     472          S := Phrases.Lookup('PRICECAT_ALLMODEL')
    475473        else
    476474        begin
     
    478476          if MainScreen.mNames.Checked then
    479477          begin
    480             s := Tribe[mox.Owner].ModelName[mox.mix];
    481             if (Kind = kAllEModels) and (code[1, sb.Position + l] = 0) then
    482               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]);
    483481          end
    484482          else
    485             s := Format(Tribe[mox.Owner].TPhrase('GENMODEL'), [mox.mix]);
     483            S := Format(Tribe[mox.Owner].TPhrase('GENMODEL'), [mox.mix]);
    486484          if NonText then
    487485            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,
    489487                pix mod 10 * 65 + 1, pix div 10 * 49 + 1);
    490488        end;
    491489      kChooseModel:
    492490        if lix = mixAll then
    493           s := Phrases.Lookup('PRICECAT_ALLMODEL')
     491          S := Phrases.Lookup('PRICECAT_ALLMODEL')
    494492        else
    495493        begin
    496           s := Tribe[me].ModelName[lix];
     494          S := Tribe[Me].ModelName[lix];
    497495          if NonText then
    498496            DisplayProject(8 + ofs, y0 - 15, lix);
     
    501499        begin
    502500          if lix and cpType <> 0 then
    503             s := Phrases.Lookup('CITYTYPE', lix and cpIndex)
     501            S := Phrases.Lookup('CITYTYPE', lix and cpIndex)
    504502          else if lix and cpImp = 0 then
    505503            with MyModel[lix and cpIndex] do
    506504            begin
    507               s := Tribe[me].ModelName[lix and cpIndex];
     505              S := Tribe[Me].ModelName[lix and cpIndex];
    508506              if lix and cpConscripts <> 0 then
    509                 s := Format(Phrases.Lookup('CONSCRIPTS'), [s]);
     507                S := Format(Phrases.Lookup('CONSCRIPTS'), [S]);
    510508            end
    511509          else
    512510          begin
    513             s := Phrases.Lookup('IMPROVEMENTS', lix and cpIndex);
     511            S := Phrases.Lookup('IMPROVEMENTS', lix and cpIndex);
    514512            if (Imp[lix and cpIndex].Kind in [ikNatLocal, ikNatGlobal]) and
    515513              (MyRO.NatBuilt[lix and cpIndex] > 0) or
     
    517515              (MyCity[cixProject].Built[imPower] + MyCity[cixProject].Built
    518516              [imHydro] + MyCity[cixProject].Built[imNuclear] > 0) then
    519               s := Format(Phrases.Lookup('NATEXISTS'), [s]);
     517              S := Format(Phrases.Lookup('NATEXISTS'), [S]);
    520518          end;
    521519          if NonText then
     
    525523        begin
    526524          if lix = adAll then
    527             s := Phrases.Lookup('PRICECAT_ALLTECH')
     525            S := Phrases.Lookup('PRICECAT_ALLTECH')
    528526          else
    529527          begin
    530528            if lix = adNexus then
    531               s := Phrases.Lookup('NEXUS')
     529              S := Phrases.Lookup('NEXUS')
    532530            else if lix = adNone then
    533               s := Phrases.Lookup('NOFARTECH')
     531              S := Phrases.Lookup('NOFARTECH')
    534532            else if lix = adMilitary then
    535               s := Phrases.Lookup('INITUNIT')
     533              S := Phrases.Lookup('INITUNIT')
    536534            else
    537535            begin
    538               s := Phrases.Lookup('ADVANCES', lix);
     536              S := Phrases.Lookup('ADVANCES', lix);
    539537              if (Kind = kAdvance) and (lix in FutureTech) then
    540538                if MyRO.Tech[lix] < tsApplicable then
    541                   s := s + ' 1'
     539                  S := S + ' 1'
    542540                else
    543                   s := s + ' ' + inttostr(MyRO.Tech[lix] + 1);
     541                  S := S + ' ' + IntToStr(MyRO.Tech[lix] + 1);
    544542            end;
    545             if BiColorTextWidth(ca, s) > TechNameSpace + 8 then
     543            if BiColorTextWidth(ca, S) > TechNameSpace + 8 then
    546544            begin
    547545              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 + '.';
    551549            end;
    552550
     
    555553              if lix = adNexus then
    556554              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),
    558556                  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)
    560558              end
    561559              else if lix = adNone then
    562560              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),
    564562                  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)
    566564              end
    567565              else if lix = adMilitary then
    568566              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),
    570568                  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)
    572570              end
    573571              else
    574572              begin
    575                 Frame(offscreen.Canvas, (8 + 16 - 1), y0 - 1,
     573                Frame(Offscreen.Canvas, (8 + 16 - 1), y0 - 1,
    576574                  (8 + 16 + xSizeSmall), y0 + ySizeSmall,
    577575                  MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    578576                if AdvIcon[lix] < 84 then
    579                   DpiBitCanvas(offscreen.Canvas, (8 + 16), y0, xSizeSmall,
     577                  DpiBitBltCanvas(Offscreen.Canvas, (8 + 16), y0, xSizeSmall,
    580578                    ySizeSmall, SmallImp.Canvas,
    581579                    (AdvIcon[lix] + SystemIconLines * 7) mod 7 * xSizeSmall,
     
    583581                    ySizeSmall)
    584582                else
    585                   Dump(offscreen, HGrSystem, (8 + 16), y0, 36, 20,
     583                  Dump(Offscreen, HGrSystem, (8 + 16), y0, 36, 20,
    586584                    1 + (AdvIcon[lix] - 84) mod 8 * 37,
    587585                    295 + (AdvIcon[lix] - 84) div 8 * 21);
    588                 j := AdvValue[lix] div 1000;
    589                 DpiBitCanvas(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,
    591589                  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);
    594592              end;
    595593            end;
     
    598596          if NonText and (Kind in [kAdvance, kScience]) then
    599597          begin // show research state
    600             for j := 0 to nColumn - 1 do
     598            for J := 0 to nColumn - 1 do
    601599            begin
    602600              FutureCount := 0;
    603               if j = 0 then // own science
     601              if J = 0 then // own science
    604602                if lix = MyRO.ResearchTech then
    605603                begin
    606                   Server(sGetTechCost, me, 0, icon);
     604                  Server(sGetTechCost, Me, 0, icon);
    607605                  icon := 4 + MyRO.Research * 4 div icon;
    608606                  if icon > 4 + 3 then
     
    623621                  icon := -1
    624622              else
    625                 with MyRO.EnemyReport[Column[j]]^ do // enemy science
    626                   if (MyRO.Alive and (1 shl Column[j]) <> 0) and
     623                with MyRO.EnemyReport[Column[J]]^ do // enemy science
     624                  if (MyRO.Alive and (1 shl Column[J]) <> 0) and
    627625                    (TurnOfCivilReport >= 0) and (lix = ResearchTech) and
    628626                    ((lix = adMilitary) or (lix in FutureTech) or
     
    631629                    icon := 4 + ResearchDone div 25;
    632630                    if icon > 4 + 3 then
    633                       icon := 4 + 3
     631                      icon := 4 + 3;
    634632                  end
    635633                  else if lix = adMilitary then
     
    647645                    icon := -1;
    648646              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)
    651649              else if (Kind = kScience) and (FutureCount > 0) then
    652650              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 -
    655653                  BiColorTextWidth(ca, number) div 2, y0, number);
    656               end
    657             end
     654              end;
     655            end;
    658656          end;
    659657        end; // kAdvance, kScience
    660658      kTribe:
    661         s := TribeNames[lix];
     659        S := TribeNames[lix];
    662660      kShipPart:
    663661        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]) + ')';
    666664          if NonText then
    667665            DisplayProject(8 + ofs, y0 - 15, cpImp + imShipComp + lix);
     
    669667      kEShipPart:
    670668        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]) + ')';
    673671          if NonText then
    674672            DisplayProject(8 + ofs, y0 - 15, cpImp + imShipComp + lix);
     
    676674      kGov:
    677675        begin
    678           s := Phrases.Lookup('GOVERNMENT', lix);
     676          S := Phrases.Lookup('GOVERNMENT', lix);
    679677          if NonText then
    680678          begin
    681             Frame(offscreen.Canvas, 8 + 16 - 1, y0 - 15 + (16 - 2),
     679            Frame(Offscreen.Canvas, 8 + 16 - 1, y0 - 15 + (16 - 2),
    682680              8 + 16 + xSizeSmall, y0 - 15 + (16 - 1 + ySizeSmall),
    683681              MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    684             DpiBitCanvas(offscreen.Canvas, 8 + 16, y0 - 15 + (16 - 1),
     682            DpiBitBltCanvas(Offscreen.Canvas, 8 + 16, y0 - 15 + (16 - 1),
    685683              xSizeSmall, ySizeSmall, SmallImp.Canvas,
    686684              (lix - 1) * xSizeSmall, ySizeSmall);
    687           end
     685          end;
    688686        end;
    689687      kMission:
    690         s := Phrases.Lookup('SPYMISSION', lix);
     688        S := Phrases.Lookup('SPYMISSION', lix);
    691689    end;
    692690    case Kind of
    693691      kTribe, kMission: // center text
    694692        if Lines[0] > MaxLines then
    695           x := (InnerWidth - DpiGetSystemMetrics(SM_CXVSCROLL)) div 2 -
    696             BiColorTextWidth(ca, s) div 2
     693          X := (InnerWidth - DpiGetSystemMetrics(SM_CXVSCROLL)) div 2 -
     694            BiColorTextWidth(ca, S) div 2
    697695        else
    698           x := InnerWidth div 2 - BiColorTextWidth(ca, s) div 2;
     696          X := InnerWidth div 2 - BiColorTextWidth(ca, S) div 2;
    699697      kAdvance, kFarAdvance, kScience, kChooseTech, kChooseETech,
    700698        kStealTech, kGov:
    701         x := 104 - 33;
     699        X := 104 - 33;
    702700      kAllEModels:
    703         x := 104;
     701        X := 104;
    704702    else
    705       x := 104 + 15;
     703      X := 104 + 15;
    706704    end;
    707     y := y0;
     705    Y := y0;
    708706    if ca = Canvas then
    709707    begin
    710       x := x + SideFrame;
    711       y := y + TitleHeight
     708      X := X + SideFrame;
     709      Y := Y + TitleHeight;
    712710    end;
    713711    if lit then
     
    716714      TextColor := -1;
    717715    { 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;
    721719end;
    722720
    723721procedure TListDlg.OffscreenPaint;
    724722var
    725   i, j: integer;
     723  I, J: Integer;
    726724begin
    727725  case Kind of
    728726    kCities:
    729       Caption := Tribe[me].TPhrase('TITLE_CITIES');
     727      Caption := Tribe[Me].TPhrase('TITLE_CITIES');
    730728    kCityEvents:
    731729      Caption := Format(Phrases.Lookup('TITLE_EVENTS'),
     
    734732
    735733  inherited;
    736   offscreen.Canvas.Font.Assign(UniFont[ftNormal]);
     734  Offscreen.Canvas.Font.Assign(UniFont[ftNormal]);
    737735  FillOffscreen(0, 0, InnerWidth, InnerHeight);
    738   with offscreen.Canvas do
     736  with Offscreen.Canvas do
    739737  begin
    740738    if Kind = kScience then
    741       for i := 1 to nColumn - 1 do
     739      for I := 1 to nColumn - 1 do
    742740      begin
    743741        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 then
    749         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;
    754752        end
    755753        else
    756754        begin // colored player columns
    757           Pen.Color := Tribe[Column[i]].Color;
    758           for j := 1 to 8 do
    759           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 do
    767       if (i + sb.Position >= 0) and (i + sb.Position < Lines[Layer]) then
    768         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);
    769767  end;
    770768  MarkUsedOffscreen(InnerWidth, 8 + 48 + DispLines * LineDistance);
     
    772770
    773771procedure TListDlg.PaintBox1MouseMove(Sender: TObject; Shift: TShiftState;
    774   x, y: integer);
     772  X, Y: Integer);
    775773var
    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) and
    783     (y < InnerHeight) and (y mod LineDistance >= 4) and (y mod LineDistance < 20)
     774  i0, Sel0, iColumn, OldScienceNation, xScreen: Integer;
     775  S: string;
     776begin
     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)
    784782  then
    785     Sel := y div LineDistance - 1
     783    Selected := Y div LineDistance - 1
    786784  else
    787     Sel := -2;
    788   if (Sel < -1) or (Sel > DispLines) or (Sel + i0 < 0) or
    789     (Sel + i0 >= Lines[Layer]) then
    790     Sel := -2;
    791   if Sel <> Sel0 then
     785    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
    792790  begin
    793791    if Sel0 <> -2 then
    794       line(Canvas, Sel0, false, false);
    795     if Sel <> -2 then
    796       line(Canvas, Sel, false, true)
     792      Line(Canvas, Sel0, False, False);
     793    if Selected <> -2 then
     794      Line(Canvas, Selected, False, True);
    797795  end;
    798796
     
    801799    OldScienceNation := ScienceNation;
    802800    ScienceNation := -1;
    803     if (x >= SideFrame + (104 - 33 + 15 + TechNameSpace)) and
    804       ((x - SideFrame - (104 - 33 + 15 + TechNameSpace)) mod 24 <= 18) and
    805       (y >= 0) and (y < InnerHeight) then
     801    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
    806804    begin
    807       iColumn := (x - SideFrame - (104 - 33 + 15 + TechNameSpace)) div 24;
     805      iColumn := (X - SideFrame - (104 - 33 + 15 + TechNameSpace)) div 24;
    808806      if (iColumn >= 1) and (iColumn < nColumn) then
    809807        ScienceNation := Column[iColumn];
     
    816814      if ScienceNation >= 0 then
    817815      begin
    818         s := Tribe[ScienceNation].TPhrase('SHORTNAME');
     816        S := Tribe[ScienceNation].TPhrase('SHORTNAME');
    819817        if MyRO.Alive and (1 shl ScienceNation) = 0 then
    820           s := Format(Phrases.Lookup('SCIENCEREPORT_EXTINCT'), [s]) // extinct
     818          S := Format(Phrases.Lookup('SCIENCEREPORT_EXTINCT'), [S]) // extinct
    821819        else if MyRO.EnemyReport[ScienceNation].TurnOfCivilReport < MyRO.Turn - 1
    822820        then
    823           s := s + ' (' + TurnToString(MyRO.EnemyReport[ScienceNation]
     821          S := S + ' (' + TurnToString(MyRO.EnemyReport[ScienceNation]
    824822            .TurnOfCivilReport) + ')'; // old report
    825         xScreen := (ClientWidth - BiColorTextWidth(Canvas, s)) div 2;
     823        xScreen := (ClientWidth - BiColorTextWidth(Canvas, S)) div 2;
    826824        LoweredTextOut(Canvas, -1, MainTexture, xScreen + 10,
    827           ClientHeight - 29, s);
    828         DpiBitCanvas(ScienceNationDotBuffer.Canvas, 0, 0, ScienceNationDot.Width,
     825          ClientHeight - 29, S);
     826        DpiBitBltCanvas(ScienceNationDotBuffer.Canvas, 0, 0, ScienceNationDot.Width,
    829827          ScienceNationDot.Height, Canvas, xScreen - 10, ClientHeight - 27);
    830828        ImageOp_BCC(ScienceNationDotBuffer, Templates.Data, Point(0, 0),
    831829          ScienceNationDot.BoundsRect, MainTexture.ColorBevelShade, Tribe[ScienceNation].Color);
    832         DpiBitCanvas(Canvas, xScreen - 10, ClientHeight - 27, ScienceNationDot.Width,
     830        DpiBitBltCanvas(Canvas, xScreen - 10, ClientHeight - 27, ScienceNationDot.Width,
    833831          ScienceNationDot.Height, ScienceNationDotBuffer.Canvas, 0, 0);
    834832      end;
     
    840838  WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
    841839begin
    842   if sb.ProcessMouseWheel(WheelDelta) then begin
     840  if ScrollBar.ProcessMouseWheel(WheelDelta) then begin
    843841    PaintBox1MouseMove(nil, [], MousePos.X - Left,
    844842      MousePos.Y - Top);
     
    846844end;
    847845
    848 function TListDlg.RenameCity(cix: integer): boolean;
     846procedure TListDlg.FormClose(Sender: TObject; var CloseAction: TCloseAction);
     847begin
     848  //Gtk2Fix;
     849end;
     850
     851function TListDlg.RenameCity(cix: Integer): Boolean;
    849852var
    850853  CityNameInfo: TCityNameInfo;
     
    859862    CityNameInfo.ID := MyCity[cix].ID;
    860863    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
    864870    begin
    865       CityDlg.FormShow(nil);
    866       CityDlg.Invalidate;
     871      MainScreen.CityDlg.FormShow(nil);
     872      MainScreen.CityDlg.Invalidate;
    867873    end;
    868     result := true;
     874    Result := True;
    869875  end
    870876  else
    871     result := false;
    872 end;
    873 
    874 function TListDlg.RenameModel(mix: integer): boolean;
     877    Result := False;
     878end;
     879
     880function TListDlg.RenameModel(mix: Integer): Boolean;
    875881var
    876882  ModelNameInfo: TModelNameInfo;
    877883begin
    878884  InputDlg.Caption := Phrases.Lookup('TITLE_MODELNAME');
    879   InputDlg.EInput.Text := Tribe[me].ModelName[mix];
     885  InputDlg.EInput.Text := Tribe[Me].ModelName[mix];
    880886  InputDlg.CenterToRect(BoundsRect);
    881887  InputDlg.ShowModal;
    882888  if (InputDlg.ModalResult = mrOK) and (InputDlg.EInput.Text <> '') and
    883     (InputDlg.EInput.Text <> Tribe[me].ModelName[mix]) then
     889    (InputDlg.EInput.Text <> Tribe[Me].ModelName[mix]) then
    884890  begin
    885891    ModelNameInfo.mix := mix;
    886892    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
    890899    begin
    891       UnitStatDlg.FormShow(nil);
    892       UnitStatDlg.Invalidate;
     900      MainScreen.UnitStatDlg.FormShow(nil);
     901      MainScreen.UnitStatDlg.Invalidate;
    893902    end;
    894     result := true;
     903    Result := True;
    895904  end
    896905  else
    897     result := false;
     906    Result := False;
    898907end;
    899908
    900909procedure TListDlg.PaintBox1MouseDown(Sender: TObject; Button: TMouseButton;
    901   Shift: TShiftState; x, y: integer);
     910  Shift: TShiftState; X, Y: Integer);
    902911var
    903   lix: integer;
    904 begin
    905   if sb.Position + Sel >= 0 then
    906     lix := code[Layer, sb.Position + Sel];
     912  lix: Integer;
     913begin
     914  if ScrollBar.Position + Selected >= 0 then
     915    lix := Code[Layer, ScrollBar.Position + Selected];
    907916  if Kind in [kScience, kCities, kCityEvents, kModels, kEModels, kAllEModels]
    908917  then
    909     include(Shift, ssShift); // don't close list window
     918    Include(Shift, ssShift); // don't close list window
    910919  if (ssLeft in Shift) and not(ssShift in Shift) then
    911920  begin
    912     if Sel <> -2 then
     921    if Selected <> -2 then
    913922    begin
    914       result := lix;
    915       Closable := true;
     923      Result := lix;
     924      Closable := True;
    916925      Close;
    917926    end;
     
    919928  else if (ssLeft in Shift) and (ssShift in Shift) then
    920929  begin // show help/info popup
    921     if Sel <> -2 then
     930    if Selected <> -2 then
    922931      case Kind of
    923932        kCities:
    924933          MainScreen.ZoomToCity(MyCity[lix].Loc);
    925934        kCityEvents:
    926           MainScreen.ZoomToCity(MyCity[lix].Loc, false, MyCity[lix].Flags and
     935          MainScreen.ZoomToCity(MyCity[lix].Loc, False, MyCity[lix].Flags and
    927936            CityRepMask);
    928937        kModels, kChooseModel:
    929938          if lix <> mixAll then
    930             UnitStatDlg.ShowNewContent_OwnModel(FWindowMode or
    931               wmPersistent, lix);
     939            MainScreen.UnitStatDlg.ShowNewContent_OwnModel(wmPersistent, lix);
    932940        kEModels:
    933           UnitStatDlg.ShowNewContent_EnemyModel(FWindowMode or wmPersistent,
    934             code[1, sb.Position + Sel]);
     941          MainScreen.UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent,
     942            Code[1, ScrollBar.Position + Selected]);
    935943        kAllEModels, kChooseEModel:
    936944          if lix <> mixAll then
    937             UnitStatDlg.ShowNewContent_EnemyModel(FWindowMode or
    938               wmPersistent, lix);
     945            MainScreen.UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent, lix);
    939946        kAdvance, kFarAdvance, kScience, kChooseTech, kChooseETech, kStealTech:
    940947          if lix = adMilitary then
    941             HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkText,
    942               HelpDlg.TextIndex('MILRES'))
     948            MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkText,
     949              MainScreen.HelpDlg.TextIndex('MILRES'))
    943950          else if lix < adMilitary then
    944             HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkAdv, lix);
     951            MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkAdv, lix);
    945952        kProject:
    946953          if lix = cpImp + imTrGoods then
    947             HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkText,
    948               HelpDlg.TextIndex('TRADINGGOODS'))
     954            MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkText,
     955              MainScreen.HelpDlg.TextIndex('TRADINGGOODS'))
    949956          else if lix and (cpImp + cpType) = 0 then
    950             UnitStatDlg.ShowNewContent_OwnModel(FWindowMode or wmPersistent,
     957            MainScreen.UnitStatDlg.ShowNewContent_OwnModel(wmPersistent,
    951958              lix and cpIndex)
    952959          else if (lix and cpType = 0) and (lix <> cpImp + imTrGoods) then
    953             HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp,
     960            MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkImp,
    954961              lix and cpIndex);
    955962        kGov:
    956           HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkMisc,
    957             miscGovList);
     963          MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkMisc,
     964            Integer(miscGovList));
    958965        kShipPart, kEShipPart:
    959966          ;
     
    962969  else if ssRight in Shift then
    963970  begin
    964     if Sel <> -2 then
     971    if Selected <> -2 then
    965972      case Kind of
    966973        kCities, kCityEvents:
     
    976983procedure TListDlg.InitLines;
    977984var
    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) >= rExecuted
     985  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
    983990    then
    984991    begin
    985       code[Layer, Lines[Layer]] := Project;
    986       inc(Lines[Layer]);
     992      Code[Layer, Lines[Layer]] := Project;
     993      Inc(Lines[Layer]);
    987994    end;
    988995  end;
     
    990997  procedure SortTechs;
    991998  var
    992     i, j, swap: integer;
     999    I, J, swap: Integer;
    9931000  begin // sort by advancedness
    994     for i := 0 to Lines[0] - 2 do
    995       if code[0, i] < adMilitary then
    996         for j := i + 1 to Lines[0] - 1 do
    997           if AdvValue[code[0, i]] * nAdv + code[0, i] < AdvValue[code[0, j]] *
    998             nAdv + code[0, j] then
    999           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;
    10031010          end;
    10041011  end;
     
    10061013  procedure SortCities;
    10071014  var
    1008     i, j, swap: integer;
    1009   begin
    1010     for i := 0 to Lines[0] - 2 do
    1011       for j := i + 1 to Lines[0] - 1 do
    1012         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)
    10131020        then
    10141021        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;
    10181025        end;
    10191026  end;
    10201027
    10211028  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;
    10251032    if MixPlayers then
    1026       dec(result, ModelCode(mi) shl 16);
     1033      Dec(Result, ModelCode(mi) shl 16);
    10271034  end;
    10281035
    10291036  procedure SortModels;
    10301037  var
    1031     i, j, swap: integer;
     1038    I, J, swap: Integer;
    10321039  begin // sort by code[2]
    1033     for i := 0 to Lines[0] - 2 do
    1034       for j := i + 1 to Lines[0] - 1 do
    1035         if code[2, i] > code[2, j] then
    1036         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 then
     1040    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
    10531060    begin
    1054       if (AdvPreq[i, 0] >= 0) then
    1055         MarkPreqs(AdvPreq[i, 0]);
    1056       if (AdvPreq[i, 1] >= 0) then
    1057         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]);
    10581065    end;
    10591066  end;
    10601067
    10611068var
    1062   Loc1, i, j, p1, dx, dy, mix, emix, EnemyType, TestEnemyType: integer;
     1069  Loc1, I, J, p1, dx, dy, mix, emix, EnemyType, TestEnemyType: Integer;
    10631070  mi: TModelInfo;
    10641071  PPicture, PTestPicture: ^TModelPicture;
    1065   ModelOk: array [0 .. 4095] of boolean;
    1066   ok: boolean;
    1067 begin
    1068   for i := 0 to MaxLayer - 1 do
    1069   begin
    1070     Lines[i] := 0;
    1071     FirstShrinkedLine[i] := MaxInt;
     1072  ModelOk: array [0 .. 4095] of Boolean;
     1073  ok: Boolean;
     1074begin
     1075  for I := 0 to MaxLayer - 1 do
     1076  begin
     1077    Lines[I] := 0;
     1078    FirstShrinkedLine[I] := MaxInt;
    10721079  end;
    10731080  case Kind of
     
    10751082      begin
    10761083        // improvements
    1077         code[0, 0] := cpImp + imTrGoods;
     1084        Code[0, 0] := cpImp + imTrGoods;
    10781085        Lines[0] := 1;
    1079         for i := nWonder to nImp - 1 do
    1080           if Imp[i].Kind = ikCommon then
    1081             TryAddImpLine(0, i + cpImp);
    1082         for i := nWonder to nImp - 1 do
    1083           if not(Imp[i].Kind in [ikCommon, ikTrGoods]) and
    1084             ((MyRO.NatBuilt[i] = 0) or (Imp[i].Kind = ikNatLocal)) then
    1085             TryAddImpLine(0, i + cpImp);
    1086         for i := 0 to nCityType - 1 do
    1087           if MyData.ImpOrder[i, 0] >= 0 then
    1088           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]);
    10911098          end;
    10921099
    10931100        // wonders
    1094         for i := 0 to nWonder - 1 do
    1095           TryAddImpLine(1, i + cpImp);
     1101        for I := 0 to nWonder - 1 do
     1102          TryAddImpLine(1, I + cpImp);
    10961103
    10971104        // units
    1098         for i := 0 to MyRO.nModel - 1 do
     1105        for I := 0 to MyRO.nModel - 1 do
    10991106        begin
    11001107          { if MyModel[i].Kind=mkSlaves then
    1101             ok:= MyRO.Wonder[woPyramids].EffectiveOwner=me
    1102             else } if MyModel[i].Domain = dSea then
    1103           begin
    1104             ok := false;
     1108            ok:= MyRO.Wonder[woPyramids].EffectiveOwner=Me
     1109            else } if MyModel[I].Domain = dSea then
     1110          begin
     1111            ok := False;
    11051112            for dx := -2 to 2 do
    11061113              for dy := -2 to 2 do
     
    11111118                    ((MyMap[Loc1] and fTerrain = fShore) or
    11121119                    (MyMap[Loc1] and fCanal > 0)) then
    1113                     ok := true;
     1120                    ok := True;
    11141121                end;
    11151122          end
    11161123          else
    1117             ok := true;
     1124            ok := True;
    11181125          if ok then
    11191126          begin
    1120             if MyModel[i].Status and msObsolete = 0 then
     1127            if MyModel[I].Status and msObsolete = 0 then
    11211128            begin
    1122               code[2, Lines[2]] := i;
    1123               inc(Lines[2]);
     1129              Code[2, Lines[2]] := I;
     1130              Inc(Lines[2]);
    11241131            end;
    1125             if MyModel[i].Status and msAllowConscripts <> 0 then
     1132            if MyModel[I].Status and msAllowConscripts <> 0 then
    11261133            begin
    1127               code[2, Lines[2]] := i + cpConscripts;
    1128               inc(Lines[2]);
     1134              Code[2, Lines[2]] := I + cpConscripts;
     1135              Inc(Lines[2]);
    11291136            end;
    11301137          end;
     
    11401147          MarkPreqs(MyData.FarTech);
    11411148        end;
    1142         for i := 0 to nAdv - 1 do
    1143           if ((i in FutureTech) or (MyRO.Tech[i] < tsApplicable)) and
    1144             (Server(sSetResearch - sExecute, me, i, nil^) >= rExecuted) and
    1145             ((MyData.FarTech = adNone) or (required[i] > 0)) then
    1146           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]);
    11491156          end;
    11501157        SortTechs;
    11511158        if Lines[0] = 0 then // no more techs -- offer nexus
    11521159        begin
    1153           code[0, Lines[0]] := adNexus;
    1154           inc(Lines[0]);
    1155         end;
    1156         ok := false;
    1157         for i := 0 to nDomains - 1 do
    1158           if (upgrade[i, 0].Preq = preNone) or
    1159             (MyRO.Tech[upgrade[i, 0].Preq] >= tsApplicable) then
    1160             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;
    11611168        if ok then { new unit class }
    11621169        begin
    1163           code[0, Lines[0]] := adMilitary;
    1164           inc(Lines[0]);
     1170          Code[0, Lines[0]] := adMilitary;
     1171          Inc(Lines[0]);
    11651172        end;
    11661173      end;
    11671174    kFarAdvance:
    11681175      begin
    1169         code[0, Lines[0]] := adNone;
    1170         inc(Lines[0]);
    1171         for i := 0 to nAdv - 1 do
    1172           if not(i in FutureTech) and (MyRO.Tech[i] < tsApplicable) and
    1173             ((AdvValue[i] < 2000) or (MyRO.Tech[adMassProduction] > tsNA)) and
    1174             ((AdvValue[i] < 1000) or (MyRO.Tech[adScience] > tsNA)) then
    1175           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]);
    11781185          end;
    11791186        SortTechs;
     
    11811188    kChooseTech:
    11821189      begin
    1183         for i := 0 to nAdv - 1 do
    1184           if not(i in FutureTech) and (MyRO.Tech[i] >= tsApplicable) and
    1185             (MyRO.EnemyReport[DipMem[me].pContact].Tech[i] < tsSeen) then
    1186           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]);
    11891196          end;
    11901197        SortTechs;
    11911198        // if Lines[0]>1 then
    11921199        begin
    1193           code[0, Lines[0]] := adAll;
    1194           inc(Lines[0]);
     1200          Code[0, Lines[0]] := adAll;
     1201          Inc(Lines[0]);
    11951202        end;
    11961203      end;
    11971204    kChooseETech:
    11981205      begin
    1199         for i := 0 to nAdv - 1 do
    1200           if not(i in FutureTech) and (MyRO.Tech[i] < tsSeen) and
    1201             (MyRO.EnemyReport[DipMem[me].pContact].Tech[i] >= tsApplicable) then
    1202           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]);
    12051212          end;
    12061213        SortTechs;
    12071214        // if Lines[0]>1 then
    12081215        begin
    1209           code[0, Lines[0]] := adAll;
    1210           inc(Lines[0]);
     1216          Code[0, Lines[0]] := adAll;
     1217          Inc(Lines[0]);
    12111218        end;
    12121219      end;
    12131220    kStealTech:
    12141221      begin
    1215         for i := 0 to nAdv - 1 do
    1216           if Server(sStealTech - sExecute, me, i, nil^) >= rExecuted then
    1217           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]);
    12201227          end;
    12211228        SortTechs;
     
    12231230    kScience:
    12241231      begin
    1225         Column[0] := me;
     1232        Column[0] := Me;
    12261233        nColumn := 1;
    12271234        for EnemyType := 0 to 2 do
     
    12411248              begin
    12421249                Column[nColumn] := p1;
    1243                 inc(nColumn);
     1250                Inc(nColumn);
    12441251              end;
    12451252            end;
    1246         for i := 0 to nAdv - 1 do
    1247         begin
    1248           ok := (MyRO.Tech[i] <> tsNA) or (MyRO.ResearchTech = i);
    1249           for j := 1 to nColumn - 1 do
    1250             with MyRO.EnemyReport[Column[j]]^ do
    1251               if (Tech[i] <> tsNA) or (TurnOfCivilReport >= 0) and
    1252                 (ResearchTech = i) then
    1253                 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;
    12541261          if ok then
    12551262          begin
    1256             code[0, Lines[0]] := i;
    1257             inc(Lines[0]);
     1263            Code[0, Lines[0]] := I;
     1264            Inc(Lines[0]);
    12581265          end;
    12591266        end;
     
    12611268
    12621269        ok := MyRO.ResearchTech = adMilitary;
    1263         for j := 1 to nColumn - 1 do
    1264           with MyRO.EnemyReport[Column[j]]^ do
    1265             if (MyRO.Alive and (1 shl Column[j]) <> 0) and
     1270        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
    12661273              (TurnOfCivilReport >= 0) and (ResearchTech = adMilitary) then
    1267               ok := true;
     1274              ok := True;
    12681275        if ok then
    12691276        begin
    1270           code[0, Lines[0]] := adMilitary;
    1271           inc(Lines[0]);
     1277          Code[0, Lines[0]] := adMilitary;
     1278          Inc(Lines[0]);
    12721279        end
    12731280      end;
     
    12751282      begin
    12761283        if ClientMode < scContact then
    1277           for i := 0 to MyRO.nCity - 1 do
    1278             if MyCity[i].Loc >= 0 then
     1284          for I := 0 to MyRO.nCity - 1 do
     1285            if MyCity[I].Loc >= 0 then
    12791286            begin
    1280               code[0, Lines[0]] := i;
    1281               inc(Lines[0]);
     1287              Code[0, Lines[0]] := I;
     1288              Inc(Lines[0]);
    12821289            end;
    12831290        SortCities;
     
    12861293    kCityEvents:
    12871294      begin
    1288         for i := 0 to MyRO.nCity - 1 do
    1289           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)
    12901297          then
    12911298          begin
    1292             code[0, Lines[0]] := i;
    1293             inc(Lines[0]);
     1299            Code[0, Lines[0]] := I;
     1300            Inc(Lines[0]);
    12941301          end;
    12951302        SortCities;
     
    12981305    { kChooseECity:
    12991306      begin
    1300       for i:=0 to MyRO.nEnemyCity-1 do
    1301       if (MyRO.EnemyCity[i].Loc>=0)
    1302       and (MyRO.EnemyCity[i].owner=DipMem[me].pContact) then
    1303       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;
    13041311      FirstShrinkedLine:=0
    13051312      end; }
     
    13081315        for mix := 0 to MyRO.nModel - 1 do
    13091316        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);
    13131320        end;
    13141321        Lines[0] := MyRO.nModel;
     
    13201327        for mix := 3 to MyRO.nModel - 1 do
    13211328        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;
    13241331          for emix := 0 to MyRO.nEnemyModel - 1 do
    1325             if (MyRO.EnemyModel[emix].Owner = DipMem[me].pContact) and
     1332            if (MyRO.EnemyModel[emix].Owner = DipMem[Me].pContact) and
    13261333              IsSameModel(MyRO.EnemyModel[emix], mi) then
    1327               ok := false;
     1334              ok := False;
    13281335          if ok then
    13291336          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]);
    13341341          end;
    13351342        end;
     
    13371344        // if Lines[0]>1 then
    13381345        begin
    1339           code[0, Lines[0]] := mixAll;
    1340           inc(Lines[0]);;
     1346          Code[0, Lines[0]] := mixAll;
     1347          Inc(Lines[0]);;
    13411348        end;
    13421349        FirstShrinkedLine[0] := 0;
     
    13451352      begin
    13461353        if MyRO.TestFlags and tfUncover <> 0 then
    1347           Server(sGetModels, me, 0, nil^);
     1354          Server(sGetModels, Me, 0, nil^);
    13481355        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;
    13501357        for mix := 0 to MyRO.nModel - 1 do
    13511358        begin // don't list models I already have
    1352           MakeModelInfo(me, mix, MyModel[mix], mi);
     1359          MakeModelInfo(Me, mix, MyModel[mix], mi);
    13531360          for emix := 0 to MyRO.nEnemyModel - 1 do
    13541361            ModelOk[emix] := ModelOk[emix] and
     
    13581365          if ModelOk[emix] then
    13591366          begin
    1360             if not Assigned(Tribe[DipMem[me].pContact].ModelPicture
     1367            if not Assigned(Tribe[DipMem[Me].pContact].ModelPicture
    13611368              [MyRO.EnemyModel[emix].mix].HGr) then
    13621369              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]);
    13661373          end;
    13671374        SortModels;
    13681375        // if not IsMilReportNew(DipMem[me].pContact) or (Lines[0]>1) then
    13691376        begin
    1370           code[0, Lines[0]] := mixAll;
    1371           inc(Lines[0]);
     1377          Code[0, Lines[0]] := mixAll;
     1378          Inc(Lines[0]);
    13721379        end;
    13731380        FirstShrinkedLine[0] := 0;
     
    13751382    kEModels:
    13761383      begin
    1377         for i := 0 to MyRO.EnemyReport[pView].nModelCounted - 1 do
    1378         begin
    1379           code[1, Lines[0]] := MyRO.nEnemyModel - 1;
    1380           while (code[1, Lines[0]] >= 0) and
    1381             not((MyRO.EnemyModel[code[1, Lines[0]]].Owner = pView) and
    1382             (MyRO.EnemyModel[code[1, Lines[0]]].mix = i)) do
    1383             dec(code[1, Lines[0]]);
    1384           if not Assigned(Tribe[pView].ModelPicture[i].HGr) then
    1385             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]);
    13901397        end;
    13911398        SortModels;
     
    13941401    kAllEModels:
    13951402      begin
    1396         if (MyRO.TestFlags and tfUncover <> 0) or (G.Difficulty[me] = 0) then
    1397           Server(sGetModels, me, 0, nil^);
     1403        if (MyRO.TestFlags and tfUncover <> 0) or (G.Difficulty[Me] = 0) then
     1404          Server(sGetModels, Me, 0, nil^);
    13981405        for emix := 0 to MyRO.nEnemyModel - 1 do
    13991406          if (MyRO.EnemyModel[emix].mix >= 3) and
     
    14051412            if not Assigned(PPicture.HGr) then
    14061413              InitEnemyModel(emix);
    1407             ok := true;
     1414            ok := True;
    14081415            if MainScreen.mNames.Checked then
    1409               for j := 0 to Lines[0] - 1 do
     1416              for J := 0 to Lines[0] - 1 do
    14101417              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];
    14131420                if (PPicture.HGr = PTestPicture.HGr) and
    14141421                  (PPicture.pix = PTestPicture.pix) and
    14151422                  (ModelHash(MyRO.EnemyModel[emix])
    1416                   = ModelHash(MyRO.EnemyModel[code[0, j]])) then
     1423                  = ModelHash(MyRO.EnemyModel[Code[0, J]])) then
    14171424                begin
    1418                   code[1, j] := 1;
    1419                   ok := false;
     1425                  Code[1, J] := 1;
     1426                  ok := False;
    14201427                  Break;
    14211428                end;
     
    14231430            if ok then
    14241431            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]);
    14291436            end;
    14301437          end;
     
    14331440      end;
    14341441    kTribe:
    1435       for i := 0 to TribeNames.Count - 1 do
    1436       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]);
    14391446      end;
    14401447    (* kDeliver:
    1441       if MyRO.Treaty[DipMem[me].pContact]<trAlliance then
     1448      if MyRO.Treaty[DipMem[Me].pContact]<trAlliance then
    14421449      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 then
     1450      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
    14471454      begin // suggest peace
    1448       code[0,Lines[0]]:=opTreaty+trPeace;
    1449       inc(Lines[0]);
    1450       end;
    1451       if MyRO.Treaty[DipMem[me].pContact]>trNone then
     1455      Code[0,Lines[0]]:=opTreaty+trPeace;
     1456      Inc(Lines[0]);
     1457      end;
     1458      if MyRO.Treaty[DipMem[Me].pContact]>trNone then
    14521459      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]);
    14551462      end; *)
    14561463    kShipPart:
    14571464      begin
    14581465        Lines[0] := 0;
    1459         for i := 0 to nShipPart - 1 do
    1460           if MyRO.Ship[me].Parts[i] > 0 then
    1461           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]);
    14641471          end;
    14651472      end;
     
    14671474      begin
    14681475        Lines[0] := 0;
    1469         for i := 0 to nShipPart - 1 do
    1470           if MyRO.Ship[DipMem[me].pContact].Parts[i] > 0 then
    1471           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]);
    14741481          end;
    14751482      end;
    14761483    kGov:
    1477       for i := 1 to nGov - 1 do
    1478         if (GovPreq[i] <> preNA) and
    1479           ((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))
    14801487        then
    14811488        begin
    1482           code[0, Lines[0]] := i;
    1483           inc(Lines[0]);
     1489          Code[0, Lines[0]] := I;
     1490          Inc(Lines[0]);
    14841491        end;
    14851492    kMission:
    1486       for i := 0 to nSpyMission - 1 do
    1487       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]);
    14901497      end;
    14911498  end;
     
    14941501    if Lines[0] + Lines[1] + Lines[2] <= MaxLines then
    14951502    begin
    1496       for i := 0 to Lines[1] - 1 do // add wonders to first page
    1497       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]);
    15001507      end;
    15011508      Lines[1] := 0;
    15021509      FirstShrinkedLine[0] := Lines[0];
    1503       for i := 0 to Lines[2] - 1 do // add models to first page
    1504       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]);
    15071514      end;
    15081515      Lines[2] := 0;
    15091516    end;
    1510 end; // InitLines
    1511 
    1512 function TListDlg.OnlyChoice(TestKind: TListKind): integer;
     1517end;
     1518
     1519function TListDlg.OnlyChoice(TestKind: TListKind): Integer;
    15131520begin
    15141521  Kind := TestKind;
    15151522  InitLines;
    15161523  if Lines[0] = 0 then
    1517     result := -2
     1524    Result := -2
    15181525  else if Lines[0] > 1 then
    1519     result := -1
     1526    Result := -1
    15201527  else
    1521     result := code[0, 0];
     1528    Result := Code[0, 0];
    15221529end;
    15231530
    15241531procedure TListDlg.FormShow(Sender: TObject);
    15251532var
    1526   i: integer;
    1527 begin
    1528   result := -1;
    1529   Closable := false;
     1533  I: Integer;
     1534begin
     1535  Result := -1;
     1536  Closable := False;
    15301537
    15311538  if Kind = kTribe then
     
    15431550  InitLines;
    15441551
    1545   MultiPage := false;
    1546   for i := 1 to MaxLayer - 1 do
    1547     if Lines[i] > 0 then
    1548       MultiPage := true;
     1552  MultiPage := False;
     1553  for I := 1 to MaxLayer - 1 do
     1554    if Lines[I] > 0 then
     1555      MultiPage := True;
    15491556  WideBottom := MultiPage or (Kind = kScience) or
    15501557    not Phrases2FallenBackToEnglish and
     
    15521559  if (Kind = kAdvance) and (MyData.FarTech <> adNone) or (Kind = kModels) or
    15531560    (Kind = kEModels) then begin
    1554     sb.SetBorderSpacing(56, 10, 10);
     1561    ScrollBar.SetBorderSpacing(56, 10, 10);
    15551562    TitleHeight := WideFrame + 20;
    15561563  end else begin
    1557     sb.SetBorderSpacing(36, 10, 34);
     1564    ScrollBar.SetBorderSpacing(36, 10, 34);
    15581565    TitleHeight := WideFrame;
    15591566  end;
    15601567
    15611568  DispLines := Lines[0];
    1562   for i := 0 to MaxLayer - 1 do
    1563     if Lines[i] > DispLines then
    1564       DispLines := Lines[i];
     1569  for I := 0 to MaxLayer - 1 do
     1570    if Lines[I] > DispLines then
     1571      DispLines := Lines[I];
    15651572  if WideBottom then
    15661573  begin
     
    15771584    ClientHeight := InnerHeight + TitleHeight + NarrowFrame;
    15781585  end;
    1579   assert(ClientHeight <= Maintexture.Height);
     1586  Assert(ClientHeight <= Maintexture.Height);
    15801587
    15811588  TechNameSpace := 224;
     
    16151622  CaptionRight := CloseBtn.Left;
    16161623  { TODO:
    1617   SetWindowPos(sb.ScrollBar.Handle, 0, SideFrame + InnerWidth - DpiGetSystemMetrics(SM_CXVSCROLL),
     1624  SetWindowPos(ScrollBar.ScrollBar.Handle, 0, SideFrame + InnerWidth - DpiGetSystemMetrics(SM_CXVSCROLL),
    16181625    TitleHeight, DpiGetSystemMetrics(SM_CXVSCROLL), LineDistance * DispLines + 48,
    16191626    SWP_NOZORDER or SWP_NOREDRAW);
     
    16381645    Layer0Btn.Top := ClientHeight - 31;
    16391646    Layer0Btn.Left := ClientWidth div 2 - (12 + 29);
    1640     Layer0Btn.Down := true;
     1647    Layer0Btn.Down := True;
    16411648    Layer1Btn.Top := ClientHeight - 31;
    16421649    Layer1Btn.Left := ClientWidth div 2 - (12 - 29);
    1643     Layer1Btn.Down := false;
     1650    Layer1Btn.Down := False;
    16441651    Layer2Btn.Top := ClientHeight - 31;
    16451652    Layer2Btn.Left := ClientWidth div 2 - 12;
    1646     Layer2Btn.Down := false;
     1653    Layer2Btn.Down := False;
    16471654  end;
    16481655
    16491656  Layer := 0;
    1650   Sel := -2;
     1657  Selected := -2;
    16511658  ScienceNation := -1;
    1652   sb.Init(Lines[Layer] - 1, DispLines);
     1659  ScrollBar.Init(Lines[Layer] - 1, DispLines);
    16531660
    16541661  OffscreenPaint;
    16551662end;
    16561663
    1657 procedure TListDlg.ShowNewContent(NewMode: integer; ListKind: TListKind);
     1664procedure TListDlg.ShowNewContent(NewMode: TWindowMode; ListKind: TListKind);
    16581665var
    1659   i: integer;
    1660   ShowFocus, forceclose: boolean;
     1666  I: Integer;
     1667  ShowFocus, forceclose: Boolean;
    16611668begin
    16621669  forceclose := (ListKind <> Kind) and
     
    17221729  if Kind = kAdvance then // show focus button?
    17231730    if MyData.FarTech <> adNone then
    1724       ShowFocus := true
     1731      ShowFocus := True
    17251732    else
    17261733    begin
    1727       ShowFocus := false;
    1728       for i := 0 to nAdv - 1 do
    1729         if not(i in FutureTech) and (MyRO.Tech[i] < tsApplicable) and
    1730           ((AdvValue[i] < 2000) or (MyRO.Tech[adMassProduction] > tsNA)) and
    1731           ((AdvValue[i] < 1000) or (MyRO.Tech[adScience] > tsNA)) and
    1732           (Server(sSetResearch - sExecute, me, i, nil^) < rExecuted) then
    1733           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;
    17341741    end;
    1735   ToggleBtn.Visible := (Kind = kCities) and not supervising or (Kind = kAdvance)
     1742  ToggleBtn.Visible := (Kind = kCities) and not Supervising or (Kind = kAdvance)
    17361743    and ShowFocus or (Kind = kModels) or (Kind = kEModels);
    17371744  CloseBtn.Visible := not(Kind in MustChooseKind);
    17381745
    17391746  inherited ShowNewContent(NewMode, forceclose);
    1740 end; // ShowNewContent
    1741 
    1742 procedure TListDlg.ShowNewContent_CityProject(NewMode, cix: integer);
     1747end;
     1748
     1749procedure TListDlg.ShowNewContent_CityProject(NewMode: TWindowMode; cix: Integer);
    17431750begin
    17441751  cixProject := cix;
     
    17461753end;
    17471754
    1748 procedure TListDlg.ShowNewContent_MilReport(NewMode, p: integer);
    1749 begin
    1750   pView := p;
    1751   if p = me then
     1755procedure TListDlg.ShowNewContent_MilReport(NewMode: TWindowMode; P: Integer);
     1756begin
     1757  pView := P;
     1758  if P = Me then
    17521759    ShowNewContent(NewMode, kModels)
    17531760  else
     
    17571764procedure TListDlg.PlayerClick(Sender: TObject);
    17581765begin
    1759   if TComponent(Sender).Tag = me then
     1766  if TComponent(Sender).Tag = Me then
    17601767    Kind := kModels
    17611768  else
     
    17651772  end;
    17661773  InitLines;
    1767   Sel := -2;
    1768   sb.Init(Lines[Layer] - 1, DispLines);
     1774  Selected := -2;
     1775  ScrollBar.Init(Lines[Layer] - 1, DispLines);
    17691776  OffscreenPaint;
    17701777  Invalidate;
     
    17781785  Layer := TComponent(Sender).Tag;
    17791786
    1780   Sel := -2;
    1781   sb.Init(Lines[Layer] - 1, DispLines);
     1787  Selected := -2;
     1788  ScrollBar.Init(Lines[Layer] - 1, DispLines);
    17821789  SmartUpdateContent;
    17831790end;
     
    17851792procedure TListDlg.ToggleBtnClick(Sender: TObject);
    17861793var
    1787   p1: integer;
    1788   m: TDpiMenuItem;
     1794  p1: Integer;
     1795  M: TDpiMenuItem;
    17891796begin
    17901797  case Kind of
    17911798    kAdvance:
    17921799      begin
    1793         result := adFar;
    1794         Closable := true;
     1800        Result := adFar;
     1801        Closable := True;
    17951802        Close;
    17961803      end;
     
    18071814      begin
    18081815        EmptyMenu(Popup.Items);
    1809         if G.Difficulty[me] > 0 then
    1810         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;
    18161823          if Kind = kModels then
    1817             m.Checked := true;
    1818           Popup.Items.Add(m);
     1824            M.Checked := True;
     1825          Popup.Items.Add(M);
    18191826        end;
    18201827        for p1 := 0 to nPl - 1 do
    1821           if (p1 <> me) and (MyRO.EnemyReport[p1] <> nil) and
     1828          if (p1 <> Me) and (MyRO.EnemyReport[p1] <> nil) and
    18221829            (MyRO.EnemyReport[p1].TurnOfMilReport >= 0) then
    18231830          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;
    18291836            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);
    18321839          end;
    18331840        Popup.Popup(Left + ToggleBtn.Left, Top + ToggleBtn.Top +
     
    18371844end;
    18381845
    1839 procedure TListDlg.FormKeyDown(Sender: TObject; var Key: word;
     1846procedure TListDlg.FormKeyDown(Sender: TObject; var Key: Word;
    18401847  Shift: TShiftState);
    18411848begin
     
    18761883procedure TListDlg.RemoveUnit;
    18771884begin
    1878   if ListDlg.Visible and (Kind = kModels) then
     1885  if Visible and (Kind = kModels) then
    18791886    SmartUpdateContent;
    18801887end;
     
    18821889procedure TListDlg.ScrollBarUpdate(Sender: TObject);
    18831890begin
    1884   Sel := -2;
    1885   SmartUpdateContent(true);
     1891  Selected := -2;
     1892  SmartUpdateContent(True);
    18861893end;
    18871894
  • branches/highdpi/LocalPlayer/TechTree.pas

    r349 r465  
    3030  end;
    3131
    32 var
    33   TechTreeDlg: TTechTreeDlg;
    34 
    3532
    3633implementation
     
    5552  yLegendPitch = 32;
    5653
    57 function min(a, b: Integer): Integer;
    58 begin
    59   if a < b then
    60     result := a
     54function Min(A, B: Integer): Integer;
     55begin
     56  if A < B then
     57    Result := A
    6158  else
    62     result := b;
    63 end;
    64 
    65 function max(a, b: Integer): Integer;
    66 begin
    67   if a > b then
    68     result := a
     59    Result := B;
     60end;
     61
     62function Max(A, B: Integer): Integer;
     63begin
     64  if A > B then
     65    Result := A
    6966  else
    70     result := b;
     67    Result := B;
    7168end;
    7269
     
    8481procedure TTechTreeDlg.FormPaint(Sender: TObject);
    8582var
    86   X, w: Integer;
     83  X, W: Integer;
    8784begin
    8885  with Canvas do begin
    8986    // 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,
    9592      ClientWidth - BlackBorder, ClientHeight));
    9693
    9794    // texturize empty space
    98     brush.color := $FFFFFF;
     95    Brush.Color := $FFFFFF;
    9996    if xOffset > 0 then
    10097      FillRectSeamless(Canvas, BlackBorder, BlackBorder, BlackBorder + xOffset,
     
    105102        ClientWidth - BlackBorder, ClientHeight - BlackBorder,
    106103        -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);
    109106    if yOffset > 0 then
    110       FillRectSeamless(Canvas, X, BlackBorder, w, BlackBorder + yOffset,
     107      FillRectSeamless(Canvas, X, BlackBorder, W, BlackBorder + yOffset,
    111108        -BlackBorder - xOffset, -BlackBorder - yOffset, Paper);
    112109    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,
    114111        ClientHeight - BlackBorder, -BlackBorder - xOffset,
    115112        -BlackBorder - yOffset, Paper);
    116113  end;
    117   DpiBitCanvas(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));
    125122end;
    126123
     
    128125var
    129126  X, Y, ad: Integer;
    130   s: string;
     127  S: string;
    131128  NewWidth: Integer;
    132129  NewHeight: Integer;
    133130begin
     131  Caption := Phrases2.Lookup('MENU_ADVTREE');
    134132  if Image = nil then begin
    135133    Image := TDpiBitmap.Create;
     
    139137
    140138    with Image.Canvas do begin
    141       // write advance names
     139      // Write advance names
    142140      Font.Assign(UniFont[ftSmall]);
    143       Font.color := clBlack;
    144       brush.Style := bsClear;
    145       for X := 0 to (Image.width - xStart) div xPitch do
    146         for Y := 0 to (Image.height - yStart) div yPitch do
     141      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
    147145        begin
    148146          ad := Pixels[xStart + X * xPitch + 10, yStart + Y * yPitch - 1];
    149147          if ad and $FFFF00 = 0 then
    150148          begin
    151             s := Phrases.Lookup('ADVANCES', ad);
    152             while TextWidth(s) > 112 do
    153               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);
    155153            Pixels[xStart + X * xPitch + 10, yStart + Y * yPitch - 1]
    156154              := TransparentColor2;
    157           end
     155          end;
    158156        end;
    159157
    160       // write legend
     158      // Write legend
    161159      TextOut(xLegend, yLegend, Phrases2.Lookup('ADVTREE_UP0'));
    162160      TextOut(xLegend, yLegend + yLegendPitch, Phrases2.Lookup('ADVTREE_UP1'));
     
    172170  end;
    173171
    174   // fit window to image, center image in window, center window to screen
     172  // Fit window to image, center image in window, center window to screen
    175173  NewWidth := Min(DpiScreen.Width - 40, Image.Width + LeftBorder + RightBorder + 2 * BlackBorder);
    176174  NewHeight := Min(DpiScreen.Height - 40, Image.Height + TopBorder + BottomBorder + 2 * BlackBorder);
     
    190188  if Button = mbLeft then
    191189  begin
    192     dragging := true;
     190    Dragging := True;
    193191    xDown := X;
    194192    yDown := Y;
     
    199197  Shift: TShiftState; X, Y: Integer);
    200198begin
    201   dragging := false;
     199  Dragging := False;
    202200end;
    203201
     
    205203  X, Y: Integer);
    206204begin
    207   if dragging then
     205  if Dragging then
    208206  begin
    209207    xOffset := xOffset + X - xDown;
  • branches/highdpi/LocalPlayer/Term.lfm

    r405 r465  
    11object MainScreen: TMainScreen
    2   Left = 516
     2  Left = 469
    33  Height = 480
    4   Top = 834
     4  Top = 251
    55  Width = 800
    66  HorzScrollBar.Visible = False
     
    1414  DesignTimePPI = 144
    1515  Font.Color = clWindowText
    16   Font.Height = -13
     16  Font.Height = -20
    1717  Font.Name = 'MS Sans Serif'
    1818  KeyPreview = True
     
    3131  OnShow = FormShow
    3232  Position = poDefault
    33   LCLVersion = '2.0.12.0'
     33  LCLVersion = '2.2.0.4'
    3434  Scaled = False
    3535  WindowState = wsMaximized
     
    227227      Tag = 7
    228228      ShortCut = 112
    229       OnClick = MenuClick
     229      OnClick = mHelpClick
    230230    end
    231231    object mTechTree: TDpiMenuItem
    232232      GroupIndex = 1
    233233      ShortCut = 84
    234       OnClick = MenuClick
     234      OnClick = mTechTreeClick
    235235    end
    236236    object N12: TDpiMenuItem
     
    251251      object mOwnMovement: TDpiMenuItem
    252252        Tag = 30
    253         GroupIndex = 1
    254         RadioItem = True
    255253        object mSlowMoves: TDpiMenuItem
    256254          Tag = 75
     
    278276      object mAllyMovement: TDpiMenuItem
    279277        Tag = 90
    280         GroupIndex = 1
    281         RadioItem = True
    282278        object mAlSlowMoves: TDpiMenuItem
    283279          Tag = 91
     
    305301      object mEnemyMovement: TDpiMenuItem
    306302        Tag = 74
    307         GroupIndex = 1
    308         RadioItem = True
    309303        object mEnMoves: TDpiMenuItem
    310304          Tag = 78
     
    349343      object mRep: TDpiMenuItem
    350344        Tag = 34
    351         GroupIndex = 1
    352345        object mRep0: TDpiMenuItem
    353346          OnClick = mRepClicked
     
    417410        Caption = '-'
    418411        GroupIndex = 1
     412        RadioItem = True
    419413      end
    420414      object mWaitTurn: TDpiMenuItem
    421415        Tag = 32
    422         GroupIndex = 1
    423416        OnClick = Toggle
    424417      end
    425418      object mScrolling: TDpiMenuItem
    426419        Tag = 84
    427         GroupIndex = 1
    428420        object mScrollSlow: TDpiMenuItem
    429421          Tag = 85
     
    444436      object mTileSize: TDpiMenuItem
    445437        Tag = 96
    446         GroupIndex = 1
    447438        object mSmallTiles: TDpiMenuItem
    448439          Tag = 97
     
    463454      object mSound: TDpiMenuItem
    464455        Tag = 80
    465         GroupIndex = 1
    466456        object mSoundOn: TDpiMenuItem
    467457          Tag = 82
     
    484474        Caption = '-'
    485475        GroupIndex = 1
     476        RadioItem = True
    486477      end
    487478      object mTest: TDpiMenuItem
    488479        Tag = 8
    489         GroupIndex = 1
    490480        object mJump: TDpiMenuItem
    491481          Tag = 54
    492482          ShortCut = 16458
    493           OnClick = MenuClick
     483          OnClick = mJumpClick
    494484        end
    495485        object mRun: TDpiMenuItem
    496486          Tag = 63
    497487          ShortCut = 16466
    498           OnClick = MenuClick
     488          OnClick = mRunClick
    499489        end
    500490        object mNames: TDpiMenuItem
     
    552542      object mEnhanceDef: TDpiMenuItem
    553543        Tag = 40
    554         OnClick = MenuClick
     544        OnClick = mEnhanceDefClick
    555545      end
    556546      object mCityTypes: TDpiMenuItem
    557547        Tag = 11
    558         OnClick = MenuClick
     548        OnClick = mCityTypesClick
    559549      end
    560550    end
     
    563553      GroupIndex = 1
    564554      ShortCut = 16466
    565       OnClick = MenuClick
     555      OnClick = mRandomMapClick
    566556    end
    567557    object N3: TDpiMenuItem
     
    572562      Tag = 88
    573563      GroupIndex = 1
    574       OnClick = MenuClick
     564      OnClick = mWebsiteClick
    575565    end
    576566    object N2: TDpiMenuItem
     
    582572      GroupIndex = 1
    583573      ShortCut = 16465
    584       OnClick = MenuClick
     574      OnClick = mResignClick
    585575    end
    586576  end
     
    592582      Tag = 72
    593583      ShortCut = 16452
    594       OnClick = MenuClick
     584      OnClick = mDisbandOrUtilizeClick
    595585    end
    596586    object mUtilize: TDpiMenuItem
    597587      ShortCut = 90
    598       OnClick = MenuClick
     588      OnClick = mDisbandOrUtilizeClick
    599589    end
    600590    object N1: TDpiMenuItem
     
    603593    object mcity: TDpiMenuItem
    604594      ShortCut = 66
    605       OnClick = MenuClick
     595      OnClick = mcityClick
    606596    end
    607597    object mPillage: TDpiMenuItem
    608598      Tag = 19
    609599      ShortCut = 16464
    610       OnClick = MenuClick
     600      OnClick = mPillageClick
    611601    end
    612602    object N5: TDpiMenuItem
     
    615605    object mhome: TDpiMenuItem
    616606      ShortCut = 72
    617       OnClick = MenuClick
     607      OnClick = mhomeClick
    618608    end
    619609    object mLoad: TDpiMenuItem
    620610      Tag = 24
    621611      ShortCut = 76
    622       OnClick = MenuClick
     612      OnClick = mLoadClick
    623613    end
    624614    object mUnload: TDpiMenuItem
    625615      Tag = 70
    626616      ShortCut = 85
    627       OnClick = MenuClick
     617      OnClick = mUnloadClick
    628618    end
    629619    object mSelectTransport: TDpiMenuItem
    630620      Tag = 73
    631621      ShortCut = 16468
    632       OnClick = MenuClick
     622      OnClick = mSelectTransportClick
    633623    end
    634624    object mGoOn: TDpiMenuItem
    635625      Tag = 13
    636626      ShortCut = 71
    637       OnClick = MenuClick
     627      OnClick = mGoOnClick
    638628    end
    639629    object mCancel: TDpiMenuItem
    640630      Tag = 1
    641631      ShortCut = 16451
    642       OnClick = MenuClick
     632      OnClick = mCancelClick
    643633    end
    644634    object mRecover: TDpiMenuItem
    645635      Tag = 69
    646636      ShortCut = 86
    647       OnClick = MenuClick
     637      OnClick = mRecoverClick
    648638    end
    649639    object mwait: TDpiMenuItem
    650640      Tag = 25
    651641      ShortCut = 87
    652       OnClick = MenuClick
     642      OnClick = mwaitClick
    653643    end
    654644    object mnoorders: TDpiMenuItem
    655645      Tag = 26
    656646      ShortCut = 32
    657       OnClick = MenuClick
     647      OnClick = mnoordersClick
    658648    end
    659649    object mstay: TDpiMenuItem
    660650      Tag = 22
    661651      ShortCut = 83
    662       OnClick = MenuClick
     652      OnClick = mstayClick
    663653    end
    664654    object mCentre: TDpiMenuItem
    665655      Tag = 12
    666656      ShortCut = 67
    667       OnClick = MenuClick
     657      OnClick = mCentreClick
    668658    end
    669659    object N13: TDpiMenuItem
     
    673663      Tag = 100
    674664      ShortCut = 46
    675       OnClick = MenuClick
     665      OnClick = mPrevUnitClick
    676666    end
    677667    object mNextUnit: TDpiMenuItem
    678668      Tag = 101
    679669      ShortCut = 45
    680       OnClick = MenuClick
     670      OnClick = mNextUnitClick
    681671    end
    682672  end
     
    688678      Tag = 9
    689679      ShortCut = 113
    690       OnClick = MenuClick
     680      OnClick = mUnitStatClick
    691681    end
    692682    object mCityStat: TDpiMenuItem
    693683      Tag = 37
    694684      ShortCut = 114
    695       OnClick = MenuClick
     685      OnClick = mCityStatClick
    696686    end
    697687    object mScienceStat: TDpiMenuItem
    698688      Tag = 38
    699689      ShortCut = 115
    700       OnClick = MenuClick
     690      OnClick = mScienceStatClick
    701691    end
    702692    object mEUnitStat: TDpiMenuItem
    703693      Tag = 50
    704694      ShortCut = 116
    705       OnClick = MenuClick
     695      OnClick = mEUnitStatClick
    706696    end
    707697    object mDiagram: TDpiMenuItem
    708698      Tag = 21
    709699      ShortCut = 117
    710       OnClick = MenuClick
     700      OnClick = mDiagramClick
    711701    end
    712702    object mWonders: TDpiMenuItem
    713703      Tag = 6
    714704      ShortCut = 118
    715       OnClick = MenuClick
     705      OnClick = mWondersClick
    716706    end
    717707    object mShips: TDpiMenuItem
    718708      Tag = 41
    719709      ShortCut = 119
    720       OnClick = MenuClick
     710      OnClick = mShipsClick
    721711    end
    722712    object N4: TDpiMenuItem
     
    726716      Tag = 55
    727717      ShortCut = 120
    728       OnClick = MenuClick
     718      OnClick = mNationsClick
    729719    end
    730720    object mEmpire: TDpiMenuItem
    731721      Tag = 3
    732722      ShortCut = 121
    733       OnClick = MenuClick
     723      OnClick = mEmpireClick
    734724    end
    735725    object mRevolution: TDpiMenuItem
    736726      Tag = 89
    737       OnClick = MenuClick
     727      OnClick = mRevolutionClick
    738728    end
    739729  end
     
    751741      Tag = 273
    752742      ShortCut = 79
    753       OnClick = MenuClick
     743      OnClick = mtransClick
    754744    end
    755745    object mAfforest: TDpiMenuItem
    756746      Tag = 301
    757747      ShortCut = 77
    758       OnClick = MenuClick
     748      OnClick = mAfforestClick
    759749    end
    760750    object mClear: TDpiMenuItem
    761751      Tag = 298
    762752      ShortCut = 73
    763       OnClick = MenuClick
     753      OnClick = mClearClick
    764754    end
    765755    object mfort: TDpiMenuItem
    766756      Tag = 276
    767757      ShortCut = 70
    768       OnClick = MenuClick
     758      OnClick = mfortClick
    769759    end
    770760    object mAirBase: TDpiMenuItem
    771761      Tag = 272
    772762      ShortCut = 65
    773       OnClick = MenuClick
     763      OnClick = mAirBaseClick
    774764    end
    775765    object mCanal: TDpiMenuItem
    776766      Tag = 279
    777767      ShortCut = 78
    778       OnClick = MenuClick
     768      OnClick = mCanalClick
    779769    end
    780770    object mmine: TDpiMenuItem
    781771      Tag = 302
    782772      ShortCut = 77
    783       OnClick = MenuClick
     773      OnClick = mmineClick
    784774    end
    785775    object mFarm: TDpiMenuItem
    786776      Tag = 300
    787777      ShortCut = 73
    788       OnClick = MenuClick
     778      OnClick = mFarmClick
    789779    end
    790780    object mirrigation: TDpiMenuItem
    791781      Tag = 299
    792782      ShortCut = 73
    793       OnClick = MenuClick
    794     end
    795     object mrr: TDpiMenuItem
     783      OnClick = mirrigationClick
     784    end
     785    object mRailRoad: TDpiMenuItem
    796786      Tag = 297
    797787      ShortCut = 82
    798       OnClick = MenuClick
     788      OnClick = mRailRoadClick
    799789    end
    800790    object mroad: TDpiMenuItem
    801791      Tag = 296
    802792      ShortCut = 82
    803       OnClick = MenuClick
     793      OnClick = mroadClick
    804794    end
    805795    object mpollution: TDpiMenuItem
    806796      Tag = 274
    807797      ShortCut = 80
    808       OnClick = MenuClick
     798      OnClick = mpollutionClick
    809799    end
    810800    object mEnhance: TDpiMenuItem
    811801      Tag = 295
    812802      ShortCut = 69
    813       OnClick = MenuClick
     803      OnClick = mEnhanceClick
    814804    end
    815805  end
  • branches/highdpi/LocalPlayer/Term.pas

    r405 r465  
    55
    66uses
    7   UDpiControls, {$IFDEF Windows}
     7  UDpiControls, {$IFDEF WINDOWS}
    88  Windows,
    99{$ENDIF}
    10 {$IFDEF Linux}
     10{$IFDEF UNIX}
    1111  LMessages, Messages,
    1212{$ENDIF}
     
    1414  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, DrawDlg, Types,
    1515  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;
    1719
    1820const
     
    6870    mWonders: TDpiMenuItem;
    6971    mScienceStat: TDpiMenuItem;
    70     mRR: TDpiMenuItem;
     72    mRailRoad: TDpiMenuItem;
    7173    mClear: TDpiMenuItem;
    7274    mFarm: TDpiMenuItem;
     
    181183    procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
    182184      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);
    183234    procedure Timer1Timer(Sender: TObject);
    184235    procedure MapBoxMouseDown(Sender: TObject; Button: TMouseButton;
    185       Shift: TShiftState; x, y: integer);
     236      Shift: TShiftState; X, Y: Integer);
    186237    procedure EOTClick(Sender: TObject);
    187238    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);
    191242    procedure FormResize(Sender: TObject);
    192243    procedure PanelBtnClick(Sender: TObject);
    193     procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
     244    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    194245    procedure Toggle(Sender: TObject);
    195246    procedure PanelBoxMouseMove(Sender: TObject; Shift: TShiftState;
    196       x, y: integer);
     247      X, Y: Integer);
    197248    procedure PanelBoxMouseUp(Sender: TObject; Button: TMouseButton;
    198       Shift: TShiftState; x, y: integer);
     249      Shift: TShiftState; X, Y: Integer);
    199250    procedure MapBoxMouseMove(Sender: TObject; Shift: TShiftState;
    200       x, y: integer);
     251      X, Y: Integer);
    201252    procedure mShowClick(Sender: TObject);
    202253    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);
    205256    procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
    206       Shift: TShiftState; x, y: integer);
     257      Shift: TShiftState; X, Y: Integer);
    207258    procedure FormPaint(Sender: TObject);
    208259    procedure mRepClicked(Sender: TObject);
     
    214265    procedure mNamesClick(Sender: TObject);
    215266    procedure MapBtnClick(Sender: TObject);
    216     procedure FormKeyUp(Sender: TObject; var Key: word; Shift: TShiftState);
     267    procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    217268    procedure CreateUnitClick(Sender: TObject);
    218269    procedure mSoundOffClick(Sender: TObject);
     
    275326    NoMap: TIsoMap;
    276327    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;
    278363    procedure GetTribeList;
     364    function GetUnitStatDlg: TUnitStatDlg;
     365    function GetWondersDlg: TWondersDlg;
    279366    procedure InitModule;
    280367    procedure DoneModule;
    281     procedure InitTurn(NewPlayer: integer);
     368    procedure InitTurn(NewPlayer: Integer);
    282369    procedure SaveMenuItemsState;
    283370    procedure ScrollBarUpdate(Sender: TObject);
     
    291378    procedure FocusNextUnit(Dir: Integer = 1);
    292379    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);
    302389    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;
    310397    procedure EndNego;
    311     function IsPanelPixel(x, y: integer): boolean;
     398    function IsPanelPixel(X, Y: Integer): Boolean;
    312399    procedure InitPopup(Popup: TDpiPopupMenu);
    313400    procedure SetMapOptions;
     
    315402    procedure CheckTerrainBtnVisible;
    316403    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;
    320407    function GetCenterLoc: Integer;
    321408    procedure SetTileSizeCenter(TileSize: TTileSize);
    322409    procedure SetTileSize(TileSize: TTileSize; Loc: Integer; MapPos: TPoint);
    323     procedure RectInvalidate(Left, Top, Rigth, Bottom: integer);
     410    procedure RectInvalidate(Left, Top, Rigth, Bottom: Integer);
    324411    procedure ShowEnemyShipChange(ShowShipChange: TShowShipChange);
    325     procedure SmartRectInvalidate(Left, Top, Rigth, Bottom: integer);
     412    procedure SmartRectInvalidate(Left, Top, Rigth, Bottom: Integer);
    326413    procedure LoadSettings;
    327414    procedure SaveSettings;
     
    331418    procedure UpdateKeyShortcuts;
    332419    procedure SetFullScreen(Active: Boolean);
    333     procedure PaintZoomedTile(dst: TDpiBitmap; x, y, Loc: integer);
     420    procedure PaintZoomedTile(dst: TDpiBitmap; X, Y, Loc: Integer);
    334421  public
    335     UsedOffscreenWidth, UsedOffscreenHeight: integer;
     422    UsedOffscreenWidth: Integer;
     423    UsedOffscreenHeight: Integer;
    336424    Offscreen: TDpiBitmap;
    337425    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;
    348453  end;
    349454
     
    352457
    353458type
     459
     460  { TTribeInfo }
     461
    354462  TTribeInfo = record
    355     trix: integer;
     463    trix: Integer;
    356464    FileName: ShortString;
    357   end;
     465    function GetCommandDataSize: Byte;
     466  end;
     467
     468  { TCityNameInfo }
    358469
    359470  TCityNameInfo = record
    360     ID: integer;
     471    ID: Integer;
    361472    NewName: ShortString;
    362   end;
     473    function GetCommandDataSize: Byte;
     474  end;
     475
     476  { TModelNameInfo }
    363477
    364478  TModelNameInfo = record
    365     mix: integer;
     479    mix: Integer;
    366480    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);
    370485
    371486const
     
    410525  usToldNoReturn = $100;
    411526  usPersistent = usStay or usGoto or usEnhance or usRecover or
    412     integer($FFFF0000);
     527    Integer($FFFF0000);
    413528
    414529  { model status flags }
     
    424539  adNexus = $803;
    425540
    426   SpecialModelPictureCode: array [0 .. nSpecialModel - 1] of integer = (10,
     541  SpecialModelPictureCode: array [0 .. nSpecialModel - 1] of Integer = (10,
    427542    11, 40, 41, 21, 30, { 50,51, } 64, 74, { 71, } 73);
    428543
     
    437552
    438553  nCityEventPriority = 16;
    439   CityEventPriority: array [0 .. nCityEventPriority - 1] of integer =
     554  CityEventPriority: array [0 .. nCityEventPriority - 1] of Integer =
    440555    (chDisorder, chImprovementLost, chUnitLost, chAllImpsMade, chProduction,
    441556    chOldWonder, chNoSettlerProd, chPopDecrease, chProductionSabotaged,
     
    504619  DestinationMarkON: Boolean;
    505620  StartRunning: Boolean;
    506   StayOnTop_Ensured: Boolean;
    507621  Supervising: Boolean;
    508622  UnusedTribeFiles: TStringList;
     
    512626  DipMem: array [0 .. nPl - 1] of TDipMem;
    513627
    514 function CityEventName(i: integer): string;
    515 function RoughCredibility(Credibility: integer): integer;
    516 
    517 function InitEnemyModel(emix: integer): boolean;
     628function CityEventName(I: Integer): string;
     629function RoughCredibility(Credibility: Integer): Integer;
     630
     631function InitEnemyModel(emix: Integer): Boolean;
    518632procedure 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);
     633procedure InitMyModel(Mix: Integer; Final: Boolean);
     634
     635procedure ImpImage(ca: TDpiCanvas; X, Y, iix: Integer; Government: Integer = -1;
     636  IsControl: Boolean = False);
     637procedure HelpOnTerrain(Loc: Integer; NewMode: TWindowMode);
     638function AlignUp(Value, Alignment: Integer): Integer;
    524639
    525640
     
    527642
    528643uses
    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;
    532645
    533646{$R *.lfm}
     
    536649  lxmax_xxx = 130;
    537650  LeftPanelWidth = 70;
    538   LeftPanelWidth_Editor = 46;
    539651  overlap = PanelHeight - MidPanelHeight;
    540652  yTroop = PanelHeight - 83;
    541653  xPalace = 66;
    542654  yPalace = 24; // 120;
    543   xAdvisor = 108;
    544   yAdvisor = 48;
     655{  xAdvisor = 108;
     656  yAdvisor = 48;}
    545657  xUnitText = 80;
    546   PaperShade = 3;
    547658  BlinkOnTime = 12;
    548659  BlinkOffTime = 6;
    549660  MoveTime = 300; // {time for moving a unit in ms}
    550661  WaitAfterShowMove = 32;
    551   FastScrolling = false; // causes problems with overlapping windows
     662  FastScrolling = False; // causes problems with overlapping windows
    552663
    553664  nBrushTypes = 26;
     
    587698  CurrentMoveInfo: TCurrentMoveInfo;
    588699
    589 function CityEventName(i: integer): string;
    590 begin
    591   if i = 14 then // chAllImpsMade
     700function CityEventName(I: Integer): string;
     701begin
     702  if I = 14 then // chAllImpsMade
    592703    if not Phrases2FallenBackToEnglish then
    593       result := Phrases2.Lookup('CITYEVENT_ALLIMPSMADE')
     704      Result := Phrases2.Lookup('CITYEVENT_ALLIMPSMADE')
    594705    else
    595       result := Phrases.Lookup('CITYEVENTS', 1)
     706      Result := Phrases.Lookup('CITYEVENTS', 1)
    596707  else
    597     result := Phrases.Lookup('CITYEVENTS', i);
     708    Result := Phrases.Lookup('CITYEVENTS', I);
    598709end;
    599710
     
    605716  TBuffer = array [0 .. 99999, 0 .. 2] of Integer;
    606717var
    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;
    608720  xdivider, ydivider: Integer;
    609721  Resampled: ^TBuffer;
     
    611723begin
    612724  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;
    618725  ny := BigImp.Height div ySizeBig * ySizeSmall;
    619726
     
    624731  for ix := 0 to BigImp.Width div xSizeBig - 1 do
    625732    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 begin
    629         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;
    631738        if ydivider > ySizeSmall then
    632739          ydivider := ySizeSmall;
    633         for x := 0 to ScaleToNative(xSizeBig) - 1 do begin
    634           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;
    639746          if xdivider > xSizeSmall then
    640747            xdivider := xSizeSmall;
    641748          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);
    644751            if xdivider < xSizeSmall then
    645               Inc(Resampled[ir + 1, ch], c * (xSizeSmall - xdivider) *
     752              Inc(Resampled[ir + 1, ch], C * (xSizeSmall - xdivider) *
    646753                ydivider);
    647754            if ydivider < ySizeSmall then
    648755              Inc(Resampled[ir + nx, ch],
    649                 c * xdivider * (ySizeSmall - ydivider));
     756                C * xdivider * (ySizeSmall - ydivider));
    650757            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) *
    652759                (ySizeSmall - ydivider));
    653760          end;
     
    662769  SmallImp.SetSize(nx, ny);
    663770  SmallImp.BeginUpdate;
    664   PixelPtr := PixelPointer(SmallImp);
    665   for y := 0 to ScaleToNative(ny) - 1 do begin
    666     for x := 0 to ScaleToNative(nx) - 1 do begin
     771  PixelPtr := TPixelPointer.Create(SmallImp);
     772  for Y := 0 to ScaleToNative(ny) - 1 do begin
     773    for X := 0 to ScaleToNative(nx) - 1 do begin
    667774      for ch := 0 to 2 do begin
    668775        Sum := 0;
    669776        Cnt := 0;
    670777        for dy := -1 to 1 do
    671           if ((dy >= 0) or (ScaleFromNative(y) mod ySizeSmall > 0)) and
    672             ((dy <= 0) or (ScaleFromNative(y) mod ySizeSmall < ySizeSmall - 1)) then
     778          if ((dy >= 0) or (ScaleFromNative(Y) mod ySizeSmall > 0)) and
     779            ((dy <= 0) or (ScaleFromNative(Y) mod ySizeSmall < ySizeSmall - 1)) then
    673780            for dx := -1 to 1 do
    674               if ((dx >= 0) or (ScaleFromNative(x) mod xSizeSmall > 0)) and
    675                 ((dx <= 0) or (ScaleFromNative(x) mod xSizeSmall < xSizeSmall - 1)) then
     781              if ((dx >= 0) or (ScaleFromNative(X) mod xSizeSmall > 0)) and
     782                ((dx <= 0) or (ScaleFromNative(X) mod xSizeSmall < xSizeSmall - 1)) then
    676783              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]);
    678785                Inc(Cnt);
    679786              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));
    682789        if Sum < 0 then Sum := 0;
    683790        if Sum > 255 then Sum := 255;
     
    690797  SmallImp.EndUpdate;
    691798  FreeMem(Resampled);
    692   }
    693 end;
    694 
    695 procedure ImpImage(ca: TDpiCanvas; x, y, iix: integer; Government: integer;
    696   IsControl: boolean);
     799end;
     800
     801procedure ImpImage(ca: TDpiCanvas; X, Y, iix: Integer; Government: Integer;
     802  IsControl: Boolean);
    697803begin
    698804  if Government < 0 then
     
    700806  if (iix = imPalace) and (Government <> gAnarchy) then
    701807    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)
    703809    mod 7 * xSizeBig, (iix + SystemIconLines * 7) div 7 * ySizeBig, IsControl);
    704810end;
    705811
    706 procedure HelpOnTerrain(Loc, NewMode: integer);
     812procedure HelpOnTerrain(Loc: Integer; NewMode: TWindowMode);
    707813begin
    708814  if MyMap[Loc] and fDeadLands <> 0 then
    709     HelpDlg.ShowNewContent(NewMode, hkTer, 3 * 12)
     815    MainScreen.HelpDlg.ShowNewContent(NewMode, hkTer, 3 * 12)
    710816  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,
    712818      fJungle + (MyMap[Loc] shr 5 and 3) * 12)
    713819  else
    714     HelpDlg.ShowNewContent(NewMode, hkTer, MyMap[Loc] and fTerrain +
     820    MainScreen.HelpDlg.ShowNewContent(NewMode, hkTer, MyMap[Loc] and fTerrain +
    715821      (MyMap[Loc] shr 5 and 3) * 12);
    716822end;
    717823
     824function AlignUp(Value, Alignment: Integer): Integer;
     825begin
     826  Result := Value or (Alignment - 1);
     827end;
     828
    718829{ *** tribe management procedures *** }
    719830
    720 function RoughCredibility(Credibility: integer): integer;
     831function RoughCredibility(Credibility: Integer): Integer;
    721832begin
    722833  case Credibility of
    723834    0 .. 69:
    724       result := 0;
     835      Result := 0;
    725836    70 .. 89:
    726       result := 1;
     837      Result := 1;
    727838    90 .. 99:
    728       result := 2;
     839      Result := 2;
    729840    100:
    730       result := 3
    731   end;
    732 end;
    733 
    734 procedure ChooseModelPicture(p, mix, code, Hash, Turn: integer;
    735   ForceNew, final: boolean);
     841      Result := 3;
     842  end;
     843end;
     844
     845procedure ChooseModelPicture(P, mix, Code, Hash, Turn: Integer;
     846  ForceNew, final: Boolean);
    736847var
    737   i: integer;
     848  I: Integer;
    738849  Picture: TModelPictureInfo;
    739   IsNew: boolean;
    740 begin
    741   Picture.trix := p;
     850  IsNew: Boolean;
     851begin
     852  Picture.trix := P;
    742853  Picture.mix := mix;
    743   if code = 74 then
     854  if Code = 74 then
    744855  begin // use correct pictures for slaves
    745     if Tribe[p].mixSlaves < 0 then
    746       if not TribeOriginal[p] then
    747         Tribe[p].mixSlaves := mix
     856    if Tribe[P].mixSlaves < 0 then
     857      if not TribeOriginal[P] then
     858        Tribe[P].mixSlaves := mix
    748859      else
    749860      begin
    750         i := mix + p shl 16;
    751         Server(cSetSlaveIndex, 0, 0, i);
     861        I := mix + P shl 16;
     862        Server(cSetSlaveIndex, 0, 0, I);
    752863      end;
    753864    if ToldSlavery = 1 then
     
    757868    Picture.Hash := 0;
    758869    Picture.GrName := 'StdUnits.png';
    759     IsNew := true;
     870    IsNew := True;
    760871  end
    761872  else
    762873  begin
    763874    Picture.Hash := Hash;
    764     IsNew := Tribe[p].ChooseModelPicture(Picture, code, Turn, ForceNew);
     875    IsNew := Tribe[P].ChooseModelPicture(Picture, Code, Turn, ForceNew);
    765876  end;
    766877  if final then
    767     if not TribeOriginal[p] then
    768       Tribe[p].SetModelPicture(Picture, IsNew)
     878    if not TribeOriginal[P] then
     879      Tribe[P].SetModelPicture(Picture, IsNew)
    769880    else if IsNew then
    770       Server(cSetNewModelPicture + (Length(Picture.GrName) + 1 + 16 + 3) div 4,
     881      Server(CommandWithData(cSetNewModelPicture, Picture.GetCommandDataSize),
    771882        0, 0, Picture)
    772883    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)
    775886  else
    776     with Tribe[p].ModelPicture[mix] do
     887    with Tribe[P].ModelPicture[mix] do
    777888    begin
    778889      HGr := LoadGraphicSet(Picture.GrName);
     
    781892end;
    782893
    783 function InitEnemyModel(emix: integer): boolean;
     894function InitEnemyModel(emix: Integer): Boolean;
    784895begin
    785896  if GameMode = cMovie then
    786897  begin
    787     result := false;
    788     exit
     898    Result := False;
     899    Exit;
    789900  end;
    790901  with MyRO.EnemyModel[emix] do
    791902    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;
    794905end;
    795906
    796907procedure InitAllEnemyModels;
    797908var
    798   emix: integer;
     909  emix: Integer;
    799910begin
    800911  for emix := 0 to MyRO.nEnemyModel - 1 do
     
    804915end;
    805916
    806 procedure InitMyModel(mix: integer; final: boolean);
     917procedure InitMyModel(Mix: Integer; Final: Boolean);
    807918var
    808919  mi: TModelInfo;
    809920begin
    810921  if (GameMode = cMovie) and (MyModel[mix].Kind < $08) then
    811     exit;
     922    Exit;
    812923  // 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);
     927end;
     928
     929function AttackSound(Code: Integer): string;
     930begin
     931  Result := 'ATTACK_' + char(48 + Code div 100 mod 10) +
     932    char(48 + Code div 10 mod 10) + char(48 + Code mod 10);
     933end;
     934
     935procedure CheckToldNoReturn(uix: Integer);
    825936// check whether aircraft survived low-fuel warning
    826937begin
    827   assert(not supervising);
     938  Assert(not Supervising);
    828939  with MyUn[uix] do
    829940    if (Status and usToldNoReturn <> 0) and
     
    833944end;
    834945
    835 function CreateTribe(p: integer; FileName: string; Original: boolean): boolean;
     946function CreateTribe(P: Integer; FileName: string; Original: Boolean): Boolean;
    836947begin
    837948  FileName := LocalizedFilePath('Tribes' + DirectorySeparator + FileName +
     
    843954  end;
    844955
    845   TribeOriginal[p] := Original;
    846   Tribe[p] := TTribe.Create(FileName);
    847   with Tribe[p] do
     956  TribeOriginal[P] := Original;
     957  Tribe[P] := TTribe.Create(FileName);
     958  with Tribe[P] do
    848959  begin
    849960    if (GameMode = cNewGame) or not Original then
    850961    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;
    859970end;
    860971
    861972procedure TellNewContacts;
    862973var
    863   p1: integer;
    864 begin
    865   if not supervising then
     974  p1: Integer;
     975begin
     976  if not Supervising then
    866977    for p1 := 0 to nPl - 1 do
    867       if (p1 <> me) and (1 shl p1 and MyData.ToldContact = 0) and
     978      if (p1 <> Me) and (1 shl p1 and MyData.ToldContact = 0) and
    868979        (1 shl p1 and MyRO.Alive <> 0) and (MyRO.Treaty[p1] > trNoContact) then
    869980      begin
    870981        TribeMessage(p1, Tribe[p1].TPhrase('FRNEWNATION'), '');
    871982        MyData.ToldContact := MyData.ToldContact or (1 shl p1);
    872       end
     983      end;
    873984end;
    874985
    875986procedure TellNewModels;
    876987var
    877   mix: integer;
     988  mix: Integer;
    878989  ModelNameInfo: TModelNameInfo;
    879990begin
    880   if supervising then
    881     exit;
    882   with Tribe[me] do
     991  if Supervising then
     992    Exit;
     993  with Tribe[Me] do
    883994    while MyData.ToldModels < MyRO.nModel do
    884995    begin { new Unit class available }
     
    8911002      end;
    8921003      if not Assigned(ModelPicture[MyData.ToldModels].HGr) then
    893         InitMyModel(MyData.ToldModels, true);
     1004        InitMyModel(MyData.ToldModels, True);
    8941005      { only run if no researched model }
    895       with MessgExDlg do
     1006      with MainScreen.MessgExDlg do
    8961007      begin
    8971008        { MakeModelInfo(me,MyData.ToldModels,MyModel[MyData.ToldModels],mi);
     
    9191030          ModelNameInfo.mix := MyData.ToldModels;
    9201031          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);
    9231037        end;
    9241038      end;
     
    9291043            MyModel[mix].Status := MyModel[mix].Status or msObsolete;
    9301044      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;
     1047end;
     1048
     1049{ TTribeInfo }
     1050
     1051function TTribeInfo.GetCommandDataSize: Byte;
     1052begin
     1053  Result := SizeOf(trix) + 1 + Length(FileName)
     1054end;
     1055
     1056{ TModelNameInfo }
     1057
     1058function TModelNameInfo.GetCommandDataSize: Byte;
     1059begin
     1060  Result := SizeOf(mix) + 1 + Length(NewName);
     1061end;
     1062
     1063{ TCityNameInfo }
     1064
     1065function TCityNameInfo.GetCommandDataSize: Byte;
     1066begin
     1067  Result := SizeOf(ID) + 1 + Length(NewName);
     1068end;
     1069
     1070procedure TMainScreen.PaintZoomedTile(dst: TDpiBitmap; X, Y, Loc: Integer);
     1071
     1072  procedure TSprite(xDst, yDst, xSrc, ySrc: Integer);
    9381073  begin
    9391074    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,
    9411076        1 + xSrc * (xxt * 2 + 1), 1 + ySrc * (yyt * 3 + 1));
    9421077  end;
    9431078
    944   procedure TSprite4(xSrc, ySrc: integer);
     1079  procedure TSprite4(xSrc, ySrc: Integer);
    9451080  begin
    9461081    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,
    9481083        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,
    9501085        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,
    9521087        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,
    9541089        1 + xSrc * (xxt * 2 + 1), 1 + yyt + ySrc * (yyt * 3 + 1));
    9551090    end;
     
    9571092
    9581093var
    959   cix, ySrc, Tile: integer;
     1094  cix, ySrc, Tile: Integer;
    9601095begin
    9611096  with NoMapPanel do begin
     
    9711106        cix := MyRO.nCity - 1;
    9721107        while (cix >= 0) and (MyCity[cix].Loc <> Loc) do
    973           dec(cix);
    974         assert(cix >= 0);
     1108          Dec(cix);
     1109        Assert(cix >= 0);
    9751110        if MyCity[cix].Built[imSupermarket] > 0 then
    9761111          Tile := Tile or tiFarm
     
    10631198end;
    10641199
    1065 function ChooseResearch: boolean;
     1200function ChooseResearch: Boolean;
    10661201var
    1067   ChosenResearch: integer;
     1202  ChosenResearch: Integer;
    10681203begin
    10691204  if (MyData.FarTech <> adNone) and (MyRO.Tech[MyData.FarTech] >= tsApplicable)
     
    10731208    { research complete -- select new }
    10741209    repeat
    1075       ModalSelectDlg.ShowNewContent(wmModal, kAdvance);
    1076       if ModalSelectDlg.result < 0 then
     1210      MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kAdvance);
     1211      if MainScreen.ModalSelectDlg.Result < 0 then
    10771212      begin
    1078         result := false;
    1079         exit;
    1080       end;
    1081       ChosenResearch := ModalSelectDlg.result;
     1213        Result := False;
     1214        Exit;
     1215      end;
     1216      ChosenResearch := MainScreen.ModalSelectDlg.Result;
    10821217      if ChosenResearch = adMilitary then
    10831218      begin
    1084         DraftDlg.ShowNewContent(wmModal);
    1085         if DraftDlg.ModalResult <> mrOK then
    1086           Tribe[me].ModelPicture[MyRO.nModel].HGr := nil
    1087       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);
    10891224
    10901225    if ChosenResearch = adMilitary then
    1091       InitMyModel(MyRO.nModel, true)
     1226      InitMyModel(MyRO.nModel, True)
    10921227    else if ChosenResearch = adFar then
    10931228    begin
    1094       ModalSelectDlg.ShowNewContent(wmModal, kFarAdvance);
    1095       if ModalSelectDlg.result >= 0 then
    1096         if (ModalSelectDlg.result = adNone) or
    1097           (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^) <
    10981233          rExecuted) then
    1099           MyData.FarTech := ModalSelectDlg.result
     1234          MyData.FarTech := MainScreen.ModalSelectDlg.Result
    11001235        else
    11011236        begin
    1102           ChosenResearch := ModalSelectDlg.result;
     1237          ChosenResearch := MainScreen.ModalSelectDlg.Result;
    11031238          // can be researched immediately
    1104           MyData.FarTech := adNone
     1239          MyData.FarTech := adNone;
    11051240        end;
    11061241    end;
     
    11091244    MyData.FarTech := adNexus
    11101245  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;
     1249end;
     1250
     1251procedure ApplyToVisibleForms(FormAction: TFormAction);
     1252var
     1253  I: Integer;
     1254  Form: TDpiForm;
     1255begin
     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;
    11141272end;
    11151273
    11161274(* ** client function handling ** *)
    11171275
    1118 function TMainScreen.DipCall(Command: integer): integer;
     1276function TMainScreen.DipCall(Command: Integer): Integer;
    11191277var
    1120   i: integer;
    1121   IsTreatyDeal: boolean;
    1122 begin
    1123   result := Server(Command, me, 0, nil^);
    1124   if result >= rExecuted then
     1278  I: Integer;
     1279  IsTreatyDeal: Boolean;
     1280begin
     1281  Result := Server(Command, Me, 0, nil^);
     1282  if Result >= rExecuted then
    11251283  begin
    11261284    if Command and $FF0F = scContact then
    11271285    begin
    1128       DipMem[me].pContact := Command shr 4 and $F;
     1286      DipMem[Me].pContact := Command shr 4 and $F;
    11291287      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];
    11361294    if Command = scDipCancelTreaty then
    11371295      Play('CANCELTREATY')
    11381296    else if Command = scDipAccept then
    11391297    begin // remember delivered and received prices
    1140       for i := 0 to ReceivedOffer.nDeliver - 1 do
    1141         include(DipMem[me].ReceivedPrices, ReceivedOffer.Price[i] shr 24);
    1142       for i := 0 to ReceivedOffer.nCost - 1 do
    1143         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 do
    1147         if ReceivedOffer.Price[i] and opMask = opTreaty then
    1148           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;
    11491307      if IsTreatyDeal then
    11501308        Play('NEWTREATY')
     
    11531311    end;
    11541312    CityDlg.CloseAction := None;
    1155     if G.RO[DipMem[me].pContact] <> nil then
     1313    if G.RO[DipMem[Me].pContact] <> nil then
    11561314    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);
    11611316    end
    11621317    else
     
    11701325end;
    11711326
    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;
     1327function TMainScreen.OfferCall(var Offer: TOffer): Integer;
     1328begin
     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;
    11821335    CityDlg.CloseAction := None;
    1183     if G.RO[DipMem[me].pContact] <> nil then
     1336    if G.RO[DipMem[Me].pContact] <> nil then
    11841337    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);
    11891339    end
    11901340    else
     
    11981348end;
    11991349
    1200 procedure TMainScreen.SetUnFocus(uix: integer);
     1350procedure TMainScreen.SetUnFocus(uix: Integer);
    12011351var
    1202   Loc0: integer;
    1203 begin
    1204   assert(not((uix >= 0) and supervising));
     1352  Loc0: Integer;
     1353begin
     1354  Assert(not((uix >= 0) and Supervising));
    12051355  if uix <> UnFocus then
    12061356  begin
    1207     DestinationMarkON := false;
     1357    DestinationMarkON := False;
    12081358    PaintDestination;
    12091359    if uix >= 0 then
    12101360      UnStartLoc := MyUn[uix].Loc;
    1211     BlinkON := false;
     1361    BlinkON := False;
    12121362    BlinkTime := -1;
    12131363    if UnFocus >= 0 then
     
    12291379procedure TMainScreen.CheckTerrainBtnVisible;
    12301380var
    1231   Tile: integer;
     1381  Tile: Integer;
    12321382  mox: ^TModel;
    12331383begin
     
    12411391  end
    12421392  else
    1243     TerrainBtn.Visible := false;
     1393    TerrainBtn.Visible := False;
    12441394end;
    12451395
     
    12491399  begin
    12501400    MovieSpeed1Btn.Down := MovieSpeed = 1;
    1251     MovieSpeed1Btn.Visible := true;
     1401    MovieSpeed1Btn.Visible := True;
    12521402    MovieSpeed2Btn.Down := MovieSpeed = 2;
    1253     MovieSpeed2Btn.Visible := true;
     1403    MovieSpeed2Btn.Visible := True;
    12541404    MovieSpeed3Btn.Down := MovieSpeed = 3;
    1255     MovieSpeed3Btn.Visible := true;
     1405    MovieSpeed3Btn.Visible := True;
    12561406    MovieSpeed4Btn.Down := MovieSpeed = 4;
    1257     MovieSpeed4Btn.Visible := true;
     1407    MovieSpeed4Btn.Visible := True;
    12581408  end
    12591409  else
    12601410  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;
    12651415  end;
    12661416end;
     
    12761426end;
    12771427
    1278 procedure TMainScreen.UpdateViews(UpdateCityScreen: boolean);
     1428procedure TMainScreen.UpdateViews(UpdateCityScreen: Boolean);
    12791429begin
    12801430  SumCities(TaxSum, ScienceSum);
     
    12861436end;
    12871437
    1288 procedure TMainScreen.SetAIName(p: integer; Name: string);
     1438procedure TMainScreen.SetAIName(P: Integer; Name: string);
    12891439begin
    12901440  if Name = '' then
    12911441  begin
    1292     if AILogo[p] <> nil then
     1442    if AILogo[P] <> nil then
    12931443    begin
    1294       FreeAndNil(AILogo[p]);
     1444      FreeAndNil(AILogo[P]);
    12951445    end;
    12961446  end
    12971447  else
    12981448  begin
    1299     if AILogo[p] = nil then
    1300       AILogo[p] := TDpiBitmap.Create;
    1301     if not LoadGraphicFile(AILogo[p], HomeDir + Name + '.png', [gfNoError]) then
     1449    if AILogo[P] = nil then
     1450      AILogo[P] := TDpiBitmap.Create;
     1451    if not LoadGraphicFile(AILogo[P], HomeDir + Name + '.png', [gfNoError]) then
    13021452    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;
     1456end;
     1457
     1458function TMainScreen.ContactRefused(P: Integer; Item: String): Boolean;
    13091459// return whether treaty was cancelled
    13101460var
    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 then
    1316   begin
    1317     SimpleMessage(s);
    1318     result := false;
     1461  S: string;
     1462begin
     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;
    13191469  end
    13201470  else
    13211471  begin
    1322     case MyRO.Treaty[p] of
     1472    case MyRO.Treaty[P] of
    13231473      trPeace:
    1324         s := s + ' ' + Phrases.Lookup('FRCANCELQUERY_PEACE');
     1474        S := S + ' ' + Phrases.Lookup('FRCANCELQUERY_PEACE');
    13251475      trFriendlyContact:
    1326         s := s + ' ' + Phrases.Lookup('FRCANCELQUERY_FRIENDLY');
     1476        S := S + ' ' + Phrases.Lookup('FRCANCELQUERY_FRIENDLY');
    13271477      trAlliance:
    1328         s := s + ' ' + Phrases.Lookup('FRCANCELQUERY_ALLIANCE');
    1329     end;
    1330     result := SimpleQuery(mkYesNo, s, 'NEGO_REJECTED') = mrOK;
    1331     if result then
     1478        S := S + ' ' + Phrases.Lookup('FRCANCELQUERY_ALLIANCE');
     1479    end;
     1480    Result := SimpleQuery(mkYesNo, S, 'NEGO_REJECTED') = mrOK;
     1481    if Result then
    13321482    begin
    13331483      Play('CANCELTREATY');
    1334       Server(sCancelTreaty, me, 0, nil^);
    1335       if MyRO.Treaty[p] = trNone then
     1484      Server(sCancelTreaty, Me, 0, nil^);
     1485      if MyRO.Treaty[P] = trNone then
    13361486        CityOptimizer_BeginOfTurn;
    13371487      // peace treaty was cancelled -- use formerly forbidden tiles
    1338       MapValid := false;
     1488      MapValid := False;
    13391489      PaintAllMaps;
    13401490    end;
     
    13441494procedure TMainScreen.RememberPeaceViolation;
    13451495var
    1346   uix, p1: integer;
     1496  uix, p1: Integer;
    13471497begin
    13481498  MyData.PeaceEvaHappened := 0;
     
    13521502      begin
    13531503        p1 := MyRO.Territory[Loc];
    1354         if (p1 <> me) and (p1 >= 0) and
     1504        if (p1 <> Me) and (p1 >= 0) and
    13551505          (MyRO.Turn = MyRO.EvaStart[p1] + (PeaceEvaTurns - 1)) then
    13561506          MyData.PeaceEvaHappened := MyData.PeaceEvaHappened or (1 shl p1);
     
    13901540
    13911541var
    1392   i, cix, mix: integer;
    1393   need: boolean;
     1542  I, cix, mix: Integer;
     1543  need: Boolean;
    13941544  mi: TModelInfo;
    13951545begin
    13961546  if (sbStart in Check) and not (sbStart in SoundPreloadDone) then begin
    1397     for i := 0 to nStartBlock - 1 do
    1398       PreparePlay(StartBlock[i]);
     1547    for I := 0 to nStartBlock - 1 do
     1548      PreparePlay(StartBlock[I]);
    13991549    SoundPreloadDone := SoundPreloadDone + [sbStart];
    14001550  end;
    14011551  if (sbWonder in Check) and not (sbWonder in SoundPreloadDone) then begin
    1402     need := false;
    1403     for i := 0 to nWonder - 1 do
    1404       if MyRO.Wonder[i].CityID <> WonderNotBuiltYet then
    1405         need := true;
     1552    need := False;
     1553    for I := 0 to nWonder - 1 do
     1554      if MyRO.Wonder[I].CityID <> WonderNotBuiltYet then
     1555        need := True;
    14061556    if need then begin
    1407       for i := 0 to nWonderBlock - 1 do
    1408         PreparePlay(WonderBlock[i]);
     1557      for I := 0 to nWonderBlock - 1 do
     1558        PreparePlay(WonderBlock[I]);
    14091559      SoundPreloadDone := SoundPreloadDone + [sbWonder];
    14101560    end;
     
    14121562  if ((sbScience in Check) and not (sbScience in SoundPreloadDone)) and
    14131563    (MyRO.Tech[adScience] >= tsApplicable) then begin
    1414     for i := 0 to nScienceBlock - 1 do
    1415       PreparePlay(ScienceBlock[i]);
     1564    for I := 0 to nScienceBlock - 1 do
     1565      PreparePlay(ScienceBlock[I]);
    14161566    SoundPreloadDone := SoundPreloadDone + [sbScience];
    14171567  end;
    14181568  if ((sbContact in Check) and not (sbContact in SoundPreloadDone)) and
    14191569    (MyRO.nEnemyModel + MyRO.nEnemyCity > 0) then begin
    1420     for i := 0 to nContactBlock - 1 do
    1421       PreparePlay(ContactBlock[i]);
     1570    for I := 0 to nContactBlock - 1 do
     1571      PreparePlay(ContactBlock[I]);
    14221572    SoundPreloadDone := SoundPreloadDone + [sbContact];
    14231573  end;
     
    14301580      with MyCity[cix] do
    14311581        if (Loc >= 0) and (Flags and CityRepMask <> 0) then
    1432           for i := 0 to 12 do
    1433             if 1 shl i and Flags and CityRepMask <> 0 then
    1434               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]);
    14351585    for mix := 0 to MyRO.nModel - 1 do
    14361586      with MyModel[mix] do
    14371587        if Attack > 0 then
    14381588        begin
    1439           MakeModelInfo(me, mix, MyModel[mix], mi);
     1589          MakeModelInfo(Me, mix, MyModel[mix], mi);
    14401590          PreparePlay(AttackSound(ModelCode(mi)));
    14411591        end;
     
    14481598  Color: TColor;
    14491599  Name: string;
    1450   ok: boolean;
     1600  ok: Boolean;
    14511601begin
    14521602  UnusedTribeFiles.Clear;
     
    14681618end;
    14691619
    1470 function TMainScreen.ChooseUnusedTribe: integer;
     1620function TMainScreen.GetUnitStatDlg: TUnitStatDlg;
     1621begin
     1622  if not Assigned(FUnitStatDlg) then begin
     1623    FUnitStatDlg := TUnitStatDlg.Create(nil);
     1624    ArrangeDialog(FUnitStatDlg);
     1625    FUnitStatDlg.CheckAge;
     1626  end;
     1627  Result := FUnitStatDlg;
     1628end;
     1629
     1630function TMainScreen.GetWondersDlg: TWondersDlg;
     1631begin
     1632  if not Assigned(FWondersDlg) then FWondersDlg := TWondersDlg.Create(nil);
     1633  Result := FWondersDlg;
     1634end;
     1635
     1636function TMainScreen.ChooseUnusedTribe: Integer;
    14711637var
    1472   i: Integer;
    1473   j: Integer;
     1638  I: Integer;
     1639  J: Integer;
    14741640  ColorDistance: Integer;
    14751641  BestColorDistance: Integer;
     
    14771643  CountBest: Integer;
    14781644begin
    1479   assert(UnusedTribeFiles.Count > 0);
    1480   result := -1;
     1645  Assert(UnusedTribeFiles.Count > 0);
     1646  Result := -1;
    14811647  BestColorDistance := -1;
    1482   for j := 0 to UnusedTribeFiles.Count - 1 do
     1648  for J := 0 to UnusedTribeFiles.Count - 1 do
    14831649  begin
    14841650    ColorDistance := 250; // consider differences more than this infinite
    1485     for i := 0 to nPl - 1 do
    1486       if Tribe[i] <> nil then
     1651    for I := 0 to nPl - 1 do
     1652      if Tribe[I] <> nil then
    14871653      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 and
    1491           $FF - Tribe[i].Color shr 8 and $FF) * 3 +
    1492           abs(integer(UnusedTribeFiles.Objects[j]) and
    1493           $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;
    14941660        if TestColorDistance < ColorDistance then
    14951661          ColorDistance := TestColorDistance;
     
    15021668    if ColorDistance = BestColorDistance then
    15031669    begin
    1504       inc(CountBest);
     1670      Inc(CountBest);
    15051671      if DelphiRandom(CountBest) = 0 then
    1506         result := j;
     1672        Result := J;
    15071673    end;
    15081674  end;
     
    15111677procedure TMainScreen.ShowEnemyShipChange(ShowShipChange: TShowShipChange);
    15121678var
    1513   i, TestCost, MostCost: integer;
    1514   Ship1Plus, Ship2Plus: boolean;
     1679  I, TestCost, MostCost: Integer;
     1680  Ship1Plus, Ship2Plus: Boolean;
    15151681begin
    15161682  with ShowShipChange, MessgExDlg do
     
    15351701        begin
    15361702          OpenSound := 'SHIP_TRADED';
    1537           Ship1Plus := false;
    1538           Ship2Plus := false;
    1539           for i := 0 to nShipPart - 1 do
     1703          Ship1Plus := False;
     1704          Ship2Plus := False;
     1705          for I := 0 to nShipPart - 1 do
    15401706          begin
    1541             if Ship1Change[i] > 0 then
    1542               Ship1Plus := true;
    1543             if Ship2Change[i] > 0 then
    1544               Ship2Plus := true;
     1707            if Ship1Change[I] > 0 then
     1708              Ship1Plus := True;
     1709            if Ship2Change[I] > 0 then
     1710              Ship2Plus := True;
    15451711          end;
    15461712          if Ship1Plus and Ship2Plus then
     
    15691735    begin
    15701736      MostCost := 0;
    1571       for i := 0 to nShipPart - 1 do
     1737      for I := 0 to nShipPart - 1 do
    15721738      begin
    1573         TestCost := abs(Ship1Change[i]) * Imp[imShipComp + i].Cost;
     1739        TestCost := abs(Ship1Change[I]) * Imp[imShipComp + I].Cost;
    15741740        if TestCost > MostCost then
    15751741        begin
    15761742          MostCost := TestCost;
    1577           IconIndex := imShipComp + i;
     1743          IconIndex := imShipComp + I;
    15781744        end;
    15791745      end;
     
    15871753procedure TMainScreen.InitModule;
    15881754var
    1589   i, j, Domain: integer;
     1755  I, J, Domain: Integer;
    15901756begin
    15911757  { search icons for advances: }
    1592   for i := 0 to nAdv - 1 do
    1593     if i in FutureTech then
    1594       AdvIcon[i] := 96 + i - futResearchTechnology
     1758  for I := 0 to nAdv - 1 do
     1759    if I in FutureTech then
     1760      AdvIcon[I] := 96 + I - futResearchTechnology
    15951761    else
    15961762    begin
    1597       AdvIcon[i] := -1;
     1763      AdvIcon[I] := -1;
    15981764      for Domain := 0 to nDomains - 1 do
    1599         for j := 0 to nUpgrade - 1 do
    1600           if upgrade[Domain, j].Preq = i then
    1601             if AdvIcon[i] >= 0 then
    1602               AdvIcon[i] := 85
     1765        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
    16031769            else
    1604               AdvIcon[i] := 86 + Domain;
    1605       for j := 0 to nFeature - 1 do
    1606         if Feature[j].Preq = i then
     1770              AdvIcon[I] := 86 + Domain;
     1771      for J := 0 to nFeature - 1 do
     1772        if Feature[J].Preq = I then
    16071773          for Domain := 0 to nDomains - 1 do
    1608             if 1 shl Domain and Feature[j].Domains <> 0 then
    1609               if (AdvIcon[i] >= 0) and (AdvIcon[i] <> 86 + Domain) then
    1610                 AdvIcon[i] := 85
     1774            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
    16111777              else
    1612                 AdvIcon[i] := 86 + Domain;
    1613       for j := nWonder to nImp - 1 do
    1614         if Imp[j].Preq = i then
    1615           AdvIcon[i] := j;
    1616       for j := nWonder to nImp - 1 do
    1617         if (Imp[j].Preq = i) and (Imp[j].Kind <> ikCommon) then
    1618           AdvIcon[i] := j;
    1619       for j := 0 to nJob - 1 do
    1620         if i = JobPreq[j] then
    1621           AdvIcon[i] := 84;
    1622       for j := 0 to nWonder - 1 do
    1623         if Imp[j].Preq = i then
    1624           AdvIcon[i] := j;
    1625       if AdvIcon[i] < 0 then
    1626         if AdvValue[i] < 1000 then
    1627           AdvIcon[i] := -7
     1778                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
    16281794        else
    1629           AdvIcon[i] := 24 + AdvValue[i] div 1000;
    1630       for j := 2 to nGov - 1 do
    1631         if GovPreq[j] = i then
    1632           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;
    16331799    end;
    16341800  AdvIcon[adConscription] := 86 + dGround;
    16351801
    16361802  UnusedTribeFiles := tstringlist.Create;
    1637   UnusedTribeFiles.Sorted := true;
     1803  UnusedTribeFiles.Sorted := True;
    16381804  TribeNames := tstringlist.Create;
    16391805
    16401806  IsoEngine.Init(InitEnemyModel);
    16411807  // non-default tile size is missing a file, switch to default
    1642   MainMap.SetOutput(offscreen);
     1808  MainMap.SetOutput(Offscreen);
    16431809
    16441810  HGrStdUnits := LoadGraphicSet('StdUnits.png');
     
    16471813  InitSmallImp;
    16481814  SoundPreloadDone := [];
    1649   StartRunning := false;
    1650   StayOnTop_Ensured := false;
     1815  StartRunning := False;
    16511816
    16521817  sb := TPVScrollbar.Create(Self);
     
    16591824  FreeAndNil(UnusedTribeFiles);
    16601825  FreeAndNil(TribeNames);
    1661   // AdvisorDlg.DeInit;
    1662 end;
    1663 
    1664 procedure TMainScreen.InitTurn(NewPlayer: integer);
     1826end;
     1827
     1828procedure TMainScreen.InitTurn(NewPlayer: Integer);
    16651829const
    16661830  nAdvBookIcon = 16;
    16671831  AdvBookIcon: array [0 .. nAdvBookIcon - 1] of record Adv,
    1668     Icon: integer end = ((Adv: adPolyTheism; Icon: woZeus),
     1832    Icon: Integer end = ((Adv: adPolyTheism; Icon: woZeus),
    16691833    (Adv: adBronzeWorking; Icon: woColossus), (Adv: adMapMaking;
    16701834    Icon: woLighthouse), (Adv: adPoetry; Icon: imTheater), (Adv: adMonotheism;
     
    16781842  sbAll = [sbStart, sbWonder, sbScience, sbContact, sbTurn];
    16791843var
    1680   p1, i, ad, uix, cix, MoveOptions, MoveResult, Loc1,
     1844  p1, I, ad, uix, cix, MoveOptions, MoveResult, Loc1,
    16811845    NewAgeCenterTo, Winners, NewGovAvailable, dx,
    1682     dy: integer;
     1846    dy: Integer;
    16831847  MoveAdviceData: TMoveAdviceData;
    16841848  Picture: TModelPictureInfo;
    1685   s, Item, Item2: string;
     1849  S, Item, Item2: string;
    16861850  UpdatePanel, OwnWonder, ok, Stop, ShowCityList, WondersOnly,
    1687     AllowCityScreen: boolean;
    1688 begin
    1689   if IsMultiPlayerGame and (NewPlayer <> me) then
    1690   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) and
     1851    AllowCityScreen: Boolean;
     1852begin
     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
    16971861    (G.RO[0].Happened and phShipComplete = 0) then
    16981862  begin // inter player screen
    1699     for i := 0 to ControlCount - 1 do
    1700       if Controls[i] is TButtonC then
    1701         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;
    17031867    MainTexture.Age := -1;
    17041868    with Panel.Canvas do
     
    17161880    Invalidate;
    17171881
    1718     s := TurnToString(G.RO[0].Turn);
    1719     if supervising then
    1720       SimpleMessage(Format(Phrases.Lookup('SUPERTURN'), [s]))
     1882    S := TurnToString(G.RO[0].Turn);
     1883    if Supervising then
     1884      SimpleMessage(Format(Phrases.Lookup('SUPERTURN'), [S]))
    17211885    else
    1722       SimpleMessage(Format(Tribe[NewPlayer].TPhrase('TURN'), [s]));
    1723   end;
    1724   for i := 0 to ControlCount - 1 do
    1725     if Controls[i] is TButtonC then
    1726       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;
    17271891
    17281892  ItsMeAgain(NewPlayer);
    17291893  MyData := G.RO[NewPlayer].Data;
    1730   if not supervising then
     1894  if not Supervising then
    17311895    SoundPreload(sbAll);
    1732   if (me = 0) and ((MyRO.Turn = 0) or (ClientMode = cResume)) then
     1896  if (Me = 0) and ((MyRO.Turn = 0) or (ClientMode = cResume)) then
    17331897    Invalidate; // colorize empty space
    17341898
    1735   if not supervising then
     1899  if not Supervising then
    17361900  begin
    17371901
     
    17431907      else }
    17441908    begin
    1745       Age := GetAge(me);
     1909      Age := GetAge(Me);
    17461910      if MainTexture.Age <> Age then begin
    17471911        MainTexture.Age := Age;
     
    17671931  end;
    17681932  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];
    17731937
    17741938  UnFocus := -1;
    17751939  MarkCityLoc := -1;
    1776   BlinkON := false;
     1940  BlinkON := False;
    17771941  BlinkTime := -1;
    1778   Tracking := false;
    1779   TurnComplete := false;
     1942  Tracking := False;
     1943  TurnComplete := False;
    17801944
    17811945  if (ToldSlavery < 0) or
     
    17971961          Hash := 0;
    17981962          GrName := 'StdUnits.png';
    1799           Tribe[p1].SetModelPicture(Picture, true);
    1800         end
    1801   end;
    1802 
    1803   if not supervising and (ClientMode = cTurn) then
     1963          Tribe[p1].SetModelPicture(Picture, True);
     1964        end;
     1965  end;
     1966
     1967  if not Supervising and (ClientMode = cTurn) then
    18041968  begin
    18051969    for cix := 0 to MyRO.nCity - 1 do
     
    18161980  if ClientMode = cMovieTurn then
    18171981  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;
    18211985    EOT.Hint := Phrases.Lookup('BTN_STOP');
    1822     EOT.Visible := true;
     1986    EOT.Visible := True;
    18231987  end
    18241988  else if ClientMode < scContact then
     
    18271991    UnitBtn.Visible := UnFocus >= 0;
    18281992    CheckTerrainBtnVisible;
    1829     TurnComplete := supervising;
     1993    TurnComplete := Supervising;
    18301994    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;
    18321996  end
    18331997  else
    18341998  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;
    18382002    EOT.Hint := Phrases.Lookup('BTN_NEGO');
    1839     EOT.Visible := true;
     2003    EOT.Visible := True;
    18402004  end;
    18412005  SetTroopLoc(-1);
    1842   MapValid := false;
     2006  MapValid := False;
    18432007  NewAgeCenterTo := 0;
    1844   if ((MyRO.Turn = 0) and not supervising or IsMultiPlayerGame or
     2008  if ((MyRO.Turn = 0) and not Supervising or IsMultiPlayerGame or
    18452009    (ClientMode = cResume)) and (MyRO.nCity > 0) then
    18462010  begin
     
    18572021      begin
    18582022        NewAgeCenterTo := -1;
    1859         Loc1 := dLoc(Loc1, -dx, -dy)
     2023        Loc1 := dLoc(Loc1, -dx, -dy);
    18602024      end
    18612025      else
     
    18652029      end
    18662030    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);
    18732035
    18742036  if ClientMode <> cResume then
     
    18812043    // first turn after anarchy -- don't show despotism palace!
    18822044    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);
    18922046
    18932047    if MyRO.Happened and phGameEnd <> 0 then
     
    18972051        begin
    18982052          OpenSound := 'MSG_GAMEOVER';
    1899           MessgText := Tribe[me].TPhrase('GAMEOVER');
     2053          MessgText := Tribe[Me].TPhrase('GAMEOVER');
    19002054          IconKind := mikBigIcon;
    19012055          IconIndex := 8;
     
    19082062            begin
    19092063              Winners := Winners or 1 shl p1;
    1910               for i := 0 to nShipPart - 1 do
    1911                 if MyRO.Ship[p1].Parts[i] < ShipNeed[i] then
     2064              for I := 0 to nShipPart - 1 do
     2065                if MyRO.Ship[p1].Parts[I] < ShipNeed[I] then
    19122066                  Winners := Winners and not(1 shl p1);
    19132067            end;
    1914           assert(Winners <> 0);
    1915           if Winners and (1 shl me) <> 0 then
     2068          Assert(Winners <> 0);
     2069          if Winners and (1 shl Me) <> 0 then
    19162070          begin
    1917             s := '';
     2071            S := '';
    19182072            for p1 := 0 to nPl - 1 do
    1919               if (p1 <> me) and (1 shl p1 and Winners <> 0) then
    1920                 if s = '' then
    1921                   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')
    19222076                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')]);
    19252079
    19262080            OpenSound := 'MSG_YOUWIN';
    1927             MessgText := Tribe[me].TPhrase('MYSPACESHIP');
    1928             if s <> '' then
     2081            MessgText := Tribe[Me].TPhrase('MYSPACESHIP');
     2082            if S <> '' then
    19292083              MessgText := MessgText + '\' +
    1930                 Format(Phrases.Lookup('SHAREDWIN'), [s]);
     2084                Format(Phrases.Lookup('SHAREDWIN'), [S]);
    19312085            IconKind := mikBigIcon;
    19322086            IconIndex := 9;
     
    19342088          else
    19352089          begin
    1936             assert(me = 0);
     2090            Assert(Me = 0);
    19372091            OpenSound := 'MSG_GAMEOVER';
    19382092            MessgText := '';
     
    19462100        else { if MyRO.Happened and fTimeUp<>0 then }
    19472101        begin
    1948           assert(me = 0);
     2102          Assert(Me = 0);
    19492103          OpenSound := 'MSG_GAMEOVER';
    1950           if not supervising then
    1951             MessgText := Tribe[me].TPhrase('TIMEUP')
     2104          if not Supervising then
     2105            MessgText := Tribe[Me].TPhrase('TIMEUP')
    19522106          else
    19532107            MessgText := Phrases.Lookup('TIMEUPSUPER');
     
    19612115          p1 := 0;
    19622116          while (p1 < nPl - 1) and (Winners and (1 shl p1) = 0) do
    1963             inc(p1);
     2117            Inc(p1);
    19642118          if MyRO.Happened and phShipComplete = 0 then
    19652119            DiaDlg.ShowNewContent_Charts(wmModal);
    19662120        end;
    1967         TurnComplete := true;
    1968         exit;
    1969       end;
    1970     if not supervising and (1 shl me and MyRO.Alive = 0) then
     2121        TurnComplete := True;
     2122        Exit;
     2123      end;
     2124    if not Supervising and (1 shl Me and MyRO.Alive = 0) then
    19712125    begin
    1972       TurnComplete := true;
    1973       exit;
     2126      TurnComplete := True;
     2127      Exit;
    19742128    end;
    19752129
    19762130    if (ClientMode = cContinue) and
    1977       (DipMem[me].SentCommand and $FF0F = scContact) then
     2131      (DipMem[Me].SentCommand and $FF0F = scContact) then
    19782132      // contact was refused
    1979       if MyRO.Treaty[DipMem[me].pContact] >= trPeace then
    1980         ContactRefused(DipMem[me].pContact, 'FRREJECTED')
     2133      if MyRO.Treaty[DipMem[Me].pContact] >= trPeace then
     2134        ContactRefused(DipMem[Me].pContact, 'FRREJECTED')
    19812135      else
    1982         SoundMessage(Tribe[DipMem[me].pContact].TPhrase('FRREJECTED'),
     2136        SoundMessage(Tribe[DipMem[Me].pContact].TPhrase('FRREJECTED'),
    19832137          'NEGO_REJECTED');
    19842138
    1985     if not supervising and (Age > MyData.ToldAge) and
     2139    if not Supervising and (Age > MyData.ToldAge) and
    19862140      ((Age > 0) or (ClientMode <> cMovieTurn)) then
    19872141      with MessgExDlg do
     
    19912145          if Phrases2FallenBackToEnglish then
    19922146          begin
    1993             s := Tribe[me].TPhrase('AGE0');
     2147            S := Tribe[Me].TPhrase('AGE0');
    19942148            MessgText :=
    1995               Format(s, [TurnToString(MyRO.Turn), CityName(MyCity[0].ID)])
     2149              Format(S, [TurnToString(MyRO.Turn), CityName(MyCity[0].ID)]);
    19962150          end
    19972151          else
    19982152          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;
    20022156        end
    20032157        else
    20042158        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)]);
    20072161        end;
    20082162        IconKind := mikAge;
     
    20122166        CenterTo := NewAgeCenterTo;
    20132167        OpenSound := 'AGE_' + char(48 + Age);
     2168        DpiApplication.ProcessMessages;
    20142169        ShowModal;
    20152170        MyData.ToldAge := Age;
     
    20252180          begin
    20262181            OpenSound := 'MSG_EXTINCT';
    2027             s := Tribe[p1].TPhrase('EXTINCT');
    2028             MessgText := Format(s, [TurnToString(MyRO.Turn)]);
    2029             if MyRO.Alive = 1 shl me then
     2182            S := Tribe[p1].TPhrase('EXTINCT');
     2183            MessgText := Format(S, [TurnToString(MyRO.Turn)]);
     2184            if MyRO.Alive = 1 shl Me then
    20302185              MessgText := MessgText + Phrases.Lookup('EXTINCTALL');
    20312186            Kind := mkOk;
     
    20342189            ShowModal;
    20352190          end;
    2036       if (ClientMode <> cMovieTurn) and not supervising then
     2191      if (ClientMode <> cMovieTurn) and not Supervising then
    20372192        DiaDlg.ShowNewContent_Charts(wmModal);
    20382193    end;
    20392194
    20402195    // tell changes of own credibility
    2041     if not supervising then
     2196    if not Supervising then
    20422197    begin
    20432198      if RoughCredibility(MyRO.Credibility) <>
     
    20462201        if RoughCredibility(MyRO.Credibility) >
    20472202          RoughCredibility(MyData.ToldOwnCredibility) then
    2048           s := Phrases.Lookup('CREDUP')
     2203          S := Phrases.Lookup('CREDUP')
    20492204        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',
    20522207          RoughCredibility(MyRO.Credibility))]), '');
    20532208      end;
     
    20552210    end;
    20562211
    2057     for i := 0 to nWonder - 1 do
     2212    for I := 0 to nWonder - 1 do
    20582213    begin
    2059       OwnWonder := false;
     2214      OwnWonder := False;
    20602215      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)
    20622217        then
    2063           OwnWonder := true;
    2064       if MyRO.Wonder[i].CityID <> MyData.ToldWonders[i].CityID then
     2218          OwnWonder := True;
     2219      if MyRO.Wonder[I].CityID <> MyData.ToldWonders[I].CityID then
    20652220      begin
    2066         if MyRO.Wonder[i].CityID = WonderDestroyed then
     2221        if MyRO.Wonder[I].CityID = WonderDestroyed then
    20672222          with MessgExDlg do
    20682223          begin { tell about destroyed wonders }
    20692224            OpenSound := 'WONDER_DESTROYED';
    20702225            MessgText := Format(Phrases.Lookup('WONDERDEST'),
    2071               [Phrases.Lookup('IMPROVEMENTS', i)]);
     2226              [Phrases.Lookup('IMPROVEMENTS', I)]);
    20722227            Kind := mkOkHelp;
    20732228            HelpKind := hkImp;
    2074             HelpNo := i;
     2229            HelpNo := I;
    20752230            IconKind := mikImp;
    2076             IconIndex := i;
     2231            IconIndex := I;
    20772232            ShowModal;
    20782233          end
    20792234        else
    20802235        begin
    2081           if i = woManhattan then
    2082             if MyRO.Wonder[i].EffectiveOwner > me then
     2236          if I = woManhattan then
     2237            if MyRO.Wonder[I].EffectiveOwner > Me then
    20832238              MyData.ColdWarStart := MyRO.Turn - 1
    20842239            else
     
    20872242            with MessgExDlg do
    20882243            begin { tell about newly built wonders }
    2089               if i = woManhattan then
     2244              if I = woManhattan then
    20902245              begin
    20912246                OpenSound := 'MSG_COLDWAR';
    2092                 s := Tribe[MyRO.Wonder[i].EffectiveOwner].TPhrase('COLDWAR')
     2247                S := Tribe[MyRO.Wonder[I].EffectiveOwner].TPhrase('COLDWAR');
    20932248              end
    2094               else if MyRO.Wonder[i].EffectiveOwner >= 0 then
     2249              else if MyRO.Wonder[I].EffectiveOwner >= 0 then
    20952250              begin
    20962251                OpenSound := 'WONDER_BUILT';
    2097                 s := Tribe[MyRO.Wonder[i].EffectiveOwner]
    2098                   .TPhrase('WONDERBUILT')
     2252                S := Tribe[MyRO.Wonder[I].EffectiveOwner]
     2253                  .TPhrase('WONDERBUILT');
    20992254              end
    21002255              else
    21012256              begin
    21022257                OpenSound := 'MSG_DEFAULT';
    2103                 s := Phrases.Lookup('WONDERBUILTEXP');
     2258                S := Phrases.Lookup('WONDERBUILTEXP');
    21042259                // already expired when built
    21052260              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)]);
    21082263              Kind := mkOkHelp;
    21092264              HelpKind := hkImp;
    2110               HelpNo := i;
     2265              HelpNo := I;
    21112266              IconKind := mikImp;
    2112               IconIndex := i;
     2267              IconIndex := I;
    21132268              ShowModal;
    2114             end
    2115         end
     2269            end;
     2270        end;
    21162271      end
    2117       else if (MyRO.Wonder[i].EffectiveOwner <> MyData.ToldWonders[i]
    2118         .EffectiveOwner) and (MyRO.Wonder[i].CityID > WonderDestroyed) then
    2119         if MyRO.Wonder[i].EffectiveOwner < 0 then
     2272      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
    21202275        begin
    2121           if i <> woMIR then
     2276          if I <> woMIR then
    21222277            with MessgExDlg do
    21232278            begin { tell about expired wonders }
    21242279              OpenSound := 'WONDER_EXPIRED';
    21252280              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)]);
    21282283              Kind := mkOkHelp;
    21292284              HelpKind := hkImp;
    2130               HelpNo := i;
     2285              HelpNo := I;
    21312286              IconKind := mikImp;
    2132               IconIndex := i;
     2287              IconIndex := I;
    21332288              ShowModal;
    2134             end
     2289            end;
    21352290        end
    2136         else if (MyData.ToldWonders[i].EffectiveOwner >= 0) and not OwnWonder
     2291        else if (MyData.ToldWonders[I].EffectiveOwner >= 0) and not OwnWonder
    21372292        then
    21382293          with MessgExDlg do
    21392294          begin { tell about capture of wonders }
    21402295            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)]);
    21442299            Kind := mkOkHelp;
    21452300            HelpKind := hkImp;
    2146             HelpNo := i;
     2301            HelpNo := I;
    21472302            IconKind := mikImp;
    2148             IconIndex := i;
     2303            IconIndex := I;
    21492304            ShowModal;
    21502305          end;
     
    21542309    begin
    21552310      SoundMessageEx(Phrases.Lookup('COLDWAREND'), 'MSG_DEFAULT');
    2156       MyData.ColdWarStart := -ColdWarTurns - 1
     2311      MyData.ColdWarStart := -ColdWarTurns - 1;
    21572312    end;
    21582313
     
    21602315  end; // ClientMode<>cResume
    21612316  MyData.ToldAlive := MyRO.Alive;
    2162   move(MyRO.Wonder, MyData.ToldWonders, SizeOf(MyData.ToldWonders));
     2317  Move(MyRO.Wonder, MyData.ToldWonders, SizeOf(MyData.ToldWonders));
    21632318
    21642319  NewGovAvailable := -1;
     
    21842339          IconKind := mikBook;
    21852340          IconIndex := -1;
    2186           for i := 0 to nAdvBookIcon - 1 do
    2187             if AdvBookIcon[i].Adv = ad then
    2188               IconIndex := AdvBookIcon[i].Icon;
     2341          for I := 0 to nAdvBookIcon - 1 do
     2342            if AdvBookIcon[I].Adv = ad then
     2343              IconIndex := AdvBookIcon[I].Icon;
    21892344          ShowModal;
    21902345          MyData.ToldTech[ad] := MyRO.Tech[ad];
    2191           for i := gMonarchy to nGov - 1 do
    2192             if GovPreq[i] = ad then
    2193               NewGovAvailable := i;
     2346          for I := gMonarchy to nGov - 1 do
     2347            if GovPreq[I] = ad then
     2348              NewGovAvailable := I;
    21942349        end;
    21952350  end;
    21962351
    2197   ShowCityList := false;
     2352  ShowCityList := False;
    21982353  if ClientMode = cTurn then
    21992354  begin
     
    22012356      ChooseResearch;
    22022357
    2203     UpdatePanel := false;
     2358    UpdatePanel := False;
    22042359    if MyRO.Happened and phChangeGov <> 0 then
    22052360    begin
    22062361      ModalSelectDlg.ShowNewContent(wmModal, kGov);
    22072362      Play('NEWGOV');
    2208       Server(sSetGovernment, me, ModalSelectDlg.result, nil^);
     2363      Server(sSetGovernment, Me, ModalSelectDlg.Result, nil^);
    22092364      CityOptimizer_BeginOfTurn;
    2210       UpdatePanel := true;
     2365      UpdatePanel := True;
    22112366    end;
    22122367  end; // ClientMode=cTurn
    22132368
    2214   if not supervising and ((ClientMode = cTurn) or (ClientMode = cMovieTurn))
     2369  if not Supervising and ((ClientMode = cTurn) or (ClientMode = cMovieTurn))
    22152370  then
    22162371    for cix := 0 to MyRO.nCity - 1 do
     
    22222377  begin
    22232378    // tell what happened in cities
    2224     for WondersOnly := true downto false do
     2379    for WondersOnly := True downto False do
    22252380      for cix := 0 to MyRO.nCity - 1 do
    22262381        with MyCity[cix] do
     
    22332388              begin { tell about newly built wonder }
    22342389                OpenSound := 'WONDER_BUILT';
    2235                 s := Tribe[me].TPhrase('WONDERBUILTOWN');
     2390                S := Tribe[Me].TPhrase('WONDERBUILTOWN');
    22362391                MessgText :=
    2237                   Format(s, [Phrases.Lookup('IMPROVEMENTS',
     2392                  Format(S, [Phrases.Lookup('IMPROVEMENTS',
    22382393                  Project0 and cpIndex), CityName(ID)]);
    22392394                Kind := mkOkHelp;
     
    22442399                ShowModal;
    22452400              end;
    2246             if not supervising and (ClientMode = cTurn) then
     2401            if not Supervising and (ClientMode = cTurn) then
    22472402            begin
    2248               AllowCityScreen := true;
     2403              AllowCityScreen := True;
    22492404              if (Status and 7 <> 0) and
    22502405                (Project and (cpImp + cpIndex) = cpImp + imTrGoods) then
     
    22522407                begin
    22532408                  if AutoBuild(cix, MyData.ImpOrder[Status and 7 - 1]) then
    2254                     AllowCityScreen := false
     2409                    AllowCityScreen := False
    22552410                  else if Flags and chProduction <> 0 then
    22562411                    Flags := (Flags and not chProduction) or chAllImpsMade
     
    22802435                  CityDlg.ShowNewContent(wmModal, MyCity[cix].Loc,
    22812436                    Flags and CityRepMask);
    2282                   UpdatePanel := true;
     2437                  UpdatePanel := True;
    22832438                end;
    22842439              end
     
    22862441              begin
    22872442                if Flags and CityRepMask <> 0 then
    2288                   ShowCityList := true
     2443                  ShowCityList := True;
    22892444              end;
    22902445            end;
     
    23062461        begin
    23072462          Play('REVOLUTION');
    2308           Server(sRevolution, me, 0, nil^);
     2463          Server(sRevolution, Me, 0, nil^);
    23092464        end;
    23102465      end;
     
    23402495    DpiApplication.ProcessMessages;
    23412496
    2342     if not supervising then
     2497    if not Supervising then
    23432498      for uix := 0 to MyRO.nUn - 1 do
    23442499        with MyUn[uix] do
     
    23682523              begin // !!! Shinkansen
    23692524                MoveResult := eOK;
    2370                 ok := true;
    2371                 for i := 0 to MoveAdviceData.nStep - 1 do
     2525                ok := True;
     2526                for I := 0 to MoveAdviceData.nStep - 1 do
    23722527                begin
    2373                   Loc1 := dLoc(Loc, MoveAdviceData.dx[i],
    2374                     MoveAdviceData.dy[i]);
     2528                  Loc1 := dLoc(Loc, MoveAdviceData.dx[I],
     2529                    MoveAdviceData.dy[I]);
    23752530                  if (MyMap[Loc1] and (fCity or fOwned) = fCity)
    23762531                  // don't capture cities during auto move
     
    23782533                  // don't attack during auto move
    23792534                  begin
    2380                     ok := false;
     2535                    ok := False;
    23812536                    Break
    23822537                  end
     
    23852540                    if (Loc1 = MoveAdviceData.ToLoc) or
    23862541                      (MoveAdviceData.ToLoc = maNextCity) and
    2387                       (MyMap[dLoc(Loc, MoveAdviceData.dx[i],
    2388                       MoveAdviceData.dy[i])] and fCity <> 0) then
     2542                      (MyMap[dLoc(Loc, MoveAdviceData.dx[I],
     2543                      MoveAdviceData.dy[I])] and fCity <> 0) then
    23892544                      MoveOptions := muAutoNoWait
    23902545                    else
    23912546                      MoveOptions := 0;
    2392                     MoveResult := MoveUnit(MoveAdviceData.dx[i],
    2393                       MoveAdviceData.dy[i], MoveOptions);
     2547                    MoveResult := MoveUnit(MoveAdviceData.dx[I],
     2548                      MoveAdviceData.dy[I], MoveOptions);
    23942549                    if (MoveResult < rExecuted) or (MoveResult = eEnemySpotted)
    23952550                    then
    23962551                    begin
    2397                       ok := false;
     2552                      ok := False;
    23982553                      Break
    23992554                    end;
     
    24072562              begin
    24082563                MoveResult := eOK;
    2409                 Stop := true;
     2564                Stop := True;
    24102565              end;
    24112566
     
    24302585  end; // ClientMode=cTurn
    24312586
    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
    24372590  begin
    24382591    SetTroopLoc(-1);
     
    24492602      SetUnFocus(-1)
    24502603    else
    2451       NextUnit(-1, false);
     2604      NextUnit(-1, False);
    24522605    if UnFocus < 0 then
    24532606    begin
     
    24662619end;
    24672620
    2468 procedure TMainScreen.Client(Command, NewPlayer: integer; var Data);
     2621procedure TMainScreen.Client(Command, NewPlayer: Integer; var Data);
    24692622var
    2470   i, j, p1, mix, ToLoc, AnimationSpeed, ShowMoveDomain, cix, ecix: integer;
     2623  I, J, p1, mix, ToLoc, AnimationSpeed, ShowMoveDomain, cix, ecix: Integer;
    24712624  Color: TColor;
    2472   Name, s: string;
     2625  Name, S: string;
    24732626  TribeInfo: TTribeInfo;
    24742627  mi: TModelInfo;
    2475   SkipTurn, IsAlpine, IsTreatyDeal: boolean;
     2628  SkipTurn, IsAlpine, IsTreatyDeal: Boolean;
    24762629begin
    24772630  case Command of
    24782631    cTurn, cResume, cContinue, cMovieTurn, scContact, scDipStart .. scDipBreak:
    24792632      begin
    2480         supervising := G.Difficulty[NewPlayer] = 0;
     2633        Supervising := G.Difficulty[NewPlayer] = 0;
    24812634        ArrangeMidPanel;
    24822635      end
     
    24842637  case Command of
    24852638    cDebugMessage:
    2486       LogDlg.Add(NewPlayer, G.RO[0].Turn, pchar(@Data));
     2639      LogDlg.Add(NewPlayer, G.RO[0].Turn, PChar(@Data));
    24872640
    24882641    cShowNego:
    24892642      with TShowNegoData(Data) do
    24902643      begin
    2491         s := Format('P%d to P%d: ', [pSender, pTarget]);
     2644        S := Format('P%d to P%d: ', [pSender, pTarget]);
    24922645        if (Action = scDipOffer) and (Offer.nDeliver + Offer.nCost > 0) then
    24932646        begin
    2494           s := s + 'Offer ';
    2495           for i := 0 to Offer.nDeliver + Offer.nCost - 1 do
     2647          S := S + 'Offer ';
     2648          for I := 0 to Offer.nDeliver + Offer.nCost - 1 do
    24962649          begin
    2497             if i = Offer.nDeliver then
    2498               s := s + ' for '
    2499             else if i > 0 then
    2500               s := s + '+';
    2501             case Offer.Price[i] and opMask of
     2650            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
    25022655              opChoose:
    2503                 s := s + 'Price of choice';
     2656                S := S + 'Price of choice';
    25042657              opCivilReport:
    2505                 s := s + 'State report';
     2658                S := S + 'State report';
    25062659              opMilReport:
    2507                 s := s + 'Military report';
     2660                S := S + 'Military report';
    25082661              opMap:
    2509                 s := s + 'Map';
     2662                S := S + 'Map';
    25102663              opTreaty:
    2511                 s := s + 'Treaty';
     2664                S := S + 'Treaty';
    25122665              opShipParts:
    2513                 s := s + 'Ship part';
     2666                S := S + 'Ship part';
    25142667              opMoney:
    2515                 s := s + IntToStr(Offer.Price[i] and $FFFFFF) + 'o';
     2668                S := S + IntToStr(Offer.Price[I] and $FFFFFF) + 'o';
    25162669              opTribute:
    2517                 s := s + IntToStr(Offer.Price[i] and $FFFFFF) + 'o tribute';
     2670                S := S + IntToStr(Offer.Price[I] and $FFFFFF) + 'o tribute';
    25182671              opTech:
    2519                 s := s + Phrases.Lookup('ADVANCES', Offer.Price[i] and $FFFFFF);
     2672                S := S + Phrases.Lookup('ADVANCES', Offer.Price[I] and $FFFFFF);
    25202673              opAllTech:
    2521                 s := s + 'All advances';
     2674                S := S + 'All advances';
    25222675              opModel:
    2523                 s := s + Tribe[pSender].ModelName[Offer.Price[i] and $FFFFFF];
     2676                S := S + Tribe[pSender].ModelName[Offer.Price[I] and $FFFFFF];
    25242677              opAllModel:
    2525                 s := s + 'All models';
     2678                S := S + 'All models';
    25262679            end;
    25272680          end;
    2528           LogDlg.Add(NewPlayer, G.RO[0].Turn, pchar(s));
     2681          LogDlg.Add(NewPlayer, G.RO[0].Turn, PChar(S));
    25292682        end
    25302683        else if Action = scDipAccept then
    25312684        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));
    25342687        end;
    25352688      end;
     
    25382691      begin
    25392692        Server := TInitModuleData(Data).Server;
    2540         // AdvisorDlg.Init;
    25412693        InitModule;
    25422694        TInitModuleData(Data).DataSize := SizeOf(TPersistentData);
     
    25522704          MainTexture.Age := -1;
    25532705        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;
    25562708        HelpDlg.Difficulty := 0;
    25572709        if Command = cStartCredits then
    2558           HelpDlg.ShowNewContent(wmModal, hkMisc, miscCredits)
     2710          HelpDlg.ShowNewContent(wmModal, hkMisc, Integer(miscCredits))
    25592711        else
    2560           HelpDlg.ShowNewContent(wmModal, hkMisc, miscMain);
     2712          HelpDlg.ShowNewContent(wmModal, hkMisc, Integer(miscMain));
    25612713        Tribes.Done;
    25622714      end;
     
    25642716    cNewGame, cLoadGame, cMovie, cNewMap:
    25652717      begin
    2566         { if (Command=cNewGame) or (Command=cLoadGame) then
    2567           AdvisorDlg.NewGame(Data); }
    25682718        GenerateNames := mNames.Checked;
    2569         GameOK := true;
     2719        GameOK := True;
    25702720        G := TNewGameData(Data);
    2571         me := -1;
     2721        Me := -1;
    25722722        pLogo := -1;
    25732723        ClientMode := -1;
    25742724        SetMapOptions;
    25752725        MainMap.pDebugMap := -1;
    2576         idle := false;
     2726        Idle := False;
    25772727        FillChar(Jump, SizeOf(Jump), 0);
    25782728        if StartRunning then
     
    25972747              ToldContact := 0;
    25982748              ToldOwnCredibility := InitialCredibility;
    2599               for i := 0 to nPl - 1 do
    2600                 if G.Difficulty[i] > 0 then
    2601                   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);
    26022752              PeaceEvaHappened := 0;
    2603               for i := 0 to nWonder - 1 do
    2604                 with ToldWonders[i] do
     2753              for I := 0 to nWonder - 1 do
     2754                with ToldWonders[I] do
    26052755                begin
    26062756                  CityID := -1;
    2607                   EffectiveOwner := -1
     2757                  EffectiveOwner := -1;
    26082758                end;
    26092759              FillChar(ToldTech, SizeOf(ToldTech), Byte(tsNA));
     
    26122762            end;
    26132763
    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;
    26282765
    26292766        Age := 0;
    26302767        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;
    26352772
    26362773        MiniMap.Size := Point(G.lx, G.ly);
    2637         for i := 0 to nPl - 1 do
     2774        for I := 0 to nPl - 1 do
    26382775        begin
    2639           Tribe[i] := nil;
    2640           TribeOriginal[i] := false;
     2776          Tribe[I] := nil;
     2777          TribeOriginal[I] := False;
    26412778        end;
    26422779        ToldSlavery := -1;
    2643         RepaintOnResize := false;
    2644         Closable := false;
    2645         FirstMovieTurn := true;
     2780        RepaintOnResize := False;
     2781        Closable := False;
     2782        FirstMovieTurn := True;
    26462783
    26472784        MenuArea.Visible := GameMode <> cMovie;
     
    26542791      if NewPlayer = 0 then
    26552792      begin
    2656         i := 0;
     2793        I := 0;
    26572794        for p1 := 0 to nPl - 1 do
    26582795          if (G.Difficulty[p1] > 0) and (Tribe[p1] = nil) then
    2659             inc(i);
    2660         if i > UnusedTribeFiles.Count then
     2796            Inc(I);
     2797        if I > UnusedTribeFiles.Count then
    26612798        begin
    2662           GameOK := false;
     2799          GameOK := False;
    26632800          SimpleMessage(Phrases.Lookup('TOOFEWTRIBES'));
    26642801        end
     
    26712808              TribeInfo.trix := p1;
    26722809              TribeNames.Clear;
    2673               for j := 0 to UnusedTribeFiles.Count - 1 do
     2810              for J := 0 to UnusedTribeFiles.Count - 1 do
    26742811              begin
    2675                 GetTribeInfo(UnusedTribeFiles[j], Name, Color);
     2812                GetTribeInfo(UnusedTribeFiles[J], Name, Color);
    26762813                TribeNames.AddObject(Name, TObject(Color));
    26772814              end;
    2678               assert(TribeNames.Count > 0);
     2815              Assert(TribeNames.Count > 0);
    26792816              ModalSelectDlg.ShowNewContent(wmModal, kTribe);
    26802817              DpiApplication.ProcessMessages;
    2681               TribeInfo.FileName := UnusedTribeFiles[ModalSelectDlg.result];
    2682               UnusedTribeFiles.Delete(ModalSelectDlg.result);
     2818              TribeInfo.FileName := UnusedTribeFiles[ModalSelectDlg.Result];
     2819              UnusedTribeFiles.Delete(ModalSelectDlg.Result);
    26832820
    26842821              if GameMode = cLoadGame then
    2685                 CreateTribe(TribeInfo.trix, TribeInfo.FileName, false)
     2822                CreateTribe(TribeInfo.trix, TribeInfo.FileName, False)
    26862823              else
    2687                 Server(cSetTribe + (Length(TribeInfo.FileName) + 1 + 7) div 4,
     2824                Server(CommandWithData(cSetTribe, TribeInfo.GetCommandDataSize),
    26882825                  0, 0, TribeInfo);
    26892826            end;
     
    26932830            then
    26942831            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);
    26982835              TribeInfo.trix := p1;
    26992836              if GameMode = cLoadGame then
    2700                 CreateTribe(TribeInfo.trix, TribeInfo.FileName, false)
     2837                CreateTribe(TribeInfo.trix, TribeInfo.FileName, False)
    27012838              else
    2702                 Server(cSetTribe + (Length(TribeInfo.FileName) + 1 + 7) div 4,
     2839                Server(CommandWithData(cSetTribe, TribeInfo.GetCommandDataSize),
    27032840                  0, 0, TribeInfo);
    27042841            end;
     
    27142851        SaveSettings;
    27152852        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);
    27202854        if LogDlg.Visible then
    27212855          LogDlg.Close;
    27222856        LogDlg.List.Clear;
    2723         StartRunning := not idle and (Jump[0] > 0); // AI called Reload
    2724         me := -1;
    2725         idle := false;
     2857        StartRunning := not Idle and (Jump[0] > 0); // AI called Reload
     2858        Me := -1;
     2859        Idle := False;
    27262860        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 do
    2736           if Controls[i] is TButtonC then
    2737             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;
    27382872        sb.Init(0, 1);
    27392873        for p1 := 0 to nPl - 1 do
     
    27412875            FreeAndNil(Tribe[p1]);
    27422876        Tribes.Done;
    2743         RepaintOnResize := false;
    2744         Closable := true;
     2877        RepaintOnResize := False;
     2878        Closable := True;
    27452879        Close;
    2746         { if (GameMode=cNewGame) or (GameMode=cLoadGame) then
    2747           AdvisorDlg.BreakGame; }
    27482880      end;
    27492881
     
    27652897        Show;
    27662898        Update;
    2767         RepaintOnResize := true;
     2899        RepaintOnResize := True;
    27682900        xw := 0;
    27692901        yw := ywcenter;
    2770         if not StayOnTop_Ensured then
    2771         begin
    2772           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;
    27872902      end;
    27882903
    27892904    cShowTurnChange:
    27902905      begin
    2791         if integer(Data) >= 0 then
     2906        if Integer(Data) >= 0 then
    27922907        begin
    2793           pLogo := integer(Data);
     2908          pLogo := Integer(Data);
    27942909          if G.RO[pLogo] = nil then
    27952910          begin
    27962911            if AILogo[pLogo] <> nil then
    2797               DpiBitCanvas(Canvas, (xRightPanel + 10) - (16 + 64),
     2912              DpiBitBltCanvas(Canvas, (xRightPanel + 10) - (16 + 64),
    27982913                ClientHeight - PanelHeight, 64, 64, AILogo[pLogo].Canvas,
    27992914                0, 0);
    2800           end
    2801         end
     2915          end;
     2916        end;
    28022917      end;
    28032918
     
    28182933              ItsMeAgain(p1);
    28192934              for mix := 0 to MyRO.nModel - 1 do
    2820                 if not Assigned(Tribe[me].ModelPicture[mix].HGr) then
    2821                   InitMyModel(mix, true);
     2935                if not Assigned(Tribe[Me].ModelPicture[mix].HGr) then
     2936                  InitMyModel(mix, True);
    28222937            end;
    2823           me := -1;
     2938          Me := -1;
    28242939        end;
    28252940
     
    28302945            Jump[pTurn] := 0
    28312946          else
    2832             dec(Jump[pTurn]);
     2947            Dec(Jump[pTurn]);
    28332948        SkipTurn := Jump[pTurn] > 0;
    28342949        if SkipTurn then
     
    28392954          MiniMapPaint;
    28402955          InitAllEnemyModels; // necessary for correct replay
    2841           if not EndTurn(true) then
    2842             SkipTurn := false;
     2956          if not EndTurn(True) then
     2957            SkipTurn := False;
    28432958        end;
    28442959        if not SkipTurn then
     
    28472962            NegoDlg.Visible then
    28482963            NegoDlg.Close;
    2849           skipped := false; // always show my moves during my turn
    2850           idle := true;
     2964          Skipped := False; // always show my moves during my turn
     2965          Idle := True;
    28512966          InitTurn(NewPlayer);
    2852           DipMem[me].pContact := -1;
    2853           (* if (me=0) and (MyRO.Alive and (1 shl me)=0)} then
     2967          DipMem[Me].pContact := -1;
     2968          (* if (Me=0) and (MyRO.Alive and (1 shl Me)=0)} then
    28542969            begin
    28552970            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^)
    28582973            end
    28592974            else Play('TURNSTART'); *)
     
    28662981        pTurn := NewPlayer;
    28672982        pLogo := -1;
    2868         skipped := false; // always show my moves during my turn
    2869         idle := true;
     2983        Skipped := False; // always show my moves during my turn
     2984        Idle := True;
    28702985        if FirstMovieTurn then
    28712986        begin
    28722987          CheckMovieSpeedBtnState;
    2873           FirstMovieTurn := false;
     2988          FirstMovieTurn := False;
    28742989        end;
    28752990        InitTurn(NewPlayer);
     
    28883003        pTurn := -1;
    28893004        pLogo := -1;
    2890         MapValid := false;
     3005        MapValid := False;
    28913006        ClientMode := -1;
    2892         idle := false;
    2893         skipped := false;
     3007        Idle := False;
     3008        Skipped := False;
    28943009      end;
    28953010
     
    29013016        ItsMeAgain(0);
    29023017        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;
    29113026        HelpDlg.Difficulty := 0;
    29123027        BrushType := fGrass;
    29133028        BrushLoc := -1;
    2914         Edited := false;
     3029        Edited := False;
    29153030        UnFocus := -1;
    29163031        MarkCityLoc := -1;
    2917         Tracking := false;
    2918         TurnComplete := false;
    2919         MapValid := false;
     3032        Tracking := False;
     3033        TurnComplete := False;
     3034        MapValid := False;
    29203035        FormResize(nil); // calculate geometrics and paint all
    29213036        SetTroopLoc(-1);
    2922         idle := true;
     3037        Idle := True;
    29233038      end;
    29243039
     
    29303045    scContact:
    29313046      begin
    2932         DipMem[NewPlayer].pContact := integer(Data);
     3047        DipMem[NewPlayer].pContact := Integer(Data);
    29333048        if Jump[NewPlayer] > 0 then
    29343049          DipCall(scReject)
     
    29373052          ClientMode := Command;
    29383053          InitTurn(NewPlayer);
    2939           MyData.ToldContact := MyData.ToldContact or (1 shl integer(Data));
     3054          MyData.ToldContact := MyData.ToldContact or (1 shl Integer(Data));
    29403055          // don't tell about new nation when already contacted by them
    29413056          with MessgExDlg do
    29423057          begin
    2943             OpenSound := 'CONTACT_' + char(48 + MyRO.EnemyReport[integer(Data)
     3058            OpenSound := 'CONTACT_' + char(48 + MyRO.EnemyReport[Integer(Data)
    29443059              ].Attitude);
    2945             MessgText := Tribe[integer(Data)].TPhrase('FRCONTACT');
     3060            MessgText := Tribe[Integer(Data)].TPhrase('FRCONTACT');
    29463061            Kind := mkYesNo;
    29473062            IconKind := mikTribe;
    2948             IconIndex := integer(Data);
     3063            IconIndex := Integer(Data);
    29493064            ShowModal;
    29503065            if ModalResult = mrOK then
    29513066            begin
    29523067              NegoDlg.Respond;
    2953               DipMem[me].DeliveredPrices := [];
    2954               DipMem[me].ReceivedPrices := [];
     3068              DipMem[Me].DeliveredPrices := [];
     3069              DipMem[Me].ReceivedPrices := [];
    29553070              DipCall(scDipStart);
    29563071            end
     
    29803095        else if Command = scDipAccept then
    29813096        begin // remember delivered and received prices
    2982           for i := 0 to DipMem[me].SentOffer.nDeliver - 1 do
    2983             include(DipMem[me].DeliveredPrices,
    2984               DipMem[me].SentOffer.Price[i] shr 24);
    2985           for i := 0 to DipMem[me].SentOffer.nCost - 1 do
    2986             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 do
    2991             if DipMem[me].SentOffer.Price[i] and opMask = opTreaty then
    2992               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;
    29933108          if IsTreatyDeal then
    29943109            Play('NEWTREATY')
     
    29973112        end;
    29983113        NegoDlg.Start;
    2999         idle := true;
     3114        Idle := True;
    30003115      end;
    30013116
     
    30033118      if not IsMultiPlayerGame then
    30043119      begin
    3005         case G.RO[NewPlayer].Treaty[integer(Data)] of
     3120        case G.RO[NewPlayer].Treaty[Integer(Data)] of
    30063121          trPeace:
    3007             s := Tribe[integer(Data)].TPhrase('FRCANCELBYREJECT_PEACE');
     3122            S := Tribe[Integer(Data)].TPhrase('FRCANCELBYREJECT_PEACE');
    30083123          trFriendlyContact:
    3009             s := Tribe[integer(Data)].TPhrase('FRCANCELBYREJECT_FRIENDLY');
     3124            S := Tribe[Integer(Data)].TPhrase('FRCANCELBYREJECT_FRIENDLY');
    30103125          trAlliance:
    3011             s := Tribe[integer(Data)].TPhrase('FRCANCELBYREJECT_ALLIANCE');
     3126            S := Tribe[Integer(Data)].TPhrase('FRCANCELBYREJECT_ALLIANCE');
    30123127        end;
    3013         TribeMessage(integer(Data), s, 'CANCELTREATY');
     3128        TribeMessage(Integer(Data), S, 'CANCELTREATY');
    30143129      end;
    30153130
    30163131    cShowCancelTreatyByAlliance:
    3017       if idle and (NewPlayer = me) then
    3018         TribeMessage(integer(Data), Tribe[integer(Data)
     3132      if Idle and (NewPlayer = Me) then
     3133        TribeMessage(Integer(Data), Tribe[Integer(Data)
    30193134          ].TPhrase('FRENEMYALLIANCE'), 'CANCELTREATY');
    30203135
    30213136    cShowSupportAllianceAgainst:
    30223137      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]
    30253140          .TPhrase('FRMYALLIANCE2'), 'CANCELTREATY');
    30263141
    30273142    cShowPeaceViolation:
    30283143      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'),
    30313146          [TurnToString(MyRO.Turn + PeaceEvaTurns - 1)]), 'MSG_WITHDRAW');
    30323147
     
    30353150
    30363151    cShowUnitChanged, cShowCityChanged, cShowAfterMove, cShowAfterAttack:
    3037       if (idle and (NewPlayer = me) or not idle and not skipped) and
     3152      if (Idle and (NewPlayer = Me) or not Idle and not skipped) and
    30383153        not((GameMode = cMovie) and (MovieSpeed = 4)) then
    30393154      begin
    3040         assert(NewPlayer = me);
    3041         if not idle or (GameMode = cMovie) then
     3155        Assert(NewPlayer = Me);
     3156        if not Idle or (GameMode = cMovie) then
    30423157          DpiApplication.ProcessMessages;
    30433158        if Command = cShowCityChanged then
    30443159        begin
    3045           CurrentMoveInfo.DoShow := false;
    3046           if idle then
    3047             CurrentMoveInfo.DoShow := true
     3160          CurrentMoveInfo.DoShow := False;
     3161          if Idle then
     3162            CurrentMoveInfo.DoShow := True
    30483163          else if CurrentMoveInfo.IsAlly then
    30493164            CurrentMoveInfo.DoShow := not mAlNoMoves.Checked
     
    30533168        else if Command = cShowUnitChanged then
    30543169        begin
    3055           CurrentMoveInfo.DoShow := false;
    3056           if idle then
     3170          CurrentMoveInfo.DoShow := False;
     3171          if Idle then
    30573172            CurrentMoveInfo.DoShow := not mEffectiveMovesOnly.Checked
    30583173          else if CurrentMoveInfo.IsAlly then
     
    30683183        begin
    30693184          if Command = cShowCityChanged then
    3070             MapValid := false;
    3071           FocusOnLoc(integer(Data), flImmUpdate);
     3185            MapValid := False;
     3186          FocusOnLoc(Integer(Data), flImmUpdate);
    30723187          // OldUnFocus:=UnFocus;
    30733188          // UnFocus:=-1;
    30743189          if Command = cShowAfterMove then
    3075             PaintLoc(integer(Data), CurrentMoveInfo.AfterMovePaintRadius)
     3190            PaintLoc(Integer(Data), CurrentMoveInfo.AfterMovePaintRadius)
    30763191            // show discovered areas
    30773192          else
    3078             PaintLoc(integer(Data), 1);
     3193            PaintLoc(Integer(Data), 1);
    30793194          // UnFocus:=OldUnFocus;
    30803195          if (Command = cShowAfterAttack) and
     
    30863201            Update; // remove message box from screen
    30873202          end
    3088           else if not idle then
     3203          else if not Idle then
    30893204            if Command = cShowCityChanged then
    30903205              Sleep(MoveTime * WaitAfterShowMove div 16)
    30913206            else if (Command = cShowUnitChanged) and
    3092               (MyMap[integer(Data)] and fUnit <> 0) then
     3207              (MyMap[Integer(Data)] and fUnit <> 0) then
    30933208              Sleep(MoveTime * WaitAfterShowMove div 32)
    30943209        end // if CurrentMoveInfo.DoShow
    30953210        else
    3096           MapValid := false;
     3211          MapValid := False;
    30973212      end;
    30983213
    30993214    cShowMoving, cShowCapturing:
    3100       if (idle and (NewPlayer = me) or not idle and not skipped and
     3215      if (Idle and (NewPlayer = Me) or not Idle and not skipped and
    31013216        (TShowMove(Data).emix <> $FFFF)) and
    31023217        not((GameMode = cMovie) and (MovieSpeed = 4)) then
    31033218      begin
    3104         assert(NewPlayer = me);
    3105         if not idle or (GameMode = cMovie) then
     3219        Assert(NewPlayer = Me);
     3220        if not Idle or (GameMode = cMovie) then
    31063221          DpiApplication.ProcessMessages;
    31073222        with TShowMove(Data) do
    31083223        begin
    3109           CurrentMoveInfo.DoShow := false;
    3110           if not idle and (not Assigned(Tribe[Owner].ModelPicture[mix].HGr)) then
     3224          CurrentMoveInfo.DoShow := False;
     3225          if not Idle and (not Assigned(Tribe[Owner].ModelPicture[mix].HGr)) then
    31113226            InitEnemyModel(emix);
    31123227
    31133228          ToLoc := dLoc(FromLoc, dx, dy);
    3114           if idle then
     3229          if Idle then
    31153230          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!
    31173232            CurrentMoveInfo.DoShow := not mEffectiveMovesOnly.Checked or
    31183233              (Command = cShowCapturing);
     
    31473262                else
    31483263                  CurrentMoveInfo.AfterMovePaintRadius := 1;
    3149                 if (MyRO.Wonder[woShinkansen].EffectiveOwner = me) and
     3264                if (MyRO.Wonder[woShinkansen].EffectiveOwner = Me) and
    31503265                  (Domain = dGround) and
    31513266                  (MyMap[FromLoc] and (fRR or fCity) <> 0) and
     
    31623277            CurrentMoveInfo.IsAlly := MyRO.Treaty[Owner] = trAlliance;
    31633278            if GameMode = cMovie then
    3164               CurrentMoveInfo.DoShow := true
     3279              CurrentMoveInfo.DoShow := True
    31653280            else if CurrentMoveInfo.IsAlly then
    31663281              CurrentMoveInfo.DoShow := not mAlNoMoves.Checked and
     
    31783293                  cix := MyRO.nCity - 1;
    31793294                  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);
    31823297                end
    31833298                else
     
    31853300                  ecix := MyRO.nEnemyCity - 1;
    31863301                  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);
    31893304                end;
    31903305                TribeMessage(Owner, Format(Tribe[Owner].TPhrase('CAPTURE'),
    3191                   [s]), '');
     3306                  [S]), '');
    31923307                Update; // remove message box from screen
    31933308              end;
     
    32743389          end // if CurrentMoveInfo.DoShow
    32753390          else
    3276             MapValid := false;
     3391            MapValid := False;
    32773392        end;
    32783393      end;
    32793394
    32803395    cShowAttacking:
    3281       if (idle and (NewPlayer = me) or not idle and not skipped and
     3396      if (Idle and (NewPlayer = Me) or not Idle and not skipped and
    32823397        (TShowMove(Data).emix <> $FFFF)) and
    32833398        not((GameMode = cMovie) and (MovieSpeed = 4)) then
    32843399      begin
    3285         assert(NewPlayer = me);
    3286         if not idle or (GameMode = cMovie) then
     3400        Assert(NewPlayer = Me);
     3401        if not Idle or (GameMode = cMovie) then
    32873402          DpiApplication.ProcessMessages;
    32883403        with TShowMove(Data) do
    32893404        begin
    32903405          CurrentMoveInfo.AfterAttackExpeller := -1;
    3291           CurrentMoveInfo.DoShow := false;
    3292           if idle then
    3293             CurrentMoveInfo.DoShow := true // own unit -- always show attacks
     3406          CurrentMoveInfo.DoShow := False;
     3407          if Idle then
     3408            CurrentMoveInfo.DoShow := True // own unit -- always show attacks
    32943409          else
    32953410          begin
     
    33113426              cix := MyRO.nCity - 1;
    33123427              while (cix >= 0) and (MyCity[cix].Loc <> ToLoc) do
    3313                 dec(cix);
     3428                Dec(cix);
    33143429              if MyCity[cix].Status and csToldBombard = 0 then
    33153430              begin
    3316                 if not supervising then
     3431                if not Supervising then
    33173432                  MyCity[cix].Status := MyCity[cix].Status or csToldBombard;
    3318                 s := CityName(MyCity[cix].ID);
     3433                S := CityName(MyCity[cix].ID);
    33193434                SoundMessageEx(Format(Tribe[Owner].TPhrase('BOMBARD'),
    3320                   [s]), '');
     3435                  [S]), '');
    33213436                Update; // remove message box from screen
    33223437              end;
     
    33273442            if Flags and umExpelling <> 0 then
    33283443              Play('MOVE_EXPEL')
    3329             else if Owner = me then
     3444            else if Owner = Me then
    33303445            begin
    3331               MakeModelInfo(me, mix, MyModel[mix], mi);
     3446              MakeModelInfo(Me, mix, MyModel[mix], mi);
    33323447              Play(AttackSound(ModelCode(mi)));
    33333448            end
     
    33543469              MoveOnScreen(TShowMove(Data), 10, 0, 16);
    33553470            end
    3356             else if not idle then
     3471            else if not Idle then
    33573472              Sleep(MoveTime div 2);
    33583473            MainMap.AttackEnd;
    33593474          end // if CurrentMoveInfo.DoShow
    33603475          else
    3361             MapValid := false;
     3476            MapValid := False;
    33623477        end;
    33633478      end;
     
    33683483      else
    33693484      begin
    3370         s := Phrases.Lookup('FOREIGNINFO');
     3485        S := Phrases.Lookup('FOREIGNINFO');
    33713486        for p1 := 0 to nPl - 1 do
    33723487          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, '');
    33753490      end;
    33763491
     
    33843499        begin
    33853500          MessgText := Format(Phrases.Lookup('GRLIB_GENERAL'),
    3386             [Phrases.Lookup('ADVANCES', integer(Data))]);
     3501            [Phrases.Lookup('ADVANCES', Integer(Data))]);
    33873502          OpenSound := 'NEWADVANCE_GRLIB';
    33883503          Kind := mkOk;
     
    33943509    cRefreshDebugMap:
    33953510      begin
    3396         if integer(Data) = MainMap.pDebugMap then
     3511        if Integer(Data) = MainMap.pDebugMap then
    33973512        begin
    3398           MapValid := false;
     3513          MapValid := False;
    33993514          MainOffscreenPaint;
    34003515          Update;
    3401         end
     3516        end;
    34023517      end;
    34033518
    34043519  else
    34053520    if Command >= cClientEx then
    3406       case Command and $FFF0 of
    3407 
     3521      case Command and (not Integer(CommandDataElementCountMask)) of
    34083522        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);
    34183531          end;
    3419 
    3420         cSetNewModelPicture, cSetModelPicture:
     3532        cSetNewModelPicture:
    34213533          if TribeOriginal[TModelPictureInfo(Data).trix] then
    34223534            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;
    34293542        cSetCityName:
    34303543          with TCityNameInfo(Data) do
    34313544            if TribeOriginal[ID shr 12] then
    34323545              Tribe[ID shr 12].SetCityName(ID and $FFF, NewName);
    3433 
    34343546        cSetModelName:
    34353547          with TModelNameInfo(Data) do
     
    34443556procedure TMainScreen.FormCreate(Sender: TObject);
    34453557var
    3446   i, j: integer;
     3558  I, J: Integer;
    34473559begin
    34483560  NoMap := TIsoMap.Create;
     
    34863598
    34873599  // tag-controlled language
    3488   for i := 0 to ComponentCount - 1 do
    3489     if Components[i].Tag and $FF <> 0 then
    3490       if Components[i] is TDpiMenuItem then begin
    3491         TDpiMenuItem(Components[i]).Caption := Phrases.Lookup('CONTROLS',
    3492           -1 + Components[i].Tag and $FF);
    3493         for j := 0 to Length(SaveOption) - 1 do
    3494           if Components[i].Tag and $FF = SaveOption[j] then
    3495             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;
    34963608      end else
    3497       if Components[i] is TButtonBase then begin
    3498         TButtonBase(Components[i]).Hint := Phrases.Lookup('CONTROLS',
    3499           -1 + Components[i].Tag and $FF);
    3500         if (Components[i] is TButtonC) and
    3501           (TButtonC(Components[i]).ButtonIndex <> 1) then
    3502           TButtonC(Components[i]).ButtonIndex :=
    3503             Integer(MapOptionChecked) shr (Components[i].Tag shr 8) and 1 + 2
     3609      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
    35043616      end;
    35053617
     
    35143626    ManagementArea.Hint := Phrases2.Lookup('BTN_MANAGE');
    35153627  end;
    3516   for i := 0 to mRep.Count - 1 do
    3517   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;
    35213633  end;
    35223634
     
    35373649    else Buffer.height := 3 * ySizeBig;
    35383650  Buffer.Canvas.Font.Assign(UniFont[ftSmall]);
    3539   for i := 0 to nPl - 1 do
    3540     AILogo[i] := nil;
     3651  for I := 0 to nPl - 1 do
     3652    AILogo[I] := nil;
    35413653  Canvas.Font.Assign(UniFont[ftSmall]);
    35423654  InitButtons;
     
    35483660  I: Integer;
    35493661begin
     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
    35503679  MainFormKeyDown := nil;
    35513680  FreeAndNil(sb);
     
    35553684  FreeAndNil(Panel);
    35563685  for I := 0 to nPl - 1 do
    3557     if AILogo[i] <> nil then
     3686    if AILogo[I] <> nil then
    35583687      FreeAndNil(AILogo[I]);
    35593688  FreeAndNil(Offscreen);
     
    35863715end;
    35873716
     3717procedure TMainScreen.mAfforestClick(Sender: TObject);
     3718begin
     3719  if UnFocus >= 0 then
     3720    with TUn(MyUn[UnFocus]) do
     3721      DoJob(jAfforest);
     3722end;
     3723
     3724procedure TMainScreen.mAirBaseClick(Sender: TObject);
     3725begin
     3726  if UnFocus >= 0 then
     3727    with TUn(MyUn[UnFocus]) do
     3728      DoJob(jBase);
     3729end;
     3730
     3731procedure TMainScreen.mCanalClick(Sender: TObject);
     3732begin
     3733  if UnFocus >= 0 then
     3734    with TUn(MyUn[UnFocus]) do
     3735      DoJob(jCanal);
     3736end;
     3737
     3738procedure TMainScreen.mCancelClick(Sender: TObject);
     3739begin
     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;
     3748end;
     3749
     3750procedure TMainScreen.mCentreClick(Sender: TObject);
     3751begin
     3752  if UnFocus >= 0 then
     3753  with TUn(MyUn[UnFocus]) do begin
     3754    Centre(Loc);
     3755    PaintAllMaps;
     3756  end;
     3757end;
     3758
     3759procedure TMainScreen.mcityClick(Sender: TObject);
     3760var
     3761  Loc0: Integer;
     3762  cix: Integer;
     3763  ServerResult: Integer;
     3764begin
     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;
     3799end;
     3800
     3801procedure TMainScreen.mCityStatClick(Sender: TObject);
     3802begin
     3803  ListDlg.ShowNewContent(wmPersistent, kCities);
     3804end;
     3805
     3806procedure TMainScreen.mCityTypesClick(Sender: TObject);
     3807begin
     3808  CityTypeDlg.ShowNewContent(wmModal);
     3809  // must be modal because types are not saved before closing
     3810end;
     3811
     3812procedure TMainScreen.mClearClick(Sender: TObject);
     3813begin
     3814  if UnFocus >= 0 then
     3815    with TUn(MyUn[UnFocus]) do
     3816      DoJob(jClear);
     3817end;
     3818
     3819procedure TMainScreen.mDiagramClick(Sender: TObject);
     3820begin
     3821  DiaDlg.ShowNewContent_Charts(wmPersistent);
     3822end;
     3823
     3824procedure TMainScreen.mEmpireClick(Sender: TObject);
     3825begin
     3826  RatesDlg.ShowNewContent(wmPersistent);
     3827end;
     3828
     3829procedure TMainScreen.mEnhanceClick(Sender: TObject);
     3830begin
     3831  if UnFocus >= 0 then
     3832    with TUn(MyUn[UnFocus]) do
     3833      DoJob(-1);
     3834end;
     3835
     3836procedure TMainScreen.mEnhanceDefClick(Sender: TObject);
     3837begin
     3838  if UnFocus >= 0 then
     3839    EnhanceDlg.ShowNewContent(wmPersistent,
     3840      MyMap[MyUn[UnFocus].Loc] and fTerrain)
     3841  else
     3842    EnhanceDlg.ShowNewContent(wmPersistent);
     3843end;
     3844
     3845procedure TMainScreen.mEUnitStatClick(Sender: TObject);
     3846begin
     3847  if MyRO.nEnemyModel > 0 then
     3848    ListDlg.ShowNewContent(wmPersistent, kAllEModels);
     3849end;
     3850
     3851procedure TMainScreen.mFarmClick(Sender: TObject);
     3852begin
     3853  if UnFocus >= 0 then
     3854    with TUn(MyUn[UnFocus]) do
     3855      DoJob(jFarm);
     3856end;
     3857
     3858procedure TMainScreen.mfortClick(Sender: TObject);
     3859begin
     3860  if UnFocus >= 0 then
     3861    with TUn(MyUn[UnFocus]) do
     3862      DoJob(jFort);
     3863end;
     3864
     3865procedure TMainScreen.mGoOnClick(Sender: TObject);
     3866var
     3867  Destination: Integer;
     3868begin
     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;
     3878end;
     3879
     3880procedure TMainScreen.mHelpClick(Sender: TObject);
     3881begin
     3882  if ClientMode = cEditMap then
     3883    HelpDlg.ShowNewContent(wmPersistent, hkText, HelpDlg.TextIndex('MAPEDIT'))
     3884  else
     3885    HelpDlg.ShowNewContent(wmPersistent, hkMisc, Integer(miscMain));
     3886end;
     3887
     3888procedure TMainScreen.mhomeClick(Sender: TObject);
     3889var
     3890  cixOldHome: Integer;
     3891begin
     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;
     3912end;
     3913
     3914procedure TMainScreen.mirrigationClick(Sender: TObject);
     3915begin
     3916  if UnFocus >= 0 then
     3917    with TUn(MyUn[UnFocus]) do
     3918        DoJob(jIrr);
     3919end;
     3920
     3921procedure TMainScreen.mirrigationDrawItem(Sender: TObject; ACanvas: TDpiCanvas;
     3922  ARect: TRect; AState: TOwnerDrawState);
     3923begin
     3924
     3925end;
     3926
     3927procedure TMainScreen.mJumpClick(Sender: TObject);
     3928begin
     3929  if Supervising then
     3930    Jump[0] := 20
     3931  else
     3932    Jump[Me] := 20;
     3933  EndTurn(True);
     3934end;
     3935
     3936procedure TMainScreen.mLoadClick(Sender: TObject);
     3937var
     3938  I: Integer;
     3939begin
     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;
     3961end;
     3962
     3963procedure TMainScreen.mmineClick(Sender: TObject);
     3964begin
     3965  if UnFocus >= 0 then
     3966    with TUn(MyUn[UnFocus]) do
     3967      DoJob(jMine);
     3968end;
     3969
     3970procedure TMainScreen.mNationsClick(Sender: TObject);
     3971begin
     3972  NatStatDlg.ShowNewContent(wmPersistent);
     3973end;
     3974
     3975procedure TMainScreen.mNextUnitClick(Sender: TObject);
     3976begin
     3977  if UnFocus >= 0 then
     3978  with MyUn[UnFocus] do begin
     3979    Status := Status and not usWaiting;
     3980    FocusNextUnit(1);
     3981  end;
     3982end;
     3983
     3984procedure TMainScreen.mnoordersClick(Sender: TObject);
     3985begin
     3986  if UnFocus >= 0 then
     3987  with MyUn[UnFocus] do begin
     3988    Status := Status and not usWaiting;
     3989    NextUnit(UnStartLoc, True);
     3990  end;
     3991end;
     3992
     3993procedure TMainScreen.mPillageClick(Sender: TObject);
     3994begin
     3995  DoJob(jPillage);
     3996end;
     3997
     3998procedure TMainScreen.mpollutionClick(Sender: TObject);
     3999begin
     4000  if UnFocus >= 0 then
     4001    with TUn(MyUn[UnFocus]) do
     4002      DoJob(jPoll);
     4003end;
     4004
     4005procedure TMainScreen.mPrevUnitClick(Sender: TObject);
     4006begin
     4007  if UnFocus >= 0 then
     4008  with MyUn[UnFocus] do begin
     4009    Status := Status and not usWaiting;
     4010    FocusNextUnit(-1);
     4011  end;
     4012end;
     4013
     4014procedure TMainScreen.mRandomMapClick(Sender: TObject);
     4015begin
     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;
     4023end;
     4024
     4025procedure TMainScreen.mRecoverClick(Sender: TObject);
     4026begin
     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;
     4036end;
     4037
     4038procedure TMainScreen.mResignClick(Sender: TObject);
     4039var
     4040  QueryText: string;
     4041begin
     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;
     4061end;
     4062
     4063procedure TMainScreen.mRevolutionClick(Sender: TObject);
     4064var
     4065  AltGovs: Boolean;
     4066  RevolutionChanged: Boolean;
     4067  I: Integer;
     4068begin
     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;
     4113end;
     4114
     4115procedure TMainScreen.mroadClick(Sender: TObject);
     4116begin
     4117  if UnFocus >= 0 then
     4118    with TUn(MyUn[UnFocus]) do
     4119      DoJob(jRoad);
     4120end;
     4121
     4122procedure TMainScreen.mRailRoadClick(Sender: TObject);
     4123begin
     4124  if UnFocus >= 0 then
     4125    with TUn(MyUn[UnFocus]) do
     4126      DoJob(jRR);
     4127end;
     4128
     4129procedure TMainScreen.mRunClick(Sender: TObject);
     4130begin
     4131  if Supervising then
     4132    Jump[0] := 999999
     4133  else
     4134    Jump[Me] := 999999;
     4135  EndTurn(True);
     4136end;
     4137
     4138procedure TMainScreen.mScienceStatClick(Sender: TObject);
     4139begin
     4140  ListDlg.ShowNewContent(wmPersistent, kScience);
     4141end;
     4142
     4143procedure TMainScreen.mSelectTransportClick(Sender: TObject);
     4144begin
     4145  if UnFocus >= 0 then
     4146    with TUn(MyUn[UnFocus]) do
     4147      Server(sSelectTransport, Me, UnFocus, nil^);
     4148end;
     4149
     4150procedure TMainScreen.mShipsClick(Sender: TObject);
     4151begin
     4152  DiaDlg.ShowNewContent_Ship(wmPersistent);
     4153end;
     4154
     4155procedure TMainScreen.mstayClick(Sender: TObject);
     4156begin
     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;
     4166end;
     4167
     4168procedure TMainScreen.mTechTreeClick(Sender: TObject);
     4169begin
     4170  TechTreeDlg.ShowModal;
     4171end;
     4172
     4173procedure TMainScreen.mtransClick(Sender: TObject);
     4174begin
     4175  if UnFocus >= 0 then
     4176    with TUn(MyUn[UnFocus]) do
     4177      DoJob(jTrans);
     4178end;
     4179
     4180procedure TMainScreen.mUnitStatClick(Sender: TObject);
     4181var
     4182  I: Integer;
     4183begin
     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;
     4194end;
     4195
     4196procedure TMainScreen.mUnloadClick(Sender: TObject);
     4197var
     4198  I: Integer;
     4199  OldMaster: Integer;
     4200  NewFocus: Integer;
     4201  uix: Integer;
     4202begin
     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;
     4251end;
     4252
     4253procedure TMainScreen.mwaitClick(Sender: TObject);
     4254begin
     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);
     4262end;
     4263
     4264procedure TMainScreen.mWebsiteClick(Sender: TObject);
     4265begin
     4266  OpenURL(CevoHomepage);
     4267end;
     4268
     4269procedure TMainScreen.mWondersClick(Sender: TObject);
     4270begin
     4271  WondersDlg.ShowNewContent(wmPersistent);
     4272end;
     4273
    35884274procedure TMainScreen.FormResize(Sender: TObject);
    35894275var
    3590   MiniFrame, MaxMapWidth: integer;
     4276  MiniFrame, MaxMapWidth: Integer;
    35914277begin
    35924278  SmallScreen := ClientWidth < 1024;
     
    36664352  begin
    36674353    RectInvalidate(0, TopBarHeight, ClientWidth, TopBarHeight + MapHeight);
    3668     MapValid := false;
     4354    MapValid := False;
    36694355    PaintAll;
    36704356  end;
    36714357end;
    36724358
    3673 procedure TMainScreen.FormCloseQuery(Sender: TObject; var CanClose: boolean);
     4359procedure TMainScreen.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    36744360begin
    36754361  CanClose := Closable;
    3676   if not Closable and idle and (me = 0) and (ClientMode < scContact) then
    3677     MenuClick(mResign);
     4362  if not Closable and Idle and (Me = 0) and (ClientMode < scContact) then
     4363    mResign.Click;
    36784364end;
    36794365
     
    36964382  begin
    36974383    MessgExDlg.CancelMovie;
    3698     Server(sBreak, me, 0, nil^);
     4384    Server(sBreak, Me, 0, nil^);
    36994385  end
    37004386  else if ClientMode < 0 then
    3701     skipped := true
     4387    Skipped := True
    37024388  else if ClientMode >= scContact then
    37034389    NegoDlg.ShowNewContent(wmPersistent)
     
    37054391  begin
    37064392    Jump[pTurn] := 0;
    3707     StartRunning := false;
     4393    StartRunning := False;
    37084394  end
    37094395  else
     
    37184404  else
    37194405  with MainMap do begin
    3720     if supervising then
     4406    if Supervising then
    37214407      xTerrain := xMidPanel + 2 * xxt + 14
    37224408    else if ClientWidth < 1280 then
     
    37254411      xTerrain := ClientWidth div 2;
    37264412    xTroop := xTerrain + 2 * xxt + 12;
    3727     if SmallScreen and not supervising then
     4413    if SmallScreen and not Supervising then
    37284414      xTroop := xRightPanel + 10 - 3 * 66 -
    37294415        DpiGetSystemMetrics(SM_CXVSCROLL) - 19 - 4;
     
    37344420end;
    37354421
    3736 function TMainScreen.EndTurn(WasSkipped: boolean): boolean;
    3737 
    3738   function IsResourceUnused(cix, NeedFood, NeedProd: integer): boolean;
     4422function TMainScreen.EndTurn(WasSkipped: Boolean): Boolean;
     4423
     4424  function IsResourceUnused(cix, NeedFood, NeedProd: Integer): Boolean;
    37394425  var
    3740     dx, dy, fix: integer;
     4426    dx, dy, fix: Integer;
    37414427    CityAreaInfo: TCityAreaInfo;
    37424428    TileInfo: TTileInfo;
    37434429  begin
    3744     Server(sGetCityAreaInfo, me, cix, CityAreaInfo);
     4430    Server(sGetCityAreaInfo, Me, cix, CityAreaInfo);
    37454431    for dy := -3 to 3 do
    37464432      for dx := -3 to 3 do
     
    37524438          begin
    37534439            TileInfo.ExplCity := cix;
    3754             Server(sGetHypoCityTileInfo, me, dLoc(MyCity[cix].Loc, dx, dy),
     4440            Server(sGetHypoCityTileInfo, Me, dLoc(MyCity[cix].Loc, dx, dy),
    37554441              TileInfo);
    37564442            if (TileInfo.Food >= NeedFood) and (TileInfo.Prod >= NeedProd) then
    37574443            begin
    3758               result := true;
    3759               exit
     4444              Result := True;
     4445              Exit
    37604446            end;
    37614447          end
    37624448        end;
    3763     result := false;
     4449    Result := False;
    37644450  end;
    37654451
    37664452var
    3767   i, p1, uix, cix, CenterLoc: integer;
     4453  p1, uix, cix, CenterLoc: Integer;
    37684454  MsgItem: string;
    37694455  CityReport: TCityReport;
    37704456  PlaneReturnData: TPlaneReturnData;
    3771   Zoom: boolean;
    3772 begin
    3773   result := false;
     4457  Zoom: Boolean;
     4458begin
     4459  Result := False;
    37744460  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);
    37824465    ItsMeAgain(0);
    37834466  end;
     
    37974480          PlaneReturnData.Loc := Loc;
    37984481          PlaneReturnData.Movement := 0; // end turn without further movement?
    3799           if Server(sGetPlaneReturn, me, uix, PlaneReturnData) = eNoWay then
     4482          if Server(sGetPlaneReturn, Me, uix, PlaneReturnData) = eNoWay then
    38004483          begin
    38014484            CenterLoc := Loc + G.lx * 6;
    38024485            // centering the unit itself would make it covered by the query dialog
    38034486            while CenterLoc >= G.lx * G.ly do
    3804               dec(CenterLoc, G.lx * 2);
     4487              Dec(CenterLoc, G.lx * 2);
    38054488            Centre(CenterLoc);
    38064489            SetTroopLoc(-1);
     
    38174500              SetTroopLoc(Loc);
    38184501              PanelPaint;
    3819               exit;
     4502              Exit;
    38204503            end;
    38214504            MyUn[uix].Status := MyUn[uix].Status or usToldNoReturn;
    3822           end
     4505          end;
    38234506        end;
    38244507
    3825     if not supervising and (MyRO.TestFlags and tfImmImprove = 0) and
     4508    if not Supervising and (MyRO.TestFlags and tfImmImprove = 0) and
    38264509      (MyRO.Government <> gAnarchy) and (MyRO.Money + TaxSum < 0) and
    38274510      (MyRO.TaxRate < 100) then // low funds!
     
    38354518        ShowModal;
    38364519        if ModalResult <> mrOK then
    3837           exit
     4520          Exit;
    38384521      end;
    38394522
     
    38434526          if (Loc >= 0) and (Flags and chCaptured = 0) then
    38444527          begin
    3845             Zoom := false;
     4528            Zoom := False;
    38464529            CityReport.HypoTiles := -1;
    38474530            CityReport.HypoTax := -1;
    38484531            CityReport.HypoLux := -1;
    3849             Server(sGetCityReport, me, cix, CityReport);
     4532            Server(sGetCityReport, Me, cix, CityReport);
    38504533
    38514534            if (CityReport.Working - CityReport.Happy > Size shr 1) and
     
    39044587            begin // zoom to city
    39054588              ZoomToCity(Loc);
    3906               exit
    3907             end
     4589              Exit;
     4590            end;
    39084591          end;
    39094592
     
    39114594      (MyData.FarTech <> adNexus) then
    39124595      if not ChooseResearch then
    3913         exit;
     4596        Exit;
    39144597  end;
    39154598
     
    39214604
    39224605  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
    39314610    if CityDlg.Visible then
    39324611      CityDlg.Close;
     
    39344613      UnitStatDlg.Close;
    39354614  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);
    39394616
    39404617  if Server(sTurn, pTurn, 0, nil^) >= rExecuted then
     
    39444621    else
    39454622      EOT.Hint := Phrases.Lookup('BTN_SKIP');
    3946     result := true;
     4623    Result := True;
    39474624    SetTroopLoc(-1);
    39484625    pTurn := -1;
    39494626    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;
    39534630    EOT.ButtonIndex := eotCancel;
    3954     EOT.Visible := true;
    3955     MapValid := false;
     4631    EOT.Visible := True;
     4632    MapValid := False;
    39564633    PanelPaint;
    39574634    Update;
    39584635    ClientMode := -1;
    3959     idle := false;
    3960     skipped := WasSkipped;
     4636    Idle := False;
     4637    Skipped := WasSkipped;
    39614638    for p1 := 1 to nPl - 1 do
    39624639      if G.RO[p1] <> nil then
    3963         skipped := true; // don't show enemy moves in hotseat mode
     4640        Skipped := True; // don't show enemy moves in hotseat mode
    39644641  end
    39654642  else
    3966     PanelPaint
    3967 end; // EndTurn
     4643    PanelPaint;
     4644end;
    39684645
    39694646procedure TMainScreen.EndNego;
     
    39714648  if NegoDlg.Visible then
    39724649    NegoDlg.Close;
    3973   HaveStrategyAdvice := false;
    3974   // AdvisorDlg.HaveStrategyAdvice;
    3975   // negotiation might have changed advices
     4650  HaveStrategyAdvice := False;
    39764651  EOT.ButtonIndex := eotCancel;
    3977   EOT.Visible := true;
     4652  EOT.Visible := True;
    39784653  PanelPaint;
    39794654  Update;
    39804655  ClientMode := -1;
    3981   idle := false;
    3982 end;
    3983 
    3984 procedure TMainScreen.ProcessRect(x0, y0, nx, ny, Options: integer);
     4656  Idle := False;
     4657end;
     4658
     4659procedure TMainScreen.ProcessRect(x0, y0, nx, ny, Options: Integer);
    39854660var
    3986   xs, ys, xl, yl: integer;
     4661  xs, ys, xl, yl: Integer;
    39874662begin
    39884663  with MainMap do begin
     
    39934668    while abs(2 * (xs + G.lx * (xxt * 2)) + xl - MapWidth) <
    39944669      abs(2 * xs + xl - MapWidth) do
    3995         inc(xs, G.lx * (xxt * 2));
     4670        Inc(xs, G.lx * (xxt * 2));
    39964671    ys := (y0 - yw) * yyt - yyt;
    39974672    if xs + xl > MapWidth then
     
    40004675      yl := MapHeight - ys;
    40014676    if (xl <= 0) or (yl <= 0) then
    4002       exit;
     4677      Exit;
    40034678    if Options and prPaint <> 0 then begin
    40044679      if Options and prAutoBounds <> 0 then
     
    40124687end;
    40134688
    4014 procedure TMainScreen.PaintLoc(Loc: integer; Radius: integer = 0);
     4689procedure TMainScreen.PaintLoc(Loc: Integer; Radius: Integer = 0);
    40154690var
    4016   yLoc, x0: integer;
     4691  yLoc, x0: Integer;
    40174692begin
    40184693  if MapValid then begin
    40194694    yLoc := (Loc + G.lx * 1024) div G.lx - 1024;
    40204695    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]);
    40224697    ProcessRect(x0, yLoc - 2 * Radius, 4 * Radius + 1, 4 * Radius + 1,
    40234698      prPaint or prAutoBounds or prInvalidate);
     
    40264701end;
    40274702
    4028 procedure TMainScreen.PaintLocTemp(Loc: integer; Style: TPaintLocTempStyle);
     4703procedure TMainScreen.PaintLocTemp(Loc: Integer; Style: TPaintLocTempStyle);
    40294704var
    4030   y0, x0, xMap, yMap: integer;
     4705  y0, x0, xMap, yMap: Integer;
    40314706begin
    40324707  with NoMap do begin
    40334708    if not MapValid then
    4034       exit;
     4709      Exit;
    40354710    Buffer.Canvas.Font.Assign(UniFont[ftSmall]);
    40364711    y0 := Loc div G.lx;
     
    40404715    while abs(2 * (xMap + G.lx * (xxt * 2)) + 2 * xxt - MapWidth) <
    40414716      abs(2 * xMap + 2 * xxt - MapWidth) do
    4042       inc(xMap, G.lx * (xxt * 2));
     4717      Inc(xMap, G.lx * (xxt * 2));
    40434718    yMap := (y0 - yw) * yyt - yyt;
    40444719    NoMap.SetOutput(Buffer);
     
    40524727// panel protusions are added
    40534728// NoMap must be set to buffer and bounds before
    4054 procedure TMainScreen.PaintBufferToScreen(xMap, yMap, width, height: integer);
     4729procedure TMainScreen.PaintBufferToScreen(xMap, yMap, width, height: Integer);
    40554730begin
    40564731  if xMap + width > MapWidth then
     
    40604735  if (width <= 0) or (height <= 0) or (width + xMap <= 0) or (height + yMap <= 0)
    40614736  then
    4062     exit;
     4737    Exit;
    40634738
    40644739  NoMap.BitBltBitmap(Panel, -xMap - MapOffset, -yMap + MapHeight - overlap, xMidPanel,
     
    40704745  begin
    40714746    if xMap < 0 then
    4072       DpiBitCanvas(Canvas, MapOffset, TopBarHeight, width + xMap,
     4747      DpiBitBltCanvas(Canvas, MapOffset, TopBarHeight, width + xMap,
    40734748        height + yMap, Buffer.Canvas, -xMap, -yMap)
    40744749    else
    4075       DpiBitCanvas(Canvas, xMap + MapOffset, TopBarHeight, width,
     4750      DpiBitBltCanvas(Canvas, xMap + MapOffset, TopBarHeight, width,
    40764751        height + yMap, Buffer.Canvas, 0, -yMap);
    40774752  end
     
    40794754  begin
    40804755    if xMap < 0 then
    4081       DpiBitCanvas(Canvas, MapOffset, TopBarHeight + yMap, width + xMap,
     4756      DpiBitBltCanvas(Canvas, MapOffset, TopBarHeight + yMap, width + xMap,
    40824757        height, Buffer.Canvas, -xMap, 0)
    40834758    else
    4084       DpiBitCanvas(Canvas, xMap + MapOffset, TopBarHeight + yMap, width,
     4759      DpiBitBltCanvas(Canvas, xMap + MapOffset, TopBarHeight + yMap, width,
    40854760        height, Buffer.Canvas, 0, 0);
    40864761  end;
    40874762end;
    40884763
    4089 procedure TMainScreen.PaintLoc_BeforeMove(FromLoc: integer);
     4764procedure TMainScreen.PaintLoc_BeforeMove(FromLoc: Integer);
    40904765var
    4091   yLoc, x0: integer;
     4766  yLoc, x0: Integer;
    40924767begin
    40934768  if MapValid then
     
    40954770    yLoc := (FromLoc + G.lx * 1024) div G.lx - 1024;
    40964771    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]);
    40984773    ProcessRect(x0, yLoc, 1, 1, prPaint or prAutoBounds);
    40994774  end
     
    41024777procedure TMainScreen.PaintDestination;
    41034778var
    4104   Destination: integer;
     4779  Destination: Integer;
    41054780begin
    41064781  if (UnFocus >= 0) and (MyUn[UnFocus].Status and usGoto <> 0) then
     
    41124787end;
    41134788
    4114 {$IFDEF LINUX}
     4789{$IFDEF UNIX}
    41154790// Can't do scrolling of DC under Linux, then fallback into BitBlt.
    41164791function DpiScrollDC(Canvas: TDpiCanvas; dx: longint; dy: longint; const lprcScroll:TRect; const lprcClip:TRect; hrgnUpdate:HRGN; lprcUpdate: PRect):Boolean;
    41174792begin
    4118   Result := DpiBitCanvas(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,
    41194794    Canvas, lprcScroll.Left, lprcScroll.Top);
    41204795end;
     
    41234798procedure TMainScreen.MainOffscreenPaint;
    41244799var
    4125   ProcessOptions: integer;
     4800  ProcessOptions: Integer;
    41264801  rec: TRect;
    4127   DoInvalidate: boolean;
    4128 begin
    4129   if me < 0 then
    4130     with offscreen.Canvas do
     4802  DoInvalidate: Boolean;
     4803begin
     4804  if Me < 0 then
     4805    with Offscreen.Canvas do
    41314806    begin
    41324807      Brush.Color := $000000;
     
    41344809      Brush.Style := bsClear;
    41354810      OffscreenUser := self;
    4136       exit;
     4811      Exit;
    41374812    end;
    41384813
     
    41454820    if MapValid and (xwd = xw) and (ywd = yw) then
    41464821      MainMap.SetPaintBounds(0, 0, UsedOffscreenWidth, UsedOffscreenHeight);
    4147     MapValid := false;
     4822    MapValid := False;
    41484823    OffscreenUser := self;
    41494824  end;
     
    41584833      (ywd - yw > MapHeight div yyt) then
    41594834    begin
    4160       offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
     4835      Offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
    41614836      ProcessRect(xw, yw, MapWidth div xxt, MapHeight div yyt,
    41624837        prPaint or prInvalidate);
    41634838    end else begin
    41644839      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]);
    41674842      rec := Rect(0, 0, MapWidth, MapHeight);
    41684843{$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,
    41704845        rec, rec, 0, nil);
    41714846{$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,
    41744849        rec, rec, 0, nil);
    41754850{$ENDIF}
    4176       for DoInvalidate := false to FastScrolling do begin
     4851      for DoInvalidate := False to FastScrolling do begin
    41774852        if DoInvalidate then begin
    41784853          rec.Bottom := MapHeight - overlap;
    41794854{$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,
    41814856            rec, 0, nil);
    41824857{$ENDIF}
    4183 {$IFDEF LINUX}
     4858{$IFDEF UNIX}
    41844859          DpiScrollDC(Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
    41854860            rec, rec, 0, nil);
     
    42314906  xwd := xw;
    42324907  ywd := yw;
    4233   MapValid := true;
     4908  MapValid := True;
    42344909end;
    42354910
     
    42644939begin
    42654940  with MainMap do begin
    4266     DpiBitCanvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly,
     4941    DpiBitBltCanvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly,
    42674942      MiniMap.Bitmap.Canvas, 0, 0);
    42684943    if MarkCityLoc >= 0 then
     
    42884963  function MovementToString(var Un: TUn): string;
    42894964  begin
    4290     result := ScreenTools.MovementToString(Un.Movement);
     4965    Result := ScreenTools.MovementToString(Un.Movement);
    42914966    if Un.Master >= 0 then
    4292       result := '(' + result + ')'
     4967      Result := '(' + Result + ')'
    42934968    else if (MyModel[Un.mix].Domain = dAir) and
    42944969      (MyModel[Un.mix].Kind <> mkSpecial_Glider) then
    4295       result := Format('%s(%d)', [result, Un.Fuel]);
     4970      Result := Format('%s(%d)', [Result, Un.Fuel]);
    42964971  end;
    42974972
    42984973var
    4299   i, uix, uixDefender, x, xSrc, ySrc, xSrcBase, ySrcBase, CostFactor, Count,
     4974  I, uix, uixDefender, X, xSrc, ySrc, xSrcBase, ySrcBase, CostFactor, Count,
    43004975    mixShow, xTreasurySection, xResearchSection, JobFocus, TrueMoney,
    4301     TrueResearch: integer;
     4976    TrueResearch: Integer;
    43024977  Tile: Cardinal;
    4303   s: string;
     4978  S: string;
    43044979  unx: TUn;
    43054980  UnitInfo: TUnitInfo;
    43064981  JobProgressData: TJobProgressData;
    4307   Prio: boolean;
     4982  Prio: Boolean;
    43084983begin
    43094984  if not Assigned(MyRO) then Exit;
     
    43495024    if ClientMode <> cEditMap then
    43505025    begin
    4351       if supervising then
     5026      if Supervising then
    43525027      begin
    43535028        ScreenTools.Frame(Panel.Canvas, ClientWidth - xPalace - 1, yPalace - 1,
     
    43575032          ClientWidth - xPalace + xSizeBig + 1, yPalace + ySizeBig + 1,
    43585033          $FFFFFF, $B0B0B0);
    4359         DpiBitCanvas(Panel.Canvas, ClientWidth - xPalace, yPalace, xSizeBig,
     5034        DpiBitBltCanvas(Panel.Canvas, ClientWidth - xPalace, yPalace, xSizeBig,
    43605035          ySizeBig, HGrSystem2.Data.Canvas, 70, 123);
    43615036      end
     
    43825057    CopyMiniToPanel;
    43835058    if ClientMode <> cEditMap then // MapBtn icons
    4384       for i := 0 to 5 do
    4385         if i <> 3 then
    4386           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);
    43885063
    43895064    if ClientMode = cEditMap then
    43905065    begin
    4391       for i := 0 to TrRow - 1 do
    4392         trix[i] := -1;
     5066      for I := 0 to TrRow - 1 do
     5067        trix[I] := -1;
    43935068      Count := 0;
    4394       for i := 0 to nBrushTypes - 1 do
     5069      for I := 0 to nBrushTypes - 1 do
    43955070      begin // display terrain types
    43965071        if (Count >= TrRow * sb.Position) and (Count < TrRow * (sb.Position + 1))
    43975072        then
    43985073        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;
    44015076          xSrcBase := -1;
    4402           case BrushTypes[i] of
     5077          case BrushTypes[I] of
    44035078            0 .. 8:
    44045079              begin
    4405                 xSrc := BrushTypes[i];
     5080                xSrc := BrushTypes[I];
    44065081                ySrc := 0
    44075082              end;
     
    44115086                ySrcBase := 2;
    44125087                xSrc := 0;
    4413                 ySrc := 2 * integer(BrushTypes[i]) - 15
     5088                ySrc := 2 * Integer(BrushTypes[I]) - 15
    44145089              end;
    44155090            fRiver:
     
    44445119                ySrcBase := 2;
    44455120                xSrc := 8;
    4446                 ySrc := 12 + BrushTypes[i] shr 25;
     5121                ySrc := 12 + BrushTypes[I] shr 25;
    44475122              end;
    44485123            tiIrrigation, tiFarm, tiMine, tiBase:
    44495124              begin
    4450                 xSrc := BrushTypes[i] shr 12 - 1;
     5125                xSrc := BrushTypes[I] shr 12 - 1;
    44515126                ySrc := 12
    44525127              end;
     
    44715146          with MainMap do begin
    44725147            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,
    44745149                yyt * 3, 1 + xSrcBase * (xxt * 2 + 1),
    44755150                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,
    44775152              yyt * 3, 1 + xSrc * (xxt * 2 + 1), 1 + ySrc * (yyt * 3 + 1));
    4478             if BrushTypes[i] = BrushType then begin
    4479               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,
    44815156                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,
    44845159                yTroop + 2 * yyt + 10, MainTexture.ColorMark, MainTexture.ColorMark);
    44855160            end;
    44865161          end;
    44875162        end;
    4488         inc(Count)
     5163        Inc(Count)
    44895164      end;
    44905165      case BrushType of
    44915166        fDesert, fPrairie, fTundra, fArctic, fSwamp, fHills, fMountains:
    4492           s := Phrases.Lookup('TERRAIN', BrushType);
     5167          S := Phrases.Lookup('TERRAIN', BrushType);
    44935168        fShore:
    4494           s := Format(Phrases.Lookup('TWOTERRAINS'),
     5169          S := Format(Phrases.Lookup('TWOTERRAINS'),
    44955170            [Phrases.Lookup('TERRAIN', fOcean), Phrases.Lookup('TERRAIN',
    44965171            fShore)]);
    44975172        fGrass:
    4498           s := Format(Phrases.Lookup('TWOTERRAINS'),
     5173          S := Format(Phrases.Lookup('TWOTERRAINS'),
    44995174            [Phrases.Lookup('TERRAIN', fGrass), Phrases.Lookup('TERRAIN',
    45005175            fGrass + 12)]);
    45015176        fForest:
    4502           s := Format(Phrases.Lookup('TWOTERRAINS'),
     5177          S := Format(Phrases.Lookup('TWOTERRAINS'),
    45035178            [Phrases.Lookup('TERRAIN', fForest), Phrases.Lookup('TERRAIN',
    45045179            fJungle)]);
    45055180        fRiver:
    4506           s := Phrases.Lookup('RIVER');
     5181          S := Phrases.Lookup('RIVER');
    45075182        fDeadLands, fDeadLands or fCobalt, fDeadLands or fUranium,
    45085183          fDeadLands or fMercury:
    4509           s := Phrases.Lookup('TERRAIN', 3 * 12 + BrushType shr 25);
     5184          S := Phrases.Lookup('TERRAIN', 3 * 12 + BrushType shr 25);
    45105185        fPrefStartPos:
    4511           s := Phrases.Lookup('MAP_PREFSTART');
     5186          S := Phrases.Lookup('MAP_PREFSTART');
    45125187        fStartPos:
    4513           s := Phrases.Lookup('MAP_START');
     5188          S := Phrases.Lookup('MAP_START');
    45145189        fPoll:
    4515           s := Phrases.Lookup('POLL');
     5190          S := Phrases.Lookup('POLL');
    45165191      else // terrain improvements
    45175192        begin
    45185193          case BrushType of
    45195194            fRoad:
    4520               i := 1;
     5195              I := 1;
    45215196            fRR:
    4522               i := 2;
     5197              I := 2;
    45235198            tiIrrigation:
    4524               i := 4;
     5199              I := 4;
    45255200            tiFarm:
    4526               i := 5;
     5201              I := 5;
    45275202            tiMine:
    4528               i := 7;
     5203              I := 7;
    45295204            fCanal:
    4530               i := 8;
     5205              I := 8;
    45315206            tiFort:
    4532               i := 10;
     5207              I := 10;
    45335208            tiBase:
    4534               i := 12;
     5209              I := 12;
    45355210          end;
    4536           s := Phrases.Lookup('JOBRESULT', i);
     5211          S := Phrases.Lookup('JOBRESULT', I);
    45375212        end
    45385213      end;
    45395214      LoweredTextOut(Panel.Canvas, -1, MainTexture, xTroop + 1,
    4540         PanelHeight - 19, s);
     5215        PanelHeight - 19, S);
    45415216    end
    45425217    else if TroopLoc >= 0 then
     
    45445219      Brush.Style := bsClear;
    45455220      if UnFocus >= 0 then
    4546         with MyUn[UnFocus] do
    4547         with MyModel[mix] do
     5221        with MyUn^[UnFocus] do
     5222        with MyModel^[mix] do
    45485223        begin { display info about selected unit }
    45495224          if Job = jCity then
     
    45515226          else
    45525227            mixShow := mix;
    4553           with Tribe[me].ModelPicture[mixShow] do
     5228          with Tribe[Me].ModelPicture[mixShow] do
    45545229          begin
    45555230            Sprite(Panel, HGr, xMidPanel + 7 + 12, yTroop + 1, 64, 48,
     
    45615236
    45625237          MakeBlue(Panel, xMidPanel + 7 + 12 + 10, yTroop - 13, 44, 12);
    4563           s := MovementToString(MyUn[UnFocus]);
     5238          S := MovementToString(MyUn[UnFocus]);
    45645239          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) + '%';
    45685243          LightGradient(Panel.Canvas, xMidPanel + 7 + 12 + 7, PanelHeight - 22,
    45695244            (Health + 1) div 2, (ColorOfHealth(Health) and $FEFEFE shr 2) * 3);
     
    45725247              div 2, PanelHeight - 22, 50 - (Health + 1) div 2, $000000);
    45735248          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);
    45755250
    45765251          FrameImage(Panel.Canvas, HGrSystem.Data,
     
    45785253            121 + Exp div ExpCost * 13, 28);
    45795254          if Job = jCity then
    4580             s := Tribe[me].ModelName[-1]
     5255            S := Tribe[Me].ModelName[-1]
    45815256          else
    4582             s := Tribe[me].ModelName[mix];
     5257            S := Tribe[Me].ModelName[mix];
    45835258          if Home >= 0 then
    45845259          begin
    45855260            LoweredTextOut(Panel.Canvas, -1, MainTexture,
    4586               xMidPanel + 7 + xUnitText + 18, yTroop + 5, s);
     5261              xMidPanel + 7 + xUnitText + 18, yTroop + 5, S);
    45875262            LoweredTextOut(Panel.Canvas, -1, MainTexture,
    45885263              xMidPanel + 7 + xUnitText + 18, yTroop + 21,
     
    45915266          else
    45925267            LoweredTextOut(Panel.Canvas, -1, MainTexture,
    4593               xMidPanel + 7 + xUnitText + 18, yTroop + 13, s);
     5268              xMidPanel + 7 + xUnitText + 18, yTroop + 13, S);
    45945269        end;
    45955270
    45965271      if (UnFocus >= 0) and (MyUn[UnFocus].Loc <> TroopLoc) then
    45975272      begin // divide panel
    4598         if SmallScreen and not supervising then
    4599           x := xTroop - 8
     5273        if SmallScreen and not Supervising then
     5274          X := xTroop - 8
    46005275        else
    4601           x := xTroop - 152;
     5276          X := xTroop - 152;
    46025277        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);
    46055280        Pen.Color := MainTexture.ColorBevelLight;
    4606         MoveTo(x, PanelHeight - MidPanelHeight + 2);
    4607         LineTo(x, PanelHeight);
    4608       end;
    4609 
    4610       for i := 0 to 23 do
    4611         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;
    46125287      if MyMap[TroopLoc] and fUnit <> 0 then
    46135288      begin
     
    46195294            LoweredTextOut(Panel.Canvas, -1, MainTexture, xTroop + 10,
    46205295              PanelHeight - 24, Phrases.Lookup('PRESENT'));
    4621             Server(sGetDefender, me, TroopLoc, uixDefender);
     5296            Server(sGetDefender, Me, TroopLoc, uixDefender);
    46225297            Count := 0;
    4623             for Prio := true downto false do
     5298            for Prio := True downto False do
    46245299              for uix := 0 to MyRO.nUn - 1 do
    46255300                if (uix = uixDefender) = Prio then
     
    46325307                    begin
    46335308                      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;
    46365311                      if uix = UnFocus then
    46375312                      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,
    46405315                          $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,
    46435318                          MainTexture.ColorMark, MainTexture.ColorMark);
    46445319                      end
    46455320                      else if (unx.Master >= 0) and (unx.Master = UnFocus) then
    46465321                      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);
    46515326                      end;
    46525327                      NoMapPanel.SetOutput(Panel);
    4653                       NoMapPanel.PaintUnit(xTroop + 2 + x, yTroop + 1, UnitInfo,
     5328                      NoMapPanel.PaintUnit(xTroop + 2 + X, yTroop + 1, UnitInfo,
    46545329                        unx.Status);
    46555330                      if (ClientMode < scContact) and
     
    46575332                        (unx.Status and (usStay or usRecover or usGoto) <> 0))
    46585333                      then
    4659                         Sprite(Panel, HGrSystem, xTroop + 2 + 60 - 20 + x,
     5334                        Sprite(Panel, HGrSystem, xTroop + 2 + 60 - 20 + X,
    46605335                          yTroop + 35, 20, 20, 81, 25);
    46615336
    4662                       if not supervising then
     5337                      if not Supervising then
    46635338                      begin
    4664                         MakeBlue(Panel, xTroop + 2 + 10 + x,
     5339                        MakeBlue(Panel, xTroop + 2 + 10 + X,
    46655340                          yTroop - 13, 44, 12);
    4666                         s := MovementToString(unx);
     5341                        S := MovementToString(unx);
    46675342                        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);
    46705345                      end;
    46715346                    end;
    4672                     inc(Count)
     5347                    Inc(Count)
    46735348                  end;
    46745349                end; // for uix:=0 to MyRO.nUn-1
    4675             assert(Count = TrCnt);
     5350            Assert(Count = TrCnt);
    46765351          end;
    46775352        end
     
    46805355          LoweredTextOut(Panel.Canvas, -1, MainTexture, xTroop + 8,
    46815356            PanelHeight - 24, Phrases.Lookup('PRESENT'));
    4682           Server(sGetUnits, me, TroopLoc, Count);
    4683           for i := 0 to Count - 1 do
    4684             if (i >= TrRow * sb.Position) and (i < TrRow * (sb.Position + 1)) then
     5357          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
    46855360            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;
    46885363              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);
    46915366            end;
    46925367        end;
    46935368      end;
    4694       if not SmallScreen or supervising then
     5369      if not SmallScreen or Supervising then
    46955370      begin // show terrain and improvements
    46965371        with NoMapPanel do
     
    46985373        if (UnFocus >= 0) and (MyUn[UnFocus].Job <> jNone) then begin
    46995374          JobFocus := MyUn[UnFocus].Job;
    4700           Server(sGetJobProgress, me, MyUn[UnFocus].Loc, JobProgressData);
     5375          Server(sGetJobProgress, Me, MyUn[UnFocus].Loc, JobProgressData);
    47015376          MakeBlue(Panel, xTerrain - 72, 148 - 17, 144, 31);
    47025377          PaintRelativeProgressBar(Panel.Canvas, 3, xTerrain - 68, 148 + 3, 63,
    47035378            JobProgressData[JobFocus].Done,
    47045379            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',
    47075382            [ScreenTools.MovementToString(JobProgressData[JobFocus].Done),
    47085383            ScreenTools.MovementToString(JobProgressData[JobFocus].Required)]);
    4709           RisedTextOut(Panel.Canvas, xTerrain + 6, 148 - 3, s);
     5384          RisedTextOut(Panel.Canvas, xTerrain + 6, 148 - 3, S);
    47105385          Tile := MyMap[MyUn[UnFocus].Loc];
    47115386          if (JobFocus = jRoad) and (Tile and fRiver <> 0) then
     
    47225397              JobFocus := nJob + 4
    47235398          end;
    4724           s := Phrases.Lookup('JOBRESULT', JobFocus);
     5399          S := Phrases.Lookup('JOBRESULT', JobFocus);
    47255400          RisedTextOut(Panel.Canvas, xTerrain - BiColorTextWidth(Panel.Canvas,
    4726             s) div 2, 148 - 19, s);
     5401            S) div 2, 148 - 19, S);
    47275402        end;
    47285403        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)
    47305405        else if MyMap[TroopLoc] and fDeadLands <> 0 then
    4731           s := Phrases.Lookup('TERRAIN', 3 * 12)
     5406          S := Phrases.Lookup('TERRAIN', 3 * 12)
    47325407        else if (MyMap[TroopLoc] and fTerrain = fForest) and
    47335408          IsJungle(TroopLoc div G.lx) then
    4734           s := Phrases.Lookup('TERRAIN', fJungle)
     5409          S := Phrases.Lookup('TERRAIN', fJungle)
    47355410        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);
    47395414      end;
    47405415
     
    47475422  end;
    47485423
    4749   for i := 0 to ControlCount - 1 do
    4750     if Controls[i] is TButtonB then
    4751       with TButtonB(Controls[i]) do
     5424  for I := 0 to ControlCount - 1 do
     5425    if Controls[I] is TButtonB then
     5426      with TButtonB(Controls[I]) do
    47525427      begin
    47535428        if Visible then
     
    47655440  if ClientMode <> cEditMap then
    47665441  begin
    4767     for i := 0 to ControlCount - 1 do
    4768       if Controls[i] is TButtonC then
    4769         with TButtonC(Controls[i]) do
     5442    for I := 0 to ControlCount - 1 do
     5443      if Controls[I] is TButtonC then
     5444        with TButtonC(Controls[I]) do
    47705445        begin
    47715446          Dump(Panel, HGrSystem, Left, Top - self.ClientHeight + PanelHeight,
     
    48075482    TrueMoney := MyRO.Money;
    48085483    TrueResearch := MyRO.Research;
    4809     if supervising then
     5484    if Supervising then
    48105485    begin // normalize values from after-turn state
    4811       dec(TrueMoney, TaxSum);
     5486      Dec(TrueMoney, TaxSum);
    48125487      if TrueMoney < 0 then
    48135488        TrueMoney := 0; // shouldn't happen
    4814       dec(TrueResearch, ScienceSum);
     5489      Dec(TrueResearch, ScienceSum);
    48155490      if TrueResearch < 0 then
    48165491        TrueResearch := 0; // shouldn't happen
     
    48205495    ImageOp_BCC(TopBar, Templates.Data, Point(xTreasurySection + 8, 1), TreasuryIcon.BoundsRect,
    48215496      $40A040, $4030C0);
    4822     s := IntToStr(TrueMoney);
     5497    S := IntToStr(TrueMoney);
    48235498    LoweredTextOut(TopBar.Canvas, -1, MainTexture, xTreasurySection + 48, 0,
    4824       s + '%c');
     5499      S + '%c');
    48255500    if MyRO.Government <> gAnarchy then
    48265501    begin
     
    48285503        $0000C0, $0080C0);
    48295504      if TaxSum >= 0 then
    4830         s := Format(Phrases.Lookup('MONEYGAINPOS'), [TaxSum])
     5505        S := Format(Phrases.Lookup('MONEYGAINPOS'), [TaxSum])
    48315506      else
    4832         s := Format(Phrases.Lookup('MONEYGAINNEG'), [TaxSum]);
     5507        S := Format(Phrases.Lookup('MONEYGAINNEG'), [TaxSum]);
    48335508      LoweredTextOut(TopBar.Canvas, -1, MainTexture, xTreasurySection + 48 +
    4834         15, 18, s);
     5509        15, 18, S);
    48355510    end;
    48365511
     
    48525527      else
    48535528        CostFactor := 2;
    4854       Server(sGetTechCost, me, 0, i);
     5529      Server(sGetTechCost, Me, 0, I);
    48555530      CostFactor := CostFactor * 22; // length of progress bar
    48565531      PaintRelativeProgressBar(TopBar.Canvas, 2, xResearchSection + 48 + 1, 26,
    4857         CostFactor, TrueResearch, ScienceSum, i, true, MainTexture);
     5532        CostFactor, TrueResearch, ScienceSum, I, True, MainTexture);
    48585533
    48595534      if MyRO.ResearchTech < 0 then
    4860         s := Phrases.Lookup('SCIENCE')
     5535        S := Phrases.Lookup('SCIENCE')
    48615536      else if MyRO.ResearchTech = adMilitary then
    4862         s := Phrases.Lookup('INITUNIT')
     5537        S := Phrases.Lookup('INITUNIT')
    48635538      else
    48645539      begin
    4865         s := Phrases.Lookup('ADVANCES', MyRO.ResearchTech);
     5540        S := Phrases.Lookup('ADVANCES', MyRO.ResearchTech);
    48665541        if MyRO.ResearchTech in FutureTech then
    48675542          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)
    48695544          else
    4870             s := s + ' 1';
     5545            S := S + ' 1';
    48715546      end;
    48725547      if ScienceSum > 0 then
    48735548      begin
    48745549        { j:=(i-MyRO.Research-1) div ScienceSum +1;
    4875           if j<1 then j:=1;
    4876           if j>1 then
    4877           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]); }
    48785553        LoweredTextOut(TopBar.Canvas, -1, MainTexture,
    4879           xResearchSection + 48, 0, s);
     5554          xResearchSection + 48, 0, S);
    48805555      end
    48815556      else
    48825557        LoweredTextOut(TopBar.Canvas, -1, MainTexture,
    4883           xResearchSection + 48, 0, s);
     5558          xResearchSection + 48, 0, S);
    48845559    end
    48855560    else
     
    48895564      ImageOp_BCC(TopBar, Templates.Data, Point(xResearchSection + 48 + CostFactor + 11,
    48905565        22), ChangeIcon.BoundsRect, $0000C0, $0080C0);
    4891       s := Format(Phrases.Lookup('TECHGAIN'), [ScienceSum]);
     5566      S := Format(Phrases.Lookup('TECHGAIN'), [ScienceSum]);
    48925567      LoweredTextOut(TopBar.Canvas, -1, MainTexture, xResearchSection + 48 +
    4893         CostFactor + 26, 18, s);
     5568        CostFactor + 26, 18, S);
    48945569    end;
    48955570  end;
     
    48975572  begin
    48985573    TopBar.Canvas.Font.Assign(UniFont[ftCaption]);
    4899     s := TurnToString(MyRO.Turn);
     5574    S := TurnToString(MyRO.Turn);
    49005575    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);
    49035578    TopBar.Canvas.Font.Assign(UniFont[ftNormal]);
    49045579  end;
     
    49085583procedure TMainScreen.FocusNextUnit(Dir: Integer);
    49095584var
    4910   i, uix, NewFocus: Integer;
     5585  I, uix, NewFocus: Integer;
    49115586begin
    49125587  if ClientMode >= scContact then
     
    49155590  PaintDestination;
    49165591  NewFocus := -1;
    4917   for i := 1 to MyRO.nUn do begin
    4918     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;
    49195594    if (MyUn[uix].Loc >= 0) and (MyUn[uix].Status and usStay = 0) then begin
    49205595      NewFocus := uix;
     
    49295604end;
    49305605
    4931 procedure TMainScreen.FocusOnLoc(Loc: integer; Options: integer = 0);
     5606procedure TMainScreen.FocusOnLoc(Loc: Integer; Options: Integer = 0);
    49325607var
    4933   dx: integer;
    4934   Outside, Changed: boolean;
     5608  dx: Integer;
     5609  Outside, Changed: Boolean;
    49355610begin
    49365611  with MainMap do begin
     
    49405615      (Loc div G.lx >= yw + (MapHeight - 1) div yyt - 2));
    49415616  end;
    4942   Changed := true;
     5617  Changed := True;
    49435618  if Outside then begin
    49445619    Centre(Loc);
     
    49485623    PaintAllMaps
    49495624  else
    4950     Changed := false;
     5625    Changed := False;
    49515626  if Options and flRepaintPanel <> 0 then
    49525627    PanelPaint;
     
    49585633var
    49595634  Dist, TestDist: Single;
    4960   i, uix, NewFocus: Integer;
     5635  I, uix, NewFocus: Integer;
    49615636  GotoOnly: Boolean;
    49625637begin
     
    49685643  for GotoOnly := GoOnPhase downto False do begin
    49695644    NewFocus := -1;
    4970     for i := 1 to MyRO.nUn do begin
    4971       uix := (UnFocus + i) mod MyRO.nUn;
     5645    for I := 1 to MyRO.nUn do begin
     5646      uix := (UnFocus + I) mod MyRO.nUn;
    49725647      if (MyUn[uix].Loc >= 0) and (MyUn[uix].Job = jNone) and
    49735648        (MyUn[uix].Status and (usStay or usRecover or usWaiting) = usWaiting)
     
    50085683end;
    50095684
    5010 procedure TMainScreen.Scroll(dx, dy: integer);
     5685procedure TMainScreen.Scroll(dx, dy: Integer);
    50115686begin
    50125687  xw := (xw + G.lx + dx) mod G.lx;
     
    50325707procedure TMainScreen.Timer1Timer(Sender: TObject);
    50335708var
    5034   dx, dy, ScrollSpeed: integer;
    5035 begin
    5036   if idle and (me >= 0) and (GameMode <> cMovie) then
     5709  dx, dy, ScrollSpeed: Integer;
     5710begin
     5711  if Idle and (Me >= 0) and (GameMode <> cMovie) then
    50375712    if (fsModal in DpiScreen.ActiveForm.FormState) or
    50385713      (DpiScreen.ActiveForm is TBufferedDrawDlg) and
     
    50425717      if not BlinkON then
    50435718      begin
    5044         BlinkON := true;
     5719        BlinkON := True;
    50455720        if UnFocus >= 0 then
    50465721          PaintLocTemp(MyUn[UnFocus].Loc)
    5047         else if TurnComplete and not supervising then
     5722        else if TurnComplete and not Supervising then
    50485723          EOT.SetButtonIndexFast(eotBlinkOn);
    50495724      end;
     
    50575732        dx := 0;
    50585733        dy := 0;
    5059         if DpiMouse.CursorPos.y < DpiScreen.height - PanelHeight then
    5060           if DpiMouse.CursorPos.x = 0 then
     5734        if DpiMouse.CursorPos.Y < DpiScreen.height - PanelHeight then
     5735          if DpiMouse.CursorPos.X = 0 then
    50615736            dx := -ScrollSpeed // scroll left
    5062           else if DpiMouse.CursorPos.x = DpiScreen.width - 1 then
     5737          else if DpiMouse.CursorPos.X = DpiScreen.width - 1 then
    50635738            dx := ScrollSpeed; // scroll right
    5064         if DpiMouse.CursorPos.y = 0 then
     5739        if DpiMouse.CursorPos.Y = 0 then
    50655740          dy := -ScrollSpeed // scroll up
    5066         else if (DpiMouse.CursorPos.y = DpiScreen.height - 1) and
    5067           (DpiMouse.CursorPos.x >= TerrainBtn.Left + TerrainBtn.width) and
    5068           (DpiMouse.CursorPos.x < xRightPanel + 10 - 8) then
     5741        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
    50695744          dy := ScrollSpeed; // scroll down
    50705745        if (dx <> 0) or (dy <> 0) then
     
    50795754      BlinkTime := (BlinkTime + 1) mod (BlinkOnTime + BlinkOffTime);
    50805755      BlinkON := BlinkTime >= BlinkOffTime;
    5081       DestinationMarkON := true;
     5756      DestinationMarkON := True;
    50825757      if UnFocus >= 0 then
    50835758      begin
     
    50905765        end;
    50915766      end
    5092       else if TurnComplete and not supervising then
     5767      else if TurnComplete and not Supervising then
    50935768      begin
    50945769        if BlinkTime = 0 then
     
    51005775end;
    51015776
    5102 procedure TMainScreen.SetMapPos(Loc: integer; MapPos: TPoint);
     5777procedure TMainScreen.SetMapPos(Loc: Integer; MapPos: TPoint);
    51035778begin
    51045779  with MainMap do begin
     
    51185793end;
    51195794
    5120 procedure TMainScreen.Centre(Loc: integer);
     5795procedure TMainScreen.Centre(Loc: Integer);
    51215796begin
    51225797  SetMapPos(Loc, Point(MapWidth div 2, MapHeight div 2));
    51235798end;
    51245799
    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 then
     5800function TMainScreen.ZoomToCity(Loc: Integer; NextUnitOnClose: Boolean = False;
     5801  ShowEvent: Integer = 0): Boolean;
     5802begin
     5803  Result := MyMap[Loc] and (fOwned or fSpiedOut) <> 0;
     5804  if Result then
    51305805    with CityDlg do
    51315806    begin
     
    51535828end;
    51545829
    5155 function TMainScreen.LocationOfScreenPixel(x, y: integer): Integer;
     5830function TMainScreen.LocationOfScreenPixel(X, Y: Integer): Integer;
    51565831var
    5157   qx, qy: integer;
     5832  qx, qy: Integer;
    51585833begin
    51595834  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)
    51625837      div (xxt * yyt * 4) - 999;
    51635838    Result := (xw + (qx - qy + 2048) div 2 - 1024 + G.lx) mod G.lx + G.lx *
     
    51735848
    51745849procedure TMainScreen.MapBoxMouseDown(Sender: TObject; Button: TMouseButton;
    5175   Shift: TShiftState; x, y: integer);
     5850  Shift: TShiftState; X, Y: Integer);
    51765851var
    5177   i, uix, emix, p1, dx, dy, MouseLoc: integer;
     5852  I, uix, emix, p1, dx, dy, MouseLoc: Integer;
    51785853  EditTileData: TEditTileData;
    5179   m, m2: TDpiMenuItem;
     5854  M, m2: TDpiMenuItem;
    51805855  MoveAdviceData: TMoveAdviceData;
    5181   DoCenter: boolean;
     5856  DoCenter: Boolean;
    51825857begin
    51835858  if GameMode = cMovie then
    5184     exit;
    5185 
    5186   if CityDlg.Visible then
     5859    Exit;
     5860
     5861  if Assigned(FCityDlg) and CityDlg.Visible then
    51875862    CityDlg.Close;
    5188   if UnitStatDlg.Visible then
     5863  if Assigned(FUnitStatDlg) and UnitStatDlg.Visible then
    51895864    UnitStatDlg.Close;
    5190   MouseLoc := LocationOfScreenPixel(x, y);
     5865  MouseLoc := LocationOfScreenPixel(X, Y);
    51915866  if (MouseLoc < 0) or (MouseLoc >= G.lx * G.ly) then
    5192     exit;
     5867    Exit;
    51935868  if (Button = mbLeft) and not(ssShift in Shift) then
    51945869  begin
    5195     DoCenter := true;
     5870    DoCenter := True;
    51965871    if ClientMode = cEditMap then
    51975872    begin
    5198       DoCenter := false;
     5873      DoCenter := False;
    51995874      EditTileData.Loc := MouseLoc;
    52005875      if ssCtrl in Shift then // toggle special resource
     
    52345909      else
    52355910        EditTileData.NewTile := MyMap[MouseLoc] xor BrushType;
    5236       Server(sEditTile, me, 0, EditTileData);
    5237       Edited := true;
     5911      Server(sEditTile, Me, 0, EditTileData);
     5912      Edited := True;
    52385913      BrushLoc := MouseLoc;
    52395914      PaintLoc(MouseLoc, 2);
    52405915      MiniMapPaint;
    5241       DpiBitCanvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly,
     5916      DpiBitBltCanvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly,
    52425917        MiniMap.Bitmap.Canvas, 0, 0);
    52435918      with MainMap do begin
     
    52615936      begin
    52625937        ZoomToCity(MouseLoc);
    5263         DoCenter := false;
     5938        DoCenter := False;
    52645939      end
    52655940      else
    52665941      begin
    52675942        UnitStatDlg.ShowNewContent_EnemyCity(wmPersistent, MouseLoc);
    5268         DoCenter := false;
     5943        DoCenter := False;
    52695944      end;
    52705945    end
     
    52725947      if MyMap[MouseLoc] and fOwned <> 0 then
    52735948      begin
    5274         DoCenter := false;
    5275         if not supervising and (ClientMode < scContact) then
     5949        DoCenter := False;
     5950        if not Supervising and (ClientMode < scContact) then
    52765951        begin // not in negotiation mode
    52775952          if (UnFocus >= 0) and (MyUn[UnFocus].Loc = MouseLoc) then
    52785953          begin // rotate
    52795954            uix := (UnFocus + 1) mod MyRO.nUn;
    5280             i := MyRO.nUn - 1;
    5281             while i > 0 do
     5955            I := MyRO.nUn - 1;
     5956            while I > 0 do
    52825957            begin
    52835958              if (MyUn[uix].Loc = MouseLoc) and (MyUn[uix].Job = jNone) and
     
    52855960                usWaiting) = usWaiting) then
    52865961                Break;
    5287               dec(i);
     5962              Dec(I);
    52885963              uix := (uix + 1) mod MyRO.nUn;
    52895964            end;
    5290             if i = 0 then
     5965            if I = 0 then
    52915966              uix := UnFocus;
    52925967          end
    52935968          else
    5294             Server(sGetDefender, me, MouseLoc, uix);
     5969            Server(sGetDefender, Me, MouseLoc, uix);
    52955970          if uix <> UnFocus then
    52965971            SetUnFocus(uix);
    5297           TurnComplete := false;
     5972          TurnComplete := False;
    52985973          EOT.ButtonIndex := eotGray;
    52995974        end;
     
    53035978      else if (MyMap[MouseLoc] and fSpiedOut <> 0) and not(ssCtrl in Shift) then
    53045979      begin
    5305         DoCenter := false;
     5980        DoCenter := False;
    53065981        SetTroopLoc(MouseLoc);
    53075982        PanelPaint;
     
    53095984      else
    53105985      begin
    5311         DoCenter := false;
     5986        DoCenter := False;
    53125987        UnitStatDlg.ShowNewContent_EnemyLoc(wmPersistent, MouseLoc);
    53135988      end;
     
    53215996    not(ssShift in Shift) then
    53225997  begin
    5323     if supervising then
     5998    if Supervising then
    53245999    begin
    53256000      EditLoc := MouseLoc;
    5326       Server(sGetModels, me, 0, nil^);
     6001      Server(sGetModels, Me, 0, nil^);
    53276002      EmptyMenu(mCreateUnit);
    53286003      for p1 := 0 to nPl - 1 do
    53296004        if 1 shl p1 and MyRO.Alive <> 0 then
    53306005        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');
    53336008          for emix := MyRO.nEnemyModel - 1 downto 0 do
    53346009            if (MyRO.EnemyModel[emix].Owner = p1) and
    5335               (Server(sCreateUnit - sExecute + p1 shl 4, me,
     6010              (Server(sCreateUnit - sExecute + p1 shl 4, Me,
    53366011              MyRO.EnemyModel[emix].mix, MouseLoc) >= rExecuted) then
    53376012            begin
    53386013              if not Assigned(Tribe[p1].ModelPicture[MyRO.EnemyModel[emix].mix].HGr) then
    53396014                InitEnemyModel(emix);
    5340               m2 := TDpiMenuItem.Create(m);
     6015              m2 := TDpiMenuItem.Create(M);
    53416016              m2.Caption := Tribe[p1].ModelName[MyRO.EnemyModel[emix].mix];
    53426017              m2.Tag := p1 shl 16 + MyRO.EnemyModel[emix].mix;
    53436018              m2.OnClick := CreateUnitClick;
    5344               m.Add(m2);
     6019              M.Add(m2);
    53456020            end;
    5346           m.Visible := m.Count > 0;
    5347           mCreateUnit.Add(m);
     6021          M.Visible := M.Count > 0;
     6022          mCreateUnit.Add(M);
    53486023        end;
    53496024      if FullScreen then
    5350         EditPopup.Popup(Left + x, Top + y)
     6025        EditPopup.Popup(Left + X, Top + Y)
    53516026      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);
    53546029    end
    53556030    else if (UnFocus >= 0) and (MyUn[UnFocus].Loc <> MouseLoc) then
     
    53626037        if abs(dx) + abs(dy) < 3 then
    53636038        begin
    5364           DestinationMarkON := false;
     6039          DestinationMarkON := False;
    53656040          PaintDestination;
    53666041          Status := Status and ($FFFF - usStay - usRecover - usGoto - usEnhance)
     
    53756050            with MyUn[UnFocus], BattleDlg.Forecast do
    53766051            begin
    5377               pAtt := me;
     6052              pAtt := Me;
    53786053              mixAtt := mix;
    53796054              HealthAtt := Health;
     
    53826057            end;
    53836058            BattleDlg.Forecast.Movement := MyUn[UnFocus].Movement;
    5384             if (Server(sGetBattleForecastEx, me, MouseLoc, BattleDlg.Forecast)
     6059            if (Server(sGetBattleForecastEx, Me, MouseLoc, BattleDlg.Forecast)
    53856060              >= rExecuted) and (BattleDlg.Forecast.EndHealthAtt <= 0) then
    53866061            begin
    53876062              BattleDlg.uix := UnFocus;
    53886063              BattleDlg.ToLoc := MouseLoc;
    5389               BattleDlg.IsSuicideQuery := true;
     6064              BattleDlg.IsSuicideQuery := True;
    53906065              BattleDlg.ShowModal;
    53916066              if BattleDlg.ModalResult <> mrOK then
    5392                 exit;
     6067                Exit;
    53936068            end;
    53946069          end;
    5395           DestinationMarkON := false;
     6070          DestinationMarkON := False;
    53966071          PaintDestination;
    53976072          Status := Status and not(usStay or usRecover or usEnhance) or
    53986073            usWaiting;
    5399           MoveToLoc(MouseLoc, false); { goto }
     6074          MoveToLoc(MouseLoc, False); { goto }
    54006075        end;
    54016076      end;
     
    54046079    (MyModel[MyUn[UnFocus].mix].Kind in [mkSettler, mkSlaves]) then
    54056080  begin
    5406     DestinationMarkON := false;
     6081    DestinationMarkON := False;
    54076082    PaintDestination;
    54086083    MyUn[UnFocus].Status := MyUn[UnFocus].Status and
     
    54106085    uix := UnFocus;
    54116086    if MouseLoc <> MyUn[uix].Loc then
    5412       MoveToLoc(MouseLoc, true); { goto }
     6087      MoveToLoc(MouseLoc, True); { goto }
    54136088    if (UnFocus = uix) and (MyUn[uix].Loc = MouseLoc) then
    5414       MenuClick(mEnhance);
     6089      mEnhance.Click;
    54156090  end
    54166091  else if (Button = mbLeft) and (ssShift in Shift) and
     
    54236098    with MyUn[UnFocus], BattleDlg.Forecast do
    54246099    begin
    5425       pAtt := me;
     6100      pAtt := Me;
    54266101      mixAtt := mix;
    54276102      HealthAtt := Health;
     
    54306105    end;
    54316106    BattleDlg.Forecast.Movement := MyUn[UnFocus].Movement;
    5432     if Server(sGetBattleForecastEx, me, MouseLoc, BattleDlg.Forecast) >= rExecuted
     6107    if Server(sGetBattleForecastEx, Me, MouseLoc, BattleDlg.Forecast) >= rExecuted
    54336108    then
    54346109    begin
    54356110      BattleDlg.uix := UnFocus;
    54366111      BattleDlg.ToLoc := MouseLoc;
    5437       BattleDlg.Left := x - BattleDlg.width div 2;
     6112      BattleDlg.Left := X - BattleDlg.width div 2;
    54386113      if BattleDlg.Left < 0 then
    54396114        BattleDlg.Left := 0
    54406115      else if BattleDlg.Left + BattleDlg.width > DpiScreen.width then
    54416116        BattleDlg.Left := DpiScreen.width - BattleDlg.width;
    5442       BattleDlg.Top := y - BattleDlg.height div 2;
     6117      BattleDlg.Top := Y - BattleDlg.height div 2;
    54436118      if BattleDlg.Top < 0 then
    54446119        BattleDlg.Top := 0
    54456120      else if BattleDlg.Top + BattleDlg.height > DpiScreen.height then
    54466121        BattleDlg.Top := DpiScreen.height - BattleDlg.height;
    5447       BattleDlg.IsSuicideQuery := false;
     6122      BattleDlg.IsSuicideQuery := False;
    54486123      BattleDlg.Show;
    54496124    end;
     
    54516126end;
    54526127
    5453 function TMainScreen.MoveUnit(dx, dy: integer; Options: integer): integer;
     6128function TMainScreen.MoveUnit(dx, dy: Integer; Options: Integer): Integer;
    54546129// move focused unit to adjacent tile
    54556130var
    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;
    54586133  OldToTile: Cardinal;
    54596134  CityCaptured, IsAttack, OldUnrest, NewUnrest, NeedEcoUpdate, NeedRepaintPanel,
    5460     ToTransport, ToShip: boolean;
     6135    ToTransport, ToShip: Boolean;
    54616136  PlaneReturnData: TPlaneReturnData;
    54626137  QueryItem: string;
    54636138begin
    5464   result := eInvalid;
     6139  Result := eInvalid;
    54656140  UnFocus0 := UnFocus;
    54666141  FromLoc := MyUn[UnFocus].Loc;
     
    54686143  if (ToLoc < 0) or (ToLoc >= G.lx * G.ly) then
    54696144  begin
    5470     result := eInvalid;
    5471     exit;
     6145    Result := eInvalid;
     6146    Exit;
    54726147  end;
    54736148  if MyMap[ToLoc] and fStealthUnit <> 0 then
    54746149  begin
    54756150    SoundMessage(Phrases.Lookup('ATTACKSTEALTH'), '');
    5476     exit;
     6151    Exit;
    54776152  end;
    54786153  if MyMap[ToLoc] and fHiddenUnit <> 0 then
    54796154  begin
    54806155    SoundMessage(Phrases.Lookup('ATTACKSUB'), '');
    5481     exit;
     6156    Exit;
    54826157  end;
    54836158
     
    54896164    begin
    54906165      SoundMessage(Phrases.Lookup('NOATTACKER'), '');
    5491       exit;
     6166      Exit;
    54926167    end;
    54936168    euix := MyRO.nEnemyUn - 1;
    54946169    while (euix >= 0) and (MyRO.EnemyUn[euix].Loc <> ToLoc) do
    5495       dec(euix);
     6170      Dec(euix);
    54966171  end;
    54976172
    54986173  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) then
    5501     Server(sStartJob + jNone shl 4, me, UnFocus, nil^);
    5502   if (result < rExecuted) and (result <> eNoTime_Move) then
    5503   begin
    5504     case result of
     6174  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
    55056180      eNoTime_Load:
    55066181        if MyModel[MyUn[UnFocus].mix].Domain = dAir then
     
    55386213            (MyMap[ToLoc] and (fUnit or fOwned) = fUnit or fOwned) then
    55396214          begin // false load attempt
    5540             ToShip := false;
    5541             ToTransport := false;
     6215            ToShip := False;
     6216            ToTransport := False;
    55426217            for uix := 0 to MyRO.nUn - 1 do
    55436218              if (MyUn[uix].Loc = ToLoc) and
    55446219                (MyModel[MyUn[uix].mix].Domain = dSea) then
    55456220              begin
    5546                 ToShip := true;
     6221                ToShip := True;
    55476222                if MyModel[MyUn[uix].mix].Cap[mcSeaTrans] > 0 then
    5548                   ToTransport := true;
     6223                  ToTransport := True;
    55496224              end;
    55506225            if ToTransport then
     
    55616236      Play('NOMOVE_DEFAULT');
    55626237    end;
    5563     exit;
    5564   end;
    5565 
    5566   if ((result = eWon) or (result = eLost) or (result = eBloody)) and
     6238    Exit;
     6239  end;
     6240
     6241  if ((Result = eWon) or (Result = eLost) or (Result = eBloody)) and
    55676242    (MyUn[UnFocus].Movement < 100) and
    55686243    (MyModel[MyUn[UnFocus].mix].Cap[mcWill] = 0) then
     
    55716246      [MyUn[UnFocus].Movement]), 'NOMOVE_TIME') <> mrOK then
    55726247    begin
    5573       result := eInvalid;
    5574       exit;
     6248      Result := eInvalid;
     6249      Exit;
    55756250    end;
    55766251    Update; // remove message box from screen
    55776252  end;
    55786253
    5579   OldUnrest := false;
    5580   NewUnrest := false;
    5581   if (result >= rExecuted) and (result and rUnitRemoved = 0) and
     6254  OldUnrest := False;
     6255  NewUnrest := False;
     6256  if (Result >= rExecuted) and (Result and rUnitRemoved = 0) and
    55826257    (MyMap[ToLoc] and (fUnit or fOwned) <> fUnit) then
    55836258  begin
     
    55896264      begin
    55906265        QueryItem := 'UNREST_NOTOWN';
    5591         p1 := me;
     6266        p1 := Me;
    55926267      end
    55936268      else
     
    56066281        if ModalResult <> mrOK then
    56076282        begin
    5608           result := eInvalid;
    5609           exit;
     6283          Result := eInvalid;
     6284          Exit;
    56106285        end;
    56116286      end;
    56126287      Update; // remove message box from screen
    5613     end
    5614   end;
    5615 
    5616   if (result >= rExecuted) and (MyModel[MyUn[UnFocus].mix].Domain = dAir) and
     6288    end;
     6289  end;
     6290
     6291  if (Result >= rExecuted) and (MyModel[MyUn[UnFocus].mix].Domain = dAir) and
    56176292    (MyUn[UnFocus].Status and usToldNoReturn = 0) then
    56186293  begin // can plane return?
     
    56346309        PlaneReturnData.Movement := MyUn[UnFocus].Movement - 150;
    56356310    end;
    5636     if Server(sGetPlaneReturn, me, UnFocus, PlaneReturnData) = eNoWay then
     6311    if Server(sGetPlaneReturn, Me, UnFocus, PlaneReturnData) = eNoWay then
    56376312    begin
    56386313      if MyModel[MyUn[UnFocus].mix].Kind = mkSpecial_Glider then
     
    56436318        <> mrOK then
    56446319      begin
    5645         result := eInvalid;
    5646         exit;
     6320        Result := eInvalid;
     6321        Exit;
    56476322      end;
    56486323      Update; // remove message box from screen
    56496324      MyUn[UnFocus].Status := MyUn[UnFocus].Status or usToldNoReturn;
    5650     end
    5651   end;
    5652 
    5653   if result = eMissionDone then
     6325    end;
     6326  end;
     6327
     6328  if Result = eMissionDone then
    56546329  begin
    56556330    ModalSelectDlg.ShowNewContent(wmModal, kMission);
    56566331    Update; // dialog still on screen
    5657     Mission := ModalSelectDlg.result;
     6332    Mission := ModalSelectDlg.Result;
    56586333    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 then
     6334      Exit;
     6335    Server(sSetSpyMission + Mission shl 4, Me, 0, nil^);
     6336  end;
     6337
     6338  CityCaptured := False;
     6339  if Result = eNoTime_Move then
    56656340    Play('NOMOVE_TIME')
    56666341  else
    56676342  begin
    5668     NeedEcoUpdate := false;
    5669     DestinationMarkON := false;
     6343    NeedEcoUpdate := False;
     6344    DestinationMarkON := False;
    56706345    PaintDestination;
    5671     if result and rUnitRemoved <> 0 then
     6346    if Result and rUnitRemoved <> 0 then
    56726347      CityOptimizer_BeforeRemoveUnit(UnFocus);
    5673     IsAttack := (result = eBombarded) or (result <> eMissionDone) and
     6348    IsAttack := (Result = eBombarded) or (Result <> eMissionDone) and
    56746349      (MyMap[ToLoc] and (fUnit or fOwned) = fUnit);
    56756350    if not IsAttack then
     
    56776352      cix := MyRO.nCity - 1; { look for own city at dest location }
    56786353      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)
    56816356      then
    5682         CityCaptured := true;
    5683       result := Server(sMoveUnit + DirCode, me, UnFocus, nil^);
    5684       case result of
     6357        CityCaptured := True;
     6358      Result := Server(sMoveUnit + DirCode, Me, UnFocus, nil^);
     6359      case Result of
    56856360        eHiddenUnit:
    56866361          begin
    56876362            Play('NOMOVE_SUBMARINE');
    5688             PaintLoc(ToLoc)
     6363            PaintLoc(ToLoc);
    56896364          end;
    56906365        eStealthUnit:
    56916366          begin
    56926367            Play('NOMOVE_STEALTH');
    5693             PaintLoc(ToLoc)
     6368            PaintLoc(ToLoc);
    56946369          end;
    56956370        eZOC_EnemySpotted:
    56966371          begin
    56976372            Play('NOMOVE_ZOC');
    5698             PaintLoc(ToLoc, 1)
     6373            PaintLoc(ToLoc, 1);
    56996374          end;
    5700         rExecuted .. maxint:
     6375        rExecuted..MaxInt:
    57016376          begin
    5702             if result and rUnitRemoved <> 0 then
     6377            if Result and rUnitRemoved <> 0 then
    57036378              UnFocus := -1 // unit died
    57046379            else
    57056380            begin
    5706               assert(UnFocus >= 0);
     6381              Assert(UnFocus >= 0);
    57076382              MyUn[UnFocus].Status := MyUn[UnFocus].Status and
    57086383                not(usStay or usRecover);
     
    57146389              begin // borders have moved, unrest might have changed in any city
    57156390                CityOptimizer_BeginOfTurn;
    5716                 NeedEcoUpdate := true;
     6391                NeedEcoUpdate := True;
    57176392              end
    57186393              else
     
    57246399                    if MyUn[uix].Master = UnFocus then
    57256400                      CityOptimizer_CityChange(MyUn[uix].Home);
    5726                   NeedEcoUpdate := true;
     6401                  NeedEcoUpdate := True;
    57276402                end;
    57286403                if (MyRO.Government = gDespotism) and
     
    57346409                    while (cixChanged >= 0) and
    57356410                      (MyCity[cixChanged].Loc <> FromLoc) do
    5736                       dec(cixChanged);
    5737                     assert(cixChanged >= 0);
     6411                      Dec(cixChanged);
     6412                    Assert(cixChanged >= 0);
    57386413                    if cixChanged >= 0 then
    57396414                    begin
    57406415                      CityOptimizer_CityChange(cixChanged);
    5741                       NeedEcoUpdate := true;
     6416                      NeedEcoUpdate := True;
    57426417                    end;
    57436418                  end;
     
    57476422                    while (cixChanged >= 0) and
    57486423                      (MyCity[cixChanged].Loc <> ToLoc) do
    5749                       dec(cixChanged);
    5750                     assert(cixChanged >= 0);
     6424                      Dec(cixChanged);
     6425                    Assert(cixChanged >= 0);
    57516426                    if cixChanged >= 0 then
    57526427                    begin
    57536428                      CityOptimizer_CityChange(cixChanged);
    5754                       NeedEcoUpdate := true;
     6429                      NeedEcoUpdate := True;
    57556430                    end;
    57566431                  end;
     
    57606435          end;
    57616436      else
    5762         assert(false);
     6437        Assert(False);
    57636438      end;
    57646439      SetTroopLoc(ToLoc);
     
    57666441    else
    57676442    begin { enemy unit -- attack }
    5768       if result = eBombarded then
     6443      if Result = eBombarded then
    57696444        Defender := MyRO.Territory[ToLoc]
    57706445      else
     
    57736448        if SimpleQuery(mkYesNo,Phrases.Lookup('FRCANCELQUERY_CEASEFIRE'),
    57746449        'MSG_DEFAULT')<>mrOK then
    5775         exit; }
    5776       if (Options and muNoSuicideCheck = 0) and (result and rUnitRemoved <> 0)
    5777         and (result <> eMissionDone) then
     6450        Exit; }
     6451      if (Options and muNoSuicideCheck = 0) and (Result and rUnitRemoved <> 0)
     6452        and (Result <> eMissionDone) then
    57786453      begin // suicide query
    57796454        with MyUn[UnFocus], BattleDlg.Forecast do
    57806455        begin
    5781           pAtt := me;
     6456          pAtt := Me;
    57826457          mixAtt := mix;
    57836458          HealthAtt := Health;
     
    57866461        end;
    57876462        BattleDlg.Forecast.Movement := MyUn[UnFocus].Movement;
    5788         Server(sGetBattleForecastEx, me, ToLoc, BattleDlg.Forecast);
     6463        Server(sGetBattleForecastEx, Me, ToLoc, BattleDlg.Forecast);
    57896464        BattleDlg.uix := UnFocus;
    57906465        BattleDlg.ToLoc := ToLoc;
    5791         BattleDlg.IsSuicideQuery := true;
     6466        BattleDlg.IsSuicideQuery := True;
    57926467        BattleDlg.ShowModal;
    57936468        if BattleDlg.ModalResult <> mrOK then
    5794           exit;
     6469          Exit;
    57956470      end;
    57966471
    57976472      cixChanged := -1;
    5798       if (result and rUnitRemoved <> 0) and (MyRO.Government = gDespotism) and
     6473      if (Result and rUnitRemoved <> 0) and (MyRO.Government = gDespotism) and
    57996474        (MyModel[MyUn[UnFocus].mix].Kind = mkSpecial_TownGuard) and
    58006475        (MyMap[FromLoc] and fCity <> 0) then
     
    58026477        cixChanged := MyRO.nCity - 1;
    58036478        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 do
    5809         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;
    58106485      OldToTile := MyMap[ToLoc];
    5811       result := Server(sMoveUnit + DirCode, me, UnFocus, nil^);
     6486      Result := Server(sMoveUnit + DirCode, Me, UnFocus, nil^);
    58126487      nLostArmy := 0;
    5813       for i := 0 to MyRO.nEnemyModel - 1 do
     6488      for I := 0 to MyRO.nEnemyModel - 1 do
    58146489      begin
    5815         LostArmy[i] := MyRO.EnemyModel[i].Lost - LostArmy[i];
    5816         inc(nLostArmy, LostArmy[i])
    5817       end;
    5818       if result and rUnitRemoved <> 0 then
     6490        LostArmy[I] := MyRO.EnemyModel[I].Lost - LostArmy[I];
     6491        Inc(nLostArmy, LostArmy[I]);
     6492      end;
     6493      if Result and rUnitRemoved <> 0 then
    58196494      begin
    58206495        UnFocus := -1;
     
    58256500      begin // city was destroyed, borders have moved, unrest might have changed in any city
    58266501        CityOptimizer_BeginOfTurn;
    5827         NeedEcoUpdate := true;
    5828       end
    5829       else
    5830       begin
     6502        NeedEcoUpdate := True;
     6503      end else begin
    58316504        if cixChanged >= 0 then
    58326505        begin
    58336506          CityOptimizer_CityChange(cixChanged);
    5834           NeedEcoUpdate := true;
     6507          NeedEcoUpdate := True;
    58356508        end;
    5836         if (result = eWon) or (result = eBloody) or (result = eExpelled) then
     6509        if (Result = eWon) or (Result = eBloody) or (Result = eExpelled) then
    58376510        begin
    58386511          CityOptimizer_TileBecomesAvailable(ToLoc);
    5839           NeedEcoUpdate := true;
     6512          NeedEcoUpdate := True;
    58406513        end;
    58416514      end;
     
    58496522            MyRO.EnemyModel[MyRO.EnemyUn[euix].emix].Domain));
    58506523          ShowModal;
    5851         end
    5852       end
    5853     end;
    5854     if result and rUnitRemoved <> 0 then
     6524        end;
     6525      end;
     6526    end;
     6527    if Result and rUnitRemoved <> 0 then
    58556528    begin
    58566529      CityOptimizer_AfterRemoveUnit;
    58576530      ListDlg.RemoveUnit;
    5858       NeedEcoUpdate := true;
     6531      NeedEcoUpdate := True;
    58596532    end;
    58606533    if NeedEcoUpdate then
    58616534    begin
    5862       UpdateViews(true);
    5863       Update
    5864     end
    5865   end;
    5866 
    5867   if result = eMissionDone then
     6535      UpdateViews(True);
     6536      Update;
     6537    end;
     6538  end;
     6539
     6540  if Result = eMissionDone then
    58686541  begin
    58696542    p1 := MyRO.Territory[ToLoc];
     
    58716544      smStealMap:
    58726545        begin
    5873           MapValid := false;
     6546          MapValid := False;
    58746547          PaintAllMaps
    58756548        end;
     
    58846557    CheckToldNoReturn(UnFocus);
    58856558
    5886   NeedRepaintPanel := false;
    5887   if result >= rExecuted then
     6559  NeedRepaintPanel := False;
     6560  if Result >= rExecuted then
    58886561  begin
    58896562    if CityCaptured and (MyMap[ToLoc] and fCity = 0) then
    58906563    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)
    58936566        then
    58946567          with MessgExDlg do
    58956568          begin
    58966569            if WondersDlg.Visible then
    5897               WondersDlg.SmartUpdateContent(false);
     6570              WondersDlg.SmartUpdateContent(False);
    58986571            OpenSound := 'WONDER_DESTROYED';
    58996572            MessgText := Format(Phrases.Lookup('WONDERDEST'),
    5900               [Phrases.Lookup('IMPROVEMENTS', i)]);
     6573              [Phrases.Lookup('IMPROVEMENTS', I)]);
    59016574            Kind := mkOkHelp;
    59026575            HelpKind := hkImp;
    5903             HelpNo := i;
     6576            HelpNo := I;
    59046577            IconKind := mikImp;
    5905             IconIndex := i;
     6578            IconIndex := I;
    59066579            ShowModal;
    5907             MyData.ToldWonders[i] := MyRO.Wonder[i];
    5908           end
     6580            MyData.ToldWonders[I] := MyRO.Wonder[I];
     6581          end;
    59096582    end;
    59106583    if CityCaptured and (MyMap[ToLoc] and fCity <> 0) then
    59116584    begin // city captured
    59126585      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 then
     6586      for I := 0 to nWonder - 1 do { tell about capture of wonders }
     6587        if MyRO.City[MyRO.nCity - 1].Built[I] > 0 then
    59156588          with MessgExDlg do
    59166589          begin
    59176590            if WondersDlg.Visible then
    5918               WondersDlg.SmartUpdateContent(false);
     6591              WondersDlg.SmartUpdateContent(False);
    59196592            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)]);
    59226595            Kind := mkOkHelp;
    59236596            HelpKind := hkImp;
    5924             HelpNo := i;
     6597            HelpNo := I;
    59256598            IconKind := mikImp;
    5926             IconIndex := i;
     6599            IconIndex := I;
    59276600            ShowModal;
    5928             MyData.ToldWonders[i] := MyRO.Wonder[i];
     6601            MyData.ToldWonders[I] := MyRO.Wonder[I];
    59296602          end;
    59306603
     
    59326605      begin { Temple of Zeus -- choose advance to steal }
    59336606        ModalSelectDlg.ShowNewContent(wmModal, kStealTech);
    5934         Server(sStealTech, me, ModalSelectDlg.result, nil^);
     6607        Server(sStealTech, Me, ModalSelectDlg.Result, nil^);
    59356608      end;
    59366609      TellNewModels;
     
    59386611      cix := MyRO.nCity - 1;
    59396612      while (cix >= 0) and (MyCity[cix].Loc <> ToLoc) do
    5940         dec(cix);
    5941       assert(cix >= 0);
     6613        Dec(cix);
     6614      Assert(cix >= 0);
    59426615      MyCity[cix].Status := MyCity[cix].Status and not csResourceWeightsMask or
    59436616        (3 shl 4);
    59446617      // captured city, set to maximum growth
    59456618      NewTiles := 1 shl 13; { exploit central tile only }
    5946       Server(sSetCityTiles, me, cix, NewTiles);
     6619      Server(sSetCityTiles, Me, cix, NewTiles);
    59476620    end
    59486621    else
    5949       NeedRepaintPanel := true;
     6622      NeedRepaintPanel := True;
    59506623  end;
    59516624  TellNewContacts;
     
    59616634  if Options and (muAutoNoWait or muAutoNext) <> 0 then
    59626635  begin
    5963     if (UnFocus >= 0) and ((result = eNoTime_Move) or UnitExhausted(UnFocus) or
     6636    if (UnFocus >= 0) and ((Result = eNoTime_Move) or UnitExhausted(UnFocus) or
    59646637      (MyUn[UnFocus].Master >= 0) or (MyModel[MyUn[UnFocus].mix].Domain = dAir)
    59656638      and ((MyMap[MyUn[UnFocus].Loc] and fCity <> 0)
     
    59756648        end
    59766649        else
    5977           NextUnit(UnStartLoc, true);
     6650          NextUnit(UnStartLoc, True);
    59786651    end
    59796652    else if (UnFocus < 0) and (Options and muAutoNext <> 0) then
    5980       NextUnit(UnStartLoc, result <> eMissionDone);
     6653      NextUnit(UnStartLoc, Result <> eMissionDone);
    59816654  end;
    59826655
     
    59866659    else
    59876660    begin
    5988       assert(result <> eMissionDone);
     6661      Assert(Result <> eMissionDone);
    59896662      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)
    59946667  then
    59956668    ZoomToCity(ToLoc, UnFocus < 0, chCaptured); // show captured city
    5996 end; // moveunit
     6669end;
    59976670
    59986671procedure TMainScreen.MoveOnScreen(ShowMove: TShowMove;
    5999   Step0, Step1, nStep: integer; Restore: boolean = true);
     6672  Step0, Step1, nStep: Integer; Restore: Boolean = True);
    60006673var
    60016674  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;
    60036676  UnitInfo: TUnitInfo;
    60046677  Ticks0, Ticks: TDateTime;
    60056678begin
    6006   Timer1.Enabled := false;
     6679  Timer1.Enabled := False;
    60076680  Ticks0 := NowPrecise;
    60086681  with ShowMove do
     
    60136686    UnitInfo.Job := jNone;
    60146687    UnitInfo.Flags := Flags;
    6015     if Owner <> me then
     6688    if Owner <> Me then
    60166689      UnitInfo.emix := emix;
    60176690
     
    60326705        * xxt - MapWidth) < abs(((xFromLoc - xw1) * 2 + yFromLoc and 1 + 1) * xxt
    60336706        * 2 + dx * xxt - MapWidth) do
    6034         dec(xw1, G.lx);
     6707        Dec(xw1, G.lx);
    60356708
    60366709      xTo := (xToLoc - xw1) * (xxt * 2) + yToLoc and 1 * xxt + (xxt - xxu);
     
    60406713      if xFrom < xTo then begin
    60416714        xMin := xFrom;
    6042         xRange := xTo - xFrom
     6715        xRange := xTo - xFrom;
    60436716      end else begin
    60446717        xMin := xTo;
    6045         xRange := xFrom - xTo
     6718        xRange := xFrom - xTo;
    60466719      end;
    60476720      if yFrom < yTo then begin
    60486721        yMin := yFrom;
    6049         yRange := yTo - yFrom
     6722        yRange := yTo - yFrom;
    60506723      end else begin
    60516724        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);
    60566729    end;
    60576730
     
    60616734    for Step := 0 to abs(Step1 - Step0) do
    60626735    begin
    6063       DpiBitCanvas(Buffer.Canvas, 0, 0, xRange, yRange,
    6064         offscreen.Canvas, xMin, yMin);
     6736      DpiBitBltCanvas(Buffer.Canvas, 0, 0, xRange, yRange,
     6737        Offscreen.Canvas, xMin, yMin);
    60656738      if Step1 <> Step0 then
    60666739      begin
     
    60796752      NoMap.PaintUnit(xMoving - xMin, yMoving - yMin, UnitInfo, 0);
    60806753      PaintBufferToScreen(xMin, yMin, xRange, yRange);
    6081       {$IFDEF LINUX}
    6082       // TODO: Force animation under linux
     6754      {$IFDEF UNIX}
     6755      // TODO: Force animation under UNIX
    60836756      DpiApplication.ProcessMessages;
    60846757      {$ENDIF}
     
    60916764          < MoveTime) then
    60926765        begin
    6093           if not idle or (GameMode = cMovie) then
     6766          if not Idle or (GameMode = cMovie) then
    60946767            DpiApplication.ProcessMessages;
    60956768          Sleep(1);
    6096           inc(SliceCount)
     6769          Inc(SliceCount)
    60976770        end;
    60986771        Ticks := NowPrecise;
    60996772      until (((Ticks - Ticks0) * 12) / OneMillisecond) >= MoveTime;
    6100       Ticks0 := Ticks
     6773      Ticks0 := Ticks;
    61016774    end;
    61026775  end;
    61036776  if Restore then
    61046777  begin
    6105     DpiBitCanvas(Buffer.Canvas, 0, 0, xRange, yRange, offscreen.Canvas, xMin, yMin);
     6778    DpiBitBltCanvas(Buffer.Canvas, 0, 0, xRange, yRange, Offscreen.Canvas, xMin, yMin);
    61066779    PaintBufferToScreen(xMin, yMin, xRange, yRange);
    61076780  end;
    61086781  BlinkTime := -1;
    6109   Timer1.Enabled := true;
    6110 end;
    6111 
    6112 procedure TMainScreen.MoveToLoc(Loc: integer; CheckSuicide: boolean);
     6782  Timer1.Enabled := True;
     6783end;
     6784
     6785procedure TMainScreen.MoveToLoc(Loc: Integer; CheckSuicide: Boolean);
    61136786// path finder: move focused unit to loc, start multi-turn goto if too far
    61146787var
    6115   uix, i, MoveOptions, NextLoc, MoveResult: integer;
     6788  uix, I, MoveOptions, NextLoc, MoveResult: Integer;
    61166789  MoveAdviceData: TMoveAdviceData;
    61176790  StopReason: (None, Arrived, Dead, NoTime, EnemySpotted, MoveError);
    61186791begin
    61196792  if MyUn[UnFocus].Job > jNone then
    6120     Server(sStartJob + jNone shl 4, me, UnFocus, nil^);
     6793    Server(sStartJob + jNone shl 4, Me, UnFocus, nil^);
    61216794  if GetMoveAdvice(UnFocus, Loc, MoveAdviceData) >= rExecuted then
    61226795  begin
     
    61246797    StopReason := None;
    61256798    repeat
    6126       for i := 0 to MoveAdviceData.nStep - 1 do
     6799      for I := 0 to MoveAdviceData.nStep - 1 do
    61276800      begin
    6128         if i = MoveAdviceData.nStep - 1 then
     6801        if I = MoveAdviceData.nStep - 1 then
    61296802          MoveOptions := muAutoNext
    61306803        else
    61316804          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]);
    61346807        if (NextLoc = Loc) or (Loc = maNextCity) and
    61356808          (MyMap[NextLoc] and fCity <> 0) then
     
    61376810        if not CheckSuicide and (NextLoc = Loc) then
    61386811          MoveOptions := MoveOptions or muNoSuicideCheck;
    6139         MoveResult := MoveUnit(MoveAdviceData.dx[i], MoveAdviceData.dy[i],
     6812        MoveResult := MoveUnit(MoveAdviceData.dx[I], MoveAdviceData.dy[I],
    61406813          MoveOptions);
    61416814        if MoveResult < rExecuted then
     
    61496822      end;
    61506823      if (StopReason = None) and ((MoveAdviceData.nStep < 25) or
    6151         (MyRO.Wonder[woShinkansen].EffectiveOwner <> me)) then
     6824        (MyRO.Wonder[woShinkansen].EffectiveOwner <> Me)) then
    61526825        StopReason := NoTime;
    61536826      if StopReason <> None then
     
    61556828      if GetMoveAdvice(UnFocus, Loc, MoveAdviceData) < rExecuted then
    61566829      begin
    6157         assert(false);
     6830        Assert(False);
    61586831        Break;
    61596832      end;
    6160     until false;
     6833    until False;
    61616834
    61626835    case StopReason of
    61636836      None:
    6164         assert(false);
     6837        Assert(False);
    61656838      Arrived:
    61666839        MyUn[uix].Status := MyUn[uix].Status and ($FFFF - usGoto);
    61676840      Dead:
    61686841        if UnFocus < 0 then
    6169           NextUnit(UnStartLoc, false);
     6842          NextUnit(UnStartLoc, False);
    61706843    else
    61716844      begin // multi-turn goto
     
    61806853        begin
    61816854          MyUn[uix].Status := MyUn[uix].Status and not usWaiting;
    6182           NextUnit(UnStartLoc, true);
     6855          NextUnit(UnStartLoc, True);
    61836856        end;
    61846857      end;
     
    61886861
    61896862procedure TMainScreen.PanelBoxMouseDown(Sender: TObject; Button: TMouseButton;
    6190   Shift: TShiftState; x, y: integer);
     6863  Shift: TShiftState; X, Y: Integer);
    61916864var
    6192   i, xMouse, MouseLoc, p1: integer;
     6865  I, xMouse, MouseLoc, p1: Integer;
    61936866begin
    61946867  if GameMode = cMovie then
    6195     exit;
     6868    Exit;
    61966869
    61976870  if Button = mbLeft then
    61986871  begin
    6199     if (x >= xMini + 2) and (y >= yMini + 2) and (x < xMini + 2 + 2 * G.lx) and
    6200       (y < yMini + 2 + G.ly) then
     6872    if (X >= xMini + 2) and (Y >= yMini + 2) and (X < xMini + 2 + 2 * G.lx) and
     6873      (Y < yMini + 2 + G.ly) then
    62016874      if ssShift in Shift then
    62026875      begin
    62036876        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)
    62056878            div 2) mod G.lx;
    6206         MouseLoc := xMouse + G.lx * (y - (yMini + 2));
     6879        MouseLoc := xMouse + G.lx * (Y - (yMini + 2));
    62076880        if MyMap[MouseLoc] and fTerrain <> fUNKNOWN then
    62086881        begin
    62096882          p1 := MyRO.Territory[MouseLoc];
    6210           if (p1 = me) or (p1 >= 0) and (MyRO.Treaty[p1] >= trNone) then
     6883          if (p1 = Me) or (p1 >= 0) and (MyRO.Treaty[p1] >= trNone) then
    62116884            NatStatDlg.ShowNewContent(wmPersistent, p1);
    62126885        end;
     
    62186891        if UnitStatDlg.Visible then
    62196892          UnitStatDlg.Close;
    6220         Tracking := true;
    6221         PanelBoxMouseMove(Sender, Shift + [ssLeft], x, y);
     6893        Tracking := True;
     6894        PanelBoxMouseMove(Sender, Shift + [ssLeft], X, Y);
    62226895      end
    6223     else if (ClientMode <> cEditMap) and (x >= ClientWidth - xPalace) and
    6224       (y >= yPalace) and (x < ClientWidth - xPalace + xSizeBig) and
    6225       (y < yPalace + ySizeBig) then
     6896    else if (ClientMode <> cEditMap) and (X >= ClientWidth - xPalace) and
     6897      (Y >= yPalace) and (X < ClientWidth - xPalace + xSizeBig) and
     6898      (Y < yPalace + ySizeBig) then
    62266899    begin
    62276900      InitPopup(StatPopup);
     
    62346907          DpiGetSystemMetrics(SM_CYCAPTION) + 3)
    62356908    end
    6236     (* else if (x>=xAdvisor-3) and (y>=yAdvisor-3)
    6237       and (x<xAdvisor+16+3) and (y<yAdvisor+16+3) and HaveStrategyAdvice then
     6909    (* else if (X>=xAdvisor-3) and (Y>=yAdvisor-3)
     6910      and (X<xAdvisor+16+3) and (Y<yAdvisor+16+3) and HaveStrategyAdvice then
    62386911      AdviceBtnClick *)
    6239     else if (x >= xTroop + 1) and (y >= yTroop + 1) and
    6240       (x < xTroop + TrRow * TrPitch) and (y <= yTroop + 55) then
     6912    else if (X >= xTroop + 1) and (Y >= yTroop + 1) and
     6913      (X < xTroop + TrRow * TrPitch) and (Y <= yTroop + 55) then
    62416914    begin
    6242       i := (x - xTroop - 1) div TrPitch;
    6243       if trix[i] >= 0 then
     6915      I := (X - xTroop - 1) div TrPitch;
     6916      if trix[I] >= 0 then
    62446917        if ClientMode = cEditMap then
    62456918        begin
    6246           BrushType := trix[i];
    6247           PanelPaint
     6919          BrushType := trix[I];
     6920          PanelPaint;
    62486921        end
    62496922        else if (TroopLoc >= 0) then
     
    62526925            if ssShift in Shift then
    62536926              UnitStatDlg.ShowNewContent_OwnModel(wmPersistent,
    6254                 MyUn[trix[i]].mix)
    6255             else if not supervising and (ClientMode < scContact) and
    6256               (x - xTroop - 1 - i * TrPitch >= 60 - 20) and (y >= yTroop + 35)
    6257               and ((MyUn[trix[i]].Job > jNone) or (MyUn[trix[i]].Status and
     6927                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
    62586931              (usStay or usRecover or usGoto) <> 0)) then
    62596932            begin // wake up
    6260               MyUn[trix[i]].Status := MyUn[trix[i]].Status and
     6933              MyUn[trix[I]].Status := MyUn[trix[I]].Status and
    62616934                ($FFFF - usStay - usRecover - usGoto - usEnhance) or usWaiting;
    6262               if MyUn[trix[i]].Job > jNone then
    6263                 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^);
    62646937              if (UnFocus < 0) and not CityDlg.Visible then
    62656938              begin
    6266                 SetUnFocus(trix[i]);
    6267                 SetTroopLoc(MyUn[trix[i]].Loc);
     6939                SetUnFocus(trix[I]);
     6940                SetTroopLoc(MyUn[trix[I]].Loc);
    62686941                FocusOnLoc(TroopLoc, flRepaintPanel)
    62696942              end
     
    62716944              begin
    62726945                if CityDlg.Visible and (CityDlg.RestoreUnFocus < 0) then
    6273                   CityDlg.RestoreUnFocus := trix[i];
     6946                  CityDlg.RestoreUnFocus := trix[I];
    62746947                PanelPaint;
    62756948              end
     
    62776950            else if (ClientMode < scContact) then
    62786951            begin
    6279               if supervising then
    6280                 UnitStatDlg.ShowNewContent_OwnUnit(wmPersistent, trix[i])
     6952              if Supervising then
     6953                UnitStatDlg.ShowNewContent_OwnUnit(wmPersistent, trix[I])
    62816954              else if CityDlg.Visible then
    62826955              begin
     
    62846957                CityDlg.Close;
    62856958                SumCities(TaxSum, ScienceSum);
    6286                 SetUnFocus(trix[i]);
     6959                SetUnFocus(trix[I]);
    62876960              end
    62886961              else
    62896962              begin
    6290                 DestinationMarkON := false;
     6963                DestinationMarkON := False;
    62916964                PaintDestination;
    6292                 UnFocus := trix[i];
     6965                UnFocus := trix[I];
    62936966                UnStartLoc := TroopLoc;
    62946967                BlinkTime := 0;
    6295                 BlinkON := false;
     6968                BlinkON := False;
    62966969                PaintLoc(TroopLoc);
    62976970              end;
    62986971              if UnFocus >= 0 then
    62996972              begin
    6300                 UnitInfoBtn.Visible := true;
    6301                 UnitBtn.Visible := true;
    6302                 TurnComplete := false;
     6973                UnitInfoBtn.Visible := True;
     6974                UnitBtn.Visible := True;
     6975                TurnComplete := False;
    63036976                EOT.ButtonIndex := eotGray;
    63046977              end;
     
    63076980            end;
    63086981          end
    6309           else if Server(sGetUnits, me, TroopLoc, TrCnt) >= rExecuted then
     6982          else if Server(sGetUnits, Me, TroopLoc, TrCnt) >= rExecuted then
    63106983            if ssShift in Shift then
    63116984              UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent,
    6312                 MyRO.EnemyUn[MyRO.nEnemyUn + trix[i]].emix) // model info
     6985                MyRO.EnemyUn[MyRO.nEnemyUn + trix[I]].emix) // model info
    63136986            else
    63146987              UnitStatDlg.ShowNewContent_EnemyUnit(wmPersistent,
    6315                 MyRO.nEnemyUn + trix[i]); // unit info
    6316     end;
    6317   end;
    6318 end;
    6319 
    6320 procedure TMainScreen.SetTroopLoc(Loc: integer);
     6988                MyRO.nEnemyUn + trix[I]); // unit info
     6989    end;
     6990  end;
     6991end;
     6992
     6993procedure TMainScreen.SetTroopLoc(Loc: Integer);
    63216994var
    6322   trixFocus, uix, uixDefender: integer;
    6323   Prio: boolean;
     6995  trixFocus, uix, uixDefender: Integer;
     6996  Prio: Boolean;
    63246997begin
    63256998  TroopLoc := Loc;
     
    63337006    if MyMap[Loc] and fOwned <> 0 then
    63347007    begin // count own units here
    6335       Server(sGetDefender, me, TroopLoc, uixDefender);
    6336       for Prio := true downto false do
     7008      Server(sGetDefender, Me, TroopLoc, uixDefender);
     7009      for Prio := True downto False do
    63377010        for uix := 0 to MyRO.nUn - 1 do
    63387011          if ((uix = uixDefender) = Prio) and (MyUn[uix].Loc = Loc) then
     
    63407013            if uix = UnFocus then
    63417014              trixFocus := TrCnt;
    6342             inc(TrCnt);
     7015            Inc(TrCnt);
    63437016          end;
    63447017    end
    63457018    else // count enemy units here
    6346       Server(sGetUnits, me, Loc, TrCnt);
     7019      Server(sGetUnits, Me, Loc, TrCnt);
    63477020  if TrCnt = 0 then
    63487021    sb.Init(0, 1)
     
    63557028end;
    63567029
    6357 (* procedure TMainScreen.ShowMoveHint(ToLoc: integer; Force: boolean = false);
     7030(* procedure TMainScreen.ShowMoveHint(ToLoc: Integer; Force: Boolean = False);
    63587031  var
    6359   Step,Loc,x0,y0,xs,ys: integer;
     7032  Step,Loc,x0,y0,xs,ys: Integer;
    63607033  Info: string;
    63617034  InfoSize: TSize;
     
    63707043  MoveAdvice.MoreTurns:=0;
    63717044  MoveAdvice.MaxHostile_MovementLeft:=MyUn[UnFocus].Health-50;
    6372   if Server(sGetMoveAdvice,me,UnFocus,MoveAdvice)<rExecuted then
     7045  if Server(sGetMoveAdvice,Me,UnFocus,MoveAdvice)<rExecuted then
    63737046  ToLoc:=-1
    63747047  end;
    6375   if (ToLoc=MoveHintToLoc) and not Force then exit;
     7048  if (ToLoc=MoveHintToLoc) and not Force then Exit;
    63767049  if (ToLoc<>MoveHintToLoc) and (MoveHintToLoc>=0) then
    63777050  begin invalidate; update end; // clear old hint from screen
    63787051  MoveHintToLoc:=ToLoc;
    6379   if ToLoc<0 then exit;
    6380 
    6381   with canvas do
     7052  if ToLoc<0 then Exit;
     7053
     7054  with Canvas do
    63827055  begin
    63837056  Pen.Color:=$80C0FF;
     
    63907063  xs:=(x0-xw)*66+y0 and 1*33-G.lx*66;
    63917064  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);
    63937066  ys:=(y0-yw)*16;
    63947067  if Step=0 then moveto(xs+33,ys+16)
     
    63987071  end;
    63997072  Brush.Color:=$80C0FF;
    6400   Info:=' '+inttostr(88)+' ';
     7073  Info:=' '+IntToStr(88)+' ';
    64017074  InfoSize:=TextExtent(Info);
    64027075  TextOut(xs+33-InfoSize.cx div 2, ys+16-InfoSize.cy div 2, Info);
     
    64057078  end; *)
    64067079
    6407 procedure TMainScreen.SetDebugMap(p: integer);
    6408 begin
    6409   MainMap.pDebugMap := p;
     7080procedure TMainScreen.SetDebugMap(P: Integer);
     7081begin
     7082  MainMap.pDebugMap := P;
    64107083  MapOptions := MapOptions - [moLocCodes];
    6411   mLocCodes.Checked := false;
    6412   MapValid := false;
     7084  mLocCodes.Checked := False;
     7085  MapValid := False;
    64137086  MainOffscreenPaint;
    64147087end;
    64157088
    6416 procedure TMainScreen.SetViewpoint(p: integer);
     7089procedure TMainScreen.SetViewpoint(P: Integer);
    64177090var
    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;
     7092begin
     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);
    64277098    SumCities(TaxSum, ScienceSum);
    6428     for i := 0 to MyRO.nModel - 1 do
    6429       if not Assigned(Tribe[me].ModelPicture[i].HGr) then
    6430         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);
    64317102
    64327103    SetTroopLoc(-1);
     
    64817152  MTrans.ShortCut := BTrans.ShortCut;
    64827153  mPollution.ShortCut := BPollution.ShortCut;
    6483   mRR.ShortCut := BRailRoad.ShortCut;
     7154  mRailRoad.ShortCut := BRailRoad.ShortCut;
    64847155  mRoad.ShortCut := BRailRoad.ShortCut;
    64857156  mUnload.ShortCut := BUnload.ShortCut;
     
    65167187end;
    65177188
    6518 procedure TMainScreen.FormKeyDown(Sender: TObject; var Key: word;
     7189procedure TMainScreen.FormKeyDown(Sender: TObject; var Key: Word;
    65197190  Shift: TShiftState);
    65207191
     
    65237194    InitPopup(Popup);
    65247195    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);
    65327203  end;
    65337204
     
    65587229
    65597230  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;
    65637234    (*if Shift = [ssCtrl] then
    65647235      case char(Key) of
    65657236         'A':
    65667237          begin // auto symmetry
    6567           Server($7F0,me,0,nil^);
    6568           MapValid:=false;
     7238          Server($7F0,Me,0,nil^);
     7239          MapValid:=False;
    65697240          PaintAll;
    65707241          end;
     
    65737244          dy:=0;
    65747245          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);
    65767247          dy:=dy
    65777248          end;
     
    65867257    SetFullScreen(FullScreen);
    65877258  end
    6588   else if BHelp.Test(ShortCut) then MenuClick(mHelp)
     7259  else if BHelp.Test(ShortCut) then mHelp.Click
    65897260  else if BUnitStat.Test(ShortCut) then MenuClick_Check(StatPopup, mUnitStat)
    65907261  else if BCityStat.Test(ShortCut) then MenuClick_Check(StatPopup, mCityStat)
     
    66087279  else if BSetDebugMap9.Test(ShortCut) then SetDebugMap(9)
    66097280
    6610   else if BJump.Test(ShortCut) then MenuClick(mJump)
     7281  else if BJump.Test(ShortCut) then mJump.Click
    66117282  else if BDebugMap.Test(ShortCut) then mShowClick(mDebugMap)
    66127283  else if BLocCodes.Test(ShortCut) then mShowClick(mLocCodes)
     
    66177288  else if BNames.Test(ShortCut) then mNamesClick(mNames)
    66187289  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
    66207291  else if BTestMapRepaint.Test(ShortCut) then begin // test map repaint time
    66217292    Time0 := NowPrecise;
     
    66427313  else if BMapBtn5.Test(ShortCut) then MapBtnClick(MapBtn5)
    66437314  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;
    66467317
    66477318  if UnFocus >= 0 then begin
    6648     if BDisbandUnit.Test(ShortCut) then MenuClick(mDisband)
     7319    if BDisbandUnit.Test(ShortCut) then mDisband.Click
    66497320    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
    66557326    else if BCancel.Test(ShortCut) then MenuClick_Check(UnitPopup, mCancel)
    66567327    else if BPillage.Test(ShortCut) then MenuClick_Check(UnitPopup, mPillage)
     
    66607331    else if BEnhance.Test(ShortCut) then begin
    66617332      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
    66647335    end
    66657336    else if BGoOn.Test(ShortCut) then MenuClick_Check(UnitPopup, mGoOn)
     
    66677338    else if BFarmClearIrrigation.Test(ShortCut) then begin
    66687339      if JobTest(UnFocus, jFarm, [eTreaty]) then
    6669         MenuClick(mFarm)
     7340        mFarm.Click
    66707341      else if JobTest(UnFocus, jClear, [eTreaty]) then
    6671         MenuClick(mClear)
     7342        mClear.Click
    66727343      else MenuClick_Check(TerrainPopup, mIrrigation);
    66737344    end
    66747345    else if BLoad.Test(ShortCut) then MenuClick_Check(UnitPopup, mLoad)
    66757346    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
    66777348        else MenuClick_Check(TerrainPopup, mMine);
    66787349    end
     
    66817352    else if BPollution.Test(ShortCut) then MenuClick_Check(TerrainPopup, mPollution)
    66827353    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
    66847355        else MenuClick_Check(TerrainPopup, mRoad);
    66857356    end
     
    66987369end;
    66997370
    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
     7371function TMainScreen.DoJob(j0: Integer): Integer;
     7372var
     7373  Loc0, Movement0: Integer;
     7374begin
     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
    67077387    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
    67187392      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
    67237401        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);
    67387404        end
    67397405        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;
    67767407      end
    67777408      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;
     7424end;
     7425
     7426function TMainScreen.GetBattleDlg: TBattleDlg;
     7427begin
     7428  if not Assigned(FBattleDlg) then FBattleDlg := TBattleDlg.Create(nil);
     7429  Result := FBattleDlg;
     7430end;
     7431
     7432function TMainScreen.GetCityDlg: TCityDlg;
     7433begin
     7434  if not Assigned(FCityDlg) then begin
     7435    FCityDlg := TCityDlg.Create(nil);
     7436    FCityDlg.CheckAge;
     7437  end;
     7438  Result := FCityDlg;
     7439end;
     7440
     7441function TMainScreen.GetCityTypeDlg: TCityTypeDlg;
     7442begin
     7443  if not Assigned(FCityTypeDlg) then FCityTypeDlg := TCityTypeDlg.Create(nil);
     7444  Result := FCityTypeDlg;
     7445end;
     7446
     7447function TMainScreen.GetDiaDlg: TDiaDlg;
     7448begin
     7449  if not Assigned(FDiaDlg) then begin
     7450    FDiaDlg := TDiaDlg.Create(nil);
     7451    ArrangeDialog(FDiaDlg);
     7452  end;
     7453  Result := FDiaDlg;
     7454end;
     7455
     7456function TMainScreen.GetDraftDlg: TDraftDlg;
     7457begin
     7458  if not Assigned(FDraftDlg) then FDraftDlg := TDraftDlg.Create(nil);
     7459  Result := FDraftDlg;
     7460end;
     7461
     7462function TMainScreen.GetEnhanceDlg: TEnhanceDlg;
     7463begin
     7464  if not Assigned(FEnhanceDlg) then FEnhanceDlg := TEnhanceDlg.Create(nil);
     7465  Result := FEnhanceDlg;
     7466end;
     7467
     7468function TMainScreen.GetHelpDlg: THelpDlg;
     7469begin
     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;
     7476end;
     7477
     7478function TMainScreen.GetListDlg: TListDlg;
     7479begin
     7480  if not Assigned(FListDlg) then begin
     7481    FListDlg := TListDlg.Create(nil);
     7482    ArrangeDialog(FListDlg);
     7483  end;
     7484  Result := FListDlg;
     7485end;
     7486
     7487function TMainScreen.GetMessgExDlg: TMessgExDlg;
     7488begin
     7489  if not Assigned(FMessgExDlg) then FMessgExDlg := TMessgExDlg.Create(nil);
     7490    Result := FMessgExDlg;
     7491end;
     7492
     7493function TMainScreen.GetModalSelectDlg: TModalSelectDlg;
     7494begin
     7495  if not Assigned(FModalSelectDlg) then FModalSelectDlg := TModalSelectDlg.Create(nil);
     7496  Result := FModalSelectDlg;
     7497end;
     7498
     7499function TMainScreen.GetNatStatDlg: TNatStatDlg;
     7500begin
     7501  if not Assigned(FNatStatDlg) then begin
     7502    FNatStatDlg := TNatStatDlg.Create(nil);
     7503    ArrangeDialog(FNatStatDlg);
     7504    FNatStatDlg.CheckAge;
     7505  end;
     7506  Result := FNatStatDlg;
     7507end;
     7508
     7509function TMainScreen.GetNegoDlg: TNegoDlg;
     7510begin
     7511  if not Assigned(FNegoDlg) then FNegoDlg := TNegoDlg.Create(nil);
     7512  Result := FNegoDlg;
     7513end;
     7514
     7515function TMainScreen.GetRatesDlg: TRatesDlg;
     7516begin
     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;
     7523end;
     7524
     7525function TMainScreen.GetTechTreeDlg: TTechTreeDlg;
     7526begin
     7527  if not Assigned(FTechTreeDlg) then FTechTreeDlg := TTechTreeDlg.Create(nil);
     7528  Result := FTechTreeDlg;
     7529end;
     7530
     7531procedure TMainScreen.mDisbandOrUtilizeClick(Sender: TObject);
     7532var
     7533  Loc0: Integer;
     7534begin
     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')
    67807553    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;
    71747564end;
    71757565
    71767566procedure TMainScreen.InitPopup(Popup: TDpiPopupMenu);
    71777567var
    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;
    71817571  mox: ^TModel;
    71827572begin
    7183   NoSuper := not supervising and (1 shl me and MyRO.Alive <> 0);
    7184   HaveCities := false;
    7185   for i := 0 to MyRO.nCity - 1 do
    7186     if MyCity[i].Loc >= 0 then
     7573  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
    71877577    begin
    7188       HaveCities := true;
     7578      HaveCities := True;
    71897579      Break;
    71907580    end;
     
    71927582  begin
    71937583    mTechTree.Visible := ClientMode <> cEditMap;
    7194     mResign.Enabled := supervising or (me = 0) and (ClientMode < scContact);
     7584    mResign.Enabled := Supervising or (Me = 0) and (ClientMode < scContact);
    71957585    mRandomMap.Visible := (ClientMode = cEditMap) and
    7196       (Server(sMapGeneratorRequest, me, 0, nil^) = eOK);
     7586      (Server(sMapGeneratorRequest, Me, 0, nil^) = eOK);
    71977587    mOptions.Visible := ClientMode <> cEditMap;
    71987588    mManip.Visible := ClientMode <> cEditMap;
     
    72087598      case SoundMode of
    72097599        smOff:
    7210           mSoundOff.Checked := true;
     7600          mSoundOff.Checked := True;
    72117601        smOn:
    7212           mSoundOn.Checked := true;
     7602          mSoundOn.Checked := True;
    72137603        smOnAlt:
    7214           mSoundOnAlt.Checked := true;
    7215       end;
    7216 
    7217       for i := 0 to nTestFlags - 1 do
    7218         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;
    72227612      for p1 := 1 to nPl - 1 do
    72237613        if G.RO[p1] <> nil then
    7224           Multi := true;
     7614          Multi := True;
    72257615      mEnemyMovement.Visible := not Multi;
    72267616    end;
     
    72287618    if NoSuper and (ClientMode < scContact) then
    72297619    begin
    7230       mCityTypes.Enabled := false;
     7620      mCityTypes.Enabled := False;
    72317621      // check if city types already usefull:
    72327622      if MyRO.nCity > 0 then
    7233         for i := nWonder to nImp - 1 do
    7234           if (i <> imTrGoods) and (Imp[i].Kind = ikCommon) and
    7235             (Imp[i].Preq <> preNA) and
    7236             ((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))
    72377627          then
    72387628          begin
    7239             mCityTypes.Enabled := true;
     7629            mCityTypes.Enabled := True;
    72407630            Break
    72417631          end;
    72427632    end;
    7243     mViewpoint.Visible := (ClientMode <> cEditMap) and supervising;
     7633    mViewpoint.Visible := (ClientMode <> cEditMap) and Supervising;
    72447634    mViewpoint.Enabled := G.RO[0].Turn > 0;
    7245     if supervising then
     7635    if Supervising then
    72467636    begin
    72477637      EmptyMenu(mViewpoint);
     
    72497639        if (p1 = 0) or (1 shl p1 and G.RO[0].Alive <> 0) then
    72507640        begin
    7251           m := TDpiMenuItem.Create(mViewpoint);
     7641          M := TDpiMenuItem.Create(mViewpoint);
    72527642          if p1 = 0 then
    7253             m.Caption := Phrases.Lookup('SUPER')
     7643            M.Caption := Phrases.Lookup('SUPER')
    72547644          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;
    72587648          if p1 < 10 then
    7259             m.ShortCut := ShortCut(48 + p1, [ssCtrl]);
    7260           m.RadioItem := true;
    7261           if p1 = me then
    7262             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);
    72647654        end
    72657655    end;
    7266     mDebugMap.Visible := (ClientMode <> cEditMap) and supervising;
    7267     if supervising then
     7656    mDebugMap.Visible := (ClientMode <> cEditMap) and Supervising;
     7657    if Supervising then
    72687658    begin
    72697659      EmptyMenu(mDebugMap);
     
    72717661        if (p1 = 0) or (1 shl p1 and G.RO[0].Alive <> 0) then
    72727662        begin
    7273           m := TDpiMenuItem.Create(mDebugMap);
     7663          M := TDpiMenuItem.Create(mDebugMap);
    72747664          if p1 = 0 then
    7275             m.Caption := Phrases2.Lookup('MENU_DEBUGMAPOFF')
     7665            M.Caption := Phrases2.Lookup('MENU_DEBUGMAPOFF')
    72767666          else
    7277             m.Caption := Tribe[p1].TString(Phrases2.Lookup('BELONG'));
     7667            M.Caption := Tribe[p1].TString(Phrases2.Lookup('BELONG'));
    72787668          if p1 = 0 then
    7279             m.Tag := -1
     7669            M.Tag := -1
    72807670          else
    7281             m.Tag := p1;
    7282           m.OnClick := DebugMapClick;
     7671            M.Tag := p1;
     7672          M.OnClick := DebugMapClick;
    72837673          if p1 < 10 then
    7284             m.ShortCut := ShortCut(48 + p1, [ssAlt]);
    7285           m.RadioItem := true;
    7286           if m.Tag = MainMap.pDebugMap then
    7287             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);
    72897679        end;
    72907680    end;
     
    73017691      (ClientMode < scContact);
    73027692    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;
    73047694    mCityStat.Enabled := HaveCities;
    7305     mScienceStat.Visible := true;
     7695    mScienceStat.Visible := True;
    73067696    mScienceStat.Enabled := not NoSuper or (MyRO.ResearchTech >= 0) or
    73077697      (MyRO.Happened and phTech <> 0) or (MyRO.Happened and phGameEnd <> 0)
     
    73107700    mEUnitStat.Enabled := MyRO.nEnemyModel > 0;
    73117701    { mWonders.Enabled:= false;
    7312       for i:=0 to nWonder - 1 do if MyRO.Wonder[i].CityID <> WonderNotBuiltYet then
    7313       mWonders.Enabled:=true; }
     7702      for I:=0 to nWonder - 1 do if MyRO.Wonder[I].CityID <> WonderNotBuiltYet then
     7703      mWonders.Enabled:=True; }
    73147704    mDiagram.Enabled := MyRO.Turn >= 2;
    7315     mShips.Enabled := false;
     7705    mShips.Enabled := False;
    73167706    for p1 := 0 to nPl - 1 do
    73177707      if MyRO.Ship[p1].Parts[spComp] + MyRO.Ship[p1].Parts[spPow] +
    73187708        MyRO.Ship[p1].Parts[spHab] > 0 then
    7319         mShips.Enabled := true;
     7709        mShips.Enabled := True;
    73207710  end
    73217711  else if Popup = UnitPopup then
     
    73237713    mox := @MyModel[MyUn[UnFocus].mix];
    73247714    Tile := MyMap[MyUn[UnFocus].Loc];
    7325     extended := Tile and fCity = 0;
    7326     if extended then
     7715    Extended := Tile and fCity = 0;
     7716    if Extended then
    73277717    begin
    73287718      mCity.Caption := Phrases.Lookup('BTN_FOUND');
     
    73357725    end;
    73367726
    7337     extended := extended and ((mox.Kind = mkSettler) or (mox.Kind = mkSlaves)
     7727    Extended := Extended and ((mox.Kind = mkSettler) or (mox.Kind = mkSlaves)
    73387728      and (MyRO.Wonder[woPyramids].EffectiveOwner >= 0)) and
    73397729      (MyUn[UnFocus].Master < 0) and (Tile and fDeadLands = 0);
    73407730    if (mox.Kind = mkFreight) and (Tile and fCity <> 0) and
    73417731      not Phrases2FallenBackToEnglish or
    7342       (Server(sRemoveUnit - sExecute, me, UnFocus, nil^) = eUtilized) then
     7732      (Server(sRemoveUnit - sExecute, Me, UnFocus, nil^) = eUtilized) then
    73437733    begin
    7344       mDisband.Visible := false;
    7345       mUtilize.Visible := true;
     7734      mDisband.Visible := False;
     7735      mUtilize.Visible := True;
    73467736      if mox.Kind = mkFreight then
    73477737        mUtilize.Caption := Phrases.Lookup('UTILIZE')
     
    73517741    else
    73527742    begin
    7353       mDisband.Visible := true;
    7354       mUtilize.Visible := false
     7743      mDisband.Visible := True;
     7744      mUtilize.Visible := False
    73557745    end;
    73567746    mGoOn.Visible := MyUn[UnFocus].Status and (usGoto or usWaiting) = usGoto or
     
    73597749    mRecover.Visible := (MyUn[UnFocus].Health < 100) and
    73607750      (Tile and fTerrain >= fGrass) and
    7361       ((MyRO.Wonder[woGardens].EffectiveOwner = me) or
     7751      ((MyRO.Wonder[woGardens].EffectiveOwner = Me) or
    73627752      (Tile and fTerrain <> fArctic) and (Tile and fTerrain <> fDesert)) and
    73637753      not((mox.Domain = dAir) and (Tile and fCity = 0) and
     
    73657755    mStay.Visible := not((mox.Domain = dAir) and (Tile and fCity = 0) and
    73667756      (Tile and fTerImp <> tiBase));
    7367     mCity.Visible := extended and (mox.Kind = mkSettler) or
     7757    mCity.Visible := Extended and (mox.Kind = mkSettler) or
    73687758      (Tile and fCity <> 0) and ((mox.Kind in [mkSettler, mkSlaves]) or
    73697759      (MyUn[UnFocus].Flags and unConscripts <> 0));
     
    73737763      (MyUn[UnFocus].Status and (usRecover or usGoto) <> 0);
    73747764
    7375     Test := Server(sLoadUnit - sExecute, me, UnFocus, nil^);
     7765    Test := Server(sLoadUnit - sExecute, Me, UnFocus, nil^);
    73767766    mLoad.Visible := (Test >= rExecuted) or (Test = eNoTime_Load);
    73777767    mUnload.Visible := (MyUn[UnFocus].Master >= 0) or
    73787768      (MyUn[UnFocus].TroopLoad + MyUn[UnFocus].AirLoad > 0);
    7379     mSelectTransport.Visible := Server(sSelectTransport - sExecute, me, UnFocus,
     7769    mSelectTransport.Visible := Server(sSelectTransport - sExecute, Me, UnFocus,
    73807770      nil^) >= rExecuted;
    73817771  end
     
    73847774    mox := @MyModel[MyUn[UnFocus].mix];
    73857775    Tile := MyMap[MyUn[UnFocus].Loc];
    7386     extended := Tile and fCity = 0;
     7776    Extended := Tile and fCity = 0;
    73877777
    73887778    if (Tile and fRiver <> 0) and (MyRO.Tech[adBridgeBuilding] >= tsApplicable)
     
    73907780    begin
    73917781      mRoad.Caption := Phrases.Lookup('BTN_BUILDBRIDGE');
    7392       mRR.Caption := Phrases.Lookup('BTN_BUILDRRBRIDGE');
     7782      mRailRoad.Caption := Phrases.Lookup('BTN_BUILDRRBRIDGE');
    73937783    end
    73947784    else
    73957785    begin
    73967786      mRoad.Caption := Phrases.Lookup('BTN_BUILDROAD');
    7397       mRR.Caption := Phrases.Lookup('BTN_BUILDRR');
     7787      mRailRoad.Caption := Phrases.Lookup('BTN_BUILDRR');
    73987788    end;
    73997789    if Tile and fTerrain = fForest then
     
    74047794      mClear.Caption := Phrases.Lookup('BTN_DRAIN');
    74057795
    7406     extended := extended and ((mox.Kind = mkSettler) or (mox.Kind = mkSlaves)
     7796    Extended := Extended and ((mox.Kind = mkSettler) or (mox.Kind = mkSlaves)
    74077797      and (MyRO.Wonder[woPyramids].EffectiveOwner >= 0)) and
    74087798      (MyUn[UnFocus].Master < 0);
    7409     if extended then
     7799    if Extended then
    74107800    begin
    74117801      mRoad.Visible := JobTest(UnFocus, jRoad, [eNoBridgeBuilding, eTreaty]);
    7412       mRR.Visible := JobTest(UnFocus, jRR, [eNoBridgeBuilding, eTreaty]);
     7802      mRailRoad.Visible := JobTest(UnFocus, jRR, [eNoBridgeBuilding, eTreaty]);
    74137803      mClear.Visible := JobTest(UnFocus, jClear, [eTreaty]);
    74147804      mIrrigation.Visible := JobTest(UnFocus, jIrr, [eTreaty]);
     
    74277817    else
    74287818    begin
    7429       for i := 0 to Popup.Items.Count - 1 do
    7430         Popup.Items[i].Visible := false;
     7819      for I := 0 to Popup.Items.Count - 1 do
     7820        Popup.Items[I].Visible := False;
    74317821    end;
    74327822  end;
     
    74347824  // set menu seperators
    74357825  LastSep := nil;
    7436   NeedSep := false;
    7437   for i := 0 to Popup.Items.Count - 1 do
    7438     if Popup.Items[i].Caption = '-' then
     7826  NeedSep := False;
     7827  for I := 0 to Popup.Items.Count - 1 do
     7828    if Popup.Items[I].Caption = '-' then
    74397829    begin
    7440       Popup.Items[i].Visible := NeedSep;
     7830      Popup.Items[I].Visible := NeedSep;
    74417831      if NeedSep then
    7442         LastSep := Popup.Items[i];
    7443       NeedSep := false
     7832        LastSep := Popup.Items[I];
     7833      NeedSep := False
    74447834    end
    7445     else if Popup.Items[i].Visible then
    7446       NeedSep := true;
     7835    else if Popup.Items[I].Visible then
     7836      NeedSep := True;
    74477837  if (LastSep <> nil) and not NeedSep then
    7448     LastSep.Visible := false
     7838    LastSep.Visible := False
    74497839end;
    74507840
     
    74657855end;
    74667856
    7467 procedure TMainScreen.CityClosed(Activateuix: integer; StepFocus: boolean;
    7468   SelectFocus: boolean);
    7469 begin
    7470   if supervising then
     7857procedure TMainScreen.CityClosed(Activateuix: Integer; StepFocus: Boolean;
     7858  SelectFocus: Boolean);
     7859begin
     7860  if Supervising then
    74717861  begin
    74727862    SetTroopLoc(-1);
     
    74857875    end
    74867876    else if StepFocus then
    7487       NextUnit(TroopLoc, true)
     7877      NextUnit(TroopLoc, True)
    74887878    else
    74897879    begin
     
    74967886procedure TMainScreen.Toggle(Sender: TObject);
    74977887begin
    7498   TDpiMenuItem(Sender).Checked := not TDpiMenuItem(Sender).Checked
     7888  TDpiMenuItem(Sender).Checked := not TDpiMenuItem(Sender).Checked;
    74997889end;
    75007890
    75017891procedure TMainScreen.PanelBoxMouseMove(Sender: TObject; Shift: TShiftState;
    7502   x, y: integer);
     7892  X, Y: Integer);
    75037893var
    7504   xCentre, yCentre: integer;
     7894  xCentre, yCentre: Integer;
    75057895begin
    75067896  if Tracking and (ssLeft in Shift) then
    75077897  with MainMap do begin
    7508     if (x >= xMini + 2) and (y >= yMini + 2) and (x < xMini + 2 + 2 * G.lx) and
    7509       (y < yMini + 2 + G.ly) then
     7898    if (X >= xMini + 2) and (Y >= yMini + 2) and (X < xMini + 2 + 2 * G.lx) and
     7899      (Y < yMini + 2 + G.ly) then
    75107900    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 +
    75127902        MapWidth div (xxt * 4)) mod G.lx;
    7513       yCentre := (y - yMini - 2);
     7903      yCentre := (Y - yMini - 2);
    75147904      xw := (xCentre - MapWidth div (xxt * 4) + G.lx) mod G.lx;
    75157905      if ywmax <= 0 then
     
    75237913          yw := ywmax;
    75247914      end;
    7525       DpiBitCanvas(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);
    75267916      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,
    75297919          MainTexture.ColorMark, MainTexture.ColorMark)
    75307920      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 -
    75337923          2, MainTexture.ColorMark, MainTexture.ColorMark);
    7534       DpiBitCanvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly,
     7924      DpiBitBltCanvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly,
    75357925        Buffer.Canvas, 0, 0);
    75367926      MainOffscreenPaint;
     
    75427932  end
    75437933  else
    7544     Tracking := false;
     7934    Tracking := False;
    75457935end;
    75467936
    75477937procedure TMainScreen.PanelBoxMouseUp(Sender: TObject; Button: TMouseButton;
    7548   Shift: TShiftState; x, y: integer);
     7938  Shift: TShiftState; X, Y: Integer);
    75497939begin
    75507940  if Tracking then
    75517941  begin
    7552     Tracking := false;
     7942    Tracking := False;
    75537943    xwMini := xw;
    75547944    ywMini := yw;
     
    75597949
    75607950procedure TMainScreen.MapBoxMouseMove(Sender: TObject; Shift: TShiftState;
    7561   x, y: integer);
     7951  X, Y: Integer);
    75627952var
    7563   MouseLoc: integer;
    7564 begin
    7565   xMouse := x;
    7566   yMouse := y;
     7953  MouseLoc: Integer;
     7954begin
     7955  xMouse := X;
     7956  yMouse := Y;
    75677957  if (ClientMode = cEditMap) and (ssLeft in Shift) and not Tracking then
    75687958  begin
    7569     MouseLoc := LocationOfScreenPixel(x, y);
     7959    MouseLoc := LocationOfScreenPixel(X, Y);
    75707960    if MouseLoc <> BrushLoc then
    7571       MapBoxMouseDown(nil, mbLeft, Shift, x, y);
     7961      MapBoxMouseDown(nil, mbLeft, Shift, X, Y);
    75727962  end
    7573   (* else if idle and (UnFocus>=0) then
     7963  (* else if Idle and (UnFocus>=0) then
    75747964    begin
    75757965    qx:=(xMouse*32+yMouse*66+16*66) div(32*66)-1;
     
    75847974  TDpiMenuItem(Sender).Checked := not TDpiMenuItem(Sender).Checked;
    75857975  SetMapOptions;
    7586   MapValid := false;
     7976  MapValid := False;
    75877977  PaintAllMaps;
    75887978end;
     
    75907980procedure TMainScreen.mNamesClick(Sender: TObject);
    75917981var
    7592   p1: integer;
     7982  p1: Integer;
    75937983begin
    75947984  mNames.Checked := not mNames.Checked;
     
    76007990      else
    76017991        Tribe[p1].NumberName := p1;
    7602   MapValid := false;
     7992  MapValid := False;
    76037993  PaintAll;
    76047994end;
    76057995
    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));
     7996function TMainScreen.IsPanelPixel(X, Y: Integer): Boolean;
     7997begin
     7998  Result := (Y >= TopBarHeight + MapHeight) or (Y >= ClientHeight - PanelHeight)
     7999    and ((X < xMidPanel) or (X >= xRightPanel));
    76108000end;
    76118001
    76128002procedure TMainScreen.FormMouseDown(Sender: TObject; Button: TMouseButton;
    7613   Shift: TShiftState; x, y: integer);
    7614 begin
    7615   if idle then
    7616     if (x < 40) and (y < 40) then
     8003  Shift: TShiftState; X, Y: Integer);
     8004begin
     8005  if Idle then
     8006    if (X < 40) and (Y < 40) then
    76178007    begin
    76188008      if GameMode <> cMovie then
     
    76268016      end;
    76278017    end
    7628     else if IsPanelPixel(x, y) then
    7629       PanelBoxMouseDown(Sender, Button, Shift, x,
    7630         y - (ClientHeight - PanelHeight))
    7631     else if (y >= TopBarHeight) and (x >= MapOffset) and
    7632       (x < MapOffset + MapWidth) then
    7633       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)
    76348024end;
    76358025
    76368026procedure TMainScreen.FormMouseMove(Sender: TObject; Shift: TShiftState;
    7637   x, y: integer);
    7638 begin
    7639   if idle then
    7640     if IsPanelPixel(x, y) then
    7641       PanelBoxMouseMove(Sender, Shift, x, y - (ClientHeight - PanelHeight))
    7642     else if (y >= TopBarHeight) and (x >= MapOffset) and
    7643       (x < MapOffset + MapWidth) then
    7644       MapBoxMouseMove(Sender, Shift, x - MapOffset, y - TopBarHeight);
     8027  X, Y: Integer);
     8028begin
     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);
    76458035end;
    76468036
    76478037procedure TMainScreen.FormMouseUp(Sender: TObject; Button: TMouseButton;
    7648   Shift: TShiftState; x, y: integer);
    7649 begin
    7650   if idle then
    7651     PanelBoxMouseUp(Sender, Button, Shift, x, y - (ClientHeight - PanelHeight));
     8038  Shift: TShiftState; X, Y: Integer);
     8039begin
     8040  if Idle then
     8041    PanelBoxMouseUp(Sender, Button, Shift, X, Y - (ClientHeight - PanelHeight));
    76528042end;
    76538043
     
    76588048    with Canvas do
    76598049    begin // pillarbox, make left and right border black
    7660       if me < 0 then
     8050      if Me < 0 then
    76618051        Brush.Color := $000000
    76628052      else
     
    76848074      Brush.Style := bsClear;
    76858075    end;
    7686   DpiBitCanvas(Canvas, MapOffset, TopBarHeight, MapWidth, MapHeight - overlap,
    7687     offscreen.Canvas, 0, 0);
    7688   DpiBitCanvas(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,
    76898079    0, 0);
    76908080  if xMidPanel > MapOffset then
    7691     DpiBitCanvas(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,
    76938083      xMidPanel - MapOffset, MapHeight - overlap)
    76948084  else
    7695     DpiBitCanvas(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,
    76978087      MapHeight - overlap);
    76988088  if xRightPanel < MapOffset + MapWidth then
    7699     DpiBitCanvas(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,
    77018091      ClientWidth div 2 - MapOffset, MapHeight - overlap)
    77028092  else
    7703     DpiBitCanvas(Canvas, ClientWidth div 2, TopBarHeight + MapHeight - overlap,
     8093    DpiBitBltCanvas(Canvas, ClientWidth div 2, TopBarHeight + MapHeight - overlap,
    77048094      MapOffset + MapWidth - ClientWidth div 2, overlap,
    7705       offscreen.Canvas, ClientWidth div 2 - MapOffset,
     8095      Offscreen.Canvas, ClientWidth div 2 - MapOffset,
    77068096      MapHeight - overlap);
    7707   DpiBitCanvas(Canvas, 0, TopBarHeight + MapHeight - overlap, xMidPanel,
     8097  DpiBitBltCanvas(Canvas, 0, TopBarHeight + MapHeight - overlap, xMidPanel,
    77088098    overlap, Panel.Canvas, 0, 0);
    7709   DpiBitCanvas(Canvas, xRightPanel, TopBarHeight + MapHeight - overlap,
     8099  DpiBitBltCanvas(Canvas, xRightPanel, TopBarHeight + MapHeight - overlap,
    77108100    Panel.width - xRightPanel, overlap, Panel.Canvas, xRightPanel, 0);
    7711   DpiBitCanvas(Canvas, 0, TopBarHeight + MapHeight, Panel.width,
     8101  DpiBitBltCanvas(Canvas, 0, TopBarHeight + MapHeight, Panel.width,
    77128102    PanelHeight - overlap, Panel.Canvas, 0, overlap);
    77138103  if (pLogo >= 0) and (G.RO[pLogo] = nil) and (AILogo[pLogo] <> nil) then
    7714     DpiBitCanvas(Canvas, xRightPanel + 10 - (16 + 64),
     8104    DpiBitBltCanvas(Canvas, xRightPanel + 10 - (16 + 64),
    77158105      ClientHeight - PanelHeight, 64, 64, AILogo[pLogo].Canvas, 0, 0);
    77168106end;
    77178107
    7718 procedure TMainScreen.RectInvalidate(Left, Top, Rigth, Bottom: integer);
     8108procedure TMainScreen.RectInvalidate(Left, Top, Rigth, Bottom: Integer);
    77198109var
    77208110  r0: HRgn;
    77218111begin
    77228112  r0 := DpiCreateRectRgn(Left, Top, Rigth, Bottom);
    7723   InvalidateRgn(Handle, r0, false);
     8113  InvalidateRgn(Handle, r0, False);
    77248114  DeleteObject(r0);
    77258115end;
    77268116
    7727 procedure TMainScreen.SmartRectInvalidate(Left, Top, Rigth, Bottom: integer);
     8117procedure TMainScreen.SmartRectInvalidate(Left, Top, Rigth, Bottom: Integer);
    77288118var
    7729   i: integer;
     8119  I: Integer;
    77308120  r0, r1: HRgn;
    77318121begin
    77328122  r0 := DpiCreateRectRgn(Left, Top, Rigth, Bottom);
    7733   for i := 0 to ControlCount - 1 do
    7734     if not(Controls[i] is TArea) and Controls[i].Visible then
     8123  for I := 0 to ControlCount - 1 do
     8124    if not(Controls[I] is TArea) and Controls[I].Visible then
    77358125    begin
    7736       with Controls[i].BoundsRect do
     8126      with Controls[I].BoundsRect do
    77378127        r1 := DpiCreateRectRgn(Left, Top, Right, Bottom);
    77388128      CombineRgn(r0, r0, r1, RGN_DIFF);
    77398129      DeleteObject(r1);
    77408130    end;
    7741   InvalidateRgn(Handle, r0, false);
     8131  InvalidateRgn(Handle, r0, False);
    77428132  DeleteObject(r0);
    77438133end;
     
    78048194procedure TMainScreen.FormClose(Sender: TObject; var Action: TCloseAction);
    78058195begin
    7806   Timer1.Enabled := false;
     8196  Timer1.Enabled := False;
    78078197end;
    78088198
    78098199procedure TMainScreen.Radio(Sender: TObject);
    78108200begin
    7811   TDpiMenuItem(Sender).Checked := true;
     8201  TDpiMenuItem(Sender).Checked := True;
    78128202end;
    78138203
    78148204procedure TMainScreen.mManipClick(Sender: TObject);
    78158205var
    7816   Flag: integer;
     8206  Flag: Integer;
    78178207begin
    78188208  with TDpiMenuItem(Sender) do
     
    78268216      Play('CHEAT');
    78278217    end;
    7828     if not supervising then
     8218    if not Supervising then
    78298219    begin
    78308220      if Flag = tfUncover then
    78318221      begin
    7832         MapValid := false;
     8222        MapValid := False;
    78338223        PaintAllMaps;
    78348224      end
     
    78548244  else
    78558245  begin
    7856     MapValid := false;
     8246    MapValid := False;
    78578247    PaintAllMaps;
    78588248  end; // update main map
     
    78738263  end;
    78748264  SetMapOptions;
    7875   MapValid := false;
     8265  MapValid := False;
    78768266  PaintAllMaps;
    78778267end;
     
    78918281  end;
    78928282  SetMapOptions;
    7893   MapValid := false;
     8283  MapValid := False;
    78948284  PaintAllMaps;
    78958285end;
    78968286
    7897 procedure TMainScreen.FormKeyUp(Sender: TObject; var Key: word;
     8287procedure TMainScreen.FormKeyUp(Sender: TObject; var Key: Word;
    78988288  Shift: TShiftState);
    78998289begin
    7900   if idle and (Key = VK_APPS) then
     8290  if Idle and (Key = VK_APPS) then
    79018291  begin
    79028292    InitPopup(GamePopup);
     
    79068296      GamePopup.Popup(Left + 4, Top + DpiGetSystemMetrics(SM_CYCAPTION) + 4 +
    79078297        TopBarHeight - 1);
    7908     exit;
     8298    Exit;
    79098299  end; // windows menu button calls game menu
    79108300end;
     
    79128302procedure TMainScreen.CreateUnitClick(Sender: TObject);
    79138303var
    7914   p1, mix: integer;
     8304  p1, mix: Integer;
    79158305begin
    79168306  p1 := TComponent(Sender).Tag shr 16;
    79178307  mix := TComponent(Sender).Tag and $FFFF;
    7918   if Server(sCreateUnit + p1 shl 4, me, mix, EditLoc) >= rExecuted then
     8308  if Server(sCreateUnit + p1 shl 4, Me, mix, EditLoc) >= rExecuted then
    79198309    PaintLoc(EditLoc);
    79208310end;
     
    79348324  SoundMode := smOnAlt;
    79358325end;
    7936 
    7937 { procedure TMainScreen.AdviceBtnClick;
    7938   var
    7939   OldAdviceLoc: integer;
    7940   begin
    7941   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   var
    7951   OldAdviceLoc,x,y: integer;
    7952   begin
    7953   if Loc<>MainMap.AdviceLoc then
    7954   begin
    7955   if Loc>=0 then
    7956   begin // center
    7957   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; }
    79688326
    79698327procedure TMainScreen.UnitInfoBtnClick(Sender: TObject);
     
    80048362
    80058363procedure TMainScreen.SetTileSize(TileSize: TTileSize; Loc: Integer; MapPos: TPoint);
    8006 var
    8007   i: integer;
    80088364begin
    80098365  MainMap.TileSize := TileSize;
     
    80128368  SetMapPos(Loc, MapPos);
    80138369  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);
    80178371end;
    80188372
    80198373procedure TMainScreen.SaveMenuItemsState;
    80208374var
    8021   i, j: integer;
     8375  I, J: Integer;
    80228376begin
    80238377  if soTellAI in OptionChecked then OptionChecked := [soTellAI]
    80248378    else OptionChecked := [];
    8025   for i := 0 to ComponentCount - 1 do
    8026     if Components[i] is TDpiMenuItem then
    8027       for j := 0 to Length(SaveOption) - 1 do
    8028         if TDpiMenuItem(Components[i]).Checked and
    8029           (TDpiMenuItem(Components[i]).Tag = SaveOption[j]) then
    8030           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)];
    80318385end;
    80328386
     
    80408394  with Reg do
    80418395  try
    8042     OpenKey(AppRegistryKey, true);
     8396    OpenKey(AppRegistryKey, True);
    80438397    WriteInteger('TileSize', Integer(MainMap.TileSize));
    80448398    WriteInteger('OptionChecked', Integer(OptionChecked));
    80458399    WriteInteger('MapOptionChecked', Integer(MapOptionChecked));
    8046     WriteInteger('CityReport', integer(CityRepMask));
     8400    WriteInteger('CityReport', Integer(CityRepMask));
    80478401  finally
    80488402    Free;
     
    80568410end;
    80578411
     8412procedure TMainScreen.ArrangeDialogs;
     8413begin
     8414  ArrangeDialog(FListDlg);
     8415  ArrangeDialog(FHelpDlg);
     8416  ArrangeDialog(FUnitStatDlg);
     8417  ArrangeDialog(FDiaDlg);
     8418  ArrangeDialog(FNatStatDlg);
     8419end;
     8420
     8421procedure TMainScreen.ArrangeDialog(Form: TBufferedDrawDlg);
     8422begin
     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;
     8447end;
     8448
    80588449procedure TMainScreen.ScrollBarUpdate(Sender: TObject);
    80598450begin
  • branches/highdpi/LocalPlayer/Tribes.pas

    r349 r465  
    66uses
    77  Protocol, ScreenTools, LazFileUtils, Classes, Graphics, SysUtils, Global,
    8   UGraphicSet;
     8  GraphicSet;
    99
    1010type
     
    2020    yShield: Integer;
    2121  end;
     22
     23  { TModelPictureInfo }
    2224
    2325  TModelPictureInfo = record
     
    2729    Hash: Integer;
    2830    GrName: ShortString;
     31    function GetCommandDataSize: Byte;
    2932  end;
    3033
     
    4649    constructor Create(FileName: string);
    4750    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}
    5053{$IFNDEF SCR} function TString(Template: string): string;
    5154    function TPhrase(Item: string): string; {$ENDIF}
     
    6972function CityName(Founder: Integer): string;
    7073function ModelCode(const ModelInfo: TModelInfo): Integer;
    71 procedure FindStdModelPicture(Code: Integer; var pix: Integer; var Name: string);
     74procedure FindStdModelPicture(Code: Integer; out pix: Integer; out Name: string);
    7275function GetTribeInfo(FileName: string; var Name: string; var Color: TColor): Boolean;
    73 procedure FindPosition(HGr: TGraphicSet; x, y, xmax, ymax: Integer; Mark: TColor;
     76procedure FindPosition(HGr: TGraphicSet; X, Y, xmax, ymax: Integer; Mark: TColor;
    7477  var xp, yp: Integer);
    7578
     
    212215function Get: string;
    213216var
    214   p: Integer;
     217  P: Integer;
    215218begin
    216219  while (Input <> '') and ((Input[1] = ' ') or (Input[1] = #9)) do
    217220    Delete(Input, 1, 1);
    218   p := Pos(',', Input);
    219   if p = 0 then
    220     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);
    223226end;
    224227
    225228function GetNum: Integer;
    226229var
    227   i: Integer;
    228 begin
    229   Val(Get, Result, i);
    230   if i <> 0 then
     230  I: Integer;
     231begin
     232  Val(Get, Result, I);
     233  if I <> 0 then
    231234    Result := 0;
    232235end;
    233236
    234 procedure FindStdModelPicture(Code: Integer; var pix: Integer; var Name: string);
    235 var
    236   i: Integer;
    237 begin
    238   for i := 0 to StdUnitScript.Count - 1 do
     237procedure FindStdModelPicture(Code: Integer; out pix: Integer; out Name: string);
     238var
     239  I: Integer;
     240begin
     241  for I := 0 to StdUnitScript.Count - 1 do
    239242  begin // look through StdUnits
    240     Input := StdUnitScript[i];
     243    Input := StdUnitScript[I];
    241244    pix := GetNum;
    242245    if Code = GetNum then
     
    281284  CloseFile(TribeScript);
    282285  Result := Found = 3;
     286end;
     287
     288{ TModelPictureInfo }
     289
     290function TModelPictureInfo.GetCommandDataSize: Byte;
     291begin
     292  Result := SizeOf(trix) + SizeOf(mix) + SizeOf(pix) + SizeOf(Hash) + 1 +
     293    Length(GrName);
    283294end;
    284295
     
    329340end;
    330341
    331 procedure FindPosition(HGr: TGraphicSet; x, y, xmax, ymax: Integer; Mark: TColor;
     342procedure FindPosition(HGr: TGraphicSet; X, Y, xmax, ymax: Integer; Mark: TColor;
    332343  var xp, yp: Integer);
    333344begin
    334345  xp := 0;
    335   while (xp < xmax) and (HGr.Data.Canvas.Pixels[x + 1 + xp, y] <> Mark) do
     346  while (xp < xmax) and (HGr.Data.Canvas.Pixels[X + 1 + xp, Y] <> Mark) do
    336347    Inc(xp);
    337348  yp := 0;
    338   while (yp < ymax) and (HGr.Data.Canvas.Pixels[x, y + 1 + yp] <> Mark) do
     349  while (yp < ymax) and (HGr.Data.Canvas.Pixels[X, Y + 1 + yp] <> Mark) do
    339350    Inc(yp);
    340351end;
    341352
    342 function TTribe.GetCityName(i: Integer): string;
     353function TTribe.GetCityName(I: Integer): string;
    343354begin
    344355  Result := '';
    345   if nCityLines > i then
    346   begin
    347     Result := Script[CityLine0 + i];
     356  if nCityLines > I then
     357  begin
     358    Result := Script[CityLine0 + I];
    348359    while (Result <> '') and ((Result[1] = ' ') or (Result[1] = #9)) do
    349360      Delete(Result, 1, 1);
     
    351362{$IFNDEF SCR}
    352363  else
    353     Result := Format(TPhrase('GENCITY'), [i + 1]);
     364    Result := Format(TPhrase('GENCITY'), [I + 1]);
    354365{$ENDIF}
    355366end;
    356367
    357368{$IFNDEF SCR}
    358 procedure TTribe.SetCityName(i: Integer; NewName: string);
    359 begin
    360   while nCityLines <= i do
     369procedure TTribe.SetCityName(I: Integer; NewName: string);
     370begin
     371  while nCityLines <= I do
    361372  begin
    362373    Script.Insert(CityLine0 + nCityLines, Format(TPhrase('GENCITY'),
     
    364375    Inc(nCityLines);
    365376  end;
    366   Script[CityLine0 + i] := NewName;
     377  Script[CityLine0 + I] := NewName;
    367378end;
    368379
    369380function TTribe.TString(Template: string): string;
    370381var
    371   p: Integer;
     382  P: Integer;
    372383  Variant: Char;
    373384  CaseUp: Boolean;
    374385begin
    375386  repeat
    376     p := pos('#', Template);
    377     if (p = 0) or (p = Length(Template)) then
     387    P := Pos('#', Template);
     388    if (P = 0) or (P = Length(Template)) then
    378389      Break;
    379     Variant := Template[p + 1];
     390    Variant := Template[P + 1];
    380391    CaseUp := Variant in ['A' .. 'Z'];
    381392    if CaseUp then
    382393      Inc(Variant, 32);
    383     Delete(Template, p, 2);
     394    Delete(Template, P, 2);
    384395    if Variant in ['a' .. 'z'] then
    385396    begin
    386397      if NumberName < 0 then
    387         Insert(Name[Variant], Template, p)
     398        Insert(Name[Variant], Template, P)
    388399      else
    389         Insert(Format('P%d', [NumberName]), Template, p);
    390       if CaseUp and (Length(Template) >= p) and
    391         (Template[p] in ['a' .. 'z', #$E0 .. #$FF]) then
    392         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);
    393404    end
    394405  until False;
     
    407418  TLine = array [0 .. 649, 0 .. 2] of Byte;
    408419var
    409   i, x, Gray: Integer;
     420  I, X, Gray: Integer;
    410421  Item: string;
    411422begin
     
    415426  with Script do
    416427  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) <>
    419430        '#AGE' + char(48 + Age) + ' ') do
    420       Inc(i);
    421     if i < Count then
    422     begin
    423       Input := Strings[i];
     431      Inc(I);
     432    if I < Count then
     433    begin
     434      Input := Strings[I];
    424435      system.Delete(Input, 1, 6);
    425436      Item := Get;
     
    430441        if CompareText(Item, 'stdcities') = 0 then
    431442          case cpix of
    432             3:
    433               cpix := 0;
    434             6:
    435             begin
     443            3: cpix := 0;
     444            6: begin
    436445              cpix := 0;
    437446              Item := 'Nation2';
    438             end
     447            end;
    439448          end;
    440449        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,
    445453              xShield, yShield);
    446454            // FindPosition(cHGr,x*65,cpix*49,$FFFFFF,xf,yf);
     
    478486procedure TTribe.SetModelPicture(const Info: TModelPictureInfo; IsNew: Boolean);
    479487var
    480   i: Integer;
     488  I: Integer;
    481489  ok: Boolean;
    482490begin
     
    485493    if not IsNew then
    486494    begin
    487       i := nPictureList - 1;
    488       while (i >= 0) and (PictureList[i].Hash <> Info.Hash) do
    489         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;
    496504    end
    497505    else
     
    507515      // read model name from tribe script
    508516      ok := False;
    509       for i := 0 to Script.Count - 1 do
    510       begin
    511         Input := Script[i];
     517      for I := 0 to Script.Count - 1 do
     518      begin
     519        Input := Script[I];
    512520        if Input = '#UNITS ' + ExtractFileNameOnly(GrName) then
    513521          ok := True
     
    523531      if ModelName[mix] = '' then
    524532      begin // read model name from StdUnits.txt
    525         for i := 0 to StdUnitScript.Count - 1 do
     533        for I := 0 to StdUnitScript.Count - 1 do
    526534        begin
    527           Input := StdUnitScript[i];
     535          Input := StdUnitScript[I];
    528536          if GetNum = pix then
    529537          begin
     
    559567  Code, Turn: Integer; ForceNew: Boolean): Boolean;
    560568var
    561   i: Integer;
     569  I: Integer;
    562570  Cnt: Integer;
    563571  HGr: TGraphicSet;
     
    598606  if not ForceNew and (Picture.Hash > 0) then
    599607  begin
    600     for i := 0 to nPictureList - 1 do
    601       if PictureList[i].Hash = Picture.Hash then
    602       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;
    605613        Result := False;
    606614        Exit;
     
    614622  TestPic.GrName := 'StdUnits.png';
    615623  HGr := HGrStdUnits;
    616   for i := 0 to StdUnitScript.Count - 1 do
     624  for I := 0 to StdUnitScript.Count - 1 do
    617625  begin // look through StdUnits
    618     Input := StdUnitScript[i];
     626    Input := StdUnitScript[I];
    619627    Check;
    620628  end;
    621629
    622630  ok := False;
    623   for i := 0 to Script.Count - 1 do
     631  for I := 0 to Script.Count - 1 do
    624632  begin // look through units defined in tribe script
    625     Input := Script[i];
     633    Input := Script[I];
    626634    if Copy(Input, 1, 6) = '#UNITS' then
    627635    begin
  • branches/highdpi/LocalPlayer/UnitStat.pas

    r405 r465  
    55
    66uses
    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;
    109
    1110type
     11  TUnitStatDialogKind = (dkOwnModel, dkOwnUnit, dkEnemyModel, dkEnemyUnit,
     12    dkEnemyCityDefense, dkEnemyCity);
     13
    1214  TUnitStatDlg = class(TBufferedDrawDlg)
    1315    SwitchBtn: TButtonB;
     
    2628  private
    2729    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;
    2839  public
    2940    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
    5049
    5150implementation
    5251
    5352uses
    54   Tribes, Help, Directories, UTexture;
     53  Term, Tribes, Help, Directories, Texture;
    5554
    5655{$R *.lfm}
     
    8281  Back.PixelFormat := pf24bit;
    8382  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);
    8584  Template := TDpiBitmap.Create;
    8685  Template.PixelFormat := pf24bit;
     
    10099  if MainTexture.Age <> AgePrepared then begin
    101100    AgePrepared := MainTexture.Age;
    102     DpiBitCanvas(Back.Canvas, 0, 0, wCommon, hOwnModel,
     101    DpiBitBltCanvas(Back.Canvas, 0, 0, wCommon, hOwnModel,
    103102      MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2,
    104103      (MainTexture.Height - hOwnModel) div 2);
    105     DpiBitCanvas(Back.Canvas, wCommon, 0, wCommon, hEnemyModel,
     104    DpiBitBltCanvas(Back.Canvas, wCommon, 0, wCommon, hEnemyModel,
    106105      MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2,
    107106      (MainTexture.Height - hEnemyModel) div 2);
    108     DpiBitCanvas(Back.Canvas, 2 * wCommon, 0, wCommon, hEnemyUnit,
     107    DpiBitBltCanvas(Back.Canvas, 2 * wCommon, 0, wCommon, hEnemyUnit,
    109108      MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2,
    110109      (MainTexture.Height - hEnemyUnit) div 2);
    111     DpiBitCanvas(Back.Canvas, 3 * wCommon, 0, wCommon, hEnemyCityDefense,
     110    DpiBitBltCanvas(Back.Canvas, 3 * wCommon, 0, wCommon, hEnemyCityDefense,
    112111      MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2,
    113112      (MainTexture.Height - hEnemyCityDefense) div 2);
    114     DpiBitCanvas(Back.Canvas, 4 * wCommon, 0, wCommon, hEnemyCity,
     113    DpiBitBltCanvas(Back.Canvas, 4 * wCommon, 0, wCommon, hEnemyCity,
    115114      MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2,
    116115      (MainTexture.Height - hEnemyCity) div 2);
     
    121120procedure TUnitStatDlg.FormShow(Sender: TObject);
    122121var
    123   owner, mix: integer;
    124   IsSpecialUnit: boolean;
     122  Owner, mix: Integer;
     123  IsSpecialUnit: Boolean;
    125124begin
    126125  if Kind in [dkEnemyUnit, dkEnemyCityDefense, dkEnemyCity] then
     
    132131        euixShow := MyRO.nEnemyUn - 1;
    133132        while (euixShow >= 0) and (MyRO.EnemyUn[euixShow].Loc <> UnitLoc) do
    134           dec(euixShow);
    135         assert(euixShow >= 0);
     133          Dec(euixShow);
     134        Assert(euixShow >= 0);
    136135      end;
    137136      with MyRO.EnemyUn[euixShow] do
    138137      begin
    139138        mox := @MyRO.EnemyModel[emix];
    140         if not Assigned(Tribe[owner].ModelPicture[mix].HGr) then
     139        if not Assigned(Tribe[Owner].ModelPicture[mix].HGr) then
    141140          InitEnemyModel(emix);
    142       end
     141      end;
    143142    end
    144143    else
     
    148147      ecixShow := MyRO.nEnemyCity - 1;
    149148      while (ecixShow >= 0) and (MyRO.EnemyCity[ecixShow].Loc <> UnitLoc) do
    150         dec(ecixShow);
    151       assert(ecixShow >= 0);
     149        Dec(ecixShow);
     150      Assert(ecixShow >= 0);
    152151    end;
    153152  end;
    154153  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;
    167160  end;
    168161
     
    171164    Left := UserLeft;
    172165    Top := UserTop;
    173   end
    174   else
    175   begin
     166  end else begin
    176167    Left := (DpiScreen.Width - Width) div 2;
    177168    Top := (DpiScreen.Height - Height) div 2;
    178169  end;
    179170
    180   SwitchBtn.Visible := not supervising and (Kind = dkOwnModel);
    181   ConscriptsBtn.Visible := not supervising and (Kind = dkOwnModel) and
     171  SwitchBtn.Visible := not Supervising and (Kind = dkOwnModel);
     172  ConscriptsBtn.Visible := not Supervising and (Kind = dkOwnModel) and
    182173    (MyRO.Tech[adConscription] >= tsApplicable) and
    183174    (MyModel[mixShow].Domain = dGround) and (MyModel[mixShow].Kind < mkScout);
    184   IsSpecialUnit := false;
     175  IsSpecialUnit := False;
    185176  if Kind in [dkEnemyCity, dkEnemyCityDefense] then
    186177    Caption := CityName(MyRO.EnemyCity[ecixShow].ID)
     
    188179  begin
    189180    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;
    205193        mix := mox.mix;
    206194        IsSpecialUnit := mox.Kind >= $10;
     
    218206end;
    219207
    220 procedure TUnitStatDlg.ShowNewContent_OwnModel(NewMode, mix: integer);
     208procedure TUnitStatDlg.ShowNewContent_OwnModel(NewMode: TWindowMode; mix: Integer);
    221209begin
    222210  Kind := dkOwnModel;
     
    225213end;
    226214
    227 procedure TUnitStatDlg.ShowNewContent_OwnUnit(NewMode, uix: integer);
     215procedure TUnitStatDlg.ShowNewContent_OwnUnit(NewMode: TWindowMode; uix: Integer);
    228216begin
    229217  Kind := dkOwnUnit;
     
    232220end;
    233221
    234 procedure TUnitStatDlg.ShowNewContent_EnemyUnit(NewMode, euix: integer);
     222procedure TUnitStatDlg.ShowNewContent_EnemyUnit(NewMode: TWindowMode; euix: Integer);
    235223begin
    236224  Kind := dkEnemyUnit;
     
    240228end;
    241229
    242 procedure TUnitStatDlg.ShowNewContent_EnemyLoc(NewMode, Loc: integer);
     230procedure TUnitStatDlg.ShowNewContent_EnemyLoc(NewMode: TWindowMode; Loc: Integer);
    243231begin
    244232  Kind := dkEnemyUnit;
     
    248236end;
    249237
    250 procedure TUnitStatDlg.ShowNewContent_EnemyModel(NewMode, emix: integer);
     238procedure TUnitStatDlg.ShowNewContent_EnemyModel(NewMode: TWindowMode; emix: Integer);
    251239begin
    252240  Kind := dkEnemyModel;
     
    255243end;
    256244
    257 procedure TUnitStatDlg.ShowNewContent_EnemyCity(NewMode, Loc: integer);
     245procedure TUnitStatDlg.ShowNewContent_EnemyCity(NewMode: TWindowMode; Loc: Integer);
    258246begin
    259247  if MyMap[Loc] and fUnit <> 0 then
     
    271259  begin
    272260    UserLeft := Left;
    273     UserTop := Top
    274   end;
    275   if OffscreenUser = self then
     261    UserTop := Top;
     262  end;
     263  if OffscreenUser = Self then
    276264    OffscreenUser := nil;
    277265end;
     
    286274  PPicture: ^TModelPicture;
    287275
    288   function IsToCount(emix: integer): boolean;
     276  function IsToCount(emix: Integer): Boolean;
    289277  var
    290278    PTestPicture: ^TModelPicture;
     
    294282      PTestPicture := @Tribe[MyRO.EnemyModel[emix].owner].ModelPicture
    295283        [MyRO.EnemyModel[emix].mix];
    296       result := (PPicture.HGr = PTestPicture.HGr) and
     284      Result := (PPicture.HGr = PTestPicture.HGr) and
    297285        (PPicture.pix = PTestPicture.pix) and
    298286        (ModelHash(mox^) = ModelHash(MyRO.EnemyModel[emix]));
    299287    end
    300288    else
    301       result := (MyRO.EnemyModel[emix].owner = mox.owner) and
     289      Result := (MyRO.EnemyModel[emix].owner = mox.owner) and
    302290        (MyRO.EnemyModel[emix].mix = mox.mix);
    303291  end;
    304292
    305   procedure FeatureBar(dst: TDpiBitmap; x, y: integer; const mi: TModelInfo;
     293  procedure FeatureBar(dst: TDpiBitmap; X, Y: Integer; const mi: TModelInfo;
    306294    T: TTexture);
    307295  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);
    312300    with dst.Canvas do
    313301      if mi.Kind >= $10 then
    314302      begin
    315         s := Phrases.Lookup('UNITSPECIAL');
     303        S := Phrases.Lookup('UNITSPECIAL');
    316304        Font.Color := $000000;
    317         Textout(x - 1, y + 1, s);
     305        Textout(X - 1, Y + 1, S);
    318306        Font.Color := $B0B0B0;
    319         Textout(x - 2, y, s);
     307        Textout(X - 2, Y, S);
    320308      end
    321309      else
     
    323311        Font.Color := $000000;
    324312        dx := 2;
    325         for i := 3 to nFeature - 1 do
     313        for I := 3 to nFeature - 1 do
    326314        begin
    327315          num := 0;
    328           case i of
     316          case I of
    329317            mcSeaTrans:
    330318              if mi.Domain = dSea then
     
    342330                num := mi.TTrans;
    343331            mcFirstNonCap .. nFeature - 1:
    344               if mi.Cap and (1 shl (i - mcFirstNonCap)) <> 0 then
    345                 num := 1
     332              if mi.Cap and (1 shl (I - mcFirstNonCap)) <> 0 then
     333                num := 1;
    346334          end;
    347335          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))
    349337          then
    350338          begin
    351339            if num > 1 then
    352340            begin
    353               s := IntToStr(num);
    354               w := TextWidth(s);
     341              S := IntToStr(num);
     342              W := TextWidth(S);
    355343              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));
    357345              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);
    360348            end;
    361349            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));
    363351            Brush.Style := bsClear;
    364             Sprite(dst, HGrSystem, x - 1 + dx, y + 4, 10, 10,
    365               66 + i mod 11 * 11, 137 + i div 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);
    367355          end;
    368356        end;
    369357      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);
    377365  end;
    378366
    379367var
    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;
    383371  ui: TUnitInfo;
    384372  mi: TModelInfo;
     
    387375
    388376  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;
    422405  end;
    423406  MarkUsedOffscreen(ClientWidth, ClientHeight);
     
    427410  begin // show city defense facilities
    428411    Cnt := 0;
    429     for i := 0 to 3 do
    430       if MyRO.EnemyCity[ecixShow].Flags and (2 shl i) <> 0 then
    431         inc(Cnt);
    432     x := (wCommon - Cnt * xSizeSmall) div 2 - (Cnt - 1) * 2;
    433     for i := 0 to 3 do
    434       if MyRO.EnemyCity[ecixShow].Flags and (2 shl i) <> 0 then
    435       begin
    436         case i of
    437           0: j := imWalls;
    438           1: j := imCoastalFort;
    439           2: j := imMissileBat;
    440           3: j := imBunker
     412    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;
    441424        end;
    442         Frame(offscreen.Canvas, x - 1, yImp - 1, x + xSizeSmall,
     425        Frame(Offscreen.Canvas, X - 1, yImp - 1, X + xSizeSmall,
    443426          yImp + ySizeSmall, MainTexture.ColorBevelLight,
    444427          MainTexture.ColorBevelShade);
    445         DpiBitCanvas(offscreen.Canvas, x, yImp, xSizeSmall, ySizeSmall,
    446           SmallImp.Canvas, j mod 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);
    449432      end;
    450433  end;
     
    454437    PPicture := @Tribe[mox.owner].ModelPicture[mox.mix];
    455438    Available := 0;
    456     if G.Difficulty[me] = 0 then // supervisor -- count stacked units too
     439    if G.Difficulty[Me] = 0 then // supervisor -- count stacked units too
    457440      for Loc := 0 to G.lx * G.ly - 1 do
    458441      begin
    459442        if MyMap[Loc] and fUnit <> 0 then
    460443        begin
    461           Server(sGetUnits, me, Loc, Cnt);
     444          Server(sGetUnits, Me, Loc, Cnt);
    462445          for uix := 0 to Cnt - 1 do
    463446            if IsToCount(MyRO.EnemyUn[MyRO.nEnemyUn + uix].emix) then
    464               inc(Available);
     447              Inc(Available);
    465448        end;
    466449      end
     
    469452        if (MyRO.EnemyUn[uix].Loc >= 0) and IsToCount(MyRO.EnemyUn[uix].emix)
    470453        then
    471           inc(Available);
     454          Inc(Available);
    472455    Destroyed := 0;
    473456    for emix := 0 to MyRO.nEnemyModel - 1 do
    474457      if IsToCount(emix) then
    475         inc(Destroyed, MyRO.EnemyModel[emix].Lost);
     458        Inc(Destroyed, MyRO.EnemyModel[emix].Lost);
    476459  end
    477460  else
     
    480463    for uix := 0 to MyRO.nUn - 1 do
    481464      if (MyUn[uix].Loc >= 0) and (MyUn[uix].mix = mixShow) then
    482         inc(Available);
     465        Inc(Available);
    483466    InProd := 0;
    484467    for cix := 0 to MyRO.nCity - 1 do
    485468      if (MyCity[cix].Loc >= 0) and
    486469        (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]);
    491474  if Kind in [dkEnemyCityDefense, dkEnemyCity] then
    492475  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);
    499482  end;
    500483
     
    502485  begin // show unit stats
    503486    if Kind = dkOwnModel then
    504       MakeModelInfo(me, mixShow, MyModel[mixShow], mi)
     487      MakeModelInfo(Me, mixShow, MyModel[mixShow], mi)
    505488    else if Kind = dkOwnUnit then
    506489    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);
    509492    end
    510493    else
     
    522505          { Frame(offscreen.canvas,xView-1,yView-1,xView+64,yView+48,
    523506            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,
    525508            MainTexture.ColorBevelShade,MainTexture.ColorBevelLight); }
    526           with offscreen.Canvas do
     509          with Offscreen.Canvas do
    527510          begin
    528511            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,
    530513              yView + 16));
    531514            Brush.Style := bsClear;
     
    534517          if MyMap[Loc] and fTerrain >= fForest then
    535518          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);
    538521          end
    539522          else
    540523          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;
    543526          end;
    544           for j := -1 to 1 do
    545             for i := -1 to 1 do
    546               if (i + j) and 1 = 0 then
     527          for J := -1 to 1 do
     528            for I := -1 to 1 do
     529              if (I + J) and 1 = 0 then
    547530              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);
    550533                if MyMap[Loc] and (fTerrain or fSpecial) = fGrass or fSpecial1
    551534                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,
    553536                    1 + 2 * (xxt * 2 + 1), 1 + yyt + 1 * (yyt * 3 + 1))
    554537                else if (MyMap[Loc] and fTerrain = fForest) and
    555538                  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,
    557540                    1 + 7 * (xxt * 2 + 1), 1 + yyt + 19 * (yyt * 3 + 1))
    558541                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,
    560543                    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)
    562545                    * (yyt * 3 + 1));
    563546              end;
    564           DpiBitCanvas(offscreen.Canvas, xView, yView + 16, 64, 32,
     547          DpiBitBltCanvas(Offscreen.Canvas, xView, yView + 16, 64, 32,
    565548            Buffer.Canvas, 1, 0);
    566549
    567550          // 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,
    569552            pix div 10 * 49 + 1);
    570553          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,
    572555              1 + 6 * (xxu * 2 + 1), 1);
    573           FrameImage(offscreen.Canvas, HGrSystem.Data, xView - 20,
     556          FrameImage(Offscreen.Canvas, HGrSystem.Data, xView - 20,
    574557            yView + 5, 12, 14, 121 + Exp div ExpCost * 13, 28);
    575558          if Health < 100 then
    576559          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,
    579562              (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);
    582565          end;
    583566
    584567          if Kind = dkEnemyUnit then
    585568          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);
    590573          end;
    591574        end
    592575      else
    593576      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,
    596579          pix div 10 * 49 + 1);
    597580      end;
    598581
    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,
    601584        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'),
    607590        MovementToString(mi.Speed), MainTexture);
    608       LoweredTextOut(offscreen.Canvas, -1, MainTexture, xTotal - 2, yTotal + 57,
     591      LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2, yTotal + 57,
    609592        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,
    611594        MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    612       if G.Difficulty[me] = 0 then
    613         s := IntToStr(mi.cost)
     595      if G.Difficulty[Me] = 0 then
     596        S := IntToStr(mi.cost)
    614597      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,
    619602        10, 88, 115);
    620603
     
    624607        begin
    625608          if MyModel[mixShow].Kind = mkEnemyDeveloped then
    626             LoweredTextOut(offscreen.Canvas, -1, MainTexture, xTotal - 2,
     609            LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2,
    627610              (yTotal + StatDown - 19), Phrases.Lookup('UNITADOPT'))
    628611          else
    629             LoweredTextOut(offscreen.Canvas, -1, MainTexture, xTotal - 2,
     612            LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2,
    630613              (yTotal + StatDown - 19), Phrases.Lookup('UNITINTRO'));
    631           DLine(offscreen.Canvas, xTotal - 2, xTotal + 170,
     614          DLine(Offscreen.Canvas, xTotal - 2, xTotal + 170,
    632615            (yTotal + StatDown - 19) + 16, MainTexture.ColorTextShade,
    633616            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);
    638621        end;
    639622
    640         NumberBar(offscreen, xTotal, yTotal + StatDown,
     623        NumberBar(Offscreen, xTotal, yTotal + StatDown,
    641624          Phrases.Lookup('UNITBUILT'), MyModel[mixShow].Built, MainTexture);
    642625        if MyModel[mixShow].Lost > 0 then
    643           NumberBar(offscreen, xTotal, yTotal + StatDown + 19,
     626          NumberBar(Offscreen, xTotal, yTotal + StatDown + 19,
    644627            Phrases.Lookup('UNITLOST'), MyModel[mixShow].Lost, MainTexture);
    645628        if InProd > 0 then
    646           NumberBar(offscreen, xTotal, yTotal + StatDown + 57,
     629          NumberBar(Offscreen, xTotal, yTotal + StatDown + 57,
    647630            Phrases.Lookup('UNITINPROD'), InProd, MainTexture);
    648631        if Available > 0 then
    649           NumberBar(offscreen, xTotal, yTotal + StatDown + 38,
     632          NumberBar(Offscreen, xTotal, yTotal + StatDown + 38,
    650633            Phrases.Lookup('UNITAVAILABLE'), Available, MainTexture);
    651634
     
    674657      begin
    675658        if Destroyed > 0 then
    676           NumberBar(offscreen, xTotal, yTotal + StatDown - 19,
     659          NumberBar(Offscreen, xTotal, yTotal + StatDown - 19,
    677660            Phrases.Lookup('UNITDESTROYED'), Destroyed, MainTexture);
    678661        if Available > 0 then
    679           NumberBar(offscreen, xTotal, yTotal + StatDown,
     662          NumberBar(Offscreen, xTotal, yTotal + StatDown,
    680663            Phrases.Lookup('UNITKNOWN'), Available, MainTexture);
    681664      end;
     
    683666  end;
    684667
    685   offscreen.Canvas.Font.Assign(UniFont[ftNormal]);
     668  Offscreen.Canvas.Font.Assign(UniFont[ftNormal]);
    686669  case Kind of
    687670    dkOwnModel, dkEnemyModel:
     
    692675      yCaption := 79;
    693676  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,
    696679    yCaption, Caption);
    697 end; { OffscreenPaint }
     680end;
    698681
    699682procedure TUnitStatDlg.ModelBoxChange(Sender: TObject);
     
    734717procedure TUnitStatDlg.HelpBtnClick(Sender: TObject);
    735718begin
    736   HelpDlg.ShowNewContent(wmPersistent, hkModel, 0);
     719  MainScreen.HelpDlg.ShowNewContent(wmPersistent, hkModel, 0);
    737720end;
    738721
  • branches/highdpi/LocalPlayer/Wonders.pas

    r361 r465  
    2323    Selection: Integer;
    2424    Center: TPoint;
    25     procedure DarkIcon(i: Integer);
    26     procedure Glow(i, GlowColor: Integer);
     25    procedure DarkIcon(I: Integer);
     26    procedure Glow(I, GlowColor: Integer);
    2727    procedure PaintBackgroundShape;
    2828  public
    2929    procedure OffscreenPaint; override;
    30     procedure ShowNewContent(NewMode: Integer);
    31   end;
    32 
    33 var
    34   WondersDlg: TWondersDlg;
     30    procedure ShowNewContent(NewMode: TWindowMode);
     31  end;
    3532
    3633
     
    3835
    3936uses
    40   Term, ClientTools, Help, Tribes, UPixelPointer;
     37  Term, ClientTools, Help, Tribes, PixelPointer;
    4138
    4239{$R *.lfm}
     
    7673procedure TWondersDlg.FormShow(Sender: TObject);
    7774begin
     75  Caption := Phrases.Lookup('TITLE_WONDERS');
    7876  Selection := -1;
    7977  OffscreenPaint;
    8078end;
    8179
    82 procedure TWondersDlg.ShowNewContent(NewMode: Integer);
     80procedure TWondersDlg.ShowNewContent(NewMode: TWindowMode);
    8381begin
    8482  inherited ShowNewContent(NewMode);
     
    109107  Height := ScaleToNative(128);
    110108  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);
    115113  for Y := 0 to Height - 1 do begin
    116114    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));
    118116      ax := ((1 shl 16 div (Height div 4)) * (Width div 4)) * Y;
    119       if (r < ScaleToNative(8) * Height * Width * Width) and
    120         ((r >= (Height div 4) * (Height div 2) * (Width div 2) * (Width div 2)) and (ax < amax2 * X) and
     117      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
    121119        ((ax < amax0 * X) or (ax > amin2 * X)) or (ax > amin1 * X) and
    122120        ((ax < amax1 * X) or (ax > amin3 * X))) then begin
    123121        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] := 0
    126             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] := 0
    129             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] := 0
    132             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] := 0
    135             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;
    136134        end;
    137135      end;
     
    149147end;
    150148
    151 procedure TWondersDlg.DarkIcon(i: Integer);
     149procedure TWondersDlg.DarkIcon(I: Integer);
    152150var
    153   X, Y, ch, x0Dst, y0Dst, x0Src, y0Src, darken, c: Integer;
     151  X, Y, ch, x0Dst, y0Dst, x0Src, y0Src, darken, C: Integer;
    154152  Src, Dst: TPixelPointer;
    155153begin
    156154  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 := (i mod 7) * xSizeBig;
    160   y0Src := (i div 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));
    163161  for Y := 0 to ScaleToNative(ySizeBig) - 1 do begin
    164162    for X := 0 to ScaleToNative(xSizeBig) - 1 do begin
     
    166164        15 + (255 - Src.Pixel^.R) * 9) div 128;
    167165      for ch := 0 to 2 do begin
    168         c := Dst.Pixel^.Planes[ch] - Darken;
    169         if c < 0 then Dst.Pixel^.Planes[ch] := 0
    170           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;
    171169      end;
    172170      Src.NextPixel;
     
    179177end;
    180178
    181 procedure TWondersDlg.Glow(i, GlowColor: Integer);
     179procedure TWondersDlg.Glow(I, GlowColor: Integer);
    182180begin
    183181  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,
    186184    xSizeBig, ySizeBig, GlowColor);
    187185end;
     
    235233        WonderDestroyed: begin
    236234          HaveWonder := True;
    237           DpiBitCanvas(Offscreen.Canvas,
     235          DpiBitBltCanvas(Offscreen.Canvas,
    238236            Center.X - xSizeBig div 2 + RingPosition[I].X,
    239237            Center.Y - ySizeBig div 2 + RingPosition[I].Y, xSizeBig,
     
    243241        else begin
    244242          HaveWonder := True;
    245           DpiBitCanvas(Offscreen.Canvas,
     243          DpiBitBltCanvas(Offscreen.Canvas,
    246244            Center.X - xSizeBig div 2 + RingPosition[I].X,
    247245            Center.Y - ySizeBig div 2 + RingPosition[I].Y, xSizeBig, ySizeBig,
     
    280278
    281279  MarkUsedOffscreen(ClientWidth, ClientHeight);
    282 end; { OffscreenPaint }
     280end;
    283281
    284282procedure TWondersDlg.CloseBtnClick(Sender: TObject);
     
    350348begin
    351349  if Selection >= 0 then
    352     HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp, Selection);
     350    MainScreen.HelpDlg.ShowNewContent(WindowModeMakePersistent(FWindowMode), hkImp, Selection);
    353351end;
    354352
  • branches/highdpi/Localization/cs/Help/Help.txt

    r464 r465  
    1 #HELPTITLE_MAIN Manuál
     1#HELPTITLE_MAIN Příručka
    22#HELPTITLE_QUICKSTART Rychlý start
    33#HELPTITLE_CONCEPTS Koncepce hry
     
    6565#DEFBONUS Bonus k obraně: %d%%
    6666#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)
    6868#TERIMPEXCLUDE Zavlažování, důl, pevnost a vojenská základna se navzájem vylučují.
    6969Například pokud postavíte vojenskou základnu na čtverci s pevností,
     
    133133
    134134!Pokročilé\
    135 ;MACRO Makro Management\
     135;MACRO Makro správa\
    136136;MAPEDIT Editor map\
    137137;AIT Turnaj AI
     
    168168hře. Nejjednodušším způsobem jak vyvinout vlastní AI je použít šablonu C#. Můžete ji najít ve složce s
    169169nainstalovanou hrou.\
    170 ::E1 Manuál návrhu AI\\
     170::E1 Příručka návrhu AI\\
    171171
    172172!Systémové požadavky\
     
    175175
    176176!Parametry příkazové řádky\
    177 --man ... zobrazí pouze manuál\\
     177--man ... zobrazí pouze příručku\\
    178178
    179179!Odinstalace\
     
    188188-se podívat, zda nebyla uvolněna novější verze programu, než kterou máte. V ní totiž
    189189můž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í
    191191klon Civilization II!)\
    192192-se ujistit, že se nejedná o problém s instalací nebo s některým doplňkem hry vytvořeným
     
    242242!!Rychlý start\
    243243
    244 Základní tipy pro zahájení hraní bez čtení manuálu:\\
     244Základní tipy pro zahájení hraní bez čtení příručky:\\
    245245
    246246-Toto je tahová hra. Zatímco jeden národ vykonává činnosti v rámci svého tahu, všechny ostatní
     
    262262je stavba městských projektů. Klikněte na obrázek projektu uprostřed okna
    263263a vyberte nový projekt, např. začněte vyrábět nové Osadníky pro založení nových měst.\
    264 -Na vašem managementu zá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í
    265265do vaší pokladnice, jak rychle probíhá vědecký výzkum.\
    266266-Kliknutím na položku se zmáčknutou klávesou Shift zobrazíte nápovědu o dané položce.\\
     
    745745
    746746Na 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é 
     747třídy jednotek vypočítána podle vzorce "základní hodnota × modifikátor". Pokud hrajete na nízké
    748748resp. vysoké úrovni obtížnosti, jsou náklady na výrobu jednotek sníženy resp.
    749749zvýšeny o 25%.
     
    851851!Obchod\
    852852Tento zdroj (symbol: %t) zastupuje vše, co má hodnotu při obchodování.
    853 Obchod je 
     853Obchod je
    854854produkován pouze na čtvercích na městském území, ne na samotném čtverci
    855855s městem - ani v případě, že na tomto čtverci je umístěn zdroj se zlatem.
     
    875875v dalším tahu.\\
    876876
    877 !Automatický management populace\
     877!Automatická správa populace\
    878878Př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 
     879do civilní služby se děje automaticky a optimálně. Hráč potřebuje pouze nastavit
    880880priority pomocí primárního přepínače (9). K dispozici je 5
    881881pozic:\
     
    910910
    911911!Plná kontrola\
    912 Pokud z nějakých důvodů nechcete používat automatický management populace,
     912Pokud z nějakých důvodů nechcete používat automatickou správu populace,
    913913můžete jej vypnout kliknutím na primární přepínač ve spodní části nebo
    914914kliknutím na území města. Tím je vám umožněno ručně vybrat čtverce, které se budou
     
    919919krocích.\\
    920920
    921 Pokud je automatický management vypnutý, musíte se starat o vše
     921Pokud je automatická správa vypnutá, musíte se starat o vše
    922922sami: zásobu jídla, podporu jednotek, civilní nepokoje. Můžete narazit na
    923923problémy, které jste předtím neměli.\\
     
    930930podporu, dokud není ve městě nastolen pořádek.\\
    931931
    932 Automatický management populace obvykle zabraňuje civilním nepořádkům. Nedokáže
     932Automatická správa populace obvykle zabraňuje civilním nepořádkům. Nedokáže
    933933ale zvládnout situaci, kdy je ve městě už příliš mnoho nespokojenosti. Pokud
    934934zaznamenáte nepokoje v automaticky spravovaném městě, zmenšete nespokojenost přesunem jednotek
    935935způsobujících nepokoje do oblasti, kde tento jev zmizí, nebo tyto jednotky rozpusťte.\\
    936936
    937 Pokud vypnete automatický management, je pouze na vás, jak udržíte dostatečnou míru spokojenosti
     937Pokud vypnete automatickou správu, je pouze na vás, jak udržíte dostatečnou míru spokojenosti
    938938ve městě. Nejčastější reakcí na potlačení nepokojů je
    939939posílení policejních sil.
     
    946946
    947947Korupce ve městě je vypočítávána podle tohoto vzorce:\
    948 @CORRUPTION\
     948@Corruption\
    949949-T - obchod produkovaný městem\
    950950-C - korupční faktor daný formou vlády\
     
    962962!Vzorce pro optimalizaci správy města\
    963963
    964 Pět primárních nastavení automatického managementu populace
     964Pět základních nastavení automatické správy populace
    965965se z matematického hlediska odlišuje pouze v hodnotě m, která je
    966966maximalizována. Výpočet hodnoty m bere v úvahu jídlo (f), produkci (p),
     
    10531053náhodná budova prodána.\\
    10541054
    1055 V obrazovce managementu města klikněte na tlačítko "Zobrazit vylepšení" a zobrazí se vám seznam vylepšení
     1055V obrazovce správy města klikněte na tlačítko "Zobrazit vylepšení" a zobrazí se vám seznam vylepšení
    10561056vybudovaných ve městě. Přejete-li si prodat nebo přestavět některé z nich, klikněte na jeho
    10571057obrázek. Zisk z prodeje stavby je totožný s produkčními náklady
     
    10681068Zpočátku je domovským městem jednotky to město, v němž byla vyrobena. Chcete-li
    10691069změnit domovské město, přesuňte jednotku do daného města a zvolte příkaz
    1070 "Podpora odtud". V obrazovce managementu města klikněte na tlačítko "Zobrazit podporu" a
     1070"Podpora odtud". V obrazovce správy města klikněte na tlačítko "Zobrazit podporu" a
    10711071zobrazí se seznam jednotek podporovaných daným městem.\\
    10721072
     
    10811081
    10821082#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 management vám pomůže zbavit se
     1083$Makro správa\
     1084
     1085!!Makro správa\
     1086
     1087Hraní této hry by měla být zábava, ne dřina. Makro správa vám pomůže zbavit se
    10881088opakujících se činností, takže se můžete koncentrovat na strategii. Makro
    1089 management neumožňuje dělat zcela všechny věci, ale
     1089správa neumožňuje dělat zcela všechny věci, ale
    10901090umožňuje hrát mnohem efektivněji. Není však doporučováno
    1091 používat makro management dříve, než porozumíte základům toho, co
     1091používat makro správu dříve, než porozumíte základům toho, co
    10921092chcete manažovat.\\
    10931093
  • branches/highdpi/Localization/cs/Language.txt

    r405 r465  
    3838#UNITSPEED Rychlost
    3939#UNITSTRENGTH Síla
    40 #UNITTRANSPORT Transport
     40#UNITTRANSPORT Doprava
    4141#UNITCOST Cena
    4242#UNITBUILT Vytvořeno
     
    101101#RANMAP Náhodná mapa
    102102#TWOTERRAINS %s / %s
    103 #MPMAP Multi Player
     103#MPMAP Více Hráčů
    104104#NOGAMES Žádné knihy
    105105#AIT_ROUND Kolo %d,
     
    140140#TITLE_SPYMISSION Špionážní operace
    141141#TITLE_SUICIDE Sebevražedná mise
     142#TITLE_MESSAGE Sdělení
    142143#FRMILREP Vojenské hlášení
    143144
     
    186187#ZOC Tento typ jednotky se nemůže pohybovat v zónách pod cizí kontrolou.
    187188#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.
    189190#NOTIMELOADAIR Letadlo potřebuje 100 MP bodů, aby je bylo možné naložit nebo vyložit z nosiče.
    190191#NOTIMEBOMBARD Bombardování města vyžaduje 100 MP bodů.
     
    192193#NOROAD Tato jednotka se může pohybovat jen po cestách nebo železnici.
    193194#NONAV Tato loď nemá schopnost navigace.
    194 #NOTRANSPORT tato loď nemá transportní schopnost.
     195#NOTRANSPORT tato loď nemá přepravní schopnost.
    195196#FULLTRANSPORT Tento transport je plně naložen.
    196197#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?
     
    264265#MISSDEACT Hráč %d ukončen bez správné deaktivace.
    265266#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?
    267268#NOSTARTPOS Tato mapa nemá definovány žádné startovní pozice. Není možné ji hrát.
    268269#TOOFEWTRIBES Počet účastníků nemůže převýšit počet nasazených národů ve hře.
     
    305306#FRBREAK Toto jednání je ztrátou času. Přijděte jindy, až přehodnotíte svůj postoj.
    306307#FROFFER Nabízíme\-%s\výměnou za\-%s
    307 #FRPRESENT Nabízíme vám tento dárek:\-%s
     308#FRPRESENT Nabízíme vám tento dar:\-%s
    308309#FRDEMAND_STRONG Dejte nám\-%s\nebo ponesete následky!
    309310#FRDONE Chcete mluvit o něčem dalším?
     
    317318#FRACCEPTDEMAND_STRONG Pro zachování našich dobrých vztahů jsme se rozhodli vyhovět vašim přáním.
    318319#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.
    320321#FRNOTACCEPTDEMAND_STRONG Požadujete příliš mnoho.
    321322#FRDELCHOICE Zajímá nás\-%s\Co můžeme na oplátku nabídnout?
     
    455456Pouze terén
    456457Divy světa
    457 Manuál
     458Příručka
    458459Test
    459460Vojenské hlášení
     
    490491Vylepšení terénu
    491492Kolonizační lodě
    492 Makro management
     493Makro správa
    493494Postavit zavlažování
    494495Postavit farmu
     
    497498Vytvořit jednotku
    498499Mřížka
    499 AI Debug Mapa
     500AI Ladící Mapa
    500501Třídy cizích jednotek
    501502Politická mapa
     
    532533Zapnutý (Výchozí implementace)
    533534Zapnutý (Alternativní implementace)
    534 Scrolling
     535Rolování
    535536Pomalý
    536537Rychlý
  • branches/highdpi/Localization/cs/Language2.txt

    r349 r465  
    88#MENU_DEBUGMAPOFF Vypnuto
    99#MENU_TELLAI Jaká AI?
    10 #BTN_MENU Hlavní menu
    11 #BTN_MANAGE Management říše
     10#BTN_MENU Hlavní nabídka
     11#BTN_MANAGE Správa říše
    1212
    1313'Tooltips
     
    2929#ACTIONHEADER_CONFIG Konfigurátor
    3030#ACTION_CONFIG Změna jazyka, přidání map a AI
    31 #ACTIONHEADER_MANUAL Manuál
     31#ACTIONHEADER_MANUAL Příručka
    3232#ACTION_MANUAL Popis pravidel a uživatelského rozhraní
    3333#ACTIONHEADER_CREDITS Autoři
  • branches/highdpi/Localization/cs/readme!!!.txt

    r64 r465  
    23233. Obsah tohoto balíku
    2424----------------------
    25 Všechny texty jsou přeloženy do češtiny. Včetně dvou obrázků v manuálu.
     25Všechny texty jsou přeloženy do češtiny. Včetně dvou obrázků v příručce.
    2626Dále byla přeložena jména a jednotky národů, které jsou standardně dodávány se hrou.
    2727Jako bonus byl přidán nový národ Čechů (o něm více na konci tohoto souboru).
     
    88888. Autoři
    8989---------
    90 Autor lokalizace textů a manuálu:
     90Autor lokalizace textů a příručky:
    9191 "tyllanthor" <tyl.lanthor@gmail.com> (dříve používající přezdívku "LFK")
    9292
  • branches/highdpi/Localization/de/Help/Help.txt

    r464 r465  
    392392Ein 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:\
    393393
    394 -Friedensvertrag: 
     394-Friedensvertrag:
    395395Die Einheiten beider Nationen dürfen sich nicht angreifen oder sich in das Gebiet des Vertragspartners begeben.\
    396396
    397 -Freundschaftsvertrag: 
     397-Freundschaftsvertrag:
    398398Zusätzlich zum Friedensvertrag tauschen beide Nationen jede Runde Zivilberichte aus.\
    399399
    400 -Bündnisvertrag: 
     400-Bündnisvertrag:
    401401Wenn 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.\\
    402402
     
    604604-5: Zusammenfassung der neuen Einheitenklasse\\
    605605
    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. 
     606Die 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.
    607607Ebenso gibt es Transportfaktoren, die die Ladekapazität von Einheiten verändern.\\
    608608
     
    697697
    698698Die genaue Formel für die Berechnung der Korruption in einer Stadt sieht folgendermaßen aus:\
    699 @CORRUPTION\
     699@Corruption\
    700700-T - Handelseinkommen der Stadt\
    701701-C - Korruptionsfaktor der Regierungsform\
     
    718718-beschleunigte Produktion: m = sqrt(f) * (8p + 2t + r)\
    719719-beschleunigte Forschung: m = sqrt(f) * (r + t + p)\
    720  
     720
    721721
    722722
     
    796796!!Unterhalt von Einheiten\
    797797
    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 
     798In 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
    799799und 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.\\
    800800
     
    827827!!Das Startfenster\
    828828
    829 Das Startfenster hat drei Register, zwischen denen Du mit einem Klick auf die oberen Laschen hin- und herschalten kannst. Um 
     829Das Startfenster hat drei Register, zwischen denen Du mit einem Klick auf die oberen Laschen hin- und herschalten kannst. Um
    830830ein 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' .\\
    831831
    832832!Auswahl der Spieler\
    833833Verwende 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. 
     834Klicke auf die Boxen und wähle jeweils einen menschlichen oder einen KI-Gegner aus der Liste.
    835835Die 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, 
     836Hier kann die Auswahl für jeweils 2 oder 3 zusätzlich Gegenspieler getroffen werden,
    837837die die gleiche Konfiguration erhalten. Damit können insgesamt bis zu 14 Nationen am Spiel teilnehmen.\\
    838838
    839 Jedem Gegner wird ein eigener Schwierigkeitsgrad zugewiesen, den Du mit den +/- Tasten links der Fenster 
     839Jedem Gegner wird ein eigener Schwierigkeitsgrad zugewiesen, den Du mit den +/- Tasten links der Fenster
    840840auswä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, 
     841Wenn Du zum Beispiel gegen die KI spielst und es so schwer wie möglich haben möchtest,
    842842setze Deinen eigenen Schwierigkeitsgrad (Lokaler Spieler) auf das Maximum und den der KI-Gegner auf das Minimum.\\
    843843
    844 Ein höherer Schwierigkeitsgrad bedeutet langsamere Entwicklung der Bevölkerung, 
     844Ein höherer Schwierigkeitsgrad bedeutet langsamere Entwicklung der Bevölkerung,
    845845langsamere Produktion und langsamerer Fortschritt bis die Produktions- und Fortschrittskosten und natürlich auch die Grösse des Nahrungsmittelspeichers angewachsen sind.\\
    846846
     
    848848
    849849Alle 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 
     850Ein Buch enthält alle Runden eines Spiels. Möchtest Du das Spiel zu einem früheren Zeitpunkt fortführen
     851als in der zuletzt gespeicherten Runde, benutze die Jahreszahl rechts
    852852um den gewünschten Zeitpunkt einzustellen, bevor Du das Spiel öffnest.\\
    853853
    854854!Weltkarten\
    855855
    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 
     856Standardmäßig spielst Du auf zufälligen Weltkarten, die automatisch am Anfang eines neuen Spiels
     857generiert werden. Im 'Karten'-Register können zwei
    858858Parameter eingestellt werden: Größe und Prozentanteil der Landmasse.\\
    859859
    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. 
     860Alternativ ist es möglich auf einer editierten Karte zu spielen, die für C-evo
     861entworfen wurde, z.B. eine Karte der Erde. Das Grundpaket enthält keine solcher Karten,
     862jedoch können verschiedene solcher Karten von der Projekt-homepage heruntergeladen werden.
     863Verschiebe die Kartendateien in den 'Maps'-Ordner. Du benötigst die Karte nur zum Starten des Spiels.
    864864Die Karte ist nicht erforderlich um das Spiel später wieder öffnen zu können, da sie im Buch mit abgespeichert wird.\\
    865865
     
    870870!!Der Kartograf\
    871871
    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, 
     872Es gibt einen einfachen Karteneditor für Karten in diesem Spiel. Um ihn zu starten,
     873klicke auf 'Karten' im Startfenster. Wähle die gewünschte Karte aus und klicke dann auf
     874die Schaltfläche 'Kartograf'. Möchtest Du eine neue Karte erstellen,
    875875wähle 'Zufallskarte', stelle Größe und Landmasse ein und starte dann den Kartografen.\\
    876876
    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, 
     877Die Bedienung des Editors ist sehr einfach. Wähle eine Landschaft oder ein Objekt
     878aus der Liste unten am Bildschirm und zeichne sie mittels der Maus in die
     879Karte. Die Grenzen zwischen Ozean und Küste und die Verteilung von Ressourcen werden
     880automatisch festgelegt. Vergiss nicht zumindest
     881eine Lagerstelle jeder besonderen Ressource festzulegen,
    882882da sonst das Raumschiff nicht gebaut werden kann.\\
    883883
    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. 
     884Es ist wichtig die Startpunkte der Nationen zu markieren. Eine Karte kann nicht
     885von mehr Nationen bespielt werden als es Startpositionen gibt. Sind keine Startpositionen vorhanden,
     886ist die Karte leider nicht spielbar.
    887887Möchtest Du eine besondere Startposition für den oder die menschlichen Spieler, markiere sie durch eine 'Bevorzugte Startposition'.\\
    888888
    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 
     889Karten werden im Startfenster nicht angezeigt. Stattdessen kann ein
     890Symbol eingefügt werden. Dieses muss eine *.bmp-Datei sein und denselben Namen wie die
    891891Karte besitzen. Speichere die Datei im 'Maps'-Ordner. Die maximale Grösse des Symbols beträgt 192 x 96 pixel.
    892892
     
    897897!!KI-Wettkampf\
    898898
    899 Hast Du mehrere verschiedene KI-Module installiert, kannst Du sie in einem Wettkampf 
     899Hast Du mehrere verschiedene KI-Module installiert, kannst Du sie in einem Wettkampf
    900900gegeneinander antreten lassen. Wähle hierfür ‚
    901 KI-Wettkampf' im zentralen Feld der neun Gegner und klicke 
     901KI-Wettkampf' im zentralen Feld der neun Gegner und klicke
    902902auf '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 
     903Mit dem Klicken auf die Schaltfläche ‚Abspielen' beginnt C-evo eine endlose Reihe an Spielen
     904rundenweise ablaufen zu lassen. Das Ergebnis besteht aus einer einfachen Statistik, die nach jeder
    905905Runde aktualisiert wird.\\
    906906
    907907@AITShot\
    908908
    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
    910910als erste das Raumschiff fertiggestellt oder alle anderen Nationen beseitigt hat.\
    911911-2: Anzahl der Runden, in denen diese Nation zerstört wurde.
     
    942942!!Militärische Forschung\
    943943
    944 Eine Nation muss militärische Forschung betreiben, um neue Einheitenklassen in Dienst stellen 
     944Eine Nation muss militärische Forschung betreiben, um neue Einheitenklassen in Dienst stellen
    945945zu können.\
    946946:CLASSES Einheitenklassen\\
     
    10611061Verhindert, dass die Weltwunder dieser Nation ihre Wirkung verlieren. Veraltete Weltwunder werden wieder aktiv.
    10621062Zä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. 
     1063Bewegung auf Schienen kostet innerhalb des eigenen Territoriums keine Aktionspunkte mehr.
    10641064Löst den kalten Krieg aus. In dieser Zeit können keine diplomatischen Verhandlungen geführt werden.\Der kalte Krieg dauert 40 Runden.
    10651065Die 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  
    144144#TITLE_SPYMISSION Verdeckte Operation
    145145#TITLE_SUICIDE Himmelfahrtskommando
     146#TITLE_MESSAGE Message
    146147
    147148'Message Text
  • branches/highdpi/Localization/it/Help/Help.txt

    r464 r465  
    132132
    133133!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 
     134C-evo è un gioco non commerciale, basato sul famoso "Sid Meier's Civilization" della
     135Microprose. L'ambizione del progetto non è competere con i giochi commerciali per la
     136presentazione più entusiasmante. Inoltre, non punta a divertire introducendo un sacco
     137di nuovi, realistici elementi a ogni versione. Invece l'obiettivo è di creare un gioco
     138di pura strategia, che diverta per una cosa soprattutto: la sfida. Quindi l'interesse
    139139centrale è la definizione delle regole e delle IA. Per maggiori informazioni, visita:\
    140140::E2 c-evo.org\\
    141141
    142142!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 
     143C-evo è frutto del lavoro di numerosi autori. Hai il permesso di usare il gioco e
     144distribuirlo gratuitamente anche senza autorizzazione esplicita. Il gioco stesso e
     145tutte le sue parti, eccetto la grafica e i suoni, sono di pubblico dominio. Ovvero puoi farne
     146quello che ti pare. Questo vale anche per il codice binario e i sorgenti, che sono
     147disponibili nel sito del progetto. Per quanto riguarda grafica e suoni, dovresti chiedere
    148148ai rispettivi autori prima di usarli per un qualunque scopo che non sia giocare.\
    149149::C Ringraziamenti\\
    150150
    151151!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. 
     152Il gioco ha un'interfaccia aperta per l'intelligenza artificiale, cioè è possibile rimpiazzare
     153l'I.A. ufficiale con altri algoritmi, per tutte o solo per alcune nazioni.
    154154E' possibile giocare con fino a 8 I.A. diverse nella stessa partita.
    155155Se sei un vero nerd e vuoi programmare un'I.A., il modo più semplice è usare il modello in C#
     
    264264
    265265Quando 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. 
     266La 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.
    267267C'è sempre una sola ricerca alla volta, e non è possibile cambiare l'oggetto della ricerca una volta scelto.
    268268Il costo di un progresso aumenta col numero di scoperte che la tua nazione ha già fatto.\\
     
    439439!!Combattimento\
    440440
    441 Puoi attaccare le unità nemiche nelle caselle adiacenti usando la tastiera o il mouse, 
     441Puoi attaccare le unità nemiche nelle caselle adiacenti usando la tastiera o il mouse,
    442442esattamente come per entrare nelle caselle. Ma non tutti gli attacchi sono permessi.
    443443Normalmente, le unità di terra non possono attaccare le navi e viceversa. Le navi non
    444444possono 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 
     445Gli aerei possono essere attaccati solo da altri aerei, eccetto quando si trovano in una
     446città o base militare. L'unità più debole è sempre distrutta in battaglia, la più forte
    447447rimane 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.\\
    448448
     
    502502-Stendere rapporto militare.\\
    503503
    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. 
     504Un trattato di pace tra due nazioni impedisce azioni di spionaggio reciproco. Comunque, gli agenti segreti possono infiltrarsi in ogni territorio, ignorando i trattati.
    505505
    506506#CLASSES
     
    580580
    581581!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. 
     582Il 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.
    583583Fanno 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.\\
    584584
     
    587587
    588588!Commercio\
    589 Il commercio (simbolo: %t) rappresenta ciò che ha un valore mercantile. 
     589Il commercio (simbolo: %t) rappresenta ciò che ha un valore mercantile.
    590590Solo 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).
    591591Parte 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".
     
    634634
    635635L'ammontare esatto della corruzione si calcola con questa formula:\
    636 @CORRUPTION\
     636@Corruption\
    637637-T - Commercio prodotto dalla città\
    638638-C - Fattore di corruzione dipendente dal governo\
     
    748748I 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.\\
    749749
    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 
     750Ogni partecipante ha il suo livello di difficoltà personale, impostabile sulla sinistra
     751del riquadro. Una linea è il livello più facile, 3 il più difficile. Se ad esempio vuoi
     752che il gioco sia il più duro possibile per te, imposta la tua difficoltà a 3 e quella degli
    753753avversari a 1.\\
    754754
     
    972972Raddoppia l'effetto di fabbrica e stabilimento.\(ogni città può sfruttare un solo tipo di centrale)\Non aumenta l'inquinamento.
    973973+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. 
     974Permette di produrre fino a 3%t per casella.
    975975Aumenta la grandezza massima della città a 30.
    976976Permette di sfruttare le fattorie.
     
    989989+12%f nella città.
    990990Raddoppia 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. 
     991Rendimento 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.
    992992*
    993993*
  • branches/highdpi/Localization/it/Language.txt

    r405 r465  
    140140#TITLE_SPYMISSION Servizi segreti
    141141#TITLE_SUICIDE Missione suicida
     142#TITLE_MESSAGE Message
    142143#FRMILREP Rapporto militare
    143144
  • branches/highdpi/Localization/ru/Help/Help.txt

    r464 r465  
    7070#TERIMPCITY Квадрат с городом автоматически имеет следующие улучшения местности:\-Дорога\-Железная дорога (после открытия знания Жедезная дорога)\-Канал\-Орошение\-Ферма.
    7171#HOSTILE Это враждебная территория. Юниты, проходящие эту местность получают повреждения, пропорциональные очкам MP. Полный ход по территории дает %d%% повреждений.
    72 Враждебность территории может быть нейтрализована рекой, оазисом, каналом, или военной базой. 
     72Враждебность территории может быть нейтрализована рекой, оазисом, каналом, или военной базой.
    7373#DEADLANDS Мертвые земли не могут быть улучшены.
    7474#RARE На произвольной карте всегда имеется 12 мертвых земель. Половина из них содержат специальные ресурсы, по два ресурса каждого типа.
     
    655655
    656656Точное вычисление уровня Коррупции в городе производится по такой формуле:\
    657 @CORRUPTION\
     657@Corruption\
    658658-T - Торговля, производимая городом\
    659659-C - Показатель коррупции текущей формы правления\
     
    778778Также можно выбрать для игры специальную карту, созданную кем-то для C-evo,
    779779например настоящую карту Земли. Стандартная установка не содержит дополнительных
    780 карт, но их можно скачать на домашней странице игры. 
    781 Все карты должны быть расположены в папке "Maps". 
     780карт, но их можно скачать на домашней странице игры.
     781Все карты должны быть расположены в папке "Maps".
    782782Карта нужна только чтобы начать игру, а затем
    783783сохраняется вместе с ней.
     
    789789!!Редактор карт\
    790790
    791 Вместе с игрой есть простой редактор для карт. Карту для редактирования 
     791Вместе с игрой есть простой редактор для карт. Карту для редактирования
    792792можно выбрать на закладке "Карты" и нажать кнопку "Редактировать". Или
    793793можно создать случайную карту, указав её размер и процент суши, и затем
     
    798798и "обычный участок/особые ресурсы" происходит автоматически, Вы не можете
    799799на это повлиять. Не забудьте добавить хотябы по одному участку с редкими
    800 видами ресурсов, иначе игроки не смогут построить космический 
     800видами ресурсов, иначе игроки не смогут построить космический
    801801корабль.\\
    802802
     
    821821соперника "Компьютер против компьютера" и нажать "Начало". Игра превратится
    822822в простой диалог, C-evo начнёт бесконечную серию игр (раундов). И в результате
    823 после каждого раунда будет выдаваться 
     823после каждого раунда будет выдаваться
    824824статистика:\\
    825825
     
    10121012Влияние Фабрики и Завода на рост производства увеличивается в два раза.\(Строить более одного Завода в городе бесполезно.)\Не увеличивает загрязнение.
    10131013+1%p на прибрежных участках.\\Может быть построена только в городах, имеющих выход к морю.
    1014 Позволяет собирать до 3%t с участка. 
     1014Позволяет собирать до 3%t с участка.
    10151015Размер города может расти больше 12.
    10161016Появляется возможность использовать Фермы.
  • branches/highdpi/Localization/ru/Language.txt

    r405 r465  
    143143#TITLE_SPYMISSION Шпионская операция
    144144#TITLE_SUICIDE Миссия самоубийства
     145#TITLE_MESSAGE Message
    145146#FRMILREP Военное сообщение
    146147
  • branches/highdpi/Localization/zh-Hans/Fonts.txt

    r464 r465  
    11#NORMAL
    2 Î¢ÈíÑźÚ, 15
     2微软雅黑, 15
    33
    44#SMALL
    5 Î¢ÈíÑźÚ, 13
     5微软雅黑, 13
    66
    77#TINY
    8 Î¢ÈíÑźÚ, 11B
     8微软雅黑, 11B
    99
    1010#CAPTION
    11 Î¢ÈíÑźÚ, 17
     11微软雅黑, 17
    1212
    1313#BUTTON
    14 Î¢ÈíÑźÚ, 17B
     14微软雅黑, 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 (部队科技属性)
    3131
    3232#TECHFORMULA %.6g*n*EXP(n/%.6g)
    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 ÌØÊâ×ÊÔ´
     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 特殊资源
    5959#SPECIALFOOD , +%d%%f
    6060#SPECIALPROD , +%d%%p
    6161#SPECIALTRADE , +%d%%t
    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" µÄÈκÎËÑË÷½á¹û.
     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" 的任何搜索结果.
    9595
    9696
    9797#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 电脑对决
    126126
    127127
    128128#ABOUT
    129 $¹ØÓÚÓÎÏ·\
     129$关于游戏\
    130130
    131131&LOGO\\
    132132
    133 !ÆðÔ´¼°Ä¿±ê\
     133!起源及目标\
    134134C-evo is a non-commerical game project based on the famous "Sid Meier's
    135135Civilization" by Microprose. The ambition of C-evo is not, to compete with
     
    140140::E2 c-evo.org\\
    141141
    142 !ËùÓÐȨÐí¿É\
     142!所有权许可\
    143143C-evo is a compilation of work by a number of authors. You are allowed
    144144to play the game and to distribute it without explicit permission. The compilation
     
    148148the graphics, you should ask the author of an item before using it for another
    149149purpose than to play.\
    150 ::C ²é¿´ÖÆ×÷ÈËÔ±Ãûµ¥\\
    151 
    152 !AIÄ£¿é\
     150::C 查看制作人员名单\\
     151
     152!AI模块\
    153153The game has an open AI interface, which means the player can replace the standard AI
    154154contained in the package by other AI algorithms, either for all or for single
     
    158158you installed the game. Maybe competition will lead us to the first real good AI
    159159in 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!错误报告\
    173173
    174174To support the progress of this project, please tell me about problems you have
     
    200200
    201201#CREDITS
    202 $ÖÆ×÷ÈËÔ±\
     202$制作人员\
    203203
    204204@@18\\
    205205
    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 °æȨͼƬ, »òÊDz»Ô¸ÄúµÄÀͶ¯³É¹û±»Ãâ·ÑתÓÃ, »òÊÇ×÷Ϊ
    226 Í¼Æ¬×÷ÕßµÄÄúÏëÔÚÖÆ×÷ÈËÔ±Ãûµ¥ÖÐÁôÏÂÐÕÃû, ÇëÁªÏµÎÒÃÇ.
     206!设计\
     207原创意来自Sid Meier & Brian Reynolds制作的
     208 "Sid Meier's Civilization" "Civilization II".\
     209根据玩家同好的意见建议修改而成.\\
     210
     211!程序\
     212主程序: Steffen Gerlach.\
     213PNG图片支持: Edmund H. Hand\\
     214
     215!测试\
     216无数不知名的测试者, 感谢你们每一个人!\\
     217
     218!其他\
     219某些纹理图片来自 "Mayang's Free Textures".\
     220城市名单提供: Charles Nadolski..\\
     221
     222!美工\
     223绝大部分图片是从网上流传的各种文明II资源包内提取的,
     224其中一些作者已不可考, 还有一些无法联络. 若发现商业
     225版权图片, 或是不愿您的劳动成果被免费转用, 或是作为
     226图片作者的您想在制作人员名单中留下姓名, 请联系我们.
    227227
    228228
    229229#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可显示相关的帮助信息.\\\
    252252
    253253
    254254@@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-某些地形对地面部队会造成伤害, 详见"地形种类"中的"恶土".\
    289289
    290290
    291291#INTRO
    292 $ÓÎÏ·½éÉÜ\
     292$游戏介绍\
    293293
    294294@@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不论是哪个种族, 都在为了同一个目标而竞争: 最终的胜利.
    322322
    323323
    324324#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回合结束"的提示,请点击屏幕右下角的结束回合按钮.\\
    343343
    344344
    345345#SCIENCE
    346 $¿Æ¼¼\
     346$科技\
    347347
    348348@@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 科研费用详解
    368368
    369369
    370370#SCIENCECOST
    371 $¿ÆÑзÑÓÃÏê½â\
    372 
    373 !¿ÆÑзÑÓÃÏê½â\
    374 
    375 Ëæ×ſƼ¼Ñз¢ÊýÁ¿µÄÔö¶à, ¿ÆÑзÑÓÃÒ²»áËæÖ®Ìá¸ß.
    376 µ±Ç°ÄѶÈÏÂ, ¿ÆÑзÑÓõļÆË㹫ʽΪ:\
     371$科研费用详解\
     372
     373!科研费用详解\
     374
     375随着科技研发数量的增多, 科研费用也会随之提高.
     376当前难度下, 科研费用的计算公式为:\
    377377&TECHFORMULA\\
    378 ±äÁ¿nµÄ³õʼֵΪ4, ²¢¸ù¾ÝÒÔÏÂÌõ¼þ·¢ÉúÏàÓ¦±ä»¯:\
    379 -²¿¶ÓÑз¢²»»áÓ°ÏìnÖµµÄ±ä»¯\
    380 -µçÄԿƼ¼µÄÑо¿²»»áÓ°ÏìnÖµµÄ±ä»¯\
    381 -³É¹¦ÑеôÓÆäËûÊÆÁ¦»ñµÃµÄ¿Æ¼¼, nÖµ+1\
    382 -×ÔÐгɹ¦ÑеÃÈκÎÆäËû¿Æ¼¼, °üÀ¨ÈýÖÖδÀ´¿Æ¼¼, nÖµ+2\
    383 -´Ó´óͼÊé¹ÝÖÐÖ±½Ó»ñµÃ¿Æ¼¼, nÖµ+1
     378变量n的初始值为4, 并根据以下条件发生相应变化:\
     379-部队研发不会影响n值的变化\
     380-电脑科技的研究不会影响n值的变化\
     381-成功研得从其他势力获得的科技, n值+1\
     382-自行成功研得任何其他科技, 包括三种未来科技, n值+2\
     383-从大图书馆中直接获得科技, n值+1
    384384
    385385
    386386#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综上所述, 两国间可能的关系列表如下:\
    446446&TREATIES\\
    447447
    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的可信度, 对其他国家都是公开透明的.
    468468
    469469
    470470#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特殊资源包括:\
    487487&MODERN\\
    488488
    489 Òª·¢ÏÖÕâЩÌØÊâ×ÊÔ´, ±ØÐëÏÈ»ñµÃÒÔÏ¿Ƽ¼:\
    490 ::A47 ¹æÄ£Á¿²ú
     489要发现这些特殊资源, 必须先获得以下科技:\
     490::A47 规模量产
    491491
    492492
    493493#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移动所耗机动力的示意图如下:\
    529529@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也会陷入骚乱状态, 并持续三个回合.
    553553
    554554
    555555#COMMANDS
    556 $²¿¶ÓÖ¸Áî\
     556$部队指令\
    557557
    558558@@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点机动力)
    574574
    575575
    576576#SETTLE
    577 $ÒÆÃñ¹¤×÷\
     577$移民工作\
    578578
    579579@@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 可参考: 地形种类一览
    600600
    601601
    602602#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每支部队的战斗力分为攻击和防御两种. 部队情报中显示的
     61675/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点状态, 部队经验提升一级. 经验等级详列如下:\
    643643&EXPERIENCE\\
    644644
    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点.  驱逐的方法与攻击方法相同.
    661661
    662662
    663663#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造价较低的那支部队将担任防守任务.
    680680
    681681
    682682#SPYMISSIONS
    683 $ÃØÃÜÐж¯\
     683$秘密行动\
    684684
    685685@@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但特种兵依然可潜入任何地区, 无视条约的约束.
    698698
    699699
    700700#CLASSES
    701 $²¿¶ÓÑз¢\
    702 
    703 !²¿¶ÓÑз¢\
    704 
    705 ÓÎÏ·³õʼʱ, ÈκÎÊÆÁ¦¶¼¿ÉÖ±½ÓÉú²úÃñ±øºÍÍØ»ÄÕß,
    706 Ä³Ð©ÌØÊⲿ¶ÓÐëÕÆÎÕÌض¨µÄ¿Æ¼¼»òÆæ¼£, ·½¿ÉÉú²ú.\
    707 ::S ²Î¼û"ÌØÊⲿ¶Ó"\\
    708 
    709 ÒªÉú²úÆäËûµÄÐÂÐͲ¿¶Ó, ±ØÐë½èÖú¿Æ¼¼Ñз¢·½ÄÜ´ï³É.
    710 µ±»ñµÃÁËÏà¹ØµÄ¿Æ¼¼ÖªÊ¶Ö®ºó, (ÀýÈçÕÆÎÕÉÐÎäÏ°Ë׺ó,
    711 ¿ÉÑз¢ÐµĵØÃ沿¶Ó), ¿ÉÔÚÑз¢´°¿ÚÑ¡Ôñ"²¿¶ÓÑз¢",
    712 ´Ó¶ø¿ªÆô²¿¶ÓÑз¢´°¿Ú:\\
     701$部队研发\
     702
     703!部队研发\
     704
     705游戏初始时, 任何势力都可直接生产民兵和拓荒者,
     706某些特殊部队须掌握特定的科技或奇迹, 方可生产.\
     707::S 参见"特殊部队"\\
     708
     709要生产其他的新型部队, 必须借助科技研发方能达成.
     710当获得了相关的科技知识之后, (例如掌握尚武习俗后,
     711可研发新的地面部队), 可在研发窗口选择"部队研发",
     712从而开启部队研发窗口:\\
    713713
    714714@DraftShot\
    715715
    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%.
    736736
    737737
    738738#CITIES
    739 $³ÇÊиÅÂÛ\
     739$城市概论\
    740740
    741741@@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即可打开该城市的专属画面: \\
    753753
    754754@CityShot\
    755755
    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 Ä³Ð©Ìض¨µÄÕþÌåÐÎʽÏÂ, ²»°²Ê¼þµÄ·¢Éú»á½µµÍ
    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).
    806806\\
    807807
    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最常用的方法是将更多市民改为城市戒严部队.
    904904
    905905
    906906#CORRUPTION
    907 $¼ÆË㸯°Ü±ÈÀý\
    908 
    909 !¼ÆË㸯°Ü±ÈÀý\
    910 
    911 Ò»¸ö³ÇÊеĸ¯°Ü±ÈÀý, ¸ù¾ÝÒÔϹ«Ê½¼ÆËã:\
    912 @CORRUPTION\
    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%.
    921921
    922922
    923923#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)
    935935
    936936
    937937#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的一半. 拓荒者和工程师可以清理污染.
    983983
    984984
    985985#BUILDINGS
    986 $½¨Öþ½éÉÜ\
     986$建筑介绍\
    987987
    988988@@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设施变卖的价格等同于其生产原料换算成现金的价格.
    10151015
    10161016
    10171017#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直至骚乱结束.
    10361036
    10371037
    10381038#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将在在建的设施建成后再行启动.
    10621062
    10631063
    10641064#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子目录下即可使用.
    11061106
    11071107
    11081108#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像素.
    11291129
    11301130
    11311131#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数字, 根据回合推进而同步更新, 如下图所示:\\
    11421142
    11431143@AITShot\
    11441144
    1145 -1: ¸ÃÑÕÉ«AIÊÆÁ¦Ó®µÃÓÎÏ·µÄ´ÎÊý, »ñʤԭÒò¿ÉÄÜÊÇÖ³Ãñ
    1146 ·É´¬·¢Éä, Ò²¿ÉÄÜÊÇÏûÃðËùÓÐÆäËûÊÆÁ¦.\
    1147 -2: ¸ÃÑÕÉ«AIÊÆÁ¦ÓÎϷʧ°ÜµÄ´ÎÊý.
     1145-1: 该颜色AI势力赢得游戏的次数, 获胜原因可能是殖民
     1146飞船发射, 也可能是消灭所有其他势力.\
     1147-2: 该颜色AI势力游戏失败的次数.
    11481148
    11491149
    11501150#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-其他菜单快捷键, 请参见游戏中各菜单
    11671167
    11681168#TRADINGGOODS
    1169 $ÉÌƷóÒ×\
    1170 
    1171 !ÉÌƷóÒ×\
    1172 
    1173 Ñ¡ÔñÉÌƷóÒ×, ËùÓÐÉú²úÔ­ÁϽ«±»Ö±½Óת»»ÎªÏÖ½ðÀûÈó.
     1169$商品贸易\
     1170
     1171!商品贸易\
     1172
     1173选择商品贸易, 所有生产原料将被直接转换为现金利润.
    11741174
    11751175#MILRES
    1176 $²¿¶ÓÑз¢\
    1177 
    1178 !²¿¶ÓÑз¢\
    1179 
    1180 ÒªÉú²úÐÂÐ͵ÄÇ¿Á¦²¿¶Ó, ±ØÐëÏȽøÐв¿¶ÓÑз¢.\
    1181 :CLASSES ²é¿´²¿¶ÓÑз¢µÄÓйØÐÅÏ¢
     1176$部队研发\
     1177
     1178!部队研发\
     1179
     1180要生产新型的强力部队, 必须先进行部队研发.\
     1181:CLASSES 查看部队研发的有关信息
    11821182
    11831183#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%\(不会增加额外污染)
    12761276*
    12771277*
    12781278
    12791279#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城市规模增长后, 粮食储量不是全空, 而是半满.
    13111311+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%.
    13181318+4%m.
    1319 ¿ÆѧÉú²ú +75%.
    1320 Ã¿¸ö½üº£µØ¿é +1%f.\\´ËÉèÊ©Ö»Äܽ¨ÔÚÑغ£³ÇÊÐ.
     1319科学生产 +75%.
     1320每个近海地块 +1%f.\\此设施只能建在沿海城市.
    13211321+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%f
    1345 ËùÓÐÒøÐеÄЧ¹û¼Ó±¶.
    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%.\\可以开始建造殖民飞船部件. 如果没有太空港, 殖民飞船工程将化为乌有. 如果太空港被其他拥有太空港的势力占领, 则殖民飞船也将落入占领者的手中.
    13471347
    13481348*
     
    13511351
    13521352#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连续生产同种部队的生产费用减半, 但若改为生产其他部队, 生产费用加倍.
    13801380
    13811381#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.
    13901390
    13911391#TECHAGE
    1392 ÔçÆڿƼ¼
    1393 ¹¤Òµ»¯¿Æ¼¼
    1394 ÏÖ´ú¿Æ¼¼
    1395 Î´À´¿Æ¼¼
     1392早期科技
     1393工业化科技
     1394现代科技
     1395未来科技
    13961396
    13971397#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-在本方回合中, 可在空中飞行; 在其他势力的回合中, 将被当作地面部队.\-可侦察邻近城市, 以及同一地块的多个部队.\-如果在本方回合结束时, 滑翔机仍在海面, 就会坠毁.\-不可搭载舰船.
    14071407
    14081408#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 ½ø¶È %d
    2 #MAP µØͼ %d
    3 #BC ¹«ÔªÇ° %d Äê
    4 #AD ¹«Ôª %d Äê
     1#GAME 进度 %d
     2#MAP 地图 %d
     3#BC 公元前 %d 年
     4#AD 公元 %d 年
    55#SHARE %d/%d
    66#SHORTNAME #S
    77#OWNED #A %s
    88#GENCITY #S %d
    9 #GENMODEL #A Ä£¿é %d
     9#GENMODEL #A 模块 %d
    1010#TILESIZE %dx%d
    1111
    1212'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 隶属部队
    3636
    3737'Class Screen Text
    3838#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 特殊部队
    5252
    5353'Diplomacy Screen Text
    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 ¹Øϵ:
     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 关系:
    6767#FRAND ,
    68 #FRCREDIBILITY (%d%% ÐÅÓöÈ)
    69 #FRTREASURY ¹ú¿â: %d%%c
    70 #FRRELATIONS Ëû¹ú¹Øϵ:
     68#FRCREDIBILITY (%d%% 信用度)
     69#FRTREASURY 国库: %d%%c
     70#FRRELATIONS 他国关系:
    7171
    7272'Other Dialog Text
    73 #PRESENT µ±Ç°²¿¶Ó
    74 #SHOWSTRENGTH Õ½¶·Á¦: %d/%d
    75 #RIVER ºÓÁ÷
    76 #INITUNIT ²¿¶ÓÑз¢
    77 #TECHFOCUS Ä¿±ê£º%s
    78 #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 税收
    8282#MONEYGAINPOS +%d%%c
    8383#MONEYGAINNEG %d%%c
    8484#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%
    8989#NATEXISTS (%s)
    90 #CONSCRIPTS Õ÷ļ %s
     90#CONSCRIPTS 征募 %s
    9191#WONDEROF %s (%s)
    9292#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 随机地图
    104104#TWOTERRAINS %s / %s
    105 #MPMAP ¶àÈËģʽ
    106 #NOGAMES ÉÐÎÞ½ø¶È
    107 #AIT_ROUND µÚ%d»ØºÏ,
     105#MPMAP 多人模式
     106#NOGAMES 尚无进度
     107#AIT_ROUND 第%d回合,
    108108
    109109'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 地图名称
    142142#TITLE_NATION #N
    143 #TITLE_SPYMISSION ÃØÃÜÐж¯
    144 #TITLE_SUICIDE ×ÔɱÐж¯
    145 #FRMILREP ¾üʱ¨¸æ
     143#TITLE_SPYMISSION 秘密行动
     144#TITLE_SUICIDE 自杀行动
     145#TITLE_MESSAGE Message
     146#FRMILREP 军事报告
    146147
    147148'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½¨³ÉÁËеÄÊÀ½çÆæ¼£:\%s
    210 #WONDERBUILTEXP ij¹ú½¨³ÉÁËеÄÊÀ½çÆæ¼£:\%s\\µ«ÕâÏîÆæ¼£ÒѾ­¹ýʱ, ûÓÐÈκÎÏÖʵÒâÒå.
    211 #WONDERBUILTOWN ÎÒ¹ú½¨³ÉÁËеÄÊÀ½çÆæ¼£:\%s
    212 #WONDERCAPT #NÕ¼ÁìÁËÒ»ÏîÊÀ½çÆæ¼£:\%s
    213 #WONDERCAPTOWN ÎÒ¹úÕ¼ÁìÁËÒ»ÏîÊÀ½çÆæ¼£:\%s
    214 #WONDEREXP ÊÀ½çÆæ¼£: %s µÄЧ¹ûÒѲ»¸´´æÔÚ.
    215 #WONDERDEST Ò»ÏîÊÀ½çÆæ¼£±»´Ý»ÙÁË:\%s
    216 #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%%c
    241 #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 共享胜利)
    253254#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 ÎÞ·¨ÕÒµ½Óû§%s
    263 #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 地图已删除
    268269#TURN #N\%s
    269 #SUPERTURN ³¬¼¶Óû§\%s
    270 #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 自由女神像\已经生效.
    294295
    295296'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\À´½»»»¹ó¹úµÄ\-%s
    304 #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%%c
    334 #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所有的研发部队
    336337#PRICE_CONCAT %s\-%s
    337 #PRICECAT_ALLTECH ËùÓпƼ¼³É¹û
    338 #PRICECAT_ALLMODEL ËùÓв¿¶ÓÑз¢
     338#PRICECAT_ALLTECH 所有科技成果
     339#PRICECAT_ALLMODEL 所有部队研发
    339340
    340341'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 帮助
    346347#BTN_RESET Reset
    347348
    348349'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 后来的部分
    395396
    396397'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 整编
    416417#NETWORK_SERVER Network Server
    417418#NETWORK_CLIENT Network Client
    418419
    419420'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 载入游戏进度…
    425426
    426427'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 选择关闭当前的地图。\是否保存?
    431432
    432433#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竞争种族:
     450AI模块:
    450451
    451452#AUTODIFF
    452 ÈëÃÅ
    453 ¼òµ¥
    454 Õý³£
    455 À§ÄÑ
    456 ±ä̬
     453入门
     454简单
     455正常
     456困难
     457变态
    457458
    458459#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军事情报…
     469AI测试信息…
     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网格
     508AI测试地图
     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地块尺寸
    555556Small
    556557Medium
     
    560561
    561562#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人工智能
    656657
    657658#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飞船居住舱
    728729
    729730#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流水作业
    757758
    758759#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水银
    799800
    800801#DOMAIN
    801 Â½¾ü
    802 º£¾ü
    803 ¿Õ¾ü
     802陆军
     803海军
     804空军
    804805
    805806#EXPERIENCE
    806 Ð±ø
    807 ÊÜѵ
    808 ÀúÁ·
    809 Àϱø
    810 ¾«Èñ
     807新兵
     808受训
     809历练
     810老兵
     811精锐
    811812
    812813#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受损恢复
    828829
    829830#GOVERNMENT
    830 ÎÞÕþ¸®
    831 Å«Á¥ÖÆ
    832 ¾ýÖ÷ÖÆ
    833 ¹²ºÍÖÆ
    834 ×Ú½ÌÖÆ
    835 ¹²²úÖÆ
    836 ÃñÖ÷ÖÆ
    837 Î´À´ÖÆ
     831无政府
     832奴隶制
     833君主制
     834共和制
     835宗教制
     836共产制
     837民主制
     838未来制
    838839
    839840#TREATY
    840 ½»Õ½
    841 Í£Õ½
    842 ºÍƽ
    843 ÓѺÃ
    844 ÁªÃË
     841交战
     842停战
     843和平
     844友好
     845联盟
    845846
    846847#HAVETREATY
    847 Óë#n½¨½»
    848 Óë#nÍ£Õ½
    849 Óë#nºÍƽ
    850 Óë#nÓѺÃ
    851 #Óë#nÁªÃË
     848与#n建交
     849与#n停战
     850与#n和平
     851与#n友好
     852#与#n联盟
    852853
    853854#ATTITUDE
    854 µÐ¶Ô
    855 Àäµ­
    856 ²»ºÏ
    857 ÖÐÁ¢
    858 ½ÓÊÜ
    859 ÓÑÉÆ
    860 ÈÈÇé
     855敌对
     856冷淡
     857不合
     858中立
     859接受
     860友善
     861热情
    861862
    862863#CREDIBILITY
    863 ÑÔ¶øÎÞÐÅ
    864 ×½Ãþ²»¶¨
    865 ÖØŵÊØÐÅ
    866 ÑÔ³ö±ØÐÐ
     864言而无信
     865捉摸不定
     866重诺守信
     867言出必行
    867868
    868869#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无效城市类型
    885886
    886887#CITYTYPE
    887 ÆÕͨÐͳÇÊÐ
    888 ¿Æ¼¼ÐͳÇÊÐ
    889 ¹¤ÒµÐͳÇÊÐ
    890 ³¬¼¶´ó¶¼ÊÐ
     888普通型城市
     889科技型城市
     890工业型城市
     891超级大都市
    891892
    892893#DIAGRAM
    893 ÈË¿Ú
    894 ÁìÍÁ
    895 ¾üÊÂ
    896 ¿Æ¼¼
    897 Ì½Ë÷
    898 ¸û×÷
     894人口
     895领土
     896军事
     897科技
     898探索
     899耕作
    899900
    900901#JOBRESULT
    901902*
    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抽干沼泽
    921922
    922923#ARMYLOST
    923 #A²¿¶Ó±»¼ßÃð
    924 #A½¢¶Ó±»¼ßÃð
    925 #A²¿¶Ó¼¯Èº±»¼ßÃð
     924#A部队被歼灭
     925#A舰队被歼灭
     926#A部队集群被歼灭
    926927
    927928#SPYMISSION
    928 ÆÆ»µÉú²ú
    929 ÇÔÈ¡µØͼ
    930 »ñµÃµÚÈý¹úÇ鱨
    931 ´òÌý¹ú¼ÒÇ鱨
    932 ´òÌý¾üÊÂÇ鱨
     929破坏生产
     930窃取地图
     931获得第三国情报
     932打听国家情报
     933打听军事情报
    933934
    934935#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让对方自行出价
    947948
    948949#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让对方自行要价
    961962
    962963#CITYMANAGETYPE
    963 ÊÖ¶¯·ÖÅä
    964 ¿ÆÑÐ×î´ó»¯
    965 ¿ÆÑÐÓÅÏÈ
    966 Ôö³¤×î´ó»¯
    967 Éú²úÓÅÏÈ
    968 Éú²ú×î´ó»¯
     964手动分配
     965科研最大化
     966科研优先
     967增长最大化
     968生产优先
     969生产最大化
    969970
    970971#SETTINGS
  • branches/highdpi/Localization/zh-Hans/ReadMe.txt

    r124 r465  
    1 C-EVO(ÎÄÃ÷½ø»¯Ê·)ºº»¯ËµÃ÷
     1C-EVO(文明进化史)汉化说明
    22
    3 ÓÎÏ·½éÉÜ£º
    4 C-EVOÊÇÒ»¿î´ÓÎÄÃ÷(Civilization)ϵÁÐÑÜÉú¶ø³öµÄWindowsƽ̨¿ªÔ´×ÔÓÉÓÎÏ·£¬ÔÚ×ñÑ­ÎÄÃ÷ϵÁÐ
    5 »ù±¾Ô­ÔòµÄ»ù´¡ÉÏ£¬×öÁËÐí¶àÓд´ÒâºÍÈËÐÔ»¯µÄ¸ïУ¬ÊÇÒ»¿î¾«ÃÀÓÐȤµÄÎÄÃ÷ÀàÓÎÏ·£¬ÎÄÃ÷ÃÔ²»¿É²»Íæ¡£
    6 ¹Ù·½Ö÷Ò³£ºhttp://www.c-evo.org
    7 Ô­°æÓÎÏ·(V1.10£¬¶ÔÓ¦ºº»¯°ü)ÏÂÔØÒ³Ã棺http://www.c-evo.org/files/download.php
     3游戏介绍:
     4C-EVO是一款从文明(Civilization)系列衍生而出的Windows平台开源自由游戏,在遵循文明系列
     5基本原则的基础上,做了许多有创意和人性化的革新,是一款精美有趣的文明类游戏,文明迷不可不玩。
     6官方主页:http://www.c-evo.org
     7原版游戏(V1.10,对应汉化包)下载页面:http://www.c-evo.org/files/download.php
    88
    9 ºº»¯°üʹÓ÷½·¨£º
    10 °²×°Ô­°æÓÎÏ·ºó£¬½«ºº»¯°üÄÚµÄÎļþ½âѹµ½ÓÎÏ·°²×°Ä¿Â¼£¬Îñ±Ø¸²¸ÇÔ­Îļþ£¨Language.txt, Help\Help.txt£©£¬
    11 È»ºóÖ´ÐÐÓÎÏ·³ÌÐò¡£
     9汉化包使用方法:
     10安装原版游戏后,将汉化包内的文件解压到游戏安装目录,务必覆盖原文件(Language.txt, Help\Help.txt),
     11然后执行游戏程序。
    1212
    13 ºº»¯ËµÃ÷£º
    14 1. »ù±¾ÍêÈ«ºº»¯°æ£¬³ýÁËÓÎÏ·¹ØÓÚ²¿·ÖÍâÆäËûÄÚÈÝÎÄ×ÖÈ«²¿ºº»¯£¬°üÀ¨°ïÖúÖ¸ÄÏ£¬ÎÄ×ÖÁ¿Ô¼70KB¡£
    15 2. ºº»¯°üÖи½´øÁ˺º»¯Õß×ÔÐÐÉè¼ÆµÄÒ»¿îÓÎÏ·µØͼ£¬Ö÷Òª¶ÔÍæ¼ÒµÄÆðʼλÖÃ×öÁËÓÅ»¯¡£
    16 3. ºº»¯°üÖÐÌí¼ÓÁËÓÎÏ·Ö¸ÄϵĿì½ÝÔËÐз½Ê½£¬·½±ãÍæ¼Ò²éÔÄ¡£
    17 4. ÓÎÏ·Ö¸ÄÏÖеÄijЩ²¿·Ö£¬Èç¿Æ¼¼¡¢ÉèÊ©¡¢Ææ¼£µÈ°ïÖú´°¿Ú£¬´°¿Ú±êÌâÏ·½µÄÊ×ÐУ¨ÎÄ×ÖÄÚÈÝÓë´°¿Ú±êÌâÏàͬ£©
    18 ÎªÂÒÂ룬Ϊ³ÌÐò¼æÈÝÎÊÌ⣨Ê××Öĸ´óд³ö´í£©£¬ÎÞ·ÁÓÎÏ·£¬ÆäËû´¦ÉÐδ·¢ÏÖÏÔʾ´íÎó¡£
     13汉化说明:
     141. 基本完全汉化版,除了游戏关于部分外其他内容文字全部汉化,包括帮助指南,文字量约70KB。
     152. 汉化包中附带了汉化者自行设计的一款游戏地图,主要对玩家的起始位置做了优化。
     163. 汉化包中添加了游戏指南的快捷运行方式,方便玩家查阅。
     174. 游戏指南中的某些部分,如科技、设施、奇迹等帮助窗口,窗口标题下方的首行(文字内容与窗口标题相同)
     18为乱码,为程序兼容问题(首字母大写出错),无妨游戏,其他处尚未发现显示错误。
    1919
    20 ÍƼöÓÎÏ·×ÖÌ壺΢ÈíÑźڣ¬×ÖÌåÉèÖÃÎļþÒѸ½ÔÚºº»¯°üÖÐ
     20推荐游戏字体:微软雅黑,字体设置文件已附在汉化包中
    2121
    22 V1.10°æ¸üиÅÒª£º
    23 1¡¢ÓÎÏ·½çÃæ×÷Á˵÷Õû£¬Ð½çÃæ¸üÖ±¹ÛÓѺÃ
    24 2¡¢³ÇÊд°¿ÚÖÐÔöÉèÁË×ÊÔ´×Ô¶¯·ÖÅäģʽ£¬·½±ãÍæ¼Ò¿ìËÙÉèÖ㬼õÉÙÁËÈß·±µÄϸ½Ú²Ù×÷
    25 3¡¢¸ù¾ÝÍæ¼Ò·´À¡£¬ÐÞ¸ÄÁËÈýÏîÆæ¼£µÄЧ¹û
    26 4¡¢µ÷ÕûÁ˳ÇÊа²¶¨ÖµµÄÓ°Ïì²ÎÊýÒÔ¼°³õʼˮƽ
    27 5¡¢Ôö¼ÓÁ˽»Õ½½á¹ûÔ¤²â
    28 6¡¢½»ÉæÖ¸ÁîµÄÉÙÁ¿µ÷Õû£¬È¥³ýÁËÄê¹±²¿·Ö£¬²¢µ÷ÕûÁËÖÕÖ¹ÌõÔ¼µÄ²¿·ÖÉ趨
    29 7¡¢ÆäËû·½ÃæµÄ΢µ÷
     22V1.10版更新概要:
     231、游戏界面作了调整,新界面更直观友好
     242、城市窗口中增设了资源自动分配模式,方便玩家快速设置,减少了冗繁的细节操作
     253、根据玩家反馈,修改了三项奇迹的效果
     264、调整了城市安定值的影响参数以及初始水平
     275、增加了交战结果预测
     286、交涉指令的少量调整,去除了年贡部分,并调整了终止条约的部分设定
     297、其他方面的微调
    3030
    31 ºº»¯¸üУº
    32 08.06.18  1.10°æºº»¯°üÖÆ×÷Íê³É£¬¶ÔÓ¦ÐÂÍƳöµÄ1.10Ó¢Îİ棨080526£©
    33 08.04.18        1.04°æºº»¯°üÖÆ×÷Íê³É£¬¶ÔÓ¦Ô­ÏȵÄ1.04Ó¢ÎÄ°æ
     31汉化更新:
     3208.06.18  1.10版汉化包制作完成,对应新推出的1.10英文版(080526)
     3308.04.18    1.04版汉化包制作完成,对应原先的1.04英文版
    3434
    35 ¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª
    36 ºº»¯£¨º¹»¯£©²»ÈÝÒ×£¬×ªÔØʱÇë±£Áôºº»¯Õߣ¬Ð»Ð»¡£
     35—————————————————————————————————————
     36汉化(汗化)不容易,转载时请保留汉化者,谢谢。
    3737
    38 NapTID£¨ÎÞÃû£©2008.06.18
     38NapTID(无名)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 美利坚
    55#COLOR FFAFAF
    66#SYMBOLS Nation1, 48
     
    1111
    1212#CITIES
    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
     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
    113113
    114114#UNITS StdUnits
    115         20,     040,    Ãñ±ø
     115    20, 040,    民兵
    116116
    117117#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 巴比伦
    55#COLOR EFCB47
    66#SYMBOLS Nation2, 92
     
    1111
    1212#CITIES
    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
     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
    5959
    6060#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 大不列颠
    55#COLOR 978367
    66#SYMBOLS Nation2, 95
     
    1111
    1212#CITIES
    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
     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
    118118
    119119#UNITS StdUnits
    120         22,     040,    Ãñ±ø
     120    22, 040,    民兵
    121121
    122122#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 中华
    55#COLOR 00FFFF
    66#SYMBOLS Nation1, 41
     
    1111
    1212#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    湛江
    112112
    113113#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 埃及
    55#COLOR 37CFAF
    66#SYMBOLS Nation1, 42
     
    1111
    1212#CITIES
    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
     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
    8989
    9090#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 法兰西
    55#COLOR 576FC7
    66#SYMBOLS Nation1, 43
     
    1111
    1212#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         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ône
    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
     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
    142142
    143143#UNITS StdUnits
    144         23,     040,    Ãñ±ø
     144    23, 040,    民兵
    145145
    146146#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 日耳曼
    55#COLOR AFAFAF
    66#SYMBOLS Nation1, 44
     
    1111
    1212#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         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
     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
    159159
    160160#UNITS StdUnits
    161         20,     040,    Ãñ±ø
     161    20, 040,    民兵
    162162
    163163#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 希腊
    55#COLOR FF00BF
    66#SYMBOLS Nation2, 90
     
    1111
    1212#CITIES
    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
     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
    105105
    106106#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 日本
    55#COLOR 57AB27
    66#SYMBOLS Nation1, 45
     
    1111
    1212#CITIES
    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
     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
    112112
    113113#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 蒙古
    55#COLOR 8367B3
    66#SYMBOLS Nation2, 91
     
    1111
    1212#CITIES
    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
     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
    5454
    5555#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 波斯
    55#COLOR EB830B
    66#SYMBOLS Nation1, 46
     
    1111
    1212#CITIES
    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
     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
    6262
    6363#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 婓尼基
    55#COLOR B3FF00
    66#SYMBOLS Nation1, 40
     
    1111
    1212#CITIES
    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
     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
    7070
    7171#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 罗马
    55#COLOR FFFFFF
    66#SYMBOLS Nation1, 49
     
    1111
    1212#CITIES
    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
     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
    8383
    8484#UNITS StdUnits
    85         22,     040,    Ãñ±ø
     85    22, 040,    民兵
    8686
    8787#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 俄罗斯
    55#COLOR E70000
    66#SYMBOLS Nation2, 94
     
    1111
    1212#CITIES
    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
     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
    112112
    113113#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,    Ã׸ñ-29
     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,    米格-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 西班牙
    55#COLOR FFFF00
    66#SYMBOLS Nation1, 47
     
    1111
    1212#CITIES
    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
     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
    115115
    116116#UNITS StdUnits
    117         22,     040,    Ãñ±ø
     117    22, 040,    民兵
    118118
    119119#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,    ÏÖ´úºäÕ¨»ú
     10,  074,    奴隶劳工
     21,  075,    自由民众
     33,  071,    小潜艇
     44,  073,    滑翔机
     57,  064,    单桅帆船
     610, 010,    拓荒者
     711, 011,    工程师
     813, 021,    特种兵
     914, 030,    建设队
     1016, 017,    建城地
     1117, 041,    守城卫兵
     1220, 100,    蛮战士
     1321, 100,    弓兵
     1422, 100,    蛮战士
     1523, 100,    蛮战士
     1624, 101,    罗马军团
     1725, 101,    长矛手
     1826, 101,    方阵兵
     1927, 101,    箭手
     2030, 102,    守卫
     2131, 102,    守卫
     2232, 102,    守卫
     2333, 102,    守卫
     2434, 103,    火枪手
     2535, 103,    火枪手
     2636, 103,    火枪手
     2737, 103,    火枪手
     2840, 104,    步枪手
     2941, 104,    步枪手
     3042, 104,    步枪手
     3143, 104,    步枪手
     3244, 105,    步兵
     3345, 105,    步兵
     3446, 105,    步兵
     3547, 105,    步兵
     3650, 106,    陆战队
     3751, 106,    陆战队
     3852, 106,    陆战队
     3953, 106,    陆战队
     4054, 110,    装甲步兵
     4155, 110,    装甲步兵
     4256, 110,    装甲步兵
     4357, 110,    装甲步兵
     4460, 130,    骑兵
     4561, 130,    骑兵
     4662, 130,    骑兵
     4763, 130,    骑兵
     4864, 131,    骑兵
     4965, 131,    骑兵
     5066, 131,    骑兵
     5167, 131,    骑兵
     5270, 132,    骑士
     5371, 132,    骑士
     5472, 132,    骑士
     5573, 132,    骑士
     5674, 133,    龙骑兵
     5775, 133,    龙骑兵
     5876, 133,    龙骑兵
     5977, 133,    龙骑兵
     6080, 134,    轻骑兵
     6181, 134,    轻骑兵
     6282, 134,    轻骑兵
     6383, 134,    轻骑兵
     6484, 135,    坦克
     6585, 135,    坦克
     6686, 135,    坦克
     6787, 135,    坦克
     6890, 136,    装甲车
     6991, 136,    装甲车
     7092, 136,    装甲车
     7193, 136,    装甲车
     72100,    170,    投石车
     73101,    170,    攻城塔
     74102,    170,    弩炮
     75103,    170,    弩炮
     76104,    171,    加农炮
     77105,    171,    加农炮
     78106,    171,    加农炮
     79107,    171,    加农炮
     80110,    172,    榴弹炮
     81111,    172,    榴弹炮
     82112,    172,    榴弹炮
     83113,    172,    榴弹炮
     84114,    173,    火箭炮
     85115,    173,    火箭炮
     86116,    173,    火箭炮
     87117,    173,    火箭炮
     88120,    200,    帆船
     89121,    200,    帆船
     90122,    200,    帆船
     91123,    200,    帆船
     92124,    201,    大帆船
     93125,    201,    快速帆船
     94126,    201,    护卫舰
     95127,    201,    护卫舰
     96130,    202 铁甲舰
     97131,    202,    驱逐舰
     98132,    202,    巡洋舰
     99133,    202,    巡洋舰
     100134,    203,    导弹巡洋舰
     101135,    203,    战列舰
     102136,    203,    战列巡洋舰
     103137,    203,    战列舰
     104140,    210,    运输舰
     105141,    210,    运输舰
     106142,    210,    运输舰
     107143,    210,    运输舰
     108144,    220,    航母
     109145,    220,    航母
     110146,    220,    航母
     111147,    220,    航母
     112150,    240,    潜艇
     113151,    240,    潜艇
     114152,    240,    潜艇
     115153,    240,    潜艇
     116160,    300,    战斗机
     117161,    300,    战斗机
     118162,    300,    战斗机
     119163,    300,    战斗机
     120164,    301,    喷气战斗机
     121165,    301,    喷气战斗机
     122166,    301,    直升机
     123167,    301,    喷气战斗机
     124170,    310,    轰炸机
     125171,    310,    轰炸机
     126172,    310,    飞艇
     127173,    310,    轰炸机
     128174,    311,    现代轰炸机
     129175,    311,    现代轰炸机
     130176,    311,    现代轰炸机
     131177,    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 维京
    55#COLOR 9FBB8B
    66#SYMBOLS Nation2, 93
     
    1111
    1212#CITIES
    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
     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
    120120
    121121#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 ´åÀ¸«ü«n
    2 #HELPTITLE_QUICKSTART §Ö³t¤W¤â
    3 #HELPTITLE_CONCEPTS ·§©À¸Ñ»¡
    4 #HELPTITLE_TECHLIST ¬ì§Þ¤@Äý
    5 #HELPTITLE_IMPLIST «°¥«³]¬I
    6 #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¯Áµ²ªG
    20 
    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 (部隊科技屬性)
    3131
    3232#TECHFORMULA %.6g*n*EXP(n/%.6g)
    33 #PREREQ ¥ý´Á©Ò»Ý¬ì§Þ
    34 #PREREQALT ¥ý´Á©Ò»Ý¬ì§Þ (¤T¶µ¤¤»Ý¨ã³Æ¨â¶µ)
    35 #BASETECH (¦E®É¥N¬ì§Þ)
    36 #STRENGTHUP %s: ¾Ô¤æ¤O­¿¼W¦]¤l +%d
    37 #COSTUP (³yɲ­¿¼W¦]¤l +%d)
    38 #COSTMIN (³yɲ­¿¼W¦]¤l ¤W¤É¦Ü %d)
    39 #TRANSUP %s: ¹B¿é¤O­¿¼W¦]¤l +%d
    40 #ADVEFFECT ¥\®Ä
    41 #EFFECT ®ÄªG
    42 #COSTS ³yɲ
    43 #BUILDCOST ¥Í²£³yɲ: %d%%p
    44 #MAINTCOST ºûÅ@¶O¥Î: ¨C¦^¦X %d%%c
    45 #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 ©Ò»Ý¬ì§Þ: %s
    51 #RAREREQUIRED ¥Í²£»Ý­n %s
    52 #RESFOOD ³­¹: %d%%f
    53 #RESPROD ¥Í²£: %d%%p
    54 #RESTRADE ¶T©ö: %d%%t
    55 #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 特殊資源
    5959#SPECIALFOOD , +%d%%f
    6060#SPECIALPROD , +%d%%p
    6161#SPECIALTRADE , +%d%%t
    62 #TRAFO ¦a§Î¥iÅÜ§ó¬° %s
    63 #MOVEPLAIN ³¡¶¤²¾°ÊÃþ«¬: ¥­©Z¦a§Î
    64 #MOVEHEAVY ³¡¶¤²¾°ÊÃþ«¬: ±T¹ò¦a§Î
    65 #DEFBONUS ¨¾±s¥[¦¨: %d%%
    66 #JOBCOST -«Ø³]³yɲ: %s ¦æ°ÊÂI
    67 #JOBCOSTVAR -«Ø³]³yɲ: ½Ð¦b´åÀ¸¤¤¿ï¾Ü"¨t²Îµæ³æ" - "§Ö³t§»¾Þ§@" -  "¦a§Î§ï³y"
    68 #TERIMPEXCLUDE Äéµ@¡BªöÄq¡B­n¶ë©M­x¨Æ°ò¦a¤£¥i¦@¦s¤_¦P¤@¦a¶ô. ¨Ò¦p, ­Y¦b¤w«Ø¦³­n¶ëªº¦a¶ô«Ø³]­x¨Æ°ò¦a, «h­n¶ë±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/%d
    74 #SPEED Éó°Ê: %s
    75 #MODELNOTE (¦b¤£¦P°ê®a¤¤, ¦PÏú³¡¶¤ªº¥~Æ[©M¦WºÙ¥i¯à¦³©Ò®tÉÝ.)
    76 #COSTBASE ¥Í²£³yɲ°ò­È %s%%p
    77 #WEIGHT ½s¨î %s%%w
    78 #BUILDALLOW ·s¼W³]¬I
    79 #MODELALLOW ¥i©º¯S®í³¡¶¤
    80 #FEATALLOW ·s¼W¯S®íÄÝ©Ê
    81 #FOLLOWADV ¦ZÄò¬ì§Þ
    82 #GOVALLOW ¥X²{·s¥Í¬FÊ^
    83 #UPGRADEALLOW ­x¨Æ¼vÅT
    84 #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" 的任何搜索結果.
    9595
    9696
    9797#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¸£¹ï¨M
     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 電腦對決
    126126
    127127
    128128#ABOUT
    129 $Ãö¤_´åÀ¸\
     129$關于游戲\
    130130
    131131&LOGO\\
    132132
    133 !°_·½¤Î¥Ø¼Ð\
     133!起源及目標\
    134134C-evo is a non-commerical game project based on the famous "Sid Meier's
    135135Civilization" by Microprose. The ambition of C-evo is not, to compete with
     
    140140::E2 c-evo.org\\
    141141
    142 !©Ò¦³Åv³\¥i\
     142!所有權許可\
    143143C-evo is a compilation of work by a number of authors. You are allowed
    144144to play the game and to distribute it without explicit permission. The compilation
     
    148148the graphics, you should ask the author of an item before using it for another
    149149purpose than to play.\
    150 ::C ¬d¬Ý¨î§@¤H­û¦W³æ\\
    151 
    152 !AI¼Ò¶ô\
     150::C 查看制作人員名單\\
     151
     152!AI模塊\
    153153The game has an open AI interface, which means the player can replace the standard AI
    154154contained in the package by other AI algorithms, either for all or for single
     
    158158you installed the game. Maybe competition will lead us to the first real good AI
    159159in 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!錯誤報告\
    173173
    174174To support the progress of this project, please tell me about problems you have
     
    200200
    201201#CREDITS
    202 $¨î§@¤H­û\
     202$制作人員\
    203203
    204204@@18\\
    205205
    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Á§A­Ì¨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.\
     213PNG圖片支持: Edmund H. Hand\\
     214
     215!測試\
     216無數不知名的測試者, 感謝你們每一個人!\\
     217
     218!其他\
     219某些紋理圖片來自 "Mayang's Free Textures".\
     220城市名單提供: Charles Nadolski..\\
     221
     222!美工\
     223絕大部分圖片是從网上流傳的各种文明II資源包內提取的,
     224其中一些作者已不可考, 還有一些無法聯絡. 若發現商業
     225版權圖片, 或是不愿您的勞動成果被免費轉用, 或是作為
     226圖片作者的您想在制作人員名單中留下姓名, 請聯系我們.
    227227
    228228
    229229#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可顯示相關的幫助信息.\\\
    252252
    253253
    254254@@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¤W­z®tÉݤ§¥~, ÁÙ¦³¥H¤U­nÂI´£½Ð¦U¦ìª±®a¯d·N:\
    271 
    272 -C-evo¤£¾aÀHÉó¹Bºâ§@¬°½æÂI. ¨C¤@¶µ­p¦Eªºµ²ªG³£¥i
    273 ¹w´Á, °£¤F¥@¬É¦a¹Ïªº¥Í¦¨©M¨ä¥L¶Õ¤OªºÁ|°Ê¤§¥~.\
    274 -¹q¸£­pºâ©Ò¨ÌÕuªº³W«hÉO¯u¤Hª±®a§¹¥þ¬Û¦P. ¹q¸£ª±®a
    275 ¦}µ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-某些地形對地面部隊會造成傷害, 詳見"地形种類"中的"惡土".\
    289289
    290290
    291291#INTRO
    292 $´åÀ¸¤¶²Ð\
     292$游戲介紹\
    293293
    294294@@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不論是哪個种族, 都在為了同一個目標而競爭: 最終的胜利.
    322322
    323323
    324324#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回合結束"的提示,請點擊屏幕右下角的結束回合按鈕.\\
    343343
    344344
    345345#SCIENCE
    346 $¬ì§Þ\
     346$科技\
    347347
    348348@@46\
    349 !¬ì§Þ\
    350 
    351 ´åÀ¸¤¤°ê®a­n·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¿ï¾Ü·Q­n
    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 ¬ã¨s­p¦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 科研費用詳解
    368368
    369369
    370370#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當前難度下, 科研費用的計算公式為:\
    377377&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­È+1
     378變量n的初始值為4, 并根据以下條件發生相應變化:\
     379-部隊研發不會影響n值的變化\
     380-電腦科技的研究不會影響n值的變化\
     381-成功研得從其他勢力獲得的科技, n值+1\
     382-自行成功研得任何其他科技, 包括三种未來科技, n值+2\
     383-從大圖書館中直接獲得科技, n值+1
    384384
    385385
    386386#DIPLOMACY
    387 $¥~¥æ\
    388 
    389 !·§½×\
    390 
    391 ¨â­Ó¯À¥¼¿Ñ­±ªº°ê®a­n«Ø¥ß¥~¥æÃö¨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µ{¥D­n¥Ñ¨î©w´£Ä³,
    400 ±µ¨ü´£Ä³, ¥H¤Î¨ú®ø±ø¬ù¤T³¡¤À²Õ¦¨.\\
    401 
    402 ·í¥æ¯AÂù¤è³£°±¤î´£Ä³ªº®É­Ô, ¥æ¯A´N±Nµ²§ô. ¦pªG¤@¤è
    403 ¿ï¾Ü²×¤î½Í§P, ¥æ¯A¤]·|¥ß§Y²×¤î.\\
    404 
    405 !´£Ä³\
    406 ¥~¥æ¥æ¯A¥D­nªº²Õ¦¨³¡¤À¬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¥­±ø¬ùªº¤W­z¬ù©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綜上所述, 兩國間可能的關系列表如下:\
    446446&TREATIES\\
    447447
    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的可信度, 對其他國家都是公開透明的.
    468468
    469469
    470470#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特殊資源包括:\
    487487&MODERN\\
    488488
    489 ­nµo²{³o¨Ç¯S®í¸ê·½, ¥²¶·¥ýÀò±o¥H¤U¬ì§Þ:\
    490 ::A47 ³W¼Ò¶q²£
     489要發現這些特殊資源, 必須先獲得以下科技:\
     490::A47 規模量產
    491491
    492492
    493493#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¤W­z±¡ª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移動所耗机動力的示意圖如下:\
    529529@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也會陷入騷亂狀態, 并持續三個回合.
    553553
    554554
    555555#COMMANDS
    556 $³¡¶¤«ü¥O\
     556$部隊指令\
    557557
    558558@@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點机動力)
    574574
    575575
    576576#SETTLE
    577 $²¾¥Á¤u§@\
     577$移民工作\
    578578
    579579@@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 可參考: 地形种類一覽
    600600
    601601
    602602#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°_§ðÀ»; ªÅ¤¤³¡¶¤¥u­n¤£¦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, ¦b
    624 «°¥«¨½©Î¹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每支部隊的戰斗力分為攻擊和防御兩种. 部隊情報中顯示的
     61675/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點狀態, 部隊經驗提升一級. 經驗等級詳列如下:\
    643643&EXPERIENCE\\
    644644
    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點.  驅逐的方法与攻擊方法相同.
    661661
    662662
    663663#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造价較低的那支部隊將擔任防守任務.
    680680
    681681
    682682#SPYMISSIONS
    683 $¯µ±K¦æ°Ê\
     683$秘密行動\
    684684
    685685@@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 -¥´§v­x¨Æ±¡³ø: Àòª¾¼Ä¤è³Ì·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但特种兵依然可潛入任何地區, 無視條約的約束.
    698698
    699699
    700700#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從而開啟部隊研發窗口:\\
    713713
    714714@DraftShot\
    715715
    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%.
    736736
    737737
    738738#CITIES
    739 $«°¥«·§½×\
     739$城市概論\
    740740
    741741@@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即可打開該城市的專屬畫面: \\
    753753
    754754@CityShot\
    755755
    756 ¤W­zµe­±¤¤, ¥D­n¥]§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¤£¦w
    786 ¥«¥ÁÅܬ°¦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).
    806806\\
    807807
    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ªºÂ³­¹±N­p¤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¨ì¤W­z±¡ª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最常用的方法是將更多市民改為城市戒嚴部隊.
    904904
    905905
    906906#CORRUPTION
    907 $­pºâ»G±Ñ¤ñ¨Ò\
    908 
    909 !­pºâ»G±Ñ¤ñ¨Ò\
    910 
    911 ¤@­Ó«°¥«ªº»G±Ñ¤ñ¨Ò, ®ÚÕu¥H¤U¤½¦¡­pºâ:\
    912 @CORRUPTION\
    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%.
    921921
    922922
    923923#OPTI
    924 $¸ê·½¦Û°Ê¤À°t±ø¥ó¤½¦¡\
    925 
    926 !¸ê·½¦Û°Ê¤À°t±ø¥ó¤½¦¡\
    927 
    928 ¦Û°Ê¤À°t¸ê·½¦@¥]¬A¤­Ïú±¡ªp, ¨ä¤¤ªº®t§O¦b¤_ɬ¥ý¦]¤lmªºÚÌ©w¤Î­pºâ. ɬ¥ý¦]¤lmªº¦Ò¶q­S³ò¥]¬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)
    935935
    936936
    937937#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的一半. 拓荒者和工程師可以清理污染.
    983983
    984984
    985985#BUILDINGS
    986 $«Øµ®¤¶²Ð\
     986$建筑介紹\
    987987
    988988@@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°ê«Ø¦¨¤F
    998 ©_¸ñ, «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ªG­n±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設施變賣的价格等同于其生產原料換算成現金的价格.
    10151015
    10161016
    10171017#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直至騷亂結束.
    10361036
    10371037
    10381038#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¤@¦}°õ¦æ. ¦b­n
    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將在在建的設施建成后再行啟動.
    10621062
    10631063
    10641064#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"¦r­Y¬°
    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子目錄下即可使用.
    11061106
    11071107
    11081108#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ªG­n³Ð«Ø·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像素.
    11291129
    11301130
    11311131#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數字, 根据回合推進而同步更新, 如下圖所示:\\
    11421142
    11431143@AITShot\
    11441144
    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勢力游戲失敗的次數.
    11481148
    11491149
    11501150#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-其他菜單快捷鍵, 請參見游戲中各菜單
    11671167
    11681168#TRADINGGOODS
    1169 $°Ó«~¶T©ö\
    1170 
    1171 !°Ó«~¶T©ö\
    1172 
    1173 ¿ï¾Ü°Ó«~¶T©ö, ©Ò¦³¥Í²£­ì®Æ±N³Qª½±µÂà´«¬°²{ª÷§Q¼í.
     1169$商品貿易\
     1170
     1171!商品貿易\
     1172
     1173選擇商品貿易, 所有生產原料將被直接轉換為現金利潤.
    11741174
    11751175#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 查看部隊研發的有關信息
    11821182
    11831183#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«Ø³y­n¶ë.\::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«Ø³y­x¨Æ°ò¦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%\(不會增加額外污染)
    12761276*
    12771277*
    12781278
    12791279#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±¡³ø©M­x¨Æ±¡³ø.\\­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城市規模增長后, 糧食儲量不是全空, 而是半滿.
    13111311+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%.
    13181318+4%m.
    1319 ¬ì¾Ç¥Í²£ +75%.
    1320 ¨C­Óªñ®ü¦a¶ô +1%f.\\¦¹³]¬I¥u¯à«Ø¦bªu®ü«°¥«.
     1319科學生產 +75%.
     1320每個近海地塊 +1%f.\\此設施只能建在沿海城市.
    13211321+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%f
    1345 ©Ò¦³»È¦æªº®Äª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%.\\可以開始建造殖民飛船部件. 如果沒有太空港, 殖民飛船工程將化為烏有. 如果太空港被其他擁有太空港的勢力占領, 則殖民飛船也將落入占領者的手中.
    13471347
    13481348*
     
    13511351
    13521352#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連續生產同种部隊的生產費用減半, 但若改為生產其他部隊, 生產費用加倍.
    13801380
    13811381#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.
    13901390
    13911391#TECHAGE
    1392 ¦­´Á¬ì§Þ
    1393 ¤u·~¤Æ¬ì§Þ
    1394 ²{¥N¬ì§Þ
    1395 ¥¼¨Ó¬ì§Þ
     1392早期科技
     1393工業化科技
     1394現代科技
     1395未來科技
    13961396
    13971397#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-在本方回合中, 可在空中飛行; 在其他勢力的回合中, 將被當作地面部隊.\-可偵察鄰近城市, 以及同一地塊的多個部隊.\-如果在本方回合結束時, 滑翔机仍在海面, 就會墜毀.\-不可搭載艦船.
    14071407
    14081408#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¦b­x¨Æ°ò¦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«× %d
    2 #MAP ¦a¹Ï %d
    3 #BC ¤½¤¸«e %d ¦~
    4 #AD ¤½¤¸ %d ¦~
     1#GAME 進度 %d
     2#MAP 地圖 %d
     3#BC 公元前 %d 年
     4#AD 公元 %d 年
    55#SHARE %d/%d
    66#SHORTNAME #S
    77#OWNED #A %s
    88#GENCITY #S %d
    9 #GENMODEL #A ¼Ò¶ô %d
     9#GENMODEL #A 模塊 %d
    1010#TILESIZE %dx%d
    1111
    1212'City Screen Text
    13 #HAPPINESS ¦w©w
    14 #CONTROL §ÙÄY
    15 #FAITH «H¥õ
    16 #UNREST ¤£¦w
    17 #HAPPINESSDEMAND ¤H¤f
    18 #HAPPINESSPLUS ³Ñ§E
    19 #STORAGE ¦s³
    20 #FOOD ³­¹
    21 #DEMAND »Ý¨D
    22 #SURPLUS ¦h§E
    23 #LACK ¯Ê¥F
    24 #MATERIAL ­ì®Æ
    25 #PROD ¥Í²£
    26 #POLL ¦Ã¬V
    27 #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 屬部隊
    3636
    3737'Class Screen Text
    3838#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§ÐÁ`­p
    51 #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 特殊部隊
    5252
    5353'Diplomacy Screen Text
    54 #FRSTATGOV ¬FÊ^: %s
    55 #FRSTATPOP ¤H¤f: %d¦ÊÉE
    56 #FRSTATTER »â¤g: %d¦ÊÉE¥­¤è¤½¨½
    57 #FRSTATTECH ¬ì§Þ: %d%%
    58 #FRSTATEXP ±´¯Á: %d%%
    59 #FRLASTCONTACT ¤W¦¸±µàD:
    60 #FRNOCONTACT ¥¼´¿±µàD¡A¶È¾Ì¶Ç»D
    61 #FRNOVISIT ©|¥¼«ô³X
    62 #FROLDCIVILREP (±q%s³BÀò±o)
    63 #FRNOCIVILREP (©|µL°ê®a³ø§i)
    64 #FROURATT §Ú¤èºA«×: %s
    65 #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 關系:
    6767#FRAND ,
    68 #FRCREDIBILITY (%d%% «H¥Î«×)
    69 #FRTREASURY °ê®w: %d%%c
    70 #FRRELATIONS ¥L°êÃö¨t:
     68#FRCREDIBILITY (%d%% 信用度)
     69#FRTREASURY 國庫: %d%%c
     70#FRRELATIONS 他國關系:
    7171
    7272'Other Dialog Text
    73 #PRESENT ·í«e³¡¶¤
    74 #SHOWSTRENGTH ¾Ô¤æ¤O: %d/%d
    75 #RIVER ªe¬y
    76 #INITUNIT ³¡¶¤¬ãµo
    77 #TECHFOCUS ¥Ø¼Ð¡G%s
    78 #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 稅收
    8282#MONEYGAINPOS +%d%%c
    8383#MONEYGAINNEG %d%%c
    8484#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%
    8989#NATEXISTS (%s)
    90 #CONSCRIPTS ©º¶Ò %s
     90#CONSCRIPTS 征募 %s
    9191#WONDEROF %s (%s)
    9292#WONDEROWNER (#A)
    93 #EXPIRED (¤w¹L´Á)
    94 #DESTROYED (¤w³Q·´)
    95 #NOWONDER ©|µL©_¸ñ«Ø¦¨
    96 #BUILDORDER ¥ý¿ï©w«°¥«Ãþ«¬¡A¦A³]©w«Ø³]¦¸§Ç¡G
    97 #BUILDREST ©|¥¼³]©w¦¸§Çªº³]¬I:
    98 #ENHANCE %s: %s ¦æ°ÊÂI
    99 #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 隨机地圖
    104104#TWOTERRAINS %s / %s
    105 #MPMAP ¦h¤H¼Ò¦¡
    106 #NOGAMES ©|µL¶i«×
    107 #AIT_ROUND ²Ä%d¦^¦X,
     105#MPMAP 多人模式
     106#NOGAMES 尚無進度
     107#AIT_ROUND 第%d回合,
    108108
    109109'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 «°¥«¨¾±s
    122 #TITLE_RATES ¸gÀÙ
    123 #TITLE_DRAFT ³¡¶¤¬ãµo
    124 #TITLE_WONDERS ¥@¬É©_¸ñ
    125 #TITLE_ENHANCE ¦a§Î§ï³y
    126 #TITLE_CITYTYPES «°¥«Ãþ«¬
    127 #TITLE_PROJECT ½Ð«ü©w­n«Ø³]ªº³æ¦ì
    128 #TITLE_CITYNAME «°¥«¦WºÙ
    129 #TITLE_MODELNAME ·s«¬³¡¶¤¦WºÙ
    130 #TITLE_ERROR ¿ù»~
    131 #TITLE_SCIENCE ¬ì§Þ³ø§i
    132 #TITLE_OFFERDELIVER ²K¥[´£Ä³
    133 #TITLE_OFFERCOST ²K¥[»Ý¨D
    134 #TITLE_NUMBER ¼Æ¦r
    135 #TITLE_AMOUNT ¼Æ¶q
    136 #TITLE_CHOOSETECH ¿ï¾Ü¬ì§Þ
    137 #TITLE_CHOOSEMODEL ¿ï¾Ü³]­p³æ¦ì
    138 #TITLE_CHOOSESHIPPART ¿ï¾ÜÃþ§O
    139 #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 地圖名稱
    142142#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 軍事報告
    146147
    147148'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¦¹«Øµ®±À­Ë­««Ø¡H
    165 #SPDESTRUCTQUERY \(ª`·N: ¦pªG©î°£¤ÓªÅ´ä, ¦¹¦aªº´Þ¥Á­¸²î¶µ¥Ø±N³Q¼o°£!)
    166 #SELL %s\\±N¦¹«Øµ®Åܽæ®M²{¡H
    167 #LOSEMAT ­Y§¹¥þ§ó§ï«Ø³]Ãþ«¬, ·í«e«Ø³]¤¤ªº¶µ¥Ø±N³QÅܽæ. %d%%p ªºÅܽæɲ®æ¬° %d%%c.
    168 #LOSEMAT3 ­Y­n§ó§ï¬°¦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§ðÀ»¥Ø¼Ð¤\¡H
    185 #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 ¦¹³¡¶¤¤£¬O­x¨Æ³æ¦ì, µ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!\#N­n¨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ªº¥@¬É©_¸ñ:\%s
    210 #WONDERBUILTEXP ¬Y°ê«Ø¦¨¤F·sªº¥@¬É©_¸ñ:\%s\\¦ý³o¶µ©_¸ñ¤w¸g¹L®É, ¨S¦³¥ô¦ó²{¹ê·N¸q.
    211 #WONDERBUILTOWN §Ú°ê«Ø¦¨¤F·sªº¥@¬É©_¸ñ:\%s
    212 #WONDERCAPT #N¥e»â¤F¤@¶µ¥@¬É©_¸ñ:\%s
    213 #WONDERCAPTOWN §Ú°ê¥e»â¤F¤@¶µ¥@¬É©_¸ñ:\%s
    214 #WONDEREXP ¥@¬É©_¸ñ: %s ªº®ÄªG¤w¤£Î`¦s¦b.
    215 #WONDERDEST ¤@¶µ¥@¬É©_¸ñ³QºR·´¤F:\%s
    216 #COLDWAR ¥Ñ¤_®Ö¾Ôªº¥@¬É©Ê«Â¯Ù, ©Ò¦³¶Õ¤Oªº¥~¥æ¥ß³õÅܱoÃø¥H°Ê·n, ¥æ¯A¤w¤£¦A¦³®Ä. ¥þ²y§N¾Ô¶}©l¤F.
    217 #COLDWAREND §N¾Ôµ²§ô¤F.
    218 #SHIPBUILT #N­è§¹¦¨¤F´Þ¥Á­¸²îªº¬Y³¡¥ó¥Í²£.
    219 #SHIPBITRADE1 #S ©M
    220 #SHIPBITRADE2 #s ¥æ´«¤F¦U¦Ûªº´Þ¥Á­¸²î³¡¥ó.
    221 #SHIPUNITRADE1 #N ±q #s ³BÀò±o¤F
    222 #SHIPUNITRADE2 ¥ó´Þ¥Á­¸²î³¡¥ó¡C
    223 #SHIPCAPTURE1 #N¹Ü¨ú¤F
    224 #SHIPCAPTURE2 #aªº´Þ¥Á­¸²î³¡¥ó!
    225 #SHIPDESTROYED #Nªº´Þ¥Á­¸²î¶µ¥Ø³Q¼o°£¤F
    226 #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¡I
    239 #GRLIB_GENERAL ±q¤j¹Ï®ÑÀ]¤¤¡A§Ú­ÌÀò±o¤F %s ªºª¾ÃÑ¡I
    240 #ORACLEINCOME ¦¬¤J: %d%%c
    241 #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´åÀ¸Ð`§Q
    252 #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 共享胜利)
    253254#SHAREDWIN_CONCAT %s, %s
    254 #NOAI ¥¼µo²{¦w¸ËªºAI´¡¥ó¡I
    255 #FILENOTFOUND ¥¼µo²{¦W¬° "%s" ªº¤å¥ó.
    256 #AIEXCEPTION AI´¡¥ó%s¤¤¥X²{ÄY­«¿ù»~¡I
    257 #LOADERR ¦¹´åÀ¸¶i«×ÉO·í«eªº´åÀ¸ª©¥»¤£¯à­Ý®e
    258 #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§ä¨ì¥Î¤á%s
    263 #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 地圖已刪除
    268269#TURN #N\%s
    269 #SUPERTURN ¶W¯Å¥Î¤á\%s
    270 #FRNEWNATION §Ú­Ì¤w¦P#n«Ø¥ß¤F¥~¥æÁp¨t.
    271 #FRCONTACT #nªº¨Ï¸`·QÂѨ£¤j¤H.\¬O§_±µ¨£?
    272 #FRREJECTED #N¤£º@±µ¨£§Ú¤è¨Ï¸`.
    273 #FRCANCELQUERY_CEASEFIRE ¼¹·´°±¤õ±ø¬ù?
    274 #FRCANCELQUERY_PEACE ¦V¹ï¤è«Å¾Ô¤\¡H
    275 #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®Ä¡I
    289 #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 自由女神像\已經生效.
    294295
    295296'Diplomatic Statements, do not use '\'!
    296 #FRSTART_NOTREATY ÂÔ¥Nªí#n¥Á¨Ó¦¹ÉO¶Q°ê¥æ¯A.
    297 #FRSTART_PEACE ÂÔ¥Nªí#n¦V»Õ¤U­P·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°êªº\-%s
    304 #FRPRESENT §Ú­Ìº@±N:\-%s ©^°eµ¹¶Q°ê§@¬°Â§ª«.
    305 #FRDEMAND_STRONG §â\-%s ¥æ¥X¨Ó¡A\§_«h¦³§A­Ì¨üªº!
    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%%c
    334 #PRICE_ALLTECH #a©Ò¦³ªº¬ì§Þ¦¨ªG
    335 #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所有的研發部隊
    336337#PRICE_CONCAT %s\-%s
    337 #PRICECAT_ALLTECH ©Ò¦³¬ì§Þ¦¨ªG
    338 #PRICECAT_ALLMODEL ©Ò¦³³¡¶¤¬ãµo
     338#PRICECAT_ALLTECH 所有科技成果
     339#PRICECAT_ALLMODEL 所有部隊研發
    339340
    340341'Button Captions
    341 #BTN_OK ÚÌ©w
    342 #BTN_CANCEL ¨ú®ø
    343 #BTN_YES ¬O
    344 #BTN_NO §_
    345 #BTN_INFO À°§U
     342#BTN_OK 确定
     343#BTN_CANCEL 取消
     344#BTN_YES
     345#BTN_NO
     346#BTN_INFO 幫助
    346347#BTN_RESET Reset
    347348
    348349'Button Tooltips
    349 #BTN_SELECT ¿ï¾Ü
    350 #BTN_PAGE ¤U­¶
    351 #BTN_SUPPORT Æ×Äݳ¡¶¤
    352 #BTN_IMPRS «°¥«³]¬I
    353 #BTN_CLASSES ³¡¶¤
    354 #BTN_WONDERS ©_¸ñ
    355 #BTN_BUY ÁʶR
    356 #BTN_DELETE §R°£
    357 #BTN_RENAME §ó¦W
    358 #BTN_OBSOLETE °±¤î¥Í²£
    359 #BTN_NONOBSOLETE ¤¹³\¥Í²£
    360 #BTN_ALLOWCONSCRIPTS ¤¹³\©º¶Ò
    361 #BTN_NOCONSCRIPTS °±¤î©º¶Ò
    362 #BTN_ENDTURN µ²§ô¦^¦X¡I
    363 #BTN_SKIP ¤£¦AÅã¥Ü¨ä¥L¶Õ¤O²¾°Ê
    364 #BTN_NOAUTOMOVE °±¤î¦V¥Ø¼Ð²¾°Ê
    365 #BTN_STOP °±¤î
    366 #BTN_NEGO Ä~Äò½Í§P
    367 #BTN_DIALOG Ápµ¸¦¹°ê
    368 #BTN_BREAK ²×¤î¥»¦¸½Í§P
    369 #BTN_PASS µ²§ô¥»¤è´£Ä³
    370 #BTN_CNTREATY ¼¹·´¨óij
    371 #BTN_ACCEPT ±µ¨ü´£Ä³
    372 #BTN_NOTICE ¤wÀò±x¨M©w
    373 #BTN_REPLAY ¾ú¥v­«©ñ
    374 #BTN_RENGAME ´åÀ¸§ó¦W
    375 #BTN_DELGAME ´åÀ¸§R°£
    376 #BTN_RENMAP ¦a¹Ï§ó¦W
    377 #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¬Û³B
    388 #BTN_OFFERFRIENDLY ´£Ä³¤Í¦n¬Û³B
    389 #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 后來的部分
    395396
    396397'Morphing Menu Entries
    397 #SUPER ¶W¯Å¥Î¤á
    398 #HUMAN ¥»¦aª±®a
    399 #AIT ¹q¸£¹ï¨M
    400 #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°£´ËªL
    410 #BTN_DRAIN ©â¤zªh¿A
    411 #BTN_UNDESERT ¾ã¬°¥­­ì
    412 #FARTECH ³]©w¥Ø¼Ð
    413 #NOFARTECH ¨S¦³¥Ø¼Ð
    414 #UTILIZE °Ñ«Ø
    415 #INTEGRATE ¾ã½s
     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 整編
    416417#NETWORK_SERVER Network Server
    417418#NETWORK_CLIENT Network Client
    418419
    419420'Busy Messages
    420 #BUSY_START ³Ð«Ø¥@¬É¡K
    421 #BUSY_MOD %s¸ü¤J¤¤¡K
    422 #BUSY_MODLH ¹Ï§Îªì©l¤Æ¡K
    423 #BUSY_INIT ª±®aªì©l¤Æ¡K
    424 #BUSY_LOAD ¸ü¤J´åÀ¸¶i«×¡K
     421#BUSY_START 創建世界…
     422#BUSY_MOD %s載入中…
     423#BUSY_MODLH 圖形初始化…
     424#BUSY_INIT 玩家初始化…
     425#BUSY_LOAD 載入游戲進度…
    425426
    426427'Map Editor
    427 #MAP_START ¹q¸£Ïú±Úªì©l¦ì¸m
    428 #MAP_PREFSTART ª±®aÏú±Úªì©l¦ì¸m
    429 #MAP_RANDOM ©ñ±ó·í«eªº¦a¹Ï, ­«·sÀHÉó¥Í¦¨·sªº¦a¹Ï¡H
    430 #MAP_CLOSE ¿ï¾ÜÃö³¬·í«eªº¦a¹Ï¡C\¬O§_«O¦s¡H
     428#MAP_START 電腦种族初始位置
     429#MAP_PREFSTART 玩家种族初始位置
     430#MAP_RANDOM 放棄當前的地圖, 重新隨机生成新的地圖?
     431#MAP_CLOSE 選擇關閉當前的地圖。\是否保存?
    431432
    432433#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¼Ò¶ô¡G
     434退出
     435開始
     436讀取
     437新建游戲
     438讀取進度
     439世界尺寸:
     440陸地比例:
     441自定義玩家
     442年代:
     443%s的難度
     444年限:
     445地圖編輯
     446編輯
     447幫助
     448難度:
     449競爭种族:
     450AI模塊:
    450451
    451452#AUTODIFF
    452 ¤Jªù
    453 Â²³æ
    454 ¥¿±`
    455 §xÃø
    456 ÅܺA
     453入門
     454簡單
     455正常
     456困難
     457變態
    457458
    458459#CONTROLS
    459 ¨ú®ø©R¥O
    460 Ãö³¬
    461 ¸gÀ٤ε|¦¬¡K
    462 ªø«°«OÅ@°Ï°ì
    463 ¬d¬Ý¦a§Î
    464 ¥@¬É©_¸ñ¡K
    465 ´åÀ¸«ü«n
    466 ´ú¸Õ
    467 ­x¨Æ±¡³ø¡K
    468 AI´ú¸Õ«H®§¡K
    469 «°¥«Ãþ«¬¡K
    470 ¬É­±©~¤¤
    471 ¥Ø¼Ð²¾°Ê
    472 ³¡¶¤©R¥O
    473 ³¡¶¤«H®§
    474 «Ø¥ß­x¨Æ°ò¦a
    475 §ó´«¦a§Î
    476 ²M°£¦Ã¬V
    477 ±°¹Ü
    478 «Ø³y­n¶ë
    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軍事情報…
     469AI測試信息…
     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网格
     508AI測試地圖
     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地塊尺寸
    555556Small
    556557Medium
     
    560561
    561562#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人工智能
    656657
    657658#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 °Ò«¢¹y­p¦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飛船居住艙
    728729
    729730#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流水作業
    757758
    758759#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水銀
    799800
    800801#DOMAIN
    801 ³°­x
    802 ®ü­x
    803 ªÅ­x
     802陸軍
     803海軍
     804空軍
    804805
    805806#EXPERIENCE
    806 ·s§L
    807 ¨ü°V
    808 ¾ú½m
    809 ¦Ñ§L
    810 ºë¾U
     807新兵
     808受訓
     809歷練
     810老兵
     811精銳
    811812
    812813#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受損恢复
    828829
    829830#GOVERNMENT
    830 µL¬F©²
    831 ¥£Æרî
    832 §g¥D¨î
    833 ¦@©M¨î
    834 ©v±Ð¨î
    835 ¦@²£¨î
    836 ¥Á¥D¨î
    837 ¥¼¨Ó¨î
     831無政府
     832奴制
     833君主制
     834共和制
     835宗教制
     836共產制
     837民主制
     838未來制
    838839
    839840#TREATY
    840 ¥æ¾Ô
    841 °±¾Ô
    842 ©M¥­
    843 ¤Í¦n
    844 Áp·ù
     841交戰
     842停戰
     843和平
     844友好
     845聯盟
    845846
    846847#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聯盟
    852853
    853854#ATTITUDE
    854 ¼Ä¹ï
    855 §N²H
    856 ¤£¦X
    857 ¤¤¥ß
    858 ±µ¨ü
    859 ¤Íµ½
    860 ¼ö±¡
     855敵對
     856冷淡
     857不合
     858中立
     859接受
     860友善
     861熱情
    861862
    862863#CREDIBILITY
    863 ¨¥¦ÓµL«H
    864 ®»ºN¤£©w
    865 ­«¿Õ¦u«H
    866 ¨¥¥X¥²¦æ
     864言而無信
     865捉摸不定
     866重諾守信
     867言出必行
    867868
    868869#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無效城市類型
    885886
    886887#CITYTYPE
    887 ´¶³q«¬«°¥«
    888 ¬ì§Þ«¬«°¥«
    889 ¤u·~«¬«°¥«
    890 ¶W¯Å¤j³£¥«
     888普通型城市
     889科技型城市
     890工業型城市
     891超級大都市
    891892
    892893#DIAGRAM
    893 ¤H¤f
    894 »â¤g
    895 ­x¨Æ
    896 ¬ì§Þ
    897 ±´¯Á
    898 ¯Ñ§@
     894人口
     895領土
     896軍事
     897科技
     898探索
     899耕作
    899900
    900901#JOBRESULT
    901902*
    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抽干沼澤
    921922
    922923#ARMYLOST
    923 #A³¡¶¤³QÄè·À
    924 #AÄ¥¶¤³QÄè·À
    925 #A³¡¶¤¶°¸s³QÄè·À
     924#A部隊被殲滅
     925#A艦隊被殲滅
     926#A部隊集群被殲滅
    926927
    927928#SPYMISSION
    928 ¯}§¥¥Í²£
    929 ÅѨú¦a¹Ï
    930 Àò±o²Ä¤T°ê±¡³ø
    931 ¥´§v°ê®a±¡³ø
    932 ¥´§v­x¨Æ±¡³ø
     929破坏生產
     930竊取地圖
     931獲得第三國情報
     932打听國家情報
     933打听軍事情報
    933934
    934935#WANT
    935 ¯Á­n°ê®a±¡³ø
    936 ¯Á­n­x¨Æ±¡³ø
    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讓對方自行出价
    947948
    948949#OFFER
    949 ©^°e°ê®a±¡³ø
    950 ©^°e­x¨Æ±¡³ø
    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讓對方自行要价
    961962
    962963#CITYMANAGETYPE
    963 ¤â°Ê¤À°t
    964 ¬ì¬ã³Ì¤j¤Æ
    965 ¬ì¬ãɬ¥ý
    966 ¼Wªø³Ì¤j¤Æ
    967 ¥Í²£É¬¥ý
    968 ¥Í²£³Ì¤j¤Æ
     964手動分配
     965科研最大化
     966科研优先
     967增長最大化
     968生產优先
     969生產最大化
    969970
    970971#SETTINGS
  • branches/highdpi/Localization/zh-Hant/ReadMe.txt

    r124 r465  
    1 C-EVO(¤å©ú¶i¤Æ¥v)º~¤Æ»¡©ú
     1C-EVO(文明進化史)漢化說明
    22
    3 ¹CÀ¸¤¶²Ð¡G
    4 C-EVO¬O¤@´Ú±q¤å©ú(Civilization)¨t¦C­l¥Í¦Ó¥XªºWindows¥­¥x¶}·½¦Û¥Ñ¹CÀ¸¡A¦b¿í´`¤å©ú¨t¦C
    5 °ò¥»­ì«hªº°ò¦¤W¡A°µ¤F³\¦h¦³³Ð·N©M¤H©Ê¤Æªº­²·s¡A¬O¤@´Úºë¬ü¦³½ìªº¤å©úÃþ¹CÀ¸¡A¤å©ú°g¤£¥i¤£ª±¡C
    6 ©x¤è¥D­¶¡Ghttp://www.c-evo.org
    7 ­ìª©¹CÀ¸(V1.10¡A¹ïÀ³º~¤Æ¥])¤U¸ü­¶­±¡Ghttp://www.c-evo.org/files/download.php
     3遊戲介紹:
     4C-EVO是一款從文明(Civilization)系列衍生而出的Windows平台開源自由遊戲,在遵循文明系列
     5基本原則的基礎上,做了許多有創意和人性化的革新,是一款精美有趣的文明類遊戲,文明迷不可不玩。
     6官方主頁:http://www.c-evo.org
     7原版遊戲(V1.10,對應漢化包)下載頁面:http://www.c-evo.org/files/download.php
    88
    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然後執行遊戲程序。
    1212
    13 º~¤Æ»¡©ú¡G
    14 1. °ò¥»§¹¥þº~¤Æª©¡A°£¤F¹CÀ¸Ãö©ó³¡¤À¥~¨ä¥L¤º®e¤å¦r¥þ³¡º~¤Æ¡A¥]¬AÀ°§U«ü«n¡A¤å¦r¶q¬ù70KB¡C
    15 2. º~¤Æ¥]¤¤ªþ±a¤Fº~¤ÆªÌ¦Û¦æ³]­pªº¤@´Ú¹CÀ¸¦a¹Ï¡A¥D­n¹ïª±®aªº°_©l¦ì¸m°µ¤FÀu¤Æ¡C
    16 3. º~¤Æ¥]¤¤²K¥[¤F¹CÀ¸«ü«nªº§Ö±¶¹B¦æ¤è¦¡¡A¤è«Kª±®a¬d¾\¡C
    17 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漢化說明:
     141. 基本完全漢化版,除了遊戲關於部分外其他內容文字全部漢化,包括幫助指南,文字量約70KB。
     152. 漢化包中附帶了漢化者自行設計的一款遊戲地圖,主要對玩家的起始位置做了優化。
     163. 漢化包中添加了遊戲指南的快捷運行方式,方便玩家查閱。
     174. 遊戲指南中的某些部分,如科技、設施、奇跡等幫助窗口,窗口標題下方的首行(文字內容與窗口標題相同)
     18為亂碼,為程序兼容問題(首字母大寫出錯),無妨遊戲;繁體中文版中城市的名稱若為中文,在城市窗口中只能顯示城市名的首字,故保留英文名
    1919
    20 V1.10ª©§ó·s·§­n¡G
    21 1¡B¹CÀ¸¬É­±§@¤F½Õ¾ã¡A·s¬É­±§óª½Æ[¤Í¦n
    22 2¡B«°¥«µ¡¤f¤¤¼W³]¤F¸ê·½¦Û°Ê¤À°t¼Ò¦¡¡A¤è«Kª±®a§Ö³t³]¸m¡A´î¤Ö¤F¤¾Ácªº²Ó¸`¾Þ§@
    23 3¡B®Ú¾Úª±®a¤ÏõX¡A­×§ï¤F¤T¶µ©_¸ñªº®ÄªG
    24 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²×¤î±ø¬ùªº³¡¤À³]©w
    27 7¡B¨ä¥L¤è­±ªº·L½Õ
     20V1.10版更新概要:
     211、遊戲界面作了調整,新界面更直觀友好
     222、城市窗口中增設了資源自動分配模式,方便玩家快速設置,減少了冗繁的細節操作
     233、根據玩家反饋,修改了三項奇跡的效果
     244、調整了城市安定值的影響參數以及初始水平
     255、增加了交戰結果預測
     266、交涉指令的少量調整,去除了年貢部分,並調整了終止條約的部分設定
     277、其他方面的微調
    2828
    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漢化更新:
     3008.06.18  1.10版漢化包製作完成,對應新推出的1.10英文版(080526)
     3108.04.18    1.04版漢化包製作完成,對應原先的1.04英文版
    3232
    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漢化(汗化)不容易,轉載時請保留漢化者,謝謝。
    3535
    36 NapTID¡]µL¦W¡^2008.06.18
     36NapTID(無名)2008.06.18
  • branches/highdpi/Localization/zh-Hant/Tribes/Americans.tribe.txt

    r123 r465  
    1 #CHOOSE ¬ü°ê
    2 #n ¬ü°ê¤H
    3 #s ¬ü°ê
    4 #a ¬ü§Q°í
     1#CHOOSE 美國
     2#n 美國人
     3#s 美國
     4#a 美利堅
    55#COLOR FFAFAF
    66#SYMBOLS Nation1, 48
     
    1111
    1212#CITIES
    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
     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
    113113
    114114#UNITS StdUnits
    115         20,     040,    ¥Á§L
     115    20, 040,    民兵
    116116
    117117#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 ¤Ú¤ñ­Û¤H
    3 #s ¤Ú¤ñ­Û
    4 #a ¤Ú¤ñ­Û
     1#CHOOSE 巴比倫
     2#n 巴比倫人
     3#s 巴比倫
     4#a 巴比倫
    55#COLOR EFCB47
    66#SYMBOLS Nation2, 92
     
    1111
    1212#CITIES
    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
     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
    5959
    6060#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ÄA
    2 #n ¤£¦CÄA¤H
    3 #s ­^°ê
    4 #a ¤j¤£¦CÄA
     1#CHOOSE 不列顛
     2#n 不列顛人
     3#s 英國
     4#a 大不列顛
    55#COLOR 978367
    66#SYMBOLS Nation2, 95
     
    1111
    1212#CITIES
    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
     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
    118118
    119119#UNITS StdUnits
    120         22,     040,    ¥Á§L
     120    22, 040,    民兵
    121121
    122122#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 ¤¤°ê¤H
    3 #s ¤¤°ê
    4 #a ¤¤µØ
     1#CHOOSE 中國
     2#n 中國人
     3#s 中國
     4#a 中華
    55#COLOR 00FFFF
    66#SYMBOLS Nation1, 41
     
    1111
    1212#CITIES
    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
     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
    113113
    114114#UNITS Nation1
    115         1,      040,    ¥Á§L
    116         11,     104,    ´åÀ»¶¤
    117         21,     072,    ¤p­Qª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¤Î¤H
    3 #s ®J¤Î
    4 #a ®J¤Î
     1#CHOOSE 埃及
     2#n 埃及人
     3#s 埃及
     4#a 埃及
    55#COLOR 37CFAF
    66#SYMBOLS Nation1, 42
     
    1111
    1212#CITIES
    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
     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
    8989
    9090#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Äõ¦è¤H
    3 #s ªk°ê
    4 #a ªkÄõ¦è
     1#CHOOSE 法蘭西
     2#n 法蘭西人
     3#s 法國
     4#a 法蘭西
    55#COLOR 576FC7
    66#SYMBOLS Nation1, 43
     
    1111
    1212#CITIES
    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
     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
    142142
    143143#UNITS StdUnits
    144         23,     040,    ¥Á§L
     144    23, 040,    民兵
    145145
    146146#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 ¤é¦Õ°Ò¤H
    3 #s ¼w°ê
    4 #a ¤é¦Õ°Ò
     1#CHOOSE 日耳曼
     2#n 日耳曼人
     3#s 德國
     4#a 日耳曼
    55#COLOR AFAFAF
    66#SYMBOLS Nation1, 44
     
    1111
    1212#CITIES
    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
     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
    159159
    160160#UNITS StdUnits
    161         20,     040,    ¥Á§L
     161    20, 040,    民兵
    162162
    163163#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§ÆÛK
    2 #n §ÆÛK¤H
    3 #s §ÆÛK
    4 #a §ÆÛK
     1#CHOOSE 古希腊
     2#n 希腊人
     3#s 希腊
     4#a 希腊
    55#COLOR FF00BF
    66#SYMBOLS Nation2, 90
     
    1111
    1212#CITIES
    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
     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
    105105
    106106#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 ¤é¥»¤H
    3 #s ¤é¥»
    4 #a ¤é¥»
     1#CHOOSE 日本
     2#n 日本人
     3#s 日本
     4#a 日本
    55#COLOR 57AB27
    66#SYMBOLS Nation1, 45
     
    1111
    1212#CITIES
    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
     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
    113113
    114114#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¥j
    2 #n »X¥j¤H
    3 #s »X¥j
    4 #a »X¥j
     1#CHOOSE 蒙古
     2#n 蒙古人
     3#s 蒙古
     4#a 蒙古
    55#COLOR 8367B3
    66#SYMBOLS Nation2, 91
     
    1111
    1212#CITIES
    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
     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
    5454
    5555#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´µ¤H
    3 #s ªi´µ
    4 #a ªi´µ
     1#CHOOSE 波斯
     2#n 波斯人
     3#s 波斯
     4#a 波斯
    55#COLOR EB830B
    66#SYMBOLS Nation1, 46
     
    1111
    1212#CITIES
    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
     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
    6262
    6363#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 ÔÚ¥§°ò¤H
    3 #s ÔÚ¥§°ò
    4 #a ÔÚ¥§°ò
     1#CHOOSE 婓尼基
     2#n 婓尼基人
     3#s 婓尼基
     4#a 婓尼基
    55#COLOR B3FF00
    66#SYMBOLS Nation1, 40
     
    1111
    1212#CITIES
    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
     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
    7070
    7171#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 ù°¨¤H
    3 #s ù°¨
    4 #a ù°¨
     1#CHOOSE 古羅馬
     2#n 羅馬人
     3#s 羅馬
     4#a 羅馬
    55#COLOR FFFFFF
    66#SYMBOLS Nation1, 49
     
    1111
    1212#CITIES
    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
     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
    8383
    8484#UNITS StdUnits
    85         22,     040,    ¥Á§L
     85    22, 040,    民兵
    8686
    8787#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°ê¤H
    3 #s «X°ê
    4 #a «Xù´µ
     1#CHOOSE 俄國
     2#n 俄國人
     3#s 俄國
     4#a 俄羅斯
    55#COLOR E70000
    66#SYMBOLS Nation2, 94
     
    1111
    1212#CITIES
    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
     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
    112112
    113113#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,    ¦Ì®æ-29
     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,    米格-29
  • branches/highdpi/Localization/zh-Hant/Tribes/Spanish.tribe.txt

    r123 r465  
    1 #CHOOSE ¦è¯Z¤ú
    2 #n ¦è¯Z¤ú¤H
    3 #s ¦è¯Z¤ú
    4 #a ¦è¯Z¤ú
     1#CHOOSE 西班牙
     2#n 西班牙人
     3#s 西班牙
     4#a 西班牙
    55#COLOR FFFF00
    66#SYMBOLS Nation1, 47
     
    1111
    1212#CITIES
    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
     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
    115115
    116116#UNITS StdUnits
    117         22,     040,    ¥Á§L
     117    22, 040,    民兵
    118118
    119119#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,    ¥£Æ׳Ҥu
    2 1,      075,    ¦Û¥Ñ¥Á²³
    3 3,      071,    ¤p¼ç¸¥
    4 4,      073,    ·Æµ¾Éó
    5 7,      064,    ³æ®é¦|²î
    6 10,     010,    ©Ý¯îªÌ
    7 11,     011,    ¤uµ{®v
    8 13,     021,    ¯SÏú§L
    9 14,     030,    «Ø³]¶¤
    10 16,     017,    «Ø«°¦a
    11 17,     041,    ¦u«°½Ã§L
    12 20,     100,    ÆZ¾Ô¤h
    13 21,     100,    ¤}§L
    14 22,     100,    ÆZ¾Ô¤h
    15 23,     100,    ÆZ¾Ô¤h
    16 24,     101,    ù°¨­x¹Î
    17 25,     101,    ªø¥Ù¤â
    18 26,     101,    ¤è°}§L
    19 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§L
    33 45,     105,    ¨B§L
    34 46,     105,    ¨B§L
    35 47,     105,    ¨B§L
    36 50,     106,    ³°¾Ô¶¤
    37 51,     106,    ³°¾Ô¶¤
    38 52,     106,    ³°¾Ô¶¤
    39 53,     106,    ³°¾Ô¶¤
    40 54,     110,    ¸Ë¥Ò¨B§L
    41 55,     110,    ¸Ë¥Ò¨B§L
    42 56,     110,    ¸Ë¥Ò¨B§L
    43 57,     110,    ¸Ë¥Ò¨B§L
    44 60,     130,    ÃM§L
    45 61,     130,    ÃM§L
    46 62,     130,    ÃM§L
    47 63,     130,    ÃM§L
    48 64,     131,    ÃM§L
    49 65,     131,    ÃM§L
    50 66,     131,    ÃM§L
    51 67,     131,    ÃM§L
    52 70,     132,    ÃM¤h
    53 71,     132,    ÃM¤h
    54 72,     132,    ÃM¤h
    55 73,     132,    ÃM¤h
    56 74,     133,    ÀsÃM§L
    57 75,     133,    ÀsÃM§L
    58 76,     133,    ÀsÃM§L
    59 77,     133,    ÀsÃM§L
    60 80,     134,    »´ÃM§L
    61 81,     134,    »´ÃM§L
    62 82,     134,    »´ÃM§L
    63 83,     134,    »´ÃM§L
    64 84,     135,    ©Z§J
    65 85,     135,    ©Z§J
    66 86,     135,    ©Z§J
    67 87,     135,    ©Z§J
    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,    ¥[¹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¬µÉó
     10,  074,    奴勞工
     21,  075,    自由民眾
     33,  071,    小潛艇
     44,  073,    滑翔机
     57,  064,    單桅帆船
     610, 010,    拓荒者
     711, 011,    工程師
     813, 021,    特种兵
     914, 030,    建設隊
     1016, 017,    建城地
     1117, 041,    守城衛兵
     1220, 100,    蠻戰士
     1321, 100,    弓兵
     1422, 100,    蠻戰士
     1523, 100,    蠻戰士
     1624, 101,    羅馬軍團
     1725, 101,    長矛手
     1826, 101,    方陣兵
     1927, 101,    箭手
     2030, 102,    守衛
     2131, 102,    守衛
     2232, 102,    守衛
     2333, 102,    守衛
     2434, 103,    火槍手
     2535, 103,    火槍手
     2636, 103,    火槍手
     2737, 103,    火槍手
     2840, 104,    步槍手
     2941, 104,    步槍手
     3042, 104,    步槍手
     3143, 104,    步槍手
     3244, 105,    步兵
     3345, 105,    步兵
     3446, 105,    步兵
     3547, 105,    步兵
     3650, 106,    陸戰隊
     3751, 106,    陸戰隊
     3852, 106,    陸戰隊
     3953, 106,    陸戰隊
     4054, 110,    裝甲步兵
     4155, 110,    裝甲步兵
     4256, 110,    裝甲步兵
     4357, 110,    裝甲步兵
     4460, 130,    騎兵
     4561, 130,    騎兵
     4662, 130,    騎兵
     4763, 130,    騎兵
     4864, 131,    騎兵
     4965, 131,    騎兵
     5066, 131,    騎兵
     5167, 131,    騎兵
     5270, 132,    騎士
     5371, 132,    騎士
     5472, 132,    騎士
     5573, 132,    騎士
     5674, 133,    龍騎兵
     5775, 133,    龍騎兵
     5876, 133,    龍騎兵
     5977, 133,    龍騎兵
     6080, 134,    輕騎兵
     6181, 134,    輕騎兵
     6282, 134,    輕騎兵
     6383, 134,    輕騎兵
     6484, 135,    坦克
     6585, 135,    坦克
     6686, 135,    坦克
     6787, 135,    坦克
     6890, 136,    裝甲車
     6991, 136,    裝甲車
     7092, 136,    裝甲車
     7193, 136,    裝甲車
     72100,    170,    投石車
     73101,    170,    攻城塔
     74102,    170,    弩炮
     75103,    170,    弩炮
     76104,    171,    加農炮
     77105,    171,    加農炮
     78106,    171,    加農炮
     79107,    171,    加農炮
     80110,    172,    榴彈炮
     81111,    172,    榴彈炮
     82112,    172,    榴彈炮
     83113,    172,    榴彈炮
     84114,    173,    火箭炮
     85115,    173,    火箭炮
     86116,    173,    火箭炮
     87117,    173,    火箭炮
     88120,    200,    帆船
     89121,    200,    帆船
     90122,    200,    帆船
     91123,    200,    帆船
     92124,    201,    大帆船
     93125,    201,    快速帆船
     94126,    201,    護衛艦
     95127,    201,    護衛艦
     96130,    202 鐵甲艦
     97131,    202,    驅逐艦
     98132,    202,    巡洋艦
     99133,    202,    巡洋艦
     100134,    203,    導彈巡洋艦
     101135,    203,    戰列艦
     102136,    203,    戰列巡洋艦
     103137,    203,    戰列艦
     104140,    210,    運輸艦
     105141,    210,    運輸艦
     106142,    210,    運輸艦
     107143,    210,    運輸艦
     108144,    220,    航母
     109145,    220,    航母
     110146,    220,    航母
     111147,    220,    航母
     112150,    240,    潛艇
     113151,    240,    潛艇
     114152,    240,    潛艇
     115153,    240,    潛艇
     116160,    300,    戰斗机
     117161,    300,    戰斗机
     118162,    300,    戰斗机
     119163,    300,    戰斗机
     120164,    301,    噴气戰斗机
     121165,    301,    噴气戰斗机
     122166,    301,    直升机
     123167,    301,    噴气戰斗机
     124170,    310,    轟炸机
     125171,    310,    轟炸机
     126172,    310,    飛艇
     127173,    310,    轟炸机
     128174,    311,    現代轟炸机
     129175,    311,    現代轟炸机
     130176,    311,    現代轟炸机
     131177,    311,    現代轟炸机
  • branches/highdpi/Localization/zh-Hant/Tribes/Vikings.tribe.txt

    r123 r465  
    1 #CHOOSE ºû¨Ê
    2 #n ºû¨Ê¤H
    3 #s ºû¨Ê
    4 #a ºû¨Ê
     1#CHOOSE 維京
     2#n 維京人
     3#s 維京
     4#a 維京
    55#COLOR 9FBB8B
    66#SYMBOLS Nation2, 93
     
    1111
    1212#CITIES
    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
     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
    120120
    121121#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  
    55
    66uses
    7   UDpiControls, LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms,
     7  UDpiControls, LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    88  StdCtrls, Menus;
    99
     
    2727    procedure mClearClick(Sender: TObject);
    2828    procedure mSlotClick(Sender: TObject);
    29     procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);
     29    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    3030    procedure Toggle(Sender: TObject);
    3131    procedure ListMouseDown(Sender: TObject; Button: TMouseButton;
    3232      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);
    3434  public
    3535    Host: TDpiForm;
    36     procedure Add(Level, Turn: Integer; Text: pchar);
     36    procedure Add(Level, Turn: Integer; Text: PChar);
    3737  private
    3838    MaxLevel: Integer;
     
    6161begin
    6262  MaxLevel := TDpiMenuItem(Sender).Tag;
    63   TDpiMenuItem(Sender).Checked := true;
     63  TDpiMenuItem(Sender).Checked := True;
    6464end;
    6565
    66 procedure TLogDlg.Add(Level, Turn: Integer; Text: pchar);
     66procedure TLogDlg.Add(Level, Turn: Integer; Text: PChar);
    6767begin
    6868  if (MaxLevel > 0) and (Level <= MaxLevel) or (Level = 1 shl 16 + 1) and
     
    8989var
    9090  X, Y: Integer;
    91   s: string;
     91  S: string;
    9292begin
    9393  for Y := 0 to 2 do
    9494  begin
    95     s := '| ';
     95    S := '| ';
    9696    for X := 0 to 2 do
    9797      if G.Difficulty[SlotNo[Y, X]] = 0 then
    98         s := s + 'SUP |'
     98        S := S + 'SUP |'
    9999      else if G.Difficulty[SlotNo[Y, X]] < 0 then
    100         s := s + '--- |'
     100        S := S + '--- |'
    101101      else
    102102      begin
     
    104104        begin // check multi control
    105105          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') + '+';
    107107          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') + '+';
    109109        end;
    110         s := s + Tribe[SlotNo[Y, X]].TPhrase('SHORTNAME') + ' | ';
     110        S := S + Tribe[SlotNo[Y, X]].TPhrase('SHORTNAME') + ' | ';
    111111      end;
    112     List.Lines.Add(s)
     112    List.Lines.Add(S);
    113113  end;
    114114  PostMessage(List.Handle, WM_VSCROLL, SB_BOTTOM, 0);
    115115end;
    116116
    117 procedure TLogDlg.FormKeyDown(Sender: TObject; var Key: word;
     117procedure TLogDlg.FormKeyDown(Sender: TObject; var Key: Word;
    118118  Shift: TShiftState);
    119119begin
     
    134134end;
    135135
    136 procedure TLogDlg.FormKeyUp(Sender: TObject; var Key: word; Shift: TShiftState);
     136procedure TLogDlg.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    137137begin
    138138  if Host <> nil then
  • branches/highdpi/Messg.pas

    r361 r465  
    5353procedure TMessgDlg.FormShow(Sender: TObject);
    5454begin
    55   Button1.Visible := true;
     55  Button1.Visible := True;
    5656  Button2.Visible := not(Kind in [mkOK]);
    5757  if Button2.Visible then
     
    7070  end;
    7171
    72   SplitText(true);
     72  SplitText(True);
    7373  CorrectHeight;
    7474end;
  • branches/highdpi/MiniMap.pas

    r464 r465  
    11{$INCLUDE Switches.inc}
    2 unit UMiniMap;
     2unit MiniMap;
    33
    44interface
     
    3737
    3838uses
    39   ScreenTools, UPixelPointer, Global, GameServer, IsoEngine, Tribes;
     39  ScreenTools, PixelPointer, Global, GameServer, IsoEngine, Tribes;
    4040
    4141const
     
    162162procedure TMiniMap.PaintRandom(Brightness, StartLandMass: Integer; WorldSize: TPoint);
    163163var
    164   i, x, y, xm, cm: Integer;
     164  i, x, y, xm: Integer;
     165  cm: Int64;
    165166  MiniPixel: TPixelPointer;
    166167  Map: ^TTileList;
     
    172173  Bitmap.SetSize(Size.X * 2, Size.Y);
    173174  Bitmap.BeginUpdate;
    174   MiniPixel := PixelPointer(Bitmap);
     175  MiniPixel := TPixelPointer.Create(Bitmap);
    175176  for y := 0 to ScaleToNative(Size.Y) - 1 do begin
    176177    for x := 0 to ScaleToNative(Size.X) - 1 do begin
     
    193194procedure TMiniMap.PaintFile(SaveMap: TMapArray);
    194195var
    195   i, x, y, xm, cm, Tile, OwnColor, EnemyColor: integer;
     196  cm: Int64;
     197  i, x, y, xm, Tile, OwnColor, EnemyColor: integer;
    196198  MiniPixel: TPixelPointer;
    197199  PrevMiniPixel: TPixelPointer;
     
    203205  if Mode = mmPicture then begin
    204206    Bitmap.BeginUpdate;
    205     MiniPixel := PixelPointer(Bitmap);
    206     PrevMiniPixel := PixelPointer(Bitmap, 0, -1);
     207    MiniPixel := TPixelPointer.Create(Bitmap);
     208    PrevMiniPixel := TPixelPointer.Create(Bitmap, 0, -1);
    207209    for y := 0 to ScaleToNative(Size.Y) - 1 do begin
    208210      for x := 0 to ScaleToNative(Size.X) - 1 do begin
     
    211213          MiniPixel.SetX(xm);
    212214          Tile := SaveMap[ScaleFromNative(x) + Size.X * ScaleFromNative(y)];
     215          if Tile > 11 then Tile := fUnknown;
    213216          if Tile and fTerrain = fUNKNOWN then
    214217            cm := $000000
     
    264267  Bitmap.SetSize(Size.X * 2, Size.Y);
    265268  Bitmap.BeginUpdate;
    266   MiniPixel := PixelPointer(Bitmap);
    267   PrevMiniPixel := PixelPointer(Bitmap, 0, -1);
     269  MiniPixel := TPixelPointer.Create(Bitmap);
     270  PrevMiniPixel := TPixelPointer.Create(Bitmap, 0, -1);
    268271  for y := 0 to ScaleToNative(Size.Y) - 1 do begin
    269272    for x := 0 to ScaleToNative(Size.X) - 1 do begin
     
    328331end;
    329332
    330 
    331333end.
    332334
     335
     336
  • branches/highdpi/Network/NetworkClient.pas

    r464 r465  
    1 unit UNetworkClient;
    2 
    3 {$mode delphi}
     1unit NetworkClient;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils{$IFDEF LINUX}, fpAsync, fpsock{$ENDIF}, Protocol;
     6  Classes, SysUtils{$IFDEF UNIX}, fpAsync, fpsock{$ENDIF}, Protocol;
    97
    10 {$IFDEF LINUX}
     8{$IFDEF UNIX}
    119type
    1210  { TTCPClientThread }
     
    4846
    4947uses
    50   LocalPlayer{$IFDEF LINUX}, Global, UNetworkCommon{$ENDIF};
     48  LocalPlayer{$IFDEF UNIX}, Global, NetworkCommon{$ENDIF};
    5149
    5250procedure Client(Command, Player: Integer; var Data);
    53 {$IFDEF LINUX}
     51{$IFDEF UNIX}
    5452var
    5553  Cmd: TCommand;
    5654{$ENDIF}
    5755begin
    58   {$IFDEF LINUX}
     56  {$IFDEF UNIX}
    5957  Cmd := TCommand(Command);
    6058  case Cmd of
     
    7371end;
    7472
    75 {$IFDEF LINUX}
     73{$IFDEF UNIX}
    7674function LocalServer(Command, Player, Subject: Integer; var Data): Integer; stdcall;
    7775begin
     
    178176end.
    179177
     178
  • branches/highdpi/Network/NetworkCommon.pas

    r464 r465  
    1 unit UNetworkCommon;
    2 
    3 {$mode delphi}
     1unit NetworkCommon;
    42
    53interface
     
    108procedure StreamAppend(Stream: TStream; SourceStream: TStream);
    119procedure StreamRemoveRead(Stream: TMemoryStream);
     10
    1211
    1312implementation
     
    4544end.
    4645
     46
  • branches/highdpi/Network/NetworkServer.pas

    r464 r465  
    1 unit UNetworkServer;
    2 
    3 {$mode delphi}
     1unit NetworkServer;
    42
    53interface
    64
    75uses
    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}
    1110type
    1211  TNetworkServer = class;
     
    5756  { TNetworkServerPlayers }
    5857
    59   TNetworkServerPlayers = class(TFPGObjectList<TNetworkServerPlayer>)
     58  TNetworkServerPlayers = class(TObjectList<TNetworkServerPlayer>)
    6059    function SearchById(Id: Integer): TNetworkServerPlayer;
    6160  end;
     
    6665  private
    6766    Players: TNetworkServerPlayers;
    68     Connections: TFPGObjectList<TNetworkServerConnection>;
     67    Connections: TObjectList<TNetworkServerConnection>;
    6968    TCPServerThread: TTCPServerThread;
    7069    ServerEventLoop: TEventLoop;
    7170    procedure ConnectExecute(Sender: TConnectionBasedSocket; AStream: TSocketStream);
    72     procedure Client(Command: TCommand; Player: integer; var Data);
     71    procedure Client(Command: TCommand; Player: Integer; var Data);
    7372  public
    7473    TCPServer: TTCPServer;
     
    8281{$ENDIF}
    8382
    84 procedure Client(Command, Player: integer; var Data); stdcall;
     83procedure Client(Command, Player: Integer; var Data); stdcall;
    8584
    8685
    8786implementation
    8887
    89 {$IFDEF LINUX}
     88{$IFDEF UNIX}
    9089uses
    91   Global, UNetworkCommon;
     90  Global, NetworkCommon;
    9291{$ENDIF}
    9392
    94 procedure Client(Command, Player: integer; var Data);
    95 begin
    96   {$IFDEF LINUX}
     93procedure Client(Command, Player: Integer; var Data);
     94begin
     95  {$IFDEF UNIX}
    9796  if not Assigned(NetworkServer) then begin
    9897    NetworkServer := TNetworkServer.Create;
     
    107106end;
    108107
    109 {$IFDEF LINUX}
     108{$IFDEF UNIX}
    110109
    111110{ TNetworkServerPlayers }
     
    304303  Players := TNetworkServerPlayers.Create;
    305304  ServerEventLoop := TEventLoop.Create;
    306   Connections := TFPGObjectList<TNetworkServerConnection>.Create;
     305  Connections := TObjectList<TNetworkServerConnection>.Create;
    307306  TCPServer := TTCPServer.Create(nil);
    308307  with TCPServer do begin
     
    339338end.
    340339
     340
  • branches/highdpi/NoTerm.pas

    r378 r465  
    1818    procedure FormPaint(Sender: TObject);
    1919    procedure FormCreate(Sender: TObject);
    20     procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);
     20    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    2121  public
    22     procedure Client(Command, Player: integer; var Data);
     22    procedure Client(Command, Player: Integer; var Data);
    2323  private
    2424    Me: Integer;
     
    4343    procedure NewStat;
    4444    procedure EndPlaying;
    45     procedure ShowActive(p: integer; Active: boolean);
     45    procedure ShowActive(P: Integer; Active: Boolean);
    4646    procedure ShowYear;
    4747  end;
     
    5050  NoTermDlg: TNoTermDlg;
    5151
    52 procedure Client(Command, Player: integer; var Data); stdcall;
     52procedure Client(Command, Player: Integer; var Data); stdcall;
     53
    5354
    5455implementation
    5556
    5657uses
    57   GameServer, log;
     58  GameServer, Log;
    5859
    5960{$R *.lfm}
     
    6869  dxBrain = 128;
    6970  dyBrain = 128;
    70   xBrain: array [0 .. nPlOffered - 1] of integer = (x0Brain, x0Brain,
     71  xBrain: array [0 .. nPlOffered - 1] of Integer = (x0Brain, x0Brain,
    7172    x0Brain + dxBrain, x0Brain + dxBrain, x0Brain + dxBrain, x0Brain,
    7273    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,
    7475    y0Brain - dyBrain, y0Brain, y0Brain + dyBrain, y0Brain + dyBrain,
    7576    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,
    7778    -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,
    7980    36, 0, -36);
    8081
    8182var
    82   FormsCreated: boolean;
     83  FormsCreated: Boolean;
    8384
    8485procedure TNoTermDlg.FormCreate(Sender: TObject);
     
    107108procedure TNoTermDlg.EndPlaying;
    108109var
    109   EndCommand: integer;
     110  EndCommand: Integer;
    110111begin
    111112  NewStat;
    112   if G.RO[me].Turn > 0 then
     113  if G.RO[Me].Turn > 0 then
    113114    with MessgDlg do
    114115    begin
     
    123124  else
    124125    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 then
    131     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^);
     127end;
     128
     129procedure TNoTermDlg.ShowActive(P: Integer; Active: Boolean);
     130begin
     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);
    133134end;
    134135
     
    137138  Fill(State.Canvas, 0, 0, 192, 20, 64, 287 + 138);
    138139  RisedTextOut(State.Canvas, 0, 0, Format(Phrases.Lookup('AIT_ROUND'), [Round])
    139     + ' ' + TurnToString(G.RO[me].Turn));
    140   DpiBitCanvas(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);
     142end;
     143
     144procedure TNoTermDlg.Client(Command, Player: Integer; var Data);
     145var
     146  I, X, Y, P: Integer;
     147  ActiveDuration: Extended;
     148  ShipComplete: Boolean;
     149  R: TRect;
    149150  nowt: TDateTime;
    150151begin
    151152  case Command of
    152153    cDebugMessage:
    153       LogDlg.Add(Player, G.RO[0].Turn, pchar(@Data));
     154      LogDlg.Add(Player, G.RO[0].Turn, PChar(@Data));
    154155
    155156    cInitModule:
     
    159160        Shade := TDpiBitmap.Create;
    160161        Shade.SetSize(64, 64);
    161         for x := 0 to 63 do
    162           for y := 0 to 63 do
    163             if Odd(x + y) then
    164               Shade.Canvas.Pixels[x, y] := $FFFFFF
     162        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
    165166            else
    166               Shade.Canvas.Pixels[x, y] := $000000;
     167              Shade.Canvas.Pixels[X, Y] := $000000;
    167168        State := TDpiBitmap.Create;
    168169        State.SetSize(192, 20);
     
    180181    cNewGame, cLoadGame:
    181182      begin
    182         inc(Round);
     183        Inc(Round);
    183184        if Mode = rmRunning then
    184185        begin
     
    189190          Show;
    190191        G := TNewGameData(Data);
    191         LogDlg.mSlot.Visible := false;
     192        LogDlg.mSlot.Visible := False;
    192193        LogDlg.Host := nil;
    193         ToldAlive := G.RO[me].Alive;
     194        ToldAlive := G.RO[Me].Alive;
    194195        Active := -1;
    195196        FillChar(DisallowShowActive, SizeOf(DisallowShowActive), 0); // false
     
    212213    cTurn, cResume, cContinue:
    213214      begin
    214         me := Player;
     215        Me := Player;
    215216        if Active >= 0 then
    216217        begin
    217           ShowActive(Active, false);
     218          ShowActive(Active, False);
    218219          Active := -1;
    219220        end; // should not happen
     
    227228        TurnTime := SecondOf(nowt - LastNewTurn);
    228229        LastNewTurn := nowt;
    229         if (G.RO[me].Alive <> ToldAlive) then
    230         begin
    231           for p := 1 to nPlOffered - 1 do
    232             if 1 shl p and (G.RO[me].Alive xor ToldAlive) <> 0 then
     230        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
    233234            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);
    237238            end;
    238           ToldAlive := G.RO[me].Alive;
     239          ToldAlive := G.RO[Me].Alive;
    239240        end;
    240241        DpiApplication.ProcessMessages;
    241242        if Mode = rmQuit then
    242243          EndPlaying
    243         else if G.RO[me].Happened and phGameEnd <> 0 then
     244        else if G.RO[Me].Happened and phGameEnd <> 0 then
    244245        begin // game ended, update statistics
    245           for p := 1 to nPlOffered - 1 do
    246             if Assigned(PlayersBrain[p]) then
    247               if 1 shl p and G.RO[me].Alive = 0 then
    248                 inc(ExtStat[p]) // extinct
    249               else if G.RO[me].Alive = 1 shl p then
    250                 inc(AloneStat[p]) // only player alive
     246          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
    251252              else
    252253              begin // alive but not alone -- check colony ship
    253                 ShipComplete := true;
    254                 for i := 0 to nShipPart - 1 do
    255                   if G.RO[me].Ship[p].Parts[i] < ShipNeed[i] then
    256                     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;
    257258                if ShipComplete then
    258                   inc(WinStat[p]);
     259                  Inc(WinStat[P]);
    259260              end;
    260261          if Mode = rmRunning then
    261             Server(sNextRound, me, 0, nil^);
     262            Server(sNextRound, Me, 0, nil^);
    262263        end
    263264        else if Mode = rmRunning then
    264           Server(sTurn, me, 0, nil^);
     265          Server(sTurn, Me, 0, nil^);
    265266        if Mode = rmStop then
    266267        begin
     
    279280          TotalStatTime := TotalStatTime + ActiveDuration;
    280281          if not DisallowShowActive[Active] then
    281             ShowActive(Active, false);
     282            ShowActive(Active, False);
    282283          DisallowShowActive[Active] := (ActiveDuration < TurnTime * 0.25) and
    283284            (ActiveDuration < ShowActiveThreshold);
     
    285286        LastShowTurnChange := nowt;
    286287
    287         Active := integer(Data);
     288        Active := Integer(Data);
    288289        if (Active >= 0) and not DisallowShowActive[Active] then
    289           ShowActive(Active, true);
     290          ShowActive(Active, True);
    290291      end;
    291292  end;
     
    301302    GoBtn.ButtonIndex := 23;
    302303    GoBtn.Update;
    303     Server(sTurn, me, 0, nil^);
     304    Server(sTurn, Me, 0, nil^);
    304305  end;
    305306end;
     
    313314procedure TNoTermDlg.FormPaint(Sender: TObject);
    314315var
    315   i, TimeShare: integer;
     316  I, TimeShare: Integer;
    316317begin
    317318  Fill(Canvas, 3, 3, ClientWidth - 6, ClientHeight - 6, 0, 0);
     
    329330    7, Caption);
    330331  Canvas.Font.Assign(UniFont[ftSmall]);
    331   for i := 1 to nPlOffered - 1 do
    332     if Assigned(PlayersBrain[i]) then
     332  for I := 1 to nPlOffered - 1 do
     333    if Assigned(PlayersBrain[I]) then
    333334    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,
    336337        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 then
    340         DpiBitCanvas(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,
    341342          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,
    343344        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,
    347348        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,
    351352        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,
    355356        1 + 45, 316);
    356357      if TotalStatTime > 0 then
    357358      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,
    360361          IntToStr(TimeShare) + '%');
    361362      end;
    362       ShowActive(i, i = Active);
     363      ShowActive(I, I = Active);
    363364    end;
    364365  Sprite(Canvas, HGrSystem2, x0Brain + 32 - 20, y0Brain + 32 - 20, 40,
     
    370371end;
    371372
    372 procedure Client(Command, Player: integer; var Data);
     373procedure Client(Command, Player: Integer; var Data);
    373374begin
    374375  if not FormsCreated then
    375376  begin
    376     FormsCreated := true;
     377    FormsCreated := True;
    377378    DpiApplication.CreateForm(TNoTermDlg, NoTermDlg);
    378379  end;
     
    380381end;
    381382
    382 procedure TNoTermDlg.FormKeyDown(Sender: TObject; var Key: word;
     383procedure TNoTermDlg.FormKeyDown(Sender: TObject; var Key: Word;
    383384  Shift: TShiftState);
    384385begin
  • branches/highdpi/Packages/DpiControls/DpiControls.lpk

    r265 r465  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<CONFIG>
    3   <Package Version="4">
     3  <Package Version="5">
    44    <Name Value="DpiControls"/>
    55    <Type Value="RunAndDesignTime"/>
     
    1010        <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-${BuildMode}"/>
    1111      </SearchPaths>
     12      <Parsing>
     13        <SyntaxOptions>
     14          <SyntaxMode Value="Delphi"/>
     15        </SyntaxOptions>
     16      </Parsing>
    1217    </CompilerOptions>
    1318    <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."/>
     
    2530      </Item2>
    2631    </Files>
     32    <CompatibilityMode Value="True"/>
    2733    <RequiredPkgs Count="3">
    2834      <Item1>
  • branches/highdpi/Packages/DpiControls/UDpiControls.pas

    r463 r465  
    11unit UDpiControls;
    2 
    3 {$mode objfpc}{$H+}
    42
    53interface
     
    75uses
    86  {$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;
    1210
    1311const
    14   FixedDpi = -1;
     12  FixedDpi = 192;
    1513
    1614type
     
    8987    procedure SetName(AValue: string);
    9088    procedure SetNativeFont(AValue: TFont);
    91     procedure SetOnChange(AValue: TNotifyEvent);
    9289    procedure SetPixelsPerInch(AValue: Integer);
    9390    procedure SetSize(AValue: Integer);
     
    114111    property PixelsPerInch: Integer read GetPixelsPerInch write SetPixelsPerInch;
    115112    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;
    117114  end;
    118115
     
    189186    procedure SetFont(AValue: TDpiFont);
    190187    procedure SetHint(AValue: string);
    191     procedure SetOnChangeBounds(AValue: TNotifyEvent);
    192188    procedure SetOnClick(AValue: TNotifyEvent);
    193189    procedure SetOnDblClick(AValue: TNotifyEvent);
    194     procedure SetOnResize(AValue: TNotifyEvent);
    195190    procedure SetParentFont(AValue: Boolean);
    196191    procedure SetShowHint(AValue: Boolean);
     
    275270    property Constraints: TDpiSizeConstraints read FConstraints write FConstraints;
    276271    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;
    279274    property OnClick: TNotifyEvent read GetOnClick write SetOnClick;
    280275    property OnDblClick: TNotifyEvent read GetOnDblClick write SetOnDblClick;
     
    285280  end;
    286281
    287   TDpiControls = specialize TFPGObjectList<TDpiControl>;
     282  TDpiControls = TObjectList<TDpiControl>;
    288283
    289284  { TDpiControlBorderSpacing }
     
    446441  public
    447442    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;
    449444    procedure RoundRect(X1, Y1, X2, Y2: Integer; RX,RY: Integer); overload; virtual;
    450445    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;
    454449    procedure PolyBezier(const Points: array of TPoint;
    455       Filled: Boolean = False; Continuous: boolean = True);
     450      Filled: Boolean = False; Continuous: boolean = True); overload;
    456451    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;
    463459    procedure Pie(EllipseX1, EllipseY1, EllipseX2, EllipseY2,
    464460      StartX, StartY, EndX, EndY: Integer); virtual;
    465     procedure StretchDraw(const DestRect: TRect; SrcGraphic: TDpiGraphic); virtual;
    466461    procedure FrameRect(Rect: TRect);
    467462    procedure Rectangle(X1, Y1, X2, Y2: Integer); overload;
     
    475470    procedure LineTo(X, Y: Integer);
    476471    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;
    479474    procedure Draw(X, Y: Integer; Source: TDpiGraphic);
    480475    procedure CopyRect(Dest: TRect; SrcCanvas: TDpiCanvas; Source: TRect);
     
    708703  end;
    709704
    710   TDpiForms = specialize TFPGObjectList<TDpiForm>;
     705  TDpiForms = TObjectList<TDpiForm>;
    711706
    712707  { TDpiEdit }
     
    12421237    procedure UpdateScreen;
    12431238    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);
    12461241    property FormCount: Integer read GetFormCount;
    12471242    property Forms[Index: Integer]: TDpiForm read GetForms;
     
    14191414  public
    14201415    NativePopupMenu: TPopupMenu;
    1421     procedure PopUp;
    1422     procedure PopUp(X, Y: Integer); virtual;
     1416    procedure PopUp;  overload;
     1417    procedure PopUp(X, Y: Integer); virtual; overload;
    14231418    constructor Create(AOwner: TComponent); override;
    14241419    destructor Destroy; override;
     
    23102305  if not Assigned(NativeListView) then begin
    23112306    NativeListView := TListView.Create(nil);
    2312     NativeListView.OnCustomDrawItem := @DoCustomDrawItem;
     2307    NativeListView.OnCustomDrawItem := DoCustomDrawItem;
    23132308  end;
    23142309  Result := NativeListView;
     
    27812776    NativeMenuItem := TMenuItem.Create(nil);
    27822777    NativeMenuItem.Name := 'Native' + Name;
    2783     NativeMenuItem.OnClick := @OnClickHandler;
     2778    NativeMenuItem.OnClick := OnClickHandler;
    27842779  end;
    27852780  Result := NativeMenuItem;
     
    30843079begin
    30853080  if (FMainForm = nil)
    3086   and (FCreatingForm=AForm)
     3081  and (FCreatingForm = AForm)
    30873082  //and (not (AppDestroying in FFlags))
    30883083  and not (AForm.FormStyle in [fsMDIChild, fsSplash])
     
    30963091var
    30973092  Instance: TComponent;
    3098   ok: Boolean;
     3093  Ok: Boolean;
    30993094  AForm: TDpiForm;
    31003095begin
     
    31053100  TComponent(Reference) := Instance;
    31063101
    3107   ok := False;
     3102  Ok := False;
    31083103  try
    31093104    if (FCreatingForm = nil) and (Instance is TDpiForm) then
    31103105      FCreatingForm := TDpiForm(Instance);
    31113106    Instance.Create(Self);
    3112     ok := true;
     3107    Ok := true;
    31133108  finally
    3114     if not ok then begin
     3109    if not Ok then begin
    31153110      TComponent(Reference) := nil;
    31163111      if FCreatingForm = Instance then
     
    41034098begin
    41044099  inherited;
    4105   TGraphicControlEx(GetNativeGraphicControl).OnPaint := @PaintHandler;
     4100  TGraphicControlEx(GetNativeGraphicControl).OnPaint := PaintHandler;
    41064101end;
    41074102
     
    41964191begin
    41974192  Result := NativeFont;
    4198 end;
    4199 
    4200 procedure TDpiFont.SetOnChange(AValue: TNotifyEvent);
    4201 begin
    4202   if FOnChange = AValue then Exit;
    4203   FOnChange := AValue;
    42044193end;
    42054194
     
    44094398begin
    44104399  inherited;
    4411   GetNativeWinControl.OnKeyDown := @KeyDownHandler;
     4400  GetNativeWinControl.OnKeyDown := KeyDownHandler;
    44124401end;
    44134402
     
    44484437begin
    44494438  Controls := TDpiControls.Create;
    4450   Controls.FreeObjects := False;
     4439  Controls.OwnsObjects := False;
    44514440  inherited;
    44524441end;
     
    45574546end;
    45584547
    4559 function TDpiScreen.DisableForms(SkipForm: TDpiForm; DisabledList: TList
    4560   ): TList;
     4548function TDpiScreen.DisableForms(SkipForm: TDpiForm; DisabledList: Classes.TList
     4549  ): Classes.TList;
    45614550begin
    45624551  Result := Screen.DisableForms(SkipForm.GetNativeForm, DisabledList);
    45634552end;
    45644553
    4565 procedure TDpiScreen.EnableForms(var AFormList: TList);
     4554procedure TDpiScreen.EnableForms(var AFormList: Classes.TList);
    45664555begin
    45674556  Screen.EnableForms(AFormList);
     
    45714560begin
    45724561  FForms := TDpiForms.Create;
    4573   FForms.FreeObjects := False;
     4562  FForms.OwnsObjects := False;
    45744563  FPrevActiveForms := TDpiForms.Create;
    4575   FPrevActiveForms.FreeObjects := False;
     4564  FPrevActiveForms.OwnsObjects := False;
    45764565  // Screen.PixelsPerInch is not initialized at this point
    45774566  Dpi := 96;
     
    46514640begin
    46524641  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;
    46614650end;
    46624651
     
    48304819  inherited;
    48314820  FFont := TDpiFont.Create;
    4832   FFont.OnChange := @FontChanged;
     4821  FFont.OnChange := FontChanged;
    48334822  FConstraints := TDpiSizeConstraints.Create;
    48344823  if Assigned(TheOwner) and (TheOwner is TDpiWinControl) then
     
    50315020end;
    50325021
    5033 procedure TDpiControl.SetOnChangeBounds(AValue: TNotifyEvent);
    5034 begin
    5035   if FOnChangeBounds = AValue then Exit;
    5036   FOnChangeBounds := AValue;
    5037 end;
    5038 
    50395022procedure TDpiControl.SetOnClick(AValue: TNotifyEvent);
    50405023begin
     
    50455028begin
    50465029  TControlEx(GetNativeControl).OnDblClick := AValue;
    5047 end;
    5048 
    5049 procedure TDpiControl.SetOnResize(AValue: TNotifyEvent);
    5050 begin
    5051   if FOnResize = AValue then Exit;
    5052   FOnResize := AValue;
    50535030end;
    50545031
     
    54115388  if not Assigned(NativeForm) then begin
    54125389    NativeForm := TFormEx.CreateNew(nil);
    5413     (NativeForm as TFormEx).OnMessage := @FormMessageHandler;
     5390    (NativeForm as TFormEx).OnMessage := FormMessageHandler;
    54145391    //NativeForm := TForm.Create(nil);
    54155392  end;
     
    54205397begin
    54215398  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;
    54265403  GetNativeForm.Name := Name + 'Native';
    54275404end;
  • branches/highdpi/Packages/DpiControls/UPixelPointer2.pas

    r265 r465  
    11unit UPixelPointer2;
    2 
    3 {$mode delphi}{$H+}
    42
    53interface
  • branches/highdpi/Platform.pas

    r303 r465  
    11unit Platform;
    2 
    3 {$mode delphi}{$H+}
    42
    53interface
    64
    75uses
    8   {$IFDEF Windows}Windows,{$ENDIF}
    9   {$IFDEF Linux}Unix,{$ENDIF}
     6  {$IFDEF WINDOWS}Windows,{$ENDIF}
     7  {$IFDEF UNIX}Unix,{$ENDIF}
    108  Classes, SysUtils, DateUtils, SyncObjs;
    119
    1210function NowPrecise: TDateTime;
    1311
     12
    1413implementation
    1514
    16 {$IFDEF Windows}
     15{$IFDEF WINDOWS}
    1716var
    1817  PerformanceFrequency: Int64;
     
    2423function NowPrecise: TDateTime;
    2524var
    26   {$IFDEF Linux}T: TimeVal;{$ENDIF}
    27   {$IFDEF Windows}TimerValue: Int64;{$ENDIF}
     25  {$IFDEF UNIX}T: TimeVal;{$ENDIF}
     26  {$IFDEF WINDOWS}TimerValue: Int64;{$ENDIF}
    2827begin
    2928//  Result := Now;
    3029  //try
    3130    //NowPreciseLock.Acquire;
    32     {$IFDEF Windows}
     31    {$IFDEF WINDOWS}
    3332    QueryPerformanceCounter(TimerValue);
    3433    //Result := Int64(TimeStampToMSecs(DateTimeToTimeStamp(Now)) * 1000) // an alternative Win32 timebase
     
    3635    {$ENDIF}
    3736
    38     {$IFDEF Linux}
     37    {$IFDEF UNIX}
    3938    fpgettimeofday(@t, nil);
    4039     // Build a 64 bit microsecond tick from the seconds and microsecond longints
     
    5150initialization
    5251
    53 {$IFDEF Windows}
     52{$IFDEF WINDOWS}
    5453QueryPerformanceFrequency(PerformanceFrequency);
    5554{$ENDIF}
     
    6261end.
    6362
     63
  • branches/highdpi/Protocol.pas

    r378 r465  
    1818  ExpCost = 50; { received damage required for next experience level }
    1919  MaxFutureTech = 25;
    20   // maximum number of future techs of one kind except computing technology
     20  // Maximum number of future techs of one kind except computing technology
    2121  MaxFutureTech_Computing = 100;
    22   // maximum number of computing technology future techs
     22  // Maximum number of computing technology future techs
    2323  CountryRadius = 9;
    2424  MaxCitySize = 30;
     
    3636  CancelTreatyTurns = 3;
    3737  PeaceEvaTurns = 5;
    38   // should be less then 2*CancelTreatyTurns, so that you can't attack an ally without re-entering
     38  // Should be less then 2*CancelTreatyTurns, so that you can't attack an ally without re-entering
    3939  ColdWarTurns = 40;
    4040  DesertThurst = 20; // damage for turn in desert
     
    4949  InitialCredibility = 95;
    5050
    51   // ai module flags (for TInitModuleData.Flags)
     51  // AI module flags (for TInitModuleData.Flags)
    5252  aiThreaded = $01;
    5353
    54   // difficulty settings
     54  // Difficulty settings
    5555  MaxDiff = 4; { maximum difficulty level }
    5656  StorageSize: array [1 .. MaxDiff] of Integer = (30, 40, 50, 60);
     
    5959  BuildCostMod: array [1 .. MaxDiff] of Integer = (9, 12, 15, 18); // in 1/12
    6060
    61   // test flags
     61  // Test flags
    6262  nTestFlags = 7; // max. 11
    6363  tfAllTechs = $001; { all nations get all techs }
     
    7070  tfTested = $800; // at least one test flag was set
    7171
    72   { server commands
     72  { Server commands
    7373    IMPORTANT: lowest 4 bits must indicate size in DWORDS of data parameter,
    7474    except for request commands }
     
    191191  sSetCityTiles = $7201;
    192192
    193   // free command space
     193  // Free command space
    194194  sctUnused = $3800;
    195195
    196   { client commands }
     196  { Client commands }
    197197  cInitModule = $0000;
    198198  cReleaseModule = $0100;
     
    241241  cRefreshDebugMap = $3F90;
    242242
    243   // diplomacy commands equal to server, see below
     243  // Diplomacy commands equal to server, see below
    244244
    245245  cDebugMessage = $7000;
    246246  cShowNego = $7010;
    247247
    248   // commands same for server and client
     248  // Commands same for server and client
    249249  scContact = $4900; // + concerned player shl 4 for server call
    250250  scReject = $4A00;
     
    256256  scDipBreak = $4BF0;
    257257
    258   { server return codes: flags }
     258  { Server return codes: flags }
    259259  rExecuted = $40000000;
    260260  rEffective = $20000000;
     
    262262  rEnemySpotted = $08000000;
    263263
    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!
    266266  eOK = $60000000; // ok
    267267  eEnemySpotted = $68000000; // unit move ok, new enemy unit/city spotted
    268268  eDied = $70000000; // move executed, unit died due to hostile terrain
    269269  eEnemySpotted_Died = $78000000;
    270   // unit move ok, new enemy unit/city spotted, unit died due to hostile terrain
     270  // Unit move ok, new enemy unit/city spotted, unit died due to hostile terrain
    271271  eLoaded = $60000002; // unit move caused loading to transport ship
    272272  eLost = $70000004; // attack executed, battle lost, unit is dead
     
    276276  eExpelled = $60000007; // friendly unit expelled
    277277  eMissionDone = $70000008;
    278   // spy moved into city: mission done, spy no longer exists
     278  // Spy moved into city: mission done, spy no longer exists
    279279  eJobDone = $60000001; // settler job started and already done
    280280  eJobDone_Died = $70000001;
    281   // settler job started and already done, unit died due to hostile terrain
     281  // Settler job started and already done, unit died due to hostile terrain
    282282  eCity = $70000002; // city founded, settler no more exists
    283283  eRemoved = $70000000; // sRemoveUnit: unit removed
     
    285285
    286286  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 }
    290290  eHiddenUnit = $20000013;
    291   // unit move: not possible, destination tile occupied by hidden foreign submarine
     291  // Unit move: not possible, destination tile occupied by hidden foreign submarine
    292292  eStealthUnit = $2000001A;
    293   // unit move: not possible, destination tile occupied by foreign stealth unit
     293  // Unit move: not possible, destination tile occupied by foreign stealth unit
    294294  eZOC_EnemySpotted = $28000014;
    295   // unit move: not possible, new enemy unit spotted, ZOC violation
     295  // Unit move: not possible, new enemy unit spotted, ZOC violation
    296296
    297297  eInvalid = $0000; // command not allowed now or parameter out of allowed range
     
    308308
    309309  eDomainMismatch = $0011;
    310   // move/attack: action not allowed for this unit domain
     310  // Move/attack: action not allowed for this unit domain
    311311  eNoCapturer = $0012;
    312   // unit move: this type of unit is not allowed to capture a city
     312  // Unit move: this type of unit is not allowed to capture a city
    313313  eZOC = $0014; // unit move: not possible, ZOC violation
    314314  eTreaty = $0015; // move/attack: not possible, peace treaty violation
     
    320320
    321321  eMaxSize = $0020;
    322   // add to city: bigger size not allowed due to missing aqueduct/sewer
     322  // Add to city: bigger size not allowed due to missing aqueduct/sewer
    323323  eNoCityTerrain = $0022; // found city: not possible in this terrain
    324324  eNoBridgeBuilding = $0023;
     
    332332  eNoWorkerAvailable = $0051;
    333333  eOnlyOnce = $0058;
    334   // sell/rebuild city improvement: only once per city and turn!
     334  // Sell/rebuild city improvement: only once per city and turn!
    335335  eObsolete = $0059; // city project: more advanced improvement already exists
    336336  eOutOfControl = $005A;
    337   // buy/sell/rebuild improvement: not in anarchy, not in captured cities
     337  // Buy/sell/rebuild improvement: not in anarchy, not in captured cities
    338338
    339339  eNoWay = $0100; // sGetMoveAdvice: no way found
    340340
    341   // chart types
     341  // Chart types
    342342  nStat = 6;
    343343  stPop = 0;
     
    348348  stWork = 5;
    349349
    350   { tile flags: terrain type }
     350  { Tile flags: terrain type }
    351351  fTerrain = $1F; // mask for terrain type
    352352  fOcean = $00;
     
    363363  fUNKNOWN = fTerrain;
    364364
    365   { tile flags: terrain improvements }
     365  { Tile flags: terrain improvements }
    366366  fTerImp = $0000F000; // mask for terrain improvement
    367367  tiNone = $00000000;
     
    372372  tiBase = $00005000;
    373373
    374   { tile flags: add ons }
     374  { Tile flags: add ons }
    375375  fSpecial = $00000060;
    376376  fSpecial1 = $00000020;
     
    378378  fRiver = $00000080;
    379379  fRoad = $00000100;
    380   fRR = $00000200;
     380  fRR = $00000200; // railroad
    381381  fCanal = $00000400;
    382382  fPoll = $00000800;
     
    389389  fMercury = $06000000;
    390390
    391   { tile flags: redundant helper info }
     391  { Tile flags: redundant helper info }
    392392  fGrWall = $00010000; // tile protected by great wall
    393393  fSpiedOut = $00020000;
     
    400400  fOwnZoCUnit = $10000000; // own ZoC unit present at this tile
    401401  fInEnemyZoC = $20000000;
    402   // tile is adjacent to known foreign ZoC unit (not allied)
     402  // Tile is adjacent to known foreign ZoC unit (not allied)
    403403  fPeace = $40000000;
    404404  // tile belongs to territory of nation that we are in peace with but not allied
    405405
    406   // city project flags
     406  // City project flags
    407407  cpIndex = $1FF;
    408408  cpConscripts = $200; // produce unit as conscripts
    409409  cpDisbandCity = $400;
    410   // allow to disband city when settlers/conscripts are produced
     410  // Allow to disband city when settlers/conscripts are produced
    411411  cpImp = $800; // 0: index refers to model, 1: index refers to city improvement
    412412  cpRepeat = $1000;
     
    414414  cpAuto = $F000; // for internal use only
    415415
    416   // tech status indicators
     416  // Tech status indicators
    417417  tsNA = -2;
    418418  tsSeen = -1;
     
    422422  tsApplicable = tsResearched;
    423423
    424   // nation treaties
     424  // Nation treaties
    425425  trNoContact = -1;
    426426  trNone = 0;
     
    429429  trAlliance = 4;
    430430
    431   // attitudes
     431  // Attitudes
    432432  nAttitude = 7;
    433433  atHostile = 0;
     
    439439  atEnth = 6;
    440440
    441   // offer prices
     441  // Offer prices
    442442  opChoose = $00000000;
    443443  opCivilReport = $11000000; // + turn + concerned player shl 16
     
    455455  opMask = $FF000000;
    456456
    457   // improvement kinds
     457  // Improvement kinds
    458458  ikTrGoods = 0;
    459459  ikCommon = 1;
     
    464464  ikNA = $7F;
    465465
    466   { model domains }
     466  { Model domains }
    467467  nDomains = 3;
    468468  dGround = 0;
     
    470470  dAir = 2;
    471471
    472   { model kinds }
     472  { Model kinds }
    473473  mkSelfDeveloped = $00;
    474474  mkEnemyDeveloped = $01;
     
    483483  mkFreight = $24;
    484484
    485   { unit flags }
     485  { Unit flags }
    486486  unFortified = $01;
    487487  unBombsLoaded = $02;
     
    491491  unMulti = $80;
    492492
    493   // unit report flags
     493  // Unit report flags
    494494  urfAlwaysSupport = $01;
    495495  urfDeployed = $02;
    496496
    497   // unit moves
     497  // Unit moves
    498498  umCapturing = $0100;
    499499  umSpyMission = $0200;
     
    505505  umPlaneUnloading = $8000;
    506506
    507   { model flags }
     507  { Model flags }
    508508  mdZOC = $01;
    509509  mdCivil = $02;
    510510  mdDoubleSupport = $04;
    511511
    512   { player happened flags }
     512  { Player happened flags }
    513513  phTech = $01;
    514514  phStealTech = $02;
     
    523523  phGameEnd = $F000;
    524524
    525   { city happened flags }
     525  { City happened flags }
    526526  chDisorder = $01;
    527527  chProduction = $02;
     
    541541  chImprovementSold = $80000000;
    542542
    543   { city info flags }
     543  { City info flags }
    544544  ciCapital = $01;
    545545  ciWalled = $02;
     
    549549  ciSpacePort = $20;
    550550
    551   { city tile available values }
     551  { City tile available values }
    552552  faAvailable = 0;
    553553  faNotAvailable = 1;
     
    556556  faInvalid = $FF;
    557557
    558   // battle history flags
     558  // Battle history flags
    559559  bhEnemyAttack = $01;
    560560  bhMyUnitLost = $02;
    561561  bhEnemyUnitLost = $04;
    562562
    563   { move advice special destinations }
     563  { Move advice special destinations }
    564564  maNextCity = -1;
    565565
    566   { goverment forms }
     566  { Goverment forms }
    567567  nGov = 8;
    568568  gAnarchy = 0;
     
    575575  gFuture = 7;
    576576
    577   // ship change reasons
     577  // Ship change reasons
    578578  scrProduction = 0;
    579579  scrDestruction = 1;
     
    581581  scrCapture = 3;
    582582
    583   { unit jobs }
     583  { Unit jobs }
    584584  nJob = 15;
    585585  jNone = 0;
     
    599599  jCity = 14;
    600600
    601   // job preconditions are:
     601  // Job preconditions are:
    602602  // technology JobPreq is available, no city, plus the following:
    603603  // jRoad: no river when bridge building unavailable
     
    614614  // jCity, jFort, jBase: none
    615615
    616   // spy mission
     616  // Spy mission
    617617  nSpyMission = 5;
    618618  smSabotageProd = 0;
     
    622622  smStealMilReport = 4;
    623623
    624   // resource weights
     624  // Resource weights
    625625  rwOff = $00000000;
    626626  rwMaxGrowth = $3F514141; // 120*F + 1/8*P + 1/16*T + 1/16*S
     
    630630  rwForceScience = $F1010101; // F^1/2 * (1*P + 1*T + 1*S)
    631631
    632   { advances }
     632  { Advances }
    633633  adAdvancedFlight = 0;
    634634  adAmphibiousWarfare = 1;
     
    731731  adMilitary = $800; // Military Research
    732732
    733   { wonders }
     733  { Wonders }
    734734  woPyramids = 00;
    735735  woZeus = 01;
     
    752752  woMir = 20;
    753753
    754   { city improvements }
     754  { City improvements }
    755755  imTrGoods = 28;
    756756  imBarracks = 29;
     
    801801  // in 1/2*city size
    802802
    803   // special prerequisite values
     803  // Special prerequisite values
    804804  preNone = -1;
    805805  preLighthouse = -2;
     
    813813    adExplosives, adConstruction, preNone, adMedicine, preNone, preNone);
    814814
    815   AdvPreq: array [0 .. nAdv - 1, 0 .. 2] of Integer = { advance prerequisites }
     815  AdvPreq: array [0 .. nAdv - 1, 0 .. 2] of Integer = { Advance prerequisites }
    816816    ((adFlight, adRobotics, preNone), // adAdvancedFlight
    817817    (adNavigation, adTactics, preNone), // adAmphibiousWarfare
     
    910910    (adSmartWeapons, preNone, preNone)); // futMissileTechnology
    911911
    912 Imp: array [0 .. nImp - 1] of // city improvements
     912Imp: array [0 .. nImp - 1] of // City improvements
    913913record
    914914  Kind: Integer;
     
    916916  Cost: Integer;
    917917  Maint: Integer;
    918   Expiration: integer;
     918  Expiration: Integer;
    919919end
    920920= ((Kind: ikWonder; Preq: adMathematics; Cost: 400; Maint: 0;
     
    10191019  (NewImp: imMilAcademy; OldImp: imBarracks));
    10201020
    1021 // colony ship
     1021// Colony ship
    10221022nShipPart = 3;
    10231023spComp = 0;
     
    10991099  TradeRes: (0, 0, 7); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))); { Mou }
    11001100
    1101 // settler work required MP
     1101// Settler work required MP
    11021102PillageWork = 100;
    11031103CityWork = 900;
     
    11121112PollWork = 1800;
    11131113
    1114 // upgrades for new unit models
     1114// Upgrades for new unit models
    11151115// upgrade[domain,0].preq is domain precondition advance
    11161116// cost values accumulate if prerequisite is future tech / are maximized if not
    11171117nUpgrade = 15;
    1118 upgrade: array [0 .. nDomains - 1, 0 .. nUpgrade - 1] of record
     1118Upgrade: array [0..nDomains - 1, 0..nUpgrade - 1] of record
    11191119  Preq: Integer;
    11201120  Strength: Integer;
    11211121  Trans: Integer;
    1122   Cost: integer;
     1122  Cost: Integer;
    11231123end
    11241124= (((Preq: adWarriorCode; Strength: 4; Trans: 0; Cost: 3),
     
    11681168  (Preq: preNA; Strength: 0; Trans: 0; Cost: 0)));
    11691169
    1170 { model features }
     1170{ Model features }
    11711171nFeature = 27;
    11721172mcWeapons = 0;
     
    12001200AutoFeature: set of mcFirstNonCap .. nFeature - 1 = [mcNav, mcSE, mcNP, mcJet,
    12011201  mcAcademy];
    1202 // unit class advances, automatically applied if available
    1203 
    1204 Feature: array [0 .. nFeature - 1] of { unit model features }
     1202// Unit class advances, automatically applied if available
     1203
     1204Feature: array [0 .. nFeature - 1] of { Unit model features }
    12051205  record
    12061206    Domains: Integer;
     
    12431243INFIN = 999999;
    12441244
    1245 // for backward compatibility
     1245// For backward compatibility
    12461246fRare = fDeadLands;
    12471247fRare1 = fCobalt;
     
    13221322    cmRefreshDebugMap = $3F90,
    13231323
    1324     // diplomacy commands equal to server, see below
     1324    // Diplomacy commands equal to server, see below
    13251325
    13261326    cmDebugMessage = $7000,
     
    13851385    Cost: Word;
    13861386    MStrength: Word;
    1387     // construction time multipliers, only valid if kind is mkSelfDeveloped or mkEnemyDeveloped
     1387    // Construction time multipliers, only valid if kind is mkSelfDeveloped or mkEnemyDeveloped
    13881388    MTrans: Byte;
    13891389    MCost: Byte;
    13901390    Weight: Byte;
    13911391    MaxWeight: Byte;
    1392     // weight and maximum weight (construction time)
     1392    // Weight and maximum weight (construction time)
    13931393    Upgrades: Cardinal; // bitarray indicating all upgrades
    13941394    Flags: Cardinal;
     
    15251525  TCityReportNew = record
    15261526    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)
    15281528    HypoTaxRate: Integer;
    15291529    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)
    15311531    Morale: Integer;
    15321532    FoodSupport: Integer;
    15331533    MaterialSupport: Integer;
    1534     // food and material taken for unit support
     1534    // Food and material taken for unit support
    15351535    ProjectCost: Integer; // material cost of current project
    15361536    Storage: Integer; // size of food storage
     
    15401540    CollectedMaterial: Integer;
    15411541    CollectedTrade: Integer;
    1542     // raw control, food, material and trade as collected by the citizens
     1542    // Raw control, food, material and trade as collected by the citizens
    15431543    Working: Integer; // number of exploited tiles including city tile
    15441544    FoodSurplus: Integer;
    15451545    Production: Integer;
    15461546    AddPollution: Integer;
    1547     // food surplus, production gain and pollution after all effects
     1547    // Food surplus, production gain and pollution after all effects
    15481548    Corruption: Integer;
    15491549    Tax: Integer;
    15501550    Science: Integer;
    15511551    Luxury: Integer;
    1552     // corruption, tax, science and wealth after all effects
     1552    // Corruption, tax, science and wealth after all effects
    15531553    HappinessBalance: Integer;
    15541554    // = (Morale+Wealth+Control) - (Size+Unrest), value < 0 means disorder
     
    15631563  TGetCityData = record
    15641564    Owner: Integer;
    1565     c: TCity;
     1565    C: TCity;
    15661566  end;
    15671567
     
    16001600    Movement: Integer;
    16011601    EndHealthDef: Integer;
    1602     EndHealthAtt: Integer; // must be same as in TBattleForecast
     1602    EndHealthAtt: Integer; // Must be same as in TBattleForecast
    16031603    AStr: Integer;
    16041604    DStr: Integer;
     
    16441644  TCreateUnitData = record
    16451645    Loc: Integer;
    1646     p: Integer;
     1646    P: Integer;
    16471647    mix: Integer;
    16481648  end;
     
    16531653  TOwnerList = array [0 .. INFIN] of ShortInt;
    16541654  TByteList = array [0 .. INFIN] of Byte;
    1655   TIntList = array [0 .. INFIN] of integer;
     1655  TIntList = array [0 .. INFIN] of Integer;
    16561656  TCityList = array [0 .. INFIN] of TCity;
    16571657  TUnList = array [0 .. INFIN] of TUn;
     
    16651665    Data: Pointer;
    16661666    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 }
    16681668    MapObservedLast: ^TTileObservedLastList;
    1669     // turn in which the tile was observed last, index = location
     1669    // Turn in which the tile was observed last, index = location
    16701670    Territory: ^TOwnerList; // nation to which's territory a tile belongs, -1 indicates none
    16711671    Un: ^TUnList; { units }
     
    16951695    LuxRate: Integer;
    16961696    Research: Integer;
    1697     { collected research points for currently researched tech }
     1697    { Collected research points for currently researched tech }
    16981698    ResearchTech: Integer; // currently researched tech
    16991699    DevModel: TModel; { unit model currently under development }
     
    17301730    MaxTurn: Integer;
    17311731    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,
    17331733      -1 for unused slots }
    17341734    RO: array [0 .. nPl - 1] of ^TPlayerContext;
     
    17441744    RND: Integer;
    17451745    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,
    17471747      -1 for unused slots }
    17481748    Controlled: Integer;
     
    17571757
    17581758const
    1759   { predefined unit models: }
     1759  { Predefined unit models: }
    17601760  nSpecialModel = 9;
    17611761  SpecialModel: array [0 .. nSpecialModel - 1] of TModel = ((Status: 0;
     
    18151815    0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)));
    18161816
    1817   SpecialModelPreq: array [0 .. nSpecialModel - 1] of integer = (preNone,
     1817  SpecialModelPreq: array [0 .. nSpecialModel - 1] of Integer = (preNone,
    18181818    adExplosives, preNone, preNone, (* adWri, *) adIntelligence, adTrade,
    18191819    (* adTheCorporation,adHorsebackRiding,adAutomobile,adNavigation,
     
    18241824  DelphiRandSeed: Integer;
    18251825
    1826 procedure MakeUnitInfo(p: Integer; const u: TUn; var ui: TUnitInfo);
    1827 procedure MakeModelInfo(p, mix: Integer; const m: TModel; var mi: TModelInfo);
     1826procedure MakeUnitInfo(P: Integer; const U: TUn; var ui: TUnitInfo);
     1827procedure MakeModelInfo(P, mix: Integer; const M: TModel; var mi: TModelInfo);
    18281828function IsSameModel(const mi1, mi2: TModelInfo): Boolean;
    18291829function SpecialTile(Loc, TerrType, lx: Integer): Integer;
     
    18361836implementation
    18371837
    1838 procedure MakeUnitInfo(p: Integer; const u: TUn; var ui: TUnitInfo);
     1838procedure MakeUnitInfo(P: Integer; const U: TUn; var ui: TUnitInfo);
    18391839begin
    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;
    18491849end;
    18501850
    1851 procedure MakeModelInfo(p, mix: Integer; const m: TModel; var mi: TModelInfo);
     1851procedure MakeModelInfo(P, mix: Integer; const M: TModel; var mi: TModelInfo);
    18521852var
    1853   i: Integer;
     1853  I: Integer;
    18541854begin
    1855   mi.Owner := p;
     1855  mi.Owner := P;
    18561856  mi.mix := mix;
    1857   mi.ID := m.ID;
    1858   mi.Domain := m.Domain;
    1859   if m.Kind = mkEnemyDeveloped then
    1860     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()
    18611861  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;
    18671867  if mi.Domain = dAir then
    18681868  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];
    18711871  end
    18721872  else
    18731873  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;
    18781878  mi.Cap := 0;
    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));
     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));
    18821882  mi.MaxUpgrade := 0;
    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;
     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;
    18871887  mi.Lost := 0;
    18881888end;
     
    18961896  Compare1 := @mi1;
    18971897  Compare2 := @mi2;
    1898   result := (Compare1[1] and $FFFF0000 = Compare2[1] and $FFFF0000) and
     1898  Result := (Compare1[1] and $FFFF0000 = Compare2[1] and $FFFF0000) and
    18991899    (Compare1[2] = Compare2[2]) and (Compare1[3] = Compare2[3]) and
    19001900    (Compare1[4] = Compare2[4]) and (Compare1[5] = Compare2[5])
     
    19031903function SpecialTile(Loc, TerrType, lx: Integer): Integer;
    19041904var
    1905   x, y, qx, qy, a: Integer;
     1905  X, Y, qx, qy, A: Integer;
    19061906begin
    19071907  if TerrType = fOcean then
    1908     result := 0
     1908    Result := 0
    19091909  else
    19101910  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) then
    1915         result := 1
     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) then
     1915        Result := 1
    19161916      else
    1917         result := 0
    1918     else { formula for special resources }
     1917        Result := 0
     1918    else { Formula for special resources }
    19191919    begin
    1920       a := 4 * x - y + 9980;
    1921       qx := a div 10;
    1922       if (qx * 10 = a) and (qx and 3 <> 0) then
     1920      A := 4 * X - Y + 9980;
     1921      qx := A div 10;
     1922      if (qx * 10 = A) and (qx and 3 <> 0) then
    19231923      begin
    1924         qy := (y + x) div 5;
     1924        qy := (Y + X) div 5;
    19251925        if qy and 3 <> qx shr 2 and 1 * 2 then
    19261926          if (TerrType = fArctic) or (TerrType = fSwamp) then
    1927             result := 1
     1927            Result := 1
    19281928          else if TerrType = fShore then
    19291929          begin
    19301930            if (qx + qy) and 1 = 0 then
    19311931              if qx and 3 = 2 then
    1932                 result := 2
     1932                Result := 2
    19331933              else
    1934                 result := 1
     1934                Result := 1
    19351935            else
    1936               result := 0
     1936              Result := 0
    19371937          end
    19381938          else
    1939             result := (qx + qy) and 1 + 1
     1939            Result := (qx + qy) and 1 + 1
    19401940        else
    1941           result := 0;
     1941          Result := 0;
    19421942      end
    19431943      else
    1944         result := 0;
    1945     end
     1944        Result := 0;
     1945    end;
    19461946  end;
    19471947end;
  • branches/highdpi/Settings.lfm

    r412 r465  
    55  Width = 483
    66  BorderStyle = bsNone
    7   Caption = 'LocaleDlg'
     7  Caption = 'Settings'
    88  ClientHeight = 448
    99  ClientWidth = 483
     10  Color = clBtnFace
    1011  DesignTimePPI = 144
    1112  FormStyle = fsStayOnTop
     
    1617  OnShow = FormShow
    1718  Position = poScreenCenter
    18   LCLVersion = '2.0.12.0'
     19  LCLVersion = '2.2.0.4'
    1920  Scaled = False
    2021  object ListLanguages: TDpiListBox
    2122    Tag = 15360
    2223    Left = 16
    23     Height = 267
     24    Height = 320
    2425    Top = 32
    2526    Width = 144
     
    6970  object Up2Btn: TButtonC
    7071    Tag = 6912
    71     Left = 432
     72    Left = 452
    7273    Height = 12
    73     Top = 328
     74    Top = 360
    7475    Width = 12
    7576    Down = False
     
    8081  object Down2Btn: TButtonC
    8182    Tag = 6912
    82     Left = 432
     83    Left = 452
    8384    Height = 12
    84     Top = 340
     85    Top = 372
    8586    Width = 12
    8687    Down = False
     
    9293    Tag = 15360
    9394    Left = 176
    94     Height = 192
     95    Height = 264
    9596    Top = 32
    9697    Width = 288
     
    113114  object EditShortCutPrimary: TDpiEdit
    114115    Left = 176
    115     Height = 19
    116         BorderStyle = bsNone
    117     Top = 256
     116    Height = 27
     117    Top = 325
    118118    Width = 136
     119    BorderStyle = bsNone
    119120    Color = clBlack
    120121    Enabled = False
    121     Font.Charset = DEFAULT_CHARSET
    122122    Font.Color = 4176863
    123123    Font.Height = -15
     
    130130  object EditShortCutSecondary: TDpiEdit
    131131    Left = 328
    132     Height = 19
    133         BorderStyle = bsNone
    134     Top = 257
     132    Height = 27
     133    Top = 325
    135134    Width = 136
     135    BorderStyle = bsNone
    136136    Color = clBlack
    137137    Enabled = False
    138     Font.Charset = DEFAULT_CHARSET
    139138    Font.Color = 4176863
    140139    Font.Height = -15
  • branches/highdpi/Settings.pas

    r412 r465  
    11unit Settings;
    2 
    3 {$mode delphi}
    42
    53interface
     
    75uses
    86  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;
    119
    1210type
     
    5856{$R *.lfm}
    5957
     58uses
     59  Start;
     60
    6061var
    6162  SFullScreen, SGamma, SRestartMsg, SShortCutPrimary, SShortCutSecondary,
     
    7778procedure TSettingsDlg.FormCreate(Sender: TObject);
    7879begin
     80  Color := clBlack;
    7981  LocalKeyBindings := TKeyBindings.Create;
    8082
     
    117119  Shift: TShiftState);
    118120begin
    119   if Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin
     121  if (Sender is TDpiEdit) and Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin
    120122    CurrentKeyBinding.ShortCut := Key or
    121123      (scShift * Integer(ssShift in Shift)) or
     
    131133  var Key: Word; Shift: TShiftState);
    132134begin
    133   if Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin
     135  if (Sender is TDpiEdit) and Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin
    134136    CurrentKeyBinding.ShortCut2 := Key or
    135137      (scShift * Integer(ssShift in Shift)) or
     
    192194procedure TSettingsDlg.FormShow(Sender: TObject);
    193195begin
     196  Caption := Phrases2.Lookup('ACTIONHEADER_CONFIG');
    194197  ReloadLanguages;
    195   Languages.LoadToStrings(ListLanguages.Items);
     198  StartDlg.Translator.LanguageListToStrings(ListLanguages.Items);
    196199  ListLanguages.Font.Color := MainTexture.ColorMark;
    197200  ListKeyBindings.Font.Color := MainTexture.ColorMark;
     
    260263procedure TSettingsDlg.LoadData;
    261264begin
    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;
    265269  if FullScreen then ButtonFullscreen.ButtonIndex := 3
    266270    else ButtonFullscreen.ButtonIndex := 2;
    267271  LocalGamma := Gamma;
    268   LocalKeyBindings.Assign(KeyBindings);
     272  LocalKeyBindings.Assign(KeyBindings.KeyBindings);
    269273end;
    270274
     
    274278begin
    275279  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;
    277287  FullScreen := (ButtonFullscreen.ButtonIndex and 1) = 1;
    278288  Gamma := LocalGamma;
    279289  if NeedRestart then SimpleMessage(SRestartMsg);
    280   KeyBindings.Assign(LocalKeyBindings);
     290  KeyBindings.KeyBindings.Assign(LocalKeyBindings);
    281291end;
    282292
    283293end.
    284294
     295
     296
  • branches/highdpi/Start.lfm

    r378 r465  
    2626  OnShow = FormShow
    2727  LCLVersion = '2.0.12.0'
     28  ShowInTaskBar = stNever
    2829  Scaled = False
    2930  object StartBtn: TButtonA
  • branches/highdpi/Start.pas

    r405 r465  
    77  UDpiControls, GameServer, Messg, ButtonBase, ButtonA, ButtonC, ButtonB, Area, Types,
    88  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;
    1011
    1112type
    12 
    1313  { TPlayerSlot }
    1414
     
    2121  end;
    2222
    23   TPlayerSlots = class(TFPGObjectList<TPlayerSlot>)
     23  TPlayerSlots = class(TObjectList<TPlayerSlot>)
    2424  end;
    2525
     
    6969    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    7070    procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
    71       Shift: TShiftState; x, y: integer);
     71      Shift: TShiftState; X, Y: Integer);
    7272    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);
    7575    procedure Up1BtnClick(Sender: TObject);
    7676    procedure Down1BtnClick(Sender: TObject);
     
    122122    MiniMap: TMiniMap;
    123123    LastGame: string;
    124     procedure DrawAction(y, IconIndex: integer; HeaderItem, TextItem: string);
     124    procedure DrawAction(Y, IconIndex: Integer; HeaderItem, TextItem: string);
    125125    procedure InitPopup(PlayerIndex: Integer);
    126126    procedure OfferBrain(Brain: TBrain; FixedLines: Integer);
     
    129129    procedure ChangeTab(NewTab: TStartTab);
    130130    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;
    133133    procedure LoadConfig;
    134134    procedure SaveConfig;
     135    procedure LoadLanguages;
    135136    procedure LoadAiBrainsPictures;
    136137    procedure UpdateInterface;
     
    138139  public
    139140    EmptyPicture: TDpiBitmap;
     141    Translator: TTranslator;
    140142    procedure UpdateFormerGames;
    141143    procedure UpdateMaps;
     
    149151
    150152uses
    151   Global, Directories, Direct, ScreenTools, Inp, Back, Settings, UKeyBindings;
     153  Global, Directories, Direct, ScreenTools, Inp, Back, Settings, KeyBindings,
     154  Languages;
    152155
    153156{$R *.lfm}
     
    157160  // attention: lx*ly+1 must be prime!
    158161  { 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);
    161164    DefaultWorldTiles=4200; }
    162165  MaxWorldSize = 6;
     
    189192  dxBrain = 104;
    190193  dyBrain = 80;
    191   xBrain: array [0 .. nPlOffered - 1] of integer = (x0Brain, x0Brain,
     194  xBrain: array [0 .. nPlOffered - 1] of Integer = (x0Brain, x0Brain,
    192195    x0Brain + dxBrain, x0Brain + dxBrain, x0Brain + dxBrain, x0Brain,
    193196    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,
    195198    y0Brain - dyBrain, y0Brain, y0Brain + dyBrain, y0Brain + dyBrain,
    196199    y0Brain + dyBrain, y0Brain, y0Brain - dyBrain);
     
    199202  TabHeight = 40;
    200203
    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,
    202205    1 + 2 + 8 + 128, 1 + 2 + 8 + 32 + 128, 1 + 2 + 8 + 16 + 64 + 128,
    203206    1 + 2 + 4 + 16 + 32 + 64 + 256, 511 - 32, 511, 511 - 32, 511, 511 - 32, 511,
    204207    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,
    206209    256 + 128, 256 + 128 + 64, 256 + 128 + 64);
    207210
    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);
    210213
    211214{ TStartDlg }
     
    213216procedure TStartDlg.FormCreate(Sender: TObject);
    214217var
    215   x, i: Integer;
     218  X, I: Integer;
    216219  PlayerSlot: TPlayerSlot;
    217220  AIBrains: TBrains;
     
    226229  LoadConfig;
    227230  LoadAssets;
     231  LoadLanguages;
    228232
    229233  ActionsOffered := [maConfig, maManual, maCredits, maWeb];
     
    232236
    233237  BrainDefault := nil;
    234   for i := Brains.IndexOf(BrainRandom) to Brains.Count - 1 do
    235     if AnsiCompareFileName(DefaultAI, Brains[i].FileName) = 0 then
    236       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];
    237241  if (BrainDefault = BrainRandom) and (Brains.GetKindCount(btAI) < 2) then
    238242    BrainDefault := nil;
     
    256260  ReplayBtn.Hint := Phrases.Lookup('BTN_REPLAY');
    257261  PlayerSlots.Count := nPlOffered;
    258   for i := 0 to PlayerSlots.Count - 1 do
    259   with PlayerSlots[i] do begin
     262  for I := 0 to PlayerSlots.Count - 1 do
     263  with PlayerSlots[I] do begin
    260264    DiffUpBtn := TButtonC.Create(self);
    261265    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;
    264268    DiffUpBtn.ButtonIndex := 1;
    265269    DiffUpBtn.Parent := self;
     
    267271    DiffDownBtn := TButtonC.Create(self);
    268272    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;
    271275    DiffDownBtn.ButtonIndex := 0;
    272276    DiffDownBtn.Parent := self;
    273277    DiffDownBtn.OnClick := DiffBtnClick;
    274278  end;
    275   for i := 6 to 8 do
    276   with PlayerSlots[i] do begin
     279  for I := 6 to 8 do
     280  with PlayerSlots[I] do begin
    277281    MultiBtn := TButtonC.Create(self);
    278282    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];
    281285    MultiBtn.Parent := self;
    282286    MultiBtn.OnClick := MultiBtnClick;
     
    284288  end;
    285289
    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;
    288292  if AutoDiff < 0 then
    289293    CustomizeBtn.ButtonIndex := 3
     
    291295    CustomizeBtn.ButtonIndex := 2;
    292296
    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
    297302  LoadAiBrainsPictures;
    298303
     
    325330begin
    326331  SaveConfig;
     332  FreeAndNil(Translator);
    327333  FreeAndNil(FormerGames);
    328334  FreeAndNil(Maps);
     
    333339end;
    334340
    335 procedure TStartDlg.SmartInvalidate(x0, y0, x1, y1: integer;
    336   invalidateTab0: boolean);
    337 var
    338   i: integer;
     341procedure TStartDlg.SmartInvalidate(x0, y0, x1, y1: Integer;
     342  invalidateTab0: Boolean);
     343var
     344  I: Integer;
    339345  r0, r1: HRgn;
    340346begin
    341347  r0 := DpiCreateRectRgn(x0, y0, x1, y1);
    342   for i := 0 to ControlCount - 1 do
    343     if not (Controls[i] is TArea) and Controls[i].Visible then
     348  for I := 0 to ControlCount - 1 do
     349    if not (Controls[I] is TArea) and Controls[I].Visible then
    344350    begin
    345       with Controls[i].BoundsRect do
     351      with Controls[I].BoundsRect do
    346352        r1 := DpiCreateRectRgn(left, top, Right, Bottom);
    347353      CombineRgn(r0, r0, r1, RGN_DIFF);
     
    353359    DeleteObject(r1);
    354360  end;
    355   InvalidateRgn(Handle, r0, false);
     361  InvalidateRgn(Handle, r0, False);
    356362  DeleteObject(r0);
    357363end;
     
    429435  end;
    430436
    431   KeyBindings.LoadFromRegistry(HKEY_CURRENT_USER, AppRegistryKey + '\KeyBindings');
     437  KeyBindings.KeyBindings.LoadFromRegistry(HKEY_CURRENT_USER, AppRegistryKey + '\KeyBindings');
    432438end;
    433439
     
    453459  end;
    454460
    455   KeyBindings.SaveToRegistry(HKEY_CURRENT_USER, AppRegistryKey + '\KeyBindings');
     461  KeyBindings.KeyBindings.SaveToRegistry(HKEY_CURRENT_USER, AppRegistryKey + '\KeyBindings');
     462end;
     463
     464procedure TStartDlg.LoadLanguages;
     465var
     466  I: Integer;
     467begin
     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;
    456477end;
    457478
    458479procedure TStartDlg.LoadAiBrainsPictures;
    459480var
    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;
     482begin
     483  AiBrains := TBrains.Create(False);
     484  try
     485    Brains.GetByKind(btAI, AiBrains);
     486    AiBrains.LoadPictures;
     487  finally
     488    FreeAndNil(AiBrains);
     489  end;
    483490end;
    484491
     
    498505    DeleteObject(r1);
    499506    r1 := DpiCreateRectRgn(QuitBtn.Left, QuitBtn.Top, QuitBtn.Left + QuitBtn.Width,
    500       QuitBtn.top + QuitBtn.Height);
     507      QuitBtn.Top + QuitBtn.Height);
    501508    CombineRgn(r0, r0, r1, RGN_OR);
    502509    DeleteObject(r1);
     
    505512  end else begin
    506513    BoundsRect := Bounds((DpiScreen.Width - Width) div 2,
    507       (DpiScreen.Height - Height) div 2, Width, Height)
     514      (DpiScreen.Height - Height) div 2, Width, Height);
    508515  end;
    509516end;
     
    521528end;
    522529
    523 procedure TStartDlg.DrawAction(y, IconIndex: integer; HeaderItem, TextItem: string);
     530procedure TStartDlg.DrawAction(Y, IconIndex: Integer; HeaderItem, TextItem: string);
    524531begin
    525532  Canvas.Font.Assign(UniFont[ftCaption]);
    526533  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));
    528535  Canvas.Font.Assign(UniFont[ftNormal]);
    529536  BiColorTextOut(Canvas, Colors.Canvas.Pixels[clkAge0 - 1, cliDimmedText],
    530     $000000, xAction, y + 21, Phrases2.Lookup(TextItem));
     537    $000000, xAction, Y + 21, Phrases2.Lookup(TextItem));
    531538
    532539  UnshareBitmap(LogoBuffer);
    533   DpiBitCanvas(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);
    535542  GlowFrame(LogoBuffer, 8, 8, 34, 34, $202020);
    536   DpiBitCanvas(Canvas, xActionIcon - 2, y - 2, 50, 50,
     543  DpiBitBltCanvas(Canvas, xActionIcon - 2, Y - 2, 50, 50,
    537544    LogoBuffer.Canvas, 0, 0);
    538   DpiBitCanvas(Canvas, xActionIcon, y, 40, 40, BigImp.Canvas,
     545  DpiBitBltCanvas(Canvas, xActionIcon, Y, 40, 40, BigImp.Canvas,
    539546    (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,
    541548    $000000, $000000);
    542549end;
     
    546553  TabNames: array[TStartTab] of Integer = (0, 11, 3, 4);
    547554var
    548   i, w, h, xMini, yMini, y: integer;
    549   s: string;
     555  I, W, H, xMini, yMini, Y: Integer;
     556  S: string;
    550557  Tab2: TStartTab;
    551558  MainAction: TMainAction;
     
    579586
    580587  // 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,
    582589    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,
    584591    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;
    586593  for Tab2 := tbMap to tbPrevious do
    587594  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),
    589596      TabOffset + (Integer(Tab2) + 1) * TabSize - 1, TabHeight, MainTexture.ColorBevelLight,
    590597      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),
    592599      TabOffset + (Integer(Tab2) + 1) * TabSize, TabHeight, MainTexture.ColorBevelLight,
    593600      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)] :=
    595602      MainTexture.ColorBevelShade;
    596603  end;
     
    598605  for Tab2 := tbMap to tbPrevious do
    599606  begin
    600     s := Phrases.Lookup('STARTCONTROLS', TabNames[Tab2]);
     607    S := Phrases.Lookup('STARTCONTROLS', TabNames[Tab2]);
    601608    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);
    604611  end;
    605612  Frame(Canvas, TabOffset + 4 * TabSize + 1, -1, ClientWidth, TabHeight,
     
    630637  // Paint menu logo
    631638  UnshareBitmap(LogoBuffer);
    632   DpiBitCanvas(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));
    634641
    635642  ImageOp_BCC(LogoBuffer, Templates.Data, 0, 0, MenuLogo.Left, MenuLogo.Top,
     
    637644  ImageOp_BCC(LogoBuffer, Templates.Data, 10, 27, MenuLogo.Left + 10,
    638645    MenuLogo.Top + 27, MenuLogo.Width - 10, 9, $BFBF20, $4040DF); // logo part 2
    639   DpiBitCanvas(Canvas, 6, 3 + 2 * integer(Tab <> tbMain), MenuLogo.Width, MenuLogo.Height,
     646  DpiBitBltCanvas(Canvas, 6, 3 + 2 * Integer(Tab <> tbMain), MenuLogo.Width, MenuLogo.Height,
    640647    LogoBuffer.Canvas, 0, 0);
    641648
    642649  if Page = pgMain then begin
    643650    if SelectedAction <> maNone then // mark selected action
    644       for i := 0 to (ClientWidth - 2 * ActionSideBorder) div wBuffer + 1 do
     651      for I := 0 to (ClientWidth - 2 * ActionSideBorder) div wBuffer + 1 do
    645652      begin
    646         w := ClientWidth - 2 * ActionSideBorder - i * wBuffer;
    647         if w > wBuffer then
    648           w := wBuffer;
    649         h := ActionPitch;
    650         if yAction + Integer(SelectedAction) * ActionPitch - 8 + h > ClientHeight - ActionBottomBorder
     653        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
    651658        then
    652           h := ClientHeight - ActionBottomBorder -
     659          H := ClientHeight - ActionBottomBorder -
    653660            (yAction + Integer(SelectedAction) * ActionPitch - 8);
    654661
    655662        UnshareBitmap(LogoBuffer);
    656         DpiBitCanvas(LogoBuffer.Canvas, 0, 0, w, h, Canvas,
    657           ActionSideBorder + i * wBuffer, yAction + Integer(SelectedAction) * ActionPitch
     663        DpiBitBltCanvas(LogoBuffer.Canvas, 0, 0, W, H, Canvas,
     664          ActionSideBorder + I * wBuffer, yAction + Integer(SelectedAction) * ActionPitch
    658665          - 8);
    659         MakeBlue(LogoBuffer, 0, 0, w, h);
    660         DpiBitCanvas(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,
    662669          LogoBuffer.Canvas, 0, 0);
    663670      end;
    664     y := yAction;
     671    Y := yAction;
    665672    for MainAction := Low(TMainActionSet) to High(TMainActionSet) do
    666673    begin
    667674      if MainAction in ActionsOffered then
    668675        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');
    673680          maWeb:
    674681            begin
    675682              Canvas.Font.Assign(UniFont[ftCaption]);
    676683              // Canvas.Font.Style:=Canvas.Font.Style+[fsUnderline];
    677               RisedTextOut(Canvas, xActionIcon + 99, y,
     684              RisedTextOut(Canvas, xActionIcon + 99, Y,
    678685                Format(Phrases2.Lookup('ACTIONHEADER_WEB'), [CevoHomepageShort]));
    679686              Canvas.Font.Assign(UniFont[ftNormal]);
    680687
    681688              UnshareBitmap(LogoBuffer);
    682               DpiBitCanvas(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);
    684691              ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), LinkArrows.BoundsRect, 0,
    685692                Colors.Canvas.Pixels[clkAge0 - 1, cliDimmedText]);
    686               DpiBitCanvas(Canvas, xActionIcon, y + 2, LinkArrows.Width, LinkArrows.Height,
     693              DpiBitBltCanvas(Canvas, xActionIcon, Y + 2, LinkArrows.Width, LinkArrows.Height,
    687694                LogoBuffer.Canvas, 0, 0);
    688695            end;
    689696        end;
    690       Inc(y, ActionPitch);
     697      Inc(Y, ActionPitch);
    691698    end;
    692699  end
     
    696703      TurnToString(MaxTurn), 344, y0Mini + 61, 170);
    697704
    698     s := Phrases.Lookup('STARTCONTROLS', 7);
    699     w := Canvas.TextWidth(s);
    700     LoweredTextOut(Canvas, -2, MainTexture, x0Brain + 32 - w div 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);
    702709
    703710    InitOrnament;
    704711    if AutoDiff < 0 then
    705712    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,
    710716            HGrSystem2.Mask.Canvas, Ornament.Left, Ornament.Top, SRCAND);
    711           DpiBitCanvas(Canvas, 9 + i * 27, yLogo - 2, Ornament.Width, Ornament.Height,
     717          DpiBitBltCanvas(Canvas, 9 + I * 27, yLogo - 2, Ornament.Width, Ornament.Height,
    712718            HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT);
    713719        end;
     
    715721        MainTexture.ColorBevelShade);
    716722
    717       for i := 0 to nPlOffered - 1 do
    718         if 1 shl i and SlotAvailable <> 0 then
     723      for I := 0 to nPlOffered - 1 do
     724        if 1 shl I and SlotAvailable <> 0 then
    719725        begin
    720           if Assigned(PlayersBrain[i]) then
    721             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)
    723729          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]) then
     730            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
    727733          begin
    728             DpiBitCanvas(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) *
    730736              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,
    735741              MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    736742            with Canvas do
    737743            begin
    738744              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));
    741747              Brush.Style := bsClear;
    742748            end;
     
    746752                PlayerSlots[I].MultiBtn.left + 12, PlayerSlots[I].MultiBtn.top + 12,
    747753                MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    748               DpiBitCanvas(Canvas, xBrain[i] - 31, yBrain[i], 13, 12,
     754              DpiBitBltCanvas(Canvas, xBrain[I] - 31, yBrain[I], 13, 12,
    749755                HGrSystem.Data.Canvas, 88, 47);
    750756            end;
    751757          end;
    752           if Assigned(PlayersBrain[i]) then
     758          if Assigned(PlayersBrain[I]) then
    753759          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;
    757763          end;
    758764        end;
     
    765771        yMain + 140 { y0Mini-77 } , Phrases.Lookup('STARTCONTROLS', 15));
    766772      if Page = pgStartRandom then
    767         s := IntToStr(AutoEnemies)
     773        S := IntToStr(AutoEnemies)
    768774      else if nMapStartPositions = 0 then
    769         s := '0'
     775        S := '0'
    770776      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);
    773779
    774780      DLine(Canvas, 24, xDefault - 6, yMain + 164 + 19,
     
    778784      if AutoDiff = 1 then
    779785        FrameImage(Canvas, Brains.GetBeginner.Picture, xDefault, yDefault, 64,
    780           64, 0, 0, false)
     786          64, 0, 0, False)
    781787      else
    782788        FrameImage(Canvas, BrainDefault.Picture, xDefault, yDefault, 64, 64,
    783           0, 0, true);
     789          0, 0, True);
    784790      DLine(Canvas, 56, 272, y0Mini + 61 + 19, MainTexture.ColorBevelLight,
    785791        MainTexture.ColorBevelShade);
     
    787793      RisedTextOut(Canvas, 56, y0Mini + 61,
    788794        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,
    796801            HGrSystem2.Mask.Canvas, Ornament.Left, Ornament.Top, SRCAND);
    797           DpiBitCanvas(Canvas, 9 + i * 27, yLogo - 2, Ornament.Width, Ornament.Height,
     802          DpiBitBltCanvas(Canvas, 9 + I * 27, yLogo - 2, Ornament.Width, Ornament.Height,
    798803            HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT);
    799804        end;
     
    818823        MainTexture.ColorBevelShade);
    819824    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);
    822827  end
    823828  else if Page = pgEditRandom then
     
    833838  begin
    834839    // DLine(Canvas,344,514,y0Mini+61+19,MainTexture.ColorBevelLight,MainTexture.ColorBevelShade);
    835     s := Format(Phrases2.Lookup('MAPPROP'),
     840    S := Format(Phrases2.Lookup('MAPPROP'),
    836841      [(nMapLandTiles * 100 + 556) div 1112,
    837842      // 1112 is typical for world with 100% size and default land mass
    838843      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);
    841846  end;
    842847
     
    881886      MainTexture.ColorBevelLight);
    882887
    883     s := '';
     888    S := '';
    884889    if MiniMap.Mode = mmPicture then
    885890    begin
    886       DpiBitCanvas(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,
    887892        MiniMap.Bitmap.Canvas, 0, 0);
    888893      if Page = pgStartRandom then
    889         s := Phrases.Lookup('RANMAP')
     894        S := Phrases.Lookup('RANMAP');
    890895    end
    891896    else if MiniMap.Mode = mmMultiPlayer then
    892       s := Phrases.Lookup('MPMAP')
     897      S := Phrases.Lookup('MPMAP')
    893898    else if Page = pgStartMap then
    894       s := Copy(MapFileName, 1, Length(MapFileName) - Length(CevoMapExt))
     899      S := Copy(MapFileName, 1, Length(MapFileName) - Length(CevoMapExt))
    895900    else if Page = pgEditMap then
    896       s := List.Items[List.ItemIndex]
     901      S := List.Items[List.ItemIndex]
    897902    else if Page = pgNoLoad then
    898       s := Phrases.Lookup('NOGAMES');
    899     if s <> '' then
    900       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);
    902907  end;
    903908end;
     
    905910procedure TStartDlg.FormShow(Sender: TObject);
    906911begin
     912  {$IFDEF UNIX}
     913  ShowInTaskBar := stAlways;
     914  {$ENDIF}
    907915  MainTexture.Age := -1;
    908916  List.Font.Color := MainTexture.ColorMark;
     
    949957      begin // load
    950958        FileName := List.Items[List.ItemIndex];
    951         if LoadGame(GetSavedDir + DirectorySeparator, FileName + CevoExt, LoadTurn, false)
     959        if LoadGame(GetSavedDir + DirectorySeparator, FileName + CevoExt, LoadTurn, False)
    952960        then
    953961          UnlistBackupFile(FileName)
     
    969977        with Reg do
    970978        try
    971           OpenKey(AppRegistryKey, true);
     979          OpenKey(AppRegistryKey, True);
    972980          if ValueExists('GameCount') then GameCount := ReadInteger('GameCount')
    973981            else GameCount := 0;
     
    11581166          if Assigned(PlayersBrain[I]) and (PlayersBrain[I].Kind = btTerm) then begin
    11591167            PlayersBrain[I] := nil;
    1160             PlayerSlots[I].DiffUpBtn.Visible := false;
     1168            PlayerSlots[I].DiffUpBtn.Visible := False;
    11611169            PlayerSlots[I].DiffUpBtn.Tag := 0;
    1162             PlayerSlots[I].DiffDownBtn.Visible := false;
     1170            PlayerSlots[I].DiffDownBtn.Visible := False;
    11631171            PlayerSlots[I].DiffDownBtn.Tag := 0;
    11641172            if PlayerSlots[I].OfferMultiple then begin
    1165               PlayerSlots[I].MultiBtn.Visible := false;
     1173              PlayerSlots[I].MultiBtn.Visible := False;
    11661174              PlayerSlots[I].MultiBtn.Tag := 0;
    11671175            end;
     
    11891197  J := FixedLines;
    11901198  while (J < PopupMenu1.Items.Count) and
    1191     (StrIComp(pchar(MenuItem.Caption), pchar(PopupMenu1.Items[J].Caption)) > 0) do
     1199    (StrIComp(PChar(MenuItem.Caption), PChar(PopupMenu1.Items[J].Caption)) > 0) do
    11921200    Inc(J);
    11931201  MenuItem.RadioItem := True;
     
    12001208var
    12011209  I: Integer;
    1202   FixedLines: integer;
     1210  FixedLines: Integer;
    12031211  MenuItem: TDpiMenuItem;
    12041212  AIBrains: TBrains;
     
    12341242    end;
    12351243    for I := Brains.IndexOf(BrainTerm) downto 0 do // offer game interfaces
    1236       if (PlayerPopupIndex = 0) or (Brains[i].Kind = btTerm) and
     1244      if (PlayerPopupIndex = 0) or (Brains[I].Kind = btTerm) and
    12371245        (PlayersBrain[0].Kind <> btNoTerm) then begin
    12381246        OfferBrain(Brains[I], FixedLines);
     
    12581266        if (AIBrains[I].Flags and fMultiple <> 0) or (AIBrains[I].Flags and fUsed = 0)
    12591267          or (Brains[I] = PlayersBrain[PlayerPopupIndex]) then
    1260           OfferBrain(AIBrains[i], FixedLines);
     1268          OfferBrain(AIBrains[I], FixedLines);
    12611269      FreeAndNil(AIBrains);
    12621270    end;
     
    12731281    repeat
    12741282      I := FormerGames.Count;
    1275       while (I > 0) and (F.Time < integer(FormerGames.Objects[I - 1])) do
     1283      while (I > 0) and (F.Time < Integer(FormerGames.Objects[I - 1])) do
    12761284        Dec(I);
    12771285      FormerGames.InsertObject(I, Copy(F.Name, 1, Length(F.Name) - 5),
     
    12871295procedure TStartDlg.UpdateMaps;
    12881296var
    1289   f: TSearchRec;
     1297  F: TSearchRec;
    12901298begin
    12911299  Maps.Clear;
    1292   if FindFirst(GetMapsDir + DirectorySeparator + '*' + CevoMapExt, $21, f) = 0 then
     1300  if FindFirst(GetMapsDir + DirectorySeparator + '*' + CevoMapExt, $21, F) = 0 then
    12931301    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;
    12961304  FindClose(F);
    12971305  Maps.Sort;
     
    13041312procedure TStartDlg.ChangePage(NewPage: TStartPage);
    13051313var
    1306   i, j, p1: integer;
    1307   s: string;
     1314  I, J, p1: Integer;
     1315  S: string;
    13081316  Reg: TRegistry;
    1309   InvalidateTab0: boolean;
     1317  InvalidateTab0: Boolean;
    13101318begin
    13111319  InvalidateTab0 := (Page = pgMain) or (NewPage = pgMain);
     
    13161324        StartBtn.Caption := Phrases.Lookup('STARTCONTROLS', 1);
    13171325        if Page = pgStartRandom then
    1318           i := nPlOffered
     1326          I := nPlOffered
    13191327        else
    13201328        begin
    1321           i := nMapStartPositions;
    1322           if i = 0 then
     1329          I := nMapStartPositions;
     1330          if I = 0 then
    13231331          begin
    13241332            PlayersBrain[0] := BrainSuperVirtual;
     
    13261334          end;
    13271335          if PlayersBrain[0].Kind in [btNoTerm, btSuperVirtual] then
    1328             inc(i);
    1329           if i > nPl then
    1330             i := nPl;
    1331           if i <= nPlOffered then
     1336            Inc(I);
     1337          if I > nPl then
     1338            I := nPl;
     1339          if I <= nPlOffered then
    13321340            MultiControl := 0
    13331341          else
    1334             MultiControl := InitMulti[i];
     1342            MultiControl := InitMulti[I];
    13351343        end;
    1336         if InitAlive[i] <> SlotAvailable then
     1344        if InitAlive[I] <> SlotAvailable then
    13371345          if Page = pgStartRandom then
    13381346          begin // restore AI assignment of last start
     
    13431351              for p1 := 0 to nPlOffered - 1 do begin
    13441352                PlayersBrain[p1] := nil;
    1345                 s := ReadString('Control' + IntToStr(p1));
     1353                S := ReadString('Control' + IntToStr(p1));
    13461354                Difficulty[p1] := ReadInteger('Diff' + IntToStr(p1));
    1347                 if s <> '' then
    1348                   for j := 0 to Brains.Count - 1 do
    1349                     if AnsiCompareFileName(s, Brains[j].FileName) = 0 then
    1350                       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];
    13511359              end;
    13521360            finally
     
    13561364          else
    13571365            for p1 := 1 to nPl - 1 do
    1358               if 1 shl p1 and InitAlive[i] <> 0 then
     1366              if 1 shl p1 and InitAlive[I] <> 0 then
    13591367              begin
    13601368                PlayersBrain[p1] := BrainDefault;
     
    13631371              else
    13641372                PlayersBrain[p1] := nil;
    1365         SlotAvailable := InitAlive[i];
    1366         for i := 0 to nPlOffered - 1 do
    1367           if (AutoDiff < 0) and Assigned(PlayersBrain[i]) and
    1368             (PlayersBrain[i].Kind in [btTerm, btRandom, btAI]) then
     1373        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
    13691377          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;
    13721380          end
    13731381          else
    13741382          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;
    13771385          end;
    1378         for i := 6 to 8 do
    1379           if (AutoDiff < 0) and Assigned(PlayersBrain[i]) and
    1380             (PlayersBrain[i].Kind in [btTerm, btRandom, btAI]) then
     1386        for I := 6 to 8 do
     1387          if (AutoDiff < 0) and Assigned(PlayersBrain[I]) and
     1388            (PlayersBrain[I].Kind in [btTerm, btRandom, btAI]) then
    13811389          begin
    1382             PlayerSlots[i].MultiBtn.Tag := 768;
    1383             PlayerSlots[i].MultiBtn.ButtonIndex := 2 + (MultiControl shr i) and 1;
    1384             PlayerSlots[i].MultiBtn.Enabled := Page = pgStartRandom
     1390            PlayerSlots[I].MultiBtn.Tag := 768;
     1391            PlayerSlots[I].MultiBtn.ButtonIndex := 2 + (MultiControl shr I) and 1;
     1392            PlayerSlots[I].MultiBtn.Enabled := Page = pgStartRandom
    13851393          end
    13861394          else
    1387             PlayerSlots[i].MultiBtn.Tag := 0;
     1395            PlayerSlots[I].MultiBtn.Tag := 0;
    13881396        if (AutoDiff > 0) and (Page <> pgStartMap) then
    13891397        begin
     
    14241432
    14251433  PaintInfo;
    1426   for i := 0 to ControlCount - 1 do
    1427     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;
    14281436  if Page = pgLoad then
    14291437    ReplayBtn.Visible := MiniMap.Mode <> mmMultiPlayer;
     
    14691477
    14701478procedure TStartDlg.FormMouseDown(Sender: TObject; Button: TMouseButton;
    1471   Shift: TShiftState; x, y: integer);
     1479  Shift: TShiftState; X, Y: Integer);
    14721480var
    14731481  I: Integer;
    14741482begin
    1475   if (y < TabHeight + 1) and (x - TabOffset < TabSize * 4) and
    1476     ((x - TabOffset) div TabSize <> Integer(Tab)) then
     1483  if (Y < TabHeight + 1) and (X - TabOffset < TabSize * 4) and
     1484    ((X - TabOffset) div TabSize <> Integer(Tab)) then
    14771485  begin
    14781486    // Play('BUTTON_DOWN');
    14791487    ListIndex[Tab] := List.ItemIndex;
    1480     ChangeTab(TStartTab((x - TabOffset) div TabSize));
     1488    ChangeTab(TStartTab((X - TabOffset) div TabSize));
    14811489  end
    14821490  else if Page = pgMain then begin
     
    14931501  begin
    14941502    for I := 0 to nPlOffered - 1 do
    1495       if (1 shl I and SlotAvailable <> 0) and (x >= xBrain[I]) and
    1496         (y >= yBrain[I]) and (x < xBrain[I] + 64) and (y < yBrain[I] + 64) then
     1503      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
    14971505      begin
    14981506        InitPopup(I);
     
    15041512  end
    15051513  else if (AutoDiff > 1) and ((Page = pgStartRandom) or (Page = pgStartMap)) and
    1506     (x >= xDefault) and (y >= yDefault) and (x < xDefault + 64) and
    1507     (y < yDefault + 64) then
     1514    (X >= xDefault) and (Y >= yDefault) and (X < xDefault + 64) and
     1515    (Y < yDefault + 64) then
    15081516    if Brains.GetKindCount(btAI) < 2 then
    15091517      SimpleMessage(Phrases.Lookup('NOALTAI'))
     
    15131521      PopupMenu1.Popup(left + xDefault + 4, top + yDefault + 4);
    15141522    end
    1515   else if (Page = pgLoad) and (LastTurn > 0) and (y >= yTurnSlider) and
    1516     (y < yTurnSlider + 7) and (x >= xTurnSlider) and
    1517     (x <= xTurnSlider + wTurnSlider) then
    1518   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;
    15201528    SmartInvalidate(xTurnSlider - 2, y0Mini + 61, xTurnSlider + wTurnSlider + 2,
    15211529      yTurnSlider + 9);
     
    15301538      if MaxTurn < 1400 then
    15311539      begin
    1532         inc(MaxTurn, 200);
     1540        Inc(MaxTurn, 200);
    15331541        SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 82);
    15341542      end;
     
    15361544      if LoadTurn < LastTurn then
    15371545      begin
    1538         inc(LoadTurn);
     1546        Inc(LoadTurn);
    15391547        SmartInvalidate(xTurnSlider - 2, y0Mini + 61, xTurnSlider + wTurnSlider
    15401548          + 2, yTurnSlider + 9);
     
    15431551      if StartLandMass < 96 then
    15441552      begin
    1545         inc(StartLandMass, 5);
     1553        Inc(StartLandMass, 5);
    15461554        PaintInfo;
    15471555        SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 61 + 21);
     
    15561564      if MaxTurn > 400 then
    15571565      begin
    1558         dec(MaxTurn, 200);
     1566        Dec(MaxTurn, 200);
    15591567        SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 82);
    15601568      end;
     
    15621570      if LoadTurn > 0 then
    15631571      begin
    1564         dec(LoadTurn);
     1572        Dec(LoadTurn);
    15651573        SmartInvalidate(xTurnSlider - 2, y0Mini + 61, xTurnSlider + wTurnSlider
    15661574          + 2, yTurnSlider + 9);
     
    15691577      if StartLandMass > 10 then
    15701578      begin
    1571         dec(StartLandMass, 5);
     1579        Dec(StartLandMass, 5);
    15721580        PaintInfo;
    15731581        SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 61 + 21);
     
    16241632procedure TStartDlg.RenameBtnClick(Sender: TObject);
    16251633var
    1626   i: integer;
     1634  I: Integer;
    16271635  NewName: string;
    1628   f: file;
    1629   ok: boolean;
     1636  F: file;
     1637  ok: Boolean;
    16301638  MapPictureFileName: string;
    16311639begin
     
    16451653      (NewName <> List.Items[List.ItemIndex]) then
    16461654    begin
    1647       for i := 1 to Length(NewName) do
    1648         if NewName[i] in ['\', '/', ':', '*', '?', '"', '<', '>', '|'] then
     1655      for I := 1 to Length(NewName) do
     1656        if NewName[I] in ['\', '/', ':', '*', '?', '"', '<', '>', '|'] then
    16491657        begin
    1650           SimpleMessage(Format(Phrases.Lookup('NOFILENAME'), [NewName[i]]));
     1658          SimpleMessage(Format(Phrases.Lookup('NOFILENAME'), [NewName[I]]));
    16511659          Exit;
    16521660        end;
    16531661      if Page = pgLoad then
    1654         AssignFile(f, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)
     1662        AssignFile(F, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)
    16551663      else
    1656         AssignFile(f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +
     1664        AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +
    16571665          CevoMapExt);
    1658       ok := true;
     1666      ok := True;
    16591667      try
    16601668        if Page = pgLoad then
    1661           Rename(f, GetSavedDir + DirectorySeparator + NewName + CevoExt)
     1669          Rename(F, GetSavedDir + DirectorySeparator + NewName + CevoExt)
    16621670        else
    1663           Rename(f, GetMapsDir + DirectorySeparator + NewName + CevoMapExt);
     1671          Rename(F, GetMapsDir + DirectorySeparator + NewName + CevoMapExt);
    16641672      except
    16651673        // Play('INVALID');
     
    16721680        if FileExists(MapPictureFileName) then
    16731681        try
    1674           AssignFile(f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex]
     1682          AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex]
    16751683            + CevoMapPictureExt);
    1676           Rename(f, GetMapsDir + DirectorySeparator + NewName + CevoMapPictureExt);
     1684          Rename(F, GetMapsDir + DirectorySeparator + NewName + CevoMapPictureExt);
    16771685        except
    16781686        end;
     
    16941702procedure TStartDlg.DeleteBtnClick(Sender: TObject);
    16951703var
    1696   iDel: integer;
    1697   f: file;
     1704  iDel: Integer;
     1705  F: file;
    16981706begin
    16991707  if List.ItemIndex >= 0 then
     
    17081716    begin
    17091717      if Page = pgLoad then
    1710         AssignFile(f, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)
     1718        AssignFile(F, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)
    17111719      else
    1712         AssignFile(f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +
     1720        AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +
    17131721          CevoMapExt);
    1714       Erase(f);
     1722      Erase(F);
    17151723      iDel := List.ItemIndex;
    17161724      if Page = pgLoad then
     
    17331741          List.Invalidate;
    17341742          if Page = pgLoad then
    1735             TurnValid := false;
     1743            TurnValid := False;
    17361744          PaintInfo;
    17371745          if Page = pgLoad then
     
    18321840
    18331841procedure TStartDlg.FormMouseUp(Sender: TObject; Button: TMouseButton;
    1834   Shift: TShiftState; x, y: integer);
     1842  Shift: TShiftState; X, Y: Integer);
    18351843begin
    18361844  Tracking := False;
     
    18381846
    18391847procedure TStartDlg.FormMouseMove(Sender: TObject; Shift: TShiftState;
    1840   x, y: integer);
     1848  X, Y: Integer);
    18411849var
    18421850  OldLoadTurn: Integer;
     
    18451853  if Tracking then
    18461854  begin
    1847     x := x - xTurnSlider;
    1848     if x < 0 then
    1849       x := 0
    1850     else if x > wTurnSlider then
    1851       x := wTurnSlider;
     1855    X := X - xTurnSlider;
     1856    if X < 0 then
     1857      X := 0
     1858    else if X > wTurnSlider then
     1859      X := wTurnSlider;
    18521860    OldLoadTurn := LoadTurn;
    1853     LoadTurn := LastTurn * x div wTurnSlider;
     1861    LoadTurn := LastTurn * X div wTurnSlider;
    18541862    if LoadTurn < OldLoadTurn then
    18551863    begin
     
    18691877  else if Page = pgMain then
    18701878  begin
    1871     if (x >= ActionSideBorder) and (x < ClientWidth - ActionSideBorder) and
    1872       (y >= yAction - 8) and (y < ClientHeight - ActionBottomBorder) then
     1879    if (X >= ActionSideBorder) and (X < ClientWidth - ActionSideBorder) and
     1880      (Y >= yAction - 8) and (Y < ClientHeight - ActionBottomBorder) then
    18731881    begin
    1874       NewSelectedAction := TMainAction((y - (yAction - 8)) div ActionPitch);
     1882      NewSelectedAction := TMainAction((Y - (yAction - 8)) div ActionPitch);
    18751883      if not (NewSelectedAction in ActionsOffered) then
    18761884        NewSelectedAction := maNone;
     
    19181926end;
    19191927
    1920 
    19211928end.
  • branches/highdpi/UnitProcessing.pas

    r303 r465  
    1313  TMoveInfo = record
    1414    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;
    1717  end;
    1818
    1919var
    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 }
    2222
    2323  // 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;
     24function HostileDamage(P, mix, Loc, MP: Integer): Integer;
     25function CalculateMove(P, uix, ToLoc, MoveLength: Integer; TestOnly: Boolean;
     26  var MoveInfo: TMoveInfo): Integer;
     27function GetBattleForecast(Loc: Integer; var BattleForecast: TBattleForecast;
     28  var Duix, Dcix, AStr, DStr, ABaseDamage, DBaseDamage: Integer): Integer;
     29function LoadUnit(P, uix: Integer; TestOnly: Boolean): Integer;
     30function UnloadUnit(P, uix: Integer; TestOnly: Boolean): Integer;
     31procedure Recover(P, uix: Integer);
     32function GetMoveAdvice(P, uix: Integer; var A: TMoveAdviceData): Integer;
     33function CanPlaneReturn(P, uix: Integer;
     34  PlaneReturnData: TPlaneReturnData): Boolean;
    3535
    3636// 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;
     37function StartJob(P, uix, NewJob: Integer; TestOnly: Boolean): Integer;
     38function Work(P, uix: Integer): Boolean;
     39function GetJobProgress(P, Loc: Integer;
     40  var JobProgressData: TJobProgressData): Integer;
    4141
    4242// Start/End Game
    4343procedure InitGame;
    4444procedure ReleaseGame;
     45
    4546
    4647implementation
     
    7374
    7475type
    75   TToWorkList = array [0 .. INFIN, 0 .. nJob - 1] of word;
     76  TToWorkList = array [0 .. INFIN, 0 .. nJob - 1] of Word;
    7677
    7778var
     
    8283    ____________________________________________________________________
    8384  }
    84 function HostileDamage(p, mix, Loc, MP: integer): integer;
    85 var
    86   Tile: integer;
     85function HostileDamage(P, mix, Loc, MP: Integer): Integer;
     86var
     87  Tile: Integer;
    8788begin
    8889  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) or
     90  if (RW[P].Model[mix].Domain >= dSea) or (RW[P].Model[mix].Kind = mkSettler)
     91    and (RW[P].Model[mix].Speed >= 200) or
    9192    (Tile and (fCity or fRiver or fCanal) <> 0) or (Tile and fTerImp = tiBase)
    92     or (GWonder[woGardens].EffectiveOwner = p) then
    93     result := 0
     93    or (GWonder[woGardens].EffectiveOwner = P) then
     94    Result := 0
    9495  else if (Tile and fTerrain = fDesert) and
    9596    (Tile and fSpecial <> fSpecial1 { Oasis } ) then
    9697  begin
    97     assert((Tile and fTerImp <> tiIrrigation) and (Tile and fTerImp <> tiFarm));
    98     result := (DesertThurst * MP - 1) div RW[p].Model[mix].Speed + 1
     98    Assert((Tile and fTerImp <> tiIrrigation) and (Tile and fTerImp <> tiFarm));
     99    Result := (DesertThurst * MP - 1) div RW[P].Model[mix].Speed + 1
    99100  end
    100101  else if Tile and fTerrain = fArctic then
    101102  begin
    102     assert((Tile and fTerImp <> tiIrrigation) and (Tile and fTerImp <> tiFarm));
    103     result := (ArcticThurst * MP - 1) div RW[p].Model[mix].Speed + 1
     103    Assert((Tile and fTerImp <> tiIrrigation) and (Tile and fTerImp <> tiFarm));
     104    Result := (ArcticThurst * MP - 1) div RW[P].Model[mix].Speed + 1
    104105  end
    105106  else
    106     result := 0
    107 end;
    108 
    109 function Controlled(p, Loc: integer; IsDest: boolean): integer;
     107    Result := 0;
     108end;
     109
     110function Controlled(P, Loc: Integer; IsDest: Boolean): Integer;
    110111{ whether tile at Loc is in control zone of enemy unit
    111112  returns combination of tile control flags }
    112113var
    113   Loc1, V8: integer;
     114  Loc1, V8: Integer;
    114115  Adjacent: TVicinity8Loc;
    115116begin
    116   result := 0;
    117   if IsDest and (Occupant[Loc] = p) and (ZoCMap[Loc] > 0) then
    118     exit;
     117  Result := 0;
     118  if IsDest and (Occupant[Loc] = P) and (ZoCMap[Loc] > 0) then
     119    Exit;
    119120  // destination tile, not controlled if already occupied
    120121
    121   if (RealMap[Loc] and fCity = 0) or (integer(RealMap[Loc] shr 27) <> p) and
    122     (ServerVersion[p] >= $000EF0) then
     122  if (RealMap[Loc] and fCity = 0) or (Integer(RealMap[Loc] shr 27) <> P) and
     123    (ServerVersion[P] >= $000EF0) then
    123124  begin // not own city
    124125    V8_to_Loc(Loc, Adjacent);
     
    127128      Loc1 := Adjacent[V8];
    128129      if (Loc1 >= 0) and (Loc1 < MapSize) and (ZoCMap[Loc1] > 0) and
    129         (Occupant[Loc1] >= 0) and (Occupant[Loc1] <> p) and
    130         (RW[p].Treaty[Occupant[Loc1]] < trAlliance) then
    131         if ObserveLevel[Loc1] and (3 shl (p * 2)) > 0 then
     130        (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
    132133        begin // p observes tile
    133           result := coKnown or coTrue;
    134           exit
     134          Result := coKnown or coTrue;
     135          Exit;
    135136        end
    136137        else
    137           result := coTrue; // p does not observe tile
    138     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;
     141end;
     142
     143function GetMoveCost(P, mix, FromLoc, ToLoc, MoveLength: Integer;
     144  var MoveCost: Integer): Integer;
    144145// MoveLength - 2 for short move, 3 for long move
    145146var
    146   FromTile, ToTile: integer;
    147 begin
    148   result := eOK;
     147  FromTile, ToTile: Integer;
     148begin
     149  Result := eOK;
    149150  FromTile := RealMap[FromLoc];
    150151  ToTile := RealMap[ToLoc];
    151   with RW[p].Model[mix] do
     152  with RW[P].Model[mix] do
    152153  begin
    153154    case Domain of
     
    159160          if (FromTile and (fRR or fCity) <> 0) and
    160161            (ToTile and (fRR or fCity) <> 0) then
    161             if GWonder[woShinkansen].EffectiveOwner = p then
     162            if GWonder[woShinkansen].EffectiveOwner = P then
    162163              MoveCost := 0
    163164            else
     
    173174              MoveCost := 20
    174175          else if Cap[mcOver] > 0 then
    175             result := eNoRoad
     176            Result := eNoRoad
    176177          else
    177178            case Terrain[ToTile and fTerrain].MoveCost of
     
    180181              2:
    181182                begin
    182                   assert(Speed - 150 <= 600);
     183                  Assert(Speed - 150 <= 600);
    183184                  MoveCost := 50 + (Speed - 150) * 13 shr 7; // heavy terrain
    184185                end;
     
    186187                begin
    187188                  MoveCost := Speed;
    188                   result := eMountains;
    189                   exit
     189                  Result := eMountains;
     190                  Exit;
    190191                end;
    191192            end;
     
    193194        end
    194195        else
    195           result := eDomainMismatch;
     196          Result := eDomainMismatch;
    196197
    197198      dSea:
     
    201202            MoveCost := 50 * MoveLength { valid move }
    202203          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;
    206207
    207208      dAir:
    208209        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;
     212end;
     213
     214function CalculateMove(P, uix, ToLoc, MoveLength: Integer; TestOnly: Boolean;
     215  var MoveInfo: TMoveInfo): Integer;
    215216var
    216217  uix1, p1, FromLoc, DestControlled, AStr, DStr, ABaseDamage,
    217     DBaseDamage: integer;
     218    DBaseDamage: Integer;
    218219  PModel: ^TModel;
    219220  BattleForecast: TBattleForecast;
    220221begin
    221   with RW[p], Un[uix] do
     222  with RW[P], Un[uix] do
    222223  begin
    223224    PModel := @Model[mix];
    224225    FromLoc := Loc;
    225226
    226     BattleForecast.pAtt := p;
     227    BattleForecast.pAtt := P;
    227228    BattleForecast.mixAtt := mix;
    228229    BattleForecast.HealthAtt := Health;
     
    230231    BattleForecast.FlagsAtt := Flags;
    231232    BattleForecast.Movement := Movement;
    232     result := GetBattleForecast(ToLoc, BattleForecast, MoveInfo.Duix,
     233    Result := GetBattleForecast(ToLoc, BattleForecast, MoveInfo.Duix,
    233234      MoveInfo.Dcix, AStr, DStr, ABaseDamage, DBaseDamage);
    234235
    235     if result = eHiddenUnit then
     236    if Result = eHiddenUnit then
    236237      if TestOnly then
    237         result := eOK // behave just like unit was moving
     238        Result := eOK // behave just like unit was moving
    238239      else if Mode > moLoading_Fast then
    239240        Map[ToLoc] := Map[ToLoc] or fHiddenUnit;
    240     if result = eStealthUnit then
     241    if Result = eStealthUnit then
    241242      if TestOnly then
    242         result := eOK // behave just like unit was moving
     243        Result := eOK // behave just like unit was moving
    243244      else if Mode > moLoading_Fast then
    244245        Map[ToLoc] := Map[ToLoc] or fStealthUnit;
    245     if result < rExecuted then
    246       exit;
    247 
    248     case result of
     246    if Result < rExecuted then
     247      Exit;
     248
     249    case Result of
    249250      eOK:
    250251        MoveInfo.MoveType := mtMove;
     
    260261      begin
    261262        p1 := RealMap[ToLoc] shr 27;
    262         if (p1 < nPl) and (p1 <> p) and
     263        if (p1 < nPl) and (p1 <> P) and
    263264          ((RealMap[Loc] shr 27 <> Cardinal(p1)) and (PModel.Kind <> mkDiplomat)
    264265          and (Treaty[p1] >= trPeace) and (Treaty[p1] < trAlliance) or
    265266          (RealMap[ToLoc] and fCity <> 0) and (Treaty[p1] >= trPeace)) then
    266267        begin
    267           result := eTreaty;
    268           exit
     268          Result := eTreaty;
     269          Exit;
    269270        end; // keep peace treaty!
    270271      end;
    271272      if (RealMap[ToLoc] and fCity <> 0) and
    272         (RealMap[ToLoc] shr 27 <> Cardinal(p)) then // empty enemy city
     273        (RealMap[ToLoc] shr 27 <> Cardinal(P)) then // empty enemy city
    273274        if PModel.Kind = mkDiplomat then
    274275        begin
     
    279280          if PModel.Flags and mdCivil <> 0 then
    280281          begin
    281             result := eNoCapturer;
    282             exit
     282            Result := eNoCapturer;
     283            Exit;
    283284          end;
    284285          MoveInfo.MoveType := mtCapture;
     
    288289          if (PModel.Domain = dSea) and (PModel.Cap[mcArtillery] = 0) then
    289290          begin
    290             result := eDomainMismatch;
    291             exit
     291            Result := eDomainMismatch;
     292            Exit;
    292293          end
    293294          else if (PModel.Attack = 0) and
     
    295296          then
    296297          begin
    297             result := eNoBombarder;
    298             exit
     298            Result := eNoBombarder;
     299            Exit;
    299300          end
    300301          else if Movement < 100 then
    301302          begin
    302             result := eNoTime_Bombard;
    303             exit
     303            Result := eNoTime_Bombard;
     304            Exit;
    304305          end;
    305306          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;
    311312    if MoveInfo.MoveType in [mtAttack, mtBombard, mtExpel] then
    312313    begin
     
    316317      then
    317318      begin
    318         result := eViolation;
    319         exit
     319        Result := eViolation;
     320        Exit;
    320321      end;
    321322      if MoveInfo.MoveType = mtBombard then
     
    328329        MoveInfo.EndHealth := BattleForecast.EndHealthAtt;
    329330        MoveInfo.EndHealthDef := BattleForecast.EndHealthDef;
    330       end
     331      end;
    331332    end
    332333    else // if MoveInfo.MoveType in [mtMove,mtCapture,mtSpyMission] then
     
    336337        MoveInfo.Cost := PModel.Speed;
    337338        if RealMap[ToLoc] and fTerrain < fGrass then
    338           result := eDomainMismatch;
     339          Result := eDomainMismatch;
    339340      end
    340341      else
    341342      begin
    342         result := GetMoveCost(p, mix, FromLoc, ToLoc, MoveLength,
     343        Result := GetMoveCost(P, mix, FromLoc, ToLoc, MoveLength,
    343344          MoveInfo.Cost);
    344         if result = eMountains then
    345         begin
    346           result := eOK;
    347           MoveInfo.MountainDelay := true
     345        if Result = eMountains then
     346        begin
     347          Result := eOK;
     348          MoveInfo.MountainDelay := True
    348349        end;
    349350      end;
    350       if (result >= rExecuted) and (MoveInfo.MoveType = mtSpyMission) then
    351         result := eMissionDone;
     351      if (Result >= rExecuted) and (MoveInfo.MoveType = mtSpyMission) then
     352        Result := eMissionDone;
    352353
    353354      MoveInfo.ToMaster := -1;
    354       if (result = eDomainMismatch) and (PModel.Domain < dSea) and
     355      if (Result = eDomainMismatch) and (PModel.Domain < dSea) and
    355356        (PModel.Cap[mcOver] = 0) then
    356357      begin
     
    360361              (TroopLoad < Model[mix].MTrans * Model[mix].Cap[mcSeaTrans]) then
    361362            begin
    362               result := eLoaded;
     363              Result := eLoaded;
    363364              MoveInfo.Cost := PModel.Speed;
    364365              MoveInfo.ToMaster := uix1;
     
    377378              (AirLoad < Model[mix].MTrans * Model[mix].Cap[mcCarrier]) then
    378379            begin // load plane to ship
    379               result := eLoaded;
     380              Result := eLoaded;
    380381              MoveInfo.ToMaster := uix1;
    381382              if (uixSelectedTransport >= 0) and (uix1 = uixSelectedTransport)
    382383              then
    383384                Break;
    384             end
     385            end;
    385386      end;
    386       if result < rExecuted then
    387         exit;
     387      if Result < rExecuted then
     388        Exit;
    388389
    389390      if (Master < 0) and (MoveInfo.ToMaster < 0) then
    390         MoveInfo.EndHealth := Health - HostileDamage(p, mix, ToLoc,
     391        MoveInfo.EndHealth := Health - HostileDamage(P, mix, ToLoc,
    391392          MoveInfo.Cost)
    392393      else
     
    394395
    395396      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)
    397398      then
    398399      begin
    399         DestControlled := Controlled(p, ToLoc, true);
     400        DestControlled := Controlled(P, ToLoc, True);
    400401        if DestControlled >= coTrue + coKnown then
    401402        begin
    402           result := eZOC;
    403           exit
     403          Result := eZOC;
     404          Exit;
    404405        end
    405406        else if not TestOnly and (DestControlled >= coTrue) then
    406407        begin
    407           result := eZOC_EnemySpotted;
    408           exit
    409         end
     408          Result := eZOC_EnemySpotted;
     409          Exit;
     410        end;
    410411      end;
    411       if (Movement = 0) and (ServerVersion[p] >= $0100F1) or
     412      if (Movement = 0) and (ServerVersion[P] >= $0100F1) or
    412413        (MoveInfo.Cost > Movement) then
    413414        if (Master >= 0) or (MoveInfo.ToMaster >= 0) then
    414415        begin
    415           result := eNoTime_Load;
    416           exit
     416          Result := eNoTime_Load;
     417          Exit;
    417418        end
    418419        else
    419420        begin
    420           result := eNoTime_Move;
    421           exit
     421          Result := eNoTime_Move;
     422          Exit;
    422423        end;
    423424      if (MoveInfo.EndHealth <= 0) or (MoveInfo.MoveType = mtSpyMission) then
    424         result := result or rUnitRemoved;
     425        Result := Result or rUnitRemoved;
    425426      // spy mission or victim of HostileDamage
    426427
     
    433434      MoveInfo.Defender := RealMap[ToLoc] shr 27;
    434435      SearchCity(ToLoc, MoveInfo.Defender, MoveInfo.Dcix);
    435     end
    436   end
    437 end; // CalculateMove
    438 
    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;
     438end;
     439
     440function GetBattleForecast(Loc: Integer; var BattleForecast: TBattleForecast;
     441  var Duix, Dcix, AStr, DStr, ABaseDamage, DBaseDamage: Integer): Integer;
     442var
     443  Time, Defender, ABon, DBon, DCnt, MultiDamage: Integer;
    443444  PModel, DModel: ^TModel;
    444445begin
     
    448449    if (Defender < 0) or (Defender = pAtt) then
    449450    begin
    450       result := eOK;
    451       exit
     451      Result := eOK;
     452      Exit;
    452453    end; // no attack, simple move
    453454
     
    458459      EndHealthAtt := HealthAtt;
    459460      EndHealthDef := RW[Defender].Un[Duix].Health;
    460       result := eOK;
    461       exit
     461      Result := eOK;
     462      Exit;
    462463    end;
    463464
     
    469470        (ObserveLevel[Loc] shr (2 * pAtt) and 3 < lObserveAll) then
    470471      begin
    471         result := eHiddenUnit;
    472         exit;
     472        Result := eHiddenUnit;
     473        Exit;
    473474      end; // attacking submarine not allowed
    474475      if (DModel.Cap[mcStealth] > 0) and
    475476        (ObserveLevel[Loc] shr (2 * pAtt) and 3 <> lObserveSuper) then
    476477      begin
    477         result := eStealthUnit;
    478         exit;
     478        Result := eStealthUnit;
     479        Exit;
    479480      end; // attacking stealth aircraft not allowed
    480481      if (DModel.Domain = dAir) and (DModel.Kind <> mkSpecial_Glider) and
    481482        (PModel.Domain <> dAir) then
    482483      begin
    483         result := eDomainMismatch;
    484         exit
     484        Result := eDomainMismatch;
     485        Exit;
    485486      end; // can't attack plane
    486487    end;
     
    491492      (PModel.Domain = dSea) and (RealMap[Loc] and fTerrain >= fGrass)) then
    492493    begin
    493       result := eDomainMismatch;
    494       exit
     494      Result := eDomainMismatch;
     495      Exit;
    495496    end;
    496497    if (PModel.Attack = 0) and not((PModel.Cap[mcBombs] > 0) and
    497498      (FlagsAtt and unBombsLoaded <> 0) and (DModel.Domain < dAir)) then
    498499    begin
    499       result := eInvalid;
    500       exit
     500      Result := eInvalid;
     501      Exit;
    501502    end;
    502503
    503504    if Movement = 0 then
    504505    begin
    505       result := eNoTime_Attack;
    506       exit
    507     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}
    510511    if RW[pAtt].Treaty[Defender] >= trPeace then
    511512    begin
    512513      if (PModel.Domain <> dAir) and (PModel.Attack > 0) and
    513         (integer(RealMap[Loc] shr 27) = pAtt) then
     514        (Integer(RealMap[Loc] shr 27) = pAtt) then
    514515        if Movement >= 100 then
    515516        begin // expel friendly unit
    516517          EndHealthDef := RW[Defender].Un[Duix].Health;
    517518          EndHealthAtt := HealthAtt;
    518           result := eExpelled
     519          Result := eExpelled
    519520        end
    520521        else
    521           result := eNoTime_Expel
     522          Result := eNoTime_Expel
    522523      else
    523         result := eTreaty;
    524       exit;
     524        Result := eTreaty;
     525      Exit;
    525526    end;
    526527
     
    533534        (Continent[RW[Defender].City[Dcix].Loc] = GrWallContinent[Defender]))
    534535      then
    535         inc(DBon, 8)
     536        Inc(DBon, 8)
    536537      else if (PModel.Domain = dSea) and
    537538        (RW[Defender].City[Dcix].Built[imCoastalFort] = 1) then
    538         inc(DBon, 4)
     539        Inc(DBon, 4)
    539540      else if (PModel.Domain = dAir) and
    540541        (RW[Defender].City[Dcix].Built[imMissileBat] = 1) then
    541         inc(DBon, 4);
     542        Inc(DBon, 4);
    542543      if RW[Defender].City[Dcix].Built[imBunker] = 1 then
    543         inc(DBon, 4)
     544        Inc(DBon, 4)
    544545    end;
    545546    if (PModel.Domain = dAir) and (DModel.Cap[mcAirDef] > 0) then
    546       inc(DBon, 4);
     547      Inc(DBon, 4);
    547548    DStr := DModel.Defense * DBon * 100;
    548549    if (DModel.Domain = dAir) and ((RealMap[Loc] and fCity <> 0) or
     
    577578        DBaseDamage := 1;
    578579      if DBaseDamage > RW[Defender].Un[Duix].Health then
    579         DBaseDamage := RW[Defender].Un[Duix].Health
     580        DBaseDamage := RW[Defender].Un[Duix].Health;
    580581    end;
    581582
     
    589590        ABaseDamage := 1;
    590591      if ABaseDamage > HealthAtt then
    591         ABaseDamage := HealthAtt
     592        ABaseDamage := HealthAtt;
    592593    end;
    593594
     
    621622
    622623    if EndHealthDef > 0 then
    623       result := eLost
     624      Result := eLost
    624625    else if EndHealthAtt > 0 then
    625       result := eWon
     626      Result := eWon
    626627    else
    627       result := eBloody
    628   end
    629 end; // GetBattleForecast
    630 
    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] do
    637   begin
    638     d := RW[p].Model[mix].Domain;
    639     if (Master >= 0) or (d = dSea) or
    640       (RW[p].Model[mix].Cap[mcAirTrans] + RW[p].Model[mix].Cap[mcOver] > 0) then
    641       result := eViolation
     628      Result := eBloody;
     629  end;
     630end;
     631
     632function LoadUnit(P, uix: Integer; TestOnly: Boolean): Integer;
     633var
     634  uix1, D, Cost, ToMaster: Integer;
     635begin
     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
    642643    else
    643644    begin
    644645      ToMaster := -1;
    645       for uix1 := 0 to RW[p].nUn - 1 do
    646         if RW[p].Un[uix1].Loc = Loc then
    647           with RW[p].Un[uix1], RW[p].Model[mix] do
    648             if (d < dSea) and
     646      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
    649650              (TroopLoad < MTrans * (Cap[mcSeaTrans] + Cap[mcAirTrans])) or
    650               (d = dAir) and (AirLoad < MTrans * Cap[mcCarrier]) then
     651              (D = dAir) and (AirLoad < MTrans * Cap[mcCarrier]) then
    651652            begin { load onto unit uix1 }
    652653              if (uixSelectedTransport < 0) or (uix1 = uixSelectedTransport)
     
    654655              begin
    655656                ToMaster := uix1;
    656                 Break
     657                Break;
    657658              end
    658659              else if ToMaster < 0 then
     
    660661            end;
    661662      if ToMaster < 0 then
    662         result := eNoLoadCapacity
     663        Result := eNoLoadCapacity
    663664      else
    664665      begin
    665         if d = dAir then
     666        if D = dAir then
    666667          Cost := 100
    667668        else
    668           Cost := RW[p].Model[mix].Speed;
     669          Cost := RW[P].Model[mix].Speed;
    669670        if Movement < Cost then
    670           result := eNoTime_Load
     671          Result := eNoTime_Load
    671672        else if not TestOnly then
    672673        begin
    673           FreeUnit(p, uix);
    674           dec(Movement, Cost);
    675           if d = dAir then
    676             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)
    677678          else
    678             inc(RW[p].Un[ToMaster].TroopLoad);
     679            Inc(RW[P].Un[ToMaster].TroopLoad);
    679680          Master := ToMaster;
    680681          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] do
     682        end;
     683      end;
     684    end;
     685  end;
     686end;
     687
     688function UnloadUnit(P, uix: Integer; TestOnly: Boolean): Integer;
     689var
     690  Cost: Integer;
     691begin
     692  Result := eOK;
     693  with RW[P].Un[uix] do
    693694    if Master < 0 then
    694       result := eNotChanged
    695     else if (RW[p].Model[mix].Domain < dSea) and
     695      Result := eNotChanged
     696    else if (RW[P].Model[mix].Domain < dSea) and
    696697      (RealMap[Loc] and fTerrain < fGrass) then
    697       result := eDomainMismatch
     698      Result := eDomainMismatch
    698699      // else if (RW[p].Model[mix].Domain<dSea)
    699700      // and (RW[p].Model[mix].Flags and mdCivil<>0)
     
    701702    else
    702703    begin
    703       if RW[p].Model[mix].Domain = dAir then
     704      if RW[P].Model[mix].Domain = dAir then
    704705        Cost := 100
    705706      else
    706         Cost := RW[p].Model[mix].Speed;
     707        Cost := RW[P].Model[mix].Speed;
    707708      if Movement < Cost then
    708         result := eNoTime_Load
     709        Result := eNoTime_Load
    709710      else if not TestOnly then
    710711      begin
    711         dec(Movement, Cost);
    712         if RW[p].Model[mix].Domain = dAir then
    713           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);
    717718          // Movement:=0 // no more movement after unload
    718719        end;
    719720        Master := -1;
    720         PlaceUnit(p, uix);
     721        PlaceUnit(P, uix);
    721722        UpdateUnitMap(Loc);
    722723      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] do
     724    end;
     725end;
     726
     727procedure Recover(P, uix: Integer);
     728var
     729  cix, Recovery: Integer;
     730begin
     731  with RW[P], Un[uix] do
    731732  begin
    732733    if (Master >= 0) and (Model[Un[Master].mix].Cap[mcSupplyShip] > 0) then
     
    738739      cix := nCity - 1;
    739740      while (cix >= 0) and (City[cix].Loc <> Loc) do
    740         dec(cix);
     741        Dec(cix);
    741742      if City[cix].Flags and chDisorder <> 0 then
    742743        Recovery := NoCityRecovery
     
    761762    if Recovery > 100 - Health then
    762763      Recovery := 100 - Health;
    763     inc(Health, Recovery);
     764    Inc(Health, Recovery);
    764765  end;
    765766end;
    766767
    767 function GetMoveAdvice(p, uix: integer; var a: TMoveAdviceData): integer;
     768function GetMoveAdvice(P, uix: Integer; var A: TMoveAdviceData): Integer;
    768769const
    769770  // domains
     
    777778  gmaAlpine = 8;
    778779var
    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,
    780781    MoveInfo, HeavyCost, RailCost, MoveCost, AddDamage, MaxDamage,
    781     MovementLeft: integer;
     782    MovementLeft: Integer;
    782783  Map: ^TTileList;
    783784  Q: TIPQ;
    784785  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;
    789790  // tt,tt0: int64;
    790791begin
    791792  // QueryPerformanceCounter(tt0);
    792793
    793   MaxDamage := RW[p].Un[uix].Health - 1;
    794   if MaxDamage > a.MaxHostile_MovementLeft then
    795     if a.MaxHostile_MovementLeft >= 0 then
    796       MaxDamage := a.MaxHostile_MovementLeft
     794  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
    797798    else
    798799      MaxDamage := 0;
    799800
    800   Map := @(RW[p].Map^);
    801   if (a.ToLoc <> maNextCity) and ((a.ToLoc < 0) or (a.ToLoc >= MapSize)) then
    802   begin
    803     result := eInvalid;
    804     exit
     801  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;
    805806  end;
    806   if (a.ToLoc <> maNextCity) and (Map[a.ToLoc] and fTerrain = fUNKNOWN) then
    807   begin
    808     result := eNoWay;
    809     exit
     807  if (A.ToLoc <> maNextCity) and (Map[A.ToLoc] and fTerrain = fUNKNOWN) then
     808  begin
     809    Result := eNoWay;
     810    Exit;
    810811  end;
    811812
    812   with RW[p].Model[RW[p].Un[uix].mix] do
     813  with RW[P].Model[RW[P].Un[uix].mix] do
    813814    case Domain of
    814815      dGround:
    815         if (a.ToLoc <> maNextCity) and (Map[a.ToLoc] and fTerrain = fOcean) then
    816         begin
    817           result := eDomainMismatch;
    818           exit
     816        if (A.ToLoc <> maNextCity) and (Map[A.ToLoc] and fTerrain = fOcean) then
     817        begin
     818          Result := eDomainMismatch;
     819          Exit;
    819820        end
    820821        else
     
    825826            MoveInfo := gmaGround_NoZoC;
    826827          if Cap[mcOver] > 0 then
    827             inc(MoveInfo, gmaOver);
     828            Inc(MoveInfo, gmaOver);
    828829          if Cap[mcAlpine] > 0 then
    829             inc(MoveInfo, gmaAlpine);
     830            Inc(MoveInfo, gmaAlpine);
    830831          HeavyCost := 50 + (Speed - 150) * 13 shr 7;
    831           if GWonder[woShinkansen].EffectiveOwner = p then
     832          if GWonder[woShinkansen].EffectiveOwner = P then
    832833            RailCost := 0
    833834          else
     
    835836          maxmov := Speed;
    836837          initmov := 0;
    837           Resistant := (GWonder[woGardens].EffectiveOwner = p) or
     838          Resistant := (GWonder[woGardens].EffectiveOwner = P) or
    838839            (Kind = mkSettler) and (Speed >= 200);
    839840        end;
    840841      dSea:
    841         if (a.ToLoc <> maNextCity) and (Map[a.ToLoc] and fTerrain >= fGrass) and
    842           (Map[a.ToLoc] and (fCity or fUnit or fCanal) = 0) then
    843         begin
    844           result := eDomainMismatch;
    845           exit
     842        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;
    846847        end
    847848        else
     
    849850          MoveInfo := gmaSea;
    850851          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);
    855856        end;
    856857      dAir:
     
    859860          maxmov := Speed;
    860861          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;
    865866  FillChar(Time, SizeOf(Time), 255); { -1 }
    866867  Damage[FromLoc] := 0;
    867868  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);
    869870  while Q.Get(Loc, T) do
    870871  begin
    871872    Time[Loc] := T;
    872     if T >= (a.MoreTurns + 1) shl 20 then
     873    if T >= (A.MoreTurns + 1) shl 20 then
    873874    begin
    874875      Loc := -1;
    875       Break
     876      Break;
    876877    end;
    877878    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)
    879880    then
    880881      Break;
    881882    if T and $FFF00 = $FFF00 then
    882       inc(T, $100000); // indicates mountain delay
     883      Inc(T, $100000); // indicates mountain delay
    883884    V8_to_Loc(Loc, Adjacent);
    884885    for V8 := 0 to 7 do
     
    888889      begin
    889890        ToTile := Map[Loc1];
    890         if (Loc1 = a.ToLoc) and (ToTile and (fUnit or fOwned) = fUnit) and
     891        if (Loc1 = A.ToLoc) and (ToTile and (fUnit or fOwned) = fUnit) and
    891892          not((MoveInfo and 3 = gmaSea) and (FromTile and fTerrain >= fGrass))
    892893          and not((MoveInfo and 3 = gmaAir) and ((FromTile and fCity <> 0) or
     
    897898        end
    898899        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))
    900901        // 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))
    902903        // way is blocked
    903904          and (ToTile and not FromTile and fPeace = 0) and
     
    909910          // calculate move cost, must be identic to GetMoveCost function
    910911          AddDamage := 0;
    911           MountainDelay := false;
     912          MountainDelay := False;
    912913          case MoveInfo of
    913914
     
    955956                    begin
    956957                      MoveCost := maxmov;
    957                       MountainDelay := true;
     958                      MountainDelay := True;
    958959                    end;
    959960                end;
     
    989990          if (MoveCost > 0) and not MountainDelay then
    990991            if V8 and 1 <> 0 then
    991               inc(MoveCost, MoveCost * 2)
     992              Inc(MoveCost, MoveCost * 2)
    992993            else
    993               inc(MoveCost, MoveCost);
     994              Inc(MoveCost, MoveCost);
    994995
    995996          if (MoveInfo and 2 <> 0) // ground unit, check transport load/unload
     
    10101011                if FromTile and (fTerrain or fCity or fRiver or fCanal or
    10111012                  fSpecial1 { Oasis } ) = fDesert then
    1012                   inc(AddDamage, (DesertThurst * (maxmov - T shr 8 and $FFF) -
     1013                  Inc(AddDamage, (DesertThurst * (maxmov - T shr 8 and $FFF) -
    10131014                    1) div maxmov + 1)
    10141015                else if FromTile and (fTerrain or fCity or fRiver or fCanal) = fArctic
    10151016                then
    1016                   inc(AddDamage, (ArcticThurst * (maxmov - T shr 8 and $FFF) -
     1017                  Inc(AddDamage, (ArcticThurst * (maxmov - T shr 8 and $FFF) -
    10171018                    1) div maxmov + 1);
    10181019
     
    10291030                From[Loc1] := Loc;
    10301031                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;
    10361037  end;
    10371038  FreeAndNil(Q);
    1038   if (Loc = a.ToLoc) or (a.ToLoc = maNextCity) and (Loc >= 0) and
     1039  if (Loc = A.ToLoc) or (A.ToLoc = maNextCity) and (Loc >= 0) and
    10391040    (Map[Loc] and fCity <> 0) then
    10401041  begin
    1041     a.MoreTurns := T shr 20;
     1042    A.MoreTurns := T shr 20;
    10421043    EndLoc := Loc;
    1043     a.nStep := 0;
     1044    A.nStep := 0;
    10441045    while Loc <> FromLoc do
    10451046    begin
    10461047      if Time[Loc] < $100000 then
    1047         inc(a.nStep);
     1048        Inc(A.nStep);
    10481049      Loc := From[Loc];
    10491050    end;
    10501051    Loc := EndLoc;
    1051     i := a.nStep;
     1052    I := A.nStep;
    10521053    while Loc <> FromLoc do
    10531054    begin
    10541055      if Time[Loc] < $100000 then
    10551056      begin
    1056         dec(i);
    1057         if i < 25 then
    1058         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) -
    10601061            (From[Loc] mod lx * 2 + From[Loc] div lx and 1) + 3 * lx)
    10611062            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;
    10631064        end
    10641065      end;
    10651066      Loc := From[Loc];
    10661067    end;
    1067     a.MaxHostile_MovementLeft := maxmov - Time[EndLoc] shr 8 and $FFF;
    1068     if a.nStep > 25 then
    1069       a.nStep := 25;
    1070     result := eOK
     1068    A.MaxHostile_MovementLeft := maxmov - Time[EndLoc] shr 8 and $FFF;
     1069    if A.nStep > 25 then
     1070      A.nStep := 25;
     1071    Result := eOK
    10711072  end
    10721073  else
    1073     result := eNoWay;
     1074    Result := eNoWay;
    10741075
    10751076  // QueryPerformanceCounter(tt);{time in s is: (tt-tt0)/PerfFreq}
    1076 end; // GetMoveAdvice
    1077 
    1078 function CanPlaneReturn(p, uix: integer;
    1079   PlaneReturnData: TPlaneReturnData): boolean;
     1077end;
     1078
     1079function CanPlaneReturn(P, uix: Integer;
     1080  PlaneReturnData: TPlaneReturnData): Boolean;
    10801081const
    10811082  mfEnd = 1;
    10821083  mfReached = 2;
    10831084var
    1084   uix1, T, T1, Loc, Loc1, FromTile, ToTile, V8, MoveCost, maxmov: integer;
     1085  uix1, T, T1, Loc, Loc1, FromTile, ToTile, V8, MoveCost, maxmov: Integer;
    10851086  Map: ^TTileList;
    10861087  Q: TIPQ;
    10871088  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;
     1090begin
     1091  Map := @(RW[P].Map^);
    10911092
    10921093  // calculate possible return points
    10931094  FillChar(MapFlags, SizeOf(MapFlags), 0);
    1094   if RW[p].Model[RW[p].Un[uix].mix].Kind = mkSpecial_Glider then
     1095  if RW[P].Model[RW[P].Un[uix].mix].Kind = mkSpecial_Glider then
    10951096  begin
    10961097    for Loc := 0 to MapSize - 1 do
     
    11051106        (Map[Loc] and (fUnit or fOwned) <> fUnit) then
    11061107        MapFlags[Loc] := MapFlags[Loc] or mfEnd;
    1107     if RW[p].Model[RW[p].Un[uix].mix].Cap[mcAirTrans] = 0 then
     1108    if RW[P].Model[RW[P].Un[uix].mix].Cap[mcAirTrans] = 0 then
    11081109    // plane can land on carriers
    1109       for uix1 := 0 to RW[p].nUn - 1 do
    1110         with RW[p].Un[uix1], RW[p].Model[mix] do
     1110      for uix1 := 0 to RW[P].nUn - 1 do
     1111        with RW[P].Un[uix1], RW[P].Model[mix] do
    11111112          if AirLoad < MTrans * Cap[mcCarrier] then
    11121113            MapFlags[Loc] := MapFlags[Loc] or mfEnd;
    11131114  end;
    11141115
    1115   with RW[p].Un[uix] do
     1116  with RW[P].Un[uix] do
    11161117  begin
    11171118    if Master >= 0 then // can return to same carrier, even if full now
    11181119      MapFlags[Loc] := MapFlags[Loc] or mfEnd;
    1119     maxmov := RW[p].Model[mix].Speed;
     1120    maxmov := RW[P].Model[mix].Speed;
    11201121  end;
    11211122
    1122   result := false;
     1123  Result := False;
    11231124  Q := TIPQ.Create(MapSize);
    11241125  Q.Put(PlaneReturnData.Loc, (maxmov - PlaneReturnData.Movement) shl 8);
     
    11281129    if T >= (PlaneReturnData.Fuel + 1) shl 20 then
    11291130    begin
    1130       result := false;
    1131       Break
     1131      Result := False;
     1132      Break;
    11321133    end;
    11331134    if MapFlags[Loc] and mfEnd <> 0 then
    11341135    begin
    1135       result := true;
    1136       Break
     1136      Result := True;
     1137      Break;
    11371138    end;
    11381139    FromTile := Map[Loc];
     
    11611162            T1 := T + MoveCost shl 8;
    11621163          Q.Put(Loc1, T1);
    1163         end
    1164       end
    1165     end
     1164        end;
     1165      end;
     1166    end;
    11661167  end;
    11671168  FreeAndNil(Q);
    1168 end; // CanPlaneReturn
     1169end;
    11691170
    11701171{
     
    11721173  ____________________________________________________________________
    11731174}
    1174 function CalculateJobWork(p, Loc, Job: integer; var JobWork: integer): integer;
    1175 var
    1176   TerrType: integer;
    1177 begin
    1178   result := eOK;
     1175function CalculateJobWork(P, Loc, Job: Integer; var JobWork: Integer): Integer;
     1176var
     1177  TerrType: Integer;
     1178begin
     1179  Result := eOK;
    11791180  TerrType := RealMap[Loc] and fTerrain;
    11801181  with Terrain[TerrType] do
     
    11821183      jCity:
    11831184        if RealMap[Loc] and fCity <> 0 then
    1184           result := eInvalid
     1185          Result := eInvalid
    11851186        else if IrrEff = 0 then
    1186           result := eNoCityTerrain
     1187          Result := eNoCityTerrain
    11871188        else
    11881189          JobWork := CityWork;
     
    11921193          JobWork := MoveCost * RoadWork;
    11931194          if RealMap[Loc] and fRiver <> 0 then
    1194             if RW[p].Tech[adBridgeBuilding] >= tsApplicable then
    1195               inc(JobWork, RoadBridgeWork) { across river }
     1195            if RW[P].Tech[adBridgeBuilding] >= tsApplicable then
     1196              Inc(JobWork, RoadBridgeWork) { across river }
    11961197            else
    1197               result := eNoBridgeBuilding
     1198              Result := eNoBridgeBuilding;
    11981199        end
    11991200        else
    1200           result := eInvalid;
     1201          Result := eInvalid;
    12011202      jRR:
    12021203        if RealMap[Loc] and fRoad = 0 then
    1203           result := eNoPreq
     1204          Result := eNoPreq
    12041205        else if RealMap[Loc] and fRR <> 0 then
    1205           result := eInvalid
     1206          Result := eInvalid
    12061207        else
    12071208        begin
    12081209          JobWork := MoveCost * RRWork;
    12091210          if RealMap[Loc] and fRiver <> 0 then
    1210             inc(JobWork, RRBridgeWork); { across river }
     1211            Inc(JobWork, RRBridgeWork); { across river }
    12111212        end;
    12121213      jClear:
    1213         if (TerrType = fDesert) and (GWonder[woGardens].EffectiveOwner <> p)
     1214        if (TerrType = fDesert) and (GWonder[woGardens].EffectiveOwner <> P)
    12141215        then
    1215           result := eInvalid
     1216          Result := eInvalid
    12161217        else if ClearTerrain >= 0 then
    12171218          JobWork := IrrClearWork
    12181219        else
    1219           result := eInvalid;
     1220          Result := eInvalid;
    12201221      jIrr:
    12211222        begin
     
    12231224          if (IrrEff = 0) or (RealMap[Loc] and fTerImp = tiIrrigation) or
    12241225            (RealMap[Loc] and fTerImp = tiFarm) then
    1225             result := eInvalid
     1226            Result := eInvalid;
    12261227        end;
    12271228      jFarm:
    12281229        if RealMap[Loc] and fTerImp <> tiIrrigation then
    1229           result := eNoPreq
     1230          Result := eNoPreq
    12301231        else
    12311232        begin
    12321233          JobWork := IrrClearWork * FarmWork;
    12331234          if (JobWork <= 0) or (RealMap[Loc] and fTerImp = tiFarm) then
    1234             result := eInvalid
     1235            Result := eInvalid;
    12351236        end;
    12361237      jAfforest:
     
    12381239          JobWork := MineAfforestWork
    12391240        else
    1240           result := eInvalid;
     1241          Result := eInvalid;
    12411242      jMine:
    12421243        begin
    12431244          JobWork := MineAfforestWork;
    12441245          if (MineEff = 0) or (RealMap[Loc] and fTerImp = tiMine) then
    1245             result := eInvalid
     1246            Result := eInvalid;
    12461247        end;
    12471248      jFort:
     
    12491250          JobWork := MoveCost * FortWork
    12501251        else
    1251           result := eInvalid;
     1252          Result := eInvalid;
    12521253      jCanal:
    12531254        if (RealMap[Loc] and fCanal = 0) and (TerrType in TerrType_Canalable)
     
    12551256          JobWork := CanalWork
    12561257        else
    1257           result := eInvalid;
     1258          Result := eInvalid;
    12581259      jTrans:
    12591260        begin
    12601261          JobWork := TransWork;
    12611262          if JobWork <= 0 then
    1262             result := eInvalid
     1263            Result := eInvalid;
    12631264        end;
    12641265      jPoll:
     
    12661267          JobWork := PollWork
    12671268        else
    1268           result := eInvalid;
     1269          Result := eInvalid;
    12691270      jBase:
    12701271        if RealMap[Loc] and fTerImp <> tiBase then
    12711272          JobWork := MoveCost * BaseWork
    12721273        else
    1273           result := eInvalid;
     1274          Result := eInvalid;
    12741275      jPillage:
    12751276        if RealMap[Loc] and (fRoad or fRR or fCanal or fTerImp) <> 0 then
    12761277          JobWork := PillageWork
    12771278        else
    1278           result := eInvalid;
    1279     end;
    1280 end; // CalculateJobWork
    1281 
    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 p and InvalidTreatyMap = 0); {$ENDIF}
    1287   result := eOK;
    1288   with RW[p].Un[uix] do
     1279          Result := eInvalid;
     1280    end;
     1281end;
     1282
     1283function StartJob(P, uix, NewJob: Integer; TestOnly: Boolean): Integer;
     1284var
     1285  JobWork, Loc0, p1, uix1, TerrType: Integer;
     1286begin
     1287{$IFOPT O-}Assert(1 shl P and InvalidTreatyMap = 0); {$ENDIF}
     1288  Result := eOK;
     1289  with RW[P].Un[uix] do
    12891290  begin
    12901291    if NewJob = Job then
    12911292    begin
    1292       result := eNotChanged;
    1293       exit
     1293      Result := eNotChanged;
     1294      Exit;
    12941295    end;
    12951296    if NewJob = jNone then
     
    12971298      if not TestOnly then
    12981299        Job := jNone;
    1299       exit
     1300      Exit;
    13001301    end;
    13011302    Loc0 := Loc;
     
    13031304      (NewJob <> jRR) then
    13041305    begin
    1305       result := eDeadLands;
    1306       exit
     1306      Result := eDeadLands;
     1307      Exit;
    13071308    end;
    13081309    TerrType := RealMap[Loc0] and fTerrain;
    13091310    if (RealMap[Loc0] and fCity <> 0) or (TerrType < fGrass) or (Master >= 0) or
    1310       not((NewJob = jPillage) and (RW[p].Model[mix].Domain = dGround) or
    1311       (RW[p].Model[mix].Kind = mkSettler) or (NewJob <> jCity) and
    1312       (RW[p].Model[mix].Kind = mkSlaves) and (GWonder[woPyramids].EffectiveOwner
     1311      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
    13131314      >= 0)) then
    13141315    begin
    1315       result := eInvalid;
    1316       exit
     1316      Result := eInvalid;
     1317      Exit;
    13171318    end;
    13181319    if (JobPreq[NewJob] <> preNone) and
    1319       (RW[p].Tech[JobPreq[NewJob]] < tsApplicable) then
    1320     begin
    1321       result := eNoPreq;
    1322       exit
    1323     end;
    1324 
    1325     result := CalculateJobWork(p, Loc0, NewJob, JobWork);
    1326     if (Mode = moPlaying) and (result = eOK) and (NewJob <> jPoll) then
     1320      (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
    13271328    begin // not allowed in territory of friendly nation
    13281329      p1 := RealMap[Loc0] shr 27; // owner of territory
    1329       if (p1 < nPl) and (p1 <> p) and (RW[p].Treaty[p1] >= trPeace) then
    1330         result := eTreaty; // keep peace treaty!
    1331     end;
    1332     if TestOnly or (result < rExecuted) then
    1333       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;
    13341335
    13351336    if (ToWork[Loc0, NewJob] = 0) or (ToWork[Loc0, NewJob] > JobWork) then
     
    13371338    Job := NewJob;
    13381339    Flags := Flags and not unFortified;
    1339     for uix1 := 0 to RW[p].nUn - 1 do
    1340       if (RW[p].Un[uix1].Loc = Loc) and
    1341         (RW[p].Un[uix1].Job in ContraJobs[NewJob]) then
    1342         RW[p].Un[uix1].Job := jNone; // stop contradictive jobs
    1343     if ServerVersion[p] < $000EF0 then
    1344       if Work(p, uix) then
    1345         result := eJobDone;
    1346     if (NewJob = jCity) and (result = eJobDone) then
    1347     begin
    1348       RemoveUnit_UpdateMap(p, uix);
    1349       result := eCity
     1340    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;
    13501351    end
    13511352    else if Health <= 0 then
    13521353    begin // victim of HostileDamage
    1353       RemoveUnit_UpdateMap(p, uix);
    1354       result := result or rUnitRemoved;
     1354      RemoveUnit_UpdateMap(P, uix);
     1355      Result := Result or rUnitRemoved;
    13551356    end;
    13561357    if Mode > moLoading_Fast then
    13571358    begin
    1358       if result = eCity then
    1359       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);
    13621363        // CheckContact;
    1363       end
    1364     end
    1365   end; // with
    1366 end; // StartJob
    1367 
    1368 function Work(p, uix: integer): boolean;
    1369 var
    1370   uix1, j0: integer;
    1371 begin
    1372   result := false;
    1373   with RW[p].Un[uix] do
     1364      end;
     1365    end;
     1366  end;
     1367end;
     1368
     1369function Work(P, uix: Integer): Boolean;
     1370var
     1371  uix1, j0: Integer;
     1372begin
     1373  Result := False;
     1374  with RW[P].Un[uix] do
    13741375    if Movement >= 100 then
    13751376    begin
    1376       assert(ToWork[Loc, Job] < $FFFF); // should have been set by StartJob
     1377      Assert(ToWork[Loc, Job] < $FFFF); // should have been set by StartJob
    13771378      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;
    13811382          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]);
    13841385          if not(Job in [jCity, jPillage, jPoll]) then
    1385             inc(Worked[p], ToWork[Loc, Job]);
     1386            Inc(Worked[P], ToWork[Loc, Job]);
    13861387          if Job = jCity then
    13871388          begin // found new city
    1388             FoundCity(p, Loc);
    1389             inc(Founded[p]);
    1390             with RW[p].City[RW[p].nCity - 1] do
     1389            FoundCity(P, Loc);
     1390            Inc(Founded[P]);
     1391            with RW[P].City[RW[P].nCity - 1] do
    13911392            begin
    1392               ID := p shl 12 + Founded[p] - 1;
     1393              ID := P shl 12 + Founded[P] - 1;
    13931394              Flags := chFounded;
    13941395            end;
    13951396            if Mode = moPlaying then
    13961397            begin
    1397               LogCheckBorders(p, RW[p].nCity - 1);
    1398               RecalcPeaceMap(p);
     1398              LogCheckBorders(P, RW[P].nCity - 1);
     1399              RecalcPeaceMap(P);
    13991400            end;
    14001401{$IFOPT O-} if Mode < moPlaying then
    1401               InvalidTreatyMap := not(1 shl p); {$ENDIF}
     1402              InvalidTreatyMap := not(1 shl P); {$ENDIF}
    14021403            // territory should not be considered for the rest of the command
    14031404            // execution, because during loading a game it's incorrect before
    14041405            // subsequent sIntExpandTerritory is processed
    1405             RW[p].Un[uix].Health := 0; // causes unit to be removed later
     1406            RW[P].Un[uix].Health := 0; // causes unit to be removed later
    14061407          end
    14071408          else
    1408             CompleteJob(p, Loc, Job);
     1409            CompleteJob(P, Loc, Job);
    14091410          ToWork[Loc, Job] := 0;
    14101411          j0 := Job;
    1411           for uix1 := 0 to RW[p].nUn - 1 do
    1412             if (RW[p].Un[uix1].Loc = Loc) and (RW[p].Un[uix1].Job = j0) then
    1413               RW[p].Un[uix1].Job := jNone
     1412          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
    14141415        end
    14151416        else
    14161417        begin
    1417           dec(ToWork[Loc, Job], Movement);
     1418          Dec(ToWork[Loc, Job], Movement);
    14181419          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);
    14211422          Movement := 0;
    14221423        end
    14231424    end
    1424 end; // work
    1425 
    1426 function GetJobProgress(p, Loc: integer;
    1427   var JobProgressData: TJobProgressData): integer;
    1428 var
    1429   Job, JobResult, uix: integer;
     1425end;
     1426
     1427function GetJobProgress(P, Loc: Integer;
     1428  var JobProgressData: TJobProgressData): Integer;
     1429var
     1430  Job, JobResult, uix: Integer;
    14301431begin
    14311432  for Job := 0 to nJob - 1 do
    14321433  begin
    1433     JobResult := CalculateJobWork(p, Loc, Job, JobProgressData[Job].Required);
     1434    JobResult := CalculateJobWork(P, Loc, Job, JobProgressData[Job].Required);
    14341435    if JobResult = eOK then
    14351436    begin
     
    14381439      else
    14391440        JobProgressData[Job].Done := JobProgressData[Job].Required -
    1440           ToWork[Loc, Job]
     1441          ToWork[Loc, Job];
    14411442    end
    14421443    else
     
    14471448    JobProgressData[Job].NextTurnPlus := 0;
    14481449  end;
    1449   for uix := 0 to RW[p].nUn - 1 do
    1450     if (RW[p].Un[uix].Loc = Loc) and (RW[p].Un[uix].Movement >= 100) then
    1451       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;
    14541455end;
    14551456
  • branches/highdpi/readme.txt

    r405 r465  
    22===================
    33
    4 * Developed with: Lazarus 2.0.12 (https://www.lazarus-ide.org/)
     4* Developed with: Lazarus 2.2.0 (https://www.lazarus-ide.org/)
    55* Supported platforms: Windows and Linux
    66* Supported architectures: 32-bit and 64-bit x86
     
    2424* Home page: https://app.zdechov.net/c-evo/
    2525* Source code: https://svn.zdechov.net/c-evo/
    26 * Developed in [http://www.lazarus-ide.org/ Lazarus/FPC] 2.0.12
     26* Developed in [http://www.lazarus-ide.org/ Lazarus/FPC] 2.2.0
    2727* To build new Windows installer run Install/build.bat. InnoSetup (http://www.jrsoftware.org/isdl.php) needs to be installed).
    2828
Note: See TracChangeset for help on using the changeset viewer.