From fbc6c2973891e8be14a714b64837bdb121e8d79e 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, 26 Apr 2024 05:36:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=80=E4=BA=9Bflags?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=9B=BF=E6=8D=A2=E5=AE=8C=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-json_data.js | 6 +++--- script-skill-parser.js | 14 +++++++------- service-worker.js | 8 ++------ 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/script-json_data.js b/script-json_data.js index a2049901..946a5386 100644 --- a/script-json_data.js +++ b/script-json_data.js @@ -1316,7 +1316,7 @@ const specialSearchFunctions = (function() { else if(skill.type == 231 && sk[6] > 0) { outObj.skilltype = 1; - outObj.awoken = sk.slice(1, 5).filter(Boolean).filter(flags); + outObj.awoken = sk.slice(1, 5).filter(Boolean); outObj.turns = sk[0]; outObj.rate = sk[6]; } @@ -1351,7 +1351,7 @@ const specialSearchFunctions = (function() { outObj.rate = sk[4]; } else if (skill.type == 231 && sk[7] > 0) { outObj.skilltype = 1; - outObj.awoken = sk.slice(1, 5).filter(Boolean).filter(flags); + outObj.awoken = sk.slice(1, 5).filter(Boolean); outObj.turns = sk[0]; outObj.rate = sk[7]; } else if (skill.type == 50 || skill.type == 90) { @@ -2395,7 +2395,7 @@ const specialSearchFunctions = (function() { if (skill.type == 249) { fragment.append(createOrbsList(Bin.unflags(sk[1]))); } - fragment.append(`${sk[7]? sk[7] : '固定'+sk.slice(2,7).flatMap(flags).length }`,`×${sk[0]}T`); + fragment.append(`${sk[7]? sk[7] : '固定'+sk.slice(2,7).flatMap(Bin.unflags).length }`,`×${sk[0]}T`); return fragment; } }, diff --git a/script-skill-parser.js b/script-skill-parser.js index 940c866e..ff21acdc 100644 --- a/script-skill-parser.js +++ b/script-skill-parser.js @@ -1232,7 +1232,7 @@ const skillObjectParsers = { [123](percent, attrs, types, atk, rcv) { return powerUp(Bin.unflags(attrs), Bin.unflags(types), p.mul({ atk: atk || 100, rcv: rcv || 100 }), c.hp(percent, 100)); }, [124](attrs1, attrs2, attrs3, attrs4, attrs5, min, mul, bonus) { const attrs = [attrs1, attrs2, attrs3, attrs4, attrs5].filter(Boolean); - return powerUp(null, null, p.scaleMatchAttrs(attrs.flatMap(flags), min, bonus ? attrs.length : min, [mul, 100], [bonus, 0])); + return powerUp(null, null, p.scaleMatchAttrs(attrs.flatMap(Bin.unflags), min, bonus ? attrs.length : min, [mul, 100], [bonus, 0])); }, [125](mon1, mon2, mon3, mon4, mon5, hp, atk, rcv) { return powerUp(null, null, p.mul({ hp: hp || 100, atk: atk || 100, rcv: rcv || 100 }), c.compo('card', [mon1, mon2, mon3, mon4, mon5].filter(Boolean))); }, [126](attrs, turns, turns2, percent) { return activeTurns(turns === turns2 ? turns : [turns, turns2], orbDropIncrease(v.percent(percent), Bin.unflags(attrs))); }, @@ -1349,7 +1349,7 @@ const skillObjectParsers = { }, [164](attrs1, attrs2, attrs3, attrs4, min, atk, rcv, bonus) { const attrs = [attrs1, attrs2, attrs3, attrs4].filter(Boolean); - return powerUp(null, null, p.scaleMatchAttrs(attrs.flatMap(flags), min, attrs.length, [atk, rcv], [bonus, bonus])); + return powerUp(null, null, p.scaleMatchAttrs(attrs.flatMap(Bin.unflags), min, attrs.length, [atk, rcv], [bonus, bonus])); }, [165](attrs, min, baseAtk, baseRcv, bonusAtk, bonusRcv, incr) { const attrsArr = Bin.unflags(attrs); @@ -1371,7 +1371,7 @@ const skillObjectParsers = { }, [171](attrs1, attrs2, attrs3, attrs4, min, mul, percent, bonus) { const attrs = [attrs1, attrs2, attrs3, attrs4].filter(Boolean); - return powerUp(null, null, p.scaleMatchAttrs(attrs.flatMap(flags), min, bonus ? attrs.length : min, [mul, 100], [bonus ?? 0, 0]), null, v.percent(percent)); + return powerUp(null, null, p.scaleMatchAttrs(attrs.flatMap(Bin.unflags), min, bonus ? attrs.length : min, [mul, 100], [bonus ?? 0, 0]), null, v.percent(percent)); }, [172]() { return setOrbState(Attributes.orbs(), 'unlocked'); }, [173](turns, attrAbsorb, comboAbsorb, damageAbsorb) { @@ -1482,7 +1482,7 @@ const skillObjectParsers = { }, [201](attrs1, attrs2, attrs3, attrs4, min, damage) { const attrs = [attrs1, attrs2, attrs3, attrs4].filter(Boolean); - return powerUp(null, null, p.scaleMatchAttrs(attrs.flatMap(flags), min, min, [100, 100], [0, 0]), null, null, [followAttackFixed(damage)]); + return powerUp(null, null, p.scaleMatchAttrs(attrs.flatMap(Bin.unflags), min, min, [100, 100], [0, 0]), null, null, [followAttackFixed(damage)]); }, [202](id) { return henshin(id); @@ -1502,7 +1502,7 @@ const skillObjectParsers = { [205](attrs, turns) { return activeTurns(turns, orbDropIncrease(null, Bin.unflags(attrs == -1 ? 0b1111111111: attrs), 'locked')); }, [206](attrs1, attrs2, attrs3, attrs4, attrs5, min, combo) { const attrs = [attrs1, attrs2, attrs3, attrs4, attrs5].filter(Boolean); - return powerUp(null, null, p.scaleMatchAttrs(attrs.flatMap(flags), min, min, [100, 100], [0, 0]), null, null, combo ? [addCombo(combo)] : null); + return powerUp(null, null, p.scaleMatchAttrs(attrs.flatMap(Bin.unflags), min, min, [100, 100], [0, 0]), null, null, combo ? [addCombo(combo)] : null); }, [207](turns, time, row1, row2, row3, row4, row5, count) { /*return activeTurns(turns, count ? @@ -1513,7 +1513,7 @@ const skillObjectParsers = { if (count) { options.count = count; } else { - options.positions = [row1, row2, row3, row4, row5].map(flags); + options.positions = [row1, row2, row3, row4, row5].map(Bin.unflags); } return activeTurns(turns, boardJammingStates('roulette', count ? 'random' : 'shape', options) @@ -1671,7 +1671,7 @@ const skillObjectParsers = { if (count) { options.count = count; } else { - options.positions = [row1, row2, row3, row4, row5].map(flags); + options.positions = [row1, row2, row3, row4, row5].map(Bin.unflags); } return activeTurns(turns, boardJammingStates('roulette', count ? 'random' : 'shape', options) diff --git a/service-worker.js b/service-worker.js index 06292e6d..e8974997 100644 --- a/service-worker.js +++ b/service-worker.js @@ -25511,11 +25511,11 @@ const cachesMap = new Map([ ], [ "script-json_data.js", - "11cec86f554c4b4dceb01d57850b20a9" + "24fa2bd9a0ff6e04fa1520d027701a3e" ], [ "script-skill-parser.js", - "3ec1eb93ca9b88f454c0e9e69e347a06" + "7fd84302ec5dc1d1a7b68a8f4bbec9d5" ], [ "script-universal_function.js", @@ -25753,10 +25753,6 @@ const cachesMap = new Map([ "library/html2canvas.min.js", "d7530aa0b7587e627484c49fdf8f13f2" ], - [ - "library/minified.js", - "4d02ac7bb781ce3f52a8008f2047e77e" - ], [ "library/zxing.umd.min.js", "46934f662940b020aee6466c1e334c5f"