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/server/tf/tf_projectile_flare.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/server/tf/tf_projectile_flare.h')
| -rw-r--r-- | game/server/tf/tf_projectile_flare.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/game/server/tf/tf_projectile_flare.h b/game/server/tf/tf_projectile_flare.h new file mode 100644 index 0000000..2a55c14 --- /dev/null +++ b/game/server/tf/tf_projectile_flare.h @@ -0,0 +1,91 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// TF Flare Projectile +// +//============================================================================= +#ifndef TF_PROJECTILE_FLARE_H +#define TF_PROJECTILE_FLARE_H +#ifdef _WIN32 +#pragma once +#endif + +#include "tf_weaponbase_rocket.h" +#include "iscorer.h" + +// Base force scaler +#define TF_FLARE_PELLET_FORCE 20.0f + +// The farther the pellet flies, the more force it does up to a max of 4X at 1 second +#define TF_FLARE_PELLET_FORCE_DISTANCE_SCALE 3.75f + +// We need this to get the player off the ground +#define TF_FLARE_PELLET_FORCE_UPWARD 275 + +// We need this to get the heavy off the ground +#define TF_FLARE_PELLET_FORCE_UPWARD_HEAVY 525 + + +class CTFProjectile_Flare : public CTFBaseRocket, public IScorer +{ +public: + + DECLARE_CLASS( CTFProjectile_Flare, CTFBaseRocket ); + DECLARE_NETWORKCLASS(); + DECLARE_DATADESC(); + + CTFProjectile_Flare(); + ~CTFProjectile_Flare(); + + // Creation. + static CTFProjectile_Flare *Create( CBaseEntity *pLauncher, const Vector &vecOrigin, const QAngle &vecAngles, CBaseEntity *pOwner = NULL, CBaseEntity *pScorer = NULL ); + virtual void Spawn(); + virtual void Precache(); + virtual int GetWeaponID( void ) const { return TF_WEAPON_FLAREGUN; } + + virtual void Explode( trace_t *pTrace, CBaseEntity *pOther ); + void Explode_Air( trace_t *pTrace, int bitsDamageType, bool bSelfOnly = false ); + void Detonate( bool bSelfOnly = false ); + virtual float GetRadius( void ); + void SendDeathNotice( void ); + + float GetTimeAlive( void ) const { return gpGlobals->curtime - m_flCreationTime; } + bool IsFromTaunt( void ) const { return m_bIsFromTaunt; } + + void ImpactThink( void ); + + // Implement this if you use MOVETYPE_CUSTOM + virtual void PerformCustomPhysics( Vector *pNewPosition, Vector *pNewVelocity, QAngle *pNewAngles, QAngle *pNewAngVelocity ); + + // IScorer interface + virtual CBasePlayer *GetScorer( void ); + virtual CBasePlayer *GetAssistant( void ) { return NULL; } + + void SetScorer( CBaseEntity *pScorer ); + + void SetCritical( bool bCritical ) { m_bCritical = bCritical; } + virtual int GetDamageType(); + + virtual bool IsDeflectable() { return true; } + virtual void Deflected( CBaseEntity *pDeflectedBy, Vector &vecDir ); + virtual bool IsDestroyable( void ) OVERRIDE { return false; } + + float GetProjectileSpeed( void ) const; + float GetHeatSeekPower( void ) const; + +private: + + CBaseHandle m_Scorer; + + bool m_bIsFromTaunt; + float m_flCreationTime; + float m_flImpactTime; + Vector m_vecImpactNormal; + + CNetworkVar( bool, m_bCritical ); + + bool m_bImpact; + + float m_flNextSeekUpdate; +}; + +#endif //TF_PROJECTILE_FLARE_H
\ No newline at end of file |