diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 081635e5e1..33b56ca617 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -432,7 +432,8 @@ NextScreen7=ScreenInstructions NextScreen8=ScreenInstructions NextScreenArcade=ScreenSelectGroup NextScreenOni=ScreenInstructions -NextScreenBattle=ScreenInstructions +NextScreenCpubattle=ScreenInstructions +NextScreenHumanbattle=ScreenInstructions NextScreenRave=ScreenInstructions PictureP1OFFCommand=linear,0.15;zoomy,0 PictureP1ONCommand=zoomy,0;sleep,0.15;linear,0.15;zoomy,1 @@ -510,7 +511,8 @@ NextScreenArcade=ScreenSelectMusic NextScreenNonstop=ScreenSelectCourse NextScreenOni=ScreenSelectCourse NextScreenEndless=ScreenSelectCourse -NextScreenBattle=ScreenSelectMusic +NextScreenCpubattle=ScreenSelectMusic +NextScreenHumanbattle=ScreenSelectMusic NextScreenRave=ScreenSelectCharacter HelpText=Press START to continue TimerSeconds=15 @@ -645,19 +647,22 @@ PrevScreenArcade=ScreenTitleMenu PrevScreenNonstop=ScreenTitleMenu PrevScreenOni=ScreenTitleMenu PrevScreenEndless=ScreenTitleMenu -PrevScreenBattle=ScreenTitleMenu +PrevScreenCpubattle=ScreenTitleMenu +PrevScreenHumanbattle=ScreenTitleMenu PrevScreenRave=ScreenTitleMenu NextScreenArcade=ScreenStage NextScreenNonstop=ScreenStage NextScreenOni=ScreenStage NextScreenEndless=ScreenStage -NextScreenBattle=ScreenStage +NextScreenCpubattle=ScreenStage +NextScreenHumanbattle=ScreenStage NextScreenRave=ScreenStage NextOptionsScreenArcade=ScreenPlayerOptions NextOptionsScreenNonstop=ScreenPlayerOptions NextOptionsScreenOni=ScreenPlayerOptions NextOptionsScreenEndless=ScreenPlayerOptions -NextOptionsScreenBattle=ScreenPlayerOptions +NextOptionsScreenCpubattle=ScreenPlayerOptions +NextOptionsScreenHumanbattle=ScreenPlayerOptions NextOptionsScreenRave=ScreenRaveOptions [ScreenEz2SelectMusic] @@ -709,19 +714,22 @@ PrevScreenArcade=ScreenTitleMenu PrevScreenNonstop=ScreenTitleMenu PrevScreenOni=ScreenTitleMenu PrevScreenEndless=ScreenTitleMenu -PrevScreenBattle=ScreenTitleMenu +PrevScreenCpubattle=ScreenTitleMenu +PrevScreenHumanbattle=ScreenTitleMenu PrevScreenRave=ScreenTitleMenu NextScreenArcade=ScreenStage NextScreenNonstop=ScreenStage NextScreenOni=ScreenStage NextScreenEndless=ScreenStage -NextScreenBattle=ScreenStage +NextScreenCpubattle=ScreenStage +NextScreenHumanbattle=ScreenStage NextScreenRave=ScreenStage NextOptionsScreenArcade=ScreenPlayerOptions NextOptionsScreenNonstop=ScreenPlayerOptions NextOptionsScreenOni=ScreenPlayerOptions NextOptionsScreenEndless=ScreenPlayerOptions -NextOptionsScreenBattle=ScreenPlayerOptions +NextOptionsScreenCpubattle=ScreenPlayerOptions +NextOptionsScreenHumanbattle=ScreenPlayerOptions NextOptionsScreenRave=ScreenRaveOptions [ScreenSelectCourse] @@ -757,13 +765,15 @@ PrevScreenArcade=ScreenSelectMusic PrevScreenNonstop=ScreenSelectCourse PrevScreenOni=ScreenSelectCourse PrevScreenEndless=ScreenSelectCourse -PrevScreenBattle=ScreenSelectMusic +PrevScreenCpubattle=ScreenSelectMusic +PrevScreenHumanattle=ScreenSelectMusic PrevScreenRave=ScreenSelectMusic NextScreenArcade=ScreenEvaluationStage NextScreenNonstop=ScreenEvaluationNonstop NextScreenOni=ScreenEvaluationOni NextScreenEndless=ScreenEvaluationEndless -NextScreenBattle=ScreenEvaluationBattle +NextScreenCpubattle=ScreenEvaluationCpubattle +NextScreenHumanbattle=ScreenEvaluationHumanbattle NextScreenRave=ScreenEvaluationRave BPMX=999 // don't show by default BPMY=999 @@ -958,6 +968,7 @@ AutoPlayY=400 SecondsBetweenComments=10 DemonstrationSeconds=30 TickEarlySeconds=0.05 +ShowLifeMeterForDisabledPlayers=1 [ScreenEvaluation] BannerWidth=248 @@ -1474,7 +1485,38 @@ JudgeSoundTimeOK=-1 JudgeSoundTimeMaxCombo=-1 JudgeSoundIfJudgeGraphicsFullAlpha=0 -[ScreenEvaluationBattle] +[ScreenEvaluationCpubattle] +NextScreen=ScreenSelectMusic +EndScreen=ScreenEvaluationSummary +ShowBannerArea=1 +ShowGradeArea=1 +ShowPointsArea=0 +ShowBonusArea=0 +ShowSurvivedArea=0 +ShowWinArea=1 +ShowMarvelous=1 +ShowPerfect=1 +ShowGreat=1 +ShowGood=1 +ShowBoo=1 +ShowMiss=1 +ShowOK=1 +ShowMaxCombo=0 +ShowScoreArea=1 +ShowTimeArea=0 +HelpText=Press START to continue +TimerSeconds=15 +JudgeSoundTimeMarvelous=-1 +JudgeSoundTimePerfect=-1 +JudgeSoundTimeGreat=-1 +JudgeSoundTimeGood=-1 +JudgeSoundTimeBoo=-1 +JudgeSoundTimeMiss=-1 +JudgeSoundTimeOK=-1 +JudgeSoundTimeMaxCombo=-1 +JudgeSoundIfJudgeGraphicsFullAlpha=0 + +[ScreenEvaluationHumanbattle] NextScreen=ScreenSelectMusic EndScreen=ScreenEvaluationSummary ShowBannerArea=1 @@ -2110,13 +2152,15 @@ PrevScreenArcade=ScreenSelectMusic PrevScreenNonstop=ScreenSelectCourse PrevScreenOni=ScreenSelectCourse PrevScreenEndless=ScreenSelectCourse -PrevScreenBattle=ScreenSelectMusic +PrevScreenCpubattle=ScreenSelectMusic +PrevScreenHumanbattle=ScreenSelectMusic PrevScreenRave=ScreenSelectMusic NextScreenArcade=ScreenSongOptions NextScreenNonstop=ScreenSongOptions NextScreenOni=ScreenSongOptions NextScreenEndless=ScreenSongOptions -NextScreenBattle=ScreenSongOptions +NextScreenCpubattle=ScreenSongOptions +NextScreenHumanbattle=ScreenSongOptions NextScreenRave=ScreenSongOptions HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options START to accept changes TimerSeconds=30 @@ -2126,13 +2170,15 @@ PrevScreenArcade= // should never get here PrevScreenNonstop= // should never get here PrevScreenOni= // should never get here PrevScreenEndless= // should never get here -PrevScreenBattle= // should never get here +PrevScreenCpubattle= // should never get here +PrevScreenHumanbattle= // should never get here PrevScreenRave=ScreenSelectMusic NextScreenArcade= // should never get here NextScreenNonstop= // should never get here NextScreenOni= // should never get here NextScreenEndless= // should never get here -NextScreenBattle= // should never get here +NextScreenCpubattle= // should never get here +NextScreenHumanbattle= // should never get here NextScreenRave=ScreenSongOptions HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options START to accept changes TimerSeconds=30 @@ -2142,13 +2188,15 @@ PrevScreenArcade=ScreenPlayerOptions PrevScreenNonstop=ScreenPlayerOptions PrevScreenOni=ScreenPlayerOptions PrevScreenEndless=ScreenPlayerOptions -PrevScreenBattle=ScreenPlayerOptions +PrevScreenCpubattle=ScreenPlayerOptions +PrevScreenHumanbattle=ScreenPlayerOptions PrevScreenRave=ScreenRaveOptions NextScreenArcade=ScreenStage NextScreenNonstop=ScreenStage NextScreenOni=ScreenStage NextScreenEndless=ScreenStage -NextScreenBattle=ScreenStage +NextScreenCpubattle=ScreenStage +NextScreenHumanbattle=ScreenStage NextScreenRave=ScreenStage HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options START to accept changes Game=Change the current game type with this option. diff --git a/stepmania/src/BGAnimationLayer.cpp b/stepmania/src/BGAnimationLayer.cpp index f871805737..6d62e4e71a 100644 --- a/stepmania/src/BGAnimationLayer.cpp +++ b/stepmania/src/BGAnimationLayer.cpp @@ -26,6 +26,7 @@ #include "Sprite.h" #include "RageDisplay.h" #include "ActorUtil.h" +#include "StepMania.h" // for HOOKS const float PARTICLE_SPEED = 300; @@ -57,8 +58,8 @@ void BGAnimationLayer::Init() Unload(); m_fUpdateRate = 1; - m_fFOV = 0; // ortho - m_bLighting = 0; // ortho + m_fFOV = -1; // no change + m_bLighting = false; // m_bCycleColor = false; // m_bCycleAlpha = false; @@ -491,7 +492,9 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer ) } else if( sFile == "" ) { - RageException::Throw( "In the ini file for BGAnimation '%s', '%s' is missing a the line 'File='.", sAniDir.c_str(), sLayer.c_str() ); + if( DISPLAY->IsWindowed() ) + HOOKS->MessageBoxOK( ssprintf( + "In the ini file for BGAnimation '%s', '%s' is missing a the line 'File='.", sAniDir.c_str(), sLayer.c_str() ) ); } @@ -501,15 +504,18 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer ) vector asElementPaths; GetDirListing( sPath + "*", asElementPaths, false, true ); if(asElementPaths.size() == 0) - RageException::Throw( "In the ini file for BGAnimation '%s', the specified File '%s' does not exist.", sAniDir.c_str(), sFile.c_str() ); + { + if( DISPLAY->IsWindowed() ) + HOOKS->MessageBoxOK( ssprintf("In the ini file for BGAnimation '%s', the specified File '%s' does not exist.", sAniDir.c_str(), sFile.c_str()) ); + return; + } if(asElementPaths.size() > 1) { - CString message = ssprintf( - "There is more than one file that matches " - "'%s/%s'. Please remove all but one of these matches.", - sAniDir.c_str(), sFile.c_str() ); - - RageException::Throw( message ); + if( DISPLAY->IsWindowed() ) + HOOKS->MessageBoxOK( ssprintf( + "There is more than one file that matches " + "'%s/%s'. Please remove all but one of these matches.", + sAniDir.c_str(), sFile.c_str() ) ); } sPath = asElementPaths[0]; } @@ -903,14 +909,16 @@ void BGAnimationLayer::Update( float fDeltaTime ) void BGAnimationLayer::Draw() { - DISPLAY->LoadMenuPerspective( m_fFOV ); + float fLastFOV = DISPLAY->GetMenuPerspectiveFOV(); + if( m_fFOV != -1 ) + DISPLAY->LoadMenuPerspective( m_fFOV ); if( m_bLighting ) { DISPLAY->SetLighting( true ); DISPLAY->SetLightDirectional( 0, - RageColor(0.6,0.6,0.6,1), - RageColor(0.9,0.9,0.9,1), + RageColor(0.6f,0.6f,0.6f,1), + RageColor(0.9f,0.9f,0.9f,1), RageColor(0,0,0,1), RageVector3(0, 0, 1) ); } @@ -918,7 +926,8 @@ void BGAnimationLayer::Draw() for( unsigned i=0; iDraw(); - DISPLAY->LoadMenuPerspective( 0 ); + if( m_fFOV != -1 ) + DISPLAY->LoadMenuPerspective( fLastFOV ); if( m_bLighting ) { DISPLAY->SetLightOff( 0 ); diff --git a/stepmania/src/BGAnimationLayer.h b/stepmania/src/BGAnimationLayer.h index 865c8bc86b..21d1085e47 100644 --- a/stepmania/src/BGAnimationLayer.h +++ b/stepmania/src/BGAnimationLayer.h @@ -97,7 +97,7 @@ protected: // common stuff CString m_sCommand; float m_fUpdateRate; // get by GainingFocus - float m_fFOV; + float m_fFOV; // -1 = no change bool m_bLighting; // stretch stuff diff --git a/stepmania/src/CombinedLifeMeterEnemy.cpp b/stepmania/src/CombinedLifeMeterEnemy.cpp index 44f205d6f2..887b9d14c8 100644 --- a/stepmania/src/CombinedLifeMeterEnemy.cpp +++ b/stepmania/src/CombinedLifeMeterEnemy.cpp @@ -27,18 +27,36 @@ const float SECONDS_TO_SHOW_FACE = 1.5f; +#define FACE_X THEME->GetMetricF("CombinedLifeMeterEnemy","FaceX") +#define FACE_Y THEME->GetMetricF("CombinedLifeMeterEnemy","FaceY") +#define HEALTH_X THEME->GetMetricF("CombinedLifeMeterEnemy","HealthX") +#define HEALTH_Y THEME->GetMetricF("CombinedLifeMeterEnemy","HealthY") +#define FRAME_X THEME->GetMetricF("CombinedLifeMeterEnemy","FrameX") +#define FRAME_Y THEME->GetMetricF("CombinedLifeMeterEnemy","FrameY") + + CombinedLifeMeterEnemy::CombinedLifeMeterEnemy() { m_sprFace.Load( THEME->GetPathToG("CombinedLifeMeterEnemy face 2x3") ); ASSERT( m_sprFace.GetNumStates() >= NUM_FACES ); m_sprFace.StopAnimating(); + m_sprFace.SetXY( FACE_X, FACE_Y ); this->AddChild( &m_sprFace ); - m_meterHealth.Load( THEME->GetPathToG("CombinedLifeMeterEnemy stream"), 464 ); + m_sprHealthBackground.Load( THEME->GetPathToG("CombinedLifeMeterEnemy health background") ); + m_sprHealthBackground.SetXY( HEALTH_X, HEALTH_Y ); + this->AddChild( &m_sprHealthBackground ); + + m_sprHealthStream.Load( THEME->GetPathToG("CombinedLifeMeterEnemy health stream") ); + m_sprHealthStream.SetXY( HEALTH_X, HEALTH_Y ); + m_sprHealthStream.SetTexCoordVelocity(-0.2f,0.5f); + this->AddChild( &m_sprHealthStream ); + m_fLastSeenHealthPercent = -1; - this->AddChild( &m_meterHealth ); m_sprFrame.Load( THEME->GetPathToG("CombinedLifeMeterEnemy frame") ); + m_sprFrame.SetName( "Frame" ); + m_sprFrame.SetXY( FRAME_X, FRAME_Y ); this->AddChild( &m_sprFrame ); } @@ -53,17 +71,28 @@ void CombinedLifeMeterEnemy::Update( float fDelta ) if( m_fSecondsUntilReturnToNormalFace < 0 ) { m_fSecondsUntilReturnToNormalFace = 0; - this->SetState( normal ); + m_sprFace.SetState( normal ); } } if( GAMESTATE->m_fOpponentHealthPercent == 0 ) - this->SetState( defeated ); + { + m_sprFace.SetState( defeated ); + } if( m_fLastSeenHealthPercent != GAMESTATE->m_fOpponentHealthPercent ) { - m_meterHealth.SetPercent( GAMESTATE->m_fOpponentHealthPercent ); + m_sprHealthStream.SetGlow( RageColor(1,1,1,1) ); + m_sprHealthStream.BeginTweening( 0.5f, TWEEN_DECELERATE ); + m_sprHealthStream.SetCropRight( 1-GAMESTATE->m_fOpponentHealthPercent ); + m_sprHealthStream.SetGlow( RageColor(1,1,1,0) ); m_fLastSeenHealthPercent = GAMESTATE->m_fOpponentHealthPercent; + + if( GAMESTATE->m_fOpponentHealthPercent == 0 ) + { + m_sprFrame.BeginTweening( 0.5f ); + m_sprFrame.SetDiffuse( RageColor(0.5f,0.5f,0.5f,1) ); + } } diff --git a/stepmania/src/CombinedLifeMeterEnemy.h b/stepmania/src/CombinedLifeMeterEnemy.h index 64f625e4cc..ab11eaae88 100644 --- a/stepmania/src/CombinedLifeMeterEnemy.h +++ b/stepmania/src/CombinedLifeMeterEnemy.h @@ -35,7 +35,8 @@ public: virtual bool FailedEarlier( PlayerNumber pn ) { return false; }; protected: - MeterDisplay m_meterHealth; + Sprite m_sprHealthStream; + Sprite m_sprHealthBackground; float m_fLastSeenHealthPercent; Sprite m_sprFace; diff --git a/stepmania/src/GameConstantsAndTypes.cpp b/stepmania/src/GameConstantsAndTypes.cpp index bf9a22d780..29d28cf2b8 100644 --- a/stepmania/src/GameConstantsAndTypes.cpp +++ b/stepmania/src/GameConstantsAndTypes.cpp @@ -67,13 +67,14 @@ CString PlayModeToString( PlayMode pm ) { switch( pm ) { - case PLAY_MODE_ARCADE: return "arcade"; - case PLAY_MODE_ONI: return "oni"; - case PLAY_MODE_NONSTOP: return "nonstop"; - case PLAY_MODE_ENDLESS: return "endless"; - case PLAY_MODE_BATTLE: return "battle"; - case PLAY_MODE_RAVE: return "rave"; - default: ASSERT(0); return ""; + case PLAY_MODE_ARCADE: return "arcade"; + case PLAY_MODE_ONI: return "oni"; + case PLAY_MODE_NONSTOP: return "nonstop"; + case PLAY_MODE_ENDLESS: return "endless"; + case PLAY_MODE_HUMAN_BATTLE: return "humanbattle"; + case PLAY_MODE_CPU_BATTLE: return "cpubattle"; + case PLAY_MODE_RAVE: return "rave"; + default: ASSERT(0); return ""; } } diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index 2dde07cae3..e9a1f70f19 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -90,7 +90,8 @@ enum PlayMode PLAY_MODE_NONSTOP, // DDR EX Nonstop PLAY_MODE_ONI, // DDR EX Challenge PLAY_MODE_ENDLESS, // DDR PlayStation Endless - PLAY_MODE_BATTLE, // inventory battle + PLAY_MODE_CPU_BATTLE, // inventory battle vs non-player CPU + PLAY_MODE_HUMAN_BATTLE, // inventory battle vs human player or CPU-controlled player PLAY_MODE_RAVE, // DDR Disney Rave "Dance Magic" NUM_PLAY_MODES, PLAY_MODE_INVALID diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 05eb721baa..9c5c2b8cb0 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -301,6 +301,11 @@ bool GameState::IsPlayerEnabled( PlayerNumber pn ) if( m_PlayMode == PLAY_MODE_RAVE ) return true; + // In cpu battle, show cpu player only if there's room on the screen. + if( m_PlayMode == PLAY_MODE_CPU_BATTLE ) + if( GetCurrentStyleDef()->m_StyleType == StyleDef::ONE_PLAYER_ONE_CREDIT ) + return true; + return IsHumanPlayer( pn ); } @@ -401,7 +406,8 @@ StageResult GameState::GetStageResult( PlayerNumber pn ) { switch( GAMESTATE->m_PlayMode ) { - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: return (m_fOpponentHealthPercent==0)?RESULT_WIN:RESULT_LOSE; case PLAY_MODE_RAVE: switch( pn ) @@ -489,11 +495,14 @@ void GameState::LaunchAttack( PlayerNumber target, Attack a ) void GameState::RemoveAllActiveAttacks() { for( int p=0; pm_PlayMode ) + { + case PLAY_MODE_CPU_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + break; + default: + ASSERT(0); + } } Inventory::~Inventory() @@ -75,8 +83,10 @@ void Inventory::Load( PlayerNumber pn ) m_iLastSeenCombo = 0; // don't load battle sounds if they're not going to be used - if( GAMESTATE->m_PlayMode == PLAY_MODE_BATTLE ) + switch( GAMESTATE->m_PlayMode ) { + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: m_soundAcquireItem.Load( THEME->GetPathToS("Inventory aquire item") ); for( unsigned i=0; iGetPathToS("Inventory item ending") ); + break; } } void Inventory::Update( float fDelta ) { - if( GAMESTATE->m_PlayMode != PLAY_MODE_BATTLE ) - return; - if( GAMESTATE->m_bActiveAttackEndedThisUpdate[m_PlayerNumber] ) m_soundItemEnding.Play(); @@ -145,6 +153,12 @@ void Inventory::Update( float fDelta ) void Inventory::AwardItem( int iItemIndex ) { + // CPU player is vanity only. It should have no effect on gameplay + // and should not aquire/launch attacks. + if( GAMESTATE->IsCpuPlayer(m_PlayerNumber) ) + return; + + // search for the first open slot int iOpenSlot = -1; @@ -181,20 +195,26 @@ void Inventory::UseItem( int iSlot ) if( asInventory[iSlot].IsBlank() ) return; -// PlayerNumber pnToAttack = OPPOSITE_PLAYER[m_PlayerNumber]; + PlayerNumber pnToAttack = OPPOSITE_PLAYER[m_PlayerNumber]; GameState::Attack a = asInventory[iSlot]; -// GAMESTATE->LaunchAttack( pnToAttack, a ); -// GAMESTATE->RebuildPlayerOptionsFromActiveAttacks( pnToAttack ); + // remove the item + asInventory[iSlot].MakeBlank(); + m_vpSoundUseItem[a.level]->Play(); + + + // Item has no effect if CPU is already dead + if( GAMESTATE->m_PlayMode == PLAY_MODE_CPU_BATTLE && GAMESTATE->m_fOpponentHealthPercent==0 ) + return; + + + GAMESTATE->LaunchAttack( pnToAttack, a ); float fPercentHealthToDrain = (a.level+1) / 10.f; ASSERT( fPercentHealthToDrain > 0 ); GAMESTATE->m_fOpponentHealthPercent -= fPercentHealthToDrain; CLAMP( GAMESTATE->m_fOpponentHealthPercent, 0.f, 1.f ); - // remove the item - asInventory[iSlot].MakeBlank(); - m_vpSoundUseItem[a.level]->Play(); - + // play announcer sound SCREENMAN->SendMessageToTopScreen( (ScreenMessage)(SM_BattleDamageLevel1+a.level) ); } diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index d7c1160b12..3a63d17b76 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -365,7 +365,8 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelItemDatas switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: { if( so == SORT_SORT ) diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index 933e0840fa..74557e22ed 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -415,9 +415,16 @@ void RageDisplay::LoadIdentity() g_ModelViewStack.LoadIdentity(); } +float g_fLastMenuPerspectiveFOV = -1; +float RageDisplay::GetMenuPerspectiveFOV() +{ + return g_fLastMenuPerspectiveFOV; +} void RageDisplay::LoadMenuPerspective(float fovDegrees) { + g_fLastMenuPerspectiveFOV = fovDegrees; + /* fovDegrees == 0 looks the same as an ortho projection. However, * we don't want to mess with the ModelView stack because * EnterPerspectiveMode's preserve location feature expectes there diff --git a/stepmania/src/RageDisplay.h b/stepmania/src/RageDisplay.h index 4d14dc4ee9..f75ba143af 100644 --- a/stepmania/src/RageDisplay.h +++ b/stepmania/src/RageDisplay.h @@ -218,6 +218,7 @@ public: void PostMultMatrix( const RageMatrix &f ); void PreMultMatrix( const RageMatrix &f ); void LoadIdentity(); + float GetMenuPerspectiveFOV(); void LoadMenuPerspective(float fovDegrees); void EnterPerspective(float fov, bool preserve_loc = true, float znear = 1, float zfar = 1000); void ExitPerspective(); diff --git a/stepmania/src/ScoreKeeperMAX2.cpp b/stepmania/src/ScoreKeeperMAX2.cpp index 51f77e77c5..a0da54be39 100644 --- a/stepmania/src/ScoreKeeperMAX2.cpp +++ b/stepmania/src/ScoreKeeperMAX2.cpp @@ -30,7 +30,8 @@ ScoreKeeperMAX2::ScoreKeeperMAX2( const vector& apNotes_, PlayerNumber p switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: { ASSERT( !apNotes.empty() ); @@ -324,7 +325,8 @@ void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTa switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: case PLAY_MODE_NONSTOP: case PLAY_MODE_ENDLESS: @@ -455,7 +457,8 @@ int ScoreKeeperMAX2::TapNoteScoreToDancePoints( TapNoteScore tns ) switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: case PLAY_MODE_ENDLESS: case PLAY_MODE_NONSTOP: @@ -491,7 +494,8 @@ int ScoreKeeperMAX2::HoldNoteScoreToDancePoints( HoldNoteScore hns ) switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: case PLAY_MODE_ENDLESS: case PLAY_MODE_NONSTOP: diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index 027e2d6fc6..525f23b5ce 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -309,7 +309,8 @@ Screen* Screen::Create( CString sClassName ) IF_RETURN( ScreenEvaluationNonstop ); IF_RETURN( ScreenEvaluationOni ); IF_RETURN( ScreenEvaluationEndless ); - IF_RETURN( ScreenEvaluationBattle ); + IF_RETURN( ScreenEvaluationCpubattle ); + IF_RETURN( ScreenEvaluationHumanbattle ); IF_RETURN( ScreenEvaluationRave ); IF_RETURN( ScreenEz2SelectPlayer ); IF_RETURN( ScreenGameOver ); diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index 779a0d7fb2..0b4e7762ba 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -687,7 +687,8 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type ) : Screen(sCl case stage: switch( GAMESTATE->m_PlayMode ) { - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: { bool bWon = GAMESTATE->GetStageResult(GAMESTATE->m_MasterPlayerNumber) == RESULT_WIN; if( bWon ) diff --git a/stepmania/src/ScreenEvaluation.h b/stepmania/src/ScreenEvaluation.h index 97778701a8..1086d0140d 100644 --- a/stepmania/src/ScreenEvaluation.h +++ b/stepmania/src/ScreenEvaluation.h @@ -133,10 +133,16 @@ public: ScreenEvaluationEndless() : ScreenEvaluation("ScreenEvaluationEndless",ScreenEvaluation::course) {}; }; -class ScreenEvaluationBattle : public ScreenEvaluation +class ScreenEvaluationCpubattle : public ScreenEvaluation { public: - ScreenEvaluationBattle() : ScreenEvaluation("ScreenEvaluationBattle",ScreenEvaluation::stage) {}; + ScreenEvaluationCpubattle() : ScreenEvaluation("ScreenEvaluationCpubattle",ScreenEvaluation::stage) {}; +}; + +class ScreenEvaluationHumanbattle : public ScreenEvaluation +{ +public: + ScreenEvaluationHumanbattle() : ScreenEvaluation("ScreenEvaluationHumanbattle",ScreenEvaluation::stage) {}; }; class ScreenEvaluationRave : public ScreenEvaluation diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index df452e4151..b2ac808a48 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -40,12 +40,14 @@ #include "RageTextureManager.h" #include "CombinedLifeMeterEnemy.h" #include "CombinedLifeMeterTug.h" +#include "Inventory.h" // // Defines // -#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 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") CachedThemeMetricF SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBetweenComments"); CachedThemeMetricF G_TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds"); @@ -113,7 +115,8 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") switch( GAMESTATE->m_PlayMode ) { - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: { // cache NoteSkin graphics @@ -239,11 +242,14 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") m_TimingAssist.Load((PlayerNumber)p, &m_Player[p]); - if( GAMESTATE->m_PlayMode == PLAY_MODE_BATTLE ) + switch( GAMESTATE->m_PlayMode ) { + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: m_ActiveItemList[p].Init( (PlayerNumber)p ); /* Position it in LoadNextSong. */ this->AddChild( &m_ActiveItemList[p] ); + break; } m_sprOniGameOver[p].Load( THEME->GetPathToG("ScreenGameplay oni gameover") ); @@ -274,14 +280,51 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") SET_XY( m_sprLifeFrame ); this->AddChild( &m_sprLifeFrame ); + // + // 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 + // switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: case PLAY_MODE_ONI: case PLAY_MODE_NONSTOP: case PLAY_MODE_ENDLESS: + case PLAY_MODE_CPU_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: for( p=0; pm_PlayMode == PLAY_MODE_CPU_BATTLE && + GAMESTATE->IsCpuPlayer(p) ) + continue; // skip + + if( !GAMESTATE->IsPlayerEnabled(p) && !SHOW_LIFE_METER_FOR_DISABLED_PLAYERS ) + continue; // skip + switch( GAMESTATE->m_SongOptions.m_LifeType ) { case SongOptions::LIFE_BAR: @@ -300,23 +343,6 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") this->AddChild( m_pLifeMeter[p] ); } break; - case PLAY_MODE_BATTLE: - case PLAY_MODE_RAVE: - switch( GAMESTATE->m_PlayMode ) - { - case PLAY_MODE_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; } @@ -338,7 +364,8 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: m_sprStage.Load( THEME->GetPathToG("ScreenGameplay stage "+GAMESTATE->GetStageText()) ); this->AddChild( &m_sprStage ); @@ -386,7 +413,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") for( p=0; pIsPlayerEnabled(PlayerNumber(p)) ) + if( !GAMESTATE->IsPlayerEnabled(p) ) continue; switch( GAMESTATE->m_PlayMode ) @@ -399,7 +426,14 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") case PLAY_MODE_ENDLESS: m_pScoreDisplay[p] = new ScoreDisplayOni; break; - case PLAY_MODE_BATTLE: + 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: m_pScoreDisplay[p] = new ScoreDisplayBattle; break; case PLAY_MODE_RAVE: @@ -413,7 +447,13 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") m_pScoreDisplay[p]->SetName( ssprintf("ScoreP%d%s",p+1,bExtra?"Extra":"") ); SET_XY( *m_pScoreDisplay[p] ); this->AddChild( m_pScoreDisplay[p] ); - + } + + for( p=0; pIsPlayerEnabled(p) ) + continue; + m_textPlayerOptions[p].LoadFromFont( THEME->GetPathToF("Common normal") ); m_textPlayerOptions[p].EnableShadow( false ); m_textPlayerOptions[p].SetName( ssprintf("PlayerOptionsP%d%s",p+1,bExtra?"Extra":"") ); @@ -458,10 +498,14 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") for( p=0; pm_PlayMode==PLAY_MODE_BATTLE ) + switch( GAMESTATE->m_PlayMode ) { - m_Inventory[p].Load( (PlayerNumber)p ); - this->AddChild( &m_Inventory[p] ); + 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; } } @@ -489,7 +533,8 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") // only load if we're going to use it switch( GAMESTATE->m_PlayMode ) { - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: for( p=0; pGetPathTo("gameplay combo stopped") ); m_soundAssistTick.Load( THEME->GetPathToS("ScreenGameplay assist tick") ); - if( GAMESTATE->m_PlayMode == PLAY_MODE_BATTLE ) + switch( GAMESTATE->m_PlayMode ) { + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: 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") ); @@ -573,6 +620,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") 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") ); + break; } } @@ -591,6 +639,7 @@ ScreenGameplay::~ScreenGameplay() SAFE_DELETE( m_pScoreDisplay[p] ); SAFE_DELETE( m_pPrimaryScoreKeeper[p] ); SAFE_DELETE( m_pSecondaryScoreKeeper[p] ); + SAFE_DELETE( m_pInventory[p] ); } SAFE_DELETE( m_pCombinedLifeMeter ); @@ -658,7 +707,7 @@ void ScreenGameplay::LoadNextSong() NoteData pNewNoteData; pStyleDef->GetTransformedNoteDataForStyle( (PlayerNumber)p, &pOriginalNoteData, &pNewNoteData ); - m_Player[p].Load( (PlayerNumber)p, &pNewNoteData, m_pLifeMeter[p], m_pCombinedLifeMeter, m_pScoreDisplay[p], &m_Inventory[p], m_pPrimaryScoreKeeper[p], m_pSecondaryScoreKeeper[p] ); + m_Player[p].Load( (PlayerNumber)p, &pNewNoteData, m_pLifeMeter[p], m_pCombinedLifeMeter, m_pScoreDisplay[p], m_pInventory[p], m_pPrimaryScoreKeeper[p], m_pSecondaryScoreKeeper[p] ); if( m_bDemonstration ) { GAMESTATE->m_PlayerController[p] = PC_CPU; @@ -1004,6 +1053,34 @@ void ScreenGameplay::Update( float fDeltaTime ) ASSERT(0); } + + // + // 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 ) + { + GAMESTATE->RemoveAllActiveAttacks(); + + for( int p=0; pIsCpuPlayer(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; + + // // Check to see if it's time to play a ScreenGameplay comment // @@ -1013,7 +1090,8 @@ void ScreenGameplay::Update( float fDeltaTime ) switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: if( OneIsHot() ) m_announcerHot.PlayRandom(); else if( AllAreInDanger() ) m_announcerDanger.PlayRandom(); @@ -1036,11 +1114,16 @@ void ScreenGameplay::Update( float fDeltaTime ) m_soundAssistTick.Play(); - // launch battle attacks - - if( GAMESTATE->m_PlayMode == PLAY_MODE_BATTLE ) + // + // launch enemy attacks to human players + // + switch( GAMESTATE->m_PlayMode ) { -#define CROSSED_SONG_SECONDS( s ) ((GAMESTATE->m_fMusicSeconds-fDeltaTime) < s && (GAMESTATE->m_fMusicSeconds) >= s ) + case PLAY_MODE_CPU_BATTLE: + + // Don't apply any attacks if the enemy is already defeated + if( GAMESTATE->m_fOpponentHealthPercent==0 ) + break; static const CString sPossibleModifiers[NUM_ATTACK_LEVELS][3] = { @@ -1061,6 +1144,8 @@ void ScreenGameplay::Update( float fDeltaTime ) } }; +#define CROSSED_SONG_SECONDS( s ) ((GAMESTATE->m_fMusicSeconds-fDeltaTime) < s && (GAMESTATE->m_fMusicSeconds) >= s ) + if( CROSSED_SONG_SECONDS(20) || CROSSED_SONG_SECONDS(40) ) { GameState::Attack a; @@ -1068,7 +1153,7 @@ void ScreenGameplay::Update( float fDeltaTime ) a.level = ATTACK_LEVEL_1; a.sModifier = sPossibleModifiers[a.level][rand()%3]; for( int p=0; pIsPlayerEnabled(p) ) + if( GAMESTATE->IsHumanPlayer(p) ) GAMESTATE->LaunchAttack( (PlayerNumber)p, a ); this->HandleScreenMessage( SM_BattleTrickLevel1 ); } @@ -1079,7 +1164,7 @@ void ScreenGameplay::Update( float fDeltaTime ) a.level = ATTACK_LEVEL_2; a.sModifier = sPossibleModifiers[a.level][rand()%3]; for( int p=0; pIsPlayerEnabled(p) ) + if( GAMESTATE->IsHumanPlayer(p) ) GAMESTATE->LaunchAttack( (PlayerNumber)p, a ); this->HandleScreenMessage( SM_BattleTrickLevel2 ); } @@ -1090,10 +1175,11 @@ void ScreenGameplay::Update( float fDeltaTime ) a.level = ATTACK_LEVEL_3; a.sModifier = sPossibleModifiers[a.level][rand()%3]; for( int p=0; pIsPlayerEnabled(p) ) + if( GAMESTATE->IsHumanPlayer(p) ) GAMESTATE->LaunchAttack( (PlayerNumber)p, a ); this->HandleScreenMessage( SM_BattleTrickLevel3 ); } + break; } } @@ -1279,7 +1365,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ } if( iItemSlot != -1 ) - m_Inventory[MenuI.player].UseItem( iItemSlot ); + m_pInventory[MenuI.player]->UseItem( iItemSlot ); } } @@ -1308,7 +1394,8 @@ void SaveChanges() switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: GAMESTATE->m_pCurSong->Save(); break; @@ -1331,7 +1418,8 @@ void DontSaveChanges() switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: GAMESTATE->m_pCurSong->RevertFromDisk(); break; @@ -1358,7 +1446,8 @@ void ShowSavePrompt( ScreenMessage SM_SendWhenDone ) switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: sMessage = ssprintf( "You have changed the offset or BPM of\n" @@ -1483,7 +1572,8 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) switch( GAMESTATE->m_PlayMode ) { - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: { PlayerNumber winner = GAMESTATE->GetWinner(); @@ -1719,7 +1809,8 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: if( PREFSMAN->m_bEventMode ) HandleScreenMessage( SM_GoToScreenAfterBack ); @@ -1759,7 +1850,8 @@ void ScreenGameplay::TweenOnScreen() if( !GAMESTATE->IsPlayerEnabled(p) ) continue; ON_COMMAND( m_textCourseSongNumber[p] ); - ON_COMMAND( *m_pScoreDisplay[p] ); + if( m_pScoreDisplay[p] ) + ON_COMMAND( *m_pScoreDisplay[p] ); ON_COMMAND( m_textPlayerOptions[p] ); ON_COMMAND( m_DifficultyIcon[p] ); } @@ -1780,7 +1872,8 @@ void ScreenGameplay::TweenOffScreen() if( !GAMESTATE->IsPlayerEnabled(p) ) continue; OFF_COMMAND( m_textCourseSongNumber[p] ); - OFF_COMMAND( *m_pScoreDisplay[p] ); + if( m_pScoreDisplay[p] ) + OFF_COMMAND( *m_pScoreDisplay[p] ); OFF_COMMAND( m_textPlayerOptions[p] ); OFF_COMMAND( m_DifficultyIcon[p] ); } diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index eb15791199..877f21ba3c 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -24,7 +24,7 @@ #include "ScoreDisplay.h" #include "DifficultyIcon.h" #include "BPMDisplay.h" -#include "Inventory.h" +class Inventory; #include "ActiveItemList.h" //#include "BeginnerHelper.h" // uncomment once it's checked in #include "LyricDisplay.h" @@ -144,7 +144,7 @@ protected: Player m_Player[NUM_PLAYERS]; // used in PLAY_MODE_BATTLE - Inventory m_Inventory[NUM_PLAYERS]; + Inventory* m_pInventory[NUM_PLAYERS]; ActiveItemList m_ActiveItemList[NUM_PLAYERS]; DifficultyIcon m_DifficultyIcon[NUM_PLAYERS]; diff --git a/stepmania/src/ScreenNameEntry.cpp b/stepmania/src/ScreenNameEntry.cpp index 58fa70a3f1..2ce93a26b8 100644 --- a/stepmania/src/ScreenNameEntry.cpp +++ b/stepmania/src/ScreenNameEntry.cpp @@ -193,7 +193,8 @@ ScreenNameEntry::ScreenNameEntry() : Screen("ScreenNameEntry") switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: { StageStats SS; @@ -404,7 +405,8 @@ void ScreenNameEntry::MenuStart( PlayerNumber pn ) switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_BATTLE: + case PLAY_MODE_HUMAN_BATTLE: + case PLAY_MODE_CPU_BATTLE: case PLAY_MODE_RAVE: SONGMAN->m_MachineScores[GAMESTATE->m_RankingNotesType][GAMESTATE->m_RankingCategory[pn]][GAMESTATE->m_iRankingIndex[pn]].sName = m_sSelectedName[pn]; break; diff --git a/stepmania/src/ScreenSelect.cpp b/stepmania/src/ScreenSelect.cpp index 55c7a8fc7d..595eaa503f 100644 --- a/stepmania/src/ScreenSelect.cpp +++ b/stepmania/src/ScreenSelect.cpp @@ -24,6 +24,8 @@ #include "GameConstantsAndTypes.h" #include "ThemeManager.h" #include "ModeChoice.h" +#include "RageDisplay.h" +#include "StepMania.h" #define CHOICES THEME->GetMetric (m_sName,"Choices") @@ -97,7 +99,10 @@ ScreenSelect::ScreenSelect( CString sClassName ) : Screen(sClassName) continue; } - LOG->Warn( "The choice token '%s' is not recognized as a Game, Style, PlayMode, or Difficulty. The choice containing this token will be ignored.", sBit.c_str() ); + CString sError = ssprintf( "The choice token '%s' is not recognized as a Game, Style, PlayMode, or Difficulty. The choice containing this token will be ignored.", sBit.c_str() ); + LOG->Warn( sError ); + if( DISPLAY->IsWindowed() ) + HOOKS->MessageBoxOK( sError ); bChoiceIsInvalid |= true; } diff --git a/stepmania/src/ScreenSelectDifficulty.cpp b/stepmania/src/ScreenSelectDifficulty.cpp index ffa9dc39e8..bc84a0ee3d 100644 --- a/stepmania/src/ScreenSelectDifficulty.cpp +++ b/stepmania/src/ScreenSelectDifficulty.cpp @@ -86,7 +86,7 @@ ScreenSelectDifficulty::ScreenSelectDifficulty() : ScreenSelect( "ScreenSelectDi CLAMP( m_iChoiceOnPage[p], 0, (int)m_ModeChoices[0].size()-1 ); m_bChosen[p] = false; - if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) ) + if( !GAMESTATE->IsHumanPlayer(p) ) continue; m_sprShadow[p].SetName( "Shadow" ); @@ -203,8 +203,11 @@ void ScreenSelectDifficulty::MenuRight( PlayerNumber pn ) // return; if( m_bChosen[pn] ) return; - if( m_iChoiceOnPage[pn] == (int)m_ModeChoices[m_CurrentPage].size()-1 ) // can't go left any more + if( m_iChoiceOnPage[pn] == (int)m_ModeChoices[m_CurrentPage].size()-1 ) // can't go right any more { + if( m_ModeChoices[m_CurrentPage+1].size()==0 ) // there is no page 2 + return; + if( m_CurrentPage < NUM_PAGES-1 ) ChangePage( (Page)(m_CurrentPage+1) ); } diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 623a617a31..4d91b942f7 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -155,7 +155,6 @@ ScreenSelectMusic::ScreenSelectMusic() : Screen("ScreenSelectMusic") m_sprDifficultyFrame[p].SetName( ssprintf("DifficultyFrameP%d",p+1) ); m_sprDifficultyFrame[p].Load( THEME->GetPathToG(ssprintf("ScreenSelectMusic difficulty frame p%d",p+1)) ); m_sprDifficultyFrame[p].StopAnimating(); - m_sprDifficultyFrame[p].SetState( p ); this->AddChild( &m_sprDifficultyFrame[p] ); m_DifficultyIcon[p].SetName( ssprintf("DifficultyIconP%d",p+1) ); diff --git a/stepmania/src/StepMania.RC b/stepmania/src/StepMania.RC index fc1368ecab..6a181a5fb1 100644 --- a/stepmania/src/StepMania.RC +++ b/stepmania/src/StepMania.RC @@ -1,4 +1,4 @@ -// Microsoft Visual C++ generated resource script. +//Microsoft Developer Studio generated resource script. // #include "resource.h" @@ -26,8 +26,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Dialog // -IDD_ERROR_DIALOG DIALOG 0, 0, 332, 234 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION +IDD_ERROR_DIALOG DIALOG DISCARDABLE 0, 0, 332, 234 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION CAPTION "StepMania Error" FONT 8, "MS Sans Serif" BEGIN @@ -42,8 +42,8 @@ BEGIN IDC_STATIC,7,46,298,28 END -IDD_LOADING_DIALOG DIALOG 0, 0, 312, 82 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE +IDD_LOADING_DIALOG DIALOG DISCARDABLE 0, 0, 312, 82 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE FONT 8, "MS Sans Serif" BEGIN CONTROL 117,IDC_STATIC,"Static",SS_BITMAP,0,0,312,38 @@ -52,8 +52,8 @@ BEGIN CTEXT "line3",IDC_STATIC_MESSAGE3,0,65,310,10,SS_CENTERIMAGE END -IDD_DISASM_CRASH DIALOG 0, 0, 399, 271 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION +IDD_DISASM_CRASH DIALOG DISCARDABLE 0, 0, 399, 271 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION CAPTION "StepMania Error" FONT 8, "MS Sans Serif" BEGIN @@ -80,16 +80,15 @@ BEGIN LTEXT "Estimated call stack",IDC_STATIC,7,184,64,8 END -IDD_OK DIALOGEX 0, 0, 318, 74 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | - WS_CAPTION +IDD_OK DIALOG DISCARDABLE 0, 0, 318, 87 +STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION CAPTION "StepMania" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 +FONT 8, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "OK",IDOK,131,53,50,14 + DEFPUSHBUTTON "OK",IDOK,131,66,50,14 CONTROL "&Don't display this message",IDC_HUSH,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,211,56,100,10 - EDITTEXT IDC_MESSAGE,7,7,304,40,ES_CENTER | ES_MULTILINE | + BS_AUTOCHECKBOX | WS_TABSTOP,211,67,100,10 + EDITTEXT IDC_MESSAGE,7,7,304,55,ES_CENTER | ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | WS_VSCROLL END @@ -101,7 +100,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO +GUIDELINES DESIGNINFO MOVEABLE PURE BEGIN IDD_LOADING_DIALOG, DIALOG BEGIN @@ -124,7 +123,7 @@ BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 311 TOPMARGIN, 7 - BOTTOMMARGIN, 67 + BOTTOMMARGIN, 80 END END #endif // APSTUDIO_INVOKED @@ -136,18 +135,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include ""afxres.h""\r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -163,8 +162,9 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_ICON ICON "StepMania.ICO" +IDI_ICON ICON DISCARDABLE "StepMania.ICO" +#ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // // Version @@ -187,14 +187,14 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "CompanyName", "http://www.stepmania.com" - VALUE "FileDescription", "StepMania" - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "StepMania" - VALUE "LegalCopyright", "Copyright © 2001-2002" - VALUE "OriginalFilename", "StepMania.exe" - VALUE "ProductName", " StepMania" - VALUE "ProductVersion", "1, 0, 0, 1" + VALUE "CompanyName", "http://www.stepmania.com\0" + VALUE "FileDescription", "StepMania\0" + VALUE "FileVersion", "1, 0, 0, 1\0" + VALUE "InternalName", "StepMania\0" + VALUE "LegalCopyright", "Copyright © 2001-2002\0" + VALUE "OriginalFilename", "StepMania.exe\0" + VALUE "ProductName", " StepMania\0" + VALUE "ProductVersion", "1, 0, 0, 1\0" END END BLOCK "VarFileInfo" @@ -203,15 +203,17 @@ BEGIN END END +#endif // !_MAC + ///////////////////////////////////////////////////////////////////////////// // // Bitmap // -BITMAP_ERROR BITMAP "error.bmp" -BITMAP_LOADING BITMAP "loading.bmp" -BITMAP_CRASH BITMAP "error2.bmp" +BITMAP_ERROR BITMAP MOVEABLE PURE "error.bmp" +BITMAP_LOADING BITMAP MOVEABLE PURE "loading.bmp" +BITMAP_CRASH BITMAP MOVEABLE PURE "error2.bmp" #endif // English (U.S.) resources /////////////////////////////////////////////////////////////////////////////