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.

130 lines
3.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "weapon_dodfullauto.h"
  8. #if defined( CLIENT_DLL )
  9. #define CWeaponC96 C_WeaponC96
  10. #endif
  11. class CWeaponC96 : public CDODFullAutoWeapon
  12. {
  13. public:
  14. DECLARE_CLASS( CWeaponC96, CDODFullAutoWeapon );
  15. DECLARE_NETWORKCLASS();
  16. DECLARE_PREDICTABLE();
  17. DECLARE_ACTTABLE();
  18. CWeaponC96() {}
  19. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_C96; }
  20. virtual Activity GetIdleActivity( void );
  21. virtual Activity GetPrimaryAttackActivity( void );
  22. virtual Activity GetDrawActivity( void );
  23. virtual Activity GetReloadActivity( void );
  24. virtual float GetRecoil( void ) { return 3.0f; }
  25. private:
  26. CWeaponC96( const CWeaponC96 & );
  27. };
  28. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponC96, DT_WeaponC96 )
  29. BEGIN_NETWORK_TABLE( CWeaponC96, DT_WeaponC96 )
  30. END_NETWORK_TABLE()
  31. BEGIN_PREDICTION_DATA( CWeaponC96 )
  32. END_PREDICTION_DATA()
  33. LINK_ENTITY_TO_CLASS( weapon_c96, CWeaponC96 );
  34. PRECACHE_WEAPON_REGISTER( weapon_c96 );
  35. acttable_t CWeaponC96::m_acttable[] =
  36. {
  37. { ACT_DOD_STAND_AIM, ACT_DOD_STAND_AIM_C96, false },
  38. { ACT_DOD_CROUCH_AIM, ACT_DOD_CROUCH_AIM_C96, false },
  39. { ACT_DOD_CROUCHWALK_AIM, ACT_DOD_CROUCHWALK_AIM_C96, false },
  40. { ACT_DOD_WALK_AIM, ACT_DOD_WALK_AIM_C96, false },
  41. { ACT_DOD_RUN_AIM, ACT_DOD_RUN_AIM_C96, false },
  42. { ACT_PRONE_IDLE, ACT_DOD_PRONE_AIM_C96, false },
  43. { ACT_PRONE_FORWARD, ACT_DOD_PRONEWALK_IDLE_C96, false },
  44. { ACT_DOD_STAND_IDLE, ACT_DOD_STAND_IDLE_C96, false },
  45. { ACT_DOD_CROUCH_IDLE, ACT_DOD_CROUCH_IDLE_C96, false },
  46. { ACT_DOD_CROUCHWALK_IDLE, ACT_DOD_CROUCHWALK_IDLE_C96, false },
  47. { ACT_DOD_WALK_IDLE, ACT_DOD_WALK_IDLE_C96, false },
  48. { ACT_DOD_RUN_IDLE, ACT_DOD_RUN_IDLE_C96, false },
  49. { ACT_SPRINT, ACT_DOD_SPRINT_IDLE_C96, false },
  50. // Attack ( prone? )
  51. { ACT_RANGE_ATTACK1, ACT_DOD_PRIMARYATTACK_C96, false },
  52. { ACT_DOD_PRIMARYATTACK_CROUCH, ACT_DOD_PRIMARYATTACK_C96, false },
  53. { ACT_DOD_PRIMARYATTACK_PRONE, ACT_DOD_PRIMARYATTACK_PRONE_C96,false },
  54. // Reload ( prone? )
  55. { ACT_RELOAD, ACT_DOD_RELOAD_C96, false },
  56. { ACT_DOD_RELOAD_CROUCH, ACT_DOD_RELOAD_CROUCH_C96, false },
  57. { ACT_DOD_RELOAD_PRONE, ACT_DOD_RELOAD_PRONE_C96, false },
  58. // Hand Signals
  59. { ACT_DOD_HS_IDLE, ACT_DOD_HS_IDLE_MP44, false },
  60. { ACT_DOD_HS_CROUCH, ACT_DOD_HS_CROUCH_MP44, false },
  61. };
  62. IMPLEMENT_ACTTABLE( CWeaponC96 );
  63. Activity CWeaponC96::GetIdleActivity( void )
  64. {
  65. Activity actIdle;
  66. if( m_iClip1 <= 0 )
  67. actIdle = ACT_VM_IDLE_EMPTY;
  68. else
  69. actIdle = ACT_VM_IDLE;
  70. return actIdle;
  71. }
  72. Activity CWeaponC96::GetPrimaryAttackActivity( void )
  73. {
  74. Activity actPrim;
  75. if( m_iClip1 <= 0 )
  76. actPrim = ACT_VM_PRIMARYATTACK_EMPTY;
  77. else
  78. actPrim = ACT_VM_PRIMARYATTACK;
  79. return actPrim;
  80. }
  81. Activity CWeaponC96::GetDrawActivity( void )
  82. {
  83. Activity actDraw;
  84. if( m_iClip1 <= 0 )
  85. actDraw = ACT_VM_DRAW_EMPTY;
  86. else
  87. actDraw = ACT_VM_DRAW;
  88. return actDraw;
  89. }
  90. Activity CWeaponC96::GetReloadActivity( void )
  91. {
  92. Activity actReload;
  93. if( m_iClip1 <= 0 )
  94. actReload = ACT_VM_RELOAD_EMPTY;
  95. else
  96. actReload = ACT_VM_RELOAD;
  97. return actReload;
  98. }