From 6889c8be3fa207172405b567947d10e818f52fce Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 27 Apr 2005 06:34:53 +0000 Subject: [PATCH] Move "30misses" to a GiveUp metric. It's not very different from FailEndOfSong. Only fail when giving up if died earlier. --- stepmania/Themes/default/metrics.ini | 4 +-- stepmania/src/GameState.cpp | 2 +- stepmania/src/ScreenGameplay.cpp | 37 ++++++++-------------- stepmania/src/ScreenGameplay.h | 3 +- stepmania/src/ScreenOptionsMasterPrefs.cpp | 5 ++- stepmania/src/SongOptions.cpp | 2 -- stepmania/src/SongOptions.h | 1 - 7 files changed, 20 insertions(+), 34 deletions(-) diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 6cdf010370..ba9085c0b6 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -1010,7 +1010,8 @@ NextScreen=@GetGameplayNextScreen() PlayerType=Player StartGivesUp=1 BackGivesUp=0 -GivingUpFails=1 +GivingUpGoesToPrevScreen=0 +GivingUpGoesToNextScreen=0 InitialBackgroundBrightness=1 MusicFadeOutSeconds=0.5 UseForcedModifiersInBeginner=0 @@ -1193,7 +1194,6 @@ PlayerP2TwoPlayersTwoSidesX=SCREEN_CENTER_X+160 PlayerP1OnePlayerTwoSidesX=SCREEN_CENTER_X PlayerP2OnePlayerTwoSidesX=SCREEN_CENTER_X StopCourseEarly=0 -GivingUpGoesToNextScreen=0 [ScreenGameplayExtra] Class=ScreenGameplay diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 8c66d30867..43fb06598c 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -1290,7 +1290,7 @@ SongOptions::FailType GameState::GetPlayerFailType( PlayerNumber pn ) const if( this->IsCourseMode() ) { if( PREFSMAN->m_bMinimum1FullSongInCourses && GAMESTATE->IsCourseMode() && GAMESTATE->GetCourseSongIndex()==0 ) - ft = max( ft, SongOptions::FAIL_COMBO_OF_30_MISSES ); // take the least harsh of the two FailTypes + ft = max( ft, SongOptions::FAIL_END_OF_SONG ); // take the least harsh of the two FailTypes } else { diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 372cc2b9cc..ab3da921b1 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -95,8 +95,9 @@ ScreenGameplay::ScreenGameplay( CString sName ) : ScreenWithMenuElements(sName) MUSIC_FADE_OUT_SECONDS.Load( sName, "MusicFadeOutSeconds" ); START_GIVES_UP.Load( sName, "StartGivesUp" ); BACK_GIVES_UP.Load( sName, "BackGivesUp" ); - GIVING_UP_FAILS.Load( sName, "GivingUpFails" ); + GIVING_UP_GOES_TO_PREV_SCREEN.Load( sName, "GivingUpGoesToPrevScreen" ); GIVING_UP_GOES_TO_NEXT_SCREEN.Load( sName, "GivingUpGoesToNextScreen" ); + GIVE_UP_AFTER_30_MISSES.Load( sName, "GiveUpAfter30Misses" ); USE_FORCED_MODIFIERS_IN_BEGINNER.Load( sName, "UseForcedModifiersInBeginner" ); FORCED_MODIFIERS_IN_BEGINNER.Load( sName, "ForcedModifiersInBeginner" ); } @@ -1428,10 +1429,6 @@ void ScreenGameplay::Update( float fDeltaTime ) if( GAMESTATE->m_pPlayerState[pn]->m_HealthState < PlayerState::DEAD ) bAllFailed = false; break; - case SongOptions::FAIL_COMBO_OF_30_MISSES: - if( STATSMAN->m_CurStageStats.m_player[pn].iCurMissCombo < 30 ) - bAllFailed = false; - break; case SongOptions::FAIL_END_OF_SONG: bAllFailed = false; // wait until the end of the song to fail. break; @@ -1556,29 +1553,17 @@ void ScreenGameplay::Update( float fDeltaTime ) } // - // update give up timer + // update give up // - if( !m_GiveUpTimer.IsZero() && m_GiveUpTimer.Ago() > 2.5f ) + bool bGiveUpTimerFired = !m_GiveUpTimer.IsZero() && m_GiveUpTimer.Ago() > 2.5f; + if( bGiveUpTimerFired || GAMESTATE->AllHaveComboOf30OrMoreMisses() ) { m_GiveUpTimer.SetZero(); - if( GIVING_UP_FAILS ) + if( GIVING_UP_GOES_TO_PREV_SCREEN ) { - /* Unless we're in FailOff, giving up means failing the song. */ - switch( GAMESTATE->m_SongOptions.m_FailType ) - { - case SongOptions::FAIL_IMMEDIATE: - case SongOptions::FAIL_COMBO_OF_30_MISSES: - case SongOptions::FAIL_END_OF_SONG: - FOREACH_EnabledPlayer(p) - { - STATSMAN->m_CurStageStats.m_player[p].bFailed = true; // fail - m_pLifeMeter[p]->ForceFail(); - STATSMAN->m_CurStageStats.m_player[p].SetLifeRecordAt( 0, STATSMAN->m_CurStageStats.fGameplaySeconds ); - } - } + BackOutFromGameplay(); - this->PostScreenMessage( SM_NotesEnded, 0 ); } else if( GIVING_UP_GOES_TO_NEXT_SCREEN ) { @@ -1587,9 +1572,9 @@ void ScreenGameplay::Update( float fDeltaTime ) } else { - BackOutFromGameplay(); - return; + this->PostScreenMessage( SM_NotesEnded, 0 ); } + return; } // @@ -2233,6 +2218,10 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) if( !STATSMAN->m_CurStageStats.m_player[p].bFailed ) STATSMAN->m_CurStageStats.m_player[p].iSongsPassed++; + + // set a life record at the point of failue + if( STATSMAN->m_CurStageStats.m_player[p].bFailed ) + STATSMAN->m_CurStageStats.m_player[p].SetLifeRecordAt( 0, STATSMAN->m_CurStageStats.fGameplaySeconds ); } /* If all players have *really* failed (bFailed, not the life meter or diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index b3c1d02833..b6c10ab004 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -50,8 +50,9 @@ protected: ThemeMetric MUSIC_FADE_OUT_SECONDS; ThemeMetric START_GIVES_UP; ThemeMetric BACK_GIVES_UP; - ThemeMetric GIVING_UP_FAILS; + ThemeMetric GIVING_UP_GOES_TO_PREV_SCREEN; ThemeMetric GIVING_UP_GOES_TO_NEXT_SCREEN; + ThemeMetric GIVE_UP_AFTER_30_MISSES; ThemeMetric USE_FORCED_MODIFIERS_IN_BEGINNER; ThemeMetric FORCED_MODIFIERS_IN_BEGINNER; diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index f2ce4f86de..02ef47e2e9 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -408,9 +408,8 @@ static void DefaultFailType( int &sel, bool ToSel, const ConfOption *pConfOption switch( sel ) { case 0: so.m_FailType = SongOptions::FAIL_IMMEDIATE; break; - case 1: so.m_FailType = SongOptions::FAIL_COMBO_OF_30_MISSES; break; - case 2: so.m_FailType = SongOptions::FAIL_END_OF_SONG; break; - case 3: so.m_FailType = SongOptions::FAIL_OFF; break; + case 1: so.m_FailType = SongOptions::FAIL_END_OF_SONG; break; + case 2: so.m_FailType = SongOptions::FAIL_OFF; break; default: ASSERT(0); } diff --git a/stepmania/src/SongOptions.cpp b/stepmania/src/SongOptions.cpp index 2e3717eddf..5087c1ffe8 100644 --- a/stepmania/src/SongOptions.cpp +++ b/stepmania/src/SongOptions.cpp @@ -42,7 +42,6 @@ CString SongOptions::GetString() const switch( m_FailType ) { case FAIL_IMMEDIATE: break; - case FAIL_COMBO_OF_30_MISSES: sReturn += "Fail30Misses, "; break; case FAIL_END_OF_SONG: sReturn += "FailEndOfSong, "; break; case FAIL_OFF: sReturn += "FailOff, "; break; default: ASSERT(0); @@ -119,7 +118,6 @@ void SongOptions::FromString( CString sOptions ) else if( sBit == "normal-drain" ) m_DrainType = DRAIN_NORMAL; else if( sBit == "failarcade" || sBit == "failimmediate" ) m_FailType = FAIL_IMMEDIATE; - else if( sBit == "fail30misses" ) m_FailType = FAIL_COMBO_OF_30_MISSES; else if( sBit == "failendofsong" ) m_FailType = FAIL_END_OF_SONG; else if( sBit == "failoff" ) m_FailType = FAIL_OFF; diff --git a/stepmania/src/SongOptions.h b/stepmania/src/SongOptions.h index 6b88de13f4..0640f52a52 100644 --- a/stepmania/src/SongOptions.h +++ b/stepmania/src/SongOptions.h @@ -23,7 +23,6 @@ struct SongOptions int m_iBatteryLives; enum FailType { FAIL_IMMEDIATE=0, // fail when life touches 0 - FAIL_COMBO_OF_30_MISSES, // fail when 30 misses in a row, or on end of song if life touched 0 FAIL_END_OF_SONG, // fail on end of song if life touched 0 FAIL_OFF }; // never fail FailType m_FailType;