Module:Common: Difference between revisions

no edit summary
(Amend abyss depth icon type)
No edit summary
Line 14: Line 14:
local GameData = require('Module:GameData')
local GameData = require('Module:GameData')
local Icons = require('Module:Icons')
local Icons = require('Module:Icons')
local Num = require('Module:Number')


-- getSkillName: Given a valid namespaced skill ID, returns that skill's name
-- getSkillName: Given a valid namespaced skill ID, returns that skill's name
Line 243: Line 244:
local depthStr = 'Complete ' .. Icons.Icon({depth.name, type='combatArea'})
local depthStr = 'Complete ' .. Icons.Icon({depth.name, type='combatArea'})
if req.count > 1 then
if req.count > 1 then
depthStr = depthStr .. ' ' .. Shared.formatnum(req.count) .. ' times'
depthStr = depthStr .. ' ' .. Num.formatnum(req.count) .. ' times'
end
end
table.insert(reqArray, depthStr)
table.insert(reqArray, depthStr)
Line 261: Line 262:
table.insert(reqArray, reqText)
table.insert(reqArray, reqText)
elseif req.type == 'ArchaeologyItemsDonated' then
elseif req.type == 'ArchaeologyItemsDonated' then
table.insert(reqArray, 'Donate ' .. Shared.formatnum(req.count) .. ' Artefacts to the Museum in ' .. Icons.Icon({'Archaeology', type='skill'}))
table.insert(reqArray, 'Donate ' .. Num.formatnum(req.count) .. ' Artefacts to the Museum in ' .. Icons.Icon({'Archaeology', type='skill'}))
elseif req.type == 'CartographyPOIDiscovery' then
elseif req.type == 'CartographyPOIDiscovery' then
local map = GameData.getEntityByID(GameData.skillData.Cartography.worldMaps, req.worldMapID)
local map = GameData.getEntityByID(GameData.skillData.Cartography.worldMaps, req.worldMapID)
Line 286: Line 287:
local dungStr = 'Complete ' .. Icons.Icon({dung.name, type='dungeon'})
local dungStr = 'Complete ' .. Icons.Icon({dung.name, type='dungeon'})
if req.count > 1 then
if req.count > 1 then
dungStr = dungStr .. ' ' .. Shared.formatnum(req.count) .. ' times'
dungStr = dungStr .. ' ' .. Num.formatnum(req.count) .. ' times'
end
end
table.insert(reqArray, dungStr)
table.insert(reqArray, dungStr)
Line 318: Line 319:
local taskCategory = GameData.getEntityByID('slayerTaskCategories', req.category)
local taskCategory = GameData.getEntityByID('slayerTaskCategories', req.category)
if taskCategory ~= nil then
if taskCategory ~= nil then
table.insert(reqArray, 'Complete ' .. Shared.formatnum(req.count) .. ' ' .. taskCategory.name .. ' or higher Slayer Tasks')
table.insert(reqArray, 'Complete ' .. Num.formatnum(req.count) .. ' ' .. taskCategory.name .. ' or higher Slayer Tasks')
end
end
elseif req.type == 'TownshipBuilding' then
elseif req.type == 'TownshipBuilding' then
Line 325: Line 326:
local building = GameData.getEntityByID(tsData.buildings, req.buildingID)
local building = GameData.getEntityByID(tsData.buildings, req.buildingID)
if building ~= nil then
if building ~= nil then
table.insert(reqArray, 'Have ' .. Shared.formatnum(req.count) .. ' ' .. building.name .. ' actively built in Township')
table.insert(reqArray, 'Have ' .. Num.formatnum(req.count) .. ' ' .. building.name .. ' actively built in Township')
end
end
end
end
elseif req.type == 'TownshipTask' then
elseif req.type == 'TownshipTask' then
table.insert(reqArray, 'Complete ' .. Shared.formatnum(req.count) .. ' Township Tasks')
table.insert(reqArray, 'Complete ' .. Num.formatnum(req.count) .. ' Township Tasks')
else
else
table.insert(reqArray, Shared.printError('Unknown requirement: ' .. (req.type or 'nil')))
table.insert(reqArray, Shared.printError('Unknown requirement: ' .. (req.type or 'nil')))
2,647

edits