source-sdk-2013-mapbase/sp/src/game/server/hl1_CBaseHelicopter.h
Joe Ludwig beaae8ac45 Updated the SDK with the latest code from the TF and HL2 branches
* Adds support for Visual Studio 2012 and 2013
* VR Mode:
. Switches from headtrack.dll to sourcevr.dll
. Improved readability of the UI in VR
. Removed the IPD calibration tool. TF2 will now obey the Oculus
configuration file. Use the Oculus calibration tool in your SDK or
install and run "OpenVR" under Tools in Steam to calibrate your IPD.
. Added dropdown to enable VR mode in the Video options. Removed the -vr
command line option.
. Added the ability to switch in and out of VR mode without quitting the
game
. By default VR mode will run full screen. To switch back to a
borderless window set the vr_force_windowed convar.
. Added support for VR mode on Linux
* Many assorted bug fixes and other changes from Team Fortress in
various shared files
2013-12-03 08:54:16 -08:00

136 lines
3.9 KiB
C++

//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
//---------------------------------------------------------
// Helicopter flags
//---------------------------------------------------------
enum HelicopterFlags_t
{
BITS_HELICOPTER_GUN_ON = 0x00000001, // Gun is on and aiming
BITS_HELICOPTER_MISSILE_ON = 0x00000002, // Missile turrets are on and aiming
};
//---------------------------------------------------------
//---------------------------------------------------------
#define SF_NOWRECKAGE 0x08
#define SF_NOROTORWASH 0x20
#define SF_AWAITINPUT 0x40
//---------------------------------------------------------
//---------------------------------------------------------
#define BASECHOPPER_MAX_SPEED 400.0f
#define BASECHOPPER_MAX_FIRING_SPEED 250.0f
#define BASECHOPPER_MIN_ROCKET_DIST 1000.0f
#define BASECHOPPER_MAX_GUN_DIST 2000.0f
//=========================================================
//=========================================================
class CBaseHelicopter : public CAI_BaseNPC
{
public:
DECLARE_CLASS( CBaseHelicopter, CAI_BaseNPC );
DECLARE_DATADESC();
DECLARE_SERVERCLASS();
void Spawn( void );
void Precache( void );
void Event_Killed( const CTakeDamageInfo &info );
void StopLoopingSounds();
int BloodColor( void ) { return DONT_BLEED; }
void GibMonster( void );
Class_T Classify ( void ) { return CLASS_HUMAN_MILITARY; }
void CallDyingThink( void ) { DyingThink(); }
bool HasEnemy( void ) { return GetEnemy() != NULL; }
void CheckEnemy( CBaseEntity *pEnemy );
virtual bool ChooseEnemy( void );
virtual void HelicopterThink( void );
virtual void HelicopterPostThink( void ) { };
virtual void FlyTouch( CBaseEntity *pOther );
virtual void CrashTouch( CBaseEntity *pOther );
virtual void DyingThink( void );
virtual void Startup( void );
virtual void NullThink( void );
virtual void Flight( void );
virtual void ShowDamage( void ) {};
virtual void FlyPathCorners( void );
void UpdatePlayerDopplerShift( void );
virtual void Hunt( void );
virtual bool IsCrashing( void ) { return m_lifeState != LIFE_ALIVE; }
virtual float GetAcceleration( void ) { return 5; }
virtual bool HasReachedTarget( void );
virtual void OnReachedTarget( CBaseEntity *pTarget ) {};
virtual void ApplySidewaysDrag( const Vector &vecRight );
virtual void ApplyGeneralDrag( void );
int OnTakeDamage_Alive( const CTakeDamageInfo &info );
void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator );
virtual bool FireGun( void );
virtual float GetRotorVolume( void ) { return 1.0; }
virtual void InitializeRotorSound( void );
virtual void UpdateRotorSoundPitch( int iPitch );
virtual void AimRocketGun(void) {};
virtual void FireRocket( Vector vLaunchPos, Vector vLaunchDir ) {};
void DrawDebugGeometryOverlays(void);
CSoundPatch *m_pRotorSound;
float m_flForce;
int m_fHelicopterFlags;
Vector m_vecDesiredFaceDir;
Vector m_vecDesiredPosition;
Vector m_vecGoalOrientation; // orientation of the goal entity.
float m_flLastSeen;
float m_flPrevSeen;
int m_iSoundState; // don't save this
Vector m_vecTarget;
Vector m_vecTargetPosition;
float m_flMaxSpeed; // Maximum speed of the helicopter.
float m_flMaxSpeedFiring; // Maximum speed of the helicopter whilst firing guns.
float m_flGoalSpeed; // Goal speed
float m_flInitialSpeed;
float m_angleVelocity;
void ChangePathCorner( const char *pszName );
// Inputs
void InputChangePathCorner( inputdata_t &inputdata );
void InputActivate( inputdata_t &inputdata );
// Outputs
COutputEvent m_AtTarget; // Fired when pathcorner has been reached
COutputEvent m_LeaveTarget; // Fired when pathcorner is left
float m_flNextCrashExplosion;
};