FANDOM


 
local p = {}
 
    function p.medalsSwitch(frame)
        local awakeMedals = frame.args[1]
        local dokkanMedals = frame.args[2]
 
        if awakeMedals == nil or awakeMedals == '' then
            if dokkanMedals == nil or dokkanMedals == '' then
                return 0
            else
                return 3
            end
        else
            if  dokkanMedals == nil or dokkanMedals == '' then
                return 1
            else
                return 2
            end
        end
 
    end
 
    function p.compareType(frame)
        local characterType = frame.args[1]
        local superType = frame.args[2]
        local extremeType = frame.args[3]
 
        if string.find(characterType, superType) then
            return ""
        elseif string.find(characterType, extremeType) then
            return ""
        else
            return (false)
        end
 
    end
 
    function p.getRarity(frame)
        local rarityLinks = frame.args[1]
 
        if string.find(rarityLinks, ":N") then
            return ("N")
        elseif string.find(rarityLinks, ":R") then
            return ("R")
        elseif string.find(rarityLinks, ":SR") then
            return ("SR")
        elseif string.find(rarityLinks, ":SSR") then
            return ("SSR")
        elseif string.find(rarityLinks, ":UR") then
            return ("UR")
        elseif string.find(rarityLinks, ":LR") then
            return ("LR")
        end
 
        return ("Unknown")
 
    end
 
    function p.getLine(frame)
        local tmpStr = string.gsub(frame.args[1], "<hr? ?/?>? ", "")
        tmpStr = string.gsub(tmpStr, "%-%-%-%-", "")
        local index = tonumber(frame.args[2])
        local tmpArray = mw.text.split(tmpStr, "\n")
 
        if #tmpArray == 1 then
            return ""
        end
 
        if index <= #tmpArray then
            return tmpArray[index]
        end
 
        return ""
    end
 
return p
Sauf mention contraire, le contenu de la communauté est disponible sous licence CC-BY-SA  .