2012-11-26 18:58:24 +00:00
|
|
|
/*
|
|
|
|
===========================================================================
|
|
|
|
|
|
|
|
Doom 3 BFG Edition GPL Source Code
|
2012-11-28 15:47:07 +00:00
|
|
|
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
2012-11-26 18:58:24 +00:00
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
2012-11-26 18:58:24 +00:00
|
|
|
|
|
|
|
Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
In addition, the Doom 3 BFG Edition 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 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
===========================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GAME_MOVER_H__
|
|
|
|
#define __GAME_MOVER_H__
|
|
|
|
|
|
|
|
extern const idEventDef EV_TeamBlocked;
|
|
|
|
extern const idEventDef EV_PartBlocked;
|
|
|
|
extern const idEventDef EV_ReachedPos;
|
|
|
|
extern const idEventDef EV_ReachedAng;
|
|
|
|
|
|
|
|
/*
|
|
|
|
===============================================================================
|
|
|
|
|
|
|
|
General movers.
|
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
*/
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
class idMover : public idEntity
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
public:
|
|
|
|
CLASS_PROTOTYPE( idMover );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idMover();
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Spawn();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
void Save( idSaveGame* savefile ) const;
|
|
|
|
void Restore( idRestoreGame* savefile );
|
|
|
|
|
|
|
|
virtual void Killed( idEntity* inflictor, idEntity* attacker, int damage, const idVec3& dir, int location );
|
2012-11-26 18:58:24 +00:00
|
|
|
virtual void ClientThink( const int curTime, const float fraction, const bool predict );
|
2012-11-28 15:47:07 +00:00
|
|
|
virtual void WriteToSnapshot( idBitMsg& msg ) const;
|
|
|
|
virtual void ReadFromSnapshot( const idBitMsg& msg );
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
virtual void Hide();
|
|
|
|
virtual void Show();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void SetPortalState( bool open );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
protected:
|
2012-11-28 15:47:07 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
ACCELERATION_STAGE,
|
|
|
|
LINEAR_STAGE,
|
|
|
|
DECELERATION_STAGE,
|
|
|
|
FINISHED_STAGE
|
|
|
|
} moveStage_t;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
MOVER_NONE,
|
|
|
|
MOVER_ROTATING,
|
|
|
|
MOVER_MOVING,
|
|
|
|
MOVER_SPLINE
|
|
|
|
} moverCommand_t;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
//
|
|
|
|
// mover directions. make sure to change script/doom_defs.script if you add any, or change their order
|
|
|
|
//
|
2012-11-28 15:47:07 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
DIR_UP = -1,
|
|
|
|
DIR_DOWN = -2,
|
|
|
|
DIR_LEFT = -3,
|
|
|
|
DIR_RIGHT = -4,
|
|
|
|
DIR_FORWARD = -5,
|
|
|
|
DIR_BACK = -6,
|
|
|
|
DIR_REL_UP = -7,
|
|
|
|
DIR_REL_DOWN = -8,
|
|
|
|
DIR_REL_LEFT = -9,
|
|
|
|
DIR_REL_RIGHT = -10,
|
|
|
|
DIR_REL_FORWARD = -11,
|
|
|
|
DIR_REL_BACK = -12
|
|
|
|
} moverDir_t;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
moveStage_t stage;
|
|
|
|
int acceleration;
|
|
|
|
int movetime;
|
|
|
|
int deceleration;
|
|
|
|
idVec3 dir;
|
|
|
|
} moveState_t;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
moveStage_t stage;
|
|
|
|
int acceleration;
|
|
|
|
int movetime;
|
|
|
|
int deceleration;
|
|
|
|
idAngles rot;
|
|
|
|
} rotationState_t;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
idPhysics_Parametric physicsObj;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_OpenPortal();
|
|
|
|
void Event_ClosePortal();
|
2012-11-28 15:47:07 +00:00
|
|
|
void Event_PartBlocked( idEntity* blockingEntity );
|
|
|
|
|
|
|
|
void MoveToPos( const idVec3& pos );
|
2012-11-26 18:58:24 +00:00
|
|
|
void UpdateMoveSound( moveStage_t stage );
|
|
|
|
void UpdateRotationSound( moveStage_t stage );
|
2012-11-28 15:47:07 +00:00
|
|
|
void SetGuiStates( const char* state );
|
2012-11-26 18:58:24 +00:00
|
|
|
void FindGuiTargets();
|
2012-11-28 15:47:07 +00:00
|
|
|
void SetGuiState( const char* key, const char* val ) const;
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
virtual void DoneMoving();
|
|
|
|
virtual void DoneRotating();
|
2012-11-28 15:47:07 +00:00
|
|
|
virtual void BeginMove( idThread* thread = NULL );
|
|
|
|
virtual void BeginRotation( idThread* thread, bool stopwhendone );
|
2012-11-26 18:58:24 +00:00
|
|
|
moveState_t move;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
private:
|
|
|
|
rotationState_t rot;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
int move_thread;
|
|
|
|
int rotate_thread;
|
|
|
|
idAngles dest_angles;
|
|
|
|
idAngles angle_delta;
|
|
|
|
idVec3 dest_position;
|
|
|
|
idVec3 move_delta;
|
|
|
|
float move_speed;
|
|
|
|
int move_time;
|
|
|
|
int deceltime;
|
|
|
|
int acceltime;
|
|
|
|
bool stopRotation;
|
|
|
|
bool useSplineAngles;
|
|
|
|
idEntityPtr<idEntity> splineEnt;
|
|
|
|
moverCommand_t lastCommand;
|
|
|
|
float damage;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
qhandle_t areaPortal; // 0 = no portal
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
idList< idEntityPtr<idEntity>, TAG_MOVER > guiTargets;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
void VectorForDir( float dir, idVec3& vec );
|
|
|
|
idCurve_Spline<idVec3>* GetSpline( idEntity* splineEntity ) const;
|
|
|
|
|
|
|
|
void Event_SetCallback();
|
|
|
|
void Event_TeamBlocked( idEntity* blockedPart, idEntity* blockingEntity );
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_StopMoving();
|
|
|
|
void Event_StopRotating();
|
|
|
|
void Event_UpdateMove();
|
|
|
|
void Event_UpdateRotation();
|
|
|
|
void Event_SetMoveSpeed( float speed );
|
|
|
|
void Event_SetMoveTime( float time );
|
|
|
|
void Event_SetDecelerationTime( float time );
|
|
|
|
void Event_SetAccellerationTime( float time );
|
2012-11-28 15:47:07 +00:00
|
|
|
void Event_MoveTo( idEntity* ent );
|
|
|
|
void Event_MoveToPos( idVec3& pos );
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_MoveDir( float angle, float distance );
|
|
|
|
void Event_MoveAccelerateTo( float speed, float time );
|
|
|
|
void Event_MoveDecelerateTo( float speed, float time );
|
|
|
|
void Event_RotateDownTo( int axis, float angle );
|
|
|
|
void Event_RotateUpTo( int axis, float angle );
|
2012-11-28 15:47:07 +00:00
|
|
|
void Event_RotateTo( idAngles& angles );
|
|
|
|
void Event_Rotate( idAngles& angles );
|
|
|
|
void Event_RotateOnce( idAngles& angles );
|
|
|
|
void Event_Bob( float speed, float phase, idVec3& depth );
|
|
|
|
void Event_Sway( float speed, float phase, idAngles& depth );
|
|
|
|
void Event_SetAccelSound( const char* sound );
|
|
|
|
void Event_SetDecelSound( const char* sound );
|
|
|
|
void Event_SetMoveSound( const char* sound );
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_FindGuiTargets();
|
|
|
|
void Event_InitGuiTargets();
|
|
|
|
void Event_EnableSplineAngles();
|
|
|
|
void Event_DisableSplineAngles();
|
|
|
|
void Event_RemoveInitialSplineAngles();
|
2012-11-28 15:47:07 +00:00
|
|
|
void Event_StartSpline( idEntity* splineEntity );
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_StopSpline();
|
2012-11-28 15:47:07 +00:00
|
|
|
void Event_Activate( idEntity* activator );
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_PostRestore( int start, int total, int accel, int decel, int useSplineAng );
|
|
|
|
void Event_IsMoving();
|
|
|
|
void Event_IsRotating();
|
|
|
|
};
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
class idSplinePath : public idEntity
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
public:
|
|
|
|
CLASS_PROTOTYPE( idSplinePath );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSplinePath();
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Spawn();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
struct floorInfo_s
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
idVec3 pos;
|
|
|
|
idStr door;
|
|
|
|
int floor;
|
|
|
|
};
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
class idElevator : public idMover
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
public:
|
|
|
|
CLASS_PROTOTYPE( idElevator );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idElevator();
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Spawn();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
void Save( idSaveGame* savefile ) const;
|
|
|
|
void Restore( idRestoreGame* savefile );
|
|
|
|
|
|
|
|
virtual bool HandleSingleGuiCommand( idEntity* entityGui, idLexer* src );
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_GotoFloor( int floor );
|
2012-11-28 15:47:07 +00:00
|
|
|
floorInfo_s* GetFloorInfo( int floor );
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
protected:
|
|
|
|
virtual void DoneMoving();
|
2012-11-28 15:47:07 +00:00
|
|
|
virtual void BeginMove( idThread* thread = NULL );
|
|
|
|
void SpawnTrigger( const idVec3& pos );
|
2012-11-26 18:58:24 +00:00
|
|
|
void GetLocalTriggerPosition();
|
2012-11-28 15:47:07 +00:00
|
|
|
void Event_Touch( idEntity* other, trace_t* trace );
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
private:
|
2012-11-28 15:47:07 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
INIT,
|
|
|
|
IDLE,
|
|
|
|
WAITING_ON_DOORS
|
|
|
|
} elevatorState_t;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
elevatorState_t state;
|
|
|
|
idList<floorInfo_s, TAG_MOVER> floorInfo;
|
|
|
|
int currentFloor;
|
|
|
|
int pendingFloor;
|
|
|
|
int lastFloor;
|
|
|
|
bool controlsDisabled;
|
|
|
|
float returnTime;
|
|
|
|
int returnFloor;
|
|
|
|
int lastTouchTime;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
class idDoor* GetDoor( const char* name );
|
2012-11-26 18:58:24 +00:00
|
|
|
void Think();
|
|
|
|
void OpenInnerDoor();
|
|
|
|
void OpenFloorDoor( int floor );
|
|
|
|
void CloseAllDoors();
|
|
|
|
void DisableAllDoors();
|
|
|
|
void EnableProperDoors();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
void Event_TeamBlocked( idEntity* blockedEntity, idEntity* blockingEntity );
|
|
|
|
void Event_Activate( idEntity* activator );
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_PostFloorArrival();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_SetGuiStates();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
===============================================================================
|
|
|
|
|
|
|
|
Binary movers.
|
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
*/
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
MOVER_POS1,
|
|
|
|
MOVER_POS2,
|
|
|
|
MOVER_1TO2,
|
|
|
|
MOVER_2TO1
|
|
|
|
} moverState_t;
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
class idMover_Binary : public idEntity
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
public:
|
|
|
|
CLASS_PROTOTYPE( idMover_Binary );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idMover_Binary();
|
|
|
|
~idMover_Binary();
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Spawn();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
void Save( idSaveGame* savefile ) const;
|
|
|
|
void Restore( idRestoreGame* savefile );
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
virtual void PreBind();
|
|
|
|
virtual void PostBind();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Enable( bool b );
|
2012-11-28 15:47:07 +00:00
|
|
|
void InitSpeed( idVec3& mpos1, idVec3& mpos2, float mspeed, float maccelTime, float mdecelTime );
|
|
|
|
void InitTime( idVec3& mpos1, idVec3& mpos2, float mtime, float maccelTime, float mdecelTime );
|
2012-11-26 18:58:24 +00:00
|
|
|
void GotoPosition1();
|
|
|
|
void GotoPosition2();
|
2012-11-28 15:47:07 +00:00
|
|
|
void Use_BinaryMover( idEntity* activator );
|
|
|
|
void SetGuiStates( const char* state );
|
2012-11-26 18:58:24 +00:00
|
|
|
void UpdateBuddies( int val );
|
2012-11-28 15:47:07 +00:00
|
|
|
idMover_Binary* GetActivateChain() const
|
|
|
|
{
|
|
|
|
return activateChain;
|
|
|
|
}
|
|
|
|
idMover_Binary* GetMoveMaster() const
|
|
|
|
{
|
|
|
|
return moveMaster;
|
|
|
|
}
|
|
|
|
void BindTeam( idEntity* bindTo );
|
2012-11-26 18:58:24 +00:00
|
|
|
void SetBlocked( bool b );
|
|
|
|
bool IsBlocked();
|
2012-11-28 15:47:07 +00:00
|
|
|
idEntity* GetActivator() const;
|
|
|
|
|
|
|
|
virtual void WriteToSnapshot( idBitMsg& msg ) const;
|
|
|
|
virtual void ReadFromSnapshot( const idBitMsg& msg );
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void SetPortalState( bool open );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
protected:
|
|
|
|
idVec3 pos1;
|
|
|
|
idVec3 pos2;
|
|
|
|
moverState_t moverState;
|
2012-11-28 15:47:07 +00:00
|
|
|
idMover_Binary* moveMaster;
|
|
|
|
idMover_Binary* activateChain;
|
2012-11-26 18:58:24 +00:00
|
|
|
int soundPos1;
|
|
|
|
int sound1to2;
|
|
|
|
int sound2to1;
|
|
|
|
int soundPos2;
|
|
|
|
int soundLoop;
|
|
|
|
float wait;
|
|
|
|
float damage;
|
|
|
|
int duration;
|
|
|
|
int accelTime;
|
|
|
|
int decelTime;
|
|
|
|
idEntityPtr<idEntity> activatedBy;
|
|
|
|
int stateStartTime;
|
|
|
|
idStr team;
|
|
|
|
bool enabled;
|
|
|
|
int move_thread;
|
|
|
|
int updateStatus; // 1 = lock behaviour, 2 = open close status
|
|
|
|
idStrList buddies;
|
|
|
|
idPhysics_Parametric physicsObj;
|
|
|
|
qhandle_t areaPortal; // 0 = no portal
|
|
|
|
bool blocked;
|
|
|
|
bool playerOnly;
|
|
|
|
idList< idEntityPtr<idEntity>, TAG_MOVER > guiTargets;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void MatchActivateTeam( moverState_t newstate, int time );
|
2012-11-28 15:47:07 +00:00
|
|
|
void JoinActivateTeam( idMover_Binary* master );
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void UpdateMoverSound( moverState_t state );
|
|
|
|
void SetMoverState( moverState_t newstate, int time );
|
2012-11-28 15:47:07 +00:00
|
|
|
moverState_t GetMoverState() const
|
|
|
|
{
|
|
|
|
return moverState;
|
|
|
|
}
|
2012-11-26 18:58:24 +00:00
|
|
|
void FindGuiTargets();
|
2012-11-28 15:47:07 +00:00
|
|
|
void SetGuiState( const char* key, const char* val ) const;
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_SetCallback();
|
|
|
|
void Event_ReturnToPos1();
|
2012-11-28 15:47:07 +00:00
|
|
|
void Event_Use_BinaryMover( idEntity* activator );
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_Reached_BinaryMover();
|
|
|
|
void Event_MatchActivateTeam( moverState_t newstate, int time );
|
|
|
|
void Event_Enable();
|
|
|
|
void Event_Disable();
|
|
|
|
void Event_OpenPortal();
|
|
|
|
void Event_ClosePortal();
|
|
|
|
void Event_FindGuiTargets();
|
|
|
|
void Event_InitGuiTargets();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
static void GetMovedir( float dir, idVec3& movedir );
|
2012-11-26 18:58:24 +00:00
|
|
|
};
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
class idDoor : public idMover_Binary
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
public:
|
|
|
|
CLASS_PROTOTYPE( idDoor );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idDoor();
|
|
|
|
~idDoor();
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Spawn();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
void Save( idSaveGame* savefile ) const;
|
|
|
|
void Restore( idRestoreGame* savefile );
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
virtual void ClientThink( const int curTime, const float fraction, const bool predict );
|
|
|
|
virtual void Think();
|
|
|
|
virtual void PreBind();
|
|
|
|
virtual void PostBind();
|
|
|
|
virtual void Hide();
|
|
|
|
virtual void Show();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
bool IsOpen();
|
|
|
|
bool IsNoTouch();
|
2012-11-28 15:47:07 +00:00
|
|
|
bool AllowPlayerOnly( idEntity* ent );
|
2012-11-26 18:58:24 +00:00
|
|
|
int IsLocked();
|
|
|
|
void Lock( int f );
|
2012-11-28 15:47:07 +00:00
|
|
|
void Use( idEntity* other, idEntity* activator );
|
2012-11-26 18:58:24 +00:00
|
|
|
void Close();
|
|
|
|
void Open();
|
2012-11-28 15:47:07 +00:00
|
|
|
void SetCompanion( idDoor* door );
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
private:
|
|
|
|
float triggersize;
|
|
|
|
bool crusher;
|
|
|
|
bool noTouch;
|
|
|
|
bool aas_area_closed;
|
|
|
|
idStr buddyStr;
|
2012-11-28 15:47:07 +00:00
|
|
|
idClipModel* trigger;
|
|
|
|
idClipModel* sndTrigger;
|
2012-11-26 18:58:24 +00:00
|
|
|
int nextSndTriggerTime;
|
|
|
|
idVec3 localTriggerOrigin;
|
|
|
|
idMat3 localTriggerAxis;
|
|
|
|
idStr requires;
|
|
|
|
int removeItem;
|
|
|
|
idStr syncLock;
|
|
|
|
int normalAxisIndex; // door faces X or Y for spectator teleports
|
2012-11-28 15:47:07 +00:00
|
|
|
idDoor* companionDoor;
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void SetAASAreaState( bool closed );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
void GetLocalTriggerPosition( const idClipModel* trigger );
|
|
|
|
void CalcTriggerBounds( float size, idBounds& bounds );
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_Reached_BinaryMover();
|
2012-11-28 15:47:07 +00:00
|
|
|
void Event_TeamBlocked( idEntity* blockedEntity, idEntity* blockingEntity );
|
|
|
|
void Event_PartBlocked( idEntity* blockingEntity );
|
|
|
|
void Event_Touch( idEntity* other, trace_t* trace );
|
|
|
|
void Event_Activate( idEntity* activator );
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_StartOpen();
|
|
|
|
void Event_SpawnDoorTrigger();
|
|
|
|
void Event_SpawnSoundTrigger();
|
|
|
|
void Event_Close();
|
|
|
|
void Event_Open();
|
|
|
|
void Event_Lock( int f );
|
|
|
|
void Event_IsOpen();
|
|
|
|
void Event_Locked();
|
2012-11-28 15:47:07 +00:00
|
|
|
void Event_SpectatorTouch( idEntity* other, trace_t* trace );
|
2012-11-26 18:58:24 +00:00
|
|
|
void Event_OpenPortal();
|
|
|
|
void Event_ClosePortal();
|
|
|
|
};
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
class idPlat : public idMover_Binary
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
public:
|
|
|
|
CLASS_PROTOTYPE( idPlat );
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
idPlat();
|
|
|
|
~idPlat();
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Spawn();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
void Save( idSaveGame* savefile ) const;
|
|
|
|
void Restore( idRestoreGame* savefile );
|
2012-11-26 18:58:24 +00:00
|
|
|
void RunPhysics_NoBlocking();
|
|
|
|
virtual void ClientThink( const int curTime, const float fraction, const bool predict );
|
|
|
|
virtual void Think();
|
|
|
|
virtual void PreBind();
|
|
|
|
virtual void PostBind();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
private:
|
2012-11-28 15:47:07 +00:00
|
|
|
idClipModel* trigger;
|
2012-11-26 18:58:24 +00:00
|
|
|
idVec3 localTriggerOrigin;
|
|
|
|
idMat3 localTriggerAxis;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
void GetLocalTriggerPosition( const idClipModel* trigger );
|
|
|
|
void SpawnPlatTrigger( idVec3& pos );
|
|
|
|
|
|
|
|
void Event_TeamBlocked( idEntity* blockedEntity, idEntity* blockingEntity );
|
|
|
|
void Event_PartBlocked( idEntity* blockingEntity );
|
|
|
|
void Event_Touch( idEntity* other, trace_t* trace );
|
2012-11-26 18:58:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
===============================================================================
|
|
|
|
|
|
|
|
Special periodic movers.
|
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
*/
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
class idMover_Periodic : public idEntity
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
public:
|
|
|
|
CLASS_PROTOTYPE( idMover_Periodic );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idMover_Periodic();
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Spawn();
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
void Save( idSaveGame* savefile ) const;
|
|
|
|
void Restore( idRestoreGame* savefile );
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
virtual void Think();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
virtual void WriteToSnapshot( idBitMsg& msg ) const;
|
|
|
|
virtual void ReadFromSnapshot( const idBitMsg& msg );
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
protected:
|
|
|
|
idPhysics_Parametric physicsObj;
|
|
|
|
float damage;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
void Event_TeamBlocked( idEntity* blockedEntity, idEntity* blockingEntity );
|
|
|
|
void Event_PartBlocked( idEntity* blockingEntity );
|
2012-11-26 18:58:24 +00:00
|
|
|
};
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
class idRotater : public idMover_Periodic
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
public:
|
|
|
|
CLASS_PROTOTYPE( idRotater );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idRotater();
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Spawn();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
void Save( idSaveGame* savefile ) const;
|
|
|
|
void Restore( idRestoreGame* savefile );
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
private:
|
|
|
|
idEntityPtr<idEntity> activatedBy;
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
void Event_Activate( idEntity* activator );
|
2012-11-26 18:58:24 +00:00
|
|
|
};
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
class idBobber : public idMover_Periodic
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
public:
|
|
|
|
CLASS_PROTOTYPE( idBobber );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idBobber();
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Spawn();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
private:
|
|
|
|
};
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
class idPendulum : public idMover_Periodic
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
public:
|
|
|
|
CLASS_PROTOTYPE( idPendulum );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idPendulum();
|
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Spawn();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
private:
|
|
|
|
};
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
class idRiser : public idMover_Periodic
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
public:
|
|
|
|
CLASS_PROTOTYPE( idRiser );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
idRiser();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
void Spawn();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
private:
|
2012-11-28 15:47:07 +00:00
|
|
|
void Event_Activate( idEntity* activator );
|
2012-11-26 18:58:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* !__GAME_MOVER_H__ */
|