Module:Skill List/Header: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Mistiryshak (talk | contribs) mNo edit summary |
||
(6 intermediate revisions by one other user not shown) | |||
Line 7: | Line 7: | ||
local exampleSkill = args[2]:lower() | local exampleSkill = args[2]:lower() | ||
local getSkill = require('Module:Data/Skill/' .. game) | local getSkill = require('Module:Data/Skill/' .. game) | ||
local | local columnIds = { "name", "rpname", "battlename", "skilltype", "damagetype", "cost", "powerlvl", "target", "range", "hit", "power", "crit", "acc", "rank", "description", "rpdescription", "effect", "notes" } | ||
local columnLabels = { | |||
"Name", | |||
frame:expandTemplate{ title = "tt", args = { "RP Name", "''Revelations: Persona'' Name" } }, | |||
"Battle Name", | |||
frame:expandTemplate{ title = "tt", args = { "S. Type", "Skill Type" } }, | |||
frame:expandTemplate{ title = "tt", args = { "D. Type", "Damage Type" } }, | |||
"Cost", | |||
frame:expandTemplate{ title = "tt", args = { "P. Level", "Power Level" } }, | |||
"Target", | |||
"Range", | |||
"Hits", | |||
frame:expandTemplate{ title = "tt", args = { "B. Power", "Base Power" } }, | |||
frame:expandTemplate{ title = "tt", args = { "C. Rate", "Critical Hit Rate" } }, | |||
"Accuracy", | |||
"Rank", | |||
"Description", | |||
frame:expandTemplate{ title = "tt", args = { "RP Description", "''Revelations: Persona'' Description" } }, | |||
"Effect", | |||
"Notes" | |||
} | } | ||
local usedColumns = "" | local usedColumns = "" | ||
for columnId | for i, columnId in ipairs(columnIds) do | ||
if getSkill.skill[exampleSkill][columnId] then | if getSkill.skill[exampleSkill][columnId] then | ||
usedColumns = usedColumns .. "! " .. | if not (columnId == "cost" and getSkill.skill[exampleSkill]["attribute"] == "passive") then | ||
usedColumns = usedColumns .. "! " .. columnLabels[i] .. "\n" | |||
end | |||
end | end | ||
end | end |
Latest revision as of 18:11, 15 November 2024
Documentation for this module may be created at Module:Skill List/Header/doc
local getArgs = require('Module:Arguments').getArgs local p = {} function p.main(frame) local args = getArgs(frame) local game = args[1]:lower() local exampleSkill = args[2]:lower() local getSkill = require('Module:Data/Skill/' .. game) local columnIds = { "name", "rpname", "battlename", "skilltype", "damagetype", "cost", "powerlvl", "target", "range", "hit", "power", "crit", "acc", "rank", "description", "rpdescription", "effect", "notes" } local columnLabels = { "Name", frame:expandTemplate{ title = "tt", args = { "RP Name", "''Revelations: Persona'' Name" } }, "Battle Name", frame:expandTemplate{ title = "tt", args = { "S. Type", "Skill Type" } }, frame:expandTemplate{ title = "tt", args = { "D. Type", "Damage Type" } }, "Cost", frame:expandTemplate{ title = "tt", args = { "P. Level", "Power Level" } }, "Target", "Range", "Hits", frame:expandTemplate{ title = "tt", args = { "B. Power", "Base Power" } }, frame:expandTemplate{ title = "tt", args = { "C. Rate", "Critical Hit Rate" } }, "Accuracy", "Rank", "Description", frame:expandTemplate{ title = "tt", args = { "RP Description", "''Revelations: Persona'' Description" } }, "Effect", "Notes" } local usedColumns = "" for i, columnId in ipairs(columnIds) do if getSkill.skill[exampleSkill][columnId] then if not (columnId == "cost" and getSkill.skill[exampleSkill]["attribute"] == "passive") then usedColumns = usedColumns .. "! " .. columnLabels[i] .. "\n" end end end return '{| class="wikitable"\n' .. usedColumns .. "|-\n" end return p