Boas noticias! Agora em português temos as estatísticas de wikis. Estatística na Gamepedia

Módulo:Tipo

De Pokémon GO Wiki
Ir para: navegação, pesquisa

A documentação para este módulo pode ser criada em Módulo:Tipo/doc

local p = {}
function p.typeformat( f )
  local args = f:getParent().args
  local types = {
    ["normal"] = {
      ["forecolor"] = "#5e6062",
      ["backcolor"] = "#868886"
    },
    ["fogo"] = {
      ["forecolor"] = "#f06818",
      ["backcolor"] = "#fba130"
    },
    ["combate"] = {
      ["forecolor"] = "#a82f2a",
      ["backcolor"] = "#d14d62"
    },
    ["água"] = {
      ["forecolor"] = "#3371c6",
      ["backcolor"] = "#60a5d9"
    },
    ["voador"] = {
      ["forecolor"] = "#5456ab",
      ["backcolor"] = "#7785d9"
    },
    ["grama"] = {
      ["forecolor"] = "#1e7057",
      ["backcolor"] = "#43bb66"
    },
    ["poção"] = {
      ["forecolor"] = "#ad2c9e",
      ["backcolor"] = "#d746c3"
    },
    ["elétrico"] = {
      ["forecolor"] = "#e29c15",
      ["backcolor"] = "#fccf36"
    },
    ["terra"] = {
      ["forecolor"] = "#a53f10",
      ["backcolor"] = "#ca7338"
    },
    ["psychic"] = {
      ["forecolor"] = "#e8264e",
      ["backcolor"] = "#fc7066"
    },
    ["rocha"] = {
      ["forecolor"] = "#94966c",
      ["backcolor"] = "#c7b966"
    },
    ["gelado"] = {
      ["forecolor"] = "#167179",
      ["backcolor"] = "#6bccc4"
    },
    ["bug"] = {
      ["forecolor"] = "#479d06",
      ["backcolor"] = "#77c10c"
    },
    ["dragão"] = {
      ["forecolor"] = "#275799",
      ["backcolor"] = "#2f69b6"
    },
    ["fantasma"] = {
      ["forecolor"] = "#733fb7",
      ["backcolor"] = "#816dc5"
    },
    ["escuro"] = {
      ["forecolor"] = "#3b334d",
      ["backcolor"] = "#575565"
    },
    ["aço"] = {
      ["forecolor"] = "#256473",
      ["backcolor"] = "#347a8f"
    },
    ["fada"] = {
      ["forecolor"] = "#cf44a9",
      ["backcolor"] = "#f38dd8"
    }
  }

  local returnhtml, typeLow = {}, ''

  for _,ptype in ipairs(args) do
    typeLow = string.lower(ptype)
    if types[typeLow] ~= nil then
      table.insert(returnhtml,'<div style="display:inline-block;border-radius: 2em; width:4em; background:'..types[typeLow].backcolor..'; border: 1px solid '..types[typeLow].forecolor..'; text-shadow:0 0 1px black;padding:0 0.3em; text-align:center;position:relative;height: 1.5em;color:white">[['..ptype..'|<span style="position:absolute;width:100%;height:100%;top:0;left:0;z-index:1;"></span>]]'..ptype..'</div>')
    end
  end
  return table.concat(returnhtml,' ')
end
return p