Added "progressive stages lifebar" support

Fixed bug where final stage wasn't really at full difficulty
This commit is contained in:
Andrew Wong
2003-07-31 15:07:48 +00:00
parent adc19d0a15
commit c3f1d5bc12
5 changed files with 33 additions and 9 deletions
+6 -2
View File
@@ -467,12 +467,16 @@ void LifeMeterBar::DrawPrimitives()
ActorFrame::DrawPrimitives();
}
void LifeMeterBar::UpdateNonstopLifebar(const int cleared, const int total, int ProgressiveLifebarDifficulty)
void LifeMeterBar::UpdateNonstopLifebar(const int cleared,
const int total, int ProgressiveLifebarDifficulty)
{
// if (cleared > total) cleared = total; // clear/total <= 1
// if (total == 0) total = 1; // no division by 0
m_fLifeDifficulty = m_fBaseLifeDifficulty - 0.2f * ProgressiveLifebarDifficulty * cleared / total;
if (total > 1)
m_fLifeDifficulty = m_fBaseLifeDifficulty - 0.2f * (int)(ProgressiveLifebarDifficulty * cleared / (total - 1));
else
m_fLifeDifficulty = m_fBaseLifeDifficulty - 0.2f * ProgressiveLifebarDifficulty;
if (m_fLifeDifficulty >= 0.4) return;
+3
View File
@@ -107,6 +107,7 @@ PrefsManager::PrefsManager()
// set to 0 so people aren't shocked at first
m_iProgressiveLifebar = 0;
m_iProgressiveNonstopLifebar = 0;
m_iProgressiveStageLifebar = 0;
/* DDR Extreme-style extra stage support.
* Default off so people used to the current behavior (or those with extra
@@ -224,6 +225,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame )
ini.GetValueI( "Options", "CourseSortOrder", (int&)m_iCourseSortOrder );
ini.GetValueI( "Options", "ProgressiveLifebar", (int&)m_iProgressiveLifebar );
ini.GetValueI( "Options", "ProgressiveNonstopLifebar", (int&)m_iProgressiveNonstopLifebar );
ini.GetValueI( "Options", "ProgressiveStageLifebar", (int&)m_iProgressiveStageLifebar );
ini.GetValueB( "Options", "UseUnlockSystem", m_bUseUnlockSystem );
@@ -337,6 +339,7 @@ void PrefsManager::SaveGlobalPrefsToDisk()
ini.SetValueB( "Options", "TenFooterInRed", m_bTenFooterInRed );
ini.SetValueI( "Options", "CourseSortOrder", m_iCourseSortOrder );
ini.SetValueI( "Options", "ProgressiveLifebar", m_iProgressiveLifebar );
ini.SetValueI( "Options", "ProgressiveStageLifebar", m_iProgressiveStageLifebar );
ini.SetValueI( "Options", "ProgressiveNonstopLifebar", m_iProgressiveNonstopLifebar );
/* Only write these if they aren't the default. This ensures that we can change
+1
View File
@@ -84,6 +84,7 @@ public:
bool m_bDebugMode;
bool m_bTenFooterInRed;
int m_iProgressiveLifebar;
int m_iProgressiveStageLifebar;
int m_iProgressiveNonstopLifebar;
// course ranking
+14 -2
View File
@@ -710,10 +710,22 @@ void ScreenGameplay::LoadNextSong()
if( GAMESTATE->m_SongOptions.m_LifeType==SongOptions::LIFE_BATTERY && GAMESTATE->m_CurStageStats.bFailed[p] ) // already failed
ShowOniGameOver((PlayerNumber)p);
if( GAMESTATE->m_SongOptions.m_LifeType==SongOptions::LIFE_BAR && GAMESTATE->m_PlayMode == PLAY_MODE_ARCADE && !PREFSMAN->m_bEventMode )
{
m_pLifeMeter[p]->UpdateNonstopLifebar(
GAMESTATE->GetStageIndex(),
PREFSMAN->m_iNumArcadeStages,
PREFSMAN->m_iProgressiveStageLifebar);
}
if( GAMESTATE->m_SongOptions.m_LifeType==SongOptions::LIFE_BAR && GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP )
{
LOG->Trace("Song %d of %d", GAMESTATE->GetCourseSongIndex(), GAMESTATE->m_pCurCourse->GetEstimatedNumStages() );
m_pLifeMeter[p]->UpdateNonstopLifebar(GAMESTATE->GetCourseSongIndex(), GAMESTATE->m_pCurCourse->GetEstimatedNumStages(), PREFSMAN->m_iProgressiveNonstopLifebar);
LOG->Trace("Song %d of %d",
GAMESTATE->GetCourseSongIndex(),
GAMESTATE->m_pCurCourse->GetEstimatedNumStages() );
m_pLifeMeter[p]->UpdateNonstopLifebar(
GAMESTATE->GetCourseSongIndex(),
GAMESTATE->m_pCurCourse->GetEstimatedNumStages(),
PREFSMAN->m_iProgressiveNonstopLifebar);
}
m_DifficultyIcon[p].SetFromNotes( PlayerNumber(p), GAMESTATE->m_pCurNotes[p] );
+9 -5
View File
@@ -31,6 +31,7 @@ enum {
MO_JUDGE_DIFFICULTY,
MO_LIFE_DIFFICULTY,
MO_PROGRESSIVE_LIFEBAR,
MO_PROG_STAGE_LIFEBAR,
MO_PROG_NONSTOP_LIFEBAR,
MO_FAIL,
MO_SHOWSTATS,
@@ -47,6 +48,7 @@ OptionRow g_MachineOptionsLines[NUM_MACHINE_OPTIONS_LINES] = {
OptionRow( "Judge\nDifficulty", "1","2","3","4","5","6","7","8","JUSTICE" ),
OptionRow( "Life\nDifficulty", "1","2","3","4","5","6","7" ),
OptionRow( "Progressive\nLifebar", "OFF","1","2","3","4","5","6","7","8"),
OptionRow( "Progressive\nStage Lifebar", "OFF","1","2","3","4"),
OptionRow( "Progressive\nNonstop Lifebar", "OFF","1","2","3","4"),
OptionRow( "Default\nFail Type", "ARCADE","END OF SONG","OFF" ),
OptionRow( "Show\nStats", "OFF","ON" ),
@@ -108,6 +110,7 @@ void ScreenMachineOptions::ImportOptions()
so.FromString( PREFSMAN->m_sDefaultModifiers );
m_iSelectedOption[0][MO_PROGRESSIVE_LIFEBAR] = PREFSMAN->m_iProgressiveLifebar;
m_iSelectedOption[0][MO_PROG_NONSTOP_LIFEBAR] = PREFSMAN->m_iProgressiveNonstopLifebar;
m_iSelectedOption[0][MO_PROG_STAGE_LIFEBAR] = PREFSMAN->m_iProgressiveStageLifebar;
m_iSelectedOption[0][MO_FAIL] = so.m_FailType;
m_iSelectedOption[0][MO_SHOWSTATS] = PREFSMAN->m_bShowStats ? 1:0;
m_iSelectedOption[0][MO_COINS_PER_CREDIT] = PREFSMAN->m_iCoinsPerCredit - 1;
@@ -123,11 +126,12 @@ void ScreenMachineOptions::ImportOptions()
void ScreenMachineOptions::ExportOptions()
{
PREFSMAN->m_iCoinMode = m_iSelectedOption[0][MO_COIN_MODE];
PREFSMAN->m_bMenuTimer = m_iSelectedOption[0][MO_MENU_TIMER] == 1;
PREFSMAN->m_iNumArcadeStages = m_iSelectedOption[0][MO_NUM_ARCADE_STAGES] + 1;
PREFSMAN->m_bEventMode = m_iSelectedOption[0][MO_NUM_ARCADE_STAGES] == 7;
PREFSMAN->m_iProgressiveNonstopLifebar = m_iSelectedOption[0][MO_PROG_NONSTOP_LIFEBAR];
PREFSMAN->m_iCoinMode = m_iSelectedOption[0][MO_COIN_MODE];
PREFSMAN->m_bMenuTimer = m_iSelectedOption[0][MO_MENU_TIMER] == 1;
PREFSMAN->m_iNumArcadeStages = m_iSelectedOption[0][MO_NUM_ARCADE_STAGES] + 1;
PREFSMAN->m_bEventMode = m_iSelectedOption[0][MO_NUM_ARCADE_STAGES] == 7;
PREFSMAN->m_iProgressiveNonstopLifebar = m_iSelectedOption[0][MO_PROG_NONSTOP_LIFEBAR];
PREFSMAN->m_iProgressiveStageLifebar = m_iSelectedOption[0][MO_PROG_STAGE_LIFEBAR];
switch( m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] )
{