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.

89 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef C_TF_PROJECTILE_ARROW_H
  7. #define C_TF_PROJECTILE_ARROW_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tf_weaponbase_rocket.h"
  12. #define CTFProjectile_Arrow C_TFProjectile_Arrow
  13. //-----------------------------------------------------------------------------
  14. // Purpose: Arrow projectile.
  15. //-----------------------------------------------------------------------------
  16. class C_TFProjectile_Arrow : public C_TFBaseRocket
  17. {
  18. DECLARE_CLASS( C_TFProjectile_Arrow, C_TFBaseRocket );
  19. public:
  20. DECLARE_NETWORKCLASS();
  21. C_TFProjectile_Arrow();
  22. ~C_TFProjectile_Arrow();
  23. virtual void OnDataChanged( DataUpdateType_t updateType );
  24. virtual void NotifyBoneAttached( C_BaseAnimating* attachTarget );
  25. virtual void ClientThink( void );
  26. void CheckNearMiss( void );
  27. void CreateCritTrail( void );
  28. void SetLifeTime( float flLifetime ) { m_flLifeTime = flLifetime; }
  29. private:
  30. float m_fAttachTime;
  31. float m_nextNearMissCheck;
  32. bool m_bNearMiss;
  33. bool m_bArrowAlight;
  34. bool m_bCritical;
  35. CNewParticleEffect *m_pCritEffect;
  36. int m_iCachedDeflect;
  37. float m_flLifeTime;
  38. CNetworkVar( int, m_iProjectileType );
  39. };
  40. //-----------------------------------------------------------------------------
  41. // Purpose: Arrow projectile.
  42. //-----------------------------------------------------------------------------
  43. class C_TFProjectile_HealingBolt : public C_TFProjectile_Arrow
  44. {
  45. DECLARE_CLASS( C_TFProjectile_HealingBolt, C_TFProjectile_Arrow );
  46. virtual void OnDataChanged( DataUpdateType_t updateType );
  47. public:
  48. DECLARE_NETWORKCLASS();
  49. };
  50. //-----------------------------------------------------------------------------
  51. // Purpose: Grappling Hook projectile.
  52. //-----------------------------------------------------------------------------
  53. class C_TFProjectile_GrapplingHook : public C_TFProjectile_Arrow
  54. {
  55. DECLARE_CLASS( C_TFProjectile_GrapplingHook, C_TFProjectile_Arrow );
  56. public:
  57. DECLARE_NETWORKCLASS();
  58. virtual void OnDataChanged( DataUpdateType_t updateType );
  59. virtual void UpdateOnRemove();
  60. virtual void ClientThink();
  61. private:
  62. void UpdateRope();
  63. void RemoveRope();
  64. CHandle< C_RopeKeyframe > m_hRope;
  65. };
  66. #endif // C_TF_PROJECTILE_ARROW_H