Module:ModifierTables: Difference between revisions

Fix modifier table, was previously horribly broken
(Further skill ID fixes)
(Fix modifier table, was previously horribly broken)
Line 248: Line 248:
                             includeInMainText = skill == nil or skill == '' or subVal.skillID == skill
                             includeInMainText = skill == nil or skill == '' or subVal.skillID == skill
                         end
                         end
                        subVal = {subVal}
                     end
                     end


Line 278: Line 279:
--Going through each type of thing to add to the array
--Going through each type of thing to add to the array
local itemList = p.getItemsWithModifier(modifiers, skill, getOpposites)
local itemList = p.getItemsWithModifier(modifiers, skill, getOpposites)
for i, item in Shared.skpairs(itemList) do
for i, item in ipairs(itemList) do
local row = {}
local row = {}
row.name = item.name
row.name = item.name
Line 285: Line 286:
--For equipment, show the slot they go in
--For equipment, show the slot they go in
if item.validSlots ~= nil then
if item.validSlots ~= nil then
row.type = row.type..' ('..table.concat(item.validSlots, ', ')..')'
row.type = row.type..' ('..table.concat(Shared.clone(item.validSlots), ', ')..')'
end
end
local totalVal = 0
local totalVal = 0
Line 345: Line 346:


local pillarList = p.getPillarsWithModifier(modifiers, skill, getOpposites)
local pillarList = p.getPillarsWithModifier(modifiers, skill, getOpposites)
for i, pillar in Shared.skpairs(pillarList) do
for i, pillar in ipairs(pillarList) do
local row = {}
local row = {}
row.name = pillar.name
row.name = pillar.name
Line 387: Line 388:


local upgradeList = p.getUpgradesWithModifier(modifiers, skill, getOpposites)
local upgradeList = p.getUpgradesWithModifier(modifiers, skill, getOpposites)
for i, upgrade in Shared.skpairs(upgradeList) do
for i, upgrade in ipairs(upgradeList) do
local row = {}
local row = {}
row.name = Shop._getPurchaseName(upgrade)
row.name = Shop._getPurchaseName(upgrade)
Line 415: Line 416:
row.val = 15 -- Assume highest possible, the range is 1 to 15 inclusive
row.val = 15 -- Assume highest possible, the range is 1 to 15 inclusive


local modList = Skills._buildAstrologyModifierArray(cons, {1, 15}, true, true, true, true)
local modList = Skills._buildAstrologyModifierArray(cons, nil, true, true, true, true)
row.modifierText, row.otherModifiers = getModText(modList)
row.modifierText, row.otherModifiers = getModText(modList)


Line 441: Line 442:
end
end
end)
end)
for i, row in Shared.skpairs(tableArray) do
for i, row in ipairs(tableArray) do
result = result..'\r\n|-'
result = result..'\r\n|-'
result = result..'\r\n|data-sort-value="'..row.name..'"|'..row.icon
result = result..'\r\n|data-sort-value="'..row.name..'"|'..row.icon
result = result..'||'..row.type..'||data-sort-value="'..row.val..'"|'..row.modifierText
result = result..'||'..row.type..'||data-sort-value="'..row.val..'"| '..row.modifierText
if hasOtherModifiers and displayOtherMods then
if hasOtherModifiers and displayOtherMods then
result = result..'||'..row.otherModifiers
result = result..'|| '..row.otherModifiers
end
end
end
end