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.

111 lines
3.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #include "cbase.h"
  14. #include "basetempentity.h"
  15. #include "te_basebeam.h"
  16. // memdbgon must be the last include file in a .cpp file!!!
  17. #include "tier0/memdbgon.h"
  18. //-----------------------------------------------------------------------------
  19. // Purpose: Dispatches a beam ring between two entities
  20. //-----------------------------------------------------------------------------
  21. class CTEBeamFollow : public CTEBaseBeam
  22. {
  23. DECLARE_CLASS( CTEBeamFollow, CTEBaseBeam );
  24. public:
  25. DECLARE_SERVERCLASS();
  26. CTEBeamFollow( const char *name );
  27. virtual ~CTEBeamFollow( void );
  28. virtual void Test( const Vector& current_origin, const QAngle& current_angles );
  29. public:
  30. CNetworkVar( int, m_iEntIndex );
  31. };
  32. //-----------------------------------------------------------------------------
  33. // Purpose:
  34. // Input : *name -
  35. //-----------------------------------------------------------------------------
  36. CTEBeamFollow::CTEBeamFollow( const char *name ) :
  37. CTEBaseBeam( name )
  38. {
  39. m_iEntIndex = -1;
  40. }
  41. //-----------------------------------------------------------------------------
  42. // Purpose:
  43. //-----------------------------------------------------------------------------
  44. CTEBeamFollow::~CTEBeamFollow( void )
  45. {
  46. }
  47. //-----------------------------------------------------------------------------
  48. // Purpose:
  49. // Input : *current_origin -
  50. // *current_angles -
  51. //-----------------------------------------------------------------------------
  52. void CTEBeamFollow::Test( const Vector& current_origin, const QAngle& current_angles )
  53. {
  54. m_iEntIndex = 1;
  55. }
  56. IMPLEMENT_SERVERCLASS_ST(CTEBeamFollow, DT_TEBeamFollow)
  57. SendPropInt( SENDINFO(m_iEntIndex), 24, SPROP_UNSIGNED ),
  58. END_SEND_TABLE()
  59. // Singleton to fire TEBeamEntPoint objects
  60. static CTEBeamFollow g_TEBeamFollow( "BeamFollow" );
  61. //-----------------------------------------------------------------------------
  62. // Purpose:
  63. // Input : filter -
  64. // delay -
  65. // iEntIndex -
  66. // modelIndex -
  67. // modelindex -
  68. // haloIndex -
  69. // life -
  70. // width -
  71. // endWidth -
  72. // fadeLength -
  73. // r -
  74. // g -
  75. // b -
  76. // a -
  77. //-----------------------------------------------------------------------------
  78. void TE_BeamFollow( IRecipientFilter& filter, float delay,
  79. int iEntIndex, int modelIndex, int haloIndex, float life, float width, float endWidth,
  80. float fadeLength,float r, float g, float b, float a )
  81. {
  82. g_TEBeamFollow.m_iEntIndex = (iEntIndex & 0x0FFF) | ((1 & 0xF)<<12);
  83. g_TEBeamFollow.m_nModelIndex = modelIndex;
  84. g_TEBeamFollow.m_nHaloIndex = haloIndex;
  85. g_TEBeamFollow.m_nStartFrame = 0;
  86. g_TEBeamFollow.m_nFrameRate = 0;
  87. g_TEBeamFollow.m_fLife = life;
  88. g_TEBeamFollow.m_fWidth = width;
  89. g_TEBeamFollow.m_fEndWidth = endWidth;
  90. g_TEBeamFollow.m_nFadeLength = fadeLength;
  91. g_TEBeamFollow.r = r;
  92. g_TEBeamFollow.g = g;
  93. g_TEBeamFollow.b = b;
  94. g_TEBeamFollow.a = a;
  95. // Send it over the wire
  96. g_TEBeamFollow.Create( filter, delay );
  97. }