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_repairgun.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_repairgun.h')
| -rw-r--r-- | game/shared/tf2/weapon_repairgun.h | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/game/shared/tf2/weapon_repairgun.h b/game/shared/tf2/weapon_repairgun.h new file mode 100644 index 0000000..7a954a6 --- /dev/null +++ b/game/shared/tf2/weapon_repairgun.h @@ -0,0 +1,112 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef WEAPON_REPAIRGUN_H +#define WEAPON_REPAIRGUN_H +#ifdef _WIN32 +#pragma once +#endif + +#include "weapon_combat_usedwithshieldbase.h" + +#if defined( CLIENT_DLL ) +#define CWeaponRepairGun C_WeaponRepairGun +#endif + +//========================================================= +// Medikit Weapon +//========================================================= +class CWeaponRepairGun : public CWeaponCombatUsedWithShieldBase +{ + DECLARE_CLASS( CWeaponRepairGun, CWeaponCombatUsedWithShieldBase ); +public: + DECLARE_NETWORKCLASS(); + DECLARE_PREDICTABLE(); + + CWeaponRepairGun( void ); + + virtual void Precache(); + + virtual bool Holster( CBaseCombatWeapon *pSwitchingTo ); + virtual void ItemPostFrame( void ); + virtual void PrimaryAttack( void ); + virtual void WeaponIdle( void ); + virtual void PlayAttackAnimation( int activity ); + virtual void GainedNewTechnology( CBaseTechnology *pTechnology ); + virtual bool ComputeEMPFireState( void ); + + virtual float GetTargetRange( void ); + virtual float GetStickRange( void ); + virtual float GetHealRate( void ); + virtual bool AppliesModifier( void ) { return true; } + virtual bool TargetsPlayers( void ) { return true; } + + // 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(); + } + + // Stop all sounds being output. + void StopRepairSound( bool bStopHealingSound = true, bool bStopNoTargetSound = true ); + + // This is used to stop making particles when the entity goes dormant. + virtual void NotifyShouldTransmit( ShouldTransmitState_t state ); +// IClientNetworkable. +public: + virtual void OnDataChanged( DataUpdateType_t updateType ); +// IClientThinkable. +public: + + virtual void ClientThink(); + +#endif + +protected: + virtual CBaseEntity *GetTargetToHeal( CBaseEntity *pCurHealing ); + virtual CBaseEntity *CheckVehicleTargets( CBaseEntity *pCurHealing ); + +private: + CBaseEntity* GetCurHealingTarget() { return m_hHealingTarget; } + void RemoveHealingTarget(); + + double m_flNextBuzzTime; + + float m_flHealEffectLifetime; // Count down until the healing effect goes off. +#if !defined( CLIENT_DLL ) + CDamageModifier m_DamageModifier; // This attaches to whoever we're healing. +#endif + CNetworkVar( bool, m_bAttacking ); + +protected: +// Networked data. + CNetworkVar( bool, m_bHealing ); + CNetworkHandle( CBaseEntity, m_hHealingTarget ); + +#if defined( CLIENT_DLL ) + CSmartPtr<CSimpleEmitter> m_pEmitter; + PMaterialHandle m_hParticleMaterial; + + TimedEvent m_PathParticleEvent; + + bool m_bPlayingSound; + +#endif +private: + CWeaponRepairGun( const CWeaponRepairGun & ); +}; + +#endif // WEAPON_REPAIRGUN_H |