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

Fixing the fix of link of PrevNext in Pokémon subpages *** sovrascritto il testo esistente ***
m (Damn MediaWiki)
(Fixing the fix of link of PrevNext in Pokémon subpages *** sovrascritto il testo esistente ***)
--[[
 
Parse the input data when it's a Pokémon name.
 
 
--]]
Ex:
{{#invoke: PokémonData | getType2 | 398 }} --> Volante
{{#invoke: PokémonData | getType2 | Staraptor }} --> Volante
{{#invoke: PokémonData | getType2 | 65 }} --> Psico
{{#invoke: PokémonData | getType2 | 479L }} --> Acqua
Ex:
{{#invoke: PokémonData | gradTypes | 398 }} --> normale-volante
{{#invoke: PokémonData | gradTypes | Staraptor }} --> normale-volante
{{#invoke: PokémonData | gradTypes | 65 }} --> psico-psico
{{#invoke: PokémonData | gradTypes | 479L }} --> elettro-acqua
Ex:
{{#invoke: PokémonData | getStat | 398 | hp }} --> 85
{{#invoke: PokémonData | getStat | Staraptor | hp }} --> 85
{{#invoke: PokémonData | getStat | 65 | spatk }} --> 135
{{#invoke: PokémonData | getStat | 487O | def }} --> 100
 
b.getlink = b.getLink
 
--[[
 
Returns the link to an alternative form, without the surrounding div.
The Pokémon name (first parameter) can be both a name or a ndex followed
by the abbr.
The ndex may be the base form's one. If the ndex doesn't correspond to a
Pokémon with alternative forms, it returns an empty string.
 
Ex:
{{#invoke: PokémonData | getPlainLink | 487 }}
{{#invoke: PokémonData | getPlainLink | 487O }}
{{#invoke: PokémonData | getPlainLink | 028A }}
{{#invoke: PokémonData | getPlainLink | 028 }}
{{#invoke: PokémonData | getPlainLink | 774R }}
{{#invoke: PokémonData | getPlainLink | 398 }}
 
--]]
b.getPlainLink = function(frame)
local name, black = string.trim(frame.args[1]), frame.args[2]
-- Links also to UselessForms
formlib.loadUseless(true)
local divlink = formlib.getLink(name, black)
return divlink:match("%[%[[^]]+%]%]") or ""
end
 
b.getplainlink = b.getPlainLink
 
--[[
79 547

contributi