17,105
edits
No edit summary |
(Fix getRaidModifierList()) |
||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
local Shared = require('Module:Shared') | local Shared = require('Module:Shared') | ||
local GameData = require('Module:GameData') | local GameData = require('Module:GameData') | ||
local Modifiers = require('Module:Modifiers') | |||
local Icons = require('Module:Icons') | local Icons = require('Module:Icons') | ||
local Items = require('Module:Items') | local Items = require('Module:Items') | ||
Line 85: | Line 85: | ||
function p.getRaidModifierList() | function p.getRaidModifierList() | ||
local modList = {} | local modList = {} | ||
for i, | for i, randomMod in ipairs(GameData.rawData.golbinRaid.randomModifiers) do | ||
local baseName | local baseName = randomMod.key | ||
local modDefn = Modifiers.getModifierByAlias(baseName) | |||
local modID = modDefn.mod.id | |||
local aliasData = Shared.clone(modDefn.alias) | |||
aliasData.key = nil | |||
aliasData.value = 5 * (randomMod.multiplier or 1) | |||
local modData = {} | |||
modData[modID] = aliasData | |||
modList[ | |||
if modList[modID] == nil then | |||
modList[modID] = { ["ord"] = i, modText = {} } | |||
end | end | ||
table.insert(modList[modID].modText, Modifiers.getModifiersText(modData, false)) | |||
end | end | ||
Line 109: | Line 110: | ||
local sortFunc = function(t, a, b) return t[a].ord < t[b].ord end | local sortFunc = function(t, a, b) return t[a].ord < t[b].ord end | ||
for baseName, modDet in Shared.spairs(modList, sortFunc) do | for baseName, modDet in Shared.spairs(modList, sortFunc) do | ||
local modText = | local modText = table.concat(modDet.modText, '<br>') | ||
resultTable:tag('tr') | resultTable:tag('tr') | ||
:tag('td'):wikitext(modText):done() | :tag('td'):wikitext(modText):done() |