Module:CharStats: Difference between revisions
From Elwiki
(Created page with "require('Module:CommonFunctions') local getArgs = require('Module:Arguments').getArgs local p = {} -- Main process function p.main(frame, title) local args = getArgs(fram...") |
No edit summary |
||
Line 36: | Line 36: | ||
local char_stats = mw.html.create('div'):addClass('char-stats'); | local char_stats = mw.html.create('div'):addClass('char-stats'); | ||
char_stats:tag('div').addClass('.char-stats-cat') | char_stats:tag('div').addClass('.char-stats-cat') | ||
return char_stats; | return char_stats; |
Revision as of 17:02, 6 May 2022
Documentation for this module may be created at Module:CharStats/doc
require('Module:CommonFunctions')
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Main process
function p.main(frame, title)
local args = getArgs(frame);
local speed = args.l_slow;
if args['Speed'] == '2' then
speed = args.l_average;
elseif args['Speed'] == '3' then
speed = args.l_fast;
end
local range = args.l_short;
if args['Range'] == '2' then
range = args.l_medium;
elseif args['Range'] == '3' then
range = args.l_long;
end
local difficulty = args.l_easy;
if args['Difficulty'] == '2' then
difficulty = args.l_normal;
elseif args['Difficulty'] == '3' then
difficulty = args.l_hard;
end
local type = args.l_magical;
local type_img = '[[File:UI - Magical Class.png]]';
if args['Damage'] == 'P' then
type = args.l_physical;
type_img = '[[File:UI - Physical Class.png]]';
end
local char_stats = mw.html.create('div'):addClass('char-stats');
char_stats:tag('div').addClass('.char-stats-cat')
return char_stats;
end
return p