Change Nonstop scoring to the DDREX way
Clean up ScreenGameplay by having a Song and Notes Queue (rather than different logic based on the PlayMode)
This commit is contained in:
@@ -1 +1 @@
|
|||||||
ScreenEvaluation extra1.mp3
|
ScreenEvaluation try extra1.mp3
|
||||||
@@ -791,6 +791,7 @@ GradeP1X=82
|
|||||||
GradeP2X=118
|
GradeP2X=118
|
||||||
|
|
||||||
[MusicWheel]
|
[MusicWheel]
|
||||||
|
NumWheelItems=13
|
||||||
FadeSeconds=1
|
FadeSeconds=1
|
||||||
SwitchSeconds=0.10
|
SwitchSeconds=0.10
|
||||||
RouletteSwitchSeconds=0.05
|
RouletteSwitchSeconds=0.05
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
struct PlayerOptions;
|
struct PlayerOptions;
|
||||||
struct SongOptions;
|
struct SongOptions;
|
||||||
class Song;
|
class Song;
|
||||||
struct Notes;
|
class Notes;
|
||||||
|
|
||||||
class Course
|
class Course
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include "CourseEntryDisplay.h"
|
#include "CourseEntryDisplay.h"
|
||||||
class Course;
|
class Course;
|
||||||
class Song;
|
class Song;
|
||||||
struct Notes;
|
class Notes;
|
||||||
|
|
||||||
|
|
||||||
const int MAX_VISIBLE_CONTENTS = 5;
|
const int MAX_VISIBLE_CONTENTS = 5;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
class Course;
|
class Course;
|
||||||
class Song;
|
class Song;
|
||||||
struct Notes;
|
class Notes;
|
||||||
|
|
||||||
|
|
||||||
class CourseEntryDisplay : public ActorFrame
|
class CourseEntryDisplay : public ActorFrame
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "PlayerNumber.h"
|
#include "PlayerNumber.h"
|
||||||
struct Notes;
|
class Notes;
|
||||||
|
|
||||||
|
|
||||||
class DifficultyIcon : public Sprite
|
class DifficultyIcon : public Sprite
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "BitmapText.h"
|
#include "BitmapText.h"
|
||||||
struct Notes;
|
class Notes;
|
||||||
|
|
||||||
|
|
||||||
class DifficultyMeter : public BitmapText
|
class DifficultyMeter : public BitmapText
|
||||||
|
|||||||
@@ -314,6 +314,7 @@ void GameState::GetFinalEvalStatsAndSongs( StageStats& statsOut, vector<Song*>&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* XXX: Should we store song options, too? */
|
/* XXX: Should we store song options, too? */
|
||||||
/* Store the player's preferred options. This is called at the very beginning
|
/* Store the player's preferred options. This is called at the very beginning
|
||||||
* of gameplay. */
|
* of gameplay. */
|
||||||
@@ -321,6 +322,7 @@ void GameState::StoreSelectedOptions()
|
|||||||
{
|
{
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
GAMESTATE->m_StoredPlayerOptions[p] = GAMESTATE->m_PlayerOptions[p];
|
GAMESTATE->m_StoredPlayerOptions[p] = GAMESTATE->m_PlayerOptions[p];
|
||||||
|
m_StoredSongOptions = m_SongOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restore the preferred options. This is called after a song ends, before
|
/* Restore the preferred options. This is called after a song ends, before
|
||||||
@@ -335,6 +337,7 @@ void GameState::RestoreSelectedOptions()
|
|||||||
* to stick around for the length of the course (for regaining). Let's
|
* to stick around for the length of the course (for regaining). Let's
|
||||||
* just reset the options that can actually be set per-song. XXX */
|
* just reset the options that can actually be set per-song. XXX */
|
||||||
// GAMESTATE->m_SongOptions.Init();
|
// GAMESTATE->m_SongOptions.Init();
|
||||||
GAMESTATE->m_SongOptions.m_DrainType = SongOptions::DRAIN_NORMAL;
|
m_SongOptions = m_StoredSongOptions;
|
||||||
GAMESTATE->m_SongOptions.m_fMusicRate = 1.0f;
|
// GAMESTATE->m_SongOptions.m_DrainType = SongOptions::DRAIN_NORMAL;
|
||||||
|
// GAMESTATE->m_SongOptions.m_fMusicRate = 1.0f;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include "StageStats.h"
|
#include "StageStats.h"
|
||||||
|
|
||||||
class Song;
|
class Song;
|
||||||
struct Notes;
|
class Notes;
|
||||||
class Course;
|
class Course;
|
||||||
class GameDef;
|
class GameDef;
|
||||||
class StyleDef;
|
class StyleDef;
|
||||||
@@ -129,6 +129,7 @@ public:
|
|||||||
PlayerOptions m_PlayerOptions[NUM_PLAYERS]; // change this, and current will move gradually toward it
|
PlayerOptions m_PlayerOptions[NUM_PLAYERS]; // change this, and current will move gradually toward it
|
||||||
PlayerOptions m_StoredPlayerOptions[NUM_PLAYERS]; // user's choices on the PlayerOptions screen
|
PlayerOptions m_StoredPlayerOptions[NUM_PLAYERS]; // user's choices on the PlayerOptions screen
|
||||||
SongOptions m_SongOptions;
|
SongOptions m_SongOptions;
|
||||||
|
SongOptions m_StoredSongOptions;
|
||||||
|
|
||||||
void StoreSelectedOptions();
|
void StoreSelectedOptions();
|
||||||
void RestoreSelectedOptions();
|
void RestoreSelectedOptions();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include "Grade.h"
|
#include "Grade.h"
|
||||||
class NoteData;
|
class NoteData;
|
||||||
|
|
||||||
struct Notes
|
class Notes
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Notes();
|
Notes();
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include "GameConstantsAndTypes.h" // for TapNoteScore and HoldNoteScore
|
#include "GameConstantsAndTypes.h" // for TapNoteScore and HoldNoteScore
|
||||||
class NoteData;
|
class NoteData;
|
||||||
class Inventory;
|
class Inventory;
|
||||||
|
class Notes;
|
||||||
|
|
||||||
|
|
||||||
class ScoreKeeper: public Actor
|
class ScoreKeeper: public Actor
|
||||||
@@ -37,9 +38,11 @@ protected:
|
|||||||
// bool Stats_DoublesCount;
|
// bool Stats_DoublesCount;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ScoreKeeper(PlayerNumber pn) { m_PlayerNumber=pn; }
|
ScoreKeeper(const vector<Notes*>& apNotes, PlayerNumber pn) { m_PlayerNumber=pn; }
|
||||||
virtual void DrawPrimitives() { }
|
virtual void DrawPrimitives() { }
|
||||||
|
|
||||||
|
virtual void OnNextSong( int iSongInCourseIndex, Notes* pNotes ) = 0; // before a song plays (called multiple times if course)
|
||||||
|
|
||||||
virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, Inventory* pInventory ) = 0;
|
virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, Inventory* pInventory ) = 0;
|
||||||
virtual void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ) = 0;
|
virtual void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ) = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -17,45 +17,115 @@
|
|||||||
#include "ScreenManager.h"
|
#include "ScreenManager.h"
|
||||||
#include "ScreenGameplay.h"
|
#include "ScreenGameplay.h"
|
||||||
#include "GameState.h"
|
#include "GameState.h"
|
||||||
|
#include "Course.h"
|
||||||
|
|
||||||
|
|
||||||
ScoreKeeperMAX2::ScoreKeeperMAX2(Notes *notes, PlayerNumber pn_):
|
ScoreKeeperMAX2::ScoreKeeperMAX2( const vector<Notes*>& apNotes, PlayerNumber pn_ ):
|
||||||
ScoreKeeper(pn_)
|
ScoreKeeper(apNotes, pn_)
|
||||||
{
|
{
|
||||||
if( notes )
|
//
|
||||||
|
// Fill in m_CurStageStats, calculate multiplier
|
||||||
|
//
|
||||||
|
NoteData notedata;
|
||||||
|
switch( GAMESTATE->m_PlayMode )
|
||||||
{
|
{
|
||||||
NoteData noteData;
|
case PLAY_MODE_ARCADE:
|
||||||
notes->GetNoteData( ¬eData );
|
case PLAY_MODE_BATTLE:
|
||||||
|
{
|
||||||
int Meter = notes->GetMeter();
|
ASSERT( !apNotes.empty() );
|
||||||
Meter = min(Meter, 10);
|
Notes* pNotes = apNotes[0];
|
||||||
|
GAMESTATE->m_CurStageStats.pSong = GAMESTATE->m_pCurSong;
|
||||||
int N = noteData.GetNumRowsWithTaps() + noteData.GetNumHoldNotes();
|
GAMESTATE->m_CurStageStats.iMeter[pn_] = pNotes->GetMeter();
|
||||||
|
pNotes->GetNoteData( ¬edata );
|
||||||
int sum = (N * (N + 1)) / 2;
|
GAMESTATE->m_CurStageStats.iPossibleDancePoints[pn_] = this->GetPossibleDancePoints( ¬edata );
|
||||||
|
|
||||||
if(sum)
|
|
||||||
m_fScoreMultiplier = float(Meter * 1000000) / sum;
|
|
||||||
else /* avoid div/0 on empty songs */
|
|
||||||
m_fScoreMultiplier = 0.f;
|
|
||||||
|
|
||||||
ASSERT(m_fScoreMultiplier >= 0.0);
|
|
||||||
}
|
}
|
||||||
else
|
break;
|
||||||
|
case PLAY_MODE_NONSTOP:
|
||||||
|
case PLAY_MODE_ONI:
|
||||||
|
case PLAY_MODE_ENDLESS:
|
||||||
{
|
{
|
||||||
ASSERT( GAMESTATE->IsCourseMode() );
|
int iTotalPossibleDancePoints = 0;
|
||||||
m_fScoreMultiplier = 0.f;
|
for( unsigned i=0; i<apNotes.size(); i++ )
|
||||||
|
{
|
||||||
|
apNotes[i]->GetNoteData( ¬edata );
|
||||||
|
iTotalPossibleDancePoints += this->GetPossibleDancePoints( ¬edata );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_iTapNotesHit = 0;
|
GAMESTATE->m_CurStageStats.pSong = NULL;
|
||||||
m_lScore = 0;
|
GAMESTATE->m_CurStageStats.iPossibleDancePoints[pn_] = iTotalPossibleDancePoints;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ASSERT(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
m_fScore = 0;
|
||||||
m_iCurToastyCombo = 0;
|
m_iCurToastyCombo = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScoreKeeperMAX2::OnNextSong( int iSongInCourseIndex, Notes* pNotes )
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
http://www.aaroninjapan.com/ddr2.html
|
||||||
|
|
||||||
|
Note on NONSTOP Mode scoring
|
||||||
|
|
||||||
|
Nonstop mode requires the player to play 4 songs in succession, with the total maximum possible score for the four song set being 100,000,000. This comes from the sum of the four stages' maximum possible scores, which, regardless of song or difficulty is:
|
||||||
|
|
||||||
|
10,000,000 for the first song
|
||||||
|
20,000,000 for the second song
|
||||||
|
30,000,000 for the third song
|
||||||
|
40,000,000 for the fourth song
|
||||||
|
*/
|
||||||
|
//
|
||||||
|
// Calculate the score multiplier
|
||||||
|
//
|
||||||
|
NoteData noteData;
|
||||||
|
pNotes->GetNoteData( ¬eData );
|
||||||
|
int N = noteData.GetNumRowsWithTaps() + noteData.GetNumHoldNotes();
|
||||||
|
int sum = (N * (N + 1)) / 2;
|
||||||
|
|
||||||
|
int iMaxPossiblePoints; // fill this in below
|
||||||
|
if( GAMESTATE->IsCourseMode() )
|
||||||
|
{
|
||||||
|
iMaxPossiblePoints = (iSongInCourseIndex+1) * 1000000;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int iMeter = pNotes->GetMeter();
|
||||||
|
CLAMP( iMeter, 1, 10 );
|
||||||
|
iMaxPossiblePoints = iMeter * 100000;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_fScoreMultiplier = (float)iMaxPossiblePoints / sum;
|
||||||
|
|
||||||
|
ASSERT(m_fScoreMultiplier >= 0.0);
|
||||||
|
|
||||||
|
m_iTapNotesHit = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScoreKeeperMAX2::AddScore( TapNoteScore score )
|
void ScoreKeeperMAX2::AddScore( TapNoteScore score )
|
||||||
{
|
{
|
||||||
int p; // score multiplier
|
int p = 0; // score multiplier
|
||||||
|
/*
|
||||||
|
http://www.aaroninjapan.com/ddr2.html
|
||||||
|
|
||||||
|
Regular scoring:
|
||||||
|
|
||||||
|
Let p = score multiplier (Perfect = 10, Great = 5, other = 0)
|
||||||
|
|
||||||
|
Note on NONSTOP Mode scoring
|
||||||
|
|
||||||
|
Let p = score multiplier (Marvelous = 10, Perfect = 9, Great = 5, other = 0)
|
||||||
|
|
||||||
|
*/
|
||||||
|
switch( GAMESTATE->m_PlayMode )
|
||||||
|
{
|
||||||
|
case PLAY_MODE_ARCADE:
|
||||||
|
case PLAY_MODE_BATTLE:
|
||||||
switch( score )
|
switch( score )
|
||||||
{
|
{
|
||||||
case TNS_MARVELOUS: p = 10; break;
|
case TNS_MARVELOUS: p = 10; break;
|
||||||
@@ -63,12 +133,31 @@ void ScoreKeeperMAX2::AddScore( TapNoteScore score )
|
|||||||
case TNS_GREAT: p = 5; break;
|
case TNS_GREAT: p = 5; break;
|
||||||
default: p = 0; break;
|
default: p = 0; break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case PLAY_MODE_NONSTOP:
|
||||||
|
case PLAY_MODE_ONI:
|
||||||
|
case PLAY_MODE_ENDLESS:
|
||||||
|
switch( score )
|
||||||
|
{
|
||||||
|
case TNS_MARVELOUS: p = 10; break;
|
||||||
|
case TNS_PERFECT: p = 9; break;
|
||||||
|
case TNS_GREAT: p = 5; break;
|
||||||
|
default: p = 0; break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ASSERT(0);
|
||||||
|
}
|
||||||
|
|
||||||
m_lScore += p * ++m_iTapNotesHit;
|
m_iTapNotesHit++;
|
||||||
|
|
||||||
ASSERT(m_lScore >= 0);
|
m_fScore += (p * m_iTapNotesHit) * m_fScoreMultiplier;
|
||||||
|
|
||||||
GAMESTATE->m_CurStageStats.fScore[m_PlayerNumber] = m_lScore * m_fScoreMultiplier;
|
ASSERT(m_fScore >= 0);
|
||||||
|
|
||||||
|
printf( "score: %10.0f\n", m_fScore );
|
||||||
|
|
||||||
|
GAMESTATE->m_CurStageStats.fScore[m_PlayerNumber] = m_fScore;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, Inventory* pInventory )
|
void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, Inventory* pInventory )
|
||||||
@@ -118,7 +207,7 @@ void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTa
|
|||||||
|
|
||||||
3dfsux:
|
3dfsux:
|
||||||
I redid this code so it will store the score as a long, then correct the score for each song based on that value.
|
I redid this code so it will store the score as a long, then correct the score for each song based on that value.
|
||||||
lScore == p * n
|
m_lScore == p * n
|
||||||
m_fScoreMultiplier = (B/S)
|
m_fScoreMultiplier = (B/S)
|
||||||
keeping these seperate for as long as possible improves accuracy.
|
keeping these seperate for as long as possible improves accuracy.
|
||||||
|
|
||||||
@@ -140,6 +229,12 @@ void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTa
|
|||||||
//
|
//
|
||||||
// Toasty combo
|
// Toasty combo
|
||||||
//
|
//
|
||||||
|
if( GAMESTATE->IsCourseMode() )
|
||||||
|
{
|
||||||
|
// don't play Toasty in a course. It's distracting.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
switch( scoreOfLastTap )
|
switch( scoreOfLastTap )
|
||||||
{
|
{
|
||||||
case TNS_MARVELOUS:
|
case TNS_MARVELOUS:
|
||||||
@@ -153,7 +248,7 @@ void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTa
|
|||||||
m_iCurToastyCombo = 0;
|
m_iCurToastyCombo = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Regular combo
|
// Regular combo
|
||||||
|
|||||||
@@ -14,12 +14,12 @@
|
|||||||
|
|
||||||
#include "ScoreKeeper.h"
|
#include "ScoreKeeper.h"
|
||||||
#include "NoteDataWithScoring.h"
|
#include "NoteDataWithScoring.h"
|
||||||
struct Notes;
|
class Notes;
|
||||||
|
|
||||||
class ScoreKeeperMAX2: public ScoreKeeper
|
class ScoreKeeperMAX2: public ScoreKeeper
|
||||||
{
|
{
|
||||||
long m_lScore;
|
double m_fScore;
|
||||||
float m_fScoreMultiplier;
|
double m_fScoreMultiplier;
|
||||||
int m_iTapNotesHit; // number of notes judged so far, needed by scoring
|
int m_iTapNotesHit; // number of notes judged so far, needed by scoring
|
||||||
|
|
||||||
int m_iCurToastyCombo;
|
int m_iCurToastyCombo;
|
||||||
@@ -27,7 +27,9 @@ class ScoreKeeperMAX2: public ScoreKeeper
|
|||||||
void AddScore( TapNoteScore score );
|
void AddScore( TapNoteScore score );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ScoreKeeperMAX2(Notes *notes, PlayerNumber pn);
|
ScoreKeeperMAX2( const vector<Notes*>& apNotes, PlayerNumber pn);
|
||||||
|
|
||||||
|
void OnNextSong( int iSongInCourseIndex, Notes* pNotes ); // before a song plays (called multiple times if course)
|
||||||
|
|
||||||
void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, Inventory* pInventory );
|
void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, Inventory* pInventory );
|
||||||
void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore );
|
void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore );
|
||||||
|
|||||||
@@ -132,64 +132,42 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
|||||||
GAMESTATE->m_CurStageStats = StageStats(); // clear values
|
GAMESTATE->m_CurStageStats = StageStats(); // clear values
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// fill in m_apSongsQueue, m_apNotesQueue, m_asModifiersQueue
|
||||||
|
//
|
||||||
|
if( GAMESTATE->IsCourseMode() )
|
||||||
|
{
|
||||||
|
Course* pCourse = GAMESTATE->m_pCurCourse;
|
||||||
|
pCourse->GetStageInfo( m_apSongsQueue, m_apNotesQueue[0], m_asModifiersQueue[0], GAMESTATE->GetCurrentStyleDef()->m_NotesType, false );
|
||||||
|
for( int p=1; p<NUM_PLAYERS; p++ )
|
||||||
|
{
|
||||||
|
m_apNotesQueue[p] = m_apNotesQueue[0];
|
||||||
|
m_asModifiersQueue[p] = m_asModifiersQueue[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_apSongsQueue.push_back( GAMESTATE->m_pCurSong );
|
||||||
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
|
{
|
||||||
|
m_apNotesQueue[p].push_back( GAMESTATE->m_pCurNotes[p] );
|
||||||
|
m_asModifiersQueue[p].push_back( "" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Init ScoreKeepers
|
||||||
|
//
|
||||||
int p;
|
int p;
|
||||||
for( p=0; p<NUM_PLAYERS; p++ )
|
for( p=0; p<NUM_PLAYERS; p++ )
|
||||||
{
|
{
|
||||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||||
continue; // skip
|
continue; // skip
|
||||||
m_pScoreKeeper[p] = new ScoreKeeperMAX2(GAMESTATE->m_pCurNotes[p], (PlayerNumber)p);
|
m_pScoreKeeper[p] = new ScoreKeeperMAX2( m_apNotesQueue[p], (PlayerNumber)p );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Fill in m_CurStageStats
|
|
||||||
NoteData notedata;
|
|
||||||
switch( GAMESTATE->m_PlayMode )
|
|
||||||
{
|
|
||||||
case PLAY_MODE_ARCADE:
|
|
||||||
case PLAY_MODE_BATTLE:
|
|
||||||
{
|
|
||||||
GAMESTATE->m_CurStageStats.pSong = GAMESTATE->m_pCurSong;
|
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
||||||
{
|
|
||||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
||||||
continue; // skip
|
|
||||||
GAMESTATE->m_CurStageStats.iMeter[p] = GAMESTATE->m_pCurNotes[p]->GetMeter();
|
|
||||||
GAMESTATE->m_pCurNotes[p]->GetNoteData( ¬edata );
|
|
||||||
// TODO: Make this more elegant
|
|
||||||
GAMESTATE->m_CurStageStats.iPossibleDancePoints[p] = m_pScoreKeeper[p]->GetPossibleDancePoints( ¬edata );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case PLAY_MODE_NONSTOP:
|
|
||||||
case PLAY_MODE_ONI:
|
|
||||||
case PLAY_MODE_ENDLESS:
|
|
||||||
{
|
|
||||||
Course* pCourse = GAMESTATE->m_pCurCourse;
|
|
||||||
pCourse->GetStageInfo( m_apCourseSongs, m_apCourseNotes, m_asCourseModifiers, GAMESTATE->GetCurrentStyleDef()->m_NotesType, false );
|
|
||||||
|
|
||||||
int iTotalMeter = 0;
|
|
||||||
int iTotalPossibleDancePoints = 0;
|
|
||||||
for( unsigned i=0; i<m_apCourseNotes.size(); i++ )
|
|
||||||
{
|
|
||||||
iTotalMeter += m_apCourseNotes[i]->GetMeter();
|
|
||||||
m_apCourseNotes[i]->GetNoteData( ¬edata );
|
|
||||||
iTotalPossibleDancePoints += m_pScoreKeeper[GAMESTATE->m_MasterPlayerNumber]->GetPossibleDancePoints( ¬edata );
|
|
||||||
}
|
|
||||||
|
|
||||||
GAMESTATE->m_CurStageStats.pSong = NULL;
|
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
||||||
{
|
|
||||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
||||||
continue; // skip
|
|
||||||
GAMESTATE->m_CurStageStats.iMeter[p] = iTotalMeter;
|
|
||||||
GAMESTATE->m_CurStageStats.iPossibleDancePoints[p] = iTotalPossibleDancePoints;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ASSERT(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_bChangedOffsetOrBPM = GAMESTATE->m_SongOptions.m_bAutoSync;
|
m_bChangedOffsetOrBPM = GAMESTATE->m_SongOptions.m_bAutoSync;
|
||||||
@@ -529,26 +507,10 @@ ScreenGameplay::~ScreenGameplay()
|
|||||||
|
|
||||||
bool ScreenGameplay::IsLastSong()
|
bool ScreenGameplay::IsLastSong()
|
||||||
{
|
{
|
||||||
switch( GAMESTATE->m_PlayMode )
|
if( GAMESTATE->m_pCurCourse && GAMESTATE->m_pCurCourse->m_bRepeat )
|
||||||
{
|
|
||||||
case PLAY_MODE_ARCADE:
|
|
||||||
case PLAY_MODE_BATTLE:
|
|
||||||
return true;
|
|
||||||
case PLAY_MODE_NONSTOP:
|
|
||||||
case PLAY_MODE_ONI:
|
|
||||||
case PLAY_MODE_ENDLESS:
|
|
||||||
{
|
|
||||||
Course* pCourse = GAMESTATE->m_pCurCourse;
|
|
||||||
if( pCourse->m_bRepeat )
|
|
||||||
return false;
|
return false;
|
||||||
else
|
|
||||||
return GAMESTATE->GetCourseSongIndex()+1 == (int)m_apCourseSongs.size(); // GetCourseSongIndex() is 0-based but size() is not
|
return GAMESTATE->GetCourseSongIndex()+1 == (int)m_apSongsQueue.size(); // GetCourseSongIndex() is 0-based but size() is not
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ASSERT(0);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenGameplay::LoadNextSong()
|
void ScreenGameplay::LoadNextSong()
|
||||||
@@ -559,40 +521,16 @@ void ScreenGameplay::LoadNextSong()
|
|||||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||||
GAMESTATE->m_CurStageStats.iSongsPlayed[p]++;
|
GAMESTATE->m_CurStageStats.iSongsPlayed[p]++;
|
||||||
|
|
||||||
switch( GAMESTATE->m_PlayMode )
|
|
||||||
{
|
|
||||||
case PLAY_MODE_ARCADE:
|
|
||||||
case PLAY_MODE_BATTLE:
|
|
||||||
break;
|
|
||||||
case PLAY_MODE_NONSTOP:
|
|
||||||
case PLAY_MODE_ONI:
|
|
||||||
case PLAY_MODE_ENDLESS:
|
|
||||||
{
|
|
||||||
for( p=0; p<NUM_PLAYERS; p++ )
|
for( p=0; p<NUM_PLAYERS; p++ )
|
||||||
m_textCourseSongNumber[p].SetText( ssprintf("%d", GAMESTATE->m_CurStageStats.iSongsPlayed[p]) );
|
m_textCourseSongNumber[p].SetText( ssprintf("%d", GAMESTATE->m_CurStageStats.iSongsPlayed[p]) );
|
||||||
|
|
||||||
int iPlaySongIndex = GAMESTATE->GetCourseSongIndex();
|
int iPlaySongIndex = GAMESTATE->GetCourseSongIndex();
|
||||||
iPlaySongIndex %= m_apCourseSongs.size();
|
iPlaySongIndex %= m_apSongsQueue.size();
|
||||||
GAMESTATE->m_pCurSong = m_apCourseSongs[iPlaySongIndex];
|
GAMESTATE->m_pCurSong = m_apSongsQueue[iPlaySongIndex];
|
||||||
|
|
||||||
// Restore the player's originally selected options.
|
// Restore the player's originally selected options.
|
||||||
GAMESTATE->RestoreSelectedOptions();
|
GAMESTATE->RestoreSelectedOptions();
|
||||||
|
|
||||||
for( p=0; p<NUM_PLAYERS; p++ )
|
|
||||||
{
|
|
||||||
GAMESTATE->m_pCurNotes[p] = m_apCourseNotes[iPlaySongIndex];
|
|
||||||
|
|
||||||
// Put courses options into effect.
|
|
||||||
GAMESTATE->m_PlayerOptions[p].FromString( m_asCourseModifiers[iPlaySongIndex] );
|
|
||||||
GAMESTATE->m_SongOptions.FromString( m_asCourseModifiers[iPlaySongIndex] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ASSERT(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_textSongOptions.SetText( GAMESTATE->m_SongOptions.GetString() );
|
m_textSongOptions.SetText( GAMESTATE->m_SongOptions.GetString() );
|
||||||
|
|
||||||
for( p=0; p<NUM_PLAYERS; p++ )
|
for( p=0; p<NUM_PLAYERS; p++ )
|
||||||
@@ -600,6 +538,13 @@ void ScreenGameplay::LoadNextSong()
|
|||||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
GAMESTATE->m_pCurNotes[p] = m_apNotesQueue[p][iPlaySongIndex];
|
||||||
|
m_pScoreKeeper[p]->OnNextSong( GAMESTATE->GetCourseSongIndex(), GAMESTATE->m_pCurNotes[p] );
|
||||||
|
|
||||||
|
// Put courses options into effect.
|
||||||
|
GAMESTATE->m_PlayerOptions[p].FromString( m_asModifiersQueue[p][iPlaySongIndex] );
|
||||||
|
GAMESTATE->m_SongOptions.FromString( m_asModifiersQueue[p][iPlaySongIndex] );
|
||||||
|
|
||||||
m_textPlayerOptions[p].SetText( GAMESTATE->m_PlayerOptions[p].GetString() );
|
m_textPlayerOptions[p].SetText( GAMESTATE->m_PlayerOptions[p].GetString() );
|
||||||
|
|
||||||
// reset oni game over graphic
|
// reset oni game over graphic
|
||||||
@@ -1160,8 +1105,8 @@ void SaveChanges()
|
|||||||
case PLAY_MODE_ENDLESS:
|
case PLAY_MODE_ENDLESS:
|
||||||
{
|
{
|
||||||
// FIXME
|
// FIXME
|
||||||
//for( int i=0; i<m_apCourseSongs.size(); i++ )
|
//for( int i=0; i<m_apSongsQueue.size(); i++ )
|
||||||
// m_apCourseSongs[i]->Save();
|
// m_apSongsQueue[i]->Save();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -1184,9 +1129,9 @@ void DontSaveChanges()
|
|||||||
case PLAY_MODE_ENDLESS:
|
case PLAY_MODE_ENDLESS:
|
||||||
{
|
{
|
||||||
// FIXME
|
// FIXME
|
||||||
// for( unsigned i=0; i<m_apCourseSongs.size(); i++ )
|
// for( unsigned i=0; i<m_apSongsQueue.size(); i++ )
|
||||||
// {
|
// {
|
||||||
// Song* pSong = m_apCourseSongs[i];
|
// Song* pSong = m_apSongsQueue[i];
|
||||||
// ld.LoadFromSMFile( pSong->GetCacheFilePath(), *pSong );
|
// ld.LoadFromSMFile( pSong->GetCacheFilePath(), *pSong );
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,9 +84,9 @@ protected:
|
|||||||
STATE_OUTRO, // not allowed to press Back
|
STATE_OUTRO, // not allowed to press Back
|
||||||
NUM_DANCING_STATES
|
NUM_DANCING_STATES
|
||||||
} m_DancingState;
|
} m_DancingState;
|
||||||
vector<Song*> m_apCourseSongs; // used only in a GameModes with courses
|
vector<Song*> m_apSongsQueue; // size may be >1 if playing a course
|
||||||
vector<Notes*> m_apCourseNotes; // used only in a GameModes with courses
|
vector<Notes*> m_apNotesQueue[NUM_PLAYERS]; // size may be >1 if playing a course
|
||||||
CStringArray m_asCourseModifiers; // used only in a GameModes with courses
|
CStringArray m_asModifiersQueue[NUM_PLAYERS];// size may be >1 if playing a course
|
||||||
|
|
||||||
bool m_bChangedOffsetOrBPM;
|
bool m_bChangedOffsetOrBPM;
|
||||||
float m_fTimeLeftBeforeDancingComment; // this counter is only running while STATE_DANCING
|
float m_fTimeLeftBeforeDancingComment; // this counter is only running while STATE_DANCING
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include "PlayerNumber.h"
|
#include "PlayerNumber.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
#include "Grade.h"
|
#include "Grade.h"
|
||||||
struct Notes;
|
class Notes;
|
||||||
class StyleDef;
|
class StyleDef;
|
||||||
class NotesLoader;
|
class NotesLoader;
|
||||||
class LyricsLoader;
|
class LyricsLoader;
|
||||||
|
|||||||
Reference in New Issue
Block a user