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.

79 lines
1.8 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef DECOY_PROJECTILE_H
  7. #define DECOY_PROJECTILE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "basecsgrenade_projectile.h"
  12. #if defined( CLIENT_DLL )
  13. class C_DecoyProjectile : public C_BaseCSGrenadeProjectile
  14. {
  15. public:
  16. DECLARE_CLASS( C_DecoyProjectile, 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. private:
  22. CUtlReference<CNewParticleEffect> m_decoyParticleEffect;
  23. };
  24. #else // GAME_DLL
  25. struct DecoyWeaponProfile;
  26. class CDecoyProjectile : public CBaseCSGrenadeProjectile
  27. {
  28. public:
  29. DECLARE_CLASS( CDecoyProjectile, CBaseCSGrenadeProjectile );
  30. DECLARE_NETWORKCLASS();
  31. DECLARE_DATADESC();
  32. // Overrides.
  33. public:
  34. virtual void Spawn( void );
  35. virtual void Precache( void );
  36. virtual void Detonate( void );
  37. virtual void BounceSound( void );
  38. virtual GrenadeType_t GetGrenadeType( void ) { return GRENADE_TYPE_DECOY; }
  39. // Grenade stuff.
  40. static CDecoyProjectile* Create(
  41. const Vector &position,
  42. const QAngle &angles,
  43. const Vector &velocity,
  44. const AngularImpulse &angVelocity,
  45. CBaseCombatCharacter *pOwner,
  46. const CCSWeaponInfo& weaponInfo );
  47. private:
  48. void Think_Detonate( void );
  49. void GunfireThink( void );
  50. void SetTimer( float timer );
  51. int m_shotsRemaining;
  52. float m_fExpireTime;
  53. DecoyWeaponProfile* m_pProfile;
  54. CSWeaponID m_decoyWeaponId;
  55. item_definition_index_t m_decoyWeaponDefIndex;
  56. WeaponSound_t m_decoyWeaponSoundType;
  57. };
  58. #endif // GAME_DLL
  59. #endif // DECOY_PROJECTILE_H