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.

75 lines
2.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "weapon_dodsemiauto.h"
  8. #if defined( CLIENT_DLL )
  9. #define CWeaponM1Carbine C_WeaponM1Carbine
  10. #endif
  11. class CWeaponM1Carbine : public CDODSemiAutoWeapon
  12. {
  13. public:
  14. DECLARE_CLASS( CWeaponM1Carbine, CDODSemiAutoWeapon );
  15. DECLARE_NETWORKCLASS();
  16. DECLARE_PREDICTABLE();
  17. DECLARE_ACTTABLE();
  18. CWeaponM1Carbine() {}
  19. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_M1CARBINE; }
  20. virtual float GetRecoil( void ) { return 1.4f; }
  21. private:
  22. CWeaponM1Carbine( const CWeaponM1Carbine & );
  23. };
  24. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponM1Carbine, DT_WeaponM1Carbine )
  25. BEGIN_NETWORK_TABLE( CWeaponM1Carbine, DT_WeaponM1Carbine )
  26. END_NETWORK_TABLE()
  27. BEGIN_PREDICTION_DATA( CWeaponM1Carbine )
  28. END_PREDICTION_DATA()
  29. LINK_ENTITY_TO_CLASS( weapon_m1carbine, CWeaponM1Carbine );
  30. PRECACHE_WEAPON_REGISTER( weapon_m1carbine );
  31. acttable_t CWeaponM1Carbine::m_acttable[] =
  32. {
  33. { ACT_DOD_STAND_AIM, ACT_DOD_STAND_AIM_RIFLE, false },
  34. { ACT_DOD_CROUCH_AIM, ACT_DOD_CROUCH_AIM_RIFLE, false },
  35. { ACT_DOD_CROUCHWALK_AIM, ACT_DOD_CROUCHWALK_AIM_RIFLE, false },
  36. { ACT_DOD_WALK_AIM, ACT_DOD_WALK_AIM_RIFLE, false },
  37. { ACT_DOD_RUN_AIM, ACT_DOD_RUN_AIM_RIFLE, false },
  38. { ACT_PRONE_IDLE, ACT_DOD_PRONE_AIM_RIFLE, false },
  39. { ACT_PRONE_FORWARD, ACT_DOD_PRONEWALK_IDLE_RIFLE, false },
  40. { ACT_DOD_STAND_IDLE, ACT_DOD_STAND_IDLE_RIFLE, false },
  41. { ACT_DOD_CROUCH_IDLE, ACT_DOD_CROUCH_IDLE_RIFLE, false },
  42. { ACT_DOD_CROUCHWALK_IDLE, ACT_DOD_CROUCHWALK_IDLE_RIFLE, false },
  43. { ACT_DOD_WALK_IDLE, ACT_DOD_WALK_IDLE_RIFLE, false },
  44. { ACT_DOD_RUN_IDLE, ACT_DOD_RUN_IDLE_RIFLE, false },
  45. { ACT_SPRINT, ACT_DOD_SPRINT_IDLE_RIFLE, false },
  46. // Attack ( prone? )
  47. { ACT_RANGE_ATTACK1, ACT_DOD_PRIMARYATTACK_RIFLE, false },
  48. { ACT_DOD_PRIMARYATTACK_CROUCH, ACT_DOD_PRIMARYATTACK_RIFLE, false },
  49. { ACT_DOD_PRIMARYATTACK_PRONE, ACT_DOD_PRIMARYATTACK_PRONE_RIFLE, false },
  50. { ACT_RELOAD, ACT_DOD_RELOAD_M1CARBINE, false },
  51. { ACT_DOD_RELOAD_CROUCH, ACT_DOD_RELOAD_CROUCH_M1CARBINE, false },
  52. { ACT_DOD_RELOAD_PRONE, ACT_DOD_RELOAD_PRONE_M1CARBINE, false },
  53. // Hand Signals
  54. { ACT_DOD_HS_IDLE, ACT_DOD_HS_IDLE_K98, false },
  55. { ACT_DOD_HS_CROUCH, ACT_DOD_HS_CROUCH_K98, false },
  56. };
  57. IMPLEMENT_ACTTABLE( CWeaponM1Carbine );