Module:Skills: Difference between revisions

Added a group number to Astrology modifier lists so that multiple bonuses on the same modifier can be grouped together
No edit summary
(Added a group number to Astrology modifier lists so that multiple bonuses on the same modifier can be grouped together)
Line 188: Line 188:
local modArray = {}
local modArray = {}
local isSkillMod = {}
local isSkillMod = {}
--Adding a Group Number to hold together different bonuses from the same modifier [Falterfire 22/10/27]
local groupNum = 0


for _, modType in ipairs(modTypes) do
for _, modType in ipairs(modTypes) do
for i, modTypeData in ipairs(cons[modType]) do
for i, modTypeData in ipairs(cons[modType]) do
groupNum = groupNum + 1
local modVal = nil
local modVal = nil
if modValue ~= nil then
if modValue ~= nil then
Line 199: Line 202:
for j, modifier in ipairs(modTypeData.modifiers) do
for j, modifier in ipairs(modTypeData.modifiers) do
local modEntry = (modifier.skill ~= nil and { skillID = modifier.skill, value = modVal }) or modVal
local modEntry = (modifier.skill ~= nil and { skillID = modifier.skill, value = modVal }) or modVal
addToArray(modArray, {modifier.key, modEntry})
addToArray(modArray, {modifier.key, modEntry, group = groupNum})
end
end
end
end