summaryrefslogtreecommitdiff
path: root/game/shared/dod/weapon_explodingstickgrenade.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/shared/dod/weapon_explodingstickgrenade.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/shared/dod/weapon_explodingstickgrenade.cpp')
-rw-r--r--game/shared/dod/weapon_explodingstickgrenade.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/game/shared/dod/weapon_explodingstickgrenade.cpp b/game/shared/dod/weapon_explodingstickgrenade.cpp
new file mode 100644
index 0000000..fa5e012
--- /dev/null
+++ b/game/shared/dod/weapon_explodingstickgrenade.cpp
@@ -0,0 +1,54 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#include "cbase.h"
+#include "weapon_dodbasegrenade.h"
+
+#ifdef CLIENT_DLL
+ #define CWeaponExplodingStickGrenade C_WeaponExplodingStickGrenade
+#else
+ #include "dod_stickgrenade.h" //the thing that we throw
+#endif
+
+class CWeaponExplodingStickGrenade : public CWeaponDODBaseGrenade
+{
+public:
+ DECLARE_CLASS( CWeaponExplodingStickGrenade, CWeaponDODBaseGrenade );
+ DECLARE_NETWORKCLASS();
+ DECLARE_PREDICTABLE();
+
+ CWeaponExplodingStickGrenade() {}
+
+ virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_FRAG_GER_LIVE; }
+
+#ifndef CLIENT_DLL
+
+ virtual void EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer, float flLifeTime = GRENADE_FUSE_LENGTH )
+ {
+ // align the stickgrenade vertically and spin end over end
+ QAngle vecNewAngles = QAngle(45,pPlayer->EyeAngles().y,0);
+ AngularImpulse angNewImpulse = AngularImpulse( 0, 600, 0 );
+
+ CDODStickGrenade::Create( vecSrc, vecNewAngles, vecVel, angNewImpulse, pPlayer, flLifeTime, GetWeaponID() );
+ }
+
+#endif
+
+ virtual bool IsArmed( void ) { return true; }
+
+ CWeaponExplodingStickGrenade( const CWeaponExplodingStickGrenade & ) {}
+};
+
+IMPLEMENT_NETWORKCLASS_ALIASED( WeaponExplodingStickGrenade, DT_WeaponExplodingStickGrenade )
+
+BEGIN_NETWORK_TABLE(CWeaponExplodingStickGrenade, DT_WeaponExplodingStickGrenade)
+END_NETWORK_TABLE()
+
+BEGIN_PREDICTION_DATA( CWeaponExplodingStickGrenade ) //MATTTODO: are these necessary?
+END_PREDICTION_DATA()
+
+LINK_ENTITY_TO_CLASS( weapon_frag_ger_live, CWeaponExplodingStickGrenade );
+PRECACHE_WEAPON_REGISTER( weapon_frag_ger_live ); \ No newline at end of file