add TNS_AVOIDED_MINE. Fixes unattempted mines counted as successful when ending early.

This commit is contained in:
Chris Danford
2005-04-13 01:11:44 +00:00
parent 4988744e12
commit d312ea5bef
6 changed files with 46 additions and 30 deletions
+1
View File
@@ -126,6 +126,7 @@ StringToX( SortOrder );
static const CString TapNoteScoreNames[NUM_TAP_NOTE_SCORES] = { static const CString TapNoteScoreNames[NUM_TAP_NOTE_SCORES] = {
"None", "None",
"HitMine", "HitMine",
"AvoidMine",
"Miss", "Miss",
"Boo", "Boo",
"Good", "Good",
+2 -1
View File
@@ -128,13 +128,14 @@ inline bool IsSongSort( SortOrder so ) { return so >= SORT_PREFERRED && so <= SO
enum TapNoteScore { enum TapNoteScore {
TNS_NONE, TNS_NONE,
TNS_HIT_MINE, TNS_HIT_MINE,
TNS_AVOIDED_MINE,
TNS_MISS, TNS_MISS,
TNS_BOO, TNS_BOO,
TNS_GOOD, TNS_GOOD,
TNS_GREAT, TNS_GREAT,
TNS_PERFECT, TNS_PERFECT,
TNS_MARVELOUS, TNS_MARVELOUS,
NUM_TAP_NOTE_SCORES NUM_TAP_NOTE_SCORES,
}; };
#define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TAP_NOTE_SCORES, tns ) #define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TAP_NOTE_SCORES, tns )
const CString& TapNoteScoreToString( TapNoteScore tns ); const CString& TapNoteScoreToString( TapNoteScore tns );
+1 -1
View File
@@ -77,7 +77,7 @@ int GetSuccessfulMines( const NoteData &in, int iStartIndex = 0, int iEndIndex =
for( int t=0; t<in.GetNumTracks(); t++ ) for( int t=0; t<in.GetNumTracks(); t++ )
{ {
const TapNote &tn = in.GetTapNote(t,i); const TapNote &tn = in.GetTapNote(t,i);
if( tn.type == TapNote::mine && tn.result.tns != TNS_HIT_MINE ) if( tn.type == TapNote::mine && tn.result.tns == TNS_AVOIDED_MINE )
iNumSuccessfulMinesNotes++; iNumSuccessfulMinesNotes++;
} }
} }
+11 -6
View File
@@ -1063,6 +1063,7 @@ void Player::OnRowCompletelyJudged( int iIndexThatWasSteppedOn )
TapNoteScore score = NoteDataWithScoring::LastTapNoteScore( m_NoteData, iIndexThatWasSteppedOn ); TapNoteScore score = NoteDataWithScoring::LastTapNoteScore( m_NoteData, iIndexThatWasSteppedOn );
ASSERT(score != TNS_NONE); ASSERT(score != TNS_NONE);
ASSERT(score != TNS_HIT_MINE); ASSERT(score != TNS_HIT_MINE);
ASSERT(score != TNS_AVOIDED_MINE);
/* 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. */
@@ -1143,23 +1144,27 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds )
{ {
case TapNote::empty: case TapNote::empty:
case TapNote::attack: case TapNote::attack:
case TapNote::mine:
continue; /* no note here */ continue; /* no note here */
} }
if( tn.result.tns != TNS_NONE ) /* note here is already hit */ if( tn.result.tns != TNS_NONE ) /* note here is already hit */
continue; continue;
tn.result.tns = TNS_MISS; if( tn.type == TapNote::mine )
{
tn.result.tns = TNS_AVOIDED_MINE;
}
else
{
// A normal note. Penalize for not stepping on it. // A normal note. Penalize for not stepping on it.
MissedNoteOnThisRow = true; MissedNoteOnThisRow = true;
tn.result.tns = TNS_MISS;
m_NoteData.SetTapNote( t, r, tn );
if( m_pPlayerStageStats ) if( m_pPlayerStageStats )
m_pPlayerStageStats->iTotalError += MAX_PRO_TIMING_ERROR; m_pPlayerStageStats->iTotalError += MAX_PRO_TIMING_ERROR;
} }
m_NoteData.SetTapNote( t, r, tn );
}
if( MissedNoteOnThisRow ) if( MissedNoteOnThisRow )
{ {
iNumMissesFound++; iNumMissesFound++;
+1
View File
@@ -130,6 +130,7 @@ Grade PlayerStageStats::GetGrade() const
switch( tns ) switch( tns )
{ {
case TNS_NONE: iTapScoreValue = 0; break; case TNS_NONE: iTapScoreValue = 0; break;
case TNS_AVOIDED_MINE: iTapScoreValue = 0; break;
case TNS_HIT_MINE: iTapScoreValue = PREFSMAN->m_iGradeWeightHitMine; break; case TNS_HIT_MINE: iTapScoreValue = PREFSMAN->m_iGradeWeightHitMine; break;
case TNS_MISS: iTapScoreValue = PREFSMAN->m_iGradeWeightMiss; break; case TNS_MISS: iTapScoreValue = PREFSMAN->m_iGradeWeightMiss; break;
case TNS_BOO: iTapScoreValue = PREFSMAN->m_iGradeWeightBoo; break; case TNS_BOO: iTapScoreValue = PREFSMAN->m_iGradeWeightBoo; break;
+19 -11
View File
@@ -1435,19 +1435,27 @@ void ScreenGameplay::Update( float fDeltaTime )
{ {
TapNoteScore tns = m_Player[p].GetLastTapNoteScore(); TapNoteScore tns = m_Player[p].GetLastTapNoteScore();
ANIM_STATES_2D StateMap[NUM_TAP_NOTE_SCORES] = ANIM_STATES_2D state = AS2D_MISS;
switch( tns )
{ {
AS2D_MISS, /* TNS_NONE (shouldn't happen) */ case TNS_NONE:
AS2D_MISS, /* TNS_HIT_MINE (shouldn't happen) */ case TNS_MISS:
AS2D_MISS, /* TNS_MISS */ case TNS_BOO:
AS2D_MISS, /* TNS_BOO */ state = AS2D_MISS;
AS2D_GOOD, /* TNS_GOOD */ break;
AS2D_GOOD, /* TNS_GREAT */ case TNS_GOOD:
AS2D_GREAT, /* TNS_PERFECT */ case TNS_GREAT:
AS2D_GREAT /* TNS_MARVELOUS */ state = AS2D_GOOD;
}; break;
case TNS_PERFECT:
case TNS_MARVELOUS:
state = AS2D_GREAT;
break;
default:
ASSERT(0);
}
ANIM_STATES_2D state = StateMap[tns];
if( state == AS2D_GREAT && m_pLifeMeter[p] && m_pLifeMeter[p]->GetLife() == 1.0f ) // full life if( state == AS2D_GREAT && m_pLifeMeter[p] && m_pLifeMeter[p]->GetLife() == 1.0f ) // full life
state = AS2D_FEVER; state = AS2D_FEVER;