fix HoldNote scoring

This commit is contained in:
Chris Danford
2003-11-10 01:24:46 +00:00
parent ab37ee294b
commit 0b87d72d71
4 changed files with 21 additions and 5 deletions
+16 -1
View File
@@ -256,7 +256,7 @@ int NoteData::GetNumTapNotes( float fStartBeat, float fEndBeat ) const
return iNumNotes;
}
int NoteData::GetNumRowsWithTaps( float fStartBeat, float fEndBeat ) const
int NoteData::GetNumRowsWithTap( float fStartBeat, float fEndBeat ) const
{
int iNumNotes = 0;
@@ -271,6 +271,21 @@ int NoteData::GetNumRowsWithTaps( float fStartBeat, float fEndBeat ) const
return iNumNotes;
}
int NoteData::GetNumRowsWithTapOrHoldHead( float fStartBeat, float fEndBeat ) const
{
int iNumNotes = 0;
if(fEndBeat == -1) fEndBeat = GetMaxBeat();
int iStartIndex = BeatToNoteRow( fStartBeat );
int iEndIndex = BeatToNoteRow( fEndBeat );
for( int i=iStartIndex; i<=iEndIndex; i++ )
if( IsThereATapOrHoldHeadAtRow(i) )
iNumNotes++;
return iNumNotes;
}
int NoteData::GetNumDoubles( float fStartBeat, float fEndBeat ) const
{
int iNumDoubles = 0;
+2 -1
View File
@@ -150,7 +150,8 @@ public:
float GetLastBeat() const; // return the beat number of the last note
int GetLastRow() const;
int GetNumTapNotes( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
int GetNumRowsWithTaps( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
int GetNumRowsWithTap( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
int GetNumRowsWithTapOrHoldHead( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
int GetNumDoubles( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
/* optimization: for the default of start to end, use the second (faster) */
int GetNumHoldNotes( const float fStartBeat, const float fEndBeat = -1 ) const;
+2 -2
View File
@@ -171,7 +171,7 @@ void ScoreKeeperMAX2::OnNextSong( int iSongInCourseIndex, const Steps* pNotes, c
ASSERT( m_iMaxPossiblePoints >= 0 );
m_iMaxScoreSoFar += m_iMaxPossiblePoints;
m_iNumTapsAndHolds = pNoteData->GetNumRowsWithTaps() + pNoteData->GetNumHoldNotes();
m_iNumTapsAndHolds = pNoteData->GetNumRowsWithTapOrHoldHead() + pNoteData->GetNumHoldNotes();
m_iPointBonus = m_iMaxPossiblePoints;
@@ -424,7 +424,7 @@ int ScoreKeeperMAX2::GetPossibleDancePoints( const NoteData &preNoteData, const
* The logic here is that if you use a modifier that adds notes, you should have to
* hit the new notes to get a high grade. However, if you use one that removes notes,
* they should simply be counted as misses. */
int NumTaps = max( preNoteData.GetNumRowsWithTaps(), postNoteData.GetNumRowsWithTaps() );
int NumTaps = max( preNoteData.GetNumRowsWithTapOrHoldHead(), postNoteData.GetNumRowsWithTapOrHoldHead() );
int NumHolds = max( preNoteData.GetNumHoldNotes(), postNoteData.GetNumHoldNotes() );
return NumTaps*TapNoteScoreToDancePoints(TNS_MARVELOUS)+
NumHolds*HoldNoteScoreToDancePoints(HNS_OK);
+1 -1
View File
@@ -973,7 +973,7 @@ bool ScreenGameplay::IsTimeToPlayTicks() const
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
continue; // skip
bAnyoneHasANote |= m_Player[p].IsThereATapAtRow( r );
bAnyoneHasANote |= m_Player[p].IsThereATapOrHoldHeadAtRow( r );
break; // this will only play the tick for the first player that is joined
}
}