ElEditors, Interface administrators, Administrators
70,867
edits
No edit summary |
No edit summary |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
local args = getArgs(frame); | local args = getArgs(frame); | ||
local | local stats = {}; | ||
if args[ | function readStats(stat, value1, value2, value3) | ||
stats[stat] = args[value1] | |||
if args[stat] == '2' then | |||
stats[stat] = args[value2] | |||
elseif args[stat] == '3' then | |||
stats[stat] = args[value3] | |||
elseif args[stat] == '0' or args[stat] == nil then | |||
stats[stat] = args['l_unk'] | |||
end | |||
end | end | ||
readStats('Speed', 'l_slow', 'l_average', 'l_fast'); | |||
readStats('Range', 'l_short', 'l_medium', 'l_long'); | |||
readStats('Difficulty', 'l_easy', 'l_normal', 'l_hard'); | |||
local type = args.l_magical; | local type = args.l_magical; | ||
Line 47: | Line 42: | ||
addCell('char-stats-cat', args.l_speed, true); | addCell('char-stats-cat', args.l_speed, true); | ||
addCell('char-stats-active', | addCell('char-stats-active', stats['Speed']); | ||
addCell('char-stats-attack', type_img); | addCell('char-stats-attack', type_img); | ||
addCell('char-stats-cat', args.l_range, true); | addCell('char-stats-cat', args.l_range, true); | ||
addCell('char-stats-active', | addCell('char-stats-active', stats['Range']); | ||
addCell('char-stats-cat', args.l_difficulty, true); | addCell('char-stats-cat', args.l_difficulty, true); | ||
addCell('char-stats-active', | addCell('char-stats-active', stats['Difficulty']); | ||
addCell('char-stats-attack-caption', type, true); | addCell('char-stats-attack-caption', type, true); | ||