Module:FamilyCostumeUpgradeTable: Difference between revisions

m
no edit summary
(Created page with "local p = {} function p.main(frame) local args = frame:getParent().args local name = args.name or "Unnamed Costume" local image = args.image or "Placeholder.png" local levels = args.levels or "" local rows = {} for line in mw.text.gsplit(levels, ";", true) do local parts = mw.text.split(mw.text.trim(line), ",") local level = parts[1] or "" local cap = parts[2] or "" local intimacy = parts[3] or "" local bp = parts[4] or "" table.insert(rows, string....")
 
mNo edit summary
 
(6 intermediate revisions by the same user not shown)
Line 2: Line 2:


function p.main(frame)
function p.main(frame)
local args = frame:getParent().args
local args     = frame:getParent().args
local name = args.name or "Unnamed Costume"
local skill    = args.skill or "Placeholder Skill"
local image = args.image or "Placeholder.png"
local image   = args.image or ""
local levels = args.levels or ""
local levels   = args.levels or ""
local typeName = args.typeName or "❴❴❴Fellow Type❵❵❵"


local rows = {}
local rows = {}


for line in mw.text.gsplit(levels, ";", true) do
for line in mw.text.gsplit(levels, ";", true) do
local parts = mw.text.split(mw.text.trim(line), ",")
local parts   = mw.text.split(mw.text.trim(line), ",")
local level = parts[1] or ""
local level   = parts[1] or ""
local cap = parts[2] or ""
local cap     = parts[2] or ""
local intimacy = parts[3] or ""
local apt      = parts[3] or ""
local bp = parts[4] or ""
local intimacy = parts[4] or ""
local bp       = parts[5] or ""


table.insert(rows, string.format(
table.insert(rows, string.format(
'|-\n| style="text-align: center;" | %s || %s || 1 || %s || %s',
'|-\n| | %s || %s || %s || %s || %s',
level, cap, intimacy, bp
level, cap, apt, intimacy, bp
))
))
end
end


local header = [=[
local header = string.format([=[
{| class="wikitable" style="text-align: center;"
{| class="wikitable" style="text-align: center;"
|+ Costume Upgrade
|+ Costume Upgrade
Line 30: Line 32:
! Lv.
! Lv.
! Level Cap
! Level Cap
! <abbr title="The Aptitude multiplier granted by this costume.">Aptitude</abbr>
! <abbr title="The Aptitude granted by this costume.">%s Aptitude</abbr>
! <abbr title="The total Intimacy this costume contributes at this level.">Intimacy</abbr>
! <abbr title="The total Intimacy this costume contributes at this level.">Intimacy</abbr>
! <abbr title="The total Blessing Power this costume contributes at this level.">Blessing Power</abbr>
! <abbr title="The total Blessing Power this costume contributes at this level.">Blessing Power</abbr>
]=]
]=], image, skill, typeName)


local output = string.format(header, image, name)
local output = header .. "\n" .. table.concat(rows, "\n") .. "\n|}"
output = output .. "\n" .. table.concat(rows, "\n") .. "\n|}"
return output
return output
end
end


return p
return p
contributors, delete_pages, Interface administrators
4,701

edits