home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 March / Gamestar_82_2006-03_dvd.iso / DVDStar / Editace / quake4_sdkv10.exe / source / game / Target.h < prev    next >
C/C++ Source or Header  |  2005-11-14  |  15KB  |  705 lines

  1.  
  2. #ifndef __GAME_TARGET_H__
  3. #define __GAME_TARGET_H__
  4.  
  5. //Used to compare two ammoData structs and see who has more.
  6. int                    CompareAmmoData( const void* ammo1, const void* ammo2);
  7.  
  8.  
  9. /*
  10. ===============================================================================
  11.  
  12. idTarget
  13.  
  14. ===============================================================================
  15. */
  16.  
  17. class idTarget : public idEntity {
  18. public:
  19.     CLASS_PROTOTYPE( idTarget );
  20. };
  21.  
  22.  
  23. /*
  24. ===============================================================================
  25.  
  26. idTarget_Remove
  27.  
  28. ===============================================================================
  29. */
  30.  
  31. class idTarget_Remove : public idTarget {
  32. public:
  33.     CLASS_PROTOTYPE( idTarget_Remove );
  34.  
  35. private:
  36.     void                Event_Activate( idEntity *activator );
  37. };
  38.  
  39.  
  40. /*
  41. ===============================================================================
  42.  
  43. idTarget_Show
  44.  
  45. ===============================================================================
  46. */
  47.  
  48. class idTarget_Show : public idTarget {
  49. public:
  50.     CLASS_PROTOTYPE( idTarget_Show );
  51.  
  52. private:
  53.     void                Event_Activate( idEntity *activator );
  54. };
  55.  
  56.  
  57. /*
  58. ===============================================================================
  59.  
  60. idTarget_Damage
  61.  
  62. ===============================================================================
  63. */
  64.  
  65. class idTarget_Damage : public idTarget {
  66. public:
  67.     CLASS_PROTOTYPE( idTarget_Damage );
  68.  
  69. private:
  70.     void                Event_Activate( idEntity *activator );
  71. };
  72.  
  73.  
  74. /*
  75. ===============================================================================
  76.  
  77. idTarget_SessionCommand
  78.  
  79. ===============================================================================
  80. */
  81.  
  82. class idTarget_SessionCommand : public idTarget {
  83. public:
  84.     CLASS_PROTOTYPE( idTarget_SessionCommand );
  85.  
  86. private:
  87.     void                Event_Activate( idEntity *activator );
  88. };
  89.  
  90.  
  91. /*
  92. ===============================================================================
  93.  
  94. idTarget_EndLevel
  95.  
  96. ===============================================================================
  97. */
  98.  
  99. class idTarget_EndLevel : public idTarget {
  100. public:
  101.     CLASS_PROTOTYPE( idTarget_EndLevel );
  102.  
  103. private:
  104.     void                Event_Activate( idEntity *activator );
  105.  
  106. };
  107.  
  108.  
  109. /*
  110. ===============================================================================
  111.  
  112. idTarget_WaitForButton
  113.  
  114. ===============================================================================
  115. */
  116.  
  117. class idTarget_WaitForButton : public idTarget {
  118. public:
  119.     CLASS_PROTOTYPE( idTarget_WaitForButton );
  120.  
  121.     void                Think( void );
  122.  
  123. private:
  124.     void                Event_Activate( idEntity *activator );
  125. };
  126.  
  127. /*
  128. ===============================================================================
  129.  
  130. idTarget_SetGlobalShaderTime
  131.  
  132. ===============================================================================
  133. */
  134.  
  135. class idTarget_SetGlobalShaderTime : public idTarget {
  136. public:
  137.     CLASS_PROTOTYPE( idTarget_SetGlobalShaderTime );
  138.  
  139. private:
  140.     void                Event_Activate( idEntity *activator );
  141. };
  142.  
  143.  
  144. /*
  145. ===============================================================================
  146.  
  147. idTarget_SetShaderParm
  148.  
  149. ===============================================================================
  150. */
  151.  
  152. class idTarget_SetShaderParm : public idTarget {
  153. public:
  154.     CLASS_PROTOTYPE( idTarget_SetShaderParm );
  155.  
  156. private:
  157.     void                Event_Activate( idEntity *activator );
  158. };
  159.  
  160.  
  161. /*
  162. ===============================================================================
  163.  
  164. idTarget_SetShaderTime
  165.  
  166. ===============================================================================
  167. */
  168.  
  169. class idTarget_SetShaderTime : public idTarget {
  170. public:
  171.     CLASS_PROTOTYPE( idTarget_SetShaderTime );
  172.  
  173. private:
  174.     void                Event_Activate( idEntity *activator );
  175. };
  176.  
  177. /*
  178. ===============================================================================
  179.  
  180. idTarget_FadeEntity
  181.  
  182. ===============================================================================
  183. */
  184.  
  185. class idTarget_FadeEntity : public idTarget {
  186. public:
  187.     CLASS_PROTOTYPE( idTarget_FadeEntity );
  188.  
  189.                         idTarget_FadeEntity( void );
  190.  
  191.     void                Save( idSaveGame *savefile ) const;
  192.     void                Restore( idRestoreGame *savefile );
  193.  
  194.     void                Think( void );
  195.  
  196. private:
  197.     idVec4                fadeFrom;
  198.     int                    fadeStart;
  199.     int                    fadeEnd;
  200.  
  201.     void                Event_Activate( idEntity *activator );
  202. };
  203.  
  204. /*
  205. ===============================================================================
  206.  
  207. idTarget_LightFadeIn
  208.  
  209. ===============================================================================
  210. */
  211.  
  212. class idTarget_LightFadeIn : public idTarget {
  213. public:
  214.     CLASS_PROTOTYPE( idTarget_LightFadeIn );
  215.  
  216. private:
  217.     void                Event_Activate( idEntity *activator );
  218. };
  219.  
  220. /*
  221. ===============================================================================
  222.  
  223. idTarget_LightFadeOut
  224.  
  225. ===============================================================================
  226. */
  227.  
  228. class idTarget_LightFadeOut : public idTarget {
  229. public:
  230.     CLASS_PROTOTYPE( idTarget_LightFadeOut );
  231.  
  232. private:
  233.     void                Event_Activate( idEntity *activator );
  234. };
  235.  
  236. /*
  237. ===============================================================================
  238.  
  239. idTarget_Give
  240.  
  241. ===============================================================================
  242. */
  243.  
  244. class idTarget_Give : public idTarget {
  245. public:
  246.     CLASS_PROTOTYPE( idTarget_Give );
  247.  
  248.     void                Spawn( void );
  249.  
  250. private:
  251.     void                Event_Activate( idEntity *activator );
  252. // RAVEN BEGIN
  253. // abahr: fixing issue with EV_Activate not taking NULL ptrs
  254.     void                Event_PostSpawn();
  255. // RAVEN END
  256. };
  257.  
  258.  
  259. /*
  260. ===============================================================================
  261.  
  262. idTarget_GiveEmail
  263.  
  264. ===============================================================================
  265. */
  266.  
  267. class idTarget_GiveEmail : public idTarget {
  268. public:
  269.     CLASS_PROTOTYPE( idTarget_GiveEmail );
  270.  
  271.     void                Spawn( void );
  272.  
  273. private:
  274.     void                Event_Activate( idEntity *activator );
  275. };
  276.  
  277. /*
  278. ===============================================================================
  279.  
  280. idTarget_SetModel
  281.  
  282. ===============================================================================
  283. */
  284.  
  285. class idTarget_SetModel : public idTarget {
  286. public:
  287.     CLASS_PROTOTYPE( idTarget_SetModel );
  288.  
  289.     void                Spawn( void );
  290.  
  291. private:
  292.     void                Event_Activate( idEntity *activator );
  293. };
  294.  
  295.  
  296. /*
  297. ===============================================================================
  298.  
  299. idTarget_SetInfluence
  300.  
  301. ===============================================================================
  302. */
  303.  
  304. class idTarget_SetInfluence : public idTarget {
  305. public:
  306.     CLASS_PROTOTYPE( idTarget_SetInfluence );
  307.  
  308.                         idTarget_SetInfluence( void );
  309.  
  310.     void                Save( idSaveGame *savefile ) const;
  311.     void                Restore( idRestoreGame *savefile );
  312.  
  313.     void                Spawn( void );
  314.  
  315. private:
  316.     void                Event_Activate( idEntity *activator );
  317.     void                Event_RestoreInfluence();
  318.     void                Event_GatherEntities();
  319.     void                Event_Flash( float flash, int out );
  320.     void                Event_ClearFlash( float flash );
  321.     void                Think( void );
  322.  
  323.     idList<int>            lightList;
  324.     idList<int>            guiList;
  325.     idList<int>            soundList;
  326.     idList<int>            genericList;
  327.     float                flashIn;
  328.     float                flashOut;
  329.     float                delay;
  330.     idStr                flashInSound;
  331.     idStr                flashOutSound;
  332.     idEntity *            switchToCamera;
  333.     idInterpolate<float>fovSetting;
  334.     bool                soundFaded;
  335.     bool                restoreOnTrigger;
  336. };
  337.  
  338.  
  339. /*
  340. ===============================================================================
  341.  
  342. idTarget_SetKeyVal
  343.  
  344. ===============================================================================
  345. */
  346.  
  347. class idTarget_SetKeyVal : public idTarget {
  348. public:
  349.     CLASS_PROTOTYPE( idTarget_SetKeyVal );
  350.  
  351. private:
  352.     void                Event_Activate( idEntity *activator );
  353. };
  354.  
  355.  
  356. /*
  357. ===============================================================================
  358.  
  359. idTarget_SetFov
  360.  
  361. ===============================================================================
  362. */
  363.  
  364. class idTarget_SetFov : public idTarget {
  365. public:
  366.     CLASS_PROTOTYPE( idTarget_SetFov );
  367.  
  368.     void                Save( idSaveGame *savefile ) const;
  369.     void                Restore( idRestoreGame *savefile );
  370.  
  371.     void                Think( void );
  372.  
  373. private:
  374.     idInterpolate<int>    fovSetting;
  375.  
  376.     void                Event_Activate( idEntity *activator );
  377. };
  378.  
  379.  
  380. /*
  381. ===============================================================================
  382.  
  383. idTarget_SetPrimaryObjective
  384.  
  385. ===============================================================================
  386. */
  387.  
  388. class idTarget_SetPrimaryObjective : public idTarget {
  389. public:
  390.     CLASS_PROTOTYPE( idTarget_SetPrimaryObjective );
  391.  
  392. private:
  393.     void                Event_Activate( idEntity *activator );
  394. };
  395.  
  396. // RAVEN BEGIN
  397. // bdube: added player database
  398. /*
  399. ===============================================================================
  400.  
  401. idTarget_AddDatabaseEntry
  402.  
  403. ===============================================================================
  404. */
  405.  
  406. class rvTarget_AddDatabaseEntry : public idTarget {
  407. public:
  408.     CLASS_PROTOTYPE( rvTarget_AddDatabaseEntry );
  409.  
  410. private:
  411.     void                Event_Activate( idEntity *activator );
  412. };
  413.  
  414. // jshepard: secret area discovery
  415.  
  416. /*
  417. ===============================================================================
  418.  
  419. idTarget_SecretArea
  420.  
  421. ===============================================================================
  422. */
  423.  
  424. class rvTarget_SecretArea : public idTarget {
  425. public:
  426.     CLASS_PROTOTYPE( rvTarget_SecretArea );
  427.  
  428. private:
  429.     void                Event_Activate( idEntity *activator );
  430. };
  431.  
  432. /*
  433. ===============================================================================
  434.  
  435. rvTarget_BossBattle
  436.  
  437. ===============================================================================
  438. */
  439.  
  440. class rvTarget_BossBattle : public idTarget {
  441. public:
  442.     CLASS_PROTOTYPE( rvTarget_BossBattle );
  443.  
  444. private:
  445.     void                Event_Activate( idEntity *activator );
  446.     void                Event_SetShieldPercent( float percent );
  447.     void                Event_SetBossMaxHealth( float f );
  448.     void                Event_AllowShieldBar( float activate );
  449.     void                Event_AllowShieldWarningBar( float activate );
  450.  
  451. };
  452.  
  453. /*
  454. ===============================================================================
  455.  
  456. rvTarget_TetherAI
  457.  
  458. ===============================================================================
  459. */
  460.  
  461. class rvTarget_TetherAI : public idTarget {
  462. public:
  463.     CLASS_PROTOTYPE( rvTarget_TetherAI );
  464.  
  465. private:
  466.     void                Event_Activate( idEntity *activator );
  467. };
  468.  
  469.  
  470. /*
  471. ===============================================================================
  472.  
  473. rvTarget_Nailable
  474.  
  475. ===============================================================================
  476. */
  477.  
  478. class rvTarget_Nailable : public idTarget {
  479. public:
  480.     CLASS_PROTOTYPE( rvTarget_Nailable );
  481.  
  482. private:
  483.     void                Spawn( void );
  484. };
  485.  
  486.  
  487. // RAVEN END
  488.  
  489. /*
  490. ===============================================================================
  491.  
  492. idTarget_LockDoor
  493.  
  494. ===============================================================================
  495. */
  496.  
  497. class idTarget_LockDoor: public idTarget {
  498. public:
  499.     CLASS_PROTOTYPE( idTarget_LockDoor );
  500.  
  501. private:
  502.     void                Event_Activate( idEntity *activator );
  503. };
  504.  
  505. /*
  506. ===============================================================================
  507.  
  508. idTarget_CallObjectFunction
  509.  
  510. ===============================================================================
  511. */
  512.  
  513. class idTarget_CallObjectFunction : public idTarget {
  514. public:
  515.     CLASS_PROTOTYPE( idTarget_CallObjectFunction );
  516.  
  517. private:
  518.     void                Event_Activate( idEntity *activator );
  519. };
  520.  
  521.  
  522. /*
  523. ===============================================================================
  524.  
  525. idTarget_LockDoor
  526.  
  527. ===============================================================================
  528. */
  529.  
  530. class idTarget_EnableLevelWeapons : public idTarget {
  531. public:
  532.     CLASS_PROTOTYPE( idTarget_EnableLevelWeapons );
  533.  
  534. private:
  535.     void                Event_Activate( idEntity *activator );
  536. };
  537.  
  538.  
  539. /*
  540. ===============================================================================
  541.  
  542. idTarget_Tip
  543.  
  544. ===============================================================================
  545. */
  546.  
  547. class idTarget_Tip : public idTarget {
  548. public:
  549.     CLASS_PROTOTYPE( idTarget_Tip );
  550.  
  551.                         idTarget_Tip( void );
  552.  
  553.     void                Spawn( void );
  554.  
  555.     void                Save( idSaveGame *savefile ) const;
  556.     void                Restore( idRestoreGame *savefile );
  557.  
  558. private:
  559.     idVec3                playerPos;
  560.  
  561.     void                Event_Activate( idEntity *activator );
  562.     void                Event_TipOff( void );
  563.     void                Event_GetPlayerPos( void );
  564. };
  565.  
  566. /*
  567. ===============================================================================
  568.  
  569. idTarget_GiveSecurity
  570.  
  571. ===============================================================================
  572. */
  573. class idTarget_GiveSecurity : public idTarget {
  574. public:
  575.     CLASS_PROTOTYPE( idTarget_GiveSecurity );
  576. private:
  577.     void                Event_Activate( idEntity *activator );
  578. };
  579.  
  580.  
  581. /*
  582. ===============================================================================
  583.  
  584. idTarget_RemoveWeapons
  585.  
  586. ===============================================================================
  587. */
  588. class idTarget_RemoveWeapons : public idTarget {
  589. public:
  590.     CLASS_PROTOTYPE( idTarget_RemoveWeapons );
  591. private:
  592.     void                Event_Activate( idEntity *activator );
  593. };
  594.  
  595.  
  596. /*
  597. ===============================================================================
  598.  
  599. idTarget_LevelTrigger
  600.  
  601. ===============================================================================
  602. */
  603. class idTarget_LevelTrigger : public idTarget {
  604. public:
  605.     CLASS_PROTOTYPE( idTarget_LevelTrigger );
  606. private:
  607.     void                Event_Activate( idEntity *activator );
  608. };
  609.  
  610. /*
  611. ===============================================================================
  612.  
  613. idTarget_EnableStamina
  614.  
  615. ===============================================================================
  616. */
  617. class idTarget_EnableStamina : public idTarget {
  618. public:
  619.     CLASS_PROTOTYPE( idTarget_EnableStamina );
  620. private:
  621.     void                Event_Activate( idEntity *activator );
  622. };
  623.  
  624. /*
  625. ===============================================================================
  626.  
  627. idTarget_FadeSoundClass
  628.  
  629. ===============================================================================
  630. */
  631. class idTarget_FadeSoundClass : public idTarget {
  632. public:
  633.     CLASS_PROTOTYPE( idTarget_FadeSoundClass );
  634. private:
  635.     void                Event_Activate( idEntity *activator );
  636.     void                Event_RestoreVolume();
  637. };
  638.  
  639.  
  640. /*
  641. ===============================================================================
  642.  
  643. rvTarget_LaunchProjectile
  644.  
  645. ===============================================================================
  646. */
  647.  
  648. class rvTarget_LaunchProjectile : public idTarget {
  649. public:
  650.     CLASS_PROTOTYPE( rvTarget_LaunchProjectile );
  651.  
  652.     void                Spawn( void );
  653.  
  654. private:
  655.     void                Event_Activate( idEntity *activator );
  656.     void                Event_LaunchProjectile( idEntity *activator );
  657. };
  658.  
  659. /*
  660. ===============================================================================
  661.  
  662. rvTarget_ExitAreaAlert
  663.  
  664. ===============================================================================
  665. */
  666.  
  667. class rvTarget_ExitAreaAlert : public idTarget {
  668. public:
  669.     CLASS_PROTOTYPE( rvTarget_ExitAreaAlert );
  670.  
  671. private:
  672.     void                Event_Activate( idEntity *activator );
  673. };
  674.  
  675. /*
  676. ===============================================================================
  677.  
  678. rvTarget_AmmoStash
  679.  
  680. ===============================================================================
  681. */
  682. typedef struct    ammodata_s    {
  683.  
  684.     int            ammoIndex;
  685.     idStr        ammoName;
  686.     int            ammoCount;
  687.     int            ammoMax;
  688.     float        percentFull;
  689.  
  690. } ammodata_t;
  691.  
  692. #define AMMO_ARRAY_SIZE 10
  693.  
  694. class rvTarget_AmmoStash : public idTarget {
  695. public:
  696.     CLASS_PROTOTYPE( rvTarget_AmmoStash );
  697.  
  698.     //used to detect which weapons need ammo. The values stored are 0 to 1, with -1 meaning don't check this out.
  699.     ammodata_t            AmmoArray[ AMMO_ARRAY_SIZE];
  700.  
  701. private:
  702.     void                Event_Activate( idEntity *activator );
  703. };
  704. #endif /* !__GAME_TARGET_H__ */
  705.