map.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #ifndef MAPD
  2. #define MAPD
  3. struct TimeEvent
  4. {
  5. //bajty wydarzeñ (59 + |teksty|)
  6. //4 bajty na d³ugoœæ nazwy zdarzenia
  7. //nazwa zdarzenia (bajty dodatkowe)
  8. //4 bajty na d³ugoœæ wiadomoœci
  9. //wiadomoϾ (bajty dodatkowe)
  10. //4 bajty na zwiêkszenie siê ilosci drewna (zapis normalny) lub ff,ff,ff,ff - iloœæ drewna do odebrania (maksymalna iloœæ drewna, któr¹ mo¿na daæ/odebraæ to 32767)
  11. //4 bajty na zwiêkszenie siê ilosci rtêci (zapis normalny) lub ff,ff,ff,ff - iloœæ rtêci do odebrania (maksymalna iloœæ rtêci, któr¹ mo¿na daæ/odebraæ to 32767)
  12. //4 bajty na zwiêkszenie siê ilosci rudy (zapis normalny) lub ff,ff,ff,ff - iloœæ rudy do odebrania (maksymalna iloœæ rudy, któr¹ mo¿na daæ/odebraæ to 32767)
  13. //4 bajty na zwiêkszenie siê ilosci siarki (zapis normalny) lub ff,ff,ff,ff - iloœæ siarki do odebrania (maksymalna iloœæ siarki, któr¹ mo¿na daæ/odebraæ to 32767)
  14. //4 bajty na zwiêkszenie siê ilosci kryszta³u (zapis normalny) lub ff,ff,ff,ff - iloœæ kryszta³u do odebrania (maksymalna iloœæ kryszta³u, któr¹ mo¿na daæ/odebraæ to 32767)
  15. //4 bajty na zwiêkszenie siê ilosci klejnotów (zapis normalny) lub ff,ff,ff,ff - iloœæ klejnotów do odebrania (maksymalna iloœæ klejnotów, któr¹ mo¿na daæ/odebraæ to 32767)
  16. //4 bajty na zwiêkszenie siê ilosci z³ota (zapis normalny) lub ff,ff,ff,ff - iloœæ z³ota do odebrania (maksymalna iloœæ z³ota, któr¹ mo¿na daæ/odebraæ to 32767)
  17. //1 bajt - których graczy dotyczy zdarzenie (pole bitowe, +1 - pierwszy, +2 - drugi, +4 - trzeci, +8 - czwarty, +16 - pi¹ty, +32 - szósty, +64 - siódmy, +128 - ósmy)
  18. //1 bajt - czy zdarzenie odnosi siê do graczy - ludzi (00 - nie, 01 - tak)
  19. //1 bajt - czy zdarzenie odnosi siê do graczy komputerowych (00 - nie, 01 - tak)
  20. //2 bajty - opóŸnienie pierwszego wyst¹pienia (w dniach, zapis normalny, maks 671)
  21. //1 bajt - co ile dni wystêpuje zdarzenie (maks 28, 00 oznacza zdarzenie jednorazowe)
  22. //17 bajtów zerowych
  23. };
  24. struct TerrainTile
  25. {
  26. EterrainType tertype; // type of terrain
  27. unsigned int terview; // look of terrain
  28. Eriver nuine; // type of Eriver (0 if there is no Eriver)
  29. unsigned int rivDir; // direction of Eriver
  30. Eroad malle; // type of Eroad (0 if there is no Eriver)
  31. unsigned int roadDir; // direction of Eroad
  32. unsigned int siodmyTajemniczyBajt; // mysterius byte // jak bedzie waidomo co to, to sie nazwie inaczej
  33. };
  34. struct DefInfo //information from def declaration
  35. {
  36. std::string name;
  37. int bytes [46];
  38. };
  39. struct SheroName //name of starting hero
  40. {
  41. int heroID;
  42. std::string heroName;
  43. };
  44. struct PlayerInfo
  45. {
  46. bool canHumanPlay;
  47. bool canComputerPlay;
  48. unsigned int AITactic; //(00 - random, 01 - warrior, 02 - builder, 03 - explorer)
  49. unsigned int allowedFactions; //(01 - castle; 02 - rampart; 04 - tower; 08 - inferno; 16 - necropolis; 32 - dungeon; 64 - stronghold; 128 - fortress; 256 - conflux);
  50. bool isFactionRandom;
  51. unsigned int mainHeroPortrait; //it's ID of hero with choosen portrait; 255 if standard
  52. std::string mainHeroName;
  53. std::vector<SheroName> heroesNames;
  54. };
  55. struct Location
  56. {
  57. int x, y;
  58. bool z; // underground
  59. };
  60. struct LossCondition
  61. {
  62. ElossCon typeOfLossCon;
  63. union
  64. {
  65. Location castlePos;
  66. Location heroPos;
  67. int timeLimit; // in days
  68. };
  69. };
  70. struct CspecificVictoryConidtions
  71. {
  72. bool allowNormalVictory;
  73. bool appliesToAI;
  74. };
  75. struct VicCon0 : public CspecificVictoryConidtions //acquire artifact
  76. {
  77. int ArtifactID;
  78. };
  79. struct VicCon1 : public CspecificVictoryConidtions //accumulate creatures
  80. {
  81. int monsterID;
  82. int neededQuantity;
  83. };
  84. struct VicCon2 : public CspecificVictoryConidtions // accumulate resources
  85. {
  86. int resourceID;
  87. int neededQuantity;
  88. };
  89. struct VicCon3 : public CspecificVictoryConidtions // upgrade specific town
  90. {
  91. Location posOfCity;
  92. int councilNeededLevel; //0 - town; 1 - city; 2 - capitol
  93. int fortNeededLevel;// 0 - fort; 1 - citadel; 2 - castle
  94. };
  95. struct VicCon4 : public CspecificVictoryConidtions // build grail structure
  96. {
  97. bool anyLocation;
  98. Location whereBuildGrail;
  99. };
  100. struct VicCon5 : public CspecificVictoryConidtions // defeat a specific hero
  101. {
  102. Location locationOfHero;
  103. };
  104. struct VicCon6 : public CspecificVictoryConidtions // capture a specific town
  105. {
  106. Location locationOfTown;
  107. };
  108. struct VicCon7 : public CspecificVictoryConidtions // defeat a specific monster
  109. {
  110. Location locationOfMonster;
  111. };
  112. /*struct VicCon8 : public CspecificVictoryConidtions // flag all creature dwellings
  113. {
  114. };
  115. struct VicCon9 : public CspecificVictoryConidtions // flag all mines
  116. {
  117. };*/
  118. struct VicCona : public CspecificVictoryConidtions //transport specific artifact
  119. {
  120. int artifactID;
  121. Location destinationPlace;
  122. };
  123. struct Rumor
  124. {
  125. std::string name, text;
  126. };
  127. struct Mapa
  128. {
  129. Eformat version; // version of map Eformat
  130. bool twoLevel; // if map has underground level
  131. int difficulty; // 0 easy - 4 impossible
  132. int levelLimit;
  133. bool areAnyPLayers; // if there are any playable players on map
  134. std::string name; //name of map
  135. std::string description; //and description
  136. int height, width;
  137. TerrainTile** terrain;
  138. TerrainTile** undergroungTerrain; // used only if there is underground level
  139. std::vector<Rumor> rumors;
  140. std::vector<DefInfo> defy; // list of .def files
  141. PlayerInfo players[8]; // info about players
  142. std::vector<int> teams; // teams[i] = team of player nr i
  143. LossCondition lossCondition;
  144. EvictoryConditions victoryCondition; //victory conditions
  145. CspecificVictoryConidtions * vicConDetails; // used only if vistory conditions aren't standard
  146. };
  147. #endif //MAPD