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.

74 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Projectile shot by mortar synth
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #ifndef GRENADEBEAM_H
  14. #define GRENADEBEAM_H
  15. #include "basegrenade_shared.h"
  16. #define GRENADEBEAM_MAXBEAMS 2
  17. #define GRENADEBEAM_MAXHITS GRENADEBEAM_MAXBEAMS-1
  18. class CGrenadeBeam;
  19. class CBeam;
  20. // End of the grenade beam
  21. class CGrenadeBeamChaser : public CBaseAnimating
  22. {
  23. public:
  24. DECLARE_CLASS( CGrenadeBeamChaser, CBaseAnimating );
  25. DECLARE_DATADESC();
  26. static CGrenadeBeamChaser* ChaserCreate( CGrenadeBeam *pTarget );
  27. void Spawn( void );
  28. void ChaserThink();
  29. CGrenadeBeam* m_pTarget;
  30. };
  31. class CGrenadeBeam : public CBaseGrenade
  32. {
  33. public:
  34. DECLARE_CLASS( CGrenadeBeam, CBaseGrenade );
  35. DECLARE_DATADESC();
  36. static CGrenadeBeam* Create( CBaseEntity* pOwner, const Vector &vStart);
  37. public:
  38. void Spawn( void );
  39. void Precache( void );
  40. void Format( color32 clrColor, float flWidth);
  41. void GrenadeBeamTouch( CBaseEntity *pOther );
  42. void KillBeam();
  43. void CreateBeams(void);
  44. void UpdateBeams(void);
  45. //void DebugBeams(void);
  46. void GetChaserTargetPos(Vector *vPosition);
  47. void GetNextTargetPos(Vector *vPosition);
  48. int UpdateTransmitState(void);
  49. void Shoot(Vector vDirection, float flSpeed, float flLifetime, float flLag, float flDamage );
  50. Vector m_vLaunchPos;
  51. float m_flBeamWidth;
  52. float m_flBeamSpeed;
  53. float m_flBeamLag;
  54. float m_flLaunchTime;
  55. float m_flLastTouchTime;
  56. EHANDLE m_hBeamChaser;
  57. int m_nNumHits;
  58. Vector m_pHitLocation[GRENADEBEAM_MAXHITS];
  59. CBeam* m_pBeam[GRENADEBEAM_MAXBEAMS];
  60. };
  61. #endif //GRENADEBEAM_H