Anonymous

Module:Skills/Gathering: Difference between revisions

From Melvor Idle
_buildAstrologyConstellationTable: Amend for new modifier format; buildAstrologyValueTable: Remove as now redundant following skill rework
(Fix call to _getItemSources)
(_buildAstrologyConstellationTable: Amend for new modifier format; buildAstrologyValueTable: Remove as now redundant following skill rework)
Line 714: Line 714:


function p._buildAstrologyConstellationTable()
function p._buildAstrologyConstellationTable()
local maxModifier = 5
local result = '{|class="wikitable sortable stickyHeader"'
local result = '{|class="wikitable sortable stickyHeader"'
result = result..'\r\n|- class="headerRow-0"'
result = result..'\r\n|- class="headerRow-0"'
Line 720: Line 719:
result = result..'!!XP!!Skills!!Standard Modifiers!!Unique Modifiers'
result = result..'!!XP!!Skills!!Standard Modifiers!!Unique Modifiers'


for i, cons in ipairs(SkillData.Astrology.Constellations) do
for i, cons in ipairs(SkillData.Astrology.recipes) do
local name = cons.name
local name = cons.name
result = result..'\r\n|-'
result = result..'\r\n|-'
result = result..'\r\n|data-sort-value="'..name..'"|'..Icons.Icon({name, type='constellation', size='50', notext=true})..'||'..name
result = result..'\r\n|data-sort-value="'..name..'"|'..Icons.Icon({name, type='constellation', size='50', notext=true})..'||'..name
result = result..'||'..cons.level..'||'..cons.provides.xp
result = result..'||'..cons.level..'||'..cons.baseExperience


local skillIconArray = {}
local skillIconArray = {}
for j, skillID in ipairs(cons.skills) do
for j, skillID in ipairs(cons.skillIDs) do
table.insert(skillIconArray, Icons.Icon({Constants.getSkillName(skillID), type='skill'}))
table.insert(skillIconArray, Icons.Icon({Constants.getSkillName(skillID), type='skill'}))
end
end
result = result..'||'..table.concat(skillIconArray, '<br/>')
result = result..'||'..table.concat(skillIconArray, '<br/>')


local standModsRaw = Skills._buildAstrologyModifierArray(cons, maxModifier, true, false, false, false)
local standModsRaw = Skills._buildAstrologyModifierArray(cons, nil, true, false, false, false)
local standMods = {}
local standMods = {}
--Building the list of Standard modifiers:
--Building the list of Standard modifiers:
for j, modifier in ipairs(standModsRaw) do
for j, modifier in ipairs(standModsRaw) do
table.insert(standMods, Constants._getModifierText(modifier[1], modifier[2], false))
local modMagnitude = type(modifier[2]) == 'table' and {modifier[2]} or modifier[2]
table.insert(standMods, Constants._getModifierText(modifier[1], modMagnitude, false))
end
end
result = result..'|| '..table.concat(standMods, '<br/>')
result = result..'|| '..table.concat(standMods, '<br/>')


--Building the list of all Unique Modifiers
--Building the list of all Unique Modifiers
local uModsRaw = Skills._buildAstrologyModifierArray(cons, maxModifier, false, true, false, false)
local uModsRaw = Skills._buildAstrologyModifierArray(cons, nil, false, true, false, false)
local uMods = {}
local uMods = {}
for j, modifier in ipairs(uModsRaw) do
for j, modifier in ipairs(uModsRaw) do
table.insert(uMods, Constants._getModifierText(modifier[1], modifier[2], false))
local modMagnitude = type(modifier[2]) == 'table' and {modifier[2]} or modifier[2]
table.insert(uMods, Constants._getModifierText(modifier[1], modMagnitude, false))
end
end
result = result..'||'..table.concat(uMods, '<br/>')
result = result..'||'..table.concat(uMods, '<br/>')
Line 755: Line 756:
function p.buildAstrologyConstellationTable(frame)
function p.buildAstrologyConstellationTable(frame)
return p._buildAstrologyConstellationTable()
return p._buildAstrologyConstellationTable()
end
function p.buildAstrologyValueTable()
local result = '{|class="wikitable sortable"'
result = result..'\r\n!rowspan="2"| Value!!colspan="2"| Chance'
result = result..'\r\n|-\r\n! This Value!! This Value or Greater'
local cumulativeChance = 100
for i, chance in ipairs(SkillData.Astrology.ModifierMagnitudeChances) do
result = result..'\r\n|-'
result = result..'\r\n|style="text-align:right"| ' .. i
result = result..'\r\n|style="text-align:right"| ' .. chance .. '%'
result = result..'\r\n|style="text-align:right"| ' .. cumulativeChance .. '%'
cumulativeChance = cumulativeChance - chance
end
result = result..'\r\n|}'
return result
end
end


return p
return p