diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/server/tf/trigger_catapult.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/server/tf/trigger_catapult.h')
| -rw-r--r-- | game/server/tf/trigger_catapult.h | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/game/server/tf/trigger_catapult.h b/game/server/tf/trigger_catapult.h new file mode 100644 index 0000000..3fbf66f --- /dev/null +++ b/game/server/tf/trigger_catapult.h @@ -0,0 +1,101 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +// copied from portal2 code; original code came with client-predicted counterpart, +// but implementing predictable triggers in tf2 wasn't trivial so this is just the +// server component. it works but causes prediction errors. +#ifndef TRIGGER_CATAPULT_H +#define TRIGGER_CATAPULT_H +#ifdef _WIN32 +#pragma once +#endif + +#include "triggers.h" + + +class CTriggerCatapult : public CBaseTrigger +{ + DECLARE_CLASS( CTriggerCatapult, CBaseTrigger ); + DECLARE_DATADESC(); + //DECLARE_SERVERCLASS(); + +public: + + CTriggerCatapult( void ); + + virtual void Spawn( void ); + virtual void StartTouch( CBaseEntity *pOther ); + virtual void EndTouch( CBaseEntity *pOther ); + virtual int DrawDebugTextOverlays(void); + virtual void DrawDebugGeometryOverlays( void ); + + void LaunchThink( void ); + + void PlayerPassesTriggerFiltersThink( void ); + static const char *s_szPlayerPassesTriggerFiltersThinkContext; + +private: + void InputSetPlayerSpeed( inputdata_t &in ); + void InputSetPhysicsSpeed( inputdata_t &in ); + void InputSetLaunchTarget( inputdata_t &in ); + void InputSetExactVelocityChoiceType( inputdata_t &in ); + + void LaunchByTarget( CBaseEntity *pVictim, CBaseEntity *pTarget ); + Vector CalculateLaunchVector( CBaseEntity *pVictim, CBaseEntity *pTarget ); + Vector CalculateLaunchVectorPreserve( Vector vecInitialVelocity, CBaseEntity *pVictim, CBaseEntity *pTarget, bool bForcePlayer = false ); + + void LaunchByDirection( CBaseEntity *pVictim ); + void OnLaunchedVictim( CBaseEntity *pVictim ); + + float m_flRefireDelay[MAX_PLAYERS + 1]; + float m_flPlayerVelocity; + float m_flPhysicsVelocity; + QAngle m_vecLaunchAngles; + string_t m_strLaunchTarget; + int m_ExactVelocityChoice; + bool m_bUseExactVelocity; + bool m_bUseThresholdCheck; + float m_flLowerThreshold; + float m_flUpperThreshold; + float m_flEntryAngleTolerance; + EHANDLE m_hLaunchTarget; + bool m_bOnlyVelocityCheck; + bool m_bApplyAngularImpulse; + bool m_bPlayersPassTriggerFilters; + float m_flAirControlSupressionTime; + bool m_bDirectionSuppressAirControl; + + //CNetworkArray( float, m_flRefireDelay, MAX_PLAYERS + 1 ); // 0 for physics object the rest for each player userid + //CNetworkVar( float, m_flPlayerVelocity ); + //CNetworkVar( float, m_flPhysicsVelocity ); + //CNetworkQAngle( m_vecLaunchAngles ); + ////CNetworkVar( string_t, m_strLaunchTarget ); + //string_t m_strLaunchTarget; + + //CNetworkVar( int, m_ExactVelocityChoice ); + //CNetworkVar( bool, m_bUseExactVelocity ); + + //CNetworkVar( bool, m_bUseThresholdCheck ); + //CNetworkVar( float, m_flLowerThreshold ); + //CNetworkVar( float, m_flUpperThreshold ); + //CNetworkVar( float, m_flEntryAngleTolerance ); + + //CNetworkHandle( CBaseEntity, m_hLaunchTarget ); + + //CNetworkVar( bool, m_bOnlyVelocityCheck ); + //CNetworkVar( bool, m_bApplyAngularImpulse ); + //CNetworkVar( bool, m_bPlayersPassTriggerFilters ); + + //CNetworkVar( float, m_flAirControlSupressionTime ); // After catapult, stop air control for this long (or default of quarter second if this value is negative) + //CNetworkVar( bool, m_bDirectionSuppressAirControl ); // Do we want to use air control suppression for directional catapults. + + COutputEvent m_OnCatapulted; + + CUtlVector< EHANDLE > m_hAbortedLaunchees; +}; + +#endif // TRIGGER_CATAPULT_H |