Ce module contient les fonctions permettant de créer des modèles concernant les stats (d'ennemis, objets, etc) de Kingdom Hearts II.
Fonction StatsKH2.CategorieEnnemi[]
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 Kingdom Hearts II ou uniquement Kingdom Hearts II: 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 |
---|---|
KH2boss | 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) |
KH2FM | Indique que l'ennemi est exclusif à Kingdom Hearts II: Final Mix si le paramètre est utilisé |
Fonction StatsKH2.Ennemi[]
Cette fonction génère le tableau de statistiques d'un ennemi de Kingdom Hearts II.
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 |
---|---|---|
KH2HP | - | Multiplicateur des HP (par rapport à la valeur de base donnée par le Niveau de combat) |
KH2EXP | - | Multiplicateur d'expérience (par rapport à la valeur de base donnée par le Niveau de combat) |
KH2loc | 1-23 | Mondes et niveaux de combat où l'ennemi apparaît (si c'est un ennemi standard). Les stats sont calculées automatiquement, et jusqu'à 23 lignes sont disponibles. |
KH2niv | ||
KH20exp | 1-23 | Permet d'annuler l'expérience donnée par un ennemi pour un lieu particulier (par exemple les tournois du Colisée). |
KH2locBoss | 1-6 | Mondes, niveau de combat, et HP d'un Boss (les HP de boss n'obéissant pas à la règle de multiplicateur usuelle, et ils ne donnent pas d'expérience). Jusqu'à 5 lignes sont disponibles. |
KH2nivBoss | ||
KH2HPBoss | ||
KH2arme | - | Résistances aux différents éléments et altérations d'état. |
KH2brasier | ||
KH2glacier | ||
KH2foudre | ||
KH2ten | ||
KH2autre | ||
KH2reaction | - | Commande Réaction de l'ennemi |
KH2recomp | - | Renseigne les récompenses abandonnées par l'ennemi |
local StatsKH2 = {}
--Informations de niveau de combat
local KH2Niv = {
["1"] = {["HP"] = "20", ["EXP"] = "4", ["For"] = "5", ["Def"] = "2"},
["2"] = {["HP"] = "21", ["EXP"] = "5", ["For"] = "6", ["Def"] = "2"},
["3"] = {["HP"] = "23", ["EXP"] = "6", ["For"] = "7", ["Def"] = "3"},
["6"] = {["HP"] = "28", ["EXP"] = "9", ["For"] = "9", ["Def"] = "4"},
["7"] = {["HP"] = "29", ["EXP"] = "10", ["For"] = "10", ["Def"] = "5"},
["8"] = {["HP"] = "31", ["EXP"] = "12", ["For"] = "11", ["Def"] = "5"},
["10"] = {["HP"] = "34", ["EXP"] = "16", ["For"] = "12", ["Def"] = "6"},
["13"] = {["HP"] = "39", ["EXP"] = "23", ["For"] = "15", ["Def"] = "8"},
["15"] = {["HP"] = "42", ["EXP"] = "29", ["For"] = "17", ["Def"] = "9"},
["16"] = {["HP"] = "44", ["EXP"] = "33", ["For"] = "17", ["Def"] = "9"},
["18"] = {["HP"] = "48", ["EXP"] = "41", ["For"] = "19", ["Def"] = "10"},
["19"] = {["HP"] = "49", ["EXP"] = "45", ["For"] = "20", ["Def"] = "11"},
["20"] = {["HP"] = "51", ["EXP"] = "50", ["For"] = "21", ["Def"] = "11"},
["22"] = {["HP"] = "54", ["EXP"] = "61", ["For"] = "22", ["Def"] = "12"},
["24"] = {["HP"] = "57", ["EXP"] = "73", ["For"] = "24", ["Def"] = "13"},
["25"] = {["HP"] = "59", ["EXP"] = "0", ["For"] = "25", ["Def"] = "14"},
["26"] = {["HP"] = "61", ["EXP"] = "87", ["For"] = "26", ["Def"] = "14"},
["28"] = {["HP"] = "64", ["EXP"] = "102", ["For"] = "27", ["Def"] = "15"},
["30"] = {["HP"] = "67", ["EXP"] = "119", ["For"] = "29", ["Def"] = "16"},
["32"] = {["HP"] = "71", ["EXP"] = "0", ["For"] = "31", ["Def"] = "17"},
["34"] = {["HP"] = "74", ["EXP"] = "159", ["For"] = "32", ["Def"] = "18"},
["35"] = {["HP"] = "76", ["EXP"] = "170", ["For"] = "34", ["Def"] = "19"},
["36"] = {["HP"] = "77", ["EXP"] = "182", ["For"] = "34", ["Def"] = "19"},
["37"] = {["HP"] = "79", ["EXP"] = "194", ["For"] = "35", ["Def"] = "20"},
["38"] = {["HP"] = "81", ["EXP"] = "207", ["For"] = "36", ["Def"] = "20"},
["39"] = {["HP"] = "82", ["EXP"] = "220", ["For"] = "37", ["Def"] = "21"},
["40"] = {["HP"] = "84", ["EXP"] = "234", ["For"] = "37", ["Def"] = "21"},
["41"] = {["HP"] = "86", ["EXP"] = "248", ["For"] = "39", ["Def"] = "22"},
["43"] = {["HP"] = "89", ["EXP"] = "278", ["For"] = "40", ["Def"] = "23"},
["45"] = {["HP"] = "92", ["EXP"] = "310", ["For"] = "42", ["Def"] = "24"},
["47"] = {["HP"] = "95", ["EXP"] = "344", ["For"] = "43", ["Def"] = "25"},
["50"] = {["HP"] = "100", ["EXP"] = "400", ["For"] = "45", ["Def"] = "26"},
["53"] = {["HP"] = "105", ["EXP"] = "0", ["For"] = "48", ["Def"] = "28"},
["55"] = {["HP"] = "109", ["EXP"] = "400", ["For"] = "50", ["Def"] = "29"},
["60"] = {["HP"] = "117", ["EXP"] = "0", ["For"] = "54", ["Def"] = "31"},
["70"] = {["HP"] = "133", ["EXP"] = "0", ["For"] = "62", ["Def"] = "36"},
["74"] = {["HP"] = "140", ["EXP"] = "400", ["For"] = "65", ["Def"] = "33"},
["80"] = {["HP"] = "150", ["EXP"] = "0", ["For"] = "70", ["Def"] = "41"},
["99"] = {["HP"] = "181", ["EXP"] = "0", ["For"] = "87 ([[Kingdom Hearts II|KHII]])<br />86 ([[Kingdom Hearts II: Final Mix|FM]])", ["Def"] = "51"},
["99FM"] = {["HP"] = "181", ["EXP"] = "0", ["For"] = "86", ["Def"] = "51"},
}
--<includeonly>
function StatsKH2.CategorieEnnemi(args)
if args["boss"] or args["KH2boss"] then
if args["KH2FM"] then return "[[Catégorie:Boss Kingdom Hearts II: Final Mix]]" else return "[[Catégorie:Boss Kingdom Hearts II]]" end
else
if args["KH2FM"] then return "[[Catégorie:Ennemis Kingdom Hearts II: Final Mix]]" else return "[[Catégorie:Ennemis Kingdom Hearts II]]" end
end
end
--</includeonly>
function StatsKH2.Ennemi(args, multiples)
local Template=require("Module:Stats/Template")
local stringBuilder = ""
if multiples then stringBuilder = stringBuilder .. Template.OpenTab(args, "KH2") end -- Ouvre un tab si nécessaire
stringBuilder = stringBuilder .. Template.OpenContainer(args["theme"])
stringBuilder = stringBuilder .. Template.OpenBox()
stringBuilder = stringBuilder .. Template.Header("Statistiques", (args["KH2locBoss1"] and 5 or 6))
if args["KH2loc1"] ~= nil then
stringBuilder = stringBuilder .. Template.LabelRow({
{["label"] = "Monde", ["style"] = "width:40%; padding-left:1em;"},
{["label"] = '[[Niveau de combat|Niveau]]', ["style"] = "width:12%;"},
{["label"] = 'HP', ["style"] = "width:12%;"},
{["label"] = "EXP", ["style"] = "width:12%;"},
{["label"] = "Force", ["style"] = "width:12%;"},
{["label"] = "Défense", ["style"] = "width:12%;"}
})
for i=1,23 do
if args["KH2loc"..tostring(i)] ~= nil then
stringBuilder = stringBuilder .. Template.DataRow({
{["data"] = args["KH2loc"..tostring(i)], ["class"] = "textData"},
{["data"] = args["KH2niv"..tostring(i)]=="99FM" and "99" or args["KH2niv"..tostring(i)], ["class"] = "numberData"},
{["data"] = Template.round(args["KH2HP"]*KH2Niv[args["KH2niv"..tostring(i)]]["HP"]), ["class"] = "numberData"},
{["data"] = (args["KH20exp"..i] and "-" or Template.round(args["KH2EXP"]*KH2Niv[args["KH2niv"..tostring(i)]]["EXP"])), ["class"] = "numberData"},
{["data"] = KH2Niv[args["KH2niv"..tostring(i)]]["For"], ["class"] = "numberData"},
{["data"] = KH2Niv[args["KH2niv"..tostring(i)]]["Def"], ["class"] = "numberData"}
})
end
end
elseif args["KH2locBoss1"] ~= nil then
stringBuilder = stringBuilder .. Template.LabelRow({
{["label"] = "Monde", ["style"] = "width:40%; padding-left:1em;"},
{["label"] = '[[Niveau de combat|Niveau]]', ["style"] = "width:15%;"},
{["label"] = 'HP', ["style"] = "width:15%;"},
{["label"] = "Force", ["style"] = "width:15%;"},
{["label"] = "Défense", ["style"] = "width:15%;"}
})
for i=1,6 do
if args["KH2locBoss"..tostring(i)] ~= nil then
stringBuilder = stringBuilder .. Template.DataRow({
{["data"] = args["KH2locBoss"..tostring(i)], ["class"] = "textData"},
{["data"] = args["KH2nivBoss"..tostring(i)]=="99FM" and "99" or args["KH2nivBoss"..tostring(i)], ["class"] = "numberData"},
{["data"] = args["KH2HPBoss"..tostring(i)], ["class"] = "numberData"},
{["data"] = KH2Niv[args["KH2nivBoss"..tostring(i)]]["For"], ["class"] = "numberData"},
{["data"] = KH2Niv[args["KH2nivBoss"..tostring(i)]]["Def"], ["class"] = "numberData"}
})
end
end
end
if args["KH2reaction"] ~= nil then
stringBuilder = stringBuilder..Template.MixedRow({
{["label"]=1, ["text"]="Commande Réaction"},
{["text"]=args["KH2reaction"], ["colspan"]=(args["KH2locBoss1"] and 4 or 5)}
})
end
stringBuilder = stringBuilder .. Template.CloseContainer()
stringBuilder = stringBuilder .. Template.ContainerLine()
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["KH2arme"] or "x1.0"), ["class"]="numberData"},
{["data"] = (args["KH2brasier"] or "x1.0"), ["class"]="numberData"},
{["data"] = (args["KH2glacier"] or "x1.0"), ["class"]="numberData"},
{["data"] = (args["KH2foudre"] or "x1.0"), ["class"]="numberData"},
{["data"] = (args["KH2ten"] or "x1.0"), ["class"]="numberData"},
{["data"] = (args["KH2autre"] or "x1.0"), ["class"]="numberData"}
})
stringBuilder = stringBuilder .. Template.CloseContainer()
if args["KH2recomp"] ~= nil then
stringBuilder = stringBuilder .. Template.ContainerLine()
stringBuilder = stringBuilder .. Template.OpenBox()
stringBuilder = stringBuilder .. Template.Header("Récompenses",1)
stringBuilder = stringBuilder .. Template.DataRow({
{["data"] = args["KH2recomp"], ["class"] = "textData"}
})
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 StatsKH2