5,003
edits
(Add Ancient Relics, Summoning Synergies, Township Buildings and Township Seasons to ModifierTables) |
(Add Mastery Pool Bonuses to Modifier Tables) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
local Icons = require('Module:Icons') | local Icons = require('Module:Icons') | ||
local GameData = require('Module:GameData') | local GameData = require('Module:GameData') | ||
local SkillData = GameData.skillData | |||
local Modifiers = require('Module:Modifiers') | local Modifiers = require('Module:Modifiers') | ||
local SkillTree = require('Module:SkillTree') | local SkillTree = require('Module:SkillTree') | ||
Line 225: | Line 226: | ||
return synergyList | return synergyList | ||
end | |||
function p.getMasteryPoolModifiers(modifierCriteria) | |||
local masteryPoolList = {} | |||
for skillName, skillData in pairs(SkillData) do | |||
if skillData.masteryPoolBonuses ~= nil then | |||
for i, masteryPool in ipairs(skillData.masteryPoolBonuses) do | |||
local mods = Modifiers.getMatchingModifiers(masteryPool.modifiers, modifierCriteria) | |||
if not Shared.tableIsEmpty(mods.matched) then | |||
table.insert(masteryPoolList, { [skillName] = masteryPool }) | |||
end | |||
end | |||
end | |||
end | |||
return masteryPoolList | |||
end | end | ||
Line 576: | Line 594: | ||
row.expIcon = Icons.getDLCColumnIcon(building.id) | row.expIcon = Icons.getDLCColumnIcon(building.id) | ||
row.expSort = Icons.getExpansionID(building.id) | row.expSort = Icons.getExpansionID(building.id) | ||
row.type = Icons.Icon({'Township', 'Building', section='Buildings', type=' | row.type = Icons.Icon({'Township', 'Building', section='Buildings', type='skill', noicon=true}) | ||
row.typeText = 'Building' | row.typeText = 'Building' | ||
local modList = {} | |||
-- Multiply mod value by max upgrades to get the total modifier value | |||
for modID, value in pairs(building.modifiers) do | |||
if type(value) == 'table' then | |||
modList[modID] = value[1].value * building.maxUpgrades | |||
else | |||
modList[modID] = value * building.maxUpgrades | |||
end | |||
end | |||
local objMods = nil | local objMods = nil | ||
row.modifierText, row.otherModifiers, objMods = getModText( | row.modifierText, row.otherModifiers, objMods = getModText(modList) | ||
row.val = Modifiers.getModifierValue(objMods.matched) | row.val = Modifiers.getModifierValue(objMods.matched) | ||
Line 597: | Line 625: | ||
row.expIcon = Icons.getDLCColumnIcon(season.id) | row.expIcon = Icons.getDLCColumnIcon(season.id) | ||
row.expSort = Icons.getExpansionID(season.id) | row.expSort = Icons.getExpansionID(season.id) | ||
row.type = Icons.Icon({'Township', 'Season', section='Seasons', type=' | row.type = Icons.Icon({'Township', 'Season', section='Seasons', type='skill', noicon=true}) | ||
row.typeText = 'Season' | row.typeText = 'Season' | ||
Line 631: | Line 659: | ||
row.name = familiar1.name .. familiar2.name .. ' Synergy' | row.name = familiar1.name .. familiar2.name .. ' Synergy' | ||
row.icon = Icons.Icon({familiar1.name, type='item'}) .. ' ' .. Icons.Icon({'SynergyIcon', notext=true}) .. ' ' .. Icons.Icon({familiar2.name, type='item'}) .. ' Synergy' | row.icon = Icons.Icon({familiar1.name, type='item'}) .. ' ' .. Icons.Icon({'SynergyIcon', notext=true, nolink=true}) .. ' ' .. Icons.Icon({familiar2.name, type='item'}) .. ' Synergy' | ||
row.expIcon = Icons.getDLCColumnIcon(familiar2.id) | row.expIcon = Icons.getDLCColumnIcon(familiar2.id) | ||
row.expSort = Icons.getExpansionID(familiar2.id) | row.expSort = Icons.getExpansionID(familiar2.id) | ||
row.type = Icons.Icon({'Summoning', 'Summoning Synergy', section='Synergies', type=' | row.type = Icons.Icon({'Summoning', 'Summoning Synergy', section='Synergies', type='skill', noicon=true}) | ||
row.typeText = 'Synergy' | row.typeText = 'Synergy' | ||
Line 646: | Line 674: | ||
table.insert(tableArray, row) | table.insert(tableArray, row) | ||
end | |||
local masteryPools = p.getMasteryPoolModifiers(modifierCriteria) | |||
for i, masteryPoolData in ipairs(masteryPools) do | |||
for skillName, masteryPool in pairs(masteryPoolData) do | |||
local row = {} | |||
local isAbyssal = masteryPool.realm == 'melvorItA:Abyssal' and 'Abyssal ' or '' | |||
row.name = isAbyssal .. masteryPool.percent .. '% Mastery Pool Bonus' | |||
row.icon = Icons.Icon({skillName, row.name, section='Mastery Pool Checkpoints', type='skill'}) | |||
row.expIcon = Icons.getDLCColumnIcon(masteryPool.realm) | |||
row.expSort = Icons.getExpansionID(masteryPool.realm) | |||
row.type = Icons.Icon({skillName, 'Mastery Pool Bonus', section='Mastery Pool Checkpoints', type='skill', noicon=true}) | |||
row.typeText = 'Mastery Pool Bonus' | |||
local objMods = nil | |||
row.modifierText, row.otherModifiers, objMods = getModText(masteryPool.modifiers) | |||
row.val = Modifiers.getModifierValue(objMods.matched) | |||
if not hasOtherModifiers and not Shared.tableIsEmpty(objMods.unmatched) then | |||
hasOtherModifiers = true | |||
end | |||
table.insert(tableArray, row) | |||
end | |||
end | end | ||