From a96504ed9dbba8b632d6bad39fd81ddff419649e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Fri, 28 May 2021 14:53:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E8=A7=A3=E5=86=B3=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E7=9A=84=E7=BC=96=E5=8F=B7=E4=BC=9A=E4=B8=8D=E6=96=AD?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-universal_function.js | 10 ++++++---- script.js | 9 ++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/script-universal_function.js b/script-universal_function.js index 01e62320..696497ae 100644 --- a/script-universal_function.js +++ b/script-universal_function.js @@ -573,13 +573,13 @@ function getAllowLatent(card) { } //计算队伍中有多少血量 function countTeamHp(memberArr, leader1id, leader2id, solo, noAwoken = false) { - const ls1 = Skills[Cards[leader1id].leaderSkillId]; - const ls2 = Skills[Cards[leader2id].leaderSkillId]; + const ls1 = Skills[(Cards[leader1id] || Cards[0]).leaderSkillId]; + const ls2 = Skills[(Cards[leader2id] || Cards[0]).leaderSkillId]; const mHpArr = memberArr.map(m => { const ability = noAwoken ? m.abilityNoAwoken : m.ability; let hp = ability ? ability[0] : 0; if (!hp) return 0; - const card = Cards[m.id]; + const card = Cards[m.id] || Cards[0]; hp = hp1 = Math.round(hp * memberHpMul(card, ls2, memberArr, solo)); //战友队长技 hp = hp2 = Math.round(hp * memberHpMul(card, ls1, memberArr, solo)); //我方队长技 @@ -695,10 +695,12 @@ function countTeamHp(memberArr, leader1id, leader2id, solo, noAwoken = false) { //返回卡片的队长技能 function getCardLeaderSkills(card, skillTypes) { + if (!card) return []; return getActuallySkills(Skills[card.leaderSkillId], skillTypes, false); } //返回卡片的主动技能 function getCardActiveSkills(card, skillTypes) { + if (!card) return []; return getActuallySkills(Skills[card.activeSkillId], skillTypes, false); } //查找到真正起作用的那一个技能 @@ -726,7 +728,7 @@ function tIf_Effect_76board(leader1id, leader2id) { function henshinBase(cardid) { let card = Cards[cardid]; - if (card.henshinFrom) + if (card && card.henshinFrom) { card = Cards[card.henshinFrom]; } diff --git a/script.js b/script.js index 7edb5cd9..6a601d35 100644 --- a/script.js +++ b/script.js @@ -3194,13 +3194,16 @@ function refreshMenberAwoken(menberAwokenDom, assistAwokenDom, team, idx) { const memberData = team[0][idx]; const assistData = team[1][idx]; + + const memberCard = Cards[memberData.id] || Cards[0]; + const assistCard = Cards[assistData.id] || Cards[0]; //队员觉醒 - let menberAwokens = Cards[memberData.id].awakenings.slice(0,memberData.awoken); + let menberAwokens = memberCard.awakenings.slice(0,memberData.awoken); //单人和三人为队员增加超觉醒 - if ((solo || teamsCount === 3) && memberData.sawoken >= 0) menberAwokens.push(Cards[memberData.id].superAwakenings[memberData.sawoken]); + if ((solo || teamsCount === 3) && memberData.sawoken >= 0) menberAwokens.push(memberCard.superAwakenings[memberData.sawoken]); //menberAwokens.sort(); //武器觉醒 - let assistAwokens = Cards[assistData.id > 0 ? assistData.id : 0].awakenings.slice(0,assistData.awoken); + let assistAwokens = assistCard.awakenings.slice(0,assistData.awoken); if (!assistAwokens.includes(49)) assistAwokens = []; //清空非武器的觉醒 //assistAwokens.sort(); /*if (assistAwokens.includes(49))