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.

72 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef C_PLANTEDC4_H
  9. #define C_PLANTEDC4_H
  10. #include "cbase.h"
  11. #include "in_buttons.h"
  12. #include "decals.h"
  13. #include "c_cs_player.h"
  14. #include "utlvector.h"
  15. // ------------------------------------------------------------------------------------------ //
  16. // CPlantedC4 class.
  17. // For now to show the planted c4 on the radar - client proxy to remove the CBaseAnimating
  18. // network vars?
  19. // ------------------------------------------------------------------------------------------ //
  20. class C_PlantedC4 : public C_BaseAnimating
  21. {
  22. public:
  23. DECLARE_CLASS( C_PlantedC4, CBaseAnimating );
  24. DECLARE_CLIENTCLASS();
  25. C_PlantedC4();
  26. virtual ~C_PlantedC4();
  27. void Explode( void );
  28. void Spawn( void );
  29. virtual void SetDormant( bool bDormant );
  30. void ClientThink( void );
  31. int GetSecondsRemaining( void ) { return ceil( m_flC4Blow - gpGlobals->curtime ); }
  32. inline bool IsBombActive( void ) { return m_bBombTicking; }
  33. CNetworkVar( bool, m_bBombTicking );
  34. float m_flNextGlow;
  35. float m_flNextBeep;
  36. float m_flC4Blow;
  37. float m_flTimerLength;
  38. CNetworkVar( float, m_flDefuseLength );
  39. CNetworkVar( float, m_flDefuseCountDown );
  40. float GetDefuseProgress( void )
  41. {
  42. float flProgress = 1.0f;
  43. if( m_flDefuseLength > 0.0 )
  44. {
  45. flProgress = ( ( m_flDefuseCountDown - gpGlobals->curtime ) / m_flDefuseLength );
  46. }
  47. return flProgress;
  48. }
  49. float m_flNextRadarFlashTime; // next time to change flash state
  50. bool m_bRadarFlash; // is the flash on or off
  51. CNewParticleEffect *m_pC4Explosion; // client side explosion particle effect for the bomb
  52. };
  53. extern CUtlVector< C_PlantedC4* > g_PlantedC4s;
  54. #endif //C_PLANTEDC4_H