diff --git a/multi.html b/multi.html index 754f63ff..6bce586f 100644 --- a/multi.html +++ b/multi.html @@ -496,7 +496,6 @@ var formation = new Formation(teamsCount,5);
- @@ -504,6 +503,7 @@ var formation = new Formation(teamsCount,5); + diff --git a/script-universal_function.js b/script-universal_function.js index 0e4f0a67..dd838489 100644 --- a/script-universal_function.js +++ b/script-universal_function.js @@ -158,22 +158,20 @@ fetch("library/jy4340132-aaa/adpcm.wasm").then((response) => response.arrayBuffe //▲ADPCM播放相关 //计算用了多少潜觉格子 -function usedHole(latent) +function usedHole(latents) { - return latent.reduce(function(previous,current){ - return previous + (current>= 12?2:1); //12号以后都是2格的潜觉 - },0); + return latents.reduce((usedHole, latentId) => usedHole + (latentId>= 12 ? 2 : 1), 0); //12号以后都是2格的潜觉 } //计算所有队伍中有多少个该觉醒 -function awokenCountInFormation(formationTeams,awokenIndex,solo) +function awokenCountInFormation(formationTeams,awokenIndex,solo,teamsCount) { const formationAwokenCount = formationTeams.reduce(function(previous,team){ - return previous + awokenCountInTeam(team,awokenIndex,solo); + return previous + awokenCountInTeam(team,awokenIndex,solo,teamsCount); },0); return formationAwokenCount; } //计算单个队伍中有多少个该觉醒 -function awokenCountInTeam(team,awokenIndex,solo) +function awokenCountInTeam(team,awokenIndex,solo,teamsCount) { const memberArray = team[0]; const assistArray = team[1]; @@ -193,7 +191,7 @@ function awokenCountInTeam(team,awokenIndex,solo) const assistCard = Cards[assist.id]; //启用的觉醒数组片段 let enableAwoken = card.awakenings.slice(0, mon.awoken); - if (solo) //单人增加超觉醒 + if (solo || (teamsCount === 3 && currentDataSource.code === 'ja')) //单人、3人日服增加超觉醒 { enableAwoken = enableAwoken.concat(card.superAwakenings[mon.sawoken]); } diff --git a/script.js b/script.js index c90ae872..0de283fa 100644 --- a/script.js +++ b/script.js @@ -2168,8 +2168,8 @@ function refreshTeamAwokenCount(awokenDom,team){ const equivalentAwoken = equivalent_awoken[equalIndex]; if (equivalentAwoken.small === ai) { - const totalNum = awokenCountInTeam(team, equivalentAwoken.small, solo) + - awokenCountInTeam(team, equivalentAwoken.big, solo) * equivalentAwoken.times; + const totalNum = awokenCountInTeam(team, equivalentAwoken.small, solo, teamsCount) + + awokenCountInTeam(team, equivalentAwoken.big, solo, teamsCount) * equivalentAwoken.times; setCount(aicon, totalNum); }else { @@ -2177,7 +2177,7 @@ function refreshTeamAwokenCount(awokenDom,team){ } }else { - setCount(aicon,awokenCountInTeam(team,ai,solo)); + setCount(aicon,awokenCountInTeam(team,ai,solo, teamsCount)); } } awokenDom.appendChild(fragment); @@ -2208,8 +2208,8 @@ function refreshFormationAwokenCount(awokenDom,teams){ const equivalentAwoken = equivalent_awoken[equalIndex]; if (equivalentAwoken.small === ai) { - const totalNum = awokenCountInFormation(teams, equivalentAwoken.small, solo) + - awokenCountInFormation(teams, equivalentAwoken.big, solo) * equivalentAwoken.times; + const totalNum = awokenCountInFormation(teams, equivalentAwoken.small, solo, teamsCount) + + awokenCountInFormation(teams, equivalentAwoken.big, solo, teamsCount) * equivalentAwoken.times; setCount(aicon, totalNum); }else { @@ -2217,7 +2217,7 @@ function refreshFormationAwokenCount(awokenDom,teams){ } }else { - setCount(aicon,awokenCountInFormation(teams,ai,solo)); + setCount(aicon,awokenCountInFormation(teams,ai,solo, teamsCount)); } } awokenDom.appendChild(fragment); @@ -2264,7 +2264,7 @@ function refreshTeamTotalHP(totalDom,team){ const tHP = team[0].reduce(function(value,mon){ //队伍计算的总HP return value += mon.ability ? mon.ability[0] : 0; },0); - const teamHPAwoken = awokenCountInTeam(team,46,solo); //全队大血包个数 + const teamHPAwoken = awokenCountInTeam(team,46,solo, teamsCount); //全队大血包个数 let badgeHPScale = 1; //徽章倍率 if (formation.badge == 4 && solo) @@ -2285,7 +2285,7 @@ function refreshTeamTotalHP(totalDom,team){ const tRCV = team[0].reduce(function(value,mon){ //队伍计算的总回复 return value += mon.ability ? mon.ability[2] : 0; },0); - const teamRCVAwoken = awokenCountInTeam(team,47,solo); //全队大回复个数 + const teamRCVAwoken = awokenCountInTeam(team,47,solo, teamsCount); //全队大回复个数 let badgeRCVScale = 1; //徽章倍率 if (formation.badge == 3 && solo) @@ -2315,7 +2315,7 @@ function refreshFormationTotalHP(totalDom, teams){ const teamTHP = team[0].reduce(function(value,mon){ //队伍计算的总HP return value += mon.ability ? mon.ability[0] : 0; },0); - const teamHPAwoken = awokenCountInTeam(team,46,solo); //全队大血包个数 + const teamHPAwoken = awokenCountInTeam(team,46,solo, teamsCount); //全队大血包个数 return [teamTHP,teamHPAwoken]; }); const tHP = tHPArr.reduce(function(value, teamHP){ @@ -2331,7 +2331,7 @@ function refreshFormationTotalHP(totalDom, teams){ const teamTRCV = team[0].reduce(function(value,mon){ //队伍计算的总回复 return value += mon.ability ? mon.ability[2] : 0; },0); - const teamRCVAwoken = awokenCountInTeam(team,47,solo); //全队大回复个数 + const teamRCVAwoken = awokenCountInTeam(team,47,solo, teamsCount); //全队大回复个数 return [teamTRCV,teamRCVAwoken]; },0); const tRCV = tRCVArr.reduce(function(value, teamRCV){ diff --git a/solo.html b/solo.html index fbc8446c..3b485e15 100644 --- a/solo.html +++ b/solo.html @@ -448,7 +448,6 @@ var formation = new Formation(teamsCount,6); - @@ -456,6 +455,7 @@ var formation = new Formation(teamsCount,6); + diff --git a/triple.html b/triple.html index a381e2dd..72edfb17 100644 --- a/triple.html +++ b/triple.html @@ -1083,7 +1083,6 @@ var formation = new Formation(teamsCount,6); - @@ -1091,6 +1090,7 @@ var formation = new Formation(teamsCount,6); +