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.

57 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Load item upgrade data from KeyValues
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef TF_UPGRADES_SHARED_H
  8. #define TF_UPGRADES_SHARED_H
  9. #ifdef CLIENT_DLL
  10. #define CTFPlayer C_TFPlayer
  11. #endif
  12. class CTFPlayer;
  13. class CMannVsMachineUpgrades
  14. {
  15. public:
  16. char szAttrib[ MAX_ATTRIBUTE_DESCRIPTION_LENGTH ];
  17. char szIcon[ MAX_PATH ];
  18. float flIncrement;
  19. float flCap;
  20. int nCost;
  21. int nUIGroup;
  22. int nQuality;
  23. int nTier; // If set, upgrades in the same tier - for the same player/item - will be mutually exclusive
  24. };
  25. class CMannVsMachineUpgradeManager : public CAutoGameSystem
  26. {
  27. public:
  28. CMannVsMachineUpgradeManager();
  29. virtual void LevelInitPostEntity();
  30. virtual void LevelShutdownPostEntity();
  31. void ParseUpgradeBlockForUIGroup( KeyValues *pKV, int iDefaultUIGroup );
  32. int GetAttributeIndexByName( const char* pszAttributeName );
  33. void LoadUpgradesFile( void );
  34. void LoadUpgradesFileFromPath( const char *pszPath );
  35. public:
  36. CUtlVector< CMannVsMachineUpgrades > m_Upgrades;
  37. private:
  38. CUtlMap< const char*, int > m_AttribMap;
  39. };
  40. extern CMannVsMachineUpgradeManager g_MannVsMachineUpgrades;
  41. int GetUpgradeStepData( CTFPlayer *pPlayer, int nWeaponSlot, int nUpgradeIndex, int &nCurrentStep, bool &bOverCap );
  42. #endif // TF_UPGRADES_H