SCENARIO.H 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. //
  2. // Copyright 2020 Electronic Arts Inc.
  3. //
  4. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free
  5. // software: you can redistribute it and/or modify it under the terms of
  6. // the GNU General Public License as published by the Free Software Foundation,
  7. // either version 3 of the License, or (at your option) any later version.
  8. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
  9. // in the hope that it will be useful, but with permitted additional restrictions
  10. // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
  11. // distributed with this program. You should have received a copy of the
  12. // GNU General Public License along with permitted additional restrictions
  13. // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
  14. /* $Header: /CounterStrike/SCENARIO.H 1 3/03/97 10:25a Joe_bostic $ */
  15. /***********************************************************************************************
  16. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  17. ***********************************************************************************************
  18. * *
  19. * Project Name : Command & Conquer *
  20. * *
  21. * File Name : SCENARIO.H *
  22. * *
  23. * Programmer : Joe L. Bostic *
  24. * *
  25. * Start Date : 02/26/96 *
  26. * *
  27. * Last Update : February 26, 1996 [JLB] *
  28. * *
  29. *---------------------------------------------------------------------------------------------*
  30. * Functions: *
  31. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  32. #ifndef SCENARIO_H
  33. #define SCENARIO_H
  34. /*
  35. ** This class holds the information about the current game being played. This information is
  36. ** global to the scenario and is generally of a similar nature to the information that was held
  37. ** in the controlling scenario INI file. It is safe to write this structure out as a whole since
  38. ** it doesn't contain any embedded pointers.
  39. */
  40. class ScenarioClass {
  41. public:
  42. // Constructor.
  43. ScenarioClass(void);
  44. void Set_Scenario_Name(int scenario, ScenarioPlayerType player, ScenarioDirType dir = SCEN_DIR_NONE, ScenarioVarType var = SCEN_VAR_NONE);
  45. void Set_Scenario_Name(char const * name);
  46. bool Set_Global_To(int global, bool value);
  47. void Do_BW_Fade(void);
  48. void Do_Fade_AI(void);
  49. /*
  50. ** This is the source of the random numbers used in the game. This controls
  51. ** the game logic and thus must be in sync with any networked machines.
  52. */
  53. RandomClass RandomNumber;
  54. /*
  55. ** This is the difficulty setting of the game.
  56. */
  57. DiffType Difficulty; // For human player.
  58. DiffType CDifficulty; // For computer players.
  59. /*
  60. ** This is the main mission timer. This is the timer that is reset at the
  61. ** start of the mission. It, effectively, holds the elapsed time of the
  62. ** mission.
  63. */
  64. TTimerClass<FrameTimerClass> Timer;
  65. /*
  66. ** This is an array of waypoints; each waypoint corresponds to a letter of
  67. ** the alphabet, and points to a cell number. -1 means unassigned.
  68. ** The CellClass has a bit that tells if that cell has a waypoint attached to
  69. ** it; the only way to find which waypoint it is, is to scan this array. This
  70. ** shouldn't be needed often; usually, you know the waypoint & you want the CELL.
  71. */
  72. CELL Waypoint[WAYPT_COUNT];
  73. /*
  74. ** This holds the system wide mission countdown timer. Time based missions
  75. ** are governed by this timer. Various trigger events can modify and examine
  76. ** this timer. The current value of this timer will display on the game
  77. ** screen.
  78. */
  79. CDTimerClass<FrameTimerClass> MissionTimer;
  80. /*
  81. ** The shroud regrowth (if enabled) is regulated by this timer. When the
  82. ** timer expires, the shroud will regrow one step.
  83. */
  84. CDTimerClass<FrameTimerClass> ShroudTimer;
  85. /*
  86. ** The scenario number.
  87. */
  88. int Scenario;
  89. /*
  90. ** The theater of the current scenario.
  91. */
  92. TheaterType Theater;
  93. /*
  94. ** The full name of the scenario (as it exists on disk).
  95. */
  96. char ScenarioName[_MAX_FNAME+_MAX_EXT];
  97. /*
  98. ** Description of the scenario.
  99. */
  100. char Description[DESCRIP_MAX];
  101. /*
  102. ** The filename of the introduction movie.
  103. */
  104. VQType IntroMovie;
  105. /*
  106. ** The filename of the briefing movie.
  107. */
  108. VQType BriefMovie;
  109. /*
  110. ** The filename of the movie to play if the scenario is won.
  111. */
  112. VQType WinMovie;
  113. /*
  114. ** The filename of the movie to play if the scenario is won.
  115. */
  116. VQType WinMovie2;
  117. /*
  118. ** The filename of the movie to play if the scenario is won.
  119. */
  120. VQType WinMovie3;
  121. /*
  122. ** The filename of the movie to play if the scenario is won.
  123. */
  124. VQType WinMovie4;
  125. /*
  126. ** The filename of the movie to play if the scenario is lost.
  127. */
  128. VQType LoseMovie;
  129. /*
  130. ** The filename of the movie to play right after the briefing and
  131. ** just before the game.
  132. */
  133. VQType ActionMovie;
  134. /*
  135. ** This is the full text of the briefing. This text will be
  136. ** displayed when the player commands the "restate mission
  137. ** objectives" operation.
  138. */
  139. char BriefingText[1024];
  140. /*
  141. ** This is the theme to start playing at the beginning of the action
  142. ** movie. A score started in this fashion will continue to play as
  143. ** the game progresses.
  144. */
  145. ThemeType TransitTheme;
  146. /*
  147. ** The house that the player is to be (obsolete).
  148. */
  149. HousesType PlayerHouse;
  150. /*
  151. ** The percentage of money that is allowed to be carried over into the
  152. ** following scenario.
  153. */
  154. fixed CarryOverPercent;
  155. /*
  156. ** This is the amount of money that was left over in the previous
  157. ** scenario.
  158. */
  159. int CarryOverMoney;
  160. /*
  161. ** This specifies the maximum amount of money that is allowed to be
  162. ** carried over from the previous scenario. This limits the amount
  163. ** regardless of what the carry over percentage is set to.
  164. */
  165. int CarryOverCap;
  166. /*
  167. ** This is the percent that the computer controlled base is to be
  168. ** built up to at the scenario start.
  169. */
  170. int Percent;
  171. /*
  172. ** Global flags that are used in the trigger system and are persistent
  173. ** over the course of the game.
  174. */
  175. bool GlobalFlags[30];
  176. /*
  177. ** This records the bookmark view locations the player has recorded.
  178. */
  179. CELL Views[4];
  180. /*
  181. ** This is the number of active passable bridges in the current game.
  182. */
  183. int BridgeCount;
  184. /*
  185. ** This records the carry over timer value that is used when the mission
  186. ** starts (presuming the appropriate flag is set) and also used when the
  187. ** scenario restarts.
  188. */
  189. int CarryOverTimer;
  190. /*
  191. ** If a bridge has been destroyed, then this flag will be set to true.
  192. ** If there is a trigger that depends on this, it might be triggered.
  193. */
  194. unsigned IsBridgeChanged:1;
  195. /*
  196. ** If a global has changed and global change trigger events must be
  197. ** processed, then this flag will be set to true.
  198. */
  199. unsigned IsGlobalChanged:1;
  200. /*
  201. ** Are the buildings and units in this scenario to carry over into
  202. ** some (unspecified) later scenario and thus have to be recorded
  203. ** at the end?
  204. */
  205. unsigned IsToCarryOver:1;
  206. /*
  207. ** Is this scenario to begin by taking the previously recorded
  208. ** carryover objects and creating them onto the map?
  209. */
  210. unsigned IsToInherit:1;
  211. /*
  212. ** If Tanya or a civilian is to be automatically evacuated when they enter
  213. ** a transport vehicle, then this flag will be true.
  214. */
  215. unsigned IsTanyaEvac:1;
  216. /*
  217. ** These variables are assigned to the chronosphere effect, and control
  218. ** whether the palette should be fading towards b&w or towards color.
  219. */
  220. unsigned IsFadingBW:1;
  221. unsigned IsFadingColor:1;
  222. /*
  223. ** If this scenario is to be the last mission of the game (for this side), then
  224. ** this flag will be true.
  225. */
  226. unsigned IsEndOfGame:1;
  227. /*
  228. ** If the mission countdown timer is to be inherited from the previous
  229. ** scenario, then this flag will be set to true.
  230. */
  231. unsigned IsInheritTimer:1;
  232. /*
  233. ** If the spy plane is to be disabled in this scenario even though circumstances
  234. ** might otherwise indicate that it should appear, then this flag will be true.
  235. */
  236. unsigned IsNoSpyPlane:1;
  237. /*
  238. ** If the score screen (and "mission accomplished" voice) is to be skipped when
  239. ** this scenario is finished, then this flag will be true.
  240. */
  241. unsigned IsSkipScore:1;
  242. /*
  243. ** If this is to be a one time only mission such that when it is completed, the game
  244. ** will return to the main menu, then this flag will be set to true.
  245. */
  246. unsigned IsOneTimeOnly:1;
  247. /*
  248. ** If the map selection is to be skipped then this flag will be true. If this
  249. ** ins't a one time only scenario, then the next scenario will have the same
  250. ** name as the current one but will be for variation "B".
  251. */
  252. unsigned IsNoMapSel:1;
  253. /*
  254. ** If trucks are supposed to drop wood crates when they explode, then this flag
  255. ** will be set to true.
  256. */
  257. unsigned IsTruckCrate:1;
  258. /*
  259. ** If the initial money is to be assigned as ore in available silos, then
  260. ** this flag will be set to true.
  261. */
  262. unsigned IsMoneyTiberium:1;
  263. /*
  264. ** This is the fading countdown timer. As this timer counts down, the
  265. ** fading to b&w or color will progress. This timer represents a
  266. ** percentage of the Options.Get_Saturation() to fade towards.
  267. */
  268. CDTimerClass<FrameTimerClass> FadeTimer;
  269. #ifdef FIXIT_VERSION_3 // For endgame auto-sonar pulse.
  270. // Timer to set the period for checking if an auto-sonar pulse should be performed.
  271. // This will take place if a player has nothing but subs left in the game.
  272. CDTimerClass<FrameTimerClass> AutoSonarTimer;
  273. #endif
  274. #ifdef FIXIT_VERSION_3 // Stalemate games.
  275. bool bLocalProposesDraw; // True if the local player in a 2-player game has a draw offer extended.
  276. bool bOtherProposesDraw; // True if the other player in a 2-player game has a draw offer extended.
  277. #endif
  278. };
  279. #endif