Fire Emblem Wiki
Advertisement
Fire Emblem Wiki

Documentation for this module may be created at Module:CharGrowth/doc

--This module is invoked by Template:CharGrowth

local p = {}
local getArgs = require('Module:Arguments').getArgs
local getColor = require('Module:Color').colorByGame
local common = require('Module:Common')
local cols = require('Module:CharStat/data').growth

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

function p._main(args)
    local out, game, columns
    local color, class = '', ''
    if(args.game ~= nil) then 
        game = string.lower(args.game)
        color = getColor[game]
        class = common.colorLinks(game)
    end

    if(game == 'fe1' or game == 'fe3') then
        columns =
            cols.hp..
            cols.str..
            cols.skl..
            cols.spd..
            cols.lck..
            cols.wlv..
            cols.def..
            cols.res
    elseif(game == 'fe2') then
        columns =
            cols.hp..
            cols.str..
            cols.skl..
            cols.spd..
            cols.lck..
            cols.def..
            cols.res
    elseif(game == 'fe5') then
        columns =
            cols.hp..
            cols.str..
            cols.mag..
            cols.skl..
            cols.spd..
            cols.lck..
            cols.def..
            cols.bld..
            cols.mov
    elseif(game == 'fe6' or game == 'fe7' or game == 'fe8') then
        columns =
            cols.hp..
            cols.sm..
            cols.skl..
            cols.spd..
            cols.lck..
            cols.def..
            cols.res
    elseif(game == 'fe15') then
        columns =
            cols.hp..
            cols.atk..
            cols.skl..
            cols.spd..
            cols.lck..
            cols.def..
            cols.res
    elseif(game == 'fe16') then
        columns =
            cols.hp..
            cols.str..
            cols.mag..
            cols.dex..
            cols.spd..
            cols.lck..
            cols.def..
            cols.res..
            cols.cha
    elseif(game == 'ts') then
        columns =
            cols.hp..
            cols.str..
            cols.mag..
            cols.skl..
            cols.agl..
            cols.lck..
            cols.wlv..
            cols.def..
            cols.mov
    elseif(game == 'ts2') then
        columns =
            cols.hp..
            cols.str..
            cols.mnd..
            cols.agl..
            cols.def
        for i = 1, 4 do
            if(args[i] ~= nil) then
                columns = columns..'\n!'..args[i]
            end
        end
    else
        columns =
            cols.hp..
            cols.str..
            cols.mag..
            cols.skl..
            cols.spd..
            cols.lck..
            cols.def..
            cols.res
    end

    out = 
    '{|class="statbox"'..
    '\n|-bgcolor='..color..' class='..class..
        columns..
    '\n|-class="s-cells"'
    
    return out
end

return p
--[[Category:Modules]]