PaladinOne (talk | contribs) (Make this less specific so that it would work with ANY aspect, with the 6 primals shorthanded) |
(added minor optimization :P) |
||
(4 intermediate revisions by one other user not shown) | |||
Line 2: | Line 2: | ||
function toGrid(aspect, size) |
function toGrid(aspect, size) |
||
− | return mw.getCurrentFrame():expandTemplate{title = " |
+ | return mw.getCurrentFrame():expandTemplate{title = "G/Cell", args = {aspect, size, mod = "TC4A", link = "none"}} |
end |
end |
||
Line 9: | Line 9: | ||
local size = params.args.stacksize -- defaults to 1 via the template |
local size = params.args.stacksize -- defaults to 1 via the template |
||
− | + | if aspect == "A" then |
|
− | + | return toGrid("Aer", size) |
|
elseif aspect == "T" then |
elseif aspect == "T" then |
||
return toGrid("Terra", size) |
return toGrid("Terra", size) |
||
Line 21: | Line 21: | ||
elseif aspect == "P" then |
elseif aspect == "P" then |
||
return toGrid("Perditio", size) |
return toGrid("Perditio", size) |
||
− | + | else |
|
− | + | return toGrid(aspect, size) |
|
− | + | end |
|
end |
end |
||
Latest revision as of 22:38, 20 August 2015
Documentation for this module may be created at Module:PrimalAspect/doc
local p = {}
function toGrid(aspect, size)
return mw.getCurrentFrame():expandTemplate{title = "G/Cell", args = {aspect, size, mod = "TC4A", link = "none"}}
end
function p.aspect(params)
local aspect = params.args.aspect
local size = params.args.stacksize -- defaults to 1 via the template
if aspect == "A" then
return toGrid("Aer", size)
elseif aspect == "T" then
return toGrid("Terra", size)
elseif aspect == "I" then
return toGrid("Ignis", size)
elseif aspect == "Aq" or aspect == "Q" then
return toGrid("Aqua", size)
elseif aspect == "O" then
return toGrid("Ordo", size)
elseif aspect == "P" then
return toGrid("Perditio", size)
else
return toGrid(aspect, size)
end
end
return p