Module:Skills/Gathering: Difference between revisions

It's not done, but started the table at least
(Fixed miningOreTable)
(It's not done, but started the table at least)
Line 687: Line 687:
return resultArray
return resultArray
end
function p._buildAstrologyConstellationTable()
local maxModifier = 5
local result = '{|class="wikitable stickyHeader"'
result = result..'\r\n|- class="headerRow-0"'
result = result..'\r\n!colspan="2"|Constellation!!'..Icons.Icon({"Astrology", type='skill', notext='true'})..' Level'
result = result..'!!XP!!Skills!!Standard Modifiers!!Unique Modifiers'
for i, cons in Shared.skpairs(SkillData.Astrology.Constellations) do
local name = cons.name
result = result..'\r\n|-'
result = result..'\r\n|data-sort-value="'..name..'"|'..Icons.Icon({name, type='astrology', size='50', notext=true})..'||'..name
result = result..'||'..cons.level..'||'..cons.provides.xp
local standMods = {}
local skillArray = {}
local skillIconArray = {}
for j, skillID in pairs(cons.skills) do
local skill = SkillData.Skills[skillID + 1]
table.insert(skillArray, skill)
table.insert(skillIconArray, Icons.Icon({skill.name, type='skill'}))
end
result = result..'||'..table.concat(skillIconArray, '<br/>')
--Currently awaiting hotfix to go live (as of 11/13/21):
--This is where I'd put the list of Standard Modifiers... IF I HAD ONE
result = result..'|| '..table.concat(standMods, '<br/>')
--Building the list of all Unique Modifiers
local uMods = {}
for j, modName in pairs(cons.uniqueModifiers) do
--The most important thing we're getting here is the modText and modBase
--modText lets us check if this is a per-skill modifier or not
--modBase lets us check .isSkill, which are modifiers that we only use for skills with Mastery
local modBaseName, modText, sign, isNegative, unsign, modBase = Constants.getModifierDetails(modName)
if Shared.contains(modText, '{SV0}') then
for k, skill in pairs(skillArray) do
local skillID = cons.skills[k]
local useMod = true
if modBase.isSkill then
useMod = skill.hasMastery
end
mw.logObject(skillID)
if useMod then
table.insert(uMods, Constants._getModifierText(modName, {skillID, maxModifier}, false))
end
end
else
table.insert(uMods, Constants._getModifierText(modName, maxModifier, false))
end
end
result = result..'||'..table.concat(uMods, '<br/>')
end
return result
end
function p.buildAstrologyConstellationTable(frame)
return p._buildAstrologyConstellationTable()
end
end


return p
return p