From e27a135bdbe2b77dabddfc43031310e6c1bc977e 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, 17 Jan 2020 23:53:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script.js | 16 +++++++++++----- style.css | 2 +- universal_function.js | 8 ++++---- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/script.js b/script.js index ffc7ff64..d83f6985 100644 --- a/script.js +++ b/script.js @@ -45,7 +45,7 @@ Member.prototype.outObj = function(){ } if (m.latent != undefined && m.latent instanceof Array && m.latent.length>=1) obj[4] = m.latent; if (m.sawoken != undefined && m.sawoken>=0) obj[5] = m.sawoken; - const card = Cards[m.id]; //怪物固定数据 + const card = Cards[m.id] || Cards[0]; //怪物固定数据 const skill = Skills[card.activeSkillId]; //有技能等级,并且技能等级低于最大等级时才记录技能 if (m.skilllevel != undefined && m.skilllevel < skill.maxLevel) obj[6] = m.skilllevel; @@ -178,7 +178,13 @@ Formation.prototype.loadObj= function(f){ //获取最大潜觉数量 function getMaxLatentCount(id) { //转生2和超转生3为8个格子 - return Cards[id].is8Latent ? 8 : 6; + if (Cards[id]) + { + return Cards[id].is8Latent ? 8 : 6; + }else + { + return 6; + } } //切换怪物ID显示 function toggleShowMonId() @@ -902,7 +908,7 @@ function initialize() formation.team[editBox.memberIdx[0]][editBox.memberIdx[1]][editBox.memberIdx[2]] = mon; mon.id = parseInt(monstersID.value,10); - const card = Cards[mon.id]; + const card = Cards[mon.id] || Cards[0]; const skill = Skills[card.activeSkillId]; mon.level = parseInt(monEditLv.value,10); @@ -1172,8 +1178,8 @@ function changeid(mon,monDom,latentDom) const parentNode = monDom.parentNode; fragment.appendChild(monDom); const monId = mon.id; - const card = Cards[monId]; //怪物固定数据 - const skill = Skills[card.activeSkillId]; + const card = Cards[monId] || Cards[0]; //怪物固定数据 + //const skill = Skills[card.activeSkillId]; monDom.setAttribute("data-cardid", monId); //设定新的id if (monId<0) //如果是延迟 { diff --git a/style.css b/style.css index 58039ae1..94974446 100644 --- a/style.css +++ b/style.css @@ -94,7 +94,7 @@ ul{ .null .subproperty,.delay .subproperty { box-sizing: border-box; - background-image: none; + background-image: none !important; } .null .monster{ background-color: rgba(230,230,230,0.5); diff --git a/universal_function.js b/universal_function.js index d6ad1a1b..0ecd0971 100644 --- a/universal_function.js +++ b/universal_function.js @@ -99,19 +99,19 @@ function awokenCountInTeam(team,awokenIndex,solo) { var formationAwokenCount = team.reduce(function(tc,tm,isAssist){ var teamAwokenCount = tm.reduce(function(c,m){ - let Card = Cards[m.id]; + const Card = Cards[m.id] || Cards[0]; if (m.id<=0) { //如果是特殊情况的 return c; } - let cdAwoken = Card.awakenings; //这个怪物的觉醒数据 - let cdSAwoken = Card.superAwakenings; //这个怪物的超觉醒数据 + const cdAwoken = Card.awakenings; //这个怪物的觉醒数据 + const cdSAwoken = Card.superAwakenings; //这个怪物的超觉醒数据 if ((!cdAwoken && !cdSAwoken) || (isAssist && cdAwoken.indexOf(49)<0)) { //如果没有觉醒和超觉醒 || (如果是辅助队 &&第一个不是武器觉醒) return c; } //启用的觉醒数组片段 - let enableAwoken = cdAwoken.slice(0,m.awoken); + const enableAwoken = cdAwoken.slice(0,m.awoken); //相同的觉醒数 let hasAwoken = enableAwoken.filter(function(a){return a == awokenIndex;}).length; //如果是单人,有超觉醒,且超觉醒id和计数的id相同