Anonymous

Module:Skills/Archaeology: Difference between revisions

From Melvor Idle
_getDigSiteArtefactTable: Amend logic for 'Type' column - indicates which artefacts are generic, and links to equipment pages for consumables & gems
(_getDigSiteArtefactValue: Adjust wording of average value text)
(_getDigSiteArtefactTable: Amend logic for 'Type' column - indicates which artefacts are generic, and links to equipment pages for consumables & gems)
Line 6: Line 6:


local Shared = require('Module:Shared')
local Shared = require('Module:Shared')
local Common = require('Module:Common')
local Constants = require('Module:Constants')
local Constants = require('Module:Constants')
local GameData = require('Module:GameData')
local GameData = require('Module:GameData')
Line 33: Line 34:
end
end
return nil
return nil
end
function p._getArtefactType(item)
if item.isArtefact then
if item.isGenericArtefact then
return 'Generic'
elseif item.validSlots ~= nil then
local searchSlots = { 'Consumable', 'Gem' }
for i, slotID in ipairs(searchSlots) do
if Shared.contains(item.validSlots, slotID) then
return Common.getEquipmentSlotLink(slotID)
end
end
end
return 'Other'
end
end
end


Line 75: Line 92:
end
end
table.insert(result, '||'..thisItem.type..'')
table.insert(result, '||' .. p._getArtefactType(thisItem) .. '')
table.insert(result, '||style="text-align:right" data-sort-value="'..row.maxQuantity..'"|')
table.insert(result, '||style="text-align:right" data-sort-value="'..row.maxQuantity..'"|')
if row.maxQuantity > row.minQuantity then
if row.maxQuantity > row.minQuantity then