Target.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. /*
  2. ===========================================================================
  3. Doom 3 GPL Source Code
  4. Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
  6. Doom 3 Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 Source Code 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. You should have received a copy of the GNU General Public License
  15. along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #ifndef __GAME_TARGET_H__
  21. #define __GAME_TARGET_H__
  22. /*
  23. ===============================================================================
  24. idTarget
  25. ===============================================================================
  26. */
  27. class idTarget : public idEntity {
  28. public:
  29. CLASS_PROTOTYPE( idTarget );
  30. };
  31. /*
  32. ===============================================================================
  33. idTarget_Remove
  34. ===============================================================================
  35. */
  36. class idTarget_Remove : public idTarget {
  37. public:
  38. CLASS_PROTOTYPE( idTarget_Remove );
  39. private:
  40. void Event_Activate( idEntity *activator );
  41. };
  42. /*
  43. ===============================================================================
  44. idTarget_Show
  45. ===============================================================================
  46. */
  47. class idTarget_Show : public idTarget {
  48. public:
  49. CLASS_PROTOTYPE( idTarget_Show );
  50. private:
  51. void Event_Activate( idEntity *activator );
  52. };
  53. /*
  54. ===============================================================================
  55. idTarget_Damage
  56. ===============================================================================
  57. */
  58. class idTarget_Damage : public idTarget {
  59. public:
  60. CLASS_PROTOTYPE( idTarget_Damage );
  61. private:
  62. void Event_Activate( idEntity *activator );
  63. };
  64. /*
  65. ===============================================================================
  66. idTarget_SessionCommand
  67. ===============================================================================
  68. */
  69. class idTarget_SessionCommand : public idTarget {
  70. public:
  71. CLASS_PROTOTYPE( idTarget_SessionCommand );
  72. private:
  73. void Event_Activate( idEntity *activator );
  74. };
  75. /*
  76. ===============================================================================
  77. idTarget_EndLevel
  78. ===============================================================================
  79. */
  80. class idTarget_EndLevel : public idTarget {
  81. public:
  82. CLASS_PROTOTYPE( idTarget_EndLevel );
  83. private:
  84. void Event_Activate( idEntity *activator );
  85. };
  86. /*
  87. ===============================================================================
  88. idTarget_WaitForButton
  89. ===============================================================================
  90. */
  91. class idTarget_WaitForButton : public idTarget {
  92. public:
  93. CLASS_PROTOTYPE( idTarget_WaitForButton );
  94. void Think( void );
  95. private:
  96. void Event_Activate( idEntity *activator );
  97. };
  98. /*
  99. ===============================================================================
  100. idTarget_SetGlobalShaderTime
  101. ===============================================================================
  102. */
  103. class idTarget_SetGlobalShaderTime : public idTarget {
  104. public:
  105. CLASS_PROTOTYPE( idTarget_SetGlobalShaderTime );
  106. private:
  107. void Event_Activate( idEntity *activator );
  108. };
  109. /*
  110. ===============================================================================
  111. idTarget_SetShaderParm
  112. ===============================================================================
  113. */
  114. class idTarget_SetShaderParm : public idTarget {
  115. public:
  116. CLASS_PROTOTYPE( idTarget_SetShaderParm );
  117. private:
  118. void Event_Activate( idEntity *activator );
  119. };
  120. /*
  121. ===============================================================================
  122. idTarget_SetShaderTime
  123. ===============================================================================
  124. */
  125. class idTarget_SetShaderTime : public idTarget {
  126. public:
  127. CLASS_PROTOTYPE( idTarget_SetShaderTime );
  128. private:
  129. void Event_Activate( idEntity *activator );
  130. };
  131. /*
  132. ===============================================================================
  133. idTarget_FadeEntity
  134. ===============================================================================
  135. */
  136. class idTarget_FadeEntity : public idTarget {
  137. public:
  138. CLASS_PROTOTYPE( idTarget_FadeEntity );
  139. idTarget_FadeEntity( void );
  140. void Save( idSaveGame *savefile ) const;
  141. void Restore( idRestoreGame *savefile );
  142. void Think( void );
  143. private:
  144. idVec4 fadeFrom;
  145. int fadeStart;
  146. int fadeEnd;
  147. void Event_Activate( idEntity *activator );
  148. };
  149. /*
  150. ===============================================================================
  151. idTarget_LightFadeIn
  152. ===============================================================================
  153. */
  154. class idTarget_LightFadeIn : public idTarget {
  155. public:
  156. CLASS_PROTOTYPE( idTarget_LightFadeIn );
  157. private:
  158. void Event_Activate( idEntity *activator );
  159. };
  160. /*
  161. ===============================================================================
  162. idTarget_LightFadeOut
  163. ===============================================================================
  164. */
  165. class idTarget_LightFadeOut : public idTarget {
  166. public:
  167. CLASS_PROTOTYPE( idTarget_LightFadeOut );
  168. private:
  169. void Event_Activate( idEntity *activator );
  170. };
  171. /*
  172. ===============================================================================
  173. idTarget_Give
  174. ===============================================================================
  175. */
  176. class idTarget_Give : public idTarget {
  177. public:
  178. CLASS_PROTOTYPE( idTarget_Give );
  179. void Spawn( void );
  180. private:
  181. void Event_Activate( idEntity *activator );
  182. };
  183. /*
  184. ===============================================================================
  185. idTarget_GiveEmail
  186. ===============================================================================
  187. */
  188. class idTarget_GiveEmail : public idTarget {
  189. public:
  190. CLASS_PROTOTYPE( idTarget_GiveEmail );
  191. void Spawn( void );
  192. private:
  193. void Event_Activate( idEntity *activator );
  194. };
  195. /*
  196. ===============================================================================
  197. idTarget_SetModel
  198. ===============================================================================
  199. */
  200. class idTarget_SetModel : public idTarget {
  201. public:
  202. CLASS_PROTOTYPE( idTarget_SetModel );
  203. void Spawn( void );
  204. private:
  205. void Event_Activate( idEntity *activator );
  206. };
  207. /*
  208. ===============================================================================
  209. idTarget_SetInfluence
  210. ===============================================================================
  211. */
  212. #ifdef _D3XP
  213. typedef struct SavedGui_s {
  214. SavedGui_s() {memset(gui, 0, sizeof(idUserInterface*)*MAX_RENDERENTITY_GUI); };
  215. idUserInterface* gui[MAX_RENDERENTITY_GUI];
  216. } SavedGui_t;
  217. #endif
  218. class idTarget_SetInfluence : public idTarget {
  219. public:
  220. CLASS_PROTOTYPE( idTarget_SetInfluence );
  221. idTarget_SetInfluence( void );
  222. void Save( idSaveGame *savefile ) const;
  223. void Restore( idRestoreGame *savefile );
  224. void Spawn( void );
  225. private:
  226. void Event_Activate( idEntity *activator );
  227. void Event_RestoreInfluence();
  228. void Event_GatherEntities();
  229. void Event_Flash( float flash, int out );
  230. void Event_ClearFlash( float flash );
  231. void Think( void );
  232. idList<int> lightList;
  233. idList<int> guiList;
  234. idList<int> soundList;
  235. idList<int> genericList;
  236. float flashIn;
  237. float flashOut;
  238. float delay;
  239. idStr flashInSound;
  240. idStr flashOutSound;
  241. idEntity * switchToCamera;
  242. idInterpolate<float>fovSetting;
  243. bool soundFaded;
  244. bool restoreOnTrigger;
  245. #ifdef _D3XP
  246. idList<SavedGui_t> savedGuiList;
  247. #endif
  248. };
  249. /*
  250. ===============================================================================
  251. idTarget_SetKeyVal
  252. ===============================================================================
  253. */
  254. class idTarget_SetKeyVal : public idTarget {
  255. public:
  256. CLASS_PROTOTYPE( idTarget_SetKeyVal );
  257. private:
  258. void Event_Activate( idEntity *activator );
  259. };
  260. /*
  261. ===============================================================================
  262. idTarget_SetFov
  263. ===============================================================================
  264. */
  265. class idTarget_SetFov : public idTarget {
  266. public:
  267. CLASS_PROTOTYPE( idTarget_SetFov );
  268. void Save( idSaveGame *savefile ) const;
  269. void Restore( idRestoreGame *savefile );
  270. void Think( void );
  271. private:
  272. idInterpolate<int> fovSetting;
  273. void Event_Activate( idEntity *activator );
  274. };
  275. /*
  276. ===============================================================================
  277. idTarget_SetPrimaryObjective
  278. ===============================================================================
  279. */
  280. class idTarget_SetPrimaryObjective : public idTarget {
  281. public:
  282. CLASS_PROTOTYPE( idTarget_SetPrimaryObjective );
  283. private:
  284. void Event_Activate( idEntity *activator );
  285. };
  286. /*
  287. ===============================================================================
  288. idTarget_LockDoor
  289. ===============================================================================
  290. */
  291. class idTarget_LockDoor: public idTarget {
  292. public:
  293. CLASS_PROTOTYPE( idTarget_LockDoor );
  294. private:
  295. void Event_Activate( idEntity *activator );
  296. };
  297. /*
  298. ===============================================================================
  299. idTarget_CallObjectFunction
  300. ===============================================================================
  301. */
  302. class idTarget_CallObjectFunction : public idTarget {
  303. public:
  304. CLASS_PROTOTYPE( idTarget_CallObjectFunction );
  305. private:
  306. void Event_Activate( idEntity *activator );
  307. };
  308. /*
  309. ===============================================================================
  310. idTarget_LockDoor
  311. ===============================================================================
  312. */
  313. class idTarget_EnableLevelWeapons : public idTarget {
  314. public:
  315. CLASS_PROTOTYPE( idTarget_EnableLevelWeapons );
  316. private:
  317. void Event_Activate( idEntity *activator );
  318. };
  319. /*
  320. ===============================================================================
  321. idTarget_Tip
  322. ===============================================================================
  323. */
  324. class idTarget_Tip : public idTarget {
  325. public:
  326. CLASS_PROTOTYPE( idTarget_Tip );
  327. idTarget_Tip( void );
  328. void Spawn( void );
  329. void Save( idSaveGame *savefile ) const;
  330. void Restore( idRestoreGame *savefile );
  331. private:
  332. idVec3 playerPos;
  333. void Event_Activate( idEntity *activator );
  334. void Event_TipOff( void );
  335. void Event_GetPlayerPos( void );
  336. };
  337. /*
  338. ===============================================================================
  339. idTarget_GiveSecurity
  340. ===============================================================================
  341. */
  342. class idTarget_GiveSecurity : public idTarget {
  343. public:
  344. CLASS_PROTOTYPE( idTarget_GiveSecurity );
  345. private:
  346. void Event_Activate( idEntity *activator );
  347. };
  348. /*
  349. ===============================================================================
  350. idTarget_RemoveWeapons
  351. ===============================================================================
  352. */
  353. class idTarget_RemoveWeapons : public idTarget {
  354. public:
  355. CLASS_PROTOTYPE( idTarget_RemoveWeapons );
  356. private:
  357. void Event_Activate( idEntity *activator );
  358. };
  359. /*
  360. ===============================================================================
  361. idTarget_LevelTrigger
  362. ===============================================================================
  363. */
  364. class idTarget_LevelTrigger : public idTarget {
  365. public:
  366. CLASS_PROTOTYPE( idTarget_LevelTrigger );
  367. private:
  368. void Event_Activate( idEntity *activator );
  369. };
  370. /*
  371. ===============================================================================
  372. idTarget_EnableStamina
  373. ===============================================================================
  374. */
  375. class idTarget_EnableStamina : public idTarget {
  376. public:
  377. CLASS_PROTOTYPE( idTarget_EnableStamina );
  378. private:
  379. void Event_Activate( idEntity *activator );
  380. };
  381. /*
  382. ===============================================================================
  383. idTarget_FadeSoundClass
  384. ===============================================================================
  385. */
  386. class idTarget_FadeSoundClass : public idTarget {
  387. public:
  388. CLASS_PROTOTYPE( idTarget_FadeSoundClass );
  389. private:
  390. void Event_Activate( idEntity *activator );
  391. void Event_RestoreVolume();
  392. };
  393. #endif /* !__GAME_TARGET_H__ */