Module:Capsule
Aller à la navigation
Aller à la recherche
Fonction « tableau »[modifier]
Paramètres[modifier]
Certains paramètres sont accompagnés d'une ou plusieurs icône indiquant leur(s) caractéristique(s) :
|
- génération : numéro de la génération en chiffres arabes (1, 2, 3…)
- jeu : si la capacité présente dans une Capsule varie dans les jeux d'une même génération, il faut utiliser plusieurs fois le module. Dans ce cas, on utilise ce paramètre pour préciser à quel jeu de la génération le tableau se rapporte.
- capacité : nom de la capacité.
- jeux : liste des abréviations des jeux dans lesquels la capsule est présente tels que définies dans le Modèle:Jeu. Chaque jeu est séparé par un « / ».
- abréviation_du_jeu-emplacement : emplacement de la capsule. À répéter pour chaque jeu.
- abréviation_du_jeu-achat : prix d'achat de la capsule. À répéter pour chaque jeu.
- abréviation_du_jeu-achat-unité : unité du prix d'achat de la capsule, par exemple « jetons ». Par défaut, le module considère qu'il s'agit de Pokédollars (). À répéter pour chaque jeu.
- abréviation_du_jeu-vente : prix de vente de la capsule. À répéter pour chaque jeu.
- imagenuméro : nom de l'image représentant la localisation de la capsule. La première image a « 1 » comme numéro, puis la suivante 2, puis 3…
- imagenuméro-description : decription de l'image représentant la localisation de la capsule. La première image a « 1 » comme numéro, puis la suivante 2, puis 3…
- pokémon : liste des Pokémon pouvant apprendre la capsule séparés par des « / ». Incompatible avec le paramètre tous.
- tous : si tous les Pokémon ou presque pouvant apprendre une capsule peuvent apprendre cette capacité, remplir ce paramètre avec oui. Si ce n'est le cas que pour les Pokémon sexués, indiquer tous=sexués. Incompatible avec le paramètre pokémon.
- exceptions : seulement dans les cas où tous=oui ou tous=sexués, il est possible de renseigner ce paramètre pour définir les exceptions, les Pokémon qui ne peuvent pas apprendre la capacité même s'ils peuvent une capsule. Par exemple, si les exceptions sont Tarsal, Kirlia et Méios, il faut taper « exceptions = [[Tarsal]], [[Kirlia]] et [[Méios]] ».
Trois paramètres spécifiques ont été introduits pour mieux gérer la Machine à CT de Pokémon Écarlate et Violet : ev-recette-pl pour indiquer le nombre de Points de Ligue nécessaires à la création de la CT, ev-recette-échantillons pour indiquer les échantillons nécessaires à la création de la CT et ev-recette-condition (facultatif) si un événement du jeu débloque l'apparition de cette recette. Les informations sont disposées sur une ligne à part - voir le dernier exemple pour bien comprendre le fonctionnement prévu de ces paramètres.
Exemples[modifier]
Données venant de la page CT01
{{#invoke:Capsule|tableau | génération = 1 | capacité = Ultimapoing | jeux = rbj | rbj-emplacement = [[Mont Sélénite]], [[Centre commercial de Céladopole]] | rbj-achat = 3 000 | rbj-vente = 1 500 | image1 = Cap ecran obtention ct01 sélénite rbj.png | image1-description = CT01 au Mont Sélénite | image2 = Cap ecran obtention ct01 céladopole rbj.png | image2-description = Au Centre Commercial | pokémon = Salamèche/Reptincel/Dracaufeu/Carapuce/Carabaffe/Tortank/Pikachu/Raichu/Nidoqueen/Nidoking/Mélofée/Mélodelfe/Rondoudou/Grodoudou/Psykokwak/Akwakwak/Férosinge/Colossinge/Têtarte/Tartard/Abra/Kadabra/Alakazam/Machoc/Machopeur/Mackogneur/Racaillou/Gravalanch/Grolem/Flagadoss/Ectoplasma/Soporifik/Hypnomade/Osselait/Ossatueur/Kicklee/Tygnon/Excelangue/Rhinoféros/Leveinard/Kangourex/M. Mime/Lippoutou/Élektek/Magmar/Ronflex/Mewtwo/Mew }}
donne :
Capacité | Type | Catégorie | Puissance | Précision | PP | |
---|---|---|---|---|---|---|
Ultimapoing | 80 | 85 % | 20 | |||
Jeu | Emplacement | Achat | Vente | |||
RBJ | Mont Sélénite, Centre commercial de Céladopole | 3 000 | 1 500 | |||
| ||||||
Pokémon aptes | ||||||
0004 Salamèche | 0005 Reptincel | 0006 Dracaufeu | 0007 Carapuce | 0008 Carabaffe | 0009 Tortank | |
0025 Pikachu | 0026 Raichu | 0031 Nidoqueen | 0034 Nidoking | 0035 Mélofée | 0036 Mélodelfe | |
0039 Rondoudou | 0040 Grodoudou | 0054 Psykokwak | 0055 Akwakwak | 0056 Férosinge | 0057 Colossinge | |
0061 Têtarte | 0062 Tartard | 0063 Abra | 0064 Kadabra | 0065 Alakazam | 0066 Machoc | |
0067 Machopeur | 0068 Mackogneur | 0074 Racaillou | 0075 Gravalanch | 0076 Grolem | 0080 Flagadoss | |
0094 Ectoplasma | 0096 Soporifik | 0097 Hypnomade | 0104 Osselait | 0105 Ossatueur | 0106 Kicklee | |
0107 Tygnon | 0108 Excelangue | 0112 Rhinoféros | 0113 Leveinard | 0115 Kangourex | 0122 M. Mime | |
0124 Lippoutou | 0125 Élektek | 0126 Magmar | 0143 Ronflex | 0150 Mewtwo | 0151 Mew | |
Données venant de la page CT89
{{#invoke:Capsule|tableau | génération = 4 | capacité = Demi-Tour | jeux = dpp/hgss/pbr | dpp-emplacement = [[Joliberges]], [[Casino de Voilaroc]] | dpp-achat = 6 000 | dpp-achat-unité = jetons | dpp-vente = 2 500 | hgss-emplacement = Prix pour avoir battu [[Hector]], [[Zone de Combat (Quatrième génération)|Zone de Combat]] | hgss-achat = 40 | hgss-achat-unité = PCo | hgss-vente = 1 500 | pbr-emplacement = Boutique | pokémon = Papilusion/Dardargnan/Roucool/Roucoups/Roucarnage/Rattata/Rattatac/Piafabec/Rapasdepic/Nosferapti/Nosferalto/Aéromite/Miaouss/Persian/Férosinge/Colossinge/Canarticho/Insécateur/Artikodin/Électhor/Sulfura/Mew/Fouinette/Fouinar/Coxy/Coxyclaque/Nostenfer/Natu/Xatu/Granivol/Floravol/Cotovol/Capumain/Yanma/Scorplane/Cizayox/Celebi/Charmillon/Papinox/Nirondelle/Hélédelle/Goélise/Bekipan/Maskadra/Ninjask/Muciole/Lumivole/Vibraninf/Libégon/Jirachi/Ouisticram/Chimpenfeu/Simiabraz/Étourmi/Étourvol/Étouraptor/Papilord/Apireine/Pachirisu/Capidextre/Chaglam/Chaffreux/Pijako/Écayon/Luminéon/Yanmega/Scorvol/Créhelf/Créfollet/Créfadet/Phione/Manaphy }}
donne :
Données venant de la page CT94
{{#invoke:Capsule|tableau | génération = 6 | jeu = Rubis Oméga et Saphir Alpha | capacité = Force Cachée | jeux = rosa | rosa-emplacement = Offerte par [[Millepertuis]] sur la [[Route 111]] | tous = oui | exceptions = [[Zarbi]], [[Qulbutoké]], [[Okéoké]], [[Crikzik]], [[Cheniti]], [[Anchwatt]] et [[Pérégrain]] }}
donne :
Capacité | Type | Catégorie | Puissance | Précision | PP | Type concours | Charme | Blocage | |
---|---|---|---|---|---|---|---|---|---|
Force Cachée | 70 | 100 % | 20 | ♥ | — | ||||
Jeu | Emplacement | Achat | Vente | ||||||
ROSA | Offerte par Millepertuis sur la Route 111 | — | — | ||||||
Pokémon aptes | |||||||||
Tout Pokémon pouvant apprendre une capacité par capsule peut apprendre Force Cachée sauf Zarbi, Qulbutoké, Okéoké, Crikzik, Cheniti, Anchwatt et Pérégrain. |
{{#invoke:Capsule|tableau | génération = 9 | capacité = Croco Larme | jeux = ev | ev-emplacement = [[Zone Est n° 1]], [[Mont Nappé]], [[Zone Sud n° 2]], [[Zone Sud n° 5]] | ev-vente=400 | ev-recette-condition=avoir vaincu [[Brome]] | ev-recette-pl=400 | ev-recette-échantillons=Larme de [[Manzaï]] ×3, Griffe de [[Teddiursa]] ×3 | pokémon =Pikachu/Rondoudou/Grodoudou/Miaouss/Miaouss forme(Alola)/Miaouss forme(Galar)/Persian/Persian forme(Alola)/Évoli/Aquali/Voltali/Pyroli/Mew/Toudoudou/Marill/Azumarill/Simularbre/Mentali/Noctali/Feuforêve/Farfuret/Teddiursa/Ursaring/Balignon/Chapignon/Azurill/Stalgamin/Oniglali/Lixy/Luxio/Luxray/Pachirisu/Magirêve/Manzaï/Dimoret/Phyllali/Givrali/Momartik/Zorua/Zorua forme(Hisui)/Zoroark/Zoroark forme(Hisui)/Scrutella/Mesmérella/Sidérella/Vivaldaim/Haydaim/Meloetta/Nymphali/Diancie/Malamandre/Minisange/Bleuseille/Corvaillus/Grimalin/Fourbelin/Angoliath/Berserkatt/Ursaking/Poussacha/Matourgeon/Miascarade/Compagnol/Famignol/Tapatoès/Grondogue/Dogrino/Forgerette/Forgella/Forgelina/Hurle-Queue/Flotte-Mèche }}
donne :
local p = {} local ressources = { ["infosPokemon"] = require("Module:Ressources/infosPokemon"), ["donneesCapacite"] = require("Module:Ressources/donneesCapacite"), ["indexTableau"] = require("Module:Ressources/indexTableau") } function p.tableau( frame ) local generation = tonumber( mw.text.trim( frame.args['génération'] ) ) local capacite = mw.text.trim( frame.args['capacité'] ) local jeux = frame.args['jeux'] local poke_aptes = frame.args['pokémon'] if generation == nil then generation = "" end if capacite == nil then return "Pas de nom de capacité renseigné" end if jeux ~= nil then jeux = mw.text.split( string.lower(jeux), "/" ) else jeux = {} end for i,jeu in ipairs(jeux) do jeux[i] = mw.text.trim( jeu ) end if poke_aptes ~= nil then poke_aptes = mw.text.split( poke_aptes, "/" ) else poke_aptes = {} end local generations = {"Première", "Deuxième", "Troisième", "Quatrième", "Cinquième", "Sixième", "Septième", "Huitième", "Neuvième"} local titre if generations[generation] then titre = generations[generation] end titre = titre .. ' génération' if frame.args['jeu'] then titre = titre .. ' - <i>' .. frame.args['jeu'] .. '</i>' end local colspan = 6 if generation == 3 or generation == 6 then colspan = 9 elseif generation == 4 then colspan = 8 end local i = 1 local infos_jeux = {} local emplacement, achat, vente while jeux[i] ~= nil do jeux[i] = mw.text.trim( jeux[i] ) if frame.args[jeux[i] .. '-emplacement'] == nil then if jeux[i] == "ev" and frame.args["ev-recette-pl"] ~= nil then emplacement = "—" else emplacement = "Inconnu" end else emplacement = mw.text.trim( frame.args[jeux[i] .. '-emplacement'] ) end if frame.args[jeux[i] .. '-achat'] == nil or frame.args[jeux[i] .. '-achat'] == "-" or frame.args[jeux[i] .. '-achat'] == "—" then achat = "—" else if frame.args[jeux[i] .. '-achat-unité'] then achat = mw.text.trim( frame.args[jeux[i] .. '-achat'] ) .. " " .. mw.text.trim( frame.args[jeux[i] .. '-achat-unité'] ) else achat = mw.text.trim( frame.args[jeux[i] .. '-achat'] ) .. " [[Fichier:Miniature Pokédollar EB.png|10px|class=imagenoire|link=Pokédollar|alt=Pokédollar]]" end end if frame.args[jeux[i] .. '-vente'] == nil or frame.args[jeux[i] .. '-vente'] == "-" or frame.args[jeux[i] .. '-vente'] == "—" then vente = "—" else vente = mw.text.trim( frame.args[jeux[i] .. '-vente'] ) .. " [[Fichier:Miniature Pokédollar EB.png|10px|class=imagenoire|link=Pokédollar|alt=Pokédollar]]" end if jeux[i] == "ev" and frame.args["ev-recette-échantillons"] ~= nil and frame.args["ev-recette-pl"] ~= nil then if emplacement == "—" then table.insert(infos_jeux, '<tr class="ligne-jeu-recette"><td>' .. frame:expandTemplate{ title = 'Abréviation', args = { jeux[i] } } .. '</td><td colspan="'.. colspan - 2 .. '">Fabricable à la [[Machine à CT]]') else table.insert(infos_jeux, '<tr class="ligne-jeu"><td rowspan="2">' .. frame:expandTemplate{ title = 'Abréviation', args = { jeux[i] } } .. '</td><td colspan="' .. colspan - 3 .. '">' .. emplacement .. '</td><td>' .. achat .. '</td><td rowspan="2">' .. vente .. '</td></tr><tr class="ligne-jeu-recette-2"><td colspan="'.. colspan - 2 .. '">Fabricable à la [[Machine à CT]]') end if frame.args["ev-recette-condition"] ~= nil then table.insert(infos_jeux, ' après ' .. mw.text.trim(frame.args["ev-recette-condition"])) end table.insert(infos_jeux, ' pour ' .. mw.text.trim(frame.args["ev-recette-pl"]) .. ' [[PL]] et avec les échantillons suivants :<br />' .. mw.text.trim(frame.args["ev-recette-échantillons"]) .. '</td>') if emplacement == "—" then table.insert(infos_jeux, '<td>' .. vente .. '</td>') end table.insert(infos_jeux, '</tr>') else table.insert(infos_jeux, '<tr class="ligne-jeu"><td>' .. frame:expandTemplate{ title = 'Abréviation', args = { jeux[i] } } .. '</td><td colspan="' .. colspan - 3 .. '">' .. emplacement .. '</td><td>' .. achat .. '</td><td>' .. vente .. '</td></tr>') end i = i + 1 end local poke = {} local aucun = "non" table.insert(poke, '<tr class="tableau-capsule-pokémon tableau-capsule-generation' .. generation) if frame.args['jeu'] then table.insert(poke, '-' .. frame.args['jeu'] .. '') end table.insert(poke, '-pokémon">') if frame.args['tous'] == "oui" or frame.args['tous'] == "sexués" then table.insert(poke, '<td class="cellule-unique" colspan="' .. colspan + 1 .. '">Tout Pokémon') if frame.args['tous'] == "sexués" then table.insert(poke, ' sexué') end table.insert(poke, ' pouvant apprendre une capacité par capsule peut apprendre ' .. capacite) if frame.args['exceptions'] then table.insert(poke, ' sauf ' .. frame.args['exceptions']) end table.insert(poke, '.</td>') else local y = 1 local z = 1 local colspan_poke if poke_aptes[1] == "" then aucun = "oui" table.insert(poke, '<td class="cellule-unique" colspan="' .. colspan + 1 .. '">\'\'Incomplet\'\'</td>') end while poke_aptes[y] and aucun == "non" do if generation == 3 and (z == 1 or z == 3 or z == 5) then colspan_poke = 2 elseif generation == 4 and (z == 3 or z == 4) then colspan_poke = 2 elseif generation == 9 and z == 6 then colspan_poke = 2 else colspan_poke = 1 end table.insert(poke, '<td colspan="' .. colspan_poke .. '" style="text-align: left;">' .. ressources.infosPokemon( poke_aptes[y] ) .. '</td>') y = y + 1 if z == 6 then table.insert(poke, '</tr><tr class="tableau-capsule-pokémon tableau-capsule-generation' .. generation) if frame.args['jeu'] then table.insert(poke, '-' ..frame.args['jeu'] .. '') end table.insert(poke, '-pokémon">') z = 1 else z = z + 1 end end end table.insert(poke, '</tr>') local donnees = ressources.donneesCapacite(generation, capacite, jeux) local resultat = {} table.insert(resultat, '<table class="tableaustandard centre ' .. donnees["type"] .. ' tableau-capsule tableau-capsule-generation' .. generation .. '" style="width: 90%;"><caption><h3>' .. titre.. '</h3></caption><tr class="ligne-1">') if ressources.indexTableau(jeux, "ev") then table.insert(resultat, '<th>Vignette</th>') end table.insert(resultat, '<th>Capacité</th><th>Type</th><th>Catégorie</th><th>Puissance</th><th>Précision</th><th>PP</th>') if generation == 3 or generation == 6 then table.insert(resultat, '<th>[[Concours Pokémon|Type concours]]</th><th>[[Charme (concours)|Charme]]</th><th>[[Blocage (concours)|Blocage]]</th>') elseif generation == 4 then table.insert(resultat, '<th>[[Concours Pokémon|Type concours]]</th><th>[[Charme (concours)|Charme]]</th>') end table.insert(resultat, '</tr><tr class="ligne-2">') if ressources.indexTableau(jeux, "ev") then rowspan = #jeux + 2 if frame.args["ev-recette-échantillons"] ~= nil and frame.args["ev-recette-pl"] ~= nil then rowspan = rowspan + 1 end table.insert(resultat, '<td rowspan="' .. rowspan .. '">[[Fichier:Vignette ' .. frame:getParent():getTitle() .. ' EV.png|150px]]</td>') end for j = 1, colspan do table.insert(resultat, '<td>' .. donnees[j] .. '</td>') end table.insert(resultat, '</tr><tr class="ligne-3"><th>Jeu</th><th colspan="' .. colspan - 3 .. '">Emplacement</th><th>Achat</th><th>Vente</th></tr>' .. table.concat(infos_jeux, "")) local j = 1 local galerie = {} if frame.args['image1'] then table.insert(galerie, '<gallery widths="180px" heights="120px">') end while frame.args['image' .. j] do if frame.args['image' .. j .. '-description'] == nil then frame.args['image' .. j .. '-description'] = "" end table.insert(galerie, frame.args['image' .. j] .. '|' .. frame.args['image' .. j .. '-description'] .. '\n') j = j + 1 end if frame.args['image1'] then table.insert(galerie, '</gallery>') table.insert(resultat, '<tr><td colspan="' .. colspan .. '">' .. frame:preprocess( table.concat(galerie, "") .. '</td></tr>' ) ) end table.insert(resultat, '<tr><th colspan=' .. colspan + 1 .. '>Pokémon aptes</th></tr>') if frame.args['tous'] ~= "oui" and frame.args['tous'] ~= "sexués" and aucun ~= "oui" then table.insert(resultat, '<tr><td colspan="' .. colspan + 1 .. '"><button type="button" name="tableau-capsule-generation' .. generation .. '') if frame.args['jeu'] then table.insert(resultat, '-' .. frame.args['jeu']) end table.insert(resultat, '-pokémon" value="afficher" style="font-size:80%" title="[-] Masquer les Pokémon aptes">[+] Afficher les Pokémon aptes</button></td></tr>') end table.insert(resultat, table.concat(poke, "") .. '</table>') return table.concat(resultat, "") end return p