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.

77 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "weapon_dodbasemelee.h"
  8. #include "dod_shareddefs.h"
  9. #if defined( CLIENT_DLL )
  10. #define CWeaponAmerKnife C_WeaponAmerKnife
  11. #endif
  12. class CWeaponAmerKnife : public CWeaponDODBaseMelee
  13. {
  14. public:
  15. DECLARE_CLASS( CWeaponAmerKnife, CWeaponDODBaseMelee );
  16. DECLARE_NETWORKCLASS();
  17. DECLARE_PREDICTABLE();
  18. DECLARE_ACTTABLE();
  19. CWeaponAmerKnife() {}
  20. virtual Activity GetMeleeActivity( void ) { return ACT_VM_PRIMARYATTACK; }
  21. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_AMERKNIFE; }
  22. virtual void PrimaryAttack()
  23. {
  24. MeleeAttack( 60, MELEE_DMG_FIST, 0.2f, 0.4f );
  25. }
  26. private:
  27. CWeaponAmerKnife( const CWeaponAmerKnife & );
  28. };
  29. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponAmerKnife, DT_WeaponAmerKnife )
  30. BEGIN_NETWORK_TABLE( CWeaponAmerKnife, DT_WeaponAmerKnife )
  31. END_NETWORK_TABLE()
  32. BEGIN_PREDICTION_DATA( CWeaponAmerKnife )
  33. END_PREDICTION_DATA()
  34. LINK_ENTITY_TO_CLASS( weapon_amerknife, CWeaponAmerKnife );
  35. PRECACHE_WEAPON_REGISTER( weapon_amerknife );
  36. acttable_t CWeaponAmerKnife::m_acttable[] =
  37. {
  38. { ACT_DOD_STAND_AIM, ACT_DOD_STAND_AIM_KNIFE, false },
  39. { ACT_DOD_CROUCH_AIM, ACT_DOD_CROUCH_AIM_KNIFE, false },
  40. { ACT_DOD_CROUCHWALK_AIM, ACT_DOD_CROUCHWALK_AIM_KNIFE, false },
  41. { ACT_DOD_WALK_AIM, ACT_DOD_WALK_AIM_KNIFE, false },
  42. { ACT_DOD_RUN_AIM, ACT_DOD_RUN_AIM_KNIFE, false },
  43. { ACT_PRONE_IDLE, ACT_DOD_PRONE_AIM_KNIFE, false },
  44. { ACT_PRONE_FORWARD, ACT_DOD_PRONEWALK_AIM_KNIFE, false },
  45. { ACT_DOD_STAND_IDLE, ACT_DOD_STAND_AIM_KNIFE, false },
  46. { ACT_DOD_CROUCH_IDLE, ACT_DOD_CROUCH_AIM_KNIFE, false },
  47. { ACT_DOD_CROUCHWALK_IDLE, ACT_DOD_CROUCHWALK_AIM_KNIFE, false },
  48. { ACT_DOD_WALK_IDLE, ACT_DOD_WALK_AIM_KNIFE, false },
  49. { ACT_DOD_RUN_IDLE, ACT_DOD_RUN_AIM_KNIFE, false },
  50. { ACT_SPRINT, ACT_DOD_SPRINT_AIM_KNIFE, false },
  51. { ACT_RANGE_ATTACK2, ACT_DOD_PRIMARYATTACK_KNIFE, false },
  52. { ACT_DOD_SECONDARYATTACK_CROUCH, ACT_DOD_PRIMARYATTACK_CROUCH_KNIFE, false },
  53. { ACT_DOD_SECONDARYATTACK_PRONE, ACT_DOD_PRIMARYATTACK_PRONE_KNIFE, false },
  54. // Hand Signals
  55. { ACT_DOD_HS_IDLE, ACT_DOD_HS_IDLE_KNIFE, false },
  56. { ACT_DOD_HS_CROUCH, ACT_DOD_HS_CROUCH_KNIFE, false },
  57. };
  58. IMPLEMENT_ACTTABLE( CWeaponAmerKnife );