×
Create a new article
Write your page title here:
We currently have 770 articles on Angry Birds Wiki. Type your article name above or create one of the articles listed here!



    Angry Birds Wiki
    770Articles

    Module:AB2 rank names

    Revision as of 22:09, 22 August 2021 by fandom:angrybirds>Ytxmobile (get rank name)
    (diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
    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: Script error: The module returned a nil value. It is supposed to return an export table.
    • {{#invoke:AB2 rank names|getCardRank|10}}
      gives: Script error: The module returned a nil value. It is supposed to return an export table.
    • {{#invoke:AB2 rank names|getCardRank|25}}
      gives: Script error: The module returned a nil value. It is supposed to return an export table.
    • {{#invoke:AB2 rank names|getCardRank|51}}
      gives: Script error: The module returned a nil value. It is supposed to return an export table.
    • {{#invoke:AB2 rank names|getCardRank|100}}
      gives: Script error: The module returned a nil value. It is supposed to return an export table.

    Slingshot ranks

    • {{#invoke:AB2 rank names|getSlingshotRank|1}}
      gives: Script error: The module returned a nil value. It is supposed to return an export table.
    • {{#invoke:AB2 rank names|getSlingshotRank|10}}
      gives: Script error: The module returned a nil value. It is supposed to return an export table.
    • {{#invoke:AB2 rank names|getSlingshotRank|25}}
      gives: Script error: The module returned a nil value. It is supposed to return an export table.
    • {{#invoke:AB2 rank names|getSlingshotRank|51}}
      gives: Script error: The module returned a nil value. It is supposed to return an export table.
    • {{#invoke:AB2 rank names|getSlingshotRank|100}}
      gives: Script error: The module returned a nil value. It is supposed to return an export table.

    See also

    Angry Birds 2 modules

    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'
    	end
    	
    	-- rank >= 2, rank <= 49
    	local prefix = prefixes[math.floor((rank - 2) / 7)]
    	local material = materials[(rank - 2) % 7]
    	if prefix == nil then
    		return material
    	else
    		return prefix .. ' ' .. material
    	end
    end
    
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.