FANDOM


local p = {}
function p.rareza(frame)
    local rareza = frame.args[1] or 'Común'
    local string = frame.args[2] or rareza
    local style = {}
    local plural = {}
 
    if mw.ustring.lower(rareza) == 'especial' then
        plural = 'especiales'
    elseif mw.ustring.lower(rareza) == 'épica' then
        plural = 'épicas'
    elseif mw.ustring.lower(rareza) == 'legendaria' then
        plural = 'legendarias'
    else
        plural = 'comunes'
    end
 
    if mw.ustring.lower(rareza) == 'especial' then
        style = 'color: #c86f2b'
    elseif mw.ustring.lower(rareza) == 'épica' then
        style = 'color: #b925d7'
    elseif mw.ustring.lower(rareza) == 'legendaria' then
        style = 'background: -webkit-linear-gradient(right, #ff6e6e, #f6ff78, #9fff7f, #87fbff, #9182ff, #ff69fa); -webkit-background-clip: text; -webkit-text-fill-color: transparent'
    else
        style = 'color: #f2efea'
    end
    return '[[Cartas ' .. plural .. '|<span style="font-weight: bold; font-family: magic; ' .. style .. ';">' .. string .. '</span>]]'
end
 
return p