此模块的文档可以在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 = {
-- growth stats
hp = '\n![[HP]]',
str = '\n![[Strength|Str]]',
mag = '\n![[Magic (stat)|Mag]]',
sm = '\n![[Strength|S]]/[[Magic (stat)|M]]',
mnd = '\n![[Magic (stat)|Mnd]]',
skl = '\n![[Skill (stat)|Skl]]',
spd = '\n![[Speed (stat)|Spd]]',
agl = '\n![[Speed (stat)|Agl]]',
lck = '\n![[Luck|Lck]]',
def = '\n![[Defense|Def]]',
res = '\n![[Resistance|Res]]',
con = '\n![[Constitution|Con]]',
bld = '\n![[Constitution|Bld]]',
wlv = '\n![[Weapon Level|Wlv]]',
mov = '\n![[Movement|Mov]]',
}
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 == '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]]