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/tf_obj_manned_plasmagun.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/tf_obj_manned_plasmagun.h')
| -rw-r--r-- | game/shared/tf2/tf_obj_manned_plasmagun.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/game/shared/tf2/tf_obj_manned_plasmagun.h b/game/shared/tf2/tf_obj_manned_plasmagun.h new file mode 100644 index 0000000..9bd35c0 --- /dev/null +++ b/game/shared/tf2/tf_obj_manned_plasmagun.h @@ -0,0 +1,88 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: A stationary gun that players can man +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef TF_OBJ_MANNED_PLASMAGUN_H +#define TF_OBJ_MANNED_PLASMAGUN_H + +#ifdef _WIN32 +#pragma once +#endif + +#include "tf_obj_base_manned_gun.h" + +#if defined( CLIENT_DLL ) + +#define CObjectMannedPlasmagun C_ObjectMannedPlasmagun + +#endif + +// ------------------------------------------------------------------------ // +// A stationary gun that players can man that's built by the player +// ------------------------------------------------------------------------ // +class CObjectMannedPlasmagun : public CObjectBaseMannedGun +{ +public: +#if !defined( CLIENT_DLL ) + DECLARE_DATADESC(); +#endif + + DECLARE_NETWORKCLASS(); + DECLARE_PREDICTABLE(); + DECLARE_CLASS( CObjectMannedPlasmagun, CObjectBaseMannedGun ); + + static CObjectMannedPlasmagun* Create(const Vector &vOrigin, const QAngle &vAngles); + + CObjectMannedPlasmagun(); + + virtual void Spawn(); + virtual void Precache(); + virtual void SetupTeamModel( void ); + virtual void FinishedBuilding( void ); + + // All predicted weapons need to implement and return true + virtual bool IsPredicted( void ) const + { + return true; + } + + +#if defined( CLIENT_DLL ) + virtual bool ShouldPredict( void ) + { + if ( GetOwner() == C_BasePlayer::GetLocalPlayer() ) + return true; + + return BaseClass::ShouldPredict(); + } + + virtual void PreDataUpdate( DataUpdateType_t updateType ); + virtual void PostDataUpdate( DataUpdateType_t updateType ); +#endif + +protected: + // Think function + void RechargeThink(); + + // Fire the weapon + virtual void Fire( void ); + +protected: + int m_nMaxAmmoCount; + CNetworkVar( float, m_flNextIdleTime ); + + // Handling for the multiple barrels + int m_nRightBarrelAttachment; + CNetworkVar( bool, m_bFiringLeft ); + +private: + CObjectMannedPlasmagun( const CObjectMannedPlasmagun& src ); + + int m_nPreviousTeam; +}; + + +#endif // TF_OBJ_MANNED_PLASMAGUN_H |