Module:Prayer: Difference between revisions

Add "For Each Unholy Mark stack on the enemy:" to unholy prayers
(Use printError function)
(Add "For Each Unholy Mark stack on the enemy:" to unholy prayers)
 
(4 intermediate revisions by the same user not shown)
Line 52: Line 52:
local chr = asList and '* ' or ''
local chr = asList and '* ' or ''
local bonusLines = {}
local bonusLines = {}
 
if prayer.isUnholy then
table.insert(bonusLines, "For each Unholy Mark stack on the enemy:")
end
if type(prayer.modifiers) == 'table' then
if type(prayer.modifiers) == 'table' then
for bonusKey, bonusVal in Shared.skpairs(prayer.modifiers) do
for bonusKey, bonusVal in Shared.skpairs(prayer.modifiers) do
Line 131: Line 135:


function p.getPrayerTable(frame)
function p.getPrayerTable(frame)
return p.getPrayerTableFiltered(frame, function(prayer) return true end)
end
function p.getUnholyPrayerTable(frame)
return p.getPrayerTableFiltered(frame, function(prayer) return prayer.isUnholy end)
end
function p.getPrayerTableFiltered(frame, prayerPredicate)
local result = '{| class="wikitable sortable stickyHeader"'
local result = '{| class="wikitable sortable stickyHeader"'
result = result..'\r\n|-class=headerRow-0'
result = result..'\r\n|-class=headerRow-0'
Line 136: Line 148:
result = result..'!!Effects!!Point Cost'
result = result..'!!Effects!!Point Cost'


local prayerList = p.getPrayers(function(prayer) return true end)
local prayerList = p.getPrayers(prayerPredicate)
table.sort(prayerList, function(a, b)
table.sort(prayerList, function(a, b)
if a.level == b.level then
if a.level == b.level then
48

edits