Add 'difficult' for nonstop courses.
This feels hackish; feel free to make it more general
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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; p<NUM_PLAYERS; p++ )
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
int m_iCoins; // not "credits"
|
||||
PlayerNumber m_MasterPlayerNumber; // used in Styles where one player controls both sides
|
||||
bool m_bIsOnSystemMenu; // system screens will not be effected by the operator key -- Miryokuteki
|
||||
bool m_bDifficultCourses; //used in nonstop
|
||||
int GetNumSidesJoined()
|
||||
{
|
||||
int iNumSidesJoined = 0;
|
||||
|
||||
@@ -836,6 +836,9 @@ void MusicWheel::Update( float fDeltaTime )
|
||||
|
||||
void MusicWheel::ChangeMusic(int dist)
|
||||
{
|
||||
if(GAMESTATE->m_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. */
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ protected:
|
||||
|
||||
RageSound m_soundSelect;
|
||||
RageSound m_soundOptionsChange;
|
||||
RageSound m_soundChangeNotes;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user