Add GiveUpGoesToNextScreen. Used in workout so that giving up doesn't loose everything you've done in the stage so far.
This commit is contained in:
@@ -1188,6 +1188,7 @@ PlayerP2TwoPlayersTwoSidesX=SCREEN_CENTER_X+160
|
|||||||
PlayerP1OnePlayerTwoSidesX=SCREEN_CENTER_X
|
PlayerP1OnePlayerTwoSidesX=SCREEN_CENTER_X
|
||||||
PlayerP2OnePlayerTwoSidesX=SCREEN_CENTER_X
|
PlayerP2OnePlayerTwoSidesX=SCREEN_CENTER_X
|
||||||
StopCourseEarly=0
|
StopCourseEarly=0
|
||||||
|
GivingUpGoesToNextScreen=0
|
||||||
|
|
||||||
[ScreenGameplayExtra]
|
[ScreenGameplayExtra]
|
||||||
Class=ScreenGameplay
|
Class=ScreenGameplay
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ AutoScreenMessage( SM_SaveChangedBeforeGoingBack )
|
|||||||
AutoScreenMessage( SM_GoToScreenAfterBack )
|
AutoScreenMessage( SM_GoToScreenAfterBack )
|
||||||
|
|
||||||
AutoScreenMessage( SM_BeginFailed )
|
AutoScreenMessage( SM_BeginFailed )
|
||||||
|
AutoScreenMessage( SM_LeaveGameplay )
|
||||||
|
|
||||||
// received while STATE_INTRO
|
// received while STATE_INTRO
|
||||||
AutoScreenMessage( SM_StartHereWeGo )
|
AutoScreenMessage( SM_StartHereWeGo )
|
||||||
@@ -95,6 +96,7 @@ ScreenGameplay::ScreenGameplay( CString sName ) : ScreenWithMenuElements(sName)
|
|||||||
START_GIVES_UP.Load( sName, "StartGivesUp" );
|
START_GIVES_UP.Load( sName, "StartGivesUp" );
|
||||||
BACK_GIVES_UP.Load( sName, "BackGivesUp" );
|
BACK_GIVES_UP.Load( sName, "BackGivesUp" );
|
||||||
GIVING_UP_FAILS.Load( sName, "GivingUpFails" );
|
GIVING_UP_FAILS.Load( sName, "GivingUpFails" );
|
||||||
|
GIVING_UP_GOES_TO_NEXT_SCREEN.Load( sName, "GivingUpGoesToNextScreen" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenGameplay::Init()
|
void ScreenGameplay::Init()
|
||||||
@@ -1523,6 +1525,11 @@ void ScreenGameplay::Update( float fDeltaTime )
|
|||||||
|
|
||||||
this->PostScreenMessage( SM_NotesEnded, 0 );
|
this->PostScreenMessage( SM_NotesEnded, 0 );
|
||||||
}
|
}
|
||||||
|
else if( GIVING_UP_GOES_TO_NEXT_SCREEN )
|
||||||
|
{
|
||||||
|
HandleScreenMessage( SM_LeaveGameplay );
|
||||||
|
return;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BackOutFromGameplay();
|
BackOutFromGameplay();
|
||||||
@@ -2129,77 +2136,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
if( bStopCourseEarly || bAllReallyFailed || bIsLastSong )
|
if( bStopCourseEarly || bAllReallyFailed || bIsLastSong )
|
||||||
{
|
{
|
||||||
// Time to leave from ScreenGameplay
|
// Time to leave from ScreenGameplay
|
||||||
|
HandleScreenMessage( SM_LeaveGameplay );
|
||||||
// update dancing characters for win / lose
|
|
||||||
DancingCharacters *Dancers = m_SongBackground.GetDancingCharacters();
|
|
||||||
if( Dancers )
|
|
||||||
{
|
|
||||||
FOREACH_EnabledPlayer(p)
|
|
||||||
{
|
|
||||||
/* XXX: In battle modes, switch( GAMESTATE->GetStageResult(p) ). */
|
|
||||||
if( STATSMAN->m_CurStageStats.m_player[p].bFailed )
|
|
||||||
Dancers->Change2DAnimState( p, AS2D_FAIL ); // fail anim
|
|
||||||
else if( m_pLifeMeter[p] && m_pLifeMeter[p]->GetLife() == 1.0f ) // full life
|
|
||||||
Dancers->Change2DAnimState( p, AS2D_WINFEVER ); // full life pass anim
|
|
||||||
else
|
|
||||||
Dancers->Change2DAnimState( p, AS2D_WIN ); // pass anim
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* End round. */
|
|
||||||
if( m_DancingState == STATE_OUTRO ) // ScreenGameplay already ended
|
|
||||||
return; // ignore
|
|
||||||
m_DancingState = STATE_OUTRO;
|
|
||||||
AbortGiveUp( false );
|
|
||||||
|
|
||||||
GAMESTATE->RemoveAllActiveAttacks();
|
|
||||||
FOREACH_EnabledPlayer( p )
|
|
||||||
m_ActiveAttackList[p].Refresh();
|
|
||||||
|
|
||||||
LIGHTSMAN->SetLightsMode( LIGHTSMODE_ALL_CLEARED );
|
|
||||||
|
|
||||||
|
|
||||||
if( bAllReallyFailed )
|
|
||||||
{
|
|
||||||
this->PostScreenMessage( SM_BeginFailed, 0 );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// do they deserve an extra stage?
|
|
||||||
if( GAMESTATE->HasEarnedExtraStage() )
|
|
||||||
{
|
|
||||||
TweenOffScreen();
|
|
||||||
m_Extra.StartTransitioning( SM_GoToNextScreen );
|
|
||||||
SOUND->PlayOnceFromAnnouncer( "gameplay extra" );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TweenOffScreen();
|
|
||||||
|
|
||||||
switch( GAMESTATE->m_PlayMode )
|
|
||||||
{
|
|
||||||
case PLAY_MODE_BATTLE:
|
|
||||||
case PLAY_MODE_RAVE:
|
|
||||||
{
|
|
||||||
PlayerNumber winner = GAMESTATE->GetBestPlayer();
|
|
||||||
switch( winner )
|
|
||||||
{
|
|
||||||
case PLAYER_INVALID:
|
|
||||||
m_Draw.StartTransitioning( SM_GoToNextScreen );
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
m_Win[winner].StartTransitioning( SM_GoToNextScreen );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
m_Cleared.StartTransitioning( SM_GoToNextScreen );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
SOUND->PlayOnceFromAnnouncer( "gameplay cleared" );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2213,6 +2150,81 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if( SM == SM_LeaveGameplay )
|
||||||
|
{
|
||||||
|
// update dancing characters for win / lose
|
||||||
|
DancingCharacters *Dancers = m_SongBackground.GetDancingCharacters();
|
||||||
|
if( Dancers )
|
||||||
|
{
|
||||||
|
FOREACH_EnabledPlayer(p)
|
||||||
|
{
|
||||||
|
/* XXX: In battle modes, switch( GAMESTATE->GetStageResult(p) ). */
|
||||||
|
if( STATSMAN->m_CurStageStats.m_player[p].bFailed )
|
||||||
|
Dancers->Change2DAnimState( p, AS2D_FAIL ); // fail anim
|
||||||
|
else if( m_pLifeMeter[p] && m_pLifeMeter[p]->GetLife() == 1.0f ) // full life
|
||||||
|
Dancers->Change2DAnimState( p, AS2D_WINFEVER ); // full life pass anim
|
||||||
|
else
|
||||||
|
Dancers->Change2DAnimState( p, AS2D_WIN ); // pass anim
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* End round. */
|
||||||
|
if( m_DancingState == STATE_OUTRO ) // ScreenGameplay already ended
|
||||||
|
return; // ignore
|
||||||
|
m_DancingState = STATE_OUTRO;
|
||||||
|
AbortGiveUp( false );
|
||||||
|
|
||||||
|
GAMESTATE->RemoveAllActiveAttacks();
|
||||||
|
FOREACH_EnabledPlayer( p )
|
||||||
|
m_ActiveAttackList[p].Refresh();
|
||||||
|
|
||||||
|
LIGHTSMAN->SetLightsMode( LIGHTSMODE_ALL_CLEARED );
|
||||||
|
|
||||||
|
bool bAllReallyFailed = STATSMAN->m_CurStageStats.AllFailed();
|
||||||
|
|
||||||
|
if( bAllReallyFailed )
|
||||||
|
{
|
||||||
|
this->PostScreenMessage( SM_BeginFailed, 0 );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// do they deserve an extra stage?
|
||||||
|
if( GAMESTATE->HasEarnedExtraStage() )
|
||||||
|
{
|
||||||
|
TweenOffScreen();
|
||||||
|
m_Extra.StartTransitioning( SM_GoToNextScreen );
|
||||||
|
SOUND->PlayOnceFromAnnouncer( "gameplay extra" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TweenOffScreen();
|
||||||
|
|
||||||
|
switch( GAMESTATE->m_PlayMode )
|
||||||
|
{
|
||||||
|
case PLAY_MODE_BATTLE:
|
||||||
|
case PLAY_MODE_RAVE:
|
||||||
|
{
|
||||||
|
PlayerNumber winner = GAMESTATE->GetBestPlayer();
|
||||||
|
switch( winner )
|
||||||
|
{
|
||||||
|
case PLAYER_INVALID:
|
||||||
|
m_Draw.StartTransitioning( SM_GoToNextScreen );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
m_Win[winner].StartTransitioning( SM_GoToNextScreen );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
m_Cleared.StartTransitioning( SM_GoToNextScreen );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
SOUND->PlayOnceFromAnnouncer( "gameplay cleared" );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
else if( SM == SM_StartLoadingNextSong )
|
else if( SM == SM_StartLoadingNextSong )
|
||||||
{
|
{
|
||||||
m_pSoundMusic->Stop();
|
m_pSoundMusic->Stop();
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ protected:
|
|||||||
ThemeMetric<bool> START_GIVES_UP;
|
ThemeMetric<bool> START_GIVES_UP;
|
||||||
ThemeMetric<bool> BACK_GIVES_UP;
|
ThemeMetric<bool> BACK_GIVES_UP;
|
||||||
ThemeMetric<bool> GIVING_UP_FAILS;
|
ThemeMetric<bool> GIVING_UP_FAILS;
|
||||||
|
ThemeMetric<bool> GIVING_UP_GOES_TO_NEXT_SCREEN;
|
||||||
|
|
||||||
void TweenOnScreen();
|
void TweenOnScreen();
|
||||||
void TweenOffScreen();
|
void TweenOffScreen();
|
||||||
|
|||||||
Reference in New Issue
Block a user