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.

54 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef WEAPON_CROWBAR_H
  7. #define WEAPON_CROWBAR_H
  8. #include "basebludgeonweapon.h"
  9. #if defined( _WIN32 )
  10. #pragma once
  11. #endif
  12. #ifdef HL2MP
  13. #error weapon_crowbar.h must not be included in hl2mp. The windows compiler will use the wrong class elsewhere if it is.
  14. #endif
  15. #define CROWBAR_RANGE 75.0f
  16. #define CROWBAR_REFIRE 0.4f
  17. //-----------------------------------------------------------------------------
  18. // CWeaponCrowbar
  19. //-----------------------------------------------------------------------------
  20. class CWeaponCrowbar : public CBaseHLBludgeonWeapon
  21. {
  22. public:
  23. DECLARE_CLASS( CWeaponCrowbar, CBaseHLBludgeonWeapon );
  24. DECLARE_SERVERCLASS();
  25. DECLARE_ACTTABLE();
  26. CWeaponCrowbar();
  27. float GetRange( void ) { return CROWBAR_RANGE; }
  28. float GetFireRate( void ) { return CROWBAR_REFIRE; }
  29. void AddViewKick( void );
  30. float GetDamageForActivity( Activity hitActivity );
  31. virtual int WeaponMeleeAttack1Condition( float flDot, float flDist );
  32. void SecondaryAttack( void ) { return; }
  33. // Animation event
  34. virtual void Operator_HandleAnimEvent( animevent_t *pEvent, CBaseCombatCharacter *pOperator );
  35. private:
  36. // Animation event handlers
  37. void HandleAnimEventMeleeHit( animevent_t *pEvent, CBaseCombatCharacter *pOperator );
  38. };
  39. #endif // WEAPON_CROWBAR_H