allow display of negative dance points

stop counting dance points after fail
This commit is contained in:
Chris Danford
2004-01-12 06:45:36 +00:00
parent 5f10d10abb
commit 96a7cb0bcd
3 changed files with 23 additions and 3 deletions
+7 -2
View File
@@ -76,9 +76,14 @@ void PercentageDisplay::Refresh()
int iPercentRemainder = int( (fPercentDancePoints*100 - int(fPercentDancePoints*100)) * 10 );
sNumToDisplay = ssprintf( "%02d", iPercentWhole );
m_textPercentRemainder.SetText( ssprintf(".%01d%%", iPercentRemainder) );
} else {
float fNumToDisplay = max( 0, fPercentDancePoints*100 );
}
else
{
float fNumToDisplay = fPercentDancePoints*100;
sNumToDisplay = ssprintf( "%0*.*f%%", PERCENT_TOTAL_SIZE, PERCENT_DECIMAL_PLACES, fNumToDisplay );
// HACK: Use the last frame in the numbers texture as '-'
sNumToDisplay.Replace('-','x');
}
}
else
+12
View File
@@ -209,6 +209,9 @@ static int GetScore(int p, int B, int S, int n)
void ScoreKeeperMAX2::AddScore( TapNoteScore score )
{
if( g_CurStageStats.bFailed[m_PlayerNumber] )
return; // don't add
int &iScore = g_CurStageStats.iScore[m_PlayerNumber];
/*
http://www.aaroninjapan.com/ddr2.html
@@ -318,6 +321,9 @@ void ScoreKeeperMAX2::AddScore( TapNoteScore score )
void ScoreKeeperMAX2::HandleTapScore( TapNoteScore score )
{
if( g_CurStageStats.bFailed[m_PlayerNumber] )
return; // don't add
if( score == TNS_HIT_MINE )
{
g_CurStageStats.iActualDancePoints[m_PlayerNumber] += TapNoteScoreToDancePoints( TNS_HIT_MINE );
@@ -327,6 +333,9 @@ void ScoreKeeperMAX2::HandleTapScore( TapNoteScore score )
void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow )
{
if( g_CurStageStats.bFailed[m_PlayerNumber] )
return; // don't add
ASSERT( iNumTapsInRow >= 1 );
// Update dance points.
@@ -402,6 +411,9 @@ void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTa
void ScoreKeeperMAX2::HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore )
{
if( g_CurStageStats.bFailed[m_PlayerNumber] )
return; // don't add
// update dance points totals
g_CurStageStats.iHoldNoteScores[m_PlayerNumber][holdScore] ++;
g_CurStageStats.iActualDancePoints[m_PlayerNumber] += HoldNoteScoreToDancePoints( holdScore );
+4 -1
View File
@@ -256,8 +256,11 @@ float StageStats::GetPercentDancePoints( PlayerNumber pn ) const
if( iActualDancePoints[pn] == iPossibleDancePoints[pn] )
return 1; // correct for rounding error
ASSERT( iActualDancePoints[pn] <= iPossibleDancePoints[pn] );
float fPercentDancePoints = iActualDancePoints[pn] / (float)iPossibleDancePoints[pn];
return clamp( fPercentDancePoints, 0, 1 );
return fPercentDancePoints;
}
void StageStats::SetLifeRecord( PlayerNumber pn, float life, float pos )