[HighScore] Added Max Combo, Stage Award and Peak Award. New Lua bindings for HighScore: GetMaxCombo(), GetStageAward(), GetPeakComboAward().
This commit is contained in:
@@ -8,6 +8,12 @@ ________________________________________________________________________________
|
|||||||
StepMania 5.0 alpha 1a | 2012021?
|
StepMania 5.0 alpha 1a | 2012021?
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
2012/02/15
|
||||||
|
----------
|
||||||
|
* [HighScore] Added Max Combo, Stage Award and Peak Award. New Lua bindings for
|
||||||
|
HighScore: GetMaxCombo(), GetStageAward(), GetPeakComboAward(). [AJ]
|
||||||
|
(the specifics of this are subject to change.)
|
||||||
|
|
||||||
2012/02/10
|
2012/02/10
|
||||||
----------
|
----------
|
||||||
* [WheelBase, WheelItemBase] Turned WheelItemDataType into a Lua type,
|
* [WheelBase, WheelItemBase] Turned WheelItemDataType into a Lua type,
|
||||||
|
|||||||
+28
-2
@@ -18,6 +18,9 @@ struct HighScoreImpl
|
|||||||
int iScore;
|
int iScore;
|
||||||
float fPercentDP;
|
float fPercentDP;
|
||||||
float fSurviveSeconds;
|
float fSurviveSeconds;
|
||||||
|
int iMaxCombo; // maximum combo obtained [SM5 alpha 1a+]
|
||||||
|
StageAward stageAward; // stage award [SM5 alpha 1a+]
|
||||||
|
PeakComboAward peakComboAward; // peak combo award [SM5 alpha 1a+]
|
||||||
RString sModifiers;
|
RString sModifiers;
|
||||||
DateTime dateTime; // return value of time() when screenshot was taken
|
DateTime dateTime; // return value of time() when screenshot was taken
|
||||||
RString sPlayerGuid; // who made this high score
|
RString sPlayerGuid; // who made this high score
|
||||||
@@ -43,6 +46,9 @@ bool HighScoreImpl::operator==( const HighScoreImpl& other ) const
|
|||||||
COMPARE( sName );
|
COMPARE( sName );
|
||||||
COMPARE( grade );
|
COMPARE( grade );
|
||||||
COMPARE( iScore );
|
COMPARE( iScore );
|
||||||
|
COMPARE( iMaxCombo );
|
||||||
|
COMPARE( stageAward );
|
||||||
|
COMPARE( peakComboAward );
|
||||||
COMPARE( fPercentDP );
|
COMPARE( fPercentDP );
|
||||||
COMPARE( fSurviveSeconds );
|
COMPARE( fSurviveSeconds );
|
||||||
COMPARE( sModifiers );
|
COMPARE( sModifiers );
|
||||||
@@ -69,6 +75,9 @@ HighScoreImpl::HighScoreImpl()
|
|||||||
iScore = 0;
|
iScore = 0;
|
||||||
fPercentDP = 0;
|
fPercentDP = 0;
|
||||||
fSurviveSeconds = 0;
|
fSurviveSeconds = 0;
|
||||||
|
iMaxCombo = 0;
|
||||||
|
stageAward = StageAward_Invalid;
|
||||||
|
peakComboAward = PeakComboAward_Invalid;
|
||||||
sModifiers = "";
|
sModifiers = "";
|
||||||
dateTime.Init();
|
dateTime.Init();
|
||||||
sPlayerGuid = "";
|
sPlayerGuid = "";
|
||||||
@@ -92,6 +101,9 @@ XNode *HighScoreImpl::CreateNode() const
|
|||||||
pNode->AppendChild( "Score", iScore );
|
pNode->AppendChild( "Score", iScore );
|
||||||
pNode->AppendChild( "PercentDP", fPercentDP );
|
pNode->AppendChild( "PercentDP", fPercentDP );
|
||||||
pNode->AppendChild( "SurviveSeconds", fSurviveSeconds );
|
pNode->AppendChild( "SurviveSeconds", fSurviveSeconds );
|
||||||
|
pNode->AppendChild( "MaxCombo", iMaxCombo );
|
||||||
|
pNode->AppendChild( "StageAward", StageAwardToString(stageAward) );
|
||||||
|
pNode->AppendChild( "PeakComboAward", PeakComboAwardToString(peakComboAward) );
|
||||||
pNode->AppendChild( "Modifiers", sModifiers );
|
pNode->AppendChild( "Modifiers", sModifiers );
|
||||||
pNode->AppendChild( "DateTime", dateTime.GetString() );
|
pNode->AppendChild( "DateTime", dateTime.GetString() );
|
||||||
pNode->AppendChild( "PlayerGuid", sPlayerGuid );
|
pNode->AppendChild( "PlayerGuid", sPlayerGuid );
|
||||||
@@ -124,6 +136,9 @@ void HighScoreImpl::LoadFromNode( const XNode *pNode )
|
|||||||
pNode->GetChildValue( "Score", iScore );
|
pNode->GetChildValue( "Score", iScore );
|
||||||
pNode->GetChildValue( "PercentDP", fPercentDP );
|
pNode->GetChildValue( "PercentDP", fPercentDP );
|
||||||
pNode->GetChildValue( "SurviveSeconds", fSurviveSeconds );
|
pNode->GetChildValue( "SurviveSeconds", fSurviveSeconds );
|
||||||
|
pNode->GetChildValue( "MaxCombo", iMaxCombo );
|
||||||
|
pNode->GetChildValue( "StageAward", s ); stageAward = StringToStageAward(s);
|
||||||
|
pNode->GetChildValue( "PeakComboAward", s ); peakComboAward = StringToPeakComboAward(s);
|
||||||
pNode->GetChildValue( "Modifiers", sModifiers );
|
pNode->GetChildValue( "Modifiers", sModifiers );
|
||||||
pNode->GetChildValue( "DateTime", s ); dateTime.FromString( s );
|
pNode->GetChildValue( "DateTime", s ); dateTime.FromString( s );
|
||||||
pNode->GetChildValue( "PlayerGuid", sPlayerGuid );
|
pNode->GetChildValue( "PlayerGuid", sPlayerGuid );
|
||||||
@@ -175,6 +190,9 @@ bool HighScore::IsEmpty() const
|
|||||||
RString HighScore::GetName() const { return m_Impl->sName; }
|
RString HighScore::GetName() const { return m_Impl->sName; }
|
||||||
Grade HighScore::GetGrade() const { return m_Impl->grade; }
|
Grade HighScore::GetGrade() const { return m_Impl->grade; }
|
||||||
int HighScore::GetScore() const { return m_Impl->iScore; }
|
int HighScore::GetScore() const { return m_Impl->iScore; }
|
||||||
|
int HighScore::GetMaxCombo() const { return m_Impl->iMaxCombo; }
|
||||||
|
StageAward HighScore::GetStageAward() const { return m_Impl->stageAward; }
|
||||||
|
PeakComboAward HighScore::GetPeakComboAward() const { return m_Impl->peakComboAward; }
|
||||||
float HighScore::GetPercentDP() const { return m_Impl->fPercentDP; }
|
float HighScore::GetPercentDP() const { return m_Impl->fPercentDP; }
|
||||||
float HighScore::GetSurviveSeconds() const { return m_Impl->fSurviveSeconds; }
|
float HighScore::GetSurviveSeconds() const { return m_Impl->fSurviveSeconds; }
|
||||||
float HighScore::GetSurvivalSeconds() const { return GetSurviveSeconds() + GetLifeRemainingSeconds(); }
|
float HighScore::GetSurvivalSeconds() const { return GetSurviveSeconds() + GetLifeRemainingSeconds(); }
|
||||||
@@ -192,6 +210,9 @@ bool HighScore::GetDisqualified() const { return m_Impl->bDisqualified; }
|
|||||||
void HighScore::SetName( const RString &sName ) { m_Impl->sName = sName; }
|
void HighScore::SetName( const RString &sName ) { m_Impl->sName = sName; }
|
||||||
void HighScore::SetGrade( Grade g ) { m_Impl->grade = g; }
|
void HighScore::SetGrade( Grade g ) { m_Impl->grade = g; }
|
||||||
void HighScore::SetScore( int iScore ) { m_Impl->iScore = iScore; }
|
void HighScore::SetScore( int iScore ) { m_Impl->iScore = iScore; }
|
||||||
|
void HighScore::SetMaxCombo( int i ) { m_Impl->iMaxCombo = i; }
|
||||||
|
void HighScore::SetStageAward( StageAward a ) { m_Impl->stageAward = a; }
|
||||||
|
void HighScore::SetPeakComboAward( PeakComboAward a ) { m_Impl->peakComboAward = a; }
|
||||||
void HighScore::SetPercentDP( float f ) { m_Impl->fPercentDP = f; }
|
void HighScore::SetPercentDP( float f ) { m_Impl->fPercentDP = f; }
|
||||||
void HighScore::SetAliveSeconds( float f ) { m_Impl->fSurviveSeconds = f; }
|
void HighScore::SetAliveSeconds( float f ) { m_Impl->fSurviveSeconds = f; }
|
||||||
void HighScore::SetModifiers( RString s ) { m_Impl->sModifiers = s; }
|
void HighScore::SetModifiers( RString s ) { m_Impl->sModifiers = s; }
|
||||||
@@ -251,7 +272,7 @@ RString HighScore::GetDisplayName() const
|
|||||||
return GetName();
|
return GetName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* begin HighScoreList */
|
||||||
void HighScoreList::Init()
|
void HighScoreList::Init()
|
||||||
{
|
{
|
||||||
iNumTimesPlayed = 0;
|
iNumTimesPlayed = 0;
|
||||||
@@ -428,6 +449,7 @@ public:
|
|||||||
lua_pushboolean( L, bIsFillInMarker );
|
lua_pushboolean( L, bIsFillInMarker );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
static int GetMaxCombo( T* p, lua_State *L ) { lua_pushnumber(L, p->GetMaxCombo() ); return 1; }
|
||||||
static int GetModifiers( T* p, lua_State *L ) { lua_pushstring(L, p->GetModifiers() ); return 1; }
|
static int GetModifiers( T* p, lua_State *L ) { lua_pushstring(L, p->GetModifiers() ); return 1; }
|
||||||
static int GetTapNoteScore( T* p, lua_State *L ) { lua_pushnumber(L, p->GetTapNoteScore( Enum::Check<TapNoteScore>(L, 1) ) ); return 1; }
|
static int GetTapNoteScore( T* p, lua_State *L ) { lua_pushnumber(L, p->GetTapNoteScore( Enum::Check<TapNoteScore>(L, 1) ) ); return 1; }
|
||||||
static int GetHoldNoteScore( T* p, lua_State *L ) { lua_pushnumber(L, p->GetHoldNoteScore( Enum::Check<HoldNoteScore>(L, 1) ) ); return 1; }
|
static int GetHoldNoteScore( T* p, lua_State *L ) { lua_pushnumber(L, p->GetHoldNoteScore( Enum::Check<HoldNoteScore>(L, 1) ) ); return 1; }
|
||||||
@@ -438,6 +460,8 @@ public:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
DEFINE_METHOD( GetGrade, GetGrade() )
|
DEFINE_METHOD( GetGrade, GetGrade() )
|
||||||
|
DEFINE_METHOD( GetStageAward, GetStageAward() )
|
||||||
|
DEFINE_METHOD( GetPeakComboAward, GetPeakComboAward() )
|
||||||
|
|
||||||
LunaHighScore()
|
LunaHighScore()
|
||||||
{
|
{
|
||||||
@@ -447,12 +471,14 @@ public:
|
|||||||
ADD_METHOD( GetDate );
|
ADD_METHOD( GetDate );
|
||||||
ADD_METHOD( GetSurvivalSeconds );
|
ADD_METHOD( GetSurvivalSeconds );
|
||||||
ADD_METHOD( IsFillInMarker );
|
ADD_METHOD( IsFillInMarker );
|
||||||
// sm-ssc additions:
|
|
||||||
ADD_METHOD( GetModifiers );
|
ADD_METHOD( GetModifiers );
|
||||||
ADD_METHOD( GetTapNoteScore );
|
ADD_METHOD( GetTapNoteScore );
|
||||||
ADD_METHOD( GetHoldNoteScore );
|
ADD_METHOD( GetHoldNoteScore );
|
||||||
ADD_METHOD( GetRadarValues );
|
ADD_METHOD( GetRadarValues );
|
||||||
ADD_METHOD( GetGrade );
|
ADD_METHOD( GetGrade );
|
||||||
|
ADD_METHOD( GetMaxCombo );
|
||||||
|
ADD_METHOD( GetStageAward );
|
||||||
|
ADD_METHOD( GetPeakComboAward );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ struct HighScore
|
|||||||
* @return the number of seconds left. */
|
* @return the number of seconds left. */
|
||||||
float GetSurviveSeconds() const;
|
float GetSurviveSeconds() const;
|
||||||
float GetSurvivalSeconds() const;
|
float GetSurvivalSeconds() const;
|
||||||
|
int GetMaxCombo() const;
|
||||||
|
StageAward GetStageAward() const;
|
||||||
|
PeakComboAward GetPeakComboAward() const;
|
||||||
/**
|
/**
|
||||||
* @brief Get the modifiers used for this run.
|
* @brief Get the modifiers used for this run.
|
||||||
* @return the modifiers. */
|
* @return the modifiers. */
|
||||||
@@ -66,6 +69,9 @@ struct HighScore
|
|||||||
void SetScore( int iScore );
|
void SetScore( int iScore );
|
||||||
void SetPercentDP( float f );
|
void SetPercentDP( float f );
|
||||||
void SetAliveSeconds( float f );
|
void SetAliveSeconds( float f );
|
||||||
|
void SetMaxCombo( int i );
|
||||||
|
void SetStageAward( StageAward a );
|
||||||
|
void SetPeakComboAward( PeakComboAward a );
|
||||||
void SetModifiers( RString s );
|
void SetModifiers( RString s );
|
||||||
void SetDateTime( DateTime d );
|
void SetDateTime( DateTime d );
|
||||||
void SetPlayerGuid( RString s );
|
void SetPlayerGuid( RString s );
|
||||||
|
|||||||
@@ -135,6 +135,9 @@ static HighScore FillInHighScore( const PlayerStageStats &pss, const PlayerState
|
|||||||
hs.SetScore( pss.m_iScore );
|
hs.SetScore( pss.m_iScore );
|
||||||
hs.SetPercentDP( pss.GetPercentDancePoints() );
|
hs.SetPercentDP( pss.GetPercentDancePoints() );
|
||||||
hs.SetAliveSeconds( pss.m_fAliveSeconds );
|
hs.SetAliveSeconds( pss.m_fAliveSeconds );
|
||||||
|
hs.SetMaxCombo( pss.GetMaxCombo().m_cnt );
|
||||||
|
hs.SetStageAward( pss.m_StageAward );
|
||||||
|
hs.SetPeakComboAward( pss.m_PeakComboAward );
|
||||||
|
|
||||||
vector<RString> asModifiers;
|
vector<RString> asModifiers;
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user