brouillon6
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 | ||
| brouillon6 [2026/04/23 15:17] – nanaki | brouillon6 [2026/05/02 00:09] (Version actuelle) – nanaki | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | Version finale cac | ||
| - | |||
| < | < | ||
| + | < | ||
| + | <meta charset=" | ||
| + | < | ||
| < | < | ||
| - | body { font-family: | + | body { |
| - | + | | |
| - | table { border-collapse: collapse; width: 100%; font-size: 13px; } | + | |
| - | td, th { border: 1px solid #ccc; padding: | + | color:#7dd3fc; |
| - | th { background: #f2f2f2; } | + | padding:10px; |
| - | + | } | |
| - | .cac { background: #fff3e5; } | + | h1,h2 { color: |
| - | .passif | + | .box { border:1px solid gold; padding:10px; margin-bottom: |
| - | + | select | |
| - | .controls | + | input { margin:3px; width:60px; } |
| + | .statLine | ||
| + | .result | ||
| + | .small { font-size:12px; color:#aaa; } | ||
| </ | </ | ||
| </ | </ | ||
| Ligne 19: | Ligne 23: | ||
| < | < | ||
| - | <div class=" | + | < |
| - | Points | + | |
| + | <div class=" | ||
| + | Race : | ||
| + | <select | ||
| + | < | ||
| + | <pre id=" | ||
| </ | </ | ||
| - | <table id="skills"> | + | <div class="box"> |
| - | <thead> | + | <h3>Améliorations</h3> |
| - | < | + | <div id=" |
| - | <th></th> | + | <div id=" |
| - | <th>Race</th> | + | </div> |
| - | <th>Nom</ | + | |
| - | < | + | |
| - | < | + | |
| - | < | + | |
| - | < | + | |
| - | < | + | |
| - | </tr> | + | |
| - | </thead> | + | |
| - | <tbody> | + | <div class=" |
| + | < | ||
| + | Tête <select id=" | ||
| + | Cou <select id=" | ||
| + | Dos <select id=" | ||
| + | Main droite <select id=" | ||
| + | Main gauche <select id=" | ||
| + | Corps <select id=" | ||
| + | Anneau <select id=" | ||
| + | Pieds <select id=" | ||
| + | <div id=" | ||
| + | </div> | ||
| - | <!-- ===== NIVEAU 1 ===== --> | + | <div class=" |
| + | < | ||
| + | <div id=" | ||
| + | </div> | ||
| - | <tr class=" | + | <!-- ================= POUSSEE ================= --> |
| - | <tr class=" | + | <div class=" |
| - | <tr class=" | + | <h3>Simulateur de poussée</h3> |
| - | <tr class=" | + | |
| - | <tr class=" | + | |
| - | <!-- ===== NIVEAU 2 ===== --> | + | Force assaillant |
| + | Renforcement <select id=" | ||
| - | <tr class=" | + | Endurance |
| - | <tr class=" | + | Agilité |
| - | <tr class=" | + | |
| - | <tr class=" | + | |
| - | <tr class=" | + | |
| - | <tr class=" | + | |
| - | <tr class=" | + | |
| - | <!-- ===== NIVEAU 3 ===== --> | + | PV actuels |
| - | <tr class="cac">< | + | Instabilité |
| - | <tr class=" | + | Stabilité |
| - | <tr class=" | + | |
| - | <tr class=" | + | |
| - | <tr class=" | + | |
| - | <tr class="cac">< | + | |
| - | <tr class=" | + | |
| - | <tr class=" | + | |
| - | <tr class=" | + | |
| - | <tr class="cac">< | + | |
| - | <tr class="cac">< | + | |
| - | <tr class="cac">< | + | |
| - | <tr class="cac">< | + | |
| - | <!-- ===== NIVEAU 4 ===== --> | + | <pre id=" |
| + | </div> | ||
| - | <tr class="cac">< | + | <button onclick="resetAll()">Reset</button> |
| - | <tr class=" | + | |
| - | <tr class=" | + | |
| - | </tbody> | + | <pre id=" |
| - | </table> | + | |
| < | < | ||
| - | let max = 15; | ||
| - | document.querySelectorAll(".skill").forEach(cb=>{ | + | // ===== RACES ===== |
| - | cb.addEventListener("change", | + | const races = { |
| - | let total = document.querySelectorAll(".skill: | + | Elfe: |
| - | if(total > max){ cb.checked | + | Nain: |
| - | document.getElementById(" | + | Géant: |
| + | Olympien: | ||
| + | HS: | ||
| + | }; | ||
| + | |||
| + | // ===== COST ===== | ||
| + | const costTable = { | ||
| + | a: | ||
| + | cc: | ||
| + | f: | ||
| + | agi: | ||
| + | m: | ||
| + | fm: | ||
| + | p: | ||
| + | pv: | ||
| + | pm: | ||
| + | mvt: | ||
| + | r: | ||
| + | rm: | ||
| + | }; | ||
| + | |||
| + | // ===== PASSIFS ===== | ||
| + | const skills = [ | ||
| + | {name:"Fulgurance", | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | ]; | ||
| + | |||
| + | |||
| + | const equipments | ||
| + | |||
| + | /* ================= COMMUNS ================= */ | ||
| + | |||
| + | {name:" | ||
| + | {name:"Armure matelassée",race:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | /* ===== NOUVEAUX COMMUNS ===== */ | ||
| + | |||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | /* ================= ELFES ================= */ | ||
| + | |||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | // spécifique elfe | ||
| + | {name:" | ||
| + | |||
| + | /* ================= NAINS ================= */ | ||
| + | |||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | // spécifiques nains | ||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | /* ================= GÉANTS ================= */ | ||
| + | |||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | // spécifique géant | ||
| + | {name:" | ||
| + | |||
| + | /* ================= HS ================= */ | ||
| + | |||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | // spécifiques HS | ||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | /* ================= OLYMPIENS ================= */ | ||
| + | |||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | // spécifique olympien | ||
| + | {name:" | ||
| + | |||
| + | /* ================= ANNEAUX ================= */ | ||
| + | |||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | |||
| + | ]; | ||
| + | |||
| + | |||
| + | // ===== INIT ===== | ||
| + | const raceSelect | ||
| + | const statsDiv = document.getElementById(" | ||
| + | const baseDiv = document.getElementById(" | ||
| + | |||
| + | for(let r in races){ | ||
| + | raceSelect.innerHTML += `<option>${r}</ | ||
| + | } | ||
| + | |||
| + | // stats UI | ||
| + | for(let s in costTable){ | ||
| + | statsDiv.innerHTML += ` | ||
| + | <div class=" | ||
| + | < | ||
| + | <input type=" | ||
| + | </ | ||
| + | } | ||
| + | |||
| + | // passifs | ||
| + | skills.forEach(s=> | ||
| + | document.getElementById(" | ||
| + | < | ||
| + | <input type=" | ||
| + | < | ||
| + | <span class=" | ||
| + | </ | ||
| }); | }); | ||
| + | |||
| + | // base stats | ||
| + | function displayBase(){ | ||
| + | baseDiv.textContent = JSON.stringify(races[raceSelect.value], | ||
| + | } | ||
| + | raceSelect.addEventListener(" | ||
| + | displayBase(); | ||
| + | |||
| + | // ===== COST ===== | ||
| + | function calcCost(b, | ||
| + | let total=0, | ||
| + | for(let i=1; | ||
| + | if(i===1) last=b; | ||
| + | else if(i<=3) last+=m1; | ||
| + | else last+=m2; | ||
| + | total+=last; | ||
| + | } | ||
| + | return total; | ||
| + | } | ||
| + | |||
| + | function updateCost(){ | ||
| + | let total=0; | ||
| + | for(let s in costTable){ | ||
| + | let v=+document.getElementById(s).value||0; | ||
| + | let [b, | ||
| + | total+=calcCost(b, | ||
| + | } | ||
| + | document.getElementById(" | ||
| + | } | ||
| + | |||
| + | // ===== SLOTS ===== | ||
| + | const slots = { | ||
| + | head: | ||
| + | leftHand: | ||
| + | }; | ||
| + | |||
| + | function resetSlots(){ | ||
| + | Object.values(slots).forEach(s=> | ||
| + | } | ||
| + | |||
| + | 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===" | ||
| }); | }); | ||
| - | </ | + | } |
| + | 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 ===== | ||
| + | function calculate(){ | ||
| + | |||
| + | let char={...races[raceSelect.value]}; | ||
| + | |||
| + | // stats investies | ||
| + | for(let s in costTable){ | ||
| + | let v=+document.getElementById(s).value||0; | ||
| + | char[s]=(char[s]||0)+v; | ||
| + | } | ||
| + | |||
| + | // equip | ||
| + | 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]; | ||
| + | } | ||
| + | }); | ||
| + | |||
| + | // ===== ESQUIVE ===== | ||
| + | let esquive=Math.round(char.agi*0.75+char.cc*0.25); | ||
| + | |||
| + | let checked=[...document.querySelectorAll(" | ||
| + | |||
| + | if(checked.includes(" | ||
| + | esquive=Math.round(char.agi*0.85+char.cc*0.15); | ||
| + | |||
| + | if(checked.includes(" | ||
| + | esquive=Math.round(char.cc*0.85+char.agi*0.15); | ||
| + | |||
| + | if(checked.includes(" | ||
| + | esquive+=1; | ||
| + | |||
| + | // ===== MAGIE ===== | ||
| + | let jetFM = char.fm * 2; | ||
| + | |||
| + | 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 ===== | ||
| + | result.textContent = | ||
| + | "===== STATS =====\n" | ||
| + | JSON.stringify(char, | ||
| + | |||
| + | " | ||
| + | " | ||
| + | "\n✨ FM : " | ||
| + | " | ||
| + | |||
| + | " | ||
| + | "Jet FM (x2) : " | ||
| + | sorts; | ||
| + | } | ||
| + | |||
| + | // ===== AUTO ===== | ||
| + | function autoCalculate(){ | ||
| + | updateCost(); | ||
| + | calculate(); | ||
| + | } | ||
| + | |||
| + | // events stats | ||
| + | document.querySelectorAll("# | ||
| + | i.addEventListener(" | ||
| + | }); | ||
| + | |||
| + | // passifs | ||
| + | document.querySelectorAll(" | ||
| + | s.addEventListener(" | ||
| + | }); | ||
| + | |||
| + | // ===== RESET ===== | ||
| + | function resetAll(){ | ||
| + | |||
| + | document.querySelectorAll("# | ||
| + | |||
| + | 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 ===== | ||
| + | updateCost(); | ||
| + | calculate(); | ||
| + | calculatePush(); | ||
| + | |||
| + | </ | ||
| </ | </ | ||
| </ | </ | ||
brouillon6.1776950275.txt.gz · Dernière modification : 2026/04/23 15:17 de nanaki
