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.

78 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=====================================================================================//
  6. #include "cbase.h"
  7. #include "weapon_sdkbase.h"
  8. #include "sdk_weapon_melee.h"
  9. #if defined( CLIENT_DLL )
  10. #define CWeaponCrowbar C_WeaponCrowbar
  11. #include "c_sdk_player.h"
  12. #else
  13. #include "sdk_player.h"
  14. #endif
  15. class CWeaponCrowbar : public CWeaponSDKMelee
  16. {
  17. public:
  18. DECLARE_CLASS( CWeaponCrowbar, CWeaponSDKMelee );
  19. DECLARE_NETWORKCLASS();
  20. DECLARE_PREDICTABLE();
  21. DECLARE_ACTTABLE();
  22. CWeaponCrowbar();
  23. virtual SDKWeaponID GetWeaponID( void ) const { return SDK_WEAPON_CROWBAR; }
  24. virtual float GetRange( void ) { return 64.0f; } //Tony; let the crowbar swing further.
  25. virtual bool CanWeaponBeDropped() const { return false; }
  26. private:
  27. CWeaponCrowbar( const CWeaponCrowbar & );
  28. };
  29. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponCrowbar, DT_WeaponCrowbar )
  30. BEGIN_NETWORK_TABLE( CWeaponCrowbar, DT_WeaponCrowbar )
  31. END_NETWORK_TABLE()
  32. BEGIN_PREDICTION_DATA( CWeaponCrowbar )
  33. END_PREDICTION_DATA()
  34. LINK_ENTITY_TO_CLASS( weapon_crowbar, CWeaponCrowbar );
  35. PRECACHE_WEAPON_REGISTER( weapon_crowbar );
  36. CWeaponCrowbar::CWeaponCrowbar()
  37. {
  38. }
  39. //Tony; todo; add ACT_MP_PRONE* activities, so we have them.
  40. acttable_t CWeaponCrowbar::m_acttable[] =
  41. {
  42. { ACT_MP_STAND_IDLE, ACT_DOD_STAND_AIM_SPADE, false },
  43. { ACT_MP_CROUCH_IDLE, ACT_DOD_CROUCH_AIM_SPADE, false },
  44. { ACT_MP_PRONE_IDLE, ACT_DOD_PRONE_AIM_SPADE, false },
  45. { ACT_MP_RUN, ACT_DOD_RUN_AIM_SPADE, false },
  46. { ACT_MP_WALK, ACT_DOD_WALK_AIM_SPADE, false },
  47. { ACT_MP_CROUCHWALK, ACT_DOD_CROUCHWALK_AIM_SPADE, false },
  48. { ACT_MP_PRONE_CRAWL, ACT_DOD_PRONEWALK_AIM_SPADE, false },
  49. { ACT_SPRINT, ACT_DOD_SPRINT_AIM_SPADE, false },
  50. { ACT_MP_ATTACK_STAND_PRIMARYFIRE, ACT_DOD_PRIMARYATTACK_SPADE, false },
  51. { ACT_MP_ATTACK_CROUCH_PRIMARYFIRE, ACT_DOD_PRIMARYATTACK_SPADE, false },
  52. { ACT_MP_ATTACK_PRONE_PRIMARYFIRE, ACT_DOD_PRIMARYATTACK_PRONE_SPADE, false },
  53. };
  54. IMPLEMENT_ACTTABLE( CWeaponCrowbar );