add "nodifficult" course song tag

This commit is contained in:
Glenn Maynard
2004-02-10 22:52:43 +00:00
parent 7b8049ce00
commit e2e692f77a
2 changed files with 24 additions and 8 deletions
+22 -8
View File
@@ -273,6 +273,8 @@ void Course::LoadFromCRSFile( CString sPath )
new_entry.mystery = false;
else if( !mods[j].CompareNoCase("noshowcourse") )
new_entry.mystery = true;
else if( !mods[j].CompareNoCase("nodifficult") )
new_entry.no_difficult = true;
else
continue;
mods.erase(mods.begin() + j);
@@ -382,16 +384,25 @@ void Course::Save()
line += DifficultyToString(entry.difficulty);
else if( entry.low_meter != -1 && entry.high_meter != -1 )
line += ssprintf( "%d..%d", entry.low_meter, entry.high_meter );
line += ssprintf( ":%s", entry.modifiers.c_str() );
line += ":";
CString modifiers = entry.modifiers;
bool default_mystery = (entry.type == COURSE_ENTRY_RANDOM || entry.type == COURSE_ENTRY_RANDOM_WITHIN_GROUP);
if( default_mystery != entry.mystery )
{
if( entry.modifiers != "" )
line += ",";
line += entry.mystery? "noshowcourse":"showcourse";
if( modifiers != "" )
modifiers += ",";
modifiers += entry.mystery? "noshowcourse":"showcourse";
}
if( entry.no_difficult )
{
if( modifiers != "" )
modifiers += ",";
modifiers += "nodifficult";
}
line += modifiers;
line += ";";
f.PutLine( line );
}
@@ -578,6 +589,9 @@ void Course::GetCourseInfo( StepsType nt, vector<Course::Info> &ci, CourseDiffic
for( unsigned i=0; i<entries.size(); i++ )
{
const CourseEntry &e = entries[i];
CourseDifficulty entry_difficulty = cd;
if( e.no_difficult && entry_difficulty == COURSE_DIFFICULTY_DIFFICULT )
entry_difficulty = COURSE_DIFFICULTY_REGULAR;
Song* pSong = NULL; // fill this in
Steps* pNotes = NULL; // fill this in
@@ -585,7 +599,7 @@ void Course::GetCourseInfo( StepsType nt, vector<Course::Info> &ci, CourseDiffic
/* This applies difficult mode for meter ranges. (If it's a difficulty
* class, we'll do it below.) */
int low_meter, high_meter;
GetMeterRange( i, low_meter, high_meter, cd );
GetMeterRange( i, low_meter, high_meter, entry_difficulty );
switch( e.type )
{
@@ -679,12 +693,12 @@ void Course::GetCourseInfo( StepsType nt, vector<Course::Info> &ci, CourseDiffic
/* If e.difficulty == DIFFICULTY_INVALID, then we already increased difficulty
* based on meter. */
if( cd > COURSE_DIFFICULTY_REGULAR && e.difficulty != DIFFICULTY_INVALID )
if( entry_difficulty > COURSE_DIFFICULTY_REGULAR && e.difficulty != DIFFICULTY_INVALID )
{
/* See if we can find a NoteData that's one notch more difficult than
* the one we found above. */
Difficulty dc = pNotes->GetDifficulty();
Difficulty new_dc = Difficulty( dc + cd );
Difficulty new_dc = Difficulty( dc + entry_difficulty );
if( new_dc < NUM_DIFFICULTIES )
{
Steps* pNewNotes = pSong->GetStepsByDifficulty( nt, new_dc );
@@ -701,7 +715,7 @@ void Course::GetCourseInfo( StepsType nt, vector<Course::Info> &ci, CourseDiffic
cinfo.Random = ( e.type == COURSE_ENTRY_RANDOM || e.type == COURSE_ENTRY_RANDOM_WITHIN_GROUP );
cinfo.Mystery = e.mystery;
cinfo.CourseIndex = i;
cinfo.Difficulty = cd;
cinfo.Difficulty = entry_difficulty;
ci.push_back( cinfo );
}
+2
View File
@@ -53,6 +53,7 @@ public:
Song* pSong; // used in type=fixed
CString group_name; // used in type=random_within_group
Difficulty difficulty; // = DIFFICULTY_INVALID if no difficulty specified
bool no_difficult; // if true, difficult course setting doesn't affect this entry
int low_meter; // = -1 if no meter range specified
int high_meter; // = -1 if no meter range specified
int players_index; // ignored if type isn't 'best' or 'worst'
@@ -66,6 +67,7 @@ public:
pSong = NULL;
group_name = "";
difficulty = DIFFICULTY_INVALID;
no_difficult = false;
low_meter = -1;
high_meter = -1;
players_index = 0;