diff --git a/languages/zh-CN.css b/languages/zh-CN.css index 8a3b75d7..fb7144b7 100644 --- a/languages/zh-CN.css +++ b/languages/zh-CN.css @@ -132,8 +132,11 @@ .edit-box .button-box .button-done.cant-assist::after{ content: "不能辅助"; } -.awoken-total-box::before{ - content: "觉醒总计:"; +.formation-awoken::before{ + content: "阵型觉醒总计:"; +} +.team-awoken::before{ + content: "队伍觉醒总计:"; } .type-name-4::after{ content: "龍"; @@ -204,10 +207,10 @@ .control-box .btn-show-mon-skill-cd::before{ content: "❄️显示已满技能冷却"; } -.team-info .tIf-total-hp::before{ +.tIf-total-hp::before{ content: "总HP(队伍觉醒和徽章):"; } -.team-info .tIf-total-rcv::before{ +.tIf-total-rcv::before{ content: "总回复(队伍觉醒和徽章):"; } diff --git a/multi.html b/multi.html index e134139f..daa7bb81 100644 --- a/multi.html +++ b/multi.html @@ -13,8 +13,8 @@ @@ -36,6 +36,7 @@ var formation = new Formation(teamsNumber,5);
+
-
+
    diff --git a/script.js b/script.js index 897e1ba9..10ce07ec 100644 --- a/script.js +++ b/script.js @@ -494,7 +494,7 @@ function initialize() { teamBadge.classList.remove(className_ChoseBadges); formation.badge = bidx; - refreshTotalAbility(formation.team[0]); + refreshTotalHP(formation.team[0]); creatNewUrl(); }else { @@ -941,7 +941,8 @@ function initialize() return; } let mon = editBox.isAssist?new MemberAssist():new MemberTeam(); - formation.team[editBox.memberIdx[0]][editBox.memberIdx[1]][editBox.memberIdx[2]] = mon; + const thisTeamData = formation.team[editBox.memberIdx[0]]; + thisTeamData[editBox.memberIdx[1]][editBox.memberIdx[2]] = mon; mon.id = parseInt(monstersID.value,10); const card = Cards[mon.id] || Cards[0]; @@ -987,20 +988,25 @@ function initialize() } changeid(mon,editBox.monsterHead,editBox.memberIdx[1] ? null : editBox.latentBox); - const formationAbilityDom = document.querySelector(".formation-box .formation-ability"); - if (formationAbilityDom) + const thisTeamData = formation.team[editBox.memberIdx[0]]; + const thisTeamBBDom = teamBigBoxs[editBox.memberIdx[0]]; + const teamAbilityDom = thisTeamBBDom.querySelector(".team-ability"); + if (teamAbilityDom) { refreshAbility( - formationAbilityDom, + teamAbilityDom, formation.team[editBox.memberIdx[0]], editBox.memberIdx[2]); - refreshTotalAbility(formation.team[editBox.memberIdx[0]]); + const teamTotalInfoDom = thisTeamBBDom.querySelector(".team-total-info"); + if (teamTotalInfoDom) refreshTeamTotalHP(teamTotalInfoDom,thisTeamData); + formation-total-info + refreshTeamTotalHP(formation.team[editBox.memberIdx[0]]); } refreshAwokenCount(formation.team); //刷新改队员的CD const teamDom = document.querySelector(".formation-box .formation-" + (editBox.memberIdx[0]?"B":"A") + "-box"); - refreshSkillCD(teamDom,formation.team[editBox.memberIdx[0]],editBox.memberIdx[2]); + refreshMemberSkillCD(teamDom,formation.team[editBox.memberIdx[0]],editBox.memberIdx[2]); creatNewUrl(); editBox.hide(); }; @@ -1023,7 +1029,7 @@ function initialize() formationAbilityDom, formation.team[editBox.memberIdx[0]], editBox.memberIdx[2]); - refreshTotalAbility(formation.team[editBox.memberIdx[0]]); + refreshTotalHP(formation.team[editBox.memberIdx[0]]); } refreshAwokenCount(formation.team); creatNewUrl(); @@ -1039,7 +1045,7 @@ function initialize() formationAbilityDom, formation.team[editBox.memberIdx[0]], editBox.memberIdx[2]); - refreshTotalAbility(formation.team[editBox.memberIdx[0]]); + refreshTotalHP(formation.team[editBox.memberIdx[0]]); } refreshAwokenCount(formation.team); creatNewUrl(); @@ -1686,69 +1692,103 @@ function searchColla(collabId) //刷新整个队伍 function refreshAll(formationData){ let fragment = document.createDocumentFragment(); //创建节点用的临时空间 - const formationBox = document.querySelector(".formation-box"); const titleBox = fragment.appendChild(formationBox.querySelector(".title-box")); - const formationA_bigbox = fragment.appendChild(formationBox.querySelector(".formation-A-bigbox")); - const formationB_bigbox = formationBox.querySelector(".formation-B-bigbox"); - if (formationB_bigbox) - {fragment.appendChild(formationB_bigbox);} - const awokenTotalBox = fragment.appendChild(formationBox.querySelector(".awoken-total-box")); - const detailBox = fragment.appendChild(formationBox.querySelector(".detail-box")); + const awokenTotalBox = formationBox.querySelector(".awoken-total-box"); + const detailBox = formationBox.querySelector(".detail-box"); + + for (let ni=0; ni < formationBox.childNodes.length; ni++) + { + fragment.appendChild(formationBox.childNodes[ni]); + } const txtTitle = titleBox.querySelector(".title"); const txtDetail = detailBox.querySelector(".detail"); txtTitle.value = formationData.title || ""; txtDetail.value = formationData.detail || ""; - const badges = Array.prototype.slice.call(formationA_bigbox.querySelectorAll(".formation-badge .badge-bg")); - badges.forEach((b,idx)=>{ - if (idx==formationData.badge) - { - b.classList.remove("display-none"); - }else + teamBigBoxs.forEach((teamBigBox,teamNum)=>{ + const badgeBox = teamBigBox.querySelector(".team-badge"); + //const badges = Array.prototype.slice.call(badgeBox.querySelectorAll(".badge-radio")); + const badge = badgeBox.querySelector(`#team-${teamNum}-badge-${formationData.badge}`); + badge.checked = true; + }); + + teamBoxs.forEach((teamBox,teamNum)=>{ + const members = teamBox.querySelectorAll(".team-members .monster"); + const latents = teamBox.querySelectorAll(".team-latents .latent-ul"); + const assist = teamBox.querySelectorAll(".team-assist .monster"); + const teamAbilityDom = teamBox.querySelector(".team-ability"); + for (let ti=0;ti=0) //属于大觉醒 { - changeid(formationData.team[1][0][ti],fBTeam[ti],fBLatents[ti]); - changeid(formationData.team[1][1][ti],fBAssist[ti]); - refreshSkillCD(formationB,formationData.team[1],ti); + continue; + }else + { + setCount(ai,awokenCountInFormation(teams,ai,solo)); } } - formationBox.appendChild(fragment); - refreshTotalAbility(formationData.team[0]); - refreshAwokenCount(formationData.team); - txtDetail.onblur(); //这个需要放在显示出来后再改才能生效 + awokenTotalBox.appendChild(awokenUL); } -//刷新觉醒总计 -function refreshAwokenCount(teams){ +//刷新几个队伍觉醒统计 +function refreshFormationAwokenCount(teams){ let fragment = document.createDocumentFragment(); //创建节点用的临时空间 const awokenTotalBox = formationBox.querySelector(".awoken-total-box"); const awokenUL = fragment.appendChild(awokenTotalBox.querySelector(".awoken-ul")); @@ -1831,11 +1871,10 @@ function refreshAbility(abilityDom,team,idx){ } }); } -//刷新能力值合计 -function refreshTotalAbility(team){ +//刷新队伍能力值合计 +function refreshTeamTotalHP(totalDom,team){ //计算总的生命值 - const formationBox = document.querySelector(".formation-box"); - const teamInfo = formationBox.querySelector(".team-info"); + const teamInfo = formationBox.querySelector(".team-total-info"); if (!teamInfo) return; const tHpDom = teamInfo.querySelector(".tIf-total-hp"); const tRcvDom = teamInfo.querySelector(".tIf-total-rcv"); @@ -1874,11 +1913,10 @@ function refreshTotalAbility(team){ ("("+Math.round(tRCV * (1 + 0.10 * teamRCVAwoken)*badgeRCVScale).toString()+")") : ""); } -//刷新能力值合计 -function refreshTotalAbility(team){ +//刷新所有队伍能力值合计 +function refreshFormationTotalHP(teams){ //计算总的生命值 - const formationBox = document.querySelector(".formation-box"); - const teamInfo = formationBox.querySelector(".team-info"); + const teamInfo = formationBox.querySelector(".team-total-info"); if (!teamInfo) return; const tHpDom = teamInfo.querySelector(".tIf-total-hp"); const tRcvDom = teamInfo.querySelector(".tIf-total-rcv"); @@ -1917,10 +1955,10 @@ function refreshTotalAbility(team){ ("("+Math.round(tRCV * (1 + 0.10 * teamRCVAwoken)*badgeRCVScale).toString()+")") : ""); } -//刷新技能CD -function refreshSkillCD(teamDom,team,idx){ - const memberMonDom = teamDom.querySelector(".formation-team .member-" + (idx+1) + " .monster"); - const assistMonDom = teamDom.querySelector(".formation-assist .member-" + (idx+1) + " .monster"); +//刷新单人技能CD +function refreshMemberSkillCD(teamDom,team,idx){ + const memberMonDom = teamDom.querySelector(`.team-members .member-${idx+1} .monster`); + const assistMonDom = teamDom.querySelector(`.team-assist .member-${idx+1} .monster`); const member = team[0][idx]; const assist = team[1][idx]; diff --git a/solo.html b/solo.html index 15cdecf0..f0ebbbc8 100644 --- a/solo.html +++ b/solo.html @@ -13,8 +13,8 @@