From 0a0368182526e8f9737c85bf1c27d63e8253415b Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 10 Aug 2003 19:07:54 +0000 Subject: [PATCH] working on mine logic --- stepmania/src/NoteDataWithScoring.cpp | 9 +++- stepmania/src/Player.cpp | 69 +++++++++++++++++++-------- 2 files changed, 55 insertions(+), 23 deletions(-) diff --git a/stepmania/src/NoteDataWithScoring.cpp b/stepmania/src/NoteDataWithScoring.cpp index 5c56d353c1..e4d44761b0 100644 --- a/stepmania/src/NoteDataWithScoring.cpp +++ b/stepmania/src/NoteDataWithScoring.cpp @@ -107,6 +107,9 @@ TapNoteScore NoteDataWithScoring::MinTapNoteScore(unsigned row) const /* If there's no tap note on this row, skip it, or else the score will always be TNS_NONE. */ if(GetTapNote(t, row) == TAP_EMPTY) continue; + /* Don't count mines - the goal is to miss those */ + if(GetTapNote(t, row) == TAP_MINE) + continue; score = min( score, GetTapNoteScore(t, row) ); } @@ -127,11 +130,13 @@ int NoteDataWithScoring::LastTapNoteScoreTrack(unsigned row) const int best_track = -1; for( int t=0; t= TNS_GREAT ) + m_NoteField.SetTapNote(c, iIndexThatWasSteppedOn, TAP_EMPTY); // show the ghost arrow for this column switch( score ) @@ -620,28 +625,50 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds ) //LOG->Trace( "iStartCheckingAt: %d iMissIfOlderThanThisIndex: %d", iStartCheckingAt, iMissIfOlderThanThisIndex ); int iNumMissesFound = 0; + int iNumMinesMissed = 0; for( int r=iStartCheckingAt; rm_CurStageStats.iTotalError[m_PlayerNumber] += MAX_PRO_TIMING_ERROR; - m_ProTimingDisplay.SetJudgment( MAX_PRO_TIMING_ERROR, TNS_MISS ); + if( GetTapNoteScore(t, r) != TNS_NONE ) continue; /* note here is already hit */ + + if( GetTapNote(t, r) == TAP_MINE ) + { + // A mine. Reward for not stepping on it. + MissedMineOnThisRow = true; + SetTapNoteScore(t, r, TNS_MARVELOUS); + } + else + { + // A normal note. Penalize for not stepping on it. + MissedNoteOnThisRow = true; + SetTapNoteScore(t, r, TNS_MISS); + GAMESTATE->m_CurStageStats.iTotalError[m_PlayerNumber] += MAX_PRO_TIMING_ERROR; + m_ProTimingDisplay.SetJudgment( MAX_PRO_TIMING_ERROR, TNS_MISS ); + } } - if(!MissedNoteOnThisRow) continue; - iNumMissesFound++; - HandleTapRowScore( r ); - m_Combo.SetCombo( GAMESTATE->m_CurStageStats.iCurCombo[m_PlayerNumber] ); + if( MissedNoteOnThisRow ) + { + iNumMissesFound++; + HandleTapRowScore( r ); + m_Combo.SetCombo( GAMESTATE->m_CurStageStats.iCurCombo[m_PlayerNumber] ); + } + else if( MissedMineOnThisRow ) + { + iNumMinesMissed++; + HandleTapRowScore( r ); + m_Combo.SetCombo( GAMESTATE->m_CurStageStats.iCurCombo[m_PlayerNumber] ); + } } if( iNumMissesFound > 0 ) m_Judgment.SetJudgment( TNS_MISS ); + else if( iNumMinesMissed > 0 ) + m_Judgment.SetJudgment( TNS_MARVELOUS ); }