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.

83 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TF_WEAPON_BOTTLE_H
  7. #define TF_WEAPON_BOTTLE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tf_weaponbase_melee.h"
  12. #ifdef CLIENT_DLL
  13. #define CTFBottle C_TFBottle
  14. #define CTFStickBomb C_TFStickBomb
  15. #endif
  16. //=============================================================================
  17. //
  18. // Bottle class.
  19. //
  20. class CTFBottle : public CTFWeaponBaseMelee
  21. {
  22. public:
  23. DECLARE_CLASS( CTFBottle, CTFWeaponBaseMelee );
  24. DECLARE_NETWORKCLASS();
  25. DECLARE_PREDICTABLE();
  26. CTFBottle();
  27. virtual int GetWeaponID( void ) const { return TF_WEAPON_BOTTLE; }
  28. virtual void Smack( void );
  29. virtual void WeaponReset( void );
  30. virtual bool DefaultDeploy( char *szViewModel, char *szWeaponModel, int iActivity, char *szAnimExt );
  31. virtual void SwitchBodyGroups( void );
  32. private:
  33. CTFBottle( const CTFBottle & ) {}
  34. protected:
  35. CNetworkVar( bool, m_bBroken );
  36. };
  37. //=============================================================================
  38. //
  39. // StickBomb class.
  40. //
  41. class CTFStickBomb : public CTFBottle
  42. {
  43. public:
  44. DECLARE_CLASS( CTFStickBomb, CTFBottle );
  45. DECLARE_NETWORKCLASS();
  46. DECLARE_PREDICTABLE();
  47. CTFStickBomb();
  48. virtual void Precache( void );
  49. virtual int GetWeaponID( void ) const { return TF_WEAPON_STICKBOMB; }
  50. virtual void Smack( void );
  51. virtual void WeaponReset( void );
  52. virtual void WeaponRegenerate( void );
  53. virtual void SwitchBodyGroups( void );
  54. virtual const char* GetWorldModel( void ) const;
  55. #ifdef CLIENT_DLL
  56. virtual int GetWorldModelIndex( void );
  57. #endif
  58. void SetDetonated( int iVal ) { m_iDetonated = iVal; }
  59. int GetDetonated( void ) { return m_iDetonated; }
  60. private:
  61. CNetworkVar( int, m_iDetonated ); // int, not bool so we can use a recv proxy
  62. };
  63. #endif // TF_WEAPON_BOTTLE_H