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.

90 lines
2.5 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #include "cbase.h"
  10. #include "c_basetempentity.h"
  11. #include "IEffects.h"
  12. #include "tier0/vprof.h"
  13. // memdbgon must be the last include file in a .cpp file!!!
  14. #include "tier0/memdbgon.h"
  15. //-----------------------------------------------------------------------------
  16. // Purpose: Energy Splash TE
  17. //-----------------------------------------------------------------------------
  18. class C_TEEnergySplash : public C_BaseTempEntity
  19. {
  20. public:
  21. DECLARE_CLIENTCLASS();
  22. C_TEEnergySplash( void );
  23. virtual ~C_TEEnergySplash( void );
  24. virtual void PostDataUpdate( DataUpdateType_t updateType );
  25. virtual void Precache( void );
  26. public:
  27. Vector m_vecPos;
  28. Vector m_vecDir;
  29. bool m_bExplosive;
  30. const struct model_t *m_pModel;
  31. };
  32. //-----------------------------------------------------------------------------
  33. // Purpose:
  34. //-----------------------------------------------------------------------------
  35. C_TEEnergySplash::C_TEEnergySplash( void )
  36. {
  37. m_vecPos.Init();
  38. m_vecDir.Init();
  39. m_bExplosive = false;
  40. m_pModel = NULL;
  41. }
  42. //-----------------------------------------------------------------------------
  43. // Purpose:
  44. //-----------------------------------------------------------------------------
  45. C_TEEnergySplash::~C_TEEnergySplash( void )
  46. {
  47. }
  48. //-----------------------------------------------------------------------------
  49. // Purpose:
  50. //-----------------------------------------------------------------------------
  51. void C_TEEnergySplash::Precache( void )
  52. {
  53. }
  54. //-----------------------------------------------------------------------------
  55. // Purpose:
  56. // Input : bool -
  57. //-----------------------------------------------------------------------------
  58. void C_TEEnergySplash::PostDataUpdate( DataUpdateType_t updateType )
  59. {
  60. VPROF( "C_TEEnergySplash::PostDataUpdate" );
  61. g_pEffects->EnergySplash( m_vecPos, m_vecDir, m_bExplosive );
  62. }
  63. void TE_EnergySplash( IRecipientFilter& filter, float delay,
  64. const Vector* pos, const Vector* dir, bool bExplosive )
  65. {
  66. g_pEffects->EnergySplash( *pos, *dir, bExplosive );
  67. }
  68. // Expose the TE to the engine.
  69. IMPLEMENT_CLIENTCLASS_EVENT( C_TEEnergySplash, DT_TEEnergySplash, CTEEnergySplash );
  70. BEGIN_RECV_TABLE_NOBASE(C_TEEnergySplash, DT_TEEnergySplash)
  71. RecvPropVector(RECVINFO(m_vecPos)),
  72. RecvPropVector(RECVINFO(m_vecDir)),
  73. RecvPropInt(RECVINFO(m_bExplosive)),
  74. END_RECV_TABLE()