Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
924 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. /*
  9. ===== item_antidote.cpp ========================================================
  10. handling for the antidote object
  11. */
  12. #include "cbase.h"
  13. #include "player.h"
  14. #include "basecombatweapon.h"
  15. #include "gamerules.h"
  16. #include "items.h"
  17. class CItemAntidote : public CItem
  18. {
  19. public:
  20. DECLARE_CLASS( CItemAntidote, CItem );
  21. void Spawn( void )
  22. {
  23. Precache( );
  24. SetModel( "models/w_antidote.mdl" );
  25. BaseClass::Spawn( );
  26. }
  27. void Precache( void )
  28. {
  29. PrecacheModel ("models/w_antidote.mdl");
  30. }
  31. bool MyTouch( CBasePlayer *pPlayer )
  32. {
  33. pPlayer->SetSuitUpdate("!HEV_DET4", FALSE, SUIT_NEXT_IN_1MIN);
  34. pPlayer->m_rgItems[ITEM_ANTIDOTE] += 1;
  35. return true;
  36. }
  37. };
  38. LINK_ENTITY_TO_CLASS(item_antidote, CItemAntidote);