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.

67 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TF_WEAPON_SHOVEL_H
  7. #define TF_WEAPON_SHOVEL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tf_weaponbase_melee.h"
  12. #ifdef CLIENT_DLL
  13. #define CTFShovel C_TFShovel
  14. #endif
  15. enum shovel_weapontypes_t
  16. {
  17. SHOVEL_STANDARD = 0,
  18. SHOVEL_DAMAGE_BOOST,
  19. SHOVEL_SPEED_BOOST,
  20. };
  21. //=============================================================================
  22. //
  23. // Shovel class.
  24. //
  25. class CTFShovel : public CTFWeaponBaseMelee
  26. {
  27. public:
  28. DECLARE_CLASS( CTFShovel, CTFWeaponBaseMelee );
  29. DECLARE_NETWORKCLASS();
  30. DECLARE_PREDICTABLE();
  31. CTFShovel();
  32. virtual int GetWeaponID( void ) const { return TF_WEAPON_SHOVEL; }
  33. virtual void PrimaryAttack();
  34. int GetShovelType( void ) { int iMode = 0; CALL_ATTRIB_HOOK_INT( iMode, set_weapon_mode ); return iMode; };
  35. virtual bool HasDamageBoost( void ) { return (GetShovelType() == SHOVEL_DAMAGE_BOOST); }
  36. virtual bool HasSpeedBoost( void ) { return (GetShovelType() == SHOVEL_SPEED_BOOST); }
  37. virtual void ItemPreFrame( void ) OVERRIDE;
  38. virtual float GetMeleeDamage( CBaseEntity *pTarget, int* piDamageType, int* piCustomDamage );
  39. virtual float GetSpeedMod( void );
  40. void MoveSpeedThink( void );
  41. virtual bool Deploy( void );
  42. virtual bool Holster( CBaseCombatWeapon *pSwitchingTo );
  43. #ifndef CLIENT_DLL
  44. virtual float GetForceScale( void );
  45. virtual int GetDamageCustom();
  46. #endif
  47. private:
  48. CTFShovel( const CTFShovel & ) {}
  49. bool m_bHolstering;
  50. float m_flLastHealthRatio;
  51. };
  52. #endif // TF_WEAPON_SHOVEL_H