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/tf2/weapon_builder.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/tf2/weapon_builder.h')
| -rw-r--r-- | game/shared/tf2/weapon_builder.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/game/shared/tf2/weapon_builder.h b/game/shared/tf2/weapon_builder.h new file mode 100644 index 0000000..a684dbb --- /dev/null +++ b/game/shared/tf2/weapon_builder.h @@ -0,0 +1,90 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef WEAPON_BUILDER_H +#define WEAPON_BUILDER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "weapon_combat_usedwithshieldbase.h" + +class CBaseObject; + +//========================================================= +// Builder Weapon +//========================================================= +class CWeaponBuilder : public CWeaponCombatUsedWithShieldBase +{ + DECLARE_CLASS( CWeaponBuilder, CWeaponCombatUsedWithShieldBase ); +public: + CWeaponBuilder(); + + virtual void UpdateOnRemove( void ); + + DECLARE_SERVERCLASS(); + + virtual void Precache( void ); + virtual bool CanDeploy( void ); + virtual bool CanHolster( void ); + virtual CBaseCombatWeapon *GetLastWeapon( void ); + virtual bool Holster( CBaseCombatWeapon *pSwitchingTo = NULL ); + virtual void ItemPostFrame( void ); + virtual void PrimaryAttack( void ); + virtual void WeaponIdle( void ); + virtual bool Deploy( void ); + virtual const char *GetViewModel( int viewmodelindex = 0 ) const; + + void SetCurrentState( int iState ); + void SetCurrentObject( int iObject ); + + virtual void GainedNewTechnology( CBaseTechnology *pTechnology ); + virtual void Equip( CBaseCombatCharacter *pOwner ); + + // Add a new object type to the list of objects this builder weapon can build + void AddBuildableObject( int iObjectType ); + + // Placement + void StartPlacement( void ); + void StopPlacement( void ); + bool UpdatePlacement( void ); + + // Building + void StartBuilding( void ); + void StoppedBuilding( int iObjectType ); + bool IsBuilding( void ); + void FinishedObject( void ); + + virtual void GetControlPanelInfo( int nPanelIndex, const char *&pPanelName ); + + virtual bool ShouldShowControlPanels( void ); + +private: + void PerformModifications( CBaseObject* pObject ); + +public: + CNetworkVar( int, m_iBuildState ); + CNetworkVar( unsigned int, m_iCurrentObject ); + int m_iCurrentObjectID; + CNetworkVar( int, m_iCurrentObjectState ); + + // Objects that this builder can build + CNetworkArray( bool, m_bObjectValidity, OBJ_LAST ); + // Buildability of each object + CNetworkArray( bool, m_bObjectBuildability, OBJ_LAST ); + + // Build data for the current object, propagated when the player starts to build it + CNetworkVar( float, m_flStartTime ); + CNetworkVar( float, m_flTotalTime ); + + float m_flLastRepairTime; + + CNetworkHandle( CBaseObject, m_hObjectBeingBuilt ); +}; + + +#endif // WEAPON_BUILDER_H |