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.

59 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // TF Rocket Projectile
  4. //
  5. //=============================================================================
  6. #ifndef TF_PROJECTILE_ROCKET_H
  7. #define TF_PROJECTILE_ROCKET_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tf_weaponbase_rocket.h"
  12. #include "iscorer.h"
  13. //=============================================================================
  14. //
  15. // Generic rocket.
  16. //
  17. class CTFProjectile_Rocket : public CTFBaseRocket, public IScorer
  18. {
  19. public:
  20. DECLARE_CLASS( CTFProjectile_Rocket, CTFBaseRocket );
  21. DECLARE_NETWORKCLASS();
  22. // Creation.
  23. static CTFProjectile_Rocket *Create( CBaseEntity *pLauncher, const Vector &vecOrigin, const QAngle &vecAngles, CBaseEntity *pOwner = NULL, CBaseEntity *pScorer = NULL );
  24. virtual void Spawn();
  25. virtual void Precache();
  26. virtual void RocketTouch( CBaseEntity *pOther ) OVERRIDE;
  27. // IScorer interface
  28. virtual CBasePlayer *GetScorer( void );
  29. virtual CBasePlayer *GetAssistant( void ) { return NULL; }
  30. void SetScorer( CBaseEntity *pScorer );
  31. void SetCritical( bool bCritical ) { m_bCritical = bCritical; }
  32. bool IsCritical() { return m_bCritical; }
  33. virtual int GetDamageType();
  34. virtual int GetDamageCustom();
  35. virtual bool IsDeflectable() { return true; }
  36. virtual void Deflected( CBaseEntity *pDeflectedBy, Vector &vecDir );
  37. void SetDirectHit( bool bDirectHit ){ m_bDirectHit = bDirectHit; }
  38. virtual int GetWeaponID( void ) const { return ( m_bDirectHit ? TF_WEAPON_ROCKETLAUNCHER_DIRECTHIT : TF_WEAPON_ROCKETLAUNCHER ); }
  39. void SetEyeBallRocket( bool state ){ m_bEyeBallRocket = state; }
  40. void SetSpell( bool bSpell ) { m_bSpell = bSpell; }
  41. private:
  42. CBaseHandle m_Scorer;
  43. CNetworkVar( bool, m_bCritical );
  44. bool m_bDirectHit;
  45. bool m_bEyeBallRocket;
  46. bool m_bSpell;
  47. };
  48. #endif //TF_PROJECTILE_ROCKET_H