From 29c97703156a545da8d3256a3417ed97615220bc Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 11 Nov 2003 07:36:28 +0000 Subject: [PATCH] fix "can't hit taps on same line as mines" move life deltas to prefs separate life delta for stepping on a mine --- stepmania/src/CombinedLifeMeterTug.cpp | 51 ++++++++++-- stepmania/src/CombinedLifeMeterTug.h | 3 +- stepmania/src/LifeMeter.h | 22 +---- stepmania/src/LifeMeterBar.cpp | 111 +++++++++++++++++++------ stepmania/src/LifeMeterBar.h | 2 + stepmania/src/LifeMeterBattery.cpp | 9 ++ stepmania/src/LifeMeterBattery.h | 2 + stepmania/src/NoteDataWithScoring.cpp | 12 ++- stepmania/src/Player.cpp | 40 +++++---- stepmania/src/PrefsManager.cpp | 33 +++++++- stepmania/src/PrefsManager.h | 9 ++ stepmania/src/StageStats.cpp | 2 +- 12 files changed, 210 insertions(+), 86 deletions(-) diff --git a/stepmania/src/CombinedLifeMeterTug.cpp b/stepmania/src/CombinedLifeMeterTug.cpp index a5d55a28a5..df968fef8a 100644 --- a/stepmania/src/CombinedLifeMeterTug.cpp +++ b/stepmania/src/CombinedLifeMeterTug.cpp @@ -12,6 +12,7 @@ #include "CombinedLifeMeterTug.h" #include "ThemeManager.h" #include "GameState.h" +#include "PrefsManager.h" const float METER_WIDTH = 550; @@ -55,16 +56,16 @@ void CombinedLifeMeterTug::Update( float fDelta ) void CombinedLifeMeterTug::ChangeLife( PlayerNumber pn, TapNoteScore score ) { - float fPercentToMove; + float fPercentToMove = 0; switch( score ) { - case TNS_MARVELOUS: fPercentToMove = +0.010f; break; - case TNS_PERFECT: fPercentToMove = +0.010f; break; - case TNS_GREAT: fPercentToMove = +0.005f; break; - case TNS_GOOD: fPercentToMove = +0.000f; break; - case TNS_BOO: fPercentToMove = -0.010f; break; - case TNS_MISS: fPercentToMove = -0.020f; break; - default: ASSERT(0); fPercentToMove = +0.000f; break; + case TNS_MARVELOUS: fPercentToMove = PREFSMAN->m_fLifeDeltaMarvelousPercentChange; break; + case TNS_PERFECT: fPercentToMove = PREFSMAN->m_fLifeDeltaPerfectPercentChange; break; + case TNS_GREAT: fPercentToMove = PREFSMAN->m_fLifeDeltaGreatPercentChange; break; + case TNS_GOOD: fPercentToMove = PREFSMAN->m_fLifeDeltaGoodPercentChange; break; + case TNS_BOO: fPercentToMove = PREFSMAN->m_fLifeDeltaBooPercentChange; break; + case TNS_MISS: fPercentToMove = PREFSMAN->m_fLifeDeltaMissPercentChange; break; + default: ASSERT(0); break; } switch( pn ) @@ -79,5 +80,39 @@ void CombinedLifeMeterTug::ChangeLife( PlayerNumber pn, TapNoteScore score ) void CombinedLifeMeterTug::ChangeLife( PlayerNumber pn, HoldNoteScore score, TapNoteScore tscore ) { + /* The initial tap note score (which we happen to have in have in + * tscore) has already been reported to the above function. If the + * hold end result was an NG, count it as a miss; if the end result + * was an OK, count a perfect. (Remember, this is just life meter + * computation, not scoring.) */ + float fPercentToMove = 0; + switch( score ) + { + case HNS_OK: fPercentToMove = PREFSMAN->m_fLifeDeltaOKPercentChange; break; + case HNS_NG: fPercentToMove = PREFSMAN->m_fLifeDeltaNGPercentChange; break; + default: ASSERT(0); break; + } + switch( pn ) + { + case PLAYER_1: GAMESTATE->m_fTugLifePercentP1 += fPercentToMove; break; + case PLAYER_2: GAMESTATE->m_fTugLifePercentP1 -= fPercentToMove; break; + default: ASSERT(0); + } + + CLAMP( GAMESTATE->m_fTugLifePercentP1, 0, 1 ); } + +void CombinedLifeMeterTug::ChangeLifeMine( PlayerNumber pn ) +{ + float fPercentToMove = PREFSMAN->m_fLifeDeltaMinePercentChange; + switch( pn ) + { + case PLAYER_1: GAMESTATE->m_fTugLifePercentP1 += fPercentToMove; break; + case PLAYER_2: GAMESTATE->m_fTugLifePercentP1 -= fPercentToMove; break; + default: ASSERT(0); + } + + CLAMP( GAMESTATE->m_fTugLifePercentP1, 0, 1 ); + +} \ No newline at end of file diff --git a/stepmania/src/CombinedLifeMeterTug.h b/stepmania/src/CombinedLifeMeterTug.h index 033721cd4a..6d54d05287 100644 --- a/stepmania/src/CombinedLifeMeterTug.h +++ b/stepmania/src/CombinedLifeMeterTug.h @@ -11,7 +11,7 @@ ----------------------------------------------------------------------------- */ -#include "LifeMeter.h" +#include "CombinedLifeMeter.h" #include "Sprite.h" #include "MeterDisplay.h" #include "CharacterHead.h" @@ -25,6 +25,7 @@ public: virtual void ChangeLife( PlayerNumber pn, TapNoteScore score ); virtual void ChangeLife( PlayerNumber pn, HoldNoteScore score, TapNoteScore tscore ); + virtual void ChangeLifeMine( PlayerNumber pn ); virtual void OnDancePointsChange( PlayerNumber pn ) {}; virtual bool IsInDanger( PlayerNumber pn ) { return false; }; virtual bool IsHot( PlayerNumber pn ) { return false; }; diff --git a/stepmania/src/LifeMeter.h b/stepmania/src/LifeMeter.h index 5bbadc866e..effac9228b 100644 --- a/stepmania/src/LifeMeter.h +++ b/stepmania/src/LifeMeter.h @@ -30,6 +30,7 @@ public: /* Change life after receiving a hold note grade. tscore is the score * received for the initial tap note. */ virtual void ChangeLife( HoldNoteScore score, TapNoteScore tscore ) = 0; + virtual void ChangeLifeMine() = 0; virtual void OnDancePointsChange() = 0; // look in GAMESTATE and update the display virtual bool IsInDanger() const = 0; virtual bool IsHot() const = 0; @@ -42,26 +43,5 @@ protected: PlayerNumber m_PlayerNumber; }; -class CombinedLifeMeter : public ActorFrame -{ -public: - CombinedLifeMeter() {}; - virtual ~CombinedLifeMeter() {}; - - virtual void OnSongEnded() {}; - /* Change life after receiving a tap note grade. This *is* called for - * the head of hold notes. */ - virtual void ChangeLife( PlayerNumber pn, TapNoteScore score ) = 0; - /* Change life after receiving a hold note grade. tscore is the score - * received for the initial tap note. */ - virtual void ChangeLife( PlayerNumber pn, HoldNoteScore score, TapNoteScore tscore ) = 0; - virtual void OnDancePointsChange( PlayerNumber pn ) = 0; // look in GAMESTATE and update the display - virtual bool IsInDanger( PlayerNumber pn ) = 0; - virtual bool IsHot( PlayerNumber pn ) = 0; - virtual bool IsFailing( PlayerNumber pn ) = 0; - virtual void OnTaunt() {}; -}; - - #endif diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index a2d51e9c94..34f3fec788 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -292,12 +292,12 @@ void LifeMeterBar::ChangeLife( TapNoteScore score ) case SongOptions::DRAIN_NORMAL: switch( score ) { - case TNS_MARVELOUS: fDeltaLife = +0.008f; break; - case TNS_PERFECT: fDeltaLife = +0.008f; break; - case TNS_GREAT: fDeltaLife = +0.004f; break; - case TNS_GOOD: fDeltaLife = +0.000f; break; - case TNS_BOO: fDeltaLife = -0.040f; break; - case TNS_MISS: fDeltaLife = -0.080f; break; + case TNS_MARVELOUS: fDeltaLife = PREFSMAN->m_fLifeDeltaMarvelousPercentChange; break; + case TNS_PERFECT: fDeltaLife = PREFSMAN->m_fLifeDeltaPerfectPercentChange; break; + case TNS_GREAT: fDeltaLife = PREFSMAN->m_fLifeDeltaGreatPercentChange; break; + case TNS_GOOD: fDeltaLife = PREFSMAN->m_fLifeDeltaGoodPercentChange; break; + case TNS_BOO: fDeltaLife = PREFSMAN->m_fLifeDeltaBooPercentChange; break; + case TNS_MISS: fDeltaLife = PREFSMAN->m_fLifeDeltaMissPercentChange; break; default: ASSERT(0); } @@ -311,8 +311,8 @@ void LifeMeterBar::ChangeLife( TapNoteScore score ) case TNS_PERFECT: fDeltaLife = +0.000f; break; case TNS_GREAT: fDeltaLife = +0.000f; break; case TNS_GOOD: fDeltaLife = +0.000f; break; - case TNS_BOO: fDeltaLife = -0.040f; break; - case TNS_MISS: fDeltaLife = -0.080f; break; + case TNS_BOO: fDeltaLife = PREFSMAN->m_fLifeDeltaBooPercentChange; break; + case TNS_MISS: fDeltaLife = PREFSMAN->m_fLifeDeltaMissPercentChange; break; default: ASSERT(0); } @@ -334,20 +334,67 @@ void LifeMeterBar::ChangeLife( TapNoteScore score ) ASSERT(0); } - // handle progressiveness and ComboToRegainLife here - switch( score ) + ChangeLife( fDeltaLife ); +} + +void LifeMeterBar::ChangeLife( HoldNoteScore score, TapNoteScore tscore ) +{ + /* The initial tap note score (which we happen to have in have in + * tscore) has already been reported to the above function. If the + * hold end result was an NG, count it as a miss; if the end result + * was an OK, count a perfect. (Remember, this is just life meter + * computation, not scoring.) */ + float fDeltaLife=0.f; + switch( GAMESTATE->m_SongOptions.m_DrainType ) + { + case SongOptions::DRAIN_NORMAL: + switch( score ) + { + case HNS_OK: fDeltaLife = PREFSMAN->m_fLifeDeltaOKPercentChange; break; + case HNS_NG: fDeltaLife = PREFSMAN->m_fLifeDeltaNGPercentChange; break; + default: + ASSERT(0); + } + if( IsHot() && score == HNS_NG ) + fDeltaLife = -0.10f; // make it take a while to get back to "doing great" + break; + case SongOptions::DRAIN_NO_RECOVER: + switch( score ) + { + case HNS_OK: fDeltaLife = +0.000f; break; + case HNS_NG: fDeltaLife = PREFSMAN->m_fLifeDeltaNGPercentChange; break; + default: + ASSERT(0); + } + break; + case SongOptions::DRAIN_SUDDEN_DEATH: + switch( score ) + { + case HNS_OK: fDeltaLife = +0; break; + case HNS_NG: fDeltaLife = -1.0; break; + default: + ASSERT(0); + } + break; + default: + ASSERT(0); + } + + ChangeLife( fDeltaLife ); +} + +void LifeMeterBar::ChangeLife( float fDeltaLife ) +{ + // handle progressiveness and ComboToRegainLife here + if( fDeltaLife >= 0 ) { - case TNS_MARVELOUS: - case TNS_PERFECT: - case TNS_GREAT: - case TNS_GOOD: m_iMissCombo = 0; m_iComboToRegainLife = max( m_iComboToRegainLife-1, 0 ); if ( m_iComboToRegainLife > 0 ) fDeltaLife = 0.0f; - break; - case TNS_BOO: - case TNS_MISS: + } + else + { fDeltaLife *= 1 + (float)m_iProgressiveLifebar/8 * m_iMissCombo; // do this after; only successive boo/miss will // increase the amount of life lost. @@ -394,17 +441,27 @@ void LifeMeterBar::ChangeLife( TapNoteScore score ) m_fLifeVelocity += fDeltaLife; } -void LifeMeterBar::ChangeLife( HoldNoteScore score, TapNoteScore tscore ) +void LifeMeterBar::ChangeLifeMine() { - /* The initial tap note score (which we happen to have in have in - * tscore) has already been reported to the above function. If the - * hold end result was an NG, count it as a miss; if the end result - * was an OK, count a perfect. (Remember, this is just life meter - * computation, not scoring.) */ - if(score == HNS_NG) - ChangeLife(TNS_MISS); - else if(score == HNS_OK) - ChangeLife(TNS_PERFECT); + float fDeltaLife=0.f; + switch( GAMESTATE->m_SongOptions.m_DrainType ) + { + case SongOptions::DRAIN_NORMAL: + fDeltaLife = PREFSMAN->m_fLifeDeltaMinePercentChange; + if( IsHot() ) + fDeltaLife = -0.10f; // make it take a while to get back to "doing great" + break; + case SongOptions::DRAIN_NO_RECOVER: + fDeltaLife = PREFSMAN->m_fLifeDeltaMinePercentChange; + break; + case SongOptions::DRAIN_SUDDEN_DEATH: + fDeltaLife = -1.0; + break; + default: + ASSERT(0); + } + + ChangeLife( fDeltaLife ); } void LifeMeterBar::AfterLifeChanged() diff --git a/stepmania/src/LifeMeterBar.h b/stepmania/src/LifeMeterBar.h index 850103bd87..dbcf0d8f93 100644 --- a/stepmania/src/LifeMeterBar.h +++ b/stepmania/src/LifeMeterBar.h @@ -30,6 +30,8 @@ public: virtual void ChangeLife( TapNoteScore score ); virtual void ChangeLife( HoldNoteScore score, TapNoteScore tscore ); + virtual void ChangeLife( float fDeltaLifePercent ); + virtual void ChangeLifeMine(); virtual void AfterLifeChanged(); virtual void OnDancePointsChange() {}; // this life meter doesn't care virtual bool IsInDanger() const; diff --git a/stepmania/src/LifeMeterBattery.cpp b/stepmania/src/LifeMeterBattery.cpp index d73010db04..6ecea2f8da 100644 --- a/stepmania/src/LifeMeterBattery.cpp +++ b/stepmania/src/LifeMeterBattery.cpp @@ -135,6 +135,15 @@ void LifeMeterBattery::ChangeLife( HoldNoteScore score, TapNoteScore tscore ) } } +void LifeMeterBattery::ChangeLife( float fDeltaLifePercent ) +{ +} + +void LifeMeterBattery::ChangeLifeMine() +{ + ChangeLife( TNS_MISS ); // same as a miss +} + void LifeMeterBattery::OnDancePointsChange() { } diff --git a/stepmania/src/LifeMeterBattery.h b/stepmania/src/LifeMeterBattery.h index 4e03194482..4084f4c731 100644 --- a/stepmania/src/LifeMeterBattery.h +++ b/stepmania/src/LifeMeterBattery.h @@ -31,6 +31,8 @@ public: virtual void OnSongEnded(); virtual void ChangeLife( TapNoteScore score ); virtual void ChangeLife( HoldNoteScore score, TapNoteScore tscore ); + virtual void ChangeLife( float fDeltaLifePercent ); + virtual void ChangeLifeMine(); virtual void OnDancePointsChange(); // look in GAMESTATE and update the display virtual bool IsInDanger() const; virtual bool IsHot() const; diff --git a/stepmania/src/NoteDataWithScoring.cpp b/stepmania/src/NoteDataWithScoring.cpp index 02a8a5c6f8..d885dec232 100644 --- a/stepmania/src/NoteDataWithScoring.cpp +++ b/stepmania/src/NoteDataWithScoring.cpp @@ -104,8 +104,10 @@ TapNoteScore NoteDataWithScoring::MinTapNoteScore(unsigned row) const TapNoteScore score = TNS_MARVELOUS; for( int t=0; tm_fJudgeWindowMineSeconds ) { m_soundMineExplosion.Play(); score = TNS_MISS; - m_pNoteField->TapMine( col, TNS_MISS ); + m_pNoteField->TapMine( col, score ); + + if( m_pLifeMeter ) + m_pLifeMeter->ChangeLifeMine(); + if( m_pCombinedLifeMeter ) + m_pCombinedLifeMeter->ChangeLifeMine(m_PlayerNumber); } else { @@ -632,7 +637,11 @@ void PlayerMinus::Step( int col, RageTimer tm ) { m_soundMineExplosion.Play(); score = TNS_MISS; - m_pNoteField->TapMine( col, TNS_MISS ); + m_pNoteField->TapMine( col, score ); + if( m_pLifeMeter ) + m_pLifeMeter->ChangeLifeMine(); + if( m_pCombinedLifeMeter ) + m_pCombinedLifeMeter->ChangeLifeMine(m_PlayerNumber); } break; case PC_AUTOPLAY: @@ -681,8 +690,12 @@ void PlayerMinus::Step( int col, RageTimer tm ) score >= TNS_GREAT ) HandleAutosync(fNoteOffset); - if( IsRowCompletelyJudged(iIndexOverlappingNote) ) - OnRowCompletelyJudged( iIndexOverlappingNote ); + + if( IsThereATapOrHoldHeadAtRow(iIndexOverlappingNote) ) // don't judge rows that are only mines + { + if( IsRowCompletelyJudged(iIndexOverlappingNote) ) + OnRowCompletelyJudged( iIndexOverlappingNote ); + } if( score == TNS_MISS || score == TNS_BOO ) { @@ -813,23 +826,15 @@ void PlayerMinus::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds ) //LOG->Trace( "iStartCheckingAt: %d iMissIfOlderThanThisIndex: %d", iStartCheckingAt, iMissIfOlderThanThisIndex ); int iNumMissesFound = 0; - int iNumMinesMissed = 0; for( int r=iStartCheckingAt; rShowMarvelous()? TNS_MARVELOUS:TNS_PERFECT); - } - else + if( GetTapNote(t, r) != TAP_MINE ) { // A normal note. Penalize for not stepping on it. MissedNoteOnThisRow = true; @@ -844,17 +849,10 @@ void PlayerMinus::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds ) iNumMissesFound++; HandleTapRowScore( r ); } - else if( MissedMineOnThisRow ) - { - iNumMinesMissed++; - HandleTapRowScore( r ); - } } if( iNumMissesFound > 0 ) m_Judgment.SetJudgment( TNS_MISS ); - else if( iNumMinesMissed > 0 ) - m_Judgment.SetJudgment( GAMESTATE->ShowMarvelous()? TNS_MARVELOUS:TNS_PERFECT ); } diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 7684ff5a13..41d1daadf2 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -58,6 +58,7 @@ PrefsManager::PrefsManager() m_bEventMode = false; m_bAutoPlay = false; m_fJudgeWindowScale = 1.0f; + m_fLifeDifficultyScale = 1.0f; m_fJudgeWindowMarvelousSeconds = 0.0225f; m_fJudgeWindowPerfectSeconds = 0.045f; m_fJudgeWindowGreatSeconds = 0.090f; @@ -65,7 +66,15 @@ PrefsManager::PrefsManager() m_fJudgeWindowBooSeconds = 0.180f; m_fJudgeWindowOKSeconds = 0.250f; // allow enough time to take foot off and put back on m_fJudgeWindowMineSeconds = 0.135f; - m_fLifeDifficultyScale = 1.0f; + m_fLifeDeltaMarvelousPercentChange = +0.008f; + m_fLifeDeltaPerfectPercentChange = +0.008f; + m_fLifeDeltaGreatPercentChange = +0.004f; + m_fLifeDeltaGoodPercentChange = +0.000f; + m_fLifeDeltaBooPercentChange = -0.040f; + m_fLifeDeltaMissPercentChange = -0.080f; + m_fLifeDeltaOKPercentChange = +0.008f; + m_fLifeDeltaNGPercentChange = -0.080f; + m_fLifeDeltaMinePercentChange = -0.160f; m_iRegenComboAfterFail = 10; // cumulative m_iRegenComboAfterMiss = 5; // cumulative m_iMaxRegenComboAfterFail = 10; @@ -224,6 +233,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk() ini.GetValue( "Options", "EventMode", m_bEventMode ); ini.GetValue( "Options", "AutoPlay", m_bAutoPlay ); ini.GetValue( "Options", "JudgeWindowScale", m_fJudgeWindowScale ); + ini.GetValue( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale ); ini.GetValue( "Options", "JudgeWindowMarvelousSeconds", m_fJudgeWindowMarvelousSeconds ); ini.GetValue( "Options", "JudgeWindowPerfectSeconds", m_fJudgeWindowPerfectSeconds ); ini.GetValue( "Options", "JudgeWindowGreatSeconds", m_fJudgeWindowGreatSeconds ); @@ -231,7 +241,15 @@ void PrefsManager::ReadGlobalPrefsFromDisk() ini.GetValue( "Options", "JudgeWindowBooSeconds", m_fJudgeWindowBooSeconds ); ini.GetValue( "Options", "JudgeWindowOKSeconds", m_fJudgeWindowOKSeconds ); ini.GetValue( "Options", "JudgeWindowMineSeconds", m_fJudgeWindowMineSeconds ); - ini.GetValue( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale ); + ini.GetValue( "Options", "LifeDeltaMarvelousPercentChange", m_fLifeDeltaMarvelousPercentChange ); + ini.GetValue( "Options", "LifeDeltaPerfectPercentChange", m_fLifeDeltaPerfectPercentChange ); + ini.GetValue( "Options", "LifeDeltaGreatPercentChange", m_fLifeDeltaGreatPercentChange ); + ini.GetValue( "Options", "LifeDeltaGoodPercentChange", m_fLifeDeltaGoodPercentChange ); + ini.GetValue( "Options", "LifeDeltaBooPercentChange", m_fLifeDeltaBooPercentChange ); + ini.GetValue( "Options", "LifeDeltaMissPercentChange", m_fLifeDeltaMissPercentChange ); + ini.GetValue( "Options", "LifeDeltaOKPercentChange", m_fLifeDeltaOKPercentChange ); + ini.GetValue( "Options", "LifeDeltaNGPercentChange", m_fLifeDeltaNGPercentChange ); + ini.GetValue( "Options", "LifeDeltaMinePercentChange", m_fLifeDeltaMinePercentChange ); ini.GetValue( "Options", "RegenComboAfterFail", m_iRegenComboAfterFail ); ini.GetValue( "Options", "RegenComboAfterMiss", m_iRegenComboAfterMiss ); ini.GetValue( "Options", "MaxRegenComboAfterFail", m_iMaxRegenComboAfterFail ); @@ -364,6 +382,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const ini.SetValue( "Options", "EventMode", m_bEventMode ); ini.SetValue( "Options", "AutoPlay", m_bAutoPlay ); ini.SetValue( "Options", "JudgeWindowScale", m_fJudgeWindowScale ); + ini.SetValue( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale ); ini.SetValue( "Options", "JudgeWindowMarvelousSeconds", m_fJudgeWindowMarvelousSeconds ); ini.SetValue( "Options", "JudgeWindowPerfectSeconds", m_fJudgeWindowPerfectSeconds ); ini.SetValue( "Options", "JudgeWindowGreatSeconds", m_fJudgeWindowGreatSeconds ); @@ -371,7 +390,15 @@ void PrefsManager::SaveGlobalPrefsToDisk() const ini.SetValue( "Options", "JudgeWindowBooSeconds", m_fJudgeWindowBooSeconds ); ini.SetValue( "Options", "JudgeWindowOKSeconds", m_fJudgeWindowOKSeconds ); ini.SetValue( "Options", "JudgeWindowMineSeconds", m_fJudgeWindowMineSeconds ); - ini.SetValue( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale ); + ini.SetValue( "Options", "LifeDeltaMarvelousPercentChange", m_fLifeDeltaMarvelousPercentChange ); + ini.SetValue( "Options", "LifeDeltaPerfectPercentChange", m_fLifeDeltaPerfectPercentChange ); + ini.SetValue( "Options", "LifeDeltaGreatPercentChange", m_fLifeDeltaGreatPercentChange ); + ini.SetValue( "Options", "LifeDeltaGoodPercentChange", m_fLifeDeltaGoodPercentChange ); + ini.SetValue( "Options", "LifeDeltaBooPercentChange", m_fLifeDeltaBooPercentChange ); + ini.SetValue( "Options", "LifeDeltaMissPercentChange", m_fLifeDeltaMissPercentChange ); + ini.SetValue( "Options", "LifeDeltaOKPercentChange", m_fLifeDeltaOKPercentChange ); + ini.SetValue( "Options", "LifeDeltaNGPercentChange", m_fLifeDeltaNGPercentChange ); + ini.SetValue( "Options", "LifeDeltaMinePercentChange", m_fLifeDeltaMinePercentChange ); ini.SetValue( "Options", "RegenComboAfterFail", m_iRegenComboAfterFail ); ini.SetValue( "Options", "RegenComboAfterMiss", m_iRegenComboAfterMiss ); ini.SetValue( "Options", "MaxRegenComboAfterFail", m_iMaxRegenComboAfterFail ); diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 1dbe861a52..8673392c5a 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -57,6 +57,15 @@ public: float m_fJudgeWindowBooSeconds; float m_fJudgeWindowOKSeconds; float m_fJudgeWindowMineSeconds; + float m_fLifeDeltaMarvelousPercentChange; + float m_fLifeDeltaPerfectPercentChange; + float m_fLifeDeltaGreatPercentChange; + float m_fLifeDeltaGoodPercentChange; + float m_fLifeDeltaBooPercentChange; + float m_fLifeDeltaMissPercentChange; + float m_fLifeDeltaOKPercentChange; + float m_fLifeDeltaNGPercentChange; + float m_fLifeDeltaMinePercentChange; int m_iRegenComboAfterFail; int m_iRegenComboAfterMiss; int m_iMaxRegenComboAfterFail; diff --git a/stepmania/src/StageStats.cpp b/stepmania/src/StageStats.cpp index a3f188a3bb..8dbb943d07 100644 --- a/stepmania/src/StageStats.cpp +++ b/stepmania/src/StageStats.cpp @@ -88,7 +88,7 @@ Grade StageStats::GetGrade( PlayerNumber pn ) float Possible = 0, Actual = 0; int i; - for( i = TNS_MISS; i < NUM_TAP_NOTE_SCORES; ++i ) + for( i = 0; i < NUM_TAP_NOTE_SCORES; ++i ) { Actual += iTapNoteScores[pn][i] * TapScoreValues[i]; Possible += iTapNoteScores[pn][i] * TapScoreValues[TNS_MARVELOUS];