Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // TF Energy Ball Projectile
  4. //
  5. //=============================================================================
  6. #ifndef TF_PROJECTILE_ENERGY_BALL_H
  7. #define TF_PROJECTILE_ENERGY_BALL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tf_player.h"
  12. #include "tf_weaponbase_rocket.h"
  13. #include "iscorer.h"
  14. class CTFProjectile_EnergyBall : public CTFBaseRocket//, public IScorer
  15. {
  16. public:
  17. DECLARE_CLASS( CTFProjectile_EnergyBall, CTFBaseRocket );
  18. DECLARE_NETWORKCLASS();
  19. DECLARE_DATADESC();
  20. CTFProjectile_EnergyBall();
  21. ~CTFProjectile_EnergyBall();
  22. // Creation.
  23. static CTFProjectile_EnergyBall *Create( const Vector &vecOrigin, const QAngle &vecAngles, const float fSpeed, const float fGravity, CBaseEntity *pOwner = NULL, CBaseEntity *pScorer = NULL );
  24. virtual void InitEnergyBall( const Vector &vecOrigin, const QAngle &vecAngles, const float fSpeed, const float fGravity, CBaseEntity *pOwner = NULL, CBaseEntity *pScorer = NULL );
  25. virtual void Spawn();
  26. virtual void Precache();
  27. virtual int GetWeaponID( void ) const { return TF_WEAPON_PARTICLE_CANNON; }
  28. // IScorer interface
  29. virtual CBasePlayer *GetScorer( void );
  30. virtual CBasePlayer *GetAssistant( void ) { return NULL; }
  31. void SetScorer( CBaseEntity *pScorer );
  32. void SetCritical( bool bCritical ) { m_bCritical = bCritical; }
  33. virtual bool CanHeadshot() { return false; }
  34. void ImpactSound( const char *pszSoundName, bool bLoudForAttacker = false );
  35. virtual void ImpactTeamPlayer( CTFPlayer *pOther ) {}
  36. void FadeOut( int iTime );
  37. void RemoveThink();
  38. virtual float GetDamage();
  39. virtual int GetDamageCustom();
  40. virtual int GetDamageType();
  41. virtual bool IsDeflectable() { return true; }
  42. virtual void Deflected( CBaseEntity *pDeflectedBy, Vector &vecDir );
  43. void SetChargedShot( bool bCharged ) { m_bChargedShot = bCharged; }
  44. virtual void Explode( trace_t *pTrace, CBaseEntity *pOther );
  45. void SetColor( int idx, Vector vColor ) { if ( idx==1 ) m_vColor1=vColor; else m_vColor2=vColor; }
  46. const char *GetExplosionParticleName( void );
  47. private:
  48. CBaseHandle m_Scorer;
  49. CNetworkVar( bool, m_bChargedShot );
  50. CNetworkVector( m_vColor1 );
  51. CNetworkVector( m_vColor2 );
  52. protected:
  53. float m_flInitTime;
  54. };
  55. #endif //TF_PROJECTILE_ENERGY_BALL_H