diff --git a/README.md b/README.md index 74f3328d..f7d30557 100644 --- a/README.md +++ b/README.md @@ -41,14 +41,20 @@ Copy the URL directly to share the Formation, or add a Bookmark to archives. You * 使用后退即可撤销上一次修改 Use back to undo the last edit ![撤銷修改](document/tips-undo.png) +* 拖拽怪物头像即可快速切换位置 +Drag monster avatars to quickly switch positions +![切换位置](document/tips-interchangeCard.png) * 点击编辑界面的怪物头像可以跳转到攻略网站 Click on the monster avatar in the editing interface to jump to the Guide. -![攻略網站](document/tips-guide.png) +![攻略网站](document/tips-guide.png) +在队伍界面的怪物头像上点击鼠标中键也可以跳转到攻略网站 +Or click the middle mouse button on the monster avatar of the formation interface to jump to the Guide. +![攻略网站2](document/tips-guide2.png) * 可以在编辑界面的怪物ID输入怪物名称来搜索怪物 You can search for monsters by entering the monster name in the monster ID of the editing interface. ![搜索怪物](document/tips-search.png) -* 车队模式只显示部分杀潜觉以及共用的觉醒的统计,单人则全部显示。 -2-Player Multi Games Mode only show the killer latent and several common awoken statistics, but solo mode shows all. +* 车队模式只显示部分共用的觉醒的统计,单人则全部显示。 +2-Player Multi Games Mode only show several common awoken statistics, but solo mode shows all. # 翻译我 | TRANSLATE ME ## How to **Pull requests** diff --git a/images/cards_ja/README.md b/images/README.md similarity index 100% rename from images/cards_ja/README.md rename to images/README.md diff --git a/images/cards_en/CARDS_050.PNG b/images/cards_en/CARDS_050.PNG index ba20a68a..27386bea 100644 Binary files a/images/cards_en/CARDS_050.PNG and b/images/cards_en/CARDS_050.PNG differ diff --git a/images/cards_en/CARDS_054.PNG b/images/cards_en/CARDS_054.PNG index a870e274..793b41b6 100644 Binary files a/images/cards_en/CARDS_054.PNG and b/images/cards_en/CARDS_054.PNG differ diff --git a/images/cards_en/CARDS_057.PNG b/images/cards_en/CARDS_057.PNG index 22b5c7cb..5ca0eee3 100644 Binary files a/images/cards_en/CARDS_057.PNG and b/images/cards_en/CARDS_057.PNG differ diff --git a/images/cards_en/CARDS_058.PNG b/images/cards_en/CARDS_058.PNG new file mode 100644 index 00000000..c57cde84 Binary files /dev/null and b/images/cards_en/CARDS_058.PNG differ diff --git a/images/cards_ja/CARDS_057.PNG b/images/cards_ja/CARDS_057.PNG index 85116412..29e4e31f 100644 Binary files a/images/cards_ja/CARDS_057.PNG and b/images/cards_ja/CARDS_057.PNG differ diff --git a/images/cards_ja/CARDS_058.PNG b/images/cards_ja/CARDS_058.PNG index 54cc8a30..21efc2e7 100644 Binary files a/images/cards_ja/CARDS_058.PNG and b/images/cards_ja/CARDS_058.PNG differ diff --git a/images/cards_ja/CARDS_059.PNG b/images/cards_ja/CARDS_059.PNG new file mode 100644 index 00000000..2f75c92e Binary files /dev/null and b/images/cards_ja/CARDS_059.PNG differ diff --git a/images/cards_ko/CARDS_050.PNG b/images/cards_ko/CARDS_050.PNG index 65122078..26e64a83 100644 Binary files a/images/cards_ko/CARDS_050.PNG and b/images/cards_ko/CARDS_050.PNG differ diff --git a/images/cards_ko/CARDS_054.PNG b/images/cards_ko/CARDS_054.PNG index a870e274..793b41b6 100644 Binary files a/images/cards_ko/CARDS_054.PNG and b/images/cards_ko/CARDS_054.PNG differ diff --git a/images/cards_ko/CARDS_057.PNG b/images/cards_ko/CARDS_057.PNG index 22b5c7cb..5ca0eee3 100644 Binary files a/images/cards_ko/CARDS_057.PNG and b/images/cards_ko/CARDS_057.PNG differ diff --git a/images/cards_ko/CARDS_058.PNG b/images/cards_ko/CARDS_058.PNG new file mode 100644 index 00000000..c57cde84 Binary files /dev/null and b/images/cards_ko/CARDS_058.PNG differ diff --git a/monsters-info/extractByNode.js b/monsters-info/extractByNode.js index 92afdc29..0899c077 100644 --- a/monsters-info/extractByNode.js +++ b/monsters-info/extractByNode.js @@ -150,19 +150,59 @@ for (let li = 0;li < officialAPI.length; li++) { let otherLangs = officialAPI.concat(); //复制一份原始数组,储存其他语言 let lang = otherLangs.splice(li,1)[0]; //删掉并取得当前的语言 - let monCard = lang.cards //储存输出内容 - for (let mi=0; mi=671 && mi<= 680) || + (!langIsJa && mi>=1049 && mi<= 1058): + //神罗 日服 671-680 等于英韩服 1049-1058 + diff = 378; + break; + case (langIsJa && mi>=669 && mi<= 670) || + (!langIsJa && mi>=934 && mi<= 935): + //神罗 日服 669-670 等于英韩服 934-935 + diff = 265; + break; + case (langIsJa && mi>=924 && mi<= 935) || + (!langIsJa && mi>=669 && mi<= 680): + //蝙蝠侠 日服 924-935 等于英韩服 669-680 + diff = -255; + break; + case (langIsJa && mi>=1049 && mi<= 1058) || + (!langIsJa && mi>=924 && mi<= 933): + //蝙蝠侠 日服 1049-1058 等于英韩服 924-933 + diff = -125; + break; + } + if (diff != 0) + { + _m = langIsJa ? otLang.cards[mi + diff] : otLang.cards[mi - diff]; + isSame = true; + } + } + if (_m && isSame) //如果有这个怪物,且与原语言怪物是同一只 + { + let otName = _m.name; if (!/^\*+/.test(name) && //名字不是星号开头 !/^\*+/.test(otName) && //另一个语言名字不是星号开头 !/^\?+/.test(name) && //名字不是问号开头 diff --git a/monsters-info/official-API/test-mon.html b/monsters-info/official-API/test-mon.html index f9442e69..6bd69eb1 100644 --- a/monsters-info/official-API/test-mon.html +++ b/monsters-info/official-API/test-mon.html @@ -95,7 +95,11 @@ function parseCard(data) { card.collabId = data[i++]; //合作ID const flags = data[i++]; //一个旗子? card.unk08 = flags; //未知08 - card.canAssist = (flags & 1) !== 0; //是否能当二技 + card.canAssist = (flags & parseInt("1",2)) !== 0; //是否能当二技 + card.enabled = (flags & parseInt("10",2)) !== 0; //是否已启用 + card.overlay = card.types.some(t => { //这步还是猜测,是否能合并 + return t == 0 || t == 12 || t == 14; //0進化用;12能力覺醒用;14強化合成用;15販賣用 + }) && (flags & parseInt("1000",2)) === 0; //進化用、能力覺醒用、強化合成用,且flag有1000时 card.altName = data[i++]; //替换名字 card.limitBreakIncr = data[i++]; //110级增长 card.unk08 = data[i++]; //未知08 @@ -137,7 +141,7 @@ function g(id) m[58+m[57]*3], //觉醒数 m[14]+"-"+m[15]+"/"+m[17]+"-"+m[18]+"/"+m[20]+"-"+m[21], //三维 m[superAwokenIdx+9], //110级增长 - m[superAwokenIdx+7]>2?"能":"不能", //二技 + m[superAwokenIdx+7] & 1?"能":"不能", //二技 Math.round(m[11]/4), //1级经验,每级,直接乘 Math.round(m[13]/10), //1级卖钱 m[superAwokenIdx+4], //MP @@ -186,6 +190,6 @@ window.onload = function() mid = document.querySelector("#mid"); } - + diff --git a/multi.html b/multi.html index 9529ab81..73b186df 100644 --- a/multi.html +++ b/multi.html @@ -35,7 +35,7 @@ var formation = new Formation(2,5);
  • @@ -104,6 +106,8 @@ var formation = new Formation(2,5);
  • +
  • +
  • @@ -114,6 +118,8 @@ var formation = new Formation(2,5);
  • +
  • +
  • @@ -124,6 +130,8 @@ var formation = new Formation(2,5);
  • +
  • +
  • @@ -134,12 +142,14 @@ var formation = new Formation(2,5);
  • +
  • +
  • @@ -284,6 +298,8 @@ var formation = new Formation(2,5);
  • +
  • +
  • @@ -294,6 +310,8 @@ var formation = new Formation(2,5);
  • +
  • +
  • @@ -304,12 +322,14 @@ var formation = new Formation(2,5);
  • +
  • +
    • diff --git a/script.js b/script.js index 7157aa92..d8232a46 100644 --- a/script.js +++ b/script.js @@ -14,6 +14,10 @@ const dataSourceList = [ //几个不同的游戏服务区 source:"퍼즐앤드래곤" }, ]; +var cardInterchange = { //记录DOM交换 + from:null, + to:null +}; //队员基本的留空 var Member = function(){ this.id=0; @@ -58,6 +62,16 @@ var MemberAssist = function(){ } MemberAssist.prototype = Object.create(Member.prototype); MemberAssist.prototype.constructor = MemberAssist +MemberAssist.prototype.loadFromMember = function(m){ + if (m == undefined) //如果没有提供数据,直接返回默认 + { + return; + } + this.id = m.id; + if (m.level != undefined) this.level = m.level; + if (m.awoken != undefined) this.awoken = m.awoken; + if (m.plus != undefined && m.plus instanceof Array && m.plus.length>=3 && (m.plus[0]+m.plus[1]+m.plus[2])>0) this.plus = m.plus; +} //正式队伍 var MemberTeam = function(){ this.latent = []; @@ -67,6 +81,19 @@ var MemberTeam = function(){ } MemberTeam.prototype = Object.create(MemberAssist.prototype); MemberTeam.prototype.constructor = MemberTeam; +MemberTeam.prototype.loadFromMember = function(m){ + if (m == undefined) //如果没有提供数据,直接返回默认 + { + return; + } + this.id = m.id; + if (m.level != undefined) this.level = m.level; + if (m.awoken != undefined) this.awoken = m.awoken; + if (m.plus != undefined && m.plus instanceof Array && m.plus.length>=3 && (m.plus[0]+m.plus[1]+m.plus[2])>0) this.plus = m.plus; + if (m.latent != undefined && m.latent instanceof Array && m.latent.length>=1) this.latent = m.latent; + if (m.sawoken != undefined) this.sawoken = m.sawoken; + if (m.ability != undefined && m.ability instanceof Array && m.plus.length>=3) this.ability = m.ability; +} var Formation = function(teamCount,memberCount){ this.title = "", @@ -115,6 +142,17 @@ Formation.prototype.loadObj= function(f){ }) }); } +//获取最大潜觉数量 +function getMaxLatentCount(id) +{ //转生2和超转生3为8个格子 + function is8Latent(id) + { + let m = ms[id] || ms[0],mEvoType = m.evoType; + if (mEvoType == 2 || mEvoType == 3 || mEvoType==21){return true;} + return false; + } + return is8Latent(id) ? 8 : 6; +} //创建一个新的怪物头像 function createCardHead(id) { @@ -335,7 +373,44 @@ function initialize() //队伍框 var formationBox = document.querySelector(".formation-box"); formationBox.formation = formation; + + var formationA = formationBox.querySelector(".formation-box .formation-A-box"); + var formationB = formationBox.querySelector(".formation-box .formation-B-box"); + var fATeam = formationA.querySelectorAll(".formation-team .monster"); + var fAAssist = formationA.querySelectorAll(".formation-assist .monster"); + if (formationB) + { + var fBTeam = formationB.querySelectorAll(".formation-team .monster"); + var fBAssist = formationB.querySelectorAll(".formation-assist .monster"); + } + for (var ti=0;ti= 12 && usedHoleN<=4) + let maxLatentCount = getMaxLatentCount(editBox.mid); //最大潜觉数量 + if (lIdx >= 12 && usedHoleN<=(maxLatentCount-2)) editBox.latent.push(lIdx); - else if (lIdx < 12 && usedHoleN<=5) + else if (lIdx < 12 && usedHoleN<=(maxLatentCount-1)) editBox.latent.push(lIdx); editBox.reCalculateAbility(); - editBox.refreshLatent(editBox.latent); + editBox.refreshLatent(editBox.latent,editBox.mid); } }) @@ -692,6 +769,72 @@ function initialize() languageJS.type = "text/javascript"; languageJS.src = "languages/"+currentLanguage.i18n+".js"; } +//编辑界面点击每个怪物的头像的处理 +function clickMonHead() +{ + let team = parseInt(this.getAttribute("data-team"),10); + let assist = parseInt(this.getAttribute("data-assist"),10); + let index = parseInt(this.getAttribute("data-index"),10); + editMon(team,assist,index); + return false; //没有false将会打开链接 +} +//编辑界面每个怪物的头像的拖动 +function dragStartMonHead(e) +{ + let team = parseInt(this.getAttribute("data-team"),10); + let assist = parseInt(this.getAttribute("data-assist"),10); + let index = parseInt(this.getAttribute("data-index"),10); + e.dataTransfer.setData('from',[team,assist,index].join(",")); +} +//编辑界面每个怪物的头像的经过,阻止事件发生 +function dropOverMonHead(e) +{ + e.preventDefault(); +} +//编辑界面每个怪物的头像的放下 +function dropMonHead(e) +{ + let dataFrom = e.dataTransfer.getData('from').split(",").map((i)=>{return parseInt(i,10);}); + let team = parseInt(this.getAttribute("data-team"),10); + let assist = parseInt(this.getAttribute("data-assist"),10); + let index = parseInt(this.getAttribute("data-index"),10); + let dataTo = [team,assist,index]; + + if ((dataTo[0] != dataFrom[0]) + || (dataTo[1] != dataFrom[1]) + || (dataTo[2] != dataFrom[2])) + { //必须有所不同才继续交换 + interchangeCard(dataFrom,dataTo); + } + return false; //没有false将会打开链接 +} +function interchangeCard(formArr,toArr) +{ + function changeType(member,isAssist) + { + if (member.id == 0 || (isAssist && member.id == -1)) + { + return new Member; + }else + { + let newMember = isAssist ? new MemberTeam() : new MemberAssist(); + newMember.loadFromMember(member); + return newMember; + } + } + let from = formation.team[formArr[0]][formArr[1]][formArr[2]]; + let to = formation.team[toArr[0]][toArr[1]][toArr[2]]; + if(formArr[1] != toArr[1]) //从武器拖到非武器才改变类型 + { + from = changeType(from,formArr[1]); + to = changeType(to,toArr[1]); + } + formation.team[toArr[0]][toArr[1]][toArr[2]] = from; + formation.team[formArr[0]][formArr[1]][formArr[2]] = to; + + creatNewUrl(); //刷新URL + refreshAll(formation); //刷新全部 +} //改变一个怪物头像 function changeid(mon,monDom,latentDom) { @@ -816,20 +959,25 @@ function changeid(mon,monDom,latentDom) } if (latentDom && mon.latent) //如果提供了潜觉 { - var latent = mon.latent.sort(function(a,b){return b-a;}); + var latent = mon.latent.sort(function(a,b){ + if(b>=12 && a<12) {return 1;} //如果大于12,就排到前面 + else if(b<12 && a>=12) {return -1} //如果小于12就排到后面 + else {return 0} //其他情况不变 + }); if (latent.length < 1) latentDom.classList.add("display-none"); else latentDom.classList.remove("display-none"); var latentDoms = Array.prototype.slice.call(latentDom.querySelectorAll("li")); var usedHoleN = usedHole(latent); - for (var ai=0;ai<6;ai++) + let maxLatentCount = getMaxLatentCount(mon.id); //最大潜觉数量 + for (var ai=0;ai 0 && Cards[mainMD.id].ppt[0]==Cards[assistMD.id].ppt[0]) + let mainCard = ms[mainMD.id] || ms[0]; + let assistCard = ms[assistMD.id] || ms[0]; + var assistAbility = (assistMD.id > 0 && mainCard.attrs[0]==assistCard.attrs[0]) ?calculateAbility(assistMD.id,assistMD.level,assistMD.plus,null,null) :[0,0,0]; if (mainAbility && mainMD.ability) diff --git a/solo.html b/solo.html index 92507b1d..05b74ab6 100644 --- a/solo.html +++ b/solo.html @@ -56,7 +56,7 @@ var formation = new Formation(1,6);
  • @@ -135,6 +137,8 @@ var formation = new Formation(1,6);
  • +
  • +
  • @@ -145,6 +149,8 @@ var formation = new Formation(1,6);
  • +
  • +
  • @@ -155,6 +161,8 @@ var formation = new Formation(1,6);
  • +
  • +
  • @@ -165,6 +173,8 @@ var formation = new Formation(1,6);
  • +
  • +
  • @@ -175,12 +185,14 @@ var formation = new Formation(1,6);
  • +
  • +