Module:Magic: Difference between revisions

Add damage column for abyssal spell tables, add initial combat effects handling
(Remove legacy spellbook table functions)
(Add damage column for abyssal spell tables, add initial combat effects handling)
 
Line 315: Line 315:
if statGroup.modifiers ~= nil then
if statGroup.modifiers ~= nil then
return 'Enemies are inflicted with:<br>' .. Modifiers.getModifiersText(statGroup.modifiers or {}, false, inline)
return 'Enemies are inflicted with:<br>' .. Modifiers.getModifiersText(statGroup.modifiers or {}, false, inline)
end
end
end
return ''
elseif spell.combatEffects ~= nil then
for _, combatEffect in ipairs(spell.combatEffects) do
-- Doesn't handle initialParams, which is used by the four abyssal spells
local effect = GameData.getEntityByID('combatEffects', combatEffect.effectID)
if effect ~= nil and effect.statGroups ~= nil then
for _, statGroup in ipairs(effect.statGroups) do
if statGroup.modifiers ~= nil then
return 'Enemies are inflicted with:<br>' .. Modifiers.getModifiersText(statGroup.modifiers or {}, false, inline)
end
end
end
end
end
Line 376: Line 389:


--11/01/22: Added Spell Damage for standard & archaic spells
--11/01/22: Added Spell Damage for standard & archaic spells
if spellBook.id == 'standard' or spellBook.id == 'archaic' then
if Shared.contains({'standard', 'archaic', 'abyssal'}, spellBook.id) then
result = result.."\r\n|-\r\n|'''Spell Damage:''' "..p._getSpellStat(spell, 'spellDamage')
result = result.."\r\n|-\r\n|'''Spell Damage:''' "..p._getSpellStat(spell, 'spellDamage')
end
end
Line 632: Line 645:
includeExperience = true
includeExperience = true
end
end
if not includeDamage and (spellBook.id == 'archaic' or spellBook.id == 'standard') then
if not includeDamage and Shared.contains({'standard', 'archaic', 'abyssal'}, spellBook.id) then
includeDamage = true
includeDamage = true
end
end
239

edits