working on mine logic

This commit is contained in:
Chris Danford
2003-08-10 19:07:54 +00:00
parent 9e9eac516f
commit 0a03681825
2 changed files with 55 additions and 23 deletions
+7 -2
View File
@@ -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 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) if(GetTapNote(t, row) == TAP_EMPTY)
continue; continue;
/* Don't count mines - the goal is to miss those */
if(GetTapNote(t, row) == TAP_MINE)
continue;
score = min( score, GetTapNoteScore(t, row) ); score = min( score, GetTapNoteScore(t, row) );
} }
@@ -127,11 +130,13 @@ int NoteDataWithScoring::LastTapNoteScoreTrack(unsigned row) const
int best_track = -1; int best_track = -1;
for( int t=0; t<GetNumTracks(); t++ ) for( int t=0; t<GetNumTracks(); t++ )
{ {
/* If there's no tap note on this row, skip it; the score will always be TNS_NONE. */ /* If there's no tap note on this track, skip it (the score will always be TNS_NONE) */
if(GetTapNote(t, row) == TAP_EMPTY) continue; if(GetTapNote(t, row) == TAP_EMPTY) continue;
TapNoteScore tns = GetTapNoteScore(t, row); TapNoteScore tns = GetTapNoteScore(t, row);
if(tns == TNS_NONE || tns == TNS_MISS) return t;
/* Ignore tracks that haven't yet been graded. */
if(tns == TNS_NONE) continue;
float tm = GetTapNoteOffset(t, row); float tm = GetTapNoteOffset(t, row);
if(tm < scoretime) continue; if(tm < scoretime) continue;
+40 -13
View File
@@ -493,7 +493,11 @@ void Player::Step( int col, RageTimer tm )
break; break;
} }
if( score != TNS_NONE ) // Stepping on a mine counts as a miss
if( GetTapNote(col,iIndexOverlappingNote) == TAP_MINE )
score = TNS_MISS;
if( score != TNS_NONE && score != TNS_MISS )
{ {
int ms_error = (int) roundf( fSecondsFromPerfect * 1000 ); int ms_error = (int) roundf( fSecondsFromPerfect * 1000 );
ms_error = min( ms_error, MAX_PRO_TIMING_ERROR ); ms_error = min( ms_error, MAX_PRO_TIMING_ERROR );
@@ -554,25 +558,26 @@ void Player::OnRowCompletelyJudged( int iIndexThatWasSteppedOn )
/* Find the minimum score of the row. This will never be TNS_NONE, since this /* Find the minimum score of the row. This will never be TNS_NONE, since this
* function is only called when a row is completed. */ * function is only called when a row is completed. */
/* Instead, use the last tap score (ala DDR). Using the minimum results in
* slightly more harsh scoring than DDR */
// TapNoteScore score = MinTapNoteScore(iIndexThatWasSteppedOn); // TapNoteScore score = MinTapNoteScore(iIndexThatWasSteppedOn);
TapNoteScore score = LastTapNoteScore(iIndexThatWasSteppedOn); TapNoteScore score = LastTapNoteScore(iIndexThatWasSteppedOn);
ASSERT(score != TNS_NONE); ASSERT(score != TNS_NONE);
/* If the whole row was hit with perfects or greats, remove the row /* If the whole row was hit with perfects or greats, remove the row
* from the NoteField, so it disappears. */ * from the NoteField, so it disappears. */
switch ( score )
{
case TNS_MARVELOUS:
case TNS_PERFECT:
case TNS_GREAT:
m_NoteField.RemoveTapNoteRow( iIndexThatWasSteppedOn );
break;
}
for( int c=0; c<GetNumTracks(); c++ ) // for each column for( int c=0; c<GetNumTracks(); c++ ) // for each column
{ {
if( GetTapNote(c, iIndexThatWasSteppedOn) == TAP_EMPTY ) TapNote tn = GetTapNote(c, iIndexThatWasSteppedOn);
continue; /* no note in this col */
if( tn == TAP_EMPTY ) continue; /* no note in this col */
if( tn == TAP_MINE ) continue; /* don't flash on mines b/c they're supposed to be missed */
// If the score is great or better, remove the note from the screen to
// indicate success.
if( score >= TNS_GREAT )
m_NoteField.SetTapNote(c, iIndexThatWasSteppedOn, TAP_EMPTY);
// show the ghost arrow for this column // show the ghost arrow for this column
switch( score ) switch( score )
@@ -620,28 +625,50 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds )
//LOG->Trace( "iStartCheckingAt: %d iMissIfOlderThanThisIndex: %d", iStartCheckingAt, iMissIfOlderThanThisIndex ); //LOG->Trace( "iStartCheckingAt: %d iMissIfOlderThanThisIndex: %d", iStartCheckingAt, iMissIfOlderThanThisIndex );
int iNumMissesFound = 0; int iNumMissesFound = 0;
int iNumMinesMissed = 0;
for( int r=iStartCheckingAt; r<iMissIfOlderThanThisIndex; r++ ) for( int r=iStartCheckingAt; r<iMissIfOlderThanThisIndex; r++ )
{ {
bool MissedNoteOnThisRow = false; bool MissedNoteOnThisRow = false;
bool MissedMineOnThisRow = false;
for( int t=0; t<GetNumTracks(); t++ ) for( int t=0; t<GetNumTracks(); t++ )
{ {
if( GetTapNote(t, r) == TAP_EMPTY) continue; /* no note here */ if( GetTapNote(t, r) == TAP_EMPTY) continue; /* no note here */
if( GetTapNoteScore(t, r) != TNS_NONE ) continue; /* note here is hit */ 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; MissedNoteOnThisRow = true;
SetTapNoteScore(t, r, TNS_MISS); SetTapNoteScore(t, r, TNS_MISS);
GAMESTATE->m_CurStageStats.iTotalError[m_PlayerNumber] += MAX_PRO_TIMING_ERROR; GAMESTATE->m_CurStageStats.iTotalError[m_PlayerNumber] += MAX_PRO_TIMING_ERROR;
m_ProTimingDisplay.SetJudgment( MAX_PRO_TIMING_ERROR, TNS_MISS ); m_ProTimingDisplay.SetJudgment( MAX_PRO_TIMING_ERROR, TNS_MISS );
} }
}
if(!MissedNoteOnThisRow) continue; if( MissedNoteOnThisRow )
{
iNumMissesFound++; iNumMissesFound++;
HandleTapRowScore( r ); HandleTapRowScore( r );
m_Combo.SetCombo( GAMESTATE->m_CurStageStats.iCurCombo[m_PlayerNumber] ); 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 ) if( iNumMissesFound > 0 )
m_Judgment.SetJudgment( TNS_MISS ); m_Judgment.SetJudgment( TNS_MISS );
else if( iNumMinesMissed > 0 )
m_Judgment.SetJudgment( TNS_MARVELOUS );
} }