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.

80 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Tripmine
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #ifndef TRIPWIRE_H
  10. #define TRIPWIRE_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #include "basegrenade_shared.h"
  15. class CRopeKeyframe;
  16. // ####################################################################
  17. // CTripwireHook
  18. //
  19. // This is what the tripwire shoots out at the end of the rope
  20. // ####################################################################
  21. class CTripwireHook : public CBaseAnimating
  22. {
  23. DECLARE_DATADESC();
  24. public:
  25. DECLARE_CLASS( CTripwireHook, CBaseAnimating );
  26. EHANDLE m_hGrenade;
  27. bool m_bAttached;
  28. void Spawn( void );
  29. void Precache( void );
  30. bool CreateVPhysics( void );
  31. void EndTouch( CBaseEntity *pOther );
  32. void SetVelocity( const Vector &velocity, const AngularImpulse &angVelocity );
  33. };
  34. class CTripwireGrenade : public CBaseGrenade
  35. {
  36. public:
  37. DECLARE_CLASS( CTripwireGrenade, CBaseGrenade );
  38. CTripwireGrenade();
  39. void Spawn( void );
  40. void Precache( void );
  41. int OnTakeDamage_Alive( const CTakeDamageInfo &info );
  42. void WarningThink( void );
  43. void PowerupThink( void );
  44. void RopeBreakThink( void );
  45. void FireThink( void );
  46. void Event_Killed( const CTakeDamageInfo &info );
  47. void Attach( void );
  48. void MakeRope( void );
  49. void BreakRope( void );
  50. void ShakeRope( void );
  51. void FireMissile(const Vector &vTargetPos);
  52. private:
  53. float m_flPowerUp;
  54. Vector m_vecDir;
  55. int m_nMissileCount;
  56. Vector m_vTargetPos;
  57. Vector m_vTargetOffset;
  58. CRopeKeyframe* m_pRope;
  59. CTripwireHook* m_pHook;
  60. DECLARE_DATADESC();
  61. };
  62. #endif //TRIPWIRE_H