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.

93 lines
2.3 KiB

  1. //========= Copyright � 1996-2005, 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 "c_rope.h"
  15. #include "utlvector.h"
  16. // ------------------------------------------------------------------------------------------ //
  17. // CPlantedC4 class.
  18. // For now to show the planted c4 on the radar - client proxy to remove the CBaseAnimating
  19. // network vars?
  20. // ------------------------------------------------------------------------------------------ //
  21. class C_PlantedC4 : public C_BaseAnimating
  22. {
  23. public:
  24. DECLARE_CLASS( C_PlantedC4, CBaseAnimating );
  25. DECLARE_CLIENTCLASS();
  26. C_PlantedC4();
  27. virtual ~C_PlantedC4();
  28. void Explode( void );
  29. void Spawn( void );
  30. virtual void SetDormant( bool bDormant );
  31. void ClientThink( void );
  32. int GetSecondsRemaining( void ) { return ceil( m_flC4Blow - gpGlobals->curtime ); }
  33. inline bool IsBombActive( void ) { return m_bBombTicking; }
  34. CNetworkVar( bool, m_bBombTicking );
  35. float m_flNextGlow;
  36. float m_flNextBeep;
  37. float m_flC4Blow;
  38. float m_flTimerLength;
  39. float m_bTenSecWarning;
  40. float m_bTriggerWarning;
  41. float m_bExplodeWarning;
  42. CNetworkVar( float, m_flDefuseLength );
  43. CNetworkVar( float, m_flDefuseCountDown );
  44. CNetworkVar( bool, m_bBombDefused );
  45. CNetworkVar( CHandle<CCSPlayer>, m_hBombDefuser );
  46. CGlowObject m_GlowObject;
  47. CUtlVector<CHandle<C_RopeKeyframe>> m_hDefuserRopes;
  48. CHandle<C_BaseAnimating> m_hDefuserMultimeter;
  49. float GetDefuseProgress( void )
  50. {
  51. float flProgress = 1.0f;
  52. if( m_flDefuseLength > 0.0 )
  53. {
  54. flProgress = ( ( m_flDefuseCountDown - gpGlobals->curtime ) / m_flDefuseLength );
  55. }
  56. return flProgress;
  57. }
  58. // returns progress towards detonation in percent (detonation at 0%)
  59. float GetDetonationProgress( void );
  60. float m_flNextRadarFlashTime; // next time to change flash state
  61. bool m_bRadarFlash; // is the flash on or off
  62. virtual void UpdateOnRemove( void ) OVERRIDE;
  63. private:
  64. bool CreateDefuserRopes( void );
  65. void DestroyDefuserRopes( void );
  66. CHandle<CCSPlayer> m_hLocalDefusingPlayerHandle;
  67. };
  68. extern CUtlVector< C_PlantedC4* > g_PlantedC4s;
  69. #endif //C_PLANTEDC4_H