This wiki has been automatically closed because there have been no edits or log actions made within the last 60 days. If you are a user (who is not the bureaucrat) that wishes for this wiki to be reopened, please request that at Requests for reopening wikis. If this wiki is not reopened within 6 months it may be deleted. Note: If you are a bureaucrat on this wiki, you can go to Special:ManageWiki and uncheck the "Closed" box to reopen it.This module allows you to get the rank names of cards and the Slingshot in Angry Birds 2.
Usage
{{#invoke:AB2 rank names|getCardRank|<rank>}}
{{#invoke:AB2 rank names|getSlingshotRank|<rank>}}
<rank>: a positive integer.
Examples
Card ranks
{{#invoke:AB2 rank names|getCardRank|1}}gives: Lua error in package.lua at line 80: module 'Dev:Arguments' not found.{{#invoke:AB2 rank names|getCardRank|10}}gives: Lua error in package.lua at line 80: module 'Dev:Arguments' not found.{{#invoke:AB2 rank names|getCardRank|25}}gives: Lua error in package.lua at line 80: module 'Dev:Arguments' not found.{{#invoke:AB2 rank names|getCardRank|51}}gives: Lua error in package.lua at line 80: module 'Dev:Arguments' not found.{{#invoke:AB2 rank names|getCardRank|100}}gives: Lua error in package.lua at line 80: module 'Dev:Arguments' not found.
Slingshot ranks
{{#invoke:AB2 rank names|getSlingshotRank|1}}gives: Lua error in package.lua at line 80: module 'Dev:Arguments' not found.{{#invoke:AB2 rank names|getSlingshotRank|10}}gives: Lua error in package.lua at line 80: module 'Dev:Arguments' not found.{{#invoke:AB2 rank names|getSlingshotRank|25}}gives: Lua error in package.lua at line 80: module 'Dev:Arguments' not found.{{#invoke:AB2 rank names|getSlingshotRank|51}}gives: Lua error in package.lua at line 80: module 'Dev:Arguments' not found.{{#invoke:AB2 rank names|getSlingshotRank|100}}gives: Lua error in package.lua at line 80: module 'Dev:Arguments' not found.
See also
- Angry Birds 2 modules
local getArgs = require('Module:Common').getArgs
local prefixes = {
nil, -- 1-8
'Elder', -- 9-15
'Master', -- 16-22
'Pristine', -- 23-29
'Epic', -- 30-36
'Ancient', -- 37-43
'Mythic', -- 44-50
nil, -- 51+
}
local materials = {
'Bronze',
'Silver',
'Gold',
'Azure',
'Emerald',
'Amethyst',
'Diamond'
}
local function getRankName(rank)
if rank <= 1 then
return 'Vanilla'
elseif rank >= 51 then
return 'Legendary'
else
-- rank >= 2, rank <= 50
local prefix = prefixes[math.floor((rank - 2) / 7) + 1]
local material = materials[(rank - 2) % 7 + 1]
if prefix == nil then
return material
else
return prefix .. ' ' .. material
end
end
end
local p = {}
p.getRankName = function(frame)
local args = getArgs(frame)
local rank = tonumber(args[1])
return getRankName(rank)
end
return p
