From c22ef8892e1bc2b8a7edd9e19c5ab1747e9b4381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Wed, 21 Oct 2020 19:41:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=B1=E9=9F=A9=E6=9C=8D=E8=BF=98=E6=9C=AA?= =?UTF-8?q?=E5=AE=9E=E8=A3=85=EF=BC=8C=E4=BF=AE=E8=AE=A2=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-universal_function.js | 44 ++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/script-universal_function.js b/script-universal_function.js index 726b2fdc..8962cb35 100644 --- a/script-universal_function.js +++ b/script-universal_function.js @@ -259,12 +259,19 @@ function calculateAbility(member, assist = null, solo = true, teamsCount = 1) [{index:3,value:200},{index:67,value:-2000}] //RCV ]; const awokenScale = [ //对应比例加三维觉醒的序号与倍率值 - //63 语音觉醒 - [{index:63,scale:1.1}], //HP - [{index:63,scale:1.1}], //ATK - [{index:63,scale:1.1}] //RCV + [], //HP + [], //ATK + [] //RCV ]; + if (currentDataSource.code=="ja") + { + //63 语音觉醒 + awokenScale.forEach(ab=>{ + ab.push({index:63,scale:1.1}); + }); + } + if (!solo) { //协力时计算协力觉醒 awokenScale.forEach(ab=>{ @@ -337,22 +344,19 @@ function calculateAbility(member, assist = null, solo = true, teamsCount = 1) } },reValue)); - if (currentDataSource.code=="ja") - { - //觉醒无效时的倍率 —— 计算顺序可能不对,这里只作为初步设置 - const awokenScale_noAwoken = awokenScale.map(arr=>arr.filter(obj=>obj.index == 63)); //筛选出在无觉醒情况下依然生效的倍率觉醒,目前只有63语音觉醒 - reValueNoAwoken = Math.round(awokenScale_noAwoken[idx].reduce((previous,aw)=>{ - const awokenCount = awokenList.filter(ak=>ak==aw.index).length; //每个倍率觉醒的数量 - if (awokenCount>0) - { - return previous * Math.pow(aw.scale,awokenCount); - } - else - { - return previous; - } - },reValueNoAwoken)); - } + //觉醒无效时的倍率 —— 计算顺序可能不对,这里只作为初步设置 + const awokenScale_noAwoken = awokenScale.map(arr=>arr.filter(obj=>obj.index == 63)); //筛选出在无觉醒情况下依然生效的倍率觉醒,目前只有63语音觉醒 + reValueNoAwoken = Math.round(awokenScale_noAwoken[idx].reduce((previous,aw)=>{ + const awokenCount = awokenList.filter(ak=>ak==aw.index).length; //每个倍率觉醒的数量 + if (awokenCount>0) + { + return previous * Math.pow(aw.scale,awokenCount); + } + else + { + return previous; + } + },reValueNoAwoken)); if (idx<2 && reValue<1) reValue = 1; //HP和ATK最低为1 return [reValue,reValueNoAwoken];