Counter Strike : Global Offensive Source Code
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.

86 lines
2.2 KiB

  1. //========= Copyright � 1996-2009, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: base class for belt items, eg pills and adrenaline
  4. //
  5. // $NoKeywords: $
  6. //=====================================================================================//
  7. #ifndef _WEAPON_BASE_ITEM_H_
  8. #define _WEAPON_BASE_ITEM_H_
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "weapon_csbase.h"
  13. #include "util_shared.h"
  14. #if defined( CLIENT_DLL )
  15. #define CWeaponBaseItem C_WeaponBaseItem
  16. #endif
  17. class CWeaponBaseItem : public CWeaponCSBase
  18. {
  19. public:
  20. DECLARE_CLASS( CWeaponBaseItem, CWeaponCSBase );
  21. DECLARE_NETWORKCLASS();
  22. DECLARE_PREDICTABLE();
  23. #ifndef CLIENT_DLL
  24. DECLARE_DATADESC();
  25. #endif
  26. CWeaponBaseItem();
  27. virtual bool HasPrimaryAmmo( void ); // Returns true if weapon has ammo
  28. virtual bool CanBeSelected( void );
  29. virtual void Spawn( void );
  30. virtual void PrimaryAttack( void ); // do "+ATTACK"
  31. virtual void SecondaryAttack( void ); // do "+ATTACK2"
  32. // virtual bool OnHit( trace_t &trace, const Vector &swingVector, bool firstTime ); // deals damage and plays hit effects. returns true if this hit stops the swing.
  33. bool Reload();
  34. virtual void ItemPostFrame( void ); // called each frame by the player PostThink
  35. // virtual bool CanExtendHelpingHand( void ) const;
  36. virtual bool CanFidget( void );
  37. virtual bool Deploy( void );
  38. virtual bool Holster( CBaseCombatWeapon *pSwitchingTo = NULL );
  39. virtual void WeaponIdle( void ); // called when no buttons pressed
  40. virtual bool SendWeaponAnim( int iActivity );
  41. // virtual Activity GetWeaponDeployActivity( PlayerAnimEvent_t animEvent, Activity mainActivity ) { return ACT_DEPLOY_GREN; }
  42. virtual bool CanUseOnSelf( CCSPlayer *pPlayer ) { return true; }
  43. virtual void OnStartUse( CCSPlayer *pPlayer ) {}
  44. virtual float GetUseTimerDuration( void );
  45. #ifndef CLIENT_DLL
  46. virtual void CompleteUse( CCSPlayer *pPlayer ) {}
  47. #endif
  48. private:
  49. CWeaponBaseItem( const CWeaponBaseItem & ) {}
  50. CNetworkVarEmbedded( CountdownTimer, m_UseTimer );
  51. CNetworkVar( bool, m_bRedraw ); // Draw the weapon again after throwing a grenade
  52. };
  53. inline bool CWeaponBaseItem::HasPrimaryAmmo( void )
  54. {
  55. return true;
  56. }
  57. inline bool CWeaponBaseItem::CanBeSelected( void )
  58. {
  59. return true;
  60. }
  61. #endif // _WEAPON_BASE_ITEM_H_