Files
itgmania212121/Themes/_fallback/Scripts/03 Gameplay.lua
T

350 lines
8.0 KiB
Lua
Raw Normal View History

2011-03-17 01:47:30 -04:00
-- sm-ssc fallback theme | script ring 03 | Gameplay.lua
-- [en] This file is used to store settings that should be different in each
-- game mode.
-- shakesoda calls this pump.lua
2011-12-27 20:40:30 -06:00
local function CurGameName()
return GAMESTATE:GetCurrentGame():GetName()
end
2011-03-17 01:47:30 -04:00
-- Check the active game mode against a string. Cut down typing this in metrics.
2012-03-24 00:16:21 -05:00
function IsGame(str) return CurGameName() == str end
2011-03-17 01:47:30 -04:00
-- GetExtraColorThreshold()
-- [en] returns the difficulty threshold in meter
-- for songs that should be counted as boss songs.
function GetExtraColorThreshold()
local Modes = {
dance = 10,
pump = 21,
2011-03-17 01:47:30 -04:00
beat = 12,
kb7 = 10,
para = 10,
techno = 10,
lights = 10, -- lights shouldn't be playable
}
2011-12-27 20:40:30 -06:00
return Modes[CurGameName()]
2011-03-17 01:47:30 -04:00
end
-- AllowOptionsMenu()
-- [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
2011-03-17 01:47:30 -04:00
-- GameCompatibleModes:
-- [en] returns possible modes for ScreenSelectPlayMode
function GameCompatibleModes()
local Modes = {
dance = "Single,Double,Solo,Versus,Couple",
2011-06-04 19:36:32 -04:00
pump = "Single,Double,HalfDouble,Versus,Couple,Routine",
beat = "5Keys,7Keys,10Keys,14Keys,Versus5,Versus7",
2011-03-17 01:47:30 -04:00
kb7 = "KB7",
para = "Single",
-- todo: add versus modes for technomotion
techno = "Single4,Single5,Single8,Double4,Double5,Double8",
2011-03-17 01:47:30 -04:00
lights = "Single" -- lights shouldn't be playable
}
2011-12-27 20:40:30 -06:00
return Modes[CurGameName()]
2011-03-17 01:47:30 -04:00
end
function SelectProfileKeys()
2011-12-27 20:40:30 -06:00
local sGame = CurGameName()
2011-03-17 01:47:30 -04:00
if sGame == "pump" then
return "Up,Down,Start,Back,Center,DownLeft,DownRight"
elseif sGame == "dance" then
return "Up,Down,Start,Back,Up2,Down2"
else
return "Up,Down,Start,Back"
end
end
-- ScoreKeeperClass:
-- [en] Determines the correct ScoreKeeper class to use.
function ScoreKeeperClass()
2011-09-27 22:05:09 -05:00
-- rave scorekeeper
if GAMESTATE:GetPlayMode() == 'PlayMode_Rave' then return "ScoreKeeperRave" end
2011-09-29 00:31:29 -05:00
if GAMESTATE:GetCurrentStyle() then
local styleType = GAMESTATE:GetCurrentStyle():GetStyleType()
if styleType == 'StyleType_TwoPlayersSharedSides' then return "ScoreKeeperShared" end
end
2011-09-27 22:08:44 -05:00
return "ScoreKeeperNormal"
2011-03-17 01:47:30 -04:00
end
-- ComboContinue:
-- [en]
function ComboContinue()
local Continue = {
dance = GAMESTATE:GetPlayMode() == "PlayMode_Oni" and "TapNoteScore_W2" or "TapNoteScore_W3",
pump = "TapNoteScore_W3",
beat = "TapNoteScore_W3",
kb7 = "TapNoteScore_W3",
para = "TapNoteScore_W4"
}
2011-12-27 20:40:30 -06:00
return Continue[CurGameName()]
2011-03-17 01:47:30 -04:00
end
function ComboMaintain()
local Maintain = {
dance = "TapNoteScore_W3",
pump = "TapNoteScore_W4",
beat = "TapNoteScore_W3",
kb7 = "TapNoteScore_W3",
para = "TapNoteScore_W4"
}
2011-12-27 20:40:30 -06:00
return Maintain[CurGameName()]
2011-03-17 01:47:30 -04:00
end
function ComboPerRow()
2011-12-27 20:40:30 -06:00
sGame = CurGameName()
2011-03-17 01:47:30 -04:00
if sGame == "pump" then
return true
elseif GAMESTATE:GetPlayMode() == "PlayMode_Oni" then
return true
else
return false
end
end
2011-07-09 14:40:57 -04:00
function EvalUsesCheckpointsWithJudgments()
2011-12-27 20:40:30 -06:00
return (CurGameName() == "pump") and true or false
2011-07-09 14:40:57 -04:00
end
2011-12-29 12:49:45 -06:00
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 },
-------------------------------------------
default = { Hit = 2, Miss = 2, Fail = -1 }
}
2011-03-17 01:47:30 -04:00
function HitCombo()
2011-12-29 12:49:45 -06:00
if ComboThresholds[CurGameName()] then
return ComboThresholds[CurGameName()].Hit
end
return ComboThresholds["default"].Hit
2011-03-17 01:47:30 -04:00
end
function MissCombo()
2011-12-29 12:49:45 -06:00
if ComboThresholds[CurGameName()] then
return ComboThresholds[CurGameName()].Miss
end
return ComboThresholds["default"].Miss
2011-03-17 01:47:30 -04:00
end
-- FailCombo:
-- [en] The combo that causes game failure.
function FailCombo()
2011-12-29 12:49:45 -06:00
-- ITG (dance) uses 30. Pump Pro uses 30, real Pump uses 51
if ComboThresholds[CurGameName()] then
return ComboThresholds[CurGameName()].Fail
end
return ComboThresholds["default"].Fail
2011-03-17 01:47:30 -04:00
end
2011-12-29 12:49:45 -06:00
local RoutineSkins = {
dance = { P1 = "midi-routine-p1", P2 = "midi-routine-p2" },
2011-12-29 12:49:45 -06:00
pump = { P1 = "cmd-routine-p1", P2 = "cmd-routine-p2" },
kb7 = { P1 = "default", P2 = "retrobar" },
-------------------------------------------------------------
default = { P1 = "default", P2 = "default" }
}
2011-03-17 01:47:30 -04:00
function RoutineSkinP1()
2011-12-29 12:49:45 -06:00
if RoutineSkins[CurGameName()] then
return RoutineSkins[CurGameName()].P1
end
return RoutineSkins["default"].P1
2011-03-17 01:47:30 -04:00
end
function RoutineSkinP2()
2011-12-29 12:49:45 -06:00
if RoutineSkins[CurGameName()] then
return RoutineSkins[CurGameName()].P2
end
return RoutineSkins["default"].P2
2011-03-17 01:47:30 -04:00
end
-- todo: use tables for some of these -aj
function HoldTiming()
return IsGame("pump") and 0 or PREFSMAN:GetPreference("TimingWindowSecondsHold")
2011-03-17 01:47:30 -04:00
end
function ShowHoldJudgments()
return not IsGame("pump")
2011-03-17 01:47:30 -04:00
end
local CodeDetectorCodes = {
-- steps
PrevSteps1 = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Up,Up",
2011-08-20 01:16:41 -05:00
pump = "+UpLeft",
},
PrevSteps2 = {
default = "MenuUp,MenuUp",
dance = "MenuUp,MenuUp",
pump = "",
},
NextSteps1 = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Down,Down",
2011-08-20 01:16:41 -05:00
pump = "+UpRight",
},
NextSteps2 = {
default = "MenuDown,MenuDown",
dance = "MenuDown,MenuDown",
pump = "",
},
-- group
NextGroup = {
default = "",
dance = "MenuUp,MenuRight,MenuRight",
pump = "",
},
PrevGroup = {
default = "",
dance = "MenuUp,MenuDown,MenuUp,MenuDown",
pump = "",
},
CloseCurrentFolder = {
default = "MenuUp-MenuDown",
},
-- sorts
NextSort1 = {
default = "@MenuLeft-@MenuRight-Start",
dance = "@MenuLeft-@MenuRight-Start",
pump = "@MenuLeft-@MenuRight-Start",
},
NextSort2 = {
default = "MenuLeft-MenuRight",
dance = "MenuLeft-MenuRight",
pump = "MenuLeft-MenuRight",
},
NextSort3 = {
default = "",
dance = "@Left-@Right-Start",
pump = "@DownLeft-@DownRight-Start",
},
NextSort4 = {
default = "",
dance = "Left-Right",
pump = "DownLeft-DownRight",
},
-- modemenu
ModeMenu1 = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Up,Down,Up,Down",
},
ModeMenu2 = {
default = "MenuUp,MenuDown,MenuUp,MenuDown",
},
-- Evaluation:
SaveScreenshot1 = {
default = "MenuLeft-MenuRight",
},
SaveScreenshot2 = {
default = "Select",
},
-- modifiers section
CancelAll = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Left,Right,Left,Right,Left,Right,Left,Right",
},
--- specific modifiers
Mirror = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Up,Left,Right,Left,Right",
pump = "DownRight,DownLeft,UpRight,UpLeft,DownRight,DownLeft,UpRight,UpLeft,Center",
},
Left = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Up,Down,Right,Left",
},
Right = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Up,Down,Left,Right",
},
Shuffle = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Down,Up,Down,Up",
pump = "UpLeft,UpRight,UpLeft,UpRight,DownLeft,DownRight,DownLeft,DownRight,Center", -- random
},
SuperShuffle = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Down,Up,Left,Right",
pump = "UpLeft,UpRight,DownLeft,DownRight,UpLeft,UpRight,DownLeft,DownRight,Center"
},
Reverse = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Down,Left,Right,Left,Right",
pump = "UpLeft,DownLeft,UpRight,DownRight,UpLeft,DownLeft,UpRight,DownRight,DownRight", -- drop
},
HoldNotes = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Right,Left,Down,Up",
},
Mines = {
default = "",
},
Dark = {
default = "",
},
Hidden = {
default = "",
pump = "UpLeft,UpRight,DownLeft,DownRight,Center", -- vanish
},
RandomVanish = {
default = "",
},
-- boost (accel), brake (decel), stealth (nonstep)
--- next/prev modifiers
NextTransform = {
default = "",
},
NextScrollSpeed = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Up,Left,Down,Left,Up",
pump = "UpLeft,UpRight,UpLeft,UpRight,Center",
},
PreviousScrollSpeed = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Down,Right,Up,Right,Down",
pump = "UpRight,UpLeft,UpRight,UpLeft,Center",
},
NextAccel = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Left,Right,Down,Up",
},
NextEffect = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Left,Down,Right",
},
NextAppearance = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Left,Up,Right",
},
NextTurn = {
default = "",
},
-- cancel all in player options
CancelAllPlayerOptions = {
2011-08-20 01:16:41 -05:00
default = "",
dance = "Left,Right,Left,Right,Left,Right",
},
};
function GetCodeForGame(codeName)
2011-12-27 20:40:30 -06:00
local gameName = string.lower(CurGameName())
local inputCode = CodeDetectorCodes[codeName]
return inputCode[gameName] or inputCode["default"]
2011-09-29 00:12:54 -04:00
end