From 0ce2147bc22fa02c2d3f772b911a69eb453b9fd8 Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Fri, 25 Jul 2003 08:05:29 +0000 Subject: [PATCH] added "courses only" option for marvelous judgement --- stepmania/src/GameState.cpp | 12 ++++++++++++ stepmania/src/GameState.h | 2 ++ stepmania/src/Player.cpp | 2 +- stepmania/src/PrefsManager.cpp | 6 +++--- stepmania/src/PrefsManager.h | 2 +- stepmania/src/ScoreKeeperMAX2.cpp | 9 +++++---- stepmania/src/ScreenEvaluation.cpp | 2 +- stepmania/src/ScreenGameplayOptions.cpp | 6 +++--- 8 files changed, 28 insertions(+), 13 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 41c88ca534..1fec09c7f7 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -590,3 +590,15 @@ void GameState::AdjustFailType() GAMESTATE->m_iCurrentStageIndex == 0) setmax(GAMESTATE->m_SongOptions.m_FailType, SongOptions::FAIL_OFF); } + +bool GameState::ShowMarvelous() const +{ + if (PREFSMAN->m_iMarvelousTiming == 2) + return true; + + if (PREFSMAN->m_iMarvelousTiming == 1) + if (IsCourseMode()) + return true; + + return false; +} \ No newline at end of file diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index 7d6d13dc06..02006a2f98 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -102,6 +102,8 @@ public: bool IsCourseMode() const; bool IsBattleMode() const; /* not Rave */ + bool ShowMarvelous() const; + CString m_sLoadingMessage; // used in loading screen CString m_sPreferredGroup; // GROUP_ALL_MUSIC denotes no preferred group bool m_bChangedFailType; // true if FailType was changed in the song options screen diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index cb52c4438f..2526f32fde 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -464,7 +464,7 @@ void Player::Step( int col, RageTimer tm ) break; } - if( score==TNS_MARVELOUS && !PREFSMAN->m_bMarvelousTiming ) + if( score==TNS_MARVELOUS && !GAMESTATE->ShowMarvelous()) score = TNS_PERFECT; bGrayArrowStep = score < TNS_GOOD; diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index b3f9b2be38..e6d631139b 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -82,7 +82,7 @@ PrefsManager::PrefsManager() m_MusicWheelUsesSections = ALWAYS; m_iMusicWheelSwitchSpeed = 10; m_bEasterEggs = true; - m_bMarvelousTiming = true; + m_iMarvelousTiming = 2; m_iCoinMode = COIN_HOME; m_iCoinsPerCredit = 1; m_bJointPremium = false; @@ -191,7 +191,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) ini.GetValueI( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed ); ini.GetValue ( "Options", "SoundDrivers", m_sSoundDrivers ); ini.GetValueB( "Options", "EasterEggs", m_bEasterEggs ); - ini.GetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming ); + ini.GetValueI( "Options", "MarvelousTiming", (int&)m_iMarvelousTiming ); ini.GetValueF( "Options", "SoundVolume", m_fSoundVolume ); ini.GetValueB( "Options", "SoundPreloadAll", m_bSoundPreloadAll ); ini.GetValueI( "Options", "CoinMode", m_iCoinMode ); @@ -291,7 +291,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() ini.SetValueI( "Options", "MusicWheelUsesSections", m_MusicWheelUsesSections ); ini.SetValueI( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed ); ini.SetValueB( "Options", "EasterEggs", m_bEasterEggs ); - ini.SetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming ); + ini.SetValueI( "Options", "MarvelousTiming", m_iMarvelousTiming ); ini.SetValueB( "Options", "SoundPreloadAll", m_bSoundPreloadAll ); ini.SetValueI( "Options", "CoinMode", m_iCoinMode ); ini.SetValueI( "Options", "CoinsPerCredit", m_iCoinsPerCredit ); diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 3fd96c1fa5..97e7643a5a 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -60,7 +60,7 @@ public: enum { NEVER, ALWAYS, ABC_ONLY } m_MusicWheelUsesSections; int m_iMusicWheelSwitchSpeed; bool m_bEasterEggs; - bool m_bMarvelousTiming; + int m_iMarvelousTiming; int m_iCoinMode; int m_iCoinsPerCredit; bool m_bJointPremium; diff --git a/stepmania/src/ScoreKeeperMAX2.cpp b/stepmania/src/ScoreKeeperMAX2.cpp index 2e36d43581..e04837c8cc 100644 --- a/stepmania/src/ScoreKeeperMAX2.cpp +++ b/stepmania/src/ScoreKeeperMAX2.cpp @@ -178,7 +178,7 @@ void ScoreKeeperMAX2::AddScore( TapNoteScore score ) */ int p = 0; // score multiplier - const bool MarvelousEnabled = GAMESTATE->IsCourseMode() && PREFSMAN->m_bMarvelousTiming; + const bool MarvelousEnabled = GAMESTATE->IsCourseMode() && (PREFSMAN->m_iMarvelousTiming > 0); switch( score ) { @@ -416,7 +416,8 @@ int ScoreKeeperMAX2::GetPossibleDancePoints( const NoteData* pNoteData ) /* Note that, if Marvelous timing is disabled or not active (not course mode), * PERFECT will be used instead. */ - TapNoteScore maxPossibleTapScore = PREFSMAN->m_bMarvelousTiming ? TNS_MARVELOUS : TNS_PERFECT; + TapNoteScore maxPossibleTapScore = + (GAMESTATE->ShowMarvelous() ) ? TNS_MARVELOUS : TNS_PERFECT; return pNoteData->GetNumRowsWithTaps()*TapNoteScoreToDancePoints(maxPossibleTapScore)+ pNoteData->GetNumHoldNotes()*HoldNoteScoreToDancePoints(HNS_OK); @@ -425,7 +426,7 @@ int ScoreKeeperMAX2::GetPossibleDancePoints( const NoteData* pNoteData ) int ScoreKeeperMAX2::TapNoteScoreToDancePoints( TapNoteScore tns ) { - if(!PREFSMAN->m_bMarvelousTiming && tns == TNS_MARVELOUS) + if(GAMESTATE->ShowMarvelous() && tns == TNS_MARVELOUS) tns = TNS_PERFECT; /* @@ -514,7 +515,7 @@ int ScoreKeeperMAX2::HoldNoteScoreToDancePoints( HoldNoteScore hns ) case PLAY_MODE_ONI: switch( hns ) { - case HNS_OK: return PREFSMAN->m_bMarvelousTiming? +3:+2; + case HNS_OK: return (PREFSMAN->m_iMarvelousTiming != 0)? +3:+2; case HNS_NG: return +0; } break; diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index fe7b278a78..db6b69958d 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -554,7 +554,7 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type ) : Screen(sCl for( l=0; lm_bMarvelousTiming ) + if( l == 0 && !GAMESTATE->ShowMarvelous() ) continue; // skip if( SHOW_JUDGMENT(l) ) diff --git a/stepmania/src/ScreenGameplayOptions.cpp b/stepmania/src/ScreenGameplayOptions.cpp index 87198d0a1b..ee53ad5ff7 100644 --- a/stepmania/src/ScreenGameplayOptions.cpp +++ b/stepmania/src/ScreenGameplayOptions.cpp @@ -37,7 +37,7 @@ OptionRow g_GameplayOptionsLines[NUM_GAMEPLAY_OPTIONS_LINES] = { OptionRow( "Solo\nSingles", "OFF","ON" ), OptionRow( "Hidden\nSongs", "OFF","ON" ), OptionRow( "Easter\nEggs", "OFF","ON" ), - OptionRow( "Marvelous\nTiming", "OFF","ON" ), + OptionRow( "Marvelous\nTiming", "NEVER","COURSES ONLY","ALWAYS" ), OptionRow( "Pick Extra\nStage", "OFF","ON" ), OptionRow( "Unlock\nSystem", "OFF","ON" ) }; @@ -62,7 +62,7 @@ void ScreenGameplayOptions::ImportOptions() m_iSelectedOption[0][GO_SOLO_SINGLE] = PREFSMAN->m_bSoloSingle ? 1:0; m_iSelectedOption[0][GO_HIDDEN_SONGS] = PREFSMAN->m_bHiddenSongs ? 1:0; m_iSelectedOption[0][GO_EASTER_EGGS] = PREFSMAN->m_bEasterEggs ? 1:0; - m_iSelectedOption[0][GO_MARVELOUS] = PREFSMAN->m_bMarvelousTiming ? 1:0; + m_iSelectedOption[0][GO_MARVELOUS] = PREFSMAN->m_iMarvelousTiming; m_iSelectedOption[0][GO_PICK_EXTRA_STAGE] = PREFSMAN->m_bPickExtraStage? 1:0; m_iSelectedOption[0][GO_UNLOCK_SYSTEM] = PREFSMAN->m_bUseUnlockSystem? 1:0; } @@ -72,7 +72,7 @@ void ScreenGameplayOptions::ExportOptions() PREFSMAN->m_bSoloSingle = m_iSelectedOption[0][GO_SOLO_SINGLE] == 1; PREFSMAN->m_bHiddenSongs = m_iSelectedOption[0][GO_HIDDEN_SONGS] == 1; PREFSMAN->m_bEasterEggs = m_iSelectedOption[0][GO_EASTER_EGGS] == 1; - PREFSMAN->m_bMarvelousTiming = m_iSelectedOption[0][GO_MARVELOUS] == 1; + PREFSMAN->m_iMarvelousTiming = m_iSelectedOption[0][GO_MARVELOUS]; PREFSMAN->m_bPickExtraStage = m_iSelectedOption[0][GO_PICK_EXTRA_STAGE] == 1; PREFSMAN->m_bUseUnlockSystem = m_iSelectedOption[0][GO_UNLOCK_SYSTEM] == 1; }