simplify
This commit is contained in:
@@ -1734,18 +1734,15 @@ void Player::HandleTapRowScore( unsigned row )
|
|||||||
m_pSecondaryScoreKeeper->HandleTapScore( tn );
|
m_pSecondaryScoreKeeper->HandleTapScore( tn );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bComboStopped = false;
|
|
||||||
bool bMissComboStopped = false;
|
|
||||||
|
|
||||||
const int iCurCombo = m_pPlayerStageStats ? m_pPlayerStageStats->m_iCurCombo : 0;
|
const int iCurCombo = m_pPlayerStageStats ? m_pPlayerStageStats->m_iCurCombo : 0;
|
||||||
const int iCurMissCombo = m_pPlayerStageStats ? m_pPlayerStageStats->m_iCurMissCombo : 0;
|
const int iCurMissCombo = m_pPlayerStageStats ? m_pPlayerStageStats->m_iCurMissCombo : 0;
|
||||||
|
|
||||||
if( m_pPrimaryScoreKeeper != NULL )
|
if( m_pPrimaryScoreKeeper != NULL )
|
||||||
m_pPrimaryScoreKeeper->HandleTapRowScore( m_NoteData, row, bComboStopped, bMissComboStopped );
|
m_pPrimaryScoreKeeper->HandleTapRowScore( m_NoteData, row );
|
||||||
if( iOldCombo > 50 && iCurCombo < 50 )
|
if( iOldCombo > 50 && iCurCombo < 50 )
|
||||||
SCREENMAN->PostMessageToTopScreen( SM_ComboStopped, 0 );
|
SCREENMAN->PostMessageToTopScreen( SM_ComboStopped, 0 );
|
||||||
if( m_pSecondaryScoreKeeper != NULL )
|
if( m_pSecondaryScoreKeeper != NULL )
|
||||||
m_pSecondaryScoreKeeper->HandleTapRowScore( m_NoteData, row, bComboStopped, bMissComboStopped );
|
m_pSecondaryScoreKeeper->HandleTapRowScore( m_NoteData, row );
|
||||||
|
|
||||||
if( m_pPlayerStageStats && m_pCombo )
|
if( m_pPlayerStageStats && m_pCombo )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
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)
|
||||||
|
|
||||||
virtual void HandleTapScore( const TapNote &tn ) = 0;
|
virtual void HandleTapScore( const TapNote &tn ) = 0;
|
||||||
virtual void HandleTapRowScore( const NoteData &nd, int iRow, bool &bComboStopped, bool &bMissComboStopped ) = 0;
|
virtual void HandleTapRowScore( const NoteData &nd, int iRow ) = 0;
|
||||||
virtual void HandleHoldScore( const TapNote &tn ) = 0;
|
virtual void HandleHoldScore( const TapNote &tn ) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -350,13 +350,11 @@ void ScoreKeeperNormal::HandleTapScore( const TapNote &tn )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow, bool &bComboStopped, bool &bMissComboStopped )
|
void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow )
|
||||||
{
|
{
|
||||||
TapNoteScore scoreOfLastTap;
|
TapNoteScore scoreOfLastTap;
|
||||||
int iNumTapsInRow;
|
int iNumTapsInRow;
|
||||||
|
|
||||||
bComboStopped = false;
|
|
||||||
bMissComboStopped = false;
|
|
||||||
GetScoreOfLastTapInRow( nd, iRow, scoreOfLastTap, iNumTapsInRow );
|
GetScoreOfLastTapInRow( nd, iRow, scoreOfLastTap, iNumTapsInRow );
|
||||||
|
|
||||||
if( iNumTapsInRow <= 0 )
|
if( iNumTapsInRow <= 0 )
|
||||||
@@ -378,14 +376,12 @@ void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow, bool &b
|
|||||||
const int iComboCountIfHit = m_bComboIsPerRow? 1: iNumTapsInRow;
|
const int iComboCountIfHit = m_bComboIsPerRow? 1: iNumTapsInRow;
|
||||||
if( scoreOfLastTap >= m_MinScoreToMaintainCombo )
|
if( scoreOfLastTap >= m_MinScoreToMaintainCombo )
|
||||||
{
|
{
|
||||||
bMissComboStopped = true;
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bComboStopped = true;
|
|
||||||
m_pPlayerStageStats->m_iCurCombo = 0;
|
m_pPlayerStageStats->m_iCurCombo = 0;
|
||||||
if( scoreOfLastTap == TNS_Miss )
|
if( scoreOfLastTap == TNS_Miss )
|
||||||
++m_pPlayerStageStats->m_iCurMissCombo;
|
++m_pPlayerStageStats->m_iCurMissCombo;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public:
|
|||||||
void OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData );
|
void OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData );
|
||||||
|
|
||||||
void HandleTapScore( const TapNote &tn );
|
void HandleTapScore( const TapNote &tn );
|
||||||
void HandleTapRowScore( const NoteData &nd, int iRow, bool &bComboStopped, bool &bMissComboStopped );
|
void HandleTapRowScore( const NoteData &nd, int iRow );
|
||||||
void HandleHoldScore( const TapNote &tn );
|
void HandleHoldScore( const TapNote &tn );
|
||||||
|
|
||||||
// This must be calculated using only cached radar values so that we can
|
// This must be calculated using only cached radar values so that we can
|
||||||
|
|||||||
@@ -31,15 +31,12 @@ void ScoreKeeperRave::HandleTapScore( const TapNote &tn )
|
|||||||
|
|
||||||
#define CROSSED( val ) (fOld < val && fNew >= val)
|
#define CROSSED( val ) (fOld < val && fNew >= val)
|
||||||
#define CROSSED_ATTACK_LEVEL( level ) CROSSED(1.f/NUM_ATTACK_LEVELS*(level+1))
|
#define CROSSED_ATTACK_LEVEL( level ) CROSSED(1.f/NUM_ATTACK_LEVELS*(level+1))
|
||||||
void ScoreKeeperRave::HandleTapRowScore( const NoteData &nd, int iRow, bool &bComboStopped, bool &bMissComboStopped )
|
void ScoreKeeperRave::HandleTapRowScore( const NoteData &nd, int iRow )
|
||||||
{
|
{
|
||||||
TapNoteScore scoreOfLastTap;
|
TapNoteScore scoreOfLastTap;
|
||||||
int iNumTapsInRow;
|
int iNumTapsInRow;
|
||||||
float fPercentToMove;
|
float fPercentToMove;
|
||||||
|
|
||||||
bComboStopped = false;
|
|
||||||
bMissComboStopped = false;
|
|
||||||
|
|
||||||
GetScoreOfLastTapInRow( nd, iRow, scoreOfLastTap, iNumTapsInRow );
|
GetScoreOfLastTapInRow( nd, iRow, scoreOfLastTap, iNumTapsInRow );
|
||||||
if( iNumTapsInRow <= 0 )
|
if( iNumTapsInRow <= 0 )
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public:
|
|||||||
ScoreKeeperRave( PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats );
|
ScoreKeeperRave( PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats );
|
||||||
void OnNextSong( int iSongInCourseIndex, const Steps *pSteps, const NoteData *pNoteData ) { }
|
void OnNextSong( int iSongInCourseIndex, const Steps *pSteps, const NoteData *pNoteData ) { }
|
||||||
void HandleTapScore( const TapNote &tn );
|
void HandleTapScore( const TapNote &tn );
|
||||||
void HandleTapRowScore( const NoteData &nd, int iRow, bool &bComboStopped, bool &bMissComboStopped );
|
void HandleTapRowScore( const NoteData &nd, int iRow );
|
||||||
void HandleHoldScore( const TapNote &tn );
|
void HandleHoldScore( const TapNote &tn );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
Reference in New Issue
Block a user