Module:Prayer: Difference between revisions

Added an option to just use the prayer's description if it has no regular modifier lines
(Added p.getPrayerTable)
(Added an option to just use the prayer's description if it has no regular modifier lines)
Line 85: Line 85:
   local chr = asList and '* ' or ''
   local chr = asList and '* ' or ''
   local bonusLines = {}
   local bonusLines = {}
  --[[
 
  for i, var in Shared.skpairs(prayer.vars) do
    local val = prayer.values[i]
    table.insert(bonusLines, chr..p.formatEffectLine(var, val))
  end
  --]]
   for bonusKey, bonusVal in Shared.skpairs(prayer.modifiers) do
   for bonusKey, bonusVal in Shared.skpairs(prayer.modifiers) do
     table.insert(bonusLines, chr..Constants.getModifierText(bonusKey, bonusVal, false))
     table.insert(bonusLines, chr..Constants.getModifierText(bonusKey, bonusVal, false))
  end
  --If there are no actual effects, just use the prayer's description 
  if Shared.tableCount(prayer.modifiers) == 0 then
    table.insert(bonusLines, chr..prayer.description)
   end
   end