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.

107 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef WEAPON_MG42_H
  7. #define WEAPON_MG42_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "weapon_dodbase.h"
  12. #include "weapon_dodbipodgun.h"
  13. #if defined( CLIENT_DLL )
  14. #define CWeaponMG42 C_WeaponMG42
  15. #endif
  16. #define COOL_CONTEXT "CoolContext"
  17. class CWeaponMG42 : public CDODBipodWeapon
  18. {
  19. public:
  20. DECLARE_CLASS( CWeaponMG42, CDODBipodWeapon );
  21. DECLARE_NETWORKCLASS();
  22. DECLARE_PREDICTABLE();
  23. DECLARE_ACTTABLE();
  24. #ifdef GAME_DLL
  25. DECLARE_DATADESC();
  26. #endif
  27. CWeaponMG42() {}
  28. #ifdef CLIENT_DLL
  29. virtual ~CWeaponMG42();
  30. #endif
  31. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_MG42; }
  32. // weapon id for stats purposes
  33. virtual DODWeaponID GetStatsWeaponID( void )
  34. {
  35. if ( !IsDeployed() )
  36. return WEAPON_MG42_UNDEPLOYED;
  37. else
  38. return WEAPON_MG42;
  39. }
  40. virtual void Spawn();
  41. virtual void Precache();
  42. virtual void PrimaryAttack( void );
  43. virtual bool Reload( void );
  44. virtual void FinishReload( void );
  45. virtual void ItemPostFrame( void );
  46. virtual void ItemBusyFrame( void );
  47. void ItemFrameCool( void );
  48. virtual bool Deploy( void );
  49. virtual bool Holster( CBaseCombatWeapon *pSwitchingTo );
  50. virtual void Drop( const Vector &vecVelocity );
  51. virtual Activity GetReloadActivity( void );
  52. virtual Activity GetDrawActivity( void );
  53. virtual Activity GetDeployActivity( void );
  54. virtual Activity GetUndeployActivity( void );
  55. virtual Activity GetIdleActivity( void );
  56. virtual Activity GetPrimaryAttackActivity( void );
  57. int GetWeaponHeat( void ) { return m_iWeaponHeat; }
  58. virtual bool ShouldDrawCrosshair( void ) { return IsDeployed(); }
  59. void Cool( void );
  60. #ifdef CLIENT_DLL
  61. virtual void ClientThink( void );
  62. virtual void OnDataChanged( DataUpdateType_t updateType );
  63. virtual void CleanupToolRecordingState( KeyValues *msg );
  64. void EmitSmokeParticle( void );
  65. #else
  66. void CoolThink( void );
  67. #endif
  68. virtual float GetRecoil( void );
  69. private:
  70. CWeaponMG42( const CWeaponMG42 & );
  71. CNetworkVar( int, m_iWeaponHeat );
  72. CNetworkVar( float, m_flNextCoolTime );
  73. CNetworkVar( bool, m_bOverheated );
  74. #ifdef CLIENT_DLL
  75. CSmartPtr<CSimpleEmitter> m_pEmitter;
  76. float m_flParticleAccumulator;
  77. PMaterialHandle m_hParticleMaterial;
  78. #endif
  79. };
  80. #endif //WEAPON_MG42_H