don't disqualify for mods that have no effect on the current song or course

This commit is contained in:
Chris Danford
2004-03-25 05:38:04 +00:00
parent 910b378509
commit cb91aa5f36
3 changed files with 39 additions and 14 deletions
+11 -2
View File
@@ -897,9 +897,18 @@ void GameState::RestoreSelectedOptions()
bool GameState::IsDisqualified( PlayerNumber pn )
{
if( GAMESTATE->IsCourseMode() )
return GAMESTATE->m_PlayerOptions[pn].IsHandicapForCourse( GAMESTATE->m_pCurCourse );
{
return GAMESTATE->m_PlayerOptions[pn].IsEasierForCourse(
GAMESTATE->m_pCurCourse,
GAMESTATE->GetCurrentStyleDef()->m_StepsType,
GAMESTATE->m_PreferredCourseDifficulty[pn] );
}
else
return GAMESTATE->m_PlayerOptions[pn].IsHandicapForSong( GAMESTATE->m_pCurSong );
{
return GAMESTATE->m_PlayerOptions[pn].IsEasierForSongAndSteps(
GAMESTATE->m_pCurSong,
GAMESTATE->m_pCurNotes[pn] );
}
}
void GameState::ResetNoteSkins()
+23 -10
View File
@@ -20,6 +20,7 @@
#include "NoteSkinManager.h"
#include "song.h"
#include "Course.h"
#include "Steps.h"
#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYSIZE(arr); ++Z ) arr[Z]=1.0f; }
@@ -540,29 +541,41 @@ bool PlayerOptions::operator==( const PlayerOptions &other ) const
return true;
}
bool PlayerOptions::IsHandicapForSong( Song* pSong )
bool PlayerOptions::IsEasierForSongAndSteps( Song* pSong, Steps* pSteps )
{
if( m_bTimeSpacing && pSong->HasSignificantBpmChangesOrStops() )
return true;
if( m_bTransforms[TRANSFORM_NOHOLDS] && pSteps->GetRadarValues()[RADAR_NUM_HOLDS]>0 )
return true;
if( m_bTransforms[TRANSFORM_NOMINES] && pSteps->GetRadarValues()[RADAR_NUM_MINES]>0 )
return true;
if( m_bTransforms[TRANSFORM_NOHANDS] && pSteps->GetRadarValues()[RADAR_NUM_HANDS]>0 )
return true;
if( m_bTransforms[TRANSFORM_NOQUADS] && pSteps->GetRadarValues()[RADAR_NUM_HANDS]>0 )
return true;
if( m_bTransforms[TRANSFORM_NOJUMPS] && pSteps->GetRadarValues()[RADAR_NUM_JUMPS]>0 )
return true;
if( m_bTransforms[TRANSFORM_NOHOLDS] ) return true;
if( m_bTransforms[TRANSFORM_NOMINES] ) return true;
if( m_bTransforms[TRANSFORM_NOJUMPS] ) return true;
if( m_bTransforms[TRANSFORM_NOHANDS] ) return true;
if( m_bTransforms[TRANSFORM_NOQUADS] ) return true;
// Inserted holds can be really easy on some songs, and scores will be
// highly hold-weighted, and very little tap score weighted.
if( m_bTransforms[TRANSFORM_PLANTED] ) return true;
if( m_bTransforms[TRANSFORM_TWISTER] ) return true;
// This makes songs with sparse notes easier.
if( m_bTransforms[TRANSFORM_ECHO] ) return true;
return false;
}
bool PlayerOptions::IsHandicapForCourse( Course* pCourse )
bool PlayerOptions::IsEasierForCourse( Course* pCourse, StepsType st, CourseDifficulty cd )
{
for( unsigned i=0; i<pCourse->m_entries.size(); i++ )
vector<Course::Info> ci;
pCourse->GetCourseInfo( st, ci, cd );
for( unsigned i=0; i<ci.size(); i++ )
{
const CourseEntry& ce = pCourse->m_entries[i];
if( ce.pSong && IsHandicapForSong(ce.pSong) )
const Course::Info& info = ci[i];
if( info.pSong && IsEasierForSongAndSteps(info.pSong, info.pNotes) )
return true;
}
return false;
+5 -2
View File
@@ -12,8 +12,11 @@
*/
class Song;
class Steps;
class Course;
#include "GameConstantsAndTypes.h"
struct PlayerOptions
{
PlayerOptions() { Init(); };
@@ -140,8 +143,8 @@ struct PlayerOptions
// return true if any mods being used will make the song(s) easier
bool IsHandicapForSong( Song* pSong );
bool IsHandicapForCourse( Course* pCourse );
bool IsEasierForSongAndSteps( Song* pSong, Steps* pSteps );
bool IsEasierForCourse( Course* pCourse, StepsType st, CourseDifficulty cd );
};
#endif