Counter Strike : Global Offensive Source Code
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.

103 lines
3.0 KiB

  1. //========= Copyright � 1996-2005, 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 "te_particlesystem.h"
  15. // memdbgon must be the last include file in a .cpp file!!!
  16. #include "tier0/memdbgon.h"
  17. extern int g_sModelIndexSmoke; // (in combatweapon.cpp) holds the index for the smoke cloud
  18. //-----------------------------------------------------------------------------
  19. // Purpose: Dispatches smoke tempentity
  20. //-----------------------------------------------------------------------------
  21. class CTELargeFunnel : public CTEParticleSystem
  22. {
  23. public:
  24. DECLARE_CLASS( CTELargeFunnel, CTEParticleSystem );
  25. DECLARE_SERVERCLASS();
  26. CTELargeFunnel( const char *name );
  27. virtual ~CTELargeFunnel( void );
  28. virtual void Test( const Vector& current_origin, const QAngle& current_angles );
  29. public:
  30. CNetworkVar( int, m_nModelIndex );
  31. CNetworkVar( int, m_nReversed );
  32. };
  33. //-----------------------------------------------------------------------------
  34. // Purpose:
  35. // Input : *name -
  36. //-----------------------------------------------------------------------------
  37. CTELargeFunnel::CTELargeFunnel( const char *name ) :
  38. BaseClass( name )
  39. {
  40. m_nModelIndex = 0;
  41. m_nReversed = 0;
  42. }
  43. //-----------------------------------------------------------------------------
  44. // Purpose:
  45. //-----------------------------------------------------------------------------
  46. CTELargeFunnel::~CTELargeFunnel( void )
  47. {
  48. }
  49. //-----------------------------------------------------------------------------
  50. // Purpose:
  51. // Input : *current_origin -
  52. // *current_angles -
  53. //-----------------------------------------------------------------------------
  54. void CTELargeFunnel::Test( const Vector& current_origin, const QAngle& current_angles )
  55. {
  56. // Fill in data
  57. m_nModelIndex = g_sModelIndexSmoke;
  58. m_nReversed = 0;
  59. m_vecOrigin = current_origin;
  60. Vector forward, right;
  61. m_vecOrigin.GetForModify()[2] += 24;
  62. AngleVectors( current_angles, &forward, &right, NULL );
  63. forward[2] = 0.0;
  64. VectorNormalize( forward );
  65. VectorMA( m_vecOrigin.Get(), 50.0, forward, m_vecOrigin.GetForModify() );
  66. VectorMA( m_vecOrigin.Get(), 25.0, right, m_vecOrigin.GetForModify() );
  67. CBroadcastRecipientFilter filter;
  68. Create( filter, 0.0 );
  69. }
  70. IMPLEMENT_SERVERCLASS_ST(CTELargeFunnel, DT_TELargeFunnel)
  71. SendPropModelIndex( SENDINFO(m_nModelIndex) ),
  72. SendPropInt( SENDINFO(m_nReversed), 2, SPROP_UNSIGNED ),
  73. END_SEND_TABLE()
  74. // Singleton to fire TELargeFunnel objects
  75. static CTELargeFunnel g_TELargeFunnel( "Large Funnel" );
  76. void TE_LargeFunnel( IRecipientFilter& filter, float delay,
  77. const Vector* pos, int modelindex, int reversed )
  78. {
  79. g_TELargeFunnel.m_vecOrigin = *pos;
  80. g_TELargeFunnel.m_nModelIndex = modelindex;
  81. g_TELargeFunnel.m_nReversed = reversed;
  82. // Send it over the wire
  83. g_TELargeFunnel.Create( filter, delay );
  84. }