Skip to content

Commit

Permalink
kill a ton of code related to stages as well as some lifebar garbage …
Browse files Browse the repository at this point in the history
…and some leftover editor code
  • Loading branch information
MinaciousGrace committed Jun 10, 2017
1 parent dff6536 commit 80424d3
Show file tree
Hide file tree
Showing 33 changed files with 740 additions and 1,641 deletions.
2 changes: 0 additions & 2 deletions Themes/Til Death/Scripts/02 Branches.lua
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ Branch = {
return Branch.EvaluationScreen()
end,
AfterEvaluation = function()
local maxStages = PREFSMAN:GetPreference("SongsPerPlay")
local stagesLeft = GAMESTATE:GetSmallestNumStagesLeftForAnyHumanPlayer()
local allFailed = STATSMAN:GetCurStageStats():AllFailed()
local song = GAMESTATE:GetCurrentSong()

Expand Down
49 changes: 2 additions & 47 deletions Themes/_fallback/Scripts/02 StageMods.lua
Original file line number Diff line number Diff line change
@@ -1,57 +1,12 @@
function AreStagePlayerModsForced()
return GAMESTATE:IsAnExtraStage() or (GAMESTATE:GetPlayMode() == "PlayMode_Oni")
return false
end

function AreStageSongModsForced()
local pm = GAMESTATE:GetPlayMode()
local bOni = pm == "PlayMode_Oni"
local bBattle = pm == "PlayMode_Battle"
local bRave = pm == "PlayMode_Rave"
return GAMESTATE:IsAnExtraStage() or bOni or bBattle or bRave
return false
end

function ScreenSelectMusic:setupmusicstagemods()
Trace( "setupmusicstagemods" )
local pm = GAMESTATE:GetPlayMode()

if pm == "PlayMode_Battle" or pm == "PlayMode_Rave" then
local so = GAMESTATE:GetDefaultSongOptions()
GAMESTATE:SetSongOptions( "ModsLevel_Stage", so )
MESSAGEMAN:Broadcast( "SongOptionsChanged" )
elseif GAMESTATE:IsAnExtraStage() then
if GAMESTATE:GetPreferredSongGroup() == "---Group All---" then
local song = GAMESTATE:GetCurrentSong()
GAMESTATE:SetPreferredSongGroup( song:GetGroupName() )
end

local bExtra2 = GAMESTATE:IsExtraStage2()
local style = GAMESTATE:GetCurrentStyle()
local song, steps = SONGMAN:GetExtraStageInfo( bExtra2, style )
local po, so
if bExtra2 then
po = THEME:GetMetric("SongManager","OMESPlayerModifiers")
so = THEME:GetMetric("SongManager","OMESStageModifiers")
else
po = THEME:GetMetric("SongManager","ExtraStagePlayerModifiers")
so = THEME:GetMetric("SongManager","ExtraStageStageModifiers")
end

local difficulty = steps:GetDifficulty()
local Reverse = PlayerNumber:Reverse()

GAMESTATE:SetCurrentSong( song )
GAMESTATE:SetPreferredSong( song )

for pn in ivalues(GAMESTATE:GetHumanPlayers()) do
GAMESTATE:SetCurrentSteps( pn, steps )
GAMESTATE:GetPlayerState(pn):SetPlayerOptions( "ModsLevel_Stage", po )
GAMESTATE:SetPreferredDifficulty( pn, difficulty )
MESSAGEMAN:Broadcast( "PlayerOptionsChanged", {PlayerNumber = pn} )
end

GAMESTATE:SetSongOptions( "ModsLevel_Stage", so )
MESSAGEMAN:Broadcast( "SongOptionsChanged" )
end
return self
end

Expand Down
6 changes: 0 additions & 6 deletions Themes/_fallback/Scripts/03 Gameplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,7 @@ end
-- [en] returns if you are able to select options
-- on ScreenSelectMusic.
function AllowOptionsMenu()
if GAMESTATE:IsAnExtraStage() then
return false
elseif GAMESTATE:GetPlayMode() == "PlayMode_Oni" then
return false
else
return true
end
end

-- GameCompatibleModes:
Expand Down
17 changes: 1 addition & 16 deletions Themes/_fallback/Scripts/03 ThemeAndGamePrefs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,7 @@ function GetDefaultOptionLines()
"1,8,14,2,3,4,5,6,R,7,9,10,11,12,13,15,16,SF,17,18", -- All
"1,8,14,2,7,13,16,SF,17,18", -- DDR Essentials ( no turns, fx )
};
local function IsExtra()
if GAMESTATE:IsExtraStage() or GAMESTATE:IsExtraStage2() then
return true
else
return false
end
end
if not IsExtra() then
if GetUserPrefB("UserPrefShowLotsaOptions") then
return GetUserPrefB("UserPrefShowLotsaOptions") and LineSets[1] or LineSets[2];
else
return LineSets[2]; -- Just make sure!
end
else
return "1,8,14,2,7,13,16,SF,17,18" -- "failsafe" list
end
return "1,8,14,2,7,13,16,SF,17,18" -- "failsafe" list
end;

--[[ end themeoption rows ]]
Expand Down
17 changes: 6 additions & 11 deletions src/ArrowEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,18 +301,13 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float
Steps *pCurSteps = GAMESTATE->m_pCurSteps[pn];

/* Usually, fTimeSpacing is 0 or 1, in which case we use entirely beat spacing or
* entirely time spacing (respectively). Occasionally, we tween between them. */
if( curr_options->m_fTimeSpacing != 1.0f )
* entirely time spacing (respectively). Occasionally, we tween between them. */
if (curr_options->m_fTimeSpacing != 1.0f)
{
if( GAMESTATE->m_bInStepEditor ) {
// Use constant spacing in step editor
fYOffset = fNoteBeat - fSongBeat;
} else {
fYOffset = GetDisplayedBeat(pPlayerState, fNoteBeat) - GetDisplayedBeat(pPlayerState, fSongBeat);
fYOffset *= pCurSteps->GetTimingData()->GetDisplayedSpeedPercent(
position.m_fSongBeatVisible,
position.m_fMusicSecondsVisible );
}
fYOffset = GetDisplayedBeat(pPlayerState, fNoteBeat) - GetDisplayedBeat(pPlayerState, fSongBeat);
fYOffset *= pCurSteps->GetTimingData()->GetDisplayedSpeedPercent(
position.m_fSongBeatVisible,
position.m_fMusicSecondsVisible);
fYOffset *= 1 - curr_options->m_fTimeSpacing;
}

Expand Down
9 changes: 2 additions & 7 deletions src/BPMDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ void BPMDisplay::SetBPMRange( const DisplayBpms &bpms )
m_fPercentInState = 1;
}

if( GAMESTATE->IsAnExtraStageAndSelectionLocked() )
RunCommands( SET_EXTRA_COMMAND );
else if( !AllIdentical )
if( !AllIdentical )
RunCommands( SET_CHANGING_COMMAND );
else
RunCommands( SET_NORMAL_COMMAND );
Expand Down Expand Up @@ -226,10 +224,7 @@ void BPMDisplay::SetFromGameState()
{
if( GAMESTATE->m_pCurSong.Get() )
{
if( GAMESTATE->IsAnExtraStageAndSelectionLocked() )
CycleRandomly();
else
SetBpmFromSong( GAMESTATE->m_pCurSong );
SetBpmFromSong( GAMESTATE->m_pCurSong );
return;
}
NoBPM();
Expand Down
8 changes: 0 additions & 8 deletions src/GameConstantsAndTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,6 @@ LuaXType( Stage );
XToLocalizedString( Stage );
LuaFunction( StageToLocalizedString, StageToLocalizedString(Enum::Check<Stage>(L, 1)) );

static const char *EarnedExtraStageNames[] = {
"No",
"Extra1",
"Extra2",
};
XToString( EarnedExtraStage );
LuaXType( EarnedExtraStage );


static const char *MultiPlayerStatusNames[] = {
"Joined",
Expand Down
12 changes: 0 additions & 12 deletions src/GameConstantsAndTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -557,18 +557,6 @@ const RString& StageToString( Stage s );
LuaDeclareType( Stage );
const RString& StageToLocalizedString( Stage i );

/** @brief The different possibilities of earning an extra stage. */
enum EarnedExtraStage
{
EarnedExtraStage_No, /**< No extra stage was earned. */
EarnedExtraStage_Extra1, /**< The first extra stage was earned. */
EarnedExtraStage_Extra2, /**< The second extra stage (or encore extra stage) was earned. */
NUM_EarnedExtraStage,
EarnedExtraStage_Invalid
};
const RString& EarnedExtraStageToString( EarnedExtraStage s );
LuaDeclareType( EarnedExtraStage );

/** @brief The different results of loading a profile. */
enum ProfileLoadResult
{
Expand Down
Loading

0 comments on commit 80424d3

Please sign in to comment.