Untitled diff
640 lines
//========= Copyright Valve Corporation, All rights reserved. ============//
//========= Copyright Valve Corporation, All rights reserved. ============//
//
//
// Purpose:
// Purpose:
//
//
//===========================================================================//
//===========================================================================//
#ifndef PLAYER_H
#ifndef PLAYER_H
#define PLAYER_H
#define PLAYER_H
#ifdef _WIN32
#ifdef _WIN32
#pragma once
#pragma once
#endif
#endif
#include "basecombatcharacter.h"
#include "basecombatcharacter.h"
#include "usercmd.h"
#include "usercmd.h"
#include "playerlocaldata.h"
#include "playerlocaldata.h"
#include "PlayerState.h"
#include "PlayerState.h"
#include "game/server/iplayerinfo.h"
#include "game/server/iplayerinfo.h"
#include "hintsystem.h"
#include "hintsystem.h"
#include "SoundEmitterSystem/isoundemittersystembase.h"
#include "SoundEmitterSystem/isoundemittersystembase.h"
#include "util_shared.h"
#include "util_shared.h"
#if defined USES_ECON_ITEMS
#if defined USES_ECON_ITEMS
#include "game_item_schema.h"
#include "game_item_schema.h"
#include "econ_item_view.h"
#include "econ_item_view.h"
#endif
#endif
#include "ai_senses.h"
#include "soundent.h"
// For queuing and processing usercmds
// For queuing and processing usercmds
class CCommandContext
class CCommandContext
{
{
public:
public:
CUtlVector< CUserCmd > cmds;
CUtlVector< CUserCmd > cmds;
int numcmds;
int numcmds;
int totalcmds;
int totalcmds;
int dropped_packets;
int dropped_packets;
bool paused;
bool paused;
};
};
// Info about last 20 or so updates to the
// Info about last 20 or so updates to the
class CPlayerCmdInfo
class CPlayerCmdInfo
{
{
public:
public:
CPlayerCmdInfo() :
CPlayerCmdInfo() :
m_flTime( 0.0f ), m_nNumCmds( 0 ), m_nDroppedPackets( 0 )
m_flTime( 0.0f ), m_nNumCmds( 0 ), m_nDroppedPackets( 0 )
{
{
}
}
// realtime of sample
// realtime of sample
float m_flTime;
float m_flTime;
// # of CUserCmds in this update
// # of CUserCmds in this update
int m_nNumCmds;
int m_nNumCmds;
// # of dropped packets on the link
// # of dropped packets on the link
int m_nDroppedPackets;
int m_nDroppedPackets;
};
};
class CPlayerSimInfo
class CPlayerSimInfo
{
{
public:
public:
CPlayerSimInfo() :
CPlayerSimInfo() :
m_flTime( 0.0f ), m_nNumCmds( 0 ), m_nTicksCorrected( 0 ), m_flFinalSimulationTime( 0.0f ), m_flGameSimulationTime( 0.0f ), m_flServerFrameTime( 0.0f ), m_vecAbsOrigin( 0, 0, 0 )
m_flTime( 0.0f ), m_nNumCmds( 0 ), m_nTicksCorrected( 0 ), m_flFinalSimulationTime( 0.0f ), m_flGameSimulationTime( 0.0f ), m_flServerFrameTime( 0.0f ), m_vecAbsOrigin( 0, 0, 0 )
{
{
}
}
// realtime of sample
// realtime of sample
float m_flTime;
float m_flTime;
// # of CUserCmds in this update
// # of CUserCmds in this update
int m_nNumCmds;
int m_nNumCmds;
// If clock needed correction, # of ticks added/removed
// If clock needed correction, # of ticks added/removed
int m_nTicksCorrected; // +ve or -ve
int m_nTicksCorrected; // +ve or -ve
// player's m_flSimulationTime at end of frame
// player's m_flSimulationTime at end of frame
float m_flFinalSimulationTime;
float m_flFinalSimulationTime;
float m_flGameSimulationTime;
float m_flGameSimulationTime;
// estimate of server perf
// estimate of server perf
float m_flServerFrameTime;
float m_flServerFrameTime;
Vector m_vecAbsOrigin;
Vector m_vecAbsOrigin;
};
};
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Forward declarations:
// Forward declarations:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
class CBaseCombatWeapon;
class CBaseCombatWeapon;
class CBaseViewModel;
class CBaseViewModel;
class CTeam;
class CTeam;
class IPhysicsPlayerController;
class IPhysicsPlayerController;
class IServerVehicle;
class IServerVehicle;
class CUserCmd;
class CUserCmd;
class CFuncLadder;
class CFuncLadder;
class CNavArea;
class CNavArea;
class CHintSystem;
class CHintSystem;
class CAI_Expresser;
class CAI_Expresser;
#if defined USES_ECON_ITEMS
#if defined USES_ECON_ITEMS
class CEconWearable;
class CEconWearable;
#endif // USES_ECON_ITEMS
#endif // USES_ECON_ITEMS
// for step sounds
// for step sounds
struct surfacedata_t;
struct surfacedata_t;
// !!!set this bit on guns and stuff that should never respawn.
// !!!set this bit on guns and stuff that should never respawn.
#define SF_NORESPAWN ( 1 << 30 )
#define SF_NORESPAWN ( 1 << 30 )
//
//
// Player PHYSICS FLAGS bits
// Player PHYSICS FLAGS bits
//
//
enum PlayerPhysFlag_e
enum PlayerPhysFlag_e
{
{
PFLAG_DIROVERRIDE = ( 1<<0 ), // override the player's directional control (trains, physics gun, etc.)
PFLAG_DIROVERRIDE = ( 1<<0 ), // override the player's directional control (trains, physics gun, etc.)
PFLAG_DUCKING = ( 1<<1 ), // In the process of ducking, but totally squatted yet
PFLAG_DUCKING = ( 1<<1 ), // In the process of ducking, but totally squatted yet
PFLAG_USING = ( 1<<2 ), // Using a continuous entity
PFLAG_USING = ( 1<<2 ), // Using a continuous entity
PFLAG_OBSERVER = ( 1<<3 ), // player is locked in stationary cam mode. Spectators can move, observers can't.
PFLAG_OBSERVER = ( 1<<3 ), // player is locked in stationary cam mode. Spectators can move, observers can't.
PFLAG_VPHYSICS_MOTIONCONTROLLER = ( 1<<4 ), // player is physically attached to a motion controller
PFLAG_VPHYSICS_MOTIONCONTROLLER = ( 1<<4 ), // player is physically attached to a motion controller
PFLAG_GAMEPHYSICS_ROTPUSH = (1<<5), // game physics did a rotating push that we may want to override with vphysics
PFLAG_GAMEPHYSICS_ROTPUSH = (1<<5), // game physics did a rotating push that we may want to override with vphysics
// If you add another flag here check that you aren't
// If you add another flag here check that you aren't
// overwriting phys flags in the HL2 of TF2 player classes
// overwriting phys flags in the HL2 of TF2 player classes
};
};
//
//
// generic player
// generic player
//
//
//-----------------------------------------------------
//-----------------------------------------------------
//This is Half-Life player entity
//This is Half-Life player entity
//-----------------------------------------------------
//-----------------------------------------------------
#define CSUITPLAYLIST 4 // max of 4 suit sentences queued up at any time
#define CSUITPLAYLIST 4 // max of 4 suit sentences queued up at any time
#define SUIT_REPEAT_OK 0
#define SUIT_REPEAT_OK 0
#define SUIT_NEXT_IN_30SEC 30
#define SUIT_NEXT_IN_30SEC 30
#define SUIT_NEXT_IN_1MIN 60
#define SUIT_NEXT_IN_1MIN 60
#define SUIT_NEXT_IN_5MIN 300
#define SUIT_NEXT_IN_5MIN 300
#define SUIT_NEXT_IN_10MIN 600
#define SUIT_NEXT_IN_10MIN 600
#define SUIT_NEXT_IN_30MIN 1800
#define SUIT_NEXT_IN_30MIN 1800
#define SUIT_NEXT_IN_1HOUR 3600
#define SUIT_NEXT_IN_1HOUR 3600
#define CSUITNOREPEAT 32
#define CSUITNOREPEAT 32
#define TEAM_NAME_LENGTH 16
#define TEAM_NAME_LENGTH 16
// constant items
// constant items
#define ITEM_HEALTHKIT 1
#define ITEM_HEALTHKIT 1
#define ITEM_BATTERY 4
#define ITEM_BATTERY 4
#define AUTOAIM_2DEGREES 0.0348994967025
#define AUTOAIM_2DEGREES 0.0348994967025
#define AUTOAIM_5DEGREES 0.08715574274766
#define AUTOAIM_5DEGREES 0.08715574274766
#define AUTOAIM_8DEGREES 0.1391731009601
#define AUTOAIM_8DEGREES 0.1391731009601
#define AUTOAIM_10DEGREES 0.1736481776669
#define AUTOAIM_10DEGREES 0.1736481776669
#define AUTOAIM_20DEGREES 0.3490658503989
#define AUTOAIM_20DEGREES 0.3490658503989
// useful cosines
// useful cosines
#define DOT_1DEGREE 0.9998476951564
#define DOT_1DEGREE 0.9998476951564
#define DOT_2DEGREE 0.9993908270191
#define DOT_2DEGREE 0.9993908270191
#define DOT_3DEGREE 0.9986295347546
#define DOT_3DEGREE 0.9986295347546
#define DOT_4DEGREE 0.9975640502598
#define DOT_4DEGREE 0.9975640502598
#define DOT_5DEGREE 0.9961946980917
#define DOT_5DEGREE 0.9961946980917
#define DOT_6DEGREE 0.9945218953683
#define DOT_6DEGREE 0.9945218953683
#define DOT_7DEGREE 0.9925461516413
#define DOT_7DEGREE 0.9925461516413
#define DOT_8DEGREE 0.9902680687416
#define DOT_8DEGREE 0.9902680687416
#define DOT_9DEGREE 0.9876883405951
#define DOT_9DEGREE 0.9876883405951
#define DOT_10DEGREE 0.9848077530122
#define DOT_10DEGREE 0.9848077530122
#define DOT_15DEGREE 0.9659258262891
#define DOT_15DEGREE 0.9659258262891
#define DOT_20DEGREE 0.9396926207859
#define DOT_20DEGREE 0.9396926207859
#define DOT_25DEGREE 0.9063077870367
#define DOT_25DEGREE 0.9063077870367
#define DOT_30DEGREE 0.866025403784
#define DOT_30DEGREE 0.866025403784
#define DOT_45DEGREE 0.707106781187
#define DOT_45DEGREE 0.707106781187
enum
enum
{
{
VPHYS_WALK = 0,
VPHYS_WALK = 0,
VPHYS_CROUCH,
VPHYS_CROUCH,
VPHYS_NOCLIP,
VPHYS_NOCLIP,
};
};
enum PlayerConnectedState
enum PlayerConnectedState
{
{
PlayerConnected,
PlayerConnected,
PlayerDisconnecting,
PlayerDisconnecting,
PlayerDisconnected,
PlayerDisconnected,
};
};
extern bool gInitHUD;
extern bool gInitHUD;
extern ConVar *sv_cheats;
extern ConVar *sv_cheats;
class CBasePlayer;
class CBasePlayer;
class CPlayerInfo : public IBotController, public IPlayerInfo
class CPlayerInfo : public IBotController, public IPlayerInfo
{
{
public:
public:
CPlayerInfo () { m_pParent = NULL; }
CPlayerInfo () { m_pParent = NULL; }
~CPlayerInfo () {}
~CPlayerInfo () {}
void SetParent( CBasePlayer *parent ) { m_pParent = parent; }
void SetParent( CBasePlayer *parent ) { m_pParent = parent; }
// IPlayerInfo interface
// IPlayerInfo interface
virtual const char *GetName();
virtual const char *GetName();
virtual int GetUserID();
virtual int GetUserID();
virtual const char *GetNetworkIDString();
virtual const char *GetNetworkIDString();
virtual int GetTeamIndex();
virtual int GetTeamIndex();
virtual void ChangeTeam( int iTeamNum );
virtual void ChangeTeam( int iTeamNum );
virtual int GetFragCount();
virtual int GetFragCount();
virtual int GetDeathCount();
virtual int GetDeathCount();
virtual bool IsConnected();
virtual bool IsConnected();
virtual int GetArmorValue();
virtual int GetArmorValue();
virtual bool IsHLTV();
virtual bool IsHLTV();
virtual bool IsReplay();
virtual bool IsReplay();
virtual bool IsPlayer();
virtual bool IsPlayer();
virtual bool IsFakeClient();
virtual bool IsFakeClient();
virtual bool IsDead();
virtual bool IsDead();
virtual bool IsInAVehicle();
virtual bool IsInAVehicle();
virtual bool IsObserver();
virtual bool IsObserver();
virtual const Vector GetAbsOrigin();
virtual const Vector GetAbsOrigin();
virtual const QAngle GetAbsAngles();
virtual const QAngle GetAbsAngles();
virtual const Vector GetPlayerMins();
virtual const Vector GetPlayerMins();
virtual const Vector GetPlayerMaxs();
virtual const Vector GetPlayerMaxs();
virtual const char *GetWeaponName();
virtual const char *GetWeaponName();
virtual const char *GetModelName();
virtual const char *GetModelName();
virtual const int GetHealth();
virtual const int GetHealth();
virtual const int GetMaxHealth();
virtual const int GetMaxHealth();
// bot specific functions
// bot specific functions
virtual void SetAbsOrigin( Vector & vec );
virtual void SetAbsOrigin( Vector & vec );
virtual void SetAbsAngles( QAngle & ang );
virtual void SetAbsAngles( QAngle & ang );
virtual void RemoveAllItems( bool removeSuit );
virtual void RemoveAllItems( bool removeSuit );
virtual void SetActiveWeapon( const char *WeaponName );
virtual void SetActiveWeapon( const char *WeaponName );
virtual void SetLocalOrigin( const Vector& origin );
virtual void SetLocalOrigin( const Vector& origin );
virtual const Vector GetLocalOrigin( void );
virtual const Vector GetLocalOrigin( void );
virtual void SetLocalAngles( const QAngle& angles );
virtual void SetLocalAngles( const QAngle& angles );
virtual const QAngle GetLocalAngles( void );
virtual const QAngle GetLocalAngles( void );
virtual bool IsEFlagSet( int nEFlagMask );
virtual bool IsEFlagSet( int nEFlagMask );
virtual void RunPlayerMove( CBotCmd *ucmd );
virtual void RunPlayerMove( CBotCmd *ucmd );
virtual void SetLastUserCommand( const CBotCmd &cmd );
virtual void SetLastUserCommand( const CBotCmd &cmd );
virtual CBotCmd GetLastUserCommand();
virtual CBotCmd GetLastUserCommand();
private:
public:
CBasePlayer *m_pParent;
CBasePlayer *m_pParent;
};
};
class IBot;
class CSquad;
class CBasePlayer : public CBaseCombatCharacter
class CBasePlayer : public CBaseCombatCharacter
{
{
public:
public:
DECLARE_CLASS( CBasePlayer, CBaseCombatCharacter );
DECLARE_CLASS( CBasePlayer, CBaseCombatCharacter );
protected:
protected:
// HACK FOR BOTS
// HACK FOR BOTS
friend class CBotManager;
friend class CBotManager;
static edict_t *s_PlayerEdict; // must be set before calling constructor
static edict_t *s_PlayerEdict; // must be set before calling constructor
public:
public:
DECLARE_DATADESC();
DECLARE_DATADESC();
DECLARE_SERVERCLASS();
DECLARE_SERVERCLASS();
CBasePlayer();
CBasePlayer();
~CBasePlayer();
~CBasePlayer();
// IPlayerInfo passthrough (because we can't do multiple inheritance)
// IPlayerInfo passthrough (because we can't do multiple inheritance)
IPlayerInfo *GetPlayerInfo() { return &m_PlayerInfo; }
IPlayerInfo *GetPlayerInfo() { return &m_PlayerInfo; }
IBotController *GetBotController() { return &m_PlayerInfo; }
//IBotController *GetBotController() { return &m_PlayerInfo; }
virtual IBot *GetBotController() {
return NULL;
}
virtual void SetBotController( IBot *pBot ) { }
virtual void SetUpBot() { }
virtual CAI_Senses *GetSenses() {
return NULL;
}
virtual const CAI_Senses *GetSenses() const {
return NULL;
}
virtual CSound *GetBestSound( int validTypes = ALL_SOUNDS ) {
return NULL;
}
virtual CSound *GetBestScent( void ) {
return NULL;
}
// Squad
virtual CSquad *GetSquad() {
return NULL;
}
virtual void SetSquad( CSquad *pSquad ) { }
virtual void SetSquad( const char *name ) { }
virtual void OnNewLeader( CBasePlayer *pMember ) { }
virtual void OnMemberTakeDamage( CBasePlayer *pMember, const CTakeDamageInfo &info ) { }
virtual void OnMemberDeath( CBasePlayer *pMember, const CTakeDamageInfo &info ) { }
virtual void OnMemberReportEnemy( CBasePlayer *pMember, CBaseEntity *pEnemy ) { }
virtual void SetModel( const char *szModelName );
virtual void SetModel( const char *szModelName );
void SetBodyPitch( float flPitch );
void SetBodyPitch( float flPitch );
virtual void UpdateOnRemove( void );
virtual void UpdateOnRemove( void );
static CBasePlayer *CreatePlayer( const char *className, edict_t *ed );
static CBasePlayer *CreatePlayer( const char *className, edict_t *ed );
virtual void CreateViewModel( int viewmodelindex = 0 );
virtual void CreateViewModel( int viewmodelindex = 0 );
CBaseViewModel *GetViewModel( int viewmodelindex = 0, bool bObserverOK = true );
CBaseViewModel *GetViewModel( int viewmodelindex = 0, bool bObserverOK = true );
void HideViewModels( void );
void HideViewModels( void );
void DestroyViewModels( void );
void DestroyViewModels( void );
CPlayerState *PlayerData( void ) { return &pl; }
CPlayerState *PlayerData( void ) { return &pl; }
int RequiredEdictIndex( void ) { return ENTINDEX(edict()); }
int RequiredEdictIndex( void ) { return ENTINDEX(edict()); }
void LockPlayerInPlace( void );
void LockPlayerInPlace( void );
void UnlockPlayer( void );
void UnlockPlayer( void );
virtual void DrawDebugGeometryOverlays(void);
virtual void DrawDebugGeometryOverlays(void);
// Networking is about to update this entity, let it override and specify it's own pvs
// Networking is about to update this entity, let it override and specify it's own pvs
virtual void SetupVisibility( CBaseEntity *pViewEntity, unsigned char *pvs, int pvssize );
virtual void SetupVisibility( CBaseEntity *pViewEntity, unsigned char *pvs, int pvssize );
virtual int UpdateTransmitState();
virtual int UpdateTransmitState();
virtual int ShouldTransmit( const CCheckTransmitInfo *pInfo );
virtual int ShouldTransmit( const CCheckTransmitInfo *pInfo );
// Returns true if this player wants pPlayer to be moved back in time when this player runs usercmds.
// Returns true if this player wants pPlayer to be moved back in time when this player runs usercmds.
// Saves a lot of overhead on the server if we can cull out entities that don't need to lag compensate
// Saves a lot of overhead on the server if we can cull out entities that don't need to lag compensate
// (like team members, entities out of our PVS, etc).
// (like team members, entities out of our PVS, etc).
virtual bool WantsLagCompensationOnEntity( const CBasePlayer *pPlayer, const CUserCmd *pCmd, const CBitVec<MAX_EDICTS> *pEntityTransmitBits ) const;
virtual bool WantsLagCompensationOnEntity( const CBasePlayer *pPlayer, const CUserCmd *pCmd, const CBitVec<MAX_EDICTS> *pEntityTransmitBits ) const;
virtual void Spawn( void );
virtual void Spawn( void );
virtual void Activate( void );
virtual void Activate( void );
virtual void SharedSpawn(); // Shared between client and server.
virtual void SharedSpawn(); // Shared between client and server.
virtual void ForceRespawn( void );
virtual void ForceRespawn( void );
virtual void InitialSpawn( void );
virtual void InitialSpawn( void );
virtual void InitHUD( void ) {}
virtual void InitHUD( void ) {}
virtual void ShowViewPortPanel( const char * name, bool bShow = true, KeyValues *data = NULL );
virtual void ShowViewPortPanel( const char * name, bool bShow = true, KeyValues *data = NULL );
virtual void PlayerDeathThink( void );
virtual void PlayerDeathThink( void );
virtual void Jump( void );
virtual void Jump( void );
virtual void Duck( void );
virtual void Duck( void );
const char *GetTracerType( void );
const char *GetTracerType( void );
void MakeTracer( const Vector &vecTracerSrc, const trace_t &tr, int iTracerType );
void MakeTracer( const Vector &vecTracerSrc, const trace_t &tr, int iTracerType );
void DoImpactEffect( trace_t &tr, int nDamageType );
void DoImpactEffect( trace_t &tr, int nDamageType );
#if !defined( NO_ENTITY_PREDICTION )
#if !defined( NO_ENTITY_PREDICTION )
void AddToPlayerSimulationList( CBaseEntity *other );
void AddToPlayerSimulationList( CBaseEntity *other );
void RemoveFromPlayerSimulationList( CBaseEntity *other );
void RemoveFromPlayerSimulationList( CBaseEntity *other );
void SimulatePlayerSimulatedEntities( void );
void SimulatePlayerSimulatedEntities( void );
void ClearPlayerSimulationList( void );
void ClearPlayerSimulationList( void );
#endif
#endif
// Physics simulation (player executes it's usercmd's here)
// Physics simulation (player executes it's usercmd's here)
virtual void PhysicsSimulate( void );
virtual void PhysicsSimulate( void );
// Forces processing of usercmds (e.g., even if game is paused, etc.)
// Forces processing of usercmds (e.g., even if game is paused, etc.)
void ForceSimulation();
void ForceSimulation();
virtual unsigned int PhysicsSolidMaskForEntity( void ) const;
virtual unsigned int PhysicsSolidMaskForEntity( void ) const;
virtual void PreThink( void );
virtual void PreThink( void );
virtual void PostThink( void );
virtual void PostThink( void );
virtual int TakeHealth( float flHealth, int bitsDamageType );
virtual int TakeHealth( float flHealth, int bitsDamageType );
virtual void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator );
virtual void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator );
bool ShouldTakeDamageInCommentaryMode( const CTakeDamageInfo &inputInfo );
bool ShouldTakeDamageInCommentaryMode( const CTakeDamageInfo &inputInfo );
virtual int OnTakeDamage( const CTakeDamageInfo &info );
virtual int OnTakeDamage( const CTakeDamageInfo &info );
virtual void DamageEffect(float flDamage, int fDamageType);
virtual void DamageEffect(float flDamage, int fDamageType);
virtual void OnDamagedByExplosion( const CTakeDamageInfo &info );
virtual void OnDamagedByExplosion( const CTakeDamageInfo &info );
void PauseBonusProgress( bool bPause = true );
void PauseBonusProgress( bool bPause = true );
void SetBonusProgress( int iBonusProgress );
void SetBonusProgress( int iBonusProgress );
void SetBonusChallenge( int iBonusChallenge );
void SetBonusChallenge( int iBonusChallenge );
int GetBonusProgress() const { return m_iBonusProgress; }
int GetBonusProgress() const { return m_iBonusProgress; }
int GetBonusChallenge() const { return m_iBonusChallenge; }
int GetBonusChallenge() const { return m_iBonusChallenge; }
virtual Vector EyePosition( ); // position of eyes
virtual Vector EyePosition( ); // position of eyes
const QAngle &EyeAngles( );
const QAngle &EyeAngles( );
void EyePositionAndVectors( Vector *pPosition, Vector *pForward, Vector *pRight, Vector *pUp );
void EyePositionAndVectors( Vector *pPosition, Vector *pForward, Vector *pRight, Vector *pUp );
virtual const QAngle &LocalEyeAngles(); // Direction of eyes
virtual const QAngle &LocalEyeAngles(); // Direction of eyes
void EyeVectors( Vector *pForward, Vector *pRight = NULL, Vector *pUp = NULL );
void EyeVectors( Vector *pForward, Vector *pRight = NULL, Vector *pUp = NULL );
void CacheVehicleView( void ); // Calculate and cache the position of the player in the vehicle
void CacheVehicleView( void ); // Calculate and cache the position of the player in the vehicle
// Sets the view angles
// Sets the view angles
void SnapEyeAngles( const QAngle &viewAngles );
void SnapEyeAngles( const QAngle &viewAngles );
virtual QAngle BodyAngles();
virtual QAngle BodyAngles();
virtual Vector BodyTarget( const Vector &posSrc, bool bNoisy);
virtual Vector BodyTarget( const Vector &posSrc, bool bNoisy);
virtual bool ShouldFadeOnDeath( void ) { return FALSE; }
virtual bool ShouldFadeOnDeath( void ) { return FALSE; }
virtual const impactdamagetable_t &GetPhysicsImpactDamageTable();
virtual const impactdamagetable_t &GetPhysicsImpactDamageTable();
virtual int OnTakeDamage_Alive( const CTakeDamageInfo &info );
virtual int OnTakeDamage_Alive( const CTakeDamageInfo &info );
virtual void Event_Killed( const CTakeDamageInfo &info );
virtual void Event_Killed( const CTakeDamageInfo &info );
// Notifier that I've killed some other entity. (called from Victim's Event_Killed).
// Notifier that I've killed some other entity. (called from Victim's Event_Killed).
virtual void Event_KilledOther( CBaseEntity *pVictim, const CTakeDamageInfo &info );
virtual void Event_KilledOther( CBaseEntity *pVictim, const CTakeDamageInfo &info );
virtual void Event_Dying( const CTakeDamageInfo &info );
virtual void Event_Dying( const CTakeDamageInfo &info );
bool IsHLTV( void ) const { return pl.hltv; }
bool IsHLTV( void ) const { return pl.hltv; }
bool IsReplay( void ) const { return pl.replay; }
bool IsReplay( void ) const { return pl.replay; }
virtual bool IsPlayer( void ) const { return true; } // Spectators return TRUE for this, use IsObserver to separate cases
virtual bool IsPlayer( void ) const { return true; } // Spectators return TRUE for this, use IsObserver to separate cases
virtual bool IsNetClient( void ) const { return true; } // Bots should return FALSE for this, they can't receive NET messages
virtual bool IsNetClient( void ) const { return true; } // Bots should return FALSE for this, they can't receive NET messages
// Spectators should return TRUE for this
// Spectators should return TRUE for this
virtual bool IsFakeClient( void ) const;
virtual bool IsFakeClient( void ) const;
// Get the client index (entindex-1).
// Get the client index (entindex-1).
int GetClientIndex() { return ENTINDEX( edict() ) - 1; }
int GetClientIndex() { return ENTINDEX( edict() ) - 1; }
// returns the player name
// returns the player name
const char * GetPlayerName() { return m_szNetname; }
const char * GetPlayerName() { return m_szNetname; }
void SetPlayerName( const char *name );
void SetPlayerName( const char *name );
int GetUserID() { return engine->GetPlayerUserId( edict() ); }
int GetUserID() { return engine->GetPlayerUserId( edict() ); }
const char * GetNetworkIDString();
const char * GetNetworkIDString();
virtual const Vector GetPlayerMins( void ) const; // uses local player
virtual const Vector GetPlayerMins( void ) const; // uses local player
virtual const Vector GetPlayerMaxs( void ) const; // uses local player
virtual const Vector GetPlayerMaxs( void ) const; // uses local player
void VelocityPunch( const Vector &vecForce );
void VelocityPunch( const Vector &vecForce );
void ViewPunch( const QAngle &angleOffset );
void ViewPunch( const QAngle &angleOffset );
void ViewPunchReset( float tolerance = 0 );
void ViewPunchReset( float tolerance = 0 );
void ShowViewModel( bool bShow );
void ShowViewModel( bool bShow );
void ShowCrosshair( bool bShow );
void ShowCrosshair( bool bShow );
// View model prediction setup
// View model prediction setup
void CalcView( Vector &eyeOrigin, QAngle &eyeAngles, float &zNear, float &zFar, float &fov );
void CalcView( Vector &eyeOrigin, QAngle &eyeAngles, float &zNear, float &zFar, float &fov );
// Handle view smoothing when going up stairs
// Handle view smoothing when going up stairs
void SmoothViewOnStairs( Vector& eyeOrigin );
void SmoothViewOnStairs( Vector& eyeOrigin );
virtual float CalcRoll (const QAngle& angles, const Vector& velocity, float rollangle, float rollspeed);
virtual float CalcRoll (const QAngle& angles, const Vector& velocity, float rollangle, float rollspeed);
void CalcViewRoll( QAngle& eyeAngles );
void CalcViewRoll( QAngle& eyeAngles );
virtual int Save( ISave &save );
virtual int Save( ISave &save );
virtual int Restore( IRestore &restore );
virtual int Restore( IRestore &restore );
virtual bool ShouldSavePhysics();
virtual bool ShouldSavePhysics();
virtual void OnRestore( void );
virtual void OnRestore( void );
virtual void PackDeadPlayerItems( void );
virtual void PackDeadPlayerItems( void );
virtual void RemoveAllItems( bool removeSuit );
virtual void RemoveAllItems( bool removeSuit );
bool IsDead() const;
bool IsDead() const;
#ifdef CSTRIKE_DLL
#ifdef CSTRIKE_DLL
virtual bool IsRunning( void ) const { return false; } // bot support under cstrike (AR)
virtual bool IsRunning( void ) const { return false; } // bot support under cstrike (AR)
#endif
#endif
bool HasPhysicsFlag( unsigned int flag ) { return (m_afPhysicsFlags & flag) != 0; }
bool HasPhysicsFlag( unsigned int flag ) { return (m_afPhysicsFlags & flag) != 0; }
// Weapon stuff
// Weapon stuff
virtual Vector Weapon_ShootPosition( );
virtual Vector Weapon_ShootPosition( );
virtual bool Weapon_CanUse( CBaseCombatWeapon *pWeapon );
virtual bool Weapon_CanUse( CBaseCombatWeapon *pWeapon );
virtual void Weapon_Equip( CBaseCombatWeapon *pWeapon );
virtual void Weapon_Equip( CBaseCombatWeapon *pWeapon );
virtual void Weapon_Drop( CBaseCombatWeapon *pWeapon, const Vector *pvecTarget /* = NULL */, const Vector *pVelocity /* = NULL */ );
virtual void Weapon_Drop( CBaseCombatWeapon *pWeapon, const Vector *pvecTarget /* = NULL */, const Vector *pVelocity /* = NULL */ );
virtual bool Weapon_Switch( CBaseCombatWeapon *pWeapon, int viewmodelindex = 0 ); // Switch to given weapon if has ammo (false if failed)
virtual bool Weapon_Switch( CBaseCombatWeapon *pWeapon, int viewmodelindex = 0 ); // Switch to given weapon if has ammo (false if failed)
virtual void Weapon_SetLast( CBaseCombatWeapon *pWeapon );
virtual void Weapon_SetLast( CBaseCombatWeapon *pWeapon );
virtual bool Weapon_ShouldSetLast( CBaseCombatWeapon *pOldWeapon, CBaseCombatWeapon *pNewWeapon ) { return true; }
virtual bool Weapon_ShouldSetLast( CBaseCombatWeapon *pOldWeapon, CBaseCombatWeapon *pNewWeapon ) { return true; }
virtual bool Weapon_ShouldSelectItem( CBaseCombatWeapon *pWeapon );
virtual bool Weapon_ShouldSelectItem( CBaseCombatWeapon *pWeapon );
void Weapon_DropSlot( int weaponSlot );
void Weapon_DropSlot( int weaponSlot );
CBaseCombatWeapon *GetLastWeapon( void ) { return m_hLastWeapon.Get(); }
CBaseCombatWeapon *GetLastWeapon( void ) { return m_hLastWeapon.Get(); }
virtual void OnMyWeaponFired( CBaseCombatWeapon *weapon ); // call this when this player fires a weapon to allow other systems to react
virtual void OnMyWeaponFired( CBaseCombatWeapon *weapon ); // call this when this player fires a weapon to allow other systems to react
virtual float GetTimeSinceWeaponFired( void ) const; // returns the time, in seconds, since this player fired a weapon
virtual float GetTimeSinceWeaponFired( void ) const; // returns the time, in seconds, since this player fired a weapon
virtual bool IsFiringWeapon( void ) const; // return true if this player is currently firing their weapon
virtual bool IsFiringWeapon( void ) const; // return true if this player is currently firing their weapon
bool HasAnyAmmoOfType( int nAmmoIndex );
bool HasAnyAmmoOfType( int nAmmoIndex );
// JOHN: sends custom messages if player HUD data has changed (eg health, ammo)
// JOHN: sends custom messages if player HUD data has changed (eg health, ammo)
virtual void UpdateClientData( void );
virtual void UpdateClientData( void );
void RumbleEffect( unsigned char index, unsigned char rumbleData, unsigned char rumbleFlags );
void RumbleEffect( unsigned char index, unsigned char rumbleData, unsigned char rumbleFlags );
// Player is moved across the transition by other means
// Player is moved across the transition by other means
virtual int ObjectCaps( void ) { return BaseClass::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
virtual int ObjectCaps( void ) { return BaseClass::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
virtual void Precache( void );
virtual void Precache( void );
bool IsOnLadder( void );
bool IsOnLadder( void );
virtual void ExitLadder() {}
virtual void ExitLadder() {}
virtual surfacedata_t *GetLadderSurface( const Vector &origin );
virtual surfacedata_t *GetLadderSurface( const Vector &origin );
virtual void SetFlashlightEnabled( bool bState ) { };
virtual void SetFlashlightEnabled( bool bState ) { };
virtual int FlashlightIsOn( void ) { return false; }
virtual int FlashlightIsOn( void ) { return false; }
virtual void FlashlightTurnOn( void ) { };
virtual void FlashlightTurnOn( void ) { };
virtual void FlashlightTurnOff( void ) { };
virtual void FlashlightTurnOff( void ) { };
virtual bool IsIlluminatedByFlashlight( CBaseEntity *pEntity, float *flReturnDot ) {return false; }
virtual bool IsIlluminatedByFlashlight( CBaseEntity *pEntity, float *flReturnDot ) {return false; }
void UpdatePlayerSound ( void );
void UpdatePlayerSound ( void );
virtual void UpdateStepSound( surfacedata_t *psurface, const Vector &vecOrigin, const Vector &vecVelocity );
virtual void UpdateStepSound( surfacedata_t *psurface, const Vector &vecOrigin, const Vector &vecVelocity );
virtual void PlayStepSound( Vector &vecOrigin, surfacedata_t *psurface, float fvol, bool force );
virtual void PlayStepSound( Vector &vecOrigin, surfacedata_t *psurface, float fvol, bool force );
virtual const char *GetOverrideStepSound( const char *pszBaseStepSoundName ) { return pszBaseStepSoundName; }
virtual const char *GetOverrideStepSound( const char *pszBaseStepSoundName ) { return pszBaseStepSoundName; }
virtual void GetStepSoundVelocities( float *velwalk, float *velrun );
virtual void GetStepSoundVelocities( float *velwalk, float *velrun );
virtual void SetStepSoundTime( stepsoundtimes_t iStepSoundTime, bool bWalking );
virtual void SetStepSoundTime( stepsoundtimes_t iStepSoundTime, bool bWalking );
virtual void DeathSound( const CTakeDamageInfo &info );
virtual void DeathSound( const CTakeDamageInfo &info );
virtual const char* GetSceneSoundToken( void ) { return ""; }
virtual const char* GetSceneSoundToken( void ) { return ""; }
virtual void OnEmitFootstepSound( const CSoundParameters& params, const Vector& vecOrigin, float fVolume ) {}
virtual void OnEmitFootstepSound( const CSoundParameters& params, const Vector& vecOrigin, float fVolume ) {}
Class_T Classify ( void );
Class_T Classify ( void );
virtual void SetAnimation( PLAYER_ANIM playerAnim );
virtual void SetAnimation( PLAYER_ANIM playerAnim );
void SetWeaponAnimType( const char *szExtention );
void SetWeaponAnimType( const char *szExtention );
// custom player functions
// custom player functions
virtual void ImpulseCommands( void );
virtual void ImpulseCommands( void );
virtual void CheatImpulseCommands( int iImpulse );
virtual void CheatImpulseCommands( int iImpulse );
virtual bool ClientCommand( const CCommand &args );
virtual bool ClientCommand( const CCommand &args );
void NotifySinglePlayerGameEnding() { m_bSinglePlayerGameEnding = true; }
void NotifySinglePlayerGameEnding() { m_bSinglePlayerGameEnding = true; }
bool IsSinglePlayerGameEnding() { return m_bSinglePlayerGameEnding == true; }
bool IsSinglePlayerGameEnding() { return m_bSinglePlayerGameEnding == true; }
bool HandleVoteCommands( const CCommand &args );
bool HandleVoteCommands( const CCommand &args );
// Observer functions
// Observer functions
virtual bool StartObserverMode(int mode); // true, if successful
virtual bool StartObserverMode(int mode); // true, if successful
virtual void StopObserverMode( void ); // stop spectator mode
virtual void StopObserverMode( void ); // stop spectator mode
virtual bool ModeWantsSpectatorGUI( int iMode ) { return true; }
virtual bool ModeWantsSpectatorGUI( int iMode ) { return true; }
virtual bool SetObserverMode(int mode); // sets new observer mode, returns true if successful
virtual bool SetObserverMode(int mode); // sets new observer mode, returns true if successful
virtual int GetObserverMode( void ); // returns observer mode or OBS_NONE
virtual int GetObserverMode( void ); // returns observer mode or OBS_NONE
virtual bool SetObserverTarget(CBaseEntity * target);
virtual bool SetObserverTarget(CBaseEntity * target);
virtual void ObserverUse( bool bIsPressed ); // observer pressed use
virtual void ObserverUse( bool bIsPressed ); // observer pressed use
virtual CBaseEntity *GetObserverTarget( void ); // returns players targer or NULL
virtual CBaseEntity *GetObserverTarget( void ); // returns players targer or NULL
virtual CBaseEntity *FindNextObserverTarget( bool bReverse ); // returns next/prev player to follow or NULL
virtual CBaseEntity *FindNextObserverTarget( bool bReverse ); // returns next/prev player to follow or NULL
virtual int GetNextObserverSearchStartPoint( bool bReverse ); // Where we should start looping the player list in a FindNextObserverTarget call
virtual int GetNextObserverSearchStartPoint( bool bReverse ); // Where we should start looping the player list in a FindNextObserverTarget call
virtual bool IsValidObserverTarget(CBaseEntity * target); // true, if player is allowed to see this target
virtual bool IsValidObserverTarget(CBaseEntity * target); // true, if player is allowed to see this target
virtual void CheckObserverSettings(); // checks, if target still valid (didn't die etc)
virtual void CheckObserverSettings(); // checks, if target still valid (didn't die etc)
virtual void JumptoPosition(const Vector &origin, const QAngle &angles);
virtual void JumptoPosition(const Vector &origin, const QAngle &angles);
virtual void ForceObserverMode(int mode); // sets a temporary mode, force because of invalid targets
virtual void ForceObserverMode(int mode); // sets a temporary mode, force because of invalid targets
virtual void ResetObserverMode(); // resets all observer related settings
virtual void ResetObserverMode(); // resets all observer related settings
virtual void ValidateCurrentObserverTarget( void ); // Checks the current observer target, and moves on if it's not valid anymore
virtual void ValidateCurrentObserverTarget( void ); // Checks the current observer target, and moves on if it's not valid anymore
virtual void AttemptToExitFreezeCam( void );
virtual void AttemptToExitFreezeCam( void );
virtual bool StartReplayMode( float fDelay, float fDuration, int iEntity );
virtual bool StartReplayMode( float fDelay, float fDuration, int iEntity );
virtual void StopReplayMode();
virtual void StopReplayMode();
virtual int GetDelayTicks();
virtual int GetDelayTicks();
virtual int GetReplayEntity();
virtual int GetReplayEntity();
virtual void CreateCorpse( void ) { }
virtual void CreateCorpse( void ) { }
virtual CBaseEntity *EntSelectSpawnPoint( void );
virtual CBaseEntity *EntSelectSpawnPoint( void );
// Vehicles
// Vehicles
virtual bool IsInAVehicle( void ) const;
virtual bool IsInAVehicle( void ) const;
bool CanEnterVehicle( IServerVehicle *pVehicle, int nRole );
bool CanEnterVehicle( IServerVehicle *pVehicle, int nRole );
virtual bool GetInVehicle( IServerVehicle *pVehicle, int nRole );
virtual bool GetInVehicle( IServerVehicle *pVehicle, int nRole );
virtual void LeaveVehicle( const Vector &vecExitPoint = vec3_origin, const QAngle &vecExitAngles = vec3_angle );
virtual void LeaveVehicle( const Vector &vecExitPoint = vec3_origin, const QAngle &vecExitAngles = vec3_angle );
int GetVehicleAnalogControlBias() { return m_iVehicleAnalogBias; }
int GetVehicleAnalogControlBias() { return m_iVehicleAnalogBias; }
void SetVehicleAnalogControlBias( int bias ) { m_iVehicleAnalogBias = bias; }
void SetVehicleAnalogControlBias( int bias ) { m_iVehicleAnalogBias = bias; }
// override these for
// override these for
virtual void OnVehicleStart() {}
virtual void OnVehicleStart() {}
virtual void OnVehicleEnd( Vector &playerDestPosition ) {}
virtual void OnVehicleEnd( Vector &playerDestPosition ) {}
IServerVehicle *GetVehicle();
IServerVehicle *GetVehicle();
CBaseEntity *GetVehicleEntity( void );
CBaseEntity *GetVehicleEntity( void );
bool UsingStandardWeaponsInVehicle( void );
bool UsingStandardWeaponsInVehicle( void );
void AddPoints( int score, bool bAllowNegativeScore );
void AddPoints( int score, bool bAllowNegativeScore );
void AddPointsToTeam( int score, bool bAllowNegativeScore );
void AddPointsToTeam( int score, bool bAllowNegativeScore );
virtual bool BumpWeapon( CBaseCombatWeapon *pWeapon );
virtual bool BumpWeapon( CBaseCombatWeapon *pWeapon );
bool RemovePlayerItem( CBaseCombatWeapon *pItem );
bool RemovePlayerItem( CBaseCombatWeapon *pItem );
CBaseEntity *HasNamedPlayerItem( const char *pszItemName );
CBaseEntity *HasNamedPlayerItem( const char *pszItemName );
bool HasWeapons( void );// do I have ANY weapons?
bool HasWeapons( void );// do I have ANY weapons?
virtual void SelectLastItem(void);
virtual void SelectLastItem(void);
virtual void SelectItem( const char *pstr, int iSubType = 0 );
virtual void SelectItem( const char *pstr, int iSubType = 0 );
void ItemPreFrame( void );
void ItemPreFrame( void );
virtual void ItemPostFrame( void );
virtual void ItemPostFrame( void );
virtual CBaseEntity *GiveNamedItem( const char *szName, int iSubType = 0 );
virtual CBaseEntity *GiveNamedItem( const char *szName, int iSubType = 0 );
void EnableControl(bool fControl);
void EnableControl(bool fControl);
virtual void CheckTrainUpdate( void );
virtual void CheckTrainUpdate( void );
void AbortReload( void );
void AbortReload( void );
void SendAmmoUpdate(void);
void SendAmmoUpdate(void);
void WaterMove( void );
void WaterMove( void );
float GetWaterJumpTime() const;
float GetWaterJumpTime() const;
void SetWaterJumpTime( float flWaterJumpTime );
void SetWaterJumpTime( float flWaterJumpTime );
float GetSwimSoundTime( void ) const;
float GetSwimSoundTime( void ) const;
void SetSwimSoundTime( float flSwimSoundTime );
void SetSwimSoundTime( float flSwimSoundTime );
virtual void SetPlayerUnderwater( bool state );
virtual void SetPlayerUnderwater( bool state );
void UpdateUnderwaterState( void );
void UpdateUnderwaterState( void );
bool IsPlayerUnderwater( void ) { return m_bPlayerUnderwater; }
bool IsPlayerUnderwater( void ) { return m_bPlayerUnderwater; }
virtual bool CanBreatheUnderwater() const { return false; }
virtual bool CanBreatheUnderwater() const { return false; }
virtual void PlayerUse( void );
virtual void PlayerUse( void );
virtual void PlayUseDenySound() {}
virtual void PlayUseDenySound() {}
virtual CBaseEntity *FindUseEntity( void );
virtual CBaseEntity *FindUseEntity( void );
virtual bool IsUseableEntity( CBaseEntity *pEntity, unsigned int requiredCaps );
virtual bool IsUseableEntity( CBaseEntity *pEntity, unsigned int requiredCaps );
bool ClearUseEntity();
bool ClearUseEntity();
CBaseEntity *DoubleCheckUseNPC( CBaseEntity *pNPC, const Vector &vecSrc, const Vector &vecDir );
CBaseEntity *DoubleCheckUseNPC( CBaseEntity *pNPC, const Vector &vecSrc, const Vector &vecDir );
// physics interactions
// physics interactions
// mass/size limit set to zero for none
// mass/size limit set to zero for none
static bool CanPickupObject( CBaseEntity *pObject, float massLimit, float sizeLimit );
static bool CanPickupObject( CBaseEntity *pObject, float massLimit, float sizeLimit );
virtual void PickupObject( CBaseEntity *pObject, bool bLimitMassAndSize = true ) {}
virtual void PickupObject( CBaseEntity *pObject, bool bLimitMassAndSize = true ) {}
virtual void ForceDropOfCarriedPhysObjects( CBaseEntity *pOnlyIfHoldindThis = NULL ) {}
virtual void ForceDropOfCarriedPhysObjects( CBaseEntity *pOnlyIfHoldindThis = NULL ) {}
virtual float GetHeldObjectMass( IPhysicsObject *pHeldObject );
virtual float GetHeldObjectMass( IPhysicsObject *pHeldObject );
void CheckSuitUpdate();
void CheckSuitUpdate();
void SetSuitUpdate(const char *name, int fgroup, int iNoRepeat);
void SetSuitUpdate(const char *name, int fgroup, int iNoRepeat);
virtual void UpdateGeigerCounter( void );
virtual void UpdateGeigerCounter( void );
void CheckTimeBasedDamage( void );
void CheckTimeBasedDamage( void );
void ResetAutoaim( void );
void ResetAutoaim( void );
virtual Vector GetAutoaimVector( float flScale );
virtual Vector GetAutoaimVector( float flScale );
virtual Vector GetAutoaimVector( float flScale, float flMaxDist );
virtual Vector GetAutoaimVector( float flScale, float flMaxDist );
virtual void GetAutoaimVector( autoaim_params_t ¶ms );
virtual void GetAutoaimVector( autoaim_params_t ¶ms );
float GetAutoaimScore( const Vector &eyePosition, const Vector &viewDir, const Vector &vecTarget, CBaseEntity *pTarget, float fScale, CBaseCombatWeapon *pActiveWeapon );
float GetAutoaimScore( const Vector &eyePosition, const Vector &viewDir, const Vector &vecTarget, CBaseEntity *pTarget, float fScale, CBaseCombatWeapon *pActiveWeapon );
QAngle AutoaimDeflection( Vector &vecSrc, autoaim_params_t ¶ms );
QAngle AutoaimDeflection( Vector &vecSrc, autoaim_params_t ¶ms );
virtual bool ShouldAutoaim( void );
virtual bool ShouldAutoaim( void );
void SetTargetInfo( Vector &vecSrc, float flDist );
void SetTargetInfo( Vector &vecSrc, float flDist );
void SetViewEntity( CBaseEntity *pEntity );
void SetViewEntity( CBaseEntity *pEntity );
CBaseEntity *GetViewEntity( void ) { return m_hViewEntity; }
CBaseEntity *GetViewEntity( void ) { return m_hViewEntity; }
virtual void ForceClientDllUpdate( void ); // Forces all client .dll specific data to be resent to client.
virtual void ForceClientDllUpdate( void ); // Forces all client .dll specific data to be resent to client.
void DeathMessage( CBaseEntity *pKiller );
void DeathMessage( CBaseEntity *pKiller );
virtual void ProcessUsercmds( CUserCmd *cmds, int numcmds, int totalcmds,
virtual void ProcessUsercmds( CUserCmd *cmds, int numcmds, int totalcmds,
int dropped_packets, bool paused );
int dropped_packets, bool paused );
bool IsUserCmdDataValid( CUserCmd *pCmd );
bool IsUserCmdDataValid( CUserCmd *pCmd );
void AvoidPhysicsProps( CUserCmd *pCmd );
void AvoidPhysicsProps( CUserCmd *pCmd );
// Run a user command. The default implementation calls ::PlayerRunCommand. In TF, this controls a vehicle if
// Run a user command. The default implementation calls ::PlayerRunCommand. In TF, this controls a vehicle if
// the player is in one.
// the player is in one.
virtual void PlayerRunCommand(CUserCmd *ucmd, IMoveHelper *moveHelper);
virtual void PlayerRunCommand(CUserCmd *ucmd, IMoveHelper *moveHelper);
void RunNullCommand();
void RunNullCommand();
CUserCmd * GetCurrentCommand( void ) { return m_pCurrentCommand; }
CUserCmd * GetCurrentCommand( void ) { return m_pCurrentCommand; }
float GetTimeSinceLastUserCommand( void ) { return ( !IsConnected() || IsFakeClient() || IsBot() ) ? 0.f : gpGlobals->curtime - m_flLastUserCommandTime; }
float GetTimeSinceLastUserCommand( void ) { return ( !IsConnected() || IsFakeClient() || IsBot() ) ? 0.f : gpGlobals->curtime - m_flLastUserCommandTime; }
// Team Handling
// Team Handling
virtual void ChangeTeam( int iTeamNum ) { ChangeTeam(iTeamNum,false, false); }
virtual void ChangeTeam( int iTeamNum ) { ChangeTeam(iTeamNum,false, false); }
virtual void ChangeTeam( int iTeamNum, bool bAutoTeam, bool bSilent );
virtual void ChangeTeam( int iTeamNum, bool bAutoTeam, bool bSilent );
// say/sayteam allowed?
// say/sayteam allowed?
virtual bool CanHearAndReadChatFrom( CBasePlayer *pPlayer ) { return true; }
virtual bool CanHearAndReadChatFrom( CBasePlayer *pPlayer ) { return true; }
virtual bool CanSpeak( void ) { return true; }
virtual bool CanSpeak( void ) { return true; }
audioparams_t &GetAudioParams() { return m_Local.m_audio; }
audioparams_t &GetAudioParams() { return m_Local.m_audio; }
virtual void ModifyOrAppendPlayerCriteria( AI_CriteriaSet& set );
virtual void ModifyOrAppendPlayerCriteria( AI_CriteriaSet& set );
const QAngle& GetPunchAngle();
const QAngle& GetPunchAngle();
void SetPunchAngle( const QAngle &punchAngle );
void SetPunchAngle( const QAngle &punchAngle );
virtual void DoMuzzleFlash();
virtual void DoMuzzleFlash();
const char *GetLastKnownPlaceName( void ) const { return m_szLastPlaceName; } // return the last nav place name the player occupied
const char *GetLastKnownPlaceName( void ) const { return m_szLastPlaceName; } // return the last nav place name the player occupied
virtual void CheckChatText( char *p, int bufsize ) {}
virtual void CheckChatText( char *p, int bufsize ) {}
virtual void CreateRagdollEntity( void ) { return; }
virtual void CreateRagdollEntity( void ) { return; }
virtual void HandleAnimEvent( animevent_t *pEvent );
virtual void HandleAnimEvent( animevent_t *pEvent );
virtual bool ShouldAnnounceAchievement( void );
virtual bool ShouldAnnounceAchievement( void );
#if defined USES_ECON_ITEMS
#if defined USES_ECON_ITEMS
// Wearables
// Wearables
virtual void EquipWearable( CEconWearable *pItem );
virtual vo
virtual void RemoveWearable( CEconWearable *pItem );
void PlayWearableAnimsForPlaybackEvent( wearableanimplayback_t iPlayback );
#endif
public:
// Player Physics Shadow
void SetupVPhysicsShadow( const Vector &vecAbsOrigin, const Vector &vecAbsVelocity, CPhysCollide *pStandModel, const char *pStandHullName, CPhysCollide *pCrouchModel, const char *pCrouchHullName );
IPhysicsPlayerController* GetPhysicsController() { return m_pPhysicsController; }
virtual void VPhysicsCollision( int index, gamevcollisionevent_t *pEvent );
void VPhysicsUpdate( IPhysicsObject *pPhysics );
virtual void VPhysicsShadowUpdate( IPhysicsObject *pPhysics );
virtual bool IsFollowingPhysics( void ) { return false; }
bool IsRideablePhysics( IPhysicsObject *pPhysics );
IPhysicsObject *GetGroundVPhysics();
virtual void Touch( CBaseEntity *pOther );
void SetTouchedPhysics( bool bTouch );
bool TouchedPhysics( void );
Vector GetSmoothedVelocity( void );
vi