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.

64 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // TF Pumpkin Bomb
  4. //
  5. //=============================================================================
  6. #ifndef TF_PUMPKIN_BOMB_H
  7. #define TF_PUMPKIN_BOMB_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #ifdef CLIENT_DLL
  12. #define CTFPumpkinBomb C_TFPumpkinBomb
  13. #endif
  14. class CTFPumpkinBombShim : public CBaseAnimating
  15. {
  16. virtual void PumpkinTouch( CBaseEntity *pOther ) = 0;
  17. public:
  18. void Touch( CBaseEntity *pOther ) { return PumpkinTouch( pOther ) ; }
  19. };
  20. DECLARE_AUTO_LIST( ITFPumpkinBomb );
  21. class CTFPumpkinBomb : public CTFPumpkinBombShim, public ITFPumpkinBomb
  22. {
  23. DECLARE_CLASS( CTFPumpkinBomb, CBaseAnimating );
  24. DECLARE_NETWORKCLASS();
  25. public:
  26. CTFPumpkinBomb();
  27. ~CTFPumpkinBomb() {}
  28. virtual void Precache( void );
  29. virtual void Spawn( void );
  30. void Break( void );
  31. virtual void PumpkinTouch( CBaseEntity *pOther ) OVERRIDE;
  32. void SetInitParams( float scale, float damage, float radius, int iTeam, float flLifeTime );
  33. void RemovePumpkin();
  34. #ifdef GAME_DLL
  35. virtual void Event_Killed( const CTakeDamageInfo &info );
  36. virtual int OnTakeDamage( const CTakeDamageInfo &info );
  37. void SetSpell( bool bSpell ) { m_bIsSpell = bSpell; }
  38. #endif
  39. private:
  40. #ifdef GAME_DLL
  41. bool m_bIsSpell;
  42. #endif
  43. bool m_bDead;
  44. bool m_bPrecached;
  45. int m_iTeam;
  46. float m_flDamage;
  47. float m_flScale;
  48. float m_flRadius;
  49. float m_flLifeTime;
  50. };
  51. #endif //TF_PUMPKIN_BOMB_H