16 403
contributi
m |
(Fixed pokemoncentral/wiki-project#40 (spero)) |
||
local tab = require('Modulo:Wikilib/tables') -- luacheck: no unused
--
local makeTargetedLink = function(linkstr, index, target, list)
t[poke][index] = table.map(t[poke].names, function(formName)▼
return formName == ''▼
and ''▼
anchor = t[poke].anchor or string.fu(poke),▼
formName = formName▼
})▼
end)▼
end▼
-- Creates links to alternative forms
local makeLinks = function(black)
local link = black
and '<div class="small-text black-text">[[Differenze di forma#${anchor}|
or '<div class="small-text">[[Differenze di forma#${anchor}|${formName}]]</div>'
local index = black and 'blacklinks' or 'links'
-- Si eliminano le table di supporto e i
-- Pokémon che non hanno i link standard
local stdLinks = table.filter(t, function(_, key)
return
-- Links standard
for name, poke in pairs(stdLinks) do
poke[index] = table.map(poke.names, function(formName)
end
-- Link of forms with a dedicated page instead of "Differenze di forma"
makeTargetedLink(link, index, 'Megaevoluzione', table.merge(t.mega, t.megaxy))
makeTargetedLink(link, index, 'Archeorisveglio', t.archeo)
▲ for _, poke in pairs(t.mega) do
makeTargetedLink(link, index, 'Forma di Alola', t.alola)
▲ end)
▲ end
▲ end
▲ -- pagina apposita e non "Differenze di forma"
▲ link = link:gsub('Differenze di forma', 'Forma di Alola')
▲ t[poke][index] = table.map(t[poke].names, function(formName)
▲ return formName == ''
▲ and ''
▲ or string.interp(link, {
▲ anchor = t[poke].anchor or string.fu(poke),
▲ formName = formName
▲ })
end
G = 'Tipo Ghiaccio'}
t.minior.names = {R = 'Forma Nucleo', base = 'Forma Meteora'}
t.necrozma.names = {V = 'Necrozma Criniera del Vespro', A =
U = 'UltraNecrozma', base = ''}
for k, v in pairs(t.mega) do
local fu = string.fu(v)
t[v] = {}
t[v].names = {M = 'Mega' .. fu, base =
end
for k, v in pairs(t.megaxy) do
t[v] = {}
t[v].names = {MX = table.concat{'Mega', fu, ' X'},
MY = table.concat{'Mega', fu, ' Y'}, base =
end
for k, v in pairs(t.archeo) do
local fu = string.fu(v)
t[v] = {}
t[v].names = {A = '
end
for k, v in pairs(t.alola) do
|