Module:Magic: Difference between revisions

Improve curse description generation
(Undo revision 77403 by Ricewind (talk))
Tag: Undo
(Improve curse description generation)
Line 307: Line 307:
if spell.description ~= nil then
if spell.description ~= nil then
return Shared.applyTemplateData(spell.description, p._getSpellTemplateData(spell))
return Shared.applyTemplateData(spell.description, p._getSpellTemplateData(spell))
elseif spell.modifiers ~= nil or spell.targetModifiers ~= nil then
elseif spell.modifiers ~= nil then
local resultPart = {}
return Modifiers.getModifiersText(spell.modifiers, false, inline)
if spell.modifiers ~= nil then
elseif spell.effectID ~= nil then
table.insert(resultPart, Modifiers.getModifiersText(spell.modifiers, false, inline))
local effect = GameData.getEntityByID('combatEffects', spell.effectID)
end
if effect ~= nil and effect.statGroups ~= nil then
if spell.targetModifiers ~= nil then
for _, statGroup in ipairs(effect.statGroups) do
local targetModText = Modifiers.getModifiersText(spell.targetModifiers, false, inline)
if statGroup.modifiers ~= nil then
if inline then  
return 'Enemies are inflicted with:<br>' .. Modifiers.getModifiersText(statGroup.modifiers or {}, false, inline)
table.insert(resultPart, targetModText)
end
else
table.insert(resultPart, 'Enemies are inflicted with:<br/>' .. targetModText)
end
end
end
end
return table.concat(resultPart, connector)
return ''
elseif spell.specialAttackID ~= nil or spell.specialAttack ~= nil then
elseif spell.specialAttackID ~= nil or spell.specialAttack ~= nil then
local spAtt = Attacks.getAttackByID(spell.specialAttackID or spell.specialAttack)
local spAtt = Attacks.getAttackByID(spell.specialAttackID or spell.specialAttack)