Don't give awards if GaveUp or UsedAutoplay

Move bGaveUp into StageStats.  It's not really a per-player value.
This commit is contained in:
Chris Danford
2005-10-01 00:18:13 +00:00
parent bc6c7c89bc
commit fa2a5bddc3
8 changed files with 23 additions and 10 deletions
+1 -1
View File
@@ -214,7 +214,7 @@ void GraphDisplay::LoadFromStageStats( const StageStats &ss, const PlayerStageSt
UpdateVerts();
if( !pss.bFailed && !pss.bGaveUp )
if( !pss.bFailed )
{
//
// Search for the min life record to show "Just Barely!"
+3
View File
@@ -1567,7 +1567,10 @@ void Player::CrossedRow( int iNoteRow )
{
TapNote tn = m_NoteData.GetTapNote(t, iNoteRow);
if( tn.type != TapNote::empty && tn.result.tns == TNS_NONE )
{
Step( t, now );
STATSMAN->m_CurStageStats.bUsedAutoplay = true;
}
}
}
}
+6 -3
View File
@@ -24,7 +24,6 @@ void PlayerStageStats::Init()
fAliveSeconds = 0;
bFailed = false;
bFailedEarlier = false;
bGaveUp = false;
iPossibleDancePoints = iCurPossibleDancePoints = iActualDancePoints = 0;
iPossibleGradePoints = 0;
iCurCombo = iMaxCombo = iCurMissCombo = iScore = iBonus = iMaxScore = iCurMaxScore = 0;
@@ -59,7 +58,6 @@ void PlayerStageStats::AddStats( const PlayerStageStats& other )
fAliveSeconds += other.fAliveSeconds;
bFailed |= other.bFailed;
bFailedEarlier |= other.bFailedEarlier;
bGaveUp |= other.bGaveUp;
iPossibleDancePoints += other.iPossibleDancePoints;
iActualDancePoints += other.iActualDancePoints;
iCurPossibleDancePoints += other.iCurPossibleDancePoints;
@@ -511,10 +509,15 @@ float PlayerStageStats::GetPercentageOfTaps( TapNoteScore tns ) const
return iTapNoteScores[tns] / (float)iTotalTaps;
}
void PlayerStageStats::CalcAwards( PlayerNumber p )
void PlayerStageStats::CalcAwards( PlayerNumber p, bool bGaveUp, bool bUsedAutoplay )
{
LOG->Trace( "hand out awards" );
m_pcaToShow = PEAK_COMBO_AWARD_INVALID;
if( bGaveUp || bUsedAutoplay )
return;
deque<PerDifficultyAward> &vPdas = GAMESTATE->m_vLastPerDifficultyAwards[p];
LOG->Trace( "per difficulty awards" );
+1 -2
View File
@@ -39,7 +39,6 @@ public:
/* This indicates whether the player bottomed out his bar/ran out of lives at some
* point during the song. It's set in all fail modes. */
bool bFailedEarlier;
bool bGaveUp; // exited gameplay by giving up
int iPossibleDancePoints;
int iCurPossibleDancePoints;
int iActualDancePoints;
@@ -106,7 +105,7 @@ public:
float GetSurvivalSeconds() { return fAliveSeconds + fLifeRemainingSeconds; }
// Final results:
void CalcAwards( PlayerNumber p );
void CalcAwards( PlayerNumber p, bool bGaveUp, bool bUsedAutoplay );
PerDifficultyAward m_pdaToShow;
PeakComboAward m_pcaToShow;
+1 -1
View File
@@ -231,7 +231,7 @@ void ScreenEvaluation::Init()
STATSMAN->m_CurStageStats.CommitScores( SUMMARY );
FOREACH_HumanPlayer( p )
STATSMAN->m_CurStageStats.m_player[p].CalcAwards( p );
STATSMAN->m_CurStageStats.m_player[p].CalcAwards( p, STATSMAN->m_CurStageStats.bGaveUp, STATSMAN->m_CurStageStats.bUsedAutoplay );
// Run this here, so STATSMAN->m_CurStageStats is available to overlays.
ScreenWithMenuElements::Init();
+1 -1
View File
@@ -1831,9 +1831,9 @@ void ScreenGameplay::Update( float fDeltaTime )
{
// Give up
STATSMAN->m_CurStageStats.bGaveUp = true;
FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi )
{
pi->GetPlayerStageStats()->bGaveUp = true;
pi->GetPlayerStageStats()->bFailed |= GAMESTATE->AllHumanHaveComboOf30OrMoreMisses();
}
+7 -2
View File
@@ -23,6 +23,8 @@ StageStats::StageStats()
vpPlayedSongs.clear();
vpPossibleSongs.clear();
StageType = STAGE_INVALID;
bGaveUp = false;
bUsedAutoplay = false;
fGameplaySeconds = 0;
fStepsSeconds = 0;
}
@@ -87,6 +89,9 @@ void StageStats::AddStats( const StageStats& other )
FOREACH_CONST( Song*, other.vpPossibleSongs, s )
vpPossibleSongs.push_back( *s );
StageType = STAGE_INVALID; // meaningless
bGaveUp |= other.bGaveUp;
bUsedAutoplay |= other.bUsedAutoplay;
fGameplaySeconds += other.fGameplaySeconds;
fStepsSeconds += other.fStepsSeconds;
@@ -105,8 +110,8 @@ bool StageStats::OnePassed() const
bool StageStats::AllFailed() const
{
FOREACH_EnabledPlayer( pn )
if( !m_player[pn].bFailed )
FOREACH_EnabledPlayer( p )
if( !m_player[p].bFailed )
return false;
return true;
}
+3
View File
@@ -33,6 +33,9 @@ public:
vector<Song*> vpPossibleSongs;
enum { STAGE_INVALID, STAGE_NORMAL, STAGE_EXTRA, STAGE_EXTRA2 } StageType;
bool bGaveUp; // exited gameplay by giving up
bool bUsedAutoplay; // used autoplay at any point during gameplay
// TODO: These are updated in ScreenGameplay::Update based on fDelta.
// They should be made more accurate.
float fGameplaySeconds; // how many seconds before gameplay ended. Updated by Gameplay, not scaled by music rate.