2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2002-06-24 22:04:31 +00:00
|
|
|
#include "ScreenEvaluation.h"
|
|
|
|
|
#include "SongManager.h"
|
|
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "GameManager.h"
|
|
|
|
|
#include "RageUtil.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
2003-08-03 00:13:55 +00:00
|
|
|
#include "Steps.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "PrefsManager.h"
|
2002-06-24 22:04:31 +00:00
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "AnnouncerManager.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "GameState.h"
|
2002-08-27 03:59:22 +00:00
|
|
|
#include "GrooveRadar.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include "ThemeManager.h"
|
2004-07-08 00:10:34 +00:00
|
|
|
#include "GameSoundManager.h"
|
2003-04-15 02:47:24 +00:00
|
|
|
#include "ActorUtil.h"
|
2003-05-11 22:19:40 +00:00
|
|
|
#include "RageTimer.h"
|
2005-02-21 06:22:46 +00:00
|
|
|
#include "UnlockManager.h"
|
2003-07-17 20:10:07 +00:00
|
|
|
#include "Course.h"
|
2003-11-16 04:45:12 +00:00
|
|
|
#include "LightsManager.h"
|
2003-12-07 07:09:13 +00:00
|
|
|
#include "ProfileManager.h"
|
2003-12-18 03:14:39 +00:00
|
|
|
#include "song.h"
|
2005-02-16 03:25:45 +00:00
|
|
|
#include "StatsManager.h"
|
2004-02-11 22:34:04 +00:00
|
|
|
#include "Grade.h"
|
2004-02-12 09:44:16 +00:00
|
|
|
#include "CodeDetector.h"
|
|
|
|
|
#include "RageDisplay.h"
|
|
|
|
|
#include "StepMania.h"
|
2004-02-17 01:16:57 +00:00
|
|
|
#include "CryptManager.h"
|
2004-09-12 05:56:24 +00:00
|
|
|
#include "Style.h"
|
2004-10-03 05:27:52 +00:00
|
|
|
#include "MemoryCardManager.h"
|
2004-12-20 06:25:59 +00:00
|
|
|
#include "PlayerState.h"
|
2005-01-26 11:21:43 +00:00
|
|
|
#include "Command.h"
|
2005-02-12 21:03:39 +00:00
|
|
|
#include "CommonMetrics.h"
|
2002-08-27 03:59:22 +00:00
|
|
|
|
2003-03-28 23:13:32 +00:00
|
|
|
const int NUM_SCORE_DIGITS = 9;
|
|
|
|
|
|
2003-12-19 09:30:54 +00:00
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
// metrics that are common to all ScreenEvaluation classes
|
2003-12-21 03:39:05 +00:00
|
|
|
#define BANNER_WIDTH THEME->GetMetricF(m_sName,"BannerWidth")
|
|
|
|
|
#define BANNER_HEIGHT THEME->GetMetricF(m_sName,"BannerHeight")
|
2003-10-27 22:24:33 +00:00
|
|
|
const char* JUDGE_STRING[NUM_JUDGE_LINES] =
|
|
|
|
|
{
|
|
|
|
|
"Marvelous", "Perfect", "Great", "Good", "Boo", "Miss", "OK", "MaxCombo", "TotalError"
|
|
|
|
|
};
|
2003-12-16 10:04:37 +00:00
|
|
|
const char* STATS_STRING[NUM_STATS_LINES] =
|
|
|
|
|
{
|
|
|
|
|
"Jumps", "Holds", "Mines", "Hands"
|
|
|
|
|
};
|
|
|
|
|
|
2003-12-21 03:39:05 +00:00
|
|
|
#define SPIN_GRADES THEME->GetMetricB(m_sName,"SpinGrades")
|
|
|
|
|
#define CHEER_DELAY_SECONDS THEME->GetMetricF(m_sName,"CheerDelaySeconds")
|
2004-11-06 23:13:47 +00:00
|
|
|
#define BAR_ACTUAL_MAX_COMMAND THEME->GetMetricA(m_sName,"BarActualMaxCommand")
|
2003-04-15 02:47:24 +00:00
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
// metrics that are specific to classes derived from ScreenEvaluation
|
2003-11-10 23:25:44 +00:00
|
|
|
#define FAILED_SCREEN THEME->GetMetric (m_sName, "FailedScreen")
|
2003-04-12 06:16:12 +00:00
|
|
|
#define NEXT_SCREEN THEME->GetMetric (m_sName,"NextScreen")
|
|
|
|
|
#define END_SCREEN THEME->GetMetric (m_sName,"EndScreen")
|
|
|
|
|
#define SHOW_BANNER_AREA THEME->GetMetricB(m_sName,"ShowBannerArea")
|
|
|
|
|
#define SHOW_GRADE_AREA THEME->GetMetricB(m_sName,"ShowGradeArea")
|
|
|
|
|
#define SHOW_POINTS_AREA THEME->GetMetricB(m_sName,"ShowPointsArea")
|
|
|
|
|
#define SHOW_BONUS_AREA THEME->GetMetricB(m_sName,"ShowBonusArea")
|
|
|
|
|
#define SHOW_SURVIVED_AREA THEME->GetMetricB(m_sName,"ShowSurvivedArea")
|
2003-04-15 02:47:24 +00:00
|
|
|
#define SHOW_WIN_AREA THEME->GetMetricB(m_sName,"ShowWinArea")
|
2003-04-12 06:16:12 +00:00
|
|
|
#define SHOW_JUDGMENT( l ) THEME->GetMetricB(m_sName,ssprintf("Show%s",JUDGE_STRING[l]))
|
2003-12-16 10:04:37 +00:00
|
|
|
#define SHOW_STAT( s ) THEME->GetMetricB(m_sName,ssprintf("Show%s",STATS_STRING[l]))
|
2003-04-12 06:16:12 +00:00
|
|
|
#define SHOW_SCORE_AREA THEME->GetMetricB(m_sName,"ShowScoreArea")
|
2003-12-19 09:30:54 +00:00
|
|
|
#define SHOW_TOTAL_SCORE_AREA THEME->GetMetricB(m_sName,"ShowTotalScoreArea")
|
2003-04-12 06:16:12 +00:00
|
|
|
#define SHOW_TIME_AREA THEME->GetMetricB(m_sName,"ShowTimeArea")
|
2003-10-23 06:28:17 +00:00
|
|
|
#define SHOW_GRAPH_AREA THEME->GetMetricB(m_sName,"ShowGraphArea")
|
|
|
|
|
#define SHOW_COMBO_AREA THEME->GetMetricB(m_sName,"ShowComboArea")
|
2004-03-07 04:34:49 +00:00
|
|
|
#define SHOW_PER_DIFFICULTY_AWARD THEME->GetMetricB(m_sName,"ShowPerDifficultyAward")
|
2004-06-22 08:41:25 +00:00
|
|
|
#define SHOW_PEAK_COMBO_AWARD THEME->GetMetricB(m_sName,"ShowPeakComboAward")
|
2003-10-23 06:28:17 +00:00
|
|
|
#define GRAPH_START_HEIGHT THEME->GetMetricF(m_sName,"GraphStartHeight")
|
2003-09-27 23:31:42 +00:00
|
|
|
#define TYPE THEME->GetMetric (m_sName,"Type")
|
2003-12-11 05:23:40 +00:00
|
|
|
#define PASSED_SOUND_TIME THEME->GetMetricF(m_sName,"PassedSoundTime")
|
|
|
|
|
#define FAILED_SOUND_TIME THEME->GetMetricF(m_sName,"FailedSoundTime")
|
|
|
|
|
#define NUM_SEQUENCE_SOUNDS THEME->GetMetricI(m_sName,"NumSequenceSounds")
|
|
|
|
|
#define SOUNDSEQ_TIME( i ) THEME->GetMetricF(m_sName,ssprintf("SoundSeqTime%d", i+1))
|
2003-12-16 10:04:37 +00:00
|
|
|
#define SOUNDSEQ_NAME( i ) THEME->GetMetric (m_sName,ssprintf("SoundSeqName%d", i+1))
|
2004-03-20 02:59:08 +00:00
|
|
|
#define MAX_COMBO_NUM_DIGITS THEME->GetMetricI(m_sName,"MaxComboNumDigits")
|
|
|
|
|
#define PLAYER_OPTIONS_SEPARATOR THEME->GetMetric (m_sName,"PlayerOptionsSeparator")
|
2004-02-11 22:34:04 +00:00
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
|
2003-11-26 04:20:38 +00:00
|
|
|
static const int NUM_SHOWN_RADAR_CATEGORIES = 5;
|
2003-03-28 05:47:42 +00:00
|
|
|
|
2005-03-28 08:01:36 +00:00
|
|
|
AutoScreenMessage( SM_PlayCheer )
|
|
|
|
|
AutoScreenMessage( SM_AddBonus )
|
2002-06-24 22:04:31 +00:00
|
|
|
|
|
|
|
|
|
2004-11-26 17:28:47 +00:00
|
|
|
REGISTER_SCREEN_CLASS( ScreenEvaluation );
|
2004-05-01 23:19:33 +00:00
|
|
|
ScreenEvaluation::ScreenEvaluation( CString sClassName ) : ScreenWithMenuElements(sClassName)
|
2004-02-18 02:31:43 +00:00
|
|
|
{
|
2005-01-03 22:44:19 +00:00
|
|
|
LOG->Trace( "ScreenEvaluation::ScreenEvaluation" );
|
|
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-03-24 21:37:13 +00:00
|
|
|
// debugging
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-12-20 00:20:21 +00:00
|
|
|
|
|
|
|
|
if( PREFSMAN->m_bScreenTestMode )
|
|
|
|
|
{
|
2004-08-09 05:01:24 +00:00
|
|
|
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_1);
|
|
|
|
|
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_2);
|
2004-02-17 01:16:57 +00:00
|
|
|
|
2004-06-11 06:05:35 +00:00
|
|
|
GAMESTATE->m_PlayMode = PLAY_MODE_REGULAR;
|
2004-07-25 04:27:20 +00:00
|
|
|
GAMESTATE->m_pCurStyle = GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(), "versus" );
|
2005-02-23 21:13:09 +00:00
|
|
|
STATSMAN->m_CurStageStats.playMode = GAMESTATE->m_PlayMode;
|
|
|
|
|
STATSMAN->m_CurStageStats.pStyle = GAMESTATE->m_pCurStyle;
|
|
|
|
|
STATSMAN->m_CurStageStats.StageType = StageStats::STAGE_NORMAL;
|
2003-12-22 01:55:03 +00:00
|
|
|
GAMESTATE->m_bSideIsJoined[PLAYER_1] = true;
|
|
|
|
|
GAMESTATE->m_bSideIsJoined[PLAYER_2] = true;
|
2003-12-20 00:20:21 +00:00
|
|
|
GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
2005-02-24 12:27:30 +00:00
|
|
|
GAMESTATE->m_pCurSong.Set( SONGMAN->GetRandomSong() );
|
2005-02-23 21:13:09 +00:00
|
|
|
STATSMAN->m_CurStageStats.vpSongs.push_back( GAMESTATE->m_pCurSong );
|
2004-03-20 02:59:08 +00:00
|
|
|
GAMESTATE->m_pCurCourse = 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-02-16 03:25:45 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].vpSteps.push_back( GAMESTATE->m_pCurSteps[PLAYER_1] );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].vpSteps.push_back( GAMESTATE->m_pCurSteps[PLAYER_2] );
|
2004-12-20 06:25:59 +00:00
|
|
|
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.m_fScrollSpeed = 2;
|
|
|
|
|
GAMESTATE->m_pPlayerState[PLAYER_2]->m_PlayerOptions.m_fScrollSpeed = 2;
|
2004-03-20 02:59:08 +00:00
|
|
|
GAMESTATE->m_iCurrentStageIndex = 0;
|
2004-12-20 06:25:59 +00:00
|
|
|
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.ChooseRandomMofifiers();
|
|
|
|
|
GAMESTATE->m_pPlayerState[PLAYER_2]->m_PlayerOptions.ChooseRandomMofifiers();
|
2004-12-23 23:12:25 +00:00
|
|
|
if( rand() % 2 )
|
|
|
|
|
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.m_bTransforms[PlayerOptions::TRANSFORM_ECHO] = true; // show "disqualified"
|
|
|
|
|
if( rand() % 2 )
|
|
|
|
|
GAMESTATE->m_pPlayerState[PLAYER_2]->m_PlayerOptions.m_bTransforms[PlayerOptions::TRANSFORM_ECHO] = true; // show "disqualified"
|
2003-12-22 01:55:03 +00:00
|
|
|
|
|
|
|
|
for( float f = 0; f < 100.0f; f += 1.0f )
|
2003-12-21 08:55:59 +00:00
|
|
|
{
|
2003-12-22 01:55:03 +00:00
|
|
|
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 );
|
2003-12-21 08:55:59 +00:00
|
|
|
}
|
2003-12-22 01:55:03 +00:00
|
|
|
|
2005-02-16 03:25:45 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iActualDancePoints = rand()%3;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iPossibleDancePoints = 2;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iActualDancePoints = rand()%2;
|
|
|
|
|
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 );
|
2004-06-22 08:41:25 +00:00
|
|
|
if( rand()%2 )
|
|
|
|
|
{
|
2005-02-16 03:25:45 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iCurCombo = rand()%11000;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].UpdateComboList( 110, false );
|
2004-06-22 08:41:25 +00:00
|
|
|
}
|
2005-01-21 05:58:31 +00:00
|
|
|
if( rand()%5 == 0 )
|
|
|
|
|
{
|
2005-02-16 03:25:45 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].bFailedEarlier = true;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].bFailedEarlier = true;
|
2005-01-21 05:58:31 +00:00
|
|
|
}
|
2005-02-16 03:25:45 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iCurCombo = 0;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].UpdateComboList( 0, false );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iCurCombo = 1;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].UpdateComboList( 1, false );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iCurCombo = 50;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].UpdateComboList( 25, false );
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iCurCombo = 250;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].UpdateComboList( 100, false );
|
2004-06-22 08:41:25 +00:00
|
|
|
if( rand()%2 )
|
|
|
|
|
{
|
2005-02-16 03:25:45 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iCurCombo = rand()%11000;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].UpdateComboList( 110, false );
|
2004-06-22 08:41:25 +00:00
|
|
|
}
|
2004-01-22 07:22:45 +00:00
|
|
|
|
2005-02-16 03:25:45 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iTapNoteScores[TNS_MARVELOUS] = rand()%3;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iTapNoteScores[TNS_PERFECT] = rand()%3;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_1].iTapNoteScores[TNS_GREAT] = rand()%3;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iTapNoteScores[TNS_MARVELOUS] = rand()%3;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iTapNoteScores[TNS_PERFECT] = rand()%3;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[PLAYER_2].iTapNoteScores[TNS_GREAT] = rand()%3;
|
2004-01-22 07:22:45 +00:00
|
|
|
|
2005-02-16 03:25:45 +00:00
|
|
|
STATSMAN->m_vPlayedStageStats.clear();
|
2003-12-20 00:20:21 +00:00
|
|
|
}
|
2005-02-23 06:29:05 +00:00
|
|
|
}
|
2003-12-20 00:20:21 +00:00
|
|
|
|
2005-02-23 06:29:05 +00:00
|
|
|
|
|
|
|
|
void ScreenEvaluation::Init()
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace( "ScreenEvaluation::Init()" );
|
|
|
|
|
|
2005-02-23 19:18:11 +00:00
|
|
|
/* Commit stats to the profile, so any profile stats displayed on this screen
|
|
|
|
|
* include the last game. */
|
|
|
|
|
GAMESTATE->CommitStageStats();
|
|
|
|
|
|
2005-02-23 22:45:01 +00:00
|
|
|
ScreenWithMenuElements::Init();
|
2003-03-24 21:37:13 +00:00
|
|
|
|
2004-03-23 06:11:10 +00:00
|
|
|
LIGHTSMAN->SetLightsMode( LIGHTSMODE_MENU );
|
2003-11-16 04:45:12 +00:00
|
|
|
|
2005-02-16 03:25:45 +00:00
|
|
|
m_bFailed = STATSMAN->m_CurStageStats.AllFailed();
|
2003-11-10 23:25:44 +00:00
|
|
|
|
2004-02-12 09:44:16 +00:00
|
|
|
ZERO( m_bSavedScreenshot );
|
|
|
|
|
|
|
|
|
|
|
2004-03-20 07:46:56 +00:00
|
|
|
CString sType = TYPE;
|
|
|
|
|
if( !sType.CompareNoCase("stage") )
|
2003-09-27 23:31:42 +00:00
|
|
|
m_Type = stage;
|
2004-03-20 07:46:56 +00:00
|
|
|
else if( !sType.CompareNoCase("summary") )
|
2003-09-27 23:31:42 +00:00
|
|
|
m_Type = summary;
|
2004-03-20 07:46:56 +00:00
|
|
|
else if( !sType.CompareNoCase("course") )
|
2003-09-27 23:31:42 +00:00
|
|
|
m_Type = course;
|
|
|
|
|
else
|
|
|
|
|
RageException::Throw("Unknown evaluation type \"%s\"", TYPE.c_str() );
|
|
|
|
|
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
|
|
|
|
// Figure out which statistics and songs we're going to display
|
|
|
|
|
//
|
2005-02-16 19:40:09 +00:00
|
|
|
STATSMAN->CalcAccumStageStats();
|
|
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
StageStats stageStats;
|
2003-03-24 21:37:13 +00:00
|
|
|
switch( m_Type )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
case summary:
|
2005-02-16 19:40:09 +00:00
|
|
|
STATSMAN->GetFinalEvalStageStats( stageStats );
|
2002-07-28 20:28:37 +00:00
|
|
|
break;
|
2003-03-24 21:37:13 +00:00
|
|
|
case stage:
|
|
|
|
|
case course:
|
2005-02-16 03:25:45 +00:00
|
|
|
stageStats = STATSMAN->m_CurStageStats;
|
2002-07-23 01:41:40 +00:00
|
|
|
break;
|
2003-01-24 02:43:07 +00:00
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
2003-10-23 06:28:17 +00:00
|
|
|
|
2004-12-20 10:47:41 +00:00
|
|
|
LOG->Trace( "total error: %i, %i", stageStats.m_player[PLAYER_1].iTotalError, stageStats.m_player[PLAYER_2].iTotalError );
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-03-28 23:13:32 +00:00
|
|
|
/*
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-03-24 21:37:13 +00:00
|
|
|
// Debugging
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2004-05-24 06:10:11 +00:00
|
|
|
FOREACH_PlayerNumber( p ) // foreach line
|
2003-03-24 21:37:13 +00:00
|
|
|
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ ) // foreach line
|
2002-07-16 22:00:59 +00:00
|
|
|
{
|
2004-07-11 07:21:33 +00:00
|
|
|
stageStats.radarPossible[p][r] = 0.5f + r/10.0f;
|
|
|
|
|
stageStats.radarActual[p][r] = 0.5f + r/10.0f;
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
}
|
2003-03-28 23:13:32 +00:00
|
|
|
*/
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
//
|
|
|
|
|
// Calculate grades
|
|
|
|
|
//
|
2002-06-24 22:04:31 +00:00
|
|
|
Grade grade[NUM_PLAYERS];
|
2004-05-04 00:00:17 +00:00
|
|
|
|
|
|
|
|
FOREACH_PlayerNumber( p )
|
2002-07-23 01:41:40 +00:00
|
|
|
{
|
2004-05-04 00:00:17 +00:00
|
|
|
if( GAMESTATE->IsPlayerEnabled(p) )
|
2004-12-20 10:47:41 +00:00
|
|
|
grade[p] = stageStats.m_player[p].GetGrade();
|
2004-05-04 00:00:17 +00:00
|
|
|
else
|
|
|
|
|
grade[p] = GRADE_FAILED;
|
2004-05-02 11:35:13 +00:00
|
|
|
|
2004-05-04 00:00:17 +00:00
|
|
|
if( PREFSMAN->m_iScoringType == PrefsManager::SCORING_5TH )
|
|
|
|
|
{
|
|
|
|
|
const int ScoreBonuses[] = { 10000000, 10000000, 1000000, 100000, 10000, 1000, 100 };
|
|
|
|
|
if( grade[p] < (int) ARRAYSIZE(ScoreBonuses) )
|
2004-02-27 01:54:55 +00:00
|
|
|
{
|
2005-02-16 03:25:45 +00:00
|
|
|
STATSMAN->m_CurStageStats.m_player[p].iBonus += ScoreBonuses[(int)grade[p] ];
|
2004-12-20 10:47:41 +00:00
|
|
|
stageStats.m_player[p].iBonus += ScoreBonuses[(int)grade[p] ];
|
2004-02-27 01:54:55 +00:00
|
|
|
}
|
2003-08-11 12:14:26 +00:00
|
|
|
}
|
2002-07-23 01:41:40 +00:00
|
|
|
}
|
|
|
|
|
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2002-08-27 16:53:25 +00:00
|
|
|
// update persistent statistics
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2004-03-18 06:34:10 +00:00
|
|
|
int iPersonalHighScoreIndex[NUM_PLAYERS];
|
|
|
|
|
int iMachineHighScoreIndex[NUM_PLAYERS];
|
|
|
|
|
RankingCategory rc[NUM_PLAYERS];;
|
|
|
|
|
PerDifficultyAward pdaToShow[NUM_PLAYERS];
|
|
|
|
|
PeakComboAward pcaToShow[NUM_PLAYERS];
|
|
|
|
|
CommitScores( stageStats, iPersonalHighScoreIndex, iMachineHighScoreIndex, rc, pdaToShow, pcaToShow );
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
m_bTryExtraStage =
|
|
|
|
|
GAMESTATE->HasEarnedExtraStage() &&
|
2003-03-24 21:37:13 +00:00
|
|
|
m_Type==stage;
|
2003-02-28 04:31:36 +00:00
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
|
2004-01-11 07:01:06 +00:00
|
|
|
//
|
|
|
|
|
// load pass/fail sound
|
|
|
|
|
//
|
2005-02-07 06:46:41 +00:00
|
|
|
for( int snd=0; snd < NUM_SEQUENCE_SOUNDS; ++snd ) // grab in any sound sequence the user may want to throw onto this screen
|
|
|
|
|
{
|
|
|
|
|
EvalSoundSequence temp;
|
|
|
|
|
temp.fTime = SOUNDSEQ_TIME(snd);
|
|
|
|
|
temp.sSound.Load( THEME->GetPathToS(SOUNDSEQ_NAME(snd)) );
|
|
|
|
|
m_SoundSequences.push_back(temp);
|
|
|
|
|
}
|
2004-02-11 22:34:04 +00:00
|
|
|
|
2003-12-11 05:23:40 +00:00
|
|
|
m_bPassFailTriggered = false; // the sound hasn't been triggered yet
|
2004-07-17 22:21:27 +00:00
|
|
|
if( m_bFailed )
|
|
|
|
|
m_sndPassFail.Load( THEME->GetPathS(m_sName, "failed") );
|
|
|
|
|
else
|
|
|
|
|
m_sndPassFail.Load( THEME->GetPathS(m_sName, "passed") );
|
|
|
|
|
m_sndPassFail.Play();
|
2004-01-11 07:01:06 +00:00
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// load other sounds
|
|
|
|
|
//
|
2005-03-16 02:36:34 +00:00
|
|
|
m_soundStart.Load( THEME->GetPathS(m_sName,"start") );
|
2004-01-11 07:01:06 +00:00
|
|
|
|
2004-05-31 06:04:30 +00:00
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-03-24 21:37:13 +00:00
|
|
|
// init banner area
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-03-28 05:47:42 +00:00
|
|
|
if( SHOW_BANNER_AREA )
|
2002-08-22 09:31:32 +00:00
|
|
|
{
|
2003-03-28 05:47:42 +00:00
|
|
|
switch( m_Type )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2003-03-28 05:47:42 +00:00
|
|
|
case stage:
|
2002-07-23 01:41:40 +00:00
|
|
|
{
|
2003-03-28 05:47:42 +00:00
|
|
|
m_LargeBanner.LoadFromSong( GAMESTATE->m_pCurSong );
|
2003-07-03 06:38:57 +00:00
|
|
|
m_LargeBanner.ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_LargeBanner.SetName( "LargeBanner" );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_LargeBanner );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_LargeBanner );
|
|
|
|
|
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprLargeBannerFrame.Load( THEME->GetPathG(m_sName,"banner frame") );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprLargeBannerFrame->SetName( "LargeBannerFrame" );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprLargeBannerFrame );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprLargeBannerFrame );
|
2003-03-28 05:47:42 +00:00
|
|
|
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprStage.Load( THEME->GetPathG(m_sName,"stage "+GAMESTATE->GetStageText()) );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprStage->SetName( "Stage" );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprStage );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprStage );
|
2002-07-23 01:41:40 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
break;
|
|
|
|
|
case summary:
|
2002-07-17 19:24:27 +00:00
|
|
|
{
|
2004-08-30 04:09:23 +00:00
|
|
|
for( unsigned i=0; i<stageStats.vpSongs.size(); i++ )
|
2003-03-28 05:47:42 +00:00
|
|
|
{
|
2004-08-30 04:09:23 +00:00
|
|
|
Song *pSong = stageStats.vpSongs[i];
|
|
|
|
|
|
|
|
|
|
m_SmallBanner[i].LoadFromSong( pSong );
|
2003-07-03 06:38:57 +00:00
|
|
|
m_SmallBanner[i].ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_SmallBanner[i].SetName( ssprintf("SmallBanner%d",i+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_SmallBanner[i] );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_SmallBanner[i] );
|
|
|
|
|
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprSmallBannerFrame[i].Load( THEME->GetPathG(m_sName,"banner frame") );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprSmallBannerFrame[i]->SetName( ssprintf("SmallBanner%d",i+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprSmallBannerFrame[i] );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprSmallBannerFrame[i] );
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
2002-07-17 19:24:27 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
break;
|
|
|
|
|
case course:
|
|
|
|
|
{
|
|
|
|
|
m_LargeBanner.LoadFromCourse( GAMESTATE->m_pCurCourse );
|
2003-07-03 06:38:57 +00:00
|
|
|
m_LargeBanner.ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_LargeBanner.SetName( "LargeBanner" );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_LargeBanner );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_LargeBanner );
|
|
|
|
|
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprLargeBannerFrame.Load( THEME->GetPathG(m_sName,"banner frame") );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprLargeBannerFrame->SetName( "LargeBannerFrame" );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprLargeBannerFrame );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprLargeBannerFrame );
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
2004-03-20 07:46:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
switch( m_Type )
|
|
|
|
|
{
|
|
|
|
|
case stage:
|
|
|
|
|
case course:
|
|
|
|
|
{
|
|
|
|
|
FOREACH_EnabledPlayer( p )
|
|
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_DifficultyIcon[p].Load( THEME->GetPathG(m_sName,"difficulty icons") );
|
2004-03-20 07:46:56 +00:00
|
|
|
switch( m_Type )
|
|
|
|
|
{
|
|
|
|
|
case stage:
|
2004-05-29 04:50:47 +00:00
|
|
|
m_DifficultyIcon[p].SetFromSteps( p, GAMESTATE->m_pCurSteps[p] );
|
2004-03-20 07:46:56 +00:00
|
|
|
break;
|
|
|
|
|
case course:
|
2004-06-04 05:40:57 +00:00
|
|
|
m_DifficultyIcon[p].SetFromTrail( p, GAMESTATE->m_pCurTrail[p] );
|
2004-03-20 07:46:56 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
m_DifficultyIcon[p].SetName( ssprintf("DifficultyIconP%d",p+1) );
|
|
|
|
|
SET_XY_AND_ON_COMMAND( m_DifficultyIcon[p] );
|
|
|
|
|
this->AddChild( &m_DifficultyIcon[p] );
|
|
|
|
|
|
2005-02-23 22:13:06 +00:00
|
|
|
m_DifficultyMeter[p].SetName( ssprintf("DifficultyMeterP%d",p+1) );
|
2005-02-23 20:40:46 +00:00
|
|
|
m_DifficultyMeter[p].Load( ssprintf("ScreenEvaluation DifficultyMeterP%d",p+1) );
|
2004-05-31 06:04:30 +00:00
|
|
|
switch( m_Type )
|
|
|
|
|
{
|
|
|
|
|
case stage:
|
|
|
|
|
m_DifficultyMeter[p].SetFromSteps( GAMESTATE->m_pCurSteps[p] );
|
|
|
|
|
break;
|
|
|
|
|
case course:
|
2004-06-03 08:22:02 +00:00
|
|
|
m_DifficultyMeter[p].SetFromTrail( GAMESTATE->m_pCurTrail[p] );
|
2004-05-31 06:04:30 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
SET_XY_AND_ON_COMMAND( m_DifficultyMeter[p] );
|
|
|
|
|
this->AddChild( &m_DifficultyMeter[p] );
|
|
|
|
|
|
2005-04-06 05:32:09 +00:00
|
|
|
m_textPlayerOptions[p].LoadFromFont( THEME->GetPathF(m_sName,"PlayerOptions") );
|
2004-03-20 07:46:56 +00:00
|
|
|
m_textPlayerOptions[p].SetName( ssprintf("PlayerOptionsP%d",p+1) );
|
|
|
|
|
SET_XY_AND_ON_COMMAND( m_textPlayerOptions[p] );
|
2005-04-06 05:32:09 +00:00
|
|
|
vector<CString> v;
|
|
|
|
|
GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.GetThemedMods( v );
|
|
|
|
|
CString sPO = join( PLAYER_OPTIONS_SEPARATOR, v );
|
2004-03-20 07:46:56 +00:00
|
|
|
m_textPlayerOptions[p].SetText( sPO );
|
|
|
|
|
this->AddChild( &m_textPlayerOptions[p] );
|
|
|
|
|
|
2005-01-31 03:18:46 +00:00
|
|
|
if( GAMESTATE->IsDisqualified(p) )
|
2004-03-20 07:46:56 +00:00
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprDisqualified[p].Load( THEME->GetPathG(m_sName,"disqualified") );
|
2004-03-20 07:46:56 +00:00
|
|
|
m_sprDisqualified[p]->SetName( ssprintf("DisqualifiedP%d",p+1) );
|
|
|
|
|
SET_XY_AND_ON_COMMAND( m_sprDisqualified[p] );
|
|
|
|
|
this->AddChild( m_sprDisqualified[p] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case summary:
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-10-23 06:28:17 +00:00
|
|
|
//
|
|
|
|
|
// init graph area
|
|
|
|
|
//
|
|
|
|
|
if( SHOW_GRAPH_AREA )
|
|
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-10-23 06:28:17 +00:00
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprGraphFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("graph frame p%d",p+1)) );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprGraphFrame[p]->SetName( ssprintf("GraphFrameP%d",p+1) );
|
2003-12-21 08:55:59 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprGraphFrame[p] );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprGraphFrame[p] );
|
2003-12-21 08:55:59 +00:00
|
|
|
|
2003-10-23 06:28:17 +00:00
|
|
|
m_Graph[p].SetName( ssprintf("GraphP%i",p+1) );
|
2005-02-06 03:32:53 +00:00
|
|
|
m_Graph[p].Load( THEME->GetPathG(m_sName,ssprintf("graph p%i", p+1)), GRAPH_START_HEIGHT );
|
2004-12-23 23:12:25 +00:00
|
|
|
m_Graph[p].LoadFromStageStats( stageStats.m_player[p] );
|
2003-10-23 06:28:17 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_Graph[p] );
|
|
|
|
|
this->AddChild( &m_Graph[p] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( SHOW_COMBO_AREA )
|
|
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-10-23 06:28:17 +00:00
|
|
|
{
|
2003-12-28 06:00:27 +00:00
|
|
|
m_Combo[p].SetName( m_sName, ssprintf("ComboP%i",p+1) );
|
2005-02-15 21:47:30 +00:00
|
|
|
m_Combo[p].Load( m_sName, ssprintf("combo p%i",p+1), stageStats, p );
|
2003-10-23 06:28:17 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_Combo[p] );
|
|
|
|
|
|
|
|
|
|
this->AddChild( &m_Combo[p] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
//
|
|
|
|
|
// init grade area
|
|
|
|
|
//
|
2003-03-28 05:47:42 +00:00
|
|
|
if( SHOW_GRADE_AREA )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-03-28 05:47:42 +00:00
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprGradeFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("grade frame p%d",p+1)) );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprGradeFrame[p]->SetName( ssprintf("GradeFrameP%d",p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprGradeFrame[p] );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprGradeFrame[p] );
|
2003-03-24 21:37:13 +00:00
|
|
|
|
2005-02-15 19:44:34 +00:00
|
|
|
m_Grades[p].Load( THEME->GetPathG(m_sName,"grades") );
|
2005-01-31 03:18:46 +00:00
|
|
|
m_Grades[p].SetGrade( p, grade[p] );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_Grades[p].SetName( ssprintf("GradeP%d",p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_Grades[p] );
|
2003-03-28 05:47:42 +00:00
|
|
|
if( SPIN_GRADES )
|
2003-03-31 03:11:31 +00:00
|
|
|
m_Grades[p].Spin();
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_Grades[p] );
|
2004-01-20 03:32:48 +00:00
|
|
|
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprGrade[p].Load( THEME->GetPathG(m_sName,"grade "+GradeToString(grade[p])) );
|
2004-01-20 03:32:48 +00:00
|
|
|
m_sprGrade[p]->SetName( ssprintf("GradeP%d",p+1) );
|
|
|
|
|
SET_XY_AND_ON_COMMAND( m_sprGrade[p] );
|
|
|
|
|
this->AddChild( m_sprGrade[p] );
|
2003-03-25 21:17:29 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// init points area
|
|
|
|
|
//
|
|
|
|
|
if( SHOW_POINTS_AREA )
|
|
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-03-25 21:17:29 +00:00
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprPercentFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("percent frame p%d",p+1)) );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprPercentFrame[p]->SetName( ssprintf("PercentFrameP%d",p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprPercentFrame[p] );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprPercentFrame[p] );
|
2003-03-28 05:47:42 +00:00
|
|
|
|
2003-10-05 23:16:29 +00:00
|
|
|
/* Use "ScreenEvaluation Percent" for the [metric set], but position and
|
2003-10-05 00:33:05 +00:00
|
|
|
* tween it with "PercentP1X", etc. */
|
2005-02-16 23:03:01 +00:00
|
|
|
m_Percent[p].SetName( ssprintf("PercentP%d",p+1) );
|
|
|
|
|
m_Percent[p].Load( p, &STATSMAN->m_CurStageStats.m_player[p], "ScreenEvaluation Percent", true );
|
|
|
|
|
SET_XY_AND_ON_COMMAND( m_Percent[p] );
|
2003-10-05 00:33:05 +00:00
|
|
|
this->AddChild( &m_Percent[p] );
|
2003-03-25 21:17:29 +00:00
|
|
|
}
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// init bonus area
|
|
|
|
|
//
|
2003-03-28 05:47:42 +00:00
|
|
|
if( SHOW_BONUS_AREA )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-03-28 05:47:42 +00:00
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprBonusFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("bonus frame p%d",p+1)) );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprBonusFrame[p]->SetName( ssprintf("BonusFrameP%d",p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprBonusFrame[p] );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprBonusFrame[p] );
|
2003-03-24 21:37:13 +00:00
|
|
|
|
2003-11-26 04:20:38 +00:00
|
|
|
for( int r=0; r<NUM_SHOWN_RADAR_CATEGORIES; r++ ) // foreach line
|
2003-03-28 05:47:42 +00:00
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprPossibleBar[p][r].Load( THEME->GetPathG(m_sName,ssprintf("bar possible p%d",p+1)) );
|
2004-12-20 10:47:41 +00:00
|
|
|
m_sprPossibleBar[p][r].SetWidth( m_sprPossibleBar[p][r].GetUnzoomedWidth() * stageStats.m_player[p].radarPossible[r] );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprPossibleBar[p][r].SetName( ssprintf("BarPossible%dP%d",r+1,p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprPossibleBar[p][r] );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprPossibleBar[p][r] );
|
|
|
|
|
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprActualBar[p][r].Load( THEME->GetPathG(m_sName,ssprintf("bar actual p%d",p+1)) );
|
2003-07-24 13:35:20 +00:00
|
|
|
// should be out of the possible bar, not actual (whatever value that is at)
|
2004-12-20 10:47:41 +00:00
|
|
|
m_sprActualBar[p][r].SetWidth( m_sprPossibleBar[p][r].GetUnzoomedWidth() * stageStats.m_player[p].radarActual[r] );
|
2003-07-24 13:35:20 +00:00
|
|
|
|
|
|
|
|
float value = (float)100 * m_sprActualBar[p][r].GetUnzoomedWidth() / m_sprPossibleBar[p][r].GetUnzoomedWidth();
|
|
|
|
|
LOG->Trace("Radar bar %d of 5 - %f percent", r, value);
|
|
|
|
|
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprActualBar[p][r].SetName( ssprintf("BarActual%dP%d",r+1,p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprActualBar[p][r] );
|
2003-07-24 13:35:20 +00:00
|
|
|
|
|
|
|
|
// .99999 is fairly close to 1.00, so we use that
|
2004-12-20 10:47:41 +00:00
|
|
|
if( stageStats.m_player[p].radarActual[r] > 0.99999f )
|
2004-12-03 05:19:46 +00:00
|
|
|
m_sprActualBar[p][r].RunCommands( BAR_ACTUAL_MAX_COMMAND );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprActualBar[p][r] );
|
|
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
2003-03-24 21:37:13 +00:00
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
//
|
|
|
|
|
// init survived area
|
|
|
|
|
//
|
|
|
|
|
if( SHOW_SURVIVED_AREA )
|
|
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-03-28 05:47:42 +00:00
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprSurvivedFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("survived frame p%d",p+1)) );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprSurvivedFrame[p]->SetName( ssprintf("SurvivedFrameP%d",p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprSurvivedFrame[p] );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprSurvivedFrame[p] );
|
2003-03-28 05:47:42 +00:00
|
|
|
|
2004-07-25 07:22:31 +00:00
|
|
|
m_textSurvivedNumber[p].LoadFromFont( THEME->GetPathF(m_sName, "stage") );
|
2004-03-20 02:59:08 +00:00
|
|
|
m_textSurvivedNumber[p].SetShadowLength( 0 );
|
2003-07-06 10:01:59 +00:00
|
|
|
// curewater: edited the "# stages cleared" text so it deducts one if you failed.
|
|
|
|
|
// Should be accurate, but I'm not sure if its "standard" that (bool)true = 1. (assumption)
|
2004-12-20 10:47:41 +00:00
|
|
|
m_textSurvivedNumber[p].SetText( ssprintf("%02d", stageStats.m_player[p].iSongsPlayed - (int)stageStats.m_player[p].bFailed) );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_textSurvivedNumber[p].SetName( ssprintf("SurvivedNumberP%d",p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_textSurvivedNumber[p] );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_textSurvivedNumber[p] );
|
|
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
|
2003-04-15 02:47:24 +00:00
|
|
|
//
|
|
|
|
|
// init win area
|
|
|
|
|
//
|
|
|
|
|
if( SHOW_WIN_AREA )
|
|
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-04-15 02:47:24 +00:00
|
|
|
{
|
2004-06-01 05:46:21 +00:00
|
|
|
m_sprWinFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("win frame p%d",p+1)) );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprWinFrame[p]->SetName( ssprintf("WinFrameP%d",p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprWinFrame[p] );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprWinFrame[p] );
|
2003-04-15 02:47:24 +00:00
|
|
|
|
2004-06-01 05:46:21 +00:00
|
|
|
m_sprWin[p].Load( THEME->GetPathG(m_sName,ssprintf("win p%d 1x3",p+1)) );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprWin[p].StopAnimating();
|
2004-05-30 21:34:42 +00:00
|
|
|
int iFrame = GAMESTATE->GetStageResult( p );
|
2003-04-21 02:41:10 +00:00
|
|
|
m_sprWin[p].SetState( iFrame );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprWin[p].SetName( ssprintf("WinP%d",p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprWin[p] );
|
2003-04-15 02:47:24 +00:00
|
|
|
this->AddChild( &m_sprWin[p] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-03-28 05:47:42 +00:00
|
|
|
// init judgment area
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-02-14 06:53:13 +00:00
|
|
|
int l;
|
|
|
|
|
for( l=0; l<NUM_JUDGE_LINES; l++ )
|
2002-09-10 08:21:55 +00:00
|
|
|
{
|
2003-07-25 08:05:29 +00:00
|
|
|
if( l == 0 && !GAMESTATE->ShowMarvelous() )
|
2003-04-11 00:12:07 +00:00
|
|
|
continue; // skip
|
|
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
if( SHOW_JUDGMENT(l) )
|
|
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprJudgeLabels[l].Load( THEME->GetPathG(m_sName,"judge labels") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_sprJudgeLabels[l].StopAnimating();
|
|
|
|
|
m_sprJudgeLabels[l].SetState( l );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprJudgeLabels[l].SetName( ssprintf("%sLabel",JUDGE_STRING[l]) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprJudgeLabels[l] );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprJudgeLabels[l] );
|
2002-09-10 08:21:55 +00:00
|
|
|
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-03-28 05:47:42 +00:00
|
|
|
{
|
2004-07-25 07:22:31 +00:00
|
|
|
m_textJudgeNumbers[l][p].LoadFromFont( THEME->GetPathF(m_sName, "judge") );
|
2004-03-20 02:59:08 +00:00
|
|
|
m_textJudgeNumbers[l][p].SetShadowLength( 0 );
|
2005-02-12 21:03:39 +00:00
|
|
|
m_textJudgeNumbers[l][p].SetDiffuse( PLAYER_COLOR.GetValue(p) );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_textJudgeNumbers[l][p].SetName( ssprintf("%sNumberP%d",JUDGE_STRING[l],p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_textJudgeNumbers[l][p] );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_textJudgeNumbers[l][p] );
|
|
|
|
|
|
|
|
|
|
int iValue;
|
|
|
|
|
switch( l )
|
|
|
|
|
{
|
2004-12-20 10:47:41 +00:00
|
|
|
case marvelous: iValue = stageStats.m_player[p].iTapNoteScores[TNS_MARVELOUS]; break;
|
|
|
|
|
case perfect: iValue = stageStats.m_player[p].iTapNoteScores[TNS_PERFECT]; break;
|
|
|
|
|
case great: iValue = stageStats.m_player[p].iTapNoteScores[TNS_GREAT]; break;
|
|
|
|
|
case good: iValue = stageStats.m_player[p].iTapNoteScores[TNS_GOOD]; break;
|
|
|
|
|
case boo: iValue = stageStats.m_player[p].iTapNoteScores[TNS_BOO]; break;
|
|
|
|
|
case miss: iValue = stageStats.m_player[p].iTapNoteScores[TNS_MISS]; break;
|
|
|
|
|
case ok: iValue = stageStats.m_player[p].iHoldNoteScores[HNS_OK]; break;
|
|
|
|
|
case max_combo: iValue = stageStats.m_player[p].GetMaxCombo().cnt; break;
|
|
|
|
|
case error: iValue = stageStats.m_player[p].iTotalError; break;
|
2003-03-28 23:13:32 +00:00
|
|
|
default: iValue = 0; ASSERT(0);
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
2004-03-20 02:59:08 +00:00
|
|
|
|
|
|
|
|
// UGLY... generalize this
|
|
|
|
|
int iNumDigits = (l==max_combo) ? MAX_COMBO_NUM_DIGITS : 4;
|
|
|
|
|
m_textJudgeNumbers[l][p].SetText( ssprintf("%*d",iNumDigits,iValue) );
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
2002-09-10 08:21:55 +00:00
|
|
|
}
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
2002-09-10 08:21:55 +00:00
|
|
|
|
2003-12-16 10:04:37 +00:00
|
|
|
for( l=0; l<NUM_STATS_LINES; l++ )
|
|
|
|
|
{
|
|
|
|
|
if( !SHOW_STAT(l) )
|
|
|
|
|
continue;
|
|
|
|
|
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprStatsLabel[l].Load( THEME->GetPathG(m_sName,ssprintf("label %s", STATS_STRING[l])) );
|
2003-12-16 10:04:37 +00:00
|
|
|
m_sprStatsLabel[l]->StopAnimating();
|
|
|
|
|
m_sprStatsLabel[l]->SetName( ssprintf("%sLabel",STATS_STRING[l]) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprStatsLabel[l] );
|
2003-12-16 10:04:37 +00:00
|
|
|
this->AddChild( m_sprStatsLabel[l] );
|
|
|
|
|
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-12-16 10:04:37 +00:00
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_textStatsText[l][p].LoadFromFont( THEME->GetPathF(m_sName,"stats") );
|
2005-02-12 21:03:39 +00:00
|
|
|
m_textStatsText[l][p].SetDiffuse( PLAYER_COLOR.GetValue(p) );
|
2003-12-16 10:04:37 +00:00
|
|
|
m_textStatsText[l][p].SetName( ssprintf("%sTextP%d",STATS_STRING[l],p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_textStatsText[l][p] );
|
2003-12-16 10:04:37 +00:00
|
|
|
this->AddChild( &m_textStatsText[l][p] );
|
|
|
|
|
|
|
|
|
|
const int indeces[NUM_STATS_LINES] =
|
|
|
|
|
{
|
|
|
|
|
RADAR_NUM_JUMPS, RADAR_NUM_HOLDS, RADAR_NUM_MINES, RADAR_NUM_HANDS
|
|
|
|
|
};
|
|
|
|
|
const int ind = indeces[l];
|
2004-12-20 10:47:41 +00:00
|
|
|
const int iActual = (int) roundf(stageStats.m_player[p].radarActual[ind]);
|
|
|
|
|
const int iPossible = (int) roundf(stageStats.m_player[p].radarPossible[ind]);
|
2003-12-16 10:04:37 +00:00
|
|
|
|
2004-03-20 02:59:08 +00:00
|
|
|
m_textStatsText[l][p].SetText( ssprintf("%3d/%3d",iActual,iPossible) );
|
2003-12-16 10:04:37 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
//
|
|
|
|
|
// init score area
|
|
|
|
|
//
|
2003-03-28 05:47:42 +00:00
|
|
|
if( SHOW_SCORE_AREA )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprScoreLabel.Load( THEME->GetPathG(m_sName,"score label") );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprScoreLabel->SetName( "ScoreLabel" );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprScoreLabel );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprScoreLabel );
|
2003-03-28 05:47:42 +00:00
|
|
|
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-03-28 05:47:42 +00:00
|
|
|
{
|
2004-07-25 07:22:31 +00:00
|
|
|
m_textScore[p].LoadFromFont( THEME->GetPathF(m_sName, "score") );
|
2004-03-20 02:59:08 +00:00
|
|
|
m_textScore[p].SetShadowLength( 0 );
|
2005-02-12 21:03:39 +00:00
|
|
|
m_textScore[p].SetDiffuse( PLAYER_COLOR.GetValue(p) );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_textScore[p].SetName( ssprintf("ScoreNumberP%d",p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_textScore[p] );
|
2004-12-20 10:47:41 +00:00
|
|
|
m_textScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS, stageStats.m_player[p].iScore) );
|
2003-03-28 23:13:32 +00:00
|
|
|
this->AddChild( &m_textScore[p] );
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
2002-09-10 08:21:55 +00:00
|
|
|
}
|
|
|
|
|
|
2003-12-19 09:30:54 +00:00
|
|
|
if( SHOW_TOTAL_SCORE_AREA )
|
|
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprTotalScoreLabel.Load( THEME->GetPathG(m_sName,"totalscore label") );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprTotalScoreLabel->SetName( "TotalScoreLabel" );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprTotalScoreLabel );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprTotalScoreLabel );
|
2003-12-19 09:30:54 +00:00
|
|
|
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-12-19 09:30:54 +00:00
|
|
|
{
|
|
|
|
|
int iTotalScore=0;
|
2005-02-16 03:25:45 +00:00
|
|
|
for( unsigned i=0; i<STATSMAN->m_vPlayedStageStats.size(); i++ )
|
|
|
|
|
iTotalScore += STATSMAN->m_vPlayedStageStats[i].m_player[p].iScore;
|
2003-12-19 09:30:54 +00:00
|
|
|
|
2004-12-20 10:47:41 +00:00
|
|
|
//iTotalScore += stageStats.m_player[p].iScore;
|
2003-12-19 09:30:54 +00:00
|
|
|
|
2004-07-25 07:22:31 +00:00
|
|
|
m_textTotalScore[p].LoadFromFont( THEME->GetPathF(m_sName, "totalscore") );
|
2004-03-20 02:59:08 +00:00
|
|
|
m_textTotalScore[p].SetShadowLength( 0 );
|
2005-02-12 21:03:39 +00:00
|
|
|
m_textTotalScore[p].SetDiffuse( PLAYER_COLOR.GetValue(p) );
|
2003-12-19 09:30:54 +00:00
|
|
|
m_textTotalScore[p].SetName( ssprintf("TotalScoreNumberP%d",p+1) );
|
|
|
|
|
m_textTotalScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS+2, iTotalScore) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_textTotalScore[p] );
|
2003-12-19 09:30:54 +00:00
|
|
|
|
|
|
|
|
this->AddChild( &m_textTotalScore[p] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
//
|
|
|
|
|
// init time area
|
|
|
|
|
//
|
|
|
|
|
if( SHOW_TIME_AREA )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprTimeLabel.Load( THEME->GetPathG(m_sName,"time label") );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprTimeLabel->SetName( "TimeLabel" );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprTimeLabel );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprTimeLabel );
|
2002-09-10 08:21:55 +00:00
|
|
|
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2004-07-25 07:22:31 +00:00
|
|
|
m_textTime[p].LoadFromFont( THEME->GetPathF(m_sName, "time") );
|
2004-03-20 02:59:08 +00:00
|
|
|
m_textTime[p].SetShadowLength( 0 );
|
2005-02-12 21:03:39 +00:00
|
|
|
m_textTime[p].SetDiffuse( PLAYER_COLOR.GetValue(p) );
|
2003-12-21 04:19:51 +00:00
|
|
|
m_textTime[p].SetName( ssprintf("TimeNumberP%d",p+1) );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_textTime[p] );
|
2004-12-20 10:47:41 +00:00
|
|
|
m_textTime[p].SetText( SecondsToMMSSMsMs(stageStats.m_player[p].fAliveSeconds) );
|
2003-03-28 23:13:32 +00:00
|
|
|
this->AddChild( &m_textTime[p] );
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
2003-03-24 21:37:13 +00:00
|
|
|
|
|
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
//
|
|
|
|
|
// init extra area
|
|
|
|
|
//
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_PlayerNumber( p )
|
2003-03-28 05:47:42 +00:00
|
|
|
{
|
2003-10-19 21:38:11 +00:00
|
|
|
if( iMachineHighScoreIndex[p] != -1 )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprMachineRecord[p].Load( THEME->GetPathG( m_sName, ssprintf("MachineRecord %02d",iMachineHighScoreIndex[p]+1) ) );
|
2004-03-20 02:59:08 +00:00
|
|
|
m_sprMachineRecord[p]->SetName( ssprintf("MachineRecordP%d",p+1) );
|
|
|
|
|
m_sprMachineRecord[p]->StopAnimating();
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprMachineRecord[p] );
|
2004-03-20 02:59:08 +00:00
|
|
|
this->AddChild( m_sprMachineRecord[p] );
|
2003-10-19 21:38:11 +00:00
|
|
|
}
|
|
|
|
|
if( iPersonalHighScoreIndex[p] != -1 )
|
|
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprPersonalRecord[p].Load( THEME->GetPathG( m_sName, ssprintf("PersonalRecord %02d",iPersonalHighScoreIndex[p]+1) ) );
|
2004-03-20 02:59:08 +00:00
|
|
|
m_sprPersonalRecord[p]->SetName( ssprintf("PersonalRecordP%d",p+1) );
|
|
|
|
|
m_sprPersonalRecord[p]->StopAnimating();
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprPersonalRecord[p] );
|
2004-03-20 02:59:08 +00:00
|
|
|
this->AddChild( m_sprPersonalRecord[p] );
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
2004-03-18 06:34:10 +00:00
|
|
|
if( SHOW_PER_DIFFICULTY_AWARD && pdaToShow[p]!=PER_DIFFICULTY_AWARD_INVALID )
|
2003-10-31 03:10:31 +00:00
|
|
|
{
|
2004-03-18 06:34:10 +00:00
|
|
|
CString sAward = PerDifficultyAwardToString( pdaToShow[p] );
|
2004-03-07 04:34:49 +00:00
|
|
|
|
2004-06-22 08:41:25 +00:00
|
|
|
m_PerDifficultyAward[p].Load( THEME->GetPathG(m_sName,"PerDifficultyAward "+sAward) );
|
2004-03-07 04:34:49 +00:00
|
|
|
m_PerDifficultyAward[p]->SetName( ssprintf("PerDifficultyAwardP%d",p+1) );
|
|
|
|
|
SET_XY_AND_ON_COMMAND( m_PerDifficultyAward[p] );
|
|
|
|
|
this->AddChild( m_PerDifficultyAward[p] );
|
2003-10-31 03:10:31 +00:00
|
|
|
}
|
2004-06-22 08:41:25 +00:00
|
|
|
if( SHOW_PEAK_COMBO_AWARD && pcaToShow[p]!=PEAK_COMBO_AWARD_INVALID )
|
|
|
|
|
{
|
|
|
|
|
CString sAward = PeakComboAwardToString( pcaToShow[p] );
|
|
|
|
|
|
|
|
|
|
m_PeakComboAward[p].Load( THEME->GetPathG(m_sName,"PeakComboAward "+sAward) );
|
|
|
|
|
m_PeakComboAward[p]->SetName( ssprintf("PeakComboAwardP%d",p+1) );
|
|
|
|
|
SET_XY_AND_ON_COMMAND( m_PeakComboAward[p] );
|
|
|
|
|
this->AddChild( m_PeakComboAward[p] );
|
|
|
|
|
}
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
2002-09-09 05:22:02 +00:00
|
|
|
|
2003-10-19 21:38:11 +00:00
|
|
|
bool bOneHasNewTopRecord = false;
|
2004-05-04 00:00:17 +00:00
|
|
|
FOREACH_PlayerNumber( p )
|
|
|
|
|
if( GAMESTATE->IsPlayerEnabled(p) && (iMachineHighScoreIndex[p] != -1 || iPersonalHighScoreIndex[p] != -1) )
|
|
|
|
|
bOneHasNewTopRecord = true;
|
2004-01-22 02:39:55 +00:00
|
|
|
|
|
|
|
|
Grade best_grade = GRADE_NO_DATA;
|
2004-05-04 00:00:17 +00:00
|
|
|
FOREACH_PlayerNumber( p )
|
|
|
|
|
best_grade = min( best_grade, grade[p] );
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-10-17 08:03:46 +00:00
|
|
|
if( PREFSMAN->m_bAllowExtraStage && m_bTryExtraStage )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2005-02-15 19:44:34 +00:00
|
|
|
m_sprTryExtraStage.Load( THEME->GetPathG(m_sName,GAMESTATE->IsExtraStage()?"try extra2":"try extra1") );
|
2004-05-30 21:34:42 +00:00
|
|
|
m_sprTryExtraStage->SetName( "TryExtraStage" );
|
2003-12-21 03:39:05 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprTryExtraStage );
|
2004-05-30 21:34:42 +00:00
|
|
|
this->AddChild( m_sprTryExtraStage );
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-03-12 01:26:44 +00:00
|
|
|
if( GAMESTATE->IsExtraStage() )
|
2005-02-15 19:44:34 +00:00
|
|
|
SOUND->PlayOnce( THEME->GetPathS(m_sName,"try extra2") );
|
2003-03-12 01:26:44 +00:00
|
|
|
else
|
2005-02-15 19:44:34 +00:00
|
|
|
SOUND->PlayOnce( THEME->GetPathS(m_sName,"try extra1") );
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
2003-10-19 21:38:11 +00:00
|
|
|
else if( bOneHasNewTopRecord && ANNOUNCER->HasSoundsFor("evaluation new record") )
|
2002-09-09 05:22:02 +00:00
|
|
|
{
|
2003-07-26 22:53:22 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation new record") );
|
2002-09-09 05:22:02 +00:00
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
else
|
2003-03-28 05:47:42 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
switch( m_Type )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
case stage:
|
2003-05-13 13:35:32 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
2003-08-19 04:27:50 +00:00
|
|
|
case PLAY_MODE_BATTLE:
|
2003-05-13 13:35:32 +00:00
|
|
|
{
|
2003-06-30 18:08:27 +00:00
|
|
|
bool bWon = GAMESTATE->GetStageResult(GAMESTATE->m_MasterPlayerNumber) == RESULT_WIN;
|
2003-05-13 13:35:32 +00:00
|
|
|
if( bWon )
|
2003-07-26 22:53:22 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation win") );
|
2003-05-13 13:35:32 +00:00
|
|
|
else
|
2003-07-26 22:53:22 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation lose") );
|
2003-05-13 13:35:32 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
2004-04-23 02:37:09 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation "+GradeToOldString(best_grade)) );
|
2003-05-13 13:35:32 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2002-07-23 01:41:40 +00:00
|
|
|
break;
|
2003-03-24 21:37:13 +00:00
|
|
|
case course:
|
|
|
|
|
case summary:
|
2004-01-20 07:09:44 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation final "+GradeToOldString(best_grade)) );
|
2002-07-23 01:41:40 +00:00
|
|
|
break;
|
2002-06-24 22:04:31 +00:00
|
|
|
default:
|
2002-07-23 01:41:40 +00:00
|
|
|
ASSERT(0);
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-01-20 07:09:44 +00:00
|
|
|
switch( best_grade )
|
2002-10-18 19:01:32 +00:00
|
|
|
{
|
2005-03-31 06:14:28 +00:00
|
|
|
case GRADE_TIER01:
|
|
|
|
|
case GRADE_TIER02:
|
|
|
|
|
case GRADE_TIER03:
|
2003-04-15 02:47:24 +00:00
|
|
|
this->PostScreenMessage( SM_PlayCheer, CHEER_DELAY_SECONDS );
|
2002-10-18 19:01:32 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2004-05-02 03:01:27 +00:00
|
|
|
this->SortByDrawOrder();
|
2002-08-27 16:53:25 +00:00
|
|
|
|
2003-12-11 05:23:40 +00:00
|
|
|
|
2005-02-15 19:44:34 +00:00
|
|
|
SOUND->PlayMusic( THEME->GetPathS(m_sName,"music") );
|
2003-12-19 09:30:54 +00:00
|
|
|
m_timerSoundSequences.SetZero(); // zero the sound sequence timer
|
|
|
|
|
m_timerSoundSequences.Touch(); // set the timer going :]
|
2005-03-21 20:14:08 +00:00
|
|
|
|
|
|
|
|
this->PostScreenMessage( SM_AddBonus, 1.5f );
|
|
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
|
|
|
|
|
|
2004-03-18 06:34:10 +00:00
|
|
|
void ScreenEvaluation::CommitScores(
|
|
|
|
|
const StageStats &stageStats,
|
|
|
|
|
int iPersonalHighScoreIndexOut[NUM_PLAYERS],
|
|
|
|
|
int iMachineHighScoreIndexOut[NUM_PLAYERS],
|
|
|
|
|
RankingCategory rcOut[NUM_PLAYERS],
|
|
|
|
|
PerDifficultyAward pdaToShowOut[NUM_PLAYERS],
|
|
|
|
|
PeakComboAward pcaToShowOut[NUM_PLAYERS] )
|
2003-12-18 03:43:25 +00:00
|
|
|
{
|
2004-03-18 06:34:10 +00:00
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_PlayerNumber( pn )
|
|
|
|
|
{
|
|
|
|
|
iPersonalHighScoreIndexOut[pn] = -1;
|
|
|
|
|
iMachineHighScoreIndexOut[pn] = -1;
|
|
|
|
|
rcOut[pn] = RANKING_INVALID;
|
|
|
|
|
pdaToShowOut[pn] = PER_DIFFICULTY_AWARD_INVALID;
|
|
|
|
|
pcaToShowOut[pn] = PEAK_COMBO_AWARD_INVALID;
|
|
|
|
|
}
|
2004-03-18 06:34:10 +00:00
|
|
|
}
|
|
|
|
|
|
2003-12-18 03:43:25 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
|
|
|
|
case PLAY_MODE_BATTLE:
|
|
|
|
|
case PLAY_MODE_RAVE:
|
|
|
|
|
return; /* don't save scores in battle */
|
|
|
|
|
}
|
|
|
|
|
|
2004-03-20 07:46:56 +00:00
|
|
|
if( PREFSMAN->m_bScreenTestMode )
|
|
|
|
|
{
|
|
|
|
|
FOREACH_PlayerNumber( pn )
|
|
|
|
|
{
|
|
|
|
|
iPersonalHighScoreIndexOut[pn] = 0;
|
|
|
|
|
iMachineHighScoreIndexOut[pn] = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-12-18 03:43:25 +00:00
|
|
|
// don't save scores if the player chose not to
|
|
|
|
|
if( !GAMESTATE->m_SongOptions.m_bSaveScore )
|
|
|
|
|
return;
|
|
|
|
|
|
2004-03-21 08:08:59 +00:00
|
|
|
LOG->Trace( "saving stats and high scores" );
|
|
|
|
|
|
2003-12-18 03:43:25 +00:00
|
|
|
{
|
2004-03-20 02:59:08 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
|
|
|
|
{
|
|
|
|
|
// don't save scores if the player is disqualified
|
2004-05-02 11:35:13 +00:00
|
|
|
if( GAMESTATE->IsDisqualified(p) )
|
2004-03-20 02:59:08 +00:00
|
|
|
continue;
|
2004-03-09 08:19:55 +00:00
|
|
|
|
2004-04-18 18:42:42 +00:00
|
|
|
Song* pSong = GAMESTATE->m_pCurSong;
|
2004-05-24 06:12:17 +00:00
|
|
|
Steps* pSteps = GAMESTATE->m_pCurSteps[p];
|
2004-04-18 18:42:42 +00:00
|
|
|
|
2004-03-20 02:59:08 +00:00
|
|
|
// whether or not to save scores when the stage was failed
|
|
|
|
|
// depends on if this is a course or not ... it's handled
|
|
|
|
|
// below in the switch
|
2003-12-18 03:43:25 +00:00
|
|
|
|
2004-03-20 02:59:08 +00:00
|
|
|
HighScore &hs = m_HighScore[p];
|
2004-05-02 11:35:13 +00:00
|
|
|
hs.sName = RANKING_TO_FILL_IN_MARKER[p];
|
2004-12-20 10:47:41 +00:00
|
|
|
hs.grade = stageStats.m_player[p].GetGrade();
|
|
|
|
|
hs.iScore = stageStats.m_player[p].iScore;
|
|
|
|
|
hs.fPercentDP = stageStats.m_player[p].GetPercentDancePoints();
|
|
|
|
|
hs.fSurviveSeconds = stageStats.m_player[p].fAliveSeconds;
|
2004-12-20 06:25:59 +00:00
|
|
|
hs.sModifiers = GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.GetString();
|
2004-07-19 08:05:14 +00:00
|
|
|
hs.dateTime = DateTime::GetNowDateTime();
|
2004-08-06 21:01:28 +00:00
|
|
|
hs.sPlayerGuid = PROFILEMAN->IsUsingProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : CString("");
|
2004-04-18 19:49:45 +00:00
|
|
|
hs.sMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid;
|
2004-05-25 06:50:04 +00:00
|
|
|
hs.iProductID = PREFSMAN->m_iProductID;
|
2004-12-20 10:47:41 +00:00
|
|
|
memcpy( hs.iTapNoteScores, stageStats.m_player[p].iTapNoteScores, sizeof(hs.iTapNoteScores) );
|
|
|
|
|
memcpy( hs.iHoldNoteScores, stageStats.m_player[p].iHoldNoteScores, sizeof(hs.iHoldNoteScores) );
|
|
|
|
|
hs.radarValues = stageStats.m_player[p].radarActual;
|
2004-02-09 06:26:13 +00:00
|
|
|
|
2004-06-28 07:26:00 +00:00
|
|
|
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
2004-02-09 06:26:13 +00:00
|
|
|
|
2004-03-20 02:59:08 +00:00
|
|
|
switch( m_Type )
|
2003-12-18 03:43:25 +00:00
|
|
|
{
|
2004-03-20 02:59:08 +00:00
|
|
|
case stage:
|
|
|
|
|
{
|
|
|
|
|
// don't save scores for a failed song
|
2004-12-20 10:47:41 +00:00
|
|
|
if( stageStats.m_player[p].bFailed )
|
2004-03-20 02:59:08 +00:00
|
|
|
continue;
|
2003-12-18 03:43:25 +00:00
|
|
|
|
2004-04-18 18:42:42 +00:00
|
|
|
ASSERT( pSteps );
|
2003-12-18 03:43:25 +00:00
|
|
|
|
2004-05-02 11:35:13 +00:00
|
|
|
PROFILEMAN->AddStepsScore( pSong, pSteps, p, hs, iPersonalHighScoreIndexOut[p], iMachineHighScoreIndexOut[p] );
|
2004-03-20 02:59:08 +00:00
|
|
|
}
|
|
|
|
|
break;
|
2003-12-18 03:43:25 +00:00
|
|
|
|
2004-03-20 02:59:08 +00:00
|
|
|
case summary:
|
|
|
|
|
{
|
|
|
|
|
// don't save scores if any stage was failed
|
2004-12-20 10:47:41 +00:00
|
|
|
if( stageStats.m_player[p].bFailed )
|
2004-03-20 02:59:08 +00:00
|
|
|
continue;
|
2003-12-18 03:43:25 +00:00
|
|
|
|
2004-08-30 06:41:56 +00:00
|
|
|
int iAverageMeter = stageStats.GetAverageMeter(p);
|
|
|
|
|
rcOut[p] = AverageMeterToRankingCategory( iAverageMeter );
|
2003-12-18 03:43:25 +00:00
|
|
|
|
2004-05-24 03:32:56 +00:00
|
|
|
PROFILEMAN->AddCategoryScore( st, rcOut[p], p, hs, iPersonalHighScoreIndexOut[p], iMachineHighScoreIndexOut[p] );
|
2004-03-20 02:59:08 +00:00
|
|
|
|
|
|
|
|
// TRICKY: Increment play count here, and not on ScreenGameplay like the others.
|
2004-05-24 03:32:56 +00:00
|
|
|
PROFILEMAN->IncrementCategoryPlayCount( st, rcOut[p], p );
|
2004-03-20 02:59:08 +00:00
|
|
|
}
|
|
|
|
|
break;
|
2003-12-18 03:43:25 +00:00
|
|
|
|
2004-03-20 02:59:08 +00:00
|
|
|
case course:
|
|
|
|
|
{
|
|
|
|
|
Course* pCourse = GAMESTATE->m_pCurCourse;
|
|
|
|
|
ASSERT( pCourse );
|
2004-06-03 08:22:02 +00:00
|
|
|
Trail* pTrail = GAMESTATE->m_pCurTrail[p];
|
2003-12-18 03:43:25 +00:00
|
|
|
|
2004-05-23 09:17:10 +00:00
|
|
|
PROFILEMAN->AddCourseScore( pCourse, pTrail, p, hs, iPersonalHighScoreIndexOut[p], iMachineHighScoreIndexOut[p] );
|
2004-03-20 02:59:08 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
2003-12-18 03:43:25 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-03-21 08:08:59 +00:00
|
|
|
LOG->Trace( "done saving stats and high scores" );
|
|
|
|
|
|
2004-05-02 11:35:13 +00:00
|
|
|
// If both players get a machine high score in the same HighScoreList,
|
|
|
|
|
// then one player's score may have bumped the other player. Look in
|
|
|
|
|
// the HighScoreList and re-get the high score index.
|
2003-12-18 03:43:25 +00:00
|
|
|
{
|
2004-03-20 02:59:08 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
2003-12-18 03:43:25 +00:00
|
|
|
{
|
2004-03-20 02:59:08 +00:00
|
|
|
if( iMachineHighScoreIndexOut[p] == -1 ) // no record
|
2003-12-18 03:43:25 +00:00
|
|
|
continue; // skip
|
2004-03-20 02:59:08 +00:00
|
|
|
|
2004-05-02 11:35:13 +00:00
|
|
|
HighScore &hs = m_HighScore[p];
|
|
|
|
|
Profile* pProfile = PROFILEMAN->GetMachineProfile();
|
2004-06-28 07:26:00 +00:00
|
|
|
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
2004-05-02 11:35:13 +00:00
|
|
|
|
|
|
|
|
const HighScoreList *pHSL = NULL;
|
|
|
|
|
switch( m_Type )
|
2003-12-18 03:43:25 +00:00
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
case stage:
|
2004-03-20 02:59:08 +00:00
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
Song* pSong = GAMESTATE->m_pCurSong;
|
2004-05-24 06:12:17 +00:00
|
|
|
Steps* pSteps = GAMESTATE->m_pCurSteps[p];
|
2004-05-02 11:35:13 +00:00
|
|
|
pHSL = &pProfile->GetStepsHighScoreList( pSong, pSteps );
|
2004-03-20 02:59:08 +00:00
|
|
|
}
|
2004-05-02 11:35:13 +00:00
|
|
|
break;
|
|
|
|
|
case summary:
|
2004-03-20 02:59:08 +00:00
|
|
|
{
|
2004-05-23 09:17:10 +00:00
|
|
|
pHSL = &pProfile->GetCategoryHighScoreList( st, rcOut[p] );
|
2004-03-20 02:59:08 +00:00
|
|
|
}
|
2004-05-02 11:35:13 +00:00
|
|
|
break;
|
|
|
|
|
case course:
|
|
|
|
|
{
|
|
|
|
|
Course* pCourse = GAMESTATE->m_pCurCourse;
|
2004-05-24 06:07:59 +00:00
|
|
|
ASSERT( pCourse );
|
2004-06-03 08:22:02 +00:00
|
|
|
Trail *pTrail = GAMESTATE->m_pCurTrail[p];
|
2004-05-23 09:17:10 +00:00
|
|
|
ASSERT( pTrail );
|
|
|
|
|
pHSL = &pProfile->GetCourseHighScoreList( pCourse, pTrail );
|
2004-05-02 11:35:13 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
2003-12-18 03:43:25 +00:00
|
|
|
}
|
2004-05-02 11:35:13 +00:00
|
|
|
|
|
|
|
|
vector<HighScore>::const_iterator iter = find( pHSL->vHighScores.begin(), pHSL->vHighScores.end(), hs );
|
|
|
|
|
if( iter == pHSL->vHighScores.end() )
|
|
|
|
|
iMachineHighScoreIndexOut[p] = -1;
|
|
|
|
|
else
|
|
|
|
|
iMachineHighScoreIndexOut[p] = iter - pHSL->vHighScores.begin();
|
2003-12-18 03:43:25 +00:00
|
|
|
}
|
|
|
|
|
}
|
2004-03-09 08:19:55 +00:00
|
|
|
|
2004-03-21 08:08:59 +00:00
|
|
|
|
|
|
|
|
LOG->Trace( "hand out awards" );
|
|
|
|
|
|
2004-03-09 08:19:55 +00:00
|
|
|
{
|
2004-03-20 02:59:08 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
|
|
|
|
{
|
|
|
|
|
deque<PerDifficultyAward> &vPdas = GAMESTATE->m_vLastPerDifficultyAwards[p];
|
2004-03-09 08:19:55 +00:00
|
|
|
|
2004-03-21 08:08:59 +00:00
|
|
|
LOG->Trace( "per difficulty awards" );
|
|
|
|
|
|
2004-03-20 02:59:08 +00:00
|
|
|
// per-difficulty awards
|
|
|
|
|
switch( m_Type )
|
2004-03-09 08:19:55 +00:00
|
|
|
{
|
2004-03-20 02:59:08 +00:00
|
|
|
case stage:
|
|
|
|
|
// don't give per-difficutly awards if using easy mods
|
2004-05-02 11:35:13 +00:00
|
|
|
if( !GAMESTATE->IsDisqualified(p) )
|
2004-03-20 02:59:08 +00:00
|
|
|
{
|
2004-12-20 10:47:41 +00:00
|
|
|
if( stageStats.m_player[p].FullComboOfScore( TNS_GREAT ) )
|
2004-03-20 02:59:08 +00:00
|
|
|
vPdas.push_back( AWARD_FULL_COMBO_GREATS );
|
2004-12-20 10:47:41 +00:00
|
|
|
if( stageStats.m_player[p].SingleDigitsOfScore( TNS_GREAT ) )
|
2004-03-20 02:59:08 +00:00
|
|
|
vPdas.push_back( AWARD_SINGLE_DIGIT_GREATS );
|
2004-12-20 10:47:41 +00:00
|
|
|
if( stageStats.m_player[p].FullComboOfScore( TNS_PERFECT ) )
|
2004-03-20 02:59:08 +00:00
|
|
|
vPdas.push_back( AWARD_FULL_COMBO_PERFECTS );
|
2004-12-20 10:47:41 +00:00
|
|
|
if( stageStats.m_player[p].SingleDigitsOfScore( TNS_PERFECT ) )
|
2004-03-20 02:59:08 +00:00
|
|
|
vPdas.push_back( AWARD_SINGLE_DIGIT_PERFECTS );
|
2004-12-20 10:47:41 +00:00
|
|
|
if( stageStats.m_player[p].FullComboOfScore( TNS_MARVELOUS ) )
|
2004-03-20 02:59:08 +00:00
|
|
|
vPdas.push_back( AWARD_FULL_COMBO_MARVELOUSES );
|
2004-03-25 08:32:47 +00:00
|
|
|
|
2004-12-20 10:47:41 +00:00
|
|
|
if( stageStats.m_player[p].OneOfScore( TNS_GREAT ) )
|
2004-03-25 08:32:47 +00:00
|
|
|
vPdas.push_back( AWARD_ONE_GREAT );
|
2004-12-20 10:47:41 +00:00
|
|
|
if( stageStats.m_player[p].OneOfScore( TNS_PERFECT ) )
|
2004-03-25 08:32:47 +00:00
|
|
|
vPdas.push_back( AWARD_ONE_PERFECT );
|
2004-03-20 02:59:08 +00:00
|
|
|
|
2004-12-20 10:47:41 +00:00
|
|
|
float fPercentGreats = stageStats.m_player[p].GetPercentageOfTaps( TNS_GREAT );
|
2004-03-20 02:59:08 +00:00
|
|
|
if( fPercentGreats >= 0.8f )
|
|
|
|
|
vPdas.push_back( AWARD_GREATS_80_PERCENT );
|
|
|
|
|
if( fPercentGreats >= 0.9f )
|
|
|
|
|
vPdas.push_back( AWARD_GREATS_90_PERCENT );
|
|
|
|
|
if( fPercentGreats >= 1.f )
|
|
|
|
|
vPdas.push_back( AWARD_GREATS_100_PERCENT );
|
|
|
|
|
}
|
2004-03-09 08:19:55 +00:00
|
|
|
}
|
|
|
|
|
|
2004-05-04 02:00:52 +00:00
|
|
|
// Max one PDA per stage
|
|
|
|
|
if( !vPdas.empty() )
|
|
|
|
|
vPdas.erase( vPdas.begin(), vPdas.end()-1 );
|
|
|
|
|
|
2004-03-20 02:59:08 +00:00
|
|
|
if( !vPdas.empty() )
|
|
|
|
|
pdaToShowOut[p] = vPdas.back();
|
2004-03-18 06:34:10 +00:00
|
|
|
|
2004-03-21 08:08:59 +00:00
|
|
|
LOG->Trace( "done with per difficulty awards" );
|
|
|
|
|
|
2004-03-20 02:59:08 +00:00
|
|
|
// DO give peak combo awards if using easy mods
|
2004-12-20 10:47:41 +00:00
|
|
|
int iComboAtStartOfStage = stageStats.m_player[p].GetComboAtStartOfStage();
|
|
|
|
|
int iPeakCombo = stageStats.m_player[p].GetMaxCombo().cnt;
|
2004-03-09 08:19:55 +00:00
|
|
|
|
2004-03-20 02:59:08 +00:00
|
|
|
FOREACH_PeakComboAward( pca )
|
2004-03-09 08:19:55 +00:00
|
|
|
{
|
2004-03-24 00:34:27 +00:00
|
|
|
int iLevel = 1000 * (pca+1);
|
2004-03-20 02:59:08 +00:00
|
|
|
bool bCrossedLevel = iComboAtStartOfStage < iLevel && iPeakCombo >= iLevel;
|
2004-03-21 08:08:59 +00:00
|
|
|
LOG->Trace( "pca = %d, iLevel = %d, bCrossedLevel = %d", pca, iLevel, bCrossedLevel );
|
2004-03-20 02:59:08 +00:00
|
|
|
if( bCrossedLevel )
|
|
|
|
|
{
|
|
|
|
|
GAMESTATE->m_vLastPeakComboAwards[p].push_back( pca );
|
|
|
|
|
}
|
2004-03-09 08:19:55 +00:00
|
|
|
}
|
|
|
|
|
|
2004-03-20 02:59:08 +00:00
|
|
|
if( !GAMESTATE->m_vLastPeakComboAwards[p].empty() )
|
|
|
|
|
pcaToShowOut[p] = GAMESTATE->m_vLastPeakComboAwards[p].back();
|
2004-03-18 06:34:10 +00:00
|
|
|
|
2004-03-21 08:08:59 +00:00
|
|
|
LOG->Trace( "done with per combo awards" );
|
2004-03-09 08:19:55 +00:00
|
|
|
}
|
|
|
|
|
}
|
2004-03-21 08:08:59 +00:00
|
|
|
|
|
|
|
|
LOG->Trace( "done handing out awards." );
|
2003-12-18 03:43:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-06-24 22:04:31 +00:00
|
|
|
void ScreenEvaluation::TweenOffScreen()
|
|
|
|
|
{
|
2003-03-28 05:47:42 +00:00
|
|
|
// large banner area
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_LargeBanner );
|
|
|
|
|
OFF_COMMAND( m_sprLargeBannerFrame );
|
|
|
|
|
OFF_COMMAND( m_sprStage );
|
2004-05-31 06:04:30 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_DifficultyIcon[p] );
|
2004-05-31 06:04:30 +00:00
|
|
|
OFF_COMMAND( m_DifficultyMeter[p] );
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_textPlayerOptions[p] );
|
2004-03-09 08:19:55 +00:00
|
|
|
OFF_COMMAND( m_sprDisqualified[p] );
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
2002-08-01 20:30:40 +00:00
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
// small banner area
|
2003-07-31 20:34:01 +00:00
|
|
|
for( int i=0; i<MAX_SONGS_TO_SHOW; i++ )
|
2003-03-28 05:47:42 +00:00
|
|
|
{
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_SmallBanner[i] );
|
|
|
|
|
OFF_COMMAND( m_sprSmallBannerFrame[i] );
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
// grade area
|
2004-01-30 00:36:28 +00:00
|
|
|
if( SHOW_GRADE_AREA )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2004-05-31 06:04:30 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2004-01-30 00:36:28 +00:00
|
|
|
{
|
|
|
|
|
OFF_COMMAND( m_sprGradeFrame[p] );
|
|
|
|
|
OFF_COMMAND( m_Grades[p] );
|
|
|
|
|
OFF_COMMAND( m_sprGrade[p] );
|
|
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
|
|
|
|
|
2003-10-23 06:28:17 +00:00
|
|
|
if( SHOW_GRAPH_AREA )
|
|
|
|
|
{
|
2004-05-31 06:04:30 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-10-23 06:28:17 +00:00
|
|
|
{
|
2003-12-21 08:55:59 +00:00
|
|
|
OFF_COMMAND( m_sprGraphFrame[p] );
|
2003-10-23 06:28:17 +00:00
|
|
|
OFF_COMMAND( m_Graph[p] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( SHOW_COMBO_AREA )
|
|
|
|
|
{
|
2004-05-31 06:04:30 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-10-23 06:28:17 +00:00
|
|
|
{
|
|
|
|
|
OFF_COMMAND( m_Combo[p] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
// points area
|
2003-10-07 02:13:48 +00:00
|
|
|
if( SHOW_POINTS_AREA )
|
2003-03-28 05:47:42 +00:00
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-10-07 02:13:48 +00:00
|
|
|
{
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_sprPercentFrame[p] );
|
2004-12-03 05:19:46 +00:00
|
|
|
m_Percent[p].RunCommands( THEME->GetMetricA(m_sName,ssprintf("PercentP%dOffCommand",p+1)) );
|
2003-10-07 02:13:48 +00:00
|
|
|
m_Percent[p].TweenOffScreen();
|
|
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
// bonus area
|
2003-10-07 02:13:48 +00:00
|
|
|
if( SHOW_BONUS_AREA )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2002-08-22 09:31:32 +00:00
|
|
|
{
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_sprBonusFrame[p] );
|
2003-11-26 04:20:38 +00:00
|
|
|
for( int r=0; r<NUM_SHOWN_RADAR_CATEGORIES; r++ ) // foreach line
|
2003-10-07 02:13:48 +00:00
|
|
|
{
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_sprPossibleBar[p][r] );
|
|
|
|
|
OFF_COMMAND( m_sprActualBar[p][r] );
|
2003-10-07 02:13:48 +00:00
|
|
|
}
|
2002-08-22 09:31:32 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// survived area
|
2003-10-07 02:13:48 +00:00
|
|
|
if( SHOW_SURVIVED_AREA )
|
2003-03-28 05:47:42 +00:00
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-10-07 02:13:48 +00:00
|
|
|
{
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_sprSurvivedFrame[p] );
|
|
|
|
|
OFF_COMMAND( m_textSurvivedNumber[p] );
|
2003-10-07 02:13:48 +00:00
|
|
|
}
|
2003-04-15 02:47:24 +00:00
|
|
|
}
|
2003-10-07 02:13:48 +00:00
|
|
|
|
2003-04-15 02:47:24 +00:00
|
|
|
// win area
|
2003-10-07 02:13:48 +00:00
|
|
|
if( SHOW_WIN_AREA )
|
2003-04-15 02:47:24 +00:00
|
|
|
{
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-10-07 02:13:48 +00:00
|
|
|
{
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_sprWinFrame[p] );
|
|
|
|
|
OFF_COMMAND( m_sprWin[p] );
|
2003-10-07 02:13:48 +00:00
|
|
|
}
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
2003-10-07 02:13:48 +00:00
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
// judgement area
|
2004-07-13 00:13:36 +00:00
|
|
|
for( int l=0; l<NUM_JUDGE_LINES; l++ )
|
2003-04-15 02:47:24 +00:00
|
|
|
{
|
2003-10-07 02:13:48 +00:00
|
|
|
if( !SHOW_JUDGMENT(l) )
|
2003-04-15 02:47:24 +00:00
|
|
|
continue;
|
2003-10-07 02:13:48 +00:00
|
|
|
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_sprJudgeLabels[l] );
|
2003-10-07 02:13:48 +00:00
|
|
|
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_textJudgeNumbers[l][p] );
|
2003-04-15 02:47:24 +00:00
|
|
|
}
|
2002-09-15 23:41:26 +00:00
|
|
|
|
2003-12-16 10:04:37 +00:00
|
|
|
// stats area
|
2004-07-13 00:13:36 +00:00
|
|
|
for( int l=0; l<NUM_STATS_LINES; l++ )
|
2003-12-16 10:04:37 +00:00
|
|
|
{
|
|
|
|
|
if( !SHOW_STAT(l) )
|
|
|
|
|
continue;
|
|
|
|
|
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_sprStatsLabel[l] );
|
2003-12-16 10:04:37 +00:00
|
|
|
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_textStatsText[l][p] );
|
2003-12-16 10:04:37 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
// score area
|
2003-10-07 02:13:48 +00:00
|
|
|
if( SHOW_SCORE_AREA )
|
2003-04-15 02:47:24 +00:00
|
|
|
{
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_sprScoreLabel );
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_textScore[p] );
|
2003-04-15 02:47:24 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
|
2003-12-19 09:30:54 +00:00
|
|
|
// total score area
|
|
|
|
|
if( SHOW_TOTAL_SCORE_AREA )
|
|
|
|
|
{
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_sprTotalScoreLabel );
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_textTotalScore[p] );
|
2003-12-19 09:30:54 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
// time area
|
2003-10-07 02:13:48 +00:00
|
|
|
if( SHOW_TIME_AREA )
|
2003-04-15 02:47:24 +00:00
|
|
|
{
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_sprTimeLabel );
|
2004-05-02 11:35:13 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_textTime[p] );
|
2003-04-15 02:47:24 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
|
|
|
|
|
// extra area
|
2004-07-13 00:13:36 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
2003-04-15 02:47:24 +00:00
|
|
|
{
|
2004-07-13 00:13:36 +00:00
|
|
|
OFF_COMMAND( m_sprMachineRecord[p] );
|
|
|
|
|
OFF_COMMAND( m_sprPersonalRecord[p] );
|
|
|
|
|
if( m_PerDifficultyAward[p].IsLoaded() )
|
|
|
|
|
OFF_COMMAND( m_PerDifficultyAward[p] );
|
|
|
|
|
if( m_PeakComboAward[p].IsLoaded() )
|
|
|
|
|
OFF_COMMAND( m_PeakComboAward[p] );
|
2003-04-15 02:47:24 +00:00
|
|
|
}
|
2003-12-21 03:39:05 +00:00
|
|
|
OFF_COMMAND( m_sprTryExtraStage );
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenEvaluation::Update( float fDeltaTime )
|
|
|
|
|
{
|
2005-02-23 21:13:09 +00:00
|
|
|
ScreenWithMenuElements::Update( fDeltaTime );
|
2003-05-11 22:19:40 +00:00
|
|
|
|
2004-07-13 00:02:26 +00:00
|
|
|
if( !m_bPassFailTriggered )
|
2003-11-10 23:25:44 +00:00
|
|
|
{
|
2004-07-13 00:01:08 +00:00
|
|
|
float fTime = m_bFailed? FAILED_SOUND_TIME:PASSED_SOUND_TIME;
|
|
|
|
|
if( m_timerSoundSequences.Ago() > fTime )
|
2003-12-11 05:23:40 +00:00
|
|
|
{
|
2004-07-13 00:01:08 +00:00
|
|
|
if( !m_sndPassFail.IsPlaying() )
|
|
|
|
|
m_sndPassFail.Play();
|
2003-12-11 05:23:40 +00:00
|
|
|
m_bPassFailTriggered = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-07-13 00:01:08 +00:00
|
|
|
|
2004-07-13 00:02:26 +00:00
|
|
|
for( unsigned snd=0; snd<m_SoundSequences.size(); snd++ )
|
|
|
|
|
{
|
|
|
|
|
if(m_SoundSequences[snd].fTime != -1) // already played? skip...
|
2003-12-11 05:23:40 +00:00
|
|
|
{
|
2004-07-13 00:02:26 +00:00
|
|
|
if(m_timerSoundSequences.Ago() > m_SoundSequences[snd].fTime )
|
2003-12-11 05:23:40 +00:00
|
|
|
{
|
2004-07-13 00:02:26 +00:00
|
|
|
m_SoundSequences[snd].fTime = -1; // -1 indicates already started playing
|
|
|
|
|
m_SoundSequences[snd].sSound.Play();
|
2003-12-11 05:23:40 +00:00
|
|
|
}
|
|
|
|
|
}
|
2004-07-13 00:02:26 +00:00
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenEvaluation::DrawPrimitives()
|
|
|
|
|
{
|
|
|
|
|
Screen::DrawPrimitives();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenEvaluation::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
|
|
|
|
{
|
2002-09-06 00:33:51 +00:00
|
|
|
// LOG->Trace( "ScreenEvaluation::Input()" );
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2004-05-01 23:19:33 +00:00
|
|
|
if( IsTransitioning() )
|
2002-06-24 22:04:31 +00:00
|
|
|
return;
|
|
|
|
|
|
2004-02-12 09:44:16 +00:00
|
|
|
if( GameI.IsValid() )
|
|
|
|
|
{
|
2004-06-28 07:26:00 +00:00
|
|
|
PlayerNumber pn = GAMESTATE->GetCurrentStyle()->ControllerToPlayerNumber( GameI.controller );
|
2004-06-12 07:01:07 +00:00
|
|
|
HighScore &hs = m_HighScore[pn];
|
|
|
|
|
|
2004-02-12 09:44:16 +00:00
|
|
|
|
|
|
|
|
if( CodeDetector::EnteredCode(GameI.controller, CodeDetector::CODE_SAVE_SCREENSHOT) )
|
|
|
|
|
{
|
|
|
|
|
if( !m_bSavedScreenshot[pn] && // only allow one screenshot
|
|
|
|
|
PROFILEMAN->IsUsingProfile(pn) )
|
|
|
|
|
{
|
2005-01-27 20:06:20 +00:00
|
|
|
if( PROFILEMAN->ProfileWasLoadedFromMemoryCard(pn) )
|
2004-10-03 05:27:52 +00:00
|
|
|
MEMCARDMAN->MountCard( pn );
|
|
|
|
|
|
2004-02-22 05:04:11 +00:00
|
|
|
Profile* pProfile = PROFILEMAN->GetProfile(pn);
|
2004-02-16 05:35:06 +00:00
|
|
|
CString sDir = PROFILEMAN->GetProfileDir((ProfileSlot)pn) + "Screenshots/";
|
2004-02-22 05:04:11 +00:00
|
|
|
int iScreenshotIndex = pProfile->GetNextScreenshotIndex();
|
|
|
|
|
CString sFileName = SaveScreenshot( sDir, true, true, iScreenshotIndex );
|
2004-02-17 01:16:57 +00:00
|
|
|
CString sPath = sDir+sFileName;
|
|
|
|
|
|
2005-01-27 20:06:20 +00:00
|
|
|
if( PROFILEMAN->ProfileWasLoadedFromMemoryCard(pn) )
|
2004-10-03 05:27:52 +00:00
|
|
|
MEMCARDMAN->UnmountCard( pn );
|
|
|
|
|
|
2004-02-17 01:16:57 +00:00
|
|
|
if( !sFileName.empty() )
|
|
|
|
|
{
|
2004-06-12 07:01:07 +00:00
|
|
|
Screenshot screenshot;
|
2004-02-17 01:16:57 +00:00
|
|
|
screenshot.sFileName = sFileName;
|
2004-02-22 02:15:34 +00:00
|
|
|
screenshot.sMD5 = CRYPTMAN->GetMD5( sPath );
|
2004-06-12 07:01:07 +00:00
|
|
|
screenshot.highScore = hs;
|
2004-02-17 01:16:57 +00:00
|
|
|
pProfile->AddScreenshot( screenshot );
|
|
|
|
|
}
|
|
|
|
|
|
2004-02-12 09:44:16 +00:00
|
|
|
m_bSavedScreenshot[pn] = true;
|
|
|
|
|
return; // handled
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-06-24 22:04:31 +00:00
|
|
|
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenEvaluation::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
2005-03-23 08:48:38 +00:00
|
|
|
if( SM == SM_MenuTimer )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2004-01-12 23:18:38 +00:00
|
|
|
EndScreen();
|
2005-03-23 08:48:38 +00:00
|
|
|
}
|
|
|
|
|
else if( SM == SM_GoToNextScreen )
|
2004-04-02 03:55:06 +00:00
|
|
|
{
|
2005-04-05 08:30:57 +00:00
|
|
|
if( GAMESTATE->IsEventMode() )
|
2005-02-21 17:29:49 +00:00
|
|
|
{
|
2003-11-10 23:25:44 +00:00
|
|
|
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
2005-02-21 17:29:49 +00:00
|
|
|
}
|
2003-11-10 23:25:44 +00:00
|
|
|
else
|
2004-04-02 03:55:06 +00:00
|
|
|
{
|
|
|
|
|
/* Go to FAILED_SCREEN if we failed a non-extra stage. */
|
|
|
|
|
bool bReallyFailed = m_bFailed && !(GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2());
|
|
|
|
|
|
|
|
|
|
// If failed and not in event mode, go to the game over screen.
|
|
|
|
|
if( bReallyFailed )
|
|
|
|
|
{
|
|
|
|
|
SCREENMAN->SetNewScreen( FAILED_SCREEN );
|
2005-03-23 08:48:38 +00:00
|
|
|
return;
|
2004-04-02 03:55:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* We passed. If we have another stage to play, go to NEXT_SCREEN. */
|
|
|
|
|
switch( m_Type )
|
|
|
|
|
{
|
|
|
|
|
case stage:
|
|
|
|
|
if( m_bTryExtraStage || !(GAMESTATE->IsFinalStage() || GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() ) )
|
|
|
|
|
{
|
2005-01-20 01:51:30 +00:00
|
|
|
/* Finish the stage before moving on, so the stage counter will be correct
|
|
|
|
|
* for ScreenSelectMusic code which is called before the ctor. Grab NEXT_SCREEN
|
|
|
|
|
* first, NEXT_SCREEN is a Lua script that depends on the stage counter. */
|
|
|
|
|
CString sNextScreen = NEXT_SCREEN;
|
2004-10-09 15:18:42 +00:00
|
|
|
GAMESTATE->FinishStage();
|
2005-01-20 01:51:30 +00:00
|
|
|
SCREENMAN->SetNewScreen( sNextScreen );
|
2004-04-02 03:55:06 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case summary:
|
|
|
|
|
case course:
|
|
|
|
|
SCREENMAN->SetNewScreen( END_SCREEN );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( m_sndPassFail.IsPlaying() )
|
|
|
|
|
m_sndPassFail.Stop();
|
|
|
|
|
}
|
2005-03-23 08:48:38 +00:00
|
|
|
else if( SM == SM_PlayCheer )
|
|
|
|
|
{
|
2003-07-26 22:53:22 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation cheer") );
|
2005-03-23 08:48:38 +00:00
|
|
|
}
|
|
|
|
|
else if( SM == SM_AddBonus )
|
|
|
|
|
{
|
2005-03-21 20:14:08 +00:00
|
|
|
FOREACH_EnabledPlayer( p )
|
|
|
|
|
{
|
|
|
|
|
if( STATSMAN->m_CurStageStats.m_player[p].iBonus == 0 )
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if( GAMESTATE->IsCourseMode() )
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
int increment = STATSMAN->m_CurStageStats.m_player[p].iBonus/10;
|
|
|
|
|
/* XXX: What's this supposed to do? If i < 1, then min(i, 1024) is i ... */
|
|
|
|
|
if( increment < 1 )
|
|
|
|
|
increment = min( 1024, STATSMAN->m_CurStageStats.m_player[p].iBonus );
|
|
|
|
|
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[p].iBonus -= increment;
|
|
|
|
|
STATSMAN->m_CurStageStats.m_player[p].iScore += increment;
|
|
|
|
|
|
|
|
|
|
if( SHOW_SCORE_AREA )
|
|
|
|
|
m_textScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS, STATSMAN->m_CurStageStats.m_player[p].iScore) );
|
|
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-12-21 10:04:25 +00:00
|
|
|
void ScreenEvaluation::MenuLeft( PlayerNumber pn )
|
|
|
|
|
{
|
2003-01-24 02:43:07 +00:00
|
|
|
// What is the purpose of this? I keep my feet on the pads and
|
|
|
|
|
// was wondering why the grades weren't spinning. -Chris
|
2003-01-24 22:21:48 +00:00
|
|
|
// To be able to see the grade without having to wait for it to
|
|
|
|
|
// stop spinning. (I was hitting left repeatedly and wondering
|
|
|
|
|
// why it kept spinning ...)
|
2003-01-24 02:43:07 +00:00
|
|
|
//m_Grades[pn].SettleQuickly();
|
2002-12-21 10:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenEvaluation::MenuRight( PlayerNumber pn )
|
|
|
|
|
{
|
2003-01-24 02:43:07 +00:00
|
|
|
// What is the purpose of this? I keep my feet on the pads and
|
|
|
|
|
// was wondering why the grades weren't spinning. -Chris
|
|
|
|
|
//m_Grades[pn].SettleQuickly();
|
2002-12-21 10:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenEvaluation::MenuBack( PlayerNumber pn )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2002-09-04 03:49:08 +00:00
|
|
|
MenuStart( pn );
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenEvaluation::MenuStart( PlayerNumber pn )
|
2004-01-12 23:18:38 +00:00
|
|
|
{
|
|
|
|
|
m_soundStart.Play();
|
|
|
|
|
|
|
|
|
|
EndScreen();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenEvaluation::EndScreen()
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
|
|
|
|
TweenOffScreen();
|
|
|
|
|
|
2004-05-24 06:10:11 +00:00
|
|
|
FOREACH_PlayerNumber( p )
|
2003-03-25 22:23:58 +00:00
|
|
|
m_Grades[p].SettleImmediately();
|
|
|
|
|
|
2005-04-05 08:30:57 +00:00
|
|
|
if( !GAMESTATE->IsEventMode() )
|
2002-06-27 17:49:10 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
switch( m_Type )
|
2002-12-19 20:01:53 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
case stage:
|
2004-04-02 03:55:06 +00:00
|
|
|
if( !m_bTryExtraStage && (GAMESTATE->IsFinalStage() || GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2()) )
|
2003-01-27 06:49:02 +00:00
|
|
|
{
|
|
|
|
|
/* Tween the screen out, but leave the MenuElements where they are.
|
2004-04-02 03:55:06 +00:00
|
|
|
* Play the "swoosh" sound manually (would normally be played by the ME
|
|
|
|
|
* tween out). */
|
2003-01-27 06:49:02 +00:00
|
|
|
TweenOffScreen();
|
2003-02-10 05:30:12 +00:00
|
|
|
}
|
2003-02-11 02:44:26 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2002-06-27 17:49:10 +00:00
|
|
|
}
|
2004-05-01 23:19:33 +00:00
|
|
|
StartTransitioning( SM_GoToNextScreen );
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
|
2004-06-08 05:22:33 +00:00
|
|
|
/*
|
|
|
|
|
* (c) 2001-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.
|
|
|
|
|
*/
|