Browse Source

修复一些bug

tags/v8.0
枫谷剑仙 6 years ago
parent
commit
e27a135bdb
3 changed files with 16 additions and 10 deletions
  1. +11
    -5
      script.js
  2. +1
    -1
      style.css
  3. +4
    -4
      universal_function.js

+ 11
- 5
script.js View File

@@ -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) //如果是延迟
{


+ 1
- 1
style.css View File

@@ -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);


+ 4
- 4
universal_function.js View File

@@ -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相同


Loading…
Cancel
Save