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.

61 lines
1.4 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef BASEPROJECTILE_H
  7. #define BASEPROJECTILE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. // Creation.
  12. struct baseprojectilecreate_t
  13. {
  14. Vector vecOrigin;
  15. Vector vecVelocity;
  16. CBaseEntity *pOwner;
  17. string_t iszModel;
  18. float flDamage;
  19. int iDamageType;
  20. float flDamageScale;
  21. };
  22. //=============================================================================
  23. //
  24. // Generic projectile
  25. //
  26. class CBaseProjectile : public CBaseAnimating
  27. {
  28. DECLARE_CLASS( CBaseProjectile, CBaseAnimating );
  29. public:
  30. DECLARE_DATADESC();
  31. void Spawn( void );
  32. void Precache( void );
  33. static CBaseProjectile *Create( baseprojectilecreate_t &pCreate );
  34. void SetDamage( float flDamage ) { m_flDamage = flDamage; }
  35. void SetDamageScale( float &flScale ) { m_flDamageScale = flScale; }
  36. void SetDamageType( int iType ) { m_iDamageType = iType; }
  37. private:
  38. // Damage
  39. virtual float GetDamage() { return m_flDamage; }
  40. virtual float GetDamageScale( void ) { return m_flDamageScale; }
  41. virtual int GetDamageType( void ) { return m_iDamageType; }
  42. unsigned int PhysicsSolidMaskForEntity( void ) const;
  43. virtual void ProjectileTouch( CBaseEntity *pOther );
  44. void FlyThink( void );
  45. protected:
  46. float m_flDamage;
  47. int m_iDamageType;
  48. float m_flDamageScale;
  49. };
  50. #endif // BASEPROJECTILE_H