diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 340c1b57b0..47245eb02f 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -1622,36 +1622,38 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b { // TODO: remove use of PlayerNumber PlayerNumber pn = m_pPlayerState->m_PlayerNumber; + int iWeightPounds = 120; Profile *pProfile = PROFILEMAN->GetProfile( pn ); if( pProfile ) + iWeightPounds = pProfile->GetCalculatedWeightPounds(); + + int iNumTracksHeld = 0; + for( int t=0; tGetCurrentStyle()->StyleInputToGameInput( t, pn ); - 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; + GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( t, pn ); + 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; + m_pPlayerStageStats->m_iNumControllerSteps ++; } diff --git a/stepmania/src/PlayerStageStats.cpp b/stepmania/src/PlayerStageStats.cpp index 3e04c57d1b..bd67a070bf 100644 --- a/stepmania/src/PlayerStageStats.cpp +++ b/stepmania/src/PlayerStageStats.cpp @@ -44,6 +44,7 @@ void PlayerStageStats::Init() m_iSongsPassed = 0; m_iSongsPlayed = 0; m_fLifeRemainingSeconds = 0; + m_iNumControllerSteps = 0; m_fCaloriesBurned = 0; ZERO( m_iTapNoteScores ); @@ -90,6 +91,7 @@ void PlayerStageStats::AddStats( const PlayerStageStats& other ) m_radarActual += other.m_radarActual; m_iSongsPassed += other.m_iSongsPassed; m_iSongsPlayed += other.m_iSongsPlayed; + m_iNumControllerSteps += other.m_iNumControllerSteps; m_fCaloriesBurned += other.m_fCaloriesBurned; m_fLifeRemainingSeconds = other.m_fLifeRemainingSeconds; // don't accumulate m_bDisqualified |= other.m_bDisqualified; @@ -634,6 +636,7 @@ bool PlayerStageStats::IsDisqualified() const LuaFunction( GetGradeFromPercent, GetGradeFromPercent( FArg(1), false ) ) + // lua start #include "LuaBinding.h" diff --git a/stepmania/src/PlayerStageStats.h b/stepmania/src/PlayerStageStats.h index 80f1ec3f45..a16c392115 100644 --- a/stepmania/src/PlayerStageStats.h +++ b/stepmania/src/PlayerStageStats.h @@ -59,6 +59,7 @@ public: float m_fLifeRemainingSeconds; // used in survival // workout + float m_iNumControllerSteps; float m_fCaloriesBurned; map m_fLifeRecord;