source: branches/AlphaChannel/AI Template/Project/Lib/CevoPedia.cs

Last change on this file was 191, checked in by chronos, 5 years ago
  • Added: AI Template directory with manual for development of custom AI from original game.
File size: 34.6 KB
Line 
1using System;
2using System.Collections.Generic;
3
4namespace CevoAILib
5{
6 enum MovementKind { Plain = 1, Difficult = 2, Mountains = 3 }
7
8 enum BuildingKind { CityImprovement, StateImprovement, Wonder, ColonyShipPart, None }
9
10 /// <summary>
11 /// game rules and tables to query from code
12 /// </summary>
13 static class Cevo
14 {
15 public static GovernmentInfo Pedia(Government government) { return GovernmentInfoList[(int)government]; }
16 public static TerrainInfo Pedia(Terrain terrain) { return new TerrainInfo(terrain); }
17 public static JobInfo Pedia(Job job, Terrain terrain) { return new JobInfo(job, terrain); }
18 public static AdvanceInfo Pedia(Advance advance) { return new AdvanceInfo(advance); }
19 public static BuildingInfo Pedia(Building building) { return BuildingInfoList[(int)building]; }
20
21 #region Miscellaneous
22 public const int MaxNumberOfNations = 15;
23 public const int MaxUnitsPerNation = 4096;
24 public const int MaxModelsPerNation = 256;
25 public const int MaxCitiesPerNation = 1024;
26 public const int MaxDifficulty = 3;
27 public const int TerritoryRadiusAroundCities = 9; // one tile counts 2 if straight, 3 if diagonal
28 public const Advance AdvanceForNewSpecialResources = Advance.Science;
29 public const Advance AdvanceForRareMetalResources = Advance.MassProduction;
30 public const int MaxFutureTech = 25; // maximum number of future techs of one kind except computing technology
31 public const int MaxFutureTech_Computing = 100; // maximum number of computing technology future techs
32 public static readonly ColonyShipParts CompleteColonyShip = new ColonyShipParts(6, 4, 2);
33
34 public const int AnarchyTurns = 3;
35 public const int CaptureTurns = 3;
36 public const int CancelTreatyBufferTurns = 3;
37 public const int PeaceEvacuationTurns = 5;
38 public const int ColdWarTurns = 40;
39
40 // unit
41 public const int AttackCost = 100;
42 public const int MaxHealth = 100;
43 public const int ExperienceLevelCost = 50;
44 public const int RecoveryOutsideCity = 8;
45 public const int RecoveryInCity = 20; // for all types of recovery, note additional limiation: health is never more than doubled
46 public const int FastRecovery = 50;
47 public const int DamagePerTurnInDesert = 20;
48 public const int DamagePerTurnInArctic = 20;
49
50 // city
51 public const int MaxCitySizeBasic = 8;
52 public const int MaxCitySizeWithAqueduct = 12;
53 public const int MaxCitySizeWithSewerSystem = 30;
54 public const int BasicCityMorale = 4;
55 public const int PollutionCost = 240;
56 public static readonly int[] StorageSize = { 40, 30, 40, 50 }; // index is diffuculty level (0 is supervisor)
57 public const int UniversityFutureBonus = 5; // percent per tech
58 public const int ResearchLabFutureBonus = 10; // percent per tech
59 public const int FactoryFutureBonus = 5; // percent per tech
60 public const int MfgPlantFutureBonus = 10; // percent per tech
61
62 // diplomacy
63 public const int MaxPayment = 65535;
64 #endregion
65
66 #region Government
67 public struct GovernmentInfo
68 {
69 public int SettlerFoodSupport;
70 public int FreeSupport; // per city, in 1/2*city size
71 public Advance Prerequisite;
72 }
73
74 static readonly GovernmentInfo[] GovernmentInfoList =
75 {
76 new GovernmentInfo{SettlerFoodSupport = 1, FreeSupport = 2, Prerequisite = Advance.None},
77 new GovernmentInfo{SettlerFoodSupport = 1, FreeSupport = 2, Prerequisite = Advance.None},
78 new GovernmentInfo{SettlerFoodSupport = 1, FreeSupport = 1, Prerequisite = Advance.Monarchy},
79 new GovernmentInfo{SettlerFoodSupport = 2, FreeSupport = 0, Prerequisite = Advance.TheRepublic},
80 new GovernmentInfo{SettlerFoodSupport = 1, FreeSupport = 2, Prerequisite = Advance.Theology},
81 new GovernmentInfo{SettlerFoodSupport = 2, FreeSupport = 1, Prerequisite = Advance.Communism},
82 new GovernmentInfo{SettlerFoodSupport = 2, FreeSupport = 0, Prerequisite = Advance.Democracy},
83 new GovernmentInfo{SettlerFoodSupport = 2, FreeSupport = 0, Prerequisite = Advance.TheInternet}
84 };
85 #endregion
86
87 #region Terrain and Jobs
88 enum JobCost
89 {
90 RoadCost = 300, // *MovementKind
91 RailroadCost = 600, // *MovementKind
92 FarmlandCostMultiplier = 3, // *IrrigationCost
93 CanalCost = 1800,
94 FortressCost = 600, // *MovementKind
95 CleanUpCost = 1800,
96 BaseCost = 600, // *MovementKind
97 PillageCost = 100,
98 CityCost = 900
99 }
100
101 public struct BaseTerrainInfo
102 {
103 public MovementKind MovementKind;
104 public int DefenseBonus;
105 public Terrain ClearResult;
106 public int ClearCost;
107 public int IrrigationFoodGain;
108 public int IrrigationCost;
109 public Terrain AfforestResult;
110 public int AfforestCost;
111 public int MineMaterialGain;
112 public int MineCost;
113 public Terrain TransformationResult;
114 public int TransformationCost;
115 }
116
117 static readonly BaseTerrainInfo[] BaseTerrainInfoList =
118 {
119 new BaseTerrainInfo {MovementKind = MovementKind.Plain, DefenseBonus = 4, ClearResult = Terrain.Unknown, ClearCost = 0,
120 IrrigationFoodGain = 0, IrrigationCost = 0, AfforestResult = Terrain.Unknown, AfforestCost = 0,
121 MineMaterialGain = 0, MineCost = 0, TransformationResult = Terrain.Unknown, TransformationCost = 0}, // {-}
122 new BaseTerrainInfo {MovementKind = MovementKind.Plain, DefenseBonus = 4, ClearResult = Terrain.Unknown, ClearCost = 0,
123 IrrigationFoodGain = 0, IrrigationCost = 0, AfforestResult = Terrain.Unknown, AfforestCost = 0,
124 MineMaterialGain = 0, MineCost = 0, TransformationResult = Terrain.Unknown, TransformationCost = 0}, // {Ddl}
125 new BaseTerrainInfo {MovementKind = MovementKind.Plain, DefenseBonus = 4, ClearResult = Terrain.Unknown, ClearCost = 0,
126 IrrigationFoodGain = 0, IrrigationCost = 0, AfforestResult = Terrain.Unknown, AfforestCost = 0,
127 MineMaterialGain = 0, MineCost = 0, TransformationResult = Terrain.Unknown, TransformationCost = 0}, // {Ocn}
128 new BaseTerrainInfo {MovementKind = MovementKind.Plain, DefenseBonus = 4, ClearResult = Terrain.Unknown, ClearCost = 0,
129 IrrigationFoodGain = 0, IrrigationCost = 0, AfforestResult = Terrain.Unknown, AfforestCost = 0,
130 MineMaterialGain = 0, MineCost = 0, TransformationResult = Terrain.Unknown, TransformationCost = 0}, // {Sho}
131 new BaseTerrainInfo {MovementKind = MovementKind.Plain, DefenseBonus = 4, ClearResult = Terrain.Unknown, ClearCost = 0,
132 IrrigationFoodGain = 1, IrrigationCost = 600, AfforestResult = Terrain.Forest, AfforestCost = 1800,
133 MineMaterialGain = 0, MineCost = 0, TransformationResult = Terrain.Hills, TransformationCost = 3000}, // {Gra}
134 new BaseTerrainInfo {MovementKind = MovementKind.Plain, DefenseBonus = 4, ClearResult = Terrain.Grassland, ClearCost = 1800,
135 IrrigationFoodGain = 0, IrrigationCost = 0, AfforestResult = Terrain.Unknown, AfforestCost = 0,
136 MineMaterialGain = 1, MineCost = 600, TransformationResult = Terrain.Prairie, TransformationCost = 3000}, // {Dst}
137 new BaseTerrainInfo {MovementKind = MovementKind.Plain, DefenseBonus = 4, ClearResult = Terrain.Unknown, ClearCost = 0,
138 IrrigationFoodGain = 1, IrrigationCost = 600, AfforestResult = Terrain.Forest, AfforestCost = 2400,
139 MineMaterialGain = 0, MineCost = 0, TransformationResult = Terrain.Unknown, TransformationCost = 0}, // {Pra}
140 new BaseTerrainInfo {MovementKind = MovementKind.Plain, DefenseBonus = 4, ClearResult = Terrain.Unknown, ClearCost = 0,
141 IrrigationFoodGain = 1, IrrigationCost = 600, AfforestResult = Terrain.Unknown, AfforestCost = 0,
142 MineMaterialGain = 0, MineCost = 0, TransformationResult = Terrain.Grassland, TransformationCost = 3000}, // {Tun}
143 new BaseTerrainInfo {MovementKind = MovementKind.Difficult, DefenseBonus = 4, ClearResult = Terrain.Unknown, ClearCost = 0,
144 IrrigationFoodGain = 0, IrrigationCost = 0, AfforestResult = Terrain.Unknown, AfforestCost = 0,
145 MineMaterialGain = 3, MineCost = 1800, TransformationResult = Terrain.Unknown, TransformationCost = 0}, // {Arc}
146 new BaseTerrainInfo {MovementKind = MovementKind.Difficult, DefenseBonus = 6, ClearResult = Terrain.Grassland, ClearCost = 2400,
147 IrrigationFoodGain = 0, IrrigationCost = 0, AfforestResult = Terrain.Forest, AfforestCost = 2400,
148 MineMaterialGain = 0, MineCost = 0, TransformationResult = Terrain.Hills, TransformationCost = 3000}, // {Swa}
149 new BaseTerrainInfo {MovementKind = MovementKind.Plain, DefenseBonus = 4, ClearResult = Terrain.Unknown, ClearCost = 0,
150 IrrigationFoodGain = 1, IrrigationCost = 600, AfforestResult = Terrain.Forest, AfforestCost = 1800,
151 MineMaterialGain = 0, MineCost = 0, TransformationResult = Terrain.Hills, TransformationCost = 3000}, // {Gra}
152 new BaseTerrainInfo {MovementKind = MovementKind.Difficult, DefenseBonus = 6, ClearResult = Terrain.Prairie, ClearCost = 600,
153 IrrigationFoodGain = 0, IrrigationCost = 0, AfforestResult = Terrain.Unknown, AfforestCost = 0,
154 MineMaterialGain = 0, MineCost = 0, TransformationResult = Terrain.Unknown, TransformationCost = 0}, // {For}
155 new BaseTerrainInfo {MovementKind = MovementKind.Difficult, DefenseBonus = 8, ClearResult = Terrain.Unknown, ClearCost = 0,
156 IrrigationFoodGain = 1, IrrigationCost = 600, AfforestResult = Terrain.Unknown, AfforestCost = 0,
157 MineMaterialGain = 3, MineCost = 1200, TransformationResult = Terrain.Grassland, TransformationCost = 6000}, // {Hil}
158 new BaseTerrainInfo {MovementKind = MovementKind.Mountains, DefenseBonus = 12, ClearResult = Terrain.Unknown, ClearCost = 0,
159 IrrigationFoodGain = 0, IrrigationCost = 0, AfforestResult = Terrain.Unknown, AfforestCost = 0,
160 MineMaterialGain = 2, MineCost = 1200, TransformationResult = Terrain.Unknown, TransformationCost = 0} // {Mou}
161 };
162
163 static readonly BaseResourceSet[] TerrainResourcesList =
164 {
165 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
166 new BaseResourceSet{Food = 0, Material = 1, Trade = 1}, // {Dst}
167 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {Ocn}
168 new BaseResourceSet{Food = 1, Material = 0, Trade = 3}, // {Sho}
169 new BaseResourceSet{Food = 3, Material = 0, Trade = 1}, // {Gra}
170 new BaseResourceSet{Food = 0, Material = 1, Trade = 1}, // {Dst}
171 new BaseResourceSet{Food = 1, Material = 1, Trade = 1}, // {Pra}
172 new BaseResourceSet{Food = 1, Material = 0, Trade = 1}, // {Tun}
173 new BaseResourceSet{Food = 0, Material = 1, Trade = 0}, // {Arc}
174 new BaseResourceSet{Food = 1, Material = 0, Trade = 1}, // {Swa}
175 new BaseResourceSet{Food = 2, Material = 1, Trade = 1}, // {Gra1}
176 new BaseResourceSet{Food = 1, Material = 2, Trade = 1}, // {For}
177 new BaseResourceSet{Food = 1, Material = 0, Trade = 0}, // {Hil}
178 new BaseResourceSet{Food = 0, Material = 1, Trade = 0}, // {Mou}
179 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
180 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
181 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
182 new BaseResourceSet{Food = 0, Material = 1, Trade = 1}, // {Dst}
183 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
184 new BaseResourceSet{Food = 5, Material = 0, Trade = 3}, // {Sho1}
185 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
186 new BaseResourceSet{Food = 3, Material = 1, Trade = 1}, // {Dst1}
187 new BaseResourceSet{Food = 3, Material = 1, Trade = 1}, // {Pra1}
188 new BaseResourceSet{Food = 1, Material = 0, Trade = 6}, // {Tun1}
189 new BaseResourceSet{Food = 3, Material = 1, Trade = 4}, // {Arc1}
190 new BaseResourceSet{Food = 1, Material = 4, Trade = 1}, // {Swa1}
191 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
192 new BaseResourceSet{Food = 3, Material = 2, Trade = 1}, // {For1}
193 new BaseResourceSet{Food = 1, Material = 0, Trade = 4}, // {Hil1}
194 new BaseResourceSet{Food = 0, Material = 4, Trade = 0}, // {Mou1}
195 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
196 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
197 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
198 new BaseResourceSet{Food = 0, Material = 1, Trade = 1}, // {Dst}
199 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
200 new BaseResourceSet{Food = 1, Material = 5, Trade = 3}, // {Sho2}
201 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
202 new BaseResourceSet{Food = 0, Material = 4, Trade = 1}, // {Dst2}
203 new BaseResourceSet{Food = 1, Material = 3, Trade = 1}, // {Pra2}
204 new BaseResourceSet{Food = 1, Material = 4, Trade = 1}, // {Tun2}
205 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
206 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
207 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
208 new BaseResourceSet{Food = 1, Material = 2, Trade = 4}, // {For2}
209 new BaseResourceSet{Food = 1, Material = 2, Trade = 0}, // {Hil2}
210 new BaseResourceSet{Food = 0, Material = 1, Trade = 7}, // {Mou2}
211 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
212 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
213 new BaseResourceSet{Food = 0, Material = 0, Trade = 0}, // {-}
214 new BaseResourceSet{Food = 0, Material = 1, Trade = 1} // {Dst}
215 };
216
217 static readonly Advance[] JobPrerequisites =
218 {
219 Advance.None, Advance.None, Advance.Railroad,Advance.None,Advance.None,
220 Advance.Refrigeration,Advance.None,Advance.None,Advance.Explosives,Advance.Explosives,
221 Advance.Construction,Advance.None,Advance.Medicine,Advance.None,Advance.None
222 };
223
224 public struct TerrainInfo
225 {
226 Terrain terrain;
227 public TerrainInfo(Terrain terrain) { this.terrain = terrain; }
228 public BaseResourceSet Resources { get { return TerrainResourcesList[(int)terrain]; } }
229 public MovementKind MovementKind { get { return BaseTerrainInfoList[(int)terrain & 0xF].MovementKind; } }
230 public int DefenseBonus { get { return BaseTerrainInfoList[(int)terrain & 0xF].DefenseBonus; } }
231 }
232
233 public struct JobInfo
234 {
235 public bool IsPossible;
236 public int Cost;
237 public Terrain NewTerrain;
238 public BaseResourceSet Gain;
239 public Advance Prerequisite;
240
241 public JobInfo(Job job, Terrain terrain)
242 {
243 IsPossible = false;
244 Cost = 0;
245 NewTerrain = terrain;
246 Gain = new BaseResourceSet(0, 0, 0);
247 Prerequisite = JobPrerequisites[(int)job];
248 Terrain baseTerrain = (Terrain)((int)terrain & 0xF);
249
250 switch (job)
251 {
252 case CevoAILib.Job.None:
253 {
254 break;
255 }
256
257 case CevoAILib.Job.BuildRoad:
258 {
259 IsPossible = true;
260 Cost = (int)JobCost.RoadCost * (int)BaseTerrainInfoList[(int)baseTerrain].MovementKind;
261 if (BaseTerrainInfoList[(int)baseTerrain].MovementKind == MovementKind.Plain)
262 Gain.Trade = 1;
263 break;
264 }
265
266 case CevoAILib.Job.BuildRailRoad:
267 {
268 IsPossible = true;
269 Cost = (int)JobCost.RailroadCost * (int)BaseTerrainInfoList[(int)baseTerrain].MovementKind;
270 Gain.Material = (TerrainResourcesList[(int)terrain].Material + BaseTerrainInfoList[(int)baseTerrain].MineMaterialGain) / 2;
271 // assume mine as already built, if possible
272 break;
273 }
274
275 case CevoAILib.Job.ClearOrDrain:
276 {
277 if (BaseTerrainInfoList[(int)baseTerrain].ClearResult != Terrain.Unknown)
278 {
279 IsPossible = true;
280 Cost = BaseTerrainInfoList[(int)baseTerrain].ClearCost;
281 NewTerrain = BaseTerrainInfoList[(int)baseTerrain].ClearResult;
282 if (NewTerrain != Terrain.Grassland)
283 NewTerrain = (Terrain)((int)NewTerrain + ((int)terrain & 0xF0)); // keep special resource
284 }
285 break;
286 }
287
288 case CevoAILib.Job.Irrigate:
289 {
290 if (BaseTerrainInfoList[(int)baseTerrain].IrrigationFoodGain > 0)
291 {
292 IsPossible = true;
293 Cost = BaseTerrainInfoList[(int)baseTerrain].IrrigationCost;
294 Gain.Food = BaseTerrainInfoList[(int)baseTerrain].IrrigationFoodGain;
295 }
296 break;
297 }
298
299 case CevoAILib.Job.BuildFarmland:
300 {
301 if (BaseTerrainInfoList[(int)baseTerrain].IrrigationFoodGain > 0)
302 {
303 IsPossible = true;
304 Cost = (int)JobCost.FarmlandCostMultiplier * BaseTerrainInfoList[(int)baseTerrain].IrrigationCost;
305 Gain.Food = (TerrainResourcesList[(int)terrain].Food + BaseTerrainInfoList[(int)baseTerrain].IrrigationFoodGain) / 2;
306 }
307 break;
308 }
309
310 case CevoAILib.Job.Afforest:
311 {
312 if (BaseTerrainInfoList[(int)baseTerrain].AfforestResult != Terrain.Unknown)
313 {
314 IsPossible = true;
315 Cost = BaseTerrainInfoList[(int)baseTerrain].AfforestCost;
316 NewTerrain = BaseTerrainInfoList[(int)baseTerrain].AfforestResult;
317 if (NewTerrain != Terrain.Grassland)
318 NewTerrain = (Terrain)((int)NewTerrain + ((int)terrain & 0xF0)); // keep special resource
319 }
320 break;
321 }
322
323 case CevoAILib.Job.BuildMine:
324 {
325 if (BaseTerrainInfoList[(int)baseTerrain].MineMaterialGain > 0)
326 {
327 IsPossible = true;
328 Cost = BaseTerrainInfoList[(int)baseTerrain].MineCost;
329 Gain.Material = BaseTerrainInfoList[(int)baseTerrain].MineMaterialGain;
330 }
331 break;
332 }
333
334 case CevoAILib.Job.BuildCanal:
335 {
336 IsPossible = (baseTerrain != Terrain.Mountains && baseTerrain != Terrain.Arctic);
337 Cost = (int)JobCost.CanalCost;
338 break;
339 }
340
341 case CevoAILib.Job.Transform:
342 {
343 if (BaseTerrainInfoList[(int)baseTerrain].TransformationResult != Terrain.Unknown)
344 {
345 IsPossible = true;
346 Cost = BaseTerrainInfoList[(int)baseTerrain].TransformationCost;
347 NewTerrain = BaseTerrainInfoList[(int)baseTerrain].TransformationResult;
348 if (NewTerrain != Terrain.Grassland)
349 NewTerrain = (Terrain)((int)NewTerrain + ((int)terrain & 0xF0)); // keep special resource
350 }
351 break;
352 }
353
354 case CevoAILib.Job.BuildFortress:
355 {
356 IsPossible = true;
357 Cost = (int)JobCost.FortressCost * (int)BaseTerrainInfoList[(int)baseTerrain].MovementKind;
358 break;
359 }
360
361 case CevoAILib.Job.CleanUp:
362 {
363 IsPossible = true;
364 Cost = (int)JobCost.CleanUpCost;
365 break;
366 }
367
368 case CevoAILib.Job.BuildBase:
369 {
370 IsPossible = true;
371 Cost = (int)JobCost.BaseCost * (int)BaseTerrainInfoList[(int)baseTerrain].MovementKind;
372 break;
373 }
374
375 case CevoAILib.Job.Pillage:
376 {
377 IsPossible = true;
378 Cost = (int)JobCost.PillageCost;
379 break;
380 }
381
382 case CevoAILib.Job.BuildCity:
383 {
384 IsPossible = (BaseTerrainInfoList[(int)baseTerrain].IrrigationFoodGain > 0);
385 Cost = (int)JobCost.CityCost;
386 break;
387 }
388 }
389 IsPossible = IsPossible && baseTerrain >= Terrain.Grassland;
390 }
391 }
392 #endregion
393
394 #region Advances
395 public struct AdvanceInfo
396 {
397 public List<Advance> Prerequisites;
398
399 public AdvanceInfo(Advance advance)
400 {
401 Prerequisites = new List<Advance>(AdvancePrerequisites[(int)advance]);
402 }
403 }
404
405 static readonly Advance[][] AdvancePrerequisites =
406 {
407 new Advance[] {Advance.Flight, Advance.Robotics}, // AdvancedFlight
408 new Advance[] {Advance.Navigation, Advance.Tactics}, // AmphibiousWarfare
409 new Advance[] {Advance.Mysticism, Advance.Alphabet}, // Astronomy
410 new Advance[] {Advance.TheoryOfGravity}, // AtomicTheory
411 new Advance[] {Advance.CombustionEngine, Advance.Steel}, // Automobile
412 new Advance[] {Advance.Mathematics, Advance.Metallurgy}, // Ballistics
413 new Advance[] {Advance.Currency, Advance.Engineering}, // Banking
414 new Advance[] {Advance.Construction, Advance.TheWheel}, // BridgeBuilding
415 new Advance[] {}, // BronzeWorking
416 new Advance[] {}, // CeremonialBurial
417 new Advance[] {Advance.Science}, // Chemistry
418 new Advance[] {Advance.Monarchy, Advance.WarriorCode}, // Chivalry
419 new Advance[] {Advance.Metallurgy, Advance.Plastics}, // Composites
420 new Advance[] {Advance.Writing}, // CodeOfLaws
421 new Advance[] {Advance.AdvancedFlight, Advance.MobileWarfare}, // CombinedArms
422 new Advance[] {Advance.Refining, Advance.Explosives}, // CombustionEngine
423 new Advance[] {Advance.Philosophy, Advance.Industrialization}, // Communism
424 new Advance[] {Advance.Miniaturization}, // Computers
425 new Advance[] {Advance.TheRepublic, Advance.Tactics}, // Conscription
426 new Advance[] {Advance.Masonry, Advance.Alphabet}, // Construction
427 new Advance[] {Advance.Economics, Advance.Democracy}, // TheCorporation
428 new Advance[] {Advance.AdvancedFlight, Advance.AdvancedRocketry}, // SpaceFlight
429 new Advance[] {Advance.BronzeWorking}, // Currency
430 new Advance[] {Advance.Conscription, Advance.Industrialization}, // Democracy
431 new Advance[] {Advance.Banking, Advance.University}, // Economics
432 new Advance[] {Advance.Magnetism}, // Electricity
433 new Advance[] {Advance.Radio, Advance.AtomicTheory}, // Electronics
434 new Advance[] {Advance.Construction, Advance.BronzeWorking}, // Engineering
435 new Advance[] {Advance.Industrialization}, // Environmentalism
436 new Advance[] {}, // TheWheel
437 new Advance[] {Advance.Chemistry, Advance.Engineering}, // Explosives
438 new Advance[] {Advance.CombustionEngine, Advance.Physics}, // Flight
439 new Advance[] {Advance.Tactics, Advance.Invention}, // Intelligence
440 new Advance[] {Advance.Medicine, Advance.IronWorking}, // Gunpowder
441 new Advance[] {}, // HorsebackRiding
442 new Advance[] {Advance.SpaceFlight, Advance.NuclearPower}, // ImpulseDrive
443 new Advance[] {Advance.Railroad, Advance.Banking}, // Industrialization
444 new Advance[] {Advance.AdvancedRocketry, Advance.TheLaser}, // IntelligenArms
445 new Advance[] {Advance.Writing, Advance.TheWheel}, // Invention
446 new Advance[] {Advance.BronzeWorking, Advance.Invention}, // IronWorking
447 new Advance[] {Advance.Miniaturization, Advance.Physics}, // TheLaser
448 new Advance[] {Advance.NuclearFission}, // NuclearPower
449 new Advance[] {Advance.Poetry, Advance.Trade}, // Literature
450 new Advance[] {Advance.Democracy, Advance.Computers}, // Lybertarianism
451 new Advance[] {Advance.Physics, Advance.IronWorking}, // Magnetism
452 new Advance[] {Advance.Alphabet}, // MapMaking
453 new Advance[] {}, // Masonry
454 new Advance[] {Advance.Automobile, Advance.Electronics, Advance.TheCorporation}, // MassProduction
455 new Advance[] {Advance.Currency, Advance.Alphabet}, // Mathematics
456 new Advance[] {Advance.Mysticism, Advance.Pottery}, // Medicine
457 new Advance[] {Advance.Gunpowder}, // Metallurgy
458 new Advance[] {Advance.Robotics, Advance.Plastics}, // Miniaturization
459 new Advance[] {Advance.Automobile, Advance.Tactics}, // MobileWarfare
460 new Advance[] {Advance.Polytheism}, // Monarchy
461 new Advance[] {Advance.CeremonialBurial}, // Mysticism
462 new Advance[] {Advance.Seafaring, Advance.Astronomy}, // Navigation
463 new Advance[] {Advance.AtomicTheory, Advance.MassProduction}, // NuclearFission
464 new Advance[] {Advance.Mathematics, Advance.Literature}, // Philosophy
465 new Advance[] {Advance.Science}, // Physics
466 new Advance[] {Advance.MassProduction, Advance.Refining}, // Plastics
467 new Advance[] {Advance.Mysticism, Advance.WarriorCode}, // Poetry
468 new Advance[] {}, // Pottery
469 new Advance[] {Advance.Electricity, Advance.Engineering}, // Radio
470 new Advance[] {Advance.Environmentalism, Advance.Plastics}, // Recycling
471 new Advance[] {Advance.Electricity}, // Refrigeration
472 new Advance[] {Advance.Polytheism, Advance.Astronomy}, // Monotheism
473 new Advance[] {Advance.Literature}, // TheRepublic
474 new Advance[] {Advance.MassProduction, Advance.Economics}, // Robotics
475 new Advance[] {Advance.Ballistics, Advance.Explosives}, // Rocketry
476 new Advance[] {Advance.SteamEngine, Advance.BridgeBuilding}, // Railroad
477 new Advance[] {Advance.Environmentalism, Advance.Medicine}, // Sanitation
478 new Advance[] {Advance.Metallurgy, Advance.Theology, Advance.Philosophy}, // Science
479 new Advance[] {Advance.Alphabet}, // Writing
480 new Advance[] {Advance.Pottery, Advance.MapMaking}, // Seafaring
481 new Advance[] {Advance.Recycling, Advance.SyntheticFood}, // SelfContainedEnvironment
482 new Advance[] {Advance.Composites, Advance.Radio}, // Stealth
483 new Advance[] {Advance.Science, Advance.Engineering}, // SteamEngine
484 new Advance[] {Advance.IronWorking, Advance.Railroad}, // Steel
485 new Advance[] {Advance.Chemistry, Advance.Refrigeration}, // SyntheticFood
486 new Advance[] {Advance.WarriorCode, Advance.University}, // Tactics
487 new Advance[] {Advance.Monotheism, Advance.Poetry}, // Theology
488 new Advance[] {Advance.Astronomy, Advance.Physics}, // TheoryOfGravity
489 new Advance[] {Advance.Currency, Advance.CodeOfLaws}, // Trade
490 new Advance[] {Advance.ImpulseDrive, Advance.SelfContainedEnvironment}, // TransstellarColonization
491 new Advance[] {Advance.Science}, // University
492 new Advance[] {Advance.Computers, Advance.Rocketry}, // AdvancedRocketry
493 new Advance[] {}, // WarriorCode
494 new Advance[] {}, // Alphabet
495 new Advance[] {Advance.CeremonialBurial, Advance.HorsebackRiding}, // Polytheism
496 new Advance[] {Advance.Chemistry}, // Refining
497 new Advance[] {Advance.Computers}, // ResearchTechnology
498 new Advance[] {Advance.Robotics}, // ProductionTechnology
499 new Advance[] {Advance.Composites}, // ArmorTechnology
500 new Advance[] {Advance.SmartWeapons} // MissileTechnology
501 };
502 #endregion
503
504 #region Buildings
505 public struct BuildingInfo
506 {
507 public BuildingKind Kind;
508 public Advance Prerequisite;
509 public int Cost;
510 public int Maintenance;
511 public Advance Expiration;
512 }
513
514 static readonly BuildingInfo[] BuildingInfoList =
515 {
516 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Mathematics, Cost = 400, Maintenance = 0, Expiration = Advance.Democracy}, // Pyramids
517 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Polytheism, Cost = 200, Maintenance = 0, Expiration = Advance.Electronics}, // Zeus
518 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Invention, Cost = 200, Maintenance = 0, Expiration = Advance.NuclearFission}, // Gardens
519 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.BronzeWorking, Cost = 200, Maintenance = 0, Expiration = Advance.None}, // Colossus
520 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.MapMaking, Cost = 200, Maintenance = 0, Expiration = Advance.Steel}, // Lighthouse
521 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Literature, Cost = 400, Maintenance = 0, Expiration = Advance.Plastics}, // GrLibrary
522 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Mysticism, Cost = 200, Maintenance = 0, Expiration = Advance.None}, // Oracle
523 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Chivalry, Cost = 300, Maintenance = 0, Expiration = Advance.SpaceFlight}, // Sun
524 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Philosophy, Cost = 500, Maintenance = 0, Expiration = Advance.None}, // Leo
525 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Navigation, Cost = 300, Maintenance = 0, Expiration = Advance.None}, // Magellan
526 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Monotheism, Cost = 400, Maintenance = 0, Expiration = Advance.None}, // Mich
527 new BuildingInfo {Kind = BuildingKind.None, Prerequisite = Advance.None}, // {11}
528 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.TheoryOfGravity, Cost = 400, Maintenance = 0, Expiration = Advance.None}, // Newton
529 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Theology, Cost = 400, Maintenance = 0, Expiration = Advance.None}, // Bach
530 new BuildingInfo {Kind = BuildingKind.None, Prerequisite = Advance.None}, // {14}
531 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Democracy, Cost = 500, Maintenance = 0, Expiration = Advance.None}, // Liberty
532 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Steel, Cost = 800, Maintenance = 0, Expiration = Advance.None}, // Eiffel
533 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Electronics, Cost = 800, Maintenance = 0, Expiration = Advance.None}, // Hoover
534 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.Plastics, Cost = 500, Maintenance = 0, Expiration = Advance.None}, // Shinkansen
535 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.NuclearFission, Cost = 400, Maintenance = 0, Expiration = Advance.None}, // Manhattan
536 new BuildingInfo {Kind = BuildingKind.Wonder, Prerequisite = Advance.SpaceFlight, Cost = 800, Maintenance = 0, Expiration = Advance.None}, // Mir
537 new BuildingInfo {Kind = BuildingKind.None, Prerequisite = Advance.None}, // {21}
538 new BuildingInfo {Kind = BuildingKind.None, Prerequisite = Advance.None}, // {22}
539 new BuildingInfo {Kind = BuildingKind.None, Prerequisite = Advance.None}, // {23}
540 new BuildingInfo {Kind = BuildingKind.None, Prerequisite = Advance.None}, // {24}
541 new BuildingInfo {Kind = BuildingKind.None, Prerequisite = Advance.None}, // {25}
542 new BuildingInfo {Kind = BuildingKind.None, Prerequisite = Advance.None}, // {26}
543 new BuildingInfo {Kind = BuildingKind.None, Prerequisite = Advance.None}, // {27}
544 new BuildingInfo {Kind = BuildingKind.None, Prerequisite = Advance.None, Cost = 0, Maintenance = 0}, // TrGoods
545 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.WarriorCode, Cost = 40, Maintenance = 1}, // Barracks
546 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Pottery, Cost = 60, Maintenance = 1}, // Granary
547 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.CeremonialBurial, Cost = 40, Maintenance = 1}, // Temple
548 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Currency, Cost = 60, Maintenance = 1}, // Market
549 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Writing, Cost = 80, Maintenance = 3}, // Library
550 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.CodeOfLaws, Cost = 80, Maintenance = 2}, // Court
551 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Masonry, Cost = 80, Maintenance = 1}, // Walls
552 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Construction, Cost = 80, Maintenance = 1}, // Aqueduct
553 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Banking, Cost = 120, Maintenance = 2}, // Bank
554 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Monotheism, Cost = 100, Maintenance = 1}, // Cathedral
555 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.University, Cost = 160, Maintenance = 5}, // University
556 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Seafaring, Cost = 60, Maintenance = 1}, // Harbor
557 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Poetry, Cost = 60, Maintenance = 2}, // Theater
558 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Industrialization, Cost = 200, Maintenance = 3}, // Factory
559 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Robotics, Cost = 320, Maintenance = 5}, // MfgPlant
560 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Recycling, Cost = 320, Maintenance = 4}, // Recycling
561 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Electricity, Cost = 120, Maintenance = 2}, // Power
562 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Environmentalism, Cost = 120, Maintenance = 1}, // Hydro
563 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.NuclearPower, Cost = 240, Maintenance = 2}, // Nuclear
564 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Refining, Cost = 160, Maintenance = 2}, // Platform
565 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.None, Cost = 40, Maintenance = 1}, // TownHall
566 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Sanitation, Cost = 120, Maintenance = 2}, // Sewer
567 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Refrigeration, Cost = 80, Maintenance = 2}, // Supermarket
568 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Automobile, Cost = 160, Maintenance = 4}, // Highways
569 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Computers, Cost = 240, Maintenance = 7}, // ResLab
570 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.AdvancedRocketry, Cost = 100, Maintenance = 1}, // MissileBat
571 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.Metallurgy, Cost = 80, Maintenance = 1}, // CoastalFort
572 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.AdvancedFlight, Cost = 160, Maintenance = 1}, // Airport
573 new BuildingInfo {Kind = BuildingKind.CityImprovement, Prerequisite = Advance.AmphibiousWarfare, Cost = 80, Maintenance = 1}, // Dockyard
574 new BuildingInfo {Kind = BuildingKind.StateImprovement, Prerequisite = Advance.None, Cost = 100, Maintenance = 0}, // Palace
575 new BuildingInfo {Kind = BuildingKind.StateImprovement, Prerequisite = Advance.Engineering, Cost = 400, Maintenance = 4}, // GrWall
576 new BuildingInfo {Kind = BuildingKind.StateImprovement, Prerequisite = Advance.Construction, Cost = 200, Maintenance = 4}, // Colosseum
577 new BuildingInfo {Kind = BuildingKind.StateImprovement, Prerequisite = Advance.Astronomy, Cost = 300, Maintenance = 4}, // Observatory
578 new BuildingInfo {Kind = BuildingKind.StateImprovement, Prerequisite = Advance.Tactics, Cost = 100, Maintenance = 4}, // MilAcademy
579 new BuildingInfo {Kind = BuildingKind.StateImprovement, Prerequisite = Advance.Steel, Cost = 200, Maintenance = 2}, // Bunker
580 new BuildingInfo {Kind = BuildingKind.StateImprovement, Prerequisite = Advance.SyntheticFood, Cost = 120, Maintenance = 2}, // Algae
581 new BuildingInfo {Kind = BuildingKind.StateImprovement, Prerequisite = Advance.TheCorporation, Cost = 320, Maintenance = 4}, // StockEx
582 new BuildingInfo {Kind = BuildingKind.StateImprovement, Prerequisite = Advance.SpaceFlight, Cost = 400, Maintenance = 0}, // SpacePort
583 new BuildingInfo {Kind = BuildingKind.ColonyShipPart, Prerequisite = Advance.TransstellarColonization, Cost = 240, Maintenance = 0}, // ShipComp
584 new BuildingInfo {Kind = BuildingKind.ColonyShipPart, Prerequisite = Advance.ImpulseDrive, Cost = 600, Maintenance = 0}, // ShipPow
585 new BuildingInfo {Kind = BuildingKind.ColonyShipPart, Prerequisite = Advance.SelfContainedEnvironment, Cost = 800, Maintenance = 0} // ShipHab
586 };
587 #endregion
588 }
589}
Note: See TracBrowser for help on using the repository browser.