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.

135 lines
2.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: RPG
  4. //
  5. //=============================================================================//
  6. #ifndef WEAPON_RPG_H
  7. #define WEAPON_RPG_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "hl1mp_basecombatweapon_shared.h"
  12. #ifdef CLIENT_DLL
  13. #include "iviewrender_beams.h"
  14. #include "c_smoke_trail.h"
  15. #endif
  16. #ifndef CLIENT_DLL
  17. #include "smoke_trail.h"
  18. #include "Sprite.h"
  19. #include "npcevent.h"
  20. #include "beam_shared.h"
  21. #include "hl1_basegrenade.h"
  22. class CWeaponRPG;
  23. //###########################################################################
  24. // CRpgRocket
  25. //###########################################################################
  26. class CRpgRocket : public CHL1BaseGrenade
  27. {
  28. DECLARE_CLASS( CRpgRocket, CHL1BaseGrenade );
  29. DECLARE_SERVERCLASS();
  30. public:
  31. CRpgRocket();
  32. Class_T Classify( void ) { return CLASS_NONE; }
  33. void Spawn( void );
  34. void Precache( void );
  35. void RocketTouch( CBaseEntity *pOther );
  36. void IgniteThink( void );
  37. void SeekThink( void );
  38. virtual void Detonate( void );
  39. static CRpgRocket *Create( const Vector &vecOrigin, const QAngle &angAngles, CBasePlayer *pentOwner = NULL );
  40. CHandle<CWeaponRPG> m_hOwner;
  41. float m_flIgniteTime;
  42. int m_iTrail;
  43. DECLARE_DATADESC();
  44. };
  45. #endif
  46. #ifdef CLIENT_DLL
  47. #define CLaserDot C_LaserDot
  48. #endif
  49. class CLaserDot;
  50. #ifdef CLIENT_DLL
  51. #define CWeaponRPG C_WeaponRPG
  52. #endif
  53. //-----------------------------------------------------------------------------
  54. // CWeaponRPG
  55. //-----------------------------------------------------------------------------
  56. class CWeaponRPG : public CBaseHL1MPCombatWeapon
  57. {
  58. DECLARE_CLASS( CWeaponRPG, CBaseHL1MPCombatWeapon );
  59. public:
  60. CWeaponRPG( void );
  61. ~CWeaponRPG();
  62. void ItemPostFrame( void );
  63. void Precache( void );
  64. bool Deploy( void );
  65. void PrimaryAttack( void );
  66. void WeaponIdle( void );
  67. bool Holster( CBaseCombatWeapon *pSwitchingTo = NULL );
  68. void NotifyRocketDied( void );
  69. bool Reload( void );
  70. void Drop( const Vector &vecVelocity );
  71. virtual int GetDefaultClip1( void ) const;
  72. // DECLARE_SERVERCLASS();
  73. DECLARE_DATADESC();
  74. DECLARE_NETWORKCLASS();
  75. DECLARE_PREDICTABLE();
  76. private:
  77. void CreateLaserPointer( void );
  78. void UpdateSpot( void );
  79. bool IsGuiding( void );
  80. void StartGuiding( void );
  81. void StopGuiding( void );
  82. #ifndef CLIENT_DLL
  83. // DECLARE_ACTTABLE();
  84. #endif
  85. private:
  86. // bool m_bGuiding;
  87. // CHandle<CLaserDot> m_hLaserDot;
  88. // CHandle<CRpgRocket> m_hMissile;
  89. // bool m_bIntialStateUpdate;
  90. // bool m_bLaserDotSuspended;
  91. // float m_flLaserDotReviveTime;
  92. CNetworkVar( bool, m_bGuiding );
  93. CNetworkVar( bool, m_bIntialStateUpdate );
  94. CNetworkVar( bool, m_bLaserDotSuspended );
  95. CNetworkVar( float, m_flLaserDotReviveTime );
  96. CNetworkHandle( CBaseEntity, m_hMissile );
  97. #ifndef CLIENT_DLL
  98. CHandle<CLaserDot> m_hLaserDot;
  99. #endif
  100. };
  101. #endif // WEAPON_RPG_H