diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index bd7f3ade6d..d6cc1125be 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -29,6 +29,7 @@ Course::Course() m_bIsAutoGen = false; m_bRepeat = false; m_bRandomize = false; + m_bDifficult = false; m_iLives = -1; // @@ -604,6 +605,41 @@ void Course::AddScores( NotesType nt, bool bPlayerEnabled[NUM_PLAYERS], int iDan } } +bool Course::MakeNormal() +{ + if( !m_bRepeat && m_iLives == -1 ) // nonstop only, not oni or endless + if(m_bDifficult) //only make it easy if it's already difficult + { + unsigned c; + for( c = 0; c < m_entries.size(); c++) + { + if( m_entries[c].difficulty == DIFFICULTY_BEGINNER || m_entries[c].difficulty == DIFFICULTY_INVALID ) // don't suddenly make things invalid or worse + continue; + + m_entries[c].difficulty = Difficulty(m_entries[c].difficulty - 1); + } + m_bDifficult = false; + return true; + } + return false; +} +bool Course::MakeDifficult() +{ + if( !m_bRepeat && m_iLives == -1 ) // nonstop only, not oni or endless + if(!m_bDifficult) //only make it difficult once + { + unsigned c; + for( c = 0; c < m_entries.size(); c++) + { + if( m_entries[c].difficulty < DIFFICULTY_CHALLENGE ) // don't suddenly make things invalid or worse + m_entries[c].difficulty = Difficulty(m_entries[c].difficulty + 1); + } + m_bDifficult = true; + return true; + } + return false; +} + // // Sorting stuff diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index b6a293ab04..9d8db97119 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -52,6 +52,7 @@ public: bool m_bRepeat; // repeat after last song? "Endless" bool m_bRandomize; // play the songs in a random order + bool m_bDifficult; // only make something difficult once int m_iLives; // -1 means use bar life meter int m_iExtra; // extra stage number... // not used? -Chris @@ -75,6 +76,8 @@ public: void GetMeterRange( int stage, int& iMeterLowOut, int& iMeterHighOut ) const; bool ContainsAnyMysterySongs() const; bool GetTotalSeconds( float& fSecondsOut ) const; + bool MakeDifficult(); + bool MakeNormal(); void LoadFromCRSFile( CString sPath ); diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index f8ca2c3388..e1bb53c76d 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -78,6 +78,7 @@ void GameState::Reset() m_bJukeboxUsesModifiers = false; m_iCurrentStageIndex = 0; m_bAllow2ndExtraStage = true; + m_bDifficultCourses = false; m_pCurSong = NULL; for( p=0; pm_PlayMode == PLAY_MODE_NONSTOP) + GetSelectedCourse()->MakeNormal(); + m_iSelection += dist; if( m_iSelection < 0 ) m_iSelection = m_CurWheelItemData.size()-1; @@ -846,6 +849,9 @@ void MusicWheel::ChangeMusic(int dist) m_fPositionOffsetFromSelection += dist; + if(GAMESTATE->m_bDifficultCourses && GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP) + GetSelectedCourse()->MakeDifficult(); + SCREENMAN->SendMessageToTopScreen( SM_SongChanged, 0 ); /* If we're moving automatically, don't play this; it'll be called in Update. */ diff --git a/stepmania/src/ScreenSelectCourse.cpp b/stepmania/src/ScreenSelectCourse.cpp index 3fbe334970..b8b4c8019f 100644 --- a/stepmania/src/ScreenSelectCourse.cpp +++ b/stepmania/src/ScreenSelectCourse.cpp @@ -128,6 +128,8 @@ ScreenSelectCourse::ScreenSelectCourse() m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") ); m_soundOptionsChange.Load( THEME->GetPathTo("Sounds","select music options") ); + m_soundChangeNotes.Load( THEME->GetPathTo("Sounds","select music notes") ); + SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select course intro") ); @@ -247,6 +249,27 @@ void ScreenSelectCourse::Input( const DeviceInput& DeviceI, InputEventType type, return; } + if( CodeDetector::EnteredEasierDifficulty(GameI.controller) ) + { + if( m_MusicWheel.GetSelectedCourse()->MakeNormal() ) + { + m_soundChangeNotes.Play(); + GAMESTATE->m_bDifficultCourses = false; + SCREENMAN->SendMessageToTopScreen(SM_SongChanged,0); + } + } + + if( CodeDetector::EnteredHarderDifficulty(GameI.controller) ) + { + if( m_MusicWheel.GetSelectedCourse()->MakeDifficult() ) + { + m_soundChangeNotes.Play(); + GAMESTATE->m_bDifficultCourses = true; + SCREENMAN->SendMessageToTopScreen(SM_SongChanged,0); + } + } + + Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default input handler } diff --git a/stepmania/src/ScreenSelectCourse.h b/stepmania/src/ScreenSelectCourse.h index ea568d30d8..2f7d43bb49 100644 --- a/stepmania/src/ScreenSelectCourse.h +++ b/stepmania/src/ScreenSelectCourse.h @@ -62,6 +62,7 @@ protected: RageSound m_soundSelect; RageSound m_soundOptionsChange; + RageSound m_soundChangeNotes; };