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/tf/tf_weapon_compound_bow.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/tf/tf_weapon_compound_bow.h')
| -rw-r--r-- | game/shared/tf/tf_weapon_compound_bow.h | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/game/shared/tf/tf_weapon_compound_bow.h b/game/shared/tf/tf_weapon_compound_bow.h new file mode 100644 index 0000000..2af5d61 --- /dev/null +++ b/game/shared/tf/tf_weapon_compound_bow.h @@ -0,0 +1,117 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//============================================================================= +#ifndef TF_WEAPON_COMPOUND_BOW_H +#define TF_WEAPON_COMPOUND_BOW_H +#ifdef _WIN32 +#pragma once +#endif + +#include "tf_weaponbase_gun.h" +#include "tf_weapon_pipebomblauncher.h" + +// Client specific. +#ifdef CLIENT_DLL +#define CTFCompoundBow C_TFCompoundBow +#else +class CTFProjectile_Arrow; +#endif + +//============================================================================= +// +// TF Weapon Bow +// +class CTFCompoundBow : public CTFPipebombLauncher +{ +public: + + DECLARE_CLASS( CTFCompoundBow, CTFPipebombLauncher ); + DECLARE_NETWORKCLASS(); + DECLARE_PREDICTABLE(); + +// Server specific. +#ifdef GAME_DLL + DECLARE_DATADESC(); +#endif + + CTFCompoundBow(); + ~CTFCompoundBow() {} + + virtual void Precache( void ); + + virtual void WeaponReset( void ); + + virtual int GetWeaponID( void ) const { return TF_WEAPON_COMPOUND_BOW; } + + virtual void PrimaryAttack(); + virtual void LaunchGrenade( void ); + + virtual bool CalcIsAttackCriticalHelper(); + + virtual float GetChargeMaxTime( void ); + virtual float GetCurrentCharge( void ); + virtual float GetProjectileDamage( void ); + virtual float GetProjectileSpeed( void ); + virtual float GetProjectileGravity( void ); + + virtual void AddPipeBomb( CTFGrenadePipebombProjectile *pBomb ); + virtual bool DetonateRemotePipebombs( bool bFizzle ); + virtual void SecondaryAttack( void ); + virtual void LowerBow( void ); + + virtual bool Reload( void ); + + virtual bool OwnerCanJump( void ); + virtual bool Holster( CBaseCombatWeapon *pSwitchingTo ); + + virtual bool SendWeaponAnim( int iActivity ); + virtual void ItemPostFrame( void ); + + virtual float GetChargeForceReleaseTime( void ) { return 5.0f; } + virtual void ForceLaunchGrenade( void ); + virtual bool ShouldDoMuzzleFlash( void ) { return false; } + + virtual void GetProjectileFireSetup( CTFPlayer *pPlayer, Vector vecOffset, Vector *vecSrc, QAngle *angForward, bool bHitTeammates = true, float flEndDist = 2000.f ); + void ApplyRefireSpeedModifications( float &flBaseRef ); + + // The bow doesn't actually reload, it instead uses the AE_WPN_INCREMENTAMMO anim event in the fire to reload the clip. + virtual bool CanReload( void ){ return false; } + + virtual bool CanPickupOtherWeapon() const { return m_flChargeBeginTime == 0.f; } + +#ifdef CLIENT_DLL + virtual void OnDataChanged( DataUpdateType_t type ); + virtual void UpdateOnRemove( void ); +#endif + + void SetArrowAlight( bool bAlight ); + +private: +#ifdef CLIENT_DLL + virtual void StartBurningEffect( void ); + virtual void StopBurningEffect( void ); +#else + +#ifdef STAGING_ONLY + void CreateExtraArrow( CTFProjectile_Arrow* pMainArrow, const QAngle& qSpreadAngles, float flSpeed ); + float GetRandomSpreadOffset( int iArrowMasteryLevel ); +#endif // STAGING_ONLY + +#endif + +private: + float m_flLastDenySoundTime; + CNetworkVar( bool, m_bNoFire ); + CNetworkVar( bool, m_bArrowAlight ); + +#ifdef CLIENT_DLL + EHANDLE m_hParticleEffectOwner; + HPARTICLEFFECT m_pBurningArrowEffect; +#endif + + CTFCompoundBow( const CTFCompoundBow & ) {} +}; + +#endif // TF_WEAPON_COMPOUND_BOW_H |