bind HealthState
This commit is contained in:
@@ -830,7 +830,7 @@ void BackgroundImpl::Update( float fDeltaTime )
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
if( g_bShowDanger && GAMESTATE->m_pPlayerState[p]->m_HealthState == PlayerState::DANGER )
|
||||
if( g_bShowDanger && GAMESTATE->m_pPlayerState[p]->m_HealthState == HealthState_Danger )
|
||||
m_DangerPlayer[p]->Update( fDeltaTime );
|
||||
}
|
||||
|
||||
|
||||
@@ -93,6 +93,16 @@ XToLocalizedString( PlayerController );
|
||||
LuaXType( PlayerController );
|
||||
|
||||
|
||||
static const char *HealthStateNames[] = {
|
||||
"Hot",
|
||||
"Alive",
|
||||
"Danger",
|
||||
"Dead",
|
||||
};
|
||||
XToString( HealthState );
|
||||
LuaXType( HealthState );
|
||||
|
||||
|
||||
static const char *CoinModeNames[] = {
|
||||
"Home",
|
||||
"Pay",
|
||||
|
||||
@@ -271,6 +271,17 @@ enum PlayerController
|
||||
const RString& PlayerControllerToString( PlayerController pc );
|
||||
|
||||
|
||||
enum HealthState
|
||||
{
|
||||
HealthState_Hot,
|
||||
HealthState_Alive,
|
||||
HealthState_Danger,
|
||||
HealthState_Dead,
|
||||
NUM_HealthState,
|
||||
HealthState_Invalid
|
||||
};
|
||||
LuaDeclareType( HealthState );
|
||||
|
||||
enum StageResult
|
||||
{
|
||||
RESULT_WIN,
|
||||
|
||||
@@ -737,7 +737,7 @@ void GameState::ResetStageStatistics()
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
m_pPlayerState[p]->m_fSuperMeter = 0;
|
||||
m_pPlayerState[p]->m_HealthState = PlayerState::ALIVE;
|
||||
m_pPlayerState[p]->m_HealthState = HealthState_Alive;
|
||||
|
||||
m_pPlayerState[p]->m_iLastPositiveSumOfAttackLevels = 0;
|
||||
m_pPlayerState[p]->m_fSecondsUntilAttacksPhasedOut = 0; // PlayerAI not affected
|
||||
@@ -1643,7 +1643,7 @@ void GameState::StoreRankingName( PlayerNumber pn, RString sName )
|
||||
bool GameState::AllAreInDangerOrWorse() const
|
||||
{
|
||||
FOREACH_EnabledPlayer( p )
|
||||
if( m_pPlayerState[p]->m_HealthState < PlayerState::DANGER )
|
||||
if( m_pPlayerState[p]->m_HealthState < HealthState_Danger )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -1659,7 +1659,7 @@ bool GameState::AllHumanHaveComboOf30OrMoreMisses() const
|
||||
bool GameState::OneIsHot() const
|
||||
{
|
||||
FOREACH_EnabledPlayer( p )
|
||||
if( m_pPlayerState[p]->m_HealthState == PlayerState::HOT )
|
||||
if( m_pPlayerState[p]->m_HealthState == HealthState_Hot )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ void LifeMeterBar::Update( float fDeltaTime )
|
||||
m_pStream->SetPassingAlpha( m_fPassingAlpha );
|
||||
m_pStream->SetHotAlpha( m_fHotAlpha );
|
||||
|
||||
if( m_pPlayerState->m_HealthState == PlayerState::DANGER )
|
||||
if( m_pPlayerState->m_HealthState == HealthState_Danger )
|
||||
m_quadDangerGlow.SetDiffuseAlpha( 1 );
|
||||
else
|
||||
m_quadDangerGlow.SetDiffuseAlpha( 0 );
|
||||
|
||||
@@ -199,7 +199,7 @@ void LifeMeterTime::Update( float fDeltaTime )
|
||||
m_pStream->SetPassingAlpha( 0 );
|
||||
m_pStream->SetHotAlpha( 0 );
|
||||
|
||||
if( m_pPlayerState->m_HealthState == PlayerState::DANGER )
|
||||
if( m_pPlayerState->m_HealthState == HealthState_Danger )
|
||||
m_quadDangerGlow.SetDiffuseAlpha( 1 );
|
||||
else
|
||||
m_quadDangerGlow.SetDiffuseAlpha( 0 );
|
||||
|
||||
@@ -17,7 +17,7 @@ void PlayerState::Reset()
|
||||
|
||||
m_fLastDrawnBeat = -100;
|
||||
|
||||
m_HealthState = ALIVE;
|
||||
m_HealthState = HealthState_Alive;
|
||||
|
||||
m_fLastHopoNoteMusicSeconds = -1;
|
||||
m_iLastHopoNoteCol = -1;
|
||||
|
||||
@@ -32,7 +32,6 @@ public:
|
||||
//
|
||||
mutable float m_fLastDrawnBeat; // Set by NoteField. Used to push note-changing modifers back so that notes doesn't pop.
|
||||
|
||||
enum HealthState { HOT, ALIVE, DANGER, DEAD };
|
||||
HealthState m_HealthState;
|
||||
|
||||
float m_fLastStrumMusicSeconds; // Set to the MusicSeconds of when the a strum button was pressed. If -1, the strum window has passed.
|
||||
|
||||
@@ -1530,23 +1530,24 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
//
|
||||
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
|
||||
{
|
||||
HealthState &hs = pi->GetPlayerState()->m_HealthState;
|
||||
if( GAMESTATE->GetPlayerFailType(pi->GetPlayerState()) != SongOptions::FAIL_OFF &&
|
||||
pi->m_pLifeMeter && pi->m_pLifeMeter->IsFailing() )
|
||||
{
|
||||
pi->GetPlayerState()->m_HealthState = PlayerState::DEAD;
|
||||
hs = HealthState_Dead;
|
||||
}
|
||||
else if( pi->m_pLifeMeter && pi->m_pLifeMeter->IsHot() )
|
||||
{
|
||||
pi->GetPlayerState()->m_HealthState = PlayerState::HOT;
|
||||
hs = HealthState_Hot;
|
||||
}
|
||||
else if( GAMESTATE->GetPlayerFailType(pi->GetPlayerState()) != SongOptions::FAIL_OFF &&
|
||||
pi->m_pLifeMeter && pi->m_pLifeMeter->IsInDanger() )
|
||||
{
|
||||
pi->GetPlayerState()->m_HealthState = PlayerState::DANGER;
|
||||
hs = HealthState_Danger;
|
||||
}
|
||||
else
|
||||
{
|
||||
pi->GetPlayerState()->m_HealthState = PlayerState::ALIVE;
|
||||
hs = HealthState_Alive;
|
||||
}
|
||||
|
||||
pi->m_SoundEffectControl.Update( fDeltaTime );
|
||||
@@ -1710,7 +1711,7 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
break;
|
||||
}
|
||||
|
||||
if( state == AS2D_GREAT && pi->GetPlayerState()->m_HealthState == PlayerState::HOT )
|
||||
if( state == AS2D_GREAT && pi->GetPlayerState()->m_HealthState == HealthState_Hot )
|
||||
state = AS2D_FEVER;
|
||||
|
||||
pCharacter->Change2DAnimState( pi->m_pn, state );
|
||||
@@ -2349,7 +2350,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
/* XXX: In battle modes, switch( GAMESTATE->GetStageResult(p) ). */
|
||||
if( pi->GetPlayerStageStats()->m_bFailed )
|
||||
pDancers->Change2DAnimState( pi->m_pn, AS2D_FAIL ); // fail anim
|
||||
else if( pi->m_pLifeMeter && pi->GetPlayerState()->m_HealthState == PlayerState::HOT )
|
||||
else if( pi->m_pLifeMeter && pi->GetPlayerState()->m_HealthState == HealthState_Hot )
|
||||
pDancers->Change2DAnimState( pi->m_pn, AS2D_WINFEVER ); // full life pass anim
|
||||
else
|
||||
pDancers->Change2DAnimState( pi->m_pn, AS2D_WIN ); // pass anim
|
||||
|
||||
Reference in New Issue
Block a user