Counter Strike : Global Offensive Source Code
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.

76 lines
1.4 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "weapon_csbasegun.h"
  8. #if defined( CLIENT_DLL )
  9. #define CWeaponSG552 C_WeaponSG552
  10. #include "c_cs_player.h"
  11. #else
  12. #include "cs_player.h"
  13. #endif
  14. class CWeaponSG552 : public CWeaponCSBaseGun
  15. {
  16. public:
  17. DECLARE_CLASS( CWeaponSG552, CWeaponCSBaseGun );
  18. DECLARE_NETWORKCLASS();
  19. DECLARE_PREDICTABLE();
  20. CWeaponSG552();
  21. virtual void PrimaryAttack();
  22. virtual CSWeaponID GetCSWeaponID( void ) const { return WEAPON_SG552; }
  23. #ifdef CLIENT_DLL
  24. virtual bool DoesHideViewModelWhenZoomed( void ) { return false; }
  25. #endif
  26. private:
  27. CWeaponSG552( const CWeaponSG552 & );
  28. };
  29. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponSG552, DT_WeaponSG552 )
  30. BEGIN_NETWORK_TABLE( CWeaponSG552, DT_WeaponSG552 )
  31. END_NETWORK_TABLE()
  32. BEGIN_PREDICTION_DATA( CWeaponSG552 )
  33. END_PREDICTION_DATA()
  34. LINK_ENTITY_TO_CLASS_ALIASED( weapon_sg552, WeaponSG552 );
  35. // PRECACHE_REGISTER( weapon_sg552 );
  36. CWeaponSG552::CWeaponSG552()
  37. {
  38. }
  39. void CWeaponSG552::PrimaryAttack()
  40. {
  41. CCSPlayer *pPlayer = GetPlayerOwner();
  42. if ( !pPlayer )
  43. return;
  44. bool bZoomed = pPlayer->GetFOV() < pPlayer->GetDefaultFOV();
  45. float flCycleTime = GetCycleTime();
  46. if ( bZoomed )
  47. flCycleTime = 0.135f;
  48. CSBaseGunFire( flCycleTime, m_weaponMode );
  49. }