Skip to content

Commit

Permalink
purge everything related to calories or workouts
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 3, 2017
1 parent bf07bc3 commit c208c31
Show file tree
Hide file tree
Showing 24 changed files with 15 additions and 773 deletions.
5 changes: 1 addition & 4 deletions src/Course.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int CourseEntry::GetNumModChanges() const
Course::Course(): m_bIsAutogen(false), m_sPath(""), m_sMainTitle(""),
m_sMainTitleTranslit(""), m_sSubTitle(""), m_sSubTitleTranslit(""),
m_sScripter(""), m_sDescription(""), m_sBannerPath(""), m_sBackgroundPath(""),
m_sCDTitlePath(""), m_sGroupName(""), m_bRepeat(false), m_fGoalSeconds(0),
m_sCDTitlePath(""), m_sGroupName(""), m_bRepeat(false),
m_bShuffle(false), m_iLives(-1), m_bSortByMeter(false),
m_bIncomplete(false), m_vEntries(), m_SortOrder_TotalDifficulty(0),
m_SortOrder_Ranking(0), m_LoadedFromProfile(ProfileSlot_Invalid),
Expand Down Expand Up @@ -185,7 +185,6 @@ void Course::Init()
m_sGroupName = "";

m_bRepeat = false;
m_fGoalSeconds = 0;
m_bShuffle = false;

m_iLives = -1;
Expand Down Expand Up @@ -1303,7 +1302,6 @@ class LunaCourse: public Luna<Course>
DEFINE_METHOD( IsEndless, IsEndless() )
DEFINE_METHOD( IsNonstop, IsNonstop() )
DEFINE_METHOD( IsOni, IsOni() )
DEFINE_METHOD( GetGoalSeconds, m_fGoalSeconds )
static int HasBanner( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBanner() ); return 1; }
static int HasBackground( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBackground() ); return 1; }
DEFINE_METHOD( IsAnEdit, IsAnEdit() )
Expand Down Expand Up @@ -1339,7 +1337,6 @@ class LunaCourse: public Luna<Course>
ADD_METHOD( IsEndless );
ADD_METHOD( IsNonstop );
ADD_METHOD( IsOni );
ADD_METHOD( GetGoalSeconds );
ADD_METHOD( HasBanner );
ADD_METHOD( HasBackground );
ADD_METHOD( IsAnEdit );
Expand Down
1 change: 0 additions & 1 deletion src/Course.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ class Course
RString m_sGroupName;

bool m_bRepeat; // repeat after last song? "Endless"
float m_fGoalSeconds; // if not 0, stop play after this number of seconds
bool m_bShuffle;
int m_iLives; // -1 means use bar life meter
int m_iCustomMeter[NUM_Difficulty]; // -1 = no meter specified
Expand Down
4 changes: 0 additions & 4 deletions src/CourseUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,7 @@ void EditCourseUtil::PrepareForPlay()
GAMESTATE->m_PlayMode.Set( PLAY_MODE_ENDLESS );
GAMESTATE->m_bSideIsJoined[0] = true;

PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_GoalType = GoalType_Time;
Course *pCourse = GAMESTATE->m_pCurCourse;
PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_iGoalSeconds = static_cast<int>(pCourse->m_fGoalSeconds);
}

void EditCourseUtil::GetAllEditCourses( vector<Course*> &vpCoursesOut )
Expand All @@ -482,8 +480,6 @@ void EditCourseUtil::LoadDefaults( Course &out )
{
out = Course();

out.m_fGoalSeconds = 0;

// pick a default name
// XXX: Make this localizable
for( int i=0; i<10000; i++ )
Expand Down
37 changes: 0 additions & 37 deletions src/GameCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ void GameCommand::Init()
m_SortOrder = SortOrder_Invalid;
m_sSoundPath = "";
m_vsScreensToPrepare.clear();
m_iWeightPounds = -1;
m_iGoalCalories = -1;
m_GoalType = GoalType_Invalid;
m_sProfileID = "";
m_sUrl = "";
m_bUrlExits = true;
Expand Down Expand Up @@ -139,12 +136,6 @@ bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const
return false;
if( m_SortOrder != SortOrder_Invalid && GAMESTATE->m_PreferredSortOrder != m_SortOrder )
return false;
if( m_iWeightPounds != -1 && PROFILEMAN->GetProfile(pn)->m_iWeightPounds != m_iWeightPounds )
return false;
if( m_iGoalCalories != -1 && PROFILEMAN->GetProfile(pn)->m_iGoalCalories != m_iGoalCalories )
return false;
if( m_GoalType != GoalType_Invalid && PROFILEMAN->GetProfile(pn)->m_GoalType != m_GoalType )
return false;
if( !m_sProfileID.empty() && ProfileManager::m_sDefaultLocalProfileID[pn].Get() != m_sProfileID )
return false;

Expand Down Expand Up @@ -375,22 +366,6 @@ void GameCommand::LoadOne( const Command& cmd )
CHECK_INVALID_VALUE(m_SortOrder, so, SortOrder_Invalid, sortorder);
}

else if( sName == "weight" )
{
m_iWeightPounds = StringToInt( sValue );
}

else if( sName == "goalcalories" )
{
m_iGoalCalories = StringToInt( sValue );
}

else if( sName == "goaltype" )
{
GoalType go= StringToGoalType(sValue);
CHECK_INVALID_VALUE(m_GoalType, go, GoalType_Invalid, goaltype);
}

else if( sName == "profileid" )
{
m_sProfileID = sValue;
Expand Down Expand Up @@ -811,15 +786,6 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
GAMESTATE->m_PreferredSortOrder = m_SortOrder;
if( m_sSoundPath != "" )
SOUND->PlayOnce( THEME->GetPathS( "", m_sSoundPath ) );
if( m_iWeightPounds != -1 )
FOREACH_CONST( PlayerNumber, vpns, pn )
PROFILEMAN->GetProfile(*pn)->m_iWeightPounds = m_iWeightPounds;
if( m_iGoalCalories != -1 )
FOREACH_CONST( PlayerNumber, vpns, pn )
PROFILEMAN->GetProfile(*pn)->m_iGoalCalories = m_iGoalCalories;
if( m_GoalType != GoalType_Invalid )
FOREACH_CONST( PlayerNumber, vpns, pn )
PROFILEMAN->GetProfile(*pn)->m_GoalType = m_GoalType;
if( !m_sProfileID.empty() )
FOREACH_CONST( PlayerNumber, vpns, pn )
ProfileManager::m_sDefaultLocalProfileID[*pn].Set( m_sProfileID );
Expand Down Expand Up @@ -895,9 +861,6 @@ bool GameCommand::IsZero() const
m_CourseDifficulty != Difficulty_Invalid ||
!m_sSongGroup.empty() ||
m_SortOrder != SortOrder_Invalid ||
m_iWeightPounds != -1 ||
m_iGoalCalories != -1 ||
m_GoalType != GoalType_Invalid ||
!m_sProfileID.empty() ||
!m_sUrl.empty() )
return false;
Expand Down
10 changes: 1 addition & 9 deletions src/GameCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class GameCommand
m_pSong(NULL), m_pSteps(NULL), m_pCourse(NULL),
m_pTrail(NULL), m_pCharacter(NULL), m_SetEnv(), m_SetPref(),
m_sSongGroup(""), m_SortOrder(SortOrder_Invalid),
m_sSoundPath(""), m_vsScreensToPrepare(), m_iWeightPounds(-1),
m_iGoalCalories(-1), m_GoalType(GoalType_Invalid),
m_sSoundPath(""), m_vsScreensToPrepare(),
m_sProfileID(""), m_sUrl(""), m_bUrlExits(true),
m_bInsertCredit(false), m_bClearCredits(false),
m_bStopMusic(false), m_bApplyDefaultOptions(false),
Expand Down Expand Up @@ -97,13 +96,6 @@ class GameCommand
SortOrder m_SortOrder;
RString m_sSoundPath; // "" for no sound
vector<RString> m_vsScreensToPrepare;
/**
* @brief What is the player's weight in pounds?
*
* If this value is -1, then no weight was specified. */
int m_iWeightPounds;
int m_iGoalCalories; // -1 == none specified
GoalType m_GoalType;
RString m_sProfileID;
RString m_sUrl;
// sm-ssc adds:
Expand Down
9 changes: 0 additions & 9 deletions src/GameConstantsAndTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,15 +454,6 @@ XToString( StyleType );
StringToX( StyleType );
LuaXType( StyleType );

static const char *GoalTypeNames[] = {
"Calories",
"Time",
"None",
};
XToString( GoalType );
StringToX( GoalType );
LuaXType( GoalType );

static const char *EditModeNames[] = {
"Practice",
"CourseMods",
Expand Down
13 changes: 0 additions & 13 deletions src/GameConstantsAndTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -579,19 +579,6 @@ const RString& StyleTypeToString( StyleType s );
StyleType StringToStyleType( const RString& s );
LuaDeclareType( StyleType );

/** @brief The different goal types, mainly meant for fitness modes. */
enum GoalType
{
GoalType_Calories,
GoalType_Time,
GoalType_None,
NUM_GoalType,
GoalType_Invalid,
};
const RString& GoalTypeToString( GoalType gt );
GoalType StringToGoalType( const RString& s );
LuaDeclareType( GoalType );

/** @brief The different types of Edit modes available. */
enum EditMode
{
Expand Down
58 changes: 0 additions & 58 deletions src/GameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1145,29 +1145,7 @@ void GameState::Update( float fDelta )
m_SongOptions.Update( fDelta );

FOREACH_PlayerNumber( p )
{
m_pPlayerState[p]->Update( fDelta );

if( !m_bGoalComplete[p] && IsGoalComplete(p) )
{
m_bGoalComplete[p] = true;
MESSAGEMAN->Broadcast( (MessageID)(Message_GoalCompleteP1+p) );
}
}

if( GAMESTATE->m_pCurCourse )
{
if( GAMESTATE->m_pCurCourse->m_fGoalSeconds > 0 && !m_bWorkoutGoalComplete )
{
const StageStats &ssCurrent = STATSMAN->m_CurStageStats;
bool bGoalComplete = ssCurrent.m_fGameplaySeconds > GAMESTATE->m_pCurCourse->m_fGoalSeconds;
if( bGoalComplete )
{
MESSAGEMAN->Broadcast( "WorkoutGoalComplete" );
m_bWorkoutGoalComplete = true;
}
}
}
}

void GameState::SetCurGame( const Game *pGame )
Expand Down Expand Up @@ -1229,10 +1207,7 @@ void GameState::ResetStageStatistics()

m_pPlayerState[p]->m_iLastPositiveSumOfAttackLevels = 0;
m_pPlayerState[p]->m_fSecondsUntilAttacksPhasedOut = 0; // PlayerAI not affected

m_bGoalComplete[p] = false;
}
m_bWorkoutGoalComplete = false;


FOREACH_PlayerNumber( p )
Expand Down Expand Up @@ -2524,35 +2499,6 @@ Premium GameState::GetPremium() const
return DISABLE_PREMIUM_IN_EVENT_MODE ? Premium_Off : g_Premium;
}

float GameState::GetGoalPercentComplete( PlayerNumber pn )
{
const Profile *pProfile = PROFILEMAN->GetProfile(pn);
const StageStats &ssCurrent = STATSMAN->m_CurStageStats;
const PlayerStageStats &pssCurrent = ssCurrent.m_player[pn];

float fActual = 0;
float fGoal = 0;
switch( pProfile->m_GoalType )
{
case GoalType_Calories:
fActual = pssCurrent.m_fCaloriesBurned;
fGoal = (float)pProfile->m_iGoalCalories;
break;
case GoalType_Time:
fActual = ssCurrent.m_fGameplaySeconds;
fGoal = (float)pProfile->m_iGoalSeconds;
break;
case GoalType_None:
return 0; // never complete
default:
FAIL_M(ssprintf("Invalid GoalType: %i", pProfile->m_GoalType));
}
if( fGoal == 0 )
return 0;
else
return fActual / fGoal;
}

bool GameState::PlayerIsUsingModifier( PlayerNumber pn, const RString &sModifier )
{
PlayerOptions po = m_pPlayerState[pn]->m_PlayerOptions.GetCurrent();
Expand Down Expand Up @@ -2779,7 +2725,6 @@ class LunaGameState: public Luna<GameState>
DEFINE_METHOD( GetPlayMode, m_PlayMode )
DEFINE_METHOD( GetSortOrder, m_SortOrder )
DEFINE_METHOD( GetCurrentStageIndex, m_iCurrentStageIndex )
DEFINE_METHOD( IsGoalComplete, IsGoalComplete(Enum::Check<PlayerNumber>(L, 1)) )
DEFINE_METHOD( PlayerIsUsingModifier, PlayerIsUsingModifier(Enum::Check<PlayerNumber>(L, 1), SArg(2)) )
DEFINE_METHOD( GetCourseSongIndex, GetCourseSongIndex() )
DEFINE_METHOD( GetLoadingCourseSongIndex, GetLoadingCourseSongIndex() )
Expand Down Expand Up @@ -2992,7 +2937,6 @@ class LunaGameState: public Luna<GameState>
static int GetSongPercent( T* p, lua_State *L ) { lua_pushnumber(L, p->GetSongPercent(FArg(1))); return 1; }
DEFINE_METHOD( GetCurMusicSeconds, m_Position.m_fMusicSeconds )

DEFINE_METHOD( GetWorkoutGoalComplete, m_bWorkoutGoalComplete )
static int GetCharacter( T* p, lua_State *L ) { p->m_pCurCharacters[Enum::Check<PlayerNumber>(L, 1)]->PushSelf(L); return 1; }
static int SetCharacter( T* p, lua_State *L ){
Character* c = CHARMAN->GetCharacterFromID(SArg(2));
Expand Down Expand Up @@ -3283,7 +3227,6 @@ class LunaGameState: public Luna<GameState>
ADD_METHOD( GetPlayMode );
ADD_METHOD( GetSortOrder );
ADD_METHOD( GetCurrentStageIndex );
ADD_METHOD( IsGoalComplete );
ADD_METHOD( PlayerIsUsingModifier );
ADD_METHOD( GetCourseSongIndex );
ADD_METHOD( GetLoadingCourseSongIndex );
Expand Down Expand Up @@ -3343,7 +3286,6 @@ class LunaGameState: public Luna<GameState>
ADD_METHOD( GetStageSeed );
ADD_METHOD( SaveLocalData );
ADD_METHOD( SetJukeboxUsesModifiers );
ADD_METHOD( GetWorkoutGoalComplete );
ADD_METHOD( Reset );
ADD_METHOD( JoinPlayer );
ADD_METHOD( UnjoinPlayer );
Expand Down
8 changes: 0 additions & 8 deletions src/GameState.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,6 @@ class GameState
// used in PLAY_MODE_RAVE
float m_fTugLifePercentP1;

// used in workout
bool m_bGoalComplete[NUM_PLAYERS];
bool m_bWorkoutGoalComplete;

/** @brief Primarily called at the end of a song to stop all attacks. */
void RemoveAllActiveAttacks();
PlayerNumber GetBestPlayer() const;
Expand Down Expand Up @@ -407,10 +403,6 @@ class GameState
BroadcastOnChange<RString> m_sEditLocalProfileID;
Profile* GetEditLocalProfile();

// Workout stuff
float GetGoalPercentComplete( PlayerNumber pn );
bool IsGoalComplete( PlayerNumber pn ) { return GetGoalPercentComplete( pn ) >= 1; }

bool m_bDopefish;

// Autogen stuff. This should probably be moved to its own singleton or
Expand Down
2 changes: 0 additions & 2 deletions src/MessageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ static const char *MessageIDNames[] = {
"PreferredCourseDifficultyP2Changed",
"EditCourseEntryIndexChanged",
"EditLocalProfileIDChanged",
"GoalCompleteP1",
"GoalCompleteP2",
"NoteCrossed",
"NoteWillCrossIn400Ms",
"NoteWillCrossIn800Ms",
Expand Down
2 changes: 0 additions & 2 deletions src/MessageManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ enum MessageID
Message_PreferredCourseDifficultyP2Changed,
Message_EditCourseEntryIndexChanged,
Message_EditLocalProfileIDChanged,
Message_GoalCompleteP1,
Message_GoalCompleteP2,
Message_NoteCrossed,
Message_NoteWillCrossIn400Ms,
Message_NoteWillCrossIn800Ms,
Expand Down
6 changes: 0 additions & 6 deletions src/PercentageDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,6 @@ bool PercentageDisplay::ShowDancePointsNotPercentage() const
{
// Use straight dance points in workout because the percentage denominator isn't accurate - we don't know when the players are going to stop.

if( GAMESTATE->m_pCurCourse )
{
if( GAMESTATE->m_pCurCourse->m_fGoalSeconds > 0 )
return true;
}

if( PREFSMAN->m_bDancePointsForOni )
return true;

Expand Down
Loading

0 comments on commit c208c31

Please sign in to comment.