add GetLife
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -38,6 +38,8 @@ public:
|
||||
|
||||
virtual void UpdateNonstopLifebar(int cleared, int total, int ProgressiveLifebarDifficulty) { };
|
||||
|
||||
virtual float GetLife() const;
|
||||
|
||||
void Refresh();
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user