diff --git a/stepmania/src/LifeMeter.h b/stepmania/src/LifeMeter.h index 679ebc5283..26e98e378d 100644 --- a/stepmania/src/LifeMeter.h +++ b/stepmania/src/LifeMeter.h @@ -35,6 +35,7 @@ public: virtual bool IsHot() = 0; virtual bool IsFailing() = 0; + virtual float GetLife() const { return 0; } // for cosmetic use only virtual void UpdateNonstopLifebar(int cleared, int total, int ProgressiveLifebarDifficulty) = 0; protected: diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index 0ebe9a5559..25a98e4ad4 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -432,8 +432,6 @@ void LifeMeterBar::Update( float fDeltaTime ) { LifeMeter::Update( fDeltaTime ); - GAMESTATE->m_CurStageStats.SetLifeRecord( m_PlayerNumber, m_fLifePercentage, GAMESTATE->m_fSongBeat / GAMESTATE->m_pCurSong->m_fLastBeat ); - // HACK: Tweaking these values is very difficulty. Update the // "physics" many times so that the spring motion appears faster diff --git a/stepmania/src/LifeMeterBar.h b/stepmania/src/LifeMeterBar.h index 396c9c061b..f1179186c1 100644 --- a/stepmania/src/LifeMeterBar.h +++ b/stepmania/src/LifeMeterBar.h @@ -35,6 +35,7 @@ public: virtual bool IsInDanger(); virtual bool IsHot(); virtual bool IsFailing(); + virtual float GetLife() const { return m_fLifePercentage; } void UpdateNonstopLifebar(int cleared, int total, int ProgressiveLifebarDifficulty); void FillForHowToPlay(int NumPerfects, int NumMisses); diff --git a/stepmania/src/LifeMeterBattery.cpp b/stepmania/src/LifeMeterBattery.cpp index 23cd72f98e..2ff1c87f69 100644 --- a/stepmania/src/LifeMeterBattery.cpp +++ b/stepmania/src/LifeMeterBattery.cpp @@ -155,6 +155,14 @@ bool LifeMeterBattery::IsFailing() return GAMESTATE->m_CurStageStats.bFailedEarlier[m_PlayerNumber]; } +float LifeMeterBattery::GetLife() const +{ + if( !GAMESTATE->m_SongOptions.m_iBatteryLives ) + return 1; + + return float(m_iLivesLeft) / GAMESTATE->m_SongOptions.m_iBatteryLives; +} + void LifeMeterBattery::Refresh() { if( m_iLivesLeft <= 4 ) diff --git a/stepmania/src/LifeMeterBattery.h b/stepmania/src/LifeMeterBattery.h index 3f43295487..c4d83696a8 100644 --- a/stepmania/src/LifeMeterBattery.h +++ b/stepmania/src/LifeMeterBattery.h @@ -38,6 +38,8 @@ public: virtual void UpdateNonstopLifebar(int cleared, int total, int ProgressiveLifebarDifficulty) { }; + virtual float GetLife() const; + void Refresh(); private: