From 08bf61191d04b6579ca02cc65e57812b4c8d1017 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 9 Nov 2006 09:09:40 +0000 Subject: [PATCH] Add FailAtEnd, which means "check failure only at the very end of the song" (intended for use with "PassMark", which needs a better name). This isn't called "FailEndOfSong" to avoid confusion, and was the prompting for renaming FailEndOfSong.) --- stepmania/src/ScreenGameplay.cpp | 5 +++-- stepmania/src/ScreenOptionsMasterPrefs.cpp | 5 +++-- stepmania/src/SongOptions.cpp | 2 ++ stepmania/src/SongOptions.h | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index beaccb858a..1a788c0994 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1604,7 +1604,7 @@ void ScreenGameplay::Update( float fDeltaTime ) SongOptions::FailType ft = GAMESTATE->GetPlayerFailType( pi->GetPlayerState() ); SongOptions::LifeType lt = GAMESTATE->m_SongOptions.GetCurrent().m_LifeType; - if( ft == SongOptions::FAIL_OFF ) + if( ft == SongOptions::FAIL_OFF || ft == SongOptions::FAIL_AT_END ) continue; // check for individual fail @@ -1649,7 +1649,8 @@ void ScreenGameplay::Update( float fDeltaTime ) if( pi->m_pLifeMeter && !pi->m_pLifeMeter->IsFailing() ) bAllFailed = false; break; - case SongOptions::FAIL_END_OF_SONG: + case SongOptions::FAIL_IMMEDIATE_CONTINUE: + case SongOptions::FAIL_AT_END: bAllFailed = false; // wait until the end of the song to fail. break; case SongOptions::FAIL_OFF: diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index f98e9e35f9..49ac622c8f 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -451,7 +451,8 @@ static void DefaultFailType( int &sel, bool ToSel, const ConfOption *pConfOption { case 0: so.m_FailType = SongOptions::FAIL_IMMEDIATE; break; case 1: so.m_FailType = SongOptions::FAIL_IMMEDIATE_CONTINUE; break; - case 2: so.m_FailType = SongOptions::FAIL_OFF; break; + case 2: so.m_FailType = SongOptions::FAIL_AT_END; break; + case 3: so.m_FailType = SongOptions::FAIL_OFF; break; default: ASSERT(0); } @@ -652,7 +653,7 @@ static void InitializeConfOptions() ADD( ConfOption( "ProgressiveLifebar", MovePref, "Off","|1","|2","|3","|4","|5","|6","|7","|8") ); ADD( ConfOption( "ProgressiveStageLifebar", MovePref, "Off","|1","|2","|3","|4","|5","|6","|7","|8","Insanity") ); ADD( ConfOption( "ProgressiveNonstopLifebar", MovePref, "Off","|1","|2","|3","|4","|5","|6","|7","|8","Insanity") ); - ADD( ConfOption( "DefaultFailType", DefaultFailType, "Immediate","End of Song","Off" ) ); + ADD( ConfOption( "DefaultFailType", DefaultFailType, "Immediate","Delayed","End of Song","Off" ) ); ADD( ConfOption( "CoinsPerCredit", CoinsPerCredit, "|1","|2","|3","|4","|5","|6","|7","|8","|9","|10","|11","|12","|13","|14","|15","|16" ) ); ADD( ConfOption( "Premium", PremiumM, "Off","Double for 1 Credit","Joint Premium" ) ); ADD( ConfOption( "ShowSongOptions", ShowSongOptions, "Hide","Show","Ask" ) ); diff --git a/stepmania/src/SongOptions.cpp b/stepmania/src/SongOptions.cpp index 6ae5a2f8f8..b581125fc2 100644 --- a/stepmania/src/SongOptions.cpp +++ b/stepmania/src/SongOptions.cpp @@ -61,6 +61,7 @@ void SongOptions::GetMods( vector &AddTo ) const { case FAIL_IMMEDIATE: break; case FAIL_IMMEDIATE_CONTINUE: AddTo.push_back("FailImmediateContinue"); break; + case FAIL_AT_END: AddTo.push_back("FailAtEnd"); break; case FAIL_OFF: AddTo.push_back("FailOff"); break; default: ASSERT(0); } @@ -154,6 +155,7 @@ void SongOptions::FromString( const RString &sOptions ) sBit == "failimmediate" ) m_FailType = FAIL_IMMEDIATE; else if( sBit == "failendofsong" || sBit == "failimmediatecontinue" ) m_FailType = FAIL_IMMEDIATE_CONTINUE; + else if( sBit == "failatend" ) m_FailType = FAIL_AT_END; else if( sBit == "failoff" ) m_FailType = FAIL_OFF; else if( sBit == "faildefault" ) diff --git a/stepmania/src/SongOptions.h b/stepmania/src/SongOptions.h index 26a5e425f1..2b7f589054 100644 --- a/stepmania/src/SongOptions.h +++ b/stepmania/src/SongOptions.h @@ -25,6 +25,7 @@ public: enum FailType { FAIL_IMMEDIATE=0, // fail immediately when life touches 0 FAIL_IMMEDIATE_CONTINUE, // fail immediately when life touches 0, but allow playing the rest of the song + FAIL_AT_END, // fail if life is at 0 when the song ends FAIL_OFF }; // never fail FailType m_FailType; float m_fMusicRate, m_SpeedfMusicRate;