From a0bfd39c7abf31725f060ec9a178e9c355a7bc48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Tue, 16 Mar 2021 23:41:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D2P=20HP=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/script.js b/script.js index ca0ef0d3..40ef3167 100644 --- a/script.js +++ b/script.js @@ -1163,9 +1163,9 @@ function initialize() { } const hpDetailDialog_Close = hpDetailDialog.querySelector(".dialog-close"); hpDetailDialog_Close.onclick = function(){hpDetailDialog.close();}; - teamBigBoxs.forEach(teamBigBox => { - const reduceDetails = teamBigBox.querySelector(".tIf-total-hp .reduce-details"); - reduceDetails.onclick = function(){ + const reduceDetailsBars = Array.from(formationBox.querySelectorAll(".tIf-total-hp .reduce-details")); + reduceDetailsBars.forEach(bar => { + bar.onclick = function(){ hpDetailDialog.show(this.reduceAttrRanges, this.tHP, this.tHPNoAwoken); }; }); @@ -3195,7 +3195,7 @@ function drawHpInfo(hpBarDom, reduceAttrRanges) ctx.fillRect(0, 0, width, height); reduceRanges.forEach(range=>{ - ctx.fillStyle = `rgba(204, 0 ,85, 0.5)`; + ctx.fillStyle = `rgba(204, 0 ,85, 0.7)`; ctx.fillRect(width * (range.min / 100), 0, width * ((range.max - range.min) / 100), height * (1 - range.scale)); }); } @@ -3395,8 +3395,8 @@ function refreshFormationTotalHP(totalDom, teams) { hpBar.tHP = tHP; hpBar.tHPNoAwoken = tHPNoAwoken; - const tReduceHP = Math.round(tHP / (1 - reduceScale1) / (1 - reduceScale2)); //队伍正常满血加上盾能承受的最大伤害 - const tReduceHPNoAwoken = Math.round(tHPNoAwoken / (1 - reduceScale1) / (1 - reduceScale2)); //队伍封觉醒满血加上盾能承受的最大伤害 + const tReduceHP = Math.round(tHP / totalReduce); //队伍正常满血加上盾能承受的最大伤害 + const tReduceHPNoAwoken = Math.round(tHPNoAwoken / totalReduce); //队伍封觉醒满血加上盾能承受的最大伤害 const tHpDom_general = tHpDom.querySelector(".general"); const tHpDom_noAwoken = tHpDom.querySelector(".awoken-bind");