Clean up some ScoreKeeper names

Jumps are now graded on the TapNoteScore of the that completes the row, not the minimum TNS of the row
This commit is contained in:
Chris Danford
2003-03-16 17:45:32 +00:00
parent 33917de85c
commit 7192afab51
5 changed files with 37 additions and 29 deletions
+22 -14
View File
@@ -253,7 +253,7 @@ void Player::Update( float fDeltaTime )
if( hns != HNS_NONE )
{
/* this note's been judged */
HandleHoldNoteScore( hns, tns );
HandleHoldScore( hns, tns );
m_HoldJudgment[hn.iTrack].SetHoldJudgment( hns );
}
@@ -402,7 +402,8 @@ void Player::Step( int col )
LOG->Trace("(%2d/%2d)Note offset: %f, Score: %i", m_iOffsetSample, SAMPLE_COUNT, fNoteOffset, score);
SetTapNoteScore(col, iIndexOverlappingNote, score);
if (GAMESTATE->m_SongOptions.m_bAutoSync )
if( GAMESTATE->m_SongOptions.m_bAutoSync && score>=TNS_GREAT )
{
m_fOffset[m_iOffsetSample++] = fNoteOffset;
if (m_iOffsetSample >= SAMPLE_COUNT)
@@ -422,7 +423,8 @@ void Player::Step( int col )
if (score > TNS_NONE) {
if (score > TNS_NONE)
{
bool bRowDestroyed = true;
for( int t=0; t<GetNumTracks(); t++ ) // did this complete the elimination of the row?
{
@@ -434,7 +436,7 @@ void Player::Step( int col )
}
}
if( bRowDestroyed )
OnRowDestroyed( iIndexOverlappingNote );
OnRowDestroyed( score, iIndexOverlappingNote );
}
}
@@ -442,7 +444,7 @@ void Player::Step( int col )
m_GrayArrowRow.Step( col );
}
void Player::OnRowDestroyed( int iIndexThatWasSteppedOn )
void Player::OnRowDestroyed( TapNoteScore lastScore, int iIndexThatWasSteppedOn )
{
LOG->Trace( "Player::OnRowDestroyed" );
@@ -486,14 +488,20 @@ void Player::OnRowDestroyed( int iIndexThatWasSteppedOn )
iNumNotesInThisRow++;
// show the ghost arrow for this column
if(score == TNS_GREAT || score == TNS_PERFECT || score == TNS_MARVELOUS)
switch( score )
{
case TNS_GREAT:
case TNS_PERFECT:
case TNS_MARVELOUS:
m_GhostArrowRow.TapNote( c, score, m_Combo.GetCurrentCombo()>(int)BRIGHT_GHOST_COMBO_THRESHOLD);
break;
}
}
}
if( iNumNotesInThisRow > 0 )
{
HandleNoteScore( score, iNumNotesInThisRow ); // update score
HandleTapRowScore( score, iNumNotesInThisRow ); // update score
m_Combo.SetScore( score, iNumNotesInThisRow, m_pInventory );
GAMESTATE->m_CurStageStats.iMaxCombo[m_PlayerNumber] = max( GAMESTATE->m_CurStageStats.iMaxCombo[m_PlayerNumber], m_Combo.GetCurrentCombo() );
}
@@ -535,7 +543,7 @@ int Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds )
}
if( iNumMissesThisRow > 0 )
{
HandleNoteScore( TNS_MISS, iNumMissesThisRow );
HandleTapRowScore( TNS_MISS, iNumMissesThisRow );
m_Combo.SetScore( TNS_MISS, iNumMissesThisRow, m_pInventory );
}
}
@@ -564,7 +572,7 @@ void Player::CrossedRow( int iNoteRow )
}
void Player::HandleNoteScore( TapNoteScore score, int iNumTapsInRow )
void Player::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow )
{
ASSERT( iNumTapsInRow >= 1 );
@@ -575,19 +583,19 @@ void Player::HandleNoteScore( TapNoteScore score, int iNumTapsInRow )
#endif //DEBUG
if(m_pScoreKeeper)
m_pScoreKeeper->HandleTapScore(score, iNumTapsInRow);
m_pScoreKeeper->HandleTapRowScore(scoreOfLastTap, iNumTapsInRow);
if (m_pScore)
m_pScore->SetScore(GAMESTATE->m_CurStageStats.fScore[m_PlayerNumber]);
if( m_pLifeMeter ) {
m_pLifeMeter->ChangeLife( score );
m_pLifeMeter->ChangeLife( scoreOfLastTap );
m_pLifeMeter->OnDancePointsChange(); // update oni life meter
}
}
void Player::HandleHoldNoteScore( HoldNoteScore score, TapNoteScore TapNoteScore )
void Player::HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore )
{
#ifndef DEBUG
// don't accumulate points if AutoPlay is on.
@@ -596,14 +604,14 @@ void Player::HandleHoldNoteScore( HoldNoteScore score, TapNoteScore TapNoteScore
#endif //DEBUG
if(m_pScoreKeeper) {
m_pScoreKeeper->HandleHoldScore(score, TapNoteScore);
m_pScoreKeeper->HandleHoldScore(holdScore, tapScore);
}
if (m_pScore)
m_pScore->SetScore(GAMESTATE->m_CurStageStats.fScore[m_PlayerNumber]);
if( m_pLifeMeter ) {
m_pLifeMeter->ChangeLife( score, TapNoteScore );
m_pLifeMeter->ChangeLife( holdScore, tapScore );
// refresh Oni life meter
m_pLifeMeter->OnDancePointsChange();
+3 -3
View File
@@ -54,9 +54,9 @@ public:
protected:
int UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat );
void OnRowDestroyed( int iStepIndex );
void HandleNoteScore( TapNoteScore score, int iNumTapsInRow );
void HandleHoldNoteScore( HoldNoteScore score, TapNoteScore TapNoteScore );
void OnRowDestroyed( TapNoteScore lastScore, int iStepIndex );
void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow );
void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore );
int GetClosestNoteDirectional( int col, float fBeat, float fMaxBeatsAhead, int iDirection );
int GetClosestNote( int col, float fBeat, float fMaxBeatsAhead, float fMaxBeatsBehind );
+2 -2
View File
@@ -37,8 +37,8 @@ public:
ScoreKeeper(PlayerNumber pn) { m_PlayerNumber=pn; }
virtual void DrawPrimitives() { }
virtual void HandleTapScore( TapNoteScore score, int iNumTapsInRow ) = 0;
virtual void HandleHoldScore( HoldNoteScore score, TapNoteScore TapNoteScore ) = 0;
virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ) = 0;
virtual void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ) = 0;
};
#endif
+8 -8
View File
@@ -46,13 +46,13 @@ void ScoreKeeperMAX2::AddScore( TapNoteScore score )
GAMESTATE->m_CurStageStats.fScore[m_PlayerNumber] = m_lScore * m_fScoreMultiplier;
}
void ScoreKeeperMAX2::HandleTapScore( TapNoteScore score, int iNumTapsInRow )
void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow )
{
ASSERT( iNumTapsInRow >= 1 );
// update dance points for Oni lifemeter
GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += iNumTapsInRow * TapNoteScoreToDancePoints( score );
GAMESTATE->m_CurStageStats.iTapNoteScores[m_PlayerNumber][score] += iNumTapsInRow;
GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += iNumTapsInRow * TapNoteScoreToDancePoints( scoreOfLastTap );
GAMESTATE->m_CurStageStats.iTapNoteScores[m_PlayerNumber][scoreOfLastTap] += iNumTapsInRow;
/*
A single step's points are calculated as follows:
@@ -92,16 +92,16 @@ void ScoreKeeperMAX2::HandleTapScore( TapNoteScore score, int iNumTapsInRow )
*/
for( int i=0; i<iNumTapsInRow; i++ )
AddScore( score );
AddScore( scoreOfLastTap );
}
void ScoreKeeperMAX2::HandleHoldScore( HoldNoteScore score, TapNoteScore TapNoteScore )
void ScoreKeeperMAX2::HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore )
{
// update dance points totals
GAMESTATE->m_CurStageStats.iHoldNoteScores[m_PlayerNumber][score] ++;
GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += HoldNoteScoreToDancePoints( score );
GAMESTATE->m_CurStageStats.iHoldNoteScores[m_PlayerNumber][holdScore] ++;
GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += HoldNoteScoreToDancePoints( holdScore );
if( score == HNS_OK )
if( holdScore == HNS_OK )
AddScore( TNS_PERFECT );
}
+2 -2
View File
@@ -27,8 +27,8 @@ class ScoreKeeperMAX2: public ScoreKeeper
public:
ScoreKeeperMAX2(Notes *notes, NoteDataWithScoring &data, PlayerNumber pn);
void HandleTapScore( TapNoteScore score, int iNumTapsInRow );
void HandleHoldScore( HoldNoteScore score, TapNoteScore TapNoteScore );
void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow );
void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore );
};
#endif