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.

106 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TF_WEAPON_BUFF_ITEM_H
  7. #define TF_WEAPON_BUFF_ITEM_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tf_weaponbase_melee.h"
  12. #include "tf_item_wearable.h"
  13. #include "GameEventListener.h"
  14. #ifdef CLIENT_DLL
  15. #include "c_tf_buff_banner.h"
  16. #define CTFBuffItem C_TFBuffItem
  17. class C_TFBuffBanner;
  18. #endif
  19. //=============================================================================
  20. //
  21. // Buff item weapon class.
  22. //
  23. enum EBuffItemTypes
  24. {
  25. EBuffBanner = 1,
  26. EBattalion,
  27. EConcheror,
  28. EParachute,
  29. NUM_BUFF_ITEM_TYPES = EParachute
  30. };
  31. enum EParachuteStates
  32. {
  33. EParachuteDeployed,
  34. EParachuteDeployed_Idle,
  35. EParachuteRetracted,
  36. EParachuteRetracted_Idle,
  37. };
  38. class CTFBuffItem : public CTFWeaponBaseMelee
  39. {
  40. public:
  41. DECLARE_CLASS( CTFBuffItem, CTFWeaponBaseMelee );
  42. DECLARE_NETWORKCLASS();
  43. DECLARE_PREDICTABLE();
  44. CTFBuffItem();
  45. ~CTFBuffItem();
  46. virtual int GetWeaponID( void ) const { return TF_WEAPON_BUFF_ITEM; }
  47. virtual void Precache();
  48. virtual void PrimaryAttack();
  49. virtual void Equip( CBaseCombatCharacter *pOwner ) OVERRIDE;
  50. virtual void Detach( void ) OVERRIDE;
  51. void FireGameEvent( IGameEvent* event );
  52. virtual void CreateBanner();
  53. virtual bool SendWeaponAnim( int iActivity );
  54. void BlowHorn( void );
  55. void RaiseFlag( void );
  56. virtual bool Holster( CBaseCombatWeapon *pSwitchingTo );
  57. virtual bool CanReload( void );
  58. virtual int GetBuffType() { int iBuffType = 0; CALL_ATTRIB_HOOK_INT( iBuffType, set_buff_type ); return iBuffType; }
  59. #ifdef CLIENT_DLL
  60. void SetBanner( C_TFBuffBanner* pNewBanner ) { m_hBannerEntity.Set( pNewBanner ); }
  61. virtual void NotifyShouldTransmit( ShouldTransmitState_t state );
  62. virtual void OnDataChanged( DataUpdateType_t updateType );
  63. virtual void ClientThink( void );
  64. #endif
  65. virtual void WeaponReset( void );
  66. float GetProgress( void );
  67. bool IsFull( void ); // same as GetProgress() without the division by 100.0f
  68. const char* GetEffectLabelText( void ) { return "#TF_RAGE"; }
  69. bool EffectMeterShouldFlash( void );
  70. protected:
  71. #ifdef CLIENT_DLL
  72. CHandle<C_TFBuffBanner> m_hBannerEntity;
  73. int m_iBuffType;
  74. #endif // CLIENT_DLL
  75. private:
  76. CTFBuffItem( const CTFBuffItem & ) {}
  77. bool m_bPlayingHorn;
  78. };
  79. #endif // TF_WEAPON_BUFF_ITEM_H