Module:Pets: Difference between revisions

no edit summary
(_getPetSourceText: Further amends to icon types)
No edit summary
Line 8: Line 8:
local Modifiers = require('Module:Modifiers')
local Modifiers = require('Module:Modifiers')
local Icons = require('Module:Icons')
local Icons = require('Module:Icons')
local Num = require('Module:Number')


local areaDataKeys = { 'combatAreas', 'slayerAreas', 'dungeons', 'strongholds', 'abyssDepths' }
local areaDataKeys = { 'combatAreas', 'slayerAreas', 'dungeons', 'strongholds', 'abyssDepths' }
Line 140: Line 141:
-- Pet is from a dungeon or combat/slayer area
-- Pet is from a dungeon or combat/slayer area
if source.fixedChance then
if source.fixedChance then
return 'Guaranteed after ' .. Shared.formatnum(source.weight) .. (source.weight == 1 and ' clear' or ' clears')
return 'Guaranteed after ' .. Num.formatnum(source.weight) .. (source.weight == 1 and ' clear' or ' clears')
else
else
return '1 in ' .. Shared.formatnum(source.weight) .. ' (' .. Shared.round(100 / source.weight, 2, 2) .. '%)'
return '1 in ' .. Num.formatnum(source.weight) .. ' (' .. Num.round(100 / source.weight, 2, 2) .. '%)'
end
end
else
else
2,875

edits