diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 44b8cd2522..bd226dd963 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -665,10 +665,10 @@ void Player::HandleTapRowScore( unsigned row ) return; if(m_pPrimaryScoreKeeper) - m_pPrimaryScoreKeeper->HandleTapRowScore(scoreOfLastTap, iNumTapsInRow ); + m_pPrimaryScoreKeeper->HandleTapRowScore(scoreOfLastTap, iNumTapsInRow, m_pLifeMeter->FailedEarlier() ); if(m_pSecondaryScoreKeeper) - m_pSecondaryScoreKeeper->HandleTapRowScore(scoreOfLastTap, iNumTapsInRow ); + m_pSecondaryScoreKeeper->HandleTapRowScore(scoreOfLastTap, iNumTapsInRow, m_pLifeMeter->FailedEarlier() ); if (m_pScore) m_pScore->SetScore(GAMESTATE->m_CurStageStats.iScore[m_PlayerNumber]); diff --git a/stepmania/src/ScoreKeeper.h b/stepmania/src/ScoreKeeper.h index 6343097426..45e012c8af 100644 --- a/stepmania/src/ScoreKeeper.h +++ b/stepmania/src/ScoreKeeper.h @@ -44,7 +44,7 @@ public: virtual void OnNextSong( int iSongInCourseIndex, Notes* pNotes ) = 0; // before a song plays (called multiple times if course) - virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ) = 0; + virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, bool failed) = 0; virtual void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ) = 0; virtual int TapNoteScoreToDancePoints( TapNoteScore tns ) = 0; diff --git a/stepmania/src/ScoreKeeperMAX2.cpp b/stepmania/src/ScoreKeeperMAX2.cpp index 8af458f1c4..8135e7164f 100644 --- a/stepmania/src/ScoreKeeperMAX2.cpp +++ b/stepmania/src/ScoreKeeperMAX2.cpp @@ -163,7 +163,7 @@ static int GetScore(int p, int B, int S, int n) } -void ScoreKeeperMAX2::AddScore( TapNoteScore score ) +void ScoreKeeperMAX2::AddScore( TapNoteScore score, bool failed) { /* http://www.aaroninjapan.com/ddr2.html @@ -197,14 +197,22 @@ void ScoreKeeperMAX2::AddScore( TapNoteScore score ) int iScoreMultiplier = (m_iMaxPossiblePoints / (10*sum)); ASSERT( iScoreMultiplier >= 0 ); - m_iScore += GetScore(p, B, sum, m_iTapNotesHit); + if (failed) + switch( score ) + { + case TNS_MARVELOUS: m_iScore += 10; break; + case TNS_PERFECT: m_iScore += MarvelousEnabled? 9:10; break; + case TNS_GREAT: m_iScore += 5; break; + } + else + m_iScore += GetScore(p, B, sum, m_iTapNotesHit); /* Subtract the maximum this step could have been worth from the bonus. */ m_iPointBonus -= GetScore(10, B, sum, m_iTapNotesHit); if ( m_iTapNotesHit == m_iNumTapsAndHolds && score >= TNS_PERFECT ) { - m_iScore += m_iPointBonus; + if (!failed) m_iScore += m_iPointBonus; if ( m_bIsLastSongInCourse ) { m_iScore += 100000000 - m_iMaxScoreSoFar; @@ -222,7 +230,7 @@ void ScoreKeeperMAX2::AddScore( TapNoteScore score ) GAMESTATE->m_CurStageStats.iScore[m_PlayerNumber] = m_iScore; } -void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ) +void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, bool failed ) { ASSERT( iNumTapsInRow >= 1 ); @@ -267,7 +275,7 @@ void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTa Note: if you got all Perfect on this song, you would get (p=10)*B, which is 80,000,000. In fact, the maximum possible score for any song is the number of feet difficulty X 10,000,000. */ - AddScore( scoreOfLastTap ); // only score once per row + AddScore( scoreOfLastTap, failed ); // only score once per row // @@ -292,6 +300,7 @@ void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTa if( m_iCurToastyCombo==250 && !GAMESTATE->m_bDemonstrationOrJukebox ) SCREENMAN->PostMessageToTopScreen( SM_PlayToasty, 0 ); + PREFSMAN->m_fTotalToastysSeen += 1; break; default: m_iCurToastyCombo = 0; @@ -390,7 +399,7 @@ void ScoreKeeperMAX2::HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tap GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += HoldNoteScoreToDancePoints( holdScore ); if( holdScore == HNS_OK ) - AddScore( TNS_MARVELOUS ); + AddScore( TNS_MARVELOUS , false); } diff --git a/stepmania/src/ScoreKeeperMAX2.h b/stepmania/src/ScoreKeeperMAX2.h index 7599e86dc9..e6d3b3c65c 100644 --- a/stepmania/src/ScoreKeeperMAX2.h +++ b/stepmania/src/ScoreKeeperMAX2.h @@ -30,14 +30,14 @@ class ScoreKeeperMAX2: public ScoreKeeper const vector& apNotes; - void AddScore( TapNoteScore score ); + void AddScore( TapNoteScore score, bool failed); public: ScoreKeeperMAX2( const vector& apNotes, PlayerNumber pn); void OnNextSong( int iSongInCourseIndex, Notes* pNotes ); // before a song plays (called multiple times if course) - void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ); + void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, bool failed ); void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ); int TapNoteScoreToDancePoints( TapNoteScore tns ); diff --git a/stepmania/src/ScoreKeeperRave.cpp b/stepmania/src/ScoreKeeperRave.cpp index 335dc94517..6c44e640b7 100644 --- a/stepmania/src/ScoreKeeperRave.cpp +++ b/stepmania/src/ScoreKeeperRave.cpp @@ -36,7 +36,7 @@ void ScoreKeeperRave::OnNextSong( int iSongInCourseIndex, Notes* pNotes ) #define CROSSED( val ) (fOld < val && fNew >= val) #define CROSSED_ATTACK_LEVEL( level ) CROSSED(1.f/NUM_ATTACK_LEVELS*(level+1)) -void ScoreKeeperRave::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ) +void ScoreKeeperRave::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, bool failed) { AttackLevel oldAL = (AttackLevel)(int)GAMESTATE->m_fSuperMeter[m_PlayerNumber]; diff --git a/stepmania/src/ScoreKeeperRave.h b/stepmania/src/ScoreKeeperRave.h index 0e4fb5fde3..c44efc294b 100644 --- a/stepmania/src/ScoreKeeperRave.h +++ b/stepmania/src/ScoreKeeperRave.h @@ -23,7 +23,7 @@ public: ScoreKeeperRave(PlayerNumber pn); virtual void Update( float fDelta ); virtual void OnNextSong( int iSongInCourseIndex, Notes* pNotes ); // before a song plays (called multiple times if course) - virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ); + virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, bool failed); virtual void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ); virtual int TapNoteScoreToDancePoints( TapNoteScore tns ) { return 0; }; virtual int HoldNoteScoreToDancePoints( HoldNoteScore hns ) { return 0; };