2005-02-16 00:37:50 +00:00
|
|
|
#include "global.h"
|
|
|
|
|
#include "PlayerStageStats.h"
|
|
|
|
|
#include "RageLog.h"
|
2005-03-12 10:49:41 +00:00
|
|
|
#include "ThemeManager.h"
|
2005-02-16 00:37:50 +00:00
|
|
|
#include "Foreach.h"
|
2005-03-31 06:13:40 +00:00
|
|
|
#include "LuaManager.h"
|
2005-03-25 20:01:51 +00:00
|
|
|
#include <float.h>
|
2005-04-03 19:51:09 +00:00
|
|
|
#include "GameState.h"
|
|
|
|
|
#include "Course.h"
|
2005-04-26 04:16:45 +00:00
|
|
|
#include "Steps.h"
|
2005-10-08 02:10:32 +00:00
|
|
|
#include "ScoreKeeperNormal.h"
|
2006-03-17 03:44:11 +00:00
|
|
|
#include "PrefsManager.h"
|
2005-02-16 00:37:50 +00:00
|
|
|
|
2005-10-09 04:30:59 +00:00
|
|
|
#define GRADE_PERCENT_TIER(i) THEME->GetMetricF("PlayerStageStats",ssprintf("GradePercent%s",GradeToString((Grade)i).c_str()))
|
|
|
|
|
#define GRADE_TIER02_IS_ALL_W2S THEME->GetMetricB("PlayerStageStats","GradeTier02IsAllW2s")
|
2005-03-12 10:49:41 +00:00
|
|
|
|
2005-09-12 06:21:30 +00:00
|
|
|
const float LESSON_PASS_THRESHOLD = 0.8f;
|
|
|
|
|
|
2006-03-17 03:44:11 +00:00
|
|
|
Grade GetGradeFromPercent( float fPercent, bool bMerciful );
|
|
|
|
|
|
2005-02-16 00:37:50 +00:00
|
|
|
void PlayerStageStats::Init()
|
|
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
m_vpPlayedSteps.clear();
|
|
|
|
|
m_vpPossibleSteps.clear();
|
|
|
|
|
m_fAliveSeconds = 0;
|
|
|
|
|
m_bFailed = false;
|
|
|
|
|
m_iPossibleDancePoints = 0;
|
|
|
|
|
m_iCurPossibleDancePoints = 0;
|
|
|
|
|
m_iActualDancePoints = 0;
|
|
|
|
|
m_iPossibleGradePoints = 0;
|
|
|
|
|
m_iCurCombo = 0;
|
|
|
|
|
m_iMaxCombo = 0;
|
|
|
|
|
m_iCurMissCombo = 0;
|
2006-11-14 11:23:13 +00:00
|
|
|
m_iCurScoreMultiplier = 1;
|
2006-11-14 11:13:21 +00:00
|
|
|
m_iScore = 0;
|
|
|
|
|
m_iBonus = 0;
|
|
|
|
|
m_iMaxScore = 0;
|
|
|
|
|
m_iCurMaxScore = 0;
|
|
|
|
|
m_iSongsPassed = 0;
|
|
|
|
|
m_iSongsPlayed = 0;
|
|
|
|
|
m_fLifeRemainingSeconds = 0;
|
|
|
|
|
m_fCaloriesBurned = 0;
|
|
|
|
|
m_tnsLast = TapNoteScore_Invalid;
|
|
|
|
|
m_hnsLast = HoldNoteScore_Invalid;
|
|
|
|
|
|
|
|
|
|
ZERO( m_iTapNoteScores );
|
|
|
|
|
ZERO( m_iHoldNoteScores );
|
|
|
|
|
m_radarPossible.Zero();
|
|
|
|
|
m_radarActual.Zero();
|
|
|
|
|
|
|
|
|
|
m_fFirstSecond = FLT_MAX;
|
|
|
|
|
m_fLastSecond = 0;
|
2005-09-11 00:49:16 +00:00
|
|
|
|
2006-10-07 04:39:48 +00:00
|
|
|
m_pdaToShow = PerDifficultyAward_Invalid;
|
|
|
|
|
m_pcaToShow = PeakComboAward_Invalid;
|
2005-09-11 01:44:13 +00:00
|
|
|
m_iPersonalHighScoreIndex = -1;
|
|
|
|
|
m_iMachineHighScoreIndex = -1;
|
2006-09-26 20:49:10 +00:00
|
|
|
m_rc = RankingCategory_Invalid;
|
2005-09-11 01:44:13 +00:00
|
|
|
m_HighScore = HighScore();
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlayerStageStats::AddStats( const PlayerStageStats& other )
|
|
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
FOREACH_CONST( Steps*, other.m_vpPlayedSteps, s )
|
|
|
|
|
m_vpPlayedSteps.push_back( *s );
|
|
|
|
|
FOREACH_CONST( Steps*, other.m_vpPossibleSteps, s )
|
|
|
|
|
m_vpPossibleSteps.push_back( *s );
|
|
|
|
|
m_fAliveSeconds += other.m_fAliveSeconds;
|
|
|
|
|
m_bFailed |= other.m_bFailed;
|
|
|
|
|
m_iPossibleDancePoints += other.m_iPossibleDancePoints;
|
|
|
|
|
m_iActualDancePoints += other.m_iActualDancePoints;
|
|
|
|
|
m_iCurPossibleDancePoints += other.m_iCurPossibleDancePoints;
|
|
|
|
|
m_iPossibleGradePoints += other.m_iPossibleGradePoints;
|
2005-02-16 00:37:50 +00:00
|
|
|
|
2005-10-08 00:57:40 +00:00
|
|
|
for( int t=0; t<NUM_TapNoteScore; t++ )
|
2006-11-14 11:13:21 +00:00
|
|
|
m_iTapNoteScores[t] += other.m_iTapNoteScores[t];
|
2005-10-08 00:57:40 +00:00
|
|
|
for( int h=0; h<NUM_HoldNoteScore; h++ )
|
2006-11-14 11:13:21 +00:00
|
|
|
m_iHoldNoteScores[h] += other.m_iHoldNoteScores[h];
|
|
|
|
|
m_iCurCombo += other.m_iCurCombo;
|
|
|
|
|
m_iMaxCombo += other.m_iMaxCombo;
|
|
|
|
|
m_iCurMissCombo += other.m_iCurMissCombo;
|
|
|
|
|
m_iScore += other.m_iScore;
|
|
|
|
|
m_iMaxScore += other.m_iMaxScore;
|
|
|
|
|
m_iCurMaxScore += other.m_iCurMaxScore;
|
|
|
|
|
m_radarPossible += other.m_radarPossible;
|
|
|
|
|
m_radarActual += other.m_radarActual;
|
|
|
|
|
m_iSongsPassed += other.m_iSongsPassed;
|
|
|
|
|
m_iSongsPlayed += other.m_iSongsPlayed;
|
|
|
|
|
m_fCaloriesBurned += other.m_fCaloriesBurned;
|
|
|
|
|
m_fLifeRemainingSeconds = other.m_fLifeRemainingSeconds; // don't accumulate
|
|
|
|
|
|
|
|
|
|
const float fOtherFirstSecond = other.m_fFirstSecond + m_fLastSecond;
|
|
|
|
|
const float fOtherLastSecond = other.m_fLastSecond + m_fLastSecond;
|
|
|
|
|
m_fLastSecond = fOtherLastSecond;
|
2005-02-16 00:37:50 +00:00
|
|
|
|
|
|
|
|
map<float,float>::const_iterator it;
|
2006-11-14 11:13:21 +00:00
|
|
|
for( it = other.m_fLifeRecord.begin(); it != other.m_fLifeRecord.end(); ++it )
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
|
|
|
|
const float pos = it->first;
|
|
|
|
|
const float life = it->second;
|
2006-11-14 11:13:21 +00:00
|
|
|
m_fLifeRecord[fOtherFirstSecond+pos] = life;
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
for( unsigned i=0; i<other.m_ComboList.size(); ++i )
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
const Combo_t &combo = other.m_ComboList[i];
|
2005-02-16 00:37:50 +00:00
|
|
|
|
|
|
|
|
Combo_t newcombo(combo);
|
2006-11-14 11:13:21 +00:00
|
|
|
newcombo.m_fStartSecond += fOtherFirstSecond;
|
|
|
|
|
m_ComboList.push_back( newcombo );
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Merge identical combos. This normally only happens in course mode, when a combo
|
|
|
|
|
* continues between songs. */
|
2006-11-14 11:13:21 +00:00
|
|
|
for( unsigned i=1; i<m_ComboList.size(); ++i )
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
Combo_t &prevcombo = m_ComboList[i-1];
|
|
|
|
|
Combo_t &combo = m_ComboList[i];
|
|
|
|
|
const float PrevComboEnd = prevcombo.m_fStartSecond + prevcombo.m_fSizeSeconds;
|
|
|
|
|
const float ThisComboStart = combo.m_fStartSecond;
|
2005-02-16 00:37:50 +00:00
|
|
|
if( fabsf(PrevComboEnd - ThisComboStart) > 0.001 )
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* These are really the same combo. */
|
2006-11-14 11:13:21 +00:00
|
|
|
prevcombo.m_fSizeSeconds += combo.m_fSizeSeconds;
|
|
|
|
|
prevcombo.m_cnt += combo.m_cnt;
|
|
|
|
|
m_ComboList.erase( m_ComboList.begin()+i );
|
2005-02-16 00:37:50 +00:00
|
|
|
--i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2006-03-17 03:44:11 +00:00
|
|
|
Grade GetGradeFromPercent( float fPercent, bool bMerciful )
|
2005-03-31 06:13:40 +00:00
|
|
|
{
|
2006-03-17 03:44:11 +00:00
|
|
|
if( bMerciful )
|
|
|
|
|
fPercent = SCALE( fPercent, 0.0f, 1.0f, 0.5f, 1.0f );
|
|
|
|
|
|
2005-08-14 11:38:31 +00:00
|
|
|
Grade grade = Grade_Failed;
|
2005-03-31 06:13:40 +00:00
|
|
|
|
|
|
|
|
FOREACH_Grade(g)
|
|
|
|
|
{
|
|
|
|
|
if( fPercent >= GRADE_PERCENT_TIER(g) )
|
|
|
|
|
{
|
|
|
|
|
grade = g;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-03-31 17:26:25 +00:00
|
|
|
return grade;
|
2005-03-31 06:13:40 +00:00
|
|
|
}
|
|
|
|
|
|
2005-02-16 00:37:50 +00:00
|
|
|
Grade PlayerStageStats::GetGrade() const
|
|
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_bFailed )
|
2005-08-14 11:38:31 +00:00
|
|
|
return Grade_Failed;
|
2005-02-16 00:37:50 +00:00
|
|
|
|
|
|
|
|
/* XXX: This entire calculation should be in ScoreKeeper, but final evaluation
|
2005-03-17 02:14:15 +00:00
|
|
|
* is tricky since at that point the ScoreKeepers no longer exist. */
|
2005-04-26 04:16:45 +00:00
|
|
|
float fActual = 0;
|
2005-06-14 23:01:18 +00:00
|
|
|
|
|
|
|
|
bool bIsBeginner = false;
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_vpPlayedSteps.size() && !GAMESTATE->IsCourseMode() )
|
|
|
|
|
bIsBeginner = m_vpPlayedSteps[0]->GetDifficulty() == DIFFICULTY_BEGINNER;
|
2005-06-14 23:01:18 +00:00
|
|
|
|
2005-02-16 00:37:50 +00:00
|
|
|
FOREACH_TapNoteScore( tns )
|
|
|
|
|
{
|
2005-10-08 02:10:32 +00:00
|
|
|
int iTapScoreValue = ScoreKeeperNormal::TapNoteScoreToGradePoints( tns, bIsBeginner );
|
2006-11-14 11:13:21 +00:00
|
|
|
fActual += m_iTapNoteScores[tns] * iTapScoreValue;
|
|
|
|
|
LOG->Trace( "GetGrade actual: %i * %i", m_iTapNoteScores[tns], iTapScoreValue );
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FOREACH_HoldNoteScore( hns )
|
|
|
|
|
{
|
2005-10-08 02:10:32 +00:00
|
|
|
int iHoldScoreValue = ScoreKeeperNormal::HoldNoteScoreToGradePoints( hns, bIsBeginner );
|
2006-11-14 11:13:21 +00:00
|
|
|
fActual += m_iHoldNoteScores[hns] * iHoldScoreValue;
|
|
|
|
|
LOG->Trace( "GetGrade actual: %i * %i", m_iHoldNoteScores[hns], iHoldScoreValue );
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
LOG->Trace( "GetGrade: fActual: %f, fPossible: %d", fActual, m_iPossibleGradePoints );
|
2005-02-16 00:37:50 +00:00
|
|
|
|
|
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
float fPercent = (m_iPossibleGradePoints == 0) ? 0 : fActual / m_iPossibleGradePoints;
|
2005-02-16 00:37:50 +00:00
|
|
|
|
2006-03-17 03:44:11 +00:00
|
|
|
|
|
|
|
|
bool bMerciful =
|
2006-11-14 11:13:21 +00:00
|
|
|
m_vpPlayedSteps.size() > 0 &&
|
2006-03-17 03:44:11 +00:00
|
|
|
GAMESTATE->m_PlayMode == PLAY_MODE_REGULAR &&
|
|
|
|
|
PREFSMAN->m_bMercifulBeginner;
|
2006-11-14 11:13:21 +00:00
|
|
|
FOREACH_CONST( Steps*, m_vpPlayedSteps, s )
|
2006-03-17 03:44:11 +00:00
|
|
|
{
|
|
|
|
|
if( (*s)->GetDifficulty() != DIFFICULTY_BEGINNER )
|
|
|
|
|
bMerciful = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Grade grade = GetGradeFromPercent( fPercent, bMerciful );
|
2005-02-16 00:37:50 +00:00
|
|
|
|
2005-10-09 07:01:48 +00:00
|
|
|
LOG->Trace( "GetGrade: Grade: %s, %i", GradeToString(grade).c_str(), GRADE_TIER02_IS_ALL_W2S );
|
|
|
|
|
if( GRADE_TIER02_IS_ALL_W2S )
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_iTapNoteScores[TNS_W1] > 0 &&
|
|
|
|
|
m_iTapNoteScores[TNS_W2] == 0 &&
|
|
|
|
|
m_iTapNoteScores[TNS_W3] == 0 &&
|
|
|
|
|
m_iTapNoteScores[TNS_W4] == 0 &&
|
|
|
|
|
m_iTapNoteScores[TNS_W5] == 0 &&
|
|
|
|
|
m_iTapNoteScores[TNS_Miss] == 0 &&
|
|
|
|
|
m_iTapNoteScores[TNS_HitMine] == 0 &&
|
|
|
|
|
m_iHoldNoteScores[HNS_LetGo] == 0 )
|
2005-08-14 11:38:31 +00:00
|
|
|
return Grade_Tier01;
|
2005-02-16 00:37:50 +00:00
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_iTapNoteScores[TNS_W2] > 0 &&
|
|
|
|
|
m_iTapNoteScores[TNS_W3] == 0 &&
|
|
|
|
|
m_iTapNoteScores[TNS_W4] == 0 &&
|
|
|
|
|
m_iTapNoteScores[TNS_W5] == 0 &&
|
|
|
|
|
m_iTapNoteScores[TNS_Miss] == 0 &&
|
|
|
|
|
m_iTapNoteScores[TNS_HitMine] == 0 &&
|
|
|
|
|
m_iHoldNoteScores[HNS_LetGo] == 0 )
|
2005-08-14 11:38:31 +00:00
|
|
|
return Grade_Tier02;
|
2005-02-16 00:37:50 +00:00
|
|
|
|
2005-08-14 11:38:31 +00:00
|
|
|
return max( grade, Grade_Tier03 );
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return grade;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float PlayerStageStats::GetPercentDancePoints() const
|
|
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_iPossibleDancePoints == 0 )
|
2005-02-16 00:37:50 +00:00
|
|
|
return 0; // div/0
|
|
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_iActualDancePoints == m_iPossibleDancePoints )
|
2005-02-16 00:37:50 +00:00
|
|
|
return 1; // correct for rounding error
|
|
|
|
|
|
|
|
|
|
/* This can happen in battle, with transform attacks. */
|
|
|
|
|
//ASSERT_M( iActualDancePoints <= iPossibleDancePoints, ssprintf("%i/%i", iActualDancePoints, iPossibleDancePoints) );
|
|
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
float fPercentDancePoints = m_iActualDancePoints / (float)m_iPossibleDancePoints;
|
2005-02-16 00:37:50 +00:00
|
|
|
|
|
|
|
|
return fPercentDancePoints;
|
|
|
|
|
}
|
|
|
|
|
|
2005-04-05 08:50:55 +00:00
|
|
|
float PlayerStageStats::GetCurMaxPercentDancePoints() const
|
|
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
if ( m_iPossibleDancePoints == 0 )
|
2005-04-05 08:50:55 +00:00
|
|
|
return 0; // div/0
|
|
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
if ( m_iCurPossibleDancePoints == m_iPossibleDancePoints )
|
2005-04-05 08:50:55 +00:00
|
|
|
return 1; // correct for rounding error
|
|
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
float fCurMaxPercentDancePoints = m_iCurPossibleDancePoints / (float)m_iPossibleDancePoints;
|
2005-04-05 08:50:55 +00:00
|
|
|
|
|
|
|
|
return fCurMaxPercentDancePoints;
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-09 21:49:29 +00:00
|
|
|
int PlayerStageStats::GetLessonScoreActual() const
|
|
|
|
|
{
|
|
|
|
|
int iScore = 0;
|
|
|
|
|
|
|
|
|
|
FOREACH_TapNoteScore( tns )
|
|
|
|
|
{
|
|
|
|
|
switch( tns )
|
|
|
|
|
{
|
2005-10-08 00:57:40 +00:00
|
|
|
case TNS_AvoidMine:
|
2005-10-09 04:30:59 +00:00
|
|
|
case TNS_W5:
|
|
|
|
|
case TNS_W4:
|
|
|
|
|
case TNS_W3:
|
|
|
|
|
case TNS_W2:
|
|
|
|
|
case TNS_W1:
|
2006-11-14 11:13:21 +00:00
|
|
|
iScore += m_iTapNoteScores[tns];
|
2005-09-09 21:49:29 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FOREACH_HoldNoteScore( hns )
|
|
|
|
|
{
|
|
|
|
|
switch( hns )
|
|
|
|
|
{
|
2005-10-08 00:57:40 +00:00
|
|
|
case HNS_Held:
|
2006-11-14 11:13:21 +00:00
|
|
|
iScore += m_iHoldNoteScores[hns];
|
2005-09-09 21:49:29 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return iScore;
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-12 06:21:30 +00:00
|
|
|
int PlayerStageStats::GetLessonScoreNeeded() const
|
2005-09-09 21:49:29 +00:00
|
|
|
{
|
2005-09-22 03:10:47 +00:00
|
|
|
float fScore = 0;
|
2005-09-09 21:49:29 +00:00
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
FOREACH_CONST( Steps*, m_vpPossibleSteps, steps )
|
2006-07-28 03:34:14 +00:00
|
|
|
fScore += (*steps)->GetRadarValues( PLAYER_1 ).m_Values.v.fNumTapsAndHolds;
|
2005-09-09 21:49:29 +00:00
|
|
|
|
2005-09-22 03:10:47 +00:00
|
|
|
return lrintf( fScore * LESSON_PASS_THRESHOLD );
|
2005-09-09 21:49:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlayerStageStats::ResetScoreForLesson()
|
|
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
m_iCurPossibleDancePoints = 0;
|
|
|
|
|
m_iActualDancePoints = 0;
|
2005-09-09 21:49:29 +00:00
|
|
|
FOREACH_TapNoteScore( tns )
|
2006-11-14 11:13:21 +00:00
|
|
|
m_iTapNoteScores[tns] = 0;
|
2005-09-09 21:49:29 +00:00
|
|
|
FOREACH_HoldNoteScore( hns )
|
2006-11-14 11:13:21 +00:00
|
|
|
m_iHoldNoteScores[hns] = 0;
|
|
|
|
|
m_iCurCombo = 0;
|
|
|
|
|
m_iMaxCombo = 0;
|
|
|
|
|
m_iCurMissCombo = 0;
|
|
|
|
|
m_iScore = 0;
|
|
|
|
|
m_iCurMaxScore = 0;
|
|
|
|
|
m_iMaxScore = 0;
|
2005-09-09 21:49:29 +00:00
|
|
|
}
|
|
|
|
|
|
2005-04-23 02:50:26 +00:00
|
|
|
void PlayerStageStats::SetLifeRecordAt( float fLife, float fStepsSecond )
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
2005-04-03 19:51:09 +00:00
|
|
|
// Don't save life stats in endless courses, or could run OOM in a few hours.
|
|
|
|
|
if( GAMESTATE->m_pCurCourse && GAMESTATE->m_pCurCourse->IsEndless() )
|
|
|
|
|
return;
|
|
|
|
|
|
2005-04-23 02:50:26 +00:00
|
|
|
if( fStepsSecond < 0 )
|
2005-02-16 00:37:50 +00:00
|
|
|
return;
|
|
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
m_fFirstSecond = min( fStepsSecond, m_fFirstSecond );
|
|
|
|
|
m_fLastSecond = max( fStepsSecond, m_fLastSecond );
|
|
|
|
|
//LOG->Trace( "fLastSecond = %f", m_fLastSecond );
|
2005-02-16 00:37:50 +00:00
|
|
|
|
2005-04-03 23:32:30 +00:00
|
|
|
// fSecond will always be greater than any value already in the map.
|
2006-11-14 11:13:21 +00:00
|
|
|
m_fLifeRecord[fStepsSecond] = fLife;
|
2005-04-03 23:32:30 +00:00
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Memory optimization:
|
|
|
|
|
// If we have three consecutive records A, B, and C all with the same fLife,
|
|
|
|
|
// we can eliminate record B without losing data. Only check the last three
|
|
|
|
|
// records in the map since we're only inserting at the end, and we know all
|
|
|
|
|
// earlier redundant records have already been removed.
|
|
|
|
|
//
|
2006-11-14 11:13:21 +00:00
|
|
|
map<float,float>::iterator C = m_fLifeRecord.end();
|
2005-04-03 23:32:30 +00:00
|
|
|
--C;
|
2006-11-14 11:13:21 +00:00
|
|
|
if( C == m_fLifeRecord.begin() ) // no earlier records left
|
2005-04-03 23:32:30 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
map<float,float>::iterator B = C;
|
|
|
|
|
--B;
|
2006-11-14 11:13:21 +00:00
|
|
|
if( B == m_fLifeRecord.begin() ) // no earlier records left
|
2005-04-03 23:32:30 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
map<float,float>::iterator A = B;
|
|
|
|
|
--A;
|
|
|
|
|
|
|
|
|
|
if( A->second == B->second && B->second == C->second )
|
2006-11-14 11:13:21 +00:00
|
|
|
m_fLifeRecord.erase(B);
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
2005-04-23 02:50:26 +00:00
|
|
|
float PlayerStageStats::GetLifeRecordAt( float fStepsSecond ) const
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_fLifeRecord.empty() )
|
2005-04-03 23:32:30 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* Find the first element whose key is greater than k. */
|
2006-11-14 11:13:21 +00:00
|
|
|
map<float,float>::const_iterator it = m_fLifeRecord.upper_bound( fStepsSecond );
|
2005-02-16 00:37:50 +00:00
|
|
|
|
2005-04-03 23:32:30 +00:00
|
|
|
/* Find the last element whose key is less than or equal to k. */
|
2006-11-14 11:13:21 +00:00
|
|
|
if( it != m_fLifeRecord.begin() )
|
2005-02-16 00:37:50 +00:00
|
|
|
--it;
|
|
|
|
|
|
|
|
|
|
return it->second;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2005-04-23 02:50:26 +00:00
|
|
|
float PlayerStageStats::GetLifeRecordLerpAt( float fStepsSecond ) const
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_fLifeRecord.empty() )
|
2005-04-03 23:32:30 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* Find the first element whose key is greater than k. */
|
2006-11-14 11:13:21 +00:00
|
|
|
map<float,float>::const_iterator later = m_fLifeRecord.upper_bound( fStepsSecond );
|
2005-02-16 00:37:50 +00:00
|
|
|
|
2005-04-03 23:32:30 +00:00
|
|
|
/* Find the last element whose key is less than or equal to k. */
|
2005-02-16 00:37:50 +00:00
|
|
|
map<float,float>::const_iterator earlier = later;
|
2006-11-14 11:13:21 +00:00
|
|
|
if( earlier != m_fLifeRecord.begin() )
|
2005-02-16 00:37:50 +00:00
|
|
|
--earlier;
|
|
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
if( later == m_fLifeRecord.end() )
|
2005-02-16 00:37:50 +00:00
|
|
|
return earlier->second;
|
2006-06-27 15:49:37 +00:00
|
|
|
|
|
|
|
|
if( earlier->first == later->first ) // two samples from the same time. Don't divide by zero in SCALE
|
|
|
|
|
return earlier->second;
|
2005-02-16 00:37:50 +00:00
|
|
|
|
|
|
|
|
/* earlier <= pos <= later */
|
2005-04-23 02:50:26 +00:00
|
|
|
return SCALE( fStepsSecond, earlier->first, later->first, earlier->second, later->second );
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-23 02:50:26 +00:00
|
|
|
void PlayerStageStats::GetLifeRecord( float *fLifeOut, int iNumSamples, float fStepsEndSecond ) const
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
|
|
|
|
for( int i = 0; i < iNumSamples; ++i )
|
|
|
|
|
{
|
2005-04-23 02:50:26 +00:00
|
|
|
float from = SCALE( i, 0, (float)iNumSamples, 0.0f, fStepsEndSecond );
|
2005-02-16 00:37:50 +00:00
|
|
|
fLifeOut[i] = GetLifeRecordLerpAt( from );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-12-19 01:37:24 +00:00
|
|
|
/* If bRollover is true, we're being called before gameplay begins, so we can record
|
2005-02-16 00:37:50 +00:00
|
|
|
* the amount of the first combo that comes from the previous song. */
|
2005-12-19 01:28:33 +00:00
|
|
|
void PlayerStageStats::UpdateComboList( float fSecond, bool bRollover )
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
2005-04-03 19:51:09 +00:00
|
|
|
// Don't save combo stats in endless courses, or could run OOM in a few hours.
|
|
|
|
|
if( GAMESTATE->m_pCurCourse && GAMESTATE->m_pCurCourse->IsEndless() )
|
|
|
|
|
return;
|
|
|
|
|
|
2005-02-16 00:37:50 +00:00
|
|
|
if( fSecond < 0 )
|
|
|
|
|
return;
|
|
|
|
|
|
2005-12-19 01:28:33 +00:00
|
|
|
if( !bRollover )
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
m_fFirstSecond = min( fSecond, m_fFirstSecond );
|
|
|
|
|
m_fLastSecond = max( fSecond, m_fLastSecond );
|
2005-02-16 00:37:50 +00:00
|
|
|
//LOG->Trace( "fLastSecond = %f", fLastSecond );
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
int cnt = m_iCurCombo;
|
2005-02-16 00:37:50 +00:00
|
|
|
if( !cnt )
|
|
|
|
|
return; /* no combo */
|
|
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_ComboList.size() == 0 || m_ComboList.back().m_cnt >= cnt )
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
|
|
|
|
/* If the previous combo (if any) starts on -9999, then we rolled over some
|
|
|
|
|
* combo, but missed the first step. Remove it. */
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_ComboList.size() && m_ComboList.back().m_fStartSecond == -9999 )
|
|
|
|
|
m_ComboList.erase( m_ComboList.begin()+m_ComboList.size()-1, m_ComboList.end() );
|
2005-02-16 00:37:50 +00:00
|
|
|
|
|
|
|
|
/* This is a new combo. */
|
|
|
|
|
Combo_t NewCombo;
|
|
|
|
|
/* "start" is the position that the combo started within this song. If we're
|
|
|
|
|
* recording rollover, the combo hasn't started yet (within this song), so put
|
|
|
|
|
* a placeholder in and set it on the next call. (Otherwise, start will be less
|
|
|
|
|
* than fFirstPos.) */
|
2005-12-19 01:28:33 +00:00
|
|
|
if( bRollover )
|
2006-11-14 11:13:21 +00:00
|
|
|
NewCombo.m_fStartSecond = -9999;
|
2005-02-16 00:37:50 +00:00
|
|
|
else
|
2006-11-14 11:13:21 +00:00
|
|
|
NewCombo.m_fStartSecond = fSecond;
|
|
|
|
|
m_ComboList.push_back( NewCombo );
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
Combo_t &combo = m_ComboList.back();
|
|
|
|
|
if( !bRollover && combo.m_fStartSecond == -9999 )
|
|
|
|
|
combo.m_fStartSecond = 0;
|
2005-12-19 01:33:14 +00:00
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
combo.m_fSizeSeconds = fSecond - combo.m_fStartSecond;
|
|
|
|
|
combo.m_cnt = cnt;
|
2005-02-16 00:37:50 +00:00
|
|
|
|
2005-12-19 01:28:33 +00:00
|
|
|
if( bRollover )
|
2006-11-14 11:13:21 +00:00
|
|
|
combo.m_rollover = cnt;
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* This returns the largest combo contained within the song, as if
|
|
|
|
|
* m_bComboContinuesBetweenSongs is turned off. */
|
|
|
|
|
PlayerStageStats::Combo_t PlayerStageStats::GetMaxCombo() const
|
|
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_ComboList.size() == 0 )
|
2005-02-16 00:37:50 +00:00
|
|
|
return Combo_t();
|
|
|
|
|
|
|
|
|
|
int m = 0;
|
2006-11-14 11:13:21 +00:00
|
|
|
for( unsigned i = 1; i < m_ComboList.size(); ++i )
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_ComboList[i].m_cnt > m_ComboList[m].m_cnt )
|
2005-02-16 00:37:50 +00:00
|
|
|
m = i;
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-14 11:13:21 +00:00
|
|
|
return m_ComboList[m];
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int PlayerStageStats::GetComboAtStartOfStage() const
|
|
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_ComboList.empty() )
|
2005-02-16 00:37:50 +00:00
|
|
|
return 0;
|
|
|
|
|
else
|
2006-11-14 11:13:21 +00:00
|
|
|
return m_ComboList[0].m_rollover;
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool PlayerStageStats::FullComboOfScore( TapNoteScore tnsAllGreaterOrEqual ) const
|
|
|
|
|
{
|
2005-10-09 04:30:59 +00:00
|
|
|
ASSERT( tnsAllGreaterOrEqual >= TNS_W3 );
|
|
|
|
|
ASSERT( tnsAllGreaterOrEqual <= TNS_W1 );
|
2005-04-18 21:14:55 +00:00
|
|
|
|
|
|
|
|
// If missed any holds, then it's not a full combo
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_iHoldNoteScores[HNS_LetGo] > 0 )
|
2005-02-16 00:37:50 +00:00
|
|
|
return false;
|
|
|
|
|
|
2005-04-18 21:14:55 +00:00
|
|
|
// If has any of the judgments below, then not a full combo
|
2005-10-08 00:57:40 +00:00
|
|
|
for( int i=TNS_Miss; i<tnsAllGreaterOrEqual; i++ )
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_iTapNoteScores[i] > 0 )
|
2005-02-16 00:37:50 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
2005-04-18 21:14:55 +00:00
|
|
|
|
|
|
|
|
// If has at least one of the judgments equal to or above, then is a full combo.
|
2005-10-08 00:57:40 +00:00
|
|
|
for( int i=tnsAllGreaterOrEqual; i<NUM_TapNoteScore; i++ )
|
2005-04-18 21:14:55 +00:00
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
if( m_iTapNoteScores[i] > 0 )
|
2005-04-18 21:14:55 +00:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool PlayerStageStats::SingleDigitsOfScore( TapNoteScore tnsAllGreaterOrEqual ) const
|
|
|
|
|
{
|
|
|
|
|
return FullComboOfScore( tnsAllGreaterOrEqual ) &&
|
2006-11-14 11:13:21 +00:00
|
|
|
m_iTapNoteScores[tnsAllGreaterOrEqual] < 10;
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool PlayerStageStats::OneOfScore( TapNoteScore tnsAllGreaterOrEqual ) const
|
|
|
|
|
{
|
|
|
|
|
return FullComboOfScore( tnsAllGreaterOrEqual ) &&
|
2006-11-14 11:13:21 +00:00
|
|
|
m_iTapNoteScores[tnsAllGreaterOrEqual] == 1;
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int PlayerStageStats::GetTotalTaps() const
|
|
|
|
|
{
|
|
|
|
|
int iTotalTaps = 0;
|
2005-10-08 00:57:40 +00:00
|
|
|
for( int i=TNS_Miss; i<NUM_TapNoteScore; i++ )
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
iTotalTaps += m_iTapNoteScores[i];
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
return iTotalTaps;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float PlayerStageStats::GetPercentageOfTaps( TapNoteScore tns ) const
|
|
|
|
|
{
|
|
|
|
|
int iTotalTaps = 0;
|
2005-10-08 00:57:40 +00:00
|
|
|
for( int i=TNS_Miss; i<NUM_TapNoteScore; i++ )
|
2005-02-16 00:37:50 +00:00
|
|
|
{
|
2006-11-14 11:13:21 +00:00
|
|
|
iTotalTaps += m_iTapNoteScores[i];
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
2006-11-14 11:13:21 +00:00
|
|
|
return m_iTapNoteScores[tns] / (float)iTotalTaps;
|
2005-02-16 00:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
2005-10-01 00:18:13 +00:00
|
|
|
void PlayerStageStats::CalcAwards( PlayerNumber p, bool bGaveUp, bool bUsedAutoplay )
|
2005-09-11 00:48:29 +00:00
|
|
|
{
|
|
|
|
|
LOG->Trace( "hand out awards" );
|
|
|
|
|
|
2006-10-07 04:39:48 +00:00
|
|
|
m_pcaToShow = PeakComboAward_Invalid;
|
2005-10-01 00:18:13 +00:00
|
|
|
|
|
|
|
|
if( bGaveUp || bUsedAutoplay )
|
|
|
|
|
return;
|
|
|
|
|
|
2005-09-11 00:48:29 +00:00
|
|
|
deque<PerDifficultyAward> &vPdas = GAMESTATE->m_vLastPerDifficultyAwards[p];
|
|
|
|
|
|
|
|
|
|
LOG->Trace( "per difficulty awards" );
|
|
|
|
|
|
|
|
|
|
// per-difficulty awards
|
|
|
|
|
// don't give per-difficutly awards if using easy mods
|
|
|
|
|
if( !GAMESTATE->IsDisqualified(p) )
|
|
|
|
|
{
|
2005-10-09 04:30:59 +00:00
|
|
|
if( FullComboOfScore( TNS_W3 ) )
|
|
|
|
|
vPdas.push_back( AWARD_FULL_COMBO_W3 );
|
|
|
|
|
if( SingleDigitsOfScore( TNS_W3 ) )
|
|
|
|
|
vPdas.push_back( AWARD_SINGLE_DIGIT_W3 );
|
|
|
|
|
if( FullComboOfScore( TNS_W2 ) )
|
|
|
|
|
vPdas.push_back( AWARD_FULL_COMBO_W2 );
|
|
|
|
|
if( SingleDigitsOfScore( TNS_W2 ) )
|
|
|
|
|
vPdas.push_back( AWARD_SINGLE_DIGIT_W2 );
|
|
|
|
|
if( FullComboOfScore( TNS_W1 ) )
|
|
|
|
|
vPdas.push_back( AWARD_FULL_COMBO_W1 );
|
2005-09-11 00:48:29 +00:00
|
|
|
|
2005-10-09 04:30:59 +00:00
|
|
|
if( OneOfScore( TNS_W3 ) )
|
|
|
|
|
vPdas.push_back( AWARD_ONE_W3 );
|
|
|
|
|
if( OneOfScore( TNS_W2 ) )
|
|
|
|
|
vPdas.push_back( AWARD_ONE_W2 );
|
|
|
|
|
|
|
|
|
|
float fPercentW3s = GetPercentageOfTaps( TNS_W3 );
|
|
|
|
|
if( fPercentW3s >= 0.8f )
|
|
|
|
|
vPdas.push_back( AWARD_PERCENT_80_W3 );
|
|
|
|
|
if( fPercentW3s >= 0.9f )
|
|
|
|
|
vPdas.push_back( AWARD_PERCENT_90_W3 );
|
|
|
|
|
if( fPercentW3s >= 1.f )
|
|
|
|
|
vPdas.push_back( AWARD_PERCENT_100_W3 );
|
2005-09-11 00:48:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Max one PDA per stage
|
|
|
|
|
if( !vPdas.empty() )
|
|
|
|
|
vPdas.erase( vPdas.begin(), vPdas.end()-1 );
|
|
|
|
|
|
|
|
|
|
if( !vPdas.empty() )
|
|
|
|
|
m_pdaToShow = vPdas.back();
|
|
|
|
|
else
|
2006-10-07 04:39:48 +00:00
|
|
|
m_pdaToShow = PerDifficultyAward_Invalid;
|
2005-09-11 00:48:29 +00:00
|
|
|
|
|
|
|
|
LOG->Trace( "done with per difficulty awards" );
|
|
|
|
|
|
|
|
|
|
// DO give peak combo awards if using easy mods
|
|
|
|
|
int iComboAtStartOfStage = GetComboAtStartOfStage();
|
2006-11-14 11:13:21 +00:00
|
|
|
int iPeakCombo = GetMaxCombo().m_cnt;
|
2005-09-11 00:48:29 +00:00
|
|
|
|
|
|
|
|
FOREACH_PeakComboAward( pca )
|
|
|
|
|
{
|
|
|
|
|
int iLevel = 1000 * (pca+1);
|
|
|
|
|
bool bCrossedLevel = iComboAtStartOfStage < iLevel && iPeakCombo >= iLevel;
|
|
|
|
|
LOG->Trace( "pca = %d, iLevel = %d, bCrossedLevel = %d", pca, iLevel, bCrossedLevel );
|
|
|
|
|
if( bCrossedLevel )
|
|
|
|
|
GAMESTATE->m_vLastPeakComboAwards[p].push_back( pca );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( !GAMESTATE->m_vLastPeakComboAwards[p].empty() )
|
|
|
|
|
m_pcaToShow = GAMESTATE->m_vLastPeakComboAwards[p].back();
|
|
|
|
|
else
|
2006-10-07 04:39:48 +00:00
|
|
|
m_pcaToShow = PeakComboAward_Invalid;
|
2005-09-11 00:48:29 +00:00
|
|
|
|
|
|
|
|
LOG->Trace( "done with per combo awards" );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2005-02-16 00:37:50 +00:00
|
|
|
|
2006-03-17 03:44:11 +00:00
|
|
|
LuaFunction( GetGradeFromPercent, GetGradeFromPercent( FArg(1), false ) )
|
2005-03-31 06:13:40 +00:00
|
|
|
|
|
|
|
|
|
2005-02-16 02:11:31 +00:00
|
|
|
// lua start
|
|
|
|
|
#include "LuaBinding.h"
|
|
|
|
|
|
2005-06-20 05:02:03 +00:00
|
|
|
class LunaPlayerStageStats: public Luna<PlayerStageStats>
|
2005-02-16 02:11:31 +00:00
|
|
|
{
|
|
|
|
|
public:
|
2006-11-14 11:13:21 +00:00
|
|
|
DEFINE_METHOD( GetCaloriesBurned, m_fCaloriesBurned )
|
|
|
|
|
DEFINE_METHOD( GetLifeRemainingSeconds, m_fLifeRemainingSeconds )
|
2006-03-11 02:49:11 +00:00
|
|
|
DEFINE_METHOD( GetSurvivalSeconds, GetSurvivalSeconds() )
|
2006-11-14 11:23:13 +00:00
|
|
|
DEFINE_METHOD( GetCurrentCombo, m_iCurCombo )
|
|
|
|
|
DEFINE_METHOD( GetCurrentScoreMultiplier, m_iCurScoreMultiplier )
|
2006-03-11 02:49:11 +00:00
|
|
|
DEFINE_METHOD( FullCombo, FullCombo() )
|
2006-11-14 11:13:21 +00:00
|
|
|
DEFINE_METHOD( MaxCombo, GetMaxCombo().m_cnt )
|
2006-03-11 02:49:11 +00:00
|
|
|
DEFINE_METHOD( GetGrade, GetGrade() )
|
2005-09-12 06:21:30 +00:00
|
|
|
DEFINE_METHOD( GetLessonScoreActual, GetLessonScoreActual() )
|
|
|
|
|
DEFINE_METHOD( GetLessonScoreNeeded, GetLessonScoreNeeded() )
|
|
|
|
|
DEFINE_METHOD( GetPersonalHighScoreIndex, m_iPersonalHighScoreIndex )
|
|
|
|
|
DEFINE_METHOD( GetMachineHighScoreIndex, m_iMachineHighScoreIndex )
|
|
|
|
|
DEFINE_METHOD( GetPerDifficultyAward, m_pdaToShow )
|
2006-03-11 02:49:11 +00:00
|
|
|
DEFINE_METHOD( GetPeakComboAward, m_pcaToShow )
|
2005-02-16 02:11:31 +00:00
|
|
|
|
2006-09-27 19:53:05 +00:00
|
|
|
LunaPlayerStageStats()
|
2005-02-16 02:11:31 +00:00
|
|
|
{
|
2005-09-10 02:47:04 +00:00
|
|
|
ADD_METHOD( GetCaloriesBurned );
|
|
|
|
|
ADD_METHOD( GetLifeRemainingSeconds );
|
|
|
|
|
ADD_METHOD( GetSurvivalSeconds );
|
2006-11-14 11:23:13 +00:00
|
|
|
ADD_METHOD( GetCurrentCombo );
|
|
|
|
|
ADD_METHOD( GetCurrentScoreMultiplier );
|
2005-09-10 02:47:04 +00:00
|
|
|
ADD_METHOD( FullCombo );
|
|
|
|
|
ADD_METHOD( MaxCombo );
|
|
|
|
|
ADD_METHOD( GetGrade );
|
|
|
|
|
ADD_METHOD( GetLessonScoreActual );
|
2005-09-12 06:21:30 +00:00
|
|
|
ADD_METHOD( GetLessonScoreNeeded );
|
2005-09-11 01:50:12 +00:00
|
|
|
ADD_METHOD( GetPersonalHighScoreIndex );
|
|
|
|
|
ADD_METHOD( GetMachineHighScoreIndex );
|
|
|
|
|
ADD_METHOD( GetPerDifficultyAward );
|
|
|
|
|
ADD_METHOD( GetPeakComboAward );
|
2005-02-16 02:11:31 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
LUA_REGISTER_CLASS( PlayerStageStats )
|
|
|
|
|
// lua end
|
|
|
|
|
|
|
|
|
|
|
2005-02-16 00:37:50 +00:00
|
|
|
/*
|
|
|
|
|
* (c) 2001-2004 Chris Danford, Glenn Maynard
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the
|
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
* distribute, and/or sell copies of the Software, and to permit persons to
|
|
|
|
|
* whom the Software is furnished to do so, provided that the above
|
|
|
|
|
* copyright notice(s) and this permission notice appear in all copies of
|
|
|
|
|
* the Software and that both the above copyright notice(s) and this
|
|
|
|
|
* permission notice appear in supporting documentation.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
|
|
|
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
|
|
|
|
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
|
|
|
|
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
|
|
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
|
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
*/
|