16 404
contributi
(Bugfix with alternate forms) |
(Added interfaces, types returned with first uppercase) |
||
b.getName = function(frame)
data = loadData(data, 'Poké/data')
return data[tonumber(ndex) or ndex].name
end
b.get_name = b.getName
--[[
Return the form name given ndex with abbr. If the ndex is without abbr, returns
the Pokémon name even if it hasn't got alternate forms.
--]]
local name, abbr = form.getnameabbr(string.trim(frame.args[1]))
return forms[name] and forms[name].names[abbr] or b.getName{args={name}}
end
--[[
local getType = function(name, typeNumber)
data = loadData(data, 'Poké/data')
return string.fu(data[form.nameToDataindex(name)]['type' .. typeNumber])
end
--[[
The first parameter is an ndex (maybe with an abbr). Returns the second
Frontend for wikilib/forms.getlink: returns the link▼
parameter if the Pokémon has two types, otherwise the third. The two last
parameters are trimmed.
This function is meant to replace an #if parser function to check whether a
Pokémon has two types or not.
or a ndex followed by the form abbreviation, the second▼
argument is a flag to get black or normal link▼
--]]
b.ifTwoTypes = function(frame)
data = loadData(data, 'Poké/data')
local poke = data[form.nameToDataindex(frame.args[1])]
local isDualType = poke.type1 == poke.type2
return isDualType and string.trim(frame.args[2]) or string.trim(frame.args[3])
end
▲b.getLink = function(frame)
▲ forms = loadData(forms, 'Wikilib/forms', true)
--[[
▲Frontend for wikilib/forms.getlink: returns the link to an'alternate form from
module AltForms/data or UselessForms/data. The Pokémon name (first argument)
--]]
b.getLink = function(frame)
local name, black = string.trim(frame.args[1]), string.trim(frame.args[2])
local link =
if link ~= '' then
return link
else
return
end
end
|