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.

136 lines
3.8 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. //---------------------------------------------------------
  9. // Helicopter flags
  10. //---------------------------------------------------------
  11. enum HelicopterFlags_t
  12. {
  13. BITS_HELICOPTER_GUN_ON = 0x00000001, // Gun is on and aiming
  14. BITS_HELICOPTER_MISSILE_ON = 0x00000002, // Missile turrets are on and aiming
  15. };
  16. //---------------------------------------------------------
  17. //---------------------------------------------------------
  18. #define SF_NOWRECKAGE 0x08
  19. #define SF_NOROTORWASH 0x20
  20. #define SF_AWAITINPUT 0x40
  21. //---------------------------------------------------------
  22. //---------------------------------------------------------
  23. #define BASECHOPPER_MAX_SPEED 400.0f
  24. #define BASECHOPPER_MAX_FIRING_SPEED 250.0f
  25. #define BASECHOPPER_MIN_ROCKET_DIST 1000.0f
  26. #define BASECHOPPER_MAX_GUN_DIST 2000.0f
  27. //=========================================================
  28. //=========================================================
  29. class CBaseHelicopter : public CAI_BaseNPC
  30. {
  31. public:
  32. DECLARE_CLASS( CBaseHelicopter, CAI_BaseNPC );
  33. DECLARE_DATADESC();
  34. DECLARE_SERVERCLASS();
  35. void Spawn( void );
  36. void Precache( void );
  37. void Event_Killed( const CTakeDamageInfo &info );
  38. void StopLoopingSounds();
  39. int BloodColor( void ) { return DONT_BLEED; }
  40. void GibMonster( void );
  41. Class_T Classify ( void ) { return CLASS_HUMAN_MILITARY; }
  42. void CallDyingThink( void ) { DyingThink(); }
  43. bool HasEnemy( void ) { return GetEnemy() != NULL; }
  44. void CheckEnemy( CBaseEntity *pEnemy );
  45. virtual bool ChooseEnemy( void );
  46. virtual void HelicopterThink( void );
  47. virtual void HelicopterPostThink( void ) { };
  48. virtual void FlyTouch( CBaseEntity *pOther );
  49. virtual void CrashTouch( CBaseEntity *pOther );
  50. virtual void DyingThink( void );
  51. virtual void Startup( void );
  52. virtual void NullThink( void );
  53. virtual void Flight( void );
  54. virtual void ShowDamage( void ) {};
  55. virtual void FlyPathCorners( void );
  56. void UpdatePlayerDopplerShift( void );
  57. virtual void Hunt( void );
  58. virtual bool IsCrashing( void ) { return m_lifeState != LIFE_ALIVE; }
  59. virtual float GetAcceleration( void ) { return 5; }
  60. virtual bool HasReachedTarget( void );
  61. virtual void OnReachedTarget( CBaseEntity *pTarget ) {};
  62. virtual void ApplySidewaysDrag( const Vector &vecRight );
  63. virtual void ApplyGeneralDrag( void );
  64. int OnTakeDamage_Alive( const CTakeDamageInfo &info );
  65. void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr );
  66. virtual bool FireGun( void );
  67. virtual float GetRotorVolume( void ) { return 1.0; }
  68. virtual void InitializeRotorSound( void );
  69. virtual void UpdateRotorSoundPitch( int iPitch );
  70. virtual void AimRocketGun(void) {};
  71. virtual void FireRocket( Vector vLaunchPos, Vector vLaunchDir ) {};
  72. void DrawDebugGeometryOverlays(void);
  73. CSoundPatch *m_pRotorSound;
  74. float m_flForce;
  75. int m_fHelicopterFlags;
  76. Vector m_vecDesiredFaceDir;
  77. Vector m_vecDesiredPosition;
  78. Vector m_vecGoalOrientation; // orientation of the goal entity.
  79. float m_flLastSeen;
  80. float m_flPrevSeen;
  81. int m_iSoundState; // don't save this
  82. Vector m_vecTarget;
  83. Vector m_vecTargetPosition;
  84. float m_flMaxSpeed; // Maximum speed of the helicopter.
  85. float m_flMaxSpeedFiring; // Maximum speed of the helicopter whilst firing guns.
  86. float m_flGoalSpeed; // Goal speed
  87. float m_flInitialSpeed;
  88. float m_angleVelocity;
  89. void ChangePathCorner( const char *pszName );
  90. // Inputs
  91. void InputChangePathCorner( inputdata_t &inputdata );
  92. void InputActivate( inputdata_t &inputdata );
  93. // Outputs
  94. COutputEvent m_AtTarget; // Fired when pathcorner has been reached
  95. COutputEvent m_LeaveTarget; // Fired when pathcorner is left
  96. float m_flNextCrashExplosion;
  97. };