From 7192afab516a65676ee3ce348ad1a6bb446e2de4 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 16 Mar 2003 17:45:32 +0000 Subject: [PATCH] Clean up some ScoreKeeper names Jumps are now graded on the TapNoteScore of the that completes the row, not the minimum TNS of the row --- stepmania/src/Player.cpp | 36 +++++++++++++++++++------------ stepmania/src/Player.h | 6 +++--- stepmania/src/ScoreKeeper.h | 4 ++-- stepmania/src/ScoreKeeperMAX2.cpp | 16 +++++++------- stepmania/src/ScoreKeeperMAX2.h | 4 ++-- 5 files changed, 37 insertions(+), 29 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index bab95b5afe..298a162505 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -253,7 +253,7 @@ void Player::Update( float fDeltaTime ) if( hns != HNS_NONE ) { /* this note's been judged */ - HandleHoldNoteScore( hns, tns ); + HandleHoldScore( hns, tns ); m_HoldJudgment[hn.iTrack].SetHoldJudgment( hns ); } @@ -402,7 +402,8 @@ void Player::Step( int col ) LOG->Trace("(%2d/%2d)Note offset: %f, Score: %i", m_iOffsetSample, SAMPLE_COUNT, fNoteOffset, score); SetTapNoteScore(col, iIndexOverlappingNote, score); - if (GAMESTATE->m_SongOptions.m_bAutoSync ) + + if( GAMESTATE->m_SongOptions.m_bAutoSync && score>=TNS_GREAT ) { m_fOffset[m_iOffsetSample++] = fNoteOffset; if (m_iOffsetSample >= SAMPLE_COUNT) @@ -422,7 +423,8 @@ void Player::Step( int col ) - if (score > TNS_NONE) { + if (score > TNS_NONE) + { bool bRowDestroyed = true; for( int t=0; tTrace( "Player::OnRowDestroyed" ); @@ -486,14 +488,20 @@ void Player::OnRowDestroyed( int iIndexThatWasSteppedOn ) iNumNotesInThisRow++; // show the ghost arrow for this column - if(score == TNS_GREAT || score == TNS_PERFECT || score == TNS_MARVELOUS) + switch( score ) + { + case TNS_GREAT: + case TNS_PERFECT: + case TNS_MARVELOUS: m_GhostArrowRow.TapNote( c, score, m_Combo.GetCurrentCombo()>(int)BRIGHT_GHOST_COMBO_THRESHOLD); + break; + } } } if( iNumNotesInThisRow > 0 ) { - HandleNoteScore( score, iNumNotesInThisRow ); // update score + HandleTapRowScore( score, iNumNotesInThisRow ); // update score m_Combo.SetScore( score, iNumNotesInThisRow, m_pInventory ); GAMESTATE->m_CurStageStats.iMaxCombo[m_PlayerNumber] = max( GAMESTATE->m_CurStageStats.iMaxCombo[m_PlayerNumber], m_Combo.GetCurrentCombo() ); } @@ -535,7 +543,7 @@ int Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds ) } if( iNumMissesThisRow > 0 ) { - HandleNoteScore( TNS_MISS, iNumMissesThisRow ); + HandleTapRowScore( TNS_MISS, iNumMissesThisRow ); m_Combo.SetScore( TNS_MISS, iNumMissesThisRow, m_pInventory ); } } @@ -564,7 +572,7 @@ void Player::CrossedRow( int iNoteRow ) } -void Player::HandleNoteScore( TapNoteScore score, int iNumTapsInRow ) +void Player::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ) { ASSERT( iNumTapsInRow >= 1 ); @@ -575,19 +583,19 @@ void Player::HandleNoteScore( TapNoteScore score, int iNumTapsInRow ) #endif //DEBUG if(m_pScoreKeeper) - m_pScoreKeeper->HandleTapScore(score, iNumTapsInRow); + m_pScoreKeeper->HandleTapRowScore(scoreOfLastTap, iNumTapsInRow); if (m_pScore) m_pScore->SetScore(GAMESTATE->m_CurStageStats.fScore[m_PlayerNumber]); if( m_pLifeMeter ) { - m_pLifeMeter->ChangeLife( score ); + m_pLifeMeter->ChangeLife( scoreOfLastTap ); m_pLifeMeter->OnDancePointsChange(); // update oni life meter } } -void Player::HandleHoldNoteScore( HoldNoteScore score, TapNoteScore TapNoteScore ) +void Player::HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ) { #ifndef DEBUG // don't accumulate points if AutoPlay is on. @@ -596,14 +604,14 @@ void Player::HandleHoldNoteScore( HoldNoteScore score, TapNoteScore TapNoteScore #endif //DEBUG if(m_pScoreKeeper) { - m_pScoreKeeper->HandleHoldScore(score, TapNoteScore); + m_pScoreKeeper->HandleHoldScore(holdScore, tapScore); } if (m_pScore) m_pScore->SetScore(GAMESTATE->m_CurStageStats.fScore[m_PlayerNumber]); if( m_pLifeMeter ) { - m_pLifeMeter->ChangeLife( score, TapNoteScore ); + m_pLifeMeter->ChangeLife( holdScore, tapScore ); // refresh Oni life meter m_pLifeMeter->OnDancePointsChange(); diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index 874162cfe4..705161568c 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -54,9 +54,9 @@ public: protected: int UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat ); - void OnRowDestroyed( int iStepIndex ); - void HandleNoteScore( TapNoteScore score, int iNumTapsInRow ); - void HandleHoldNoteScore( HoldNoteScore score, TapNoteScore TapNoteScore ); + void OnRowDestroyed( TapNoteScore lastScore, int iStepIndex ); + void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ); + void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ); int GetClosestNoteDirectional( int col, float fBeat, float fMaxBeatsAhead, int iDirection ); int GetClosestNote( int col, float fBeat, float fMaxBeatsAhead, float fMaxBeatsBehind ); diff --git a/stepmania/src/ScoreKeeper.h b/stepmania/src/ScoreKeeper.h index eefd1ff3f9..a92d910199 100644 --- a/stepmania/src/ScoreKeeper.h +++ b/stepmania/src/ScoreKeeper.h @@ -37,8 +37,8 @@ public: ScoreKeeper(PlayerNumber pn) { m_PlayerNumber=pn; } virtual void DrawPrimitives() { } - virtual void HandleTapScore( TapNoteScore score, int iNumTapsInRow ) = 0; - virtual void HandleHoldScore( HoldNoteScore score, TapNoteScore TapNoteScore ) = 0; + virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ) = 0; + virtual void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ) = 0; }; #endif diff --git a/stepmania/src/ScoreKeeperMAX2.cpp b/stepmania/src/ScoreKeeperMAX2.cpp index 6e5dad3877..fb081f0438 100644 --- a/stepmania/src/ScoreKeeperMAX2.cpp +++ b/stepmania/src/ScoreKeeperMAX2.cpp @@ -46,13 +46,13 @@ void ScoreKeeperMAX2::AddScore( TapNoteScore score ) GAMESTATE->m_CurStageStats.fScore[m_PlayerNumber] = m_lScore * m_fScoreMultiplier; } -void ScoreKeeperMAX2::HandleTapScore( TapNoteScore score, int iNumTapsInRow ) +void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ) { ASSERT( iNumTapsInRow >= 1 ); // update dance points for Oni lifemeter - GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += iNumTapsInRow * TapNoteScoreToDancePoints( score ); - GAMESTATE->m_CurStageStats.iTapNoteScores[m_PlayerNumber][score] += iNumTapsInRow; + GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += iNumTapsInRow * TapNoteScoreToDancePoints( scoreOfLastTap ); + GAMESTATE->m_CurStageStats.iTapNoteScores[m_PlayerNumber][scoreOfLastTap] += iNumTapsInRow; /* A single step's points are calculated as follows: @@ -92,16 +92,16 @@ void ScoreKeeperMAX2::HandleTapScore( TapNoteScore score, int iNumTapsInRow ) */ for( int i=0; im_CurStageStats.iHoldNoteScores[m_PlayerNumber][score] ++; - GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += HoldNoteScoreToDancePoints( score ); + GAMESTATE->m_CurStageStats.iHoldNoteScores[m_PlayerNumber][holdScore] ++; + GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += HoldNoteScoreToDancePoints( holdScore ); - if( score == HNS_OK ) + if( holdScore == HNS_OK ) AddScore( TNS_PERFECT ); } diff --git a/stepmania/src/ScoreKeeperMAX2.h b/stepmania/src/ScoreKeeperMAX2.h index 41427724bd..c9f230b4e6 100644 --- a/stepmania/src/ScoreKeeperMAX2.h +++ b/stepmania/src/ScoreKeeperMAX2.h @@ -27,8 +27,8 @@ class ScoreKeeperMAX2: public ScoreKeeper public: ScoreKeeperMAX2(Notes *notes, NoteDataWithScoring &data, PlayerNumber pn); - void HandleTapScore( TapNoteScore score, int iNumTapsInRow ); - void HandleHoldScore( HoldNoteScore score, TapNoteScore TapNoteScore ); + void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ); + void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ); }; #endif