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.

127 lines
3.3 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 CWeaponColt C_WeaponColt
  10. #endif
  11. class CWeaponColt : public CDODSemiAutoWeapon
  12. {
  13. public:
  14. DECLARE_CLASS( CWeaponColt, CDODSemiAutoWeapon );
  15. DECLARE_NETWORKCLASS();
  16. DECLARE_PREDICTABLE();
  17. DECLARE_ACTTABLE();
  18. CWeaponColt() {}
  19. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_COLT; }
  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 1.4f; }
  25. private:
  26. CWeaponColt( const CWeaponColt & );
  27. };
  28. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponColt, DT_WeaponColt )
  29. BEGIN_NETWORK_TABLE( CWeaponColt, DT_WeaponColt )
  30. END_NETWORK_TABLE()
  31. BEGIN_PREDICTION_DATA( CWeaponColt )
  32. END_PREDICTION_DATA()
  33. LINK_ENTITY_TO_CLASS( weapon_colt, CWeaponColt );
  34. PRECACHE_WEAPON_REGISTER( weapon_colt );
  35. acttable_t CWeaponColt::m_acttable[] =
  36. {
  37. { ACT_DOD_STAND_AIM, ACT_DOD_STAND_AIM_PISTOL, false },
  38. { ACT_DOD_CROUCH_AIM, ACT_DOD_CROUCH_AIM_PISTOL, false },
  39. { ACT_DOD_CROUCHWALK_AIM, ACT_DOD_CROUCHWALK_AIM_PISTOL, false },
  40. { ACT_DOD_WALK_AIM, ACT_DOD_WALK_AIM_PISTOL, false },
  41. { ACT_DOD_RUN_AIM, ACT_DOD_RUN_AIM_PISTOL, false },
  42. { ACT_PRONE_IDLE, ACT_DOD_PRONE_AIM_PISTOL, false },
  43. { ACT_PRONE_FORWARD, ACT_DOD_PRONEWALK_IDLE_PISTOL, false },
  44. { ACT_DOD_STAND_IDLE, ACT_DOD_STAND_IDLE_PISTOL, false },
  45. { ACT_DOD_CROUCH_IDLE, ACT_DOD_CROUCH_IDLE_PISTOL, false },
  46. { ACT_DOD_CROUCHWALK_IDLE, ACT_DOD_CROUCHWALK_IDLE_PISTOL, false },
  47. { ACT_DOD_WALK_IDLE, ACT_DOD_WALK_IDLE_PISTOL, false },
  48. { ACT_DOD_RUN_IDLE, ACT_DOD_RUN_IDLE_PISTOL, false },
  49. { ACT_SPRINT, ACT_DOD_SPRINT_IDLE_PISTOL, false },
  50. { ACT_RANGE_ATTACK1, ACT_DOD_PRIMARYATTACK_PISTOL, false },
  51. { ACT_DOD_PRIMARYATTACK_CROUCH, ACT_DOD_PRIMARYATTACK_PISTOL, false },
  52. { ACT_DOD_PRIMARYATTACK_PRONE, ACT_DOD_PRIMARYATTACK_PRONE_PISTOL, false },
  53. { ACT_RELOAD, ACT_DOD_RELOAD_PISTOL, false },
  54. { ACT_DOD_RELOAD_CROUCH, ACT_DOD_RELOAD_CROUCH_PISTOL, false },
  55. { ACT_DOD_RELOAD_PRONE, ACT_DOD_RELOAD_PRONE_PISTOL, false },
  56. // Hand Signals
  57. { ACT_DOD_HS_IDLE, ACT_DOD_HS_IDLE_PISTOL, false },
  58. { ACT_DOD_HS_CROUCH, ACT_DOD_HS_CROUCH_PISTOL, false },
  59. };
  60. IMPLEMENT_ACTTABLE( CWeaponColt );
  61. Activity CWeaponColt::GetIdleActivity( void )
  62. {
  63. Activity actIdle;
  64. if( m_iClip1 <= 0 )
  65. actIdle = ACT_VM_IDLE_EMPTY;
  66. else
  67. actIdle = ACT_VM_IDLE;
  68. return actIdle;
  69. }
  70. Activity CWeaponColt::GetPrimaryAttackActivity( void )
  71. {
  72. Activity actPrim;
  73. if( m_iClip1 <= 0 )
  74. actPrim = ACT_VM_PRIMARYATTACK_EMPTY;
  75. else
  76. actPrim = ACT_VM_PRIMARYATTACK;
  77. return actPrim;
  78. }
  79. Activity CWeaponColt::GetDrawActivity( void )
  80. {
  81. Activity actDraw;
  82. if( m_iClip1 <= 0 )
  83. actDraw = ACT_VM_DRAW_EMPTY;
  84. else
  85. actDraw = ACT_VM_DRAW;
  86. return actDraw;
  87. }
  88. Activity CWeaponColt::GetReloadActivity( void )
  89. {
  90. Activity actReload;
  91. if( m_iClip1 <= 0 )
  92. actReload = ACT_VM_RELOAD_EMPTY;
  93. else
  94. actReload = ACT_VM_RELOAD;
  95. return actReload;
  96. }