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.

85 lines
2.8 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef PARTICLE_SYSTEM_H
  7. #define PARTICLE_SYSTEM_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "cbase.h"
  12. //-----------------------------------------------------------------------------
  13. // Purpose: An entity that spawns and controls a particle system
  14. //-----------------------------------------------------------------------------
  15. class CParticleSystem : public CBaseEntity
  16. {
  17. DECLARE_CLASS( CParticleSystem, CBaseEntity );
  18. public:
  19. DECLARE_SERVERCLASS();
  20. DECLARE_DATADESC();
  21. CParticleSystem( void );
  22. virtual void Precache( void );
  23. virtual void Spawn( void );
  24. virtual void Activate( void );
  25. virtual int UpdateTransmitState(void);
  26. virtual int ObjectCaps( void );
  27. virtual bool KeyValue( const char *szKeyName, const char *szValue );
  28. virtual bool GetKeyValue( const char *szKeyName, char *szValue, int iMaxLen );
  29. void StartParticleSystem( void );
  30. void StopParticleSystem( int nStopType = STOP_NORMAL );
  31. void InputStart( inputdata_t &inputdata );
  32. void InputStop( inputdata_t &inputdata );
  33. void InputStopEndCap( inputdata_t &inputdata );
  34. void InputDestroy( inputdata_t &inputdata );
  35. void StartParticleSystemThink( void );
  36. bool SetControlPointValue( int iControlPoint, const Vector &vValue ); //server controlled control points (variables in particle effects instead of literal follow points)
  37. void DisableSaveRestore( bool bState ) { m_bNoSave = bState; }
  38. enum
  39. {
  40. kSERVERCONTROLLEDPOINTS = 4,
  41. kMAXCONTROLPOINTS = 63, ///< actually one less than the total number of cpoints since 0 is assumed to be me
  42. };
  43. // stop types
  44. enum
  45. {
  46. STOP_NORMAL = 0,
  47. STOP_DESTROY_IMMEDIATELY,
  48. STOP_PLAY_ENDCAP,
  49. NUM_STOP_TYPES
  50. };
  51. protected:
  52. /// Load up and resolve the entities that are supposed to be the control points
  53. void ReadControlPointEnts( void );
  54. bool m_bNoSave;
  55. bool m_bStartActive;
  56. string_t m_iszEffectName;
  57. CNetworkString( m_szSnapshotFileName, MAX_PATH );
  58. CNetworkVar( bool, m_bActive );
  59. CNetworkVar( int, m_nStopType );
  60. CNetworkVar( int, m_iEffectIndex );
  61. CNetworkVar( float, m_flStartTime ); // Time at which this effect was started. This is used after restoring an active effect.
  62. //server controlled control points (variables in particle effects instead of literal follow points)
  63. CNetworkArray( Vector, m_vServerControlPoints, kSERVERCONTROLLEDPOINTS );
  64. CNetworkArray( uint8, m_iServerControlPointAssignments, kSERVERCONTROLLEDPOINTS );
  65. string_t m_iszControlPointNames[kMAXCONTROLPOINTS];
  66. CNetworkArray( EHANDLE, m_hControlPointEnts, kMAXCONTROLPOINTS );
  67. CNetworkArray( unsigned char, m_iControlPointParents, kMAXCONTROLPOINTS );
  68. };
  69. #endif // PARTICLE_SYSTEM_H