aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/client/c_tesla.cpp
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/client/c_tesla.cpp
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/client/c_tesla.cpp')
-rw-r--r--mp/src/game/client/c_tesla.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/mp/src/game/client/c_tesla.cpp b/mp/src/game/client/c_tesla.cpp
new file mode 100644
index 00000000..da32e00b
--- /dev/null
+++ b/mp/src/game/client/c_tesla.cpp
@@ -0,0 +1,65 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#include "cbase.h"
+#include "c_tesla.h"
+#include "fx.h"
+#include <bitbuf.h>
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+IMPLEMENT_CLIENTCLASS_DT( C_Tesla, DT_Tesla, CTesla )
+ RecvPropString( RECVINFO( m_SoundName ) ),
+ RecvPropString( RECVINFO( m_iszSpriteName ) )
+END_RECV_TABLE()
+
+
+C_Tesla::C_Tesla()
+{
+}
+
+void C_Tesla::ReceiveMessage( int classID, bf_read &msg )
+{
+ CTeslaInfo teslaInfo;
+
+ msg.ReadBitVec3Coord( teslaInfo.m_vPos );
+ teslaInfo.m_vAngles.Init();
+
+ teslaInfo.m_nEntIndex = msg.ReadShort();
+ teslaInfo.m_flRadius = msg.ReadFloat();
+
+ teslaInfo.m_vColor.x = ((unsigned char)msg.ReadChar()) / 255.0f;
+ teslaInfo.m_vColor.y = ((unsigned char)msg.ReadChar()) / 255.0f;
+ teslaInfo.m_vColor.z = ((unsigned char)msg.ReadChar()) / 255.0f;
+
+ float flAlpha = 0;
+ flAlpha = ((unsigned char)msg.ReadChar()) / 255.0f;
+
+ teslaInfo.m_nBeams = msg.ReadChar();
+
+ teslaInfo.m_flBeamWidth = msg.ReadFloat();
+ teslaInfo.m_flTimeVisible = msg.ReadFloat();
+ teslaInfo.m_pszSpriteName = m_iszSpriteName;
+
+ EmitSound( m_SoundName );
+
+ m_QueuedCommands.AddToTail( teslaInfo );
+ SetNextClientThink( CLIENT_THINK_ALWAYS );
+}
+
+
+void C_Tesla::ClientThink()
+{
+ FOR_EACH_LL( m_QueuedCommands, i )
+ {
+ FX_Tesla( m_QueuedCommands[i] );
+ }
+ m_QueuedCommands.Purge();
+ SetNextClientThink( CLIENT_THINK_NEVER );
+}
+
+