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.

106 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "basehlcombatweapon.h"
  7. #include "soundenvelope.h"
  8. #ifndef WEAPON_FLAREGUN_H
  9. #define WEAPON_FLAREGUN_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #define SF_FLARE_NO_DLIGHT 0x00000001
  14. #define SF_FLARE_NO_SMOKE 0x00000002
  15. #define SF_FLARE_INFINITE 0x00000004
  16. #define SF_FLARE_START_OFF 0x00000008
  17. #define FLARE_DURATION 30.0f
  18. #define FLARE_DECAY_TIME 10.0f
  19. #define FLARE_BLIND_TIME 6.0f
  20. //---------------------
  21. // Flare
  22. //---------------------
  23. class CFlare : public CBaseCombatCharacter
  24. {
  25. public:
  26. DECLARE_CLASS( CFlare, CBaseCombatCharacter );
  27. CFlare();
  28. ~CFlare();
  29. static CFlare * GetActiveFlares( void );
  30. CFlare * GetNextFlare( void ) const { return m_pNextFlare; }
  31. static CFlare *Create( Vector vecOrigin, QAngle vecAngles, CBaseEntity *pOwner, float lifetime );
  32. virtual unsigned int PhysicsSolidMaskForEntity( void ) const;
  33. void Spawn( void );
  34. void Precache( void );
  35. int Restore( IRestore &restore );
  36. void Activate( void );
  37. void StartBurnSound( void );
  38. void Start( float lifeTime );
  39. void Die( float fadeTime );
  40. void Launch( const Vector &direction, float speed );
  41. Class_T Classify( void );
  42. void FlareTouch( CBaseEntity *pOther );
  43. void FlareBurnTouch( CBaseEntity *pOther );
  44. void FlareThink( void );
  45. void InputStart( inputdata_t &inputdata );
  46. void InputDie( inputdata_t &inputdata );
  47. void InputLaunch( inputdata_t &inputdata );
  48. DECLARE_SERVERCLASS();
  49. DECLARE_DATADESC();
  50. static CFlare *activeFlares;
  51. CBaseEntity *m_pOwner;
  52. int m_nBounces; // how many times has this flare bounced?
  53. CNetworkVar( float, m_flTimeBurnOut ); // when will the flare burn out?
  54. CNetworkVar( float, m_flScale );
  55. float m_flDuration;
  56. float m_flNextDamage;
  57. CSoundPatch *m_pBurnSound;
  58. bool m_bFading;
  59. CNetworkVar( bool, m_bLight );
  60. CNetworkVar( bool, m_bSmoke );
  61. CNetworkVar( bool, m_bPropFlare );
  62. bool m_bInActiveList;
  63. CFlare * m_pNextFlare;
  64. void RemoveFromActiveFlares( void );
  65. void AddToActiveFlares( void );
  66. };
  67. //---------------------
  68. // Flaregun
  69. //---------------------
  70. class CFlaregun:public CBaseHLCombatWeapon
  71. {
  72. public:
  73. DECLARE_CLASS( CFlaregun, CBaseHLCombatWeapon );
  74. DECLARE_SERVERCLASS();
  75. void Precache( void );
  76. void PrimaryAttack( void );
  77. void SecondaryAttack( void );
  78. };
  79. #endif // WEAPON_FLAREGUN_H