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.

50 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef RAGDOLLBOOGIE_H
  7. #define RAGDOLLBOOGIE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. //-----------------------------------------------------------------------------
  12. // Set this spawnflag before calling Spawn to get electrical effects
  13. //-----------------------------------------------------------------------------
  14. #define SF_RAGDOLL_BOOGIE_ELECTRICAL 0x10000
  15. #define SF_RAGDOLL_BOOGIE_ELECTRICAL_NARROW_BEAM 0x20000
  16. //-----------------------------------------------------------------------------
  17. // Makes ragdolls DANCE!
  18. //-----------------------------------------------------------------------------
  19. class CRagdollBoogie : public CBaseEntity
  20. {
  21. DECLARE_DATADESC();
  22. DECLARE_CLASS( CRagdollBoogie, CBaseEntity );
  23. public:
  24. static CRagdollBoogie *Create( CBaseEntity *pTarget, float flMagnitude, float flStartTime, float flLengthTime = 0.0f, int nSpawnFlags = 0 );
  25. static void IncrementSuppressionCount( CBaseEntity *pTarget );
  26. static void DecrementSuppressionCount( CBaseEntity *pTarget );
  27. void Spawn();
  28. private:
  29. void AttachToEntity( CBaseEntity *pTarget );
  30. void SetBoogieTime( float flStartTime, float flLengthTime );
  31. void SetMagnitude( float flMagnitude );
  32. void BoogieThink( void );
  33. void ZapThink();
  34. float m_flStartTime;
  35. float m_flBoogieLength;
  36. float m_flMagnitude;
  37. int m_nSuppressionCount;
  38. };
  39. #endif // RAGDOLLBOOGIE_H