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/sdk/sdk_weapon_melee.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/sdk/sdk_weapon_melee.h')
| -rw-r--r-- | game/shared/sdk/sdk_weapon_melee.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/game/shared/sdk/sdk_weapon_melee.h b/game/shared/sdk/sdk_weapon_melee.h new file mode 100644 index 0000000..be9d75d --- /dev/null +++ b/game/shared/sdk/sdk_weapon_melee.h @@ -0,0 +1,60 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Base code for any melee based weapon +// +//=====================================================================================// + +#ifndef SDK_WEAPON_MELEE_H +#define SDK_WEAPON_MELEE_H + +#ifdef _WIN32 +#pragma once +#endif + + +#if defined( CLIENT_DLL ) +#define CWeaponSDKMelee C_WeaponSDKMelee +#endif + +//========================================================= +// CBaseHLBludgeonWeapon +//========================================================= +class CWeaponSDKMelee : public CWeaponSDKBase +{ + DECLARE_CLASS( CWeaponSDKMelee, CWeaponSDKBase ); +public: + CWeaponSDKMelee(); + + DECLARE_NETWORKCLASS(); + DECLARE_PREDICTABLE(); + + virtual void Spawn( void ); + virtual void Precache( void ); + + //Attack functions + virtual void PrimaryAttack( void ); + virtual void SecondaryAttack( void ); + + virtual void ItemPostFrame( void ); + + //Functions to select animation sequences + virtual Activity GetPrimaryAttackActivity( void ) { return ACT_VM_HITCENTER; } + virtual Activity GetSecondaryAttackActivity( void ) { return ACT_VM_HITCENTER2; } + + virtual float GetRange( void ) { return 32.0f; } + virtual float GetDamageForActivity( Activity hitActivity ) { return GetSDKWpnData().m_iDamage; } + + CWeaponSDKMelee( const CWeaponSDKMelee & ); + +protected: + virtual void ImpactEffect( trace_t &trace ); + +private: + bool ImpactWater( const Vector &start, const Vector &end ); + void Swing( int bIsSecondary ); + void Hit( trace_t &traceHit, Activity nHitActivity ); + Activity ChooseIntersectionPointAndActivity( trace_t &hitTrace, const Vector &mins, const Vector &maxs, CSDKPlayer *pOwner ); +}; + + +#endif // SDK_WEAPON_MELEE_H
\ No newline at end of file |