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.

83 lines
2.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "weapon_dodfireselect.h"
  8. #if defined( CLIENT_DLL )
  9. #define CWeaponBAR C_WeaponBAR
  10. #endif
  11. class CWeaponBAR : public CDODFireSelectWeapon
  12. {
  13. public:
  14. DECLARE_CLASS( CWeaponBAR, CDODFireSelectWeapon );
  15. DECLARE_NETWORKCLASS();
  16. DECLARE_PREDICTABLE();
  17. DECLARE_ACTTABLE();
  18. CWeaponBAR() {}
  19. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_BAR; }
  20. // weapon id for stats purposes
  21. virtual DODWeaponID GetStatsWeaponID( void )
  22. {
  23. if ( IsSemiAuto() )
  24. return WEAPON_BAR_SEMIAUTO;
  25. else
  26. return WEAPON_BAR;
  27. }
  28. virtual float GetRecoil( void ) { return 5.0f; }
  29. private:
  30. CWeaponBAR( const CWeaponBAR & );
  31. };
  32. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponBAR, DT_WeaponBAR )
  33. BEGIN_NETWORK_TABLE( CWeaponBAR, DT_WeaponBAR )
  34. END_NETWORK_TABLE()
  35. BEGIN_PREDICTION_DATA( CWeaponBAR )
  36. END_PREDICTION_DATA()
  37. LINK_ENTITY_TO_CLASS( weapon_bar, CWeaponBAR );
  38. PRECACHE_WEAPON_REGISTER( weapon_bar );
  39. acttable_t CWeaponBAR::m_acttable[] =
  40. {
  41. { ACT_DOD_STAND_AIM, ACT_DOD_STAND_AIM_BAR, false },
  42. { ACT_DOD_CROUCH_AIM, ACT_DOD_CROUCH_AIM_BAR, false },
  43. { ACT_DOD_CROUCHWALK_AIM, ACT_DOD_CROUCHWALK_AIM_BAR, false },
  44. { ACT_DOD_WALK_AIM, ACT_DOD_WALK_AIM_BAR, false },
  45. { ACT_DOD_RUN_AIM, ACT_DOD_RUN_AIM_BAR, false },
  46. { ACT_PRONE_IDLE, ACT_DOD_PRONE_AIM_BAR, false },
  47. { ACT_PRONE_FORWARD, ACT_DOD_PRONEWALK_IDLE_BAR, false },
  48. { ACT_DOD_STAND_IDLE, ACT_DOD_STAND_IDLE_BAR, false },
  49. { ACT_DOD_CROUCH_IDLE, ACT_DOD_CROUCH_IDLE_BAR, false },
  50. { ACT_DOD_CROUCHWALK_IDLE, ACT_DOD_CROUCHWALK_IDLE_BAR, false },
  51. { ACT_DOD_WALK_IDLE, ACT_DOD_WALK_IDLE_BAR, false },
  52. { ACT_DOD_RUN_IDLE, ACT_DOD_RUN_IDLE_BAR, false },
  53. { ACT_SPRINT, ACT_DOD_SPRINT_IDLE_BAR, false },
  54. { ACT_RANGE_ATTACK1, ACT_DOD_PRIMARYATTACK_BAR, false },
  55. { ACT_DOD_PRIMARYATTACK_CROUCH, ACT_DOD_PRIMARYATTACK_BAR, false },
  56. { ACT_DOD_PRIMARYATTACK_PRONE, ACT_DOD_PRIMARYATTACK_PRONE_BAR, false },
  57. { ACT_RELOAD, ACT_DOD_RELOAD_BAR, false },
  58. { ACT_DOD_RELOAD_CROUCH, ACT_DOD_RELOAD_CROUCH_BAR, false },
  59. { ACT_DOD_RELOAD_PRONE, ACT_DOD_RELOAD_PRONE_BAR, false },
  60. // Hand Signals
  61. { ACT_DOD_HS_IDLE, ACT_DOD_HS_IDLE_K98, false },
  62. { ACT_DOD_HS_CROUCH, ACT_DOD_HS_CROUCH_K98, false },
  63. };
  64. IMPLEMENT_ACTTABLE( CWeaponBAR );