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/portal/func_liquidportal.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/server/portal/func_liquidportal.h')
| -rw-r--r-- | game/server/portal/func_liquidportal.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/game/server/portal/func_liquidportal.h b/game/server/portal/func_liquidportal.h new file mode 100644 index 0000000..3e3f532 --- /dev/null +++ b/game/server/portal/func_liquidportal.h @@ -0,0 +1,65 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Rising liquid that acts as a one-way portal +// +// $NoKeywords: $ +//===========================================================================// + +#ifndef FUNC_LIQUIDPORTAL_H +#define FUNC_LIQUIDPORTAL_H + +#ifdef _WIN32 +#pragma once +#endif + +#include "triggers.h" + +class CFunc_LiquidPortal : public CBaseEntity +{ +public: + DECLARE_CLASS( CFunc_LiquidPortal, CBaseEntity ); + DECLARE_SERVERCLASS(); + DECLARE_DATADESC(); + + CFunc_LiquidPortal( void ); + + virtual void Spawn( void ); + virtual void Activate( void ); + virtual void Think( void ); + + virtual int UpdateTransmitState( void ) // set transmit filter to transmit always + { + return SetTransmitState( FL_EDICT_ALWAYS ); + } + + virtual int Save( ISave &save ); + virtual int Restore( IRestore &restore ); + + void InputSetLinkedLiquidPortal( inputdata_t &inputdata ); + void InputSetFillTime( inputdata_t &inputdata ); //time it takes to fill the portal volume + void InputStartFilling( inputdata_t &inputdata ); //start filling with portal liquid, will teleport entities as they become completely enveloped + + //add/remove teleportables to offload the selection process to triggers, each with their own filters + void InputAddActivatorToTeleportList( inputdata_t &inputdata ); //add an activator entity to the list of entities to teleport when filling + void InputRemoveActivatorFromTeleportList( inputdata_t &inputdata ); //remove an activator entity from the list of entities to teleport when filling + + void ComputeLinkMatrix( void ); + void SetLinkedLiquidPortal( CFunc_LiquidPortal *pLinked ); + + void TeleportImmersedEntity( CBaseEntity *pEntity ); + + CNetworkHandle( CFunc_LiquidPortal, m_hLinkedPortal ); //the portal this portal is linked to + VMatrix m_matrixThisToLinked; //the matrix that will transform a point relative to this portal, to a point relative to the linked portal + float m_fFillTime; //how long it takes to fill completely + bool m_bFillInProgress; + CNetworkVar( float, m_fFillStartTime ); // time started filling with portal liquid, will teleport entities as they become completely enveloped + CNetworkVar( float, m_fFillEndTime ); // time that filling should be finished and touching entities teleport + + CUtlVector<EHANDLE> m_hTeleportList; //list of entities to teleport when filling + CUtlVector<EHANDLE> m_hLeftToTeleportThisFill; //list of entities that have not yet teleported during this fill, they get teleported out when fully immersed in the liquid + + string_t m_strInitialLinkedPortal; +}; + +#endif //#ifndef FUNC_LIQUIDPORTAL_H + |