Module:Magic: Difference between revisions

No change in size ,  22 October 2022
Change spellbook -> spellBook to match game data
(formatRuneList: Fix quantity reference)
(Change spellbook -> spellBook to match game data)
Line 102: Line 102:


function p._getSpellIconType(spell)
function p._getSpellIconType(spell)
     local spellBook = GameData.getEntityByID(p.spellBooks, spell.spellbook)
     local spellBook = GameData.getEntityByID(p.spellBooks, spell.spellBook)
     if spellBook == nil then
     if spellBook == nil then
         -- Pick a suitable default
         -- Pick a suitable default
Line 184: Line 184:
function p._getSpellTemplateData(spell)
function p._getSpellTemplateData(spell)
     local templateData = nil
     local templateData = nil
     if spell.spellbook == 'altMagic' then
     if spell.spellBook == 'altMagic' then
         if spell.produces ~= nil then
         if spell.produces ~= nil then
             -- Item produced varies depending on items consumed
             -- Item produced varies depending on items consumed
Line 242: Line 242:
         end
         end
         return table.concat(resultPart, '<br/>')
         return table.concat(resultPart, '<br/>')
     elseif spell.spellbook == 'standard' then
     elseif spell.spellBook == 'standard' then
         return 'Combat spell with a max hit of ' .. Shared.formatnum(spell.maxHit * 10)
         return 'Combat spell with a max hit of ' .. Shared.formatnum(spell.maxHit * 10)
     else
     else
Line 261: Line 261:
return p._getSpellRunes(spell)
return p._getSpellRunes(spell)
elseif stat == 'type' then
elseif stat == 'type' then
return p.getTypeString(spell.spellbook)
return p.getTypeString(spell.spellBook)
end
end
return spell[stat]
return spell[stat]
Line 293: Line 293:
function p._getSpellCategories(spell)
function p._getSpellCategories(spell)
local result = '[[Category:Spells]]'
local result = '[[Category:Spells]]'
result = result..'[[Category:'..p.getTypeString(spell.spellbook)..']]'
result = result..'[[Category:'..p.getTypeString(spell.spellBook)..']]'
return result
return result
end
end