diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/server/hl2/item_longjump.cpp | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/server/hl2/item_longjump.cpp')
| -rw-r--r-- | mp/src/game/server/hl2/item_longjump.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/mp/src/game/server/hl2/item_longjump.cpp b/mp/src/game/server/hl2/item_longjump.cpp new file mode 100644 index 00000000..79335047 --- /dev/null +++ b/mp/src/game/server/hl2/item_longjump.cpp @@ -0,0 +1,61 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+/*
+
+===== item_longjump.cpp ========================================================
+
+ handling for the longjump module
+*/
+
+#include "cbase.h"
+#include "player.h"
+//#include "weapons.h"
+#include "gamerules.h"
+#include "items.h"
+
+class CItemLongJump : public CItem
+{
+public:
+ DECLARE_CLASS( CItemLongJump, CItem );
+
+ void Spawn( void )
+ {
+ Precache( );
+ SetModel( "models/w_longjump.mdl" );
+ BaseClass::Spawn( );
+ }
+ void Precache( void )
+ {
+ PrecacheModel ("models/w_longjump.mdl");
+ }
+ bool MyTouch( CBasePlayer *pPlayer )
+ {
+ if ( pPlayer->m_fLongJump )
+ {
+ return FALSE;
+ }
+
+ if ( pPlayer->IsSuitEquipped() )
+ {
+ pPlayer->m_fLongJump = TRUE;// player now has longjump module
+
+ CSingleUserRecipientFilter user( pPlayer );
+ user.MakeReliable();
+
+ UserMessageBegin( user, "ItemPickup" );
+ WRITE_STRING( STRING(pev->classname) );
+ MessageEnd();
+
+ UTIL_EmitSoundSuit( pPlayer->edict(), "!HEV_A1" ); // Play the longjump sound UNDONE: Kelly? correct sound?
+ return true;
+ }
+ return false;
+ }
+};
+
+LINK_ENTITY_TO_CLASS( item_longjump, CItemLongJump );
|