Module:FamilyCostumeUpgradeTable: Difference between revisions
Jump to navigation
Jump to search
FaeriMagic (talk | contribs) (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....") |
(No difference)
|
Revision as of 02:53, 31 July 2025
Documentation for this module may be created at Module:FamilyCostumeUpgradeTable/doc
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.format(
'|-\n| style="text-align: center;" | %s || %s || 1 || %s || %s',
level, cap, intimacy, bp
))
end
local header = [=[
{| class="wikitable" style="text-align: center;"
|+ Costume Upgrade
|-
| colspan="5" | [[File:%s|25px]] %s
|-
! Lv.
! Level Cap
! <abbr title="The Aptitude multiplier granted by this costume.">Aptitude</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>
]=]
local output = string.format(header, image, name)
output = output .. "\n" .. table.concat(rows, "\n") .. "\n|}"
return output
end
return p