From 2d5a39d4e74713fbd54e52d1040f02204803fd90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Sun, 20 Apr 2025 13:43:48 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=A7=A3=E5=86=B3=E6=8A=80=E8=83=BD=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=8D=A2=E9=98=9F=E9=95=BF=E5=90=8E=E7=94=9F=E8=82=96?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E9=94=99=E8=AF=AF=E7=9A=84bug=E3=80=82=202.?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=81=A2=E5=A4=8D=E8=A1=80=E9=87=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=8D=A0=E5=BD=93=E5=89=8D=E8=A1=80=E9=87=8F=E6=AF=94?= =?UTF-8?q?=E4=BE=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-universal_function.js | 19 ++++++++++--------- script.js | 13 ++++++++++--- service-worker.js | 6 +++--- style.css | 4 ++++ 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/script-universal_function.js b/script-universal_function.js index abd6e48b..f4b6182c 100644 --- a/script-universal_function.js +++ b/script-universal_function.js @@ -1688,25 +1688,26 @@ function tIf_Effect(leader1id, leader2id, leader1id_original,leader2id_original) inflicts: [0,0], }; const card1 = Cards[leader1id], card2 = Cards[leader2id]; - { //计算队伍是否为76 + const card1_original = henshinBase(leader1id_original), card2_original = henshinBase(leader2id_original); + { //计算队伍是否为76,判断初始队长+变身前 const searchTypeArray = [162, 186]; - effect.board76 = Boolean(getCardLeaderSkills(henshinBase(leader1id_original), searchTypeArray).length) || - Boolean(getCardLeaderSkills(henshinBase(leader2id_original), searchTypeArray).length); + effect.board76 = Boolean(getCardLeaderSkills(card1_original, searchTypeArray).length) || + Boolean(getCardLeaderSkills(card2_original, searchTypeArray).length); } { //计算队伍是否为无天降 const searchTypeArray = [163, 177]; - effect.noSkyfall = Boolean(getCardLeaderSkills(henshinBase(leader1id_original), searchTypeArray).length) || - Boolean(getCardLeaderSkills(henshinBase(leader2id_original), searchTypeArray).length); + effect.noSkyfall = Boolean(getCardLeaderSkills(card1, searchTypeArray).length) || + Boolean(getCardLeaderSkills(card2, searchTypeArray).length); } { //计算队伍是否为毒无效 const searchTypeArray = [197]; - effect.poisonNoEffect = Boolean(getCardLeaderSkills(henshinBase(leader1id_original), searchTypeArray).length) || - Boolean(getCardLeaderSkills(henshinBase(leader2id_original), searchTypeArray).length); + effect.poisonNoEffect = Boolean(getCardLeaderSkills(card1, searchTypeArray).length) || + Boolean(getCardLeaderSkills(card2, searchTypeArray).length); } { //计算队伍是否有根性 const searchTypeArray = [14]; - effect.resolve = Boolean(getCardLeaderSkills(henshinBase(leader1id_original), searchTypeArray).length) || - Boolean(getCardLeaderSkills(henshinBase(leader2id_original), searchTypeArray).length); + effect.resolve = Boolean(getCardLeaderSkills(card1, searchTypeArray).length) || + Boolean(getCardLeaderSkills(card2, searchTypeArray).length); } { //计算队伍的+C effect.addCombo[0] = getSkillAddCombo(card1); diff --git a/script.js b/script.js index 9b77c7b9..cc0e9cef 100644 --- a/script.js +++ b/script.js @@ -6642,7 +6642,8 @@ function refreshAll(formationData) { } const teamTotalInfoDom = teamBigBox.querySelector(".team-total-info"); //队伍能力值合计 - if (teamTotalInfoDom) refreshTeamTotalHP(teamTotalInfoDom, teamData, teamNum); + let teamHP = null; + if (teamTotalInfoDom) teamHP = refreshTeamTotalHP(teamTotalInfoDom, teamData, teamNum); const teamTotalInfoCountDom = teamBigBox.querySelector(".team-total-info-count"); //队伍星级、属性、类型合计 if (teamTotalInfoCountDom) refreshTeamTotalCount(teamTotalInfoCountDom, teamData, teamNum); @@ -6651,7 +6652,7 @@ function refreshAll(formationData) { if (teamAwokenDom) refreshTeamAwokenCount(teamAwokenDom, teamData); const teamAwokenEffectDom = teamBigBox.querySelector(".team-awoken-effect"); //队伍觉醒效果计算 - if (teamAwokenEffectDom) refreshTeamAwokenEfeect(teamAwokenEffectDom, teamData, teamNum); + if (teamAwokenEffectDom) refreshTeamAwokenEfeect(teamAwokenEffectDom, teamData, teamNum, { teamHP }); }); if (formationTotalInfoDom) refreshFormationTotalHP(formationTotalInfoDom, formation.teams); @@ -6710,7 +6711,7 @@ function refreshAll(formationData) { } //刷新队伍觉醒效果计算 -function refreshTeamAwokenEfeect(awokenEffectDom, team, ti) { +function refreshTeamAwokenEfeect(awokenEffectDom, team, ti, option) { const [members, assists, badge, swapId] = team; let targetIcon; //解析两个队长技 @@ -6780,6 +6781,9 @@ function refreshTeamAwokenEfeect(awokenEffectDom, team, ti) { } } targetValue.setAttribute(dataAttrName, count.bigNumberToString()); + if (option.teamHP) { + targetValue.setAttribute("data-percent", (Math.floor(count / option.teamHP.tHP * 1000) / 10)); + } } //颜色盾 @@ -7445,6 +7449,7 @@ function drawHpInfo(hpBarDom, reduceAttrRanges) function refreshTeamTotalHP(totalDom, team, teamIdx) { //计算总的生命值 if (!totalDom) return; + const outdata = {}; const tHpDom = totalDom.querySelector(".tIf-total-hp"); const tSBDom = totalDom.querySelector(".tIf-total-skill-boost"); const tMoveDom = totalDom.querySelector(".tIf-total-move"); @@ -7564,6 +7569,7 @@ function refreshTeamTotalHP(totalDom, team, teamIdx) { setTextContentAndAttribute(tHpDom_reduce.querySelector(".reduce-scale"), (totalReduce * 100).toFixed(2)); setTextContentAndAttribute(tHpDom_reduce.querySelector(".general"), tReduceHP.bigNumberToString({sub: true})); setTextContentAndAttribute(tHpDom_reduce.querySelector(".awoken-bind"), tReduceHPNoAwoken.bigNumberToString({sub: true})); + Object.assign(outdata,{tHP, tHPNoAwoken, totalReduce, tReduceHP, tReduceHPNoAwoken}); } if (tSBDom) { @@ -7599,6 +7605,7 @@ function refreshTeamTotalHP(totalDom, team, teamIdx) { if (badge == 22) effect.poisonNoEffect = true; refreshEffectDom(tEffectDom, effect); } + return outdata; } //刷新队伍能力值合计 function refreshTeamTotalCount(totalCountDom, team, teamIdx) { diff --git a/service-worker.js b/service-worker.js index 76317547..d82af3f1 100644 --- a/service-worker.js +++ b/service-worker.js @@ -47631,11 +47631,11 @@ const cachesMap = new Map([ ], [ "script-universal_function.js", - "d415679261b7c182cd1ecae2adb003a3" + "ecd23293d69eb2add579594e88c92208" ], [ "script.js", - "23c0f5bf5991b3b5d2f2b0073120567b" + "bebb03c768d5baa9072452e98515a853" ], [ "solo.html", @@ -47651,7 +47651,7 @@ const cachesMap = new Map([ ], [ "style.css", - "a6033f196d006d83c07fa431eb78d057" + "14b1c8955211c0a5e4ce0dbf30c25ee3" ], [ "temp.js", diff --git a/style.css b/style.css index 0b8d7aae..150d55f0 100644 --- a/style.css +++ b/style.css @@ -3372,6 +3372,10 @@ a.series-search::before { { content: attr(data-value)attr(data-postfix); } +.team-awoken-effect .count[data-value][data-percent]::after +{ + content: attr(data-value)attr(data-postfix)"("attr(data-percent)"%)"; +} .team-awoken-effect .prob[data-value]::before, .team-awoken-effect .orb-list .prob[data-value]::before {