Module:Magic: Difference between revisions

Further corrections to special attack description generation
(Fix special attack spell descriptions & implement getSpellBookTable)
(Further corrections to special attack description generation)
Line 244: Line 244:
         end
         end
         return table.concat(resultPart, '<br/>')
         return table.concat(resultPart, '<br/>')
     elseif spell.specialAttack ~= nil then
     elseif spell.specialAttackID ~= nil or spell.specialAttack ~= nil then
     local spAtt = Attacks.getAttackByID(spell.specialAttack)
     local spAtt = Attacks.getAttackByID(spell.specialAttackID or spell.specialAttack)
     if spAtt ~= nil then
     if spAtt ~= nil then
     return spAtt.description
     return spAtt.description
Line 524: Line 524:
table.insert(rowPart, '|| ' .. p._getSpellStat(spell, 'description'))
table.insert(rowPart, '|| ' .. p._getSpellStat(spell, 'description'))
--1/4/22: haha just kidding. Now we're also getting delay between attacks for spells with special attacks
--1/4/22: haha just kidding. Now we're also getting delay between attacks for spells with special attacks
if spell.specialAttackID ~= nil then
local spAttID = spell.specialAttackID or spell.specialAttack
local spAtt = Attacks.getAttackByID(spell.specialAttackID)
if spAttID ~= nil then
local spAtt = Attacks.getAttackByID(spAttID)
local interval = spAtt.attackInterval
local interval = spAtt.attackInterval
if interval ~= nil then
if interval ~= nil then