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.

85 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //
  4. //=============================================================================
  5. #ifndef TF_WEAPON_REVOLVER_H
  6. #define TF_WEAPON_REVOLVER_H
  7. #ifdef _WIN32
  8. #pragma once
  9. #endif
  10. #include "tf_weaponbase_gun.h"
  11. // Client specific.
  12. #ifdef CLIENT_DLL
  13. #define CTFRevolver C_TFRevolver
  14. #define CTFRevolver_Secondary C_TFRevolver_Secondary
  15. #endif
  16. //=============================================================================
  17. //
  18. // TF Weapon Revolver.
  19. //
  20. class CTFRevolver : public CTFWeaponBaseGun
  21. {
  22. public:
  23. DECLARE_CLASS( CTFRevolver, CTFWeaponBaseGun );
  24. DECLARE_NETWORKCLASS();
  25. DECLARE_PREDICTABLE();
  26. // Server specific.
  27. #ifdef GAME_DLL
  28. DECLARE_DATADESC();
  29. #endif
  30. CTFRevolver();
  31. ~CTFRevolver() {}
  32. virtual int GetWeaponID( void ) const { return TF_WEAPON_REVOLVER; }
  33. virtual int GetDamageType( void ) const;
  34. virtual bool CanFireCriticalShot( bool bIsHeadshot );
  35. virtual void PrimaryAttack( void );
  36. virtual float GetWeaponSpread( void );
  37. virtual bool DefaultReload( int iClipSize1, int iClipSize2, int iActivity );
  38. bool CanHeadshot( void ) const { int iMode = 0; CALL_ATTRIB_HOOK_INT( iMode, set_weapon_mode ); return (iMode == 1); };
  39. bool SapperKillsCollectCrits( void ) const { int iMode = 0; CALL_ATTRIB_HOOK_INT( iMode, sapper_kills_collect_crits ); return (iMode == 1); };
  40. virtual bool Holster( CBaseCombatWeapon *pSwitchingTo = NULL );
  41. virtual bool Deploy( void );
  42. int GetCount( void );
  43. const char* GetEffectLabelText( void );
  44. float GetProgress( void ) { return 0.f; }
  45. #ifdef CLIENT_DLL
  46. virtual void GetWeaponCrosshairScale( float &flScale );
  47. #else
  48. virtual void Detach();
  49. virtual float GetProjectileDamage( void );
  50. #endif
  51. private:
  52. CTFRevolver( const CTFRevolver & ) {}
  53. float m_flLastAccuracyCheck;
  54. float m_flAccuracyCheckTime;
  55. };
  56. //=============================================================================
  57. // Secondary Revolver (Engy)
  58. class CTFRevolver_Secondary : public CTFRevolver
  59. {
  60. public:
  61. DECLARE_CLASS( CTFRevolver_Secondary, CTFRevolver );
  62. DECLARE_NETWORKCLASS();
  63. DECLARE_PREDICTABLE();
  64. };
  65. #endif // TF_WEAPON_REVOLVER_H