SCENARIO.H 10 KB

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