revert to investigate life meter not draining

This commit is contained in:
Chris Danford
2005-04-06 08:36:34 +00:00
parent 8d460ba70b
commit 45908c5bef
+7 -11
View File
@@ -291,7 +291,7 @@ void LifeMeterBar::ChangeLife( TapNoteScore score )
default:
ASSERT(0);
}
if( GAMESTATE->IsPlayerHot(m_PlayerNumber) && score < TNS_GOOD )
if( IsHot() && score < TNS_GOOD )
fDeltaLife = -0.10f; // make it take a while to get back to "doing great"
break;
case SongOptions::DRAIN_NO_RECOVER:
@@ -347,7 +347,7 @@ void LifeMeterBar::ChangeLife( HoldNoteScore score, TapNoteScore tscore )
default:
ASSERT(0);
}
if( GAMESTATE->IsPlayerHot(m_PlayerNumber) && score == HNS_NG )
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:
@@ -445,11 +445,11 @@ bool LifeMeterBar::IsPastPassmark() const
{
if( GAMESTATE->m_pPlayerState[m_PlayerNumber]->m_PlayerOptions.m_fPassmark > 0 )
{
return m_fLifePercentage >= GAMESTATE->m_pPlayerState[m_PlayerNumber]->m_PlayerOptions.m_fPassmark;
return m_fLifePercentage >= GAMESTATE->m_pPlayerState[m_PlayerNumber]->m_PlayerOptions.m_fPassmark;
}
else
{
return false;
return false;
}
}
@@ -476,17 +476,13 @@ void LifeMeterBar::Update( float fDeltaTime )
// HACK: Tweaking these values is very difficulty. Update the
// "physics" many times so that the spring motion appears faster
bool bIsDead = GAMESTATE->IsPlayerDead(m_PlayerNumber);
bool bIsHot = GAMESTATE->IsPlayerHot(m_PlayerNumber);
for( int i=0; i<10; i++ )
{
const float fDelta = m_fLifePercentage - m_fTrailingLifePercentage;
// Don't apply spring and viscous forces if we're full or empty.
// Just move straight to either full or empty.
if( bIsDead || bIsHot )
if( IsFailing() || IsHot() )
{
m_fLifeVelocity = (fDelta / fabsf(fDelta)) * 4;
}
@@ -511,10 +507,10 @@ void LifeMeterBar::Update( float fDeltaTime )
m_fPassingAlpha += IsPastPassmark() ? +fDeltaTime*2 : -fDeltaTime*2;
CLAMP( m_fPassingAlpha, 0, 1 );
m_fHotAlpha += bIsHot ? + fDeltaTime*2 : -fDeltaTime*2;
m_fHotAlpha += IsHot() ? + fDeltaTime*2 : -fDeltaTime*2;
CLAMP( m_fHotAlpha, 0, 1 );
if( bIsHot )
if( IsHot() )
m_fLifeVelocity = max( 0, m_fLifeVelocity );
}