basic support for 5th scoring mode (only adjusts max score value right now)
This commit is contained in:
@@ -116,6 +116,7 @@ PrefsManager::PrefsManager()
|
||||
|
||||
// default to old sort order
|
||||
m_iCourseSortOrder = COURSE_SORT_SONGS;
|
||||
m_iScoringType = SCORING_MAX2;
|
||||
|
||||
m_fLongVerSongSeconds = 60*2.5f; // Dynamite Rave is 2:55
|
||||
m_fMarathonVerSongSeconds = 60*5.f;
|
||||
@@ -231,6 +232,9 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame )
|
||||
ini.GetValueB( "Options", "ShowDancingCharacters", m_bShowDancingCharacters );
|
||||
ini.GetValueB( "Options", "TenFooterInRed", m_bTenFooterInRed );
|
||||
ini.GetValueI( "Options", "CourseSortOrder", (int&)m_iCourseSortOrder );
|
||||
|
||||
ini.GetValueI( "Options", "ScoringType", (int&)m_iScoringType );
|
||||
|
||||
ini.GetValueI( "Options", "ProgressiveLifebar", (int&)m_iProgressiveLifebar );
|
||||
ini.GetValueI( "Options", "ProgressiveNonstopLifebar", (int&)m_iProgressiveNonstopLifebar );
|
||||
ini.GetValueI( "Options", "ProgressiveStageLifebar", (int&)m_iProgressiveStageLifebar );
|
||||
@@ -350,6 +354,8 @@ void PrefsManager::SaveGlobalPrefsToDisk()
|
||||
|
||||
ini.SetValueB( "Options", "TenFooterInRed", m_bTenFooterInRed );
|
||||
ini.SetValueI( "Options", "CourseSortOrder", m_iCourseSortOrder );
|
||||
ini.SetValueI( "Options", "ScoringType", m_iScoringType );
|
||||
|
||||
ini.SetValueI( "Options", "ProgressiveLifebar", m_iProgressiveLifebar );
|
||||
ini.SetValueI( "Options", "ProgressiveStageLifebar", m_iProgressiveStageLifebar );
|
||||
ini.SetValueI( "Options", "ProgressiveNonstopLifebar", m_iProgressiveNonstopLifebar );
|
||||
|
||||
@@ -94,6 +94,9 @@ public:
|
||||
// course ranking
|
||||
enum { COURSE_SORT_SONGS, COURSE_SORT_METER, COURSE_SORT_METER_SUM, COURSE_SORT_RANK } m_iCourseSortOrder;
|
||||
|
||||
// scoring type; SCORING_MAX2 should always be first
|
||||
enum { SCORING_MAX2, SCORING_5TH } m_iScoringType;
|
||||
|
||||
/* 0 = no; 1 = yes; -1 = auto (do whatever is appropriate for the arch). */
|
||||
int m_iBoostAppPriority;
|
||||
|
||||
|
||||
@@ -0,0 +1,527 @@
|
||||
#include "global.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ScoreKeeper5th
|
||||
|
||||
Desc: Modified scoring for 5th mix, based on MAX2
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
#include "ScoreKeeper5th.h"
|
||||
#include "GameState.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "Steps.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "ScreenGameplay.h"
|
||||
#include "GameState.h"
|
||||
#include "Course.h"
|
||||
#include "UnlockSystem.h"
|
||||
#include "SDL_utils.h"
|
||||
#include "SongManager.h"
|
||||
|
||||
|
||||
ScoreKeeper5th::ScoreKeeper5th( const vector<Steps*>& apNotes_, PlayerNumber pn_ ):
|
||||
ScoreKeeper(pn_), apNotes(apNotes_)
|
||||
{
|
||||
//
|
||||
// Fill in m_CurStageStats, calculate multiplier
|
||||
//
|
||||
int iTotalPossibleDancePoints = 0;
|
||||
for( unsigned i=0; i<apNotes.size(); i++ )
|
||||
{
|
||||
Steps* pSteps = apNotes[0];
|
||||
NoteData notedata;
|
||||
pSteps->GetNoteData( ¬edata );
|
||||
|
||||
const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
|
||||
NoteData playerNoteData;
|
||||
pStyleDef->GetTransformedNoteDataForStyle( pn_, ¬edata, &playerNoteData );
|
||||
|
||||
iTotalPossibleDancePoints += this->GetPossibleDancePoints( ¬edata );
|
||||
}
|
||||
GAMESTATE->m_CurStageStats.iPossibleDancePoints[pn_] = iTotalPossibleDancePoints;
|
||||
|
||||
if( !GAMESTATE->IsCourseMode() )
|
||||
{
|
||||
ASSERT( !apNotes.empty() );
|
||||
GAMESTATE->m_CurStageStats.pSong = GAMESTATE->m_pCurSong;
|
||||
GAMESTATE->m_CurStageStats.iMeter[pn_] = apNotes[0]->GetMeter();
|
||||
} else {
|
||||
GAMESTATE->m_CurStageStats.pSong = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
m_iScore = 0;
|
||||
m_iCurToastyCombo = 0;
|
||||
m_iMaxScoreSoFar = 0;
|
||||
m_iPointBonus = 0;
|
||||
m_iNumTapsAndHolds = 0;
|
||||
m_bIsLastSongInCourse = false;
|
||||
}
|
||||
|
||||
void ScoreKeeper5th::OnNextSong( int iSongInCourseIndex, Steps* pNotes, NoteData* pNoteData )
|
||||
{
|
||||
/*
|
||||
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
|
||||
|
||||
We extend this to work with nonstop courses of any length.
|
||||
|
||||
We also keep track of this scoring type in endless, with 100mil per iteration
|
||||
of all songs, though this score isn't actually seen anywhere right now.
|
||||
*/
|
||||
//
|
||||
// Calculate the score multiplier
|
||||
//
|
||||
m_iMaxPossiblePoints = 0;
|
||||
if( GAMESTATE->IsCourseMode() )
|
||||
{
|
||||
const int numSongsInCourse = apNotes.size();
|
||||
ASSERT( numSongsInCourse != 0 );
|
||||
|
||||
const int iIndex = iSongInCourseIndex % numSongsInCourse;
|
||||
m_bIsLastSongInCourse = (iIndex+1 == numSongsInCourse);
|
||||
|
||||
if( numSongsInCourse < 10 )
|
||||
{
|
||||
const int courseMult = (numSongsInCourse * (numSongsInCourse + 1)) / 2;
|
||||
ASSERT(courseMult >= 0);
|
||||
|
||||
m_iMaxPossiblePoints = (100000000 * (iIndex+1)) / courseMult;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* When we have lots of songs, the scale above biases too much: in a
|
||||
* course with 50 songs, the first song is worth 80k, the last 4mil, which
|
||||
* is too much of a difference.
|
||||
*
|
||||
* With this, each song in a 50-song course will be worth 2mil. */
|
||||
m_iMaxPossiblePoints = 100000000 / numSongsInCourse;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const int iMeter = clamp( pNotes->GetMeter(), 1, 10 );
|
||||
|
||||
// long ver and marathon ver songs have higher max possible scores
|
||||
int iLengthMultiplier = SongManager::GetNumStagesForSong( GAMESTATE->m_pCurSong );
|
||||
m_iMaxPossiblePoints = (1 + iMeter * iLengthMultiplier) * 5000000;
|
||||
}
|
||||
ASSERT( m_iMaxPossiblePoints >= 0 );
|
||||
m_iMaxScoreSoFar += m_iMaxPossiblePoints;
|
||||
|
||||
m_iNumTapsAndHolds = pNoteData->GetNumRowsWithTaps() + pNoteData->GetNumHoldNotes();
|
||||
|
||||
m_iPointBonus = m_iMaxPossiblePoints;
|
||||
|
||||
ASSERT( m_iPointBonus >= 0 );
|
||||
|
||||
m_iTapNotesHit = 0;
|
||||
}
|
||||
|
||||
static int GetScore(int p, int B, int S, int n)
|
||||
{
|
||||
/* There's a problem with the scoring system described below. B/S is truncated
|
||||
* to an int. However, in some cases we can end up with very small base scores.
|
||||
* Each song in a 50-song nonstop course will be worth 2mil, which is a base of
|
||||
* 200k; B/S will end up being zero.
|
||||
*
|
||||
* If we rearrange the equation to (p*B*n) / S, this problem goes away.
|
||||
* (To do that, we need to either use 64-bit ints or rearrange it a little
|
||||
* more and use floats, since p*B*n won't fit a 32-bit int.) However, this
|
||||
* changes the scoring rules slightly.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
/* This is the actual method described below. */
|
||||
return p * (B / S) * n;
|
||||
#elif 1
|
||||
/* This doesn't round down B/S. */
|
||||
return int(Uint64(p) * n * B / S);
|
||||
#else
|
||||
/* This also doesn't round down B/S. Use this if you don't have 64-bit ints. */
|
||||
return int(p * n * (float(B) / S));
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void ScoreKeeper5th::AddScore( TapNoteScore score )
|
||||
{
|
||||
/*
|
||||
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)
|
||||
|
||||
*/
|
||||
int p = 0; // score multiplier
|
||||
const bool MarvelousEnabled = GAMESTATE->IsCourseMode() && (PREFSMAN->m_iMarvelousTiming > 0);
|
||||
|
||||
switch( score )
|
||||
{
|
||||
case TNS_MARVELOUS: p = 10; break;
|
||||
case TNS_PERFECT: p = MarvelousEnabled? 9:10; break;
|
||||
case TNS_GREAT: p = 5; break;
|
||||
default: p = 0; break;
|
||||
}
|
||||
|
||||
m_iTapNotesHit++;
|
||||
|
||||
const int N = m_iNumTapsAndHolds;
|
||||
const int sum = (N * (N + 1)) / 2;
|
||||
const int B = m_iMaxPossiblePoints/10;
|
||||
|
||||
int iScoreMultiplier = (m_iMaxPossiblePoints / (10*sum));
|
||||
ASSERT( iScoreMultiplier >= 0 );
|
||||
|
||||
// What does this do? "Don't use a multiplier if
|
||||
// the player has failed"?
|
||||
// Also, why does this switch on score again instead
|
||||
// of just adding p? -Chris
|
||||
if( GAMESTATE->m_CurStageStats.bFailed[m_PlayerNumber] )
|
||||
switch( score )
|
||||
{
|
||||
case TNS_MARVELOUS: m_iScore += 10; break;
|
||||
case TNS_PERFECT: m_iScore += MarvelousEnabled? 9:10; break;
|
||||
case TNS_GREAT: m_iScore += 5; break;
|
||||
}
|
||||
else
|
||||
m_iScore += GetScore(p, B, sum, m_iTapNotesHit);
|
||||
|
||||
/* Subtract the maximum this step could have been worth from the bonus. */
|
||||
m_iPointBonus -= GetScore(10, B, sum, m_iTapNotesHit);
|
||||
|
||||
if ( m_iTapNotesHit == m_iNumTapsAndHolds && score >= TNS_PERFECT )
|
||||
{
|
||||
if (!GAMESTATE->m_CurStageStats.bFailed[m_PlayerNumber])
|
||||
m_iScore += m_iPointBonus;
|
||||
if ( m_bIsLastSongInCourse )
|
||||
{
|
||||
m_iScore += 100000000 - m_iMaxScoreSoFar;
|
||||
|
||||
/* If we're in Endless mode, we'll come around here again, so reset
|
||||
* the bonus counter. */
|
||||
m_iMaxScoreSoFar = 0;
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT(m_iScore >= 0);
|
||||
|
||||
printf( "score: %i\n", m_iScore );
|
||||
|
||||
GAMESTATE->m_CurStageStats.iScore[m_PlayerNumber] = m_iScore;
|
||||
}
|
||||
|
||||
void ScoreKeeper5th::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, int iNumAdditions )
|
||||
{
|
||||
ASSERT( iNumTapsInRow >= 1 );
|
||||
int iNumTapsToScore = iNumTapsInRow-iNumAdditions;
|
||||
|
||||
// Update dance points. Additions don't count.
|
||||
if( iNumTapsToScore > 0 )
|
||||
{
|
||||
GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += TapNoteScoreToDancePoints( scoreOfLastTap );
|
||||
}
|
||||
|
||||
// Do count additions in judge totals.
|
||||
GAMESTATE->m_CurStageStats.iTapNoteScores[m_PlayerNumber][scoreOfLastTap] += 1;
|
||||
|
||||
/*
|
||||
http://www.aaroninjapan.com/ddr2.html
|
||||
|
||||
A single step's points are calculated as follows:
|
||||
|
||||
p = score multiplier (Perfect = 10, Great = 5, other = 0)
|
||||
N = total number of steps and freeze steps
|
||||
S = The sum of all integers from 1 to N (the total number of steps/freeze steps)
|
||||
n = number of the current step or freeze step (varies from 1 to N)
|
||||
B = Base value of the song (1,000,000 X the number of feet difficulty) - All edit data is rated as 5 feet
|
||||
So, the score for one step is:
|
||||
one_step_score = p * (B/S) * n
|
||||
|
||||
*IMPORTANT* : Double steps (U+L, D+R, etc.) count as two steps instead of one *for your combo count only*,
|
||||
so if you get a double L+R on the 112th step of a song, you score is calculated for only one step, not two,
|
||||
as the combo counter might otherwise imply.
|
||||
|
||||
Now, through simple algebraic manipulation:
|
||||
S = 1+...+N = (1+N)*N/2 (1 through N added together)
|
||||
|
||||
Okay, time for an example. Suppose we wanted to calculate the step score of a "Great" on the 57th step of
|
||||
a 441 step, 8-foot difficulty song (I'm just making this one up):
|
||||
|
||||
S = (1 + 441)*441 / 2
|
||||
= 194,222 / 2
|
||||
= 97,461
|
||||
StepScore = p * (B/S) * n
|
||||
= 5 * (8,000,000 / 97,461) * 57
|
||||
= 5 * (82) * 57 (The 82 is rounded down from 82.08411...)
|
||||
= 23,370
|
||||
|
||||
Remember this is just the score for the step, not the cumulative score up to the 57th step. Also, please note that
|
||||
I am currently checking into rounding errors with the system and if there are any, how they are resolved in the system.
|
||||
|
||||
Note: if you got all Perfect on this song, you would get (p=10)*B, which is 80,000,000. In fact, the maximum possible
|
||||
score for any song is the number of feet difficulty X 10,000,000.
|
||||
*/
|
||||
AddScore( scoreOfLastTap ); // only score once per row
|
||||
|
||||
|
||||
//
|
||||
// handle combo logic
|
||||
//
|
||||
#ifndef DEBUG
|
||||
if( PREFSMAN->m_bAutoPlay && !GAMESTATE->m_bDemonstrationOrJukebox ) // cheaters never prosper
|
||||
{
|
||||
m_iCurToastyCombo = 0;
|
||||
return;
|
||||
}
|
||||
#endif //DEBUG
|
||||
|
||||
//
|
||||
// Toasty combo
|
||||
//
|
||||
switch( scoreOfLastTap )
|
||||
{
|
||||
case TNS_MARVELOUS:
|
||||
case TNS_PERFECT:
|
||||
m_iCurToastyCombo += iNumTapsInRow;
|
||||
|
||||
if( m_iCurToastyCombo==250 && !GAMESTATE->m_bDemonstrationOrJukebox )
|
||||
{
|
||||
SCREENMAN->PostMessageToTopScreen( SM_PlayToasty, 0 );
|
||||
GAMESTATE->m_pUnlockingSys->UnlockToasty();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
m_iCurToastyCombo = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
// Regular combo
|
||||
//
|
||||
int &iCurCombo = GAMESTATE->m_CurStageStats.iCurCombo[m_PlayerNumber];
|
||||
int iOldCombo = iCurCombo;
|
||||
|
||||
/*
|
||||
http://www.aaroninjapan.com/ddr2.html
|
||||
|
||||
Note on ONI Mode scoring
|
||||
|
||||
Your combo counter only increased with a "Marvelous/Perfect", and double Marvelous/Perfect steps (left and right, etc.)
|
||||
only add 1 to your combo instead of 2. The combo counter thus becomes a "Marvelous/Perfect" counter.
|
||||
*/
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_ARCADE:
|
||||
case PLAY_MODE_HUMAN_BATTLE:
|
||||
case PLAY_MODE_CPU_BATTLE:
|
||||
case PLAY_MODE_RAVE:
|
||||
case PLAY_MODE_NONSTOP:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
switch( scoreOfLastTap )
|
||||
{
|
||||
case TNS_MARVELOUS:
|
||||
case TNS_PERFECT:
|
||||
case TNS_GREAT:
|
||||
iCurCombo += iNumTapsInRow;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case PLAY_MODE_ONI:
|
||||
switch( scoreOfLastTap )
|
||||
{
|
||||
case TNS_MARVELOUS:
|
||||
case TNS_PERFECT:
|
||||
iCurCombo++;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
|
||||
#define CROSSED( x ) (iOldCombo<x && iCurCombo>=x)
|
||||
|
||||
if ( CROSSED(100) )
|
||||
SCREENMAN->PostMessageToTopScreen( SM_100Combo, 0 );
|
||||
else if( CROSSED(200) )
|
||||
SCREENMAN->PostMessageToTopScreen( SM_200Combo, 0 );
|
||||
else if( CROSSED(300) )
|
||||
SCREENMAN->PostMessageToTopScreen( SM_300Combo, 0 );
|
||||
else if( CROSSED(400) )
|
||||
SCREENMAN->PostMessageToTopScreen( SM_400Combo, 0 );
|
||||
else if( CROSSED(500) )
|
||||
SCREENMAN->PostMessageToTopScreen( SM_500Combo, 0 );
|
||||
else if( CROSSED(600) )
|
||||
SCREENMAN->PostMessageToTopScreen( SM_600Combo, 0 );
|
||||
else if( CROSSED(700) )
|
||||
SCREENMAN->PostMessageToTopScreen( SM_700Combo, 0 );
|
||||
else if( CROSSED(800) )
|
||||
SCREENMAN->PostMessageToTopScreen( SM_800Combo, 0 );
|
||||
else if( CROSSED(900) )
|
||||
SCREENMAN->PostMessageToTopScreen( SM_900Combo, 0 );
|
||||
else if( CROSSED(1000))
|
||||
SCREENMAN->PostMessageToTopScreen( SM_1000Combo, 0 );
|
||||
|
||||
// new max combo
|
||||
GAMESTATE->m_CurStageStats.iMaxCombo[m_PlayerNumber] = max(GAMESTATE->m_CurStageStats.iMaxCombo[m_PlayerNumber], iCurCombo);
|
||||
|
||||
|
||||
switch( scoreOfLastTap )
|
||||
{
|
||||
case TNS_GOOD:
|
||||
case TNS_BOO:
|
||||
case TNS_MISS:
|
||||
if( iCurCombo>50 )
|
||||
SCREENMAN->PostMessageToTopScreen( SM_ComboStopped, 0 );
|
||||
|
||||
iCurCombo = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ScoreKeeper5th::HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore )
|
||||
{
|
||||
// update dance points totals
|
||||
GAMESTATE->m_CurStageStats.iHoldNoteScores[m_PlayerNumber][holdScore] ++;
|
||||
GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += HoldNoteScoreToDancePoints( holdScore );
|
||||
|
||||
if( holdScore == HNS_OK )
|
||||
AddScore( TNS_MARVELOUS );
|
||||
}
|
||||
|
||||
|
||||
int ScoreKeeper5th::GetPossibleDancePoints( const NoteData* pNoteData )
|
||||
{
|
||||
/* Note that, if Marvelous timing is disabled or not active (not course mode),
|
||||
* PERFECT will be used instead. */
|
||||
|
||||
TapNoteScore maxPossibleTapScore =
|
||||
(GAMESTATE->ShowMarvelous() ) ? TNS_MARVELOUS : TNS_PERFECT;
|
||||
|
||||
return pNoteData->GetNumRowsWithTaps()*TapNoteScoreToDancePoints(maxPossibleTapScore)+
|
||||
pNoteData->GetNumHoldNotes()*HoldNoteScoreToDancePoints(HNS_OK);
|
||||
}
|
||||
|
||||
|
||||
int ScoreKeeper5th::TapNoteScoreToDancePoints( TapNoteScore tns )
|
||||
{
|
||||
if(!GAMESTATE->ShowMarvelous() && tns == TNS_MARVELOUS)
|
||||
tns = TNS_PERFECT;
|
||||
|
||||
/*
|
||||
http://www.aaroninjapan.com/ddr2.html
|
||||
|
||||
Regular play scoring
|
||||
|
||||
A "Perfect" is worth 2 points
|
||||
A "Great" is worth 1 points
|
||||
A "Good" is worth 0 points
|
||||
A "Boo" will subtract 4 points
|
||||
A "Miss" will subtract 8 points
|
||||
An "OK" (Successful Freeze step) will add 6 points
|
||||
A "NG" (Unsuccessful Freeze step) is worth 0 points
|
||||
|
||||
Note on ONI Mode scoring
|
||||
|
||||
The total number of Dance Points is calculated with Marvelous steps being worth 3 points, Perfects getting
|
||||
2 points, OKs getting 3 points, Greats getting 1 point, and everything else is worth 0 points. (Note: The
|
||||
"Marvelous" step rating is a new rating to DDR Extreme only used in Oni and Nonstop modes. They are rated
|
||||
higher than "Perfect" steps).
|
||||
|
||||
Note on NONSTOP Mode scoring
|
||||
|
||||
A "Marvelous" is worth 2 points
|
||||
A "Perfect" is also worth 2 points
|
||||
A "Great" is worth 1 points
|
||||
A "Good" is worth 0 points
|
||||
A "Boo" will subtract 4 points
|
||||
A "Miss" will subtract 8 points
|
||||
An "OK" (Successful Freeze step) will add 6 points
|
||||
A "NG" (Unsuccessful Freeze step) is worth 0 points
|
||||
*/
|
||||
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_ARCADE:
|
||||
case PLAY_MODE_HUMAN_BATTLE:
|
||||
case PLAY_MODE_CPU_BATTLE:
|
||||
case PLAY_MODE_RAVE:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
case PLAY_MODE_NONSTOP:
|
||||
switch( tns )
|
||||
{
|
||||
case TNS_MARVELOUS: return +2;
|
||||
case TNS_PERFECT: return +2;
|
||||
case TNS_GREAT: return +1;
|
||||
case TNS_GOOD: return +0;
|
||||
case TNS_BOO: return -4;
|
||||
case TNS_MISS: return -8;
|
||||
}
|
||||
break;
|
||||
case PLAY_MODE_ONI:
|
||||
switch( tns )
|
||||
{
|
||||
case TNS_MARVELOUS: return +3;
|
||||
case TNS_PERFECT: return +2;
|
||||
case TNS_GREAT: return +1;
|
||||
case TNS_GOOD: return +0;
|
||||
case TNS_BOO: return +0;
|
||||
case TNS_MISS: return +0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ASSERT(0);
|
||||
}
|
||||
return +0;
|
||||
}
|
||||
|
||||
int ScoreKeeper5th::HoldNoteScoreToDancePoints( HoldNoteScore hns )
|
||||
{
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_ARCADE:
|
||||
case PLAY_MODE_HUMAN_BATTLE:
|
||||
case PLAY_MODE_CPU_BATTLE:
|
||||
case PLAY_MODE_RAVE:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
case PLAY_MODE_NONSTOP:
|
||||
switch( hns )
|
||||
{
|
||||
case HNS_OK: return +6;
|
||||
case HNS_NG: return +0;
|
||||
}
|
||||
break;
|
||||
case PLAY_MODE_ONI:
|
||||
switch( hns )
|
||||
{
|
||||
case HNS_OK: return (PREFSMAN->m_iMarvelousTiming != 0)? +3:+2;
|
||||
case HNS_NG: return +0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ASSERT(0);
|
||||
}
|
||||
return +0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#ifndef SCOREKEEPER_5TH_H
|
||||
#define SCOREKEEPER_5TH_H 1
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ScoreKeeper5th
|
||||
|
||||
Class to handle scorekeeping, 5th-style.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
Glenn Maynard
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "ScoreKeeper.h"
|
||||
#include "NoteDataWithScoring.h"
|
||||
class Steps;
|
||||
|
||||
class ScoreKeeper5th: public ScoreKeeper
|
||||
{
|
||||
int m_iScore;
|
||||
int m_iMaxPossiblePoints;
|
||||
int m_iTapNotesHit; // number of notes judged so far, needed by scoring
|
||||
|
||||
int m_iNumTapsAndHolds;
|
||||
int m_iMaxScoreSoFar; // for nonstop scoring
|
||||
int m_iPointBonus; // the difference to award at the end
|
||||
int m_iCurToastyCombo;
|
||||
bool m_bIsLastSongInCourse;
|
||||
|
||||
const vector<Steps*>& apNotes;
|
||||
|
||||
void AddScore( TapNoteScore score );
|
||||
|
||||
public:
|
||||
ScoreKeeper5th( const vector<Steps*>& apNotes, PlayerNumber pn);
|
||||
|
||||
// before a song plays (called multiple times if course)
|
||||
void OnNextSong( int iSongInCourseIndex, Steps* pNotes, NoteData* pNoteData );
|
||||
|
||||
void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, int iNumAdditions );
|
||||
void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore );
|
||||
|
||||
int TapNoteScoreToDancePoints( TapNoteScore tns );
|
||||
int HoldNoteScoreToDancePoints( HoldNoteScore hns );
|
||||
int GetPossibleDancePoints( const NoteData* pNoteData );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "ThemeManager.h"
|
||||
#include "RageTimer.h"
|
||||
#include "ScoreKeeperMAX2.h"
|
||||
#include "ScoreKeeper5th.h"
|
||||
#include "ScoreKeeperRave.h"
|
||||
#include "NoteFieldPositioning.h"
|
||||
#include "LyricsLoader.h"
|
||||
@@ -181,7 +182,16 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay")
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||
continue; // skip
|
||||
m_pPrimaryScoreKeeper[p] = new ScoreKeeperMAX2( m_apNotesQueue[p], (PlayerNumber)p );
|
||||
|
||||
switch (PREFSMAN->m_iScoringType)
|
||||
{
|
||||
case (PrefsManager::SCORING_MAX2):
|
||||
m_pPrimaryScoreKeeper[p] = new ScoreKeeperMAX2( m_apNotesQueue[p], (PlayerNumber)p );
|
||||
break;
|
||||
case (PrefsManager::SCORING_5TH):
|
||||
m_pPrimaryScoreKeeper[p] = new ScoreKeeper5th( m_apNotesQueue[p], (PlayerNumber)p );
|
||||
break;
|
||||
}
|
||||
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@ enum {
|
||||
MO_MENU_TIMER,
|
||||
MO_COIN_MODE,
|
||||
MO_NUM_ARCADE_STAGES,
|
||||
MO_SCORING_TYPE,
|
||||
MO_JUDGE_DIFFICULTY,
|
||||
MO_LIFE_DIFFICULTY,
|
||||
MO_PROGRESSIVE_LIFEBAR,
|
||||
@@ -45,6 +46,7 @@ OptionRow g_MachineOptionsLines[NUM_MACHINE_OPTIONS_LINES] = {
|
||||
OptionRow( "Menu\nTimer", "OFF","ON" ),
|
||||
OptionRow( "Coin\nMode", "HOME","PAY","FREE PLAY" ),
|
||||
OptionRow( "Songs Per\nPlay", "1","2","3","4","5","6","7","EVENT MODE" ),
|
||||
OptionRow( "Scoring\nType", "MAX2","5TH" ),
|
||||
OptionRow( "Judge\nDifficulty", "1","2","3","4","5","6","7","8","JUSTICE" ),
|
||||
OptionRow( "Life\nDifficulty", "1","2","3","4","5","6","7" ),
|
||||
OptionRow( "Progressive\nLifebar", "OFF","1","2","3","4","5","6","7","8"),
|
||||
@@ -78,6 +80,8 @@ void ScreenMachineOptions::ImportOptions()
|
||||
m_iSelectedOption[0][MO_MENU_TIMER] = PREFSMAN->m_bMenuTimer ? 1:0;
|
||||
m_iSelectedOption[0][MO_NUM_ARCADE_STAGES] = PREFSMAN->m_bEventMode ? 7 : PREFSMAN->m_iNumArcadeStages - 1;
|
||||
|
||||
m_iSelectedOption[0][MO_SCORING_TYPE] = PREFSMAN->m_iScoringType;
|
||||
|
||||
/* .02 difficulty is beyond our timing right now; even autoplay
|
||||
* misses! At least fix autoplay before enabling this, or we'll
|
||||
* probably get lots of bug reports about it.
|
||||
@@ -133,6 +137,8 @@ void ScreenMachineOptions::ExportOptions()
|
||||
PREFSMAN->m_iProgressiveNonstopLifebar = m_iSelectedOption[0][MO_PROG_NONSTOP_LIFEBAR];
|
||||
PREFSMAN->m_iProgressiveStageLifebar = m_iSelectedOption[0][MO_PROG_STAGE_LIFEBAR];
|
||||
|
||||
(int&)PREFSMAN->m_iScoringType = m_iSelectedOption[0][MO_SCORING_TYPE];
|
||||
|
||||
switch( m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] )
|
||||
{
|
||||
case 0: PREFSMAN->m_fJudgeWindowScale = 1.50f; break;
|
||||
|
||||
+49
-38
@@ -1,5 +1,5 @@
|
||||
# Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 60000
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
@@ -65,7 +65,7 @@ IntDir=.\../Debug6
|
||||
TargetDir=\stepmania\stepmania
|
||||
TargetName=StepMania-debug
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||
# End Special Build Tool
|
||||
|
||||
@@ -82,27 +82,23 @@ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_XBOX" /D "_DEBUG" /YX /FD /G6 /Ztmp /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /I "SDL_sound-1.0.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /D "OGG_ONLY" /YX /FD /G6 /Ztmp /c
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /incremental:no /debug /machine:I386 /subsystem:xbox /fixed:no /TMP
|
||||
# ADD LINK32 xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /incremental:no /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"../StepManiaXbox-debug.exe" /subsystem:xbox /fixed:no /TMP
|
||||
XBE=imagebld.exe
|
||||
# ADD BASE XBE /nologo /stack:0x10000 /debug
|
||||
# ADD XBE /nologo /stack:0x10000 /debug /out:"../default.xbe"
|
||||
XBCP=xbecopy.exe
|
||||
# ADD BASE XBCP /NOLOGO
|
||||
# ADD XBCP /NOLOGO
|
||||
XBE=imagebld.exe
|
||||
# ADD BASE XBE /nologo /stack:0x10000 /debug
|
||||
# ADD XBE /nologo /stack:0x10000 /debug /out:"../default.xbe"
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /incremental:no /debug /machine:I386 /subsystem:xbox /fixed:no /TMP
|
||||
# ADD LINK32 xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /incremental:no /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"../StepManiaXbox-debug.exe" /subsystem:xbox /fixed:no /TMP
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_XBOX" /D "_DEBUG" /YX /FD /G6 /Ztmp /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /I "SDL_sound-1.0.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /D "OGG_ONLY" /YX /FD /G6 /Ztmp /c
|
||||
# Begin Special Build Tool
|
||||
IntDir=.\Debug
|
||||
TargetDir=\stepmania\stepmania
|
||||
TargetName=default
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||
# End Special Build Tool
|
||||
|
||||
@@ -142,7 +138,7 @@ IntDir=.\../Release6
|
||||
TargetDir=\stepmania\stepmania
|
||||
TargetName=StepMania
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||
# End Special Build Tool
|
||||
|
||||
@@ -160,30 +156,26 @@ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania
|
||||
# PROP Intermediate_Dir "StepMania___Xbox_Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /I "SDL_sound-1.0.0" /D "WIN32" /D "_XBOX" /D "NDEBUG" /YX"global.h" /FD /c
|
||||
# SUBTRACT CPP /Fr
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
XBCP=xbecopy.exe
|
||||
# ADD BASE XBCP /NOLOGO
|
||||
# ADD XBCP /NOLOGO
|
||||
XBE=imagebld.exe
|
||||
# ADD BASE XBE /nologo /stack:0x10000 /debug
|
||||
# ADD XBE /nologo /testid:"123456" /stack:0x10000 /debug /out:"../default.xbe"
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 $(intdir)\verstub.obj xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe"
|
||||
# SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||
# ADD LINK32 $(intdir)\verstub.obj xapilib.lib d3d8.lib d3dx8.lib xgraphics.lib dsound.lib dmusic.lib xnet.lib xboxkrnl.lib libcmt.lib /nologo /incremental:no /pdb:"../release6xbox/StepMania.pdb" /machine:I386 /nodefaultlib:"libc" /nodefaultlib:"libcmtd" /out:"../StepManiaXbox.exe" /subsystem:xbox /fixed:no /TMP /OPT:REF
|
||||
# SUBTRACT LINK32 /pdb:none /map /debug
|
||||
XBE=imagebld.exe
|
||||
# ADD BASE XBE /nologo /stack:0x10000 /debug
|
||||
# ADD XBE /nologo /testid:"123456" /stack:0x10000 /debug /out:"../default.xbe"
|
||||
XBCP=xbecopy.exe
|
||||
# ADD BASE XBCP /NOLOGO
|
||||
# ADD XBCP /NOLOGO
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /I "SDL_sound-1.0.0" /D "WIN32" /D "_XBOX" /D "NDEBUG" /YX"global.h" /FD /c
|
||||
# SUBTRACT CPP /Fr
|
||||
# Begin Special Build Tool
|
||||
IntDir=.\StepMania___Xbox_Release
|
||||
TargetDir=\stepmania\stepmania
|
||||
TargetName=default
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||
# End Special Build Tool
|
||||
|
||||
@@ -3334,6 +3326,25 @@ SOURCE=.\ScoreKeeper.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ScoreKeeper5th.cpp
|
||||
|
||||
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ScoreKeeper5th.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ScoreKeeperMAX2.cpp
|
||||
|
||||
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
||||
|
||||
Reference in New Issue
Block a user