diff --git a/Themes/_fallback/Scripts/03 Gameplay.lua b/Themes/_fallback/Scripts/03 Gameplay.lua index 1d8ac4ecfc..9717f7341b 100644 --- a/Themes/_fallback/Scripts/03 Gameplay.lua +++ b/Themes/_fallback/Scripts/03 Gameplay.lua @@ -4,6 +4,14 @@ -- shakesoda calls this pump.lua +-- Check the active game mode against a string. Cut down typing this in metrics. +function IsGame(str) + if GAMESTATE:GetCurrentGame():GetName() == str then + return true + end + return false +end + -- GetExtraColorThreshold() -- [en] returns the difficulty threshold in meter -- for songs that should be counted as boss songs. @@ -166,50 +174,11 @@ end -- todo: use tables for some of these -aj function HoldTiming() - if GAMESTATE:GetCurrentGame():GetName() == "pump" then - return 0 - else - return PREFSMAN:GetPreference("TimingWindowSecondsHold") - end + return IsGame("pump") and 0 or PREFSMAN:GetPreference("TimingWindowSecondsHold") end function ShowHoldJudgments() - local isPump = GAMESTATE:GetCurrentGame():GetName() == "pump" - return isPump and false or true -end - -function HoldHeadStep() - local isPump = GAMESTATE:GetCurrentGame():GetName() == "pump" - return isPump and false or true -end - -function InitialHoldLife() - return GAMESTATE:GetCurrentGame():GetName() == "pump" and 0.05 or 1 -end - -function MaxHoldLife() - return GAMESTATE:GetCurrentGame():GetName() == "pump" and 0.05 or 1 -end - -function ImmediateHoldLetGo() - return not (GAMESTATE:GetCurrentGame():GetName() == "pump") -end - -function RollBodyIncrementsCombo() - return false ---[[ if GAMESTATE:GetCurrentGame():GetName() == "pump" then - return false - else - return true - end --]] -end - -function CheckpointsTapsSeparateJudgment() - return not GAMESTATE:GetCurrentGame():GetName() == "pump" -end - -function ScoreMissedHoldsAndRolls() - return not GAMESTATE:GetCurrentGame():GetName() == "pump" + return not IsGame("pump") end local tNotePositions = { @@ -232,14 +201,6 @@ function ComboUnderField() return GetUserPrefB("UserPrefComboUnderField") end -function TwoPartSelection() - return GAMESTATE:GetCurrentGame():GetName() == "pump" -end - -function TwoPartConfirmsOnly() - return GAMESTATE:GetCurrentGame():GetName() == "pump" -end - local CodeDetectorCodes = { -- steps PrevSteps1 = { diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 03358b936a..effd771f81 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -1047,21 +1047,20 @@ HoldJudgmentsUnderField=false ComboUnderField=ComboUnderField() PenalizeTapScoreNone=false JudgeHoldNotesOnSameRowTogether=false -HoldCheckpoints=(GAMESTATE:GetCurrentGame():GetName() == "pump") -CheckpointsUseTickcounts=(GAMESTATE:GetCurrentGame():GetName() == "pump") +HoldCheckpoints=IsGame("pump") +CheckpointsUseTickcounts=IsGame("pump") ; deprecated? CheckpointsUseTimeSignatures=false -CheckpointsTapsSeparateJudgment=CheckpointsTapsSeparateJudgment() +CheckpointsTapsSeparateJudgment=not IsGame("pump") ; someone misunderstood me :x -Daisu -CheckpointsFlashOnHold=(GAMESTATE:GetCurrentGame():GetName() == "pump") -ImmediateHoldLetGo=ImmediateHoldLetGo() -RequireStepOnHoldHeads=HoldHeadStep() +CheckpointsFlashOnHold=IsGame("pump") +ImmediateHoldLetGo=not IsGame("pump") +RequireStepOnHoldHeads=not IsGame("pump") RequireStepOnMines=false -InitialHoldLife=InitialHoldLife() -MaxHoldLife=MaxHoldLife() -# RollBodyIncrementsCombo=RollBodyIncrementsCombo() +InitialHoldLife=IsGame("pump") and 0.05 or 1 +MaxHoldLife=IsGame("pump") and 0.05 or 1 RollBodyIncrementsCombo=GetGamePrefB("UserPrefComboOnRolls") -ScoreMissedHoldsAndRolls=ScoreMissedHoldsAndRolls() +ScoreMissedHoldsAndRolls=not IsGame("pump") PercentUntilColorCombo=0.25 ComboStoppedAt=50 AttackRunTimeRandom=6 @@ -1904,8 +1903,8 @@ ChangeGroupsWithGameButtons=false PreviousGroupButton="MenuUp" NextGroupButton="MenuDown" # -TwoPartSelection=TwoPartSelection() -TwoPartConfirmsOnly=TwoPartConfirmsOnly() +TwoPartSelection=IsGame("pump") +TwoPartConfirmsOnly=IsGame("pump") TwoPartTimerSeconds=-1 # SampleMusicDelay=0.25