Module:ClassInfo

--This module is invoked by Template:Classstat, Template:ClassPromotions and Template:ClassSkills

local getArgs = require('Module:Arguments').getArgs local getColor = require('Module:Color').colorByGame local common = require('Module:Common') local p = {}

local games = { fe1= 'FE1', fe2= 'FE2', fe3= 'FE3', fe4= 'FE4', fe5= 'FE5', fe6= 'FE6', fe7= 'FE7', fe8= 'FE8', fe9= 'FE9', fe10='FE10', fe11='FE11', fe12='FE12', fe13='FE13', fe14='FE14', ts= 'TS', }

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

function p._main(args) local out, cols, class, color, game local nP = 5     -- number of additional parameters local nFEG = 14 -- number of FE games local rows = '' if(args.type == 'stat') then cols = '!!HP!!Str!!Mag!!Skl!!Spd'.. '!!Lck!!Def!!Res!!Mov!!Con'.. '!!Wt.!!Wp.Rank' elseif(args.type == 'promotion') then cols = '!!Base Class!!width=50%|Promotion Method!!Promoted Class(es)' else cols = '!!Skill!!Requirements' end for i = 1, nFEG do       if(args['fe'..i] ~= nil) then game = 'fe'..i       elseif(args['ts'] ~= nil) then game = 'ts' end if(game ~= nil) then class = common.colorLinks(game) color = getColor[game] rows = rows.. '\n!style="background:'..color..'" class='..class.. '|'..games[game].. '\n|-'.. '| '..string.gsub(args[game], '*', '||') end end -- Final output out = '\n{|class="wikitable" style="text-align:center"'.. '\n|-\n! '..       cols.. '\n|-'.. rows.. '\n|}' return out end

return p --