From e6e2556fbba85e38f960970ceb35705f56da9441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Wed, 22 May 2024 02:24:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E5=B0=B1=E9=9F=A9=E5=9B=BD=E4=BA=BA?= =?UTF-8?q?=E7=9A=84=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script.js | 24 +++++++++++++++++------- service-worker.js | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/script.js b/script.js index cc4cca45..c918bf6e 100644 --- a/script.js +++ b/script.js @@ -1401,7 +1401,7 @@ const scriptLines = [`(()=>{ "use strict"; const tbs = JSON.parse(sessionStorage.getItem("team-build-store")); const team = tbs.state; - team.badge = ${badge & 0x7F};`]; + team.badge = ${Formation.sanbonBadgeMap.find(_badge=>_badge.pdf === badge)?.sanbon || badge};`]; const _members = {}; for (let i = 0; i < members.length; i++) { @@ -1410,7 +1410,7 @@ const scriptLines = [`(()=>{ num: m.id, level: m.level, superAwoken: m.sawoken ?? 0, - latentAwokens: m.latent.concat(), + latentAwokens: m.latent.concat().sort((a, b) => latentUseHole(b) - latentUseHole(a)), awokenCount: m.awoken, hpPlus: m.plus[0], atkPlus: m.plus[1], @@ -1450,6 +1450,16 @@ location.reload(); })();`); return scriptLines.join('\n'); }; + +//paddb的徽章对应数字 +Formation.sanbonBadgeMap = [ + {pdf:22,sanbon:15}, //除武器,全防 + {pdf:23,sanbon:16}, //除武器,10 SB + {pdf:24,sanbon:20}, //合作,英雄学院 + {pdf:25,sanbon:23}, //官桶,画师 + {pdf:27,sanbon:22}, //合作,高达 + {pdf:PAD_PASS_BADGE,sanbon:1}, //月卡 +]; Formation.prototype.getSanbonQrObj = function() { //sanbon目前只支持单人队伍 @@ -1460,7 +1470,7 @@ Formation.prototype.getSanbonQrObj = function() content: this.detail ?? "", //mons: assists.map(m=>m.id).concat(members.map(m=>m.id)), data: { - badge: (badge || 1) & 0x7f, + badge: Formation.sanbonBadgeMap.find(_badge=>_badge.pdf === badge)?.sanbon || badge, members: {}, //等待下面处理 }, }; @@ -1470,7 +1480,7 @@ Formation.prototype.getSanbonQrObj = function() num: m.id, level: m.level, superAwoken: m.sawoken ?? 0, - latentAwokens: m.latent.concat(), + latentAwokens: m.latent.concat().sort((a, b) => latentUseHole(b) - latentUseHole(a)), awokenCount: m.awoken, hpPlus: m.plus[0], atkPlus: m.plus[1], @@ -1566,7 +1576,7 @@ Formation.prototype.getDaddbQrObj = function() const [members,assists,badge] = this.teams[0]; let teamObj = { name: this.title, - badge: Formation.daddbBadgeMap.find(_badge=>_badge.pdf === badge).daddb, + badge: Formation.daddbBadgeMap.find(_badge=>_badge.pdf === badge)?.daddb, staffs: [], } for (let i = 0; i < members.length; i++) { @@ -1575,7 +1585,7 @@ Formation.prototype.getDaddbQrObj = function() staf: m.id || -1, eq: a.id || -1, sawak: m.sawoken || -1, - qawak: m.latent.map(n=>Formation.daddbLatentMap.find(latent=>latent.pdf === n).daddb), + qawak: m.latent.map(n=>Formation.daddbLatentMap.find(latent=>latent.pdf === n)?.daddb), }; } return teamObj; @@ -2783,7 +2793,7 @@ function sanbonFotmationToPdfFotmation(obj) f.detail = team.content; const t = f.teams[0]; //队伍徽章 - t[2] = team.badge === 1 ? PAD_PASS_BADGE : team.badge; + t[2] = Formation.daddbBadgeMap.find(badge=>badge.sanbon === team.badge)?.pdf || team.badge; const members = t[0], assists = t[1]; for (let i = 0; i< members.length; i++) { const m = members[i], a = assists[i], dm = team.members[i]; diff --git a/service-worker.js b/service-worker.js index 73f1470b..6cae47dc 100644 --- a/service-worker.js +++ b/service-worker.js @@ -26263,7 +26263,7 @@ const cachesMap = new Map([ ], [ "script.js", - "858116500c62bbd4eae0658cacde160c" + "a6df25e88c49f6a89b49d25958640f51" ], [ "solo.html",