Anonymous

Module:Magic: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 108: Line 108:
--Returns the expansion icon for the spell if it has one
--Returns the expansion icon for the spell if it has one
function p.getExpansionIcon(frame)
function p.getExpansionIcon(frame)
local spellName = frame.args ~= nil and frame.args[1] or frame
local args = frame.args ~= nil and frame.args or frame
local namespace = frame.namespace or nil
local spellName = args[1]
local namespace = args.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
Line 129: Line 130:


function p.getSpellIconType(frame)
function p.getSpellIconType(frame)
local spellName = frame.args ~= nil and frame.args[1] or frame
local args = frame.args ~= nil and frame.args or frame
local namespace = frame.namespace or nil
local spellName = args[1]
local namespace = args.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
Line 224: Line 226:


function p.getSpellItems(frame)
function p.getSpellItems(frame)
local spellName = frame.args ~= nil and frame.args[1] or frame
local args = frame.args ~= nil and frame.args or frame
local namespace = frame.namespace or nil
local spellName = args[1]
local namespace = args.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
Line 247: Line 250:


function p.getSpellRunes(frame)
function p.getSpellRunes(frame)
local spellName = frame.args ~= nil and frame.args[1] or frame
local args = frame.args ~= nil and frame.args or frame
local namespace = frame.namespace or nil
local spellName = args[1]
local namespace = args.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
Line 365: Line 369:


function p.getSpellStat(frame)
function p.getSpellStat(frame)
local spellName = frame.args ~= nil and frame.args[1] or frame[1]
local args = frame.args ~= nil and frame.args or frame
local statName = frame.args ~= nil and frame.args[2] or frame[2]
local spellName = args[1]
local namespace = frame.namespace or nil
local statName = args[2]
local namespace = args.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
Line 376: Line 381:


function p.getOtherSpellBoxText(frame)
function p.getOtherSpellBoxText(frame)
local spellName = frame.args ~= nil and frame.args[1] or frame
local args = frame.args ~= nil and frame.args or frame
local namespace = frame.namespace or nil
local spellName = args[1]
local namespace = args.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
Line 408: Line 414:


function p.getSpellCategories(frame)
function p.getSpellCategories(frame)
local spellName = frame.args ~= nil and frame.args[1] or frame
local args = frame.args ~= nil and frame.args or frame
local namespace = frame.namespace or nil
local spellName = args[1]
local namespace = args.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
2,875

edits