Module:Collection : Différence entre versions
Ligne 118 : | Ligne 118 : | ||
"UBISWX14", | "UBISWX14", | ||
"UBISWX15", | "UBISWX15", | ||
+ | "UBISWX21", | ||
+ | "UBISWX11", | ||
+ | "UBISWX22", | ||
+ | "UBISWX16", | ||
+ | "UBISWX17", | ||
+ | "UBISWX18", | ||
+ | "UBISWX19", | ||
+ | "UBISWX29", | ||
+ | "UBISWX23", | ||
+ | "UBISWX24", | ||
+ | "UBISWX25", | ||
+ | "UBISWX26", | ||
+ | "UBISWX27", | ||
+ | "UBISWX28", | ||
+ | "UBISWX30", | ||
+ | "UBISWX31", | ||
+ | "UBISWX32", | ||
+ | "UBISWX33", | ||
+ | "UBISWX34", | ||
+ | "UBISWX35", | ||
+ | "UBISWX37", | ||
+ | "UBISWX38", | ||
+ | "UBISWX39", | ||
+ | "UBISWX40", | ||
+ | "UBISWX41", | ||
+ | "UBISWX42", | ||
+ | "UBISWX52", | ||
+ | "UBISWX57", | ||
+ | "UBISWX53", | ||
+ | "UBISWX54", | ||
+ | "UBISWX55", | ||
+ | "UBISWX56", | ||
+ | "UBISWX59", | ||
+ | "UBISWX60", | ||
+ | "UBISWX61", | ||
+ | "UBISWX62", | ||
+ | "UBISWX63", | ||
+ | "UBISWX58", | ||
+ | "UBISWX64", | ||
+ | "UBISWX65", | ||
+ | "UBISWX66", | ||
+ | "UBISWX73", | ||
+ | "UBISWX69", | ||
+ | "UBISWX70", | ||
+ | "UBISWX72", | ||
+ | "UBISWX67", | ||
+ | "UBISWX68", | ||
} | } | ||
Version du 17 janvier 2018 à 14:26
La documentation pour ce module peut être créée à Module:Collection/doc
local p = {} local Boite = {} Boite["UBISWX01"] = { titre = "X-wing Le jeu de figurine", vaisseaux = { xwing = 1, chasseurtie = 2, }, } Boite["UBISWX36"] = { titre = "X-wing Le Réveil de la Force", vaisseaux = { xwingt70 = 1, chasseurtiefo = 2, }, } Boite["UBISWX02"] = { titre = "X-wing Paquet d'extension", vaisseaux = { xwing = 1, }, } Boite["UBISWX03"] = { titre = "Chasseur Tie Paquet d'extension", vaisseaux = { chasseurtie = 1, }, } Boite["UBISWX04"] = { titre = "Y-wing Paquet d'extension", vaisseaux = { ywing = 1, }, } Boite["UBISWX05"] = { titre = "Tie Advanced Paquet d'extension", vaisseaux = { tieadvanced = 1, }, } Boite["UBISWX06"] = { titre = "Faucon Millenium Paquet d'extension", vaisseaux = { yt1300 = 1, }, } Boite["UBISWX07"] = { titre = "Slave-1 Paquet d'extension", vaisseaux = { firespray31 = 1, }, } Boite["UBISWX08"] = { titre = "A-wing Paquet d'extension", vaisseaux = { awing = 1, }, } Boite["UBISWX09"] = { titre = "Intercepteur Tie Paquet d'extension", vaisseaux = { intercepteurtie = 1, }, } Boite["UBISWX12"] = { titre = "HWK-290 Paquet d'extension", vaisseaux = { hwk290 = 1, }, } Boite["UBISWX13"] = { titre = "Navette de classe Lambda Paquet d'extension", vaisseaux = { navetteclasselambda = 1, }, } Boite["UBISWX14"] = { titre = "B-wing Paquet d'extension", vaisseaux = { bwing = 1, }, } Boite["UBISWX15"] = { titre = "Bombardier Tie Paquet d'extension", vaisseaux = { bombardiertie = 1, }, } local Vaisseau = {} Vaisseau["chasseurtie"] = { nom = "Chasseur Tie", icone = "{{Chasseur Tie icone}}", lien = "[[Chasseur Tie]]", faction = "Empire galactique", } Vaisseau["xwing"] = { nom = "X-wing", icone = "{{X-wing icone}}", lien = "[[X-wing]]", faction = "Alliance rebelle", } local FabListe = { "UBISWX01", "UBISWX36", "UBISWX02", "UBISWX03", "UBISWX04", "UBISWX05", "UBISWX06", "UBISWX07", "UBISWX08", "UBISWX09", "UBISWX12", "UBISWX13", "UBISWX14", "UBISWX15", "UBISWX21", "UBISWX11", "UBISWX22", "UBISWX16", "UBISWX17", "UBISWX18", "UBISWX19", "UBISWX29", "UBISWX23", "UBISWX24", "UBISWX25", "UBISWX26", "UBISWX27", "UBISWX28", "UBISWX30", "UBISWX31", "UBISWX32", "UBISWX33", "UBISWX34", "UBISWX35", "UBISWX37", "UBISWX38", "UBISWX39", "UBISWX40", "UBISWX41", "UBISWX42", "UBISWX52", "UBISWX57", "UBISWX53", "UBISWX54", "UBISWX55", "UBISWX56", "UBISWX59", "UBISWX60", "UBISWX61", "UBISWX62", "UBISWX63", "UBISWX58", "UBISWX64", "UBISWX65", "UBISWX66", "UBISWX73", "UBISWX69", "UBISWX70", "UBISWX72", "UBISWX67", "UBISWX68", } function trim(s) return (string.gsub(s, "^%s*(.-)%s*$", "%1")) end function p.vaisseau(frame) local fabSelectStr = trim(frame.args[1]) or "" fabSelectTab={} fabSelectStr:gsub(".",function(c) table.insert(fabSelectTab,c) end) local vaissCollecTab={} retour = "Ma collection de boite : <br/>" for i, v in ipairs (fabSelectTab) do if fabSelectTab[i] ~= nil then if FabListe[i] ~= nil then if Boite[FabListe[i]] ~= nil then retour = retour .. "* " .. Boite[FabListe[i]].titre .. " x " .. fabSelectTab[i] .. "<br/>" for k, v in pairs (Boite[FabListe[i]].vaisseaux) do if vaissCollecTab[k] == nil then vaissCollecTab[k] = v * fabSelectTab[i] else vaissCollecTab[k] = vaissCollecTab[k] + (v * fabSelectTab[i]) end end end end end end retour = retour .. "Ma collection de vaisseau : <br/>" for k, v in pairs (vaissCollecTab) do if Vaisseau[k] ~= nil then retour = retour .. "* " .. Vaisseau[k].icone .. " x " .. v .. "<br/>" else retour = retour .. "* " .. k .. " x " .. v .. "<br/>" end end return retour end return p