summaryrefslogtreecommitdiff
path: root/game/shared/portal/env_lightrail_endpoint_shared.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/portal/env_lightrail_endpoint_shared.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/shared/portal/env_lightrail_endpoint_shared.h')
-rw-r--r--game/shared/portal/env_lightrail_endpoint_shared.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/game/shared/portal/env_lightrail_endpoint_shared.h b/game/shared/portal/env_lightrail_endpoint_shared.h
new file mode 100644
index 0000000..8b65883
--- /dev/null
+++ b/game/shared/portal/env_lightrail_endpoint_shared.h
@@ -0,0 +1,69 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#ifndef ENV_LIGHTRAIL_ENDPOINT_SHARED_H
+#define ENV_LIGHTRAIL_ENDPOINT_SHARED_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#define SF_ENDPOINT_START_SMALLFX (1<<0) //Define spawnflags
+//#define SF_ENDPOINT_START_LARGEFX (1<<1)
+
+enum //Enumeration of the 4 states the endpoints can be in.
+{
+ ENDPOINT_STATE_OFF, //No FX displayed
+ ENDPOINT_STATE_SMALLFX, //Just the small particle trail is displayed and a faint glow
+ ENDPOINT_STATE_CHARGING, //Ramp up over a certain amount of time to the large bright glow
+ ENDPOINT_STATE_LARGEFX, //Shows a particle trail and a large bright glow
+ ENDPOINT_STATE_COUNT,
+};
+
+#ifndef CLIENT_DLL
+
+// ============================================================================
+//
+// Energy core - charges up and then releases energy from its position
+//
+// ============================================================================
+
+class CEnv_Lightrail_Endpoint : public CBaseEntity
+{
+ DECLARE_CLASS( CEnv_Lightrail_Endpoint, CBaseEntity );
+ DECLARE_SERVERCLASS();
+ DECLARE_DATADESC();
+
+public:
+ void InputStartCharge( inputdata_t &inputdata );
+ void InputStartSmallFX(inputdata_t &inputdata );
+ void InputStartLargeFX( inputdata_t &inputdata );
+ void InputStop( inputdata_t &inputdata );
+ void SetSmallFXScale( float flSmallScale ) { m_flSmallScale = flSmallScale; }
+ void SetLargeFXScale( float flLargeScale ) { m_flLargeScale = flLargeScale; }
+
+ void StartCharge( float flWarmUpTime ); //Charging difference between the small and large fx
+ void StartSmallFX(); //Start discharging the scaled down version of the FX
+ void StartLargeFX(); //Start discharging the larger brighter version of the FX
+ void StopSmallFX( float flCoolDownTime ); //Stop discharging the small fx
+ void StopLargeFX( float flCoolDownTime ); //Stop discharging the small fx
+
+ virtual int ShouldTransmit( const CCheckTransmitInfo *pInfo );
+ virtual int UpdateTransmitState( void );
+
+ virtual void Precache();
+ void Spawn( void );
+
+private:
+ CNetworkVar( float, m_flSmallScale ); //Scale of the small fx
+ CNetworkVar( float, m_flLargeScale ); //Scale of the large fx
+ CNetworkVar( int, m_nState ); //Current state of the fx
+ CNetworkVar( float, m_flDuration );
+ CNetworkVar( float, m_flStartTime );
+};
+
+#endif
+
+#endif // ENV_LIGHTRAIL_ENDPOINT_SHARED_H