OK is worth a step, too.
This commit is contained in:
@@ -8,8 +8,12 @@ ScoreKeeperMAX2::ScoreKeeperMAX2(Notes *notes, NoteDataWithScoring &data, int pn
|
|||||||
// Stats_DoublesCount = true;
|
// Stats_DoublesCount = true;
|
||||||
|
|
||||||
int Meter = notes? notes->m_iMeter : 5;
|
int Meter = notes? notes->m_iMeter : 5;
|
||||||
int m_iNumTapNotes = data.GetNumTapNotes();
|
|
||||||
int sum = (m_iNumTapNotes * (m_iNumTapNotes + 1)) / 2;
|
/* Hold notes count as two tap notes. However, hold notes already count
|
||||||
|
* as 1 in GetNumTapNotes(), so only add 1*GetNumHoldNotes, not 2. */
|
||||||
|
int iNumTapNotes = data.GetNumTapNotes() + data.GetNumHoldNotes();
|
||||||
|
|
||||||
|
int sum = (iNumTapNotes * (iNumTapNotes + 1)) / 2;
|
||||||
|
|
||||||
if(sum)
|
if(sum)
|
||||||
m_fScoreMultiplier = float(Meter * 1000000) / sum;
|
m_fScoreMultiplier = float(Meter * 1000000) / sum;
|
||||||
@@ -22,6 +26,24 @@ ScoreKeeperMAX2::ScoreKeeperMAX2(Notes *notes, NoteDataWithScoring &data, int pn
|
|||||||
m_lScore = 0;
|
m_lScore = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScoreKeeperMAX2::AddScore( TapNoteScore score )
|
||||||
|
{
|
||||||
|
int p; // score multiplier
|
||||||
|
|
||||||
|
switch( score )
|
||||||
|
{
|
||||||
|
case TNS_PERFECT: p = 10; break;
|
||||||
|
case TNS_GREAT: p = 5; break;
|
||||||
|
default: p = 0; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_lScore += p * ++m_iTapNotesHit;
|
||||||
|
|
||||||
|
ASSERT(m_lScore >= 0);
|
||||||
|
|
||||||
|
GAMESTATE->m_fScore[m_PlayerNumber] = m_lScore * m_fScoreMultiplier;
|
||||||
|
}
|
||||||
|
|
||||||
void ScoreKeeperMAX2::HandleNoteScore( TapNoteScore score, int iNumTapsInRow )
|
void ScoreKeeperMAX2::HandleNoteScore( TapNoteScore score, int iNumTapsInRow )
|
||||||
{
|
{
|
||||||
ScoreKeeper::HandleNoteScore(score, iNumTapsInRow);
|
ScoreKeeper::HandleNoteScore(score, iNumTapsInRow);
|
||||||
@@ -69,21 +91,8 @@ void ScoreKeeperMAX2::HandleNoteScore( TapNoteScore score, int iNumTapsInRow )
|
|||||||
keeping these seperate for as long as possible improves accuracy.
|
keeping these seperate for as long as possible improves accuracy.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
int p; // score multiplier
|
|
||||||
|
|
||||||
switch( score )
|
|
||||||
{
|
|
||||||
case TNS_PERFECT: p = 10; break;
|
|
||||||
case TNS_GREAT: p = 5; break;
|
|
||||||
default: p = 0; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
for( int i=0; i<iNumTapsInRow; i++ )
|
for( int i=0; i<iNumTapsInRow; i++ )
|
||||||
m_lScore += p * ++m_iTapNotesHit;
|
AddScore( score );
|
||||||
|
|
||||||
ASSERT(m_lScore >= 0);
|
|
||||||
|
|
||||||
GAMESTATE->m_fScore[m_PlayerNumber] = m_lScore * m_fScoreMultiplier;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -92,4 +101,7 @@ void ScoreKeeperMAX2::HandleHoldNoteScore( HoldNoteScore score, TapNoteScore Tap
|
|||||||
// update dance points totals
|
// update dance points totals
|
||||||
GAMESTATE->m_HoldNoteScores[m_PlayerNumber][score] ++;
|
GAMESTATE->m_HoldNoteScores[m_PlayerNumber][score] ++;
|
||||||
GAMESTATE->m_iActualDancePoints[m_PlayerNumber] += HoldNoteScoreToDancePoints( score );
|
GAMESTATE->m_iActualDancePoints[m_PlayerNumber] += HoldNoteScoreToDancePoints( score );
|
||||||
|
|
||||||
|
if( score == HNS_OK )
|
||||||
|
AddScore( TNS_PERFECT );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ class ScoreKeeperMAX2: public ScoreKeeper
|
|||||||
float m_fScoreMultiplier;
|
float m_fScoreMultiplier;
|
||||||
int m_iTapNotesHit; // number of notes judged so far, needed by scoring
|
int m_iTapNotesHit; // number of notes judged so far, needed by scoring
|
||||||
|
|
||||||
|
void AddScore( TapNoteScore score );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ScoreKeeperMAX2(Notes *notes, NoteDataWithScoring &data, int pn);
|
ScoreKeeperMAX2(Notes *notes, NoteDataWithScoring &data, int pn);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user