diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 75e22fafca..574f296e3d 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -690,8 +690,6 @@ void Player::Step( int col, const RageTimer &tm ) int iIndexOverlappingNote = GetClosestNote( col, BeatToNoteRow(fSongBeat), iStepSearchRows, iStepSearchRows, false ); - //LOG->Trace( "iIndexStartLookingAt = %d, iNumElementsToExamine = %d", iIndexStartLookingAt, iNumElementsToExamine ); - // calculate TapNoteScore TapNoteScore score = TNS_NONE; @@ -735,37 +733,8 @@ void Player::Step( int col, const RageTimer &tm ) break; case TapNote::attack: - score = TNS_NONE; // don't score this as anything if( fSecondsFromPerfect <= ADJUSTED_WINDOW(Attack) && !tn.result.bHidden ) - { - m_soundAttackLaunch.Play(); - - // put attack in effect - Attack attack( - ATTACK_LEVEL_1, - -1, // now - tn.fAttackDurationSeconds, - tn.sAttackModifiers, - true, - false - ); - - // TODO: Remove use of PlayerNumber - PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - - GAMESTATE->LaunchAttack( OPPOSITE_PLAYER[pn], attack ); - - // remove all TapAttacks on this row - for( int t=0; t TNS_GOOD ) + score = TNS_PERFECT; /* sentinel */ + + /* AI will generate misses here. Don't handle a miss like a regular note because + * we want the judgment animation to appear delayed. Instead, return early if + * AI generated a miss, and let UpdateMissedTapNotesOlderThan() detect and handle the + * misses. */ + if( score == TNS_MISS ) + return; + break; default: @@ -821,6 +801,39 @@ void Player::Step( int col, const RageTimer &tm ) break; } + if( tn.type == TapNote::attack && score == TNS_PERFECT ) + { + score = TNS_NONE; // don't score this as anything + + m_soundAttackLaunch.Play(); + + // put attack in effect + Attack attack( + ATTACK_LEVEL_1, + -1, // now + tn.fAttackDurationSeconds, + tn.sAttackModifiers, + true, + false + ); + + // TODO: Remove use of PlayerNumber + PlayerNumber pn = m_pPlayerState->m_PlayerNumber; + + GAMESTATE->LaunchAttack( OPPOSITE_PLAYER[pn], attack ); + + // remove all TapAttacks on this row + for( int t=0; tDidTapNote( col, score, false ); } - switch( m_pPlayerState->m_PlayerController ) - { - case PC_HUMAN: - break; - - case PC_CPU: - case PC_AUTOPLAY: - /* AI will generate misses here. Don't handle a miss like a regular note because - * we want the judgment animation to appear delayed. Instead, return early if - * AI generated a miss, and let UpdateMissedTapNotesOlderThan() detect and handle the - * misses. */ - if( score == TNS_MISS ) - return; - - - if( tn.type == TapNote::attack && score > TNS_GOOD ) - { - m_soundAttackLaunch.Play(); - score = TNS_NONE; // don't score this as anything - - // put attack in effect - Attack attack( - ATTACK_LEVEL_1, - -1, // now - tn.fAttackDurationSeconds, - tn.sAttackModifiers, - true, - false - ); - - // TODO: Remove use of PlayerNumber. - PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - - GAMESTATE->LaunchAttack( OPPOSITE_PLAYER[pn], attack ); - - // remove all TapAttacks on this row - for( int t=0; tGetCurrentGame();