remove bFailedEarlier

This commit is contained in:
Glenn Maynard
2006-11-09 08:39:45 +00:00
parent e1eb59bc02
commit cd79b95422
5 changed files with 9 additions and 25 deletions
+2 -5
View File
@@ -254,7 +254,7 @@ void LifeMeterBar::ChangeLife( float fDeltaLife )
break;
}
// check if this step would cause a fail
// check if this step would empty the bar
if( m_fLifePercentage + fDeltaLife <= 0 && m_fLifePercentage > 0 )
{
/* Increase by m_iRegenComboAfterFail; never push it beyond m_iMaxRegenComboAfterFail
@@ -267,9 +267,6 @@ void LifeMeterBar::ChangeLife( float fDeltaLife )
m_fLifePercentage += fDeltaLife;
CLAMP( m_fLifePercentage, 0, 1 );
AfterLifeChanged();
if( m_fLifePercentage <= 0 )
m_pPlayerStageStats->bFailedEarlier = true;
}
void LifeMeterBar::AfterLifeChanged()
@@ -297,7 +294,7 @@ bool LifeMeterBar::IsInDanger() const
bool LifeMeterBar::IsFailing() const
{
return m_fLifePercentage <= 0;
return m_fLifePercentage <= m_pPlayerState->m_PlayerOptions.GetCurrent().m_fPassmark;
}
+3 -5
View File
@@ -64,7 +64,7 @@ void LifeMeterBattery::Load( const PlayerState *pPlayerState, PlayerStageStats *
void LifeMeterBattery::OnSongEnded()
{
if( m_pPlayerStageStats->bFailed || m_pPlayerStageStats->bFailedEarlier )
if( m_pPlayerStageStats->bFailed || m_iLivesLeft == 0 )
return;
if( m_iLivesLeft < GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives )
@@ -89,7 +89,7 @@ void LifeMeterBattery::OnSongEnded()
void LifeMeterBattery::ChangeLife( TapNoteScore score )
{
if( m_pPlayerStageStats->bFailedEarlier )
if( m_iLivesLeft == 0 )
return;
switch( score )
@@ -116,8 +116,6 @@ void LifeMeterBattery::ChangeLife( TapNoteScore score )
default:
ASSERT(0);
}
if( m_iLivesLeft == 0 )
m_pPlayerStageStats->bFailedEarlier = true;
}
void LifeMeterBattery::ChangeLife( HoldNoteScore score, TapNoteScore tscore )
@@ -150,7 +148,7 @@ bool LifeMeterBattery::IsHot() const
bool LifeMeterBattery::IsFailing() const
{
return m_pPlayerStageStats->bFailedEarlier;
return m_iLivesLeft == 0;
}
float LifeMeterBattery::GetLife() const
+4 -10
View File
@@ -71,7 +71,7 @@ void LifeMeterTime::Load( const PlayerState *pPlayerState, PlayerStageStats *pPl
void LifeMeterTime::OnLoadSong()
{
if( m_pPlayerStageStats->bFailedEarlier )
if( GetLifeSeconds() <= 0 )
return;
Course* pCourse = GAMESTATE->m_pCurCourse;
@@ -84,7 +84,7 @@ void LifeMeterTime::OnLoadSong()
void LifeMeterTime::ChangeLife( TapNoteScore tns )
{
if( m_pPlayerStageStats->bFailedEarlier )
if( GetLifeSeconds() <= 0 )
return;
float fMeterChange = 0;
@@ -101,14 +101,11 @@ void LifeMeterTime::ChangeLife( TapNoteScore tns )
}
m_fLifeTotalLostSeconds -= fMeterChange;
if( GetLifeSeconds() <= 0 )
m_pPlayerStageStats->bFailedEarlier = true;
}
void LifeMeterTime::ChangeLife( HoldNoteScore hns, TapNoteScore tns )
{
if( m_pPlayerStageStats->bFailedEarlier )
if( GetLifeSeconds() <= 0 )
return;
float fMeterChange = 0;
@@ -120,9 +117,6 @@ void LifeMeterTime::ChangeLife( HoldNoteScore hns, TapNoteScore tns )
}
m_fLifeTotalLostSeconds -= fMeterChange;
if( GetLifeSeconds() <= 0 )
m_pPlayerStageStats->bFailedEarlier = true;
}
bool LifeMeterTime::IsInDanger() const
@@ -137,7 +131,7 @@ bool LifeMeterTime::IsHot() const
bool LifeMeterTime::IsFailing() const
{
return m_pPlayerStageStats->bFailedEarlier;
return GetLifeSeconds() <= 0;
}
void LifeMeterTime::Update( float fDeltaTime )
-2
View File
@@ -24,7 +24,6 @@ void PlayerStageStats::Init()
vpPossibleSteps.clear();
fAliveSeconds = 0;
bFailed = false;
bFailedEarlier = false;
iPossibleDancePoints = iCurPossibleDancePoints = iActualDancePoints = 0;
iPossibleGradePoints = 0;
iCurCombo = iMaxCombo = iCurMissCombo = iScore = iBonus = iMaxScore = iCurMaxScore = 0;
@@ -58,7 +57,6 @@ void PlayerStageStats::AddStats( const PlayerStageStats& other )
vpPossibleSteps.push_back( *s );
fAliveSeconds += other.fAliveSeconds;
bFailed |= other.bFailed;
bFailedEarlier |= other.bFailedEarlier;
iPossibleDancePoints += other.iPossibleDancePoints;
iActualDancePoints += other.iActualDancePoints;
iCurPossibleDancePoints += other.iCurPossibleDancePoints;
-3
View File
@@ -35,9 +35,6 @@ public:
* this is only set if both players were failing at the same time. */
bool bFailed;
/* This indicates whether the player bottomed out his bar/ran out of lives at some
* point during the song. It's set in all fail modes. */
bool bFailedEarlier;
int iPossibleDancePoints;
int iCurPossibleDancePoints;
int iActualDancePoints;