add NumControllerSteps
This commit is contained in:
+28
-26
@@ -1622,36 +1622,38 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
|
|||||||
{
|
{
|
||||||
// TODO: remove use of PlayerNumber
|
// TODO: remove use of PlayerNumber
|
||||||
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
||||||
|
int iWeightPounds = 120;
|
||||||
Profile *pProfile = PROFILEMAN->GetProfile( pn );
|
Profile *pProfile = PROFILEMAN->GetProfile( pn );
|
||||||
if( pProfile )
|
if( pProfile )
|
||||||
|
iWeightPounds = pProfile->GetCalculatedWeightPounds();
|
||||||
|
|
||||||
|
int iNumTracksHeld = 0;
|
||||||
|
for( int t=0; t<m_NoteData.GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
int iNumTracksHeld = 0;
|
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( t, pn );
|
||||||
for( int t=0; t<m_NoteData.GetNumTracks(); t++ )
|
const float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI );
|
||||||
{
|
if( fSecsHeld > 0 && fSecsHeld < m_fTimingWindowJump )
|
||||||
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( t, pn );
|
iNumTracksHeld++;
|
||||||
const float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI );
|
|
||||||
if( fSecsHeld > 0 && fSecsHeld < m_fTimingWindowJump )
|
|
||||||
iNumTracksHeld++;
|
|
||||||
}
|
|
||||||
|
|
||||||
float fCals = 0;
|
|
||||||
switch( iNumTracksHeld )
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
// autoplay is on, or this is a computer player
|
|
||||||
iNumTracksHeld = 1;
|
|
||||||
// fall through
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
float fCalsFor100Lbs = SCALE( iNumTracksHeld, 1, 2, 0.023f, 0.077f );
|
|
||||||
float fCalsFor200Lbs = SCALE( iNumTracksHeld, 1, 2, 0.041f, 0.133f );
|
|
||||||
fCals = SCALE( pProfile->GetCalculatedWeightPounds(), 100.f, 200.f, fCalsFor100Lbs, fCalsFor200Lbs );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_pPlayerStageStats->m_fCaloriesBurned += fCals;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float fCals = 0;
|
||||||
|
switch( iNumTracksHeld )
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
// autoplay is on, or this is a computer player
|
||||||
|
iNumTracksHeld = 1;
|
||||||
|
// fall through
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
float fCalsFor100Lbs = SCALE( iNumTracksHeld, 1, 2, 0.023f, 0.077f );
|
||||||
|
float fCalsFor200Lbs = SCALE( iNumTracksHeld, 1, 2, 0.041f, 0.133f );
|
||||||
|
fCals = SCALE( pProfile->GetCalculatedWeightPounds(), 100.f, 200.f, fCalsFor100Lbs, fCalsFor200Lbs );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_pPlayerStageStats->m_fCaloriesBurned += fCals;
|
||||||
|
m_pPlayerStageStats->m_iNumControllerSteps ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ void PlayerStageStats::Init()
|
|||||||
m_iSongsPassed = 0;
|
m_iSongsPassed = 0;
|
||||||
m_iSongsPlayed = 0;
|
m_iSongsPlayed = 0;
|
||||||
m_fLifeRemainingSeconds = 0;
|
m_fLifeRemainingSeconds = 0;
|
||||||
|
m_iNumControllerSteps = 0;
|
||||||
m_fCaloriesBurned = 0;
|
m_fCaloriesBurned = 0;
|
||||||
|
|
||||||
ZERO( m_iTapNoteScores );
|
ZERO( m_iTapNoteScores );
|
||||||
@@ -90,6 +91,7 @@ void PlayerStageStats::AddStats( const PlayerStageStats& other )
|
|||||||
m_radarActual += other.m_radarActual;
|
m_radarActual += other.m_radarActual;
|
||||||
m_iSongsPassed += other.m_iSongsPassed;
|
m_iSongsPassed += other.m_iSongsPassed;
|
||||||
m_iSongsPlayed += other.m_iSongsPlayed;
|
m_iSongsPlayed += other.m_iSongsPlayed;
|
||||||
|
m_iNumControllerSteps += other.m_iNumControllerSteps;
|
||||||
m_fCaloriesBurned += other.m_fCaloriesBurned;
|
m_fCaloriesBurned += other.m_fCaloriesBurned;
|
||||||
m_fLifeRemainingSeconds = other.m_fLifeRemainingSeconds; // don't accumulate
|
m_fLifeRemainingSeconds = other.m_fLifeRemainingSeconds; // don't accumulate
|
||||||
m_bDisqualified |= other.m_bDisqualified;
|
m_bDisqualified |= other.m_bDisqualified;
|
||||||
@@ -634,6 +636,7 @@ bool PlayerStageStats::IsDisqualified() const
|
|||||||
LuaFunction( GetGradeFromPercent, GetGradeFromPercent( FArg(1), false ) )
|
LuaFunction( GetGradeFromPercent, GetGradeFromPercent( FArg(1), false ) )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// lua start
|
// lua start
|
||||||
#include "LuaBinding.h"
|
#include "LuaBinding.h"
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ public:
|
|||||||
float m_fLifeRemainingSeconds; // used in survival
|
float m_fLifeRemainingSeconds; // used in survival
|
||||||
|
|
||||||
// workout
|
// workout
|
||||||
|
float m_iNumControllerSteps;
|
||||||
float m_fCaloriesBurned;
|
float m_fCaloriesBurned;
|
||||||
|
|
||||||
map<float,float> m_fLifeRecord;
|
map<float,float> m_fLifeRecord;
|
||||||
|
|||||||
Reference in New Issue
Block a user