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.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "weapon_hl2mpbase.h"
  7. #ifndef BASEHLCOMBATWEAPON_H
  8. #define BASEHLCOMBATWEAPON_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #if defined( CLIENT_DLL )
  13. #define CHL2MPMachineGun C_HL2MPMachineGun
  14. #endif
  15. //=========================================================
  16. // Machine gun base class
  17. //=========================================================
  18. class CHL2MPMachineGun : public CWeaponHL2MPBase
  19. {
  20. public:
  21. DECLARE_CLASS( CHL2MPMachineGun, CWeaponHL2MPBase );
  22. DECLARE_DATADESC();
  23. CHL2MPMachineGun();
  24. DECLARE_NETWORKCLASS();
  25. DECLARE_PREDICTABLE();
  26. void PrimaryAttack( void );
  27. // Default calls through to m_hOwner, but plasma weapons can override and shoot projectiles here.
  28. virtual void ItemPostFrame( void );
  29. virtual void FireBullets( const FireBulletsInfo_t &info );
  30. virtual bool Deploy( void );
  31. virtual const Vector &GetBulletSpread( void );
  32. int WeaponSoundRealtime( WeaponSound_t shoot_type );
  33. // utility function
  34. static void DoMachineGunKick( CBasePlayer *pPlayer, float dampEasy, float maxVerticleKickAngle, float fireDurationTime, float slideLimitTime );
  35. private:
  36. CHL2MPMachineGun( const CHL2MPMachineGun & );
  37. protected:
  38. int m_nShotsFired; // Number of consecutive shots fired
  39. float m_flNextSoundTime; // real-time clock of when to make next sound
  40. };
  41. #endif // BASEHLCOMBATWEAPON_H