Module:Ability/Homebrew

local p = {}

function p.abilitybox(frame) local abilityname = frame.args[1] local data = require('Module:Ability/HomebrewList') ability = data.abilitylist[abilityname]

local result = ' ' .. ability.actiontype .. ' ' .. abilityname .. ' '

if ability.actiontype ~= 'Passive' then result = result .. ' Keywords: ' .. ability.keywords .. ' '  end

result = result .. ' ▼ ▲  '

if ability.cost ~= nil then result = result .. 'Costs ' .. ability.cost .. ' '  elseif ability.learnwith ~= nil then result = result .. ' Learned via ' .. ability.learnwith .. ' '  elseif ability.replaces ~= nil then result = result .. ' Learned via ' .. ability.replaces .. ' '  end

result = result .. ' '

if ability.actiontype ~= 'Passive' then if ability.attunement ~= nil and ability.class ~= nil then result = result .. ' Class: ' .. ability.class .. ' Attunement: ' .. ability.attunement .. ' '     elseif ability.attunement == nil and ability.class ~= nil then result = result .. ' Class: ' .. ability.class .. ' '     end

if ability.uselimit ~= nil and ability.gravitas ~= nil then result = result .. ' Gravitas: ' .. ability.gravitas .. ' Use Limit: ' .. ability.uselimit .. ' '     elseif ability.uselimit == nil and ability.gravitas ~= nil then result = result .. ' Gravitas: ' .. ability.gravitas .. ' '     elseif ability.uselimit ~= nil and ability.gravitas == nil then result = result .. ' Use Limit: ' .. ability.uselimit .. ' '     end

if ability.blurb ~= nil then result = result .. ' ' .. ability.blurb .. ' Effect: ' .. ability.effect .. ' '     else result = result .. ' Effect: ' .. ability.effect .. ' '     end

else if ability.blurb ~= nil then result = result .. ' ' .. ability.blurb .. ' Effect: ' .. ability.effect .. ' '     else result = result .. ' Effect: ' .. ability.effect .. ' '     end end

if ability.specialname ~= nil then result = result .. ' ' .. ability.specialname .. ': ' .. ability.specialeffect .. ' '  end

result = result .. ' '   return result end

return p