FANDOM


-- <pre>
-- Used by [[Template:Keyword color]] and [[Template:Skin tier]]
local p = {}
local lib = require('Module:Feature')
 
local keywordcolor = {
    {"salute",                "#C03300"},
    {"hp",                    "#C03300"},
    {"attacco fisico",         "#FC8A01"},
    {"danno fisico",         "#FC8A01"},
    {"danno fisico bonus",       "#FC8A01"},
    {"ad",                    "#FC8A01"},
    {"potere magico",         "#97FC97"},
    {"ap",                    "#97FC97"},
    {"true damage",           "#F9966B"}, -- used to dodge percent
    {"velocità d'attacco",          "#C80000"},
    {"as",          "#C80000"},
    {"armatura",                 "#EFF002"},
    {"letalità",             "#EFF002"},
    {"resistenza magica",          "#CA1F7B"},
    {"mr",                    "#CA1F7B"},
    {"resist",                "#E46E9D"},
    {"resistenza",                "#E46E9D"},
    {"mana",                  "#0099CC"},
    {"energia",                "#FFFF00"},
    {"possibilità di colpo critico","#E56013"},
    {"colpo critico",       "#E56013"},
    {"danno da colpo critico","#944B00"},
    {"critical damage",       "#944B00"},
    {"Velocità di movimento",        "#F5EE99"},
    {"ms",                    "#F5EE99"},
    {"xp",                    "#883FD1"},
    {"gold",                  "#FFD700"},
    {"oro",                  "#FFD700"},
    {"attacco potenziato",      "#5C58C9"},
    {"buzzword3",             "#E34D4C"},
    {"buzzword2",             "#56C456"},
    {"buzzword",              "#A01D7A"}
}
 
local skincolor = {
    {"ultimate",              "#FFA500"}, -- orange
    {"supreme",              "#FFA500"}, -- orange
    {"suprema",              "#FFA500"}, -- orange
    {"3250",                  "#FFA500"}, -- orange
    {"2775",                  "#FFA500"}, -- orange
    {"legendary",             "#FF3232"},
    {"leggendarie",             "#FF3232"},
    {"leggendaria",             "#FF3232"},
    {"1820",                  "#FF3232"},
    {"loot",                  "#7943ED"},
    {"gem",                   "#7943ED"},
    {"mythic",                "#7943ED"},
    {"mitica",                "#7943ED"},
    {"mitiche",                "#7943ED"},
    {"2450",                  "#7943ED"},
    {"10",                    "#7943ED"},
    {"epic",                  "#00C8FF"},
    {"epica",                  "#00C8FF"},
    {"epiche",                  "#00C8FF"},
    {"1350",                  "#00C8FF"},
    {"standard",              "#228B22"}, -- forestgreen
    {"975",                   "#228B22"}, -- forestgreen
    {"budget",                "#FFFFFF"}, -- white
    {"750",                   "#FFFFFF"}, -- white
    {"classic",               "#808080"}, -- grey
    {"classica",               "#808080"}, -- grey
    {"classiche",               "#808080"}, -- grey
    {"520",                   "#808080"}, -- grey
    {"460",                   "#808080"}, -- grey
    {"390",                   "#808080"}, -- grey
    {"chroma",                "#FFFFFF"}, -- white
    {"290",                   "#FFFFFF"}, -- white
    {"195",                   "#FFFFFF"}  -- white
}
 
function p.keyword(frame)
    local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end
 
    for i,color in ipairs(keywordcolor) do 
        result = mw.ustring.find(mw.ustring.lower(args[1]), color[1])
        if result ~= nil then
            return color[2]
        end
    end
    return "inherit"
end
 
function p.skin(frame)
    local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end
 
    for i,color in ipairs(skincolor) do 
        result = mw.ustring.find(mw.ustring.lower(args[1]), color[1])
        if result ~= nil then
            return color[2]
        end
    end
    return "inherit"
end
 
return p
 
-- </pre>
-- [[Category:Lua]]
I contenuti della comunità sono disponibili sotto la licenza CC-BY-SA a meno che non sia diversamente specificato.