Module:Minion/Templates

local string, table, minion = require('Module:String'), require('Module:Table'), require('Module:Minion') local minionData = mw.loadData('Module:Minion/Data')

local function to(a, b)	local arrow = '➜' return ('%s%s%s'):format(a, arrow, b) end

local function minions local ret = {} table.each(table.keys(minionData), function(name)		local stats = minionData[name].stats		local description = 		table.merge(description, table.deepCopy(minionData[name].abilities or {}, true))		local max = table.length(stats)		local max_ = string._toRoman(max)		for i, v in ipairs(stats) do			local desc = table.concat(table.map(description, function (d)				if (i >= d.req) then return d[1] end			end), '//')			if (v.tba and v.storage) then				table.push(ret, { name, string._toRoman(i), desc, v.tba, v.storage, id = '{o} Minion {0}' })			end		end		local f, l = stats[1], stats[max]		if (f.tba and f.storage and l.tba and l.storage) then			local desc = table.concat(table.map(description, function (d)				return d[1]			end), '//')			table.push(ret, { name, to('I', max_), desc, to(f.tba, l.tba), to(f.storage, l.storage), id = '{o} Minion', name = '{o} Minion', image = '{o} Minion ' .. max_ })		end	end) return ret end

local function skins return { {'Tropical Bird 2 Minion Skin', '/&eTropical Bird 2'}, {'Tropical Bird 1 Minion Skin', '/&eTropical Bird 1'}, {'White Tiger Minion Skin', 'White/&eTiger'}, {'Festive Jerry Minion Skin', '/&eFestive Jerry'}, {'Festive Zombie Minion Skin', '/&eFestive Zombie'}, {'Festive Skeleton Minion Skin', '/&eFestive Skeleton'}, {'Cyclops Minion Skin', '/&eCyclops'}, {'Scarecrow Minion Skin', '/&eScarecrow'}, {'Shark Minion Skin', '/&eShark'}, {'Basketball Minion Skin', '/&eBasketball'}, {'Ghost Minion Skin', '/&eGhost'}, {'Pumpkin Minion Skin', '/&ePumpkin'}, {'Mummy Minion Skin', '/&eMummy'}, {'Penguin Minion Skin', '/&ePenguin'}, {'Pink Bunny Personality', 'Pink/&eBunny'}, {'Easter Egg Minion Skin', '/&eEaster Egg'}, {'Present Minion Skin', '/&ePresent'}, {'Reindeer Minion Skin', '/&eReindeer'}, {'Hermit Crab Minion Skin', '/&eHermit Crab'}, {'Pink Donut Minion Skin', 'Pink/&eFrosted Donut'}, {'Beach Ball Minion Skin', 'Beach Ball'}, {'Bee Minion Skin', '/&eBee'}, {'Bunny Minion Skin', 'Bunny'}, {'Clownfish Minion Skin', 'Clownfish'}, {'Gingerbread Man Minion Skin', '/&eGingerbread Man'}, {'Grinch Minion Skin', '/&eGrinch'}, {'Ice Cream Minion Skin', 'Ice/&eCream'}, {'Ice Lolly Minion Skin', 'Ice/&eLolly'}, {'Killer Minion Skin', '/&eKiller'}, {'Lady Bug Minion Skin', 'Lady/&eBug'}, {'Melon Minion Skin', '/&eMelon'}, {'Sandcastle Minion Skin', '/&eSandcastle'}, {'Santa Minion Skin', '/&eSanta'}, {'Skull Minion Skin', '/&eSkull'}, {'Sun Minion Skin', '/&eSun'}, {'Undead Minion Skin', '/&eUndead'}, } end

return { minions = minions, skins = skins }