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.

81 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef WEAPON_KNIFE_H
  7. #define WEAPON_KNIFE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "weapon_csbase.h"
  12. #if defined( CLIENT_DLL )
  13. #define CKnife C_Knife
  14. #endif
  15. // ----------------------------------------------------------------------------- //
  16. // CKnife class definition.
  17. // ----------------------------------------------------------------------------- //
  18. class CKnife : public CWeaponCSBase
  19. {
  20. public:
  21. DECLARE_CLASS( CKnife, CWeaponCSBase );
  22. DECLARE_NETWORKCLASS();
  23. DECLARE_PREDICTABLE();
  24. #ifndef CLIENT_DLL
  25. DECLARE_DATADESC();
  26. #endif
  27. CKnife();
  28. // We say yes to this so the weapon system lets us switch to it.
  29. virtual bool HasPrimaryAmmo();
  30. virtual bool CanBeSelected();
  31. virtual void Precache();
  32. void Spawn();
  33. void Smack();
  34. //void Smack( trace_t *pTr, float delay );
  35. bool SwingOrStab( bool bStab );
  36. void PrimaryAttack();
  37. void SecondaryAttack();
  38. void WeaponAnimation( int iAnimation );
  39. virtual void ItemPostFrame( void );
  40. // virtual float GetSpread() const;
  41. bool Deploy();
  42. void Holster( int skiplocal = 0 );
  43. bool CanDrop();
  44. void WeaponIdle();
  45. virtual CSWeaponID GetWeaponID( void ) const { return WEAPON_KNIFE; }
  46. public:
  47. trace_t m_trHit;
  48. EHANDLE m_pTraceHitEnt;
  49. CNetworkVar( float, m_flSmackTime );
  50. bool m_bStab;
  51. private:
  52. CKnife( const CKnife & ) {}
  53. };
  54. #endif // WEAPON_KNIFE_H