summaryrefslogtreecommitdiff
path: root/game/server/plasma.cpp
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/server/plasma.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/server/plasma.cpp')
-rw-r--r--game/server/plasma.cpp93
1 files changed, 93 insertions, 0 deletions
diff --git a/game/server/plasma.cpp b/game/server/plasma.cpp
new file mode 100644
index 0000000..964cf76
--- /dev/null
+++ b/game/server/plasma.cpp
@@ -0,0 +1,93 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+#include "cbase.h"
+#include "plasma.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+//==================================================
+// CPlasma
+//==================================================
+
+//Link the entity
+LINK_ENTITY_TO_CLASS( _plasma, CPlasma );
+
+//Send datatable
+IMPLEMENT_SERVERCLASS_ST( CPlasma, DT_Plasma )
+ SendPropFloat( SENDINFO( m_flScale ), 0, SPROP_NOSCALE),
+ SendPropFloat( SENDINFO( m_flScaleTime ), 0, SPROP_NOSCALE),
+ SendPropInt( SENDINFO( m_nFlags ), 8, SPROP_UNSIGNED ),
+ SendPropModelIndex( SENDINFO( m_nPlasmaModelIndex )),
+ SendPropModelIndex( SENDINFO( m_nPlasmaModelIndex2 )),
+ SendPropModelIndex( SENDINFO( m_nGlowModelIndex )),
+END_SEND_TABLE()
+
+//Data description
+BEGIN_DATADESC( CPlasma )
+
+ //Client-side
+ DEFINE_FIELD( m_flScale, FIELD_FLOAT ),
+ DEFINE_FIELD( m_flScaleTime, FIELD_FLOAT ),
+ DEFINE_FIELD( m_nFlags, FIELD_INTEGER ),
+
+// DEFINE_FIELD( m_nPlasmaModelIndex, FIELD_INTEGER ),
+// DEFINE_FIELD( m_nPlasmaModelIndex2, FIELD_INTEGER ),
+// DEFINE_FIELD( m_nGlowModelIndex, FIELD_INTEGER ),
+
+ //Server-side
+
+END_DATADESC()
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : *name -
+//-----------------------------------------------------------------------------
+CPlasma::CPlasma( void )
+{
+ //Client-side
+ m_flScale = 0.0f;
+ m_flScaleTime = 0.0f;
+ m_nFlags = bitsFIRE_NONE;
+ m_nPlasmaModelIndex = PrecacheModel( "sprites/plasma1.vmt" );
+ m_nPlasmaModelIndex2 = PrecacheModel( "sprites/plasma1.vmt" );//<<TEMP>>
+ m_nGlowModelIndex = PrecacheModel( "sprites/fire_floor.vmt" );
+ //Server-side
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+CPlasma::~CPlasma( void )
+{
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : state -
+//-----------------------------------------------------------------------------
+void CPlasma::EnableSmoke( int state )
+{
+ if ( state )
+ {
+ m_nFlags |= bitsFIRESMOKE_SMOKE;
+ }
+ else
+ {
+ m_nFlags &= ~bitsFIRESMOKE_SMOKE;
+ }
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+void CPlasma::Precache( void )
+{
+ PrecacheModel( "sprites/plasma1.vmt" );
+ PrecacheModel( "sprites/fire_floor.vmt" );
+}