Target.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  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. class idTarget_SetInfluence : public idTarget {
  213. public:
  214. CLASS_PROTOTYPE( idTarget_SetInfluence );
  215. idTarget_SetInfluence( void );
  216. void Save( idSaveGame *savefile ) const;
  217. void Restore( idRestoreGame *savefile );
  218. void Spawn( void );
  219. private:
  220. void Event_Activate( idEntity *activator );
  221. void Event_RestoreInfluence();
  222. void Event_GatherEntities();
  223. void Event_Flash( float flash, int out );
  224. void Event_ClearFlash( float flash );
  225. void Think( void );
  226. idList<int> lightList;
  227. idList<int> guiList;
  228. idList<int> soundList;
  229. idList<int> genericList;
  230. float flashIn;
  231. float flashOut;
  232. float delay;
  233. idStr flashInSound;
  234. idStr flashOutSound;
  235. idEntity * switchToCamera;
  236. idInterpolate<float>fovSetting;
  237. bool soundFaded;
  238. bool restoreOnTrigger;
  239. };
  240. /*
  241. ===============================================================================
  242. idTarget_SetKeyVal
  243. ===============================================================================
  244. */
  245. class idTarget_SetKeyVal : public idTarget {
  246. public:
  247. CLASS_PROTOTYPE( idTarget_SetKeyVal );
  248. private:
  249. void Event_Activate( idEntity *activator );
  250. };
  251. /*
  252. ===============================================================================
  253. idTarget_SetFov
  254. ===============================================================================
  255. */
  256. class idTarget_SetFov : public idTarget {
  257. public:
  258. CLASS_PROTOTYPE( idTarget_SetFov );
  259. void Save( idSaveGame *savefile ) const;
  260. void Restore( idRestoreGame *savefile );
  261. void Think( void );
  262. private:
  263. idInterpolate<int> fovSetting;
  264. void Event_Activate( idEntity *activator );
  265. };
  266. /*
  267. ===============================================================================
  268. idTarget_SetPrimaryObjective
  269. ===============================================================================
  270. */
  271. class idTarget_SetPrimaryObjective : public idTarget {
  272. public:
  273. CLASS_PROTOTYPE( idTarget_SetPrimaryObjective );
  274. private:
  275. void Event_Activate( idEntity *activator );
  276. };
  277. /*
  278. ===============================================================================
  279. idTarget_LockDoor
  280. ===============================================================================
  281. */
  282. class idTarget_LockDoor: public idTarget {
  283. public:
  284. CLASS_PROTOTYPE( idTarget_LockDoor );
  285. private:
  286. void Event_Activate( idEntity *activator );
  287. };
  288. /*
  289. ===============================================================================
  290. idTarget_CallObjectFunction
  291. ===============================================================================
  292. */
  293. class idTarget_CallObjectFunction : public idTarget {
  294. public:
  295. CLASS_PROTOTYPE( idTarget_CallObjectFunction );
  296. private:
  297. void Event_Activate( idEntity *activator );
  298. };
  299. /*
  300. ===============================================================================
  301. idTarget_LockDoor
  302. ===============================================================================
  303. */
  304. class idTarget_EnableLevelWeapons : public idTarget {
  305. public:
  306. CLASS_PROTOTYPE( idTarget_EnableLevelWeapons );
  307. private:
  308. void Event_Activate( idEntity *activator );
  309. };
  310. /*
  311. ===============================================================================
  312. idTarget_Tip
  313. ===============================================================================
  314. */
  315. class idTarget_Tip : public idTarget {
  316. public:
  317. CLASS_PROTOTYPE( idTarget_Tip );
  318. idTarget_Tip( void );
  319. void Spawn( void );
  320. void Save( idSaveGame *savefile ) const;
  321. void Restore( idRestoreGame *savefile );
  322. private:
  323. idVec3 playerPos;
  324. void Event_Activate( idEntity *activator );
  325. void Event_TipOff( void );
  326. void Event_GetPlayerPos( void );
  327. };
  328. /*
  329. ===============================================================================
  330. idTarget_GiveSecurity
  331. ===============================================================================
  332. */
  333. class idTarget_GiveSecurity : public idTarget {
  334. public:
  335. CLASS_PROTOTYPE( idTarget_GiveSecurity );
  336. private:
  337. void Event_Activate( idEntity *activator );
  338. };
  339. /*
  340. ===============================================================================
  341. idTarget_RemoveWeapons
  342. ===============================================================================
  343. */
  344. class idTarget_RemoveWeapons : public idTarget {
  345. public:
  346. CLASS_PROTOTYPE( idTarget_RemoveWeapons );
  347. private:
  348. void Event_Activate( idEntity *activator );
  349. };
  350. /*
  351. ===============================================================================
  352. idTarget_LevelTrigger
  353. ===============================================================================
  354. */
  355. class idTarget_LevelTrigger : public idTarget {
  356. public:
  357. CLASS_PROTOTYPE( idTarget_LevelTrigger );
  358. private:
  359. void Event_Activate( idEntity *activator );
  360. };
  361. /*
  362. ===============================================================================
  363. idTarget_EnableStamina
  364. ===============================================================================
  365. */
  366. class idTarget_EnableStamina : public idTarget {
  367. public:
  368. CLASS_PROTOTYPE( idTarget_EnableStamina );
  369. private:
  370. void Event_Activate( idEntity *activator );
  371. };
  372. /*
  373. ===============================================================================
  374. idTarget_FadeSoundClass
  375. ===============================================================================
  376. */
  377. class idTarget_FadeSoundClass : public idTarget {
  378. public:
  379. CLASS_PROTOTYPE( idTarget_FadeSoundClass );
  380. private:
  381. void Event_Activate( idEntity *activator );
  382. void Event_RestoreVolume();
  383. };
  384. #endif /* !__GAME_TARGET_H__ */