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:
Chris Danford
2006-11-16 12:25:05 +00:00
parent 98f8625834
commit e224b1787c
5 changed files with 39 additions and 25 deletions
+1
View File
@@ -51,6 +51,7 @@ public:
/* 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)
// HandleTap* is called before HandleTapRow*
virtual void HandleTapScore( const TapNote &tn ) = 0;
virtual void HandleTapRowScore( const NoteData &nd, int iRow ) = 0;
virtual void HandleHoldScore( const TapNote &tn ) = 0;
+20 -14
View File
@@ -10,6 +10,18 @@ ScoreKeeperGuitar::ScoreKeeperGuitar( PlayerState *pPlayerState, PlayerStageStat
}
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
int iNewCurScoreMultiplier = m_pPlayerStageStats->m_iCurScoreMultiplier;
@@ -25,24 +37,18 @@ void ScoreKeeperGuitar::AddTapScore( TapNoteScore tns )
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 );
}
}
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
* All rights reserved.
+1 -1
View File
@@ -12,7 +12,7 @@ public:
ScoreKeeperGuitar( PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats );
virtual void AddTapScore( TapNoteScore score );
void AddHoldScore( HoldNoteScore hns );
virtual void AddTapRowScore( TapNoteScore score );
virtual void AddTapRowScore( TapNoteScore score, const NoteData &nd, int iRow );
};
#endif
+13 -8
View File
@@ -227,12 +227,17 @@ void ScoreKeeperNormal::AddTapScore( TapNoteScore tns )
void ScoreKeeperNormal::AddHoldScore( HoldNoteScore hns )
{
if( hns == HNS_Held )
AddTapRowScore( TNS_W1 );
AddScoreInternal( TNS_W1 );
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 &iCurMaxScore = m_pPlayerStageStats->m_iCurMaxScore;
@@ -388,6 +393,7 @@ void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow )
// increment the current total possible dance score
m_pPlayerStageStats->m_iCurPossibleDancePoints += TapNoteScoreToDancePoints( TNS_W1 );
//
// Regular combo
//
@@ -396,11 +402,7 @@ void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow )
{
m_pPlayerStageStats->m_iCurMissCombo = 0;
if( scoreOfLastTap >= m_MinScoreToContinueCombo )
{
m_pPlayerStageStats->m_iCurCombo += iComboCountIfHit;
if( m_pPlayerState->m_PlayerNumber != PLAYER_INVALID )
MESSAGEMAN->Broadcast( enum_add2(Message_CurrentComboChangedP1,m_pPlayerState->m_PlayerNumber) );
}
}
else
{
@@ -409,7 +411,10 @@ void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow )
++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
+3 -1
View File
@@ -15,6 +15,8 @@ AutoScreenMessage( SM_PlayToasty );
class ScoreKeeperNormal: public ScoreKeeper
{
void AddScoreInternal( TapNoteScore score );
int m_iScoreRemainder;
int m_iMaxPossiblePoints;
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 AddHoldScore( HoldNoteScore hns );
virtual void AddTapRowScore( TapNoteScore tns );
virtual void AddTapRowScore( TapNoteScore tns, const NoteData &nd, int iRow );
/* Configuration: */
/* Score after each tap will be rounded to the nearest m_iRoundTo; 1 to do nothing. */