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/grenade_limpetmine.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/grenade_limpetmine.h')
| -rw-r--r-- | game/shared/tf2/grenade_limpetmine.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/game/shared/tf2/grenade_limpetmine.h b/game/shared/tf2/grenade_limpetmine.h new file mode 100644 index 0000000..426df4b --- /dev/null +++ b/game/shared/tf2/grenade_limpetmine.h @@ -0,0 +1,70 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef GRENADE_LIMPETMINE_H +#define GRENADE_LIMPETMINE_H +#ifdef _WIN32 +#pragma once +#endif + +class CWeaponLimpetmine; + +//===================================================================================================== +// LIMPET MINE +//===================================================================================================== +class CLimpetMine : public CBaseGrenade +{ + DECLARE_CLASS( CLimpetMine, CBaseGrenade ); + +public: + DECLARE_SERVERCLASS(); + DECLARE_DATADESC(); + + CLimpetMine( void ); + virtual ~CLimpetMine( void ); + + // Creation and Initialization + virtual void Spawn( void ); + virtual void Precache( void ); + static CLimpetMine* CLimpetMine::Create( const Vector &vecOrigin, const Vector &vecAngles, CBasePlayer *pOwner ); + virtual int GetDamageType() const { return DMG_BLAST; } + virtual bool CanBePoweredUp( void ) { return false; } + + // Detonation + virtual void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); + bool IsLive( void ); + virtual int ObjectCaps( void ) { return BaseClass::ObjectCaps() | FCAP_IMPULSE_USE; } + + // EMP + virtual bool CanTakeEMPDamage() { return true; } + virtual bool TakeEMPDamage( float duration ); + bool IsEMPed( void ) { return m_bEMPed; } + + // Think and Touch + void LiveThink( void ); + void StickyTouch( CBaseEntity *pOther ); + void LimpetThink( void ); + + // Parent + void SetLauncher( CWeaponLimpetmine *pLauncher ); + +public: + static CLimpetMine* allLimpets; // A linked list of all limpets + CLimpetMine* nextLimpet; // The next limpet in list of all limpets + + + CNetworkVar( bool, m_bLive ); // are we active? + bool m_bStuckToTarget; // If true, the limpet stuck to something when it went active + bool m_bEMPed; // have we been EMPed? + bool m_bFizzleInit; // initialize the fizzle (EMP) process + float m_flFizzleDuration; // fizzle duration + + CHandle<CWeaponLimpetmine> m_hLauncher; // parent (weapon launched from) + +}; + +#endif // GRENADE_LIMPETMINE_H |