Browse Source

修复大U不点亮潜觉的问题

tags/v30.2
枫谷剑仙 3 years ago
parent
commit
6c795df7d7
2 changed files with 18 additions and 4 deletions
  1. +17
    -3
      script.js
  2. +1
    -1
      service-worker.js

+ 17
- 3
script.js View File

@@ -4545,6 +4545,7 @@ function refreshLatent(latents, member, latentsNode, option) {
latentsNode.classList.toggle("block-8", maxLatentCount>6);
latents = latents.concat();
if (option?.sort) latents.sort((a, b) => latentUseHole(b) - latentUseHole(a));
//如果传入了辅助,才进行有效觉醒的计算,否则算作只有本人的。
let effectiveAwokens = option?.assist instanceof Member ? member.effectiveAwokens(option.assist) : null;
let latentIndex = 0, usedHoleN = 0;
//如果传入了武器,就添加有效觉醒
@@ -4556,9 +4557,22 @@ function refreshLatent(latents, member, latentsNode, option) {
icon.setAttribute("data-latent-icon", latent);
icon.setAttribute("data-latent-hole", thisHoleN);
let enableLatent = true;
if (effectiveAwokens) {
let obj = allowable_latent.needAwoken.find(obj=>obj.latent == latent);
if (obj && !effectiveAwokens.includes(obj.awoken)) enableLatent = false;
//搜索需要觉醒的潜觉
if (effectiveAwokens) { //如果有有效觉醒,说明需要计算辅助,否则在单人编辑状态是不需要判断是否需要觉醒的
let needAwokenLatent = allowable_latent.needAwoken.find(obj=>obj.latent == latent);
if (needAwokenLatent) { //如果是需要觉醒的潜觉
let needAwokens = new Set([needAwokenLatent.awoken]);
equivalent_awoken.forEach(obj=>{
//如果搜索到等效觉醒,把大小值都添加到需要的觉醒
if (obj.small === needAwokenLatent.awoken || obj.big === needAwokenLatent.awoken) {
needAwokens.add(obj.small);
needAwokens.add(obj.big);
}
});
//如果需要的觉醒,在有效觉醒里全都没有
if ([...needAwokens].every(ak=>!effectiveAwokens.includes(ak)))
enableLatent = false;
}
}
icon.classList.toggle('unallowable-latent', !enableLatent);
usedHoleN += thisHoleN;


+ 1
- 1
service-worker.js View File

@@ -8071,7 +8071,7 @@ const cachesMap = new Map([
],
[
"script.js",
"e7baa9224af3134c62a8b62e19d12197"
"a4090df41cf38ae6903771338aa84ac1"
],
[
"solo.html",


Loading…
Cancel
Save