Module:Grid/T4Aspect

local p = {}

local g = require("Module:Common") local s = require("Module:Sprite") local cn = require("Module:Grid/Crafting_Square_Numbers")

p.aspects = { ["aer"] = 2; ["alienis"] = 3; ["aqua"] = 4; ["arbor"] = 5; ["auram"] = 6; ["bestia"] = 7; ["citrus"] = 67; -- PFG ["cognitio"] = 8; ["corpus"] = 9; ["desidia"] = 50; -- FM	["electrum"] = 57; -- GT	["exanimis"] = 10; ["exubitor"] = 64; -- TW	["fabrico"] = 11; ["fames"] = 12; ["fluctuatio"] = 68; -- TE	["fluxus"] = 68; -- PFG ["gelum"] = 13; ["granum"] = 65; -- TA	["gula"] = 51; -- FM	["herba"] = 14; ["humanus"] = 15; ["ignis"] = 16; ["infernus"] = 52; -- FM	["instrumentum"] = 17; ["invidia"] = 53; -- FM	["ira"] = 54; -- FM	["iter"] = 18; ["limus"] = 19; ["lucrum"] = 20; ["lux"] = 21; ["luxuria"] = 55; -- FM	["machina"] = 22; ["magnes"] = 69; -- PFG ["magneto"] = 58; -- GT	["matrix"] = 73; -- ET	["messis"] = 23; ["metallum"] = 24; ["meto"] = 25; ["mortuus"] = 26; ["motus"] = 27; ["mru"] = 71; -- ET	["nebrisum"] = 59; -- GT	["ordo"] = 28; ["pannus"] = 29; ["perditio"] = 30; ["perfodio"] = 31; ["permutatio"] = 32; ["potentia"] = 33; ["praecantatio"] = 34; ["radiation"] = 72; -- ET	["radio"] = 60; -- GT	["revelatio"] = 70; -- PFG ["sanctus"] = 63; -- TheE ["sano"] = 35; ["saxum"] = 66; -- TA	["sensus"] = 36; ["spiritus"] = 37; ["strontio"] = 61; -- GT	["superbia"] = 56; -- FM	["telum"] = 38; ["tempestas"] = 39; ["tempus"] = 62; -- MB	["tenebrae"] = 40; ["terra"] = 41; ["tutamen"] = 42; ["unknown"] = 1; ["vacuos"] = 43; ["venenum"] = 44; ["victus"] = 45; ["vinculum"] = 46; ["vitium"] = 47; ["vitreus"] = 48; ["volatus"] = 49; }

function p.makeAspect(name, amount, link, tooltip, top, left) local sprite = p.aspects[name:lower] or p.aspects['unknown'] local output = '' .. s.makeSprite('T4aspects.png', sprite - 1, 32, 512, link, g.cap(name)) output = output .. ' '	if amount > 1 or amount == 0 then output = output .. '' .. cn.makeCraftingNumbers(amount, link) .. ' '	end return output end

function p.makeShadedAspect(name, amount, link, tooltip, top, left) local output = '' .. g.img('T4aspectback.png', "64px", link, g.cap(name)) output = output .. ' '	return output .. p.makeAspect(name, amount, link, tooltip, top + 16, left + 16) end

function p.main(frame) local frame, args = g.getFrameAndArgs(frame) local name = args.name if not g.isGiven(name) then name = 'unknown' end name = g.cap(name:lower) local amount = 1 if g.isGiven(args.amount) and tonumber(args.amount) then amount = tonumber(args.amount) end local tooltip = name if amount > 1 or amount == 0 then tooltip = amount .. ' ' .. tooltip end local top = 0 if g.isGiven(args.top) and tonumber(args.top) then top = tonumber(args.top) end local left = 0 if g.isGiven(args.left) and tonumber(args.left) then left = tonumber(args.left) end local link = 'List of Aspects' if g.isGiven(args.link) then link = args.link end local output = '' if g.isGiven(args.shaded) then output = p.makeShadedAspect(name, amount, link, tooltip, top, left) if g.isGiven(args.nogrid) then output = '' .. output .. ' '		end else output = p.makeAspect(name, amount, link, tooltip, top, left) if g.isGiven(args.nogrid) then output = '' .. output .. ' '		end end return output end

return p