From bd2b101e26dfb632000b25374c0d19f720e1baad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Thu, 18 Mar 2021 14:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D2=E4=BA=BA=E7=AD=89=E6=95=88?= =?UTF-8?q?=E8=A1=80=E9=87=8F=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-universal_function.js | 4 ++-- script.js | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/script-universal_function.js b/script-universal_function.js index 8ed3b4cd..1658e3f6 100644 --- a/script-universal_function.js +++ b/script-universal_function.js @@ -212,7 +212,7 @@ function returnMonsterNameArr(card, lsList, defaultCode) { //Code From pad-rikuu function valueAt(level, maxLevel, curve) { const f = (maxLevel === 1 || level >= maxLevel) ? 1 : ((level - 1) / (maxLevel - 1)); - return curve.min + (curve.max - curve.min) * Math.pow(f, curve.scale); + return curve.min + (curve.max - curve.min) * f ** curve.scale; } //Code From pad-rikuu function curve(c, level, maxLevel, limitBreakIncr, limitBreakIncr120) { @@ -316,7 +316,7 @@ function calculateAbility(member, assist = null, solo = true, teamsCount = 1) { //用来计算倍率觉醒的最终倍率是多少,reduce用 function calculateAwokenScale(previous, aw) { const awokenCount = awokenList.filter(ak => ak == aw.index).length; //每个倍率觉醒的数量 - return previous * Math.pow(aw.scale, awokenCount); + return previous * aw.scale ** awokenCount; } //倍率类觉醒的比例,直接从1开始乘 diff --git a/script.js b/script.js index 40ef3167..a3cdbb52 100644 --- a/script.js +++ b/script.js @@ -560,6 +560,11 @@ function turnPage(toPage, e = null) { } } window.onload = function(event) { + if (!Array.prototype.flat) + { + alert("请更新您的浏览器。\nPlease update your browser."); + } + controlBox = document.body.querySelector(".control-box"); statusLine = controlBox.querySelector(".status"); //显示当前状态的 formationBox = document.body.querySelector(".formation-box"); @@ -3257,8 +3262,8 @@ function refreshTeamTotalHP(totalDom, team, teamIdx) { hpBar.tHP = tHP; hpBar.tHPNoAwoken = tHPNoAwoken; - const tReduceHP = Math.round(tHP / (1 - totalReduce)); //队伍正常满血加上盾能承受的最大伤害 - const tReduceHPNoAwoken = Math.round(tHPNoAwoken / (1 - totalReduce)); //队伍封觉醒满血加上盾能承受的最大伤害 + const tReduceHP = Math.floor(tHP / (1 - totalReduce)); //队伍正常满血加上盾能承受的最大伤害 + const tReduceHPNoAwoken = Math.floor(tHPNoAwoken / (1 - totalReduce)); //队伍封觉醒满血加上盾能承受的最大伤害 const tHpDom_general = tHpDom.querySelector(".general"); const tHpDom_noAwoken = tHpDom.querySelector(".awoken-bind"); @@ -3395,8 +3400,8 @@ function refreshFormationTotalHP(totalDom, teams) { hpBar.tHP = tHP; hpBar.tHPNoAwoken = tHPNoAwoken; - const tReduceHP = Math.round(tHP / totalReduce); //队伍正常满血加上盾能承受的最大伤害 - const tReduceHPNoAwoken = Math.round(tHPNoAwoken / totalReduce); //队伍封觉醒满血加上盾能承受的最大伤害 + const tReduceHP = Math.floor(tHP / (1 - totalReduce)); //队伍正常满血加上盾能承受的最大伤害 + const tReduceHPNoAwoken = Math.floor(tHPNoAwoken / (1 - totalReduce)); //队伍封觉醒满血加上盾能承受的最大伤害 const tHpDom_general = tHpDom.querySelector(".general"); const tHpDom_noAwoken = tHpDom.querySelector(".awoken-bind");