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.

94 lines
2.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "weapon_dodfullauto_punch.h"
  8. #if defined( CLIENT_DLL )
  9. #define CWeaponMP40 C_WeaponMP40
  10. #endif
  11. class CWeaponMP40 : public CDODFullAutoPunchWeapon
  12. {
  13. public:
  14. DECLARE_CLASS( CWeaponMP40, CDODFullAutoPunchWeapon );
  15. DECLARE_NETWORKCLASS();
  16. DECLARE_PREDICTABLE();
  17. DECLARE_ACTTABLE();
  18. CWeaponMP40() {}
  19. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_MP40; }
  20. virtual DODWeaponID GetAltWeaponID( void ) const { return WEAPON_MP40_PUNCH; }
  21. virtual Activity GetIdleActivity( void );
  22. virtual float GetRecoil( void ) { return 2.2f; }
  23. private:
  24. CWeaponMP40( const CWeaponMP40 & );
  25. };
  26. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponMP40, DT_WeaponMP40 )
  27. BEGIN_NETWORK_TABLE( CWeaponMP40, DT_WeaponMP40 )
  28. END_NETWORK_TABLE()
  29. BEGIN_PREDICTION_DATA( CWeaponMP40 )
  30. END_PREDICTION_DATA()
  31. LINK_ENTITY_TO_CLASS( weapon_mp40, CWeaponMP40 );
  32. PRECACHE_WEAPON_REGISTER( weapon_mp40 );
  33. acttable_t CWeaponMP40::m_acttable[] =
  34. {
  35. { ACT_DOD_STAND_AIM, ACT_DOD_STAND_AIM_MP40, false },
  36. { ACT_DOD_CROUCH_AIM, ACT_DOD_CROUCH_AIM_MP40, false },
  37. { ACT_DOD_CROUCHWALK_AIM, ACT_DOD_CROUCHWALK_AIM_MP40, false },
  38. { ACT_DOD_WALK_AIM, ACT_DOD_WALK_AIM_MP40, false },
  39. { ACT_DOD_RUN_AIM, ACT_DOD_RUN_AIM_MP40, false },
  40. { ACT_PRONE_IDLE, ACT_DOD_PRONE_AIM_MP40, false },
  41. { ACT_PRONE_FORWARD, ACT_DOD_PRONEWALK_IDLE_MP40, false },
  42. { ACT_DOD_STAND_IDLE, ACT_DOD_STAND_IDLE_MP40, false },
  43. { ACT_DOD_CROUCH_IDLE, ACT_DOD_CROUCH_IDLE_MP40, false },
  44. { ACT_DOD_CROUCHWALK_IDLE, ACT_DOD_CROUCHWALK_IDLE_MP40, false },
  45. { ACT_DOD_WALK_IDLE, ACT_DOD_WALK_IDLE_MP40, false },
  46. { ACT_DOD_RUN_IDLE, ACT_DOD_RUN_IDLE_MP40, false },
  47. { ACT_SPRINT, ACT_DOD_SPRINT_IDLE_MP40, false },
  48. { ACT_RANGE_ATTACK1, ACT_DOD_PRIMARYATTACK_MP40, false },
  49. { ACT_DOD_PRIMARYATTACK_CROUCH, ACT_DOD_PRIMARYATTACK_MP40, false },
  50. { ACT_DOD_PRIMARYATTACK_PRONE, ACT_DOD_PRIMARYATTACK_PRONE_MP40, false },
  51. { ACT_RANGE_ATTACK2, ACT_DOD_SECONDARYATTACK_MP40, false },
  52. { ACT_DOD_SECONDARYATTACK_CROUCH, ACT_DOD_SECONDARYATTACK_CROUCH_MP40,false },
  53. { ACT_DOD_SECONDARYATTACK_PRONE, ACT_DOD_SECONDARYATTACK_PRONE_MP40, false },
  54. { ACT_RELOAD, ACT_DOD_RELOAD_MP40, false },
  55. { ACT_DOD_RELOAD_CROUCH, ACT_DOD_RELOAD_CROUCH_MP40, false },
  56. { ACT_DOD_RELOAD_PRONE, ACT_DOD_RELOAD_PRONE_MP40, false },
  57. // Hand Signals
  58. { ACT_DOD_HS_IDLE, ACT_DOD_HS_IDLE_MP44, false },
  59. { ACT_DOD_HS_CROUCH, ACT_DOD_HS_CROUCH_MP44, false },
  60. };
  61. IMPLEMENT_ACTTABLE( CWeaponMP40 );
  62. Activity CWeaponMP40::GetIdleActivity( void )
  63. {
  64. Activity actIdle;
  65. if( m_iClip1 < GetMaxClip1() )
  66. actIdle = ACT_VM_IDLE_EMPTY;
  67. else
  68. actIdle = ACT_VM_IDLE;
  69. return actIdle;
  70. }