Changed LifeMeterTime to not crash when not in course mode. Changed _fallback's life settings back to forcing together. Added ForceImmediateFailForBattery theme metric. Gave up on FailFadeRemovePlayer lua function and removed it.

This commit is contained in:
Kyzentun
2014-08-19 23:58:35 -06:00
parent 7e73892e6e
commit 8ae17b4422
5 changed files with 43 additions and 36 deletions
+30 -4
View File
@@ -1,6 +1,7 @@
#include "global.h"
#include "LifeMeterTime.h"
#include "ThemeManager.h"
#include "Song.h"
#include "Steps.h"
#include "ActorUtil.h"
#include "Course.h"
@@ -94,11 +95,36 @@ void LifeMeterTime::OnLoadSong()
if( GetLifeSeconds() <= 0 && GAMESTATE->GetCourseSongIndex() > 0 )
return;
Course* pCourse = GAMESTATE->m_pCurCourse;
ASSERT( pCourse != NULL );
float fOldLife = m_fLifeTotalLostSeconds;
float fGainSeconds = pCourse->m_vEntries[GAMESTATE->GetCourseSongIndex()].fGainSeconds;
float fGainSeconds = 0;
if(GAMESTATE->IsCourseMode())
{
Course* pCourse = GAMESTATE->m_pCurCourse;
ASSERT( pCourse != NULL );
fGainSeconds= pCourse->m_vEntries[GAMESTATE->GetCourseSongIndex()].fGainSeconds;
}
else
{
// Placeholderish, at least this way it won't crash when someone tries it
// out in non-course mode. -Kyz
Song* song= GAMESTATE->m_pCurSong;
ASSERT(song != NULL);
float song_len= song->m_fMusicLengthSeconds;
Steps* steps= GAMESTATE->m_pCurSteps[m_pPlayerState->m_PlayerNumber];
ASSERT(steps != NULL);
RadarValues radars= steps->GetRadarValues(m_pPlayerState->m_PlayerNumber);
float scorable_things= radars[RadarCategory_TapsAndHolds] +
radars[RadarCategory_Lifts];
if(g_fTimeMeterSecondsChange[SE_Held] > 0.0f)
{
scorable_things+= radars[RadarCategory_Holds] +
radars[RadarCategory_Rolls];
}
// Calculate the amount of time to give for the player to need 80% W1.
float gainable_score_time= scorable_things * g_fTimeMeterSecondsChange[SE_W1];
fGainSeconds= song_len - (gainable_score_time * INITIAL_VALUE);
}
if( MIN_LIFE_TIME > fGainSeconds )
fGainSeconds = MIN_LIFE_TIME;
m_fLifeTotalGainedSeconds += fGainSeconds;