add GetLife

This commit is contained in:
Glenn Maynard
2003-10-23 06:15:58 +00:00
parent 50bd3c4408
commit 1b33b46e29
5 changed files with 12 additions and 2 deletions
+1
View File
@@ -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:
-2
View File
@@ -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
+1
View File
@@ -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);
+8
View File
@@ -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 )
+2
View File
@@ -38,6 +38,8 @@ public:
virtual void UpdateNonstopLifebar(int cleared, int total, int ProgressiveLifebarDifficulty) { };
virtual float GetLife() const;
void Refresh();
private: