diff options
Diffstat (limited to 'mp/src/game/shared/teamplayroundbased_gamerules.h')
| -rw-r--r-- | mp/src/game/shared/teamplayroundbased_gamerules.h | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/mp/src/game/shared/teamplayroundbased_gamerules.h b/mp/src/game/shared/teamplayroundbased_gamerules.h index ddf6e791..95060d3d 100644 --- a/mp/src/game/shared/teamplayroundbased_gamerules.h +++ b/mp/src/game/shared/teamplayroundbased_gamerules.h @@ -12,6 +12,7 @@ #include "teamplay_gamerules.h" #include "teamplay_round_timer.h" +#include "GameEventListener.h" #ifdef GAME_DLL #include "team_control_point.h" @@ -162,7 +163,7 @@ public: //----------------------------------------------------------------------------- // Purpose: Teamplay game rules that manage a round based structure for you //----------------------------------------------------------------------------- -class CTeamplayRoundBasedRules : public CTeamplayRules +class CTeamplayRoundBasedRules : public CTeamplayRules, public CGameEventListener { DECLARE_CLASS( CTeamplayRoundBasedRules, CTeamplayRules ); public: @@ -248,7 +249,7 @@ public: void SetMultipleTrains( bool bMultipleTrains ){ m_bMultipleTrains = bMultipleTrains; } bool HasMultipleTrains( void ){ return m_bMultipleTrains; } - virtual int GetBonusRoundTime( void ); + virtual int GetBonusRoundTime( bool bFinal = false ); #if defined(TF_CLIENT_DLL) || defined(TF_DLL) @@ -258,10 +259,15 @@ public: // Get list of players who are on the defending team now, or are likely // to end up on the defending team (not yet connected or assigned a team) - void GetMvMPotentialDefendersLobbyPlayerInfo( CUtlVector<LobbyPlayerInfo_t> &vecMvmDefenders, bool bIncludeBots = false ); + void GetPotentialPlayersLobbyPlayerInfo( CUtlVector<LobbyPlayerInfo_t> &vecLobbyPlayers, bool bIncludeBots = false ); #endif + void SetAllowBetweenRounds( bool bValue ) { m_bAllowBetweenRounds = bValue; } + +public: // IGameEventListener Interface + virtual void FireGameEvent( IGameEvent * event ); + //---------------------------------------------------------------------------------- // Server specific #ifdef GAME_DLL @@ -309,7 +315,7 @@ public: virtual bool ShouldScorePerRound( void ){ return true; } - bool CheckNextLevelCvar( void ); + bool CheckNextLevelCvar( bool bAllowEnd = true ); virtual bool TimerMayExpire( void ); @@ -332,7 +338,7 @@ public: bool IsPreviouslyPlayedRound ( string_t strName ); string_t GetLastPlayedRound( void ); - virtual void SetWinningTeam( int team, int iWinReason, bool bForceMapReset = true, bool bSwitchTeams = false, bool bDontAddScore = false ); + virtual void SetWinningTeam( int team, int iWinReason, bool bForceMapReset = true, bool bSwitchTeams = false, bool bDontAddScore = false, bool bFinal = false ) OVERRIDE; virtual void SetStalemate( int iReason, bool bForceMapReset = true, bool bSwitchTeams = false ); virtual void SetRoundOverlayDetails( void ){ return; } @@ -365,10 +371,11 @@ public: { m_bPlayerReady.Set( iIndex, bState ); } + void ResetPlayerAndTeamReadyState( void ); virtual void PlayTrainCaptureAlert( CTeamControlPoint *pPoint, bool bFinalPointInMap ){ return; } - virtual void PlaySpecialCapSounds( int iCappingTeam ){ return; } + virtual void PlaySpecialCapSounds( int iCappingTeam, CTeamControlPoint *pPoint ){ return; } bool PlayThrottledAlert( int iTeam, const char *sound, float fDelayBeforeNext ); @@ -393,14 +400,15 @@ protected: void CheckWaitingForPlayers( void ); virtual bool AllowWaitingForPlayers( void ) { return true; } void CheckRestartRound( void ); - bool CheckTimeLimit( void ); + bool CheckTimeLimit( bool bAllowEnd = true ); int GetTimeLeft( void ); - virtual bool CheckWinLimit( void ); - bool CheckMaxRounds( void ); + virtual bool CheckWinLimit( bool bAllowEnd = true ); + bool CheckMaxRounds( bool bAllowEnd = true ); void CheckReadyRestart( void ); #if defined(TF_CLIENT_DLL) || defined(TF_DLL) - bool AreDefendingPlayersReady(); + bool AreLobbyPlayersOnTeamReady( int iTeam ); + bool AreLobbyPlayersConnected( void ); #endif virtual bool CanChangelevelBecauseOfTimeLimit( void ) { return true; } @@ -479,6 +487,8 @@ protected: bool MapHasActiveTimer( void ); void CreateTimeLimitTimer( void ); + virtual float GetLastMajorEventTime( void ) OVERRIDE { return m_flLastTeamWin; } + protected: CGameRulesRoundStateInfo *m_pCurStateInfo; // Per-state data float m_flStateTransitionTime; // Timer for round states @@ -521,10 +531,13 @@ protected: gamerules_roundstate_t m_prevState; + bool m_bPlayerReadyBefore[MAX_PLAYERS+1]; // Test to see if a player has hit ready before + + float m_flLastTeamWin; + private: CUtlMap < int, int > m_GameTeams; // Team index, Score - #endif // End server specific //---------------------------------------------------------------------------------- @@ -582,6 +595,9 @@ private: int m_nAutoBalanceQueuePlayerIndex; int m_nAutoBalanceQueuePlayerScore; +protected: + bool m_bAllowBetweenRounds; + public: float m_flStopWatchTotalTime; |