brouillon7
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| brouillon7 [2026/05/03 06:54] – nanaki | brouillon7 [2026/05/04 21:25] (Version actuelle) – nanaki | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | Fiable | + | Voici un simulateur en version beta, n' |
| < | < | ||
| Ligne 13: | Ligne 14: | ||
| padding: | padding: | ||
| } | } | ||
| - | h1,h2 { color:#facc15; } /* JAUNE LISBLE */ | + | h1,h2 { color:gold;} |
| - | .box { border:1px solid #facc15; padding: | + | .box { border:1px solid gold; padding: |
| select { margin:3px; max-width: | select { margin:3px; max-width: | ||
| input { margin:3px; width:60px; } | input { margin:3px; width:60px; } | ||
| Ligne 59: | Ligne 60: | ||
| <div class=" | <div class=" | ||
| - | < | + | < |
| <div id=" | <div id=" | ||
| + | <div id=" | ||
| </ | </ | ||
| + | |||
| + | |||
| + | <!-- ================= POUSSEE ================= --> | ||
| <div class=" | <div class=" | ||
| < | < | ||
| - | Force <input id=" | + | Force assaillant |
| Renforcement <select id=" | Renforcement <select id=" | ||
| Ligne 75: | Ligne 80: | ||
| Instabilité <select id=" | Instabilité <select id=" | ||
| - | Stabilité <select id=" | + | Stabilité <select id=" |
| - | <option value=" | + | |
| - | <option value=" | + | |
| - | <option value=" | + | |
| - | <option value=" | + | |
| - | </ | + | |
| <pre id=" | <pre id=" | ||
| Ligne 86: | Ligne 86: | ||
| <button onclick=" | <button onclick=" | ||
| + | |||
| <pre id=" | <pre id=" | ||
| Ligne 124: | Ligne 125: | ||
| {name:" | {name:" | ||
| ]; | ]; | ||
| + | |||
| + | // ===== SORTS ===== | ||
| + | const spells = [ | ||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | {name:" | ||
| + | |||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | {name:" | ||
| + | |||
| + | {name:" | ||
| + | |||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | ]; | ||
| + | |||
| Ligne 246: | Ligne 274: | ||
| - | // ===== SORTS ===== | + | // ===== INIT ===== |
| - | const spells = [ | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | {name:" | + | |
| - | ]; | + | |
| - | + | ||
| - | // ===== INIT UI ===== | + | |
| const raceSelect = document.getElementById(" | const raceSelect = document.getElementById(" | ||
| const statsDiv = document.getElementById(" | const statsDiv = document.getElementById(" | ||
| Ligne 283: | Ligne 292: | ||
| } | } | ||
| - | // sorts UI | + | // passifs |
| - | spells.forEach((s,i)=>{ | + | skills.forEach(s=>{ |
| + | document.getElementById(" | ||
| + | < | ||
| + | <input type=" | ||
| + | < | ||
| + | <span class=" | ||
| + | </ | ||
| + | }); | ||
| + | |||
| + | |||
| + | // affichage sorts | ||
| + | spells.forEach(s=>{ | ||
| document.getElementById(" | document.getElementById(" | ||
| - | < | + | < |
| + | <input type=" | ||
| + | <b> | ||
| + | <span class=" | ||
| + | </ | ||
| }); | }); | ||
| - | // ===== BASE ===== | + | // base stats |
| function displayBase(){ | function displayBase(){ | ||
| baseDiv.textContent = JSON.stringify(races[raceSelect.value], | baseDiv.textContent = JSON.stringify(races[raceSelect.value], | ||
| Ligne 315: | Ligne 339: | ||
| total+=calcCost(b, | total+=calcCost(b, | ||
| } | } | ||
| - | cost.innerHTML=" | + | document.getElementById(" |
| } | } | ||
| - | // ===== SORT EFFECTS | + | // ===== SLOTS ===== |
| - | function getSpellEffects(){ | + | const slots = { |
| - | let max={dex:0,protection:0,maladresse:0,vulne:0}; | + | head:head,neck:neck,cape:cape,rightHand:rightHand, |
| + | leftHand: | ||
| + | }; | ||
| - | document.querySelectorAll(" | + | function resetSlots(){ |
| - | let e=spells[el.dataset.id].effects; | + | Object.values(slots).forEach(s=>s.innerHTML="< |
| - | for(let k in e){ | + | |
| - | if(Math.abs(e[k])>Math.abs(max[k])) max[k]=e[k]; | + | |
| } | } | ||
| + | |||
| + | function fillEquip(){ | ||
| + | let r=raceSelect.value; | ||
| + | |||
| + | equipments.forEach((e, | ||
| + | if(e.race!==" | ||
| + | |||
| + | if(e.slot===" | ||
| + | if(e.slot===" | ||
| + | if(e.slot===" | ||
| + | if(e.slot===" | ||
| + | if(e.slot===" | ||
| + | if(e.slot===" | ||
| + | if(e.slot===" | ||
| + | if(e.slot===" | ||
| }); | }); | ||
| - | return | + | } |
| + | |||
| + | raceSelect.addEventListener(" | ||
| + | resetSlots(); | ||
| + | fillEquip(); | ||
| + | autoCalculate(); | ||
| + | }); | ||
| + | |||
| + | resetSlots(); | ||
| + | fillEquip(); | ||
| + | |||
| + | // ===== BONUS ===== | ||
| + | function displayStats(select, | ||
| + | let v=select.value; | ||
| + | let el=document.getElementById(id); | ||
| + | if(v==="" | ||
| + | let e=equipments[v]; | ||
| + | let txt=""; | ||
| + | for(let s in e.stats){ | ||
| + | let val=e.stats[s]; | ||
| + | txt+=val> | ||
| + | } | ||
| + | el.innerHTML=txt; | ||
| + | } | ||
| + | |||
| + | const slotToStatId = { | ||
| + | head:" | ||
| + | neck:" | ||
| + | cape:" | ||
| + | rightHand:" | ||
| + | leftHand:" | ||
| + | body:" | ||
| + | ring:" | ||
| + | feet:" | ||
| + | }; | ||
| + | |||
| + | Object.entries(slots).forEach(([k, | ||
| + | s.addEventListener(" | ||
| + | displayStats(s, | ||
| + | checkLimit(); | ||
| + | autoCalculate(); | ||
| + | }); | ||
| + | }); | ||
| + | |||
| + | // ===== LIMIT ===== | ||
| + | function checkLimit(){ | ||
| + | let count=0; | ||
| + | Object.entries(slots).forEach(([k, | ||
| + | if(k!==" | ||
| + | }); | ||
| + | |||
| + | if(count> | ||
| + | limitWarn.innerText=" | ||
| + | Object.entries(slots).forEach(([k, | ||
| + | if(k!==" | ||
| + | }); | ||
| + | }else{ | ||
| + | limitWarn.innerText=""; | ||
| + | Object.values(slots).forEach(s=> | ||
| + | } | ||
| } | } | ||
| // ===== CALCUL ===== | // ===== CALCUL ===== | ||
| + | |||
| function calculate(){ | function calculate(){ | ||
| + | |||
| + | let activeSpells = [...document.querySelectorAll(" | ||
| + | |||
| + | let bestDex = 0; | ||
| + | let bestProt = 0; | ||
| + | |||
| + | activeSpells.forEach(s=> | ||
| + | let d = +s.dataset.dex; | ||
| + | let p = +s.dataset.prot; | ||
| + | |||
| + | if(Math.abs(d) > Math.abs(bestDex)) bestDex = d; | ||
| + | if(Math.abs(p) > Math.abs(bestProt)) bestProt = p; | ||
| + | }); | ||
| let char={...races[raceSelect.value]}; | let char={...races[raceSelect.value]}; | ||
| - | // stats | + | // stats investies |
| for(let s in costTable){ | for(let s in costTable){ | ||
| let v=+document.getElementById(s).value||0; | let v=+document.getElementById(s).value||0; | ||
| Ligne 342: | Ligne 454: | ||
| } | } | ||
| - | // effets | + | // equip |
| - | let effects=getSpellEffects(); | + | Object.values(slots).forEach(sel=> |
| + | if(sel.value==="" | ||
| + | let e=equipments[sel.value]; | ||
| + | for(let s in e.stats){ | ||
| + | char[s]=(char[s]||0)+e.stats[s]; | ||
| + | } | ||
| + | }); | ||
| - | let ccFinal=char.cc+effects.dex-effects.maladresse; | + | // ===== DÉS ===== |
| - | let ctFinal=char.ct+effects.dex-effects.maladresse; | + | let ccDice |
| - | let fmFinal=char.fm+effects.dex-effects.maladresse; | + | let ctDice |
| + | let fmDice | ||
| - | // esquive | + | // ===== VALEURS FINALES ===== |
| - | let esquive=Math.round(char.agi*0.75+char.cc*0.25); | + | let finalCC |
| - | esquive+=effects.protection-effects.vulne; | + | let finalCT = ctDice |
| + | let finalFM | ||
| - | // magie | + | // ===== CT DISTANCE ===== |
| - | let jetFM=fmFinal*2; | + | function getCTDistance(baseCT, |
| + | if(distance <= 2) return baseCT; | ||
| + | return baseCT - (distance - 2) * 3; | ||
| + | } | ||
| - | let sorts="" | + | let ct1 = getCTDistance(finalCT, |
| - | for(let lvl=1;lvl<=5;lvl++){ | + | let ct2 = getCTDistance(finalCT, |
| - | let seuil=6+6*lvl; | + | let ct3 = getCTDistance(finalCT, |
| - | sorts+=`Niveau ${lvl} → ${jetFM>=seuil?"✅":" | + | let ct4 = getCTDistance(finalCT, |
| + | |||
| + | |||
| + | |||
| + | // ===== ESQUIVE ===== | ||
| + | let checked = [...document.querySelectorAll(" | ||
| + | |||
| + | // CAC = jet CC direct | ||
| + | let esquiveCAC | ||
| + | |||
| + | // ===== ESQUIVE TIR ===== | ||
| + | |||
| + | // calcul des 2 formules en dés | ||
| + | let esquiveA = Math.floor(char.cc * 0.75 + char.agi | ||
| + | let esquiveB = Math.floor(char.cc * 0.25 + char.agi * 0.75); | ||
| + | |||
| + | // choix du meilleur | ||
| + | let esquiveStat | ||
| + | |||
| + | // ===== PASSIFS ===== | ||
| + | |||
| + | // remplace complètement le calcul si passif spécifique | ||
| + | if(checked.includes("Réflexes fulgurants")){ | ||
| + | esquiveStat = Math.floor(char.agi * 0.85 + char.cc * 0.15); | ||
| } | } | ||
| - | // affichage | + | if(checked.includes(" |
| - | result.textContent= | + | esquiveStat = Math.floor(char.cc * 0.85 + char.agi * 0.15); |
| + | } | ||
| + | |||
| + | // conversion en jet | ||
| + | let esquive = esquiveStat * 2; | ||
| + | |||
| + | // bonus | ||
| + | if(checked.includes(" | ||
| + | esquive += 1; | ||
| + | |||
| + | // bonus protection | ||
| + | esquive += bestProt; | ||
| + | |||
| + | |||
| + | // ===== ESQUIVE MAGIQUE ===== | ||
| + | let esquiveFM = Math.floor(finalFM + bestProt); | ||
| + | |||
| + | |||
| + | // ===== MAGIE ===== | ||
| + | let jetFM = finalFM; | ||
| + | |||
| + | let sorts = ""; | ||
| + | for(let lvl=1; lvl<=5; lvl++){ | ||
| + | let seuil = 6 + 6 * lvl; | ||
| + | let reussite = jetFM >= seuil ? " | ||
| + | |||
| + | sorts += `Niveau ${lvl} → Seuil ${seuil} | Jet ${jetFM} ${reussite}\n`; | ||
| + | } | ||
| + | |||
| + | // ===== AFFICHAGE ===== | ||
| + | document.getElementById(" | ||
| + | "Bonus actifs → Dex: " | ||
| + | |||
| + | result.textContent = | ||
| + | "===== STATS =====\n" | ||
| JSON.stringify(char, | JSON.stringify(char, | ||
| - | "\nCC:"+ccFinal+ | + | |
| - | "\nCT:"+ctFinal+ | + | "\n\n⚔ CC : jet moyen "+ccDice+" |
| - | "\nFM:"+fmFinal+ | + | "\n🎯 CT : jet moyen "+ctDice+" |
| - | "\nEsquive:" | + | "\n✨ FM : jet moyen "+fmDice+" |
| - | "\n\nMagie: | + | |
| + | "\n\n🛡 Esquive CAC : " | ||
| + | " | ||
| + | "\n✨ Esquive FM : " | ||
| + | "\n🏹 Esquive tir : " | ||
| + | |||
| + | "\n\n🎯 CT distances :"+ | ||
| + | "\n1 case : " | ||
| + | "\n2 cases : " | ||
| + | "\n3 cases : " | ||
| + | "\n4 cases : " | ||
| + | |||
| + | " | ||
| + | "Jet FM : " | ||
| + | sorts; | ||
| } | } | ||
| - | // ===== POUSSEE ===== | ||
| - | function calculatePush(){ | ||
| - | let atk=+pushF.value+ +pushBuff.value; | ||
| - | let def=Math.max(+pushE.value+4, | ||
| - | +(+pushPV.value/ | ||
| - | + +pushDebuff.value | ||
| - | + +pushStab.value; | ||
| - | pushResult.textContent= | + | // ===== AUTO ===== |
| - | " | + | function autoCalculate(){ |
| - | " | + | updateCost(); |
| - | " | + | calculate(); |
| } | } | ||
| - | // ===== EVENTS ===== | + | // events stats |
| - | document.querySelectorAll(" | + | document.querySelectorAll(" |
| - | e.addEventListener(" | + | i.addEventListener(" |
| }); | }); | ||
| + | |||
| + | document.querySelectorAll(" | ||
| + | s.addEventListener(" | ||
| + | }); | ||
| + | |||
| + | |||
| + | // passifs | ||
| + | document.querySelectorAll(" | ||
| + | s.addEventListener(" | ||
| + | }); | ||
| + | |||
| + | // ===== SORTS ACTIFS ===== | ||
| + | |||
| // ===== RESET ===== | // ===== RESET ===== | ||
| function resetAll(){ | function resetAll(){ | ||
| - | document.querySelectorAll(" | + | |
| + | document.querySelectorAll(" | ||
| document.querySelectorAll(" | document.querySelectorAll(" | ||
| - | updateCost();calculate();calculatePush(); | + | |
| + | Object.values(slots).forEach(s=> | ||
| + | s.value=""; | ||
| + | s.disabled=false; | ||
| + | }); | ||
| + | |||
| + | document.querySelectorAll(" | ||
| + | |||
| + | resetSlots(); | ||
| + | fillEquip(); | ||
| + | displayBase(); | ||
| + | checkLimit(); | ||
| + | autoCalculate(); | ||
| } | } | ||
| + | |||
| + | // init | ||
| + | autoCalculate(); | ||
| + | |||
| + | |||
| + | |||
| + | // ===== POUSSEE ===== | ||
| + | function calculatePush(){ | ||
| + | |||
| + | let F=+pushF.value; | ||
| + | let buff=+pushBuff.value; | ||
| + | |||
| + | let E=+pushE.value; | ||
| + | let agi=+pushAgi.value; | ||
| + | let pv=+pushPV.value; | ||
| + | |||
| + | let instability=+pushDebuff.value; | ||
| + | let stability=+pushStab.value; | ||
| + | |||
| + | let attaque=F+buff; | ||
| + | let defense=Math.max(E+4, | ||
| + | |||
| + | pushResult.textContent= | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | |||
| + | // ===== EVENTS ===== | ||
| + | document.querySelectorAll(" | ||
| + | updateCost(); | ||
| + | })); | ||
| + | |||
| + | document.querySelectorAll(" | ||
| + | updateCost(); | ||
| + | })); | ||
| // ===== INIT ===== | // ===== INIT ===== | ||
brouillon7.1777784074.txt.gz · Dernière modification : 2026/05/03 06:54 de nanaki
