add Lua binding for life
This commit is contained in:
@@ -345,6 +345,8 @@ void PlayerStageStats::SetLifeRecordAt( float fLife, float fStepsSecond )
|
|||||||
|
|
||||||
if( A->second == B->second && B->second == C->second )
|
if( A->second == B->second && B->second == C->second )
|
||||||
m_fLifeRecord.erase(B);
|
m_fLifeRecord.erase(B);
|
||||||
|
|
||||||
|
MESSAGEMAN->Broadcast( Message_LifeMeterChangedP1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
float PlayerStageStats::GetLifeRecordAt( float fStepsSecond ) const
|
float PlayerStageStats::GetLifeRecordAt( float fStepsSecond ) const
|
||||||
@@ -396,6 +398,15 @@ void PlayerStageStats::GetLifeRecord( float *fLifeOut, int iNumSamples, float fS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float PlayerStageStats::GetCurrentLife() const
|
||||||
|
{
|
||||||
|
if( m_fLifeRecord.empty() )
|
||||||
|
return 0;
|
||||||
|
map<float,float>::const_iterator iter = m_fLifeRecord.end();
|
||||||
|
--iter;
|
||||||
|
return iter->second;
|
||||||
|
}
|
||||||
|
|
||||||
/* If bRollover is true, we're being called before gameplay begins, so we can record
|
/* If bRollover is true, we're being called before gameplay begins, so we can record
|
||||||
* the amount of the first combo that comes from the previous song. */
|
* the amount of the first combo that comes from the previous song. */
|
||||||
void PlayerStageStats::UpdateComboList( float fSecond, bool bRollover )
|
void PlayerStageStats::UpdateComboList( float fSecond, bool bRollover )
|
||||||
@@ -625,6 +636,7 @@ public:
|
|||||||
DEFINE_METHOD( GetScore, m_iScore )
|
DEFINE_METHOD( GetScore, m_iScore )
|
||||||
DEFINE_METHOD( FullCombo, FullCombo() )
|
DEFINE_METHOD( FullCombo, FullCombo() )
|
||||||
DEFINE_METHOD( MaxCombo, GetMaxCombo().m_cnt )
|
DEFINE_METHOD( MaxCombo, GetMaxCombo().m_cnt )
|
||||||
|
DEFINE_METHOD( GetCurrentLife, GetCurrentLife() )
|
||||||
DEFINE_METHOD( GetGrade, GetGrade() )
|
DEFINE_METHOD( GetGrade, GetGrade() )
|
||||||
DEFINE_METHOD( GetLessonScoreActual, GetLessonScoreActual() )
|
DEFINE_METHOD( GetLessonScoreActual, GetLessonScoreActual() )
|
||||||
DEFINE_METHOD( GetLessonScoreNeeded, GetLessonScoreNeeded() )
|
DEFINE_METHOD( GetLessonScoreNeeded, GetLessonScoreNeeded() )
|
||||||
@@ -643,6 +655,7 @@ public:
|
|||||||
ADD_METHOD( GetScore );
|
ADD_METHOD( GetScore );
|
||||||
ADD_METHOD( FullCombo );
|
ADD_METHOD( FullCombo );
|
||||||
ADD_METHOD( MaxCombo );
|
ADD_METHOD( MaxCombo );
|
||||||
|
ADD_METHOD( GetCurrentLife );
|
||||||
ADD_METHOD( GetGrade );
|
ADD_METHOD( GetGrade );
|
||||||
ADD_METHOD( GetLessonScoreActual );
|
ADD_METHOD( GetLessonScoreActual );
|
||||||
ADD_METHOD( GetLessonScoreNeeded );
|
ADD_METHOD( GetLessonScoreNeeded );
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ public:
|
|||||||
void GetLifeRecord( float *fLifeOut, int iNumSamples, float fStepsEndSecond ) const;
|
void GetLifeRecord( float *fLifeOut, int iNumSamples, float fStepsEndSecond ) const;
|
||||||
float GetLifeRecordAt( float fStepsSecond ) const;
|
float GetLifeRecordAt( float fStepsSecond ) const;
|
||||||
float GetLifeRecordLerpAt( float fStepsSecond ) const;
|
float GetLifeRecordLerpAt( float fStepsSecond ) const;
|
||||||
|
float GetCurrentLife() const;
|
||||||
|
|
||||||
struct Combo_t
|
struct Combo_t
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user