Module:Infobox card/sandbox

local p = {} local m_util = require("Module:Utils") local mArguments

function p.main(frame) mArguments = require("Module:Arguments") local args = mArguments.getArgs(frame) frame = m_util.misc.get_frame(frame) local tabberContent = p._main(args) -- mw.logObject(tabberContent) -- return frame:extensionTag('tabber', tabberContent) end

-- returns k:v where k is tab label, and v is tab content. function p._main(args) local m0 = { rarity       = args.star, image        = args.image, number       = args.number, jobtype      = args.type, element      = args.element, skillseeds   = args.seeds, ability_page = args.ability, orbs         = args.orbs, extraskills  = args.extraskills, autoabilities = args.auto, augment      = args.augment, description  = args.description, }	local m = {} for k,v in pairs(m0) do		for i,s in ipairs(mw.text.split(v, '%s*//%s*')) do			m[i] = m[i] or {} m[i][k] = s		end end for i,card in ipairs(m) do		local r,f = card.rarity:match('(%d*)(%+?)') card.rarity = tonumber(r) card.is_fast_learner = f == '+' end for k,v in pairs(m[1]) do		if k ~= 'image' and k ~= 'augment' and k ~= 'extraskills' then for i=2,#m do				if m[i][k] == nil then m[i][k] = m[i-1][k] end end end end for i,card in pairs(m) do		local rarity = card.rarity local is_support = card.jobtype:lower == 'support' local max_level = is_support and (rarity + 1) or (rarity * 2) local ability_page = card.ability_page local jobtype = card.jobtype local element = card.element local results = mw.ext.cargo.query(			'abilities, ability_stats',			'name, element, job_type, level, attack, break_power, crit_chance, cooldown',			{				join = 'abilities._pageId = ability_stats._pageId',				where = ('abilities._pageName = %q AND level = %d'):format(ability_page, max_level),			}) for _,result in ipairs(results) do			card.ability = result.name card.attack = result.attack card.break_power = result.break_power card.crit_chance = result.crit_chance card.cooldown = result.cooldown card.ability_page = nil end end mw.logObject(m) --	local abilities = {}	for i,ability in ipairs(args.ability) do		abilities[

return m end

function p._test p.main{ star = '1 // 2 // 3', image = 'Card_135_EN_Dust_Soldier_Earth_1.png // Card_181_EN_Dust_Soldier_Earth_2.png // Card_182_EN_Dust_Soldier_Earth_3.png', number = '135 // 181 // 182', type = 'Warrior', element = 'earth', seeds = 'earth x8, dark x0 // earth x10, dark x0 // earth x18, dark x0', ability = 'Lesser Earth Sword // Lesser Earth Sword // Earth Sword', orbs = 'earth x5 // earth x4 // earthx4', range = 'Single', maxlv = '2 // 4 // 6', attack = '176 // 208 // 374', breakpower = '154 // 182 // 306', crit = '★', extraskills = '2 Bloodthirst //4 Elemental Retrieval', auto = '// // Attack Up +2%', augment = 'Emet Stone (Card) x2 // Emet Stone (Card) x2, Burning Stinger (Card) x2', description = "A diminutive fiend born out of Chaos's blight. This card is easy to obtain and enhance. Creates earth skillseeds.", } end

return p