Module:Magic: Difference between revisions

_getSpellDescription: Support enemyModifiers (for curses)
(getSpell: Another attempt at handling page names with apostrophes)
(_getSpellDescription: Support enemyModifiers (for curses))
Line 141: Line 141:
       result = spell.description
       result = spell.description
     end
     end
   elseif spell.modifiers ~= nil then
   elseif (spell.modifiers ~= nil or spell.enemyModifiers ~= nil) then
    result = Constants.getModifiersText(spell.modifiers, false)
  if spell.modifiers ~= nil then
  local playerModText = Constants.getModifiersText(spell.modifiers, false)
  result = playerModText
  end
  if spell.enemyModifiers ~= nil then
  local enemyModText = Constants.getModifiersText(spell.enemyModifiers, false)
  result = result .. (string.len(result) > 0 and '\r\n' or '') .. 'Enemies are inflicted with:\r\n' .. enemyModText
  end
   elseif spell.type == 'Spells' then
   elseif spell.type == 'Spells' then
     result = 'Combat spell with a max hit of '..(spell.maxHit * 10)
     result = 'Combat spell with a max hit of '..(spell.maxHit * 10)