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

Vai alla navigazione Vai alla ricerca
Added getAbile and getStat
(Adding gradientTypes)
(Added getAbile and getStat)
local pokes
local abils
local stats
local forms
 
 
--]]
local loadData = function(tab, moduleName, useRequire)
if not tab then
local loadFunction = useRequire and require orreturn mw.loadData('Modulo:' .. moduleName)
return loadFunction('Modulo:' .. moduleName)
end
return tab
 
Returns a Pokémon's hidden ability given its name or ndex. If the Pokémon
has no secondhidden ability, it returns an empty string. An optional 'gen'
parameter specifies the generation.
 
 
b.get_abil_d, b.get_abil_h, b.get_abil_n = b.getAbild, b.getAbild, b.getAbild
 
--[[
 
Returns a Pokémon's event ability given its name or ndex. If the Pokémon
has no event ability, it returns an empty string. An optional 'gen'
parameter specifies the generation.
 
Ex:
{{#invoke: PokémonData | getAbile | 487O }} --> (empty string)
{{#invoke: PokémonData | getAbile | 744 }} --> Mente Locale
 
--]]
b.getAbile = function(frame)
return getAbil(frame.args[1], 'e', frame.args.gen)
end
 
b.get_abil_e = b.getAbile
 
 
end
b.grad_types = b.gradTypes
 
 
--[[
 
Returns a Pokémon's stats (specified by the second parameter) given its name or
ndex. The optional third parameter is the generation.
If the Pokémon doesn't have the stat (i.e: stat "spec" of a non gen 1 Pokémon)
return an empty string.
 
Ex:
{{#invoke: PokémonData | getStat | 398 | hp }} --> 85
{{#invoke: PokémonData | getStat | 65 | spatk }} --> 135
{{#invoke: PokémonData | getStat | 487O | def }} --> 100
{{#invoke: PokémonData | getStat | 189 | spdef | gen = 2 }} --> 85
 
--]]
b.getStat = function(frame)
stats = loadData(stats, 'PokéStats/data')
return multigen.getGenValue(
stats[formlib.nameToDataindex(frame.args[1])][frame.args[2]:trim()],
tonumber(frame.args.gen)
)
end
 
 
--[[
return table.concat(result, ',')
end
 
 
return b

Menu di navigazione