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
+5 -9
View File
@@ -291,7 +291,7 @@ void LifeMeterBar::ChangeLife( TapNoteScore score )
default: default:
ASSERT(0); 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" fDeltaLife = -0.10f; // make it take a while to get back to "doing great"
break; break;
case SongOptions::DRAIN_NO_RECOVER: case SongOptions::DRAIN_NO_RECOVER:
@@ -347,7 +347,7 @@ void LifeMeterBar::ChangeLife( HoldNoteScore score, TapNoteScore tscore )
default: default:
ASSERT(0); 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" fDeltaLife = -0.10f; // make it take a while to get back to "doing great"
break; break;
case SongOptions::DRAIN_NO_RECOVER: case SongOptions::DRAIN_NO_RECOVER:
@@ -476,17 +476,13 @@ void LifeMeterBar::Update( float fDeltaTime )
// HACK: Tweaking these values is very difficulty. Update the // HACK: Tweaking these values is very difficulty. Update the
// "physics" many times so that the spring motion appears faster // "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++ ) for( int i=0; i<10; i++ )
{ {
const float fDelta = m_fLifePercentage - m_fTrailingLifePercentage; const float fDelta = m_fLifePercentage - m_fTrailingLifePercentage;
// Don't apply spring and viscous forces if we're full or empty. // Don't apply spring and viscous forces if we're full or empty.
// Just move straight to either full or empty. // Just move straight to either full or empty.
if( bIsDead || bIsHot ) if( IsFailing() || IsHot() )
{ {
m_fLifeVelocity = (fDelta / fabsf(fDelta)) * 4; m_fLifeVelocity = (fDelta / fabsf(fDelta)) * 4;
} }
@@ -511,10 +507,10 @@ void LifeMeterBar::Update( float fDeltaTime )
m_fPassingAlpha += IsPastPassmark() ? +fDeltaTime*2 : -fDeltaTime*2; m_fPassingAlpha += IsPastPassmark() ? +fDeltaTime*2 : -fDeltaTime*2;
CLAMP( m_fPassingAlpha, 0, 1 ); CLAMP( m_fPassingAlpha, 0, 1 );
m_fHotAlpha += bIsHot ? + fDeltaTime*2 : -fDeltaTime*2; m_fHotAlpha += IsHot() ? + fDeltaTime*2 : -fDeltaTime*2;
CLAMP( m_fHotAlpha, 0, 1 ); CLAMP( m_fHotAlpha, 0, 1 );
if( bIsHot ) if( IsHot() )
m_fLifeVelocity = max( 0, m_fLifeVelocity ); m_fLifeVelocity = max( 0, m_fLifeVelocity );
} }