From a5d1725ee7be7f2733d950197d183631c692a170 Mon Sep 17 00:00:00 2001 From: s Date: Tue, 30 Jun 2026 12:14:02 +0200 Subject: [PATCH] feat: stats historique enrichies en kills/min avec exp, kamas et top item MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Kills/h remplacé par kills/min partout (graphique + tableau) - Hero : 3 nouvelles cartes (kills/min moyen + meilleur, exp totale, kamas totaux) - Tableau : ajout colonnes exp/min, kamas, cols/min, top item droppé Co-Authored-By: Claude Sonnet 4.6 --- renderer/index.html | 58 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/renderer/index.html b/renderer/index.html index c85ff6e..6c9b393 100644 --- a/renderer/index.html +++ b/renderer/index.html @@ -528,6 +528,21 @@

0h 00m

moy. 0h / session

+
+

Kills/min moyen

+

0

+

meilleur 0/min

+
+
+

Exp totale

+

0

+

moy. 0 / session

+
+
+

Kamas totaux

+

0

+

moy. 0 / session

+
@@ -552,7 +567,7 @@
-

Kills / heure

+

Kills / min

@@ -577,10 +592,13 @@ Date Durée Kills - Kills/h + K/min Exp - Cols kill + Exp/min + Kamas + Cols/min Mob principal + Top item @@ -1834,8 +1852,15 @@ histEmpty.hidden=true; histHero.hidden=false; histCharts.hidden=false; histPanel.hidden=false; const totalKills=sessions.reduce((s,x)=>s+x.totalKills,0); const totalMs=sessions.reduce((s,x)=>s+x.durationMs,0); + const totalExp=sessions.reduce((s,x)=>s+(x.totalExp||0),0); + const totalKamas=sessions.reduce((s,x)=>s+(x.sellTotal||0),0); const avgKills=Math.round(totalKills/sessions.length); const avgMs=totalMs/sessions.length; + const avgExp=Math.round(totalExp/sessions.length); + const avgKamas=Math.round(totalKamas/sessions.length); + const ratesPerMin=sessions.filter(s=>s.durationMs>0).map(s=>s.totalKills/(s.durationMs/60000)); + const avgRate=ratesPerMin.length?ratesPerMin.reduce((a,b)=>a+b,0)/ratesPerMin.length:0; + const bestRate=ratesPerMin.length?Math.max(...ratesPerMin):0; $('histTotalSessions').textContent=fmt(sessions.length); $('histTotalKills').textContent=fmt(totalKills); $('histAvgKills').textContent='moy. '+fmt(avgKills)+' / session'; @@ -1843,12 +1868,18 @@ $('histTotalTime').textContent=tH+'h '+String(tM).padStart(2,'0')+'m'; const aH=Math.floor(avgMs/3600000),aM=Math.floor((avgMs%3600000)/60000); $('histAvgTime').textContent='moy. '+(aH>0?aH+'h ':'')+String(aM).padStart(2,'0')+'m / session'; + $('histAvgRate').textContent=fmt(avgRate,1)+'/min'; + $('histBestRate').textContent='meilleur '+fmt(bestRate,1)+'/min'; + $('histTotalExp').textContent=fmtShort(totalExp); + $('histAvgExp').textContent='moy. '+fmtShort(avgExp)+' / session'; + $('histTotalKamas').textContent=fmtShort(totalKamas); + $('histAvgKamas').textContent='moy. '+fmtShort(avgKamas)+' / session'; const kAvgEl=$('histKillsAvgLabel'); if (kAvgEl) kAvgEl.textContent='moy. '+fmt(avgKills)+' kills'; renderSvgChart($('chartKills'),sessions,s=>s.totalKills,'#9B5DE5',null,$('chartKillsLabels')); renderSvgChart($('chartRate'),sessions,s=>{ - const h=s.durationMs/3600000; return h>0?Math.round(s.totalKills/h):0; - },'#5DB7E5',v=>fmtShort(v)+'/h',$('chartRateLabels')); + const min=s.durationMs/60000; return min>0?Math.round(s.totalKills/min*10)/10:0; + },'#5DB7E5',v=>fmt(v,1)+'/min',$('chartRateLabels')); renderSvgChart($('chartExp'),sessions,s=>s.totalExp,'#F2C94C',v=>fmtShort(v),$('chartExpLabels')); const tbody=$('histSessionsBody'); tbody.innerHTML=''; @@ -1859,16 +1890,23 @@ +' '+d.toLocaleTimeString('fr-FR',{hour:'2-digit',minute:'2-digit'}); const dH=Math.floor(s.durationMs/3600000),dM=Math.floor((s.durationMs%3600000)/60000); const durStr=dH>0?dH+'h'+String(dM).padStart(2,'0')+'m':dM+'min'; - const killsPerH=s.durationMs>0?Math.round(s.totalKills/(s.durationMs/3600000)):0; + const minElapsed=s.durationMs/60000; + const killsPerMin=minElapsed>0?Math.round(s.totalKills/minElapsed*10)/10:0; + const expPerMin=minElapsed>0?Math.round(s.totalExp/minElapsed):0; + const colsPerMin=minElapsed>0?Math.round((s.killCols||0)/minElapsed*10)/10:0; + const topItemName=s.topItems&&s.topItems.length?s.topItems[0].name+' ×'+s.topItems[0].qty:'—'; const tr=document.createElement('tr'); tr.innerHTML= ''+escHtml(dateStr)+''+ ''+escHtml(durStr)+''+ ''+fmt(s.totalKills)+''+ - ''+fmt(killsPerH)+'/h'+ - ''+fmt(s.totalExp)+''+ - ''+fmt(s.killCols)+''+ - ''+escHtml(s.topMob||'—')+''; + ''+fmt(killsPerMin,1)+'/min'+ + ''+fmtShort(s.totalExp)+''+ + ''+fmtShort(expPerMin)+'/min'+ + ''+(s.sellTotal?fmtShort(Math.round(s.sellTotal)):'—')+''+ + ''+fmt(colsPerMin,1)+'/min'+ + ''+escHtml(s.topMob||'—')+''+ + ''+escHtml(topItemName.length>22?topItemName.slice(0,20)+'…':topItemName)+''; tbody.appendChild(tr); } }