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.

107 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef HL1_WEAPON_SATCHEL_H
  7. #define HL1_WEAPON_SATCHEL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #ifndef CLIENT_DLL
  12. #include "hl1_basegrenade.h"
  13. #include "hl1_basecombatweapon_shared.h"
  14. #endif
  15. #ifdef CLIENT_DLL
  16. #define CWeaponSatchel C_WeaponSatchel
  17. #endif
  18. //-----------------------------------------------------------------------------
  19. // CWeaponSatchel
  20. //-----------------------------------------------------------------------------
  21. class CWeaponSatchel : public CBaseHL1CombatWeapon
  22. {
  23. DECLARE_CLASS( CWeaponSatchel, CBaseHL1CombatWeapon );
  24. DECLARE_NETWORKCLASS();
  25. DECLARE_PREDICTABLE();
  26. public:
  27. CWeaponSatchel( void );
  28. void Equip( CBaseCombatCharacter *pOwner );
  29. bool HasAnyAmmo( void );
  30. bool CanDeploy( void );
  31. void Precache( void );
  32. void PrimaryAttack( void );
  33. void SecondaryAttack( void );
  34. void WeaponIdle( void );
  35. bool Deploy( void );
  36. bool Holster( CBaseCombatWeapon *pSwitchingTo = NULL );
  37. void ItemPostFrame( void );
  38. const char *GetViewModel( int viewmodelindex = 0 ) const;
  39. const char *GetWorldModel( void ) const;
  40. bool HasChargeDeployed() { return ( m_iChargeReady != 0 ); }
  41. void OnRestore( void );
  42. // DECLARE_SERVERCLASS();
  43. DECLARE_DATADESC();
  44. private:
  45. void Throw( void );
  46. void ActivateSatchelModel( void );
  47. void ActivateRadioModel( void );
  48. private:
  49. CNetworkVar( int, m_iRadioViewIndex );
  50. CNetworkVar( int, m_iRadioWorldIndex );
  51. CNetworkVar( int, m_iSatchelViewIndex );
  52. CNetworkVar( int, m_iSatchelWorldIndex );
  53. CNetworkVar( int, m_iChargeReady );
  54. };
  55. #ifndef CLIENT_DLL
  56. //-----------------------------------------------------------------------------
  57. // CSatchelCharge
  58. //-----------------------------------------------------------------------------
  59. class CSatchelCharge : public CHL1BaseGrenade
  60. {
  61. public:
  62. DECLARE_CLASS( CSatchelCharge, CHL1BaseGrenade );
  63. CSatchelCharge();
  64. void Spawn( void );
  65. void Precache( void );
  66. void SatchelTouch( CBaseEntity *pOther );
  67. void SatchelThink( void );
  68. void SatchelUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
  69. DECLARE_DATADESC();
  70. private:
  71. Vector m_vLastPosition;
  72. float m_flNextBounceSoundTime;
  73. bool m_bInAir;
  74. private:
  75. void BounceSound( void );
  76. void UpdateSlideSound( void );
  77. void Deactivate( void );
  78. };
  79. #endif
  80. #endif // HL1_WEAPON_SATCHEL_H