Outils pour utilisateurs

Outils du site


simulateur

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
simulateur [2026/10/12 00:43] – nanakisimulateur [2026/10/16 18:08] (Version actuelle) – nanaki
Ligne 1: Ligne 1:
-Ci dessous, vous avez le lien pour deux simulateurs. +Bonjour, 
-Celui du wiki [[https://age-of-olympia.net/wiki/doku.php?id=simulateur_saison3|ici]]+Voici le simulateur pour la saison 3. \\ 
 +N'hésitez pas à remonter des problèmes si il y a.\\ 
 +Le bouton import et export ne fonctionnent plus très bien, utiliser le bouton lien pour le moment.
  
-Et celui de Medarda : [[https://aoo-build-card.vercel.app/|la]]+<html> 
 +<head> 
 +<meta charset="UTF-8"> 
 +<meta name="viewport" content="width=device-width, initial-scale=1"> 
 +<title>Simulateur RPG</title> 
 + 
 +<style> 
 +body { 
 +    font-family: Arial, sans-serif; 
 +    background:#0b1a13; 
 +    color:#7dd3fc; 
 +    padding:10px; 
 +} 
 + 
 +h1,h2 { color:gold; } 
 +h3 { color:#7dd3fc; } 
 + 
 +.box { 
 +    border:1px solid gold; 
 +    padding:10px; 
 +    margin-bottom:10px; 
 +} 
 + 
 +select { 
 +    margin:3px; 
 +    max-width:220px; 
 +} 
 + 
 +input { 
 +    margin:3px; 
 +    width:65px; 
 +} 
 + 
 +.statLine { 
 +    display:flex; 
 +    justify-content:space-between; 
 +    max-width:260px; 
 +} 
 + 
 +.result { 
 +    background:#000; 
 +    color:#00ffcc; 
 +    padding:10px; 
 +    white-space:pre-wrap; 
 +    overflow-wrap:anywhere; 
 +} 
 + 
 +.small { 
 +    font-size:12px; 
 +    color:#aaa; 
 +} 
 + 
 +.equipStats { 
 +    margin-left:5px; 
 +} 
 + 
 +.bonus,.special { 
 +    color:#00ff00; 
 +} 
 + 
 +.malus { 
 +    color:#ff3333; 
 +} 
 + 
 +/* Magie interdite : rouge uniquement dans les bonus/malus */ 
 +.forbiddenMagic { 
 +    color:#ff3333; 
 +    font-weight:bold; 
 +} 
 + 
 +button { 
 +    margin:4px; 
 +    padding:7px 10px; 
 +    cursor:pointer; 
 +} 
 +</style> 
 +</head> 
 + 
 +<body> 
 + 
 +<h1>🎲 Simulateur</h1> 
 + 
 +<div class="box"> 
 +    Race : 
 +    <select id="race"></select> 
 + 
 +    <h3>Stats de base</h3> 
 +    <pre id="baseStats"></pre> 
 +</div> 
 + 
 +<div class="box"> 
 +    <h3>Améliorations</h3> 
 +    <div id="stats"></div> 
 +    <div id="cost"></div> 
 +</div> 
 + 
 +<div class="box"> 
 +    <h3>Équipement (3 max + 1 anneau)</h3> 
 + 
 +    Tête 
 +    <select id="head"></select> 
 +    <span id="headStats" class="equipStats"></span> 
 +    <br> 
 + 
 +    Dos 
 +    <select id="cape"></select> 
 +    <span id="capeStats" class="equipStats"></span> 
 +    <br> 
 + 
 +    Main droite 
 +    <select id="rightHand"></select> 
 +    <span id="rightStats" class="equipStats"></span> 
 +    <br> 
 + 
 +    Main gauche 
 +    <select id="leftHand"></select> 
 +    <span id="leftStats" class="equipStats"></span> 
 +    <br> 
 + 
 +    Corps 
 +    <select id="body"></select> 
 +    <span id="bodyStats" class="equipStats"></span> 
 +    <br> 
 + 
 +    Anneau 
 +    <select id="ring"></select> 
 +    <span id="ringStats" class="equipStats"></span> 
 +    <br> 
 + 
 +    Pieds 
 +    <select id="feet"></select> 
 +    <span id="feetStats" class="equipStats"></span> 
 + 
 +    <div id="limitWarn" style="color:red;"></div> 
 +</div> 
 + 
 +<div class="box"> 
 +    <h3>Passifs</h3> 
 +    <div id="skills"></div> 
 +</div> 
 + 
 +<div class="box"> 
 +    <h3>Sorts actifs</h3> 
 +    <div id="spells"></div> 
 +    <div id="spellBonus" class="small"></div> 
 +</div> 
 + 
 +<div class="box"> 
 +    <h3>Simulateur de poussée</h3> 
 + 
 +    Force assaillant 
 +    <input id="pushF" type="number" value="10"> 
 + 
 +    Renforcement 
 +    <select id="pushBuff"> 
 +        <option value="0">0</option> 
 +        <option value="6">+6</option> 
 +    </select> 
 + 
 +    <br> 
 + 
 +    Endurance 
 +    <input id="pushE" type="number" value="5"> 
 + 
 +    Agilité 
 +    <input id="pushAgi" type="number" value="5"> 
 + 
 +    <br> 
 + 
 +    PV actuels 
 +    <input id="pushPV" type="number" value="50"> 
 + 
 +    <br> 
 + 
 +    Instabilité 
 +    <select id="pushDebuff"> 
 +        <option value="0">0</option> 
 +        <option value="-6">-6</option> 
 +    </select> 
 + 
 +    Stabilité 
 +    <select id="pushStab"> 
 +        <option value="0">0</option> 
 +        <option value="6">+6</option> 
 +        <option value="12">+12</option> 
 +        <option value="18">+18</option> 
 +    </select> 
 + 
 +    <pre id="pushResult" class="result"></pre> 
 +</div> 
 + 
 +<button type="button" onclick="resetAll()">Reset</button> 
 +<button type="button" onclick="exportBuild()">📤 Export</button> 
 +<button type="button" onclick="importBuild()">📥 Import</button> 
 +<button type="button" onclick="copyLink()">🔗 Lien</button> 
 + 
 +<pre id="result" class="result"></pre> 
 + 
 +<script> 
 +"use strict"; 
 + 
 +/* ========================================================= 
 +   RACES 
 +========================================================= */ 
 + 
 +const races = { 
 + 
 +    Elfe:{ 
 +        a:2,cc:9,ct:10,f:9,e:4,agi:9, 
 +        p:5,mvt:5,pv:55,pm:30,r:4,rm:6, 
 +        fm:8,pui:6,res:5 
 +    }, 
 + 
 +    Nain:{ 
 +        a:2,cc:11,ct:8,f:11,e:6,agi:7, 
 +        p:4,mvt:4,pv:60,pm:25,r:7,rm:5, 
 +        fm:10,pui:4,res:3 
 +    }, 
 + 
 +    Géant:{ 
 +        a:2,cc:9,ct:10,f:12,e:4,agi:8, 
 +        p:4,mvt:5,pv:70,pm:30,r:6,rm:6, 
 +        fm:6,pui:5,res:4 
 +    }, 
 + 
 +    Olympien:{ 
 +        a:2,cc:10,ct:9,f:10,e:5,agi:9, 
 +        p:4,mvt:5,pv:60,pm:30,r:5,rm:6, 
 +        fm:7,pui:5,res:5 
 +    }, 
 + 
 +    HS:{ 
 +        a:2,cc:8,ct:9,f:8,e:3,agi:11, 
 +        p:5,mvt:6,pv:50,pm:40,r:3,rm:6, 
 +        fm:9,pui:5,res:6 
 +    } 
 +}; 
 + 
 +/* ========================================================= 
 +   CARACTERISTIQUES 
 +========================================================= */ 
 + 
 +const statOrder = [ 
 +    "a","cc","ct","f","e","agi","p", 
 +    "pui","fm","mvt","pv","pm","r","res","rm" 
 +]; 
 + 
 +const statLabels = { 
 +    a:"A",cc:"CC",ct:"CT",f:"F",e:"E", 
 +    agi:"Agi",p:"P",pui:"Pui",fm:"FM", 
 +    mvt:"Mvt",pv:"PV",pm:"PM",r:"R", 
 +    res:"Rés",rm:"RM" 
 +}; 
 + 
 +/* ========================================================= 
 +   COUT DES AMELIORATIONS 
 +========================================================= */ 
 + 
 +const costTable = { 
 +    a:[800,200,100], 
 +    cc:[100,50,30], 
 +    ct:[110,50,30], 
 +    f:[120,55,30], 
 +    e:[120,55,30], 
 +    agi:[95,45,25], 
 +    pui:[120,55,30], 
 +    res:[120,55,30], 
 +    fm:[100,50,30], 
 +    p:[110,85,78], 
 +    pv:[4,2,1], 
 +    pm:[5,3,1], 
 +    mvt:[100,50,30], 
 +    r:[40,30,15], 
 +    rm:[50,40,20] 
 +}; 
 + 
 +/* ========================================================= 
 +   EQUIPEMENTS 
 +========================================================= */ 
 + 
 +const equipments = [ 
 + 
 +/* COMMUN */ 
 + 
 +{name:"Bâton de marche",race:"all",slot:"rightHand",stats:{mvt:1}}, 
 +{name:"Gladius",race:"all",slot:"rightHand",stats:{cc:1}}, 
 +{name:"Sceptre",race:"all",slot:"rightHand",stats:{fm:1}}, 
 +{ 
 +    name:"Fustibale", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{ct:1,cc:-2} 
 +}, 
 +{ 
 +    name:"Arbalète de poing", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{f:12,ct:1} 
 +}, 
 +{ 
 +    name:"Torche", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{cc:-2,f:-2,feu:true} 
 +}, 
 +{ 
 +    name:"Lance barbelée", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{ct:1,f:1,cc:-1} 
 +}, 
 +{ 
 +    name:"Lance", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{ct:1,cc:-1} 
 +}, 
 +{ 
 +    name:"Rapière", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{cc:2,f:-1} 
 +}, 
 +{ 
 +    name:"Arc", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{ct:1,cc:-1} 
 +}, 
 +{ 
 +    name:"Arc long", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{ct:2,f:-1,cc:-2} 
 +}, 
 +{ 
 +    name:"Bélier", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{demolition:10,cc:-2} 
 +}, 
 +{ 
 +    name:"Pioche", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{demolition:5} 
 +}, 
 +{ 
 +    name:"Catalyseur magique", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{fPui:true,cc:-3,demolition:10} 
 +}, 
 + 
 +{ 
 +    name:"Targe", 
 +    race:"all", 
 +    slot:"leftHand", 
 +    stats:{cc:1,agi:-1} 
 +}, 
 +{ 
 +    name:"Bouclier Parma", 
 +    race:"all", 
 +    slot:"leftHand", 
 +    stats:{e:1,agi:-1} 
 +}, 
 +{ 
 +    name:"Écu brillant", 
 +    race:"all", 
 +    slot:"leftHand", 
 +    stats:{res:1,agi:-1} 
 +}, 
 + 
 +{ 
 +    name:"Armure matelassée", 
 +    race:"all", 
 +    slot:"body", 
 +    stats:{e:1,agi:-1} 
 +}, 
 +{ 
 +    name:"Toge d'apprenti", 
 +    race:"all", 
 +    slot:"body", 
 +    stats:{res:1,agi:-1} 
 +}, 
 +{ 
 +    name:"Ceinture", 
 +    race:"all", 
 +    slot:"body", 
 +    stats:{r:1} 
 +}, 
 + 
 +{ 
 +    name:"Cape de chasse", 
 +    race:"all", 
 +    slot:"cape", 
 +    stats:{ct:1} 
 +}, 
 + 
 +{ 
 +    name:"Couronne d'adonis", 
 +    race:"all", 
 +    slot:"head", 
 +    stats:{rm:1} 
 +}, 
 +{ 
 +    name:"Visière", 
 +    race:"all", 
 +    slot:"head", 
 +    stats:{p:1,cc:-1,fm:-1} 
 +}, 
 +{ 
 +    name:"Collier tressé", 
 +    race:"all", 
 +    slot:"head", 
 +    stats:{pv:5,pm:5} 
 +}, 
 + 
 +{ 
 +    name:"Bottes de marche", 
 +    race:"all", 
 +    slot:"feet", 
 +    stats:{mvt:1} 
 +}, 
 +{ 
 +    name:"Sceptre de mage", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{pui:1,fm:1} 
 +}, 
 +{ 
 +    name:"Sarbacane", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{ct:1,f:10,cc:-1} 
 +}, 
 +{ 
 +    name:"Pierre Noire", 
 +    race:"all", 
 +    slot:"rightHand", 
 +    stats:{f:1,cc:-1} 
 +}, 
 + 
 +/* OLYMPIENS */ 
 + 
 +{ 
 +    name:"Spatha", 
 +    race:"Olympien", 
 +    slot:"rightHand", 
 +    stats:{cc:1,f:1} 
 +}, 
 +{ 
 +    name:"Lame sainte", 
 +    race:"Olympiens", 
 +    slot:"rightHand", 
 +    stats:{cc:1,pui:1,fPui:true} 
 +}, 
 +{ 
 +    name:"Pilum", 
 +    race:"Olympien", 
 +    slot:"rightHand", 
 +    stats:{f:1,mvt:1,cc:-1} 
 +}, 
 +{ 
 +    name:"Sceptre de puissance", 
 +    race:"Olympien", 
 +    slot:"rightHand", 
 +    stats:{pui:1,pm:8} 
 +}, 
 +{ 
 +    name:"Gastraphète", 
 +    race:"Olympien", 
 +    slot:"rightHand", 
 +    stats:{f:15,ct:-2,cc:-1} 
 +}, 
 +{ 
 +    name:"Bouclier Ancile", 
 +    race:"Olympien", 
 +    slot:"leftHand", 
 +    stats:{e:1,pv:5} 
 +}, 
 +{ 
 +    name:"Armure Hoplitique", 
 +    race:"Olympien", 
 +    slot:"body", 
 +    stats:{e:1,res:1} 
 +}, 
 +{ 
 +    name:"Lorica", 
 +    race:"Olympien", 
 +    exo:true, 
 +    slot:"body", 
 +    stats:{e:1,res:1} 
 +}, 
 +{ 
 +    name:"Cape de dueliste", 
 +    race:"Olympien", 
 +    slot:"cape", 
 +    stats:{cc:2,f:-1} 
 +}, 
 +{ 
 +    name:"Diadème", 
 +    race:"Olympien", 
 +    slot:"head", 
 +    stats:{r:1,rm:2} 
 +}, 
 +{ 
 +    name:"Tiare d'Oracle", 
 +    race:"Olympien", 
 +    slot:"head", 
 +    stats:{fm:1,p:1} 
 +}, 
 +{ 
 +    name:"Cnémides", 
 +    race:"Olympien", 
 +    slot:"feet", 
 +    stats:{mvt:1,rm:1,r:1} 
 +}, 
 + 
 +/* ELFES */ 
 + 
 +{ 
 +    name:"Lance de garde Sylvestre", 
 +    race:"Elfe", 
 +    slot:"rightHand", 
 +    stats:{cc:1,f:1} 
 +}, 
 +{ 
 +    name:"Baton du Pelerin", 
 +    race:"Elfe", 
 +    slot:"rightHand", 
 +    stats:{mvt:1,fm:1} 
 +}, 
 +{ 
 +    name:"Charybde", 
 +    race:"Elfe", 
 +    slot:"rightHand", 
 +    stats:{pui:2,e:-1} 
 +}, 
 +{ 
 +    name:"Arc Ensorcelé", 
 +    race:"Elfes", 
 +    slot:"rightHand", 
 +    stats:{ct:1,rm:2,cc:-1,fPui:true} 
 +}, 
 +{ 
 +    name:"Arc Elfique", 
 +    race:"Elfe", 
 +    exo:true, 
 +    slot:"rightHand", 
 +    stats:{ct:1,f:1,mvt:1,cc:-2} 
 +}, 
 +{ 
 +    name:"Targe renforcée", 
 +    race:"Elfe", 
 +    slot:"leftHand", 
 +    stats:{e:1,cc:1} 
 +}, 
 +{ 
 +    name:"Cuirasse", 
 +    race:"Elfe", 
 +    slot:"body", 
 +    stats:{res:1,r:2} 
 +}, 
 +{ 
 +    name:"Armure de garde Sylvestre", 
 +    race:"Elfe", 
 +    exo:true, 
 +    slot:"body", 
 +    stats:{res:2,pm:-10} 
 +}, 
 +{ 
 +    name:"Cape de feuillages", 
 +    race:"Elfe", 
 +    slot:"cape", 
 +    stats:{fm:1,pv:5} 
 +}, 
 +{ 
 +    name:"Marque Forestière", 
 +    race:"Elfe", 
 +    slot:"head", 
 +    stats:{pm:10,r:1} 
 +}, 
 +{ 
 +    name:"Capuche du chasseur", 
 +    race:"Elfe", 
 +    slot:"head", 
 +    stats:{ct:1,r:1,rm:1} 
 +}, 
 +{ 
 +    name:"Bottes Tâlroval", 
 +    race:"Elfe", 
 +    slot:"feet", 
 +    stats:{mvt:2} 
 +}, 
 + 
 +/* NAINS */ 
 + 
 +{ 
 +    name:"Labrys", 
 +    race:"Nain", 
 +    slot:"rightHand", 
 +    stats:{cc:1,f:1} 
 +}, 
 +{ 
 +    name:"Hache runique", 
 +    race:"Nain", 
 +    slot:"rightHand", 
 +    stats:{cc:1,fm:1} 
 +}, 
 +{ 
 +    name:"Marteau runique", 
 +    race:"Nains", 
 +    slot:"rightHand", 
 +    stats:{fPui:true,pui:2} 
 +}, 
 +{ 
 +    name:"Baton d'archimage", 
 +    race:"Nain", 
 +    slot:"rightHand", 
 +    stats:{fm:1,pm:10} 
 +}, 
 +{ 
 +    name:"Marteau de guerre", 
 +    race:"Nain", 
 +    slot:"rightHand", 
 +    stats:{f:2,cc:-1} 
 +}, 
 +{ 
 +    name:"Bouclier Miroir", 
 +    race:"Nain", 
 +    slot:"leftHand", 
 +    stats:{res:1,pv:5} 
 +}, 
 +{ 
 +    name:"Armure runique", 
 +    race:"Nain", 
 +    slot:"body", 
 +    stats:{e:1,pm:8} 
 +}, 
 +{ 
 +    name:"Cotte de mailles", 
 +    race:"Nain", 
 +    exo:true, 
 +    slot:"body", 
 +    stats:{e:2,esquive:-4} 
 +}, 
 +{ 
 +    name:"Cape dorée", 
 +    race:"Nain", 
 +    exo:true, 
 +    slot:"cape", 
 +    stats:{res:1,mvt:1} 
 +}, 
 +{ 
 +    name:"Casque grossissant", 
 +    race:"Nain", 
 +    slot:"head", 
 +    stats:{ct:2,p:-1} 
 +}, 
 +{ 
 +    name:"Casque de guerre", 
 +    race:"Nain", 
 +    slot:"head", 
 +    stats:{pv:5,r:1,pm:5,rm:1} 
 +}, 
 +{ 
 +    name:"Solerets", 
 +    race:"Nain", 
 +    slot:"feet", 
 +    stats:{mvt:1,pm:5,pv:5} 
 +}, 
 + 
 +/* GEANTS */ 
 + 
 +{ 
 +    name:"Masse d'arme", 
 +    race:"Géant", 
 +    slot:"rightHand", 
 +    stats:{cc:1,f:1} 
 +}, 
 +{ 
 +    name:"Hallebarde de pierre", 
 +    race:"Géant", 
 +    slot:"rightHand", 
 +    stats:{f:1,mvt:1} 
 +}, 
 +{ 
 +    name:"Javelot lourd", 
 +    race:"Géant", 
 +    slot:"rightHand", 
 +    stats:{f:2,ct:-1,cc:-1} 
 +}, 
 +{ 
 +    name:"Pierre en fusion", 
 +    race:"Géants", 
 +    slot:"rightHand", 
 +    stats:{fPui:true,ct:-2,feu:true} 
 +}, 
 +{ 
 +    name:"Baton de shaman", 
 +    race:"Géant", 
 +    exo:true, 
 +    slot:"rightHand", 
 +    stats:{fm:2} 
 +}, 
 +{ 
 +    name:"Bouclier Clipeus", 
 +    race:"Géant", 
 +    slot:"leftHand", 
 +    stats:{e:1,pv:10} 
 +}, 
 +{ 
 +    name:"Peau de granit manifiée", 
 +    race:"Géant", 
 +    slot:"body", 
 +    stats:{res:1,rm:2,esquive:-2} 
 +}, 
 +{ 
 +    name:"Broigne", 
 +    race:"Géant", 
 +    exo:true, 
 +    slot:"body", 
 +    stats:{res:2,fm:-1} 
 +}, 
 +{ 
 +    name:"Cape de l'arpenteur", 
 +    race:"Géant", 
 +    slot:"cape", 
 +    stats:{cc:1,ct:1} 
 +}, 
 +{ 
 +    name:"Fétiche de shaman", 
 +    race:"Géant", 
 +    slot:"head", 
 +    stats:{r:2,pm:5} 
 +}, 
 +{ 
 +    name:"Coiffe de rage", 
 +    race:"Géant", 
 +    slot:"head", 
 +    stats:{cc:1,pv:5,r:1} 
 +}, 
 +{ 
 +    name:"Bottes incandescentes", 
 +    race:"Géant", 
 +    slot:"feet", 
 +    stats:{mvt:1,r:1,pv:5} 
 +}, 
 + 
 +/* HS */ 
 + 
 +{ 
 +    name:"Ceste", 
 +    race:"HS", 
 +    slot:"rightHand", 
 +    stats:{f:1,cc:1} 
 +}, 
 +{ 
 +    name:"Mains de mana", 
 +    race:"HS", 
 +    slot:"rightHand", 
 +    stats:{fPui:true,cc:2} 
 +}, 
 +{ 
 +    name:"Baton de Sage", 
 +    race:"HS", 
 +    slot:"rightHand", 
 +    stats:{pui:1,agi:1} 
 +}, 
 +{ 
 +    name:"Orbe de mana", 
 +    race:"HS", 
 +    slot:"rightHand", 
 +    stats:{pui:2,fm:-1} 
 +}, 
 +{ 
 +    name:"Bouclier en lianes", 
 +    race:"HS", 
 +    slot:"leftHand", 
 +    stats:{res:1,agi:1} 
 +}, 
 +{ 
 +    name:"Manteau de feuillage", 
 +    race:"HS", 
 +    slot:"body", 
 +    stats:{e:1,agi:1} 
 +}, 
 +{ 
 +    name:"Armure de fourrure", 
 +    race:"HS", 
 +    exo:true, 
 +    slot:"body", 
 +    stats:{e:2,rm:-3} 
 +}, 
 +{ 
 +    name:"Cape de mage", 
 +    race:"HS", 
 +    slot:"cape", 
 +    stats:{fm:1,rm:1} 
 +}, 
 +{ 
 +    name:"Collier d'apaisement", 
 +    race:"HS", 
 +    slot:"head", 
 +    stats:{pv:10,pm:5} 
 +}, 
 +{ 
 +    name:"Coiffe de rapace", 
 +    race:"HS", 
 +    slot:"head", 
 +    stats:{ct:1,p:1} 
 +}, 
 +{ 
 +    name:"Bottes griffues", 
 +    race:"HS", 
 +    exo:true, 
 +    slot:"feet", 
 +    stats:{cc:1,f:1,pv:5} 
 +}, 
 +{ 
 +    name:"Bottes de voleur", 
 +    race:"HS", 
 +    slot:"feet", 
 +    stats:{mvt:1,agi:1} 
 +}, 
 + 
 +/* LUTINS : ANNEAUX */ 
 + 
 +{ 
 +    name:"Anneau d'Horizon", 
 +    race:"Lutin", 
 +    slot:"ring", 
 +    stats:{p:1} 
 +}, 
 +{ 
 +    name:"Anneau de Caprice", 
 +    race:"Lutin", 
 +    slot:"ring", 
 +    stats:{fm:1} 
 +}, 
 +{ 
 +    name:"Anneau de Puissance", 
 +    race:"Lutin", 
 +    slot:"ring", 
 +    stats:{pui:1} 
 +}, 
 +{ 
 +    name:"Anneau de Férocité", 
 +    race:"Lutin", 
 +    slot:"ring", 
 +    stats:{f:1} 
 +}, 
 +{ 
 +    name:"Anneau de Résistance", 
 +    race:"Lutin", 
 +    slot:"ring", 
 +    stats:{res:1} 
 +}, 
 +{ 
 +    name:"Anneau d'Équilibre", 
 +    race:"Lutin", 
 +    slot:"ring", 
 +    stats:{pv:5,pm:5} 
 +}, 
 +{ 
 +    name:"Anneau de Finesse", 
 +    race:"Lutin", 
 +    slot:"ring", 
 +    stats:{cc:1} 
 +}, 
 +{ 
 +    name:"Anneau de Prétention", 
 +    race:"Lutin", 
 +    slot:"ring", 
 +    stats:{ct:1} 
 +}, 
 +{ 
 +    name:"Anneau de Tenacité", 
 +    race:"Lutin", 
 +    slot:"ring", 
 +    stats:{e:1} 
 +}, 
 +{ 
 +    name:"Anneau de Souplesse", 
 +    race:"Lutin", 
 +    slot:"ring", 
 +    stats:{agi:1} 
 +}, 
 + 
 +{ 
 +    name:"Bottes de 7 lieux", 
 +    race:"Lutin", 
 +    exo:true, 
 +    slot:"feet", 
 +    stats:{mvt:3} 
 +} 
 + 
 +]; 
 + 
 +/* ========================================================= 
 +   MAGIE INTERDITE 
 +   Affichée uniquement après les bonus/malus de l'objet. 
 +========================================================= */ 
 + 
 +const magieInterdite = new Set([ 
 +    "Lance barbelée", "Rapière", "Bélier", "Pioche", 
 +    "Catalyseur magique", "Bouclier Parma", "Écu brillant", 
 +    "Armure matelassée", "Toge d'apprenti", "Pierre Noire", 
 +    "Spatha", "Pilum", "Gastraphète", "Armure Hoplitique", 
 +    "Cape de dueliste", "Lance de garde Sylvestre", "Arc Elfique", 
 +    "Targe renforcée", "Armure de garde Sylvestre", "Bottes Tâlroval", 
 +    "Labrys", "Marteau runique", "Marteau de guerre", "Cotte de mailles", 
 +    "Cape dorée", "Casque grossissant", "Casque de guerre", 
 +    "Masse d'arme", "Hallebarde de pierre", "Javelot lourd", 
 +    "Pierre en fusion", "Bouclier Clipeus", "Broigne", "Cape de l'arpenteur", 
 +    "Ceste", "Bouclier en lianes", "Armure de fourrure" 
 +]); 
 + 
 +/* ========================================================= 
 +   PASSIFS 
 +========================================================= */ 
 + 
 +const skills = [ 
 +    { 
 +        name:"Fulgurance", 
 +        desc:"+1 toucher CAC et +1 esquive par tranche de 5 mouvements" 
 +    }, 
 +    { 
 +        name:"Couverture", 
 +        desc:"85% CC / 15% AGI" 
 +    }, 
 +    { 
 +        name:"Réflexes fulgurants", 
 +        desc:"85% AGI / 15% CC" 
 +    }, 
 +    { 
 +        name:"Berserker", 
 +        desc:"+1 F par tranche de 10 PV perdus (non calculé)" 
 +    }, 
 +    { 
 +        name:"Griffes", 
 +        desc:"+3 dégâts à mains nues, avec une ceste ou des mains de mana" 
 +    }, 
 +    { 
 +        name:"Anguille", 
 +        desc:"+1 esquive (non calculé)" 
 +    } 
 +]; 
 + 
 +/* ========================================================= 
 +   SORTS 
 +========================================================= */ 
 + 
 +const spells = [ 
 +    {name:"Peau de granit",dex:0,prot:2}, 
 +    {name:"Coup précis",dex:2,prot:0}, 
 +    {name:"Maladresse",dex:-2,prot:0}, 
 +    {name:"Vulnérabilité",dex:0,prot:-2}, 
 +    {name:"Puissance de la nature",dex:2,prot:2}, 
 +    {name:"Aide",dex:4,prot:0}, 
 +    {name:"Malchance",dex:-4,prot:0}, 
 +    {name:"Fatigue",dex:0,prot:-4}, 
 +    {name:"Réflexes accrus",dex:0,prot:4}, 
 +    {name:"Bénédiction",dex:4,prot:4}, 
 +    {name:"Puissance du lutin capricieux",dex:-4,prot:-4}, 
 +    {name:"Exténuation",dex:0,prot:-8}, 
 +    {name:"Sauvegarde",dex:0,prot:8}, 
 +    {name:"Guigne",dex:-8,prot:0}, 
 +    {name:"Virtuose",dex:8,prot:0} 
 +]; 
 + 
 +/* ========================================================= 
 +   INITIALISATION 
 +========================================================= */ 
 + 
 +const raceSelect = document.getElementById("race"); 
 + 
 +Object.keys(races).forEach(r=>{ 
 +    const option=document.createElement("option"); 
 +    option.value=r; 
 +    option.textContent=r; 
 +    raceSelect.appendChild(option); 
 +}); 
 + 
 +/* AMELIORATIONS */ 
 + 
 +const statsDiv=document.getElementById("stats"); 
 + 
 +statOrder.forEach(stat=>{ 
 +    if(!costTable[stat]) return; 
 + 
 +    const line=document.createElement("div"); 
 +    line.className="statLine"; 
 + 
 +    const label=document.createElement("label"); 
 +    label.textContent=statLabels[stat]||stat; 
 + 
 +    const input=document.createElement("input"); 
 +    input.type="number"; 
 +    input.id="up_"+stat; 
 +    input.value=0; 
 +    input.min=0; 
 + 
 +    input.addEventListener("input",calculate); 
 + 
 +    line.append(label,input); 
 +    statsDiv.appendChild(line); 
 +}); 
 + 
 +/* PASSIFS */ 
 + 
 +const skillsDiv=document.getElementById("skills"); 
 + 
 +skills.forEach((s,i)=>{ 
 +    const label=document.createElement("label"); 
 +    const cb=document.createElement("input"); 
 + 
 +    cb.type="checkbox"; 
 +    cb.id="skill_"+i; 
 +    cb.addEventListener("change",calculate); 
 + 
 +    label.append( 
 +        cb, 
 +        document.createTextNode(" "+s.name+" — "+s.desc) 
 +    ); 
 + 
 +    skillsDiv.append(label,document.createElement("br")); 
 +}); 
 + 
 +/* SORTS */ 
 + 
 +const spellsDiv=document.getElementById("spells"); 
 + 
 +spells.forEach((s,i)=>{ 
 +    const label=document.createElement("label"); 
 +    const cb=document.createElement("input"); 
 + 
 +    cb.type="checkbox"; 
 +    cb.id="spell_"+i; 
 +    cb.addEventListener("change",calculate); 
 + 
 +    label.append( 
 +        cb, 
 +        document.createTextNode( 
 +            " "+s.name+" (Dex "+s.dex+", Prot "+s.prot+")" 
 +        ) 
 +    ); 
 + 
 +    spellsDiv.append(label,document.createElement("br")); 
 +}); 
 + 
 +/* ========================================================= 
 +   EQUIPEMENTS 
 +========================================================= */ 
 + 
 +const slots = { 
 +    head:document.getElementById("head"), 
 +    cape:document.getElementById("cape"), 
 +    rightHand:document.getElementById("rightHand"), 
 +    leftHand:document.getElementById("leftHand"), 
 +    body:document.getElementById("body"), 
 +    ring:document.getElementById("ring"), 
 +    feet:document.getElementById("feet") 
 +}; 
 + 
 +const statIds = { 
 +    head:"headStats", 
 +    cape:"capeStats", 
 +    rightHand:"rightStats", 
 +    leftHand:"leftStats", 
 +    body:"bodyStats", 
 +    ring:"ringStats", 
 +    feet:"feetStats" 
 +}; 
 + 
 +/* COMPATIBILITE EXOTIQUE */ 
 + 
 +function canEquip(item,race){ 
 + 
 +    if(!item.exo){ 
 +        return true; 
 +    } 
 + 
 +    const aliases = { 
 +        "Olympiens":"Olympien", 
 +        "Elfes":"Elfe", 
 +        "Nains":"Nain", 
 +        "Géants":"Géant" 
 +    }; 
 + 
 +    const owner=aliases[item.race]||item.race; 
 + 
 +    return owner===race; 
 +} 
 + 
 +/* REMPLISSAGE */ 
 + 
 +function fillEquip(){ 
 + 
 +    const race=raceSelect.value; 
 + 
 +    for(const key in slots){ 
 + 
 +        const select=slots[key]; 
 +        select.innerHTML=""; 
 + 
 +        const empty=document.createElement("option"); 
 +        empty.value=""; 
 +        empty.textContent="— Aucun —"; 
 +        select.appendChild(empty); 
 + 
 +        const available=equipments 
 +            .filter(e=>e.slot===key) 
 +            .filter(e=>canEquip(e,race)) 
 +            .sort((a,b)=> 
 +                a.name.localeCompare( 
 +                    b.name, 
 +                    "fr", 
 +                    {sensitivity:"base"} 
 +                ) 
 +            ); 
 + 
 +        available.forEach(item=>{ 
 + 
 +            const option=document.createElement("option"); 
 + 
 +            option.value=String(equipments.indexOf(item)); 
 + 
 +            /* Le titre reste uniquement le nom de l'objet */ 
 +            option.textContent= 
 +                item.name+ 
 +                (item.exo?" (exo)":""); 
 + 
 +            select.appendChild(option); 
 +        }); 
 + 
 +        select.onchange=()=>{ 
 + 
 +            checkLimit(key); 
 +            displayAllEquipStats(); 
 +            calculate(); 
 +        }; 
 +    } 
 + 
 +    displayAllEquipStats(); 
 +    checkLimit(); 
 +    calculate(); 
 +} 
 + 
 +/* AFFICHAGE DES BONUS */ 
 + 
 +const statNames = { 
 +    a:"A",f:"F",e:"E",agi:"Agi", 
 +    cc:"CC",ct:"CT",fm:"FM",mvt:"Mvt", 
 +    pv:"PV",pm:"PM",r:"R",res:"Rés", 
 +    rm:"RM",p:"P",pui:"Pui",fPui:"F=Pui", 
 +    esquive:"Esquive", 
 +    demolition:"Démolition", 
 +    magique:"Magique", 
 +    feu:"Feu" 
 +}; 
 + 
 +function displayStats(select,id){ 
 + 
 +    const el=document.getElementById(id); 
 + 
 +    if(!el) return; 
 + 
 +    if(select.value===""){ 
 +        el.innerHTML=""; 
 +        return; 
 +    } 
 + 
 +    const item=equipments[Number(select.value)]; 
 + 
 +    if(!item){ 
 +        el.innerHTML=""; 
 +        return; 
 +    } 
 + 
 +    let html=""; 
 + 
 +    /* Bonus et malus */ 
 + 
 +    for(const [stat,value] of Object.entries(item.stats||{})){ 
 + 
 +        const name=statNames[stat]||stat; 
 + 
 +        if(value===true){ 
 +            html+=`<span class="special">${name}</span> `; 
 +            continue; 
 +        } 
 + 
 +        if(typeof value!=="number"||value===0){ 
 +            continue; 
 +        } 
 + 
 +        if(value>0){ 
 +            html+=`<span class="bonus">+${value} ${name}</span> `; 
 +        }else{ 
 +            html+=`<span class="malus">${value} ${name}</span> `; 
 +        } 
 +    } 
 + 
 +    /* Magie interdite : toujours après les bonus/malus */ 
 +    if(magieInterdite.has(item.name)){ 
 +        html += `<span class="forbiddenMagic">Magie interdite</span> `; 
 +    } 
 + 
 +    el.innerHTML=html; 
 +} 
 + 
 +function displayAllEquipStats(){ 
 + 
 +    for(const key in slots){ 
 +        displayStats(slots[key],statIds[key]); 
 +    } 
 +} 
 + 
 +/* ========================================================= 
 +   LIMITE : 3 EQUIPEMENTS + 1 ANNEAU 
 +========================================================= */ 
 + 
 +function checkLimit(changedSlot=null){ 
 + 
 +    const warn=document.getElementById("limitWarn"); 
 + 
 +    const count=Object.keys(slots) 
 +        .filter(key=>key!=="ring") 
 +        .filter(key=>slots[key].value!=="") 
 +        .length; 
 + 
 +    if(count>3){ 
 + 
 +        if(changedSlot&&changedSlot!=="ring"){ 
 + 
 +            slots[changedSlot].value=""; 
 + 
 +            displayStats( 
 +                slots[changedSlot], 
 +                statIds[changedSlot] 
 +            ); 
 +        } 
 + 
 +        warn.textContent= 
 +            "⚠️ Maximum 3 équipements hors anneau. L'anneau est un emplacement supplémentaire."; 
 + 
 +        return false; 
 +    } 
 + 
 +    warn.textContent=""; 
 +    return true; 
 +} 
 + 
 +function resetSlots(){ 
 + 
 +    for(const key in slots){ 
 +        slots[key].value=""; 
 +    } 
 + 
 +    displayAllEquipStats(); 
 +    checkLimit(); 
 +} 
 + 
 +/* ========================================================= 
 +   STATS DE BASE 
 +========================================================= */ 
 + 
 +function displayBase(){ 
 + 
 +    const r=races[raceSelect.value]; 
 + 
 +    let text=""; 
 + 
 +    statOrder.forEach(stat=>{ 
 + 
 +        if(r[stat]!==undefined){ 
 + 
 +            text+=(statLabels[stat]||stat)+": "+r[stat]+"\n"; 
 +        } 
 +    }); 
 + 
 +    document.getElementById("baseStats").textContent=text.trim(); 
 +} 
 + 
 +/* ========================================================= 
 +   COUT 
 +========================================================= */ 
 + 
 +function calcCost(){ 
 + 
 +    let total=0; 
 + 
 +    for(const stat in costTable){ 
 + 
 +        const input=document.getElementById("up_"+stat); 
 + 
 +        if(!input) continue; 
 + 
 +        const level=Math.max( 
 +            0, 
 +            parseInt(input.value,10)||0 
 +        ); 
 + 
 +        if(!level) continue; 
 + 
 +        const [B,M1,M2]=costTable[stat]; 
 + 
 +        for(let n=1;n<=level;n++){ 
 + 
 +            let cost; 
 + 
 +            if(n===1){ 
 +                cost=B; 
 +            }else if(n===2){ 
 +                cost=B+M1; 
 +            }else if(n===3){ 
 +                cost=B+2*M1; 
 +            }else{ 
 +                cost=B+2*M1+(n-3)*M2; 
 +            } 
 + 
 +            total+=cost; 
 +        } 
 +    } 
 + 
 +    return total; 
 +} 
 + 
 +function updateCost(){ 
 + 
 +    document.getElementById("cost").textContent= 
 +        "Coût total : "+calcCost(); 
 +} 
 + 
 +/* ========================================================= 
 +   LECTURE DES PASSIFS 
 +========================================================= */ 
 + 
 +function isChecked(index){ 
 + 
 +    const cb=document.getElementById("skill_"+index); 
 + 
 +    return cb?cb.checked:false; 
 +} 
 + 
 +/* ========================================================= 
 +   CALCUL DU PERSONNAGE 
 +========================================================= */ 
 + 
 + 
 + 
 +/* ========================================================= 
 +   CALCUL DU PERSONNAGE 
 +========================================================= */ 
 + 
 +function calculate(){ 
 + 
 +    const raceName = raceSelect.value; 
 +    const race = races[raceName]; 
 + 
 +    if(!race) return; 
 + 
 +    updateCost(); 
 +    displayBase(); 
 + 
 +    const char = {...race}; 
 + 
 +    /* Améliorations */ 
 + 
 +    for(const stat in costTable){ 
 + 
 +        const input = document.getElementById("up_"+stat); 
 + 
 +        if(input){ 
 + 
 +            char[stat] = 
 +                (char[stat] || 0) + 
 +                (parseInt(input.value,10) || 0); 
 +        } 
 +    } 
 + 
 +    /* Equipements */ 
 + 
 +    let forcePui = false; 
 + 
 +    for(const key in slots){ 
 + 
 +        const value = slots[key].value; 
 + 
 +        if(value === "") continue; 
 + 
 +        const item = equipments[Number(value)]; 
 + 
 +        if(!item) continue; 
 + 
 +        for(const [stat,bonus] of Object.entries(item.stats || {})){ 
 + 
 +            if(stat === "fPui" && bonus === true){ 
 +                forcePui = true; 
 +                continue; 
 +            } 
 + 
 +            if(typeof bonus === "number"){ 
 +                char[stat] = (char[stat] || 0) + bonus; 
 +            } 
 +        } 
 +    } 
 + 
 +    /* F=Pui : certains équipements remplacent la Force par la Puissance */ 
 + 
 +    if(forcePui){ 
 +        char.f = char.pui; 
 +    } 
 + 
 +    /* Passifs */ 
 + 
 +    const fulgurance = isChecked(0); 
 +    const couverture = isChecked(1); 
 +    const reflexes = isChecked(2); 
 +    const griffes = isChecked(4); 
 + 
 +    /* ===================================================== 
 +       PUISSANCES TOTALES 
 + 
 +       On conserve les caractéristiques sans leur ajouter 
 +       le bonus de dégâts de Griffes. 
 + 
 +       Le bonus de Griffes sera ajouté uniquement dans 
 +       la Puissance totale Force. 
 +    ===================================================== */ 
 + 
 +    const mainDroite = slots.rightHand.value === "" 
 +        ? null 
 +        : equipments[Number(slots.rightHand.value)]; 
 + 
 +    /* Griffes fonctionne à mains nues, avec une Ceste 
 +       ou avec des Mains de mana. */ 
 + 
 +    const griffesActives = 
 +        griffes && 
 +        ( 
 +            !mainDroite || 
 +            mainDroite.name === "Ceste" || 
 +            mainDroite.name === "Mains de mana" 
 +        ); 
 + 
 +    /* Force après améliorations et équipements, 
 +       avant le bonus de dégâts de Griffes. */ 
 + 
 +    const forceBase = char.f; 
 + 
 +    /* Puissance totale Force : 
 +       - Force calculée avec les équipements 
 +       - règle F=Pui si applicable 
 +       - bonus de dégâts de Griffes si actif */ 
 + 
 +    let puissanceTotaleForce = forceBase; 
 + 
 +    if(griffesActives){ 
 + 
 +        if( 
 +            raceName === "HS" && 
 +            mainDroite && 
 +            mainDroite.name === "Mains de mana" 
 +        ){ 
 +            puissanceTotaleForce = char.pui + 3; 
 +        }else{ 
 +            puissanceTotaleForce = forceBase + 3; 
 +        } 
 +    } 
 + 
 +    /* Puissance totale Puissance : 
 +       statistique après améliorations et équipements. */ 
 + 
 +    const puissanceTotalePuissance = char.pui; 
 + 
 +    /* Sorts : bonus de plus grande valeur absolue */ 
 + 
 +    let bestDex = 0; 
 +    let bestProt = 0; 
 + 
 +    const spellDetails = []; 
 + 
 +    spells.forEach((spell,i)=>{ 
 + 
 +        const cb = document.getElementById("spell_"+i); 
 + 
 +        if(!cb || !cb.checked) return; 
 + 
 +        if(Math.abs(spell.dex) > Math.abs(bestDex)){ 
 +            bestDex = spell.dex; 
 +        } 
 + 
 +        if(Math.abs(spell.prot) > Math.abs(bestProt)){ 
 +            bestProt = spell.prot; 
 +        } 
 + 
 +        spellDetails.push(spell.name); 
 +    }); 
 + 
 +    document.getElementById("spellBonus").textContent = 
 +        spellDetails.length 
 +        ? "Sorts actifs : " + spellDetails.join(", ") + 
 +          " | Bonus Dex : " + bestDex + 
 +          " | Protection : " + bestProt 
 +        : ""; 
 + 
 +    /* Dés */ 
 + 
 +    const ccDice = char.cc * 2; 
 +    const ctDice = char.ct * 2; 
 +    const fmDice = char.fm * 2; 
 +    const agiDice = char.agi * 2; 
 + 
 +    /* ===================================================== 
 +       FICHE PERSONNAGE 
 +    ===================================================== */ 
 + 
 +    let result = "=== PERSONNAGE ===\n\n"; 
 + 
 +    statOrder.forEach(stat=>{ 
 + 
 +        if(char[stat] !== undefined){ 
 + 
 +            result += 
 +                (statLabels[stat] || stat) + 
 +                ": " + char[stat] + "\n"; 
 +        } 
 +    }); 
 + 
 +    if(griffes){ 
 + 
 +        result += griffesActives 
 +            ? "\nGriffes : passif actif (+3 dégâts)." 
 +            : "\nGriffes : inactif (arme autre que mains nues, Ceste ou Mains de mana)."; 
 +    } 
 + 
 +    result += "\n\n=== COMBAT ===\n\n"; 
 + 
 +    /* Touchers */ 
 + 
 +    const finalCC = 
 +        ccDice + bestDex + (fulgurance ? 1 : 0); 
 + 
 +    const finalCT = 
 +        ctDice + bestDex; 
 + 
 +    const finalFM = 
 +        fmDice + bestDex; 
 + 
 +    result += "Toucher CAC : " + finalCC + "\n"; 
 +    result += "Toucher tir : " + finalCT + "\n"; 
 +    result += "FM : " + finalFM + "\n"; 
 + 
 +    /* Tir par distance */ 
 + 
 +    result += "\n=== TIR ===\n\n"; 
 + 
 +    for(let cases = 1; cases <= 4; cases++){ 
 + 
 +        let ctDistance = finalCT; 
 + 
 +        if(cases > 2){ 
 +            ctDistance -= (cases - 2) * 3; 
 +        } 
 + 
 +        result += 
 +            cases + 
 +            " case(s) : CT " + 
 +            ctDistance + 
 +            "\n"; 
 +    } 
 + 
 +    /* Esquive CAC */ 
 + 
 +    const meleeDodge = 
 +        Math.max(ccDice,agiDice) + bestProt; 
 + 
 +    result += "\n=== ESQUIVE CAC ===\n\n"; 
 +    result += "Esquive : " + meleeDodge + "\n"; 
 + 
 +    /* Esquive tir */ 
 + 
 +    let evadeStat; 
 + 
 +    if(couverture){ 
 + 
 +        evadeStat = Math.floor( 
 +            char.cc * 0.85 + char.agi * 0.15 
 +        ); 
 + 
 +    }else if(reflexes){ 
 + 
 +        evadeStat = Math.floor( 
 +            char.agi * 0.85 + char.cc * 0.15 
 +        ); 
 + 
 +    }else{ 
 + 
 +        evadeStat = Math.max( 
 +            Math.floor( 
 +                char.cc * 0.75 + 
 +                char.agi * 0.25 
 +            ), 
 +            Math.floor( 
 +                char.agi * 0.75 + 
 +                char.cc * 0.25 
 +            ) 
 +        ); 
 +    } 
 + 
 +    const fulguranceDodge = 
 +        fulgurance 
 +        ? Math.floor(char.mvt / 5) 
 +        : 0; 
 + 
 +    const rangedDodge = 
 +        evadeStat * 2 + 
 +        bestProt + 
 +        fulguranceDodge; 
 + 
 +    result += "\n=== ESQUIVE TIR ===\n\n"; 
 +    result += "Esquive tir : " + rangedDodge + "\n"; 
 + 
 +    /* Esquive FM */ 
 + 
 +    const fmDodge = 
 +        fmDice + bestProt; 
 + 
 +    result += "\n=== ESQUIVE FM ===\n\n"; 
 +    result += "Esquive FM : " + fmDodge + "\n"; 
 + 
 +    /* Magie */ 
 + 
 +    result += "\n=== MAGIE ===\n\n"; 
 +    result += "Jet FM : " + finalFM + "\n"; 
 + 
 +    for(let lvl = 1; lvl <= 5; lvl++){ 
 + 
 +        const threshold = 6 + 6 * lvl; 
 + 
 +        result += 
 +            "Sort niveau " + 
 +            lvl + 
 +            " (seuil " + 
 +            threshold + 
 +            ") : " + 
 +            ( 
 +                finalFM >= threshold 
 +                ? "Réussi" 
 +                : "Échec" 
 +            ) + 
 +            "\n"; 
 +    } 
 + 
 +    /* ===================================================== 
 +       PUISSANCES TOTALES — FIN DU RÉSULTAT 
 +    ===================================================== */ 
 + 
 +    result += "\n=== PUISSANCES TOTALES ===\n\n"; 
 + 
 +    result += 
 +        "Puissance totale Force : " + 
 +        puissanceTotaleForce + 
 +        "\n"; 
 + 
 +    result += 
 +        "Puissance totale Puissance : " + 
 +        puissanceTotalePuissance + 
 +        "\n"; 
 + 
 +    document.getElementById("result").textContent = result; 
 +} 
 + 
 + 
 + 
 +/* ========================================================= 
 +   SIMULATEUR DE POUSSEE 
 +   FORMULE CONSERVEE 
 +========================================================= */ 
 + 
 +function calculatePush(){ 
 + 
 +    const F=parseInt( 
 +        document.getElementById("pushF").value, 
 +        10 
 +    )||0; 
 + 
 +    const E=parseInt( 
 +        document.getElementById("pushE").value, 
 +        10 
 +    )||0; 
 + 
 +    const Agi=parseInt( 
 +        document.getElementById("pushAgi").value, 
 +        10 
 +    )||0; 
 + 
 +    const PV=parseInt( 
 +        document.getElementById("pushPV").value, 
 +        10 
 +    )||0; 
 + 
 +    const buff=parseInt( 
 +        document.getElementById("pushBuff").value, 
 +        10 
 +    )||0; 
 + 
 +    const debuff=parseInt( 
 +        document.getElementById("pushDebuff").value, 
 +        10 
 +    )||0; 
 + 
 +    const stab=parseInt( 
 +        document.getElementById("pushStab").value, 
 +        10 
 +    )||0; 
 + 
 +    const finalF= 
 +        F+ 
 +        buff+ 
 +        debuff+ 
 +        stab; 
 + 
 +    const score= 
 +        finalF+ 
 +        E+ 
 +        Agi; 
 + 
 +    document.getElementById("pushResult").textContent= 
 +        "Force finale : "+finalF+ 
 +        "\nEndurance : "+E+ 
 +        "\nAgilité : "+Agi+ 
 +        "\nPV actuels : "+PV+ 
 +        "\n\nScore : "+score; 
 +} 
 + 
 +/* EVENEMENTS POUSSEE */ 
 + 
 +[ 
 +    "pushF", 
 +    "pushBuff", 
 +    "pushE", 
 +    "pushAgi", 
 +    "pushPV", 
 +    "pushDebuff", 
 +    "pushStab" 
 +].forEach(id=>{ 
 + 
 +    const el=document.getElementById(id); 
 + 
 +    el.addEventListener("input",calculatePush); 
 +    el.addEventListener("change",calculatePush); 
 +}); 
 + 
 +/* ========================================================= 
 +   RESET GENERAL 
 +========================================================= */ 
 + 
 +function resetAll(){ 
 + 
 +    raceSelect.selectedIndex=0; 
 + 
 +    statOrder.forEach(stat=>{ 
 + 
 +        const input=document.getElementById("up_"+stat); 
 + 
 +        if(input){ 
 +            input.value=0; 
 +        } 
 +    }); 
 + 
 +    resetSlots(); 
 + 
 +    skills.forEach((s,i)=>{ 
 + 
 +        const cb=document.getElementById("skill_"+i); 
 + 
 +        if(cb){ 
 +            cb.checked=false; 
 +        } 
 +    }); 
 + 
 +    spells.forEach((s,i)=>{ 
 + 
 +        const cb=document.getElementById("spell_"+i); 
 + 
 +        if(cb){ 
 +            cb.checked=false; 
 +        } 
 +    }); 
 + 
 +    document.getElementById("pushF").value=10; 
 +    document.getElementById("pushBuff").value=0; 
 +    document.getElementById("pushE").value=5; 
 +    document.getElementById("pushAgi").value=5; 
 +    document.getElementById("pushPV").value=50; 
 +    document.getElementById("pushDebuff").value=0; 
 +    document.getElementById("pushStab").value=0; 
 + 
 +    fillEquip(); 
 +    calculate(); 
 +    calculatePush(); 
 +} 
 + 
 +/* ========================================================= 
 +   EXPORT / IMPORT / PARTAGE 
 +========================================================= */ 
 + 
 +function getBuildData(){ 
 + 
 +    const data={ 
 +        race:raceSelect.value, 
 +        upgrades:{}, 
 +        equipment:{}, 
 +        skills:[], 
 +        spells:[] 
 +    }; 
 + 
 +    statOrder.forEach(stat=>{ 
 + 
 +        const input=document.getElementById("up_"+stat); 
 + 
 +        if(input){ 
 +            data.upgrades[stat]= 
 +                parseInt(input.value,10)||0; 
 +        } 
 +    }); 
 + 
 +    for(const key in slots){ 
 +        data.equipment[key]=slots[key].value; 
 +    } 
 + 
 +    skills.forEach((s,i)=>{ 
 + 
 +        const cb=document.getElementById("skill_"+i); 
 + 
 +        if(cb&&cb.checked){ 
 +            data.skills.push(i); 
 +        } 
 +    }); 
 + 
 +    spells.forEach((s,i)=>{ 
 + 
 +        const cb=document.getElementById("spell_"+i); 
 + 
 +        if(cb&&cb.checked){ 
 +            data.spells.push(i); 
 +        } 
 +    }); 
 + 
 +    return data; 
 +} 
 + 
 +function applyBuildData(data){ 
 + 
 +    if(data.race&&races[data.race]){ 
 +        raceSelect.value=data.race; 
 +    } 
 + 
 +    if(data.upgrades){ 
 + 
 +        statOrder.forEach(stat=>{ 
 + 
 +            const input=document.getElementById("up_"+stat); 
 + 
 +            if( 
 +                input&& 
 +                data.upgrades[stat]!==undefined 
 +            ){ 
 +                input.value=data.upgrades[stat]; 
 +            } 
 +        }); 
 +    } 
 + 
 +    fillEquip(); 
 + 
 +    if(data.equipment){ 
 + 
 +        for(const key in slots){ 
 + 
 +            if(data.equipment[key]!==undefined){ 
 + 
 +                const wanted= 
 +                    String(data.equipment[key]); 
 + 
 +                const exists= 
 +                    [...slots[key].options] 
 +                    .some( 
 +                        option=> 
 +                            option.value===wanted 
 +                    ); 
 + 
 +                if(exists){ 
 +                    slots[key].value=wanted; 
 +                } 
 +            } 
 +        } 
 +    } 
 + 
 +    skills.forEach((s,i)=>{ 
 + 
 +        const cb=document.getElementById("skill_"+i); 
 + 
 +        if(cb){ 
 +            cb.checked= 
 +                Array.isArray(data.skills)&& 
 +                data.skills.includes(i); 
 +        } 
 +    }); 
 + 
 +    spells.forEach((s,i)=>{ 
 + 
 +        const cb=document.getElementById("spell_"+i); 
 + 
 +        if(cb){ 
 +            cb.checked= 
 +                Array.isArray(data.spells)&& 
 +                data.spells.includes(i); 
 +        } 
 +    }); 
 + 
 +    /* Corrige les configurations importées dépassant la limite */ 
 + 
 +    let count=0; 
 + 
 +    for(const key of [ 
 +        "head", 
 +        "cape", 
 +        "rightHand", 
 +        "leftHand", 
 +        "body", 
 +        "feet" 
 +    ]){ 
 + 
 +        if(slots[key].value!==""){ 
 + 
 +            count++; 
 + 
 +            if(count>3){ 
 +                slots[key].value=""; 
 +            } 
 +        } 
 +    } 
 + 
 +    displayAllEquipStats(); 
 +    checkLimit(); 
 +    calculate(); 
 +} 
 + 
 +function exportBuild(){ 
 + 
 +    const encoded=btoa( 
 +        encodeURIComponent( 
 +            JSON.stringify(getBuildData()) 
 +        ) 
 +    ); 
 + 
 +    prompt( 
 +        "Copiez ce code de configuration :", 
 +        encoded 
 +    ); 
 +} 
 + 
 +function importBuild(){ 
 + 
 +    const text= 
 +        prompt( 
 +            "Collez le code de configuration :" 
 +        ); 
 + 
 +    if(!text) return; 
 + 
 +    try{ 
 + 
 +        const data=JSON.parse( 
 +            decodeURIComponent( 
 +                atob(text.trim()) 
 +            ) 
 +        ); 
 + 
 +        applyBuildData(data); 
 + 
 +    }catch(e){ 
 + 
 +        console.error("Erreur import :",e); 
 +        alert("Configuration invalide."); 
 +    } 
 +} 
 + 
 +function copyLink(){ 
 + 
 +    const encoded=btoa( 
 +        encodeURIComponent( 
 +            JSON.stringify(getBuildData()) 
 +        ) 
 +    ); 
 + 
 +    const url= 
 +        location.origin+ 
 +        location.pathname+ 
 +        "?id=simulateur&build="+ 
 +        encoded; 
 + 
 +    if( 
 +        navigator.clipboard&& 
 +        navigator.clipboard.writeText 
 +    ){ 
 + 
 +        navigator.clipboard.writeText(url) 
 +            .then( 
 +                ()=> 
 +                    alert( 
 +                        "Lien copié dans le presse-papiers." 
 +                    ) 
 +            ) 
 +            .catch( 
 +                ()=> 
 +                    prompt( 
 +                        "Copiez ce lien :", 
 +                        url 
 +                    ) 
 +            ); 
 + 
 +    }else{ 
 + 
 +        prompt( 
 +            "Copiez ce lien :", 
 +            url 
 +        ); 
 +    } 
 +} 
 + 
 +function loadFromURL(){ 
 + 
 +    const params= 
 +        new URLSearchParams(location.search); 
 + 
 +    const encoded= 
 +        params.get("build"); 
 + 
 +    if(!encoded) return; 
 + 
 +    try{ 
 + 
 +        const data=JSON.parse( 
 +            decodeURIComponent( 
 +                atob(encoded) 
 +            ) 
 +        ); 
 + 
 +        applyBuildData(data); 
 + 
 +    }catch(e){ 
 + 
 +        console.error( 
 +            "Erreur lors du chargement du build :", 
 +            e 
 +        ); 
 + 
 +        alert( 
 +            "Impossible de charger la configuration depuis le lien." 
 +        ); 
 +    } 
 +} 
 + 
 +/* ========================================================= 
 +   CHANGEMENT DE RACE 
 +========================================================= */ 
 + 
 +raceSelect.addEventListener("change",()=>{ 
 + 
 +    resetSlots(); 
 +    fillEquip(); 
 +    calculate(); 
 +}); 
 + 
 +/* ========================================================= 
 +   INITIALISATION 
 +========================================================= */ 
 + 
 +fillEquip(); 
 +displayBase(); 
 +calculate(); 
 +calculatePush(); 
 +loadFromURL(); 
 + 
 +</script> 
 + 
 +</body> 
 +</html>
simulateur.1791758633.txt.gz · Dernière modification : 2026/10/12 00:43 de nanaki