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/server/hl1/hl1_item_suit.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/server/hl1/hl1_item_suit.cpp')
| -rw-r--r-- | game/server/hl1/hl1_item_suit.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/game/server/hl1/hl1_item_suit.cpp b/game/server/hl1/hl1_item_suit.cpp new file mode 100644 index 0000000..83644fe --- /dev/null +++ b/game/server/hl1/hl1_item_suit.cpp @@ -0,0 +1,61 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// +/* +===== item_suit.cpp ======================================================== + + handling for the player's suit. +*/ + +#include "cbase.h" +#include "player.h" +#include "gamerules.h" +#include "items.h" +#include "hl1_items.h" + + +#define SF_SUIT_SHORTLOGON 0x0001 + +#define SUIT_MODEL "models/w_suit.mdl" + +extern int gEvilImpulse101; + +class CItemSuit : public CHL1Item +{ +public: + DECLARE_CLASS( CItemSuit, CHL1Item ); + + void Spawn( void ) + { + Precache( ); + SetModel( SUIT_MODEL ); + BaseClass::Spawn( ); + + CollisionProp()->UseTriggerBounds( true, 12.0f ); + } + void Precache( void ) + { + PrecacheModel( SUIT_MODEL ); + } + bool MyTouch( CBasePlayer *pPlayer ) + { + if ( pPlayer->IsSuitEquipped() ) + return false; + + if( !gEvilImpulse101 ) + { + if ( HasSpawnFlags( SF_SUIT_SHORTLOGON ) ) + UTIL_EmitSoundSuit(pPlayer->edict(), "!HEV_A0"); // short version of suit logon, + else + UTIL_EmitSoundSuit(pPlayer->edict(), "!HEV_AAx"); // long version of suit logon + } + + pPlayer->EquipSuit(); + return true; + } +}; + +LINK_ENTITY_TO_CLASS(item_suit, CItemSuit); +PRECACHE_REGISTER(item_suit); |