修复2人等效血量计算错误
This commit is contained in:
parent
0c03fbd028
commit
bd2b101e26
|
@ -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开始乘
|
||||
|
|
13
script.js
13
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");
|
||||
|
|
Loading…
Reference in New Issue