Fandom

Fire Emblem Wiki

Module:CharGrowth

5,767pages on
this wiki
Add New Page
Talk0
--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 == '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" style="text-align: center"'..
    '\n|-bgcolor='..color..' class='..class..
        columns..
    '\n|-class="s-cells"'
 
    return out
end
 
return p
--[[Category:Modules]]

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.