Anonymous

Module:ModifierTables: Difference between revisions

From Melvor Idle
for reals fixed the problem with modifier table change
(Fix modifier table, was previously horribly broken)
(for reals fixed the problem with modifier table change)
(2 intermediate revisions by the same user not shown)
Line 283: Line 283:
row.name = item.name
row.name = item.name
row.icon = Icons.Icon({item.name, type='item'})
row.icon = Icons.Icon({item.name, type='item'})
row.expIcon = Icons.getExpansionIcon(item.id)
row.type = 'Item'
row.type = 'Item'
--For equipment, show the slot they go in
--For equipment, show the slot they go in
Line 288: Line 289:
row.type = row.type..' ('..table.concat(Shared.clone(item.validSlots), ', ')..')'
row.type = row.type..' ('..table.concat(Shared.clone(item.validSlots), ', ')..')'
end
end
row.typeText = row.type
local totalVal = 0
local totalVal = 0
for i, mod in pairs(modifiers) do
for i, mod in pairs(modifiers) do
Line 308: Line 310:
row.name = pet.name
row.name = pet.name
row.icon = Icons.Icon({pet.name, type='pet'})
row.icon = Icons.Icon({pet.name, type='pet'})
row.expIcon = Icons.getExpansionIcon(pet.id)
row.type = '[[Pets|Pet]]'
row.type = '[[Pets|Pet]]'
row.typeText = 'Pet'
local totalVal = 0
local totalVal = 0
for i, mod in pairs(modifiers) do
for i, mod in pairs(modifiers) do
Line 329: Line 333:
row.name = obst.name
row.name = obst.name
row.icon = Icons.Icon({'Agility', obst.name, type='skill'})
row.icon = Icons.Icon({'Agility', obst.name, type='skill'})
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)..']]'
row.typeText = 'Agility Obstacle '..tostring(tonumber(obst.category)+1)
local totalVal = 0
local totalVal = 0
for i, mod in pairs(modifiers) do
for i, mod in pairs(modifiers) do
Line 350: Line 356:
row.name = pillar.name
row.name = pillar.name
row.icon = Icons.Icon({'Agility', pillar.name, type='skill'})
row.icon = Icons.Icon({'Agility', pillar.name, type='skill'})
row.expIcon = Icons.getExpansionIcon(pillar.id)
row.type = '[[Agility#Passive Pillars|Agility Pillar]]'
row.type = '[[Agility#Passive Pillars|Agility Pillar]]'
row.typeText = 'Agility Pillar'
local totalVal = 0
local totalVal = 0
for i, mod in pairs(modifiers) do
for i, mod in pairs(modifiers) do
Line 371: Line 379:
row.name = prayer.name
row.name = prayer.name
row.icon = Icons.Icon({prayer.name, type='prayer'})
row.icon = Icons.Icon({prayer.name, type='prayer'})
row.expIcon = Icons.getExpansionIcon(prayer.id)
row.type = [[Prayer]]
row.type = [[Prayer]]
row.typeText = 'Prayer'
local totalVal = 0
local totalVal = 0
for i, mod in ipairs(modifiers) do
for i, mod in ipairs(modifiers) do
Line 392: Line 402:
row.name = Shop._getPurchaseName(upgrade)
row.name = Shop._getPurchaseName(upgrade)
row.icon = Icons.Icon({row.name, type='upgrade'})
row.icon = Icons.Icon({row.name, type='upgrade'})
row.expIcon = Icons.getExpansionIcon(upgrade.id)
row.type = '[[Shop|Upgrade]]'
row.type = '[[Shop|Upgrade]]'
row.typeText = 'Upgrade'
local totalVal = 0
local totalVal = 0
for i, mod in pairs(modifiers) do
for i, mod in pairs(modifiers) do
Line 413: Line 425:
row.name = cons.name
row.name = cons.name
row.icon = Icons.Icon({cons.name, type='constellation'})
row.icon = Icons.Icon({cons.name, type='constellation'})
row.expIcon = Icons.getExpansionIcon(cons.id)
row.type = '[[Astrology#Constellations|Constellation]]'
row.type = '[[Astrology#Constellations|Constellation]]'
row.typeText = 'Constellation'
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


Line 445: Line 459:
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..'|| data-sort-value="'..row.typeText..'" | '..row.expIcon..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
Line 480: Line 494:


return p._getModifierTable(modifier, skill, columnName, getOpposites, displayOtherMods, maxOtherMods)
return p._getModifierTable(modifier, skill, columnName, getOpposites, displayOtherMods, maxOtherMods)
end
--Function for console testing of modifier tables
function p.getModifierTableTest()
return p.getModifierTable({args = {'MeleeMaxHit', 'GP Boosts'}})
end
end


return p
return p