FANDOM


local Stats = {}
 
--Ce module permet de générer des tables de statistiques pour les ennemis
 
--Fonction d'arrondi à l'unié
function Stats.round(num)
    return math.floor(num + 0.5)
end
 
--Nettoie les inputs en retirant les chaînes vides passées automatiquement par le modèle
function Stats.CleanArgs(inputArgs)
    local args = {}
    for arg, value in pairs(inputArgs) do
        if (value ~= "" and value ~="\n") then args[arg] = value end
    end
    return args
end
 
 
 
 
--------------------------------------------
--------------------------------------------
 
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"},
 
}
 
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"},
}
 
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"] = "???"}
}
 
local KHRNiv = {
 ["1"] = {["HP"] = "60", ["EXP"] = "8", ["For"] = "30"},
 ["2"] = {["HP"] = "62", ["EXP"] = "9", ["For"] = "31"},
 ["3"] = {["HP"] = "65", ["EXP"] = "10", ["For"] = "32"},
 ["4"] = {["HP"] = "67", ["EXP"] = "11", ["For"] = "33"},
 ["5"] = {["HP"] = "69", ["EXP"] = "12", ["For"] = "34"},
 ["6"] = {["HP"] = "71", ["EXP"] = "13", ["For"] = "35"},
 ["7"] = {["HP"] = "74", ["EXP"] = "14", ["For"] = "37"},
 ["8"] = {["HP"] = "76", ["EXP"] = "15", ["For"] = "38"},
 ["9"] = {["HP"] = "78", ["EXP"] = "16", ["For"] = "39"},
 ["10"] = {["HP"] = "81", ["EXP"] = "17", ["For"] = "40"},
 ["11"] = {["HP"] = "83", ["EXP"] = "19", ["For"] = "41"},
 ["12"] = {["HP"] = "85", ["EXP"] = "21", ["For"] = "42"},
 ["13"] = {["HP"] = "88", ["EXP"] = "23", ["For"] = "44"},
 ["14"] = {["HP"] = "90", ["EXP"] = "25", ["For"] = "45"},
 ["15"] = {["HP"] = "92", ["EXP"] = "27", ["For"] = "46"},
 ["16"] = {["HP"] = "95", ["EXP"] = "29", ["For"] = "47"},
 ["17"] = {["HP"] = "97", ["EXP"] = "31", ["For"] = "48"},
 ["18"] = {["HP"] = "99", ["EXP"] = "33", ["For"] = "49"},
 ["19"] = {["HP"] = "102", ["EXP"] = "36", ["For"] = "51"},
 ["20"] = {["HP"] = "104", ["EXP"] = "39", ["For"] = "52"},
 ["21"] = {["HP"] = "107", ["EXP"] = "42", ["For"] = "53"},
 ["22"] = {["HP"] = "109", ["EXP"] = "45", ["For"] = "54"},
 ["23"] = {["HP"] = "112", ["EXP"] = "48", ["For"] = "56"},
 ["24"] = {["HP"] = "114", ["EXP"] = "51", ["For"] = "57"},
 ["25"] = {["HP"] = "117", ["EXP"] = "55", ["For"] = "58"},
 ["26"] = {["HP"] = "119", ["EXP"] = "59", ["For"] = "59"},
 ["27"] = {["HP"] = "122", ["EXP"] = "63", ["For"] = "61"},
 ["28"] = {["HP"] = "124", ["EXP"] = "67", ["For"] = "62"},
 ["29"] = {["HP"] = "127", ["EXP"] = "72", ["For"] = "63"},
 ["30"] = {["HP"] = "129", ["EXP"] = "77", ["For"] = "64"},
 ["31"] = {["HP"] = "132", ["EXP"] = "82", ["For"] = "66"},
 ["32"] = {["HP"] = "135", ["EXP"] = "88", ["For"] = "67"},
 ["33"] = {["HP"] = "137", ["EXP"] = "94", ["For"] = "68"},
 ["34"] = {["HP"] = "140", ["EXP"] = "100", ["For"] = "70"},
 ["35"] = {["HP"] = "143", ["EXP"] = "107", ["For"] = "71"},
 ["36"] = {["HP"] = "145", ["EXP"] = "114", ["For"] = "72"},
 ["37"] = {["HP"] = "148", ["EXP"] = "122", ["For"] = "74"},
 ["38"] = {["HP"] = "151", ["EXP"] = "130", ["For"] = "75"},
 ["39"] = {["HP"] = "154", ["EXP"] = "139", ["For"] = "77"},
 ["40"] = {["HP"] = "157", ["EXP"] = "148", ["For"] = "78"},
 ["41"] = {["HP"] = "159", ["EXP"] = "158", ["For"] = "79"},
 ["42"] = {["HP"] = "162", ["EXP"] = "168", ["For"] = "81"},
 ["43"] = {["HP"] = "165", ["EXP"] = "179", ["For"] = "82"},
 ["44"] = {["HP"] = "168", ["EXP"] = "191", ["For"] = "84"},
 ["45"] = {["HP"] = "171", ["EXP"] = "203", ["For"] = "85"},
 ["46"] = {["HP"] = "174", ["EXP"] = "216", ["For"] = "87"},
 ["47"] = {["HP"] = "177", ["EXP"] = "230", ["For"] = "88"},
 ["48"] = {["HP"] = "180", ["EXP"] = "245", ["For"] = "90"},
 ["49"] = {["HP"] = "184", ["EXP"] = "261", ["For"] = "92"},
 ["50"] = {["HP"] = "187", ["EXP"] = "278", ["For"] = "93"},
 ["51"] = {["HP"] = "190", ["EXP"] = "296", ["For"] = "95"},
 ["52"] = {["HP"] = "193", ["EXP"] = "315", ["For"] = "96"},
 ["53"] = {["HP"] = "196", ["EXP"] = "335", ["For"] = "98"},
 ["54"] = {["HP"] = "200", ["EXP"] = "356", ["For"] = "100"},
 ["55"] = {["HP"] = "203", ["EXP"] = "379", ["For"] = "101"},
 ["56"] = {["HP"] = "207", ["EXP"] = "403", ["For"] = "103"},
 ["57"] = {["HP"] = "210", ["EXP"] = "429", ["For"] = "105"},
 ["58"] = {["HP"] = "213", ["EXP"] = "459", ["For"] = "106"},
 ["59"] = {["HP"] = "217", ["EXP"] = "485", ["For"] = "108"},
 ["60"] = {["HP"] = "220", ["EXP"] = "516", ["For"] = "110"},
 ["61"] = {["HP"] = "224", ["EXP"] = "549", ["For"] = "112"},
 ["62"] = {["HP"] = "228", ["EXP"] = "584", ["For"] = "114"},
 ["63"] = {["HP"] = "231", ["EXP"] = "621", ["For"] = "115"},
 ["64"] = {["HP"] = "235", ["EXP"] = "660", ["For"] = "117"},
 ["65"] = {["HP"] = "239", ["EXP"] = "702", ["For"] = "119"},
 ["66"] = {["HP"] = "243", ["EXP"] = "746", ["For"] = "121"},
 ["67"] = {["HP"] = "247", ["EXP"] = "793", ["For"] = "123"},
 ["68"] = {["HP"] = "251", ["EXP"] = "843", ["For"] = "125"},
 ["69"] = {["HP"] = "255", ["EXP"] = "896", ["For"] = "127"},
 ["70"] = {["HP"] = "259", ["EXP"] = "952", ["For"] = "129"},
 ["71"] = {["HP"] = "263", ["EXP"] = "1012", ["For"] = "131"},
 ["72"] = {["HP"] = "267", ["EXP"] = "1076", ["For"] = "133"},
 ["73"] = {["HP"] = "271", ["EXP"] = "1144", ["For"] = "135"},
 ["74"] = {["HP"] = "275", ["EXP"] = "1216", ["For"] = "137"},
 ["75"] = {["HP"] = "279", ["EXP"] = "1292", ["For"] = "139"},
 ["76"] = {["HP"] = "284", ["EXP"] = "1373", ["For"] = "142"},
 ["77"] = {["HP"] = "288", ["EXP"] = "1459", ["For"] = "144"},
 ["78"] = {["HP"] = "292", ["EXP"] = "1551", ["For"] = "146"},
 ["79"] = {["HP"] = "297", ["EXP"] = "1648", ["For"] = "148"},
 ["80"] = {["HP"] = "302", ["EXP"] = "1751", ["For"] = "151"},
 ["81"] = {["HP"] = "306", ["EXP"] = "1861", ["For"] = "153"},
 ["82"] = {["HP"] = "311", ["EXP"] = "1978", ["For"] = "155"},
 ["83"] = {["HP"] = "316", ["EXP"] = "2102", ["For"] = "158"},
 ["84"] = {["HP"] = "320", ["EXP"] = "2234", ["For"] = "160"},
 ["85"] = {["HP"] = "325", ["EXP"] = "2374", ["For"] = "162"},
 ["86"] = {["HP"] = "330", ["EXP"] = "2523", ["For"] = "165"},
 ["87"] = {["HP"] = "335", ["EXP"] = "2681", ["For"] = "167"},
 ["88"] = {["HP"] = "340", ["EXP"] = "2849", ["For"] = "170"},
 ["89"] = {["HP"] = "345", ["EXP"] = "3028", ["For"] = "172"},
 ["90"] = {["HP"] = "350", ["EXP"] = "3218", ["For"] = "175"},
 ["91"] = {["HP"] = "355", ["EXP"] = "3420", ["For"] = "177"},
 ["92"] = {["HP"] = "361", ["EXP"] = "3634", ["For"] = "180"},
 ["93"] = {["HP"] = "366", ["EXP"] = "3862", ["For"] = "183"},
 ["94"] = {["HP"] = "371", ["EXP"] = "4104", ["For"] = "185"},
 ["95"] = {["HP"] = "377", ["EXP"] = "4361", ["For"] = "188"},
 ["96"] = {["HP"] = "382", ["EXP"] = "4634", ["For"] = "191"},
 ["97"] = {["HP"] = "388", ["EXP"] = "4924", ["For"] = "194"},
 ["98"] = {["HP"] = "394", ["EXP"] = "5232", ["For"] = "197"},
 ["99"] = {["HP"] = "400", ["EXP"] = "5559", ["For"] = "200"},
}
 
local KHUXTypes = {
    ["Force"]="[[Fichier:Icone Force KHUχ.png|30px|Force]]<br />Force",
    ["Magie"]="[[Fichier:Icone Magie KHUχ.png|30px|Magie]]<br />Magie",
    ["Vitesse"]="[[Fichier:Icone Vitesse KHUχ.png|30px|Vitesse]]<br />Vitesse",
    ["Tous"]='[[Fichier:Icone Tous KHUχ.png|30px|Tous]]<br /><acronym title="Varie selon la quête">Variable</acronym>',
    ["Terrestre"]="[[Fichier:KHUχ Ennemi terrestre.png|30px]]<br />Terrestre",
    ["Aérien"]="[[Fichier:KHUχ Ennemi aérien.png|30px]]<br />Aérien"
}
 
local DDDExpNiv = {
 ["1"] = "0",
 ["3"] = "13",
 ["6"] = "22",
 ["8"] = "28",
 ["10"] = "34",
 ["12"] = "40",
 ["14"] = "46",
 ["16"] = "52",
 ["18"] = "58",
 ["20"] = "72",
 ["22"] = "80",
 ["24"] = "88",
 ["26"] = "96",
 ["28"] = "104",
 ["30"] = "112",
 ["32"] = "120",
 ["34"] = "128",
 ["36"] = "136",
 ["38"] = "144",
 ["40"] = "152",
 ["50"] = "0",
}
 
local KH3Niv = {
 ["1"] = {["HP"] = "24", ["EXP"] = "5", ["For"] = "16", ["Def"] = "8"},
 ["4"] = {["HP"] = "30", ["EXP"] = "6", ["For"] = "19", ["Def"] = "9"},
 ["10"] = {["HP"] = "42", ["EXP"] = "15", ["For"] = "25", ["Def"] = "12"},
 ["12"] = {["HP"] = "45", ["EXP"] = "19", ["For"] = "27", ["Def"] = "13"},
 ["14"] = {["HP"] = "49", ["EXP"] = "25", ["For"] = "29", ["Def"] = "14"},
 ["16"] = {["HP"] = "53", ["EXP"] = "30", ["For"] = "31", ["Def"] = "15"},
 ["18"] = {["HP"] = "57", ["EXP"] = "37", ["For"] = "33", ["Def"] = "16"},
 ["22"] = {["HP"] = "64", ["EXP"] = "53", ["For"] = "36", ["Def"] = "18"},
 ["24"] = {["HP"] = "68", ["EXP"] = "62", ["For"] = "38", ["Def"] = "19"},
 ["26"] = {["HP"] = "72", ["EXP"] = "71", ["For"] = "40", ["Def"] = "20"},
 ["28"] = {["HP"] = "76", ["EXP"] = "82", ["For"] = "42", ["Def"] = "21"},
 ["30"] = {["HP"] = "80", ["EXP"] = "93", ["For"] = "44", ["Def"] = "22"},
 ["32"] = {["HP"] = "83", ["EXP"] = "105", ["For"] = "46", ["Def"] = "23"},
 ["34"] = {["HP"] = "87", ["EXP"] = "118", ["For"] = "48", ["Def"] = "24"},
 ["36"] = {["HP"] = "91", ["EXP"] = "131", ["For"] = "50", ["Def"] = "25"},
 ["38"] = {["HP"] = "95", ["EXP"] = "146", ["For"] = "52", ["Def"] = "26"},
 ["40"] = {["HP"] = "99", ["EXP"] = "161", ["For"] = "54", ["Def"] = "27"},
 ["42"] = {["HP"] = "102", ["EXP"] = "177", ["For"] = "55", ["Def"] = "28"},
 ["46"] = {["HP"] = "110", ["EXP"] = "210", ["For"] = "59", ["Def"] = "30"},
 ["50"] = {["HP"] = "118", ["EXP"] = "247", ["For"] = "63", ["Def"] = "32"},
 ["60"] = {["HP"] = "137", ["EXP"] = "353", ["For"] = "73", ["Def"] = "37"},
 ["70"] = {["HP"] = "156", ["EXP"] = "478", ["For"] = "82", ["Def"] = "42"},
 ["?"] = {["HP"] = "0", ["EXP"] = "0", ["For"] = "?", ["Def"] = "?"},
}
---------------------------------------
--Fin des données de niveau de combat--
---------------------------------------
 
 
------------------------------------
--Fonctions de génération de table--
------------------------------------
 
--Ouverture de tab
--Doit gérer les intitulés variables selon le jeu
function Stats.OpenTab(args, game)
    gameTitles={
        ["KH1"] = function(args) if args["KHFM"] ~= nil then return "KHFM" else return "KH" end end,
        ["COM"] = function(args) if args["1.5"] then return "1.5" elseif args["REC"] ~= nil then return "Re:COM" else return "COM" end end,
        ["KH2"] = function(args) if args["KH2FM"] ~= nil then return "KH2FM" else return "KH2" end end,
        ["BBS"] = function(args) if args["BBSFM"] ~= nil then return "BBSFM" else return "BBS" end end,
        ["CHI"] = function(args) return "KHχ" end,
        ["KHUX"]= function(args) return "KHUχ" end,
        ["REM"]=function(args) return "KH3ReM" end,
    }
    if gameTitles[game] ~= nil then return gameTitles[game](args).."=\n" end
    return '\n'..game.."=\n"
end
 
function Stats.CloseTab()
    return "|-|"
end
 
function Stats.NewTab(title)
    return "|-|\n"..title.."=\n"
end
 
function Stats.Categories(args, game, caller)
    gameTitles={
        ["KH1"] = {
            ["ennemis"]= function(args) 
                if args["KHboss"]~= nil or args["boss"] ~= nil then
                    if args["KHFM"] ~= nil then return "[[Catégorie:Boss Kingdom Hearts: Final Mix]]" else return "[[Catégorie:Boss Kingdom Hearts]]" end 
                else
                    if args["KHFM"] ~= nil then return "[[Catégorie:Ennemis Kingdom Hearts: Final Mix]]" else return "[[Catégorie:Ennemis Kingdom Hearts]]" end 
                end
            end},
        ["COM"] = {
            ["ennemis"]= function(args) if args["COMboss"]~= nil or args["boss"] ~= nil then
                    if args["REC"] ~= nil or args["1.5"] ~= nil then return "[[Catégorie:Boss Kingdom Hearts: Re:Chain of Memories]]" else return "[[Catégorie:Boss Kingdom Hearts: Chain of Memories]]" end 
                else
                    return "[[Catégorie:Ennemis Kingdom Hearts: Chain of Memories]]" 
                end
            end},
        ["KH2"] = {
            ["ennemis"]= function(args) 
                if args["KH2boss"]~= nil or args["boss"] ~= nil then
                    if args["KH2FM"] ~= nil then return "[[Catégorie:Boss Kingdom Hearts II: Final Mix]]" else return "[[Catégorie:Boss Kingdom Hearts II]]" end 
                else
                    if args["KH2FM"] ~= nil then return "[[Catégorie:Ennemis Kingdom Hearts II: Final Mix]]" else return "[[Catégorie:Ennemis Kingdom Hearts II]]" end 
                end
            end},
        ["358"] = {
            ["ennemis"]= function(args) 
                if args["358boss"]~= nil or args["boss"] ~= nil then
                    return "[[Catégorie:Boss Kingdom Hearts: 358/2 Days]]" 
                else
                    return "[[Catégorie:Ennemis Kingdom Hearts: 358/2 Days]]" 
                end 
            end},
        ["BBS"] = {
            ["ennemis"]= function(args) 
                if args["BBSboss"]~= nil or args["boss"] ~= nil then
                    if args["BBSFM"] ~= nil 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"] ~= nil 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},
        ["KHR"] = {
            ["ennemis"]= function(args) 
                if args["KHRboss"]~= nil or args["boss"] ~= nil then
                    if args["KHR"] ~= nil then return "[[Catégorie:Boss Kingdom Hearts: Re:coded]]" else return "[[Catégorie:Boss Kingdom Hearts: Coded]]" end 
                else
                    if args["KHR"] ~= nil then return "[[Catégorie:Ennemis Kingdom Hearts: Re:coded]]" else return "[[Catégorie:Ennemis Kingdom Hearts: Coded]]" end 
                end
            end},
        ["DDD"] = {
            ["ennemis"]= function(args) 
                if args["DDDboss"]~= nil or args["boss"] ~= nil then
                    return "[[Catégorie:Boss Kingdom Hearts 3D: Dream Drop Distance]]" 
                else
                    return "[[Catégorie:Ennemis Kingdom Hearts 3D: Dream Drop Distance]]" 
                end 
            end},
        ["CHI"] = {
            ["ennemis"]= function(args) 
                if args["CHIboss"]~= nil or args["boss"] ~= nil then
                    return "[[Catégorie:Boss Kingdom Hearts: χ]]" 
                else
                    return "[[Catégorie:Ennemis Kingdom Hearts: χ]]" 
                end 
            end},
        ["KHUX"] = {
            ["ennemis"]= function(args) 
                if args["KHUXboss"]~= nil or args["boss"] ~= nil then
                    if args["UCR"] ~= nil then return "[[Catégorie:Boss Kingdom Hearts: Union χ]]" else return "[[Catégorie:Boss Kingdom Hearts: Unchained χ]]" end 
                else
                    if args["UCR"] ~= nil then return "[[Catégorie:Ennemis Kingdom Hearts: Union χ]]" else return "[[Catégorie:Ennemis Kingdom Hearts: Unchained χ]]" end 
                end
            end},
        ["0.2"] = {
            ["ennemis"]= function(args) 
                if args["0.2boss"]~= nil or args["boss"] ~= nil then
                    return "[[Catégorie:Boss Kingdom Hearts: 0.2 Birth by Sleep -A Fragmentary Passage-]]" 
                else
                    return "[[Catégorie:Ennemis Kingdom Hearts: 0.2 Birth by Sleep -A Fragmentary Passage-]]" 
                end 
            end},
        ["KH3"] = {
            ["ennemis"]= function(args) 
                if args["KH3boss"]~= nil or args["boss"] ~= nil then
                    return "[[Catégorie:Boss Kingdom Hearts III]]"
                else
                    return "[[Catégorie:Ennemis Kingdom Hearts III]]"
                end 
            end},
        ["REM"]= {["ennemis"]= function(args) 
                if args["REMboss"]~= nil or args["boss"] ~= nil then
                    return "[[Catégorie:Boss Kingdom Hearts III Re Mind]]"
                else
                    return "[[Catégorie:Ennemis Kingdom Hearts III Re Mind]]"
                end 
            end},
    }
    return gameTitles[game][caller](args) .. "\n"
end
 
function Stats.OpenContainer(theme)
    return '{|class="StatBox '..(theme or "")..'"\n|\n'
end
 
function Stats.OpenBox(class)
    return '{|class="subTable'..(class and ' '..tostring(class) or '')..'"\n'
end
 
function Stats.ContainerLine()
    return [[|-
|
]]
end
 
function Stats.CloseContainer()
    return "|}\n"
end
 
function Stats.CloseFinal()
    return "|}"
end
 
 
function Stats.Header(text, colspan)
    return '!class="SectionHeader" colspan="'..tostring(colspan)..'"|' .. text .. "\n"
end
 
function Stats.Separator(text, colspan)
    return [[|- class="LabelRow"
!class="Label" colspan="]] .. tostring(colspan).. '"|' .. text .. "\n"
end
 
function Stats.LabelRow(labels)
    local stringBuilder = '|- class="LabelRow"\n'
    for _, label in ipairs(labels) do
        stringBuilder = stringBuilder .. '!class="Label"'
        if label["style"] ~= nil then
            stringBuilder = stringBuilder .. ' style = "' ..label["style"] .. '"'
        end
        if label["colspan"] ~= nil then
            stringBuilder = stringBuilder .. ' colspan = "' .. tostring(label["colspan"]) .. '"'
        end
        stringBuilder = stringBuilder .. '|'.. label["label"] .. '\n'
    end
    return stringBuilder
end
 
function Stats.DataRow(data)
    local stringBuilder = '|- class="DataRow"\n'
    for _, data in ipairs(data) do
        stringBuilder = stringBuilder .. '|class="'..data["class"] .. '"'
        if data["colspan"] ~= nil then
            stringBuilder = stringBuilder .. ' colspan = "' .. tostring(data["colspan"]) .. '"'
        end
        if data["rowspan"] ~= nil then
            stringBuilder = stringBuilder .. ' rowspan = "' .. tostring(data["rowspan"]) .. '"'
        end
        stringBuilder = stringBuilder .. '|' .. tostring(data["data"]).."\n"
    end
    return stringBuilder
end
 
function Stats.MixedRow(contents)
    local stringBuilder = '|- class="MixedRow"\n'
    for _, content in ipairs(contents) do
        if content["label"] ~= nil then
            stringBuilder = stringBuilder .. '!class="Label"'
        else
            stringBuilder = stringBuilder .. '|class="Data"'
        end
        if content["style"] ~= nil then
            stringBuilder = stringBuilder .. ' style = "' ..content["style"] .. '"'
        end
        if content["colspan"] ~= nil then
            stringBuilder = stringBuilder .. ' colspan = "' .. tostring(content["colspan"]) .. '"'
        end
        if content["rowspan"] ~= nil then
            stringBuilder = stringBuilder .. ' rowspan = "' .. tostring(content["rowspan"]) .. '"'
        end
        stringBuilder = stringBuilder .. '|'.. tostring(content["text"]) .. '\n'
    end
    return stringBuilder
end
 
-------------------------------
--Fin des génération de table--
-------------------------------
 
----------------------------
--Fonction ennemis par jeu--
----------------------------
function Stats.EnnemiKH1(args, multiples)
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Stats.OpenTab(args, "KH1") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Statistiques", 6)
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Monde", ["style"]="width:30%; padding-left: 1em;"},
        {["label"] = "HP", ["style"]="width:14%;"},
        {["label"] = "EXP", ["style"]="width:14%;"},
        {["label"] = "Force", ["style"]="width:14%;"},
        {["label"] = "Défense", ["style"]="width:14%;"},
        {["label"] = "Charge MP", ["style"]="width:14%;"},
    })
    if args["KHlocAvant1"]~= nil then
        if args["KHlocAprès1"] ~= nil then stringBuilder = stringBuilder .. Stats.Separator("Avant la rescousse de Kairi", 6) end
        for i=1,11 do
            if args["KHlocAvant"..tostring(i)] ~= nil then
                stringBuilder = stringBuilder .. Stats.DataRow({
                    {["data"]=args["KHlocAvant"..tostring(i)], ["class"] = "textData"},
                    {["data"]=(args["KHHPAvant"..tostring(i)] or "?"), ["class"]="numberData"}, 
                    {["data"]=(args["KHEXPAvant"..tostring(i)] or "?"), ["class"]="numberData"}, 
                    {["data"]=(args["KHFORAvant"..tostring(i)] or "?"), ["class"]="numberData"}, 
                    {["data"]=(args["KHDEFAvant"..tostring(i)] or "?"), ["class"]="numberData"}, 
                    {["data"]=(args["KHChargeAvant"..tostring(i)] or "?"), ["class"]="numberData"}
                })
            end
        end
    end
    if args["KHlocAprès1"]~= nil then
        if args["KHlocAvant1"] ~= nil then stringBuilder = stringBuilder .. Stats.Separator("Après la rescousse de Kairi", 6) end
        for i=1,3 do
            if args["KHlocAprès"..tostring(i)] ~= nil then
                stringBuilder = stringBuilder .. Stats.DataRow({
                    {["data"]=args["KHlocAprès"..tostring(i)], ["class"]="textData"}, 
                    {["data"]=(args["KHHPAprès"..tostring(i)] or "?"), ["class"]="numberData"}, 
                    {["data"]=(args["KHEXPAprès"..tostring(i)] or "?"), ["class"]="numberData"}, 
                    {["data"]=(args["KHFORAprès"..tostring(i)] or "?"), ["class"]="numberData"}, 
                    {["data"]=(args["KHDEFAprès"..tostring(i)] or "?"), ["class"]="numberData"}, 
                    {["data"]=(args["KHChargeAprès"..tostring(i)] or "?"), ["class"]="numberData"}
                })
            end
        end 
    end
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    stringBuilder = stringBuilder .. Stats.ContainerLine()
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Faiblesses/Résistances", 8)
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Arme", ["style"]="width:12.5%;"},
        {["label"] = "Brasier", ["style"]="width:12.5%;"},
        {["label"] = "Glacier", ["style"]="width:12.5%;"},
        {["label"] = "Foudre", ["style"]="width:12.5%;"},
        {["label"] = "Gravité", ["style"]="width:12.5%;"},
        {["label"] = "Stop", ["style"]="width:12.5%;"},
        {["label"] = "KO", ["style"]="width:12.5%;"},
        {["label"] = "Autre", ["style"]="width:12.5%;"}
    })
    if (args["KHlocAvant1"] ~= nil and (args["KHgravitéAvant"] ~= nil or args["KHgravité"] ~= nil)) then
        if (args["KHgravitéAvant"] ~= nil and args["KHgravitéAprès"] ~= nil) then stringBuilder = stringBuilder .. Stats.Separator("Avant la rescousse de Kairi", 8) end
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = (args["KHarmeAvant"] or args["KHarme"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHbrasierAvant"] or args["KHbrasier"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHglacierAvant"] or args["KHglacier"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHfoudreAvant"] or args["KHfoudre"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHgravitéAvant"] or args["KHgravité"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHstopAvant"] or args["KHstop"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHkoAvant"] or args["KHko"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHautreAvant"] or args["KHautre"] or "x1.0"), ["class"]="numberData"}
        })
    end
    if (args["KHlocAprès1"] ~= nil and args["KHgravitéAprès"] ~= nil) then
        if (args["KHgravitéAvant"] ~= nil and args["KHgravitéAprès"] ~= nil) then stringBuilder = stringBuilder .. Stats.Separator("Après la rescousse de Kairi", 8) end
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = (args["KHarmeAprès"] or args["KHarme"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHbrasierAprès"] or args["KHbrasier"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHglacierAprès"] or args["KHglacier"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHfoudreAprès"] or args["KHfoudre"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHgravitéAprès"] or args["KHgravité"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHstopAprès"] or args["KHstop"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHkoAprès"] or args["KHko"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["KHautreAprès"] or args["KHautre"] or "x1.0"), ["class"]="numberData"}, 
        })
    end
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    if args["KHrecomp"] ~= nil then
        stringBuilder = stringBuilder .. Stats.ContainerLine()
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Récompenses", 1)
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = args["KHrecomp"], ["class"]="textData"}
        })
        stringBuilder = stringBuilder .. Stats.CloseContainer()
    end
    stringBuilder = stringBuilder .. Stats.CloseFinal()
    stringBuilder = stringBuilder .. Stats.Categories(args, "KH1", "ennemis")
    if multiples then stringBuilder = stringBuilder .. Stats.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end
 
function Stats.EnnemiCOM(args, multiples)
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Stats.OpenTab(args, "COM") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Statistiques",2)
    stringBuilder = stringBuilder .. Stats.MixedRow({
        {["label"]=1, ["text"]="Mondes", ["style"]="width:30%"},
        {["text"] = args["COMmondes"]}
    })
    stringBuilder = stringBuilder .. Stats.MixedRow({
        {["label"]=1, ["text"]="Valeur des cartes"},
        {["text"] = args["COMvaleurs"]}
    })
    if args["COMduréeDuel"]~= nil then
        stringBuilder = stringBuilder .. Stats.MixedRow({
            {["label"]=1, ["text"]="Duels", ["rowspan"] = 2, ["style"]="border-bottom-left-radius: 8px;"},
            {["text"] = "'''Durée''' : "..args["COMduréeDuel"]}
        })
        stringBuilder = stringBuilder .. Stats.MixedRow({
            {["text"] = "'''Card Breaks''' : "..args["COMcartesDuel"], ["style"]="border-bottom-left-radius: 0;"}
        })
    end
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    stringBuilder = stringBuilder .. Stats.ContainerLine()
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"]="Palier", style="width:10%;"},
        {["label"]='<acronym title="Sous-sol">SS</acronym>', style="width:10%;"},
        {["label"]="HP", style="width:26%;"},
        {["label"]="AP", style="width:26%;"},
        {["label"]="EXP", style="width:26%;"}
    })
    for i=1,13 do
        if (args["COMHP"..tostring(i)]) then
            data = {}
            if (i==13 or args["COMet"..tostring(i)] == "E") then
                table.insert(data, {["data"] = i, ["class"] = "numberData"})
                table.insert(data, {["data"] = "-", ["class"] = "numberData"})
            elseif args["COMet"..tostring(i)] == "SS" then
                table.insert(data, {["data"] = "-", ["class"] = "numberData"})
                table.insert(data, {["data"] = 13-i, ["class"] = "numberData"})
            else
                table.insert(data, {["data"] = i, ["class"] = "numberData"})
                table.insert(data, {["data"] = 13-i, ["class"] = "numberData"})
            end
            table.insert(data, {["data"] = args["COMHP"..tostring(i)], ["class"]="numberData"})
            table.insert(data, {["data"] = args["COMAP"..tostring(i)], ["class"]="numberData"})
            table.insert(data, {["data"] = args["COMEXP"..tostring(i)], ["class"]="numberData"})
            stringBuilder = stringBuilder .. Stats.DataRow(data)
        end
    end
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    stringBuilder = stringBuilder .. Stats.ContainerLine()
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Faiblesses/Résistances", 7)
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Arme", ["style"]="width:14%;"},
        {["label"] = "Brasier", ["style"]="width:14%;"},
        {["label"] = "Glacier", ["style"]="width:14%;"},
        {["label"] = "Foudre", ["style"]="width:14%;"},
        {["label"] = "Autre", ["style"]="width:14%;"},
        {["label"] = "Gravité", ["style"]="width:14%;"},
        {["label"] = "KO", ["style"]="width:14%;"}
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = (args["COMarme"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["COMbrasier"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["COMglacier"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["COMfoudre"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["COMautre"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["COMgravité"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["COMko"] or "x1.0"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Stop"},
        {["label"] = "Zappeur"},
        {["label"] = "Ficelage"},
        {["label"] = "Folie"},
        {["label"] = "Terreur"},
        {["label"] = "Aimant"},
        {["label"] = "Glaciation"}
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = (args["COMstop"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["COMzappeur"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["COMficelage"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["COMfolie"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["COMterreur"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["COMaimant"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["COMglaciation"] or "x1.0"), ["class"]="numberData"}, 
    })
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    if args["COMrecomp"] ~= nil then
        stringBuilder = stringBuilder .. Stats.ContainerLine()
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Récompenses", 1)
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"]= args["COMrecomp"], ["class"]="textData"}
        })
        stringBuilder = stringBuilder .. Stats.CloseContainer()
    end
    stringBuilder = stringBuilder .. Stats.CloseFinal()
    stringBuilder = stringBuilder .. Stats.Categories(args, "COM", "ennemis")
    if multiples then stringBuilder = stringBuilder .. Stats.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end
 
function Stats.EnnemiKH2(args, multiples)
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Stats.OpenTab(args, "KH2") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Statistiques", (args["KH2locBoss1"] and 5 or 6))
    if args["KH2loc1"] ~= nil then
        stringBuilder = stringBuilder .. Stats.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 .. Stats.DataRow({
                    {["data"] = args["KH2loc"..tostring(i)], ["class"] = "textData"},
                    {["data"] = args["KH2niv"..tostring(i)]=="99FM" and "99" or args["KH2niv"..tostring(i)], ["class"] = "numberData"},
                    {["data"] = Stats.round(args["KH2HP"]*KH2Niv[args["KH2niv"..tostring(i)]]["HP"]), ["class"] = "numberData"},
                    {["data"] = (args["KH20exp"..i] and "-" or Stats.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 .. Stats.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,5 do
            if args["KH2locBoss"..tostring(i)] ~= nil then
                stringBuilder = stringBuilder .. Stats.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..Stats.MixedRow({
            {["label"]=1, ["text"]="Commande Réaction"},
            {["text"]=args["KH2reaction"], ["colspan"]=(args["KH2locBoss1"] and 4 or 5)}
        })
    end
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    stringBuilder = stringBuilder .. Stats.ContainerLine()
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Faiblesses/Résistances",6)
    stringBuilder = stringBuilder .. Stats.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 .. Stats.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 .. Stats.CloseContainer()
    if args["KH2recomp"] ~= nil then
        stringBuilder = stringBuilder .. Stats.ContainerLine()
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Récompenses",1)
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = args["KH2recomp"], ["class"] = "textData"}
        })
        stringBuilder = stringBuilder .. Stats.CloseContainer()
    end
    stringBuilder = stringBuilder .. Stats.CloseFinal()
    stringBuilder = stringBuilder .. Stats.Categories(args, "KH2", "ennemis")
    if multiples then stringBuilder = stringBuilder .. Stats.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end
 
function Stats.Ennemi358(args, multiples)
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Stats.OpenTab(args, "358") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Statistiques",7)
    stringBuilder = stringBuilder .. Stats.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 .. Stats.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 .. Stats.DataRow({
                    {["data"] = "Mission "..tostring(args["358mission"..tostring(i)]), ["class"] = "textData"},
                    {["data"] = Stats.round(args["358HP"]*(args["358niv"..tostring(i)]*3+59)), ["class"] = "numberData"},
                    {["data"] = Stats.round(args["358niv"..tostring(i)]*1.5+6), ["class"] = "numberData"},
                    {["data"] = tostring(Stats.round(args["358Def"]*Stats.round(args["358niv"..tostring(i)]*1.5+6))) .. (args["358Def2"] and ' - '.. tostring(Stats.round(args["358Def2"]*Stats.round(args["358niv"..tostring(i)]*1.5+6))) or ''), ["class"] = "numberData"},
                    {["data"] = (args["358EXP"] == "-" and "-" or Stats.round(args["358EXP"]*KH358Mission[tostring(args["358mission"..tostring(i)])]["EXP"])), ["class"] = "numberData"},
                    {["data"] = (args["358coeur"] == "-" and "-" or Stats.round(args["358coeur"]*KH358Mission[tostring(args["358mission"..tostring(i)])]["PC"])), ["class"] = "numberData"},
                    {["data"] = (args["358munnies"] == "-" and "-" or Stats.round(args["358munnies"]*KH358Mission[tostring(args["358mission"..tostring(i)])]["Munnies"])), ["class"] = "numberData"}
                })
            end
        end
    end
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    if args["358puissance1"] ~= nil then
        stringBuilder = stringBuilder .. Stats.ContainerLine()
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Attaques",5)
        stringBuilder = stringBuilder .. Stats.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 .. Stats.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 .. Stats.CloseContainer()
    end
    stringBuilder = stringBuilder .. Stats.ContainerLine()
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Faiblesses/Résistances",4)
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Brasier", ["style"]="width:25%;"},
        {["label"] = "Glacier", ["style"]="width:25%;"},
        {["label"] = "Foudre", ["style"]="width:25%;"},
        {["label"] = "Rafale", ["style"]="width:25%;"}
    })
    stringBuilder = stringBuilder .. Stats.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 .. Stats.LabelRow({
        {["label"] = "Enflammé", ["style"]="width:25%;"},
        {["label"] = "Gelé", ["style"]="width:25%;"},
        {["label"] = "Électrocuté", ["style"]="width:25%;"},
        {["label"] = "Projeté", ["style"]="width:25%;"}
    })
    stringBuilder = stringBuilder .. Stats.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 .. Stats.LabelRow({
        {["label"] = "Étourdissement", ["style"]="width:100%;", ["colspan"]=4}
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = (args["358étourdissement"] or "Attaque normale"), ["class"]="numberData", ["colspan"]=4}
    })
    stringBuilder = stringBuilder .. Stats.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 .. Stats.ContainerLine()
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Récompenses",6)
        if args["358recomp"] ~= nil then
            stringBuilder = stringBuilder .. Stats.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 .. Stats.Separator("Récompenses par mission",6)
            stringBuilder = stringBuilder .. Stats.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 .. Stats.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 .. Stats.CloseContainer()
    end
    stringBuilder = stringBuilder .. Stats.CloseFinal()
    stringBuilder = stringBuilder .. Stats.Categories(args, "358", "ennemis")
    if multiples then stringBuilder = stringBuilder .. Stats.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end
 
function Stats.EnnemiBBS(args, multiples)
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Stats.OpenTab(args, "BBS") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Stats.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 .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Statistiques",6)
        stringBuilder = stringBuilder .. Stats.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 .. Stats.DataRow({
                    {["data"] = tostring(i), ["class"] = "numberData"},
                    {["data"] = args["BBSlocNiv"..tostring(i)], ["class"] = "textData"},
                    {["data"] = Stats.round(args["BBSHP"]*BBSNiv[tostring(i)]["HP"]), ["class"] = "numberData"},
                    {["data"] = Stats.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 .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.ContainerLine()
    end
    if args["BBSlocBoss1"] ~= nil then
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Statistiques",4)
        stringBuilder = stringBuilder .. Stats.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 .. Stats.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 .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.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 .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Statistiques (Arène des Mirages)",5)
        stringBuilder = stringBuilder .. Stats.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 .. Stats.DataRow({
                    {["data"] = "[["..combat.."]]", ["class"] = "textData"},
                    {["data"] = Stats.round(args["BBSHP"]*BBSNiv[combat]["HP"]), ["class"] = "numberData"},
                    {["data"] = Stats.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 .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.ContainerLine()
    end
    if args["BBSlocBossArène1"] ~= nil then
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Statistiques (Arène des Mirages)",4)
        stringBuilder = stringBuilder .. Stats.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 .. Stats.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 .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.ContainerLine()
    end
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Faiblesses/Résistances",6)
    stringBuilder = stringBuilder .. Stats.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 .. Stats.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 .. Stats.CloseContainer()
    stringBuilder = stringBuilder .. Stats.ContainerLine()
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Altérations d'état",5)
    stringBuilder = stringBuilder .. Stats.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 .. Stats.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 .. Stats.LabelRow({
        {["label"] = "Folie"},
        {["label"] = "Ficelage"},
        {["label"] = "Poison"},
        {["label"] = "Somni"},
        {["label"] = "Stop"}
    })
    stringBuilder = stringBuilder .. Stats.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 .. Stats.LabelRow({
        {["label"] = "Sommeil"},
        {["label"] = "Mort"},
        {["label"] = "Gravité nulle"},
        {["label"] = "Aimant"},
        {["label"] = "Zappeur"}
    })
    stringBuilder = stringBuilder .. Stats.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 .. Stats.CloseContainer()
    stringBuilder = stringBuilder .. Stats.ContainerLine()
    stringBuilder = stringBuilder .. Stats.OpenBox()
    if args["BBSrecomp"] ~= nil then
        stringBuilder = stringBuilder .. Stats.Header("Récompenses",2)
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = args["BBSrecomp"], ["class"] = "textData", ["colspan"]=2}
        })
        if args["BBSorbes"] ~= nil then
            stringBuilder = stringBuilder .. Stats.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 .. Stats.Header("Récompenses",width*2)
        if args["BBSorbes"] ~= nil then
            stringBuilder = stringBuilder .. Stats.MixedRow({
                {["label"]=1, ["colspan"]=width, ["text"]="Orbes"},
                {["colspan"]=width, ["text"]=args["BBSorbes"]}
            })
        end
        if args["BBSorbesArene"] ~= nil then
            stringBuilder = stringBuilder .. Stats.MixedRow({
                {["label"]=1, ["colspan"]=width, ["text"]="Orbes (Arène des Mirages)"},
                {["colspan"]=width, ["text"]=args["BBSorbesArene"]}
            })
        end
        if args["BBSrecomp%"]~= nil then
            stringBuilder = stringBuilder .. Stats.MixedRow({
                {["label"]=1, ["colspan"]=width, ["text"]="Taux d'objets"},
                {["colspan"]=width, ["text"]=args["BBSrecomp%"]}
            })
            stringBuilder = stringBuilder .. Stats.Separator("Niveau de boutique", width*2)
            stringBuilder = stringBuilder .. Stats.LabelRow(labels)
            stringBuilder = stringBuilder .. Stats.DataRow(datas)
        end
    end
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    stringBuilder = stringBuilder .. Stats.CloseFinal()
    stringBuilder = stringBuilder .. Stats.Categories(args, "BBS", "ennemis")
    if multiples then stringBuilder = stringBuilder .. Stats.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end
 
function Stats.EnnemiKHR(args, multiples)
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Stats.OpenTab(args, "KHR") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
    if args["KHRlocBoss1"] ~= nil then
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Statistiques",5)
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"] = "Monde", ["style"] = "width:40%; padding-left:1em;"},
            {["label"] = 'HP', ["style"] = "width:15%;"},
            {["label"] = "EXP", ["style"] = "width:15%;"},
            {["label"] = "Force", ["style"] = "width:15%;"},
            {["label"] = "Défense", ["style"] = "width:15%;"}
        })
        for i=1,3 do
            if args["KHRlocBoss"..tostring(i)]~= nil then
                stringBuilder = stringBuilder .. Stats.DataRow({
                    {["data"] = args["KHRlocBoss"..tostring(i)], ["class"]="textData"},
                    {["data"] = args["KHRHPBoss"..tostring(i)], ["class"]="numberData"},
                    {["data"] = args["KHREXPBoss"..tostring(i)] or "-", ["class"]="numberData"},
                    {["data"] = args["KHRForBoss"..tostring(i)], ["class"]="numberData"},
                    {["data"] = args["KHRDefBoss"..tostring(i)], ["class"]="numberData"},
                })
            end
        end
        stringBuilder = stringBuilder .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.ContainerLine()
    end
    if args["KHRloc1"]~= nil then
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Statistiques",5)
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"] = "Monde", ["style"] = "width:40%; padding-left:1em;"},
            {["label"] = 'HP', ["style"] = "width:15%;"},
            {["label"] = "EXP", ["style"] = "width:15%;"},
            {["label"] = "Force", ["style"] = "width:15%;"},
            {["label"] = "Défense", ["style"] = "width:15%;"}
        })
        for i=1,10 do
            if args["KHRloc"..tostring(i)]~= nil then
                stringBuilder = stringBuilder .. Stats.DataRow({
                    {["data"] = args["KHRloc"..tostring(i)], ["class"]="textData"},
                    {["data"] = Stats.round(args["KHRHP"]*KHRNiv[args["KHRniv"..tostring(i)]]["HP"]), ["class"]="numberData"},
                    {["data"] = Stats.round(args["KHREXP"]*KHRNiv[args["KHRniv"..tostring(i)]]["EXP"]), ["class"]="numberData"},
                    {["data"] = KHRNiv[args["KHRniv"..tostring(i)]]["For"], ["class"]="numberData"},
                    {["data"] = (args["KHRDefOverride"] or Stats.round(args["KHRDef"]*KHRNiv[args["KHRniv"..tostring(i)]]["For"])), ["class"]="numberData"},
                })
            end
        end
        stringBuilder = stringBuilder .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.ContainerLine()
    end
    if args["KHRlocBossFissure"] ~= nil then
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Statistiques (Cyber-fissures)",4)
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"] = "Fissure", ["style"] = "width:43%; padding-left:1em;"},
            {["label"] = 'HP', ["style"] = "width:19%;"},
            {["label"] = "Force", ["style"] = "width:19%;"},
            {["label"] = "Défense", ["style"] = "width:19%;"}
        })
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = args["KHRlocBossFissure"], ["class"]="textData"},
            {["data"] = args["KHRHPBossFissure"], ["class"]="numberData"},
            {["data"] = args["KHRForBossFissure"], ["class"]="numberData"},
            {["data"] = args["KHRDefBossFissure"], ["class"]="numberData"},
        })
        stringBuilder = stringBuilder .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.ContainerLine()
    end
    if args["KHRlocFissure1"] ~= nil then
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Statistiques (Cyber-fissures)",6)
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"] = "Fissure", ["style"] = "width:50%; padding-left:1em;"},
            {["label"] = "Type", ["style"] = "width:10%; padding-left:0.4em;"},
            {["label"] = 'HP', ["style"] = "width:10%;"},
            {["label"] = "EXP", ["style"] = "width:10%;"},
            {["label"] = "Force", ["style"] = "width:10%;"},
            {["label"] = "Défense", ["style"] = "width:10%;"}
        })
        for i=1,21 do
            if args["KHRlocFissure"..tostring(i)]~= nil then
                local rowspan = (args["KHRbaseFissure"..tostring(i)] and 1 or 0) + (args["KHRbugFissure"..tostring(i)] and 1 or 0) + (args["KHRvertFissure"..tostring(i)] and 1 or 0)
                if args["KHRbaseFissure"..tostring(i)]~= nil then 
                    stringBuilder = stringBuilder .. Stats.DataRow({
                        {["data"] = args["KHRlocFissure"..tostring(i)], ["class"]="textData", ["rowspan"] = rowspan},
                        {["data"] = "Base", ["class"]="textData"},
                        {["data"] = Stats.round(args["KHRHP"]*KHRNiv[args["KHRnivFissure"..tostring(i)]]["HP"]), ["class"]="numberData"},
                        {["data"] = Stats.round((args["KHREXPFissure"..tostring(i)] or args["KHREXP"])*KHRNiv[args["KHRnivFissure"..tostring(i)]]["EXP"]), ["class"]="numberData"},
                        {["data"] = KHRNiv[args["KHRnivFissure"..tostring(i)]]["For"], ["class"]="numberData"},
                        {["data"] = (args["KHRDefOverride"] or Stats.round(args["KHRDef"]*KHRNiv[args["KHRnivFissure"..tostring(i)]]["For"])), ["class"]="numberData"},
                    })
                end
                if args["KHRbugFissure"..tostring(i)]~= nil then 
                    if args["KHRbaseFissure"..tostring(i)]== nil then
                        stringBuilder = stringBuilder .. Stats.DataRow({
                            {["data"] = args["KHRlocFissure"..tostring(i)], ["class"]="textData", ["rowspan"] = rowspan},
                            {["data"] = "Bug", ["class"]="textData"},
                            {["data"] = Stats.round(args["KHRHPBug"]*KHRNiv[args["KHRnivFissure"..tostring(i)]]["HP"]), ["class"]="numberData"},
                            {["data"] = Stats.round((args["KHREXPFissure"..tostring(i)] or args["KHREXP"])*KHRNiv[args["KHRnivFissure"..tostring(i)]]["EXP"]), ["class"]="numberData"},
                            {["data"] = KHRNiv[args["KHRnivFissure"..tostring(i)]]["For"], ["class"]="numberData"},
                            {["data"] = (args["KHRDefOverride"] or Stats.round(args["KHRDef"]*KHRNiv[args["KHRnivFissure"..tostring(i)]]["For"])), ["class"]="numberData"},
                        })
                    else
                        stringBuilder = stringBuilder .. Stats.DataRow({
                            {["data"] = "Bug", ["class"]="textData"},
                            {["data"] = Stats.round(args["KHRHPBug"]*KHRNiv[args["KHRnivFissure"..tostring(i)]]["HP"]), ["class"]="numberData"},
                            {["data"] = Stats.round((args["KHREXPFissure"..tostring(i)] or args["KHREXP"])*KHRNiv[args["KHRnivFissure"..tostring(i)]]["EXP"]), ["class"]="numberData"},
                            {["data"] = KHRNiv[args["KHRnivFissure"..tostring(i)]]["For"], ["class"]="numberData"},
                            {["data"] = (args["KHRDefOverride"] or Stats.round(args["KHRDef"]*KHRNiv[args["KHRnivFissure"..tostring(i)]]["For"])), ["class"]="numberData"},
                        })
                    end
                end
                if args["KHRvertFissure"..tostring(i)]~= nil then
                    if (args["KHRbugFissure"..tostring(i)]== nil and args["KHRbaseFissure"..tostring(i)]== nil) then
                        stringBuilder = stringBuilder .. Stats.DataRow({
                            {["data"] = args["KHRlocFissure"..tostring(i)], ["class"]="textData", ["rowspan"] = rowspan},
                            {["data"] = "Vert", ["class"]="textData"},
                            {["data"] = Stats.round(2*args["KHRHPBug"]*KHRNiv[args["KHRnivFissure"..tostring(i)]]["HP"]), ["class"]="numberData"},
                            {["data"] = Stats.round((args["KHREXPFissure"..tostring(i)] or args["KHREXP"])*KHRNiv[args["KHRnivFissure"..tostring(i)]]["EXP"]), ["class"]="numberData"},
                            {["data"] = KHRNiv[args["KHRnivFissure"..tostring(i)]]["For"], ["class"]="numberData"},
                            {["data"] = (args["KHRDefOverride"] or Stats.round(1.25*args["KHRDef"]*KHRNiv[args["KHRnivFissure"..tostring(i)]]["For"])), ["class"]="numberData"},
                        })
                    else
                        stringBuilder = stringBuilder .. Stats.DataRow({
                            {["data"] = "Vert", ["class"]="textData"},
                            {["data"] = Stats.round(2*args["KHRHPBug"]*KHRNiv[args["KHRnivFissure"..tostring(i)]]["HP"]), ["class"]="numberData"},
                            {["data"] = Stats.round((args["KHREXPFissure"..tostring(i)] or args["KHREXP"])*KHRNiv[args["KHRnivFissure"..tostring(i)]]["EXP"]), ["class"]="numberData"},
                            {["data"] = KHRNiv[args["KHRnivFissure"..tostring(i)]]["For"], ["class"]="numberData"},
                            {["data"] = (args["KHRDefOverride"] or Stats.round(1.25*args["KHRDef"]*KHRNiv[args["KHRnivFissure"..tostring(i)]]["For"])), ["class"]="numberData"},
                        })
                    end
                end
            end
        end
        stringBuilder = stringBuilder .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.ContainerLine()
    end
    if args["KHR99niveaux"] ~= nil then
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Statistiques (Selon le niveau de Digital-Sora)",1)
        local divisions = {1,26,51,76,100}
        for k = 1,4 do
            stringBuilder = stringBuilder .. Stats.ContainerLine()
            stringBuilder = stringBuilder .. Stats.OpenBox("collapsible collapsed")
            stringBuilder = stringBuilder .. Stats.Separator("Niveaux "..tostring(divisions[k]).."-"..tostring(divisions[k+1]-1),5)
            stringBuilder = stringBuilder .. Stats.LabelRow({
                {["label"] = "Niveau", ["style"] = "width:20%; padding-left:1em;"},
                {["label"] = 'HP', ["style"] = "width:20%;"},
                {["label"] = "EXP", ["style"] = "width:20%;"},
                {["label"] = "Force", ["style"] = "width:20%;"},
                {["label"] = "Défense", ["style"] = "width:20%;"}
            })
            for i=divisions[k],(divisions[k+1]-1) do
                stringBuilder = stringBuilder .. Stats.DataRow({
                    {["data"] = i, ["class"]="textData"},
                    {["data"] = Stats.round(args["KHRHP"]*KHRNiv[tostring(i)]["HP"]), ["class"]="numberData"},
                    {["data"] = Stats.round(args["KHREXP"]*KHRNiv[tostring(i)]["EXP"]), ["class"]="numberData"},
                    {["data"] = KHRNiv[tostring(i)]["For"], ["class"]="numberData"},
                    {["data"] = (args["KHRDefOverride"] or Stats.round(args["KHRDef"]*KHRNiv[tostring(i)]["For"])), ["class"]="numberData"},
                })
            end
            stringBuilder = stringBuilder .. Stats.CloseContainer()
        end
        stringBuilder = stringBuilder .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.ContainerLine()
    end
    if args["KHRloc2D1"] ~= nil or args["KHRloc3D1"] ~= nil or args["KHRlocLaby1"] ~= nil then
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Statistiques (Serrures)",5)
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"] = "Lieu", ["style"] = "width:40%; padding-left:1em;"},
            {["label"] = 'HP', ["style"] = "width:15%;"},
            {["label"] = "EXP", ["style"] = "width:15%;"},
            {["label"] = "Force", ["style"] = "width:15%;"},
            {["label"] = "Défense", ["style"] = "width:15%;"}
        })
        if args["KHRloc2D1"] ~= nil then
            stringBuilder = stringBuilder .. Stats.Separator("Défilement latéral", 5)
            for i=1,3 do
                if args["KHRloc2D"..tostring(i)] then
                    stringBuilder = stringBuilder .. Stats.DataRow({
                        {["data"] = args["KHRloc2D"..tostring(i)], ["class"]="textData"},
                        {["data"] = Stats.round(args["KHRHP"]*KHRNiv[args["KHRniv2D"..tostring(i)]]["HP"]), ["class"]="numberData"},
                        {["data"] = Stats.round(args["KHREXP"]*KHRNiv[args["KHRniv2D"..tostring(i)]]["EXP"]), ["class"]="numberData"},
                        {["data"] = KHRNiv[args["KHRniv2D"..tostring(i)]]["For"], ["class"]="numberData"},
                        {["data"] = (args["KHRDefOverride"] or Stats.round(args["KHRDef"]*KHRNiv[args["KHRniv2D"..tostring(i)]]["For"])), ["class"]="numberData"},
                    })
                end
            end
        end
        if args["KHRloc3D1"] ~= nil then
            stringBuilder = stringBuilder .. Stats.Separator("3D", 5)
            for i=1,3 do
                if args["KHRloc3D"..tostring(i)] then
                    stringBuilder = stringBuilder .. Stats.DataRow({
                        {["data"] = args["KHRloc3D"..tostring(i)], ["class"]="textData"},
                        {["data"] = Stats.round(args["KHRHP"]*KHRNiv[args["KHRniv3D"..tostring(i)]]["HP"]), ["class"]="numberData"},
                        {["data"] = Stats.round(args["KHREXP"]*KHRNiv[args["KHRniv3D"..tostring(i)]]["EXP"]), ["class"]="numberData"},
                        {["data"] = KHRNiv[args["KHRniv3D"..tostring(i)]]["For"], ["class"]="numberData"},
                        {["data"] = (args["KHRDefOverride"] or Stats.round(args["KHRDef"]*KHRNiv[args["KHRniv3D"..tostring(i)]]["For"])), ["class"]="numberData"},
                    })
                end
            end
        end
        if args["KHRlocLaby1"] ~= nil then
            stringBuilder = stringBuilder .. Stats.Separator("Labyrinthe", 5)
            for i=1,10 do
                if args["KHRlocLaby"..tostring(i)] then
                    stringBuilder = stringBuilder .. Stats.DataRow({
                        {["data"] = args["KHRlocLaby"..tostring(i)], ["class"]="textData"},
                        {["data"] = Stats.round(args["KHRHPLaby"]*KHRNiv[args["KHRnivLaby"..tostring(i)]]["HP"]), ["class"]="numberData"},
                        {["data"] = Stats.round(args["KHREXPLaby"]*KHRNiv[args["KHRnivLaby"..tostring(i)]]["EXP"]), ["class"]="numberData"},
                        {["data"] = KHRNiv[args["KHRnivLaby"..tostring(i)]]["For"], ["class"]="numberData"},
                        {["data"] = (args["KHRDefOverride"] or Stats.round(args["KHRDefLaby"]*KHRNiv[args["KHRnivLaby"..tostring(i)]]["For"])), ["class"]="numberData"},
                    })
                end
            end
        end
        stringBuilder = stringBuilder .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.ContainerLine()
    end
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Faiblesses/Résistances",4)
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Brasier", ["style"] = "width:25%"},
        {["label"] = "Glacier", ["style"] = "width:25%"},
        {["label"] = "Foudre", ["style"] = "width:25%"},
        {["label"] = "Rafale", ["style"] = "width:25%"},
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = args["KHRbrasier"] or "x1.0", ["class"]="numberData"},
        {["data"] = args["KHRglacier"] or "x1.0", ["class"]="numberData"},
        {["data"] = args["KHRfoudre"] or "x1.0", ["class"]="numberData"},
        {["data"] = args["KHRrafale"] or "x1.0", ["class"]="numberData"},
    })
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    stringBuilder = stringBuilder .. Stats.ContainerLine()
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Altérations d'état",3)
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Enflammé", ["style"] = "width:33%"},
        {["label"] = "Gelé", ["style"] = "width:33%"},
        {["label"] = "Électrocuté", ["style"] = "width:33%"},
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = args["KHRenflammé"] or "O", ["class"]="numberData"},
        {["data"] = args["KHRgelé"] or "O", ["class"]="numberData"},
        {["data"] = args["KHRélectrocuté"] or "O", ["class"]="numberData"},
    })
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Projeté"},
        {["label"] = "Somni"},
        {["label"] = "Stop"},
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = args["KHRprojeté"] or "O", ["class"]="numberData"},
        {["data"] = args["KHRsomni"] or "O", ["class"]="numberData"},
        {["data"] = args["KHRstop"] or "O", ["class"]="numberData"},
    })
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Folie"},
        {["label"] = "Étourdissement"},
        {["label"] = "Aimant"},
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = args["KHRfolie"] or "O", ["class"]="numberData"},
        {["data"] = args["KHRétourdissement"] or "O", ["class"]="numberData"},
        {["data"] = args["KHRaimant"] or "O", ["class"]="numberData"},
    })
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    if args["KHRrecomp"] ~= nil or args["KHRrecompOrbes"] ~= nil or args["KHRrecompDébutant"] ~= nil or args["KHRrecomp2D"] ~= nil or args["KHRrecomp3D"]~= nil or args["KHRrecompLaby"] ~= nil then
        stringBuilder = stringBuilder .. Stats.ContainerLine()
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Récompenses",4)
        if args["KHRrecomp"] ~= nil then
            stringBuilder = stringBuilder .. Stats.DataRow({
                {["data"] = args["KHRrecomp"], ["class"]="textData", ["colspan"]=4}
            })
        end
        if args["KHRrecompOrbes"] ~= nil then
            stringBuilder = stringBuilder .. Stats.MixedRow({
                {["label"] = 1, ["text"]="Orbes"},
                {["text"] = args["KHRrecompOrbes"], ["class"]="textData", ["colspan"]=3}
            })
        end
        if args["KHRrecompDébutant"] ~= nil then
            stringBuilder = stringBuilder .. Stats.LabelRow({
                {["label"] = "Mode Débutant", ["style"]="width:25%;"},
                {["label"] = "Mode Standard", ["style"]="width:25%;"},
                {["label"] = "Mode Ambitieux", ["style"]="width:25%;"},
                {["label"] = "Mode Extrême", ["style"]="width:25%;"},
            })
            stringBuilder = stringBuilder .. Stats.DataRow({
                {["data"] = args["KHRrecompDébutant"], ["class"]="textData"},
                {["data"] = args["KHRrecompStandard"], ["class"]="textData"},
                {["data"] = args["KHRrecompAmbitieux"], ["class"]="textData"},
                {["data"] = args["KHRrecompExtrême"], ["class"]="textData"},
            })
        end
        if args["KHRrecomp2D"] ~= nil or args["KHRrecomp3D"]~= nil or args["KHRrecompLaby"] ~= nil then
            stringBuilder = stringBuilder .. Stats.Separator("Récompenses dans les Serrures",4)
            if args["KHRrecomp2D"] ~= nil then
                stringBuilder = stringBuilder .. Stats.MixedRow({
                    {["label"]=1, ["text"] = "Défilement latéral"},
                    {["text"] = args["KHRrecomp2D"], ["colspan"]=3}
                })
            end
            if args["KHRrecomp3D"]~= nil then
                stringBuilder = stringBuilder .. Stats.MixedRow({
                    {["label"]=1, ["text"] = "3D"},
                    {["text"] = args["KHRrecomp3D"], ["colspan"]=3}
                })
            end
            if args["KHRrecompLaby"] ~= nil then
                stringBuilder = stringBuilder .. Stats.MixedRow({
                    {["label"]=1, ["text"] = "Labyrinthe"},
                    {["text"] = args["KHRrecompLaby"], ["colspan"]=3}
                })
            end
        end
        stringBuilder = stringBuilder .. Stats.CloseContainer()
    end
    stringBuilder = stringBuilder .. Stats.CloseFinal()
    stringBuilder = stringBuilder .. Stats.Categories(args, "KHR", "ennemis")
    if multiples then stringBuilder = stringBuilder .. Stats.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end
 
function Stats.EnnemiDDD(args, multiples, tabTitle)
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Stats.OpenTab(args, (tabTitle or "DDD")) end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
    if args["DDDloc1"] ~= nil then
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Statistiques",7)
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"] = "Monde", ["style"] = "width:40%; padding-left:1em;"},
            {["label"] = '[[Niveau de combat|Niveau]]', ["style"] = "width:10%;"},
            {["label"] = 'HP', ["style"] = "width:10%;"},
            {["label"] = "EXP", ["style"] = "width:10%;"},
            {["label"] = "Force", ["style"] = "width:10%;"},
            {["label"] = "Magie", ["style"] = "width:10%;"},
            {["label"] = "Défense", ["style"] = "width:10%;"}
        })
        if args["DDDCRloc1"]~= nil then
            stringBuilder = stringBuilder .. Stats.Separator("Cauchemar commun", 7)
        end
        for i=1,6 do
            if args["DDDloc"..tostring(i)] ~= nil then
                stringBuilder = stringBuilder .. Stats.DataRow({
                    {["data"] = args["DDDloc"..tostring(i)], ["class"] = "textData"},
                    {["data"] = args["DDDniv"..tostring(i)], ["class"] = "numberData"},
                    {["data"] = math.floor((args["DDDCHP"] or args["DDDHP"])*(1+args["DDDniv"..tostring(i)]/10)), ["class"] = "numberData"},
                    {["data"] = math.floor((args["DDDCEXP"] or args["DDDEXP"])*DDDExpNiv[args["DDDniv"..tostring(i)]]), ["class"] = "numberData"},
                    {["data"] = math.floor((args["DDDCFor"] or args["DDDFor"])*(1+args["DDDniv"..tostring(i)]/10)), ["class"] = "numberData"},
                    {["data"] = math.floor((args["DDDCMag"] or args["DDDMag"])*(1+args["DDDniv"..tostring(i)]/10)), ["class"] = "numberData"},
                    {["data"] = math.floor((args["DDDCDef"] or args["DDDDef"])*(1+args["DDDniv"..tostring(i)]/10)), ["class"] = "numberData"},
                })
            end
        end
        if args["DDDCRloc1"] then
            stringBuilder = stringBuilder .. Stats.Separator("Cauchemar commun", 7)
            for i=1,6 do
                stringBuilder = stringBuilder .. Stats.DataRow({
                    {["data"] = args["DDDCRloc"..tostring(i)], ["class"] = "textData"},
                    {["data"] = args["DDDCRniv"..tostring(i)], ["class"] = "numberData"},
                    {["data"] = math.floor(args["DDDCRHP"]*(1+args["DDDCRniv"..tostring(i)]/10)), ["class"] = "numberData"},
                    {["data"] = math.floor(args["DDDCREXP"]*DDDExpNiv[args["DDDCRniv"..tostring(i)]]), ["class"] = "numberData"},
                    {["data"] = math.floor(args["DDDCRFor"]*(1+args["DDDCRniv"..tostring(i)]/10)), ["class"] = "numberData"},
                    {["data"] = math.floor(args["DDDCRMag"]*(1+args["DDDCRniv"..tostring(i)]/10)), ["class"] = "numberData"},
                    {["data"] = math.floor(args["DDDCRDef"]*(1+args["DDDCRniv"..tostring(i)]/10)), ["class"] = "numberData"},
                })
            end
        end
        stringBuilder = stringBuilder .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.ContainerLine()
    end
    if args["DDDlocBoss1"] ~= nil or args["DDDHPfixes"] ~= nil then
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Statistiques",6)
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"] = "Monde", ["style"] = "width:40%; padding-left:1em;"},
            {["label"] = '[[Niveau de combat|Niveau]]', ["style"] = "width:12.5%;"},
            {["label"] = 'HP', ["style"] = "width:12.5%;"},
            {["label"] = "Force", ["style"] = "width:12.5%;"},
            {["label"] = "Magie", ["style"] = "width:12.5%;"},
            {["label"] = "Défense", ["style"] = "width:2.5%;"}
        })
        if args["DDDHPfixes"] ~= nil then
            stringBuilder = stringBuilder .. Stats.DataRow({
                {["data"]=args["DDDlocfixes"], ["class"]="textData"},
                {["data"]=args["DDDnivfixes"], ["class"]="numberData"},
                {["data"]=args["DDDHPfixes"], ["class"]="numberData"},
                {["data"]="-", ["class"]="numberData"},
                {["data"]="-", ["class"]="numberData"},
                {["data"]="-", ["class"]="numberData"},
            })
        end
        for i=1,3 do
            if args["DDDlocBoss"..tostring(i)] ~= nil then
                stringBuilder = stringBuilder .. Stats.DataRow({
                    {["data"] = args["DDDlocBoss"..tostring(i)], ["class"] = "textData"},
                    {["data"] = args["DDDnivBoss"..tostring(i)], ["class"] = "numberData"},
                    {["data"] = math.floor(args["DDDHP"]*(1+args["DDDnivBoss"..tostring(i)]/10)), ["class"] = "numberData"},
                    {["data"] = math.floor(args["DDDFor"]*(1+args["DDDnivBoss"..tostring(i)]/10)), ["class"] = "numberData"},
                    {["data"] = math.floor(args["DDDMag"]*(1+args["DDDnivBoss"..tostring(i)]/10)), ["class"] = "numberData"},
                    {["data"] = math.floor(args["DDDDef"]*(1+args["DDDnivBoss"..tostring(i)]/10)), ["class"] = "numberData"}
                })
            end
        end
        if args["DDD2FlocBoss1"] ~= nil then
            for i=1,2 do 
                if args["DDD2FlocBoss"..tostring(i)] ~= nil then
                    stringBuilder = stringBuilder .. Stats.DataRow({
                        {["data"] = args["DDD2FlocBoss"..tostring(i)], ["class"] = "textData"},
                        {["data"] = args["DDD2FnivBoss"..tostring(i)], ["class"] = "numberData"},
                        {["data"] = math.floor(args["DDD2FHP"]*(1+args["DDD2FnivBoss"..tostring(i)]/10)), ["class"] = "numberData"},
                        {["data"] = math.floor(args["DDD2FFor"]*(1+args["DDD2FnivBoss"..tostring(i)]/10)), ["class"] = "numberData"},
                        {["data"] = math.floor(args["DDD2FMag"]*(1+args["DDD2FnivBoss"..tostring(i)]/10)), ["class"] = "numberData"},
                        {["data"] = math.floor(args["DDD2FDef"]*(1+args["DDD2FnivBoss"..tostring(i)]/10)), ["class"] = "numberData"}
                    })
                end
            end
        end
        if args["DDD3FlocBoss1"] ~= nil then
            for i=1,2 do 
                if args["DDD3FlocBoss"..tostring(i)] ~= nil then
                    stringBuilder = stringBuilder .. Stats.DataRow({
                        {["data"] = args["DDD3FlocBoss"..tostring(i)], ["class"] = "textData"},
                        {["data"] = args["DDD3FnivBoss"..tostring(i)], ["class"] = "numberData"},
                        {["data"] = math.floor(args["DDD3FHP"]*(1+args["DDD3FnivBoss"..tostring(i)]/10)), ["class"] = "numberData"},
                        {["data"] = math.floor(args["DDD3FFor"]*(1+args["DDD3FnivBoss"..tostring(i)]/10)), ["class"] = "numberData"},
                        {["data"] = math.floor(args["DDD3FMag"]*(1+args["DDD3FnivBoss"..tostring(i)]/10)), ["class"] = "numberData"},
                        {["data"] = math.floor(args["DDD3FDef"]*(1+args["DDD3FnivBoss"..tostring(i)]/10)), ["class"] = "numberData"}
                    })
                end
            end
        end
        stringBuilder = stringBuilder .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.ContainerLine()
    end
    if args["DDDbrasier"]~=nil then
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Faiblesses/Résistances",6)
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"] = "Brasier", ["style"]="width:16.6%;"},
            {["label"] = "Glacier", ["style"]="width:16.6%;"},
            {["label"] = "Foudre", ["style"]="width:16.6%;"},
            {["label"] = "Eau", ["style"]="width:16.6%;"},
            {["label"] = "Ténèbres", ["style"]="width:16.6%;"},
            {["label"] = "Lumière", ["style"]="width:16.6%;"}
        })
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = (args["DDDbrasier"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["DDDglacier"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["DDDfoudre"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["DDDeau"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["DDDten"] or "x1.0"), ["class"]="numberData"}, 
            {["data"] = (args["DDDlum"] or "x1.0"), ["class"]="numberData"}
        })
        stringBuilder = stringBuilder .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.ContainerLine()
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Altérations d'état",5)
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"] = "KO", ["style"]="width:20%;"},
            {["label"] = "Mini", ["style"]="width:20%;"},
            {["label"] = "Sommeil", ["style"]="width:20%;"},
            {["label"] = "Blackout", ["style"]="width:20%;"},
            {["label"] = "Stop", ["style"]="width:20%;"},
        })
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = (args["DDDko"] or "O"), ["class"]="numberData"}, 
            {["data"] = (args["DDDmini"] or "O"), ["class"]="numberData"}, 
            {["data"] = (args["DDDsommeil"] or "O"), ["class"]="numberData"}, 
            {["data"] = (args["DDDblackout"] or "O"), ["class"]="numberData"}, 
            {["data"] = (args["DDDstop"] or "O"), ["class"]="numberData"}, 
        })
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"] = "Glaciation"},
            {["label"] = "Folie"},
            {["label"] = "Poison"},
            {["label"] = "Aimant"},
            {["label"] = "Somni"}
        })
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = (args["DDDglaciation"] or "O"), ["class"]="numberData"}, 
            {["data"] = (args["DDDfolie"] or "O"), ["class"]="numberData"}, 
            {["data"] = (args["DDDpoison"] or "O"), ["class"]="numberData"}, 
            {["data"] = (args["DDDaimant"] or "O"), ["class"]="numberData"}, 
            {["data"] = (args["DDDsomni"] or "O"), ["class"]="numberData"}
        })
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"] = "Mise à feu"},
            {["label"] = "Ficelage"},
            {["label"] = "Gravité nulle"},
            {["label"] = "Bombe retard."},
            {["label"] = "Zantetsuken"}
        })
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = (args["DDDmise à feu"] or "O"), ["class"]="numberData"},
            {["data"] = (args["DDDficelage"] or "O"), ["class"]="numberData"}, 
            {["data"] = (args["DDDgravité nulle"] or "O"), ["class"]="numberData"}, 
            {["data"] = (args["DDDbombe retard"] or "O"), ["class"]="numberData"}, 
            {["data"] = (args["DDDzantetsuken"] or "O"), ["class"]="numberData"}
        })
        stringBuilder = stringBuilder .. Stats.CloseContainer()
    end
    if args["DDDrecomp"]~= nil then
        stringBuilder = stringBuilder .. Stats.ContainerLine()
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Récompenses",1)
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = args["DDDrecomp"], ["class"] = "textData"}
        })
        stringBuilder = stringBuilder .. Stats.CloseContainer()
    end
    stringBuilder = stringBuilder .. Stats.CloseFinal()
    stringBuilder = stringBuilder .. Stats.Categories(args, "DDD", "ennemis")
    if multiples then stringBuilder = stringBuilder .. Stats.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end
 
function Stats.EnnemiCHI(args, multiples)
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Stats.OpenTab(args, "CHI") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Statistiques",4)
    stringBuilder = stringBuilder .. Stats.MixedRow({
        {["label"]=1, ["text"]="Mondes", ["colspan"]=1, ["style"]=""},
        {["text"]=args["CHIMondes"], ["colspan"]=3, ["style"]=""},
    })
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"]="AP", ["style"]="width:25%"},
        {["label"]='<acronym title="Facteur de réduction des dégâts subis">Défense</acronym>', ["style"]="width:25%"},
        {["label"]="Réapparition", ["style"]="width:25%"},
        {["label"]="EXP", ["style"]="width:25%;"},
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"]=(args["CHIAP"] or "N/D"), ["class"]="numberData"},
        {["data"]=(args["CHIDef"] or "N/D"), ["class"]="numberData"},
        {["data"]=(args["CHIDélai"] or "N/D"), ["class"]="numberData"},
        {["data"]=(args["CHIEXP"] or "N/D"), ["class"]="numberData"},
    })
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    stringBuilder = stringBuilder .. Stats.ContainerLine()
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Récompenses",3)
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"]="Cartes", ["style"]="width:40%;"},
        {["label"]="Lux", ["style"]="width:30%;"},
        {["label"]="Munnies", ["style"]="width:30%;"},
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"]=(args["CHICartes"] or "N/D"), ["class"]="textData"},
        {["data"]=(args["CHILux"] or "N/D"), ["class"]="textData"},
        {["data"]=(args["CHIMunnies"] or "N/D"), ["class"]="textData"},
    })
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    stringBuilder = stringBuilder .. Stats.CloseFinal()
    stringBuilder = stringBuilder .. Stats.Categories(args, "CHI", "ennemis")
    if multiples then stringBuilder = stringBuilder .. Stats.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end
 
function Stats.EnnemiKHUX(args, multiples)
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Stats.OpenTab(args, "KHUX") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Statistiques",3)
    if args["KHUXlabel"] ~= nil then
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"]="Élément", ["style"]="width:33%"},
            {["label"]="Attribut", ["style"]="width:33%"},
            {["label"]="Type", ["style"]="width:33%"},
        })
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"]=args["KHUXlabel"], ["class"]="numberData"},
            {["data"]=KHUXTypes[args["KHUXattribut"]], ["class"]="numberData"},
            {["data"]=KHUXTypes[args["KHUXtype"]], ["class"]="numberData"},
        })
        for i=2,4 do
            if args["KHUXlabel"..tostring(i)]~= nil then
                stringBuilder = stringBuilder .. Stats.DataRow({
                    {["data"]=args["KHUXlabel"..tostring(i)], ["class"]="numberData"},
                    {["data"]=KHUXTypes[args["KHUXattribut"..tostring(i)]], ["class"]="numberData"},
                    {["data"]=KHUXTypes[args["KHUXtype"..tostring(i)] or args["KHUXtype"]], ["class"]="numberData"},
                })
            end
        end
    else
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"]="Attribut", ["style"]="width:50%"},
            {["label"]="Type", ["style"]="width:50%"},
        })
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"]=KHUXTypes[args["KHUXattribut"]], ["class"]="numberData"},
            {["data"]=KHUXTypes[args["KHUXtype"]], ["class"]="numberData"},
        })
    end
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    stringBuilder = stringBuilder .. Stats.CloseFinal()
    stringBuilder = stringBuilder .. Stats.Categories(args, "KHUX", "ennemis")
    if multiples then stringBuilder = stringBuilder .. Stats.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end
 
function Stats.Ennemi02(args, multiples)
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Stats.OpenTab(args, "0.2") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Statistiques",3)
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Lieu", ["style"] = "width:70%; padding-left:1em;"},
        {["label"] = '<acronym title="Valeur estimée">HP</acronym>', ["style"] = "width:15%;"},
        {["label"] = '<acronym title="25% supplémentaires en mode Débutant">EXP</acronym>', ["style"] = "width:15%;"}
    })
    for i=1,7 do
        if args["0.2loc"..tostring(i)] ~= nil then
            stringBuilder = stringBuilder .. Stats.DataRow({
                {["data"] = args["0.2loc"..tostring(i)], ["class"] = "textData"},
                {["data"] = args["0.2HP"..tostring(i)], ["class"] = "numberData"},
                {["data"] = (args["0.2EXP"..tostring(i)] or '-'), ["class"] = "numberData"}
            })
        end
    end
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    if args["0.2recomp"] ~= nil then
        stringBuilder = stringBuilder .. Stats.ContainerLine()
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Récompenses",1)
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = args["0.2recomp"], ["class"] = "textData"}
        })
        stringBuilder = stringBuilder .. Stats.CloseContainer()
    end
    stringBuilder = stringBuilder .. Stats.CloseFinal()
    stringBuilder = stringBuilder .. Stats.Categories(args, "0.2", "ennemis")
    if multiples then stringBuilder = stringBuilder .. Stats.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end
 
function Stats.EnnemiKH3(args, multiples)
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Stats.OpenTab(args, "KH3") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Statistiques",6)
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Monde", ["style"] = "width:40%; padding-left:1em;"},
        {["label"] = '[[Niveau de combat|Niveau]]', ["style"] = "width:12%;"},
        {["label"] = 'HP', ["style"] = "width:12%;"},
        {["label"] = '<acronym title="25% supplémentaires en mode Débutant">EXP</acronym>', ["style"] = "width:12%;"},
        {["label"] = "Force", ["style"] = "width:12%;"},
        {["label"] = "Défense", ["style"] = "width:12%;"}
    })
    for i=1,22 do
        if args["KH3loc"..tostring(i)] ~= nil then
            stringBuilder = stringBuilder .. Stats.DataRow({
                {["data"]=args["KH3loc"..tostring(i)], ["class"]="textData"},
                {["data"] = args["KH3niv"..tostring(i)], ["class"] = "numberData"},
                {["data"] = (args["KH3HP"..tostring(i)] or Stats.round(args["KH3HP"]*KH3Niv[args["KH3niv"..tostring(i)]]["HP"])), ["class"] = "numberData"},
                {["data"] = (args["KH3EXP"] == 0 and "-" or Stats.round(args["KH3EXP"]*KH3Niv[args["KH3niv"..tostring(i)]]["EXP"])), ["class"] = "numberData"},
                {["data"] = KH3Niv[args["KH3niv"..tostring(i)]]["For"], ["class"] = "numberData"},
                {["data"] = KH3Niv[args["KH3niv"..tostring(i)]]["Def"], ["class"] = "numberData"}
            })
        end
    end
    if args["KH3locAlt"] ~= nil then
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"]=args["KH3locAlt"], ["class"]="textData"},
            {["data"] = args["KH3nivAlt"], ["class"] = "numberData"},
            {["data"] = Stats.round(args["KH3HPAlt"]*KH3Niv[args["KH3nivAlt"]]["HP"]), ["class"] = "numberData"},
            {["data"] = (args["KH3EXPAlt"] == 0 and "-" or Stats.round(args["KH3EXPAlt"]*KH3Niv[args["KH3nivAlt"]]["EXP"])), ["class"] = "numberData"},
            {["data"] = KH3Niv[args["KH3nivAlt"]]["For"], ["class"] = "numberData"},
            {["data"] = KH3Niv[args["KH3nivAlt"]]["Def"], ["class"] = "numberData"}
        })
    end
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    stringBuilder = stringBuilder .. Stats.ContainerLine()
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Faiblesses/Résistances",4)
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Arme", ["style"]="width:25%;"},
        {["label"] = "Brasier", ["style"]="width:25%;"},
        {["label"] = "Glacier", ["style"]="width:25%;"},
        {["label"] = "Foudre", ["style"]="width:25%;"}
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = (args["KH3arme"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["KH3brasier"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["KH3glacier"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["KH3foudre"] or "x1.0"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Eau"},
        {["label"] = "Rafale"},
        {["label"] = "Ténèbres"},
        {["label"] = "Autre"}
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = (args["KH3eau"] or "x1.0"), ["class"]="numberData"},
        {["data"] = (args["KH3rafale"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["KH3ténèbres"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["KH3autre"] or "x1.0"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Stats.MixedRow({
        {["label"]=1, ["text"]="Attaques continues", ["colspan"]=2},
        {["text"]=(args["KH3continu"] or "x1.0"), ["colspan"]=2}
    })
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Gel"},
        {["label"] = "Électrocuté"},
        {["label"] = "KO"},
        {["label"] = "Miel"}
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = (args["KH3gel"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["KH3électrocuté"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["KH3ko"] or "O"), ["class"]="numberData"},
        {["data"] = (args["KH3miel"] or "O"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Résistance réaction"},
        {["label"] = "Contre"},
        {["label"] = "Attraction"},
        {["label"] = "Limite-Dégâts"}
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = (args["KH3réaction"] or "0"), ["class"]="numberData"}, 
        {["data"] = (args["KH3contre"] or "-"), ["class"]="numberData"}, 
        {["data"] = (args["KH3attraction"] or "x1.0"), ["class"]="numberData"},
        {["data"] = (args["KH3dégâts"] or "-"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    if args["KH3recomp"] ~= nil then
        stringBuilder = stringBuilder .. Stats.ContainerLine()
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Récompenses",1)
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = args["KH3recomp"], ["class"] = "textData"}
        })
        stringBuilder = stringBuilder .. Stats.CloseContainer()
    end
    stringBuilder = stringBuilder .. Stats.CloseFinal()
    stringBuilder = stringBuilder .. Stats.Categories(args, "KH3", "ennemis")
    if multiples then stringBuilder = stringBuilder .. Stats.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end
 
function Stats.EnnemiREM(args, multiples)
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Stats.OpenTab(args, "REM") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Statistiques",6)
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Monde", ["style"] = "width:40%; padding-left:1em;"},
        {["label"] = '[[Niveau de combat|Niveau]]', ["style"] = "width:12%;"},
        {["label"] = 'HP', ["style"] = "width:12%;"},
        {["label"] = '<acronym title="25% supplémentaires en mode Débutant">EXP</acronym>', ["style"] = "width:12%;"},
        {["label"] = "Force", ["style"] = "width:12%;"},
        {["label"] = "Défense", ["style"] = "width:12%;"}
    })
    for i=1,3 do
        if args["REMloc"..tostring(i)] ~= nil then
            stringBuilder = stringBuilder .. Stats.DataRow({
                {["data"]=args["REMloc"..tostring(i)], ["class"]="textData"},
                {["data"] = args["REMniv"..tostring(i)], ["class"] = "numberData"},
                {["data"] = (args["REMHP"..tostring(i)] or Stats.round(args["REMHP"]*KH3Niv[args["REMniv"..tostring(i)]]["HP"])), ["class"] = "numberData"},
                {["data"] = (args["REMEXP"] == 0 and "-" or Stats.round(args["REMEXP"]*KH3Niv[args["REMniv"..tostring(i)]]["EXP"])), ["class"] = "numberData"},
                {["data"] = KH3Niv[args["REMniv"..tostring(i)]]["For"], ["class"] = "numberData"},
                {["data"] = KH3Niv[args["REMniv"..tostring(i)]]["Def"], ["class"] = "numberData"}
            })
        end
    end
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    stringBuilder = stringBuilder .. Stats.ContainerLine()
    stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Faiblesses/Résistances",4)
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Arme", ["style"]="width:25%;"},
        {["label"] = "Brasier", ["style"]="width:25%;"},
        {["label"] = "Glacier", ["style"]="width:25%;"},
        {["label"] = "Foudre", ["style"]="width:25%;"}
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = (args["REMarme"] or args["KH3arme"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["REMbrasier"] or args["KH3brasier"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["REMglacier"] or args["KH3glacier"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["REMfoudre"] or args["KH3foudre"] or "x1.0"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Eau"},
        {["label"] = "Rafale"},
        {["label"] = "Ténèbres"},
        {["label"] = "Autre"}
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = (args["REMeau"] or args["KH3eau"] or "x1.0"), ["class"]="numberData"},
        {["data"] = (args["REMrafale"] or args["KH3rafale"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["REMténèbres"] or args["KH3ténèbres"] or "x1.0"), ["class"]="numberData"}, 
        {["data"] = (args["REMautre"] or args["KH3autre"] or "x1.0"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Stats.MixedRow({
        {["label"]=1, ["text"]="Attaques continues", ["colspan"]=2},
        {["text"]=(args["REMcontinu"] or args["KH3continu"] or "x1.0"), ["colspan"]=2}
    })
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Gel"},
        {["label"] = "Électrocuté"},
        {["label"] = "KO"},
        {["label"] = "Miel"}
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = (args["REMgel"] or args["KH3gel"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["REMélectrocuté"] or args["KH3électrocuté"] or "O"), ["class"]="numberData"}, 
        {["data"] = (args["REMko"] or args["KH3ko"] or "O"), ["class"]="numberData"},
        {["data"] = (args["REMmiel"] or args["KH3miel"] or "O"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Résistance réaction"},
        {["label"] = "Contre"},
        {["label"] = "Attraction"},
        {["label"] = "Limite-Dégâts"}
    })
    stringBuilder = stringBuilder .. Stats.DataRow({
        {["data"] = (args["REMréaction"] or args["KH3réaction"] or "0"), ["class"]="numberData"}, 
        {["data"] = (args["REMcontre"] or args["KH3contre"] or "-"), ["class"]="numberData"}, 
        {["data"] = (args["REMattraction"] or args["KH3attraction"] or "x1.0"), ["class"]="numberData"},
        {["data"] = (args["REMdégâts"] or args["KH3dégâts"] or "-"), ["class"]="numberData"}
    })
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    if args["REMrecomp"] ~= nil then
        stringBuilder = stringBuilder .. Stats.ContainerLine()
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Récompenses",1)
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = args["REMrecomp"], ["class"] = "textData"}
        })
        stringBuilder = stringBuilder .. Stats.CloseContainer()
    end
    stringBuilder = stringBuilder .. Stats.CloseFinal()
    stringBuilder = stringBuilder .. Stats.Categories(args, "REM", "ennemis")
    if multiples then stringBuilder = stringBuilder .. Stats.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end
-----------------------------
--Fin des fonctions ennemis--
-----------------------------
 
----------------------
--Tableau esprit DDD--
----------------------
function Stats.EspritDDD(args, multiples)
    local stringBuilder = ""
    if multiples then stringBuilder = stringBuilder .. Stats.OpenTab(args, "DDD - Esprit") end -- Ouvre un tab si nécessaire
    stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
    s=[[stringBuilder = stringBuilder .. Stats.OpenBox()
    stringBuilder = stringBuilder .. Stats.Header("Statistiques",1)
    stringBuilder = stringBuilder .. Stats.LabelRow({
        {["label"] = "Monde", ["style"] = "width:100%;"}
    })
    for i=1,10 do
        if args["KH3loc"..tostring(i)] ~= nil then
            stringBuilder = stringBuilder .. Stats.DataRow({
                {["data"]=args["KH3loc"..tostring(i)], ["class"]="textData"}
            })
        end
    end
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    if args["KH3recomp"] ~= nil then
        stringBuilder = stringBuilder .. Stats.ContainerLine()
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Récompenses",1)
        stringBuilder = stringBuilder .. Stats.DataRow({
            {["data"] = args["KH3recomp"], ["class"] = "textData"}
        })
        stringBuilder = stringBuilder .. Stats.CloseContainer()
    end]]
    stringBuilder = stringBuilder .. Stats.CloseContainer()
    --stringBuilder = stringBuilder .. Stats.Categories(args, "KH3", "ennemis")
    if multiples then stringBuilder = stringBuilder .. Stats.CloseTab() end -- Ferme un tab si nécessaire
    return stringBuilder
end
 
--Wrapper cauchemar DDD
function Stats.CauchemarDDD(args, multiples)
    return Stats.EnnemiDDD(args, multiples, "DDD - Cauchemar")
end
------------------
--Fin esprit DDD--
------------------
 
 
----------------------
--Tableau cartes COM--
----------------------
 
function Stats.CartesCOM(frame)
    local args = Stats.CleanArgs(frame.args)
    local stringBuilder = ''
    local multiples = ((args["Carte 1"] ~= nil and 1 or 0) + (args["Tour 1"] ~= nil and 1 or 0) + (args["combat 1"] ~= nil and 1 or 0) > 1)
    if multiples then
        stringBuilder = stringBuilder .. '<div class="StatTabber '..(args["theme"] or "")..'"><tabber>\nCartes=\n'
    end
    if args["Carte 1"] ~= nil then
        stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Liste des cartes",3)
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"]="Carte", ["style"]="width:75px;"},
            {["label"]="Nom", ["style"]="width:150px;"},
            {["label"]="Description"},
        })
        for i=1,7 do
            if args["Carte "..tostring(i)] then
                stringBuilder = stringBuilder .. Stats.DataRow({
                    {["data"]="[[Fichier:"..args["Image Carte "..tostring(i)].."|50px]]", ["class"]="numberData"},
                    {["data"]=args["Carte "..tostring(i)], ["class"]="textData"},
                    {["data"]=args["Description Carte "..tostring(i)], ["class"]="textData"},
                })
            end
        end
        stringBuilder = stringBuilder .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.CloseFinal()
    end
    if args["Tour 1"] ~= nil then
        if args["Carte 1"] then stringBuilder = stringBuilder .. Stats.NewTab("Tours") end
        stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
        stringBuilder = stringBuilder .. Stats.OpenBox()
        stringBuilder = stringBuilder .. Stats.Header("Tours",3)
        stringBuilder = stringBuilder .. Stats.LabelRow({
            {["label"]="Cartes", ["style"]="width:150px;"},
            {["label"]="Tour", ["style"]="width:150px;"},
            {["label"]="Description"},
        })
        for i=1,5 do
            if args["Tour "..tostring(i)] then
                stringBuilder = stringBuilder .. Stats.DataRow({
                    {["data"]=args["Cartes Tour "..tostring(i)], ["class"]="numberData"},
                    {["data"]=args["Tour "..tostring(i)], ["class"]="textData"},
                    {["data"]=args["Description Tour "..tostring(i)], ["class"]="textData"},
                })
            end
        end
        stringBuilder = stringBuilder .. Stats.CloseContainer()
        stringBuilder = stringBuilder .. Stats.CloseFinal()
    end
    for i=1,6 do
        if args["combat "..tostring(i)] ~= nil then
            stringBuilder = stringBuilder .. Stats.NewTab(args["combat "..i])
            stringBuilder = stringBuilder .. Stats.OpenContainer(args["theme"])
            stringBuilder = stringBuilder .. Stats.OpenBox()
            stringBuilder = stringBuilder .. Stats.Header("Liste des cartes",12)
            stringBuilder = stringBuilder .. Stats.LabelRow({
                {["label"]="Carte", ["style"]=""},
                {["label"]="1", ["style"]="width:30px;"},
                {["label"]="2", ["style"]="width:30px;"},
                {["label"]="3", ["style"]="width:30px;"},
                {["label"]="4", ["style"]="width:30px;"},
                {["label"]="5", ["style"]="width:30px;"},
                {["label"]="6", ["style"]="width:30px;"},
                {["label"]="7", ["style"]="width:30px;"},
                {["label"]="8", ["style"]="width:30px;"},
                {["label"]="9", ["style"]="width:30px;"},
                {["label"]="0", ["style"]="width:30px;"},
                {["label"]="Total", ["style"]=""},
            })
            for j=1,7 do
                if args["combat "..tostring(i).." carte "..tostring(j).." ennemi"] ~= nil then
                    stringBuilder = stringBuilder .. Stats.MixedRow({
                        {["label"]=1, ["text"]="[[Fichier:"..args["Image Carte "..tostring(j)].."|50px]]", ["style"]= "text-align:center; padding-left:0;"},
                        {["text"]= args["combat "..tostring(i).." carte "..tostring(j).." ennemi"], ["colspan"] = 11, ["style"]= "text-align:center; padding:0; vertical-align:middle;"},
                    })
                elseif args["combat "..tostring(i).." carte "..tostring(j).." total"] ~= nil then
                    stringBuilder = stringBuilder .. Stats.MixedRow({
                        {["label"]=1, ["text"]="[[Fichier:"..args["Image Carte "..tostring(j)].."|50px]]", ["style"]= "text-align:center; padding-left:0;"},
                        {["text"]= args["combat "..tostring(i).." carte "..tostring(j).." #1"] or 0, ["style"]="text-align:center; padding:0; vertical-align:middle;"},
                        {["text"]= args["combat "..tostring(i).." carte "..tostring(j).." #2"] or 0, ["style"]="text-align:center; padding:0; vertical-align:middle;"},
                        {["text"]= args["combat "..tostring(i).." carte "..tostring(j).." #3"] or 0, ["style"]="text-align:center; padding:0; vertical-align:middle;"},
                        {["text"]= args["combat "..tostring(i).." carte "..tostring(j).." #4"] or 0, ["style"]="text-align:center; padding:0; vertical-align:middle;"},
                        {["text"]= args["combat "..tostring(i).." carte "..tostring(j).." #5"] or 0, ["style"]="text-align:center; padding:0; vertical-align:middle;"},
                        {["text"]= args["combat "..tostring(i).." carte "..tostring(j).." #6"] or 0, ["style"]="text-align:center; padding:0; vertical-align:middle;"},
                        {["text"]= args["combat "..tostring(i).." carte "..tostring(j).." #7"] or 0, ["style"]="text-align:center; padding:0; vertical-align:middle;"},
                        {["text"]= args["combat "..tostring(i).." carte "..tostring(j).." #8"] or 0, ["style"]="text-align:center; padding:0; vertical-align:middle;"},
                        {["text"]= args["combat "..tostring(i).." carte "..tostring(j).." #9"] or 0, ["style"]="text-align:center; padding:0; vertical-align:middle;"},
                        {["text"]= args["combat "..tostring(i).." carte "..tostring(j).." #0"] or 0, ["style"]="text-align:center; padding:0; vertical-align:middle;"},
                        {["text"]= args["combat "..tostring(i).." carte "..tostring(j).." total"], ["style"]="text-align:center; padding:0; vertical-align:middle;"}
                    })
                end
            end
            stringBuilder = stringBuilder .. Stats.CloseContainer()
            stringBuilder = stringBuilder .. Stats.CloseFinal()
        end
    end
    if multiples then
        stringBuilder = stringBuilder .. '</tabber></div>'
    end
    return frame:preprocess(stringBuilder)
end
 
--------------------------
--Fin Tableau cartes COM--
--------------------------
 
-- Liste des jeux, la fonction à lancer si ce jeu est employé, et l'argument qui déclenche l'appel de cette fonction s'il est présent.
local triggers = {
    ["ennemis"] = {
        {["function"] = Stats.EnnemiKH1, ["triggers"] = {"KHarme", "KHarmeAvant", "KHarmeAprès"}}, -- KH1
        {["function"] = Stats.EnnemiCOM, ["triggers"] = {"COMmondes"}}, -- COM -- Ajouter : prevents? afin de mettre 1.5 à un autre endroit
        {["function"] = Stats.EnnemiKH2, ["triggers"] = {"KH2arme"}}, -- KH2
        {["function"] = Stats.Ennemi358, ["triggers"] = {"358brasier"}}, -- Days
        {["function"] = Stats.EnnemiBBS, ["triggers"] = {"BBSarme"}}, -- BBS
        {["function"] = Stats.EnnemiKHR, ["triggers"] = {"KHRbrasier"}}, -- Re:coded
        {["function"] = Stats.EnnemiDDD, ["triggers"] = {"DDDbrasier", "DDDlocfixes"}}, --DDD
        {["function"] = Stats.EnnemiCHI, ["triggers"] = {"CHIMondes", "CHIAP"}}, -- CHI
        {["function"] = Stats.EnnemiKHUX, ["triggers"] = {"KHUXattribut"}}, -- KHUX
        {["function"] = Stats.Ennemi02, ["triggers"] = {"0.2loc1"}}, -- 0.2
        {["function"] = Stats.EnnemiKH3, ["triggers"] = {"KH3loc1"}}, -- KH3
        {["function"] = Stats.EnnemiREM, ["triggers"] = {"REMloc1"}}, -- KH3 Re Mind
    },
    ["AR"] = {
        {["function"] = Stats.EspritDDD, ["triggers"] = {"DDDEHP"}}, -- Esprit DDD
        {["function"] = Stats.CauchemarDDD, ["triggers"] = {"DDDloc1", "DDDlocBoss1", "DDDlocCR1"}}, --Cauchemar DDD
    }
}
 
--Récupère la liste des fonctions à exécuter et détermine s'il y en a plusieurs afin de générer un tabber
function Stats.getFunctions(args, caller)
    local count = 0
    local functions = {}
    local trigger = triggers[caller]
    for _, game in ipairs(trigger) do
        for _, arg in ipairs(game["triggers"]) do
            if args[arg]~= nil then
                count = count + 1
                table.insert(functions, game["function"])
                break
            end
        end
    end
    return count > 1, functions
end
 
function Stats.Stats(frame, caller)
    local stringBuilder = ""
    local args = Stats.CleanArgs(frame.args)
    local multiples, functions = Stats.getFunctions(args, caller)
    if multiples then
        stringBuilder = stringBuilder .. '<div class="StatTabber '..(args["theme"] or "")..'"><tabber>'
    end
    for _, func in ipairs(functions) do
        stringBuilder = stringBuilder .. func(args, multiples)
    end
    if multiples then
        stringBuilder = stringBuilder .. '</tabber></div>'
    end
    return frame:preprocess(stringBuilder)
end
 
 
function Stats.StatsEnnemi(frame)
    return Stats.Stats(frame, "ennemis")
end
 
function Stats.StatsAR(frame)
    frame.args["theme"] = "AvaleReves"
    return Stats.Stats(frame, "AR")
end
 
--function Stats.StatsArme(frame)
--function Stats.StatsAccessoire(frame)
--function Stats.StatsMatériau(frame)
 
return Stats
Sauf mention contraire, le contenu de la communauté est disponible sous licence CC-BY-SA .