local module = {} local data = require('Module:Pokemon Number/Data') local getArgs = require('Module:Arguments').getArgs function module.main(frame) local args = getArgs(frame) local name = args[1] local text = '' if data['kanto'][name] ~= nil then text = text .. string.format('\n* 关都:%03d %s', data['kanto'][name], '{{ArticleCategory|关都地区宝可梦}}') end if data['johto2'][name] ~= nil then if data['johto'][name] == data['johto2'][name] then text = text .. string.format('\n* 城都:%03d %s', data['johto'][name], '{{ArticleCategory|城都地区宝可梦}}') elseif data['johto'][name] == nil then text = text .. string.format('\n* 城都:%03d (HGSS) %s', data['johto2'][name], '{{ArticleCategory|城都地区宝可梦}}') else text = text .. string.format('\n* 城都:%03d (GSC)/%03d (HGSS) %s', data['johto'][name], data['johto2'][name], '{{ArticleCategory|城都地区宝可梦}}') end end if data['hoenn'][name] ~= nil then if data['hoenn'][name] == data['johto2'][name] then text = text .. string.format('\n* 丰缘:%03d %s', data['hoenn'][name], '{{ArticleCategory|丰缘地区宝可梦}}') elseif data['hoenn'][name] == nil then text = text .. string.format('\n* 丰缘:%03d (ORAS) %s', data['hoenn2'][name], '{{ArticleCategory|丰缘地区宝可梦}}') else text = text .. string.format('\n* 丰缘:%03d (RSE)/%03d (ORAS) %s', data['hoenn'][name], data['hoenn2'][name], '{{ArticleCategory|丰缘地区宝可梦}}') end end if data['sinnoh'][name] ~= nil then text = text .. string.format('\n* 神奥:%03d %s', data['sinnoh'][name], '{{ArticleCategory|神奥地区宝可梦}}') end if data['unova2'][name] ~= nil then if data['unova'][name] == data['unova2'][name] then text = text .. string.format('\n* 合众:%03d %s', data['unova'][name], '{{ArticleCategory|合众地区宝可梦}}') elseif data['unova'][name] == nil then text = text .. string.format('\n* 合众:%03d (B2W2) %s', data['unova2'][name], '{{ArticleCategory|合众地区宝可梦}}') else text = text .. string.format('\n* 合众:%03d (BW)/%03d (B2W2) %s', data['unova'][name], data['unova2'][name], '{{ArticleCategory|合众地区宝可梦}}') end end if data['kalos_central'][name] ~= nil then text = text .. string.format('\n* 卡洛斯:%03d (中央地区) %s', data['kalos_central'][name], '{{ArticleCategory|卡洛斯地区宝可梦}}') end if data['kalos_coastal'][name] ~= nil then text = text .. string.format('\n* 卡洛斯:%03d (海岸地区) %s', data['kalos_coastal'][name], '{{ArticleCategory|卡洛斯地区宝可梦}}') end if data['kalos_mountain'][name] ~= nil then text = text .. string.format('\n* 卡洛斯:%03d (山岳地区) %s', data['kalos_mountain'][name], '{{ArticleCategory|卡洛斯地区宝可梦}}') end if data['alola2'][name] ~= nil then if data['alola'][name] == data['alola2'][name] then text = text .. string.format('\n* 阿罗拉:%03d %s', data['alola'][name], '{{ArticleCategory|阿罗拉地区宝可梦}}') elseif data['alola'][name] == nil then text = text .. string.format('\n* 阿罗拉:%03d (USUM) %s', data['alola2'][name], '{{ArticleCategory|阿罗拉地区宝可梦}}') else text = text .. string.format('\n* 阿罗拉:%03d (SM)/%03d (USUM) %s', data['alola'][name], data['alola2'][name], '{{ArticleCategory|阿罗拉地区宝可梦}}') end end if data['alola2_melemele'][name] ~= nil then if data['alola_melemele'][name] == data['alola2_melemele'][name] then text = text .. string.format('\n** 美乐美乐岛:%03d', data['alola_melemele'][name]) elseif data['alola_melemele'][name] == nil then text = text .. string.format('\n** 美乐美乐岛:%03d (USUM)', data['alola2_melemele'][name]) else text = text .. string.format('\n** 美乐美乐岛:%03d (SM)/%03d (USUM)', data['alola_melemele'][name], data['alola2_melemele'][name]) end end if data['alola2_akala'][name] ~= nil then if data['alola_akala'][name] == data['alola2_akala'][name] then text = text .. string.format('\n** 阿卡拉岛:%03d', data['alola_akala'][name]) elseif data['alola_akala'][name] == nil then text = text .. string.format('\n** 阿卡拉岛:%03d (USUM)', data['alola2_akala'][name]) else text = text .. string.format('\n** 阿卡拉岛:%03d (SM)/%03d (USUM)', data['alola_akala'][name], data['alola2_akala'][name]) end end if data['alola2_ulaula'][name] ~= nil then if data['alola_ulaula'][name] == data['alola2_ulaula'][name] then text = text .. string.format('\n** 乌拉乌拉岛:%03d', data['alola_ulaula'][name]) elseif data['alola_ulaula'][name] == nil then text = text .. string.format('\n** 乌拉乌拉岛:%03d (USUM)', data['alola2_ulaula'][name]) else text = text .. string.format('\n** 乌拉乌拉岛:%03d (SM)/%03d (USUM)', data['alola_ulaula'][name], data['alola2_ulaula'][name]) end end if data['alola2_poni'][name] ~= nil then if data['alola_poni'][name] == data['alola2_poni'][name] then text = text .. string.format('\n** 波尼岛:%03d', data['alola_poni'][name]) elseif data['alola_poni'][name] == nil then text = text .. string.format('\n** 波尼岛:%03d (USUM)', data['alola2_poni'][name]) else text = text .. string.format('\n** 波尼岛:%03d (SM)/%03d (USUM)', data['alola_poni'][name], data['alola2_poni'][name]) end end if data['galar'][name] ~= nil then text = text .. string.format('\n* 伽勒尔:%03d %s', data['galar'][name], '{{ArticleCategory|伽勒尔地区宝可梦}}') if data['armor'][name] ~= nil then text = text .. string.format('\n** 铠岛:%03d', data['armor'][name]) end if data['crown'][name] ~= nil then text = text .. string.format('\n** 王冠雪原:%03d', data['crown'][name]) end elseif data['armor'][name] ~= nil then if data['crown'][name] ~= nil then text = text .. string.format('\n* 伽勒尔: %s', '{{ArticleCategory|伽勒尔地区宝可梦}}') text = text .. string.format('\n** 铠岛:%03d', data['armor'][name]) text = text .. string.format('\n** 王冠雪原:%03d', data['crown'][name]) else text = text .. string.format('\n* 伽勒尔-铠岛:%03d %s', data['armor'][name], '{{ArticleCategory|伽勒尔地区宝可梦}}') end elseif data['crown'][name] ~= nil then text = text .. string.format('\n* 伽勒尔-王冠雪原:%03d %s', data['crown'][name], '{{ArticleCategory|伽勒尔地区宝可梦}}') end if data['hisui'][name] ~= nil then text = text .. string.format('\n* 洗翠:%03d %s', data['hisui'][name], '{{ArticleCategory|洗翠地区宝可梦}}') end if data['paldea'][name] ~= nil then text = text .. string.format('\n* 帕底亚:%03d %s', data['paldea'][name], '{{ArticleCategory|帕底亚地区宝可梦}}') end if data['kitakami'][name] ~= nil then text = text .. string.format('\n* 北上:%03d %s', data['kitakami'][name], '{{ArticleCategory|北上乡宝可梦}}') end if data['blueberry'][name] ~= nil then text = text .. string.format('\n* 蓝莓:%03d %s', data['blueberry'][name], '{{ArticleCategory|蓝莓学园宝可梦}}') end if text == '' then text = '<center>不在地区图鉴中 {{ArticleCategory|不在地区图鉴中的宝可梦}}</center>' end return frame:preprocess(text) end return module