void ScoreKeeperNormal::HandleTapScore( const TapNote &tn ) { TapNoteScore tns = tn.result.tns; if( tn.type == TapNoteType_Mine ) { if( tns == TNS_HitMine ) { if( !m_pPlayerStageStats->m_bFailed ) m_pPlayerStageStats->m_iActualDancePoints += TapNoteScoreToDancePoints( TNS_HitMine ); m_pPlayerStageStats->m_iTapNoteScores[TNS_HitMine] += 1; if( m_MineHitIncrementsMissCombo ) HandleComboInternal( 0, 0, 1 ); } if( tns == TNS_AvoidMine && m_AvoidMineIncrementsCombo ) HandleComboInternal( 1, 0, 0 ); NSMAN->ReportScore( m_pPlayerState->m_PlayerNumber, tns, m_pPlayerStageStats->m_iScore, m_pPlayerStageStats->m_iCurCombo, tn.result.fTapNoteOffset ); Message msg( "ScoreChanged" ); msg.SetParam( "PlayerNumber", m_pPlayerState->m_PlayerNumber ); msg.SetParam( "MultiPlayer", m_pPlayerState->m_mp ); MESSAGEMAN->Broadcast( msg ); } AddTapScore( tns ); }
void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow ) { int iNumHitContinueCombo, iNumHitMaintainCombo, iNumBreakCombo; GetRowCounts( nd, iRow, iNumHitContinueCombo, iNumHitMaintainCombo, iNumBreakCombo ); int iNumTapsInRow = iNumHitContinueCombo + iNumHitMaintainCombo + iNumBreakCombo; if( iNumTapsInRow <= 0 ) return; m_iNumNotesHitThisRow = iNumTapsInRow; TapNoteScore scoreOfLastTap = NoteDataWithScoring::LastTapNoteWithResult( nd, iRow ).result.tns; HandleTapNoteScoreInternal( scoreOfLastTap, TNS_W1, iRow ); if ( GAMESTATE->GetCurrentGame()->m_bCountNotesSeparately ) { HandleComboInternal( iNumHitContinueCombo, iNumHitMaintainCombo, iNumBreakCombo, iRow ); } else { HandleRowComboInternal( scoreOfLastTap, iNumTapsInRow, iRow ); //This should work? } 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 #ifndef DEBUG if( (GamePreferences::m_AutoPlay != PC_HUMAN || m_pPlayerState->m_PlayerOptions.GetCurrent().m_fPlayerAutoPlay != 0) && !GAMESTATE->m_bDemonstrationOrJukebox ) // cheaters always prosper >:D -aj comment edit { m_cur_toasty_combo = 0; return; } #endif //DEBUG // Toasty combo if(scoreOfLastTap >= m_toasty_min_tns) { m_cur_toasty_combo += iNumTapsInRow; if(m_cur_toasty_combo > m_next_toasty_at && !GAMESTATE->m_bDemonstrationOrJukebox) { ++m_cur_toasty_level; // Broadcast the message before posting the screen message so that the // transition layer can catch the message to know the level and respond // accordingly. -Kyz Message msg("ToastyAchieved"); msg.SetParam("PlayerNumber", m_pPlayerState->m_PlayerNumber); msg.SetParam("ToastyCombo", m_cur_toasty_combo); msg.SetParam("Level", m_cur_toasty_level); MESSAGEMAN->Broadcast(msg); SCREENMAN->PostMessageToTopScreen(SM_PlayToasty, 0); // TODO: keep a pointer to the Profile. Don't index with m_PlayerNumber // TODO: Make the profile count the level and combo of the toasty. -Kyz PROFILEMAN->IncrementToastiesCount(m_pPlayerState->m_PlayerNumber); m_next_toasty_at= CalcNextToastyAt(m_cur_toasty_level); } } else { m_cur_toasty_combo = 0; m_cur_toasty_level= 0; m_next_toasty_at= 0; m_next_toasty_at= CalcNextToastyAt(m_cur_toasty_level); Message msg("ToastyDropped"); msg.SetParam( "PlayerNumber", m_pPlayerState->m_PlayerNumber ); MESSAGEMAN->Broadcast(msg); } // TODO: Remove indexing with PlayerNumber PlayerNumber pn = m_pPlayerState->m_PlayerNumber; float offset = NoteDataWithScoring::LastTapNoteWithResult( nd, iRow ).result.fTapNoteOffset; NSMAN->ReportScore( pn, scoreOfLastTap, m_pPlayerStageStats->m_iScore, m_pPlayerStageStats->m_iCurCombo, offset, m_iNumNotesHitThisRow); Message msg( "ScoreChanged" ); msg.SetParam( "PlayerNumber", m_pPlayerState->m_PlayerNumber ); msg.SetParam( "MultiPlayer", m_pPlayerState->m_mp ); msg.SetParam( "ToastyCombo", m_cur_toasty_combo ); MESSAGEMAN->Broadcast( msg ); }
void ScoreKeeperNormal::HandleHoldCheckpointScore( const NoteData &nd, int iRow, int iNumHoldsHeldThisRow, int iNumHoldsMissedThisRow ) { HandleTapNoteScoreInternal(iNumHoldsMissedThisRow == 0 ? TNS_CheckpointHit:TNS_CheckpointMiss, TNS_CheckpointHit, iRow); HandleComboInternal( iNumHoldsHeldThisRow, 0, iNumHoldsMissedThisRow, iRow ); }
void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow ) { int iNumHitContinueCombo, iNumHitMaintainCombo, iNumBreakCombo; GetRowCounts( nd, iRow, iNumHitContinueCombo, iNumHitMaintainCombo, iNumBreakCombo ); int iNumTapsInRow = iNumHitContinueCombo + iNumHitMaintainCombo + iNumBreakCombo; if( iNumTapsInRow <= 0 ) return; m_iNumNotesHitThisRow = iNumTapsInRow; TapNoteScore scoreOfLastTap = NoteDataWithScoring::LastTapNoteWithResult( nd, iRow ).result.tns; HandleTapNoteScoreInternal( scoreOfLastTap, TNS_W1, iRow ); if ( GAMESTATE->GetCurrentGame()->m_bCountNotesSeparately ) { HandleComboInternal( iNumHitContinueCombo, iNumHitMaintainCombo, iNumBreakCombo, iRow ); } else { HandleRowComboInternal( scoreOfLastTap, iNumTapsInRow, iRow ); //This should work? } 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 #ifndef DEBUG if( (GamePreferences::m_AutoPlay != PC_HUMAN || m_pPlayerState->m_PlayerOptions.GetCurrent().m_fPlayerAutoPlay != 0) && !GAMESTATE->m_bDemonstrationOrJukebox ) // cheaters always prosper >:D -aj comment edit { m_iCurToastyCombo = 0; return; } #endif //DEBUG // Toasty combo //vector<int> iToastyMilestones; switch( scoreOfLastTap ) { case TNS_W1: case TNS_W2: m_iCurToastyCombo += iNumTapsInRow; /* // compile the list of toasty triggers { Lua *L = LUA->Get(); m_vToastyTriggers.PushSelf(L); LuaHelpers::ReadArrayFromTable(iToastyMilestones, L); lua_pop( L, 1 ); LUA->Release(L); } // find out which one we're at. if(m_iCurToastyTrigger <= int(iToastyMilestones.size())) { m_iNextToastyAt = iToastyMilestones[m_iCurToastyTrigger]; } else // out of index value? then don't make it toasty! { m_iNextToastyAt = -1; } */ if( m_iCurToastyCombo >= m_ToastyTrigger && m_iCurToastyCombo - iNumTapsInRow < m_ToastyTrigger && !GAMESTATE->m_bDemonstrationOrJukebox ) { SCREENMAN->PostMessageToTopScreen( SM_PlayToasty, 0 ); Message msg("ToastyAchieved"); msg.SetParam( "PlayerNumber", m_pPlayerState->m_PlayerNumber ); msg.SetParam( "ToastyCombo", m_iCurToastyCombo ); MESSAGEMAN->Broadcast(msg); // TODO: keep a pointer to the Profile. Don't index with m_PlayerNumber PROFILEMAN->IncrementToastiesCount( m_pPlayerState->m_PlayerNumber ); //m_iCurToastyTrigger++; } break; default: m_iCurToastyCombo = 0; Message msg("ToastyDropped"); msg.SetParam( "PlayerNumber", m_pPlayerState->m_PlayerNumber ); MESSAGEMAN->Broadcast(msg); break; } // TODO: Remove indexing with PlayerNumber PlayerNumber pn = m_pPlayerState->m_PlayerNumber; float offset = NoteDataWithScoring::LastTapNoteWithResult( nd, iRow ).result.fTapNoteOffset; NSMAN->ReportScore( pn, scoreOfLastTap, m_pPlayerStageStats->m_iScore, m_pPlayerStageStats->m_iCurCombo, offset ); Message msg( "ScoreChanged" ); msg.SetParam( "PlayerNumber", m_pPlayerState->m_PlayerNumber ); msg.SetParam( "MultiPlayer", m_pPlayerState->m_mp ); msg.SetParam( "ToastyCombo", m_iCurToastyCombo ); MESSAGEMAN->Broadcast( msg ); }