Module:Skill List/Header: Difference between revisions

Jump to navigation Jump to search
(Created page with "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 possibleColumns = { name = "Name", rpname = frame:expandTemplate{ title = "tt", args = { "RP Name", "''Revelations: Persona'' Name" } }, battlename = "Battle Name", skilltype = frame:expandTemplate{ title = "tt", args...")
(No difference)

Revision as of 19:25, 15 October 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 possibleColumns = {
		name = "Name",
		rpname = frame:expandTemplate{ title = "tt", args = { "RP Name", "''Revelations: Persona'' Name" } },
		battlename = "Battle Name",
		skilltype = frame:expandTemplate{ title = "tt", args = { "S. Type", "Skill Type" } },
		damagetype = frame:expandTemplate{ title = "tt", args = { "D. Type", "Damage Type" } },
		cost = "Cost",
		powerlvl = frame:expandTemplate{ title = "tt", args = { "P. Level", "Power Level" } },
		target = "Target",
		range = "Range",
		hit = "Hits",
		power = frame:expandTemplate{ title = "tt", args = { "B. Power", "Base Power" } },
		crit = frame:expandTemplate{ title = "tt", args = { "C. Rate", "Critical Hit Rate" } },
		acc = "Accuracy",
		rank = "Rank",
		description = "Description",
		rpdescription = frame:expandTemplate{ title = "tt", args = { "RP Description", "''Revelations: Persona'' Description" } },
		effect = "Effect"
	}
	local usedColumns = ""
	for columnId, columnLabel in ipairs(weapons) do
		if getSkill.skill[exampleSkill][columnId] then
			usedColumns = usedColumns .. "! " .. columnLabel .. "\n"
		end
	end
	
	return '{| class="wikitable"\n' .. usedColumns .. "|-\n"
end

return p