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.

88 lines
2.0 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #if !defined( MOLOTOV_PROJECTILE_H )
  7. #define MOLOTOV_PROJECTILE_H
  8. #if defined( _WIN32 )
  9. #pragma once
  10. #endif
  11. #include "basecsgrenade_projectile.h"
  12. #if defined( CLIENT_DLL )
  13. class C_MolotovProjectile : public C_BaseCSGrenadeProjectile
  14. {
  15. public:
  16. DECLARE_CLASS( C_MolotovProjectile, C_BaseCSGrenadeProjectile );
  17. DECLARE_NETWORKCLASS();
  18. virtual bool Simulate( void );
  19. virtual void OnNewParticleEffect( const char *pszParticleName, CNewParticleEffect *pNewParticleEffect );
  20. virtual void OnParticleEffectDeleted( CNewParticleEffect *pParticleEffect );
  21. protected:
  22. CNetworkVar( bool, m_bIsIncGrenade );
  23. private:
  24. CUtlReference<CNewParticleEffect> m_molotovParticleEffect;
  25. };
  26. #else // GAME_DLL
  27. class CMolotovProjectile : public CBaseCSGrenadeProjectile
  28. {
  29. public:
  30. DECLARE_CLASS( CMolotovProjectile, CBaseCSGrenadeProjectile );
  31. DECLARE_NETWORKCLASS();
  32. DECLARE_DATADESC();
  33. // Overrides.
  34. public:
  35. virtual void Spawn( void );
  36. virtual void Precache( void );
  37. virtual void BounceTouch( CBaseEntity *other );
  38. virtual void BounceSound( void );
  39. virtual void Detonate( void );
  40. // virtual int GetDamageType( void ) const { return DMG_BURN; }
  41. virtual GrenadeType_t GetGrenadeType( void ) { return GRENADE_TYPE_FIRE; }
  42. void SetIsIncGrenade( bool bIsIncGrenade ) { m_bIsIncGrenade = bIsIncGrenade; }
  43. // Grenade stuff.
  44. public:
  45. static CMolotovProjectile* Create(
  46. const Vector &position,
  47. const QAngle &angles,
  48. const Vector &velocity,
  49. const AngularImpulse &angVelocity,
  50. CBaseCombatCharacter *pOwner,
  51. const CCSWeaponInfo& weaponInfo );
  52. void InitializeSpawnFromWorld( inputdata_t &inputdata );
  53. protected:
  54. CNetworkVar( bool, m_bIsIncGrenade );
  55. private:
  56. void DetonateThink( void );
  57. void SetTimer( float timer );
  58. IntervalTimer m_stillTimer;
  59. IntervalTimer m_throwDetTimer;
  60. float m_flDetonateTime;
  61. };
  62. #endif // GAME_DLL
  63. #endif // MOLOTOV_PROJECTILE_H