change "total high score dance points" to "percent complete"

This commit is contained in:
Chris Danford
2004-05-02 18:49:41 +00:00
parent 1dbcca2741
commit 741ab63c14
4 changed files with 85 additions and 15 deletions
+64 -7
View File
@@ -201,6 +201,60 @@ int Profile::GetTotalNumSongsPassed() const
return iTotal; return iTotal;
} }
int Profile::GetTotalPossibleDancePointsForStepsType( StepsType st ) const
{
int iTotal = 0;
// add steps high scores
{
const vector<Song*> vSongs = SONGMAN->GetAllSongs();
for( unsigned i=0; i<vSongs.size(); i++ )
{
Song* pSong = vSongs[i];
if( pSong->m_SelectionDisplay == Song::SHOW_NEVER )
continue; // skip
vector<Steps*> vSteps = pSong->GetAllSteps();
for( unsigned j=0; j<vSteps.size(); j++ )
{
Steps* pSteps = vSteps[j];
if( pSteps->m_StepsType != st )
continue; // skip
const RadarValues& fRadars = pSteps->GetRadarValues();
iTotal += ScoreKeeperMAX2::GetPossibleDancePoints( fRadars );
}
}
}
// add course high scores
{
vector<Course*> vCourses;
SONGMAN->GetAllCourses( vCourses, false );
for( unsigned i=0; i<vCourses.size(); i++ )
{
const Course* pCourse = vCourses[i];
// Don't count any course that has any entries that change over time.
if( !pCourse->AllSongsAreFixed() )
continue;
FOREACH_CourseDifficulty( cd )
{
if( !pCourse->HasCourseDifficulty(st,cd) )
continue;
const RadarValues& fRadars = pCourse->GetRadarValues(st,cd);
iTotal += ScoreKeeperMAX2::GetPossibleDancePoints( fRadars );
}
}
}
return iTotal;
}
int Profile::GetTotalHighScoreDancePointsForStepsType( StepsType st ) const int Profile::GetTotalHighScoreDancePointsForStepsType( StepsType st ) const
{ {
int iTotal = 0; int iTotal = 0;
@@ -214,6 +268,9 @@ int Profile::GetTotalHighScoreDancePointsForStepsType( StepsType st ) const
SongID id = i->first; SongID id = i->first;
Song* pSong = id.ToSong(); Song* pSong = id.ToSong();
if( pSong->m_SelectionDisplay == Song::SHOW_NEVER )
continue; // skip
// If the Song isn't loaded on the current machine, then we can't // If the Song isn't loaded on the current machine, then we can't
// get radar values to compute dance points. // get radar values to compute dance points.
if( pSong == NULL ) if( pSong == NULL )
@@ -233,14 +290,15 @@ int Profile::GetTotalHighScoreDancePointsForStepsType( StepsType st ) const
if( pSteps == NULL ) if( pSteps == NULL )
continue; continue;
if( pSteps->m_StepsType != st )
continue;
const HighScoresForASteps& h = j->second; const HighScoresForASteps& h = j->second;
const HighScoreList& hs = h.hs; const HighScoreList& hs = h.hs;
if( pSteps->m_StepsType == st )
{ const RadarValues& fRadars = pSteps->GetRadarValues();
const RadarValues& fRadars = pSteps->GetRadarValues(); int iPossibleDP = ScoreKeeperMAX2::GetPossibleDancePoints( fRadars );
int iPossibleDP = ScoreKeeperMAX2::GetPossibleDancePoints( fRadars ); iTotal += (int)truncf( hs.GetTopScore().fPercentDP * iPossibleDP );
iTotal += (int)truncf( hs.GetTopScore().fPercentDP * iPossibleDP );
}
} }
} }
} }
@@ -274,7 +332,6 @@ int Profile::GetTotalHighScoreDancePointsForStepsType( StepsType st ) const
} }
} }
return iTotal; return iTotal;
} }
+1
View File
@@ -73,6 +73,7 @@ public:
int GetTotalNumSongsPlayed() const; int GetTotalNumSongsPlayed() const;
int GetTotalNumSongsPassed() const; int GetTotalNumSongsPassed() const;
int GetTotalHighScoreDancePointsForStepsType( StepsType st ) const; int GetTotalHighScoreDancePointsForStepsType( StepsType st ) const;
int GetTotalPossibleDancePointsForStepsType( StepsType st ) const;
static CString GetProfileDisplayNameFromDir( CString sDir ); static CString GetProfileDisplayNameFromDir( CString sDir );
int GetSongNumTimesPlayed( const Song* pSong ) const; int GetSongNumTimesPlayed( const Song* pSong ) const;
int GetSongNumTimesPlayed( const SongID& songID ) const; int GetSongNumTimesPlayed( const SongID& songID ) const;
+11 -7
View File
@@ -37,7 +37,7 @@
CString GetStatsLineTitle( PlayerNumber pn, int iLine ) CString GetStatsLineTitle( PlayerNumber pn, int iLine )
{ {
static const CString s[NUM_ENDING_STATS_LINES] = { static const CString s[NUM_ENDING_STATS_LINES] = {
"Total %s Points", "%s Percent Complete",
"Total Calories", "Total Calories",
"Total Songs Played", "Total Songs Played",
"Current Combo", "Current Combo",
@@ -54,10 +54,14 @@ CString GetStatsLineValue( PlayerNumber pn, int iLine )
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType; StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
switch( iLine ) switch( iLine )
{ {
case 0: return Commify( pProfile->GetTotalHighScoreDancePointsForStepsType(st) ); case PERCENT_COMPLETE:
case 1: return pProfile->GetDisplayTotalCaloriesBurned(); {
case 2: return Commify( pProfile->GetTotalNumSongsPlayed() ); double fPercent = 100.0 * pProfile->GetTotalHighScoreDancePointsForStepsType(st) / (double)pProfile->GetTotalPossibleDancePointsForStepsType(st);
case 3: return Commify( pProfile->m_iCurrentCombo ); return ssprintf( "%02.4f%%", fPercent );
}
case TOTAL_CALORIES: return pProfile->GetDisplayTotalCaloriesBurned();
case TOTAL_SONGS_PLAYED: return Commify( pProfile->GetTotalNumSongsPlayed() );
case CURRENT_COMBO: return Commify( pProfile->m_iCurrentCombo );
default: ASSERT(0); return ""; default: ASSERT(0); return "";
} }
} }
@@ -69,14 +73,14 @@ ScreenEnding::ScreenEnding( CString sClassName ) : ScreenAttract( sClassName, fa
SONGMAN->GetSongs( arraySongs ); SONGMAN->GetSongs( arraySongs );
SongUtil::SortSongPointerArrayByTitle( arraySongs ); SongUtil::SortSongPointerArrayByTitle( arraySongs );
for( int p=0; p<NUM_PLAYERS; p++ ) FOREACH_PlayerNumber( p )
{ {
m_bWaitingForRemoveCard[p] = false; m_bWaitingForRemoveCard[p] = false;
if( !GAMESTATE->IsHumanPlayer(p) ) if( !GAMESTATE->IsHumanPlayer(p) )
continue; // skip continue; // skip
Profile* pProfile = PROFILEMAN->GetProfile( (PlayerNumber)p ); Profile* pProfile = PROFILEMAN->GetProfile( p );
m_textPlayerName[p].LoadFromFont( THEME->GetPathToF("ScreenEnding player name") ); m_textPlayerName[p].LoadFromFont( THEME->GetPathToF("ScreenEnding player name") );
m_textPlayerName[p].SetText( pProfile ? pProfile->GetDisplayName() : "NO CARD" ); m_textPlayerName[p].SetText( pProfile ? pProfile->GetDisplayName() : "NO CARD" );
+9 -1
View File
@@ -13,6 +13,15 @@
#include "BitmapText.h" #include "BitmapText.h"
#include "ScreenAttract.h" #include "ScreenAttract.h"
enum EndingStatsLine
{
PERCENT_COMPLETE,
TOTAL_CALORIES,
TOTAL_SONGS_PLAYED,
CURRENT_COMBO,
NUM_ENDING_STATS_LINES
};
class ScreenEnding : public ScreenAttract class ScreenEnding : public ScreenAttract
{ {
public: public:
@@ -24,7 +33,6 @@ public:
private: private:
BitmapText m_textPlayerName[NUM_PLAYERS]; BitmapText m_textPlayerName[NUM_PLAYERS];
#define NUM_ENDING_STATS_LINES 4
BitmapText m_textStatsTitle[NUM_PLAYERS][NUM_ENDING_STATS_LINES]; BitmapText m_textStatsTitle[NUM_PLAYERS][NUM_ENDING_STATS_LINES];
BitmapText m_textStatsValue[NUM_PLAYERS][NUM_ENDING_STATS_LINES]; BitmapText m_textStatsValue[NUM_PLAYERS][NUM_ENDING_STATS_LINES];