Skip to content

Commit

Permalink
clean up fallback button combo stuff and remove some game specific stuff
Browse files Browse the repository at this point in the history
pump no longer has goods continuing combo
some combos changed or fixed
pump no longer fails you at 51 misses (?)
etc
  • Loading branch information
poco0317 committed Jun 26, 2021
1 parent 1f3ad79 commit a0c82db
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 153 deletions.
175 changes: 25 additions & 150 deletions Themes/_fallback/Scripts/03 Gameplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,70 +95,12 @@ function GameCompatibleModes()
return Modes[CurGameName()]
end

local function upper_first_letter(s)
local first_letter = s:match("([a-zA-Z])")
return s:gsub(first_letter, first_letter:upper(), 1)
end

-- No more having a metric for every style for every game mode. -Kyz
function ScreenSelectStyleChoices()
local styles = GAMEMAN:GetStylesForGame(GAMESTATE:GetCurrentGame():GetName())
local choices = {}
for i, style in ipairs(styles) do
local name = style:GetName()
local cap_name = upper_first_letter(name)
-- threepanel don't seem like it should actually be selectable.
if name ~= "threepanel" then
choices[#choices + 1] =
"name," .. cap_name .. ";style," .. name .. ";text," .. cap_name .. ";screen," .. Branch.AfterSelectStyle()
end
end
return choices
end

-- No more having an xy for every style for every game mode. -Kyz
function ScreenSelectStylePositions(count)
local poses = {}
local columns = 1
local choice_height = 96
local column_x = {_screen.cx, _screen.cx + 160}
if count > 4 then
column_x[1] = _screen.cx - 160
columns = 2
end
if count > 8 then
column_x[1] = _screen.cx - 240
column_x[2] = _screen.cx
column_x[3] = _screen.cx + 240
columns = 3
end
local num_per_column = {math.ceil(count / columns), math.floor(count / columns)}
if count > 8 then
if count % 3 == 0 then
num_per_column[3] = count / columns
elseif count % 3 == 1 then
num_per_column[3] = num_per_column[2]
else
num_per_column[3] = num_per_column[1]
end
end
for c = 1, columns do
local start_y = _screen.cy - (choice_height * ((num_per_column[c] / 2) + .5))
for i = 1, num_per_column[c] do
poses[#poses + 1] = {column_x[c], start_y + (choice_height * i)}
end
end
return poses
end

function SelectProfileKeys()
local sGame = CurGameName()
if sGame == "pump" then
return "Up,Down,Start,Back,Center,DownLeft,DownRight"
elseif sGame == "dance" then
if sGame == "dance" then
return "Up,Down,Start,Back,Up2,Down2"
else
return "Up,Down,Start,Back"
return "Up,Down,Start,Back,Up2,Down2"
end
end

Expand All @@ -176,33 +118,23 @@ function ComboContinue()
pump = "TapNoteScore_W3",
beat = "TapNoteScore_W3",
kb7 = "TapNoteScore_W3",
para = "TapNoteScore_W4"
}
return Continue[CurGameName()] or "TapNoteScore_W3"
end

function ComboMaintain()
local Maintain = {
dance = "TapNoteScore_W3",
pump = "TapNoteScore_W4",
pump = "TapNoteScore_W3",
beat = "TapNoteScore_W3",
kb7 = "TapNoteScore_W3",
para = "TapNoteScore_W4"
}
return Maintain[CurGameName()] or "TapNoteScore_W3"
end

function EvalUsesCheckpointsWithJudgments()
return (CurGameName() == "pump") and true or false
end

local ComboThresholds = {
dance = {Hit = 2, Miss = 2, Fail = -1},
pump = {Hit = 4, Miss = 4, Fail = 51},
beat = {Hit = 1, Miss = 0, Fail = -1},
kb7 = {Hit = 1, Miss = 0, Fail = -1},
para = {Hit = 2, Miss = 0, Fail = -1},
maniax = {Hit = 5, Miss = 0, Fail = -1},
-- each game can be defined here to override default
-- dance = {Hit = 69, Miss = 0, Fail = 1}
-------------------------------------------
default = {Hit = 2, Miss = 2, Fail = -1}
}
Expand Down Expand Up @@ -231,57 +163,41 @@ function FailCombo()
return ComboThresholds["default"].Fail
end

function TwoPartSelection()
return GAMESTATE:GetCurrentGame():GetName() == "pump" and true or false
end

-- todo: use tables for some of these -aj
function HoldTiming()
return IsGame("pump") and 0 or PREFSMAN:GetPreference("TimingWindowSecondsHold")
end

function ShowHoldJudgments()
return not IsGame("pump")
end

local CodeDetectorCodes = {
-- each game can also be defined
-- this overrides the defaults
-- ex:
--[[
{
default = "",
dance = "",
solo = "",
pump = "",
beat = "",
kb7 = "",
popn = "",
}
]]

-- steps
PrevSteps1 = {
default = "",
dance = "Up,Up",
solo = "Up,Up",
pump = "+UpLeft"
default = "Up,Up",
},
PrevSteps2 = {
default = "MenuUp,MenuUp",
dance = "MenuUp,MenuUp",
solo = "MenuUp,MenuUp",
pump = ""
},
NextSteps1 = {
default = "",
dance = "Down,Down",
solo = "Down,Down",
pump = "+UpRight"
default = "Down,Down",
},
NextSteps2 = {
default = "MenuDown,MenuDown",
dance = "MenuDown,MenuDown",
solo = "MenuDown,MenuDown",
pump = ""
},
-- group
NextGroup = {
default = "",
dance = "",
solo = "",
pump = ""
},
PrevGroup = {
default = "",
dance = "",
solo = "",
pump = ""
},
CloseCurrentFolder1 = {
default = "MenuUp-MenuDown"
Expand All @@ -291,34 +207,20 @@ local CodeDetectorCodes = {
},
-- sorts
NextSort1 = {
default = "@MenuLeft-@MenuRight-Start",
dance = "@MenuLeft-@MenuRight-Start",
solo = "@MenuLeft-@MenuRight-Start",
pump = "@MenuLeft-@MenuRight-Start"
default = "MenuLeft-MenuRight",
},
NextSort2 = {
default = "MenuLeft-MenuRight",
dance = "MenuLeft-MenuRight",
solo = "MenuLeft-MenuRight",
pump = "MenuLeft-MenuRight"
default = "",
},
NextSort3 = {
default = "",
dance = "@Left-@Right-Start",
solo = "@Left-@Right-Start",
pump = "@DownLeft-@DownRight-Start"
},
NextSort4 = {
default = "",
dance = "Left-Right",
solo = "Left-Right",
pump = "DownLeft-DownRight"
},
-- modemenu
ModeMenu1 = {
default = "",
dance = "Up,Down,Up,Down",
solo = "Up,Down,Up,Down"
default = "Up,Down,Up,Down",
},
ModeMenu2 = {
default = "MenuUp,MenuDown,MenuUp,MenuDown"
Expand All @@ -333,68 +235,41 @@ local CodeDetectorCodes = {
-- modifiers section
CancelAll = {
default = "",
dance = "",
solo = ""
},
--- specific modifiers
Mirror = {
default = "",
dance = "",
solo = "",
pump = "DownRight,DownLeft,UpRight,UpLeft,DownRight,DownLeft,UpRight,UpLeft,Center"
},
Left = {
default = "",
dance = "",
solo = ""
},
Right = {
default = "",
dance = "",
solo = ""
},
Shuffle = {
default = "",
dance = "",
solo = "",
pump = "UpLeft,UpRight,UpLeft,UpRight,DownLeft,DownRight,DownLeft,DownRight,Center" -- random
},
SuperShuffle = {
default = "",
dance = "",
solo = "",
pump = "UpLeft,UpRight,DownLeft,DownRight,UpLeft,UpRight,DownLeft,DownRight,Center"
},
Reverse = {
default = "",
dance = "",
solo = "",
pump = "UpLeft,DownLeft,UpRight,DownRight,UpLeft,DownLeft,UpRight,DownRight,DownRight" -- drop
},
Mines = {
default = ""
},
Hidden = {
default = "",
pump = "UpLeft,UpRight,DownLeft,DownRight,Center" -- vanish
},
NextScrollSpeed = {
default = "",
dance = "",
solo = "",
pump = "UpLeft,UpRight,UpLeft,UpRight,Center"
},
PreviousScrollSpeed = {
default = "",
dance = "",
solo = "",
pump = "UpRight,UpLeft,UpRight,UpLeft,Center"
},
-- cancel all in player options
CancelAllPlayerOptions = {
default = "",
dance = "",
solo = ""
}
}

Expand Down
1 change: 0 additions & 1 deletion Themes/_fallback/base._ini
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ ScreenModsCommand=setupmusicstagemods
PreviousSongButton="MenuLeft"
NextSongButton="MenuRight"
UseOptionsList=false
TwoPartSelection=false
TwoPartConfirmsOnly=false
UsePlayerSelectMenu=false
StepsDisplayP1X=
Expand Down
2 changes: 0 additions & 2 deletions Themes/_fallback/metrics.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1300,8 +1300,6 @@ TimerSeconds=-1
#
DefaultChoice="Single"
# Giant metric list left in for backwards compatibility.
# A much better way to handle this is:
# ChoiceNames="lua,ScreenSelectStyleChoices()"
# That will list all the styles for the current game without needing a huge
# list of metrics. _fallback still uses the old method to avoid the
# possibility of breaking themes. -Kyz
Expand Down

0 comments on commit a0c82db

Please sign in to comment.