Ce module contient les fonctions permettant de créer des modèles concernant les stats (d'ennemis, objets, etc) de Kingdom Hearts: 358/2 Days.

Fonction Stats358.CategorieEnnemi

Cette fonction détermine à quelles catégories ajouter un ennemi, selon qu'il est un ennemi standard ou un boss.

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
358boss 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)

Fonction Stats358.Ennemi

Cette fonction génère le tableau de statistiques d'un ennemi de Kingdom Hearts: 358/2 Days.

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
358HP - Multiplicateur de HP
358EXP - Multiplicateur d'expérience
358Def - Multiplicateur de défense
358Def2 - Multiplicateur de défense (pour les ennemis dont la défense varie entre deux valeurs)
358mission 1-24 Missions où l'ennemi apparaît, et niveau de l'ennemi dans la mission en question. Les statistiques sont calculées automatiquement.
358niv
358brasier - Résistances aux différents éléments et altérations d'état.
358glacier
358foudre
358rafale
358enflammé
358gelé
358électrocuté
358projeté
358étourdissement - Résistance à l'étourdissement
358puissance 1-8 Caractéristiques des attaques de l'ennemi :
  • Puissance
  • Type (physique/magique)
  • Elément
  • Altération d'état
  • Détermine si l'attaque peut être parée ou renvoyée.
358type
358element
358altération
358parade
358coeur - Multiplicateur des points de cœur
358munnies - Multiplicateur des munnies
358recomp - Récompenses spéciales (par exemple pour les Boss)
358recomp1-14 - Objets relâchés dans les missions correspondantes.
358recomp15-35
358recomp36-50
358recomp51-61
358recomp62-72
358recomp73-93

local Stats358 = {}

--Informations propres à chaque mission
local KH358Mission = {
 ["0"] = {["EXP"]= "1", ["PC"]= "1", ["Munnies"]="0"},
 ["1"] = {["EXP"]= "0", ["PC"]= "1", ["Munnies"]="0"},
 ["2"] = {["EXP"]= "1.01", ["PC"]= "1.05", ["Munnies"]="3.15"},
 ["3"] = {["EXP"]= "1.02", ["PC"]= "1.10", ["Munnies"]="3.30"},
 ["4"] = {["EXP"]= "1.03", ["PC"]= "1.15", ["Munnies"]="3.45"},
 ["5"] = {["EXP"]= "1.04", ["PC"]= "1.20", ["Munnies"]="3.60"},
 ["6"] = {["EXP"]= "1.05", ["PC"]= "1.25", ["Munnies"]="3.75"},
 ["7"] = {["EXP"]= "1.05", ["PC"]= "1.30", ["Munnies"]="3.90"},
 ["8"] = {["EXP"]= "1.07", ["PC"]= "1.60", ["Munnies"]="4.80"},
 ["9"] = {["EXP"]= "1.07", ["PC"]= "1.60", ["Munnies"]="4.80"},
 ["10"] = {["EXP"]= "1.07", ["PC"]= "1.60", ["Munnies"]="4.80"},
 ["11"] = {["EXP"]= "1.09", ["PC"]= "1.65", ["Munnies"]="4.95"},
 ["12"] = {["EXP"]= "1.11", ["PC"]= "1.70", ["Munnies"]="5.10"},
 ["13"] = {["EXP"]= "1.13", ["PC"]= "1.75", ["Munnies"]="5.25"},
 ["14"] = {["EXP"]= "1.15", ["PC"]= "1.80", ["Munnies"]="5.40"},
 ["15"] = {["EXP"]= "1.17", ["PC"]= "1.85", ["Munnies"]="5.55"},
 ["16"] = {["EXP"]= "1.19", ["PC"]= "2.15", ["Munnies"]="6.45"},
 ["17"] = {["EXP"]= "1.19", ["PC"]= "2.15", ["Munnies"]="6.45"},
 ["18"] = {["EXP"]= "1.19", ["PC"]= "2.15", ["Munnies"]="6.45"},
 ["19"] = {["EXP"]= "1.19", ["PC"]= "2.15", ["Munnies"]="6.45"},
 ["20"] = {["EXP"]= "1.22", ["PC"]= "2.20", ["Munnies"]="6.60"},
 ["21"] = {["EXP"]= "1.25", ["PC"]= "2.25", ["Munnies"]="6.75"},
 ["22"] = {["EXP"]= "1.28", ["PC"]= "2.30", ["Munnies"]="6.90"},
 ["23"] = {["EXP"]= "1.31", ["PC"]= "2.35", ["Munnies"]="7.05"},
 ["24"] = {["EXP"]= "1.34", ["PC"]= "2.65", ["Munnies"]="7.95"},
 ["25"] = {["EXP"]= "1.34", ["PC"]= "2.65", ["Munnies"]="7.95"},
 ["26"] = {["EXP"]= "1.34", ["PC"]= "2.65", ["Munnies"]="7.95"},
 ["27"] = {["EXP"]= "1.34", ["PC"]= "2.65", ["Munnies"]="7.95"},
 ["28"] = {["EXP"]= "1.34", ["PC"]= "2.65", ["Munnies"]="7.95"},
 ["29"] = {["EXP"]= "1.38", ["PC"]= "2.70", ["Munnies"]="8.10"},
 ["30"] = {["EXP"]= "1.42", ["PC"]= "2.75", ["Munnies"]="8.25"},
 ["31"] = {["EXP"]= "1.46", ["PC"]= "2.80", ["Munnies"]="8.40"},
 ["32"] = {["EXP"]= "1.5", ["PC"]= "3.10", ["Munnies"]="9.30"},
 ["33"] = {["EXP"]= "1.5", ["PC"]= "3.10", ["Munnies"]="9.30"},
 ["34"] = {["EXP"]= "1.5", ["PC"]= "3.10", ["Munnies"]="9.30"},
 ["35"] = {["EXP"]= "1.5", ["PC"]= "3.10", ["Munnies"]="9.30"},
 ["36"] = {["EXP"]= "1.54", ["PC"]= "1.15", ["Munnies"]="9.45"},
 ["37"] = {["EXP"]= "0", ["PC"]= "3.20", ["Munnies"]="0"},
 ["38"] = {["EXP"]= "1.63", ["PC"]= "3.50", ["Munnies"]="10.50"},
 ["39"] = {["EXP"]= "1.63", ["PC"]= "3.50", ["Munnies"]="10.50"},
 ["40"] = {["EXP"]= "1.63", ["PC"]= "3.50", ["Munnies"]="10.50"},
 ["41"] = {["EXP"]= "1.63", ["PC"]= "3.50", ["Munnies"]="10.50"},
 ["42"] = {["EXP"]= "1.69", ["PC"]= "3.55", ["Munnies"]="10.65"},
 ["43"] = {["EXP"]= "1.75", ["PC"]= "3.60", ["Munnies"]="10.80"},
 ["44"] = {["EXP"]= "1.81", ["PC"]= "3.65", ["Munnies"]="10.95"},
 ["45"] = {["EXP"]= "1.88", ["PC"]= "3.95", ["Munnies"]="11.85"},
 ["46"] = {["EXP"]= "1.88", ["PC"]= "3.95", ["Munnies"]="11.85"},
 ["47"] = {["EXP"]= "1.88", ["PC"]= "3.95", ["Munnies"]="11.85"},
 ["48"] = {["EXP"]= "1.88", ["PC"]= "3.95", ["Munnies"]="11.85"},
 ["49"] = {["EXP"]= "1.88", ["PC"]= "3.95", ["Munnies"]="11.85"},
 ["50"] = {["EXP"]= "1.96", ["PC"]= "4.00", ["Munnies"]="12.00"},
 ["51"] = {["EXP"]= "2.05", ["PC"]= "4.05", ["Munnies"]="12.15"},
 ["52"] = {["EXP"]= "2.15", ["PC"]= "4.35", ["Munnies"]="13.05"},
 ["53"] = {["EXP"]= "2.15", ["PC"]= "4.35", ["Munnies"]="13.05"},
 ["54"] = {["EXP"]= "2.15", ["PC"]= "4.35", ["Munnies"]="13.05"},
 ["55"] = {["EXP"]= "2.15", ["PC"]= "4.35", ["Munnies"]="13.05"},
 ["56"] = {["EXP"]= "2.27", ["PC"]= "4.40", ["Munnies"]="13.20"},
 ["57"] = {["EXP"]= "2.41", ["PC"]= "4.70", ["Munnies"]="14.10"},
 ["58"] = {["EXP"]= "2.41", ["PC"]= "4.70", ["Munnies"]="14.10"},
 ["59"] = {["EXP"]= "2.41", ["PC"]= "4.70", ["Munnies"]="14.10"},
 ["60"] = {["EXP"]= "2.41", ["PC"]= "4.70", ["Munnies"]="14.10"},
 ["61"] = {["EXP"]= "2.57", ["PC"]= "4.75", ["Munnies"]="14.25"},
 ["62"] = {["EXP"]= "2.77", ["PC"]= "5.05", ["Munnies"]="15.15"},
 ["63"] = {["EXP"]= "2.77", ["PC"]= "5.05", ["Munnies"]="15.15"},
 ["64"] = {["EXP"]= "2.77", ["PC"]= "5.05", ["Munnies"]="15.15"},
 ["65"] = {["EXP"]= "2.99", ["PC"]= "5.10", ["Munnies"]="15.30"},
 ["66"] = {["EXP"]= "3.23", ["PC"]= "5.40", ["Munnies"]="16.20"},
 ["67"] = {["EXP"]= "3.23", ["PC"]= "5.40", ["Munnies"]="16.20"},
 ["68"] = {["EXP"]= "3.23", ["PC"]= "5.40", ["Munnies"]="16.20"},
 ["69"] = {["EXP"]= "3.53", ["PC"]= "5.70", ["Munnies"]="17.10"},
 ["70"] = {["EXP"]= "3.53", ["PC"]= "5.70", ["Munnies"]="17.10"},
 ["71"] = {["EXP"]= "3.53", ["PC"]= "5.70", ["Munnies"]="17.10"},
 ["72"] = {["EXP"]= "3.53", ["PC"]= "5.70", ["Munnies"]="17.10"},
 ["73"] = {["EXP"]= "3.93", ["PC"]= "5.75", ["Munnies"]="17.25"},
 ["74"] = {["EXP"]= "4.33", ["PC"]= "5.80", ["Munnies"]="17.40"},
 ["75"] = {["EXP"]= "4.73", ["PC"]= "5.85", ["Munnies"]="17.55"},
 ["76"] = {["EXP"]= "5.13", ["PC"]= "5.90", ["Munnies"]="17.70"},
 ["77"] = {["EXP"]= "5.53", ["PC"]= "5.95", ["Munnies"]="17.85"},
 ["78"] = {["EXP"]= "6.03", ["PC"]= "6.25", ["Munnies"]="18.75"},
 ["79"] = {["EXP"]= "6.03", ["PC"]= "6.25", ["Munnies"]="18.75"},
 ["80"] = {["EXP"]= "6.03", ["PC"]= "6.25", ["Munnies"]="18.75"},
 ["81"] = {["EXP"]= "6.03", ["PC"]= "6.25", ["Munnies"]="18.75"},
 ["82"] = {["EXP"]= "6.83", ["PC"]= "6.30", ["Munnies"]="18.90"},
 ["83"] = {["EXP"]= "7.83", ["PC"]= "6.60", ["Munnies"]="19.80"},
 ["84"] = {["EXP"]= "7.83", ["PC"]= "6.60", ["Munnies"]="19.80"},
 ["85"] = {["EXP"]= "7.83", ["PC"]= "6.60", ["Munnies"]="19.80"},
 ["86"] = {["EXP"]= "7.83", ["PC"]= "6.60", ["Munnies"]="19.80"},
 ["87"] = {["EXP"]= "7.83", ["PC"]= "6.60", ["Munnies"]="19.80"},
 ["88"] = {["EXP"]= "9.03", ["PC"]= "6.61", ["Munnies"]="19.83"},
 ["89"] = {["EXP"]= "10.63", ["PC"]= "6.62", ["Munnies"]="19.86"},
 ["90"] = {["EXP"]= "12.63", ["PC"]= "6.63", ["Munnies"]="19.89"},
 ["91"] = {["EXP"]= "14.83", ["PC"]= "6.64", ["Munnies"]="19.92"},
 ["92"] = {["EXP"]= "17.23", ["PC"]= "6.65", ["Munnies"]="19.95"},
 ["93"] = {["EXP"]= "19.83", ["PC"]= "6.66", ["Munnies"]="19.98"},
}
--<includeonly>
function Stats358.CategorieEnnemi(args) 
    if args["boss"] or args["358boss"] then
        return "[[Catégorie:Boss Kingdom Hearts: 358/2 Days]]" 
    else
        return "[[Catégorie:Ennemis Kingdom Hearts: 358/2 Days]]" 
    end 
end
--</includeonly>
function Stats358.Ennemi(args, multiples)
	local Template=require("Module:Stats/Template")
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Template.OpenTab(args, "358") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Template.OpenContainer(args["theme"])
    stringBuilder = stringBuilder .. Template.OpenBox()
    stringBuilder = stringBuilder .. Template.Header("Statistiques",7)
    stringBuilder = stringBuilder .. Template.LabelRow({
        {["label"] = "Mission", ["style"] = "width:28%;"},
        {["label"] = 'HP', ["style"] = "width:12%;"},
        {["label"] = "Force", ["style"] = "width:12%;"},
        {["label"] = "Défense", ["style"] = "width:12%;"},
        {["label"] = "EXP", ["style"] = "width:12%;"},
        {["label"] = "[[Points de Cœur|PC]]", ["style"] = "width:12%;"},
        {["label"] = "[[Munny|Munnies]]", ["style"] = "width:12%;"}
    })
    for i=1,23 do
        if args["358mission"..tostring(i)] ~= nil then
            if args["358HP"] == "-" then
                stringBuilder = stringBuilder .. Template.DataRow({
                    {["data"] = "Mission "..tostring(args["358mission"..tostring(i)]), ["class"] = "textData"},
                    {["data"] = "-", ["class"] = "numberData"},
                    {["data"] = "-", ["class"] = "numberData"},
                    {["data"] = "-", ["class"] = "numberData"},
                    {["data"] = "-", ["class"] = "numberData"},
                    {["data"] = "-", ["class"] = "numberData"},
                    {["data"] = "-", ["class"] = "numberData"}
                })
            else
                stringBuilder = stringBuilder .. Template.DataRow({
                    {["data"] = "Mission "..tostring(args["358mission"..tostring(i)]), ["class"] = "textData"},
                    {["data"] = Template.round(args["358HP"]*(args["358niv"..tostring(i)]*3+59)), ["class"] = "numberData"},
                    {["data"] = Template.round(args["358niv"..tostring(i)]*1.5+6), ["class"] = "numberData"},
                    {["data"] = tostring(Template.round(args["358Def"]*Template.round(args["358niv"..tostring(i)]*1.5+6))) .. (args["358Def2"] and ' - '.. tostring(Template.round(args["358Def2"]*Template.round(args["358niv"..tostring(i)]*1.5+6))) or ''), ["class"] = "numberData"},
                    {["data"] = (args["358EXP"] == "-" and "-" or Template.round(args["358EXP"]*KH358Mission[tostring(args["358mission"..tostring(i)])]["EXP"])), ["class"] = "numberData"},
                    {["data"] = (args["358coeur"] == "-" and "-" or Template.round(args["358coeur"]*KH358Mission[tostring(args["358mission"..tostring(i)])]["PC"])), ["class"] = "numberData"},
                    {["data"] = (args["358munnies"] == "-" and "-" or Template.round(args["358munnies"]*KH358Mission[tostring(args["358mission"..tostring(i)])]["Munnies"])), ["class"] = "numberData"}
                })
            end
        end
    end
    stringBuilder = stringBuilder .. Template.CloseContainer()
    if args["358puissance1"] ~= nil then
        stringBuilder = stringBuilder .. Template.ContainerLine()
        stringBuilder = stringBuilder .. Template.OpenBox()
        stringBuilder = stringBuilder .. Template.Header("Attaques",5)
        stringBuilder = stringBuilder .. Template.LabelRow({
            {["label"] = "Puissance", ["style"]="width:20%;"},
            {["label"] = "Type", ["style"]="width:20%;"},
            {["label"] = "Élément", ["style"]="width:20%;"},
            {["label"] = "Altération", ["style"]="width:20%;"},
            {["label"] = "Parade", ["style"]="width:20%;"}
        })
        for i=1,8 do
            if args["358puissance"..tostring(i)] ~= nil then
                stringBuilder = stringBuilder .. Template.DataRow({
                    {["data"] = args["358puissance"..tostring(i)], ["class"]="numberData"}, 
                    {["data"] = (args["358type"..tostring(i)] or "-"), ["class"]="numberData"}, 
                    {["data"] = (args["358element"..tostring(i)] or "-"), ["class"]="numberData"}, 
                    {["data"] = (args["358altération"..tostring(i)] or "-"), ["class"]="numberData"}, 
                    {["data"] = (args["358parade"..tostring(i)] or "-"), ["class"]="numberData"}
                })
            end
        end
        stringBuilder = stringBuilder .. Template.CloseContainer()
    end
    stringBuilder = stringBuilder .. Template.ContainerLine()
    stringBuilder = stringBuilder .. Template.OpenBox()
    stringBuilder = stringBuilder .. Template.Header("Faiblesses/Résistances",4)
    stringBuilder = stringBuilder .. Template.LabelRow({
        {["label"] = "Brasier", ["style"]="width:25%;"},
        {["label"] = "Glacier", ["style"]="width:25%;"},
        {["label"] = "Foudre", ["style"]="width:25%;"},
        {["label"] = "Rafale", ["style"]="width:25%;"}
    })
    stringBuilder = stringBuilder .. Template.DataRow({
        {["data"] = (args["358brasier"] or "x1.00"), ["class"]="numberData"}, 
        {["data"] = (args["358glacier"] or "x1.00"), ["class"]="numberData"}, 
        {["data"] = (args["358foudre"] or "x1.00"), ["class"]="numberData"}, 
        {["data"] = (args["358rafale"] or "x1.00"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Template.LabelRow({
        {["label"] = "Enflammé", ["style"]="width:25%;"},
        {["label"] = "Gelé", ["style"]="width:25%;"},
        {["label"] = "Électrocuté", ["style"]="width:25%;"},
        {["label"] = "Projeté", ["style"]="width:25%;"}
    })
    stringBuilder = stringBuilder .. Template.DataRow({
        {["data"] = (args["358enflammé"] or "x1.00"), ["class"]="numberData"}, 
        {["data"] = (args["358gelé"] or "x1.00"), ["class"]="numberData"}, 
        {["data"] = (args["358électrocuté"] or "x1.00"), ["class"]="numberData"}, 
        {["data"] = (args["358projeté"] or "x1.00"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Template.LabelRow({
        {["label"] = "Étourdissement", ["style"]="width:100%;", ["colspan"]=4}
    })
    stringBuilder = stringBuilder .. Template.DataRow({
        {["data"] = (args["358étourdissement"] or "Attaque normale"), ["class"]="numberData", ["colspan"]=4}
    })
    stringBuilder = stringBuilder .. Template.CloseContainer()
    if args["358recomp"] ~= nil or args["358recomp1-14"] ~=nil or args["358recomp15-35"] ~= nil or args["358recomp36-50"] ~= nil or args["358recomp51-61"] ~= nil or args["358recomp62-72"] ~= nil or args["358recomp73-93"] ~= nil then
        stringBuilder = stringBuilder .. Template.ContainerLine()
        stringBuilder = stringBuilder .. Template.OpenBox()
        stringBuilder = stringBuilder .. Template.Header("Récompenses",6)
        if args["358recomp"] ~= nil then
            stringBuilder = stringBuilder .. Template.DataRow({
                {["data"] = args["358recomp"], ["class"] = "textData", ["colspan"]=6}
            })
        end
        if args["358recomp1-14"] ~=nil or args["358recomp15-35"] ~= nil or args["358recomp36-50"] ~= nil or args["358recomp51-61"] ~= nil or args["358recomp62-72"] ~= nil or args["358recomp73-93"] ~= nil then
            stringBuilder = stringBuilder .. Template.Separator("Récompenses par mission",6)
            stringBuilder = stringBuilder .. Template.LabelRow({
                {["label"] = "1-14", ["style"] = "width:16.6%;"},
                {["label"] = "15-35", ["style"] = "width:16.6%;"},
                {["label"] = "36-50", ["style"] = "width:16.6%;"},
                {["label"] = "51-61", ["style"] = "width:16.6%;"},
                {["label"] = "62-72", ["style"] = "width:16.6%;"},
                {["label"] = "73-93", ["style"] = "width:16.6%;"}
            })
            stringBuilder = stringBuilder .. Template.DataRow({
                {["data"] = (args["358recomp1-14"] or "-"), ["class"] = "numberData"},
                {["data"] = (args["358recomp15-35"] or "-"), ["class"] = "numberData"},
                {["data"] = (args["358recomp36-50"] or "-"), ["class"] = "numberData"},
                {["data"] = (args["358recomp51-61"] or "-"), ["class"] = "numberData"},
                {["data"] = (args["358recomp62-72"] or "-"), ["class"] = "numberData"},
                {["data"] = (args["358recomp73-93"] or "-"), ["class"] = "numberData"}
            })
        end
        stringBuilder = stringBuilder .. Template.CloseContainer()
    end
    stringBuilder = stringBuilder .. Template.CloseFinal()
    if multiples then stringBuilder = stringBuilder .. Template.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end

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