本文整理汇总了C++中CTeamControlPointMaster::PlayingMiniRounds方法的典型用法代码示例。如果您正苦于以下问题:C++ CTeamControlPointMaster::PlayingMiniRounds方法的具体用法?C++ CTeamControlPointMaster::PlayingMiniRounds怎么用?C++ CTeamControlPointMaster::PlayingMiniRounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTeamControlPointMaster
的用法示例。
在下文中一共展示了CTeamControlPointMaster::PlayingMiniRounds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WatcherThink
//.........这里部分代码省略.........
Assert( !"No path distance in team_train_watcher\n" );
m_flTotalPathDistance = 1;
}
m_flTotalProgress = clamp( 1.0 - ( flDistanceToGoal / m_flTotalPathDistance ), 0.0, 1.0 );
m_flTrainDistanceFromStart = m_flTotalPathDistance - flDistanceToGoal;
// play alert sounds if necessary
for ( int iCount = 0 ; iCount < m_iNumCPLinks ; iCount++ )
{
if ( m_flTrainDistanceFromStart < m_CPLinks[iCount].flDistanceFromStart - TEAM_TRAIN_ALERT_DISTANCE )
{
// back up twice the alert distance before resetting our flag to play the warning again
if ( ( m_flTrainDistanceFromStart < m_CPLinks[iCount].flDistanceFromStart - ( TEAM_TRAIN_ALERT_DISTANCE * 2 ) ) || // has receded back twice the alert distance or...
( !m_bTrainCanRecede ) ) // used to catch the case where the train doesn't normally recede but has rolled back down a hill away from the CP
{
// reset our alert flag
m_CPLinks[iCount].bAlertPlayed = false;
}
}
else
{
if ( m_flTrainDistanceFromStart < m_CPLinks[iCount].flDistanceFromStart && !m_CPLinks[iCount].bAlertPlayed )
{
m_CPLinks[iCount].bAlertPlayed = true;
bool bFinalPointInMap = false;
CTeamControlPoint *pCurrentPoint = m_CPLinks[iCount].hCP.Get();
CTeamControlPointMaster *pMaster = g_hControlPointMasters.Count() ? g_hControlPointMasters[0] : NULL;
if ( pMaster )
{
// if we're not playing mini-rounds
if ( !pMaster->PlayingMiniRounds() )
{
for ( int i = FIRST_GAME_TEAM ; i < MAX_CONTROL_POINT_TEAMS ; i++ )
{
if ( ObjectiveResource() && ObjectiveResource()->TeamCanCapPoint( pCurrentPoint->GetPointIndex(), i ) )
{
if ( pMaster->WouldNewCPOwnerWinGame( pCurrentPoint, i ) )
{
bFinalPointInMap = true;
}
}
}
}
else
{
// or this is the last round
if ( pMaster->NumPlayableControlPointRounds() == 1 )
{
CTeamControlPointRound *pRound = pMaster->GetCurrentRound();
if ( pRound )
{
for ( int i = FIRST_GAME_TEAM ; i < MAX_CONTROL_POINT_TEAMS ; i++ )
{
if ( ObjectiveResource() && ObjectiveResource()->TeamCanCapPoint( pCurrentPoint->GetPointIndex(), i ) )
{
if ( pRound->WouldNewCPOwnerWinGame( pCurrentPoint, i ) )
{
bFinalPointInMap = true;
}
}
}
}
}