Added multiple difficulty levels and all group Endless and Nonstop modes.
This commit is contained in:
@@ -427,7 +427,7 @@ void Course::Save()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Course::AutogenEndlessFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup )
|
void Course::AutogenEndlessFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup, Difficulty diff )
|
||||||
{
|
{
|
||||||
m_bIsAutogen = true;
|
m_bIsAutogen = true;
|
||||||
m_bRepeat = true;
|
m_bRepeat = true;
|
||||||
@@ -435,7 +435,8 @@ void Course::AutogenEndlessFromGroup( CString sGroupName, vector<Song*> &apSongs
|
|||||||
m_iLives = -1;
|
m_iLives = -1;
|
||||||
m_iMeter[0] = m_iMeter[1] = -1;
|
m_iMeter[0] = m_iMeter[1] = -1;
|
||||||
|
|
||||||
m_sName = SONGMAN->ShortenGroupName( sGroupName );
|
m_sName = SONGMAN->ShortenGroupName( sGroupName ) + GetAutogenDifficultySuffix( diff );
|
||||||
|
|
||||||
m_sBannerPath = SONGMAN->GetGroupBannerPath( sGroupName );
|
m_sBannerPath = SONGMAN->GetGroupBannerPath( sGroupName );
|
||||||
|
|
||||||
// We want multiple songs, so we can try to prevent repeats during
|
// We want multiple songs, so we can try to prevent repeats during
|
||||||
@@ -444,7 +445,7 @@ void Course::AutogenEndlessFromGroup( CString sGroupName, vector<Song*> &apSongs
|
|||||||
CourseEntry e;
|
CourseEntry e;
|
||||||
e.type = COURSE_ENTRY_RANDOM_WITHIN_GROUP;
|
e.type = COURSE_ENTRY_RANDOM_WITHIN_GROUP;
|
||||||
e.group_name = sGroupName;
|
e.group_name = sGroupName;
|
||||||
e.difficulty = DIFFICULTY_MEDIUM;
|
e.difficulty = diff;
|
||||||
e.mystery = true;
|
e.mystery = true;
|
||||||
|
|
||||||
vector<Song*> vSongs;
|
vector<Song*> vSongs;
|
||||||
@@ -453,9 +454,39 @@ void Course::AutogenEndlessFromGroup( CString sGroupName, vector<Song*> &apSongs
|
|||||||
m_entries.push_back( e );
|
m_entries.push_back( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Course::AutogenNonstopFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup )
|
void Course::AutogenEndlessFromVector( CString sCourseName, vector<Song*> &apSongsInCourse, Difficulty diff )
|
||||||
{
|
{
|
||||||
AutogenEndlessFromGroup( sGroupName, apSongsInGroup );
|
m_bIsAutogen = true;
|
||||||
|
m_bRepeat = true;
|
||||||
|
m_bRandomize = true;
|
||||||
|
m_iLives = -1;
|
||||||
|
m_iMeter[0] = m_iMeter[1] = -1;
|
||||||
|
|
||||||
|
m_sName = SONGMAN->ShortenGroupName( sCourseName ) + GetAutogenDifficultySuffix( diff );
|
||||||
|
//m_sBannerPath = SONGMAN->GetGroupBannerPath( sBannerName );
|
||||||
|
|
||||||
|
CourseEntry e;
|
||||||
|
e.type = COURSE_ENTRY_FIXED;
|
||||||
|
e.group_name = sCourseName;
|
||||||
|
e.difficulty = diff;
|
||||||
|
e.mystery = true;
|
||||||
|
|
||||||
|
for ( unsigned i = 0; i < apSongsInCourse.size(); ++i )
|
||||||
|
{
|
||||||
|
e.pSong = apSongsInCourse[i];
|
||||||
|
m_entries.push_back( e );
|
||||||
|
}
|
||||||
|
|
||||||
|
//This means that the course will be the same each time until re-init
|
||||||
|
//Currently, this is only used for the All Songs endless course, so it's
|
||||||
|
//a non-issue
|
||||||
|
//Also, it appears to be what COURSE_ENTRY_RANDOM does anyways
|
||||||
|
random_shuffle(m_entries.begin(),m_entries.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
void Course::AutogenNonstopFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup, Difficulty diff )
|
||||||
|
{
|
||||||
|
AutogenEndlessFromGroup( sGroupName, apSongsInGroup, diff );
|
||||||
|
|
||||||
m_bRepeat = false;
|
m_bRepeat = false;
|
||||||
|
|
||||||
@@ -468,6 +499,13 @@ void Course::AutogenNonstopFromGroup( CString sGroupName, vector<Song*> &apSongs
|
|||||||
m_entries.pop_back();
|
m_entries.pop_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CString Course::GetAutogenDifficultySuffix( Difficulty diff ) const
|
||||||
|
{
|
||||||
|
if ( diff == DIFFICULTY_MEDIUM )
|
||||||
|
return "";
|
||||||
|
return " " + DifficultyToThemedString( diff );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Difficult courses do the following:
|
* Difficult courses do the following:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -139,8 +139,9 @@ public:
|
|||||||
void LoadFromCRSFile( CString sPath );
|
void LoadFromCRSFile( CString sPath );
|
||||||
void Unload();
|
void Unload();
|
||||||
void Save();
|
void Save();
|
||||||
void AutogenEndlessFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup );
|
void AutogenEndlessFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup, Difficulty diff );
|
||||||
void AutogenNonstopFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup );
|
void AutogenEndlessFromVector( CString sCourseName, vector<Song*> &apSongsInCourse, Difficulty diff );
|
||||||
|
void AutogenNonstopFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup, Difficulty diff );
|
||||||
|
|
||||||
RadarValues GetRadarValues( StepsType st, CourseDifficulty cd ) const;
|
RadarValues GetRadarValues( StepsType st, CourseDifficulty cd ) const;
|
||||||
|
|
||||||
@@ -155,6 +156,7 @@ public:
|
|||||||
void ClearCache();
|
void ClearCache();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
CString GetAutogenDifficultySuffix( Difficulty diff ) const;
|
||||||
void GetMeterRange( int stage, int& iMeterLowOut, int& iMeterHighOut, CourseDifficulty cd ) const;
|
void GetMeterRange( int stage, int& iMeterLowOut, int& iMeterHighOut, CourseDifficulty cd ) const;
|
||||||
|
|
||||||
typedef pair<StepsType,CourseDifficulty> InfoParams;
|
typedef pair<StepsType,CourseDifficulty> InfoParams;
|
||||||
|
|||||||
@@ -574,15 +574,48 @@ void SongManager::InitAutogenCourses()
|
|||||||
GetSongs( apGroupSongs, sGroupName );
|
GetSongs( apGroupSongs, sGroupName );
|
||||||
|
|
||||||
Course* pCourse;
|
Course* pCourse;
|
||||||
|
//Generate random courses from each group for each of the main three difficulty levels
|
||||||
pCourse = new Course;
|
pCourse = new Course;
|
||||||
pCourse->AutogenEndlessFromGroup( sGroupName, apGroupSongs );
|
pCourse->AutogenEndlessFromGroup( sGroupName, apGroupSongs, DIFFICULTY_EASY );
|
||||||
m_pCourses.push_back( pCourse );
|
m_pCourses.push_back( pCourse );
|
||||||
|
|
||||||
pCourse = new Course;
|
pCourse = new Course;
|
||||||
pCourse->AutogenNonstopFromGroup( sGroupName, apGroupSongs );
|
pCourse->AutogenEndlessFromGroup( sGroupName, apGroupSongs, DIFFICULTY_MEDIUM );
|
||||||
|
m_pCourses.push_back( pCourse );
|
||||||
|
|
||||||
|
pCourse = new Course;
|
||||||
|
pCourse->AutogenEndlessFromGroup( sGroupName, apGroupSongs, DIFFICULTY_HARD );
|
||||||
|
m_pCourses.push_back( pCourse );
|
||||||
|
|
||||||
|
pCourse = new Course;
|
||||||
|
pCourse->AutogenNonstopFromGroup( sGroupName, apGroupSongs, DIFFICULTY_EASY );
|
||||||
|
m_pCourses.push_back( pCourse );
|
||||||
|
|
||||||
|
pCourse = new Course;
|
||||||
|
pCourse->AutogenNonstopFromGroup( sGroupName, apGroupSongs, DIFFICULTY_MEDIUM );
|
||||||
|
m_pCourses.push_back( pCourse );
|
||||||
|
|
||||||
|
pCourse = new Course;
|
||||||
|
pCourse->AutogenNonstopFromGroup( sGroupName, apGroupSongs, DIFFICULTY_HARD );
|
||||||
m_pCourses.push_back( pCourse );
|
m_pCourses.push_back( pCourse );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vector<Song*> apCourseSongs = GetAllSongs();
|
||||||
|
|
||||||
|
Course* pCourse;
|
||||||
|
|
||||||
|
//Generate "All Songs" endless course
|
||||||
|
pCourse = new Course;
|
||||||
|
pCourse->AutogenEndlessFromVector( "All Groups", apCourseSongs, DIFFICULTY_EASY );
|
||||||
|
m_pCourses.push_back( pCourse );
|
||||||
|
|
||||||
|
pCourse = new Course;
|
||||||
|
pCourse->AutogenEndlessFromVector( "All Groups", apCourseSongs, DIFFICULTY_MEDIUM );
|
||||||
|
m_pCourses.push_back( pCourse );
|
||||||
|
|
||||||
|
pCourse = new Course;
|
||||||
|
pCourse->AutogenEndlessFromVector( "All Groups", apCourseSongs, DIFFICULTY_HARD );
|
||||||
|
m_pCourses.push_back( pCourse );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user