Module:Pokemon/Fishing

local getArgs = require('Module:Arguments').getArgs

local p = {}

function p.row( frame ) local args = getArgs( frame, { wrappers = 'Template:Pokemon/Fishing row' } ) local pokedex = mw.loadJsonData( 'Module:Pokemon/Pokedex.json' ) local game = args[1] or 'red' local monNum = args[2] or '001' local level = args[3] or 'n/a' local rates = {}

for i = 1, 3 do		rate = args[3 + i] or '' if rate ~= '' then rates[i] = rate .. "%"		end end if tonumber(monNum) >= 100 then monNum = tonumber(monNum) end local monName = pokedex[monNum] local bpLink = monName

if args['bp'] then bpLink = frame:expandTemplate{ title = 'bp', args = { monName } } end local row = { "|-\n", '| class="t_pkmn_wild_img" | ', '', '\n', '| class="t_pkmn_wild_name" | ', bpLink, '\n', '| ', level, '\n', '| ', table.concat(rates, ' || ') }

return table.concat( row ) end

return p