Differenze tra le versioni di "Modulo:PokémonData"

Vai alla navigazione Vai alla ricerca
Internal updates *** sovrascritto il testo esistente ***
(Quick fix *** sovrascritto il testo esistente ***)
(Internal updates *** sovrascritto il testo esistente ***)
-- stylua: ignore end
 
--[[
-- Parse the input data.
 
local function parseName(name, abbr)
Given the frame.args, find out which Pokémon the caller wants, and return a
local abbr = abbr and txt.trim(abbr)
value to index data module to get that Pokémon.
return formlib.nameToDataindex(mw.text.decode(name), abbr)
 
Inspects the first argument, which should be either the name or the ndex (the
latter possibly with an abbr), and the 'form' named argument, which can specify
the abbr when the first parameter is the name.
 
--]]
local function parseName(name, abbrargs)
local p = wlib.trimAll(args)
return formlib.nameToDataindex(mw.text.decode(namep[1]), abbrp.form)
end
 
b.getNdex = function(frame)
local pokes = mw.loadData('Modulo:Poké/data')
return txt.ff(pokes[parseName(frame.args[1], frame.args.form)].ndex)
end
b.get_ndex = b.getNdex
b.getName = function(frame)
local pokes = mw.loadData('Modulo:Poké/data')
return pokes[parseName(frame.args[1], frame.args.form)].name
end
b.get_name = b.getName
local abils = mw.loadData('Modulo:PokéAbil/data')
return multigen.getGenValue(
abils[parseName(frame.args[1], frame.args.form)]["ability" .. abilityNumber] or "",
or "",
tonumber(gen)
)
return txt.fu(
multigen.getGenValue(
pokes[parseName(p[1], p.form)]["type" .. typeNumber],
tonumber(p.gen)
)
local stat = txt.trim(frame.args[2])
return multigen.getGenValue(
stats[parseName(frame.args[1], frame.args.form)][stat],
tonumber(frame.args.gen)
)
b.ifTwoTypes = function(frame)
local pokes = mw.loadData('Modulo:Poké/data')
local poke = pokes[parseName(frame.args[1], frame.args.form)]
local isDualType = poke.type1 == poke.type2
return isDualType and txt.trim(frame.args[2]) or txt.trim(frame.args[3])
-- Links also to UselessForms
formlib.loadUseless(true)
return formlib.getLinkgetlink(name, black, abbr)
end
b.getlink = b.getLink
79 548

contributi

Menu di navigazione