Module:Infobox Pokémon/test
Aller à la navigation
Aller à la recherche
Ce module est une version test du Module:Infobox Pokémon.
local p = {} function separate_thousands(amount) local formatted = amount while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1 %2') if (k==0) then break end end return formatted end -- remplace le point des decimales par une virgule dans une chaine, et ajoute une décimale quand il n'y en a pas function decimal_dot_to_comma(str) if string.find(str, '%.') then return string.gsub(str,'%.',',') else return str .. ',0' end end -- convertit en nombre de pieds function meters_to_feet_and_inches(str) local conversion = (tonumber(str) * 3.2808) return {feet = math.floor(conversion + 1/24), inches = math.floor((conversion - math.floor(conversion + 1/24)) * 12 + 0.5)} end -- convertit en nombre de livres function kg_to_pounds(str) return math.floor((tonumber(str) * 2.2046)*10+0.5)/10 end function nil_to_string(str) if str == nil then return '' else return str end end function association_region(frame, region) -- Jeux principaux if region == 'Kanto' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Kanto|Kanto]]" elseif region == 'Kanto-LGPE' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Kanto|Kanto]]" .. frame:expandTemplate{title='Sup', args={'LGPE'}} elseif region == 'Johto' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Johto|Johto]]" .. frame:expandTemplate{title='Sup', args={'OAC'}} elseif region == 'Johto-HGSS' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Johto (Pokémon Or HeartGold et Argent SoulSilver)|Johto]]" .. frame:expandTemplate{title='Sup', args={'HGSS'}} elseif region == 'Hoenn' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Hoenn|Hoenn]]" .. frame:expandTemplate{title='Sup', args={'RSE'}} elseif region == 'Hoenn-ROSA' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Hoenn (Pokémon Rubis Oméga et Saphir Alpha)|Hoenn]]" .. frame:expandTemplate{title='Sup', args={'ROSA'}} elseif region == 'Sinnoh' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Sinnoh|Sinnoh]]" elseif region == 'Sinnoh-Pt' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Sinnoh|Sinnoh]]" .. frame:expandTemplate{title='Sup', args={'Pt'}} elseif region == 'Unys' then return "[[Liste des Pokémon dans l'ordre du Pokédex d'Unys|Unys]]" .. frame:expandTemplate{title='Sup', args={'NB'}} elseif region == 'Unys-NB2' then return "[[Liste des Pokémon dans l'ordre du Pokédex d'Unys (Pokémon Noir 2 et Blanc 2)|Unys]]" .. frame:expandTemplate{title='Sup', args={'NB2'}} elseif region == 'Kalos (Centre)' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Kalos|Kalos]]<br/><small><b>(Centre)</b></small>" elseif region == 'Kalos (Côtes)' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Kalos|Kalos]]<br/><small><b>(Côtes)</b></small>" elseif region == 'Kalos (Monts)' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Kalos|Kalos]]<br/><small><b>(Monts)</b></small>" elseif region == 'Alola' then return "[[Liste des Pokémon dans l'ordre du Pokédex d'Alola|Alola]]" .. frame:expandTemplate{title='Sup', args={'SL'}} elseif region == 'Alola-USUL' then return "[[Liste des Pokémon dans l'ordre du Pokédex d'Alola (Pokémon Ultra-Soleil et Ultra-Lune)|Alola]]" .. frame:expandTemplate{title='Sup', args={'USUL'}} elseif region == 'Galar' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Galar|Galar]]" elseif region == 'Isolarmure' then return "[[Liste des Pokémon dans l'ordre du Pokédex d'Isolarmure|Isolarmure]]" elseif region == 'Couronneige' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Couronneige|Couronneige]]" elseif region == 'Hisui' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Hisui|Hisui]]" elseif region == 'Paldea' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Paldea|Paldea]]" -- Jeux secondaires elseif region == 'Fiore' then return "[[Liste des Pokémon dans l'ordre du Navigateur de Fiore|Fiore]]" elseif region == 'Almia' then return "[[Liste des Pokémon dans l'ordre du Navigateur d'Almia|Almia]]" elseif region == 'Oblivia (Présent)' then return "[[Liste des Pokémon dans l'ordre du Navigateur d'Oblivia (Présent)|Oblivia]]<br/><small><b>(Présent)</b></small>" elseif region == 'Oblivia (Passé)' then return "[[Liste des Pokémon dans l'ordre du Navigateur d'Oblivia (Passé)|Oblivia]]<br/><small><b>(Passé)</b></small>" elseif region == 'Ransei' then return "[[Liste des Pokémon de la région de Ransei|Ransei]]" elseif region == 'Ransei (Reshiram)' then return "[[Liste des Pokémon de la région de Ransei|Ransei]]<br/><small><b>(DLC Reshiram)</b></small>" elseif region == 'PokéPark' then return "[[Liste des Pokémon de PokéPark Wii : La Grande Aventure de Pikachu|PokéPark]]" elseif region == 'PokéPark 2' then return "[[Liste des Pokémon de PokéPark 2 : Le Monde des Vœux|PokéPark 2]]" elseif region == 'Google Maps' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Google Maps: Pokémon Challenge|Google Maps:<br/><small>Pokémon Challenge]]</small>" elseif region == 'Shuffle' then return "[[Liste des Pokémon dans l'ordre du Pokédex de Pokémon Shuffle|Shuffle]]" elseif region == 'Picross' then return "[[Liste des niveaux de Pokémon Picross|Picross]]" elseif region == 'Picross (Alternatif)' then return "[[Liste des niveaux de Pokémon Picross|Picross]]<br/><small><b>(Alternatif)</b></small>" elseif region == 'Lentis' then return "[[Liste des Pokémon dans l'ordre du Photodex|Lentis]]" else return '<i>' .. region .. '</i>' end end function Set (list) local set = {} for _, l in ipairs(list) do set[l] = true end return set end local regions_navigateur = Set {'Fiore', 'Almia', 'Oblivia (Présent)', 'Oblivia (Passé)'} function p.infobox(frame) local resultat = {} local debug_mode = frame.args['debug'] debug_mode = (debug_mode == "oui") local nom = frame.args['nom'] if nom == nil or nom == '' then nom = frame:getParent():getTitle() end local nom_anglais = frame.args['nom-anglais'] if nom_anglais == nil or nom_anglais == '' then nom_anglais = '<i>Information manquante</i>' end local nom_japonais = frame.args['nom-japonais'] local nom_romaji = frame.args['nom-romaji'] local nom_depose = frame.args['nom-déposé'] if nom_depose == nil or nom_depose == '' then if not (nom_romaji == nil or nom_romaji == '') then nom_depose = nom_romaji nom_romaji = '' end end local artwork = frame.args['artwork'] if artwork == nil or artwork == '' then artwork = nom end artwork = mw.text.split(artwork, "/") local forme_principale = frame.args['forme-principale'] local legende = frame.args['légende'] local type1 = frame.args['type1'] if type1 == nil or type1 == '' then type1 = "inconnu" end type1 = mw.text.split(type1, "/") local type2 = frame.args['type2'] if type2 == '' or type2 == '-' or type2 == nil then type2 = {} else type2 = mw.text.split(type2, "/") end --on accepte que type2 soit nil local switch_artworks = frame.args['switch-artworks'] == 'oui' local ndex = frame.args['ndex'] if ndex == nil or ndex == '' then ndex = "—" end local dex = frame.args['dex'] local dex_secondaires = frame.args['dex-secondaires'] local donnees = frame.args['données'] donnees = donnees ~= 'non' local donnee_semantique_ndex = frame.args['donnée-sémantique-ndex'] donnee_semantique_ndex = donnee_semantique_ndex ~= 'non' local categories_wiki = frame.args['catégories-wiki'] if categories_wiki then categories_wiki = categories_wiki ~= 'non' else local namespace = frame:preprocess("{{NAMESPACENUMBER}}") categories_wiki = (tonumber(namespace) == 0) end local categorisation_plusieurs_formes = frame.args['catégorisation-plusieurs-formes'] categorisation_plusieurs_formes = categorisation_plusieurs_formes ~= 'non' local generation = frame.args['génération'] generation = tonumber(generation) if generation == nil then local ndex_int = tonumber(ndex) if ndex_int then if ndex_int <= 151 then generation = 1 elseif ndex_int <= 251 then generation = 2 elseif ndex_int <= 386 then generation = 3 elseif ndex_int <= 493 then generation = 4 elseif ndex_int <= 649 then generation = 5 elseif ndex_int <= 721 then generation = 6 elseif ndex_int <= 809 then generation = 7 elseif ndex_int <= 905 then generation = 8 else generation = 9 end else generation = 9 end end -- Calcul automatique du nombre de formes et changement optionnel automatique d'artworks local nombre_formes = 1 local couleur_principale local couleur_secondaire = nil while artwork[nombre_formes + 1] do nombre_formes = nombre_formes + 1 end if nombre_formes > 1 and categories_wiki and categorisation_plusieurs_formes then table.insert(resultat, '[[Catégorie:Pokémon à plusieurs formes]]') end if tonumber(forme_principale) and nombre_formes >= tonumber(forme_principale) then forme_principale = tonumber(forme_principale) elseif nombre_formes > 1 and switch_artworks then forme_principale = (math.floor(os.time()) % nombre_formes) + 1 else forme_principale = 1 end if forme_principale > 1 then if type1[forme_principale] then couleur_principale = type1[forme_principale] else couleur_principale = type1[1] end if type2 ~= {} then if type2[forme_principale] ~= nil and type2[forme_principale] ~= '' and type2[forme_principale] ~= '-' then couleur_secondaire = type2[forme_principale] elseif type2[forme_principale] == nil then if type2[1] == '' or type2[1] == '-' then couleur_secondaire = nil else couleur_secondaire = type2[1] end else couleur_secondaire = nil end end if forme_principale > 1 then for i = forme_principale, 2, -1 do artwork[i], artwork[i-1] = artwork[i-1], artwork[i] end end else couleur_principale = type1[1] couleur_secondaire = type2[1] end if couleur_principale == "inconnu" then couleur_principale = "" end if couleur_secondaire == "inconnu" then couleur_secondaire = "" end if couleur_secondaire ~= nil then couleur_secondaire = frame:expandTemplate{title='Couleur', args={couleur_secondaire}} end -- Conditions de forme local conditions = frame.args['conditions'] if conditions == nil then conditions = '' end conditions = mw.text.split(conditions, "/") local conditions_type = frame.args['conditions-type'] if conditions_type == nil then conditions_type = '' end conditions_type = mw.text.split(conditions_type, "/") local conditions_categorie = frame.args['conditions-espèce'] -- deprecated local conditions_categorie = frame.args['conditions-catégorie'] if conditions_categorie == nil then conditions_categorie = conditions_categorie end if conditions_categorie == nil then conditions_categorie = '' end conditions_categorie = mw.text.split(conditions_categorie, "/") local conditions_taille = frame.args['conditions-taille'] if conditions_taille == nil then conditions_taille = '' end conditions_taille = mw.text.split(conditions_taille, "/") local conditions_poids = frame.args['conditions-poids'] if conditions_poids == nil then conditions_poids = '' end conditions_poids = mw.text.split(conditions_poids, "/") local conditions_talents = frame.args['conditions-talents'] if conditions_talents == nil then conditions_talents = '' end conditions_talents = mw.text.split(conditions_talents, "/") local conditions_oeufpas = frame.args['conditions-oeufpas'] if conditions_oeufpas == nil then conditions_oeufpas = '' end conditions_oeufpas = mw.text.split(conditions_oeufpas, "/") local conditions_effortval = frame.args['conditions-effortval'] if conditions_effortval == nil then conditions_effortval = '' end conditions_effortval = mw.text.split(conditions_effortval, "/") local conditions_fmratio = frame.args['conditions-fmratio'] if conditions_fmratio == nil then conditions_fmratio = '' end conditions_fmratio = mw.text.split(conditions_fmratio, "/") local conditions_couleur = frame.args['conditions-couleur'] if conditions_couleur == nil then conditions_couleur = '' end conditions_couleur = mw.text.split(conditions_couleur, "/") local conditions_captureval = frame.args['conditions-captureval'] if conditions_captureval == nil then conditions_captureval = '' end conditions_captureval = mw.text.split(conditions_captureval, "/") local conditions_corps = frame.args['conditions-corps'] if conditions_corps == nil then conditions_corps = '' end conditions_corps = mw.text.split(conditions_corps, "/") local conditions_cri = frame.args['conditions-cri'] if conditions_cri == nil then conditions_cri = '' end conditions_cri = mw.text.split(conditions_cri, "/") local i = 1 while conditions[i] do if conditions_categorie[i] == nil or conditions_categorie[i] == '' then conditions_categorie[i] = conditions[i] end if conditions_taille[i] == nil or conditions_taille[i] == '' then conditions_taille[i] = conditions[i] end if conditions_poids[i] == nil or conditions_poids[i] == '' then conditions_poids[i] = conditions[i] end if conditions_talents[i] == nil or conditions_talents[i] == '' then conditions_talents[i] = conditions[i] end if conditions_oeufpas[i] == nil or conditions_oeufpas[i] == '' then conditions_oeufpas[i] = conditions[i] end if conditions_effortval[i] == nil or conditions_effortval[i] == '' then conditions_effortval[i] = conditions[i] end if conditions_fmratio[i] == nil or conditions_fmratio[i] == '' then conditions_fmratio[i] = conditions[i] end if conditions_couleur[i] == nil or conditions_couleur[i] == '' then conditions_couleur[i] = conditions[i] end if conditions_captureval[i] == nil or conditions_captureval[i] == '' then conditions_captureval[i] = conditions[i] end if conditions_corps[i] == nil or conditions_corps[i] == '' then conditions_corps[i] = conditions[i] end if conditions_corps[i] == nil or conditions_corps[i] == '' then conditions_corps[i] = conditions[i] end if conditions_cri[i] == nil or conditions_cri[i] == '' then conditions_cri[i] = conditions[i] end i = i + 1 end local espece = frame.args['espèce'] -- deprecated local categorie = frame.args['catégorie'] if categorie == nil then categorie = espece end local taille = frame.args['taille'] local poids = frame.args['poids'] local talents = frame.args['talents'] local groupeoeuf1 = frame.args['groupeoeuf1'] local groupeoeuf1diff = frame.args['groupeoeuf1diff'] local groupeoeuf2 = frame.args['groupeoeuf2'] local groupeoeuf2diff = frame.args['groupeoeuf2diff'] local oeufpas = frame.args['oeufpas'] local effortval = frame.args['effortval'] local expval = frame.args['expval'] local expvaldiff = frame.args['expvaldiff'] local expmax = frame.args['expmax'] local fmratio = frame.args['fmratio'] local couleur = frame.args['couleur'] local captureval = frame.args['captureval'] local empreinte = frame.args['empreinte'] local forme = frame.args['forme'] -- deprecated local corps = frame.args['corps'] if corps == nil then corps = forme end local cri = frame.args['cri'] -- EN-TÊTE table.insert(resultat, '<table class="tableaustandard ficheinfo ' .. mw.ustring.lower(couleur_principale) .. '"><thead><tr><th class="entêtesection"') if couleur_secondaire ~= nil then table.insert(resultat, ' style="background: ' .. couleur_secondaire .. ' !important"') end table.insert(resultat, '><big><span class="explain" title="Numérotation nationale">№ ') if ndex ~= "—" and donnee_semantique_ndex and donnees then table.insert(resultat, '[[Numéro National::' .. ndex .. ']]') else table.insert(resultat, ndex) end table.insert(resultat, '</span></big></th><th class="entêtesection" colspan="3">' .. nom .. '</th></thead>') -- ARTWORK table.insert(resultat, '<tbody><tr><td class="illustration" colspan="4">[[Fichier:' .. artwork[1] .. '.png|250px]]') local i = 2 while artwork[i] and artwork[i+1] and artwork[i+2] and artwork[i+3] and artwork[i+4] do table.insert(resultat, '<br/><br/>[[Fichier:' .. artwork[i] .. '.png|80px]] [[Fichier:' .. artwork[i+1] .. '.png|80px]] [[Fichier:' .. artwork[i+2] .. '.png|80px]]') i = i + 3 end if artwork[i] and artwork[i+1] and artwork[i+2] and artwork[i+3] then table.insert(resultat, '<br/><br/>[[Fichier:' .. artwork[i] .. '.png|120px]] [[Fichier:' .. artwork[i+1] .. '.png|120px]]<br/><br/>[[Fichier:' .. artwork[i+2] .. '.png|120px]] [[Fichier:' .. artwork[i+3] .. '.png|120px]]') elseif artwork[i] and artwork[i+1] and artwork[i+2] then table.insert(resultat, '<br/><br/>[[Fichier:' .. artwork[i] .. '.png|80px]] [[Fichier:' .. artwork[i+1] .. '.png|80px]] [[Fichier:' .. artwork[i+2] .. '.png|80px]]') elseif artwork[i] and artwork[i+1] then table.insert(resultat, '<br/><br/>[[Fichier:' .. artwork[i] .. '.png|120px]] [[Fichier:' .. artwork[i+1] .. '.png|120px]]') elseif artwork[i] then table.insert(resultat, '<br/><br/>[[Fichier:' .. artwork[i] .. '.png|150px]]') end if legende ~= nil then table.insert(resultat, '<br/><small>' .. legende .. '</small>') end table.insert(resultat, '</td></tr>') -- NOM JAPONAIS table.insert(resultat, '<tr><th>Nom japonais</th><td colspan="3">') if nom_japonais ~= nil then if nom_romaji ~= nil and nom_romaji ~= '' and nom_romaji ~= nom_depose then table.insert(resultat, frame:expandTemplate{title='Furigana', args={nom_japonais, nom_romaji}}) else table.insert(resultat, '<span lang="ja">' .. nom_japonais ..'</span>') end end if nom_depose ~= nil and nom_depose ~= '' then table.insert(resultat, ' <br/><span title="Nom déposé officiel"><i>' .. nom_depose .. '</i></span>') end table.insert(resultat, '</td></tr>') -- NOM ANGLAIS table.insert(resultat, '<tr><th>Nom anglais</th><td colspan="3">' .. nom_anglais .. '</td></tr>') -- NUMÉROS DE POKÉDEX table.insert(resultat, '<tr><th colspan="4" style="text-align:center">[[Liste des Pokémon dans l\'ordre du Pokédex National|Numéros de Pokédex]] régionaux</th></tr>') if dex == nil or dex == '' then table.insert(resultat, '<tr><td colspan="4" style="text-align:center"><i>Ce Pokémon n\'apparaît dans aucun Pokédex régional.</i></td></tr>') else if dex ~= nil and dex ~= '' then table.insert(resultat, '<tr><td colspan="4" style="padding:0px;"><table style="width:100%;text-align:center;background-color:white;border-radius:3px;">') -- on fait une sous-table pour les dex dex = mw.text.split(dex, "//") local i = 1 local infos_region1 = {} local infos_region2 = {} local infos_region3 = {} local infos_region4 = {} while dex[i] and dex[i+1] and dex[i+2] and dex[i+3] do -- on regroupe les régions par 4 jusqu'à ce qu'il en reste moins que 4 infos_region1 = mw.text.split(dex[i], "/") infos_region2 = mw.text.split(dex[i+1], "/") infos_region3 = mw.text.split(dex[i+2], "/") infos_region4 = mw.text.split(dex[i+3], "/") table.insert(resultat, '<tr>') table.insert(resultat, '<td style="line-height:8pt;width:25%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region1[1]) .. '</strong></small></em></td>') table.insert(resultat, '<td style="line-height:8pt;width:25%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region2[1]) .. '</strong></small></em></td>') table.insert(resultat, '<td style="line-height:8pt;width:25%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region3[1]) .. '</strong></small></em></td>') table.insert(resultat, '<td style="line-height:8pt;width:25%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region4[1]) .. '</strong></small></em></td>') table.insert(resultat, '</tr><tr>') if infos_region1[2] ~= nil then table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">' .. infos_region1[2]) if infos_region1[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region1[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">—</td>') end if infos_region2[2] ~= nil then table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">' .. infos_region2[2]) if infos_region2[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region2[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">—</td>') end if infos_region3[2] ~= nil then table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">' .. infos_region3[2]) if infos_region3[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region3[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">—</td>') end if infos_region4[2] ~= nil then table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">' .. infos_region4[2]) if infos_region4[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region4[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">—</td>') end table.insert(resultat, '</tr>') i = i + 4 end if dex[i] and dex[i+1] and dex[i+2] -- il ne reste plus que 3 régions then local infos_region1 = mw.text.split(dex[i], "/") local infos_region2 = mw.text.split(dex[i+1], "/") local infos_region3 = mw.text.split(dex[i+2], "/") table.insert(resultat, '<td style="line-height:8pt;width:25%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region1[1]) .. '</strong></small></em></td>') table.insert(resultat, '<td colspan="2" style="line-height:8pt;width:50%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region2[1]) .. '</strong></small></em></td>') table.insert(resultat, '<td style="line-height:8pt;width:25%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region3[1]) .. '</strong></small></em></td>') table.insert(resultat, '</tr><tr>') if infos_region1[2] ~= nil then table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">' .. infos_region1[2]) if infos_region1[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region1[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">—</td>') end if infos_region2[2] ~= nil then table.insert(resultat, '<td colspan="2" style="line-height:10pt;padding: 2px;">' .. infos_region2[2]) if infos_region2[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region2[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td colspan="2" style="line-height:10pt;padding: 2px;">—</td>') end if infos_region3[2] ~= nil then table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">' .. infos_region3[2]) if infos_region3[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region3[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">—</td>') end table.insert(resultat, '</tr>') elseif dex[i] and dex[i+1] -- il ne reste plus que 2 régions then local infos_region1 = mw.text.split(dex[i], "/") local infos_region2 = mw.text.split(dex[i+1], "/") table.insert(resultat, '<td colspan="2" style="line-height:8pt;width:50%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region1[1]) .. '</strong></small></em></td>') table.insert(resultat, '<td colspan="2" style="line-height:8pt;width:50%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region2[1]) .. '</strong></small></em></td>') table.insert(resultat, '</tr><tr>') if infos_region1[2] ~= nil then table.insert(resultat, '<td colspan="2" style="line-height:10pt;padding: 2px;">' .. infos_region1[2]) if infos_region1[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region1[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td colspan="2" style="line-height:10pt;padding: 2px;">—</td>') end if infos_region2[2] ~= nil then table.insert(resultat, '<td colspan="2" style="line-height:10pt;padding: 2px;">' .. infos_region2[2]) if infos_region2[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region2[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td colspan="2" style="line-height:10pt;padding: 2px;">—</td>') end table.insert(resultat, '</tr>') elseif dex[i] -- il ne reste plus qu'1 région then local infos_region1 = mw.text.split(dex[i], "/") table.insert(resultat, '<tr><td colspan="4" style="line-height:8pt;width:100%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region1[1]) .. '</strong></small></em></td></tr><tr><td colspan="4" style="line-height:10pt;padding: 2px;">') if infos_region1[2] ~= nil then table.insert(resultat, infos_region1[2]) if infos_region1[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region1[3] .. '">*</span>') end table.insert(resultat, '</td></tr>') else table.insert(resultat, '—</td></tr>') end end table.insert(resultat, '</table></td></tr>') end dex = nil end -- meme chose pour les dex_secondaires : copier/coller en remplacant dex par dex_secondaires if dex_secondaires ~= nil and dex_secondaires ~= '' then dex_secondaires = mw.text.split(dex_secondaires, "//") table.insert(resultat, '<tr><th colspan="4" style="text-align:center">') local i = 1 local region_avec_navigateur = false local region_sans_navigateur = false while dex_secondaires[i] do local b = false infos_region = mw.text.split(dex_secondaires[i], "/") if regions_navigateur[infos_region[1]] then region_avec_navigateur = true else region_sans_navigateur = true end i = i + 1 end if region_avec_navigateur then if region_sans_navigateur then table.insert(resultat, '[[Capstick#Autres fonctions|Navigateurs]] et autres numérotations') else table.insert(resultat, '[[Capstick#Autres fonctions|Navigateurs]]') end else table.insert(resultat, 'Autres numérotations') end table.insert(resultat, '</th></tr><tr><td colspan="4" style="padding:0px;"><table style="width:100%;text-align:center;background-color:white;border-radius:3px;">') -- on fait une sous-table pour les dex_secondaires local i = 1 local infos_region1 = {} local infos_region2 = {} local infos_region3 = {} local infos_region4 = {} while dex_secondaires[i] and dex_secondaires[i+1] and dex_secondaires[i+2] and dex_secondaires[i+3] do infos_region1 = mw.text.split(dex_secondaires[i], "/") infos_region2 = mw.text.split(dex_secondaires[i+1], "/") infos_region3 = mw.text.split(dex_secondaires[i+2], "/") infos_region4 = mw.text.split(dex_secondaires[i+3], "/") table.insert(resultat, '<tr>') table.insert(resultat, '<td style="line-height:8pt;width:25%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region1[1]) .. '</strong></small></em></td>') table.insert(resultat, '<td style="line-height:8pt;width:25%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region2[1]) .. '</strong></small></em></td>') table.insert(resultat, '<td style="line-height:8pt;width:25%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region3[1]) .. '</strong></small></em></td>') table.insert(resultat, '<td style="line-height:8pt;width:25%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region4[1]) .. '</strong></small></em></td>') table.insert(resultat, '</tr><tr>') if infos_region1[2] ~= nil then table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">' .. infos_region1[2]) if infos_region1[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region1[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">—</td>') end if infos_region2[2] ~= nil then table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">' .. infos_region2[2]) if infos_region2[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region2[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">—</td>') end if infos_region3[2] ~= nil then table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">' .. infos_region3[2]) if infos_region3[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region3[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">—</td>') end if infos_region4[2] ~= nil then table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">' .. infos_region4[2]) if infos_region4[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region4[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">—</td>') end table.insert(resultat, '</tr>') i = i + 4 end if dex_secondaires[i] and dex_secondaires[i+1] and dex_secondaires[i+2] -- il ne reste plus que 3 régions then local infos_region1 = mw.text.split(dex_secondaires[i], "/") local infos_region2 = mw.text.split(dex_secondaires[i+1], "/") local infos_region3 = mw.text.split(dex_secondaires[i+2], "/") table.insert(resultat, '<td style="line-height:8pt;width:25%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region1[1]) .. '</strong></small></em></td>') table.insert(resultat, '<td colspan="2" style="line-height:8pt;width:50%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region2[1]) .. '</strong></small></em></td>') table.insert(resultat, '<td style="line-height:8pt;width:25%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region3[1]) .. '</strong></small></em></td>') table.insert(resultat, '</tr><tr>') if infos_region1[2] ~= nil then table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">' .. infos_region1[2]) if infos_region1[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region1[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">—</td>') end if infos_region2[2] ~= nil then table.insert(resultat, '<td colspan="2" style="line-height:10pt;padding: 2px;">' .. infos_region2[2]) if infos_region2[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region2[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td colspan="2" style="line-height:10pt;padding: 2px;">—</td>') end if infos_region3[2] ~= nil then table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">' .. infos_region3[2]) if infos_region3[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region3[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td style="line-height:10pt;padding: 2px;">—</td>') end table.insert(resultat, '</tr>') elseif dex_secondaires[i] and dex_secondaires[i+1] -- il ne reste plus que 2 régions then local infos_region1 = mw.text.split(dex_secondaires[i], "/") local infos_region2 = mw.text.split(dex_secondaires[i+1], "/") table.insert(resultat, '<td colspan="2" style="line-height:8pt;width:50%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region1[1]) .. '</strong></small></em></td>') table.insert(resultat, '<td colspan="2" style="line-height:8pt;width:50%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region2[1]) .. '</strong></small></em></td>') table.insert(resultat, '</tr><tr>') if infos_region1[2] ~= nil then table.insert(resultat, '<td colspan="2" style="line-height:10pt;padding: 2px;">' .. infos_region1[2]) if infos_region1[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region1[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td colspan="2" style="line-height:10pt;padding: 2px;">—</td>') end if infos_region2[2] ~= nil then table.insert(resultat, '<td colspan="2" style="line-height:10pt;padding: 2px;">' .. infos_region2[2]) if infos_region2[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region2[3] .. '">*</span>') end table.insert(resultat, '</td>') else table.insert(resultat, '<td colspan="2" style="line-height:10pt;padding: 2px;">—</td>') end table.insert(resultat, '</tr>') elseif dex_secondaires[i] -- il ne reste plus qu'1 région then local infos_region1 = mw.text.split(dex_secondaires[i], "/") table.insert(resultat, '<tr><td colspan="4" style="line-height:8pt;width:100%;padding: 2px;"><em><small><strong>' .. association_region(frame, infos_region1[1]) .. '</strong></small></em></td></tr><tr><td colspan="4" style="line-height:10pt;padding: 2px;">') if infos_region1[2] ~= nil then table.insert(resultat, infos_region1[2]) if infos_region1[3] ~= nil then table.insert(resultat, '<span class="explain" title="' .. infos_region1[3] .. '">*</span>') end table.insert(resultat, '</td></tr>') else table.insert(resultat, '—</td></tr>') end end table.insert(resultat, '</table></td></tr>') end dex_secondaires = nil -- TYPES if not type1[2] -- Une seule forme then if type2[1] == nil then table.insert(resultat, '<tr><th>[[Type]]</th><td colspan="3">[[Fichier:Miniature Type ' .. mw.getContentLanguage():ucfirst(type1[1]) .. '.png|68px|link=' .. type1[1] .. ' (type)]]') if donnees then table.insert(resultat, '[[Premier type::' .. type1[1] .. '|]]') end if categories_wiki then table.insert(resultat, '[[Catégorie:Pokémon de type ' .. type1[1] .. ']]') end else table.insert(resultat, '<tr><th>[[Type]]s</th><td colspan="3">[[Fichier:Miniature Type ' .. mw.getContentLanguage():ucfirst(type1[1]) .. '.png|68px|link=' .. type1[1] .. ' (type)]] - [[Fichier:Miniature Type ' .. mw.getContentLanguage():ucfirst(type2[1]) .. '.png|68px|link=' .. type2[1] .. ' (type)]]') if donnees then table.insert(resultat, '[[Premier type::' .. type1[1] .. '|]][[Second type::' .. type2[1] ..'|]]') end if categories_wiki then table.insert(resultat, '[[Catégorie:Pokémon de type ' .. type1[1] .. ']][[Catégorie:Pokémon de type ' .. type2[1] .. ']]') end end if conditions_type[1] ~= '' then table.insert(resultat, '<small> <i>(' .. nil_to_string(conditions_type[1]) .. ')</i></small></td>') end table.insert(resultat, '</td></tr>') -- Plusieurs formes else local i = 1 -- initialisation ici pour pouvoir avoir une possibilité de précision même avec un seul set de types while conditions[i] do if conditions_type[i] == nil or conditions_type[i] == '' then conditions_type[i] = conditions[i] end i = i + 1 end table.insert(resultat, '<tr><th colspan="4" style="text-align:center">[[Type]]s</th></tr>') local i = 1 while type1[i] and type1[i+1] do if type2 ~= {} then if type2[i] == nil then type2[i] = type2[1] end end if type2[i] == nil or type2[i] == '' or type2[i] == '-' then table.insert(resultat, '<tr><td colspan="2" style="text-align:center;">[[Fichier:Miniature Type ' .. mw.getContentLanguage():ucfirst(type1[i]) .. '.png|68px|link=' .. type1[i] .. ' (type)]]') if donnees then table.insert(resultat, '[[Premier type::' .. type1[i] .. '|]]') end if categories_wiki then table.insert(resultat, '[[Catégorie:Pokémon de type ' .. type1[i] .. ']]') end else table.insert(resultat, '<tr><td colspan="2" style="text-align:center;">[[Fichier:Miniature Type ' .. mw.getContentLanguage():ucfirst(type1[i]) .. '.png|68px|link=' .. type1[i] .. ' (type)]] - [[Fichier:Miniature Type ' .. mw.getContentLanguage():ucfirst(type2[i]) .. '.png|68px|link=' .. type2[i] .. ' (type)]]') if donnees then table.insert(resultat, '[[Premier type::' .. type1[i] .. '|]][[Second type::' .. type2[i] ..'|]]') end if categories_wiki then table.insert(resultat, '[[Catégorie:Pokémon de type ' .. type1[i] .. ']][[Catégorie:Pokémon de type ' .. type2[i] .. ']]') end end table.insert(resultat, '<br/><small><i>(' .. nil_to_string(conditions_type[i]) .. ')</i></small></td>') if type2 ~= {} then if type2[i+1] == nil then type2[i+1] = type2[1] end end if type2[i+1] == nil or type2[i+1] == '' or type2[i+1] == '-' then table.insert(resultat, '<td colspan="2" style="text-align:center;">[[Fichier:Miniature Type ' .. mw.getContentLanguage():ucfirst(type1[i+1]) .. '.png|68px|link=' .. type1[i+1] .. ' (type)]]') if donnees then table.insert(resultat, '[[Premier type::' .. type1[i+1] .. '|]]') end if categories_wiki then table.insert(resultat, '[[Catégorie:Pokémon de type ' .. type1[i+1] .. ']]') end else table.insert(resultat, '<td colspan="2" style="text-align:center;">[[Fichier:Miniature Type ' .. mw.getContentLanguage():ucfirst(type1[i+1]) .. '.png|68px|link=' .. type1[i+1] .. ' (type)]] - [[Fichier:Miniature Type ' .. mw.getContentLanguage():ucfirst(type2[i+1]) .. '.png|68px|link=' .. type2[i+1] .. ' (type)]]') if donnees then table.insert(resultat, '[[Premier type::' .. type1[i+1] .. '|]][[Second type::' .. type2[i+1] ..'|]]') end if categories_wiki then table.insert(resultat, '[[Catégorie:Pokémon de type ' .. type1[i+1] .. ']][[Catégorie:Pokémon de type ' .. type2[i+1] .. ']]') end end table.insert(resultat, '<br/><small><i>(' .. nil_to_string(conditions_type[i+1]) .. ')</i></small></td></tr>') i = i + 2 end if type1[i] then if type2[i] == nil or type2[i] == '' or type2[i] == '-' then table.insert(resultat, '<tr><td colspan="4" style="text-align:center">[[Fichier:Miniature Type ' .. mw.getContentLanguage():ucfirst(type1[i]) .. '.png|68px|link=' .. type1[i] .. ' (type)]]') if donnees then table.insert(resultat, '[[Premier type::' .. type1[i] .. '|]]') end if categories_wiki then table.insert(resultat, '[[Catégorie:Pokémon de type ' .. type1[i] .. ']]') end else table.insert(resultat, '<tr><td colspan="4" style="text-align:center">[[Fichier:Miniature Type ' .. mw.getContentLanguage():ucfirst(type1[i]) .. '.png|68px|link=' .. type1[i] .. ' (type)]] - [[Fichier:Miniature Type ' .. mw.getContentLanguage():ucfirst(type2[i]) .. '.png|68px|link=' .. type2[i] .. ' (type)]]') if donnees then table.insert(resultat, '[[Premier type::' .. type1[i] .. '|]][[Second type::' .. type2[i] ..'|]]') end if categories_wiki then table.insert(resultat, '[[Catégorie:Pokémon de type ' .. type1[i] .. ']][[Catégorie:Pokémon de type ' .. type2[i] .. ']]') end end table.insert(resultat, '<br/><small><i>(' .. nil_to_string(conditions_type[i]) .. ')</i></small></td></tr>') end end -- CATÉGORIE if categorie == nil then categorie = {} else categorie = mw.text.split(categorie, "/") end if categorie[2] == nil then table.insert(resultat, '<tr><th>[[Catégorie]]</th><td colspan="3">') if categorie[1] == nil or categorie[1] == '' then table.insert(resultat, '—') if categories_wiki then table.insert(resultat, "[[Catégorie:Pokémon dont la catégorie est inconnue]]") end else table.insert(resultat, '[[Pokémon (créature)|Pokémon]] ') if donnees then table.insert(resultat, '[[Catégorie du Pokémon::' .. categorie[1] .. ']]') else table.insert(resultat, categorie[1]) end end table.insert(resultat, '</td></tr>') else table.insert(resultat, '<tr><th colspan="4" style="text-align:center">[[Catégorie]]s</th></tr>') local i = 1 while categorie[i] and categorie[i+1] do table.insert(resultat, '<tr><td colspan="2" style="text-align:center">[[Pokémon (créature)|Pokémon]] ') if donnees then table.insert(resultat, '[[Catégorie du Pokémon::' .. categorie[i] .. ']]') else table.insert(resultat, categorie[i]) end table.insert(resultat, '<br/><small><i>(' .. nil_to_string(conditions_categorie[i]) .. ')</i></small></td>') table.insert(resultat, '<td colspan="2" style="text-align:center">[[Pokémon (créature)|Pokémon]] ') if donnees then table.insert(resultat, '[[Catégorie du Pokémon::' .. categorie[i+1] .. ']]') else table.insert(resultat, categorie[i+1]) end table.insert(resultat, '<br/><small><i>(' .. nil_to_string(conditions_categorie[i+1]) .. ')</i></small></td></tr>') i = i + 2 end if categorie[i] then table.insert(resultat, '<tr><td colspan="4" style="text-align:center">[[Pokémon (créature)|Pokémon]] ') if donnees then table.insert(resultat, '[[Catégorie du Pokémon::' .. categorie[i] .. ']]') else table.insert(resultat, categorie[i]) end table.insert(resultat, '<br/><small><i>(' .. nil_to_string(conditions_categorie[i]) .. ')</i></small></td></tr>') end end categorie = nil -- TAILLE if taille == nil then taille = {} else taille = mw.text.split(taille, "/") end if taille[2] == nil -- Une seule forme then table.insert(resultat, '<tr><th>[[Taille]]</th><td colspan="3">') if taille[1] == nil or taille[1] == '' or taille[1] == '-' then table.insert(resultat, '???,? m') if categories_wiki and taille[1] ~= '-' then table.insert(resultat, "[[Catégorie:Pokémon dont la taille est inconnue]]") end else local taille_plus = false if string.sub(taille[1], -1, -1) == '+' then taille[1] = string.sub(taille[1], 1, -2) taille_plus = true end if tonumber(taille[1]) then if taille_plus then table.insert(resultat, 'Plus de ') end if donnees then table.insert(resultat, '[[Taille::' .. decimal_dot_to_comma(taille[1]) .. ']] m, soit ') -- on change la notation de type '0.2' en '0,2'. else table.insert(resultat, decimal_dot_to_comma(taille[1]) .. ' m, soit ') end local taille_pieds_pouces = meters_to_feet_and_inches(taille[1]) local taille_pieds = taille_pieds_pouces.feet local taille_pouces = taille_pieds_pouces.inches table.insert(resultat, taille_pieds .. ' pied') if taille_pieds > 1.0 then table.insert(resultat, 's') end table.insert(resultat, ' ' .. taille_pouces .. ' pouce') if taille_pouces > 1.0 then table.insert(resultat, 's') end else table.insert(resultat, '[[Fichier:Panneau Attention.png|x20px|Erreur dans la saisie de la taille : le format doit être de la forme « xxx.y », sans indiquer « m ».]] <i>' .. taille[1] .. '</i>[[Catégorie:Pokémon dont la taille est mal indiquée]]') end table.insert(resultat, '</td></tr>') end -- Plusieurs formes else table.insert(resultat, '<tr><th colspan="4" style="text-align:center">[[Taille|Tailles]]</th></tr>') local i = 1 local taille_pieds while taille[i] and taille[i+1] do table.insert(resultat, '<tr><td colspan="2" style="text-align:center;">') local taille_plus = false if string.sub(taille[i], -1, -1) == '+' then taille[i] = string.sub(taille[i], 1, -2) taille_plus = true end if tonumber(taille[i]) then if taille_plus then table.insert(resultat, 'Plus de ') end if donnees then table.insert(resultat, '[[Taille::' .. decimal_dot_to_comma(taille[i]) .. ']] m, soit<br/>') -- on change la notation de type '0.2' en '0,2'. else table.insert(resultat, decimal_dot_to_comma(taille[i]) .. ' m, soit<br/>') end local taille_pieds_pouces = meters_to_feet_and_inches(taille[i]) local taille_pieds = taille_pieds_pouces.feet local taille_pouces = taille_pieds_pouces.inches table.insert(resultat, taille_pieds .. ' pied') if taille_pieds > 1.0 then table.insert(resultat, 's') end table.insert(resultat, ' ' .. taille_pouces .. ' pouce') if taille_pouces > 1.0 then table.insert(resultat, 's') end elseif taille[i] == '' or taille[i] == '-' then table.insert(resultat, '???,? m') else table.insert(resultat, '[[Fichier:Panneau Attention.png|x20px|Erreur dans la saisie de la taille : le format doit être de la forme « xxx.y », sans indiquer « m ».]] <i>' .. taille[i] .. '</i>[[Catégorie:Pokémon dont la taille est mal indiquée]]') end table.insert(resultat, '<br/><small><i>(' .. nil_to_string(conditions_taille[i]) .. ')</i></small></td><td colspan="2" style="text-align:center;">') local taille_plus = false if string.sub(taille[i+1], -1, -1) == '+' then taille[i+1] = string.sub(taille[i+1], 1, -2) taille_plus = true end if tonumber(taille[i+1]) then if taille_plus then table.insert(resultat, 'Plus de ') end if donnees then table.insert(resultat, '[[Taille::' .. decimal_dot_to_comma(taille[i+1]) .. ']] m, soit<br/>') -- on change la notation de type '0.2' en '0,2'. else table.insert(resultat, decimal_dot_to_comma(taille[i+1]) .. ' m, soit<br/>') end local taille_pieds_pouces = meters_to_feet_and_inches(taille[i+1]) local taille_pieds = taille_pieds_pouces.feet local taille_pouces = taille_pieds_pouces.inches table.insert(resultat, taille_pieds .. ' pied') if taille_pieds > 1.0 then table.insert(resultat, 's') end table.insert(resultat, ' ' .. taille_pouces .. ' pouce') if taille_pouces > 1.0 then table.insert(resultat, 's') end elseif taille[i+1] == '' or taille[i+1] == '-' then table.insert(resultat, '???,? m') else table.insert(resultat, '[[Fichier:Panneau Attention.png|x20px|Erreur dans la saisie de la taille : le format doit être de la forme « xxx.y », sans indiquer « m ».]] <i>' .. taille[i+1] .. '</i>[[Catégorie:Pokémon dont la taille est mal indiquée]]') end table.insert(resultat, '<br/><small><i>(' .. nil_to_string(conditions_taille[i+1]) .. ')</i></small></td></tr>') i = i + 2 end if taille[i] then local taille_plus = false if string.sub(taille[i], -1, -1) == '+' then taille[i] = string.sub(taille[i], 1, -2) taille_plus = true end table.insert(resultat, '<tr><td colspan="4" style="text-align:center">') if tonumber(taille[i]) then if taille_plus then table.insert(resultat, 'Plus de ') end if donnees then table.insert(resultat, '[[Taille::' .. decimal_dot_to_comma(taille[i]) .. ']] m, soit ') -- on change la notation de type '0.2' en '0,2'. else table.insert(resultat, decimal_dot_to_comma(taille[i]) .. ' m, soit ') end local taille_pieds_pouces = meters_to_feet_and_inches(taille[i]) local taille_pieds = taille_pieds_pouces.feet local taille_pouces = taille_pieds_pouces.inches table.insert(resultat, taille_pieds .. ' pied') if taille_pieds > 1.0 then table.insert(resultat, 's') end table.insert(resultat, ' ' .. taille_pouces .. ' pouce') if taille_pouces > 1.0 then table.insert(resultat, 's') end elseif taille[i] == '' or taille[i] == '-' then table.insert(resultat, '???,? m') else table.insert(resultat, '[[Fichier:Panneau Attention.png|x20px|Erreur dans la saisie de la taille : le format doit être de la forme « xxx.y », sans indiquer « m ».]] <i>' .. taille[i] .. '</i>[[Catégorie:Pokémon dont la taille est mal indiquée]]') end table.insert(resultat, '<br/><small><i>(' .. nil_to_string(conditions_taille[i]) .. ')</i></small></td></tr>') end end taille = nil -- POIDS if poids == nil then poids = {} else poids = mw.text.split(poids, "/") end if poids[2] == nil -- Une seule forme then table.insert(resultat, '<tr><th>[[Poids]]</th><td colspan="3">') if poids[1] == nil or poids[1] == '' or poids[1] == '-' then table.insert(resultat, '???,? kg') if categories_wiki and poids[1] ~= '-' then table.insert(resultat, "[[Catégorie:Pokémon dont le poids est inconnu]]") end else if tonumber(poids[1]) then if donnees then table.insert(resultat, '[[Poids::' .. decimal_dot_to_comma(poids[1]) .. ']] kg, soit ') -- on change la notation de type '0.2' en '0,2'. else table.insert(resultat, decimal_dot_to_comma(poids[1]) .. ' kg, soit ') end local poids_livres = kg_to_pounds(poids[1]) if poids_livres <= 1.0 then table.insert(resultat, decimal_dot_to_comma(tostring(poids_livres)) .. ' livre') else table.insert(resultat, decimal_dot_to_comma(tostring(poids_livres)) .. ' livres') end else table.insert(resultat, '[[Fichier:Panneau Attention.png|x20px|Erreur dans la saisie du poids : le format doit être de la forme « xxx.y », sans indiquer « kg ».]] <i>' .. poids[1] .. '</i>[[Catégorie:Pokémon dont le poids est mal indiqué]]') end table.insert(resultat, '</td></tr>') end -- Plusieurs formes else table.insert(resultat, '<tr><th colspan="4" style="text-align:center">[[Poids]]</th></tr>') local i = 1 local poids_livres while poids[i] and poids[i+1] do table.insert(resultat, '<tr><td colspan="2" style="text-align:center;">') if tonumber(poids[i]) then if donnees then table.insert(resultat, '[[Poids::' .. decimal_dot_to_comma(poids[i]) .. ']] kg, soit<br/>') -- on change la notation de type '0.2' en '0,2'. else table.insert(resultat, decimal_dot_to_comma(poids[i]) .. ' kg, soit<br/>') end local poids_livres = kg_to_pounds(poids[i]) if poids_livres <= 1.0 then table.insert(resultat, decimal_dot_to_comma(tostring(poids_livres)) .. ' livre') else table.insert(resultat, decimal_dot_to_comma(tostring(poids_livres)) .. ' livres') end elseif poids[i] == '' or poids[i] == '-' then table.insert(resultat, '???,? kg') else table.insert(resultat, '[[Fichier:Panneau Attention.png|x20px|Erreur dans la saisie du poids : le format doit être de la forme « xxx.y », sans indiquer « kg ».]] <i>' .. poids[1] .. '</i>[[Catégorie:Pokémon dont le poids est mal indiqué]]') end table.insert(resultat, '<br/><small><i>(' .. nil_to_string(conditions_poids[i]) .. ')</i></small></td><td colspan="2" style="text-align:center;">') if tonumber(poids[i+1]) then if donnees then table.insert(resultat, '[[Poids::' .. decimal_dot_to_comma(poids[i+1]) .. ']] kg, soit<br/>') -- on change la notation de type '0.2' en '0,2'. else table.insert(resultat, decimal_dot_to_comma(poids[i+1]) .. ' kg, soit<br/>') end local poids_livres = kg_to_pounds(poids[i+1]) if poids_livres <= 1.0 then table.insert(resultat, decimal_dot_to_comma(tostring(poids_livres)) .. ' livre') else table.insert(resultat, decimal_dot_to_comma(tostring(poids_livres)) .. ' livres') end elseif poids[i+1] == '' or poids[i+1] == '-' then table.insert(resultat, '???,? kg') else table.insert(resultat, '[[Fichier:Panneau Attention.png|x20px|Erreur dans la saisie du poids : le format doit être de la forme « xxx.y », sans indiquer « kg ».]] <i>' .. poids[i+1] .. '</i>[[Catégorie:Pokémon dont le poids est mal indiqué]]') end table.insert(resultat, '<br/><small><i>(' .. nil_to_string(conditions_poids[i+1]) .. ')</i></small></td></tr>') i = i + 2 end if poids[i] then table.insert(resultat, '<tr><td colspan="4" style="text-align:center">') if tonumber(poids[i]) then if donnees then table.insert(resultat, '[[Poids::' .. decimal_dot_to_comma(poids[i]) .. ']] kg, soit ') -- on change la notation de type '0.2' en '0,2'. else table.insert(resultat, decimal_dot_to_comma(poids[i]) .. ' kg, soit ') end local poids_livres = kg_to_pounds(poids[i]) if poids_livres <= 1.0 then table.insert(resultat, decimal_dot_to_comma(tostring(poids_livres)) .. ' livre') else table.insert(resultat, decimal_dot_to_comma(tostring(poids_livres)) .. ' livres') end elseif poids[i] == '' or poids[i] == '-' then table.insert(resultat, '???,? kg') else table.insert(resultat, '[[Fichier:Panneau Attention.png|x20px|Erreur dans la saisie du poids : le format doit être de la forme « xxx.y », sans indiquer « kg ».]] <i>' .. poids[i] .. '</i>[[Catégorie:Pokémon dont le poids est mal indiqué]]') end table.insert(resultat, '<br/><small><i>(' .. nil_to_string(conditions_poids[i]) .. ')</i></small></td></tr>') end end poids = nil -- TALENTS if talents == nil or talents == '' then table.insert(resultat, '<tr><th>[[Talent]]s</th><td colspan="3">—</td></tr>') if categories_wiki then table.insert(resultat, "[[Catégorie:Pokémon dont le talent est inconnu]]") end else function talents_to_list(talents) talents = mw.text.split(talents, "//") local j = 1 local infos_talent = {} local init = true local function_ans = {} while talents[j] do infos_talent_j = mw.text.split(talents[j], "/") if infos_talent_j[1] ~= nil then if init then init = false else table.insert(function_ans, '<br>') end if talents[2] then table.insert(function_ans, j .. '. ') end if infos_talent_j[1] == "" or infos_talent_j[1] == '-' or infos_talent_j[1] == '—' then table.insert(function_ans, '—') else table.insert(function_ans, '[[' .. infos_talent_j[1] .. ']]') end if infos_talent_j[2] ~= nil and infos_talent_j[2] ~= "" then table.insert(function_ans, '<small> <i>(' .. infos_talent_j[2] .. ')</i></small>') end end j = j + 1 end return {["how_many"] = j - 1, ["ans"] = table.concat(function_ans, "")} end talents = mw.text.split(talents, "///") if not talents[2] then local ttl = talents_to_list(talents[1]) local plural = "" if ttl.how_many >= 2 then plural = "s" end table.insert(resultat, '<tr><th>[[Talent]]' .. plural .. '</th><td colspan="3">' .. ttl.ans .. '</td></tr>') else table.insert(resultat, '<tr><th colspan="4" style="text-align:center">[[Talent]]s</th></tr>') local i = 1 while talents[i] and talents[i+1] do local ttl_i = talents_to_list(talents[i]) local ttl_ip1 = talents_to_list(talents[i+1]) if ttl_i.how_many >= 2 then table.insert(resultat, '<tr><td colspan="2">' .. ttl_i.ans .. '<div style="text-align:center"><small><i>(' .. nil_to_string(conditions_talents[i]) .. ')</i></small></div></td>') else table.insert(resultat, '<tr><td colspan="2" style="text-align:center">' .. ttl_i.ans .. '<div style="text-align:center"><small><i>(' .. nil_to_string(conditions_talents[i]) .. ')</i></small></div></td>') end if ttl_ip1.how_many >= 2 then table.insert(resultat, '<td colspan="2">' .. ttl_ip1.ans .. '<div style="text-align:center"><small><i>(' .. nil_to_string(conditions_talents[i+1]) .. ')</i></small></div></td></tr>') else table.insert(resultat, '<td colspan="2" style="text-align:center">' .. ttl_ip1.ans .. '<div style="text-align:center"><small><i>(' .. nil_to_string(conditions_talents[i+1]) .. ')</i></small></div></td></tr>') end i = i + 2 end if talents[i] then local ttl_i = talents_to_list(talents[i]) if ttl_i.how_many >= 2 then table.insert(resultat, '<tr><td colspan="4">' .. ttl_i.ans .. '<div style="text-align:center"><small><i>(' .. nil_to_string(conditions_talents[i]) .. ')</i></small></div></td></tr>') else table.insert(resultat, '<tr><td colspan="4" style="text-align:center">' .. ttl_i.ans .. '<small> <i>(' .. nil_to_string(conditions_talents[i]) .. ')</i></small></td></tr>') end end end end talents = nil -- GROUPES ŒUF if groupeoeuf2 ~= nil and groupeoeuf2 ~= '' and groupeoeuf2 ~= '-' then table.insert(resultat, '<tr><th>[[Liste des Pokémon par groupe d\'Œuf|Groupes d\'Œuf]]</th><td colspan="3">') else table.insert(resultat, '<tr><th>[[Liste des Pokémon par groupe d\'Œuf|Groupe d\'Œuf]]</th><td colspan="3">') end if groupeoeuf1 == nil or groupeoeuf1 == '' or groupeoeuf1 == '-' then table.insert(resultat, '—') if categories_wiki then table.insert(resultat, "[[Catégorie:Pokémon dont le groupe d'Œuf est inconnu]]") end else table.insert(resultat, '[[:Catégorie:Pokémon du groupe ' .. groupeoeuf1 .. '|' .. groupeoeuf1 .. ']]') if groupeoeuf1diff ~= nil then table.insert(resultat, '<small> <i>(' .. groupeoeuf1diff .. ')</i></small>') end if categories_wiki then table.insert(resultat, '[[Catégorie:Pokémon du groupe ' .. groupeoeuf1 .. ']]') end if groupeoeuf2 ~= nil and groupeoeuf2 ~= '' and groupeoeuf2 ~= '-' then table.insert(resultat, '<br>[[:Catégorie:Pokémon du groupe ' .. groupeoeuf2 .. '|' .. groupeoeuf2 .. ']]') if groupeoeuf2diff ~= nil then table.insert(resultat, '<small> <i>(' .. groupeoeuf2diff .. ')</i></small>') end if categories_wiki then table.insert(resultat, '[[Catégorie:Pokémon du groupe ' .. groupeoeuf2 .. ']]') end end end table.insert(resultat, '</td></tr>') -- ÉCLOSION if oeufpas == nil then oeufpas = {} else oeufpas = mw.text.split(oeufpas, "/") end if oeufpas[2] == nil then if tonumber(oeufpas[1]) then table.insert(resultat, '<tr><th>Éclosion</th><td colspan="3">') local oeufcycles = math.floor(oeufpas[1]/255) - 1 local s = '' if oeufcycles > 1 then s = 's' end table.insert(resultat, oeufcycles .. ' cycle' .. s .. ' – ') if donnees then table.insert(resultat, '[[Éclosion::' .. separate_thousands(oeufpas[1]) .. ']] pas') else table.insert(resultat, separate_thousands(oeufpas[1]) .. ' pas') end table.insert(resultat, '</td></tr>') else if categories_wiki and oeufpas[1] ~= '-' then table.insert(resultat, "[[Catégorie:Pokémon dont le temps d'éclosion est inconnu]]") end end else table.insert(resultat, '<tr><th colspan="4" style="text-align:center">Éclosion</th></tr>') local i = 1 while oeufpas[i] and tonumber(oeufpas[i]) and oeufpas[i+1] and tonumber(oeufpas[i+1]) do local oeufcycles0 = math.floor(oeufpas[i]/255) - 1 local oeufcycles1 = math.floor(oeufpas[i+1]/255) - 1 local s = '' if oeufcycles0 > 1 then s = 's' end table.insert(resultat, '<tr><td colspan="2" style="text-align:center">' .. oeufcycles0 .. ' cycle' .. s .. ' – ') if donnees then table.insert(resultat, '[[Éclosion::' .. separate_thousands(oeufpas[i]) .. ']]') else table.insert(resultat, separate_thousands(oeufpas[i])) end table.insert(resultat, ' pas<br><small><i>(' .. nil_to_string(conditions_oeufpas[i]) .. ')</i></small></td>') if oeufcycles1 > 1 then s = 's' else s = '' end table.insert(resultat, '<td colspan="2" style="text-align:center">' .. oeufcycles1 .. ' cycle' .. s .. ' – ') if donnees then table.insert(resultat, '[[Éclosion::' .. separate_thousands(oeufpas[i+1]) .. ']]') else table.insert(resultat, separate_thousands(oeufpas[i+1])) end table.insert(resultat, ' pas<br><small><i>(' .. nil_to_string(conditions_oeufpas[i+1]) .. ')</i></small></td></tr>') i = i + 2 end if oeufpas[i] then local oeufcycles = math.floor(oeufpas[i]/255) - 1 local s = '' if oeufcycles > 1 then s = 's' end table.insert(resultat, '<tr><td colspan="4" style="text-align:center">' .. oeufcycles .. ' cycle' .. s .. ' – ') if donnees then table.insert(resultat, '[[Éclosion::' .. separate_thousands(oeufpas[i]) .. ']]') else table.insert(resultat, separate_thousands(oeufpas[i])) end table.insert(resultat, ' pas<br><small><i>(' .. nil_to_string(conditions_oeufpas[i]) .. ')</i></small></td></tr>') end end -- EV if effortval == nil then effortval = {} else effortval = mw.text.split(effortval, "/") end if effortval[2] == nil then table.insert(resultat, '<tr><th>[[EV|Points effort]]</th><td colspan="3">') if effortval[1] == nil or effortval[1] == '' then table.insert(resultat, '—') if categories_wiki then table.insert(resultat, "[[Catégorie:Pokémon dont les EV gagnés sont inconnus]]") end else if donnees then table.insert(resultat, '[[Points effort::' .. effortval[1] .. ']]') else table.insert(resultat, effortval[1]) end end table.insert(resultat, '</td></tr>') else table.insert(resultat, '<tr><th colspan="4" style="text-align:center">[[EV|Points effort]]</th></tr>') local i = 1 while effortval[i] and effortval[i+1] do if donnees then for z = i, i+1 do effortval[z] = '[[Points effort::' .. effortval[z] .. ']]' end end table.insert(resultat, '<tr><td colspan="2" style="text-align:center">' .. effortval[i] .. '<br/><small><i>(' .. nil_to_string(conditions_effortval[i]) .. ')</i></small></td>') table.insert(resultat, '<td colspan="2" style="text-align:center">' .. effortval[i+1] .. '<br/><small><i>(' .. nil_to_string(conditions_effortval[i+1]) .. ')</i></small></td></tr>') i = i + 2 end if effortval[i] then if donnees then effortval[i] = '[[Points effort::' .. effortval[i] .. ']]' end table.insert(resultat, '<tr><td colspan="4" style="text-align:center">' .. effortval[i] .. '<br/><small><i>(' .. nil_to_string(conditions_effortval[i]) .. ')</i></small></td></tr>') end end effortval = nil -- POINTS EXP table.insert(resultat, '<tr><th>[[Expérience|Points exp.]]</th><td colspan="3">') if expval == nil or expval == "" then if categories_wiki then table.insert(resultat, "[[Catégorie:Pokémon dont le gain d'expérience est inconnu]]") end expval = {"—"} else expval = mw.text.split(expval, "//") end i = 1 while expval[i] do expval_i = mw.text.split(expval[i], "/") if expval_i[1] == "—" then table.insert(resultat, '—') else if i ~= 1 then table.insert(resultat, "<br>") end if donnees and expval[i+1] == nil -- semantic data only for the latest instance then table.insert(resultat, '[[Points exp::' .. expval_i[1] .. ']] exp.') else table.insert(resultat, expval_i[1] .. ' exp.') end if expval_i[2] then table.insert(resultat, "<small> <i>(" .. expval_i[2] .. ")</i></small>") end if i == 1 and expvaldiff ~= nil then table.insert(resultat, ' (' .. expvaldiff .. ')') end end i = i + 1 end table.insert(resultat, '</td></tr>') -- EXPÉRIENCE AU NIVEAU 100 table.insert(resultat, '<tr><th>[[Expérience|Exp au niveau 100]]</th><td colspan="3">') if expmax then expmax = expmax:gsub(" ", "") end -- Pour permettre la saisie de données sous la forme "1 000 000" if not tonumber(expmax) then table.insert(resultat, '—') if categories_wiki then table.insert(resultat, "[[Catégorie:Pokémon dont l'expérience au niveau 100 est inconnue]]") end else expmax = separate_thousands(expmax) if donnees then table.insert(resultat, '[[Exp au niveau 100::' .. expmax .. ']] exp.') else table.insert(resultat, expmax .. ' exp.') end end table.insert(resultat, '</td></tr>') -- SEXE table.insert(resultat, '<tr><th>[[Liste des Pokémon par répartition des sexes|Sexe]]</th><td colspan="3">') if fmratio == nil or fmratio == '' or fmratio == '-' then table.insert(resultat, '<i>Répartition inconnue</i>') if categories_wiki then table.insert(resultat, "[[Catégorie:Pokémon dont la répartition des sexes est inconnue]]") end else fmratio = mw.text.split(fmratio, "/") local i = 1 local init = true while fmratio[i] do if tonumber(fmratio[i]) then fmratio[i] = tonumber(fmratio[i]) if init then init = false else table.insert(resultat, '<br/>') end if fmratio[i] == -1 then table.insert(resultat, 'Asexué') if fmratio[2] then table.insert(resultat, ' <i><small>(' .. nil_to_string(conditions_fmratio[i]) .. ')</small></i>') end if categories_wiki then table.insert(resultat, '[[Catégorie:Pokémon asexué]]') end else table.insert(resultat, fmratio[i]*100 .. ' % femelle ; ' .. 100-fmratio[i]*100 .. ' % mâle<br/><div style="border-radius: 10px;overflow: hidden;line-height: 15px;"><div style="background-color:pink;display:inline-block;width:' .. fmratio[i]*100 .. '%"> </div><div style="background-color:lightblue;display:inline-block;width:' .. 100-fmratio[i]*100 .. '%"> </div></div>') if fmratio[2] then table.insert(resultat, '<i><small>(' .. nil_to_string(conditions_fmratio[i]) .. ')</small></i>') end if categories_wiki and fmratio[i] == 1 then table.insert(resultat, '[[Catégorie:Pokémon uniquement femelle]]') elseif categories_wiki and fmratio[i] == 0 then table.insert(resultat, '[[Catégorie:Pokémon uniquement mâle]]') end end end i = i + 1 end end table.insert(resultat, '</td></tr>') -- COULEUR if not debug_mode and (couleur == nil or couleur == '' or couleur == '-' or couleur == 'Inconnue') then if categories_wiki then table.insert(resultat, '[[Catégorie:Pokémon dont la couleur est inconnue]]') end -- En commentaire : un code pour mettre la couleur "Inconnu" par défaut. Actuellement, on retire complètement la section. -- table.insert(resultat, '<tr><th>[[Couleur]]</th><td colspan="3">—') -- table.insert(resultat, '</th></tr>') else if couleur == nil then couleur = '' end couleur = mw.text.split(couleur, "/") local i = 1 local init = true if couleur[2] then table.insert(resultat, '<tr><th>[[Couleur|Couleurs]]</th><td colspan="3">') else table.insert(resultat, '<tr><th>[[Couleur]]</th><td colspan="3">') end while couleur[i] do if init then init = false else table.insert(resultat, '<br/>') end if donnees then table.insert(resultat, '[[Couleur::' .. couleur[i] .. '|]]') end table.insert(resultat, frame:expandTemplate{title='Image couleur', args={couleur[i]}}) if categories_wiki then if couleur[i] ~= "Inconnue" then table.insert(resultat, '[[Catégorie:Pokémon listé comme ' .. couleur[i] .. ']]') else table.insert(resultat, '[[Catégorie:Pokémon dont la couleur est inconnue]]') end end if couleur[2] then table.insert(resultat, ' <i><small>(' .. nil_to_string(conditions_couleur[i]) .. ')</small></i>') end i = i + 1 end table.insert(resultat, '</td></tr>') end couleur = nil -- TAUX DE CAPTURE if not debug_mode and not (captureval == nil or captureval == '' or captureval == '-') then if captureval == nil then captureval = '' end table.insert(resultat, '<tr><th>[[Capture de Pokémon|Taux de capture]]</th><td colspan="3">') captureval = mw.text.split(captureval, "/") local i = 1 local init = true while captureval[i] do if init then init = false else table.insert(resultat, '<br/>') end if donnees then table.insert(resultat, '[[Taux de capture::' .. captureval[i] .. ']]') else table.insert(resultat, captureval[i]) end if captureval[2] then table.insert(resultat, ' <i><small>(' .. nil_to_string(conditions_captureval[i]) .. ')</small></i>') end i = i + 1 end table.insert(resultat, '</td></tr>') else if categories_wiki then table.insert(resultat, "[[Catégorie:Pokémon dont le taux de capture est inconnu]]") end end -- EMPREINTE table.insert(resultat, '') if debug_mode or (empreinte ~= '-' and (empreinte == nil or empreinte == '')) and tonumber(ndex) and generation <= 5 then table.insert(resultat, '<tr><th>Empreinte</th><td colspan="3">[[Fichier:' .. ndex .. 'empreinte.png|x22px]]</td></tr>') elseif not(empreinte == nil or empreinte == '' or empreinte == '-') then table.insert(resultat, '<tr><th>Empreinte</th><td colspan="3">[[Fichier:' .. empreinte .. '.png|x22px]]</td></tr>') end -- APPARENCE DU CORPS if corps == nil then corps = forme end if corps == nil or corps == '' or corps == '-' then table.insert(resultat, '<tr><th>[[Apparence du corps|Apparence<br/>du corps]]</th><td colspan="3">—') if categories_wiki then table.insert(resultat, "[[Catégorie:Pokémon dont l'apparence du corps est inconnue]]") end else corps = mw.text.split(corps, "/") local i = 1 local init = true if corps[2] then table.insert(resultat, '<tr><th>[[Apparence du corps|Apparences<br/>du corps]]</th><td colspan="3">') else table.insert(resultat, '<tr><th>[[Apparence du corps|Apparence<br/>du corps]]</th><td colspan="3">') end while corps[i] do if init then init = false else table.insert(resultat, '<br/>') end table.insert(resultat, frame:expandTemplate{title='Apparence du corps', args={corps[i]}}) if corps[2] then table.insert(resultat, ' <i><small>(' .. nil_to_string(conditions_corps[i]).. ')</small></i>') end i = i + 1 end end table.insert(resultat, '</td></tr>') -- CRI if cri == '' then cri = nil end if cri == nil and not tonumber(ndex) then table.insert(resultat, '<tr><th colspan="4" style="text-align:center">[[Cri]]</th></tr><tr><td colspan="4" style="text-align:center">—</td></tr>') elseif cri ~= nil then cri = mw.text.split(cri, "/") if cri[2] then table.insert(resultat, '<tr><th colspan="4" style="text-align:center">[[Cri]]s</th></tr>') else table.insert(resultat, '<tr><th colspan="4" style="text-align:center">[[Cri]]</th></tr>') end local i = 1 while cri[i] do table.insert(resultat, '<tr><td colspan="4" style="text-align:center"><center>[[Fichier:' .. cri[i] .. '.ogg|noicon]]</center>') if cri[2] then table.insert(resultat, '<small><i>(' .. nil_to_string(conditions_cri[i]) .. ')</i></small>') end table.insert(resultat, '</td></tr>') i = i + 1 end else table.insert(resultat, '<tr><th colspan="4" style="text-align:center">[[Cri]]</th></tr><tr><td colspan="4" style="text-align:center"><center>') if tonumber(ndex) <= 493 then table.insert(resultat, '[[Fichier:Cri 4 d ' .. ndex .. '.ogg|noicon]]') elseif tonumber(ndex) <= 649 then table.insert(resultat, '[[Fichier:Cri 5 n ' .. ndex .. '.ogg|noicon]]') elseif tonumber(ndex) <= 721 then table.insert(resultat, '[[Fichier:Cri 6 x ' .. ndex .. '.ogg|noicon]]') elseif tonumber(ndex) <= 809 then table.insert(resultat, '[[Fichier:Cri 7 s ' .. ndex .. '.ogg|noicon]]') else table.insert(resultat, '[[Fichier:Cri ' .. ndex .. ' EB.ogg|noicon]]') end table.insert(resultat, '</center></td></tr>') end cri = nil -- GESTION CATÉGORISATION GÉNÉRATION ET DONNÉES table.insert(resultat, '<tr><td style="width:30%; height: 0px; padding: 0px;">') if categories_wiki then table.insert(resultat, '[[Catégorie:Pokémon]]') if generation == 1 then table.insert(resultat, '[[Catégorie:Pokémon de la première génération]]') elseif generation == 2 then table.insert(resultat, '[[Catégorie:Pokémon de la deuxième génération]]') elseif generation == 3 then table.insert(resultat, '[[Catégorie:Pokémon de la troisième génération]]') elseif generation == 4 then table.insert(resultat, '[[Catégorie:Pokémon de la quatrième génération]]') elseif generation == 5 then table.insert(resultat, '[[Catégorie:Pokémon de la cinquième génération]]') elseif generation == 6 then table.insert(resultat, '[[Catégorie:Pokémon de la sixième génération]]') elseif generation == 7 then table.insert(resultat, '[[Catégorie:Pokémon de la septième génération]]') elseif generation == 8 then table.insert(resultat, '[[Catégorie:Pokémon de la huitième génération]]') elseif generation == 9 then table.insert(resultat, '[[Catégorie:Pokémon de la neuvième génération]]') end if fmratio == -1 then table.insert(resultat, '[[Catégorie:Pokémon asexué]]') elseif fmratio == 1 then table.insert(resultat, '[[Catégorie:Pokémon uniquement femelle]]') elseif fmratio == 0 then table.insert(resultat, '[[Catégorie:Pokémon uniquement mâle]]') end end if donnees then if generation == 1 then table.insert(resultat, '[[Génération du Pokémon::Première génération|]]') elseif generation == 2 then table.insert(resultat, '[[Génération du Pokémon::Deuxième génération|]]') elseif generation == 3 then table.insert(resultat, '[[Génération du Pokémon::Troisième génération|]]') elseif generation == 4 then table.insert(resultat, '[[Génération du Pokémon::Quatrième génération|]]') elseif generation == 5 then table.insert(resultat, '[[Génération du Pokémon::Cinquième génération|]]') elseif generation == 6 then table.insert(resultat, '[[Génération du Pokémon::Sixième génération|]]') elseif generation == 7 then table.insert(resultat, '[[Génération du Pokémon::Septième génération|]]') elseif generation == 8 then table.insert(resultat, '[[Génération du Pokémon::Huitième génération|]]') elseif generation == 9 then table.insert(resultat, '[[Génération du Pokémon::Neuvième génération|]]') end end table.insert(resultat, '</td><td style="width:20%; height: 0px; padding: 0px;"></td><td style="width:20%; height: 0px; padding: 0px;"></td><td style="width:30%; height: 0px; padding: 0px;"></td></tbody>') table.insert(resultat, '</table>') return table.concat(resultat, "") end return p