home *** CD-ROM | disk | FTP | other *** search
/ WarCraft 2000 - Nuclear Epidemic / W2000.nrg / SOURCE.War2000 / Megapolis.h < prev    next >
C/C++ Source or Header  |  1998-08-04  |  4KB  |  151 lines

  1. #define N_KINDS 5
  2. class Cell8x8{
  3. public:
  4.     union{
  5.         struct{
  6.             byte Peasants;//Ωεδ-Γε Ω≡σ±≥ⁿ φ φα ²≥εΘ Ωδσ≥Ωσ
  7.             byte Towers;//------//------ßα°σφ
  8.             byte Warriors;
  9.             byte Farms;
  10.             byte Buildings;
  11.             byte Fly;
  12.             byte WaterPeas;
  13.             byte WaterObj;
  14.         };
  15.         byte UnitsAmount[8];
  16.     };
  17.     //byte P_MoveUp;//Ωεδ-Γε ∩σ≡σ±σ≈σφΦΘ Γσ≡⌡φσΘ π≡αφΦ÷√
  18.     //byte P_MoveDn;
  19.     //byte P_MoveLf;
  20.     //byte P_MoveRi;
  21.     //byte Protection;  //=4*Towers+Warriors
  22.     //byte Agressivity; //=Warriors
  23.     //byte Importance;  //=Farms+Buildings
  24.     word Neighbor;    //(0x001)  bit0 - UP
  25.                       //(0x002)  bit1 - UP-RIGHT
  26.                       //(0x004)  bit2 - RIGHT
  27.                       //(0x008)  bit3 - DN-RIGHT
  28.                       //(0x010)  bit4 - DN
  29.                       //(0x020)  bit5 - DN-LEFT
  30.                       //(0x040)  bit6 - LEFT
  31.                       //(0x080)  bit7 - UP-LEFT
  32.                       //(0x100)  bit8 - UP+2
  33.                       //(0x200)  bit9 - RIGHT+2
  34.                       //(0x400)  bit10- DN+2
  35.                       //(0x800)  bit11- RIGHT+2
  36.     //byte Resrv[3];
  37.     //word Enemy;
  38.     //word EnemyTime;
  39.     Cell8x8();
  40. };
  41. typedef Cell8x8 CellsInfo [64][64];
  42. typedef CellsInfo TotalCInfo [8];
  43. extern TotalCInfo  TCInf;
  44. class CityProject{
  45. public:
  46.  
  47. };
  48. class ProposedProject{
  49. public:
  50.     byte PKind;//=0-Monster,==1-Upgrade
  51.     word NIndex;//φε∞σ≡ ≥Φ∩α ∞εφ±≥≡α/Upgrade index
  52.     word ProducerIndex;//ΦφΣσΩ± ±ΓεßεΣφεπε ∩≡εΦτΓεΣΦ≥σδ 
  53.     byte Percent;//∩≡ε÷σφ≥ Σσφσπ, ≤∩ε≥≡σßδ σ∞√Θ φα ∩≡εΦτΓεΣ±≥Γε
  54.     int Cost;//÷σφα 
  55.     int Useful[NBRANCH];
  56. };
  57. struct BuildProject{
  58.     bool Used:1;
  59.     bool PlaceFound:1;
  60.     bool Founded:1;
  61.     bool PeonsCalled:1;
  62.     word LastStage;
  63.     word Progress;
  64.     int  x;
  65.     int  y;
  66.     char Lx;
  67.     char Ly;
  68.     word Index;
  69.     word Type;
  70.     word Producer;
  71.     byte Kind;
  72. };
  73. class CityCell{
  74. public:
  75.     int x,y;
  76.     word WorkTimes;//==0xFFFF if inside the city
  77.     CityCell* NextCell;
  78. };
  79. class CityCluster{
  80. public:
  81.     CityCell* FirstCell;
  82.     void AddCell(int x,int y);
  83. };
  84. typedef int Functional(int* x,int* y,int Lx,int Ly,byte NI);
  85. class City{
  86. public:
  87.     Nation* Nat;
  88.     byte NI;
  89.     int InX,InY,InX1,InY1,OutX,OutY,OutX1,OutY1;
  90.     int TryTimes;
  91.     int ExpandSize;
  92.     int Amount;
  93.     int GoldPeasPart;
  94.     int WoodPeasPart;
  95.     int BuildPeasPart;
  96.     word KindMax[N_KINDS];//∞αΩ±. Ωεδ-Γε ≥Γα≡σΘ ≥Φ∩α Kind
  97.     //word *MKList[N_KINDS];//∞α±±ΦΓ ≤Ωατα≥σδσΘ φα ∞α±±ΦΓ√ ± ΦφΣσΩ±α∞Φ ∞εφ±≥≡εΓ Σαφφεπε ≥Φ∩α
  98.     Functional* FNC[N_KINDS];//∞α±±ΦΓ ⌠≤φΩ÷ΦεφαδεΓ Σδ  Γ√ßε≡α ∞σ±≥α, σ±δΦ ∞σ±≥ε Γεεß∙σ φσ ∩εΣ⌡εΣΦ≥, ≥ε ΓετΓ≡. -1
  99.     word BranchPart[NBRANCH];
  100.     word UTNum;//amount of units types
  101.     word UnitAmount[512];//Amount of units of some kind
  102.     word ReadyAmount[512];
  103.     word PRPIndex[512];//index of project to produce this type of monster,if not proposed,0xFFFF
  104.     word UPGIndex[1024];
  105.     word UnBusyAmount[512];//±ΩεδⁿΩε ∞εΣ≤δσΘ ∩≡ε±≥αΦΓασ≥
  106.     word Producer[512];
  107.     bool PresentProject:1;
  108.     bool IntellectEnabled:1;
  109.     BuildProject BPR;
  110.     word NProp;
  111.     ProposedProject Prop[100];
  112.     Crowd CROWDS[10];
  113.     Crowd Defence;
  114.     word EnemyList[32];
  115.     void CreateCity(int x,int y,byte NI);
  116.     bool CheckTZone(int x,int y,int Lx,int Ly);
  117.     bool TryToFindPlace(int* x,int* y,int Lx,int Ly,byte Kind);
  118.     void EnumUnits();
  119.     void AddProp(byte NI,word NIN,GeneralObject* GO,word prop);
  120.     void AddUpgr(byte NI,word NIN,SimpleUTP* UT,word prod);
  121.     void EnumProp();
  122.     void ProcessCreation();
  123.     void HelpMe(word ID);
  124.     void HandleFly();
  125.     word FindNeedProject();
  126.     void RefreshAbility();
  127.     void CloseCity();
  128. };
  129. class Forces{
  130. public:
  131.     int MinX;
  132.     int MinY;
  133.     int MaxX;
  134.     int MaxY;
  135.     int Damage;
  136.     int Life;
  137.     int Shield;
  138.     int Protection;
  139.     int Population;
  140.     int StrongFactor;
  141.     int CenterX;
  142.     int CenterY;
  143.     int NBuild;
  144.     void SetDefaults();
  145. };
  146. extern Forces NForces[8];
  147. extern int BestForce;
  148. extern int BestNat;
  149. extern int NextBest;
  150. void OutCInf(byte x,byte y);
  151. extern int COUNTER;