add params to AddTapRowScore for calculating score based on num taps in row
fix row scored before combo and score multiplier calculated in guitar fix CurrentComboChanged not broadcasted on combo stopped
This commit is contained in:
@@ -51,6 +51,7 @@ public:
|
|||||||
/* Note that pNoteData will include any transformations due to modifiers. */
|
/* Note that pNoteData will include any transformations due to modifiers. */
|
||||||
virtual void OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData ) = 0; // before a song plays (called multiple times if course)
|
virtual void OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData ) = 0; // before a song plays (called multiple times if course)
|
||||||
|
|
||||||
|
// HandleTap* is called before HandleTapRow*
|
||||||
virtual void HandleTapScore( const TapNote &tn ) = 0;
|
virtual void HandleTapScore( const TapNote &tn ) = 0;
|
||||||
virtual void HandleTapRowScore( const NoteData &nd, int iRow ) = 0;
|
virtual void HandleTapRowScore( const NoteData &nd, int iRow ) = 0;
|
||||||
virtual void HandleHoldScore( const TapNote &tn ) = 0;
|
virtual void HandleHoldScore( const TapNote &tn ) = 0;
|
||||||
|
|||||||
@@ -10,6 +10,18 @@ ScoreKeeperGuitar::ScoreKeeperGuitar( PlayerState *pPlayerState, PlayerStageStat
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ScoreKeeperGuitar::AddTapScore( TapNoteScore tns )
|
void ScoreKeeperGuitar::AddTapScore( TapNoteScore tns )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScoreKeeperGuitar::AddHoldScore( HoldNoteScore hns )
|
||||||
|
{
|
||||||
|
if( hns == HNS_Held )
|
||||||
|
AddTapScore( TNS_W1 );
|
||||||
|
else if ( hns == HNS_LetGo )
|
||||||
|
AddTapScore( TNS_W4 ); // required for subtractive score display to work properly
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScoreKeeperGuitar::AddTapRowScore( TapNoteScore tns, const NoteData &nd, int iRow )
|
||||||
{
|
{
|
||||||
// calculate score multiplier
|
// calculate score multiplier
|
||||||
int iNewCurScoreMultiplier = m_pPlayerStageStats->m_iCurScoreMultiplier;
|
int iNewCurScoreMultiplier = m_pPlayerStageStats->m_iCurScoreMultiplier;
|
||||||
@@ -25,24 +37,18 @@ void ScoreKeeperGuitar::AddTapScore( TapNoteScore tns )
|
|||||||
|
|
||||||
if( tns != TNS_Miss )
|
if( tns != TNS_Miss )
|
||||||
{
|
{
|
||||||
iScore += 50 * iNewCurScoreMultiplier;
|
TapNoteScore scoreOfLastTap;
|
||||||
|
int iNumTapsInRow;
|
||||||
|
|
||||||
|
GetScoreOfLastTapInRow( nd, iRow, scoreOfLastTap, iNumTapsInRow );
|
||||||
|
|
||||||
|
ASSERT( iNumTapsInRow > 0 );
|
||||||
|
|
||||||
|
iScore += 50 * iNumTapsInRow * iNewCurScoreMultiplier;
|
||||||
MESSAGEMAN->Broadcast( Message_ScoreChangedP1 );
|
MESSAGEMAN->Broadcast( Message_ScoreChangedP1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScoreKeeperGuitar::AddHoldScore( HoldNoteScore hns )
|
|
||||||
{
|
|
||||||
if( hns == HNS_Held )
|
|
||||||
AddTapScore( TNS_W1 );
|
|
||||||
else if ( hns == HNS_LetGo )
|
|
||||||
AddTapScore( TNS_W4 ); // required for subtractive score display to work properly
|
|
||||||
}
|
|
||||||
|
|
||||||
void ScoreKeeperGuitar::AddTapRowScore( TapNoteScore score )
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2004 Chris Danford
|
* (c) 2001-2004 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public:
|
|||||||
ScoreKeeperGuitar( PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats );
|
ScoreKeeperGuitar( PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats );
|
||||||
virtual void AddTapScore( TapNoteScore score );
|
virtual void AddTapScore( TapNoteScore score );
|
||||||
void AddHoldScore( HoldNoteScore hns );
|
void AddHoldScore( HoldNoteScore hns );
|
||||||
virtual void AddTapRowScore( TapNoteScore score );
|
virtual void AddTapRowScore( TapNoteScore score, const NoteData &nd, int iRow );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -227,12 +227,17 @@ void ScoreKeeperNormal::AddTapScore( TapNoteScore tns )
|
|||||||
void ScoreKeeperNormal::AddHoldScore( HoldNoteScore hns )
|
void ScoreKeeperNormal::AddHoldScore( HoldNoteScore hns )
|
||||||
{
|
{
|
||||||
if( hns == HNS_Held )
|
if( hns == HNS_Held )
|
||||||
AddTapRowScore( TNS_W1 );
|
AddScoreInternal( TNS_W1 );
|
||||||
else if ( hns == HNS_LetGo )
|
else if ( hns == HNS_LetGo )
|
||||||
AddTapRowScore( TNS_W4 ); // required for subtractive score display to work properly
|
AddScoreInternal( TNS_W4 ); // required for subtractive score display to work properly
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScoreKeeperNormal::AddTapRowScore( TapNoteScore score )
|
void ScoreKeeperNormal::AddTapRowScore( TapNoteScore score, const NoteData &nd, int iRow )
|
||||||
|
{
|
||||||
|
AddScoreInternal( score );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score )
|
||||||
{
|
{
|
||||||
int &iScore = m_pPlayerStageStats->m_iScore;
|
int &iScore = m_pPlayerStageStats->m_iScore;
|
||||||
int &iCurMaxScore = m_pPlayerStageStats->m_iCurMaxScore;
|
int &iCurMaxScore = m_pPlayerStageStats->m_iCurMaxScore;
|
||||||
@@ -388,6 +393,7 @@ void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow )
|
|||||||
// increment the current total possible dance score
|
// increment the current total possible dance score
|
||||||
m_pPlayerStageStats->m_iCurPossibleDancePoints += TapNoteScoreToDancePoints( TNS_W1 );
|
m_pPlayerStageStats->m_iCurPossibleDancePoints += TapNoteScoreToDancePoints( TNS_W1 );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Regular combo
|
// Regular combo
|
||||||
//
|
//
|
||||||
@@ -396,11 +402,7 @@ void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow )
|
|||||||
{
|
{
|
||||||
m_pPlayerStageStats->m_iCurMissCombo = 0;
|
m_pPlayerStageStats->m_iCurMissCombo = 0;
|
||||||
if( scoreOfLastTap >= m_MinScoreToContinueCombo )
|
if( scoreOfLastTap >= m_MinScoreToContinueCombo )
|
||||||
{
|
|
||||||
m_pPlayerStageStats->m_iCurCombo += iComboCountIfHit;
|
m_pPlayerStageStats->m_iCurCombo += iComboCountIfHit;
|
||||||
if( m_pPlayerState->m_PlayerNumber != PLAYER_INVALID )
|
|
||||||
MESSAGEMAN->Broadcast( enum_add2(Message_CurrentComboChangedP1,m_pPlayerState->m_PlayerNumber) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -409,7 +411,10 @@ void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow )
|
|||||||
++m_pPlayerStageStats->m_iCurMissCombo;
|
++m_pPlayerStageStats->m_iCurMissCombo;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddTapRowScore( scoreOfLastTap ); // only score once per row
|
if( m_pPlayerState->m_PlayerNumber != PLAYER_INVALID )
|
||||||
|
MESSAGEMAN->Broadcast( enum_add2(Message_CurrentComboChangedP1,m_pPlayerState->m_PlayerNumber) );
|
||||||
|
|
||||||
|
AddTapRowScore( scoreOfLastTap, nd, iRow ); // only score once per row
|
||||||
|
|
||||||
//
|
//
|
||||||
// handle combo logic
|
// handle combo logic
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ AutoScreenMessage( SM_PlayToasty );
|
|||||||
|
|
||||||
class ScoreKeeperNormal: public ScoreKeeper
|
class ScoreKeeperNormal: public ScoreKeeper
|
||||||
{
|
{
|
||||||
|
void AddScoreInternal( TapNoteScore score );
|
||||||
|
|
||||||
int m_iScoreRemainder;
|
int m_iScoreRemainder;
|
||||||
int m_iMaxPossiblePoints;
|
int m_iMaxPossiblePoints;
|
||||||
int m_iTapNotesHit; // number of notes judged so far, needed by scoring
|
int m_iTapNotesHit; // number of notes judged so far, needed by scoring
|
||||||
@@ -34,7 +36,7 @@ class ScoreKeeperNormal: public ScoreKeeper
|
|||||||
|
|
||||||
virtual void AddTapScore( TapNoteScore tns );
|
virtual void AddTapScore( TapNoteScore tns );
|
||||||
virtual void AddHoldScore( HoldNoteScore hns );
|
virtual void AddHoldScore( HoldNoteScore hns );
|
||||||
virtual void AddTapRowScore( TapNoteScore tns );
|
virtual void AddTapRowScore( TapNoteScore tns, const NoteData &nd, int iRow );
|
||||||
|
|
||||||
/* Configuration: */
|
/* Configuration: */
|
||||||
/* Score after each tap will be rounded to the nearest m_iRoundTo; 1 to do nothing. */
|
/* Score after each tap will be rounded to the nearest m_iRoundTo; 1 to do nothing. */
|
||||||
|
|||||||
Reference in New Issue
Block a user