Add win/lose BGAnimations
Clean up Attack data structures
This commit is contained in:
@@ -1 +1 @@
|
||||
_shared menu header.png
|
||||
_shared options header.png
|
||||
@@ -96,6 +96,18 @@ Icon5X=380
|
||||
Icon5Y=84
|
||||
Icon5OnCommand=addx,-640;sleep,0.00;decelerate,0.3;addx,640
|
||||
Icon5OffCommand=bouncebegin,0.5;zoomy,0
|
||||
Icon6X=
|
||||
Icon6Y=
|
||||
Icon6OnCommand=addx,-640;sleep,0.00;decelerate,0.3;addx,640
|
||||
Icon6OffCommand=bouncebegin,0.5;zoomy,0
|
||||
Icon7X=
|
||||
Icon7Y=
|
||||
Icon7OnCommand=addx,-640;sleep,0.00;decelerate,0.3;addx,640
|
||||
Icon7OffCommand=bouncebegin,0.5;zoomy,0
|
||||
Icon8X=
|
||||
Icon8Y=
|
||||
Icon8OnCommand=addx,-640;sleep,0.00;decelerate,0.3;addx,640
|
||||
Icon8OffCommand=bouncebegin,0.5;zoomy,0
|
||||
IconGainFocusCommand=glowshift;effectperiod,0.5
|
||||
IconLoseFocusCommand=stopeffect
|
||||
DisabledColor=0.2,0.2,0.2,1
|
||||
@@ -1214,7 +1226,13 @@ OKCommand=shadowlength,4;diffusealpha,1;zoom,1.25;linear,0.3;zoomx,1;zoomy,1;sle
|
||||
|
||||
[Player]
|
||||
GrayArrowsY=96
|
||||
JudgmentXOffsetOneSideP1=0
|
||||
JudgmentXOffsetOneSideP2=0
|
||||
JudgmentXOffsetBothSides=0
|
||||
JudgmentY=210
|
||||
ComboXOffsetOneSideP1=0
|
||||
ComboXOffsetOneSideP2=0
|
||||
ComboXOffsetBothSides=0
|
||||
ComboY=270
|
||||
HoldJudgmentY=150
|
||||
BrightGhostComboThreshold=100
|
||||
|
||||
@@ -64,17 +64,17 @@ void ActiveItemList::Update( float fDelta )
|
||||
|
||||
if( (int)fNowSeconds != (int)fLastSeconds )
|
||||
{
|
||||
GameState::ActiveAttack* sActiveAttacks = GAMESTATE->m_ActiveAttacks[m_PlayerNumber]; // NUM_INVENTORY_SLOTS
|
||||
GameState::Attack* sActiveAttacks = GAMESTATE->m_ActiveAttacks[m_PlayerNumber]; // NUM_INVENTORY_SLOTS
|
||||
for( int s=0; s<NUM_INVENTORY_SLOTS; s++ )
|
||||
{
|
||||
GameState::ActiveAttack& aa = sActiveAttacks[s];
|
||||
GameState::Attack& a = sActiveAttacks[s];
|
||||
|
||||
CString sDisplayText = aa.sModifier;
|
||||
CString sDisplayText = a.sModifier;
|
||||
if( sDisplayText == "" )
|
||||
m_text[s].SetText( "" );
|
||||
else
|
||||
{
|
||||
int iDisplaySecondsLeft = (int)(aa.fSecsRemaining+1);
|
||||
int iDisplaySecondsLeft = (int)(a.fSecsRemaining+1);
|
||||
m_text[s].SetText( ssprintf("%s %02d:%02d", sDisplayText.GetString(), iDisplaySecondsLeft/60, iDisplaySecondsLeft%60) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,15 +286,20 @@ void Background::LoadFromSong( Song* pSong )
|
||||
const float fFirstBeat = pSong->m_fFirstBeat;
|
||||
const float fLastBeat = pSong->m_fLastBeat;
|
||||
|
||||
const int iSequenceLength = 8;
|
||||
const int iSequence[iSequenceLength] = {0,1,0,1,2,3,2,3};
|
||||
int ctr=0;
|
||||
|
||||
// change BG every 4 bars
|
||||
for( float f=fFirstBeat; f<fLastBeat; f+=BEATS_PER_MEASURE*4 )
|
||||
{
|
||||
if( bLoadedAnyRandomBackgrounds )
|
||||
{
|
||||
CString sBGName = RANDOM_BACKGROUND[ rand()%MAX_RANDOM_BACKGROUNDS ];
|
||||
CString sBGName = RANDOM_BACKGROUND[ ctr ];
|
||||
bool bFade = PREFSMAN->m_BackgroundMode==PrefsManager::BGMODE_RANDOMMOVIES ||
|
||||
PREFSMAN->m_BackgroundMode==PrefsManager::BGMODE_MOVIEVIS;
|
||||
m_aBGChanges.push_back( BackgroundChange(f,sBGName,1.f,bFade) );
|
||||
ctr = (ctr+1)%MAX_RANDOM_BACKGROUNDS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -379,13 +379,13 @@ void GameState::RestoreSelectedOptions()
|
||||
}
|
||||
|
||||
|
||||
void GameState::LaunchAttack( PlayerNumber target, ActiveAttack aa )
|
||||
void GameState::LaunchAttack( PlayerNumber target, Attack a )
|
||||
{
|
||||
// search for an open slot
|
||||
for( unsigned s=0; s<NUM_INVENTORY_SLOTS; s++ )
|
||||
if( m_ActiveAttacks[target][s].fSecsRemaining <= 0 )
|
||||
{
|
||||
m_ActiveAttacks[target][s] = aa;
|
||||
m_ActiveAttacks[target][s] = a;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -400,6 +400,16 @@ void GameState::RemoveAllActiveAttacks()
|
||||
}
|
||||
}
|
||||
|
||||
void GameState::RemoveAllInventory()
|
||||
{
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
for( unsigned s=0; s<NUM_INVENTORY_SLOTS; s++ )
|
||||
{
|
||||
m_Inventory[p][s].fSecsRemaining = 0;
|
||||
m_Inventory[p][s].sModifier = "";
|
||||
}
|
||||
}
|
||||
|
||||
void GameState::RebuildPlayerOptionsFromActiveAttacks( PlayerNumber pn )
|
||||
{
|
||||
// rebuild player options
|
||||
|
||||
@@ -158,21 +158,26 @@ public:
|
||||
AttackLevel m_MaxAttackLevel[NUM_PLAYERS];
|
||||
CString m_sAttacks[NUM_PLAYERS][NUM_ATTACK_LEVELS][NUM_ATTACKS_PER_LEVEL];
|
||||
|
||||
// used in PLAY_MODE_BATTLE
|
||||
CString m_sInventory[NUM_PLAYERS][NUM_INVENTORY_SLOTS];
|
||||
|
||||
// used in PLAY_MODE_RAVE and PLAY_MODE_BATTLE
|
||||
struct ActiveAttack
|
||||
struct Attack
|
||||
{
|
||||
AttackLevel level;
|
||||
float fSecsRemaining;
|
||||
CString sModifier;
|
||||
bool IsBlank() { return sModifier.empty(); }
|
||||
void MakeBlank() { sModifier=""; }
|
||||
};
|
||||
ActiveAttack m_ActiveAttacks[NUM_PLAYERS][NUM_INVENTORY_SLOTS];
|
||||
Attack m_ActiveAttacks[NUM_PLAYERS][NUM_INVENTORY_SLOTS];
|
||||
|
||||
// used in PLAY_MODE_BATTLE
|
||||
Attack m_Inventory[NUM_PLAYERS][NUM_INVENTORY_SLOTS];
|
||||
|
||||
bool m_bActiveAttackEndedThisUpdate[NUM_PLAYERS]; // flag so we can play sounds
|
||||
void LaunchAttack( PlayerNumber target, ActiveAttack aa );
|
||||
void LaunchAttack( PlayerNumber target, Attack aa );
|
||||
void RebuildPlayerOptionsFromActiveAttacks( PlayerNumber pn );
|
||||
void RemoveAllActiveAttacks(); // called on end of song
|
||||
void RemoveAllInventory();
|
||||
int GetSumOfActiveAttackLevels( PlayerNumber pn );
|
||||
|
||||
|
||||
|
||||
+18
-26
@@ -16,6 +16,7 @@
|
||||
#include "GameState.h"
|
||||
#include "RageTimer.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "Song.h"
|
||||
|
||||
|
||||
#define NUM_ITEM_TYPES THEME->GetMetricF("Inventory","NumItemTypes")
|
||||
@@ -110,7 +111,8 @@ void Inventory::Update( float fDelta )
|
||||
|
||||
|
||||
// use items if this player is CPU-controlled
|
||||
if( GAMESTATE->m_PlayerController[m_PlayerNumber] != HUMAN )
|
||||
if( GAMESTATE->m_PlayerController[m_PlayerNumber] != HUMAN &&
|
||||
GAMESTATE->m_fSongBeat < GAMESTATE->m_pCurSong->m_fLastBeat )
|
||||
{
|
||||
// every one second, consider using an item
|
||||
int iLastSecond = (int)(RageTimer::GetTimeSinceStart() - fDelta);
|
||||
@@ -118,8 +120,8 @@ void Inventory::Update( float fDelta )
|
||||
if( iLastSecond != iThisSecond )
|
||||
{
|
||||
int iSlotToConsider = rand()%NUM_INVENTORY_SLOTS;
|
||||
bool bTimeToUse = (rand()%10)==0;
|
||||
if( GAMESTATE->m_sInventory[m_PlayerNumber][iSlotToConsider] != "" &&
|
||||
bool bTimeToUse = (rand()%6)==0;
|
||||
if( !GAMESTATE->m_Inventory[m_PlayerNumber][iSlotToConsider].IsBlank() &&
|
||||
bTimeToUse )
|
||||
{
|
||||
UseItem( iSlotToConsider );
|
||||
@@ -133,14 +135,14 @@ void Inventory::AwardItem( int iItemIndex )
|
||||
// search for the first open slot
|
||||
int iOpenSlot = -1;
|
||||
|
||||
CString* asInventory = GAMESTATE->m_sInventory[m_PlayerNumber]; //[NUM_INVENTORY_SLOTS]
|
||||
GameState::Attack* asInventory = GAMESTATE->m_Inventory[m_PlayerNumber]; //[NUM_INVENTORY_SLOTS]
|
||||
|
||||
if( asInventory[NUM_INVENTORY_SLOTS/2] == "" )
|
||||
if( asInventory[NUM_INVENTORY_SLOTS/2].IsBlank() )
|
||||
iOpenSlot = NUM_INVENTORY_SLOTS/2;
|
||||
else
|
||||
{
|
||||
for( int s=0; s<NUM_INVENTORY_SLOTS; s++ )
|
||||
if( asInventory[s] == "" )
|
||||
if( asInventory[s].IsBlank() )
|
||||
{
|
||||
iOpenSlot = s;
|
||||
break;
|
||||
@@ -149,8 +151,11 @@ void Inventory::AwardItem( int iItemIndex )
|
||||
|
||||
if( iOpenSlot != -1 )
|
||||
{
|
||||
CString sAttackToGive = g_Items[iItemIndex].sModifier;
|
||||
asInventory[iOpenSlot] = sAttackToGive;
|
||||
GameState::Attack a;
|
||||
a.sModifier = g_Items[iItemIndex].sModifier;
|
||||
a.fSecsRemaining = ITEM_DURATION_SECONDS;
|
||||
a.level = g_Items[iItemIndex].level;
|
||||
asInventory[iOpenSlot] = a;
|
||||
m_soundAcquireItem.Play();
|
||||
}
|
||||
// else not enough room to insert item
|
||||
@@ -158,31 +163,18 @@ void Inventory::AwardItem( int iItemIndex )
|
||||
|
||||
void Inventory::UseItem( int iSlot )
|
||||
{
|
||||
CString* asInventory = GAMESTATE->m_sInventory[m_PlayerNumber]; //[NUM_INVENTORY_SLOTS]
|
||||
GameState::Attack* asInventory = GAMESTATE->m_Inventory[m_PlayerNumber]; //[NUM_INVENTORY_SLOTS]
|
||||
|
||||
if( asInventory[iSlot] == "" )
|
||||
if( asInventory[iSlot].IsBlank() )
|
||||
return;
|
||||
|
||||
PlayerNumber pnToAttack = OPPOSITE_PLAYER[m_PlayerNumber];
|
||||
GameState::ActiveAttack aa;
|
||||
aa.sModifier = asInventory[iSlot];
|
||||
aa.fSecsRemaining = ITEM_DURATION_SECONDS;
|
||||
aa.level = ATTACK_LEVEL_1;
|
||||
GameState::Attack a = asInventory[iSlot];
|
||||
|
||||
// UGLY: Search through g_Items and find out what the attack level for this item is.
|
||||
for( unsigned i=0; i<g_Items.size(); i++ )
|
||||
{
|
||||
if( aa.sModifier == g_Items[i].sModifier )
|
||||
{
|
||||
aa.level = g_Items[i].level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GAMESTATE->LaunchAttack( pnToAttack, aa );
|
||||
GAMESTATE->LaunchAttack( pnToAttack, a );
|
||||
GAMESTATE->RebuildPlayerOptionsFromActiveAttacks( pnToAttack );
|
||||
|
||||
// remove the item
|
||||
asInventory[iSlot] = "";
|
||||
asInventory[iSlot].MakeBlank();
|
||||
m_soundUseItem.Play();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
#include "PlayerAI.h"
|
||||
|
||||
#define GRAY_ARROWS_Y THEME->GetMetricF("Player","GrayArrowsY")
|
||||
#define JUDGMENT_X( p, both_sides ) THEME->GetMetricF("Player",both_sides ? "JudgmentXOffsetBothSides" : ssprintf("JudgmentXOffsetOneSideP%d",p+1))
|
||||
#define JUDGMENT_Y THEME->GetMetricF("Player","JudgmentY")
|
||||
#define COMBO_X( p, both_sides ) THEME->GetMetricF("Player",both_sides ? "ComboXOffsetBothSides" : ssprintf("ComboXOffsetOneSideP%d",p+1))
|
||||
#define COMBO_Y THEME->GetMetricF("Player","ComboY")
|
||||
#define HOLD_JUDGMENT_Y THEME->GetMetricF("Player","HoldJudgmentY")
|
||||
CachedThemeMetricI BRIGHT_GHOST_COMBO_THRESHOLD("Player","BrightGhostComboThreshold");
|
||||
@@ -137,7 +139,10 @@ void Player::Load( PlayerNumber pn, NoteData* pNoteData, LifeMeter* pLM, ScoreDi
|
||||
m_GhostArrowRow.Load( pn );
|
||||
|
||||
bool bReverse = GAMESTATE->m_PlayerOptions[pn].m_fReverseScroll == 1;
|
||||
bool bPlayerUsingBothSides = GAMESTATE->GetCurrentStyleDef()->m_StyleType==StyleDef::ONE_PLAYER_TWO_CREDITS;
|
||||
m_Combo.SetX( COMBO_X(m_PlayerNumber,bPlayerUsingBothSides) );
|
||||
m_Combo.SetY( bReverse ? SCREEN_BOTTOM-COMBO_Y : SCREEN_TOP+COMBO_Y );
|
||||
m_Judgment.SetX( JUDGMENT_X(m_PlayerNumber,bPlayerUsingBothSides) );
|
||||
m_Judgment.SetY( bReverse ? SCREEN_BOTTOM-JUDGMENT_Y : SCREEN_TOP+JUDGMENT_Y );
|
||||
|
||||
int c;
|
||||
|
||||
@@ -80,12 +80,12 @@ void RaveHelper::LaunchAttack( AttackLevel al )
|
||||
CString sAttackToGive = asAttacks[ rand()%NUM_ATTACKS_PER_LEVEL ];
|
||||
PlayerNumber pnToAttack = OPPOSITE_PLAYER[m_PlayerNumber];
|
||||
|
||||
GameState::ActiveAttack aa;
|
||||
aa.level = al;
|
||||
aa.fSecsRemaining = ATTACK_DURATION_SECONDS;
|
||||
aa.sModifier = sAttackToGive;
|
||||
GameState::Attack a;
|
||||
a.level = al;
|
||||
a.fSecsRemaining = ATTACK_DURATION_SECONDS;
|
||||
a.sModifier = sAttackToGive;
|
||||
|
||||
GAMESTATE->LaunchAttack( pnToAttack, aa );
|
||||
GAMESTATE->LaunchAttack( pnToAttack, a );
|
||||
GAMESTATE->RebuildPlayerOptionsFromActiveAttacks( pnToAttack );
|
||||
|
||||
m_soundLaunchAttack.Play();
|
||||
|
||||
@@ -49,18 +49,19 @@ void ScoreDisplayBattle::Update( float fDelta )
|
||||
|
||||
for( int s=0; s<NUM_INVENTORY_SLOTS; s++ )
|
||||
{
|
||||
CString sNewItem = GAMESTATE->m_sInventory[m_PlayerNumber][s];
|
||||
GameState::Attack attack = GAMESTATE->m_Inventory[m_PlayerNumber][s];
|
||||
CString sNewModifier = attack.sModifier;
|
||||
|
||||
if( sNewItem != m_iLastSeenInventory[s] )
|
||||
if( sNewModifier != m_iLastSeenInventory[s] )
|
||||
{
|
||||
m_iLastSeenInventory[s] = sNewItem;
|
||||
m_iLastSeenInventory[s] = sNewModifier;
|
||||
|
||||
if( sNewItem == "" )
|
||||
if( sNewModifier == "" )
|
||||
m_ItemIcon[s].Command( "linear,0.25;zoom,0" );
|
||||
else
|
||||
{
|
||||
// TODO: Cache all of the icon graphics so we don't load them dynamically from disk.
|
||||
m_ItemIcon[s].Load( THEME->GetPathToG("ScoreDisplayBattle icon "+sNewItem) );
|
||||
m_ItemIcon[s].Load( THEME->GetPathToG("ScoreDisplayBattle icon "+sNewModifier) );
|
||||
m_ItemIcon[s].StopTweening();
|
||||
m_ItemIcon[s].Command( "diffuse,1,1,1,1;zoom,1;"
|
||||
"sleep,0.1;linear,0;diffusealpha,0;"
|
||||
|
||||
@@ -46,50 +46,6 @@ CachedThemeMetricF SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBetweenCom
|
||||
CachedThemeMetricF G_TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds");
|
||||
|
||||
|
||||
/*
|
||||
#define MAXCOMBO_X THEME->GetMetricF("ScreenGameplay","MaxComboX")
|
||||
#define MAXCOMBO_Y THEME->GetMetricF("ScreenGameplay","MaxComboY")
|
||||
#define MAXCOMBO_ZOOM THEME->GetMetricF("ScreenGameplay","MaxComboZoom")
|
||||
#define BPM_X THEME->GetMetricF("ScreenGameplay","BPMX")
|
||||
#define BPM_Y THEME->GetMetricF("ScreenGameplay","BPMY")
|
||||
#define BPM_ZOOM THEME->GetMetricF("ScreenGameplay","BPMZoom")
|
||||
#define STAGENAME_X THEME->GetMetricF("ScreenGameplay","StagenameX")
|
||||
#define STAGENAME_Y THEME->GetMetricF("ScreenGameplay","StagenameY")
|
||||
#define STAGENAME_ZOOM THEME->GetMetricF("ScreenGameplay","StagenameZoom")
|
||||
#define LIFE_FRAME_X THEME->GetMetricF("ScreenGameplay","LifeFrameX")
|
||||
#define LIFE_FRAME_Y( e ) THEME->GetMetricF("ScreenGameplay",ssprintf("LifeFrame%sY",e?"Extra":""))
|
||||
#define SCORE_FRAME_X THEME->GetMetricF("ScreenGameplay","ScoreFrameX")
|
||||
#define SCORE_FRAME_Y( e ) THEME->GetMetricF("ScreenGameplay",ssprintf("ScoreFrame%sY",e?"Extra":""))
|
||||
#define MIDDLE_FRAME_X THEME->GetMetricF("ScreenGameplay","MiddleFrameX")
|
||||
#define MIDDLE_FRAME_Y THEME->GetMetricF("ScreenGameplay","MiddleFrameY")
|
||||
#define LIFE_X( p ) THEME->GetMetricF("ScreenGameplay",ssprintf("LifeP%dX",p+1))
|
||||
#define LIFE_Y( p, e ) THEME->GetMetricF("ScreenGameplay",ssprintf("LifeP%d%sY",p+1,e?"Extra":""))
|
||||
#define STAGE_X THEME->GetMetricF("ScreenGameplay","StageX")
|
||||
#define STAGE_Y( e ) THEME->GetMetricF("ScreenGameplay",ssprintf("Stage%sY",e?"Extra":""))
|
||||
#define SONG_NUMBER_X( p ) THEME->GetMetricF("ScreenGameplay",ssprintf("SongNumberP%dX",p+1))
|
||||
#define SONG_NUMBER_Y( p, e ) THEME->GetMetricF("ScreenGameplay",ssprintf("SongNumberP%d%sY",p+1,e?"Extra":""))
|
||||
#define SCORE_X( p ) THEME->GetMetricF("ScreenGameplay",ssprintf("ScoreP%dX",p+1))
|
||||
#define SCORE_Y( p, e ) THEME->GetMetricF("ScreenGameplay",ssprintf("ScoreP%d%sY",p+1,e?"Extra":""))
|
||||
#define SCORE_ZOOM THEME->GetMetricF("ScreenGameplay","ScoreZoom")
|
||||
#define PLAYER_OPTIONS_X( p ) THEME->GetMetricF("ScreenGameplay",ssprintf("PlayerOptionsP%dX",p+1))
|
||||
#define PLAYER_OPTIONS_Y( p, e ) THEME->GetMetricF("ScreenGameplay",ssprintf("PlayerOptionsP%d%sY",p+1,e?"Extra":""))
|
||||
#define SONG_OPTIONS_X THEME->GetMetricF("ScreenGameplay","SongOptionsX")
|
||||
#define SONG_OPTIONS_Y( e ) THEME->GetMetricF("ScreenGameplay",ssprintf("SongOptions%sY",e?"Extra":""))
|
||||
#define DIFFICULTY_X( p ) THEME->GetMetricF("ScreenGameplay",ssprintf("DifficultyP%dX",p+1))
|
||||
#define DIFFICULTY_Y( p, e, r ) THEME->GetMetricF("ScreenGameplay",ssprintf("DifficultyP%d%s%sY",p+1,e?"Extra":"",r?"Reverse":""))
|
||||
#define LYRICS_X THEME->GetMetricF("ScreenGameplay",ssprintf("LyricsX"))
|
||||
#define LYRICS_Y( e, r ) THEME->GetMetricF("ScreenGameplay",ssprintf("Lyrics%s%sY",e?"Extra":"",r?"Reverse":""))
|
||||
#define ACTIVE_ITEMS_X( p ) THEME->GetMetricF("ScreenGameplay",ssprintf("ActiveItemsP%dX",p+1))
|
||||
#define ACTIVE_ITEMS_Y( p, e, r ) THEME->GetMetricF("ScreenGameplay",ssprintf("ActiveItemsP%d%s%sY",p+1,e?"Extra":"",r?"Reverse":""))
|
||||
#define DEBUG_X THEME->GetMetricF("ScreenGameplay","DebugX")
|
||||
#define DEBUG_Y THEME->GetMetricF("ScreenGameplay","DebugY")
|
||||
#define AUTOPLAY_X THEME->GetMetricF("ScreenGameplay","AutoPlayX")
|
||||
#define AUTOPLAY_Y THEME->GetMetricF("ScreenGameplay","AutoPlayY")
|
||||
#define SURVIVE_TIME_X THEME->GetMetricF("ScreenGameplay","SurviveTimeX")
|
||||
#define SURVIVE_TIME_Y THEME->GetMetricF("ScreenGameplay","SurviveTimeY")
|
||||
*/
|
||||
|
||||
|
||||
const ScreenMessage SM_PlayReady = ScreenMessage(SM_User+0);
|
||||
const ScreenMessage SM_PlayGo = ScreenMessage(SM_User+1);
|
||||
|
||||
@@ -129,6 +85,8 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay")
|
||||
/* Save selected options before we change them. */
|
||||
GAMESTATE->StoreSelectedOptions();
|
||||
|
||||
GAMESTATE->RemoveAllInventory();
|
||||
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
@@ -470,6 +428,18 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay")
|
||||
m_Extra.Load( THEME->GetPathToB("ScreenGameplay extra2") );
|
||||
this->AddChild( &m_Extra );
|
||||
|
||||
// only load if we're going to use it
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_BATTLE:
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_Win[p].Load( THEME->GetPathToB(ssprintf("ScreenGameplay win p%d",p+1)) );
|
||||
this->AddChild( &m_Win[p] );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
m_In.Load( THEME->GetPathToB("ScreenGameplay in") );
|
||||
this->AddChild( &m_In );
|
||||
|
||||
@@ -1338,6 +1308,8 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
return; // ignore
|
||||
m_DancingState = STATE_OUTRO;
|
||||
|
||||
GAMESTATE->RemoveAllActiveAttacks();
|
||||
|
||||
if( GAMESTATE->m_SongOptions.m_FailType == SongOptions::FAIL_END_OF_SONG && AllFailedEarlier() )
|
||||
{
|
||||
this->PostScreenMessage( SM_BeginFailed, 0 );
|
||||
@@ -1354,7 +1326,23 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
else
|
||||
{
|
||||
TweenOffScreen();
|
||||
m_Cleared.StartTransitioning( SM_GoToStateAfterCleared );
|
||||
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_BATTLE:
|
||||
{
|
||||
PlayerNumber winner = PLAYER_1;
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->m_CurStageStats.iActualDancePoints[p] > GAMESTATE->m_CurStageStats.iActualDancePoints[winner] )
|
||||
winner = (PlayerNumber)p;
|
||||
m_Win[winner].StartTransitioning( SM_GoToStateAfterCleared );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
m_Cleared.StartTransitioning( SM_GoToStateAfterCleared );
|
||||
break;
|
||||
}
|
||||
|
||||
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay cleared") );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,6 +126,7 @@ protected:
|
||||
Transition m_Failed;
|
||||
Transition m_Extra;
|
||||
Transition m_Toasty; // easter egg
|
||||
Transition m_Win[NUM_PLAYERS];
|
||||
Transition m_In;
|
||||
Transition m_Back;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user