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.

109 lines
4.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: DOD's objective resource, transmits all objective states to players
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TF_OBJECTIVE_RESOURCE_H
  8. #define TF_OBJECTIVE_RESOURCE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "tf_shareddefs.h"
  13. #include "team_objectiveresource.h"
  14. class CTFObjectiveResource : public CBaseTeamObjectiveResource
  15. {
  16. DECLARE_CLASS( CTFObjectiveResource, CBaseTeamObjectiveResource );
  17. public:
  18. DECLARE_SERVERCLASS();
  19. DECLARE_DATADESC();
  20. CTFObjectiveResource();
  21. ~CTFObjectiveResource();
  22. virtual void Spawn( void );
  23. void SetMannVsMachineMaxWaveCount( int nCount ) { m_nMannVsMachineMaxWaveCount = nCount; }
  24. int GetMannVsMachineMaxWaveCount( void ) { return m_nMannVsMachineMaxWaveCount; }
  25. void SetMannVsMachineWaveCount( int nCount ) { m_nMannVsMachineWaveCount = nCount; }
  26. int GetMannVsMachineWaveCount( void ) { return m_nMannVsMachineWaveCount; }
  27. void SetMannVsMachineWaveEnemyCount( int nCount ) { m_nMannVsMachineWaveEnemyCount = nCount; }
  28. int GetMannVsMachineWaveEnemyCount( void ) { return m_nMannVsMachineWaveEnemyCount.Get(); }
  29. void AddMvMWorldMoney( int nCurrency ) { m_nMvMWorldMoney += nCurrency; }
  30. void SetMannVsMachineNextWaveTime( float flTime ) { m_flMannVsMachineNextWaveTime = flTime; }
  31. void SetMannVsMachineBetweenWaves( bool bVal ) { m_bMannVsMachineBetweenWaves = bVal; }
  32. bool GetMannVsMachineIsBetweenWaves( void ) { return m_bMannVsMachineBetweenWaves; }
  33. void SetMannVsMachineWaveClassCount( int nIndex, int nCount );
  34. void SetMannVsMachineWaveClassName( int nIndex, string_t iszClassIconName );
  35. void IncrementMannVsMachineWaveClassCount( string_t iszClassIconName, unsigned int iFlags );
  36. void DecrementMannVsMachineWaveClassCount( string_t iszClassIconName, unsigned int iFlags );
  37. void IncrementTeleporterCount();
  38. void DecrementTeleporterCount();
  39. int GetMannVsMachineWaveClassCount( int nIndex );
  40. void SetMannVsMachineWaveClassActive( string_t iszClassIconName, bool bActive = true );
  41. string_t GetMannVsMachineWaveClassName( int nIndex ) { return m_iszMannVsMachineWaveClassNames[ nIndex ]; }
  42. void ClearMannVsMachineWaveClassFlags( void );
  43. void AddMannVsMachineWaveClassFlags( int nIndex, unsigned int iFlags );
  44. unsigned int GetMannVsMachineWaveClassFlags( int nIndex ) { return m_nMannVsMachineWaveClassFlags[ nIndex ]; }
  45. void SetFlagCarrierUpgradeLevel( int nLevel ){ m_nFlagCarrierUpgradeLevel = nLevel; }
  46. int GetFlagCarrierUpgradeLevel( void ){ return m_nFlagCarrierUpgradeLevel; }
  47. void SetBaseMvMBombUpgradeTime( float nTime ){ m_flMvMBaseBombUpgradeTime = nTime; }
  48. float GetBaseMvMBombUpgradeTime( void ){ return m_flMvMBaseBombUpgradeTime; }
  49. void SetNextMvMBombUpgradeTime( float nTime ){ m_flMvMNextBombUpgradeTime = nTime; }
  50. float GetNextMvMBombUpgradeTime( void ) { return m_flMvMNextBombUpgradeTime; }
  51. void SetMannVsMachineChallengeIndex( int iIndex ) { m_iChallengeIndex = iIndex; }
  52. int GetMannVsMachineChallengeIndex( void ) { return m_iChallengeIndex; }
  53. void SetMvMPopfileName( string_t iszMvMPopfileName ) { m_iszMvMPopfileName = iszMvMPopfileName; }
  54. string_t GetMvMPopfileName( void ) const { return m_iszMvMPopfileName.Get(); }
  55. void SetMannVsMachineEventPopfileType( int nType ){ m_nMvMEventPopfileType.Set( nType ); }
  56. string_t GetTeleporterString() const { return m_teleporterString; }
  57. private:
  58. CNetworkVar( int, m_nMannVsMachineMaxWaveCount );
  59. CNetworkVar( int, m_nMannVsMachineWaveCount );
  60. CNetworkVar( int, m_nMannVsMachineWaveEnemyCount );
  61. CNetworkVar( int, m_nMvMWorldMoney );
  62. CNetworkVar( float, m_flMannVsMachineNextWaveTime );
  63. CNetworkVar( bool, m_bMannVsMachineBetweenWaves );
  64. CNetworkArray( int, m_nMannVsMachineWaveClassCounts, MVM_CLASS_TYPES_PER_WAVE_MAX );
  65. CNetworkArray( int, m_nMannVsMachineWaveClassCounts2, MVM_CLASS_TYPES_PER_WAVE_MAX );
  66. CNetworkArray( string_t, m_iszMannVsMachineWaveClassNames, MVM_CLASS_TYPES_PER_WAVE_MAX );
  67. CNetworkArray( string_t, m_iszMannVsMachineWaveClassNames2, MVM_CLASS_TYPES_PER_WAVE_MAX );
  68. CNetworkArray( unsigned int, m_nMannVsMachineWaveClassFlags, MVM_CLASS_TYPES_PER_WAVE_MAX );
  69. CNetworkArray( unsigned int, m_nMannVsMachineWaveClassFlags2, MVM_CLASS_TYPES_PER_WAVE_MAX );
  70. CNetworkArray( bool, m_bMannVsMachineWaveClassActive, MVM_CLASS_TYPES_PER_WAVE_MAX );
  71. CNetworkArray( bool, m_bMannVsMachineWaveClassActive2, MVM_CLASS_TYPES_PER_WAVE_MAX );
  72. CNetworkVar( int, m_nFlagCarrierUpgradeLevel );
  73. CNetworkVar( float, m_flMvMBaseBombUpgradeTime );
  74. CNetworkVar( float, m_flMvMNextBombUpgradeTime );
  75. CNetworkVar( int, m_iChallengeIndex );
  76. CNetworkVar( string_t, m_iszMvMPopfileName ) ;
  77. CNetworkVar( int, m_nMvMEventPopfileType );
  78. string_t m_teleporterString;
  79. };
  80. inline CTFObjectiveResource *TFObjectiveResource()
  81. {
  82. return static_cast< CTFObjectiveResource *>( g_pObjectiveResource );
  83. }
  84. #endif // TF_OBJECTIVE_RESOURCE_H