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.

80 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=====================================================================================//
  6. #include "cbase.h"
  7. #include "weapon_sdkbase.h"
  8. #if defined( CLIENT_DLL )
  9. #define CWeaponPistol C_WeaponPistol
  10. #include "c_sdk_player.h"
  11. #else
  12. #include "sdk_player.h"
  13. #endif
  14. class CWeaponPistol : public CWeaponSDKBase
  15. {
  16. public:
  17. DECLARE_CLASS( CWeaponPistol, CWeaponSDKBase );
  18. DECLARE_NETWORKCLASS();
  19. DECLARE_PREDICTABLE();
  20. DECLARE_ACTTABLE();
  21. CWeaponPistol();
  22. virtual SDKWeaponID GetWeaponID( void ) const { return SDK_WEAPON_PISTOL; }
  23. virtual int GetFireMode() const { return FM_SEMIAUTOMATIC; }
  24. private:
  25. CWeaponPistol( const CWeaponPistol & );
  26. };
  27. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponPistol, DT_WeaponPistol )
  28. BEGIN_NETWORK_TABLE( CWeaponPistol, DT_WeaponPistol )
  29. END_NETWORK_TABLE()
  30. BEGIN_PREDICTION_DATA( CWeaponPistol )
  31. END_PREDICTION_DATA()
  32. LINK_ENTITY_TO_CLASS( weapon_pistol, CWeaponPistol );
  33. PRECACHE_WEAPON_REGISTER( weapon_pistol );
  34. CWeaponPistol::CWeaponPistol()
  35. {
  36. }
  37. //Tony; todo; add ACT_MP_PRONE* activities, so we have them.
  38. acttable_t CWeaponPistol::m_acttable[] =
  39. {
  40. { ACT_MP_STAND_IDLE, ACT_DOD_STAND_IDLE_PISTOL, false },
  41. { ACT_MP_CROUCH_IDLE, ACT_DOD_CROUCH_IDLE_PISTOL, false },
  42. { ACT_MP_PRONE_IDLE, ACT_DOD_PRONE_AIM_PISTOL, false },
  43. { ACT_MP_RUN, ACT_DOD_RUN_AIM_PISTOL, false },
  44. { ACT_MP_WALK, ACT_DOD_WALK_AIM_PISTOL, false },
  45. { ACT_MP_CROUCHWALK, ACT_DOD_CROUCHWALK_AIM_PISTOL, false },
  46. { ACT_MP_PRONE_CRAWL, ACT_DOD_PRONEWALK_IDLE_PISTOL, false },
  47. { ACT_SPRINT, ACT_DOD_SPRINT_IDLE_PISTOL, false },
  48. { ACT_MP_ATTACK_STAND_PRIMARYFIRE, ACT_DOD_PRIMARYATTACK_PISTOL, false },
  49. { ACT_MP_ATTACK_CROUCH_PRIMARYFIRE, ACT_DOD_PRIMARYATTACK_PISTOL, false },
  50. { ACT_MP_ATTACK_PRONE_PRIMARYFIRE, ACT_DOD_PRIMARYATTACK_PRONE_PISTOL, false },
  51. { ACT_MP_RELOAD_STAND, ACT_DOD_RELOAD_PISTOL, false },
  52. { ACT_MP_RELOAD_CROUCH, ACT_DOD_RELOAD_CROUCH_PISTOL, false },
  53. { ACT_MP_RELOAD_PRONE, ACT_DOD_RELOAD_PRONE_PISTOL, false },
  54. };
  55. IMPLEMENT_ACTTABLE( CWeaponPistol );