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

  1.  
  2. #ifndef __GAME_MISC_H__
  3. #define __GAME_MISC_H__
  4.  
  5. /*
  6. ===============================================================================
  7.  
  8. idSpawnableEntity
  9.  
  10. A simple, spawnable entity with a model and no functionable ability of it's own.
  11. For example, it can be used as a placeholder during development, for marking
  12. locations on maps for script, or for simple placed models without any behavior
  13. that can be bound to other entities.  Should not be subclassed.
  14. ===============================================================================
  15. */
  16.  
  17. class idSpawnableEntity : public idEntity {
  18. public:
  19.     CLASS_PROTOTYPE( idSpawnableEntity );
  20.  
  21.     void                Spawn( void );
  22.  
  23. private:
  24. };
  25.  
  26. /*
  27. ===============================================================================
  28.  
  29.   Potential spawning position for players.
  30.   The first time a player enters the game, they will be at an 'initial' spot.
  31.   Targets will be fired when someone spawns in on them.
  32.  
  33.   When triggered, will cause player to be teleported to spawn spot.
  34.  
  35. ===============================================================================
  36. */
  37.  
  38. class idPlayerStart : public idEntity {
  39. public:
  40.     CLASS_PROTOTYPE( idPlayerStart );
  41.  
  42.     enum {
  43.         EVENT_TELEPORTPLAYER = idEntity::EVENT_MAXEVENTS,
  44.         EVENT_MAXEVENTS
  45.     };
  46.  
  47.                         idPlayerStart( void );
  48.  
  49.     void                Spawn( void );
  50.  
  51.     void                Save( idSaveGame *savefile ) const;
  52.     void                Restore( idRestoreGame *savefile );
  53.  
  54.     virtual bool        ClientReceiveEvent( int event, int time, const idBitMsg &msg );
  55.  
  56. private:
  57.     int                    teleportStage;
  58.  
  59.     void                Event_TeleportPlayer( idEntity *activator );
  60.     void                Teleport( idEntity* other );
  61.     void                Event_TeleportStage( idPlayer *player );
  62.     void                Event_ResetCamera( idPlayer *player );
  63.     void                TeleportPlayer( idPlayer *player );
  64. };
  65.  
  66.  
  67. /*
  68. ===============================================================================
  69.  
  70.   Non-displayed entity used to activate triggers when it touches them.
  71.   Bind to a mover to have the mover activate a trigger as it moves.
  72.   When target by triggers, activating the trigger will toggle the
  73.   activator on and off. Check "start_off" to have it spawn disabled.
  74.     
  75. ===============================================================================
  76. */
  77.  
  78. class idActivator : public idEntity {
  79. public:
  80.     CLASS_PROTOTYPE( idActivator );
  81.  
  82.     void                Spawn( void );
  83.  
  84.     void                Save( idSaveGame *savefile ) const;
  85.     void                Restore( idRestoreGame *savefile );
  86.  
  87.     virtual void        Think( void );
  88.  
  89. private:
  90.     bool                stay_on;
  91.  
  92.     void                Event_Activate( idEntity *activator );
  93. };
  94.  
  95. /*
  96. ===============================================================================
  97.  
  98.   Path entities for monsters to follow.
  99.  
  100. ===============================================================================
  101. */
  102. class idPathCorner : public idEntity {
  103. public:
  104.     CLASS_PROTOTYPE( idPathCorner );
  105.  
  106.     void                Spawn( void );
  107.  
  108.     static void            DrawDebugInfo( void );
  109.  
  110.     static idPathCorner *RandomPath( const idEntity *source, const idEntity *ignore );
  111.  
  112. private:
  113.     void                Event_RandomPath( void );
  114. };
  115.  
  116. // RAVEN BEGIN
  117. // bdube: jump points
  118. /*
  119. ===============================================================================
  120.  
  121.   Debug Jump Point
  122.  
  123. ===============================================================================
  124. */
  125.  
  126. class rvDebugJumpPoint : public idEntity {
  127. public:
  128.  
  129.     CLASS_PROTOTYPE( rvDebugJumpPoint );
  130.  
  131.     void                Spawn();
  132. };
  133.  
  134. /*
  135. ===============================================================================
  136.  
  137.   Object that fires targets and changes shader parms when damaged.
  138.  
  139. ===============================================================================
  140. */
  141.  
  142. class idDamagable : public idEntity {
  143. public:
  144.     CLASS_PROTOTYPE( idDamagable );
  145.  
  146.                         idDamagable( void );
  147.  
  148.     void                Save( idSaveGame *savefile ) const;
  149.     void                Restore( idRestoreGame *savefile );
  150.  
  151.     void                Spawn( void );
  152.     void                Killed( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location );
  153.  
  154. // RAVEN BEGIN
  155. // abahr:
  156.     virtual void        Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir, const char *damageDefName, const float damageScale, const int location );
  157.  
  158.     int                    invincibleTime;
  159. // RAVEN BEGIN
  160. // abahr: changed to protected
  161. protected:
  162.     int                    stage;
  163.     int                    stageNext;
  164.     const idDict*        stageDict;
  165.     int                    stageEndTime;
  166.     int                    stageEndHealth;
  167.     int                    stageEndSpeed;
  168. //jshepard: used to end a stage if a moveable is on the ground (for falling objects)
  169.     bool                stageEndOnGround;
  170. //jshepard: we want to activate certain objects when triggered-- falling blocks yes, barrels no.
  171.     bool                activateStageOnTrigger;
  172.         
  173.     virtual void        ExecuteStage    ( void );
  174.     void                UpdateStage        ( void );
  175.     idVec3                GetStageVector    ( const char* key, const char* defaultString = "" ) const;
  176.     float                GetStageFloat    ( const char* key, const char* defaultString = "" ) const;
  177.     int                    GetStageInt        ( const char* key, const char* defaultString = "" ) const;
  178. // RAVEN END
  179.  
  180.     int                    count;
  181.     int                    nextTriggerTime;
  182.  
  183.     void                BecomeBroken( idEntity *activator );
  184.     void                Event_BecomeBroken( idEntity *activator );
  185.     void                Event_RestoreDamagable( void );
  186. };
  187.  
  188. /*
  189. ===============================================================================
  190.  
  191.   Hidden object that explodes when activated
  192.  
  193. ===============================================================================
  194. */
  195.  
  196. class idExplodable : public idEntity {
  197. public:
  198.     CLASS_PROTOTYPE( idExplodable );
  199.  
  200.     void                Spawn( void );
  201.  
  202. private:
  203.     void                Event_Explode( idEntity *activator );
  204. };
  205.  
  206.  
  207. /*
  208. ===============================================================================
  209.  
  210.   idSpring
  211.  
  212. ===============================================================================
  213. */
  214.  
  215. class idSpring : public idEntity {
  216. public:
  217.     CLASS_PROTOTYPE( idSpring );
  218.  
  219.     void                Spawn( void );
  220.     void                Save( idSaveGame *savefile ) const;
  221.     void                Restore( idRestoreGame *savefile );
  222.  
  223.     virtual void        Think( void );
  224.  
  225. private:
  226.     idEntityPtr<idEntity>    ent1;
  227.     idEntityPtr<idEntity>    ent2;
  228.     int                        id1;
  229.     int                        id2;
  230.     idVec3                    p1;
  231.     idVec3                    p2;
  232.     idForce_Spring            spring;
  233.  
  234.     void                Event_LinkSpring( void );
  235. };
  236.  
  237.  
  238. /*
  239. ===============================================================================
  240.  
  241.   idForceField
  242.  
  243. ===============================================================================
  244. */
  245.  
  246. class idForceField : public idEntity {
  247. public:
  248.     CLASS_PROTOTYPE( idForceField );
  249.  
  250.     void                Save( idSaveGame *savefile ) const;
  251.     void                Restore( idRestoreGame *savefile );
  252.  
  253.     void                Spawn( void );
  254.  
  255.     virtual void        Think( void );
  256.  
  257. // RAVEN BEGIN
  258. // kfuller: idDamagable may want to change some things on the fly
  259.     void                SetExplosion(float force) { forceField.Explosion(force); }
  260. // RAVEN END
  261.  
  262.  
  263. // RAVEN BEGIN
  264. // bdube: made force field protected
  265. protected:
  266.  
  267.     idForce_Field        forceField;
  268.     
  269. private:
  270. // RAVEN END
  271.     void                Toggle( void );
  272.  
  273.     void                Event_Activate( idEntity *activator );
  274.     void                Event_Toggle( void );
  275.     void                Event_FindTargets( void );
  276. };
  277.  
  278. // RAVEN BEGIN
  279. // bdube: jump pads
  280. /*
  281. ===============================================================================
  282.  
  283.   rvJumpPad
  284.  
  285. ===============================================================================
  286. */
  287.  
  288. class rvJumpPad : public idForceField {
  289. public:
  290.     CLASS_PROTOTYPE( rvJumpPad );
  291.  
  292.     rvJumpPad ( void );
  293.  
  294.     void                Spawn( void );
  295.     void                Think( void );
  296.  
  297. private:
  298.  
  299.     int                    lastEffectTime;
  300.  
  301.     void                Event_FindTargets( void );
  302.  
  303.     enum {
  304.         EVENT_JUMPFX = idEntity::EVENT_MAXEVENTS,
  305.         EVENT_MAXEVENTS
  306.     };
  307.     bool                ClientReceiveEvent( int event, int time, const idBitMsg &msg );
  308.  
  309.     idMat3                effectAxis;
  310. };
  311. // RAVEN END
  312.  
  313. /*
  314. ===============================================================================
  315.  
  316.   idAnimated
  317.  
  318. ===============================================================================
  319. */
  320.  
  321. class idAnimated : public idAFEntity_Gibbable {
  322. public:
  323.     CLASS_PROTOTYPE( idAnimated );
  324.  
  325.                             idAnimated();
  326.                             ~idAnimated();
  327.  
  328.     void                    Save( idSaveGame *savefile ) const;
  329.     void                    Restore( idRestoreGame *savefile );
  330.  
  331.     void                    Spawn( void );
  332.     virtual bool            LoadAF( const char* keyname );
  333.     bool                    StartRagdoll( void );
  334.     virtual bool            GetPhysicsToSoundTransform( idVec3 &origin, idMat3 &axis );
  335.  
  336. // RAVEN BEGIN
  337. // bdube: script 
  338.     void                    Think ( void );
  339.     
  340.     virtual    void            Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir, const char *damageDefName, const float damageScale, const int location );
  341.      virtual bool            ShouldConstructScriptObjectAtSpawn( void ) const;
  342. // RAVEN END
  343.  
  344. private:
  345.     int                        num_anims;
  346.     int                        current_anim_index;
  347.     int                        anim;
  348.     int                        blendFrames;
  349.     jointHandle_t            soundJoint;
  350.     idEntityPtr<idEntity>    activator;
  351.     bool                    activated;
  352.  
  353. // RAVEN BEGIN
  354. // bdube: script variables
  355.     // script control
  356.     idThread *                scriptThread;
  357.     idStr                    state;
  358.     idStr                    idealState;
  359.     int                        animDoneTime[ANIM_NumAnimChannels];
  360.  
  361.     // Script state management
  362.     void                    UpdateScript( void );
  363.     void                    SetState( const char *statename, int blend );
  364.     void                    CallHandler ( const char* handler );
  365. // RAVEN END
  366.  
  367.     void                    PlayNextAnim( void );
  368.  
  369.     void                    Event_Activate( idEntity *activator );    
  370.     void                    Event_Start( void );
  371.     void                    Event_StartRagdoll( void );
  372.     void                    Event_AnimDone( int animIndex );
  373.     void                    Event_Footstep( void );
  374.     void                    Event_LaunchMissiles( const char *projectilename, const char *sound, const char *launchjoint, const char *targetjoint, int numshots, int framedelay );
  375.     void                    Event_LaunchMissilesUpdate( int launchjoint, int targetjoint, int numshots, int framedelay );
  376.  
  377. // RAVEN BEGIN
  378. // kfuller: added
  379.     void                    Event_SetAnimState( const char* state, int blendframes );
  380.     void                    Event_PlayAnim( int channel, const char *animname );
  381.     void                    Event_PlayCycle( int channel, const char *animname );
  382.     void                    Event_AnimDone2( int channel, int blendFrames );
  383. // RAVEN END    
  384. };
  385.  
  386. /*
  387. ===============================================================================
  388.  
  389.   idStaticEntity
  390.  
  391. ===============================================================================
  392. */
  393.  
  394. class idStaticEntity : public idEntity {
  395. public:
  396.     CLASS_PROTOTYPE( idStaticEntity );
  397.  
  398.                         idStaticEntity( void );
  399.  
  400.     void                Save( idSaveGame *savefile ) const;
  401.     void                Restore( idRestoreGame *savefile );
  402.  
  403.     void                Spawn( void );
  404.     void                ShowEditingDialog( void );
  405.     virtual void        Hide( void );
  406.     virtual void        Show( void );
  407.     void                Fade( const idVec4 &to, float fadeTime );
  408.     virtual void        Think( void );
  409.  
  410.     virtual void        WriteToSnapshot( idBitMsgDelta &msg ) const;
  411.     virtual void        ReadFromSnapshot( const idBitMsgDelta &msg );
  412.  
  413. private:
  414.     void                Event_Activate( idEntity *activator );
  415.  
  416.     int                    spawnTime;
  417.     bool                active;
  418.     idVec4                fadeFrom;
  419.     idVec4                fadeTo;
  420.     int                    fadeStart;
  421.     int                    fadeEnd;
  422.     bool                runGui;
  423. };
  424.  
  425.  
  426. /*
  427. ===============================================================================
  428.  
  429. idFuncEmitter
  430.  
  431. ===============================================================================
  432. */
  433.  
  434. class idFuncEmitter : public idStaticEntity {
  435. public:
  436.     CLASS_PROTOTYPE( idFuncEmitter );
  437.  
  438.                         idFuncEmitter( void );
  439.  
  440.     void                Save( idSaveGame *savefile ) const;
  441.     void                Restore( idRestoreGame *savefile );
  442.  
  443.     void                Spawn( void );
  444.     void                Event_Activate( idEntity *activator );
  445.  
  446.     virtual void        WriteToSnapshot( idBitMsgDelta &msg ) const;
  447.     virtual void        ReadFromSnapshot( const idBitMsgDelta &msg );
  448.  
  449. private:
  450.     bool                hidden;
  451.  
  452. };
  453.  
  454.  
  455. // RAVEN BEGIN
  456. // bdube: not using
  457. #if 0
  458. // RAVEN END
  459.  
  460. /*
  461. ===============================================================================
  462.  
  463. idFuncSmoke
  464.  
  465. ===============================================================================
  466. */
  467.  
  468. class idFuncSmoke : public idEntity {
  469. public:
  470.     CLASS_PROTOTYPE( idFuncSmoke );
  471.  
  472.                             idFuncSmoke();
  473.  
  474.     void                    Spawn( void );
  475.  
  476.     void                    Save( idSaveGame *savefile ) const;
  477.     void                    Restore( idRestoreGame *savefile );
  478.  
  479.     virtual void            Think( void );
  480.     void                    Event_Activate( idEntity *activator );
  481.  
  482. private:
  483.     int                        smokeTime;
  484.     const idDeclParticle *    smoke;
  485.     bool                    restart;
  486. };
  487.  
  488. // RAVEN BEGIN
  489. // bdube: not using
  490. #endif
  491. // RAVEN END
  492.  
  493. /*
  494. ===============================================================================
  495.  
  496. idFuncSplat
  497.  
  498. ===============================================================================
  499. */
  500.  
  501. class idFuncSplat : public idFuncEmitter {
  502. public:
  503.     CLASS_PROTOTYPE( idFuncSplat );
  504.  
  505.     idFuncSplat( void );
  506.  
  507.     void                Spawn( void );
  508.  
  509. private:
  510.     void                Event_Activate( idEntity *activator );
  511.     void                Event_Splat();
  512. };
  513.  
  514.  
  515. /*
  516. ===============================================================================
  517.  
  518. idTextEntity
  519.  
  520. ===============================================================================
  521. */
  522.  
  523. class idTextEntity : public idEntity {
  524. public:
  525.     CLASS_PROTOTYPE( idTextEntity );
  526.  
  527.     void                Spawn( void );
  528.  
  529.     void                Save( idSaveGame *savefile ) const;
  530.     void                Restore( idRestoreGame *savefile );
  531.  
  532.     virtual void        Think( void );
  533.     virtual void        ClientPredictionThink( void );
  534.  
  535. private:
  536.     idStr                text;
  537.     bool                playerOriented;
  538. };
  539.  
  540.  
  541. /*
  542. ===============================================================================
  543.  
  544. idLocationEntity
  545.  
  546. ===============================================================================
  547. */
  548.  
  549. class idLocationEntity : public idEntity {
  550. public:
  551.     CLASS_PROTOTYPE( idLocationEntity );
  552.  
  553.     void                Spawn( void );
  554.  
  555.     const char *        GetLocation( void ) const;
  556.  
  557. private:
  558. };
  559.  
  560. class idLocationSeparatorEntity : public idEntity {
  561. public:
  562.     CLASS_PROTOTYPE( idLocationSeparatorEntity );
  563.  
  564.     void                Spawn( void );
  565.  
  566. private:
  567. };
  568.  
  569. class idVacuumSeparatorEntity : public idEntity {
  570. public:
  571.     CLASS_PROTOTYPE( idVacuumSeparatorEntity );
  572.  
  573.                         idVacuumSeparatorEntity( void );
  574.  
  575.     void                Spawn( void );
  576.  
  577.     void                Save( idSaveGame *savefile ) const;
  578.     void                Restore( idRestoreGame *savefile );
  579.  
  580.     void                Event_Activate( idEntity *activator );    
  581.  
  582. private:
  583.     qhandle_t            portal;
  584. };
  585.  
  586. class idVacuumEntity : public idEntity {
  587. public:
  588.     CLASS_PROTOTYPE( idVacuumEntity );
  589.  
  590.     void                Spawn( void );
  591.  
  592. private:
  593. };
  594.  
  595. // RAVEN BEGIN
  596. // abahr
  597. class rvGravitySeparatorEntity : public idEntity {
  598. public:
  599.     CLASS_PROTOTYPE( rvGravitySeparatorEntity );
  600.  
  601.                         rvGravitySeparatorEntity( void );
  602.  
  603.     void                Spawn( void );
  604.  
  605.     void                Save( idSaveGame *savefile ) const;
  606.     void                Restore( idRestoreGame *savefile );
  607.  
  608.     void                Event_Activate( idEntity *activator );    
  609.  
  610. private:
  611.     qhandle_t            portal;
  612. };
  613.  
  614. class rvGravityArea : public idEntity {
  615. public:
  616.     ABSTRACT_PROTOTYPE( rvGravityArea );
  617.  
  618.     void                    Spawn( void );
  619.  
  620.     virtual int                GetArea() const { return area; }
  621.     virtual const idVec3    GetGravity( const idVec3& origin, const idMat3& axis, int clipMask, idEntity* passEntity ) const = 0;
  622.     virtual const idVec3    GetGravity( const idEntity* ent ) const = 0;
  623.     virtual const idVec3    GetGravity( const rvClientEntity* ent ) const = 0;
  624.  
  625.     void                    Save( idSaveGame *savefile ) const;
  626.     void                    Restore( idRestoreGame *savefile );
  627.  
  628.     bool                    IsEqualTo( const rvGravityArea* area ) const;
  629.     bool                    operator==( const rvGravityArea* area ) const;
  630.     bool                    operator==( const rvGravityArea& area ) const;
  631.     bool                    operator!=( const rvGravityArea* area ) const;
  632.     bool                    operator!=( const rvGravityArea& area ) const;
  633.  
  634. protected:
  635.     int                        area;
  636. };
  637.  
  638. class rvGravityArea_Static : public rvGravityArea {
  639. public:
  640.     CLASS_PROTOTYPE( rvGravityArea_Static );
  641.  
  642.     void                    Spawn( void );
  643.  
  644.     virtual const idVec3    GetGravity( const idVec3& origin, const idMat3& axis, int clipMask, idEntity* passEntity ) const { return gravity; }
  645.     virtual const idVec3    GetGravity( const idEntity* ent ) const { return gravity; }
  646.     virtual const idVec3    GetGravity( const rvClientEntity* ent ) const { return gravity; }
  647.  
  648.     void                    Save( idSaveGame *savefile ) const;
  649.     void                    Restore( idRestoreGame *savefile );
  650.  
  651. protected:
  652.     idVec3                    gravity;
  653. };
  654.  
  655. class rvGravityArea_SurfaceNormal : public rvGravityArea {
  656. public:
  657.     CLASS_PROTOTYPE( rvGravityArea_SurfaceNormal );
  658.  
  659.     virtual const idVec3    GetGravity( const idVec3& origin, const idMat3& axis, int clipMask, idEntity* passEntity ) const;
  660.     virtual const idVec3    GetGravity( const idEntity* ent ) const;
  661.     virtual const idVec3    GetGravity( const rvClientEntity* ent ) const;
  662.  
  663. protected:
  664.     virtual const idVec3    GetGravity( const idPhysics* physics ) const;
  665. };
  666. // RAVEN END
  667.  
  668. /*
  669. ===============================================================================
  670.  
  671.   idBeam
  672.  
  673. ===============================================================================
  674. */
  675.  
  676. class idBeam : public idEntity {
  677. public:
  678.     CLASS_PROTOTYPE( idBeam );
  679.  
  680.                         idBeam();
  681.  
  682.     void                Spawn( void );
  683.  
  684.     void                Save( idSaveGame *savefile ) const;
  685.     void                Restore( idRestoreGame *savefile );
  686.  
  687.     virtual void        Think( void );
  688.  
  689.     void                SetMaster( idBeam *masterbeam );
  690.     void                SetBeamTarget( const idVec3 &origin );
  691.  
  692.     virtual void        Show( void );
  693.  
  694.     virtual void        WriteToSnapshot( idBitMsgDelta &msg ) const;
  695.     virtual void        ReadFromSnapshot( const idBitMsgDelta &msg );
  696.  
  697. private:
  698.     void                Event_MatchTarget( void );
  699.     void                Event_Activate( idEntity *activator );
  700.  
  701.     idEntityPtr<idBeam>    target;
  702.     idEntityPtr<idBeam>    master;
  703. };
  704.  
  705.  
  706. /*
  707. ===============================================================================
  708.  
  709.   idLiquid
  710.  
  711. ===============================================================================
  712. */
  713.  
  714. class idRenderModelLiquid;
  715.  
  716. class idLiquid : public idEntity {
  717. public:
  718.     CLASS_PROTOTYPE( idLiquid );
  719.  
  720.     void                Spawn( void );
  721.  
  722.     void                Save( idSaveGame *savefile ) const;
  723.     void                Restore( idRestoreGame *savefile );
  724.  
  725. private:
  726.     void                Event_Touch( idEntity *other, trace_t *trace );
  727.  
  728.  
  729.     idRenderModelLiquid *model;
  730. };
  731.  
  732.  
  733. /*
  734. ===============================================================================
  735.  
  736.   idShaking
  737.  
  738. ===============================================================================
  739. */
  740.  
  741. class idShaking : public idEntity {
  742. public:
  743.     CLASS_PROTOTYPE( idShaking );
  744.  
  745.                             idShaking();
  746.                             ~idShaking();
  747.  
  748.     void                    Spawn( void );
  749.  
  750.     void                    Save( idSaveGame *savefile ) const;
  751.     void                    Restore( idRestoreGame *savefile );
  752.  
  753. private:
  754.     idPhysics_Parametric    physicsObj;
  755.     bool                    active;
  756.  
  757.     void                    BeginShaking( void );
  758.     void                    Event_Activate( idEntity *activator );
  759. };
  760.  
  761.  
  762. /*
  763. ===============================================================================
  764.  
  765.   idEarthQuake
  766.  
  767. ===============================================================================
  768. */
  769.  
  770. class idEarthQuake : public idEntity {
  771. public:
  772.     CLASS_PROTOTYPE( idEarthQuake );
  773.             
  774.                         idEarthQuake();
  775.  
  776.     void                Spawn( void );
  777.  
  778.     void                Save( idSaveGame *savefile ) const;
  779.     void                Restore( idRestoreGame *savefile );
  780.  
  781.     virtual void        Think( void );
  782.  
  783. // RAVEN BEGIN
  784. // kfuller: look for fx entities and the like that may want to be triggered when a mortar round (aka earthquake) goes off
  785. protected:
  786.     void                AffectNearbyEntities(float affectRadius);
  787. // RAVEN END
  788.  
  789. private:
  790.     int                    nextTriggerTime;
  791.     int                    shakeStopTime;
  792.     float                wait;
  793.     float                random;
  794.     bool                triggered;
  795.     bool                playerOriented;
  796.     bool                disabled;
  797.     float                shakeTime;
  798.  
  799.     void                Event_Activate( idEntity *activator );
  800. };
  801.  
  802.  
  803. /*
  804. ===============================================================================
  805.  
  806.   idFuncPortal
  807.  
  808. ===============================================================================
  809. */
  810.  
  811. class idFuncPortal : public idEntity {
  812. public:
  813.     CLASS_PROTOTYPE( idFuncPortal );
  814.             
  815.                         idFuncPortal();
  816.  
  817.     void                Spawn( void );
  818.  
  819.     void                Save( idSaveGame *savefile ) const;
  820.     void                Restore( idRestoreGame *savefile );
  821.  
  822. private:
  823.     qhandle_t            portal;
  824.     bool                state;
  825.  
  826.     void                Event_Activate( idEntity *activator );
  827. };
  828.  
  829. /*
  830. ===============================================================================
  831.  
  832.   idFuncAASPortal
  833.  
  834. ===============================================================================
  835. */
  836.  
  837. class idFuncAASPortal : public idEntity {
  838. public:
  839.     CLASS_PROTOTYPE( idFuncAASPortal );
  840.             
  841.                         idFuncAASPortal();
  842.  
  843.     void                Spawn( void );
  844.  
  845.     void                Save( idSaveGame *savefile ) const;
  846.     void                Restore( idRestoreGame *savefile );
  847.  
  848. private:
  849.     bool                state;
  850.  
  851.     void                Event_Activate( idEntity *activator );
  852. };
  853.  
  854. /*
  855. ===============================================================================
  856.  
  857.   idFuncAASObstacle
  858.  
  859. ===============================================================================
  860. */
  861.  
  862. class idFuncAASObstacle : public idEntity {
  863. public:
  864.     CLASS_PROTOTYPE( idFuncAASObstacle );
  865.             
  866.                         idFuncAASObstacle();
  867.  
  868.     void                Spawn( void );
  869.  
  870.     void                Save( idSaveGame *savefile ) const;
  871.     void                Restore( idRestoreGame *savefile );
  872.  
  873.     void                SetState ( bool _state );
  874.  
  875. private:
  876.     bool                state;
  877.  
  878.     void                Event_Activate( idEntity *activator );
  879. };
  880.  
  881.  
  882. /*
  883. ===============================================================================
  884.  
  885. idFuncRadioChatter
  886.  
  887. ===============================================================================
  888. */
  889.  
  890. class idFuncRadioChatter : public idEntity {
  891. public:
  892.     CLASS_PROTOTYPE( idFuncRadioChatter );
  893.  
  894.                         idFuncRadioChatter();
  895.  
  896.     void                Spawn( void );
  897.  
  898.     void                Save( idSaveGame *savefile ) const;
  899.     void                Restore( idRestoreGame *savefile );
  900.  
  901.     static void            RepeatLast ( void );
  902.  
  903. private:
  904.     static idEntityPtr<idFuncRadioChatter> lastRadioChatter;
  905.     float                time;
  906.     bool                isActive;
  907.     void                Event_Activate( idEntity *activator );
  908.     void                Event_ResetRadioHud( idEntity *activator );
  909.     void                Event_IsActive( void );
  910. };
  911.  
  912.  
  913. /*
  914. ===============================================================================
  915.  
  916.   idPhantomObjects
  917.  
  918. ===============================================================================
  919. */
  920.  
  921. class idPhantomObjects : public idEntity {
  922. public:
  923.     CLASS_PROTOTYPE( idPhantomObjects );
  924.             
  925.                         idPhantomObjects();
  926.  
  927.     void                Spawn( void );
  928.  
  929.     void                Save( idSaveGame *savefile ) const;
  930.     void                Restore( idRestoreGame *savefile );
  931.  
  932.     virtual void        Think( void );
  933.  
  934. private:
  935.     void                Event_Activate( idEntity *activator );
  936.     void                Event_Throw( void );
  937.     void                Event_ShakeObject( idEntity *object, int starttime );
  938.  
  939.     int                    end_time;
  940.     float                throw_time;
  941.     float                shake_time;
  942.     idVec3                shake_ang;
  943.     float                speed;
  944.     int                    min_wait;
  945.     int                    max_wait;
  946.     idEntityPtr<idActor>target;
  947.     idList<int>            targetTime;
  948.     idList<idVec3>        lastTargetPos;
  949. };
  950.  
  951.  
  952. /*
  953. ===============================================================================
  954.  
  955. rvFuncSaveGame
  956.  
  957. ===============================================================================
  958. */
  959.  
  960. class rvFuncSaveGame : public idEntity {
  961. public:
  962.     CLASS_PROTOTYPE( rvFuncSaveGame );
  963.  
  964.     void                Spawn( void );
  965.  
  966.     void                Event_Activate        ( idEntity *activator );
  967.  
  968. private:
  969. };
  970.  
  971.  
  972. #endif /* !__GAME_MISC_H__ */
  973.