Push check down.

This commit is contained in:
Steve Checkoway
2006-08-14 09:57:18 +00:00
parent 45db2de31d
commit 2f9bda2eea
+36 -35
View File
@@ -925,9 +925,6 @@ int Player::GetClosestNote( int col, int iNoteRow, int iMaxRowsAhead, int iMaxRo
void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRelease ) void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRelease )
{ {
// XXX: Ignore for now.
if( bRelease )
return;
// If we're playing on oni and we've died, do nothing. // If we're playing on oni and we've died, do nothing.
if( GAMESTATE->m_SongOptions.GetCurrent().m_LifeType == SongOptions::LIFE_BATTERY && m_pPlayerStageStats && m_pPlayerStageStats->bFailed ) if( GAMESTATE->m_SongOptions.GetCurrent().m_LifeType == SongOptions::LIFE_BATTERY && m_pPlayerStageStats && m_pPlayerStageStats->bFailed )
return; return;
@@ -939,7 +936,7 @@ void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRele
const float fSongBeat = GAMESTATE->m_pCurSong ? GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds ) : GAMESTATE->m_fSongBeat; const float fSongBeat = GAMESTATE->m_pCurSong ? GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds ) : GAMESTATE->m_fSongBeat;
const int iSongRow = row == -1 ? BeatToNoteRow( fSongBeat ) : row; const int iSongRow = row == -1 ? BeatToNoteRow( fSongBeat ) : row;
if( !bRelease )
{ {
// Update roll life // Update roll life
// Let's not check the whole array every time. // Let's not check the whole array every time.
@@ -1002,9 +999,9 @@ void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRele
// //
// Count calories for this step, unless we're being called because a button is // Count calories for this step, unless we're being called because a button is
// held over a mine. // held over a mine or being released.
// //
if( m_pPlayerStageStats && m_pPlayerState && !bHeld ) if( m_pPlayerStageStats && m_pPlayerState && !bHeld && !bRelease )
{ {
// TODO: remove use of PlayerNumber // TODO: remove use of PlayerNumber
PlayerNumber pn = m_pPlayerState->m_PlayerNumber; PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
@@ -1098,27 +1095,33 @@ void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRele
switch( m_pPlayerState->m_PlayerController ) switch( m_pPlayerState->m_PlayerController )
{ {
case PC_HUMAN: case PC_HUMAN:
if( !bRelease )
switch( tn.type )
{ {
case TapNote::mine: switch( tn.type )
// stepped too close to mine? {
if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_Mine) ) case TapNote::mine:
score = TNS_HitMine; // stepped too close to mine?
break; if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_Mine) )
score = TNS_HitMine;
break;
case TapNote::attack: case TapNote::attack:
if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_Attack) && !tn.result.bHidden ) if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_Attack) && !tn.result.bHidden )
score = TNS_W2; /* sentinel */ score = TNS_W2; /* sentinel */
break; break;
default: default:
if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_W1) ) score = TNS_W1; if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_W1) ) score = TNS_W1;
else if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_W2) ) score = TNS_W2; else if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_W2) ) score = TNS_W2;
else if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_W3) ) score = TNS_W3; else if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_W3) ) score = TNS_W3;
else if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_W4) ) score = TNS_W4; else if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_W4) ) score = TNS_W4;
else if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_W5) ) score = TNS_W5; else if( fSecondsFromExact <= ADJUSTED_WINDOW_SECONDS(TW_W5) ) score = TNS_W5;
else score = TNS_None; else score = TNS_None;
break; break;
}
}
else
{
// XXX:
} }
break; break;
@@ -1248,14 +1251,7 @@ void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRele
} }
} }
if( score != TNS_None )
if( m_pNoteField )
m_pNoteField->Step( col, score );
bool bSteppedOnATap = score != TNS_None;
if( bSteppedOnATap )
{ {
/* Search for keyed sounds separately. If we can't find a nearby note, search /* Search for keyed sounds separately. If we can't find a nearby note, search
* backwards indefinitely, and ignore grading. */ * backwards indefinitely, and ignore grading. */
@@ -1275,8 +1271,13 @@ void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRele
m_vKeysounds[tn.iKeysoundIndex].Play(); m_vKeysounds[tn.iKeysoundIndex].Play();
} }
} }
// XXX:
MESSAGEMAN->Broadcast( m_sMessageToSendOnStep ); if( !bRelease )
{
if( m_pNoteField )
m_pNoteField->Step( col, score );
MESSAGEMAN->Broadcast( m_sMessageToSendOnStep );
}
} }
static bool Unjudged( const TapNote &tn ) static bool Unjudged( const TapNote &tn )