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(); UpdateVerts();
if( !pss.bFailed && !pss.bGaveUp ) if( !pss.bFailed )
{ {
// //
// Search for the min life record to show "Just Barely!" // 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); TapNote tn = m_NoteData.GetTapNote(t, iNoteRow);
if( tn.type != TapNote::empty && tn.result.tns == TNS_NONE ) if( tn.type != TapNote::empty && tn.result.tns == TNS_NONE )
{
Step( t, now ); Step( t, now );
STATSMAN->m_CurStageStats.bUsedAutoplay = true;
}
} }
} }
} }
+6 -3
View File
@@ -24,7 +24,6 @@ void PlayerStageStats::Init()
fAliveSeconds = 0; fAliveSeconds = 0;
bFailed = false; bFailed = false;
bFailedEarlier = false; bFailedEarlier = false;
bGaveUp = false;
iPossibleDancePoints = iCurPossibleDancePoints = iActualDancePoints = 0; iPossibleDancePoints = iCurPossibleDancePoints = iActualDancePoints = 0;
iPossibleGradePoints = 0; iPossibleGradePoints = 0;
iCurCombo = iMaxCombo = iCurMissCombo = iScore = iBonus = iMaxScore = iCurMaxScore = 0; iCurCombo = iMaxCombo = iCurMissCombo = iScore = iBonus = iMaxScore = iCurMaxScore = 0;
@@ -59,7 +58,6 @@ void PlayerStageStats::AddStats( const PlayerStageStats& other )
fAliveSeconds += other.fAliveSeconds; fAliveSeconds += other.fAliveSeconds;
bFailed |= other.bFailed; bFailed |= other.bFailed;
bFailedEarlier |= other.bFailedEarlier; bFailedEarlier |= other.bFailedEarlier;
bGaveUp |= other.bGaveUp;
iPossibleDancePoints += other.iPossibleDancePoints; iPossibleDancePoints += other.iPossibleDancePoints;
iActualDancePoints += other.iActualDancePoints; iActualDancePoints += other.iActualDancePoints;
iCurPossibleDancePoints += other.iCurPossibleDancePoints; iCurPossibleDancePoints += other.iCurPossibleDancePoints;
@@ -511,10 +509,15 @@ float PlayerStageStats::GetPercentageOfTaps( TapNoteScore tns ) const
return iTapNoteScores[tns] / (float)iTotalTaps; return iTapNoteScores[tns] / (float)iTotalTaps;
} }
void PlayerStageStats::CalcAwards( PlayerNumber p ) void PlayerStageStats::CalcAwards( PlayerNumber p, bool bGaveUp, bool bUsedAutoplay )
{ {
LOG->Trace( "hand out awards" ); LOG->Trace( "hand out awards" );
m_pcaToShow = PEAK_COMBO_AWARD_INVALID;
if( bGaveUp || bUsedAutoplay )
return;
deque<PerDifficultyAward> &vPdas = GAMESTATE->m_vLastPerDifficultyAwards[p]; deque<PerDifficultyAward> &vPdas = GAMESTATE->m_vLastPerDifficultyAwards[p];
LOG->Trace( "per difficulty awards" ); 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 /* 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. */ * point during the song. It's set in all fail modes. */
bool bFailedEarlier; bool bFailedEarlier;
bool bGaveUp; // exited gameplay by giving up
int iPossibleDancePoints; int iPossibleDancePoints;
int iCurPossibleDancePoints; int iCurPossibleDancePoints;
int iActualDancePoints; int iActualDancePoints;
@@ -106,7 +105,7 @@ public:
float GetSurvivalSeconds() { return fAliveSeconds + fLifeRemainingSeconds; } float GetSurvivalSeconds() { return fAliveSeconds + fLifeRemainingSeconds; }
// Final results: // Final results:
void CalcAwards( PlayerNumber p ); void CalcAwards( PlayerNumber p, bool bGaveUp, bool bUsedAutoplay );
PerDifficultyAward m_pdaToShow; PerDifficultyAward m_pdaToShow;
PeakComboAward m_pcaToShow; PeakComboAward m_pcaToShow;
+1 -1
View File
@@ -231,7 +231,7 @@ void ScreenEvaluation::Init()
STATSMAN->m_CurStageStats.CommitScores( SUMMARY ); STATSMAN->m_CurStageStats.CommitScores( SUMMARY );
FOREACH_HumanPlayer( p ) 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. // Run this here, so STATSMAN->m_CurStageStats is available to overlays.
ScreenWithMenuElements::Init(); ScreenWithMenuElements::Init();
+1 -1
View File
@@ -1831,9 +1831,9 @@ void ScreenGameplay::Update( float fDeltaTime )
{ {
// Give up // Give up
STATSMAN->m_CurStageStats.bGaveUp = true;
FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi ) FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi )
{ {
pi->GetPlayerStageStats()->bGaveUp = true;
pi->GetPlayerStageStats()->bFailed |= GAMESTATE->AllHumanHaveComboOf30OrMoreMisses(); pi->GetPlayerStageStats()->bFailed |= GAMESTATE->AllHumanHaveComboOf30OrMoreMisses();
} }
+7 -2
View File
@@ -23,6 +23,8 @@ StageStats::StageStats()
vpPlayedSongs.clear(); vpPlayedSongs.clear();
vpPossibleSongs.clear(); vpPossibleSongs.clear();
StageType = STAGE_INVALID; StageType = STAGE_INVALID;
bGaveUp = false;
bUsedAutoplay = false;
fGameplaySeconds = 0; fGameplaySeconds = 0;
fStepsSeconds = 0; fStepsSeconds = 0;
} }
@@ -88,6 +90,9 @@ void StageStats::AddStats( const StageStats& other )
vpPossibleSongs.push_back( *s ); vpPossibleSongs.push_back( *s );
StageType = STAGE_INVALID; // meaningless StageType = STAGE_INVALID; // meaningless
bGaveUp |= other.bGaveUp;
bUsedAutoplay |= other.bUsedAutoplay;
fGameplaySeconds += other.fGameplaySeconds; fGameplaySeconds += other.fGameplaySeconds;
fStepsSeconds += other.fStepsSeconds; fStepsSeconds += other.fStepsSeconds;
@@ -105,8 +110,8 @@ bool StageStats::OnePassed() const
bool StageStats::AllFailed() const bool StageStats::AllFailed() const
{ {
FOREACH_EnabledPlayer( pn ) FOREACH_EnabledPlayer( p )
if( !m_player[pn].bFailed ) if( !m_player[p].bFailed )
return false; return false;
return true; return true;
} }
+3
View File
@@ -33,6 +33,9 @@ public:
vector<Song*> vpPossibleSongs; vector<Song*> vpPossibleSongs;
enum { STAGE_INVALID, STAGE_NORMAL, STAGE_EXTRA, STAGE_EXTRA2 } StageType; 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. // TODO: These are updated in ScreenGameplay::Update based on fDelta.
// They should be made more accurate. // They should be made more accurate.
float fGameplaySeconds; // how many seconds before gameplay ended. Updated by Gameplay, not scaled by music rate. float fGameplaySeconds; // how many seconds before gameplay ended. Updated by Gameplay, not scaled by music rate.