16 403
contributi
(Some updates *** sovrascritto il testo esistente ***) |
(Quick fix) |
||
--[[
-- Ogni Pokémon con forme alternative ha una tabella associata con▼
-- tutte le informazioni necessarie come sottotabelle: si usano le▼
-- sigle come chiavi, o come elementi stessi se l'informazione della▼
-- tabella è booleana; sono considerati solo i Pokémon le cui forme▼
-- alternative non sono puramente estetiche▼
Abbrs for alternate forms MUST match the pattern "^%u%a*$".
--]]
local t = {}
-- Creates links to alternative forms
local function makeIndexLinks(index, context)
-- Removing support
local stdLinks = tab.filter(t, function(_, key)
return
end)
-- Adds links of forms with a dedicated page
-- stylua: ignore start▼
makeTargetedLink(index, context, "
makeTargetedLink(index, context, "
makeTargetedLink(index, context, "
makeTargetedLink(index,
makeTargetedLink(index, context, "Forma di Hisui", t.formgroups.hisui, { "base", "H" })
▲ makeTargetedLink(index, context, "Forma di Alola", t.alola, { "base", "A" })
▲ makeTargetedLink(index, context, "Forma di Galar", t.galar, { "base", "G" })
▲ makeTargetedLink(index, context, "Gigamax", t.gigamax, { "base", "Gi" })
▲ makeTargetedLink(index, context, "Forma di Hisui", t.hisui, { "base", "H" })
▲ -- stylua: ignore
-- TODO: this shit is terrible
makeTargetedLink(index, context, "Forma di Paldea", t.formgroups.paldea, { "base", "P", "C", "I", "A" })
-- stylua: ignore end
end
t.gimmighoul = {}
-- Automatic generation of groups of alt forms
-- The lists of Pokémon in a given group is kept in a subtable in order not to
-- add keys which are not Pokémon names
t.formgroups = {}
-- Tabella con i Pokémon che hanno una sola megaevoluzione
-- stylua: ignore
t.formgroups.mega = {'venusaur', 'blastoise', 'beedrill', 'pidgeot', 'alakazam',
'gengar', 'slowbro', 'kangaskhan', 'pinsir', 'gyarados', 'aerodactyl',
'ampharos', 'steelix', 'scizor', 'heracross', 'houndoom', 'tyranitar',
-- Tabella contentente i Pokémon che hanno più megaevoluzioni
t.formgroups.megaxy = { "charizard", "mewtwo" }
-- Tabella contenente i Pokémon che hanno un archeorisveglio
t.formgroups.archeo = { "kyogre", "groudon" }
-- Tabella contenente i Pokémon che hanno una forma di Alola:
-- per efficienza, alcuni sono alla fine del modulo
-- stylua: ignore
t.formgroups.alola = {'rattata', 'raichu', 'sandshrew', 'vulpix', 'diglett
-- Tabella contenente i Pokémon che hanno una forma di Galar:
-- per efficienza, alcuni sono alla fine del modulo
-- stylua: ignore
t.formgroups.galar = {'meowth', 'ponyta', 'slowpoke', 'slowbro', "farfetch'd"
-- Table with Pokémon with a Gigamax
-- stylua: ignore
t.formgroups.gigamax = {'venusaur', 'charizard', 'blastoise', 'butterfree
'copperajah', 'duraludon'}
-- Tabella contenente i Pokémon che hanno una forma di Hisui:
-- per efficienza, alcuni sono alla fine del modulo
-- stylua: ignore
t.formgroups.hisui = {'growlithe', 'voltorb', 'typhlosion', 'qwilfish
'avalugg', 'decidueye'}
-- Tabella contenente i Pokémon che hanno una forma di Paldea
t.formgroups.paldea = { "wooper", "tauros" }
--[[
t.gimmighoul.names = {A = 'Forma Ambulante', base = 'Forma Scrigno'}
-- stylua: ignore end
for _, v in pairs(t.formgroups.mega) do
if not t[v] then
t[v] = { names = { base = "" } }
t[v].names.M = "Mega" .. txt.fu(v)
end
for _, v in pairs(t.formgroups.megaxy) do
if not t[v] then
t[v] = { names = { base = "" } }
t[v].names.MY = table.concat({ "Mega", fu, " Y" })
end
for _, v in pairs(t.formgroups.archeo) do
if not t[v] then
t[v] = { names = { base = "" } }
t[v].names.A = "Archeorisveglio"
end
for _, v in pairs(t.formgroups.alola) do
if not t[v] then
t[v] = { names = { base = "" } }
t[v].names.A = "Forma di Alola"
end
for _, v in pairs(t.formgroups.galar) do
if not t[v] then
t[v] = { names = { base = "" } }
t[v].names.G = "Forma di Galar"
end
for _, v in pairs(t.formgroups.gigamax) do
if not t[v] then
t[v] = { names = { base = "" } }
t[v].names.Gi = txt.fu(v) .. " Gigamax"
end
for _, v in pairs(t.formgroups.hisui) do
if not t[v] then
t[v] = { names = { base = "" } }
t.squawkabilly.ext = { azzurre = "A", gialle = "G", bianche = "B", verdi = "base" }
t.gimmighoul.ext = { ambulante = "A", scrigno = "base" }
for _, v in pairs(t.formgroups.mega) do
t[v].ext = t[v].ext or {}
t[v].ext.mega = "M"
end
for _, v in pairs(t.formgroups.megaxy) do
t[v].ext = t[v].ext or {}
t[v].ext.megax = "MX"
t[v].ext.megay = "MY"
end
for _, v in pairs(t.formgroups.archeo) do
t[v].ext = t[v].ext or {}
t[v].ext.archeo = "A"
end
for _, v in pairs(t.formgroups.alola) do
t[v].ext = t[v].ext or {}
t[v].ext.alola = "A"
end
for _, v in pairs(t.formgroups.galar) do
t[v].ext = t[v].ext or {}
t[v].ext.galar = "G"
end
for _, v in pairs(t.formgroups.gigamax) do
t[v].ext = t[v].ext or {}
t[v].ext.gigamax = "Gi"
end
for _, v in pairs(t.formgroups.hisui) do
t[v].ext = t[v].ext or {}
t[v].ext.hisui = "H"
t.squawkabilly.gamesOrder = { "base", "A", "G", "B" }
t.gimmighoul.gamesOrder = { "base", "A" }
for _, v in pairs(t.formgroups.mega) do
t[v].gamesOrder = t[v].gamesOrder or { "base", "M" }
end
for _, v in pairs(t.formgroups.megaxy) do
t[v].gamesOrder = t[v].gamesOrder or { "base", "MX", "MY" }
end
for _, v in pairs(t.formgroups.archeo) do
t[v].gamesOrder = t[v].gamesOrder or { "base", "A" }
end
for _, v in pairs(t.formgroups.alola) do
t[v].gamesOrder = t[v].gamesOrder or { "base", "A" }
end
for _, v in pairs(t.formgroups.galar) do
t[v].gamesOrder = t[v].gamesOrder or { "base", "G" }
end
for _, v in pairs(t.formgroups.gigamax) do
t[v].gamesOrder = t[v].gamesOrder or { "base", "Gi" }
end
for _, v in pairs(t.formgroups.hisui) do
t[v].gamesOrder = t[v].gamesOrder or { "base", "H" }
end
--]]
for _, v in pairs(t.formgroups.mega) do
t[v].cries = { "M" }
end
for _, v in pairs(t.formgroups.megaxy) do
t[v].cries = { "MX", "MY" }
end
for _, v in pairs(t.formgroups.archeo) do
t[v].cries = { "A" }
end
-- to avoid useless repetitions of cycles
-- Otehr Alola forms
table.insert(t.formgroups.alola, "raticate")
table.insert(t.formgroups.alola, "sandslash")
table.insert(t.formgroups.alola, "ninetales")
table.insert(t.formgroups.alola, "dugtrio")
table.insert(t.formgroups.alola, "meowth")
table.insert(t.formgroups.alola, "graveler")
table.insert(t.formgroups.alola, "golem")
table.insert(t.formgroups.alola, "muk")
-- Other Galar forms
table.insert(t.formgroups.galar, "rapidash")
table.insert(t.formgroups.galar, "linoone")
-- Other Hisuian forms
table.insert(t.formgroups.hisui, "arcanine")
table.insert(t.formgroups.hisui, "electrode")
table.insert(t.formgroups.hisui, "zoroark")
table.insert(t.formgroups.hisui, "goodra")
-- Other Gigamax forms
table.insert(t.formgroups.gigamax, "pikachu")
table.insert(t.formgroups.gigamax, "toxtricity")
-- Link creation should be done AFTER copying Pokémon with same forms, in order
-- Urshifu has both a gigamax and a non-empty base form, hence we copy it after
-- link creation
table.insert(t.formgroups.gigamax, "urshifu")
t[19] = t.rattata
|