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/30 00:14] – nanaki | brouillon6 [2026/05/02 00:09] (Version actuelle) – nanaki | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | |||
| < | < | ||
| < | < | ||
| Ligne 6: | Ligne 5: | ||
| < | < | ||
| - | body {font-family: | + | body { |
| - | .box {border:1px solid gold; | + | |
| - | select, | + | |
| - | input {width:50px;} | + | |
| - | .result {background:# | + | |
| - | .warn {color:red;} | + | } |
| + | h1,h2 { color:gold;} | ||
| + | .box { border:1px solid gold; padding: | ||
| + | select { margin:3px; max-width: | ||
| + | input { margin: | ||
| + | .statLine { display: | ||
| + | .result { background:# | ||
| + | .small { font-size: | ||
| </ | </ | ||
| </ | </ | ||
| Ligne 17: | Ligne 23: | ||
| < | < | ||
| - | < | + | <h1>🎲 Simulateur</ |
| <div class=" | <div class=" | ||
| - | Race <select id=" | + | Race : |
| + | <select id=" | ||
| + | < | ||
| <pre id=" | <pre id=" | ||
| </ | </ | ||
| Ligne 32: | Ligne 40: | ||
| <div class=" | <div class=" | ||
| < | < | ||
| - | |||
| Tête <select id=" | Tête <select id=" | ||
| Cou <select id=" | Cou <select id=" | ||
| Ligne 41: | Ligne 48: | ||
| Anneau <select id=" | Anneau <select id=" | ||
| Pieds <select id=" | Pieds <select id=" | ||
| - | + | <div id=" | |
| - | <div id=" | + | |
| </ | </ | ||
| Ligne 48: | Ligne 54: | ||
| < | < | ||
| <div id=" | <div id=" | ||
| + | </ | ||
| + | |||
| + | <!-- ================= POUSSEE ================= --> | ||
| + | <div class=" | ||
| + | < | ||
| + | |||
| + | Force assaillant <input id=" | ||
| + | Renforcement <select id=" | ||
| + | |||
| + | Endurance <input id=" | ||
| + | Agilité <input id=" | ||
| + | |||
| + | PV actuels <input id=" | ||
| + | |||
| + | Instabilité <select id=" | ||
| + | Stabilité <select id=" | ||
| + | |||
| + | <pre id=" | ||
| </ | </ | ||
| Ligne 58: | Ligne 82: | ||
| // ===== RACES ===== | // ===== RACES ===== | ||
| const races = { | const races = { | ||
| - | Elfe: | + | Elfe:{a:2,cc: |
| - | Nain: | + | Nain:{a:2,cc: |
| - | Géant: | + | Géant:{a:2,cc: |
| - | Olympien: | + | Olympien:{a:2,cc: |
| - | HS: | + | HS:{a:2,cc: |
| }; | }; | ||
| // ===== COST ===== | // ===== COST ===== | ||
| const costTable = { | const costTable = { | ||
| + | a: | ||
| cc: | cc: | ||
| f: | f: | ||
| Ligne 81: | Ligne 106: | ||
| // ===== PASSIFS ===== | // ===== PASSIFS ===== | ||
| - | const passifs | + | const skills |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| + | {name:" | ||
| ]; | ]; | ||
| - | // ===== ÉQUIPEMENTS ===== | + | |
| - | // ===== ÉQUIPEMENTS ===== | + | |
| const equipments = [ | const equipments = [ | ||
| Ligne 112: | Ligne 137: | ||
| {name:" | {name:" | ||
| {name:" | {name:" | ||
| + | |||
| + | /* ===== NOUVEAUX COMMUNS ===== */ | ||
| + | |||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| + | {name:" | ||
| /* ================= ELFES ================= */ | /* ================= ELFES ================= */ | ||
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| + | |||
| + | // spécifique elfe | ||
| + | {name:" | ||
| /* ================= NAINS ================= */ | /* ================= NAINS ================= */ | ||
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| + | |||
| + | // spécifiques nains | ||
| + | {name:" | ||
| + | {name:" | ||
| /* ================= GÉANTS ================= */ | /* ================= GÉANTS ================= */ | ||
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| {name:" | {name:" | ||
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| + | |||
| + | // spécifique géant | ||
| + | {name:" | ||
| /* ================= HS ================= */ | /* ================= HS ================= */ | ||
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| + | |||
| + | // spécifiques HS | ||
| + | {name:" | ||
| + | {name:" | ||
| /* ================= OLYMPIENS ================= */ | /* ================= OLYMPIENS ================= */ | ||
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| - | {name:" | + | {name:" |
| + | |||
| + | // spécifique olympien | ||
| + | {name:" | ||
| /* ================= ANNEAUX ================= */ | /* ================= ANNEAUX ================= */ | ||
| Ligne 186: | Ligne 235: | ||
| ]; | ]; | ||
| - | // ===== DOM ===== | + | |
| + | // ===== INIT ===== | ||
| const raceSelect = document.getElementById(" | const raceSelect = document.getElementById(" | ||
| const statsDiv = document.getElementById(" | const statsDiv = document.getElementById(" | ||
| - | const costDiv | + | const baseDiv |
| - | const result = document.getElementById(" | + | |
| - | // slots | + | for(let r in races){ |
| - | const slots = { | + | raceSelect.innerHTML += `< |
| - | head, | + | } |
| - | }; | + | |
| - | + | ||
| - | // ===== INIT ===== | + | |
| - | for(let r in races) raceSelect.innerHTML+=`< | + | |
| // stats UI | // stats UI | ||
| for(let s in costTable){ | for(let s in costTable){ | ||
| - | statsDiv.innerHTML+=`${s}< | + | statsDiv.innerHTML += ` |
| + | <div class=" | ||
| + | < | ||
| + | <input type=" | ||
| + | </div>`; | ||
| } | } | ||
| - | // passifs | + | // passifs |
| - | passifs.forEach(p=>{ | + | skills.forEach(s=>{ |
| - | skills.innerHTML+=`< | + | document.getElementById(" |
| + | < | ||
| + | <input type=" | ||
| + | <b>${s.name}</ | ||
| + | <span class=" | ||
| + | </ | ||
| }); | }); | ||
| - | // ===== EQUIP ===== | + | // base stats |
| + | function displayBase(){ | ||
| + | baseDiv.textContent | ||
| + | } | ||
| + | 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(){ | function resetSlots(){ | ||
| - | Object.values(slots).forEach(sel=>sel.innerHTML="< | + | Object.values(slots).forEach(s=>s.innerHTML="< |
| } | } | ||
| Ligne 219: | Ligne 307: | ||
| equipments.forEach((e, | equipments.forEach((e, | ||
| - | if(e.race!=" | + | 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===" |
| + | 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 ===== | // ===== LIMIT ===== | ||
| function checkLimit(){ | function checkLimit(){ | ||
| let count=0; | let count=0; | ||
| - | + | Object.entries(slots).forEach(([k,s])=>{ | |
| - | [" | + | if(k!==" |
| - | if(document.getElementById(id).value) count++; | + | |
| }); | }); | ||
| - | if(count> | + | if(count> |
| - | limitWarn.innerText=" | + | limitWarn.innerText=" |
| + | Object.entries(slots).forEach(([k, | ||
| + | if(k!==" | ||
| + | }); | ||
| }else{ | }else{ | ||
| limitWarn.innerText=""; | limitWarn.innerText=""; | ||
| + | Object.values(slots).forEach(s=> | ||
| } | } | ||
| } | } | ||
| Ligne 247: | Ligne 384: | ||
| let char={...races[raceSelect.value]}; | let char={...races[raceSelect.value]}; | ||
| - | let totalPI=0; | ||
| - | // 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; | ||
| - | char[s]+=v; | + | char[s]=(char[s]||0)+v; |
| - | let [b, | + | |
| - | totalPI+=calcCost(b, | + | |
| } | } | ||
| - | // équipement | + | // equip |
| Object.values(slots).forEach(sel=> | Object.values(slots).forEach(sel=> | ||
| - | let id=sel.value; | + | if(sel.value==="" |
| - | if(id==="" | + | let e=equipments[sel.value]; |
| - | let e=equipments[id]; | + | for(let |
| - | for(let | + | char[s]=(char[s]||0)+e.stats[s]; |
| - | char[stat]=(char[stat]||0)+e.stats[stat]; | + | |
| } | } | ||
| }); | }); | ||
| - | // esquive base | + | // ===== ESQUIVE ===== |
| - | char.esquive=Math.round(char.agi*0.75+char.cc*0.25); | + | let esquive=Math.round(char.agi*0.75+char.cc*0.25); |
| - | // passifs | + | let checked=[...document.querySelectorAll(" |
| - | document.querySelectorAll(" | + | |
| - | let obj=passifs.find(x=> | + | |
| - | if(obj) obj.effect(char); | + | |
| - | }); | + | |
| - | // CT distance | + | if(checked.includes(" |
| - | let ct1=char.ct; | + | esquive=Math.round(char.agi*0.85+char.cc*0.15); |
| - | let ct2=char.ct-1; | + | |
| - | let ct3=char.ct-2; | + | |
| - | let ct4=char.ct-3; | + | |
| - | // FM moyenne | + | if(checked.includes(" |
| - | let fmAvg=char.fm*2; | + | esquive=Math.round(char.cc*0.85+char.agi*0.15); |
| - | // sorts | + | if(checked.includes(" |
| - | let sorts=[]; | + | esquive+=1; |
| - | for(let | + | |
| - | if(fmAvg> | + | // ===== MAGIE ===== |
| + | let jetFM = char.fm * 2; | ||
| + | |||
| + | let sorts = "" | ||
| + | for(let | ||
| + | let seuil = 6 + 6 * lvl; | ||
| + | let reussite = jetFM >= seuil ? " | ||
| + | |||
| + | sorts += `Niveau ${lvl} → Seuil ${seuil} | Jet ${jetFM} ${reussite}\n`; | ||
| } | } | ||
| - | costDiv.innerText="💰 PI: "+totalPI; | + | // ===== AFFICHAGE ===== |
| + | result.textContent | ||
| + | "===== STATS =====\n"+ | ||
| + | JSON.stringify(char, | ||
| - | result.innerText= | + | "\n\n⚔ CC : "+char.cc+ |
| - | JSON.stringify(char, | + | "\n🎯 CT : " |
| - | +"\n\n🎯 CT: "+ct1+"/" | + | "\n✨ FM : "+char.fm+ |
| - | +"\n🛡 Esquive: " | + | "\n🛡 Esquive |
| - | +"\n✨ FM moyen: "+fmAvg | + | |
| - | +"\n🧙 Sorts: "+(sorts.join(", | + | |
| + | " | ||
| + | "Jet FM (x2) : " | ||
| + | sorts; | ||
| } | } | ||
| - | // ===== COST FUNC ===== | + | // ===== AUTO ===== |
| - | function | + | function |
| - | let t=0,l=b; | + | updateCost(); |
| - | for(let i=1; | + | calculate(); |
| - | if(i==1) l=b; | + | |
| - | else if(i<=3) l+=m1; | + | |
| - | else l+=m2; | + | |
| - | t+=l; | + | |
| - | } | + | |
| - | return t; | + | |
| } | } | ||
| - | // ===== EVENTS ===== | + | // events stats |
| - | document.querySelectorAll(" | + | document.querySelectorAll(" |
| - | e.addEventListener(" | + | i.addEventListener(" |
| }); | }); | ||
| - | raceSelect.addEventListener("change",()=>{ | + | // passifs |
| - | resetSlots(); | + | document.querySelectorAll(".skill").forEach(s=>{ |
| + | s.addEventListener(" | ||
| }); | }); | ||
| // ===== RESET ===== | // ===== RESET ===== | ||
| function resetAll(){ | function resetAll(){ | ||
| - | document.querySelectorAll(" | ||
| - | document.querySelectorAll(" | ||
| - | calculate(); | ||
| - | } | ||
| - | // init | + | document.querySelectorAll("# |
| + | |||
| + | Object.values(slots).forEach(s=> | ||
| + | s.value=""; | ||
| + | s.disabled=false; | ||
| + | }); | ||
| + | |||
| + | document.querySelectorAll(" | ||
| resetSlots(); | resetSlots(); | ||
| fillEquip(); | 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(); | calculate(); | ||
| + | calculatePush(); | ||
| </ | </ | ||
| </ | </ | ||
| </ | </ | ||
brouillon6.1777500863.txt.gz · Dernière modification : 2026/04/30 00:14 de nanaki
