diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/dod/weapon_riflegrenade_us_live.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/dod/weapon_riflegrenade_us_live.cpp')
| -rw-r--r-- | game/shared/dod/weapon_riflegrenade_us_live.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/game/shared/dod/weapon_riflegrenade_us_live.cpp b/game/shared/dod/weapon_riflegrenade_us_live.cpp new file mode 100644 index 0000000..039c6fa --- /dev/null +++ b/game/shared/dod/weapon_riflegrenade_us_live.cpp @@ -0,0 +1,56 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#include "cbase.h" +#include "weapon_dodbasegrenade.h" + +#ifdef CLIENT_DLL +#define CWeaponRifleGrenadeUS_Live C_WeaponRifleGrenadeUS_Live +#else +#include "dod_riflegrenade_us.h" //the thing that we throw +#endif + + +class CWeaponRifleGrenadeUS_Live : public CWeaponDODBaseGrenade +{ +public: + DECLARE_CLASS( CWeaponRifleGrenadeUS_Live, CWeaponDODBaseGrenade ); + DECLARE_NETWORKCLASS(); + DECLARE_PREDICTABLE(); + + CWeaponRifleGrenadeUS_Live() {} + + virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_RIFLEGREN_US_LIVE; } + +#ifndef CLIENT_DLL + + virtual void EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer, float flLifeTime = GRENADE_FUSE_LENGTH ) + { + // align the grenade vertically and spin end over end + QAngle vecNewAngles = QAngle(45,pPlayer->EyeAngles().y,0); + AngularImpulse angNewImpulse = AngularImpulse( 0, 600, 0 ); + + CDODRifleGrenadeUS::Create( vecSrc, vecNewAngles, vecVel, angNewImpulse, pPlayer, flLifeTime, GetWeaponID() ); + } + +#endif + + virtual bool IsArmed( void ) { return true; } + +private: + CWeaponRifleGrenadeUS_Live( const CWeaponRifleGrenadeUS_Live & ); +}; + +IMPLEMENT_NETWORKCLASS_ALIASED( WeaponRifleGrenadeUS_Live, DT_WeaponRifleGrenadeUS_Live ) + +BEGIN_NETWORK_TABLE(CWeaponRifleGrenadeUS_Live, DT_WeaponRifleGrenadeUS_Live) +END_NETWORK_TABLE() + +BEGIN_PREDICTION_DATA( CWeaponRifleGrenadeUS_Live ) +END_PREDICTION_DATA() + +LINK_ENTITY_TO_CLASS( weapon_riflegren_us_live, CWeaponRifleGrenadeUS_Live ); +PRECACHE_WEAPON_REGISTER( weapon_riflegren_us_live );
\ No newline at end of file |