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.

68 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // TF Generic Bomb
  4. //
  5. //=============================================================================
  6. #ifndef TF_GENERIC_BOMB_H
  7. #define TF_GENERIC_BOMB_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #ifdef CLIENT_DLL
  12. #define CTFGenericBomb C_TFGenericBomb
  13. #endif
  14. class CTFGenericBombShim : public CBaseAnimating
  15. {
  16. virtual void GenericTouch( CBaseEntity *pOther ) = 0;
  17. public:
  18. void Touch( CBaseEntity *pOther ) { return GenericTouch( pOther ) ; }
  19. };
  20. DECLARE_AUTO_LIST( ITFGenericBomb );
  21. class CTFGenericBomb : public CTFGenericBombShim, public ITFGenericBomb
  22. {
  23. DECLARE_CLASS( CTFGenericBomb, CBaseAnimating );
  24. DECLARE_NETWORKCLASS();
  25. enum EWhoToDamage
  26. {
  27. DAMAGE_ATTACKER_AND_ATTACKER_ENEMIES,
  28. DAMAGE_EVERYONE
  29. };
  30. public:
  31. CTFGenericBomb();
  32. ~CTFGenericBomb() {}
  33. virtual void Precache( void );
  34. virtual void Spawn( void );
  35. virtual void GenericTouch( CBaseEntity *pOther ) OVERRIDE;
  36. #ifdef GAME_DLL
  37. DECLARE_DATADESC();
  38. virtual void Event_Killed( const CTakeDamageInfo &info );
  39. #endif
  40. private:
  41. #ifdef GAME_DLL
  42. void Detonate( inputdata_t& inputdata );
  43. COutputEvent m_OnDetonate;
  44. #endif
  45. bool m_bDead;
  46. bool m_bPrecached;
  47. int m_iTeam;
  48. float m_flDamage;
  49. int m_nHealth;
  50. float m_flRadius;
  51. string_t m_strExplodeParticleName;
  52. string_t m_strHitParticleName;
  53. string_t m_strExplodeSoundName;
  54. EWhoToDamage m_eWhoToDamage;
  55. };
  56. #endif //TF_GENERIC_BOMB_H