2004-01-07 04:37:00 +00:00
|
|
|
#include "global.h"
|
|
|
|
|
#include "ScreenEnding.h"
|
2005-07-20 09:48:19 +00:00
|
|
|
#include "ScreenManager.h"
|
2004-01-07 04:37:00 +00:00
|
|
|
#include "SongManager.h"
|
2004-07-08 00:10:34 +00:00
|
|
|
#include "GameSoundManager.h"
|
2004-01-07 04:37:00 +00:00
|
|
|
#include "ThemeManager.h"
|
|
|
|
|
#include "AnnouncerManager.h"
|
|
|
|
|
#include "song.h"
|
|
|
|
|
#include "ProfileManager.h"
|
2005-07-01 05:07:22 +00:00
|
|
|
#include "Profile.h"
|
2004-01-07 04:37:00 +00:00
|
|
|
#include "ActorUtil.h"
|
|
|
|
|
#include "GameState.h"
|
|
|
|
|
#include "MemoryCardManager.h"
|
|
|
|
|
#include "RageLog.h"
|
2004-06-28 07:26:00 +00:00
|
|
|
#include "Style.h"
|
2004-03-11 06:31:30 +00:00
|
|
|
#include "GameManager.h"
|
2004-06-22 08:41:25 +00:00
|
|
|
#include "PrefsManager.h"
|
2005-02-16 03:25:45 +00:00
|
|
|
#include "StatsManager.h"
|
2004-12-20 06:25:59 +00:00
|
|
|
#include "PlayerState.h"
|
2005-03-10 19:57:43 +00:00
|
|
|
#include "CommonMetrics.h"
|
2005-09-05 02:26:50 +00:00
|
|
|
#include "InputEventPlus.h"
|
2004-01-07 04:37:00 +00:00
|
|
|
|
|
|
|
|
|
2006-01-15 20:46:15 +00:00
|
|
|
REGISTER_SCREEN_CLASS( ScreenEnding );
|
2006-01-15 19:18:57 +00:00
|
|
|
ScreenEnding::ScreenEnding() : ScreenAttract( false/*dont reset GAMESTATE*/ )
|
2004-01-07 04:37:00 +00:00
|
|
|
{
|
2004-06-22 08:41:25 +00:00
|
|
|
if( PREFSMAN->m_bScreenTestMode )
|
|
|
|
|
{
|
2004-08-09 05:00:20 +00:00
|
|
|
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_1);
|
|
|
|
|
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_2);
|
2004-06-22 08:41:25 +00:00
|
|
|
|
2005-07-25 03:59:24 +00:00
|
|
|
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
2005-05-07 08:34:20 +00:00
|
|
|
GAMESTATE->m_pCurStyle.Set( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus") );
|
2006-09-15 05:56:43 +00:00
|
|
|
GAMESTATE->JoinPlayer( PLAYER_1 );
|
|
|
|
|
GAMESTATE->JoinPlayer( PLAYER_2 );
|
2005-02-24 12:27:30 +00:00
|
|
|
GAMESTATE->m_pCurSong.Set( SONGMAN->GetRandomSong() );
|
2005-05-18 07:14:19 +00:00
|
|
|
GAMESTATE->m_pCurCourse.Set( SONGMAN->GetRandomCourse() );
|
2005-02-25 18:17:26 +00:00
|
|
|
GAMESTATE->m_pCurSteps[PLAYER_1].Set( GAMESTATE->m_pCurSong->GetAllSteps()[0] );
|
|
|
|
|
GAMESTATE->m_pCurSteps[PLAYER_2].Set( GAMESTATE->m_pCurSong->GetAllSteps()[0] );
|
2005-04-20 06:13:06 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].vpPlayedSteps.push_back( GAMESTATE->m_pCurSteps[PLAYER_1] );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].vpPlayedSteps.push_back( GAMESTATE->m_pCurSteps[PLAYER_2] );
|
2006-08-05 08:02:49 +00:00
|
|
|
PO_GROUP_ASSIGN( GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions, ModsLevel_Stage, m_fScrollSpeed, 2.0f );
|
|
|
|
|
PO_GROUP_ASSIGN( GAMESTATE->m_pPlayerState[PLAYER_2]->m_PlayerOptions, ModsLevel_Stage, m_fScrollSpeed, 2.0f );
|
2004-06-22 08:41:25 +00:00
|
|
|
GAMESTATE->m_iCurrentStageIndex = 0;
|
2006-08-05 08:02:49 +00:00
|
|
|
PO_GROUP_CALL( GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions, ModsLevel_Stage, ChooseRandomModifiers );
|
|
|
|
|
PO_GROUP_CALL( GAMESTATE->m_pPlayerState[PLAYER_2]->m_PlayerOptions, ModsLevel_Stage, ChooseRandomModifiers );
|
2004-06-22 08:41:25 +00:00
|
|
|
|
|
|
|
|
for( float f = 0; f < 100.0f; f += 1.0f )
|
|
|
|
|
{
|
|
|
|
|
float fP1 = fmodf(f/100*4+.3f,1);
|
2005-02-16 03:25:45 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].SetLifeRecordAt( fP1, f );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].SetLifeRecordAt( 1-fP1, f );
|
2004-06-22 08:41:25 +00:00
|
|
|
}
|
|
|
|
|
|
2006-06-26 12:14:30 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iActualDancePoints = RandomInt( 3 );
|
2005-02-16 03:25:45 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iPossibleDancePoints = 2;
|
2006-06-26 12:14:30 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iActualDancePoints = RandomInt( 2 );
|
2005-02-16 03:25:45 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iPossibleDancePoints = 1;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iCurCombo = 0;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].UpdateComboList( 0, false );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iCurCombo = 1;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].UpdateComboList( 1, false );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iCurCombo = 50;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].UpdateComboList( 25, false );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iCurCombo = 250;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].UpdateComboList( 100, false );
|
|
|
|
|
|
2006-06-26 12:14:30 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iTapNoteScores[TNS_W1] = RandomInt( 2 );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iTapNoteScores[TNS_W2] = RandomInt( 2 );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iTapNoteScores[TNS_W3] = RandomInt( 2 );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iTapNoteScores[TNS_W1] = RandomInt( 2 );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iTapNoteScores[TNS_W2] = RandomInt( 2 );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iTapNoteScores[TNS_W3] = RandomInt( 2 );
|
2005-02-16 03:25:45 +00:00
|
|
|
|
|
|
|
|
STATSMAN->m_vPlayedStageStats.clear();
|
2004-06-22 08:41:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-02-23 06:29:05 +00:00
|
|
|
// Update final profile stats before we load them for display.
|
2004-08-29 19:10:25 +00:00
|
|
|
GAMESTATE->FinishStage();
|
2005-02-23 06:29:05 +00:00
|
|
|
}
|
2004-08-29 19:10:25 +00:00
|
|
|
|
2005-02-23 06:29:05 +00:00
|
|
|
void ScreenEnding::Init()
|
|
|
|
|
{
|
|
|
|
|
ScreenAttract::Init();
|
2004-08-29 19:10:25 +00:00
|
|
|
|
2004-01-07 04:37:00 +00:00
|
|
|
vector<Song*> arraySongs;
|
|
|
|
|
SONGMAN->GetSongs( arraySongs );
|
2004-04-18 07:34:37 +00:00
|
|
|
SongUtil::SortSongPointerArrayByTitle( arraySongs );
|
2004-01-07 04:37:00 +00:00
|
|
|
|
2005-05-01 06:42:30 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
2004-01-07 04:37:00 +00:00
|
|
|
{
|
2006-03-15 01:31:55 +00:00
|
|
|
if( !PROFILEMAN->IsPersistentProfile(p) )
|
2005-05-01 06:42:30 +00:00
|
|
|
continue;
|
2004-01-07 04:37:00 +00:00
|
|
|
|
|
|
|
|
m_sprRemoveMemoryCard[p].SetName( ssprintf("RemoveCardP%d",p+1) );
|
2005-02-06 03:32:53 +00:00
|
|
|
m_sprRemoveMemoryCard[p].Load( THEME->GetPathG("ScreenEnding",ssprintf("remove card P%d",p+1)) );
|
2005-05-01 06:42:30 +00:00
|
|
|
switch( MEMCARDMAN->GetCardState(p) )
|
|
|
|
|
{
|
2005-12-01 03:20:25 +00:00
|
|
|
case MemoryCardState_Removed:
|
|
|
|
|
case MemoryCardState_NoCard:
|
2005-05-01 06:42:30 +00:00
|
|
|
m_sprRemoveMemoryCard[p].SetHidden( true );
|
|
|
|
|
break;
|
|
|
|
|
}
|
2004-01-07 04:37:00 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprRemoveMemoryCard[p] );
|
2006-09-21 02:24:22 +00:00
|
|
|
m_sprRemoveMemoryCard[p].AddCommand( ssprintf("CardRemovedP%dMessage",p+1), ActorUtil::ParseActorCommands("hidden,1") );
|
2004-01-07 04:37:00 +00:00
|
|
|
this->AddChild( &m_sprRemoveMemoryCard[p] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-05-06 06:34:18 +00:00
|
|
|
this->SortByDrawOrder();
|
2004-01-07 04:37:00 +00:00
|
|
|
|
|
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("music scroll") );
|
|
|
|
|
|
|
|
|
|
// Now that we've read the data from the profile, it's ok to Reset()
|
|
|
|
|
GAMESTATE->Reset();
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-05 02:26:50 +00:00
|
|
|
void ScreenEnding::Input( const InputEventPlus &input )
|
2004-05-14 07:14:45 +00:00
|
|
|
{
|
2006-09-14 20:31:46 +00:00
|
|
|
if( !IsTransitioning() )
|
2004-05-14 07:14:45 +00:00
|
|
|
{
|
2006-09-14 20:52:34 +00:00
|
|
|
switch( input.MenuI )
|
2004-05-14 07:14:45 +00:00
|
|
|
{
|
|
|
|
|
case MENU_BUTTON_START:
|
|
|
|
|
SCREENMAN->PostMessageToTopScreen( SM_BeginFadingOut, 0 );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-05 02:26:50 +00:00
|
|
|
ScreenAttract::Input( input );
|
2004-05-14 07:14:45 +00:00
|
|
|
}
|
|
|
|
|
|
2004-06-08 05:22:33 +00:00
|
|
|
/*
|
|
|
|
|
* (c) 2004 Chris Danford
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the
|
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
* distribute, and/or sell copies of the Software, and to permit persons to
|
|
|
|
|
* whom the Software is furnished to do so, provided that the above
|
|
|
|
|
* copyright notice(s) and this permission notice appear in all copies of
|
|
|
|
|
* the Software and that both the above copyright notice(s) and this
|
|
|
|
|
* permission notice appear in supporting documentation.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
|
|
|
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
|
|
|
|
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
|
|
|
|
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
|
|
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
|
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
*/
|