summaryrefslogtreecommitdiff
path: root/game/client/portal/c_neurotoxin_countdown.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/client/portal/c_neurotoxin_countdown.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/portal/c_neurotoxin_countdown.cpp')
-rw-r--r--game/client/portal/c_neurotoxin_countdown.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/game/client/portal/c_neurotoxin_countdown.cpp b/game/client/portal/c_neurotoxin_countdown.cpp
new file mode 100644
index 0000000..7a28b1d
--- /dev/null
+++ b/game/client/portal/c_neurotoxin_countdown.cpp
@@ -0,0 +1,56 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+#include "cbase.h"
+#include "c_neurotoxin_countdown.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+
+CUtlVector< C_NeurotoxinCountdown* > g_NeurotoxinCountdowns;
+
+
+IMPLEMENT_CLIENTCLASS_DT(C_NeurotoxinCountdown, DT_NeurotoxinCountdown, CNeurotoxinCountdown)
+
+ RecvPropBool( RECVINFO(m_bEnabled) ),
+
+END_RECV_TABLE()
+
+
+C_NeurotoxinCountdown::C_NeurotoxinCountdown()
+{
+ g_NeurotoxinCountdowns.AddToTail( this );
+}
+
+C_NeurotoxinCountdown::~C_NeurotoxinCountdown()
+{
+ g_NeurotoxinCountdowns.FindAndRemove( this );
+}
+
+int C_NeurotoxinCountdown::GetMinutes( void )
+{
+ C_BasePlayer *player = UTIL_PlayerByIndex( 1 );
+ if ( player )
+ return player->GetBonusProgress() / 60;
+
+ return 0.0f;
+}
+
+int C_NeurotoxinCountdown::GetSeconds( void )
+{
+ C_BasePlayer *player = UTIL_PlayerByIndex( 1 );
+ if ( player )
+ return player->GetBonusProgress() % 60;
+
+ return 0.0f;
+}
+
+int C_NeurotoxinCountdown::GetMilliseconds( void )
+{
+ return static_cast<int>( gpGlobals->curtime * 100.0f ) % 100;;
+}