diff --git a/stepmania/src/ScoreKeeper5th.cpp b/stepmania/src/ScoreKeeper5th.cpp index 2396021287..03707a185a 100644 --- a/stepmania/src/ScoreKeeper5th.cpp +++ b/stepmania/src/ScoreKeeper5th.cpp @@ -59,6 +59,7 @@ ScoreKeeper5th::ScoreKeeper5th( const vector& apNotes_, PlayerNumber pn_ m_iCurToastyCombo = 0; m_iMaxScoreSoFar = 0; m_iPointBonus = 0; + m_iComboBonus = 0; m_iNumTapsAndHolds = 0; m_bIsLastSongInCourse = false; } @@ -203,8 +204,29 @@ void ScoreKeeper5th::AddScore( TapNoteScore score ) case TNS_GREAT: m_iScore += 5; break; } else + { m_iScore += GetScore(p, B, sum, m_iTapNotesHit); + if (!GAMESTATE->IsCourseMode()) + { + // handle combo bonus + + // combo hasn't been updated yet, its one bigger than it really is + int m_iCurrentCombo = GAMESTATE->m_CurStageStats.iCurCombo[m_PlayerNumber] + 1; + + switch( score ) + { + case TNS_MARVELOUS: + case TNS_PERFECT: + m_iComboBonus += 55 * m_iCurrentCombo; + break; + case TNS_GREAT: + m_iComboBonus += 33 * m_iCurrentCombo; + } + GAMESTATE->m_CurStageStats.iBonus[m_PlayerNumber] = m_iComboBonus; + } + } + /* Subtract the maximum this step could have been worth from the bonus. */ m_iPointBonus -= GetScore(10, B, sum, m_iTapNotesHit); diff --git a/stepmania/src/ScoreKeeper5th.h b/stepmania/src/ScoreKeeper5th.h index 19b36d3cbd..9525e09e07 100644 --- a/stepmania/src/ScoreKeeper5th.h +++ b/stepmania/src/ScoreKeeper5th.h @@ -24,6 +24,7 @@ class ScoreKeeper5th: public ScoreKeeper int m_iNumTapsAndHolds; int m_iMaxScoreSoFar; // for nonstop scoring + int m_iComboBonus; // 5th-mix combo bonus at end int m_iPointBonus; // the difference to award at the end int m_iCurToastyCombo; bool m_bIsLastSongInCourse; diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index 60fa2e0ed0..7858d363f2 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -131,6 +131,12 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type ) : Screen(sCl grade[p] = stageStats.GetGrade( (PlayerNumber)p ); else grade[p] = GRADE_E; + + if (PREFSMAN->m_iScoringType == PrefsManager::SCORING_5TH) + { + int ScoreBonuses[9] = {0, 0, 100, 1000, 10000, 100000, 1000000, 10000000, 10000000}; + GAMESTATE->m_CurStageStats.iBonus[p] += ScoreBonuses[(int)grade[p] ]; + } } Grade max_grade = GRADE_NO_DATA; @@ -814,6 +820,27 @@ void ScreenEvaluation::Update( float fDeltaTime ) { Screen::Update( fDeltaTime ); + for( int p=0; pm_CurStageStats.iBonus[p] == 0) + continue; + + // wait a few seconds before adding bonus + if ( RageTimer::GetTimeSinceStart() - m_fScreenCreateTime < 3.0f) + continue; + + int increment = GAMESTATE->m_CurStageStats.iBonus[p]/10; + + if (increment < 1) increment = min(1024, GAMESTATE->m_CurStageStats.iBonus[p]); +// if (GAMESTATE->m_CurStageStats.iBonus[p] > 5000000) increment = 499999; + + GAMESTATE->m_CurStageStats.iBonus[p] -= increment; + + GAMESTATE->m_CurStageStats.iScore[p] += increment; + + m_textScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS, GAMESTATE->m_CurStageStats.iScore[p]) ); + } + /* for( int l=0; l