Anonymous

Module:Magic: Difference between revisions

From Melvor Idle
Undo revision 77406 by Ricewind (talk)
(Undo revision 77409 by Ricewind (talk))
Tag: Undo
(Undo revision 77406 by Ricewind (talk))
Tag: Undo
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 args = frame.args ~= nil and frame.args or frame
local spellName = frame.args ~= nil and frame.args[1] or frame
local spellName = args[1]
local namespace = frame.namespace or nil
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 130: Line 129:


function p.getSpellIconType(frame)
function p.getSpellIconType(frame)
local args = frame.args ~= nil and frame.args or frame
local spellName = frame.args ~= nil and frame.args[1] or frame
local spellName = args[1]
local namespace = frame.namespace or nil
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 226: Line 224:


function p.getSpellItems(frame)
function p.getSpellItems(frame)
local args = frame.args ~= nil and frame.args or frame
local spellName = frame.args ~= nil and frame.args[1] or frame
local spellName = args[1]
local namespace = frame.namespace or nil
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 250: Line 247:


function p.getSpellRunes(frame)
function p.getSpellRunes(frame)
local args = frame.args ~= nil and frame.args or frame
local spellName = frame.args ~= nil and frame.args[1] or frame
local spellName = args[1]
local namespace = frame.namespace or nil
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 369: Line 365:


function p.getSpellStat(frame)
function p.getSpellStat(frame)
local args = frame.args ~= nil and frame.args or frame
local spellName = frame.args ~= nil and frame.args[1] or frame[1]
local spellName = args[1]
local statName = frame.args ~= nil and frame.args[2] or frame[2]
local statName = args[2]
local namespace = frame.namespace or nil
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 381: Line 376:


function p.getOtherSpellBoxText(frame)
function p.getOtherSpellBoxText(frame)
local args = frame.args ~= nil and frame.args or frame
local spellName = frame.args ~= nil and frame.args[1] or frame
local spellName = args[1]
local namespace = frame.namespace or nil
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 414: Line 408:


function p.getSpellCategories(frame)
function p.getSpellCategories(frame)
local args = frame.args ~= nil and frame.args or frame
local spellName = frame.args ~= nil and frame.args[1] or frame
local spellName = args[1]
local namespace = frame.namespace or nil
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