Module:ToMoveName

local getArgs = require('Module:Arguments').main local cap = require('Module:Capitalize').main local p = {} properName = { ["NY"] = "Neutral-Y", ["SY"] = "Side-Y", ["FY"] = "Forward-Y", ["BY"] = "Backward-Y", ["J.Y"] = "Midair Y", ["J.SY"] = "Midair Side-Y", ["BX"] = "Backward-X", ["J.X"] = "Midair X", ["5Y"] = "Y", ["6Y"] = "Forward-Y", ["4Y"] = "Backward-Y", ["8Y"] = "Up-Y", ["2Y"] = "Down-Y", ["5X"] = "X", ["6X"] = "Forward-X", ["4X"] = "Backward-X", ["8X"] = "Up-X", ["2X"] = "Down-X", ["%]Y%["] = "Hold and Release Y", ["%]X%["] = "Hold and Release X", ["Y%+B"] = "Grab", ["J.Y%+B"] = "Midair Grab", ["X%+A"] = "Counter", ["J.X%+A"] = "Midair Counter" }

phaseName = { ["Field"] = "Field", ["Duel"] = "Duel" }

function p.main local args = getArgs return p._main(args) end

function p._main(args) if args[1] then local moveName = string.upper(args[1]) local arg1 = cap(args[1]) local arg2 = cap(args[2]) local arg3 = cap(args[3]) for key, value in pairs(properName) do           if string.match(moveName, key) then output = moveName:gsub(key,value) if arg2 then if phaseName[arg2] then if arg3 then return string.format('%s (%s)', arg3, output, arg2, output, arg2) else return string.format('%s (%s)', output, arg2) end else return string.format('%s', arg2, output, output) end else return output end end end if arg2 then if phaseName[arg2] then if arg3 then return string.format('%s (%s)', arg3, arg1, arg2, arg1, arg2) else return string.format('%s (%s)', arg1, arg2) end else return string.format('%s', arg2, arg1, arg1) end else return arg1 end end end

return p