From b623ed8f06473128ce4d68da2a59149b300d7ef8 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, 7 May 2020 15:52:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E4=B8=8D=E5=90=8C=E6=80=AA=E7=89=A9?= =?UTF-8?q?=E4=B9=8B=E9=97=B4=E5=88=87=E6=8D=A2=EF=BC=8C=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E6=B8=85=E7=A9=BA=E6=BD=9C=E8=A7=89=EF=BC=8C=E5=8F=AA=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E4=B8=8D=E8=83=BD=E6=89=93=E7=9A=84=E6=BD=9C=E8=A7=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-universal_function.js | 11 +++++++++++ script.js | 24 +++++++++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/script-universal_function.js b/script-universal_function.js index 67005ac0..f40fb60b 100644 --- a/script-universal_function.js +++ b/script-universal_function.js @@ -179,6 +179,17 @@ function latentUseHole(latentId) return 1; } } +//获取最大潜觉数量 +function getMaxLatentCount(id) +{ //转生2和超转生3为8个格子 + if (Cards[id]) + { + return Cards[id].is8Latent ? 8 : 6; + }else + { + return 6; + } +} //计算用了多少潜觉格子 function usedHole(latents) { diff --git a/script.js b/script.js index 7614afd0..d84ef031 100644 --- a/script.js +++ b/script.js @@ -232,17 +232,6 @@ Formation.prototype.loadObj= function(f){ if (f.b) this.teams[0][2] = f.b; //原来模式的徽章 }; -//获取最大潜觉数量 -function getMaxLatentCount(id) -{ //转生2和超转生3为8个格子 - if (Cards[id]) - { - return Cards[id].is8Latent ? 8 : 6; - }else - { - return 6; - } -} //切换通用的切换className显示的函数 function toggleDomClassName(checkBox, className, checkedAdd = true, dom = document.body) { @@ -1832,7 +1821,7 @@ function refreshLatent(latent,monid,iconArr) for (let ai = 0; ai= usedHoleN) //有潜觉 + if (latent[latentIndex] != undefined && ai >= usedHoleN && ai < maxLatentCount) //有潜觉 { icon.setAttribute("data-latent-icon", latent[latentIndex]); icon.classList.remove(className_displayNone); @@ -2178,7 +2167,12 @@ function editBoxChangeMonId(id) btnDone.disabled = false; } } - editBox.latent.length = 0; + + const allKillerLatent = typekiller_for_type.map(type=>type.latent); + //去除所有不能再打的潜觉 + editBox.latent = editBox.latent.filter(lat=> + !allKillerLatent.includes(lat) || + allKillerLatent.includes(lat) && allowLatent.has(lat)); editBox.refreshLatent(editBox.latent,id); editBox.reCalculateExp(); editBox.reCalculateAbility(); @@ -2396,7 +2390,7 @@ function refreshTeamTotalHP(totalDom,team){ tHpDom.innerHTML = Math.round(tHP).toString() + (teamHPAwoken>0||badgeHPScale!=1 ? - ("("+Math.round(tHP * (1 + 0.05 * teamHPAwoken)*badgeHPScale).toString()+")") : + ("("+Math.round(Math.round(tHP * (1 + 0.05 * teamHPAwoken))*badgeHPScale).toString()+")") : ""); } if (tRcvDom) @@ -2417,7 +2411,7 @@ function refreshTeamTotalHP(totalDom,team){ tRcvDom.innerHTML = tRCV.toString() + (teamRCVAwoken>0||badgeRCVScale!=1 ? - ("("+Math.round(tRCV * (1 + 0.10 * teamRCVAwoken)*badgeRCVScale).toString()+")") : + ("("+Math.round(Math.round(tRCV * (1 + 0.10 * teamRCVAwoken))*badgeRCVScale).toString()+")") : ""); } }