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.

56 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: The class from which all bludgeon melee
  4. // weapons are derived.
  5. //
  6. // $Workfile: $
  7. // $Date: $
  8. // $NoKeywords: $
  9. //=============================================================================//
  10. #include "basehlcombatweapon.h"
  11. #ifndef BASEBLUDGEONWEAPON_H
  12. #define BASEBLUDGEONWEAPON_H
  13. //=========================================================
  14. // CBaseHLBludgeonWeapon
  15. //=========================================================
  16. class CBaseHLBludgeonWeapon : public CBaseHLCombatWeapon
  17. {
  18. DECLARE_CLASS( CBaseHLBludgeonWeapon, CBaseHLCombatWeapon );
  19. public:
  20. CBaseHLBludgeonWeapon();
  21. DECLARE_SERVERCLASS();
  22. virtual void Spawn( void );
  23. virtual void Precache( void );
  24. //Attack functions
  25. virtual void PrimaryAttack( void );
  26. virtual void SecondaryAttack( void );
  27. virtual void ItemPostFrame( void );
  28. //Functions to select animation sequences
  29. virtual Activity GetPrimaryAttackActivity( void ) { return ACT_VM_HITCENTER; }
  30. virtual Activity GetSecondaryAttackActivity( void ) { return ACT_VM_HITCENTER2; }
  31. virtual float GetFireRate( void ) { return 0.2f; }
  32. virtual float GetRange( void ) { return 32.0f; }
  33. virtual float GetDamageForActivity( Activity hitActivity ) { return 1.0f; }
  34. virtual int CapabilitiesGet( void );
  35. virtual int WeaponMeleeAttack1Condition( float flDot, float flDist );
  36. protected:
  37. virtual void ImpactEffect( trace_t &trace );
  38. private:
  39. bool ImpactWater( const Vector &start, const Vector &end );
  40. void Swing( int bIsSecondary );
  41. void Hit( trace_t &traceHit, Activity nHitActivity, bool bIsSecondary );
  42. Activity ChooseIntersectionPointAndActivity( trace_t &hitTrace, const Vector &mins, const Vector &maxs, CBasePlayer *pOwner );
  43. };
  44. #endif