Module:Skills/Gathering: Difference between revisions

Fixed Level/XP issues with Abyssal Constellations; Added additional requirements to Abyssal Stars;
No edit summary
(Fixed Level/XP issues with Abyssal Constellations; Added additional requirements to Abyssal Stars;)
(One intermediate revision by one other user not shown)
Line 146: Line 146:
:css('text-align', 'right')
:css('text-align', 'right')
:attr('data-sort-value', itemDef.weight)
:attr('data-sort-value', itemDef.weight)
:wikitext(Shared.fraction(itemDef.weight, totalWt))
:wikitext(Num.fraction(itemDef.weight, totalWt))
row:tag('td')
row:tag('td')
:css('text-align', 'right')
:css('text-align', 'right')
Line 641: Line 641:
table.insert(normalTxt, '\r\n|-class="sortbottom" \r\n!colspan="3"|Total:')
table.insert(normalTxt, '\r\n|-class="sortbottom" \r\n!colspan="3"|Total:')
if lootChance < 100 then
if lootChance < 100 then
table.insert(normalTxt, '\r\n|style="text-align:right"|'..Shared.fraction(lootChance, 100)..'||')
table.insert(normalTxt, '\r\n|style="text-align:right"|'..Num.fraction(lootChance, 100)..'||')
else
else
table.insert(normalTxt, '\r\n|colspan="2" ')
table.insert(normalTxt, '\r\n|colspan="2" ')
Line 1,199: Line 1,199:
     for _, modType in ipairs(modTypes) do
     for _, modType in ipairs(modTypes) do
         if modType.inUse then
         if modType.inUse then
             headerRow1:tag('th'):attr('colspan', 2):wikitext(modType.name .. ' Stars')
        local spanCount = modType.name == 'Abyssal' and 3 or 2
             headerRow1:tag('th'):attr('colspan', spanCount):wikitext(modType.name .. ' Stars')
             headerRow2:tag('th'):wikitext(Icons.Icon({'Mastery', notext=true}) .. '<br>Level')
             headerRow2:tag('th'):wikitext(Icons.Icon({'Mastery', notext=true}) .. '<br>Level')
            if modType.name == "Abyssal" then
            headerRow2:tag('th'):wikitext('Level')
            end
             headerRow2:tag('th'):wikitext('Modifiers')
             headerRow2:tag('th'):wikitext('Modifiers')
         end
         end
Line 1,230: Line 1,234:
                 :wikitext(name)
                 :wikitext(name)
                 row:tag('td'):attr('rowspan', maxRows)
                 row:tag('td'):attr('rowspan', maxRows)
                 :wikitext(cons.level)
                 :wikitext((cons.abyssalLevel or cons.level))
                 :css('text-align', 'center')
                 :css('text-align', 'center')
             row:tag('td'):css('text-align', 'center')
             row:tag('td'):css('text-align', 'center')
Line 1,237: Line 1,241:
                 :wikitext(Icons.getDLCColumnIcon(cons.id))   
                 :wikitext(Icons.getDLCColumnIcon(cons.id))   
                 row:tag('td'):attr('rowspan', maxRows)
                 row:tag('td'):attr('rowspan', maxRows)
                     :wikitext(cons.baseExperience)
                     :wikitext(Num.formatnum(cons.baseAbyssalExperience or cons.baseExperience))
                     :css('text-align', 'right')
                     :css('text-align', 'right')
                 row:tag('td'):attr('rowspan', maxRows)
                 row:tag('td'):attr('rowspan', maxRows)
Line 1,249: Line 1,253:
                     local masteryLevel = modType.levels[rowIdx]
                     local masteryLevel = modType.levels[rowIdx]
                     local rowModData = modData[modType.modKey][rowIdx]
                     local rowModData = modData[modType.modKey][rowIdx]
                    local rowConsData = cons[modType.modKey][rowIdx]
                     local cell1 = row:tag('td')
                     local cell1 = row:tag('td')
                     local cell2 = row:tag('td')
                     if modType.name == "Abyssal" then
                    local starUnlockReq = nil
                    local cell2 = row:tag('td')
                    if rowConsData ~= nil and rowConsData.unlockRequirements ~= nil and Shared.tableCount(rowConsData.unlockRequirements) == 2 then
                    starUnlockReq = Common.getRequirementString({cons[modType.modKey][rowIdx].unlockRequirements[2]}, nil)
                    end
                    if starUnlockReq ~= nil then
                    cell2:wikitext(starUnlockReq)
                    :css('text-align', 'right')
                    else
                    cell2:wikitext('N/A')
                    :addClass('table-na')
                    end
                    end
                    local cell3 = row:tag('td')
                     if masteryLevel ~= nil and rowModData ~= nil then
                     if masteryLevel ~= nil and rowModData ~= nil then
local modText = {}
local modText = {}
Line 1,264: Line 1,283:
                         cell1:wikitext(masteryLevel)
                         cell1:wikitext(masteryLevel)
                         :css('text-align', 'right')
                         :css('text-align', 'right')
                         cell2:wikitext(table.concat(modText, '<br>'))
                         cell3:wikitext(table.concat(modText, '<br>'))
                     else
                     else
                         cell1:attr('colspan', 2)
                         cell1:attr('colspan', 2)
Line 1,275: Line 1,294:
     end
     end


    return tostring(root)
return tostring(root)
end
end