Ce module contient les fonctions permettant de créer des modèles concernant les stats (d'ennemis, objets, etc) de Kingdom Hearts: Birth by Sleep.

Fonction StatsBBSCategorieEnnemi

Cette fonction détermine à quelles catégories ajouter un ennemi, selon qu'il est un ennemi standard ou un boss et qu'il apparaisse dans Birth by Sleep ou uniquement Kingdom Hearts: Birth by Sleep Final Mix.

Elle reçoit un paramètre "args", version nettoyée des arguments tirés de l'appel du modèle. Il s'agit d'un tableau contenant les informations reprises dans le tableau ci-dessous.

Arguments Utilisation
BBSboss Indique que l'ennemi est un boss si le paramètre est utilisé
boss Indique que l'ennemi est un boss si le paramètre est utilisé (permet d'utiliser un argument comment si l'ennemi est un boss pour toutes ses apparitions dans la série)
BBSFM Indique que l'ennemi est exclusif à Birth by Sleep Final Mix si le paramètre est utilisé

Fonction StatsBBS.Ennemi

Cette fonction génère le tableau de statistiques d'un ennemi de Birth by Sleep.

Elle reçoit deux paramètres :

  • args, version nettoyée des arguments tirés de l'appel du modèle. Il s'agit d'un tableau contenant les informations reprises dans le tableau ci-dessous.
  • multiples : valeur booléenne indiquant si d'autres tableaux de stats sont utilisés (permet de générer le tabber).
Paramètre Sous-paramètre Utilisation
BBSHP - Multiplicateur de HP
BBSEXP - Multiplicateur d'EXP
BBSEXPArene - Multiplicateur d'EXP à l'Arène des Mirages
BBSlocBoss 1-7 Caractéristiques de l'ennemi s'il est un Boss (et ne suit pas les règles de niveau de combat) :
  • Monde
  • HP
  • Force
  • Défense
  • Niveau de combat.
BBSHPBoss
BBSForBoss
BBSDefBoss
BBSnivBoss
BBSlocNiv 1-10 Mondes où l'ennemi apparaît à un niveau de combat donné (1 à 10)
BBSlocBossArène 1-3 Missions et HP d'un Boss à l'Arène des Mirages.
BBSHPBossArène
BBSJour de patrouille - Indique si l'ennemi (normal) apparaît dans la mission concernée.
BBSCarrosse féroce
BBSRichesse risquée
BBSQuenouille folle
BBSPatrouille sinistre
BBSSonneur funèbre
BBSMenace rouge
BBSTrésor risqué
BBSRude sentence
BBSMorsure du froid
BBSImitateur suprême
BBSGardiens de l'Arène
BBSMonstre marin
BBSarme - Résistance aux éléments et altérations d'états concernés
BBSbrasier
BBSglacier
BBSfoudre
BBSten
BBSautre
BBSko
BBSglaciation
BBSmini
BBSblackout
BBSmise à feu
BBSfolie
BBSficelage
BBSpoison
BBSsomni
BBSstop
BBSsommeil
BBSmort
BBSgravité nulle
BBSaimant
BBSzappeur
BBSrecomp - Récompense spéciale (par exemple d'un Boss)
BBSrecomp% - Chances d'abandonner un prix
BBSrecomp 1-5 Objet abandonné selon le niveau de magasin
BBSnivrecomp

local StatsBBS = {}

--Informations de niveau de combat et missions d'Arène
local BBSNiv = {
 ["1"] = {["HP"] = "30", ["EXP"] = "4", ["For"] = "7", ["Def"] = "3"},
 ["2"] = {["HP"] = "31", ["EXP"] = "6", ["For"] = "8", ["Def"] = "3"},
 ["3"] = {["HP"] = "32", ["EXP"] = "8", ["For"] = "11", ["Def"] = "4"},
 ["4"] = {["HP"] = "36", ["EXP"] = "10", ["For"] = "14", ["Def"] = "6"},
 ["5"] = {["HP"] = "40", ["EXP"] = "13", ["For"] = "16", ["Def"] = "9"},
 ["6"] = {["HP"] = "46", ["EXP"] = "17", ["For"] = "19", ["Def"] = "12"},
 ["7"] = {["HP"] = "53", ["EXP"] = "25", ["For"] = "23", ["Def"] = "14"},
 ["8"] = {["HP"] = "57", ["EXP"] = "35", ["For"] = "25", ["Def"] = "15"},
 ["9"] = {["HP"] = "61", ["EXP"] = "48", ["For"] = "26", ["Def"] = "15"},
 ["10"] = {["HP"] = "66", ["EXP"] = "65", ["For"] = "27", ["Def"] = "16"},
 ["99"] = {["For"] = "80", ["Def"] = "27"},
 ["Jour de patrouille"] = {["HP"] = "50", ["EXP"] = "10", ["For"] = "13", ["Def"] = "4"},
 ["Richesse risquée"] = {["HP"] = "50", ["EXP"] = "10", ["For"] = "13", ["Def"] = "4"},
 ["Carrosse féroce"] = {["HP"] = "55", ["EXP"] = "12", ["For"] = "16", ["Def"] = "5"},
 ["Quenouille folle"] = {["HP"] = "60", ["EXP"] = "16", ["For"] = "19", ["Def"] = "7"},
 ["Sonneur funèbre"] = {["HP"] = "60", ["EXP"] = "16", ["For"] = "19", ["Def"] = "7"},
 ["Patrouille sinistre"] = {["HP"] = "75", ["EXP"] = "19", ["For"] = "21", ["Def"] = "10"},
 ["Trésor risqué"] = {["HP"] = "75", ["EXP"] = "19", ["For"] = "21", ["Def"] = "10"},
 ["Menace rouge"] = {["HP"] = "85", ["EXP"] = "27", ["For"] = "24", ["Def"] = "13"},
 ["Rude sentence"] = {["HP"] = "85", ["EXP"] = "27", ["For"] = "24", ["Def"] = "13"},
 ["Morsure du froid"] = {["HP"] = "105", ["EXP"] = "45", ["For"] = "30", ["Def"] = "16"},
 ["Imitateur suprême"] = {["HP"] = "105", ["EXP"] = "45", ["For"] = "30", ["Def"] = "16"},
 ["Monstre marin"] = {["HP"] = "105", ["EXP"] = "45", ["For"] = "30", ["Def"] = "16"},
 ["Gardiens de l'Arène"] = {["HP"] = "130", ["EXP"] = "63", ["For"] = "36", ["Def"] = "19"},
 ["Vengeance des boss"] = {["For"] = "40", ["Def"] = "20"},
 ["Inconnu"]={["For"] = "???", ["Def"] = "???"}
}
--<includeonly>
function StatsBBS.CategorieEnnemi(args) 
    if args["boss"] or args["BBSboss"] then
        if args["BBSFM"] then return "[[Catégorie:Boss Kingdom Hearts: Birth by Sleep Final Mix]]" else return "[[Catégorie:Boss Kingdom Hearts: Birth by Sleep]]" end 
    else
        if args["BBSFM"] then return "[[Catégorie:Ennemis Kingdom Hearts: Birth by Sleep Final Mix]]" else return "[[Catégorie:Ennemis Kingdom Hearts: Birth by Sleep]]" end 
    end
end
--</includeonly>
function StatsBBS.Ennemi(args, multiples)
	local Template=require("Module:Stats/Template")
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Template.OpenTab(args, "BBS") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Template.OpenContainer(args["theme"])
    if (args["BBSlocNiv1"] ~= nil or args["BBSlocNiv2"] ~= nil or args["BBSlocNiv3"] ~= nil or args["BBSlocNiv4"] ~= nil or args["BBSlocNiv5"] ~= nil or args["BBSlocNiv6"] ~= nil or args["BBSlocNiv7"] ~= nil or args["BBSlocNiv8"] ~= nil or args["BBSlocNiv9"] ~= nil or args["BBSlocNiv10"] ~= nil) then
        stringBuilder = stringBuilder .. Template.OpenBox()
        stringBuilder = stringBuilder .. Template.Header("Statistiques",6)
        stringBuilder = stringBuilder .. Template.LabelRow({
            {["label"] = "[[Niveau de combat|Niveau]]", ["style"] = "width:10%;"},
            {["label"] = "Monde", ["style"] = "width:50%; padding-left:1em;"},
            {["label"] = 'HP', ["style"] = "width:10%;"},
            {["label"] = "EXP", ["style"] = "width:10%;"},
            {["label"] = "Force", ["style"] = "width:10%;"},
            {["label"] = "Défense", ["style"] = "width:10%;"}
        })
        for i=1,10 do
            if args["BBSlocNiv"..tostring(i)] ~= nil then
                stringBuilder = stringBuilder .. Template.DataRow({
                    {["data"] = tostring(i), ["class"] = "numberData"},
                    {["data"] = args["BBSlocNiv"..tostring(i)], ["class"] = "textData"},
                    {["data"] = Template.round(args["BBSHP"]*BBSNiv[tostring(i)]["HP"]), ["class"] = "numberData"},
                    {["data"] = Template.round(args["BBSEXP"]*BBSNiv[tostring(i)]["EXP"]), ["class"] = "numberData"},
                    {["data"] = BBSNiv[tostring(i)]["For"], ["class"] = "numberData"},
                    {["data"] = BBSNiv[tostring(i)]["Def"], ["class"] = "numberData"}
                })
            end
        end
        stringBuilder = stringBuilder .. Template.CloseContainer()
        stringBuilder = stringBuilder .. Template.ContainerLine()
    end
    if args["BBSlocBoss1"] ~= nil then
        stringBuilder = stringBuilder .. Template.OpenBox()
        stringBuilder = stringBuilder .. Template.Header("Statistiques",4)
        stringBuilder = stringBuilder .. Template.LabelRow({
            {["label"] = "Monde", ["style"] = "width:43%; padding-left:1em;"},
            {["label"] = 'HP', ["style"] = "width:19%;"},
            {["label"] = "Force", ["style"] = "width:19%;"},
            {["label"] = "Défense", ["style"] = "width:19%;"}
        })
        for i=1,7 do
            if args["BBSlocBoss"..tostring(i)] ~= nil then
                stringBuilder = stringBuilder .. Template.DataRow({
                    {["data"] = args["BBSlocBoss"..tostring(i)], ["class"] = "textData"},
                    {["data"] = args["BBSHPBoss"..tostring(i)], ["class"] = "numberData"},
                    {["data"] = BBSNiv[tostring(args["BBSnivBoss" .. tostring(i)])]["For"], ["class"] = "numberData"},
                    {["data"] = BBSNiv[tostring(args["BBSnivBoss" .. tostring(i)])]["Def"], ["class"] = "numberData"}
                })
            end
        end
        stringBuilder = stringBuilder .. Template.CloseContainer()
        stringBuilder = stringBuilder .. Template.ContainerLine()
    end
    local combatsArene = {"Jour de patrouille", "Richesse risquée", "Carrosse féroce", "Quenouille folle", "Sonneur funèbre", "Patrouille sinistre", "Trésor risqué", "Menace rouge", "Rude sentence", "Morsure du froid", "Imitateur suprême", "Monstre marin", "Gardiens de l'Arène"}
    local arene = false
    for _, i in ipairs(combatsArene) do
        if args["BBS"..i] ~= nil then
            arene = true
            break
        end
    end
    if arene then
        stringBuilder = stringBuilder .. Template.OpenBox()
        stringBuilder = stringBuilder .. Template.Header("Statistiques (Arène des Mirages)",5)
        stringBuilder = stringBuilder .. Template.LabelRow({
            {["label"] = "Combat", ["style"] = "width:60%; padding-left:1em;"},
            {["label"] = 'HP', ["style"] = "width:10%;"},
            {["label"] = "EXP", ["style"] = "width:10%;"},
            {["label"] = "Force", ["style"] = "width:10%;"},
            {["label"] = "Défense", ["style"] = "width:10%;"}
        })
        for _, combat in ipairs(combatsArene) do
            if args["BBS"..combat] ~= nil then
                stringBuilder = stringBuilder .. Template.DataRow({
                    {["data"] = "[["..combat.."]]", ["class"] = "textData"},
                    {["data"] = Template.round(args["BBSHP"]*BBSNiv[combat]["HP"]), ["class"] = "numberData"},
                    {["data"] = Template.round((args["BBSEXPArene"] or args["BBSEXP"])*BBSNiv[combat]["EXP"]), ["class"] = "numberData"},
                    {["data"] = BBSNiv[combat]["For"], ["class"] = "numberData"},
                    {["data"] = BBSNiv[combat]["Def"], ["class"] = "numberData"}
                })
            end
        end
        stringBuilder = stringBuilder .. Template.CloseContainer()
        stringBuilder = stringBuilder .. Template.ContainerLine()
    end
    if args["BBSlocBossArène1"] ~= nil then
        stringBuilder = stringBuilder .. Template.OpenBox()
        stringBuilder = stringBuilder .. Template.Header("Statistiques (Arène des Mirages)",4)
        stringBuilder = stringBuilder .. Template.LabelRow({
            {["label"] = "Combat", ["style"] = "width:43%; padding-left:1em;"},
            {["label"] = 'HP', ["style"] = "width:19%;"},
            {["label"] = "Force", ["style"] = "width:19%;"},
            {["label"] = "Défense", ["style"] = "width:19%;"}
        })
        for i=1,3 do
            if args["BBSlocBossArène"..tostring(i)] ~= nil then
                stringBuilder = stringBuilder .. Template.DataRow({
                    {["data"] = "[["..args["BBSlocBossArène"..tostring(i)].."]]", ["class"] = "textData"},
                    {["data"] = args["BBSHPBossArène"..tostring(i)], ["class"] = "numberData"},
                    {["data"] = BBSNiv[args["BBSlocBossArène"..tostring(i)]]["For"], ["class"] = "numberData"},
                    {["data"] = BBSNiv[args["BBSlocBossArène"..tostring(i)]]["Def"], ["class"] = "numberData"}
                })
            end
        end
        stringBuilder = stringBuilder .. Template.CloseContainer()
        stringBuilder = stringBuilder .. Template.ContainerLine()
    end
    stringBuilder = stringBuilder .. Template.OpenBox()
    stringBuilder = stringBuilder .. Template.Header("Faiblesses/Résistances",6)
    stringBuilder = stringBuilder .. Template.LabelRow({
        {["label"] = "Arme", ["style"]="width:16.6%;"},
        {["label"] = "Brasier", ["style"]="width:16.6%;"},
        {["label"] = "Glacier", ["style"]="width:16.6%;"},
        {["label"] = "Foudre", ["style"]="width:16.6%;"},
        {["label"] = "Ténèbres", ["style"]="width:16.6%;"},
        {["label"] = "Autre", ["style"]="width:16.6%;"}
    })
    stringBuilder = stringBuilder .. Template.DataRow({
        {["data"] = (args["BBSarme"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["BBSbrasier"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["BBSglacier"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["BBSfoudre"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["BBSten"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["BBSautre"] or "x1.0"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Template.CloseContainer()
    stringBuilder = stringBuilder .. Template.ContainerLine()
    stringBuilder = stringBuilder .. Template.OpenBox()
    stringBuilder = stringBuilder .. Template.Header("Altérations d'état",5)
    stringBuilder = stringBuilder .. Template.LabelRow({
        {["label"] = "KO", ["style"]="width:20%;"},
        {["label"] = "Glaciation", ["style"]="width:20%;"},
        {["label"] = "Mini", ["style"]="width:20%;"},
        {["label"] = "Black-out", ["style"]="width:20%;"},
        {["label"] = "Mise à feu", ["style"]="width:20%;"}
    })
    stringBuilder = stringBuilder .. Template.DataRow({
        {["data"] = (args["BBSko"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["BBSglaciation"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["BBSmini"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["BBSblackout"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["BBSmise à feu"] or "O"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Template.LabelRow({
        {["label"] = "Folie"},
        {["label"] = "Ficelage"},
        {["label"] = "Poison"},
        {["label"] = "Somni"},
        {["label"] = "Stop"}
    })
    stringBuilder = stringBuilder .. Template.DataRow({
        {["data"] = (args["BBSfolie"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["BBSficelage"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["BBSpoison"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["BBSsomni"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["BBSstop"] or "O"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Template.LabelRow({
        {["label"] = "Sommeil"},
        {["label"] = "Mort"},
        {["label"] = "Gravité nulle"},
        {["label"] = "Aimant"},
        {["label"] = "Zappeur"}
    })
    stringBuilder = stringBuilder .. Template.DataRow({
        {["data"] = (args["BBSsommeil"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["BBSmort"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["BBSgravité nulle"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["BBSaimant"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["BBSzappeur"] or "O"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Template.CloseContainer()
    stringBuilder = stringBuilder .. Template.ContainerLine()
    stringBuilder = stringBuilder .. Template.OpenBox()
    if args["BBSrecomp"] ~= nil then
        stringBuilder = stringBuilder .. Template.Header("Récompenses",2)
        stringBuilder = stringBuilder .. Template.DataRow({
            {["data"] = args["BBSrecomp"], ["class"] = "textData", ["colspan"]=2}
        })
        if args["BBSorbes"] ~= nil then
            stringBuilder = stringBuilder .. Template.MixedRow({
                {["label"] = 1, ["style"]="width:30%;", ["text"]="Orbes"},
                {["text"]=args["BBSorbes"]}
            })
        end
    elseif args["BBSorbes"]~= nil or args["BBSrecomp%"] ~= nil then
        local width=0
        local labels = {}
        local datas = {}
        for i = 1,5 do
            if args["BBSrecomp"..tostring(i)]~= nil then
                width = width +1
                table.insert(labels, {["label"] = args["BBSnivrecomp"..tostring(i)], ["style"]="width:20%;", ["colspan"]=2})
                table.insert(datas, {["data"] = args["BBSrecomp"..tostring(i)], ["class"] = "textData", ["colspan"]=2})
            end
        end
        stringBuilder = stringBuilder .. Template.Header("Récompenses",width*2)
        if args["BBSorbes"] ~= nil then
            stringBuilder = stringBuilder .. Template.MixedRow({
                {["label"]=1, ["colspan"]=width, ["text"]="Orbes"},
                {["colspan"]=width, ["text"]=args["BBSorbes"]}
            })
        end
        if args["BBSorbesArene"] ~= nil then
            stringBuilder = stringBuilder .. Template.MixedRow({
                {["label"]=1, ["colspan"]=width, ["text"]="Orbes (Arène des Mirages)"},
                {["colspan"]=width, ["text"]=args["BBSorbesArene"]}
            })
        end
        if args["BBSrecomp%"]~= nil then
            stringBuilder = stringBuilder .. Template.MixedRow({
                {["label"]=1, ["colspan"]=width, ["text"]="Taux d'objets"},
                {["colspan"]=width, ["text"]=args["BBSrecomp%"]}
            })
            stringBuilder = stringBuilder .. Template.Separator("Niveau de boutique", width*2)
            stringBuilder = stringBuilder .. Template.LabelRow(labels)
            stringBuilder = stringBuilder .. Template.DataRow(datas)
        end
    end
    stringBuilder = stringBuilder .. Template.CloseContainer()
    stringBuilder = stringBuilder .. Template.CloseFinal()
    if multiples then stringBuilder = stringBuilder .. Template.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end

return StatsBBS
Sauf mention contraire, le contenu de la communauté est disponible sous licence CC-BY-SA.