diff options
| author | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
|---|---|---|
| committer | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
| commit | 0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch) | |
| tree | c831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/game/shared/basecombatweapon_shared.h | |
| parent | Updated the SDK with the latest code from the TF and HL2 branches. (diff) | |
| download | source-sdk-2013-master.tar.xz source-sdk-2013-master.zip | |
Diffstat (limited to 'mp/src/game/shared/basecombatweapon_shared.h')
| -rw-r--r-- | mp/src/game/shared/basecombatweapon_shared.h | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/mp/src/game/shared/basecombatweapon_shared.h b/mp/src/game/shared/basecombatweapon_shared.h index 2c712923..d4964d83 100644 --- a/mp/src/game/shared/basecombatweapon_shared.h +++ b/mp/src/game/shared/basecombatweapon_shared.h @@ -55,8 +55,7 @@ class CUserCmd; // Put this in your derived class definition to declare it's activity table // UNDONE: Cascade these? #define DECLARE_ACTTABLE() static acttable_t m_acttable[];\ - acttable_t *ActivityList( void );\ - int ActivityListCount( void ); + virtual acttable_t *ActivityList( int &iActivityCount ) OVERRIDE; // You also need to include the activity table itself in your class' implementation: // e.g. @@ -73,8 +72,7 @@ class CUserCmd; // activity table. // UNDONE: Cascade these? #define IMPLEMENT_ACTTABLE(className) \ - acttable_t *className::ActivityList( void ) { return m_acttable; } \ - int className::ActivityListCount( void ) { return ARRAYSIZE(m_acttable); } \ + acttable_t *className::ActivityList( int &iActivityCount ) { iActivityCount = ARRAYSIZE(m_acttable); return m_acttable; } typedef struct { @@ -83,6 +81,29 @@ typedef struct bool required; } acttable_t; + +struct poseparamtable_t +{ + const char *pszName; + float flValue; +}; + +// Put this in your derived class definition to declare it's poseparam table +#define DECLARE_POSEPARAMTABLE() static poseparamtable_t m_poseparamtable[];\ + virtual poseparamtable_t* PoseParamList( int &iPoseParamCount ) { return NULL; } + +// You also need to include the activity table itself in your class' implementation: +// e.g. +// acttable_t CTFGrapplingHook::m_poseparamtable[] = +// { +// { "r_arm", 2 }, +// }; +// +// The grapplinghook overrides the r_arm pose param, value to 2. + +#define IMPLEMENT_POSEPARAMTABLE(className)\ + poseparamtable_t* className::PoseParamList( int &iPoseParamCount ) { iPoseParamCount = ARRAYSIZE(m_poseparamtable); return m_poseparamtable; } + class CHudTexture; class Color; @@ -208,7 +229,7 @@ public: virtual bool SendWeaponAnim( int iActivity ); virtual void SendViewModelAnim( int nSequence ); float GetViewModelSequenceDuration(); // Return how long the current view model sequence is. - bool IsViewModelSequenceFinished( void ); // Returns if the viewmodel's current animation is finished + bool IsViewModelSequenceFinished( void ) const; // Returns if the viewmodel's current animation is finished virtual void SetViewModel(); @@ -224,7 +245,7 @@ public: bool UsesSecondaryAmmo( void ); // returns true if the weapon actually uses secondary ammo void GiveDefaultAmmo( void ); - virtual bool CanHolster( void ) { return TRUE; }; // returns true if the weapon can be holstered + virtual bool CanHolster( void ) const { return TRUE; }; // returns true if the weapon can be holstered virtual bool DefaultDeploy( char *szViewModel, char *szWeaponModel, int iActivity, char *szAnimExt ); virtual bool CanDeploy( void ) { return true; } // return true if the weapon's allowed to deploy virtual bool Deploy( void ); // returns true is deploy was successful @@ -266,8 +287,7 @@ public: bool DefaultReload( int iClipSize1, int iClipSize2, int iActivity ); bool ReloadsSingly( void ) const; - virtual bool AutoFiresFullClip( void ) { return false; } - virtual bool CanOverload( void ) { return false; } + virtual bool AutoFiresFullClip( void ) const { return false; } virtual void UpdateAutoFire( void ); // Weapon firing @@ -308,7 +328,7 @@ public: virtual void SetActivity( Activity act, float duration ); inline void SetActivity( Activity eActivity ) { m_Activity = eActivity; } - inline Activity GetActivity( void ) { return m_Activity; } + inline Activity GetActivity( void ) const { return m_Activity; } virtual void AddViewKick( void ); // Add in the view kick for the weapon @@ -349,6 +369,7 @@ public: virtual int GetWeight( void ) const; virtual bool AllowsAutoSwitchTo( void ) const; virtual bool AllowsAutoSwitchFrom( void ) const; + virtual bool ForceWeaponSwitch( void ) const { return false; } virtual int GetWeaponFlags( void ) const; virtual int GetSlot( void ) const; virtual int GetPosition( void ) const; @@ -387,8 +408,10 @@ public: virtual CHudTexture const *GetSpriteZoomedAutoaim( void ) const; virtual Activity ActivityOverride( Activity baseAct, bool *pRequired ); - virtual acttable_t* ActivityList( void ) { return NULL; } - virtual int ActivityListCount( void ) { return 0; } + virtual acttable_t* ActivityList( int &iActivityCount ) { return NULL; } + + virtual void PoseParameterOverride( bool bReset ); + virtual poseparamtable_t* PoseParamList( int &iPoseParamCount ) { return NULL; } virtual void Activate( void ); @@ -577,6 +600,9 @@ public: IMPLEMENT_NETWORK_VAR_FOR_DERIVED( m_nNextThinkTick ); +#ifdef CLIENT_DLL + static void RecvProxy_WeaponState( const CRecvProxyData *pData, void *pStruct, void *pOut ); +#endif int WeaponState() const { return m_iState; } // Weapon data |