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.

81 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef TF_AMMO_PACK_H
  7. #define TF_AMMO_PACK_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "items.h"
  12. typedef enum
  13. {
  14. AP_NORMAL = 0,
  15. AP_HALLOWEEN,
  16. AP_CHRISTMAS,
  17. } AmmoPackType_t;
  18. class CTFAmmoPack : public CItem
  19. {
  20. public:
  21. DECLARE_CLASS( CTFAmmoPack, CItem );
  22. DECLARE_SERVERCLASS();
  23. CTFAmmoPack()
  24. {
  25. m_PackType = AP_NORMAL;
  26. }
  27. virtual void Spawn();
  28. virtual void Precache();
  29. void EXPORT DropSoundThink( void );
  30. void EXPORT FlyThink( void );
  31. void EXPORT PackTouch( CBaseEntity *pOther );
  32. void InitWeaponDrop( CTFPlayer *pPlayer, CTFWeaponBase *pWeapon, int nSkin, bool bEmpty, bool bIsSuicide );
  33. virtual unsigned int PhysicsSolidMaskForEntity( void ) const;
  34. int GiveAmmo( int iCount, int iAmmoType );
  35. void MakeEmptyPack( void ) { m_bEmptyPack = true; }
  36. void MakeHolidayPack( void );
  37. void SetBonusScale( float flBonusScale = 1.f );
  38. void SetPickupThinkTime( float flNewThinkTime );
  39. static CTFAmmoPack *Create( const Vector &vecOrigin, const QAngle &vecAngles, CBaseEntity *pOwner, const char *pszModelName );
  40. float GetCreationTime( void ) { return m_flCreationTime; }
  41. void SetInitialVelocity( Vector &vecVelocity );
  42. void SetHealthInstead( bool bHealth ) { m_bHealthInstead = bHealth; }
  43. const char* MakeHolidayAmmoPack( const char* inModelName, CBaseEntity *pOwner, const CTakeDamageInfo &info );
  44. bool m_bObjGib;
  45. private:
  46. int m_iAmmo[TF_AMMO_COUNT];
  47. float m_flCreationTime;
  48. bool m_bEmptyPack; // If true, the pack gives nothing when picked up.
  49. bool m_bHealthInstead; // If true, the pack gives health instead of ammo
  50. bool m_bAllowOwnerPickup;
  51. bool m_bNoPickup;
  52. float m_flBonusScale;
  53. AmmoPackType_t m_PackType;
  54. CNetworkVector( m_vecInitialVelocity );
  55. private:
  56. CTFAmmoPack( const CTFAmmoPack & );
  57. DECLARE_DATADESC();
  58. };
  59. #endif //TF_AMMO_PACK_H