don't allow Hopo on the same note 2x in series

This commit is contained in:
Chris Danford
2006-12-01 05:37:33 +00:00
parent fced627efc
commit 3022def914
4 changed files with 29 additions and 6 deletions
+1 -1
View File
@@ -666,7 +666,7 @@ void GameState::ResetMusicStatistics()
FOREACH_PlayerNumber( p )
m_pPlayerState[p]->m_fLastHopoNoteMusicSeconds = -1;
m_pPlayerState[p]->ClearHopoState();
}
void GameState::ResetStageStatistics()
+19 -3
View File
@@ -1460,7 +1460,20 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
}
else
{
int iLastNoteCol = -1;
for( int i=GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer-1; i>=0; i-- )
{
const TapNote &tn = m_NoteData.GetTapNote( i, iRowOfOverlappingNoteOrRow );
bool bIsNote = (tn.type != TapNote::empty);
if( bIsNote )
{
iLastNoteCol = i;
break;
}
}
m_pPlayerState->m_fLastHopoNoteMusicSeconds = fStepSeconds;
m_pPlayerState->m_iLastHopoNoteCol = iLastNoteCol;
}
}
break;
@@ -1476,13 +1489,16 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
goto done_checking_hopo;
}
const TapNote &tn = m_NoteData.GetTapNote( col, iRowOfOverlappingNoteOrRow );
if( tn.type == TapNote::empty )
// con't hopo on the same note 2x in a row
if( col == m_pPlayerState->m_iLastHopoNoteCol )
{
bDidHopo = false;
goto done_checking_hopo;
}
const TapNote &tn = m_NoteData.GetTapNote( col, iRowOfOverlappingNoteOrRow );
ASSERT( tn.type != TapNote::empty );
int iRowsAgoLastNote = 100000; // TODO: find more reasonable value based on HOPO_CHAIN_SECONDS?
NoteData::all_tracks_reverse_iterator iter = m_NoteData.GetTapNoteRangeAllTracksReverse( iRowsAgoLastNote-iRowsAgoLastNote, iRowOfOverlappingNoteOrRow-1 );
ASSERT( !iter.IsAtEnd() ); // there must have been a note that started the hopo
@@ -1603,7 +1619,7 @@ done_checking_hopo:
// check for hopo end
if( score <= TNS_Miss )
{
m_pPlayerState->m_fLastHopoNoteMusicSeconds = -1;
m_pPlayerState->ClearHopoState();
}
+1
View File
@@ -20,6 +20,7 @@ void PlayerState::Reset()
m_HealthState = ALIVE;
m_fLastHopoNoteMusicSeconds = -1;
m_iLastHopoNoteCol = -1;
m_PlayerController = PC_HUMAN;
+8 -2
View File
@@ -34,8 +34,14 @@ public:
enum HealthState { HOT, ALIVE, DANGER, DEAD };
HealthState m_HealthState;
// Set to the MusicSeconds of the last note successfully strummed or hammered in a hammer chain
float m_fLastHopoNoteMusicSeconds; // if -1, then there is no current hammer chain
float m_fLastHopoNoteMusicSeconds; // Set to the MusicSeconds of the last note successfully strummed or hammered in a hopochain, -1, then there is no current hopo chain
int m_iLastHopoNoteCol; // if -1, then there is no current hopo chain
void ClearHopoState()
{
m_fLastHopoNoteMusicSeconds = -1;
m_iLastHopoNoteCol = -1;
}
PlayerController m_PlayerController;