2 ===========================================================================
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
22 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.
24 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.
26 ===========================================================================
29 #ifndef __GAME_MISC_H__
30 #define __GAME_MISC_H__
34 ===============================================================================
38 A simple, spawnable entity with a model and no functionable ability of it's own.
39 For example, it can be used as a placeholder during development, for marking
40 locations on maps for script, or for simple placed models without any behavior
41 that can be bound to other entities. Should not be subclassed.
42 ===============================================================================
45 class idSpawnableEntity : public idEntity {
47 CLASS_PROTOTYPE( idSpawnableEntity );
55 ===============================================================================
57 Potential spawning position for players.
58 The first time a player enters the game, they will be at an 'initial' spot.
59 Targets will be fired when someone spawns in on them.
61 When triggered, will cause player to be teleported to spawn spot.
63 ===============================================================================
66 class idPlayerStart : public idEntity {
68 CLASS_PROTOTYPE( idPlayerStart );
71 EVENT_TELEPORTPLAYER = idEntity::EVENT_MAXEVENTS,
75 idPlayerStart( void );
79 void Save( idSaveGame *savefile ) const;
80 void Restore( idRestoreGame *savefile );
82 virtual bool ClientReceiveEvent( int event, int time, const idBitMsg &msg );
87 void Event_TeleportPlayer( idEntity *activator );
88 void Event_TeleportStage( idEntity *player );
89 void TeleportPlayer( idPlayer *player );
94 ===============================================================================
96 Non-displayed entity used to activate triggers when it touches them.
97 Bind to a mover to have the mover activate a trigger as it moves.
98 When target by triggers, activating the trigger will toggle the
99 activator on and off. Check "start_off" to have it spawn disabled.
101 ===============================================================================
104 class idActivator : public idEntity {
106 CLASS_PROTOTYPE( idActivator );
110 void Save( idSaveGame *savefile ) const;
111 void Restore( idRestoreGame *savefile );
113 virtual void Think( void );
118 void Event_Activate( idEntity *activator );
123 ===============================================================================
125 Path entities for monsters to follow.
127 ===============================================================================
129 class idPathCorner : public idEntity {
131 CLASS_PROTOTYPE( idPathCorner );
135 static void DrawDebugInfo( void );
137 static idPathCorner *RandomPath( const idEntity *source, const idEntity *ignore );
140 void Event_RandomPath( void );
145 ===============================================================================
147 Object that fires targets and changes shader parms when damaged.
149 ===============================================================================
152 class idDamagable : public idEntity {
154 CLASS_PROTOTYPE( idDamagable );
158 void Save( idSaveGame *savefile ) const;
159 void Restore( idRestoreGame *savefile );
162 void Killed( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location );
168 void BecomeBroken( idEntity *activator );
169 void Event_BecomeBroken( idEntity *activator );
170 void Event_RestoreDamagable( void );
175 ===============================================================================
177 Hidden object that explodes when activated
179 ===============================================================================
182 class idExplodable : public idEntity {
184 CLASS_PROTOTYPE( idExplodable );
189 void Event_Explode( idEntity *activator );
194 ===============================================================================
198 ===============================================================================
201 class idSpring : public idEntity {
203 CLASS_PROTOTYPE( idSpring );
207 virtual void Think( void );
216 idForce_Spring spring;
218 void Event_LinkSpring( void );
223 ===============================================================================
227 ===============================================================================
230 class idForceField : public idEntity {
232 CLASS_PROTOTYPE( idForceField );
234 void Save( idSaveGame *savefile ) const;
235 void Restore( idRestoreGame *savefile );
239 virtual void Think( void );
242 idForce_Field forceField;
246 void Event_Activate( idEntity *activator );
247 void Event_Toggle( void );
248 void Event_FindTargets( void );
253 ===============================================================================
257 ===============================================================================
260 class idAnimated : public idAFEntity_Gibbable {
262 CLASS_PROTOTYPE( idAnimated );
267 void Save( idSaveGame *savefile ) const;
268 void Restore( idRestoreGame *savefile );
271 virtual bool LoadAF( void );
272 bool StartRagdoll( void );
273 virtual bool GetPhysicsToSoundTransform( idVec3 &origin, idMat3 &axis );
277 int current_anim_index;
280 jointHandle_t soundJoint;
281 idEntityPtr<idEntity> activator;
284 void PlayNextAnim( void );
286 void Event_Activate( idEntity *activator );
287 void Event_Start( void );
288 void Event_StartRagdoll( void );
289 void Event_AnimDone( int animIndex );
290 void Event_Footstep( void );
291 void Event_LaunchMissiles( const char *projectilename, const char *sound, const char *launchjoint, const char *targetjoint, int numshots, int framedelay );
292 void Event_LaunchMissilesUpdate( int launchjoint, int targetjoint, int numshots, int framedelay );
297 ===============================================================================
301 ===============================================================================
304 class idStaticEntity : public idEntity {
306 CLASS_PROTOTYPE( idStaticEntity );
308 idStaticEntity( void );
310 void Save( idSaveGame *savefile ) const;
311 void Restore( idRestoreGame *savefile );
314 void ShowEditingDialog( void );
315 virtual void Hide( void );
316 virtual void Show( void );
317 void Fade( const idVec4 &to, float fadeTime );
318 virtual void Think( void );
320 virtual void WriteToSnapshot( idBitMsgDelta &msg ) const;
321 virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
324 void Event_Activate( idEntity *activator );
337 ===============================================================================
341 ===============================================================================
344 class idFuncEmitter : public idStaticEntity {
346 CLASS_PROTOTYPE( idFuncEmitter );
348 idFuncEmitter( void );
350 void Save( idSaveGame *savefile ) const;
351 void Restore( idRestoreGame *savefile );
354 void Event_Activate( idEntity *activator );
356 virtual void WriteToSnapshot( idBitMsgDelta &msg ) const;
357 virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
366 ===============================================================================
370 ===============================================================================
373 class idFuncSmoke : public idEntity {
375 CLASS_PROTOTYPE( idFuncSmoke );
381 void Save( idSaveGame *savefile ) const;
382 void Restore( idRestoreGame *savefile );
384 virtual void Think( void );
385 void Event_Activate( idEntity *activator );
389 const idDeclParticle * smoke;
395 ===============================================================================
399 ===============================================================================
402 class idFuncSplat : public idFuncEmitter {
404 CLASS_PROTOTYPE( idFuncSplat );
411 void Event_Activate( idEntity *activator );
417 ===============================================================================
421 ===============================================================================
424 class idTextEntity : public idEntity {
426 CLASS_PROTOTYPE( idTextEntity );
430 void Save( idSaveGame *savefile ) const;
431 void Restore( idRestoreGame *savefile );
433 virtual void Think( void );
442 ===============================================================================
446 ===============================================================================
449 class idLocationEntity : public idEntity {
451 CLASS_PROTOTYPE( idLocationEntity );
455 const char * GetLocation( void ) const;
460 class idLocationSeparatorEntity : public idEntity {
462 CLASS_PROTOTYPE( idLocationSeparatorEntity );
469 class idVacuumSeparatorEntity : public idEntity {
471 CLASS_PROTOTYPE( idVacuumSeparatorEntity );
473 idVacuumSeparatorEntity( void );
477 void Save( idSaveGame *savefile ) const;
478 void Restore( idRestoreGame *savefile );
480 void Event_Activate( idEntity *activator );
486 class idVacuumEntity : public idEntity {
488 CLASS_PROTOTYPE( idVacuumEntity );
497 ===============================================================================
501 ===============================================================================
504 class idBeam : public idEntity {
506 CLASS_PROTOTYPE( idBeam );
512 void Save( idSaveGame *savefile ) const;
513 void Restore( idRestoreGame *savefile );
515 virtual void Think( void );
517 void SetMaster( idBeam *masterbeam );
518 void SetBeamTarget( const idVec3 &origin );
520 virtual void Show( void );
522 virtual void WriteToSnapshot( idBitMsgDelta &msg ) const;
523 virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
526 void Event_MatchTarget( void );
527 void Event_Activate( idEntity *activator );
529 idEntityPtr<idBeam> target;
530 idEntityPtr<idBeam> master;
535 ===============================================================================
539 ===============================================================================
542 class idRenderModelLiquid;
544 class idLiquid : public idEntity {
546 CLASS_PROTOTYPE( idLiquid );
550 void Save( idSaveGame *savefile ) const;
551 void Restore( idRestoreGame *savefile );
554 void Event_Touch( idEntity *other, trace_t *trace );
557 idRenderModelLiquid *model;
562 ===============================================================================
566 ===============================================================================
569 class idShaking : public idEntity {
571 CLASS_PROTOTYPE( idShaking );
577 void Save( idSaveGame *savefile ) const;
578 void Restore( idRestoreGame *savefile );
581 idPhysics_Parametric physicsObj;
584 void BeginShaking( void );
585 void Event_Activate( idEntity *activator );
590 ===============================================================================
594 ===============================================================================
597 class idEarthQuake : public idEntity {
599 CLASS_PROTOTYPE( idEarthQuake );
605 void Save( idSaveGame *savefile ) const;
606 void Restore( idRestoreGame *savefile );
608 virtual void Think( void );
620 void Event_Activate( idEntity *activator );
625 ===============================================================================
629 ===============================================================================
632 class idFuncPortal : public idEntity {
634 CLASS_PROTOTYPE( idFuncPortal );
640 void Save( idSaveGame *savefile ) const;
641 void Restore( idRestoreGame *savefile );
647 void Event_Activate( idEntity *activator );
651 ===============================================================================
655 ===============================================================================
658 class idFuncAASPortal : public idEntity {
660 CLASS_PROTOTYPE( idFuncAASPortal );
666 void Save( idSaveGame *savefile ) const;
667 void Restore( idRestoreGame *savefile );
672 void Event_Activate( idEntity *activator );
676 ===============================================================================
680 ===============================================================================
683 class idFuncAASObstacle : public idEntity {
685 CLASS_PROTOTYPE( idFuncAASObstacle );
691 void Save( idSaveGame *savefile ) const;
692 void Restore( idRestoreGame *savefile );
697 void Event_Activate( idEntity *activator );
702 ===============================================================================
706 ===============================================================================
709 class idFuncRadioChatter : public idEntity {
711 CLASS_PROTOTYPE( idFuncRadioChatter );
713 idFuncRadioChatter();
717 void Save( idSaveGame *savefile ) const;
718 void Restore( idRestoreGame *savefile );
722 void Event_Activate( idEntity *activator );
723 void Event_ResetRadioHud( idEntity *activator );
728 ===============================================================================
732 ===============================================================================
735 class idPhantomObjects : public idEntity {
737 CLASS_PROTOTYPE( idPhantomObjects );
743 void Save( idSaveGame *savefile ) const;
744 void Restore( idRestoreGame *savefile );
746 virtual void Think( void );
749 void Event_Activate( idEntity *activator );
750 void Event_Throw( void );
751 void Event_ShakeObject( idEntity *object, int starttime );
760 idEntityPtr<idActor>target;
761 idList<int> targetTime;
762 idList<idVec3> lastTargetPos;
765 #endif /* !__GAME_MISC_H__ */