Differenze tra le versioni di "Modulo:Evobox"

Automatically adding category for unique BST in Stats *** sovrascritto il testo esistente ***
m (Pokémon con evoluzioni diramate > Pokémon con evoluzioni ramificate)
(Automatically adding category for unique BST in Stats *** sovrascritto il testo esistente ***)
local eb = {}
 
-- stylua: ignore start
local txt = require('Modulo:Wikilib/strings') -- luacheck: no unused
local tabtxt = require('Modulo:Wikilib/tablesstrings') -- luacheck: no unused
local tab = require('Modulo:Wikilib/tables')
local form = require('Modulo:Wikilib/forms')
local evolib = require('Modulo:Wikilib/evos')
local moves = mw.loadData('Modulo:Move/data')
local evodata = mw.loadData('Modulo:Evo/data')
-- stylua: ignore end
form.loadUseless(true)
local bothforms = form.allFormsData()
SMALL_TEXT_NEWLINE = [=[<div class="small-text">${text}</div>]=],
 
CAT_TRE_PHASES = '"[[Categoria:Pokémon appartenenti a una linea di evoluzione a tre stadi]]'",
CAT_TWO_PHASES = '"[[Categoria:Pokémon appartenenti a una linea di evoluzione a due stadi]]'",
CAT_ONE_PHASE = '"[[Categoria:Pokémon che non fanno parte di una linea di evoluzione]]'",
CAT_BRANCHED_PHASES = '"[[Categoria:Pokémon con evoluzioni ramificatediramate]]'",
}
 
eb.strings.desktoparrows = {
normal = '"&rarr;'",
fixed = '"&rarr;'",
reverse = '"&larr;'",
double = '"&harr;'",
}
 
eb.strings.mobilearrows = {
normal = '"&darr;'",
fixed = '"&rarr;'",
reverse = '"&uarr;'",
double = '"'",
}
 
-- this should be constant
eb.emptybox = { }
 
--[[
--]]
eb.boxPokemon = function(args)
return stringtxt.interp(eb.strings.BOX_POKEMON, {
notes = args.notes and stringtxt.interp(eb.strings.SMALL_TEXT_NEWLINE, {
text = args.notes,
}) or ''"",
background = css.radialGradLua({ type1 = args.type1, type2 = args.type2 },
type1 = args.type1,
type2 = args.type2,
}),
spr = args.spr,
phase = args.phase or "Non si evolve",
name = args.name,
shownName = args.shownName or args.name,
type1rect = links.colorType(args.type1,
c[args.disptype1 or args.type1].dark),
type2rect = c[args.disptype2disptype1 or args.type1].dark
),
and links.colorType(args.type2, c[args.disptype2].dark)
type2rect = or (args.type2disptype2 ~=and argslinks.type1colorType(
and links.colorType(args.type2, c[args.type2].dark)
or '')c[args.disptype2].dark
) or (args.type2 ~= args.type1 and links.colorType(
args.type2,
c[args.type2].dark
) or ""),
})
end
 
 
--[[
local methodsFunctionGenerator = function(text)
return function(param)
return stringtxt.interp(text, { param = param })
end
end
 
local smallMethodsFunctionGenerator = function(text)
text = stringtxt.interp(eb.strings.SMALL_TEXT_NEWLINE, { text = text })
return function(param)
return stringtxt.interp(text, { param = param })
end
end
eb.boxArrow = { img = {}, desc = {} }
eb.boxArrow.img.methods = {
[evodata.methods.OTHER] = methodsFunctionGenerator(''""),
[evodata.methods.LEVEL] = methodsFunctionGenerator(links.bag('Caramella rara')),
links.bag("Caramella rara")
[evodata.methods.HAPPINESS] = methodsFunctionGenerator(links.bag('Calmanella')),
),
[evodata.methods.STONE] = methodsFunctionGenerator(links.bag('${param}')),
[evodata.methods.TRADEHAPPINESS] = methodsFunctionGenerator(links.bag('Blocco Amici')),
links.bag("Calmanella")
[evodata.methods.BREED] = methodsFunctionGenerator(ms.staticLua{'Uovo'}),
),
[evodata.methods.UNKNOWN] = methodsFunctionGenerator(''),
[evodata.methods.STONE] = methodsFunctionGenerator(links.bag("${param}")),
[evodata.methods.TRADE] = methodsFunctionGenerator(
links.bag("Blocco Amici")
),
[evodata.methods.BREED] = methodsFunctionGenerator(
ms.staticLua({ "Uovo" })
),
[evodata.methods.UNKNOWN] = methodsFunctionGenerator(""),
}
eb.boxArrow.img.conditions = {
[evodata.conditions.OTHER] = nilConst,
[evodata.conditions.TIME] = nilConst,
[evodata.conditions.ITEM] = methodsFunctionGenerator(links.bag('"${param}'")),
[evodata.conditions.LOCATION] = methodsFunctionGenerator(links.bag('Mappa città')),
links.bag("Mappa città")
),
[evodata.conditions.MOVE] = function(movename)
-- Takes move name and gets move type for the MT image
local movetype = multigen.getGenValue(moves[movename:lower()].type)
return links.bag('"MT '" .. stringtxt.fu(movetype), { link = "MT" })
end,
[evodata.conditions.GENDER] = nilConst,
[evodata.conditions.TRADED_FOR] = function(ndex)
return ms.staticLua({ ndex })
end,
[evodata.conditions.BREEDONLY] = methodsFunctionGenerator(ms.staticLua{'132'}),
ms.staticLua({ "132" })
),
[evodata.conditions.REGION] = nilConst,
}
 
eb.boxArrow.desc.methods = {
[evodata.methods.OTHER] = methodsFunctionGenerator('"${param}'"),
[evodata.methods.LEVEL] = function(level)
if not level then
return '"[[Livello|Aumento di livello]]'"
end
return table.concat({ '"[[Livello|Livello '", level, '"]]'" })
end,
[evodata.methods.HAPPINESS] = methodsFunctionGenerator('[[Affetto|Legame]]'),
"[[Affetto|Legame]]"
[evodata.methods.STONE] = methodsFunctionGenerator('${param}'),
),
[evodata.methods.TRADE] = methodsFunctionGenerator('[[Scambio]]'),
[evodata.methods.BREEDSTONE] = methodsFunctionGenerator('[[Accoppiamento Pokémon|Accoppiamento]]'"${param}"),
[evodata.methods.UNKNOWNTRADE] = methodsFunctionGenerator('Sconosciuto'"[[Scambio]]"),
[evodata.methods.BREED] = methodsFunctionGenerator(
"[[Accoppiamento Pokémon|Accoppiamento]]"
),
[evodata.methods.UNKNOWN] = methodsFunctionGenerator("Sconosciuto"),
}
eb.boxArrow.desc.conditions = {
[evodata.conditions.OTHER] = smallMethodsFunctionGenerator('"${param}'"),
[evodata.conditions.TIME] = smallMethodsFunctionGenerator('"(${param})'"),
[evodata.conditions.ITEM] = smallMethodsFunctionGenerator('tenendo [[${param}]]'),
[evodata.conditions.LOCATION] = smallMethodsFunctionGenerator('presso: "tenendo [[${param}]]'),"
),
[evodata.conditions.LOCATION] = smallMethodsFunctionGenerator(
"presso: [[${param}]]"
),
[evodata.conditions.MOVE] = function(movename)
return stringtxt.interp(eb.strings.SMALL_TEXT_NEWLINE, {
text = table.concat({ '"avendo appreso [['", movename, '"]]'" }),
})
end,
[evodata.conditions.GENDER] = smallMethodsFunctionGenerator('"(${param})'"),
[evodata.conditions.TRADED_FOR] = function(ndex)
local name = pokes[tonumber(ndex)].name
return table.concat({ '" per [['", name, '"]]'" })
end,
[evodata.conditions.BREEDONLY] = methodsFunctionGenerator('" con [[Ditto]]'"),
[evodata.conditions.REGION] = smallMethodsFunctionGenerator('nella regione di [[${param}]]'),
"nella regione di [[${param}]]"
),
}
 
 
--[[
end
direction = direction
or (data.method == evodata.methods.BREED and "reverse" or "normal")
and 'reverse'
or 'normal'
)
 
-- Only uses the first image found. The actual order is the keys' one
-- because there souldn't be more than one condition with an img at a time
local img = tabletab.mapToNum(data.conditions or {}, function(val, condition)
return eb.boxArrow.img.conditions[condition](val)
end)
table.insert(img, eb.boxArrow.img.methods[data.method](data[data.method]))
 
local desc = tabletab.mapToNum(data.conditions or {}, function(val, condition)
return eb.boxArrow.desc.conditions[condition](val)
end)
table.insert(desc, 1, eb.boxArrow.desc.methods[data.method](data[data.method]))
desc,
1,
eb.boxArrow.desc.methods[data.method](data[data.method])
)
 
local interpData = {
desktoparrow = eb.strings.desktoparrows[direction],
mobilearrow = eb.strings.mobilearrows[direction],
info = ''"",
}
local interpString = eb.strings.BOX_ARROW
 
if
if interpData.evodesc == ''
and interpData.infoevodesc == ''""
and interpData.timegenderinfo == '' then""
and interpData.timegender == ""
then
interpString = eb.strings.BOX_ARROW_INFOLESS
elseif interpData.direction == '"fixed'" then
interpString = eb.strings.BOX_ARROW_UNRESPONSIVE
end
return stringtxt.interp(interpString, interpData)
end
 
--]]
eb.SingleArrow = function(data, direction)
return stringtxt.interp(eb.strings.SINGLE_ARROW, {
boxarrow = eb.boxArrowGen(data, direction),
})
end
--]]
eb.DoubleArrow = function(data)
return stringtxt.interp(eb.strings.DOUBLE_ARROW, {
boxarrow1 = eb.boxArrowGen(data.evos[1]),
boxarrow2 = eb.boxArrowGen(data),
--]]
eb.TripleArrow = function(data)
return stringtxt.interp(eb.strings.TRIPLE_ARROW, {
boxarrow1 = eb.boxArrowGen(data.evos[1]),
boxarrow2 = eb.boxArrowGen(data),
if position == 1 then
if baseData.method == evodata.methods.BREED then
if baseData.conditions
and baseData.conditions[evodata.conditions.BREEDONLY] then
returnand 'Non si evolve'baseData.conditions[evodata.conditions.BREEDONLY]
then
return "Non si evolve"
else
return '"Forma Baby'"
end
elseif not baseData.method and baseData.evos then
return '"Forma Base'"
else
return '"Non si evolve'"
end
elseif position == 2 then
if baseData.conditions
and baseData.conditions[evodata.conditions.BREEDONLY] then
and baseData.conditions[evodata.conditions.BREEDONLY]
return 'Genitore'
then
return "Genitore"
else
return '"Prima evoluzione'"
end
else
return '"Seconda evoluzione'"
end
end
return ""
end
local poke = multigen.getGen(pokes[ndex]
or pokes[tonumber(ndex)]
or pokes[tonumber(string.match(ndex, "(%d%d%d)%u%l*"))])
ndex = type(ndex) == "string" and ndex or pokes[tonumber(string.threeFiguresmatch(ndex, "(%d%d%d)%u%l*"))]
)
ndex = type(ndex) == "string" and ndex or txt.threeFigures(ndex)
 
return eb.boxPokemon({
notes = notes,
type1 = poke.type1 or "sconosciuto",
phase = phase,
name = poke.name,
shownName = shownName,
})
end
 
local arrows, boxes = {}, {}
for k, v in ipairs(evos) do
local key = '"box'" .. tostring(k)
arrows[key] = eb.SingleArrow(v)
boxes[key] = eb.boxPokemonAuto(
end
 
if tabletab.getn(arrows) == 0 then
return ''""
elseif tabletab.getn(arrows) == 1 then
return table.concat({
stringtxt.interp(eb.strings.ROW_ONE, arrows),
stringtxt.interp(eb.strings.ROW_ONE, boxes),
})
else
return table.concat({
stringtxt.interp(eb.strings.ROW_TWO, arrows),
stringtxt.interp(eb.strings.ROW_TWO, boxes),
})
end
end
--]]
eb.makeManyEvosRow = function(evos)
local rowContent = tabletab.map(evos, function(v)
return stringtxt.interp(eb.strings.GRID_ROW, {
arrow = eb.SingleArrow(v, '"fixed'"),
box = eb.boxPokemonAuto(
v.ndex or v.name,
eb.phaseName(2, evodata[v.name]),
v.notes
),
})
end, ipairs)
 
return stringtxt.interp(eb.strings.ROW_THREE, {
boxes = table.concat(rowContent),
})
end
if data.conditions and data.conditions[evodata.conditions.BREEDONLY] then
-- Breedonly (aka Phione)
return table.concat({
stringtxt.interp(eb.strings.ROW_ONE, {
box1 = eb.SingleArrow(data),
}),
stringtxt.interp(eb.strings.ROW_ONE, {
box1 = eb.boxPokemonAuto(data.evos[1].ndex or data.evos[1].name,
data.evos[1].ndex or ebdata.phaseName(2, data)evos[1].name,
eb.phaseName(2, data.evos[1].notes),
data.evos[1].notes
),
}),
})
elseif tabletab.getn(data.evos) > 1 then
-- More than one phase one, even with breed
return table.concat({
eb.TripleArrow(data),
stringtxt.interp(eb.strings.ROW_TWO, {
box1 = eb.boxPokemonAuto(
data.evos[1].ndex or data.evos[1].name,
eb.phaseName(2, data),
data.evos[1].notes
),
box2 = eb.boxPokemonAuto(
data.evos[2].ndex or data.evos[2].name,
eb.phaseName(2, data),
data.evos[2].notes
),
}),
})
else
-- There is one phase one evolution, but with double arrow
return table.concat({
stringtxt.interp(eb.strings.ROW_ONE, {
box1 = eb.DoubleArrow(data),
}),
stringtxt.interp(eb.strings.ROW_ONE, {
box1 = eb.boxPokemonAuto(data.evos[1].ndex or data.evos[1].name,
data.evos[1].ndex or ebdata.phaseName(2, data)evos[1].name,
eb.phaseName(2, data.evos[1].notes),
}) data.evos[1].notes
} ),
}),
})
end
end
local pokename = mw.text.decode(p[1]):lower()
local abbr = p.form or ""
local pokeData = multigen.getGen(pokes[form.nameToDataindex(pokename .. abbr)])
multigen.getGen(pokes[form.nameToDataindex(pokename .. abbr)])
local nameabbr = abbr == "" and pokename or pokename .. abbr
 
data = evolib.prunedEvotree(nameabbr)
end
assert(data)
 
local evoboxcontent = {}
 
-- Insert the first phase Pokémon box
table.insert(evoboxcontent, string.interp(eb.strings.ROW_ONE, {
evoboxcontent,
box1 = eb.boxPokemonAuto(data.ndex or data.name, eb.phaseName(1, data), data.notes)
txt.interp(eb.strings.ROW_ONE, {
}))
box1 = eb.boxPokemonAuto(
data.ndex or data.name,
eb.phaseName(1, data),
data.notes
),
})
)
 
local phase3evos
-- If there are more than 2 phase one evolutions the module assumes there
-- aren't higher level evolutions and uses the unresponsive layout
if tabletab.getn(data.evos, "num") > 2 then
boxContainer = eb.strings.BOX_CONTAINER_UNRESPONSIVE
table.insert(evoboxcontent, eb.makeManyEvosRow(data.evos))
table.insert(evoboxcontent, eb.makePhaseRows(data.evos, 2))
end
phase3evos = tabletab.flatMapToNum(data.evos, function(v)
return v.evos or { eb.emptybox }
end)
if
if table.any(phase3evos, function(v) return v ~= eb.emptybox end) then
tab.any(phase3evos, function(v)
return v ~= eb.emptybox
end)
then
table.insert(evoboxcontent, eb.makePhaseRows(phase3evos, 3))
end
 
local evobox = {
stringtxt.interp(boxContainer, {
textcolor = cc.forModGradBgLua(
pokeData.type1 or '"sconosciuto'",
pokeData.type2 or '"sconosciuto'"
),
background = css.horizGradLua({
type1 = pokeData.type1 or '"sconosciuto'",
type2 = pokeData.type2 or '"sconosciuto'",
}),
content = table.concat(evoboxcontent),
}),
}
 
-- Adds categories
phase3evos = phase3evos
and tabletab.filter(phase3evos, function(v) return v ~= eb.emptybox end)
return orv {}~= eb.emptybox
if p.cat ~= "no" end)
and notor (data.conditions{}
if
and data.conditions[evodata.conditions.BREEDONLY]) then
if tablep.getn(phase3evos,cat ~= "numno") > 0 then
and not (
data.conditions
and data.conditions[evodata.conditions.BREEDONLY]
)
then
if tab.getn(phase3evos, "num") > 0 then
table.insert(evobox, eb.strings.CAT_TRE_PHASES)
elseif data.evos then
table.insert(evobox, eb.strings.CAT_ONE_PHASE)
end
if table.getn(phase3evos, "num") > 1
or (data.evos and tabletab.getn(data.evosphase3evos, "num") > 1) then
or (data.evos and tab.getn(data.evos, "num") > 1)
then
table.insert(evobox, eb.strings.CAT_BRANCHED_PHASES)
end
return table.concat(evobox)
end
 
 
-- ========================== Non-automatic interface ==========================
 
--]]
eb.processInput.mapToLower = { '^family$', '^evotype%d%a?$', '^move%d%a?$',
'{ "^family$", "^evotype%d%a?$", "^move%d%a?$", "^type%d$'" }
 
-- Processes an argument: maps to lowercase when needed.
eb.processInput.processElement = function(v, k)
if
if type(k) == 'string' and table.any(eb.processInput.mapToLower, function(pattern)
return string.matchtype(k, pattern) == "string"
and tab.any(eb.processInput.mapToLower, function(pattern)
end) then
return string.match(k, pattern)
end)
then
v = string.lower(v)
end
end
local fakephase = p.family == "normale" and { evos = {} } or {}
return eb.boxPokemon({
notes = p["loc" .. suff],
type1 = p["type1-" .. suff],
spr = "[[File:" .. p["sprite" .. suff] .. ".png|150px]]",
phase = p["forme" .. suff]
or eb.phaseName(tonumber(suff:match("^(%d*)%a?")), fakephase),
name = p["name" .. suff],
shownName = p["displayname" .. suff],
})
end
 
eb.evotypeToMethod = {
livello = evodata.methods.LEVEL,
['"affetto'"] = evodata.methods.HAPPINESS,
posizione = evodata.methods.LEVEL,
pietra = evodata.methods.STONE,
mossa = evodata.methods.LEVEL,
['"strum. tenuto'"] = evodata.methods.LEVEL,
['"ogg. tenuto'"] = evodata.methods.LEVEL,
scambio = evodata.methods.TRADE,
other = evodata.methods.OTHER,
local fakeevo = { ndex = 000, conditions = {} }
fakeevo.method = eb.evotypeToMethod[p["evotype" .. suff]]
or evodata.methods.OTHER
 
fakeevo[evodata.methods.LEVEL] = p["level" .. suff]
local result = {}
local evotypePhase = tostring(phase - 1)
if p['"name'" .. phase] or p['"name'" .. phase .. '"a'"] then
if p['"name'" .. phase .. '"a'"] then
-- There are two evolutions
table.insert(result, string.interp(eb.strings.ROW_TWO, {
box1 = eb.SingleArrowMaybe(p, evotypePhase)result,
box2 = ebtxt.SingleArrowMaybeinterp(p, evotypePhase eb.strings.ROW_TWO, 'a'){
}) box1 = eb.SingleArrowMaybe(p, evotypePhase),
box2 = eb.SingleArrowMaybe(p, evotypePhase .. "a"),
table.insert(result, string.interp(eb.strings.ROW_TWO, {
box1 = eb.boxPokemonManual(p, tostring(phase})),
)
box2 = eb.boxPokemonManual(p, tostring(phase) .. "a"),
}))table.insert(
result,
txt.interp(eb.strings.ROW_TWO, {
box1 = eb.boxPokemonManual(p, tostring(phase)),
box2 = eb.boxPokemonManual(p, tostring(phase) .. "a"),
})
)
else
-- There's only one evolution
table.insert(result, string.interp(eb.strings.ROW_ONE, {
box1 = eb.SingleArrowMaybe(p, evotypePhase)result,
})) txt.interp(eb.strings.ROW_ONE, {
table.insert(result, string.interp( box1 = eb.strings.ROW_ONESingleArrowMaybe(p, {evotypePhase),
box1 = eb.boxPokemonManual(p, tostring(phase})),
}))
table.insert(
result,
txt.interp(eb.strings.ROW_ONE, {
box1 = eb.boxPokemonManual(p, tostring(phase)),
})
)
end
end
eb.GlitchEvobox = function(frame)
local p = w.trimAll(mw.clone(frame.args))
p = tabletab.map(p, eb.processInput.processElement)
 
p.family = p.family and p.family:lower() or '"nessuna'"
 
local evoboxcontent = {
stringtxt.interp(eb.strings.ROW_ONE, { box1 = eb.boxPokemonManual(p, "1") }),
}
 
table.insert(evoboxcontent, eb.makeGlitchPhaseRows(p, 4))
 
return stringtxt.interp(eb.strings.BOX_CONTAINER, {
textcolor = cc.forModGradBgLua(p[1], p[2] or p[1]),
background = css.horizGradLua({ type1 = p[1], type2 = p[2] or p[1] }),
content = table.concat(evoboxcontent),
})
end
 
eb.glitchEvobox, eb.glitchevobox, eb.Glitchevobox =
eb.GlitchEvobox, eb.GlitchEvobox, eb.GlitchEvobox
 
 
-- ============================ Alternative forms box ==========================
local name, abbr = form.getnameabbr(ndex)
local altdata = bothforms[name]
shownname = shownname or altdata.names[abbr] == "" and string.fu(pokes[name].name)
or altdata.names[abbr] == "" and txt.fu(pokes[name].name)
return eb.boxPokemonAuto(ndex, '', notes, shownname)
return eb.boxPokemonAuto(ndex, "", notes, shownname)
end
 
ndex = 000,
method = evodata.methods.OTHER,
[evodata.methods.OTHER] = args.item and table.concat({
and tablelinks.concat{bag(args.item),
links.bag(args.item)"<div>",
"<div>"args.item,
args.item"</div>",
}) or "</div>",
}
or "",
}
return stringtxt.interp(eb.strings.SINGLE_ARROW, {
boxarrow = eb.boxArrowGen(fakeevo, '"double'"),
})
end
local newArgs = {}
for k, v in pairs(args) do
if k:match(ending .. '"$'") then
newArgs[k:match('"(.*)'" .. ending .. '"$'")] = v
end
end
local result = {}
local evotypeIdx = tostring(index - 1)
if p['"sprite'" .. tostring(index)] then
-- There is at least one evolution
if p['"sprite'" .. tostring(index) .. '"a'"] then
-- There are two evolutions
table.insert(result, string.interp(eb.strings.ROW_TWO, {
box1 = eb.FormArrow(eb.argsEndingSubset(p, evotypeIdx))result,
box2 = ebtxt.FormArrowinterp(eb.argsEndingSubset(pstrings.ROW_TWO, evotypeIdx .. 'a')){
box1 = eb.FormArrow(eb.argsEndingSubset(p, evotypeIdx)),
}))
table.insert(result, string.interp( box2 = eb.strings.ROW_TWO, {FormArrow(
box1 = eb.BoxFormargsEndingSubset(p, evotypeIdx .. "a")
p['sprite' .. tostring(index)],
p['loc' .. tostring(index)],
p['name' .. tostring(index)]
),
box2 = eb.BoxForm(})
p['sprite' .. tostring(index) .. 'a'],
p['loc' table.. tostringinsert(index) .. 'a'],
p['name' .. tostring(index) .. 'a']result,
txt.interp(eb.strings.ROW_TWO, {
box1 = eb.BoxForm(
p["sprite" .. tostring(index)],
p["loc" .. tostring(index)],
p["name" .. tostring(index)]
),
})) box2 = eb.BoxForm(
p["sprite" .. tostring(index) .. "a"],
p["loc" .. tostring(index) .. "a"],
p["name" .. tostring(index) .. "a"]
),
})
)
else
-- There's only one evolution
table.insert(result, string.interp(eb.strings.ROW_ONE, {
box1 = eb.FormArrow(eb.argsEndingSubset(p, evotypeIdx))result,
})) txt.interp(eb.strings.ROW_ONE, {
table.insert(result, string box1 = eb.interpFormArrow(eb.strings.ROW_ONEargsEndingSubset(p, {evotypeIdx)),
box1 = eb.BoxForm(})
p['sprite' .. tostring(index)],
p['loc' table.. tostringinsert(index)],
p['name' .. tostring(index)]result,
txt.interp(eb.strings.ROW_ONE, ){
})) box1 = eb.BoxForm(
p["sprite" .. tostring(index)],
p["loc" .. tostring(index)],
p["name" .. tostring(index)]
),
})
)
end
end
local p = w.trimAll(mw.clone(frame.args))
 
local pagename = stringtxt.fl(p[1] or mw.title.getCurrentTitle().text)
p[1] = nil
p.family = p.family or '"nessuna'"
local pagepoke = pokes[form.nameToDataindex(pagename)]
or {
or {name = 'Sconosciuto', ndex = 0, type1 = 'sconosciuto', type2 = 'sconosciuto'}
name = "Sconosciuto",
ndex = 0,
type1 = "sconosciuto",
type2 = "sconosciuto",
}
pagepoke = multigen.getGen(pagepoke)
 
 
-- Insert the first phase Pokémon box
table.insert(formboxcontent, string.interp(eb.strings.ROW_ONE, {
formboxcontent,
box1 = eb.BoxForm(p.sprite1, p.loc1, p.name1)
txt.interp(eb.strings.ROW_ONE, {
}))
box1 = eb.BoxForm(p.sprite1, p.loc1, p.name1),
})
)
 
-- Adds any form passed as argument
local i = 2
while p['"sprite'" .. tostring(i)] do
table.insert(formboxcontent, eb.makeFormRows(p, i))
i = i + 1
end
 
return stringtxt.interp(eb.strings.BOX_CONTAINER, {
textcolor = cc.forModGradBgLua(pagepoke.type1, pagepoke.type2),
background = css.horizGradLua({ type1 = pagepoke.type1, type2 = pagepoke.type2 },
content type1 = tablepagepoke.concat(formboxcontent)type1,
type2 = pagepoke.type2,
}),
content = table.concat(formboxcontent),
})
end
79 548

contributi