Anonymous

Module:ModifierTables: Difference between revisions

From Melvor Idle
_getModifierTable: Amend Agility pillar links to use anchors
(getModifierTable: Add option to force modifier magnitude sorting)
(_getModifierTable: Amend Agility pillar links to use anchors)
(2 intermediate revisions by 2 users not shown)
Line 333: Line 333:
local row = {}
local row = {}
row.name = obst.name
row.name = obst.name
row.icon = Icons.Icon({'Agility', obst.name, type='skill'})
row.icon = Icons.Icon({'Agility%23'..string.gsub(obst.name, ' ', ''), obst.name, type='skill', img='Agility'})
row.expIcon = Icons.getExpansionIcon(obst.id)
row.expIcon = Icons.getExpansionIcon(obst.id)
row.type = '[[Agility#Obstacles|Agility Obstacle '..tostring(tonumber(obst.category)+1)..']]'
row.type = '[[Agility#Obstacles|Agility Obstacle '..tostring(tonumber(obst.category)+1)..']]'
Line 356: Line 356:
local row = {}
local row = {}
row.name = pillar.name
row.name = pillar.name
row.icon = Icons.Icon({'Agility', pillar.name, type='skill'})
row.icon = Icons.Icon({'Agility%23'..string.gsub(pillar.name, ' ', ''), pillar.name, type='skill', img='Agility'})
row.expIcon = Icons.getExpansionIcon(pillar.id)
row.expIcon = Icons.getExpansionIcon(pillar.id)
row.type = '[[Agility#Passive Pillars|Agility Pillar]]'
row.type = '[[Agility#Passive Pillars|Agility Pillar]]'
Line 423: Line 423:
local constellationList = p.getConstellationsWithModifier(modifiers, skill, getOpposites)
local constellationList = p.getConstellationsWithModifier(modifiers, skill, getOpposites)
for i, cons in ipairs(constellationList) do
for i, cons in ipairs(constellationList) do
local modList = Skills._buildAstrologyModifierArray(cons, nil, true, true, true, true)
local row = {}
local row = {}
row.name = cons.name
row.name = cons.name
Line 429: Line 430:
row.type = '[[Astrology#Constellations|Constellation]]'
row.type = '[[Astrology#Constellations|Constellation]]'
row.typeText = 'Constellation'
row.typeText = 'Constellation'
row.val = 15 -- Assume highest possible, the range is 1 to 15 inclusive
local modList = Skills._buildAstrologyModifierArray(cons, nil, true, true, true, true)
row.modifierText, row.otherModifiers = getModText(modList)
row.modifierText, row.otherModifiers = getModText(modList)
local totalVal = 0
for i, mod in pairs(modifiers) do
totalVal = totalVal + p.getModifierValue(modList, mod, skill, getOpposites)
end
row.val = totalVal


if not hasOtherModifiers and string.len(row.otherModifiers) > 0 then
if not hasOtherModifiers and string.len(row.otherModifiers) > 0 then