2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2002-05-20 08:59:37 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: ScreenGameplay
|
|
|
|
|
|
|
|
|
|
Desc: See header.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ScreenGameplay.h"
|
|
|
|
|
#include "SongManager.h"
|
|
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "PrefsManager.h"
|
2002-05-20 08:59:37 +00:00
|
|
|
#include "GameManager.h"
|
|
|
|
|
#include "SongManager.h"
|
|
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "AnnouncerManager.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "LifeMeterBar.h"
|
|
|
|
|
#include "LifeMeterBattery.h"
|
|
|
|
|
#include "GameState.h"
|
|
|
|
|
#include "ScoreDisplayNormal.h"
|
|
|
|
|
#include "ScoreDisplayOni.h"
|
2003-02-25 00:33:42 +00:00
|
|
|
#include "ScoreDisplayBattle.h"
|
2003-04-07 05:14:27 +00:00
|
|
|
#include "ScoreDisplayRave.h"
|
2002-07-27 19:29:51 +00:00
|
|
|
#include "ScreenPrompt.h"
|
2002-08-27 03:59:22 +00:00
|
|
|
#include "GrooveRadar.h"
|
2002-09-06 23:36:04 +00:00
|
|
|
#include "NotesLoaderSM.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include "ThemeManager.h"
|
2003-01-25 07:40:47 +00:00
|
|
|
#include "RageTimer.h"
|
2003-03-16 18:57:34 +00:00
|
|
|
#include "ScoreKeeperMAX2.h"
|
2003-06-30 18:08:27 +00:00
|
|
|
#include "ScoreKeeperRave.h"
|
2003-04-02 21:57:25 +00:00
|
|
|
#include "NoteFieldPositioning.h"
|
2003-03-19 12:43:49 +00:00
|
|
|
#include "LyricsLoader.h"
|
2003-04-13 21:17:14 +00:00
|
|
|
#include "ActorUtil.h"
|
2003-04-22 04:54:04 +00:00
|
|
|
#include "NoteSkinManager.h"
|
|
|
|
|
#include "RageTextureManager.h"
|
2003-07-26 23:05:16 +00:00
|
|
|
#include "RageSounds.h"
|
2003-06-30 18:08:27 +00:00
|
|
|
#include "CombinedLifeMeterEnemy.h"
|
|
|
|
|
#include "CombinedLifeMeterTug.h"
|
2003-07-08 19:56:56 +00:00
|
|
|
#include "Inventory.h"
|
2003-07-17 20:10:07 +00:00
|
|
|
#include "Course.h"
|
2003-03-19 12:43:49 +00:00
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
//
|
2002-07-23 01:41:40 +00:00
|
|
|
// Defines
|
2002-05-20 08:59:37 +00:00
|
|
|
//
|
2003-07-08 19:56:56 +00:00
|
|
|
#define PREV_SCREEN( play_mode ) THEME->GetMetric ("ScreenGameplay","PrevScreen"+Capitalize(PlayModeToString(play_mode)))
|
|
|
|
|
#define NEXT_SCREEN( play_mode ) THEME->GetMetric ("ScreenGameplay","NextScreen"+Capitalize(PlayModeToString(play_mode)))
|
|
|
|
|
#define SHOW_LIFE_METER_FOR_DISABLED_PLAYERS THEME->GetMetricB("ScreenGameplay","ShowLifeMeterForDisabledPlayers")
|
2003-04-22 14:32:48 +00:00
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
CachedThemeMetricF SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBetweenComments");
|
|
|
|
|
CachedThemeMetricF G_TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds");
|
|
|
|
|
|
|
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
const ScreenMessage SM_PlayReady = ScreenMessage(SM_User+0);
|
|
|
|
|
const ScreenMessage SM_PlayGo = ScreenMessage(SM_User+1);
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
// received while STATE_DANCING
|
2003-03-09 00:55:49 +00:00
|
|
|
const ScreenMessage SM_NotesEnded = ScreenMessage(SM_User+10);
|
2003-04-13 00:44:50 +00:00
|
|
|
const ScreenMessage SM_LoadNextSong = ScreenMessage(SM_User+11);
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
// received while STATE_OUTRO
|
2003-03-09 00:55:49 +00:00
|
|
|
const ScreenMessage SM_SaveChangedBeforeGoingBack = ScreenMessage(SM_User+20);
|
|
|
|
|
const ScreenMessage SM_GoToScreenAfterBack = ScreenMessage(SM_User+21);
|
|
|
|
|
const ScreenMessage SM_GoToStateAfterCleared= ScreenMessage(SM_User+22);
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
const ScreenMessage SM_BeginFailed = ScreenMessage(SM_User+30);
|
|
|
|
|
const ScreenMessage SM_GoToScreenAfterFail = ScreenMessage(SM_User+31);
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-01-25 07:40:47 +00:00
|
|
|
// received while STATE_INTRO
|
2003-03-09 00:55:49 +00:00
|
|
|
const ScreenMessage SM_StartHereWeGo = ScreenMessage(SM_User+40);
|
|
|
|
|
const ScreenMessage SM_StopHereWeGo = ScreenMessage(SM_User+41);
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
|
2003-04-12 06:16:12 +00:00
|
|
|
ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay")
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2002-07-31 19:40:40 +00:00
|
|
|
LOG->Trace( "ScreenGameplay::ScreenGameplay()" );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-07 21:24:14 +00:00
|
|
|
int p;
|
|
|
|
|
|
2003-03-19 19:58:22 +00:00
|
|
|
m_bDemonstration = bDemonstration;
|
2003-03-09 00:55:49 +00:00
|
|
|
|
|
|
|
|
SECONDS_BETWEEN_COMMENTS.Refresh();
|
|
|
|
|
G_TICK_EARLY_SECONDS.Refresh();
|
|
|
|
|
|
|
|
|
|
|
2003-02-04 21:36:30 +00:00
|
|
|
if( GAMESTATE->m_pCurSong == NULL && GAMESTATE->m_pCurCourse == NULL )
|
2003-01-19 21:05:03 +00:00
|
|
|
return; // ScreenDemonstration will move us to the next scren. We just need to survive for one update without crashing.
|
|
|
|
|
|
2003-02-24 03:26:33 +00:00
|
|
|
/* Save selected options before we change them. */
|
|
|
|
|
GAMESTATE->StoreSelectedOptions();
|
|
|
|
|
|
2003-07-03 06:38:57 +00:00
|
|
|
GAMESTATE->ResetStageStatistics();
|
2003-04-14 22:12:54 +00:00
|
|
|
|
2003-04-07 21:24:14 +00:00
|
|
|
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2002-08-28 22:42:40 +00:00
|
|
|
{
|
2003-04-07 21:24:14 +00:00
|
|
|
m_pLifeMeter[p] = NULL;
|
|
|
|
|
m_pScoreDisplay[p] = NULL;
|
2003-06-30 18:08:27 +00:00
|
|
|
m_pPrimaryScoreKeeper[p] = NULL;
|
|
|
|
|
m_pSecondaryScoreKeeper[p] = NULL;
|
2002-08-28 22:42:40 +00:00
|
|
|
}
|
2003-06-30 18:08:27 +00:00
|
|
|
m_pCombinedLifeMeter = NULL;
|
2002-08-28 22:42:40 +00:00
|
|
|
|
2002-08-02 09:31:06 +00:00
|
|
|
|
2003-04-07 21:24:14 +00:00
|
|
|
// fill in difficulty of CPU players with that of the first human player
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
if( GAMESTATE->IsCpuPlayer(p) )
|
|
|
|
|
GAMESTATE->m_pCurNotes[p] = GAMESTATE->m_pCurNotes[ GAMESTATE->GetFirstHumanPlayer() ];
|
|
|
|
|
|
|
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
GAMESTATE->m_CurStageStats = StageStats(); // clear values
|
2003-02-14 21:42:44 +00:00
|
|
|
|
2003-04-22 04:54:04 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_HUMAN_BATTLE:
|
|
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
2003-04-22 04:54:04 +00:00
|
|
|
case PLAY_MODE_RAVE:
|
|
|
|
|
{
|
|
|
|
|
// cache NoteSkin graphics
|
|
|
|
|
CStringArray asNames;
|
|
|
|
|
NOTESKIN->GetNoteSkinNames( asNames );
|
|
|
|
|
for( unsigned i=0; i<asNames.size(); i++ )
|
|
|
|
|
{
|
|
|
|
|
CString sDir = NOTESKIN->GetNoteSkinDir( asNames[i] );
|
|
|
|
|
CStringArray asGraphicPaths;
|
|
|
|
|
GetDirListing( sDir+"*.png", asGraphicPaths, false, true );
|
|
|
|
|
GetDirListing( sDir+"*.jpg", asGraphicPaths, false, true );
|
|
|
|
|
GetDirListing( sDir+"*.gif", asGraphicPaths, false, true );
|
|
|
|
|
GetDirListing( sDir+"*.bmp", asGraphicPaths, false, true );
|
|
|
|
|
for( unsigned j=0; j<asGraphicPaths.size(); j++ )
|
|
|
|
|
TEXTUREMAN->CacheTexture( asGraphicPaths[j] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-16 18:57:34 +00:00
|
|
|
|
2003-03-26 23:08:05 +00:00
|
|
|
//
|
|
|
|
|
// fill in m_apSongsQueue, m_apNotesQueue, m_asModifiersQueue
|
|
|
|
|
//
|
|
|
|
|
if( GAMESTATE->IsCourseMode() )
|
2003-03-16 18:57:34 +00:00
|
|
|
{
|
2003-07-21 21:54:07 +00:00
|
|
|
vector<Course::Info> ci;
|
|
|
|
|
GAMESTATE->m_pCurCourse->GetCourseInfo( GAMESTATE->GetCurrentStyleDef()->m_NotesType, ci );
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
2003-03-26 23:08:05 +00:00
|
|
|
{
|
2003-07-21 21:54:07 +00:00
|
|
|
m_apNotesQueue[p].clear();
|
|
|
|
|
m_asModifiersQueue[p].clear();
|
|
|
|
|
for( unsigned c=0; c<ci.size(); ++c )
|
|
|
|
|
{
|
2003-07-21 23:52:01 +00:00
|
|
|
m_apNotesQueue[p].push_back( ci[c].pNotes );
|
2003-07-21 21:54:07 +00:00
|
|
|
m_asModifiersQueue[p].push_back( ci[c].Modifiers );
|
|
|
|
|
}
|
2003-03-26 23:08:05 +00:00
|
|
|
}
|
2003-07-24 02:41:56 +00:00
|
|
|
m_apSongsQueue.clear();
|
|
|
|
|
for( unsigned c=0; c<ci.size(); ++c )
|
|
|
|
|
m_apSongsQueue.push_back( ci[c].pSong );
|
2003-03-16 18:57:34 +00:00
|
|
|
}
|
2003-03-26 23:08:05 +00:00
|
|
|
else
|
2002-06-14 22:25:22 +00:00
|
|
|
{
|
2003-03-26 23:08:05 +00:00
|
|
|
m_apSongsQueue.push_back( GAMESTATE->m_pCurSong );
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
2002-07-28 20:28:37 +00:00
|
|
|
{
|
2003-03-26 23:08:05 +00:00
|
|
|
m_apNotesQueue[p].push_back( GAMESTATE->m_pCurNotes[p] );
|
|
|
|
|
m_asModifiersQueue[p].push_back( "" );
|
2003-02-14 21:42:44 +00:00
|
|
|
}
|
2003-03-26 23:08:05 +00:00
|
|
|
}
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-03-26 23:08:05 +00:00
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Init ScoreKeepers
|
|
|
|
|
//
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue; // skip
|
2003-06-30 18:08:27 +00:00
|
|
|
m_pPrimaryScoreKeeper[p] = new ScoreKeeperMAX2( m_apNotesQueue[p], (PlayerNumber)p );
|
|
|
|
|
|
|
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
|
|
|
|
case PLAY_MODE_RAVE:
|
|
|
|
|
m_pSecondaryScoreKeeper[p] = new ScoreKeeperRave( (PlayerNumber)p );
|
|
|
|
|
break;
|
|
|
|
|
}
|
2002-06-14 22:25:22 +00:00
|
|
|
}
|
|
|
|
|
|
2003-01-10 02:22:07 +00:00
|
|
|
|
|
|
|
|
|
2003-03-26 23:08:05 +00:00
|
|
|
|
2003-01-11 08:55:21 +00:00
|
|
|
m_bChangedOffsetOrBPM = GAMESTATE->m_SongOptions.m_bAutoSync;
|
2002-07-28 20:28:37 +00:00
|
|
|
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
m_DancingState = STATE_INTRO;
|
2002-08-13 23:26:46 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-02-27 10:56:37 +00:00
|
|
|
|
2003-04-13 00:44:50 +00:00
|
|
|
m_bZeroDeltaOnNextUpdate = false;
|
2003-02-27 10:56:37 +00:00
|
|
|
|
2003-03-08 08:03:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-02-27 10:56:37 +00:00
|
|
|
// If this is beginner mode, show the helper
|
2003-03-08 08:03:22 +00:00
|
|
|
/* !! Working on this.. having probs loading the BG sequences -- Miryokuteki */
|
|
|
|
|
|
|
|
|
|
//this->AddChild( &m_bhDancer );
|
2003-04-12 17:39:27 +00:00
|
|
|
//m_bhDancer.Load( THEME->GetPathToG( "select difficulty ex picture easy") );
|
2003-03-08 08:03:22 +00:00
|
|
|
//m_bhDancer.SetXY( -100,-100 ); //<-- causing entire screen to offset!
|
|
|
|
|
//m_bhDancer.SetDiffuse( RageColor(1,1,1,1) );
|
|
|
|
|
//m_bhDancer.SetEffectGlowShift( 0.5f );
|
|
|
|
|
//m_bhDancer.BeginDraw();
|
|
|
|
|
|
|
|
|
|
/* */
|
|
|
|
|
|
|
|
|
|
|
2003-02-27 10:56:37 +00:00
|
|
|
|
|
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
const bool bExtra = GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2();
|
2003-02-27 10:56:37 +00:00
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-10-28 05:30:45 +00:00
|
|
|
m_Background.SetDiffuse( RageColor(0.4f,0.4f,0.4f,1) );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_Background );
|
2002-05-27 08:23:27 +00:00
|
|
|
|
2003-04-13 23:22:27 +00:00
|
|
|
if( !bDemonstration ) // only load if we're going to use it
|
|
|
|
|
{
|
|
|
|
|
m_Toasty.Load( THEME->GetPathToB("ScreenGameplay toasty") );
|
|
|
|
|
this->AddChild( &m_Toasty );
|
|
|
|
|
}
|
|
|
|
|
|
2003-02-14 22:39:23 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2002-07-23 01:41:40 +00:00
|
|
|
if( !GAMESTATE->IsPlayerEnabled(PlayerNumber(p)) )
|
2002-05-20 08:59:37 +00:00
|
|
|
continue;
|
|
|
|
|
|
2002-08-01 21:55:40 +00:00
|
|
|
float fPlayerX = (float) GAMESTATE->GetCurrentStyleDef()->m_iCenterX[p];
|
2003-03-02 06:16:03 +00:00
|
|
|
|
|
|
|
|
// If solo-single is enabled..
|
|
|
|
|
/* XXX: Maybe this should be enabled for all ONE_PLAYER_ONE_CREDIT modes.
|
|
|
|
|
* I don't feel like testing that right now, though. */
|
|
|
|
|
if( PREFSMAN->m_bSoloSingle &&
|
2003-03-17 22:12:20 +00:00
|
|
|
GAMESTATE->m_CurStyle == STYLE_DANCE_SINGLE &&
|
2003-03-02 06:16:03 +00:00
|
|
|
GAMESTATE->GetNumSidesJoined() == 1 )
|
|
|
|
|
fPlayerX = SCREEN_WIDTH/2;
|
|
|
|
|
|
2002-08-01 21:55:40 +00:00
|
|
|
m_Player[p].SetX( fPlayerX );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_Player[p] );
|
2002-08-01 21:55:40 +00:00
|
|
|
|
2003-03-27 00:51:57 +00:00
|
|
|
m_TimingAssist.Load((PlayerNumber)p, &m_Player[p]);
|
|
|
|
|
|
2003-07-08 19:56:56 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
2003-04-07 23:06:33 +00:00
|
|
|
{
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_HUMAN_BATTLE:
|
|
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
2003-04-07 23:06:33 +00:00
|
|
|
m_ActiveItemList[p].Init( (PlayerNumber)p );
|
|
|
|
|
/* Position it in LoadNextSong. */
|
|
|
|
|
this->AddChild( &m_ActiveItemList[p] );
|
2003-07-08 19:56:56 +00:00
|
|
|
break;
|
2003-04-07 23:06:33 +00:00
|
|
|
}
|
2003-02-26 00:20:00 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprOniGameOver[p].Load( THEME->GetPathToG("ScreenGameplay oni gameover") );
|
2002-08-01 21:55:40 +00:00
|
|
|
m_sprOniGameOver[p].SetX( fPlayerX );
|
|
|
|
|
m_sprOniGameOver[p].SetY( SCREEN_TOP - m_sprOniGameOver[p].GetZoomedHeight()/2 );
|
2002-10-28 05:30:45 +00:00
|
|
|
m_sprOniGameOver[p].SetDiffuse( RageColor(1,1,1,0) ); // 0 alpha so we don't waste time drawing while not visible
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_sprOniGameOver[p] );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-27 00:51:57 +00:00
|
|
|
this->AddChild(&m_TimingAssist);
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-13 00:44:50 +00:00
|
|
|
this->AddChild( &m_NextSongIn );
|
|
|
|
|
|
|
|
|
|
this->AddChild( &m_NextSongOut );
|
2002-08-01 21:55:40 +00:00
|
|
|
|
|
|
|
|
|
2002-06-14 22:25:22 +00:00
|
|
|
|
2002-10-18 19:01:32 +00:00
|
|
|
// LifeFrame goes below LifeMeter
|
|
|
|
|
CString sLifeFrameName;
|
|
|
|
|
if( bExtra )
|
2003-03-09 00:55:49 +00:00
|
|
|
sLifeFrameName = "ScreenGameplay extra life frame";
|
2002-10-18 19:01:32 +00:00
|
|
|
else if( GAMESTATE->m_SongOptions.m_LifeType == SongOptions::LIFE_BATTERY )
|
2003-03-09 00:55:49 +00:00
|
|
|
sLifeFrameName = "ScreenGameplay oni life frame";
|
2002-10-18 19:01:32 +00:00
|
|
|
else
|
2003-03-09 00:55:49 +00:00
|
|
|
sLifeFrameName = "ScreenGameplay life frame";
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprLifeFrame.Load( THEME->GetPathToG(sLifeFrameName) );
|
2003-04-13 21:17:14 +00:00
|
|
|
m_sprLifeFrame.SetName( bExtra?"LifeFrameExtra":"LifeFrame" );
|
|
|
|
|
SET_XY( m_sprLifeFrame );
|
2002-10-18 19:01:32 +00:00
|
|
|
this->AddChild( &m_sprLifeFrame );
|
|
|
|
|
|
2003-07-08 19:56:56 +00:00
|
|
|
//
|
|
|
|
|
// combined life meter
|
|
|
|
|
//
|
|
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
|
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
|
|
|
|
case PLAY_MODE_RAVE:
|
|
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
|
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
|
|
|
|
m_pCombinedLifeMeter = new CombinedLifeMeterEnemy;
|
|
|
|
|
break;
|
|
|
|
|
case PLAY_MODE_RAVE:
|
|
|
|
|
m_pCombinedLifeMeter = new CombinedLifeMeterTug;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
m_pCombinedLifeMeter->SetName( ssprintf("CombinedLife%s",bExtra?"Extra":"") );
|
|
|
|
|
SET_XY( *m_pCombinedLifeMeter );
|
|
|
|
|
this->AddChild( m_pCombinedLifeMeter );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// individual life meter
|
|
|
|
|
//
|
2003-06-30 18:08:27 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2003-06-30 18:08:27 +00:00
|
|
|
case PLAY_MODE_ARCADE:
|
|
|
|
|
case PLAY_MODE_ONI:
|
|
|
|
|
case PLAY_MODE_NONSTOP:
|
|
|
|
|
case PLAY_MODE_ENDLESS:
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
|
|
|
|
case PLAY_MODE_HUMAN_BATTLE:
|
2003-06-30 18:08:27 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-07-08 19:56:56 +00:00
|
|
|
// CPU players don't have an individual life meter in CPU battle
|
|
|
|
|
if( GAMESTATE->m_PlayMode == PLAY_MODE_CPU_BATTLE &&
|
|
|
|
|
GAMESTATE->IsCpuPlayer(p) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) && !SHOW_LIFE_METER_FOR_DISABLED_PLAYERS )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
2003-06-30 18:08:27 +00:00
|
|
|
switch( GAMESTATE->m_SongOptions.m_LifeType )
|
|
|
|
|
{
|
|
|
|
|
case SongOptions::LIFE_BAR:
|
|
|
|
|
m_pLifeMeter[p] = new LifeMeterBar;
|
|
|
|
|
break;
|
|
|
|
|
case SongOptions::LIFE_BATTERY:
|
|
|
|
|
m_pLifeMeter[p] = new LifeMeterBattery;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pLifeMeter[p]->Load( (PlayerNumber)p );
|
|
|
|
|
m_pLifeMeter[p]->SetName( ssprintf("LifeP%d%s",p+1,bExtra?"Extra":"") );
|
|
|
|
|
SET_XY( *m_pLifeMeter[p] );
|
|
|
|
|
this->AddChild( m_pLifeMeter[p] );
|
|
|
|
|
}
|
|
|
|
|
break;
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-06-30 18:08:27 +00:00
|
|
|
|
2003-04-13 23:22:27 +00:00
|
|
|
m_sprStage.SetName( ssprintf("Stage%s",bExtra?"Extra":"") );
|
|
|
|
|
SET_XY( m_sprStage );
|
|
|
|
|
|
|
|
|
|
|
2002-08-01 21:11:32 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2002-08-01 03:15:27 +00:00
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textCourseSongNumber[p].LoadFromNumbers( THEME->GetPathToN("ScreenGameplay song num") );
|
2003-03-02 01:43:33 +00:00
|
|
|
m_textCourseSongNumber[p].EnableShadow( false );
|
2003-04-13 21:17:14 +00:00
|
|
|
m_textCourseSongNumber[p].SetName( ssprintf("SongNumberP%d%s",p+1,bExtra?"Extra":"") );
|
|
|
|
|
SET_XY( m_textCourseSongNumber[p] );
|
2002-08-01 03:15:27 +00:00
|
|
|
m_textCourseSongNumber[p].SetText( "" );
|
2003-03-10 00:16:49 +00:00
|
|
|
m_textCourseSongNumber[p].SetDiffuse( RageColor(0,0.5f,1,1) ); // light blue
|
2002-08-01 03:15:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
|
|
|
|
case PLAY_MODE_ARCADE:
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_HUMAN_BATTLE:
|
|
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
2003-04-07 05:14:27 +00:00
|
|
|
case PLAY_MODE_RAVE:
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprStage.Load( THEME->GetPathToG("ScreenGameplay stage "+GAMESTATE->GetStageText()) );
|
2003-03-10 00:16:49 +00:00
|
|
|
this->AddChild( &m_sprStage );
|
2002-08-01 03:15:27 +00:00
|
|
|
break;
|
2003-01-21 05:14:59 +00:00
|
|
|
case PLAY_MODE_NONSTOP:
|
2002-08-01 03:15:27 +00:00
|
|
|
case PLAY_MODE_ONI:
|
|
|
|
|
case PLAY_MODE_ENDLESS:
|
2002-08-01 21:11:32 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2002-08-01 13:42:56 +00:00
|
|
|
if( GAMESTATE->IsPlayerEnabled(p) )
|
2003-04-13 21:17:14 +00:00
|
|
|
{
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_textCourseSongNumber[p] );
|
2003-04-13 21:17:14 +00:00
|
|
|
}
|
2002-08-01 03:15:27 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0); // invalid GameMode
|
|
|
|
|
}
|
2002-06-14 22:25:22 +00:00
|
|
|
|
|
|
|
|
|
2002-08-28 22:42:40 +00:00
|
|
|
//
|
2002-09-10 17:29:11 +00:00
|
|
|
// Add all Actors in score frame
|
2002-08-28 22:42:40 +00:00
|
|
|
//
|
2002-09-10 17:29:11 +00:00
|
|
|
CString sScoreFrameName;
|
2002-09-10 16:57:13 +00:00
|
|
|
if( bExtra )
|
2003-03-09 00:55:49 +00:00
|
|
|
sScoreFrameName = "ScreenGameplay extra score frame";
|
2002-09-10 16:57:13 +00:00
|
|
|
else if( GAMESTATE->m_SongOptions.m_LifeType == SongOptions::LIFE_BATTERY )
|
2003-03-09 00:55:49 +00:00
|
|
|
sScoreFrameName = "ScreenGameplay oni score frame";
|
2002-09-10 16:57:13 +00:00
|
|
|
else
|
2003-03-09 00:55:49 +00:00
|
|
|
sScoreFrameName = "ScreenGameplay score frame";
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprScoreFrame.Load( THEME->GetPathToG(sScoreFrameName) );
|
2003-04-13 21:17:14 +00:00
|
|
|
m_sprScoreFrame.SetName( ssprintf("ScoreFrame%s",bExtra?"Extra":"") );
|
|
|
|
|
SET_XY( m_sprScoreFrame );
|
2002-09-10 17:29:11 +00:00
|
|
|
this->AddChild( &m_sprScoreFrame );
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textSongTitle.LoadFromFont( THEME->GetPathToF("ScreenGameplay song title") );
|
2003-03-30 18:12:57 +00:00
|
|
|
m_textSongTitle.EnableShadow( false );
|
2003-04-13 21:17:14 +00:00
|
|
|
m_textSongTitle.SetName( "SongTitle" );
|
|
|
|
|
SET_XY( m_textSongTitle );
|
2003-03-30 18:12:57 +00:00
|
|
|
this->AddChild( &m_textSongTitle );
|
2002-10-30 00:14:47 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_MaxCombo.LoadFromNumbers( THEME->GetPathToN("ScreenGameplay max combo") );
|
2003-04-13 21:17:14 +00:00
|
|
|
m_MaxCombo.SetName( "MaxCombo" );
|
|
|
|
|
SET_XY( m_MaxCombo );
|
|
|
|
|
m_MaxCombo.SetText( ssprintf("%d", GAMESTATE->m_CurStageStats.iCurCombo[GAMESTATE->m_MasterPlayerNumber]) ); // TODO: Make this work for both players
|
2002-11-07 19:42:39 +00:00
|
|
|
this->AddChild( &m_MaxCombo );
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-07-08 19:56:56 +00:00
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
2002-05-20 08:59:37 +00:00
|
|
|
continue;
|
2002-07-30 01:45:18 +00:00
|
|
|
|
2002-08-28 22:42:40 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
2002-08-13 23:26:46 +00:00
|
|
|
{
|
2002-08-28 22:42:40 +00:00
|
|
|
case PLAY_MODE_ARCADE:
|
2003-03-26 19:15:38 +00:00
|
|
|
case PLAY_MODE_NONSTOP:
|
2002-08-28 22:42:40 +00:00
|
|
|
m_pScoreDisplay[p] = new ScoreDisplayNormal;
|
|
|
|
|
break;
|
|
|
|
|
case PLAY_MODE_ONI:
|
|
|
|
|
case PLAY_MODE_ENDLESS:
|
|
|
|
|
m_pScoreDisplay[p] = new ScoreDisplayOni;
|
|
|
|
|
break;
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
|
|
|
|
// CPU controlled player is vanity only. It has no
|
|
|
|
|
// effect on gameplay, and thus no score.
|
|
|
|
|
if( GAMESTATE->IsCpuPlayer(p) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
m_pScoreDisplay[p] = new ScoreDisplayBattle;
|
|
|
|
|
break;
|
|
|
|
|
case PLAY_MODE_HUMAN_BATTLE:
|
2003-02-25 00:33:42 +00:00
|
|
|
m_pScoreDisplay[p] = new ScoreDisplayBattle;
|
|
|
|
|
break;
|
2003-04-07 05:14:27 +00:00
|
|
|
case PLAY_MODE_RAVE:
|
|
|
|
|
m_pScoreDisplay[p] = new ScoreDisplayRave;
|
|
|
|
|
break;
|
2002-08-28 22:42:40 +00:00
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pScoreDisplay[p]->Init( (PlayerNumber)p );
|
2003-04-13 21:17:14 +00:00
|
|
|
m_pScoreDisplay[p]->SetName( ssprintf("ScoreP%d%s",p+1,bExtra?"Extra":"") );
|
|
|
|
|
SET_XY( *m_pScoreDisplay[p] );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( m_pScoreDisplay[p] );
|
2003-07-08 19:56:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textPlayerOptions[p].LoadFromFont( THEME->GetPathToF("Common normal") );
|
2003-03-02 01:43:33 +00:00
|
|
|
m_textPlayerOptions[p].EnableShadow( false );
|
2003-04-13 21:17:14 +00:00
|
|
|
m_textPlayerOptions[p].SetName( ssprintf("PlayerOptionsP%d%s",p+1,bExtra?"Extra":"") );
|
|
|
|
|
SET_XY( m_textPlayerOptions[p] );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_textPlayerOptions[p] );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textSongOptions.LoadFromFont( THEME->GetPathToF("Common normal") );
|
2003-03-02 01:43:33 +00:00
|
|
|
m_textSongOptions.EnableShadow( false );
|
2003-04-13 21:17:14 +00:00
|
|
|
m_textSongOptions.SetName( ssprintf("SongOptions%s",bExtra?"Extra":"") );
|
|
|
|
|
SET_XY( m_textSongOptions );
|
2002-08-13 23:26:46 +00:00
|
|
|
m_textSongOptions.SetText( GAMESTATE->m_SongOptions.GetString() );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_textSongOptions );
|
2002-06-14 22:25:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-07-10 03:39:30 +00:00
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
2002-06-14 22:25:22 +00:00
|
|
|
continue;
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_DifficultyIcon[p].Load( THEME->GetPathToG("ScreenGameplay difficulty icons 2x5") );
|
2003-07-10 03:39:30 +00:00
|
|
|
|
|
|
|
|
// UGLY HACK: Don't show difficulty icon for CPU.
|
|
|
|
|
if( GAMESTATE->m_PlayMode == PLAY_MODE_CPU_BATTLE && GAMESTATE->IsCpuPlayer(p) )
|
|
|
|
|
m_DifficultyIcon[p].SetZoom( 0 );
|
|
|
|
|
|
2003-02-28 20:50:28 +00:00
|
|
|
/* Position it in LoadNextSong. */
|
2002-10-06 16:56:58 +00:00
|
|
|
this->AddChild( &m_DifficultyIcon[p] );
|
2002-06-14 22:25:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-20 18:51:14 +00:00
|
|
|
if(PREFSMAN->m_bShowLyrics)
|
|
|
|
|
this->AddChild(&m_LyricDisplay);
|
2002-08-23 20:18:29 +00:00
|
|
|
|
2003-01-11 08:55:21 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textAutoPlay.LoadFromFont( THEME->GetPathToF("ScreenGameplay autoplay") );
|
2003-04-13 21:17:14 +00:00
|
|
|
m_textAutoPlay.SetName( "AutoPlay" );
|
|
|
|
|
SET_XY( m_textAutoPlay );
|
2003-03-13 08:47:43 +00:00
|
|
|
if( !bDemonstration ) // only load if we're not in demonstration of jukebox
|
|
|
|
|
this->AddChild( &m_textAutoPlay );
|
2003-03-12 01:26:44 +00:00
|
|
|
UpdateAutoPlayText();
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_BPMDisplay.SetName( "BPM" );
|
|
|
|
|
SET_XY( m_BPMDisplay );
|
2003-03-09 00:55:49 +00:00
|
|
|
this->AddChild( &m_BPMDisplay );
|
|
|
|
|
|
2003-07-15 20:05:00 +00:00
|
|
|
ZERO( m_pInventory );
|
2003-04-07 03:25:44 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-07-08 19:56:56 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
2003-04-07 23:06:33 +00:00
|
|
|
{
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_HUMAN_BATTLE:
|
|
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
|
|
|
|
m_pInventory[p] = new Inventory;
|
|
|
|
|
m_pInventory[p]->Load( (PlayerNumber)p );
|
|
|
|
|
this->AddChild( m_pInventory[p] );
|
|
|
|
|
break;
|
2003-04-07 23:06:33 +00:00
|
|
|
}
|
2003-04-07 03:25:44 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
|
|
|
|
|
if( !bDemonstration ) // only load if we're going to use it
|
|
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_Ready.Load( THEME->GetPathToB("ScreenGameplay ready") );
|
2003-03-09 00:55:49 +00:00
|
|
|
this->AddChild( &m_Ready );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_Go.Load( THEME->GetPathToB("ScreenGameplay go") );
|
2003-03-09 00:55:49 +00:00
|
|
|
this->AddChild( &m_Go );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_Cleared.Load( THEME->GetPathToB("ScreenGameplay cleared") );
|
2003-03-09 00:55:49 +00:00
|
|
|
this->AddChild( &m_Cleared );
|
2002-09-10 01:13:45 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_Failed.Load( THEME->GetPathToB("ScreenGameplay failed") );
|
2003-03-09 00:55:49 +00:00
|
|
|
this->AddChild( &m_Failed );
|
2002-07-27 19:29:51 +00:00
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
if( GAMESTATE->IsFinalStage() ) // only load if we're going to use it
|
2003-04-12 17:39:27 +00:00
|
|
|
m_Extra.Load( THEME->GetPathToB("ScreenGameplay extra1") );
|
2003-03-09 00:55:49 +00:00
|
|
|
if( GAMESTATE->IsExtraStage() ) // only load if we're going to use it
|
2003-04-12 17:39:27 +00:00
|
|
|
m_Extra.Load( THEME->GetPathToB("ScreenGameplay extra2") );
|
2003-03-09 00:55:49 +00:00
|
|
|
this->AddChild( &m_Extra );
|
2002-08-01 13:42:56 +00:00
|
|
|
|
2003-04-14 22:12:54 +00:00
|
|
|
// only load if we're going to use it
|
|
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_HUMAN_BATTLE:
|
|
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
2003-04-21 02:41:10 +00:00
|
|
|
case PLAY_MODE_RAVE:
|
2003-04-14 22:12:54 +00:00
|
|
|
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] );
|
|
|
|
|
}
|
2003-04-21 02:41:10 +00:00
|
|
|
m_Draw.Load( THEME->GetPathToB("ScreenGameplay draw") );
|
|
|
|
|
this->AddChild( &m_Draw );
|
2003-04-14 22:12:54 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_In.Load( THEME->GetPathToB("ScreenGameplay in") );
|
2003-03-09 00:55:49 +00:00
|
|
|
this->AddChild( &m_In );
|
|
|
|
|
|
2003-03-16 23:17:48 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textDebug.LoadFromFont( THEME->GetPathToF("Common normal") );
|
2003-04-13 21:17:14 +00:00
|
|
|
m_textDebug.SetName( "Debug" );
|
|
|
|
|
SET_XY( m_textDebug );
|
2003-03-16 23:17:48 +00:00
|
|
|
this->AddChild( &m_textDebug );
|
|
|
|
|
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_Back.Load( THEME->GetPathToB("Common back") );
|
2003-03-13 01:26:50 +00:00
|
|
|
this->AddChild( &m_Back );
|
|
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
|
2003-03-30 20:18:46 +00:00
|
|
|
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() ) // only load if we're going to use it
|
2003-03-09 00:55:49 +00:00
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textSurviveTime.LoadFromFont( THEME->GetPathToF("ScreenGameplay survive time") );
|
2003-03-09 00:55:49 +00:00
|
|
|
m_textSurviveTime.EnableShadow( false );
|
2003-04-13 21:17:14 +00:00
|
|
|
m_textSurviveTime.SetName( "SurviveTime" );
|
|
|
|
|
SET_XY( m_textSurviveTime );
|
2003-03-09 00:55:49 +00:00
|
|
|
m_textSurviveTime.SetDiffuse( RageColor(1,1,1,0) );
|
|
|
|
|
this->AddChild( &m_textSurviveTime );
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-02-04 21:36:30 +00:00
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-02-28 20:50:28 +00:00
|
|
|
/* LoadNextSong first, since that positions some elements which need to be
|
|
|
|
|
* positioned before we TweenOnScreen. */
|
|
|
|
|
LoadNextSong();
|
|
|
|
|
|
2002-08-28 22:42:40 +00:00
|
|
|
TweenOnScreen();
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-01-19 04:44:22 +00:00
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
if( !bDemonstration ) // only load if we're going to use it
|
2003-01-19 04:44:22 +00:00
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_soundOniDie.Load( THEME->GetPathToS("ScreenGameplay oni die") );
|
2003-03-16 07:38:40 +00:00
|
|
|
m_announcerReady.Load( ANNOUNCER->GetPathTo("gameplay ready"), 1 );
|
2003-01-19 04:44:22 +00:00
|
|
|
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
2003-03-16 07:38:40 +00:00
|
|
|
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go extra"), 1 );
|
2003-01-19 04:44:22 +00:00
|
|
|
else if( GAMESTATE->IsFinalStage() )
|
2003-03-16 07:38:40 +00:00
|
|
|
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go final"), 1 );
|
2003-01-19 04:44:22 +00:00
|
|
|
else
|
2003-03-16 07:38:40 +00:00
|
|
|
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go normal"), 1 );
|
2003-03-12 01:26:44 +00:00
|
|
|
m_announcerDanger.Load( ANNOUNCER->GetPathTo("gameplay comment danger") );
|
|
|
|
|
m_announcerGood.Load( ANNOUNCER->GetPathTo("gameplay comment good") );
|
|
|
|
|
m_announcerHot.Load( ANNOUNCER->GetPathTo("gameplay comment hot") );
|
|
|
|
|
m_announcerOni.Load( ANNOUNCER->GetPathTo("gameplay comment oni") );
|
|
|
|
|
|
|
|
|
|
m_announcer100Combo.Load( ANNOUNCER->GetPathTo("gameplay 100 combo") );
|
|
|
|
|
m_announcer200Combo.Load( ANNOUNCER->GetPathTo("gameplay 200 combo") );
|
|
|
|
|
m_announcer300Combo.Load( ANNOUNCER->GetPathTo("gameplay 300 combo") );
|
|
|
|
|
m_announcer400Combo.Load( ANNOUNCER->GetPathTo("gameplay 400 combo") );
|
|
|
|
|
m_announcer500Combo.Load( ANNOUNCER->GetPathTo("gameplay 500 combo") );
|
|
|
|
|
m_announcer600Combo.Load( ANNOUNCER->GetPathTo("gameplay 600 combo") );
|
|
|
|
|
m_announcer700Combo.Load( ANNOUNCER->GetPathTo("gameplay 700 combo") );
|
|
|
|
|
m_announcer800Combo.Load( ANNOUNCER->GetPathTo("gameplay 800 combo") );
|
|
|
|
|
m_announcer900Combo.Load( ANNOUNCER->GetPathTo("gameplay 900 combo") );
|
|
|
|
|
m_announcer1000Combo.Load( ANNOUNCER->GetPathTo("gameplay 1000 combo") );
|
|
|
|
|
m_announcerComboStopped.Load( ANNOUNCER->GetPathTo("gameplay combo stopped") );
|
2003-04-12 17:39:27 +00:00
|
|
|
m_soundAssistTick.Load( THEME->GetPathToS("ScreenGameplay assist tick") );
|
2003-05-13 13:35:32 +00:00
|
|
|
|
2003-07-08 19:56:56 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
2003-05-13 13:35:32 +00:00
|
|
|
{
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
2003-05-13 13:35:32 +00:00
|
|
|
m_announcerBattleTrickLevel1.Load( ANNOUNCER->GetPathTo("gameplay battle trick level1") );
|
|
|
|
|
m_announcerBattleTrickLevel2.Load( ANNOUNCER->GetPathTo("gameplay battle trick level2") );
|
|
|
|
|
m_announcerBattleTrickLevel3.Load( ANNOUNCER->GetPathTo("gameplay battle trick level3") );
|
|
|
|
|
m_soundBattleTrickLevel1.Load( THEME->GetPathToS("ScreenGameplay battle trick level1") );
|
|
|
|
|
m_soundBattleTrickLevel2.Load( THEME->GetPathToS("ScreenGameplay battle trick level2") );
|
|
|
|
|
m_soundBattleTrickLevel3.Load( THEME->GetPathToS("ScreenGameplay battle trick level3") );
|
|
|
|
|
m_announcerBattleDamageLevel1.Load( ANNOUNCER->GetPathTo("gameplay battle damage level1") );
|
|
|
|
|
m_announcerBattleDamageLevel2.Load( ANNOUNCER->GetPathTo("gameplay battle damage level2") );
|
|
|
|
|
m_announcerBattleDamageLevel3.Load( ANNOUNCER->GetPathTo("gameplay battle damage level3") );
|
2003-07-09 02:27:05 +00:00
|
|
|
// HACK: Load incorrect directory on purpose for now.
|
|
|
|
|
m_announcerBattleDie.Load( ANNOUNCER->GetPathTo("gameplay battle damage level3") );
|
2003-07-08 19:56:56 +00:00
|
|
|
break;
|
2003-05-13 13:35:32 +00:00
|
|
|
}
|
2003-03-09 00:55:49 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-12 01:26:44 +00:00
|
|
|
// Get the transitions rolling on the first update.
|
|
|
|
|
// We can't do this in the constructor because ScreenGameplay is constructed
|
|
|
|
|
// in the middle of ScreenStage.
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScreenGameplay::~ScreenGameplay()
|
|
|
|
|
{
|
2002-07-31 19:40:40 +00:00
|
|
|
LOG->Trace( "ScreenGameplay::~ScreenGameplay()" );
|
2002-07-23 01:41:40 +00:00
|
|
|
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2002-08-28 22:42:40 +00:00
|
|
|
SAFE_DELETE( m_pLifeMeter[p] );
|
|
|
|
|
SAFE_DELETE( m_pScoreDisplay[p] );
|
2003-06-30 18:08:27 +00:00
|
|
|
SAFE_DELETE( m_pPrimaryScoreKeeper[p] );
|
|
|
|
|
SAFE_DELETE( m_pSecondaryScoreKeeper[p] );
|
2003-07-08 19:56:56 +00:00
|
|
|
SAFE_DELETE( m_pInventory[p] );
|
2002-07-23 01:41:40 +00:00
|
|
|
}
|
2003-06-30 18:08:27 +00:00
|
|
|
SAFE_DELETE( m_pCombinedLifeMeter );
|
2003-05-13 13:35:32 +00:00
|
|
|
|
2002-12-29 22:57:38 +00:00
|
|
|
m_soundMusic.StopPlaying();
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2002-07-28 20:28:37 +00:00
|
|
|
bool ScreenGameplay::IsLastSong()
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2003-03-26 23:08:05 +00:00
|
|
|
if( GAMESTATE->m_pCurCourse && GAMESTATE->m_pCurCourse->m_bRepeat )
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return GAMESTATE->GetCourseSongIndex()+1 == (int)m_apSongsQueue.size(); // GetCourseSongIndex() is 0-based but size() is not
|
2002-07-28 20:28:37 +00:00
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-01-25 07:40:47 +00:00
|
|
|
void ScreenGameplay::LoadNextSong()
|
2002-07-28 20:28:37 +00:00
|
|
|
{
|
|
|
|
|
GAMESTATE->ResetMusicStatistics();
|
2003-02-24 02:45:01 +00:00
|
|
|
int p;
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2003-02-24 02:58:31 +00:00
|
|
|
if( GAMESTATE->IsPlayerEnabled(p) )
|
2003-04-13 21:17:14 +00:00
|
|
|
{
|
2003-02-24 02:58:31 +00:00
|
|
|
GAMESTATE->m_CurStageStats.iSongsPlayed[p]++;
|
2003-04-13 21:17:14 +00:00
|
|
|
m_textCourseSongNumber[p].SetText( ssprintf("%d", GAMESTATE->m_CurStageStats.iSongsPlayed[p]) );
|
|
|
|
|
}
|
2003-02-24 02:45:01 +00:00
|
|
|
|
2003-03-26 23:08:05 +00:00
|
|
|
int iPlaySongIndex = GAMESTATE->GetCourseSongIndex();
|
|
|
|
|
iPlaySongIndex %= m_apSongsQueue.size();
|
|
|
|
|
GAMESTATE->m_pCurSong = m_apSongsQueue[iPlaySongIndex];
|
2002-09-04 03:29:42 +00:00
|
|
|
|
2003-03-26 23:08:05 +00:00
|
|
|
// Restore the player's originally selected options.
|
|
|
|
|
GAMESTATE->RestoreSelectedOptions();
|
2002-06-14 22:25:22 +00:00
|
|
|
|
2003-02-17 19:52:16 +00:00
|
|
|
m_textSongOptions.SetText( GAMESTATE->m_SongOptions.GetString() );
|
2002-07-28 20:28:37 +00:00
|
|
|
|
2003-02-24 02:45:01 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2002-06-14 22:25:22 +00:00
|
|
|
{
|
2002-07-28 20:28:37 +00:00
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
2002-06-14 22:25:22 +00:00
|
|
|
continue;
|
|
|
|
|
|
2003-03-26 23:08:05 +00:00
|
|
|
GAMESTATE->m_pCurNotes[p] = m_apNotesQueue[p][iPlaySongIndex];
|
|
|
|
|
|
|
|
|
|
// Put courses options into effect.
|
2003-04-22 04:54:04 +00:00
|
|
|
GAMESTATE->ApplyModifiers( (PlayerNumber)p, m_asModifiersQueue[p][iPlaySongIndex] );
|
2003-03-26 23:08:05 +00:00
|
|
|
|
2003-01-10 02:22:07 +00:00
|
|
|
m_textPlayerOptions[p].SetText( GAMESTATE->m_PlayerOptions[p].GetString() );
|
|
|
|
|
|
2002-08-01 21:55:40 +00:00
|
|
|
// reset oni game over graphic
|
|
|
|
|
m_sprOniGameOver[p].SetY( SCREEN_TOP - m_sprOniGameOver[p].GetZoomedHeight()/2 );
|
2002-10-28 05:30:45 +00:00
|
|
|
m_sprOniGameOver[p].SetDiffuse( RageColor(1,1,1,0) ); // 0 alpha so we don't waste time drawing while not visible
|
2002-08-01 21:55:40 +00:00
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
if( GAMESTATE->m_SongOptions.m_LifeType==SongOptions::LIFE_BATTERY && GAMESTATE->m_CurStageStats.bFailed[p] ) // already failed
|
2002-08-01 21:55:40 +00:00
|
|
|
ShowOniGameOver((PlayerNumber)p);
|
|
|
|
|
|
2003-07-31 15:07:48 +00:00
|
|
|
if( GAMESTATE->m_SongOptions.m_LifeType==SongOptions::LIFE_BAR && GAMESTATE->m_PlayMode == PLAY_MODE_ARCADE && !PREFSMAN->m_bEventMode )
|
|
|
|
|
{
|
|
|
|
|
m_pLifeMeter[p]->UpdateNonstopLifebar(
|
|
|
|
|
GAMESTATE->GetStageIndex(),
|
|
|
|
|
PREFSMAN->m_iNumArcadeStages,
|
|
|
|
|
PREFSMAN->m_iProgressiveStageLifebar);
|
|
|
|
|
}
|
2003-07-30 17:01:04 +00:00
|
|
|
if( GAMESTATE->m_SongOptions.m_LifeType==SongOptions::LIFE_BAR && GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP )
|
|
|
|
|
{
|
2003-07-31 15:07:48 +00:00
|
|
|
LOG->Trace("Song %d of %d",
|
|
|
|
|
GAMESTATE->GetCourseSongIndex(),
|
|
|
|
|
GAMESTATE->m_pCurCourse->GetEstimatedNumStages() );
|
|
|
|
|
m_pLifeMeter[p]->UpdateNonstopLifebar(
|
|
|
|
|
GAMESTATE->GetCourseSongIndex(),
|
|
|
|
|
GAMESTATE->m_pCurCourse->GetEstimatedNumStages(),
|
|
|
|
|
PREFSMAN->m_iProgressiveNonstopLifebar);
|
2003-07-30 17:01:04 +00:00
|
|
|
}
|
2002-08-01 21:55:40 +00:00
|
|
|
|
2002-10-06 16:56:58 +00:00
|
|
|
m_DifficultyIcon[p].SetFromNotes( PlayerNumber(p), GAMESTATE->m_pCurNotes[p] );
|
2002-06-14 22:25:22 +00:00
|
|
|
|
|
|
|
|
|
2002-10-12 00:39:00 +00:00
|
|
|
NoteData pOriginalNoteData;
|
|
|
|
|
GAMESTATE->m_pCurNotes[p]->GetNoteData( &pOriginalNoteData );
|
2002-06-14 22:25:22 +00:00
|
|
|
|
2002-08-22 23:03:39 +00:00
|
|
|
const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
|
2002-10-12 00:39:00 +00:00
|
|
|
NoteData pNewNoteData;
|
|
|
|
|
pStyleDef->GetTransformedNoteDataForStyle( (PlayerNumber)p, &pOriginalNoteData, &pNewNoteData );
|
2003-07-08 19:56:56 +00:00
|
|
|
m_Player[p].Load( (PlayerNumber)p, &pNewNoteData, m_pLifeMeter[p], m_pCombinedLifeMeter, m_pScoreDisplay[p], m_pInventory[p], m_pPrimaryScoreKeeper[p], m_pSecondaryScoreKeeper[p] );
|
2003-07-21 19:07:10 +00:00
|
|
|
|
|
|
|
|
/* The actual note data for scoring is the base class of Player. This includes
|
|
|
|
|
* transforms, like Wide. Otherwise, the scoring will operate on the worng
|
|
|
|
|
* data. */
|
|
|
|
|
m_pPrimaryScoreKeeper[p]->OnNextSong( GAMESTATE->GetCourseSongIndex(), GAMESTATE->m_pCurNotes[p], &m_Player[p] );
|
|
|
|
|
if( m_pSecondaryScoreKeeper[p] )
|
|
|
|
|
m_pSecondaryScoreKeeper[p]->OnNextSong( GAMESTATE->GetCourseSongIndex(), GAMESTATE->m_pCurNotes[p], &m_Player[p] );
|
|
|
|
|
|
2003-04-07 21:24:14 +00:00
|
|
|
if( m_bDemonstration )
|
2003-04-21 02:41:10 +00:00
|
|
|
{
|
|
|
|
|
GAMESTATE->m_PlayerController[p] = PC_CPU;
|
|
|
|
|
GAMESTATE->m_iCpuSkill[p] = 5;
|
|
|
|
|
}
|
2003-04-07 21:24:14 +00:00
|
|
|
else if( GAMESTATE->IsCpuPlayer(p) )
|
|
|
|
|
{
|
2003-04-21 02:41:10 +00:00
|
|
|
GAMESTATE->m_PlayerController[p] = PC_CPU;
|
|
|
|
|
if( GAMESTATE->m_iCpuSkill[p] == -1 )
|
2003-04-07 21:24:14 +00:00
|
|
|
{
|
2003-04-21 02:41:10 +00:00
|
|
|
switch( GAMESTATE->m_pCurNotes[p]->GetDifficulty() )
|
|
|
|
|
{
|
|
|
|
|
case DIFFICULTY_BEGINNER: GAMESTATE->m_iCpuSkill[p] = 1; break;
|
|
|
|
|
case DIFFICULTY_EASY: GAMESTATE->m_iCpuSkill[p] = 3; break;
|
|
|
|
|
case DIFFICULTY_MEDIUM: GAMESTATE->m_iCpuSkill[p] = 5; break;
|
|
|
|
|
case DIFFICULTY_HARD: GAMESTATE->m_iCpuSkill[p] = 7; break;
|
|
|
|
|
case DIFFICULTY_CHALLENGE: GAMESTATE->m_iCpuSkill[p] = 9; break;
|
|
|
|
|
default: ASSERT(0);
|
|
|
|
|
}
|
2003-04-07 21:24:14 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if( PREFSMAN->m_bAutoPlay )
|
2003-04-21 02:41:10 +00:00
|
|
|
GAMESTATE->m_PlayerController[p] = PC_AUTOPLAY;
|
2003-04-07 21:24:14 +00:00
|
|
|
else
|
2003-04-21 02:41:10 +00:00
|
|
|
GAMESTATE->m_PlayerController[p] = PC_HUMAN;
|
2003-03-27 00:51:57 +00:00
|
|
|
|
|
|
|
|
m_TimingAssist.Reset();
|
2002-06-14 22:25:22 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-30 18:12:57 +00:00
|
|
|
m_textSongTitle.SetText( GAMESTATE->m_pCurSong->m_sMainTitle );
|
2003-02-04 21:36:30 +00:00
|
|
|
|
|
|
|
|
/* XXX: set it to the current BPM, not the range */
|
2003-05-23 01:25:01 +00:00
|
|
|
/* What does this comment mean? -Chris
|
|
|
|
|
*
|
|
|
|
|
* We're in gameplay. A BPM display should display the current BPM, updating
|
|
|
|
|
* it as it changes, instead of the "BPM preview" of ScreenSelectMusic. That'd
|
|
|
|
|
* be used in IIDX, anyway. (Havn't done this since I don't know what this is
|
|
|
|
|
* currently actually used for and don't feel like investigating it until it's
|
|
|
|
|
* needed.)
|
|
|
|
|
* -glenn
|
|
|
|
|
*/
|
2003-05-23 01:14:43 +00:00
|
|
|
m_BPMDisplay.SetBPM( GAMESTATE->m_pCurSong );
|
2003-02-04 21:36:30 +00:00
|
|
|
|
2003-02-28 20:50:28 +00:00
|
|
|
const bool bExtra = GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2();
|
|
|
|
|
const bool bReverse[NUM_PLAYERS] = {
|
|
|
|
|
GAMESTATE->m_PlayerOptions[0].m_fReverseScroll == 1,
|
|
|
|
|
GAMESTATE->m_PlayerOptions[1].m_fReverseScroll == 1
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled(PlayerNumber(p)) )
|
|
|
|
|
continue;
|
|
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_ActiveItemList[p].SetName( ssprintf("ActiveItemsP%d%s%s",p+1,bExtra?"Extra":"",bReverse[p]?"Reverse":"") );
|
|
|
|
|
SET_XY( m_ActiveItemList[p] );
|
|
|
|
|
|
|
|
|
|
m_DifficultyIcon[p].SetName( ssprintf("DifficultyP%d%s%s",p+1,bExtra?"Extra":"",bReverse[p]?"Reverse":"") );
|
|
|
|
|
SET_XY( m_DifficultyIcon[p] );
|
2003-02-28 20:50:28 +00:00
|
|
|
}
|
|
|
|
|
|
2003-06-04 20:40:32 +00:00
|
|
|
const bool bBothReverse = bReverse[PLAYER_1] && bReverse[PLAYER_2];
|
|
|
|
|
const bool bOneReverse = !bBothReverse && (bReverse[PLAYER_1] || bReverse[PLAYER_2]);
|
2003-04-13 00:44:50 +00:00
|
|
|
|
2003-03-19 22:48:43 +00:00
|
|
|
/* XXX: We want to put the lyrics out of the way, but it's likely that one
|
|
|
|
|
* player is in reverse and the other isn't. What to do? */
|
2003-06-04 20:40:32 +00:00
|
|
|
m_LyricDisplay.SetName( ssprintf( "Lyrics%s", bBothReverse? "Reverse": bOneReverse? "OneReverse": "") );
|
2003-04-13 21:17:14 +00:00
|
|
|
SET_XY( m_LyricDisplay );
|
2003-03-19 22:48:43 +00:00
|
|
|
|
2003-06-04 20:40:32 +00:00
|
|
|
/* Load the Oni transitions */
|
|
|
|
|
m_NextSongIn.Load( THEME->GetPathToB("ScreenGameplay next song in") );
|
|
|
|
|
// Instead, load this right before it's used
|
|
|
|
|
// m_NextSongOut.Load( THEME->GetPathToB("ScreenGameplay next song out") );
|
|
|
|
|
|
2003-03-19 19:58:22 +00:00
|
|
|
// Load lyrics
|
|
|
|
|
// XXX: don't load this here
|
2003-03-20 18:51:14 +00:00
|
|
|
LyricsLoader LL;
|
|
|
|
|
if( GAMESTATE->m_pCurSong->HasLyrics() )
|
|
|
|
|
LL.LoadFromLRCFile(GAMESTATE->m_pCurSong->GetLyricsPath(), *GAMESTATE->m_pCurSong);
|
2003-04-13 00:44:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
m_soundMusic.Load( GAMESTATE->m_pCurSong->GetMusicPath() );
|
|
|
|
|
|
|
|
|
|
/* Set up song-specific graphics. */
|
|
|
|
|
m_Background.LoadFromSong( GAMESTATE->m_pCurSong );
|
|
|
|
|
m_Background.SetDiffuse( RageColor(0.5f,0.5f,0.5f,1) );
|
|
|
|
|
m_Background.BeginTweening( 2 );
|
|
|
|
|
m_Background.SetDiffuse( RageColor(1,1,1,1) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* m_soundMusic and m_Background take a very long time to load,
|
|
|
|
|
* so cap fDelta at 0 so m_NextSongIn will show up on screen.
|
|
|
|
|
* -Chris */
|
|
|
|
|
m_bZeroDeltaOnNextUpdate = true;
|
2003-01-25 07:40:47 +00:00
|
|
|
}
|
|
|
|
|
|
2003-01-25 08:32:57 +00:00
|
|
|
float ScreenGameplay::StartPlayingSong(float MinTimeToNotes, float MinTimeToMusic)
|
2003-01-25 07:40:47 +00:00
|
|
|
{
|
2003-01-25 08:32:57 +00:00
|
|
|
ASSERT(MinTimeToNotes >= 0);
|
|
|
|
|
ASSERT(MinTimeToMusic >= 0);
|
|
|
|
|
|
2003-01-25 07:40:47 +00:00
|
|
|
/* XXX: We want the first beat *in use*, so we don't delay needlessly. */
|
2002-09-10 08:21:55 +00:00
|
|
|
const float fFirstBeat = GAMESTATE->m_pCurSong->m_fFirstBeat;
|
|
|
|
|
const float fFirstSecond = GAMESTATE->m_pCurSong->GetElapsedTimeFromBeat( fFirstBeat );
|
2003-01-25 08:32:57 +00:00
|
|
|
float fStartSecond = fFirstSecond - MinTimeToNotes;
|
2002-12-29 23:31:29 +00:00
|
|
|
|
2003-01-25 08:32:57 +00:00
|
|
|
fStartSecond = min(fStartSecond, -MinTimeToMusic);
|
|
|
|
|
|
2002-09-10 08:21:55 +00:00
|
|
|
m_soundMusic.SetPositionSeconds( fStartSecond );
|
2002-07-23 01:41:40 +00:00
|
|
|
m_soundMusic.SetPlaybackRate( GAMESTATE->m_SongOptions.m_fMusicRate );
|
2002-12-29 23:31:29 +00:00
|
|
|
|
|
|
|
|
/* Keep the music playing after it's finished; we'll stop it. */
|
|
|
|
|
m_soundMusic.SetStopMode(RageSound::M_CONTINUE);
|
|
|
|
|
m_soundMusic.StartPlaying();
|
2003-01-25 07:40:47 +00:00
|
|
|
|
|
|
|
|
/* Return the amount of time until the first beat. */
|
2003-01-25 08:10:35 +00:00
|
|
|
return fFirstSecond - fStartSecond;
|
2002-06-14 22:25:22 +00:00
|
|
|
}
|
|
|
|
|
|
2002-07-27 19:29:51 +00:00
|
|
|
bool ScreenGameplay::OneIsHot()
|
|
|
|
|
{
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
if( GAMESTATE->IsPlayerEnabled(PlayerNumber(p)) )
|
2003-06-30 18:08:27 +00:00
|
|
|
if( (m_pLifeMeter[p] && m_pLifeMeter[p]->IsHot()) ||
|
|
|
|
|
(m_pCombinedLifeMeter && m_pCombinedLifeMeter->IsHot((PlayerNumber)p)) )
|
2002-07-27 19:29:51 +00:00
|
|
|
return true;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ScreenGameplay::AllAreInDanger()
|
|
|
|
|
{
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
if( GAMESTATE->IsPlayerEnabled(PlayerNumber(p)) )
|
2003-06-30 18:08:27 +00:00
|
|
|
if( (m_pLifeMeter[p] && !m_pLifeMeter[p]->IsInDanger()) ||
|
|
|
|
|
(m_pCombinedLifeMeter && !m_pCombinedLifeMeter->IsInDanger((PlayerNumber)p)) )
|
2002-07-27 19:29:51 +00:00
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ScreenGameplay::AllAreFailing()
|
|
|
|
|
{
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
if( GAMESTATE->IsPlayerEnabled(PlayerNumber(p)) )
|
2003-06-30 18:08:27 +00:00
|
|
|
if( (m_pLifeMeter[p] && !m_pLifeMeter[p]->IsFailing()) ||
|
|
|
|
|
(m_pCombinedLifeMeter && !m_pCombinedLifeMeter->IsFailing((PlayerNumber)p)) )
|
2002-07-27 19:29:51 +00:00
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ScreenGameplay::AllFailedEarlier()
|
|
|
|
|
{
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
if( GAMESTATE->IsPlayerEnabled(p) )
|
2003-06-30 18:08:27 +00:00
|
|
|
if( (m_pLifeMeter[p] && !m_pLifeMeter[p]->FailedEarlier()) ||
|
|
|
|
|
(m_pCombinedLifeMeter && !m_pCombinedLifeMeter->FailedEarlier((PlayerNumber)p)) )
|
2002-07-27 19:29:51 +00:00
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-12 00:32:47 +00:00
|
|
|
// play assist ticks
|
2003-01-10 02:22:07 +00:00
|
|
|
bool ScreenGameplay::IsTimeToPlayTicks() const
|
2002-10-12 00:32:47 +00:00
|
|
|
{
|
|
|
|
|
// Sound cards have a latency between when a sample is Play()ed and when the sound
|
|
|
|
|
// will start coming out the speaker. Compensate for this by boosting
|
|
|
|
|
// fPositionSeconds ahead
|
|
|
|
|
float fPositionSeconds = GAMESTATE->m_fMusicSeconds;
|
2003-07-26 23:05:16 +00:00
|
|
|
fPositionSeconds += (SOUND->GetPlayLatency()+(float)G_TICK_EARLY_SECONDS) * m_soundMusic.GetPlaybackRate();
|
2003-02-22 00:22:27 +00:00
|
|
|
float fSongBeat = GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds );
|
2002-10-12 00:32:47 +00:00
|
|
|
|
|
|
|
|
int iRowNow = BeatToNoteRowNotRounded( fSongBeat );
|
|
|
|
|
iRowNow = max( 0, iRowNow );
|
|
|
|
|
static int iRowLastCrossed = 0;
|
|
|
|
|
|
|
|
|
|
bool bAnyoneHasANote = false; // set this to true if any player has a note at one of the indicies we crossed
|
|
|
|
|
|
|
|
|
|
for( int r=iRowLastCrossed+1; r<=iRowNow; r++ ) // for each index we crossed since the last update
|
|
|
|
|
{
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
2003-03-16 18:57:34 +00:00
|
|
|
bAnyoneHasANote |= m_Player[p].IsThereATapAtRow( r );
|
2002-10-12 00:32:47 +00:00
|
|
|
break; // this will only play the tick for the first player that is joined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
iRowLastCrossed = iRowNow;
|
|
|
|
|
|
|
|
|
|
return bAnyoneHasANote;
|
|
|
|
|
}
|
2002-06-14 22:25:22 +00:00
|
|
|
|
2002-10-29 01:26:10 +00:00
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
void ScreenGameplay::Update( float fDeltaTime )
|
|
|
|
|
{
|
2003-03-24 21:26:12 +00:00
|
|
|
if( GAMESTATE->m_pCurSong == NULL )
|
|
|
|
|
{
|
|
|
|
|
/* ScreenDemonstration will move us to the next screen. We just need to
|
|
|
|
|
* survive for one update without crashing. We need to call Screen::Update
|
|
|
|
|
* to make sure we receive the next-screen message. */
|
|
|
|
|
Screen::Update( fDeltaTime );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-12 01:26:44 +00:00
|
|
|
if( m_bFirstUpdate )
|
|
|
|
|
{
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay intro") ); // crowd cheer
|
2003-03-16 07:30:50 +00:00
|
|
|
|
2003-03-12 01:26:44 +00:00
|
|
|
//
|
|
|
|
|
// Get the transitions rolling
|
|
|
|
|
//
|
|
|
|
|
if( m_bDemonstration )
|
|
|
|
|
{
|
|
|
|
|
StartPlayingSong( 0, 0 ); // *kick* (no transitions)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
float fMinTimeToMusic = m_In.GetLengthSeconds(); // start of m_Ready
|
|
|
|
|
float fMinTimeToNotes = fMinTimeToMusic + m_Ready.GetLengthSeconds() + m_Go.GetLengthSeconds()+2; // end of Go
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Tell the music to start, but don't actually make any noise for
|
|
|
|
|
* at least 2.5 (or 1.5) seconds. (This is so we scroll on screen smoothly.)
|
|
|
|
|
*
|
|
|
|
|
* This is only a minimum: the music might be started later, to meet
|
|
|
|
|
* the minimum-time-to-notes value. If you're writing song data,
|
|
|
|
|
* and you want to make sure we get ideal timing here, make sure there's
|
|
|
|
|
* a bit of space at the beginning of the music with no steps.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*float delay =*/ StartPlayingSong( fMinTimeToNotes, fMinTimeToMusic );
|
|
|
|
|
|
|
|
|
|
m_In.StartTransitioning( SM_PlayReady );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-02-10 22:08:10 +00:00
|
|
|
/* Very important: Update GAMESTATE's song beat information
|
|
|
|
|
* -before- calling update on all the classes that depend on it.
|
|
|
|
|
* If you don't do this first, the classes are all acting on old
|
|
|
|
|
* information and will lag. -Chris */
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-02-09 06:08:03 +00:00
|
|
|
/* If ScreenJukebox is changing screens, it'll stop m_soundMusic to tell
|
|
|
|
|
* us not to update the time here. (In that case, we've already created
|
|
|
|
|
* a new ScreenJukebox and reset music statistics, and if we do this then
|
|
|
|
|
* we'll un-reset them.) */
|
|
|
|
|
if(m_soundMusic.IsPlaying())
|
|
|
|
|
GAMESTATE->UpdateSongPosition(m_soundMusic.GetPositionSeconds());
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-04-13 00:44:50 +00:00
|
|
|
if( m_bZeroDeltaOnNextUpdate )
|
|
|
|
|
{
|
|
|
|
|
Screen::Update( 0 );
|
|
|
|
|
m_bZeroDeltaOnNextUpdate = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
Screen::Update( fDeltaTime );
|
2003-02-10 22:08:10 +00:00
|
|
|
|
2003-03-24 21:29:06 +00:00
|
|
|
if( GAMESTATE->m_pCurSong == NULL )
|
|
|
|
|
return;
|
2003-02-10 22:08:10 +00:00
|
|
|
|
2003-02-11 02:20:38 +00:00
|
|
|
if( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID )
|
2003-03-16 20:55:45 +00:00
|
|
|
m_MaxCombo.SetText( ssprintf("%d", GAMESTATE->m_CurStageStats.iCurCombo[GAMESTATE->m_MasterPlayerNumber]) ); /* MAKE THIS WORK FOR BOTH PLAYERS! */
|
2003-02-10 22:08:10 +00:00
|
|
|
|
2002-07-31 19:40:40 +00:00
|
|
|
//LOG->Trace( "m_fOffsetInBeats = %f, m_fBeatsPerSecond = %f, m_Music.GetPositionSeconds = %f", m_fOffsetInBeats, m_fBeatsPerSecond, m_Music.GetPositionSeconds() );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-02-06 17:47:00 +00:00
|
|
|
int pn;
|
2002-05-20 08:59:37 +00:00
|
|
|
switch( m_DancingState )
|
|
|
|
|
{
|
|
|
|
|
case STATE_DANCING:
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-03-30 20:54:37 +00:00
|
|
|
// Update living players' alive time
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-02-06 17:47:00 +00:00
|
|
|
for( pn=0; pn<NUM_PLAYERS; pn++ )
|
2003-03-30 20:54:37 +00:00
|
|
|
if( GAMESTATE->IsPlayerEnabled(pn) && !GAMESTATE->m_CurStageStats.bFailed[pn])
|
|
|
|
|
GAMESTATE->m_CurStageStats.fAliveSeconds [pn] += fDeltaTime;
|
2003-01-24 02:43:07 +00:00
|
|
|
|
2002-07-27 19:29:51 +00:00
|
|
|
//
|
2002-05-20 08:59:37 +00:00
|
|
|
// Check for end of song
|
2002-07-27 19:29:51 +00:00
|
|
|
//
|
2002-10-08 00:04:22 +00:00
|
|
|
float fSecondsToStop = GAMESTATE->m_pCurSong->GetElapsedTimeFromBeat( GAMESTATE->m_pCurSong->m_fLastBeat ) + 1;
|
2003-04-13 00:44:50 +00:00
|
|
|
if( GAMESTATE->m_fMusicSeconds > fSecondsToStop && !m_NextSongOut.IsTransitioning() )
|
2002-08-01 03:15:27 +00:00
|
|
|
{
|
|
|
|
|
GAMESTATE->m_fSongBeat = 0;
|
2003-03-25 21:17:29 +00:00
|
|
|
this->PostScreenMessage( SM_NotesEnded, 0 );
|
2002-08-01 03:15:27 +00:00
|
|
|
}
|
|
|
|
|
|
2002-07-27 19:29:51 +00:00
|
|
|
//
|
|
|
|
|
// check for fail
|
|
|
|
|
//
|
2003-02-12 23:11:37 +00:00
|
|
|
switch( GAMESTATE->m_SongOptions.m_FailType )
|
2002-07-27 19:29:51 +00:00
|
|
|
{
|
2003-02-12 23:11:37 +00:00
|
|
|
case SongOptions::FAIL_ARCADE:
|
2002-08-01 21:55:40 +00:00
|
|
|
switch( GAMESTATE->m_SongOptions.m_LifeType )
|
|
|
|
|
{
|
|
|
|
|
case SongOptions::LIFE_BAR:
|
2003-03-25 21:17:29 +00:00
|
|
|
if( AllAreFailing() ) SCREENMAN->PostMessageToTopScreen( SM_BeginFailed, 0 );
|
2002-08-01 21:55:40 +00:00
|
|
|
if( AllAreInDanger() ) m_Background.TurnDangerOn();
|
|
|
|
|
else m_Background.TurnDangerOff();
|
2002-11-01 03:13:30 +00:00
|
|
|
|
|
|
|
|
// check for individual fail
|
|
|
|
|
for ( pn=0; pn<NUM_PLAYERS; pn++ )
|
|
|
|
|
{
|
2003-06-30 18:08:27 +00:00
|
|
|
if( (m_pLifeMeter[pn] && m_pLifeMeter[pn]->IsFailing() && !GAMESTATE->m_CurStageStats.bFailed[pn]) ||
|
|
|
|
|
(m_pCombinedLifeMeter && m_pCombinedLifeMeter->IsFailing((PlayerNumber)pn) && !GAMESTATE->m_CurStageStats.bFailed[pn]) )
|
2003-07-24 09:25:25 +00:00
|
|
|
{
|
|
|
|
|
LOG->Trace("Player %d failed", (int)pn);
|
2003-01-24 02:43:07 +00:00
|
|
|
GAMESTATE->m_CurStageStats.bFailed[pn] = true; // fail
|
2003-07-24 09:25:25 +00:00
|
|
|
}
|
2002-11-01 03:13:30 +00:00
|
|
|
}
|
|
|
|
|
|
2002-08-01 21:55:40 +00:00
|
|
|
break;
|
|
|
|
|
case SongOptions::LIFE_BATTERY:
|
2003-03-25 21:17:29 +00:00
|
|
|
if( AllFailedEarlier() )SCREENMAN->PostMessageToTopScreen( SM_BeginFailed, 0 );
|
2002-08-01 21:55:40 +00:00
|
|
|
if( AllAreInDanger() ) m_Background.TurnDangerOn();
|
|
|
|
|
else m_Background.TurnDangerOff();
|
2002-07-27 19:29:51 +00:00
|
|
|
|
2002-08-01 21:55:40 +00:00
|
|
|
// check for individual fail
|
2003-01-24 02:43:07 +00:00
|
|
|
for( pn=0; pn<NUM_PLAYERS; pn++ )
|
|
|
|
|
{
|
2002-11-02 21:51:18 +00:00
|
|
|
if( !GAMESTATE->IsPlayerEnabled(pn) )
|
|
|
|
|
continue;
|
2003-06-30 18:08:27 +00:00
|
|
|
if( (m_pLifeMeter[pn] && !m_pLifeMeter[pn]->IsFailing()) ||
|
|
|
|
|
(m_pCombinedLifeMeter && !m_pCombinedLifeMeter->IsFailing((PlayerNumber)pn)) )
|
2003-01-24 02:43:07 +00:00
|
|
|
continue; /* isn't failing */
|
|
|
|
|
if( GAMESTATE->m_CurStageStats.bFailed[pn] )
|
2002-11-02 21:51:18 +00:00
|
|
|
continue; /* failed and is already dead */
|
|
|
|
|
|
|
|
|
|
if( !AllFailedEarlier() ) // if not the last one to fail
|
|
|
|
|
{
|
|
|
|
|
// kill them!
|
|
|
|
|
m_soundOniDie.PlayRandom();
|
|
|
|
|
ShowOniGameOver((PlayerNumber)pn);
|
|
|
|
|
m_Player[pn].Init(); // remove all notes and scoring
|
|
|
|
|
m_Player[pn].FadeToFail(); // tell the NoteField to fade to white
|
|
|
|
|
}
|
2003-02-17 00:30:55 +00:00
|
|
|
GAMESTATE->m_CurStageStats.bFailed[pn] = true;
|
2002-11-02 21:51:18 +00:00
|
|
|
}
|
2002-08-01 21:55:40 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2002-07-27 19:29:51 +00:00
|
|
|
break;
|
2003-02-12 23:11:37 +00:00
|
|
|
case SongOptions::FAIL_END_OF_SONG:
|
|
|
|
|
case SongOptions::FAIL_OFF:
|
2003-07-24 09:25:25 +00:00
|
|
|
// we still need to check for fail for scoring purposes
|
|
|
|
|
for ( pn=0; pn<NUM_PLAYERS; pn++ )
|
|
|
|
|
{
|
|
|
|
|
if( (m_pLifeMeter[pn] && m_pLifeMeter[pn]->IsFailing() && !GAMESTATE->m_CurStageStats.bFailed[pn]) ||
|
|
|
|
|
(m_pCombinedLifeMeter && m_pCombinedLifeMeter->IsFailing((PlayerNumber)pn) && !GAMESTATE->m_CurStageStats.bFailed[pn]) )
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace("Player %d failed", (int)pn);
|
|
|
|
|
GAMESTATE->m_CurStageStats.bFailed[pn] = true; // fail
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2002-07-27 19:29:51 +00:00
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
|
2003-07-08 19:56:56 +00:00
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Check for enemy death in enemy battle
|
|
|
|
|
//
|
|
|
|
|
static float fLastSeenEnemyHealth = 1;
|
|
|
|
|
if( fLastSeenEnemyHealth != GAMESTATE->m_fOpponentHealthPercent )
|
|
|
|
|
{
|
|
|
|
|
fLastSeenEnemyHealth = GAMESTATE->m_fOpponentHealthPercent;
|
|
|
|
|
|
|
|
|
|
if( GAMESTATE->m_fOpponentHealthPercent == 0 )
|
|
|
|
|
{
|
2003-07-09 02:27:05 +00:00
|
|
|
|
|
|
|
|
// HACK: Shut the announcer up
|
|
|
|
|
m_announcerReady.UnloadAll();
|
|
|
|
|
m_announcerHereWeGo.UnloadAll();
|
|
|
|
|
m_announcerDanger.UnloadAll();
|
|
|
|
|
m_announcerGood.UnloadAll();
|
|
|
|
|
m_announcerHot.UnloadAll();
|
|
|
|
|
m_announcerOni.UnloadAll();
|
|
|
|
|
m_announcer100Combo.UnloadAll();
|
|
|
|
|
m_announcer200Combo.UnloadAll();
|
|
|
|
|
m_announcer300Combo.UnloadAll();
|
|
|
|
|
m_announcer400Combo.UnloadAll();
|
|
|
|
|
m_announcer500Combo.UnloadAll();
|
|
|
|
|
m_announcer600Combo.UnloadAll();
|
|
|
|
|
m_announcer700Combo.UnloadAll();
|
|
|
|
|
m_announcer800Combo.UnloadAll();
|
|
|
|
|
m_announcer900Combo.UnloadAll();
|
|
|
|
|
m_announcer1000Combo.UnloadAll();
|
|
|
|
|
m_announcerComboStopped.UnloadAll();
|
|
|
|
|
m_announcerBattleTrickLevel1.UnloadAll();
|
|
|
|
|
m_announcerBattleTrickLevel2.UnloadAll();
|
|
|
|
|
m_announcerBattleTrickLevel3.UnloadAll();
|
|
|
|
|
m_announcerBattleDamageLevel1.UnloadAll();
|
|
|
|
|
m_announcerBattleDamageLevel2.UnloadAll();
|
|
|
|
|
m_announcerBattleDamageLevel3.UnloadAll();
|
|
|
|
|
|
|
|
|
|
m_announcerBattleDie.PlayRandom();
|
|
|
|
|
|
2003-07-08 19:56:56 +00:00
|
|
|
GAMESTATE->RemoveAllActiveAttacks();
|
|
|
|
|
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( GAMESTATE->IsCpuPlayer(p) )
|
|
|
|
|
{
|
|
|
|
|
m_soundOniDie.PlayRandom();
|
|
|
|
|
ShowOniGameOver((PlayerNumber)p);
|
|
|
|
|
m_Player[p].Init(); // remove all notes and scoring
|
|
|
|
|
m_Player[p].FadeToFail(); // tell the NoteField to fade to white
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
GAMESTATE->m_CurStageStats.bFailed[pn] = true;
|
|
|
|
|
|
|
|
|
|
|
2002-07-27 19:29:51 +00:00
|
|
|
//
|
2003-03-09 00:55:49 +00:00
|
|
|
// Check to see if it's time to play a ScreenGameplay comment
|
2002-07-27 19:29:51 +00:00
|
|
|
//
|
2003-01-10 02:22:07 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment -= fDeltaTime;
|
|
|
|
|
if( m_fTimeLeftBeforeDancingComment <= 0 )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2003-01-10 02:22:07 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
2002-08-02 09:31:06 +00:00
|
|
|
{
|
2003-01-10 02:22:07 +00:00
|
|
|
case PLAY_MODE_ARCADE:
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_HUMAN_BATTLE:
|
|
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
2003-04-07 05:14:27 +00:00
|
|
|
case PLAY_MODE_RAVE:
|
2003-01-10 02:22:07 +00:00
|
|
|
if( OneIsHot() ) m_announcerHot.PlayRandom();
|
|
|
|
|
else if( AllAreInDanger() ) m_announcerDanger.PlayRandom();
|
|
|
|
|
else m_announcerGood.PlayRandom();
|
2003-07-10 11:47:45 +00:00
|
|
|
if( m_pCombinedLifeMeter )
|
|
|
|
|
m_pCombinedLifeMeter->OnTaunt();
|
2003-01-10 02:22:07 +00:00
|
|
|
break;
|
2003-01-21 05:14:59 +00:00
|
|
|
case PLAY_MODE_NONSTOP:
|
2003-01-10 02:22:07 +00:00
|
|
|
case PLAY_MODE_ONI:
|
|
|
|
|
case PLAY_MODE_ENDLESS:
|
|
|
|
|
m_announcerOni.PlayRandom();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
2002-08-02 09:31:06 +00:00
|
|
|
}
|
2002-08-20 21:00:56 +00:00
|
|
|
|
2003-01-10 02:22:07 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS; // reset for the next comment
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-27 06:02:03 +00:00
|
|
|
if( GAMESTATE->m_SongOptions.m_bAssistTick && IsTimeToPlayTicks())
|
|
|
|
|
m_soundAssistTick.Play();
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenGameplay::DrawPrimitives()
|
|
|
|
|
{
|
|
|
|
|
Screen::DrawPrimitives();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
|
|
|
|
{
|
2002-07-31 19:40:40 +00:00
|
|
|
//LOG->Trace( "ScreenGameplay::Input()" );
|
2003-01-19 21:57:13 +00:00
|
|
|
|
|
|
|
|
if( MenuI.IsValid() &&
|
|
|
|
|
MenuI.button == MENU_BUTTON_BACK &&
|
|
|
|
|
m_DancingState != STATE_OUTRO &&
|
2003-03-09 00:55:49 +00:00
|
|
|
!m_Back.IsTransitioning() )
|
2003-01-19 21:57:13 +00:00
|
|
|
{
|
|
|
|
|
if( PREFSMAN->m_bDelayedEscape && type==IET_FIRST_PRESS)
|
|
|
|
|
{
|
|
|
|
|
m_textDebug.SetText( "Continue holding BACK to quit" );
|
|
|
|
|
m_textDebug.StopTweening();
|
|
|
|
|
m_textDebug.SetDiffuse( RageColor(1,1,1,0) );
|
|
|
|
|
m_textDebug.BeginTweening( 1/8.f );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_textDebug.SetDiffuse( RageColor(1,1,1,1) );
|
2003-01-19 21:57:13 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( PREFSMAN->m_bDelayedEscape && type==IET_RELEASE )
|
|
|
|
|
{
|
|
|
|
|
m_textDebug.StopTweening();
|
|
|
|
|
m_textDebug.BeginTweening( 1/8.f );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_textDebug.SetDiffuse( RageColor(1,1,1,0) );
|
2003-01-19 21:57:13 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( (!PREFSMAN->m_bDelayedEscape && type==IET_FIRST_PRESS) ||
|
|
|
|
|
(DeviceI.device==DEVICE_KEYBOARD && type==IET_SLOW_REPEAT) ||
|
|
|
|
|
(DeviceI.device!=DEVICE_KEYBOARD && type==IET_FAST_REPEAT) )
|
|
|
|
|
{
|
|
|
|
|
m_DancingState = STATE_OUTRO;
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayOnce( THEME->GetPathToS("Common back") );
|
2003-01-19 21:57:13 +00:00
|
|
|
/* Hmm. There are a bunch of subtly different ways we can
|
|
|
|
|
* tween out:
|
|
|
|
|
* 1. Keep rendering the song, and keep it moving. This might
|
|
|
|
|
* cause problems if the cancel and the end of the song overlap.
|
|
|
|
|
* 2. Stop the song completely, so all song motion under the tween
|
|
|
|
|
* ceases.
|
|
|
|
|
* 3. Stop the song, but keep effects (eg. Drunk) running.
|
|
|
|
|
* 4. Don't display the song at all.
|
|
|
|
|
*
|
|
|
|
|
* We're doing #3. I'm not sure which is best.
|
|
|
|
|
*/
|
|
|
|
|
m_soundMusic.StopPlaying();
|
|
|
|
|
|
|
|
|
|
this->ClearMessageQueue();
|
2003-03-09 00:55:49 +00:00
|
|
|
m_Back.StartTransitioning( SM_SaveChangedBeforeGoingBack );
|
2003-01-19 21:57:13 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Nothing else cares about releases. */
|
|
|
|
|
if(type == IET_RELEASE) return;
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-06-24 22:04:31 +00:00
|
|
|
// Handle special keys to adjust the offset
|
2002-07-03 21:27:26 +00:00
|
|
|
if( DeviceI.device == DEVICE_KEYBOARD )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
|
|
|
|
switch( DeviceI.button )
|
|
|
|
|
{
|
2002-11-29 20:37:12 +00:00
|
|
|
case SDLK_F6:
|
2002-10-01 01:55:39 +00:00
|
|
|
m_bChangedOffsetOrBPM = true;
|
2003-01-11 08:55:21 +00:00
|
|
|
GAMESTATE->m_SongOptions.m_bAutoSync = !GAMESTATE->m_SongOptions.m_bAutoSync; // toggle
|
2003-03-12 01:26:44 +00:00
|
|
|
UpdateAutoPlayText();
|
2002-10-01 01:55:39 +00:00
|
|
|
break;
|
2002-11-29 20:37:12 +00:00
|
|
|
case SDLK_F7:
|
2003-03-27 02:10:20 +00:00
|
|
|
GAMESTATE->m_SongOptions.m_bAssistTick ^= 1;
|
2003-06-14 22:58:21 +00:00
|
|
|
|
|
|
|
|
/* Store this change, so it sticks if we change songs: */
|
|
|
|
|
GAMESTATE->m_StoredSongOptions.m_bAssistTick = GAMESTATE->m_SongOptions.m_bAssistTick;
|
2003-01-11 08:55:21 +00:00
|
|
|
|
2003-03-27 02:10:20 +00:00
|
|
|
m_textDebug.SetText( ssprintf("Assist Tick is %s", GAMESTATE->m_SongOptions.m_bAssistTick?"ON":"OFF") );
|
2002-10-28 05:30:45 +00:00
|
|
|
m_textDebug.SetDiffuse( RageColor(1,1,1,1) );
|
2002-08-25 05:07:47 +00:00
|
|
|
m_textDebug.StopTweening();
|
2002-09-02 21:59:58 +00:00
|
|
|
m_textDebug.BeginTweening( 3 ); // sleep
|
|
|
|
|
m_textDebug.BeginTweening( 0.5f ); // fade out
|
2003-04-12 06:16:12 +00:00
|
|
|
m_textDebug.SetDiffuse( RageColor(1,1,1,0) );
|
2002-08-25 05:07:47 +00:00
|
|
|
break;
|
2002-11-29 20:37:12 +00:00
|
|
|
case SDLK_F8:
|
2003-04-07 21:24:14 +00:00
|
|
|
{
|
|
|
|
|
PREFSMAN->m_bAutoPlay = !PREFSMAN->m_bAutoPlay;
|
|
|
|
|
UpdateAutoPlayText();
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
if( GAMESTATE->IsHumanPlayer(p) )
|
2003-04-21 02:41:10 +00:00
|
|
|
GAMESTATE->m_PlayerController[p] = PREFSMAN->m_bAutoPlay?PC_AUTOPLAY:PC_HUMAN;
|
2003-04-07 21:24:14 +00:00
|
|
|
}
|
2002-07-27 19:29:51 +00:00
|
|
|
break;
|
2002-11-29 20:37:12 +00:00
|
|
|
case SDLK_F9:
|
|
|
|
|
case SDLK_F10:
|
2002-07-27 19:29:51 +00:00
|
|
|
{
|
|
|
|
|
m_bChangedOffsetOrBPM = true;
|
|
|
|
|
|
|
|
|
|
float fOffsetDelta;
|
|
|
|
|
switch( DeviceI.button )
|
|
|
|
|
{
|
2003-06-17 06:24:13 +00:00
|
|
|
case SDLK_F9: fOffsetDelta = -0.020f; break;
|
|
|
|
|
case SDLK_F10: fOffsetDelta = +0.020f; break;
|
2002-09-07 10:43:16 +00:00
|
|
|
default: ASSERT(0); return;
|
2002-07-27 19:29:51 +00:00
|
|
|
}
|
2003-06-17 06:24:13 +00:00
|
|
|
if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, SDLK_RALT)) ||
|
|
|
|
|
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, SDLK_LALT)) )
|
|
|
|
|
fOffsetDelta /= 2; /* .010 */
|
|
|
|
|
else if( type == IET_FAST_REPEAT )
|
2002-07-31 19:40:40 +00:00
|
|
|
fOffsetDelta *= 10;
|
2002-08-02 09:31:06 +00:00
|
|
|
BPMSegment& seg = GAMESTATE->m_pCurSong->GetBPMSegmentAtBeat( GAMESTATE->m_fSongBeat );
|
2002-07-27 19:29:51 +00:00
|
|
|
|
|
|
|
|
seg.m_fBPM += fOffsetDelta;
|
|
|
|
|
|
2003-06-17 06:24:13 +00:00
|
|
|
m_textDebug.SetText( ssprintf("Cur BPM = %.2f", seg.m_fBPM) );
|
2002-10-28 05:30:45 +00:00
|
|
|
m_textDebug.SetDiffuse( RageColor(1,1,1,1) );
|
2002-07-27 19:29:51 +00:00
|
|
|
m_textDebug.StopTweening();
|
2002-09-02 21:59:58 +00:00
|
|
|
m_textDebug.BeginTweening( 3 ); // sleep
|
|
|
|
|
m_textDebug.BeginTweening( 0.5f ); // fade out
|
2003-04-12 06:16:12 +00:00
|
|
|
m_textDebug.SetDiffuse( RageColor(1,1,1,0) );
|
2002-07-27 19:29:51 +00:00
|
|
|
}
|
|
|
|
|
break;
|
2002-11-29 20:37:12 +00:00
|
|
|
case SDLK_F11:
|
|
|
|
|
case SDLK_F12:
|
2002-07-03 21:27:26 +00:00
|
|
|
{
|
2002-07-27 19:29:51 +00:00
|
|
|
m_bChangedOffsetOrBPM = true;
|
|
|
|
|
|
2002-07-03 21:27:26 +00:00
|
|
|
float fOffsetDelta;
|
|
|
|
|
switch( DeviceI.button )
|
|
|
|
|
{
|
2002-11-29 20:37:12 +00:00
|
|
|
case SDLK_F11: fOffsetDelta = -0.02f; break;
|
|
|
|
|
case SDLK_F12: fOffsetDelta = +0.02f; break;
|
2002-09-07 10:43:16 +00:00
|
|
|
default: ASSERT(0); return;
|
2002-07-03 21:27:26 +00:00
|
|
|
}
|
2003-06-10 22:14:09 +00:00
|
|
|
if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, SDLK_RALT)) ||
|
|
|
|
|
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, SDLK_LALT)) )
|
|
|
|
|
fOffsetDelta /= 20; /* 1ms */
|
|
|
|
|
else switch( type )
|
|
|
|
|
{
|
|
|
|
|
case IET_SLOW_REPEAT: fOffsetDelta *= 10; break;
|
|
|
|
|
case IET_FAST_REPEAT: fOffsetDelta *= 40; break;
|
|
|
|
|
}
|
2002-07-03 21:27:26 +00:00
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
GAMESTATE->m_pCurSong->m_fBeat0OffsetInSeconds += fOffsetDelta;
|
2002-07-03 21:27:26 +00:00
|
|
|
|
2003-06-10 22:14:09 +00:00
|
|
|
m_textDebug.SetText( ssprintf("Offset = %.3f", GAMESTATE->m_pCurSong->m_fBeat0OffsetInSeconds) );
|
2002-10-28 05:30:45 +00:00
|
|
|
m_textDebug.SetDiffuse( RageColor(1,1,1,1) );
|
2002-07-03 21:27:26 +00:00
|
|
|
m_textDebug.StopTweening();
|
2002-09-02 21:59:58 +00:00
|
|
|
m_textDebug.BeginTweening( 3 ); // sleep
|
|
|
|
|
m_textDebug.BeginTweening( 0.5f ); // fade out
|
2003-04-12 06:16:12 +00:00
|
|
|
m_textDebug.SetDiffuse( RageColor(1,1,1,0) );
|
2002-07-03 21:27:26 +00:00
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
break;
|
2003-07-10 03:39:30 +00:00
|
|
|
// testing:
|
|
|
|
|
case SDLK_PAUSE:
|
|
|
|
|
{
|
|
|
|
|
if( GAMESTATE->m_PlayerOptions[PLAYER_1].m_fPerspectiveTilt == -1 ) // incoming
|
|
|
|
|
{
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
GAMESTATE->m_PlayerOptions[PLAYER_1].m_fPerspectiveTilt = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
GAMESTATE->m_PlayerOptions[PLAYER_1].m_fPerspectiveTilt = -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-07-27 19:29:51 +00:00
|
|
|
//
|
2003-02-25 00:33:42 +00:00
|
|
|
// handle a step or battle item activate
|
2002-07-27 19:29:51 +00:00
|
|
|
//
|
2003-01-25 11:05:12 +00:00
|
|
|
if( type==IET_FIRST_PRESS &&
|
|
|
|
|
!PREFSMAN->m_bAutoPlay &&
|
|
|
|
|
StyleI.IsValid() &&
|
|
|
|
|
GAMESTATE->IsPlayerEnabled( StyleI.player ) )
|
2003-02-27 10:56:37 +00:00
|
|
|
{
|
2003-07-13 00:34:30 +00:00
|
|
|
m_Player[StyleI.player].Step( StyleI.col, DeviceI.ts );
|
2003-02-27 10:56:37 +00:00
|
|
|
}
|
2003-02-25 00:33:42 +00:00
|
|
|
else if( type==IET_FIRST_PRESS &&
|
|
|
|
|
!PREFSMAN->m_bAutoPlay &&
|
|
|
|
|
MenuI.IsValid() &&
|
2003-07-09 20:34:14 +00:00
|
|
|
GAMESTATE->IsPlayerEnabled( MenuI.player ) &&
|
|
|
|
|
GAMESTATE->IsBattleMode() )
|
2003-02-25 00:33:42 +00:00
|
|
|
{
|
|
|
|
|
int iItemSlot;
|
|
|
|
|
switch( MenuI.button )
|
|
|
|
|
{
|
|
|
|
|
case MENU_BUTTON_LEFT: iItemSlot = 0; break;
|
|
|
|
|
case MENU_BUTTON_START: iItemSlot = 1; break;
|
|
|
|
|
case MENU_BUTTON_RIGHT: iItemSlot = 2; break;
|
|
|
|
|
default: iItemSlot = -1; break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( iItemSlot != -1 )
|
2003-07-08 19:56:56 +00:00
|
|
|
m_pInventory[MenuI.player]->UseItem( iItemSlot );
|
2003-02-25 00:33:42 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-12 01:26:44 +00:00
|
|
|
void ScreenGameplay::UpdateAutoPlayText()
|
2003-01-11 08:55:21 +00:00
|
|
|
{
|
2003-03-09 00:55:49 +00:00
|
|
|
CString sText;
|
2003-01-11 08:55:21 +00:00
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
if( PREFSMAN->m_bAutoPlay )
|
|
|
|
|
sText += "AutoPlay ";
|
|
|
|
|
if( GAMESTATE->m_SongOptions.m_bAutoSync )
|
|
|
|
|
sText += "AutoSync ";
|
2003-01-11 08:55:21 +00:00
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
if( sText.length() > 0 )
|
|
|
|
|
sText.resize( sText.length()-5 );
|
2003-03-12 01:26:44 +00:00
|
|
|
|
|
|
|
|
m_textAutoPlay.SetText( sText );
|
2003-01-11 08:55:21 +00:00
|
|
|
}
|
|
|
|
|
|
2002-08-02 09:31:06 +00:00
|
|
|
void SaveChanges()
|
2002-07-27 19:29:51 +00:00
|
|
|
{
|
2002-10-17 23:31:17 +00:00
|
|
|
/* XXX: Hmm. Better would be to make sure m_pCurCourse is only set when we're
|
|
|
|
|
* playing out of a course, and use that here, so these things wouldn't need to
|
|
|
|
|
* special case play modes. Need to make sure m_pCurCourse gets erased
|
|
|
|
|
* correctly, though. -glenn */
|
2003-02-14 21:42:44 +00:00
|
|
|
/* That's a very clever idea! I should look into this. -Chris */
|
2002-07-28 20:28:37 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
|
|
|
|
case PLAY_MODE_ARCADE:
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_HUMAN_BATTLE:
|
|
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
2003-04-07 05:14:27 +00:00
|
|
|
case PLAY_MODE_RAVE:
|
2002-09-11 04:49:07 +00:00
|
|
|
GAMESTATE->m_pCurSong->Save();
|
2002-07-28 20:28:37 +00:00
|
|
|
break;
|
2003-01-21 05:14:59 +00:00
|
|
|
case PLAY_MODE_NONSTOP:
|
2002-07-28 20:28:37 +00:00
|
|
|
case PLAY_MODE_ONI:
|
|
|
|
|
case PLAY_MODE_ENDLESS:
|
|
|
|
|
{
|
2003-04-07 03:25:44 +00:00
|
|
|
// FIXME!!!
|
2003-03-26 23:08:05 +00:00
|
|
|
//for( int i=0; i<m_apSongsQueue.size(); i++ )
|
|
|
|
|
// m_apSongsQueue[i]->Save();
|
2002-07-28 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
2002-07-27 19:29:51 +00:00
|
|
|
}
|
|
|
|
|
|
2002-08-02 09:31:06 +00:00
|
|
|
void DontSaveChanges()
|
2002-07-27 19:29:51 +00:00
|
|
|
{
|
2002-07-28 20:28:37 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
|
|
|
|
case PLAY_MODE_ARCADE:
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_HUMAN_BATTLE:
|
|
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
2003-04-07 05:14:27 +00:00
|
|
|
case PLAY_MODE_RAVE:
|
2003-06-24 20:06:16 +00:00
|
|
|
GAMESTATE->m_pCurSong->RevertFromDisk();
|
2002-07-28 20:28:37 +00:00
|
|
|
break;
|
2003-01-21 05:14:59 +00:00
|
|
|
case PLAY_MODE_NONSTOP:
|
2002-07-28 20:28:37 +00:00
|
|
|
case PLAY_MODE_ONI:
|
|
|
|
|
case PLAY_MODE_ENDLESS:
|
|
|
|
|
{
|
2003-02-14 21:42:44 +00:00
|
|
|
// FIXME
|
2003-03-26 23:08:05 +00:00
|
|
|
// for( unsigned i=0; i<m_apSongsQueue.size(); i++ )
|
2003-02-14 21:42:44 +00:00
|
|
|
// {
|
2003-03-26 23:08:05 +00:00
|
|
|
// Song* pSong = m_apSongsQueue[i];
|
2003-02-25 00:33:42 +00:00
|
|
|
// ld.LoadFromSMFile( pSong->GetCacheFilePath(), *pSong );
|
2003-02-14 21:42:44 +00:00
|
|
|
// }
|
2002-07-28 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
2002-07-27 19:29:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShowSavePrompt( ScreenMessage SM_SendWhenDone )
|
|
|
|
|
{
|
2002-07-28 20:28:37 +00:00
|
|
|
CString sMessage;
|
|
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
|
|
|
|
case PLAY_MODE_ARCADE:
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_HUMAN_BATTLE:
|
|
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
2003-04-07 05:14:27 +00:00
|
|
|
case PLAY_MODE_RAVE:
|
2002-07-28 20:28:37 +00:00
|
|
|
sMessage = ssprintf(
|
|
|
|
|
"You have changed the offset or BPM of\n"
|
|
|
|
|
"%s.\n"
|
|
|
|
|
"Would you like to save these changes back\n"
|
|
|
|
|
"to the song file?\n"
|
2002-08-20 06:26:34 +00:00
|
|
|
"Choosing NO will discard your changes.",
|
2003-04-25 00:01:35 +00:00
|
|
|
GAMESTATE->m_pCurSong->GetFullDisplayTitle().c_str() );
|
2002-07-28 20:28:37 +00:00
|
|
|
break;
|
2003-01-21 05:14:59 +00:00
|
|
|
case PLAY_MODE_NONSTOP:
|
2002-07-28 20:28:37 +00:00
|
|
|
case PLAY_MODE_ONI:
|
|
|
|
|
case PLAY_MODE_ENDLESS:
|
|
|
|
|
sMessage = ssprintf(
|
|
|
|
|
"You have changed the offset or BPM of\n"
|
|
|
|
|
"one or more songs in this course.\n"
|
|
|
|
|
"Would you like to save these changes back\n"
|
|
|
|
|
"to the song file(s)?\n"
|
2002-08-20 06:26:34 +00:00
|
|
|
"Choosing NO will discard your changes." );
|
2002-07-28 20:28:37 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
|
2003-06-11 20:47:39 +00:00
|
|
|
SCREENMAN->Prompt( SM_SendWhenDone, sMessage, true, false, SaveChanges, DontSaveChanges );
|
2002-07-27 19:29:51 +00:00
|
|
|
}
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
|
|
|
|
switch( SM )
|
|
|
|
|
{
|
2003-03-09 00:55:49 +00:00
|
|
|
case SM_PlayReady:
|
2003-01-25 11:05:12 +00:00
|
|
|
m_Background.FadeIn();
|
2003-03-09 00:55:49 +00:00
|
|
|
m_announcerReady.PlayRandom();
|
|
|
|
|
m_Ready.StartTransitioning( SM_PlayGo );
|
2002-05-20 08:59:37 +00:00
|
|
|
break;
|
|
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
case SM_PlayGo:
|
2003-01-25 07:40:47 +00:00
|
|
|
m_announcerHereWeGo.PlayRandom();
|
2003-03-09 00:55:49 +00:00
|
|
|
m_Go.StartTransitioning( SM_None );
|
2003-01-26 04:58:07 +00:00
|
|
|
GAMESTATE->m_bPastHereWeGo = true;
|
2003-01-25 07:40:47 +00:00
|
|
|
m_DancingState = STATE_DANCING; // STATE CHANGE! Now the user is allowed to press Back
|
|
|
|
|
break;
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
// received while STATE_DANCING
|
2002-07-11 19:02:26 +00:00
|
|
|
case SM_NotesEnded:
|
2002-07-23 01:41:40 +00:00
|
|
|
{
|
2002-11-15 23:26:32 +00:00
|
|
|
// save any statistics
|
2002-11-16 20:21:00 +00:00
|
|
|
int p;
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2002-07-28 20:28:37 +00:00
|
|
|
{
|
|
|
|
|
if( GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
{
|
|
|
|
|
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ )
|
|
|
|
|
{
|
|
|
|
|
RadarCategory rc = (RadarCategory)r;
|
2003-01-24 02:43:07 +00:00
|
|
|
GAMESTATE->m_CurStageStats.fRadarPossible[p][r] = NoteDataUtil::GetRadarValue( m_Player[p], rc, GAMESTATE->m_pCurSong->m_fMusicLengthSeconds );
|
2003-07-24 19:44:59 +00:00
|
|
|
GAMESTATE->m_CurStageStats.fRadarActual[p][r] = m_Player[p].GetActualRadarValue( rc, (PlayerNumber)p, GAMESTATE->m_pCurSong->m_fMusicLengthSeconds );
|
2002-07-28 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-04-07 03:25:44 +00:00
|
|
|
GAMESTATE->RemoveAllActiveAttacks();
|
2003-02-26 00:20:00 +00:00
|
|
|
|
2002-08-01 21:11:32 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2003-02-24 02:45:01 +00:00
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if( !GAMESTATE->m_CurStageStats.bFailed[p] )
|
2003-01-24 02:43:07 +00:00
|
|
|
GAMESTATE->m_CurStageStats.iSongsPassed[p]++;
|
2003-02-24 02:45:01 +00:00
|
|
|
}
|
2002-07-27 19:29:51 +00:00
|
|
|
|
2002-07-28 20:28:37 +00:00
|
|
|
if( !IsLastSong() )
|
2002-07-27 19:29:51 +00:00
|
|
|
{
|
2003-02-22 21:58:02 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2003-01-24 02:43:07 +00:00
|
|
|
if( GAMESTATE->IsPlayerEnabled(p) && !GAMESTATE->m_CurStageStats.bFailed[p] )
|
2003-06-30 18:08:27 +00:00
|
|
|
{
|
|
|
|
|
// give a little life back between stages
|
|
|
|
|
if( m_pLifeMeter[p] )
|
|
|
|
|
m_pLifeMeter[p]->OnSongEnded();
|
|
|
|
|
if( m_pCombinedLifeMeter )
|
|
|
|
|
m_pCombinedLifeMeter->OnSongEnded();
|
|
|
|
|
}
|
2003-04-13 00:44:50 +00:00
|
|
|
|
|
|
|
|
// HACK: Temporarily set the song pointer to the next song so that
|
|
|
|
|
// this m_NextSongOut will show the next song banner
|
|
|
|
|
Song* pCurSong = GAMESTATE->m_pCurSong;
|
|
|
|
|
|
|
|
|
|
int iPlaySongIndex = GAMESTATE->GetCourseSongIndex()+1;
|
|
|
|
|
iPlaySongIndex %= m_apSongsQueue.size();
|
|
|
|
|
GAMESTATE->m_pCurSong = m_apSongsQueue[iPlaySongIndex];
|
|
|
|
|
|
|
|
|
|
m_NextSongOut.Load( THEME->GetPathToB("ScreenGameplay next song out") );
|
|
|
|
|
GAMESTATE->m_pCurSong = pCurSong;
|
|
|
|
|
|
|
|
|
|
m_NextSongOut.StartTransitioning( SM_LoadNextSong );
|
2002-07-27 19:29:51 +00:00
|
|
|
}
|
2002-07-28 20:28:37 +00:00
|
|
|
else // IsLastSong
|
2002-07-27 19:29:51 +00:00
|
|
|
{
|
2003-03-09 00:55:49 +00:00
|
|
|
if( m_DancingState == STATE_OUTRO ) // ScreenGameplay already ended
|
2002-07-28 20:28:37 +00:00
|
|
|
return; // ignore
|
|
|
|
|
m_DancingState = STATE_OUTRO;
|
|
|
|
|
|
2003-04-14 22:12:54 +00:00
|
|
|
GAMESTATE->RemoveAllActiveAttacks();
|
|
|
|
|
|
2003-02-12 23:11:37 +00:00
|
|
|
if( GAMESTATE->m_SongOptions.m_FailType == SongOptions::FAIL_END_OF_SONG && AllFailedEarlier() )
|
2002-07-28 20:28:37 +00:00
|
|
|
{
|
2003-03-25 21:17:29 +00:00
|
|
|
this->PostScreenMessage( SM_BeginFailed, 0 );
|
2002-07-28 20:28:37 +00:00
|
|
|
}
|
2003-03-09 00:55:49 +00:00
|
|
|
else // ! failed
|
2003-02-04 21:45:42 +00:00
|
|
|
{
|
2003-03-09 00:55:49 +00:00
|
|
|
// do they deserve an extra stage?
|
|
|
|
|
if( GAMESTATE->HasEarnedExtraStage() )
|
|
|
|
|
{
|
2003-04-13 21:17:14 +00:00
|
|
|
TweenOffScreen();
|
2003-03-09 00:55:49 +00:00
|
|
|
m_Extra.StartTransitioning( SM_GoToStateAfterCleared );
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay extra") );
|
2003-03-09 00:55:49 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2003-04-13 21:17:14 +00:00
|
|
|
TweenOffScreen();
|
2003-04-14 22:12:54 +00:00
|
|
|
|
|
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_HUMAN_BATTLE:
|
2003-04-21 02:41:10 +00:00
|
|
|
case PLAY_MODE_RAVE:
|
2003-04-14 22:12:54 +00:00
|
|
|
{
|
2003-07-10 03:39:30 +00:00
|
|
|
PlayerNumber winner = GAMESTATE->GetBestPlayer();
|
2003-04-21 02:41:10 +00:00
|
|
|
switch( winner )
|
|
|
|
|
{
|
|
|
|
|
case PLAYER_INVALID:
|
|
|
|
|
m_Draw.StartTransitioning( SM_GoToStateAfterCleared );
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
m_Win[winner].StartTransitioning( SM_GoToStateAfterCleared );
|
|
|
|
|
break;
|
|
|
|
|
}
|
2003-04-14 22:12:54 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
m_Cleared.StartTransitioning( SM_GoToStateAfterCleared );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay cleared") );
|
2003-03-09 00:55:49 +00:00
|
|
|
}
|
2002-07-28 20:28:37 +00:00
|
|
|
}
|
2002-07-27 19:29:51 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2003-04-13 00:44:50 +00:00
|
|
|
case SM_LoadNextSong:
|
2003-01-25 07:40:47 +00:00
|
|
|
LoadNextSong();
|
2003-02-09 21:10:56 +00:00
|
|
|
GAMESTATE->m_bPastHereWeGo = true;
|
2003-02-05 20:50:12 +00:00
|
|
|
/* We're fading in, so don't hit any notes for a few seconds; they'll be
|
|
|
|
|
* obscured by the fade. */
|
2003-04-13 00:44:50 +00:00
|
|
|
StartPlayingSong( m_NextSongIn.GetLengthSeconds()+2, 0 );
|
|
|
|
|
m_NextSongIn.StartTransitioning( SM_None );
|
2002-08-01 03:15:27 +00:00
|
|
|
break;
|
|
|
|
|
|
2003-03-16 19:11:51 +00:00
|
|
|
case SM_PlayToasty:
|
2003-01-11 08:55:21 +00:00
|
|
|
if( PREFSMAN->m_bEasterEggs )
|
2003-03-16 19:11:51 +00:00
|
|
|
if( !m_Toasty.IsTransitioning() && !m_Toasty.IsFinished() ) // don't play if we've already played it once
|
|
|
|
|
m_Toasty.StartTransitioning();
|
2002-08-26 05:53:48 +00:00
|
|
|
break;
|
|
|
|
|
|
2003-05-13 13:35:32 +00:00
|
|
|
#define SECS_SINCE_LAST_COMMENT (SECONDS_BETWEEN_COMMENTS-m_fTimeLeftBeforeDancingComment)
|
2002-07-11 19:02:26 +00:00
|
|
|
case SM_100Combo:
|
2003-06-01 05:31:40 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 2 )
|
2002-07-11 19:02:26 +00:00
|
|
|
{
|
|
|
|
|
m_announcer100Combo.PlayRandom();
|
2002-08-13 23:26:46 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SM_200Combo:
|
2003-06-01 05:31:40 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 2 )
|
2002-07-11 19:02:26 +00:00
|
|
|
{
|
|
|
|
|
m_announcer200Combo.PlayRandom();
|
2002-08-13 23:26:46 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SM_300Combo:
|
2003-06-01 05:31:40 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 2 )
|
2002-07-11 19:02:26 +00:00
|
|
|
{
|
|
|
|
|
m_announcer300Combo.PlayRandom();
|
2002-08-13 23:26:46 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SM_400Combo:
|
2003-06-01 05:31:40 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 2 )
|
2002-07-11 19:02:26 +00:00
|
|
|
{
|
|
|
|
|
m_announcer400Combo.PlayRandom();
|
2002-08-13 23:26:46 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SM_500Combo:
|
2003-06-01 05:31:40 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 2 )
|
2002-07-11 19:02:26 +00:00
|
|
|
{
|
|
|
|
|
m_announcer500Combo.PlayRandom();
|
2002-08-13 23:26:46 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SM_600Combo:
|
2003-06-01 05:31:40 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 2 )
|
2002-07-11 19:02:26 +00:00
|
|
|
{
|
|
|
|
|
m_announcer600Combo.PlayRandom();
|
2002-08-13 23:26:46 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SM_700Combo:
|
2003-06-01 05:31:40 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 2 )
|
2002-07-11 19:02:26 +00:00
|
|
|
{
|
|
|
|
|
m_announcer700Combo.PlayRandom();
|
2002-08-13 23:26:46 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SM_800Combo:
|
2003-06-01 05:31:40 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 2 )
|
2002-07-11 19:02:26 +00:00
|
|
|
{
|
|
|
|
|
m_announcer800Combo.PlayRandom();
|
2002-08-13 23:26:46 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SM_900Combo:
|
2003-06-01 05:31:40 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 2 )
|
2002-07-11 19:02:26 +00:00
|
|
|
{
|
|
|
|
|
m_announcer900Combo.PlayRandom();
|
2002-08-13 23:26:46 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SM_1000Combo:
|
2003-06-01 05:31:40 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 2 )
|
2002-07-11 19:02:26 +00:00
|
|
|
{
|
|
|
|
|
m_announcer1000Combo.PlayRandom();
|
2002-08-13 23:26:46 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SM_ComboStopped:
|
2003-06-01 05:31:40 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 2 )
|
2002-07-11 19:02:26 +00:00
|
|
|
{
|
|
|
|
|
m_announcerComboStopped.PlayRandom();
|
2002-08-13 23:26:46 +00:00
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
break;
|
2003-03-09 00:55:49 +00:00
|
|
|
|
2003-05-13 13:35:32 +00:00
|
|
|
case SM_BattleTrickLevel1:
|
2003-07-09 02:27:05 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 3 )
|
2003-05-13 13:35:32 +00:00
|
|
|
{
|
|
|
|
|
m_announcerBattleTrickLevel1.PlayRandom();
|
|
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
|
|
|
|
}
|
|
|
|
|
m_soundBattleTrickLevel1.PlayRandom();
|
|
|
|
|
break;
|
|
|
|
|
case SM_BattleTrickLevel2:
|
2003-07-09 02:27:05 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 3 )
|
2003-05-13 13:35:32 +00:00
|
|
|
{
|
|
|
|
|
m_announcerBattleTrickLevel2.PlayRandom();
|
|
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
|
|
|
|
}
|
|
|
|
|
m_soundBattleTrickLevel2.PlayRandom();
|
|
|
|
|
break;
|
|
|
|
|
case SM_BattleTrickLevel3:
|
2003-07-09 02:27:05 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 3 )
|
2003-05-13 13:35:32 +00:00
|
|
|
{
|
|
|
|
|
m_announcerBattleTrickLevel3.PlayRandom();
|
|
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
|
|
|
|
}
|
|
|
|
|
m_soundBattleTrickLevel3.PlayRandom();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SM_BattleDamageLevel1:
|
2003-07-09 02:27:05 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 3 )
|
2003-05-13 13:35:32 +00:00
|
|
|
{
|
|
|
|
|
m_announcerBattleDamageLevel1.PlayRandom();
|
|
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SM_BattleDamageLevel2:
|
2003-07-09 02:27:05 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 3 )
|
2003-05-13 13:35:32 +00:00
|
|
|
{
|
|
|
|
|
m_announcerBattleDamageLevel2.PlayRandom();
|
|
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SM_BattleDamageLevel3:
|
2003-07-09 02:27:05 +00:00
|
|
|
if( SECS_SINCE_LAST_COMMENT > 3 )
|
2003-05-13 13:35:32 +00:00
|
|
|
{
|
|
|
|
|
m_announcerBattleDamageLevel3.PlayRandom();
|
|
|
|
|
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2002-08-01 05:11:11 +00:00
|
|
|
case SM_SaveChangedBeforeGoingBack:
|
|
|
|
|
if( m_bChangedOffsetOrBPM )
|
|
|
|
|
{
|
|
|
|
|
m_bChangedOffsetOrBPM = false;
|
|
|
|
|
ShowSavePrompt( SM_GoToScreenAfterBack );
|
|
|
|
|
}
|
2002-08-01 13:42:56 +00:00
|
|
|
else
|
2003-03-16 23:17:48 +00:00
|
|
|
HandleScreenMessage( SM_GoToScreenAfterBack );
|
2002-08-01 05:11:11 +00:00
|
|
|
break;
|
2003-03-09 00:55:49 +00:00
|
|
|
|
2002-07-27 19:29:51 +00:00
|
|
|
case SM_GoToScreenAfterBack:
|
2003-02-22 21:58:02 +00:00
|
|
|
/* Reset options. (Should this be done in ScreenSelect*?) */
|
2003-02-24 03:26:33 +00:00
|
|
|
GAMESTATE->RestoreSelectedOptions();
|
2003-04-13 21:17:14 +00:00
|
|
|
SCREENMAN->SetNewScreen( PREV_SCREEN(GAMESTATE->m_PlayMode) );
|
2002-05-20 08:59:37 +00:00
|
|
|
break;
|
2003-03-09 00:55:49 +00:00
|
|
|
|
2002-07-27 19:29:51 +00:00
|
|
|
case SM_GoToStateAfterCleared:
|
2003-02-24 03:26:33 +00:00
|
|
|
/* Reset options. (Should this be done in ScreenSelect*?) */
|
|
|
|
|
GAMESTATE->RestoreSelectedOptions();
|
|
|
|
|
|
2002-07-27 19:29:51 +00:00
|
|
|
if( m_bChangedOffsetOrBPM )
|
|
|
|
|
{
|
|
|
|
|
m_bChangedOffsetOrBPM = false;
|
|
|
|
|
ShowSavePrompt( SM_GoToStateAfterCleared );
|
|
|
|
|
break;
|
|
|
|
|
}
|
2003-04-13 21:17:14 +00:00
|
|
|
SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) );
|
2002-05-20 08:59:37 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SM_BeginFailed:
|
|
|
|
|
m_DancingState = STATE_OUTRO;
|
2002-12-29 22:57:38 +00:00
|
|
|
m_soundMusic.StopPlaying();
|
2003-04-13 21:17:14 +00:00
|
|
|
TweenOffScreen();
|
2003-03-09 00:55:49 +00:00
|
|
|
m_Failed.StartTransitioning( SM_GoToScreenAfterFail );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
// make the background invisible so we don't waste power drawing it
|
2002-05-20 08:59:37 +00:00
|
|
|
m_Background.BeginTweening( 1 );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_Background.SetDiffuse( RageColor(1,1,1,0) );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-08-01 13:42:56 +00:00
|
|
|
// show the survive time if extra stage
|
|
|
|
|
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
|
|
|
|
{
|
2003-01-24 02:43:07 +00:00
|
|
|
float fMaxSurviveSeconds = 0;
|
2002-08-01 13:42:56 +00:00
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
if( GAMESTATE->IsPlayerEnabled(p) )
|
2003-01-24 02:43:07 +00:00
|
|
|
fMaxSurviveSeconds = max( fMaxSurviveSeconds, GAMESTATE->m_CurStageStats.fAliveSeconds[p] );
|
|
|
|
|
ASSERT( fMaxSurviveSeconds > 0 );
|
2003-04-01 19:35:29 +00:00
|
|
|
m_textSurviveTime.SetText( "TIME: " + SecondsToTime(fMaxSurviveSeconds) );
|
2003-04-13 21:17:14 +00:00
|
|
|
SET_XY( m_textSurviveTime );
|
2002-08-01 13:42:56 +00:00
|
|
|
}
|
|
|
|
|
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay failed") );
|
2002-05-20 08:59:37 +00:00
|
|
|
break;
|
|
|
|
|
|
2002-05-27 08:23:27 +00:00
|
|
|
case SM_GoToScreenAfterFail:
|
2003-02-24 03:26:33 +00:00
|
|
|
/* Reset options. (Should this be done in ScreenSelect*?) */
|
|
|
|
|
GAMESTATE->RestoreSelectedOptions();
|
|
|
|
|
|
2002-07-27 19:29:51 +00:00
|
|
|
if( m_bChangedOffsetOrBPM )
|
|
|
|
|
{
|
|
|
|
|
m_bChangedOffsetOrBPM = false;
|
|
|
|
|
ShowSavePrompt( SM_GoToScreenAfterFail );
|
|
|
|
|
break;
|
|
|
|
|
}
|
2003-01-27 06:49:02 +00:00
|
|
|
|
2003-03-25 21:17:29 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
|
|
|
|
case PLAY_MODE_ARCADE:
|
2003-07-08 19:56:56 +00:00
|
|
|
case PLAY_MODE_HUMAN_BATTLE:
|
|
|
|
|
case PLAY_MODE_CPU_BATTLE:
|
2003-04-07 05:14:27 +00:00
|
|
|
case PLAY_MODE_RAVE:
|
2003-04-19 19:05:25 +00:00
|
|
|
if( PREFSMAN->m_bEventMode )
|
2003-03-25 21:17:29 +00:00
|
|
|
HandleScreenMessage( SM_GoToScreenAfterBack );
|
|
|
|
|
else if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
2003-04-16 22:49:40 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenEvaluationStage" );
|
2003-03-25 21:17:29 +00:00
|
|
|
else
|
|
|
|
|
SCREENMAN->SetNewScreen( "ScreenGameOver" );
|
|
|
|
|
break;
|
|
|
|
|
case PLAY_MODE_NONSTOP:
|
2003-03-28 05:47:42 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenEvaluationNonstop" );
|
|
|
|
|
break;
|
2003-03-25 21:17:29 +00:00
|
|
|
case PLAY_MODE_ONI:
|
2003-03-28 05:47:42 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenEvaluationOni" );
|
|
|
|
|
break;
|
2003-03-25 21:17:29 +00:00
|
|
|
case PLAY_MODE_ENDLESS:
|
2003-03-28 05:47:42 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenEvaluationEndless" );
|
2003-03-25 21:17:29 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
2002-06-14 22:25:22 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
|
2002-06-14 22:25:22 +00:00
|
|
|
void ScreenGameplay::TweenOnScreen()
|
|
|
|
|
{
|
2003-04-13 21:17:14 +00:00
|
|
|
ON_COMMAND( m_sprLifeFrame );
|
|
|
|
|
ON_COMMAND( m_sprStage );
|
|
|
|
|
ON_COMMAND( m_textSongOptions );
|
|
|
|
|
ON_COMMAND( m_sprScoreFrame );
|
2003-06-30 18:08:27 +00:00
|
|
|
if( m_pCombinedLifeMeter )
|
|
|
|
|
ON_COMMAND( *m_pCombinedLifeMeter );
|
2003-04-13 21:17:14 +00:00
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
2002-08-28 22:42:40 +00:00
|
|
|
{
|
2003-06-30 18:08:27 +00:00
|
|
|
if( m_pLifeMeter[p] )
|
|
|
|
|
ON_COMMAND( *m_pLifeMeter[p] );
|
2002-08-28 22:42:40 +00:00
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
2003-04-13 21:17:14 +00:00
|
|
|
ON_COMMAND( m_textCourseSongNumber[p] );
|
2003-07-08 19:56:56 +00:00
|
|
|
if( m_pScoreDisplay[p] )
|
|
|
|
|
ON_COMMAND( *m_pScoreDisplay[p] );
|
2003-04-13 21:17:14 +00:00
|
|
|
ON_COMMAND( m_textPlayerOptions[p] );
|
|
|
|
|
ON_COMMAND( m_DifficultyIcon[p] );
|
2002-08-28 22:42:40 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
2002-06-14 22:25:22 +00:00
|
|
|
|
|
|
|
|
void ScreenGameplay::TweenOffScreen()
|
|
|
|
|
{
|
2003-04-13 21:17:14 +00:00
|
|
|
OFF_COMMAND( m_sprLifeFrame );
|
|
|
|
|
OFF_COMMAND( m_sprStage );
|
|
|
|
|
OFF_COMMAND( m_textSongOptions );
|
|
|
|
|
OFF_COMMAND( m_sprScoreFrame );
|
2003-06-30 18:08:27 +00:00
|
|
|
if( m_pCombinedLifeMeter )
|
|
|
|
|
OFF_COMMAND( *m_pCombinedLifeMeter );
|
2003-04-13 21:17:14 +00:00
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-06-30 18:08:27 +00:00
|
|
|
if( m_pLifeMeter[p] )
|
|
|
|
|
OFF_COMMAND( *m_pLifeMeter[p] );
|
2003-04-13 21:17:14 +00:00
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
|
|
|
|
OFF_COMMAND( m_textCourseSongNumber[p] );
|
2003-07-08 19:56:56 +00:00
|
|
|
if( m_pScoreDisplay[p] )
|
|
|
|
|
OFF_COMMAND( *m_pScoreDisplay[p] );
|
2003-04-13 21:17:14 +00:00
|
|
|
OFF_COMMAND( m_textPlayerOptions[p] );
|
|
|
|
|
OFF_COMMAND( m_DifficultyIcon[p] );
|
|
|
|
|
}
|
2003-04-18 04:00:24 +00:00
|
|
|
|
2003-06-13 02:54:58 +00:00
|
|
|
m_textDebug.StopTweening();
|
|
|
|
|
m_textDebug.BeginTweening( 1/8.f );
|
|
|
|
|
m_textDebug.SetDiffuse( RageColor(1,1,1,0) );
|
2002-06-14 22:25:22 +00:00
|
|
|
}
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenGameplay::ShowOniGameOver( PlayerNumber pn )
|
2002-08-01 21:55:40 +00:00
|
|
|
{
|
2002-10-28 05:30:45 +00:00
|
|
|
m_sprOniGameOver[pn].SetDiffuse( RageColor(1,1,1,1) );
|
2002-09-04 03:49:08 +00:00
|
|
|
m_sprOniGameOver[pn].BeginTweening( 0.5f, Actor::TWEEN_BOUNCE_END );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_sprOniGameOver[pn].SetY( CENTER_Y );
|
2003-03-02 01:43:33 +00:00
|
|
|
m_sprOniGameOver[pn].SetEffectBob( 4, RageVector3(0,6,0) );
|
2002-08-01 21:55:40 +00:00
|
|
|
}
|