mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-08 01:39:36 +00:00
add source-sdk-2013
This commit is contained in:
@@ -44,14 +44,6 @@
|
||||
#define ROUND_SETUP_2SECS "Announcer.RoundBegins2Seconds"
|
||||
#define ROUND_SETUP_1SECS "Announcer.RoundBegins1Seconds"
|
||||
|
||||
#ifdef TF_CLIENT_DLL
|
||||
#define MERASMUS_SETUP_5SECS "Merasmus.RoundBegins5Seconds"
|
||||
#define MERASMUS_SETUP_4SECS "Merasmus.RoundBegins4Seconds"
|
||||
#define MERASMUS_SETUP_3SECS "Merasmus.RoundBegins3Seconds"
|
||||
#define MERASMUS_SETUP_2SECS "Merasmus.RoundBegins2Seconds"
|
||||
#define MERASMUS_SETUP_1SECS "Merasmus.RoundBegins1Seconds"
|
||||
#endif
|
||||
|
||||
#define ROUND_START_BELL "Ambient.Siren"
|
||||
|
||||
#define ROUND_TIMER_TIME_ADDED "Announcer.TimeAdded"
|
||||
@@ -253,7 +245,6 @@ CTeamRoundTimer::CTeamRoundTimer( void )
|
||||
m_bResetTimeOnRoundStart = false;
|
||||
m_nTimeToUseAfterSetupFinished = 0;
|
||||
m_flNextOvertimeNag = 0;
|
||||
m_flLastTime = 0.f;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -291,14 +282,6 @@ void CTeamRoundTimer::Precache( void )
|
||||
PrecacheScriptSound( ROUND_TIMER_TIME_ADDED_LOSER );
|
||||
PrecacheScriptSound( ROUND_TIMER_TIME_ADDED_WINNER );
|
||||
PrecacheScriptSound( ROUND_START_BELL );
|
||||
|
||||
#ifdef TF_CLIENT_DLL
|
||||
PrecacheScriptSound( MERASMUS_SETUP_5SECS );
|
||||
PrecacheScriptSound( MERASMUS_SETUP_4SECS );
|
||||
PrecacheScriptSound( MERASMUS_SETUP_3SECS );
|
||||
PrecacheScriptSound( MERASMUS_SETUP_2SECS );
|
||||
PrecacheScriptSound( MERASMUS_SETUP_1SECS );
|
||||
#endif // TF_CLIENT_DLL
|
||||
#endif // TF_DLL || TF_CLIENT_DLL
|
||||
}
|
||||
|
||||
@@ -591,16 +574,7 @@ const char *CTeamRoundTimer::GetTimeWarningSound( int nWarning )
|
||||
case RT_WARNING_5SECS:
|
||||
if ( m_nState == RT_STATE_SETUP )
|
||||
{
|
||||
#ifdef TF_CLIENT_DLL
|
||||
if ( TFGameRules() && TFGameRules()->IsHalloweenScenario( CTFGameRules::HALLOWEEN_SCENARIO_DOOMSDAY ) )
|
||||
{
|
||||
pszRetVal = MERASMUS_SETUP_5SECS;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
pszRetVal = ROUND_SETUP_5SECS;
|
||||
}
|
||||
pszRetVal = ROUND_SETUP_5SECS;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -610,16 +584,7 @@ const char *CTeamRoundTimer::GetTimeWarningSound( int nWarning )
|
||||
case RT_WARNING_4SECS:
|
||||
if ( m_nState == RT_STATE_SETUP )
|
||||
{
|
||||
#ifdef TF_CLIENT_DLL
|
||||
if ( TFGameRules() && TFGameRules()->IsHalloweenScenario( CTFGameRules::HALLOWEEN_SCENARIO_DOOMSDAY ) )
|
||||
{
|
||||
pszRetVal = MERASMUS_SETUP_4SECS;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
pszRetVal = ROUND_SETUP_4SECS;
|
||||
}
|
||||
pszRetVal = ROUND_SETUP_4SECS;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -629,16 +594,7 @@ const char *CTeamRoundTimer::GetTimeWarningSound( int nWarning )
|
||||
case RT_WARNING_3SECS:
|
||||
if ( m_nState == RT_STATE_SETUP )
|
||||
{
|
||||
#ifdef TF_CLIENT_DLL
|
||||
if ( TFGameRules() && TFGameRules()->IsHalloweenScenario( CTFGameRules::HALLOWEEN_SCENARIO_DOOMSDAY ) )
|
||||
{
|
||||
pszRetVal = MERASMUS_SETUP_3SECS;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
pszRetVal = ROUND_SETUP_3SECS;
|
||||
}
|
||||
pszRetVal = ROUND_SETUP_3SECS;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -648,16 +604,7 @@ const char *CTeamRoundTimer::GetTimeWarningSound( int nWarning )
|
||||
case RT_WARNING_2SECS:
|
||||
if ( m_nState == RT_STATE_SETUP )
|
||||
{
|
||||
#ifdef TF_CLIENT_DLL
|
||||
if ( TFGameRules() && TFGameRules()->IsHalloweenScenario( CTFGameRules::HALLOWEEN_SCENARIO_DOOMSDAY ) )
|
||||
{
|
||||
pszRetVal = MERASMUS_SETUP_2SECS;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
pszRetVal = ROUND_SETUP_2SECS;
|
||||
}
|
||||
pszRetVal = ROUND_SETUP_2SECS;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -667,16 +614,7 @@ const char *CTeamRoundTimer::GetTimeWarningSound( int nWarning )
|
||||
case RT_WARNING_1SECS:
|
||||
if ( m_nState == RT_STATE_SETUP )
|
||||
{
|
||||
#ifdef TF_CLIENT_DLL
|
||||
if ( TFGameRules() && TFGameRules()->IsHalloweenScenario( CTFGameRules::HALLOWEEN_SCENARIO_DOOMSDAY ) )
|
||||
{
|
||||
pszRetVal = MERASMUS_SETUP_1SECS;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
pszRetVal = ROUND_SETUP_1SECS;
|
||||
}
|
||||
pszRetVal = ROUND_SETUP_1SECS;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -843,9 +781,6 @@ void CTeamRoundTimer::SetTimerThink( int nType )
|
||||
//-----------------------------------------------------------------------------
|
||||
void CTeamRoundTimer::RoundTimerSetupThink( void )
|
||||
{
|
||||
float flLastTime = m_flLastTime;
|
||||
m_flLastTime = GetTimeRemaining();
|
||||
|
||||
if ( TeamplayRoundBasedRules()->IsInPreMatch() == true && IsDisabled() == false )
|
||||
{
|
||||
inputdata_t data;
|
||||
@@ -862,22 +797,6 @@ void CTeamRoundTimer::RoundTimerSetupThink( void )
|
||||
float flTime = GetTimeRemaining();
|
||||
TeamplayRoundBasedRules()->SetOvertime( false );
|
||||
|
||||
if ( m_flLastTime > 0.f )
|
||||
{
|
||||
int nLastSecond = floor( flLastTime );
|
||||
int nThisSecond = floor( flTime );
|
||||
|
||||
if ( nLastSecond != nThisSecond )
|
||||
{
|
||||
IGameEvent *event = gameeventmanager->CreateEvent( "teamplay_pre_round_time_left" );
|
||||
if ( event )
|
||||
{
|
||||
event->SetInt( "time", nThisSecond );
|
||||
gameeventmanager->FireEvent( event );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( flTime <= 0.0f && m_bFireFinished )
|
||||
{
|
||||
IGameEvent *event = gameeventmanager->CreateEvent( "teamplay_setup_finished" );
|
||||
@@ -889,8 +808,8 @@ void CTeamRoundTimer::RoundTimerSetupThink( void )
|
||||
m_OnSetupFinished.FireOutput( this, this );
|
||||
m_bFireFinished = false;
|
||||
|
||||
SetState( RT_STATE_NORMAL );
|
||||
SetTimeRemaining( m_nTimeToUseAfterSetupFinished );
|
||||
SetState( RT_STATE_NORMAL );
|
||||
|
||||
if ( ShowInHud() && !TeamplayRoundBasedRules()->IsInWaitingForPlayers() )
|
||||
{
|
||||
@@ -1109,8 +1028,8 @@ void CTeamRoundTimer::InputRoundSpawn( inputdata_t &input )
|
||||
|
||||
if ( m_nSetupTimeLength > 0 )
|
||||
{
|
||||
SetState( RT_STATE_SETUP );
|
||||
SetTimeRemaining( m_nSetupTimeLength );
|
||||
SetState( RT_STATE_SETUP );
|
||||
|
||||
if ( ShowInHud() && !TeamplayRoundBasedRules()->IsInWaitingForPlayers() )
|
||||
{
|
||||
@@ -1119,8 +1038,8 @@ void CTeamRoundTimer::InputRoundSpawn( inputdata_t &input )
|
||||
}
|
||||
else
|
||||
{
|
||||
SetState( RT_STATE_NORMAL );
|
||||
SetTimeRemaining( m_nTimeToUseAfterSetupFinished );
|
||||
SetState( RT_STATE_NORMAL );
|
||||
}
|
||||
|
||||
if ( !m_bStartPaused && !TeamplayRoundBasedRules()->IsInWaitingForPlayers() )
|
||||
@@ -1138,23 +1057,15 @@ void CTeamRoundTimer::SetTimeRemaining( int iTimerSeconds )
|
||||
return;
|
||||
|
||||
// make sure we don't go over our max length
|
||||
iTimerSeconds = m_nTimerMaxLength > 0 ? MIN( iTimerSeconds, m_nTimerMaxLength ) : iTimerSeconds;
|
||||
|
||||
float flTimerSeconds = (float)iTimerSeconds;
|
||||
if ( TeamplayRoundBasedRules()->IsInTournamentMode() && TeamplayRoundBasedRules()->IsInStopWatch() && ObjectiveResource() && !IsStopWatchTimer() && !TeamplayRoundBasedRules()->InSetup() )
|
||||
if ( m_nTimerMaxLength > 0 )
|
||||
{
|
||||
// make sure we don't go over our stop watch timer
|
||||
int iStopWatchTimer = ObjectiveResource()->GetStopWatchTimer();
|
||||
CTeamRoundTimer *pStopWatch = dynamic_cast< CTeamRoundTimer* >( UTIL_EntityByIndex( iStopWatchTimer ) );
|
||||
if ( pStopWatch && !pStopWatch->IsWatchingTimeStamps() && TeamplayRoundBasedRules()->StopWatchShouldBeTimedWin() )
|
||||
if ( iTimerSeconds > m_nTimerMaxLength )
|
||||
{
|
||||
float flStopWatchRemainingTime = pStopWatch->GetTimeRemaining();
|
||||
flTimerSeconds = flStopWatchRemainingTime > 0 ? MIN( flTimerSeconds, flStopWatchRemainingTime ) : flTimerSeconds;
|
||||
iTimerSeconds = (int)ceil( flTimerSeconds );
|
||||
iTimerSeconds = m_nTimerMaxLength;
|
||||
}
|
||||
}
|
||||
|
||||
m_flTimeRemaining = flTimerSeconds;
|
||||
m_flTimeRemaining = (float)iTimerSeconds;
|
||||
m_flTimerEndTime = gpGlobals->curtime + m_flTimeRemaining;
|
||||
m_nTimerLength = iTimerSeconds;
|
||||
|
||||
@@ -1246,32 +1157,13 @@ void CTeamRoundTimer::AddTimerSeconds( int iSecondsToAdd, int iTeamResponsible /
|
||||
}
|
||||
}
|
||||
|
||||
float flSecondsToAdd = (float)iSecondsToAdd;
|
||||
if ( TeamplayRoundBasedRules()->IsInTournamentMode() && TeamplayRoundBasedRules()->IsInStopWatch() && ObjectiveResource() && !IsStopWatchTimer() && !TeamplayRoundBasedRules()->InSetup() )
|
||||
{
|
||||
int iStopWatchTimer = ObjectiveResource()->GetStopWatchTimer();
|
||||
CTeamRoundTimer *pStopWatch = dynamic_cast< CTeamRoundTimer* >( UTIL_EntityByIndex( iStopWatchTimer ) );
|
||||
if ( pStopWatch && !pStopWatch->IsWatchingTimeStamps() && TeamplayRoundBasedRules()->StopWatchShouldBeTimedWin() )
|
||||
{
|
||||
float flStopWatchRemainingTime = pStopWatch->GetTimeRemaining();
|
||||
float flRemainingTime = GetTimeRemaining();
|
||||
// will adding this many seconds push us over our stop watch timer?
|
||||
if ( flRemainingTime + flSecondsToAdd > flStopWatchRemainingTime )
|
||||
{
|
||||
// adjust to only add up to our stop watch timer
|
||||
flSecondsToAdd = flStopWatchRemainingTime - flRemainingTime;
|
||||
iSecondsToAdd = ( int )ceil( flSecondsToAdd );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_bTimerPaused )
|
||||
{
|
||||
m_flTimeRemaining += flSecondsToAdd;
|
||||
m_flTimeRemaining += (float)iSecondsToAdd;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_flTimerEndTime += flSecondsToAdd;
|
||||
m_flTimerEndTime += (float)iSecondsToAdd;
|
||||
}
|
||||
|
||||
m_nTimerLength += iSecondsToAdd;
|
||||
@@ -1399,14 +1291,14 @@ void CTeamRoundTimer::InputAddTeamTime( inputdata_t &input )
|
||||
|
||||
// get the team
|
||||
p = nexttoken( token, p, ' ' );
|
||||
if ( token[0] )
|
||||
if ( token )
|
||||
{
|
||||
nTeam = Q_atoi( token );
|
||||
}
|
||||
|
||||
// get the time
|
||||
p = nexttoken( token, p, ' ' );
|
||||
if ( token[0] )
|
||||
if ( token )
|
||||
{
|
||||
nSeconds = Q_atoi( token );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user