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.

58 lines
1.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef WEAPON_CSBASE_GUN_H
  7. #define WEAPON_CSBASE_GUN_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "weapon_csbase.h"
  12. // This is the base class for pistols and rifles.
  13. #if defined( CLIENT_DLL )
  14. #define CWeaponCSBaseGun C_WeaponCSBaseGun
  15. #else
  16. #endif
  17. class CWeaponCSBaseGun : public CWeaponCSBase
  18. {
  19. public:
  20. DECLARE_CLASS( CWeaponCSBaseGun, CWeaponCSBase );
  21. DECLARE_NETWORKCLASS();
  22. DECLARE_PREDICTABLE();
  23. CWeaponCSBaseGun();
  24. virtual void PrimaryAttack();
  25. virtual void Spawn();
  26. virtual bool Deploy();
  27. virtual bool Reload();
  28. virtual void WeaponIdle();
  29. // Derived classes call this to fire a bullet.
  30. bool CSBaseGunFire( float flCycleTime, CSWeaponMode weaponMode );
  31. // Usually plays the shot sound. Guns with silencers can play different sounds.
  32. virtual void DoFireEffects();
  33. virtual void ItemPostFrame();
  34. protected:
  35. float m_zoomFullyActiveTime;
  36. private:
  37. CWeaponCSBaseGun( const CWeaponCSBaseGun & );
  38. };
  39. #endif // WEAPON_CSBASE_GUN_H