diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/tf/tf_item_wearable.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/tf/tf_item_wearable.h')
| -rw-r--r-- | game/shared/tf/tf_item_wearable.h | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/game/shared/tf/tf_item_wearable.h b/game/shared/tf/tf_item_wearable.h new file mode 100644 index 0000000..6013633 --- /dev/null +++ b/game/shared/tf/tf_item_wearable.h @@ -0,0 +1,113 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//============================================================================= + +#ifndef TF_WEARABLE_H +#define TF_WEARABLE_H +#ifdef _WIN32 +#pragma once +#endif + +#include "econ_wearable.h" +#include "props_shared.h" +#include "GameEventListener.h" + + +#if defined( CLIENT_DLL ) +#define CTFWearable C_TFWearable +#define CTFWearableVM C_TFWearableVM +#endif + + +#if defined( CLIENT_DLL ) +class CTFWearable : public CEconWearable, public CGameEventListener +#else +class CTFWearable : public CEconWearable +#endif +{ + DECLARE_CLASS( CTFWearable, CEconWearable ); +public: + DECLARE_NETWORKCLASS(); + DECLARE_DATADESC(); + + CTFWearable(); + + virtual void Equip( CBasePlayer* pOwner ); + virtual void UnEquip( CBasePlayer* pOwner ); + virtual bool CanEquip( CBaseEntity *pOther ); + void SetDisguiseWearable( bool bState ) { m_bDisguiseWearable = bState; } + bool IsDisguiseWearable( void ) const { return m_bDisguiseWearable; } + void SetWeaponAssociatedWith( CBaseEntity *pWeapon ) { m_hWeaponAssociatedWith = pWeapon; } + CBaseEntity* GetWeaponAssociatedWith( void ) const { return m_hWeaponAssociatedWith.Get(); } + virtual bool UpdateBodygroups( CBaseCombatCharacter* pOwner, int iState ); + virtual void ReapplyProvision( void ); + +#if defined( GAME_DLL ) + void Break( void ); + virtual int CalculateVisibleClassFor( CBaseCombatCharacter *pPlayer ); + virtual int UpdateTransmitState(); + virtual int ShouldTransmit( const CCheckTransmitInfo *pInfo ); + + int GetKillStreak ( ) { return m_iKillStreak; } + void SetKillStreak ( int value ) { m_iKillStreak = value; }; +#endif + +#if defined( CLIENT_DLL ) + virtual int InternalDrawModel( int flags ); + virtual bool ShouldDraw(); + virtual bool ShouldDrawWhenPlayerIsDead() { return ( GetWeaponAssociatedWith() == NULL ); } + virtual bool ShouldDrawParticleSystems( void ); // can't be const because it potentially mutates m_eParticleSystemVisibility state + virtual int GetWorldModelIndex( void ); + virtual void ValidateModelIndex( void ); + + virtual void OnDataChanged( DataUpdateType_t updateType ); + virtual void FireGameEvent( IGameEvent *event ); +#endif + + virtual int GetSkin( void ); + + void AddHiddenBodyGroup( const char* bodygroup ); + +protected: + virtual void InternalSetPlayerDisplayModel( void ); + +private: + CNetworkVar( bool, m_bDisguiseWearable ); + CNetworkHandle( CBaseEntity, m_hWeaponAssociatedWith ); + + CUtlVector< const char* > m_HiddenBodyGroups; + +#ifdef GAME_DLL + int m_iKillStreak; +#endif // GAME_DLL + +#if defined( CLIENT_DLL ) + enum eParticleSystemVisibility + { + kParticleSystemVisibility_Undetermined, + kParticleSystemVisibility_Shown, + kParticleSystemVisibility_Hidden, + }; + eParticleSystemVisibility m_eParticleSystemVisibility; + + short m_nWorldModelIndex; +#endif +}; + + +class CTFWearableVM : public CTFWearable +{ + DECLARE_CLASS( CTFWearableVM, CTFWearable ); +public: + DECLARE_NETWORKCLASS(); + + virtual bool IsViewModelWearable( void ) { return true; } + +#if defined( CLIENT_DLL ) + virtual ShadowType_t ShadowCastType( void ); +#endif +}; + +#endif // TF_WEARABLE_H |