From f766e8574dccca67a4499f1e06d4295032cafffa 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, 12 Oct 2022 19:46:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=9A=E5=A5=BD=E5=B0=81=E6=9D=A1=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E3=80=8176=E7=89=88=E4=B8=BB=E5=8A=A8=E6=8A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- images/icon-immobility.png | Bin 0 -> 2833 bytes languages/zh.js | 7 +- script-json_data.js | 22 +++++- script-skill-parser.js | 136 ++++++++++++++++++++++++++----------- style.css | 52 +++++++++----- 5 files changed, 158 insertions(+), 59 deletions(-) create mode 100644 images/icon-immobility.png diff --git a/images/icon-immobility.png b/images/icon-immobility.png new file mode 100644 index 0000000000000000000000000000000000000000..4c86ef0109ddf638541066e617969c187c35beb0 GIT binary patch literal 2833 zcmV+s3-0uZP)pcZg<0s)%OHh(!O)i0-OpyNG6)cSKb)BC2;p%$a8HyNLh0X3Td)yLUwY?uhQH zciow0h*dw0W`bg?DgXcg0(4SNQvd*Vlg&5)00~=3L_t(|ob6a`dz&~G^)ktT z-^#`_S_)wphbpo`OQ;4m{v%i!uT*R0; zr+I%j7nASq;=6ea?F+q#-Lv@WYOeKY{bv8m_|5@{A0Do*uHHb#`?dp?d82+}K&1R?jU44JO>-)am_PdWq_fm$TJjs8nx7%&_LN4lEebiTYX|}KL zm+|wlZ5VG)B&{ps>!Xjmep^H3?z*mb`%}EIyAH$ny56m3YUD#!^>TUQ&HUN`S;V>5N7df*>iFV?6f$qT+FSX)TJ^bnHWEXhXQJMdvAj15ifRukgSy=J zqW)O_|isE)U(Jo@e5hXrIf|Q&@|=g z=R?Jb27svjA|AE$1VEI~Yb`K;DPt?#(xZgL$R%#sq)1JYcw&{X#B{>Ph|dIL!ppf) zqR_h0S{L|{bk$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#i zk_i6%fP8Z*R3s3SOMNMuB145o4+;0A;(*q5sg8=3a6KUx<`!*g`m8BUsB@~2ij&;j zCLUiACMwU#Z41B^8gpaNWy3=dF9FT)}Pw?z<9REns^z1Bc9i< zR$ulkmxm*S$LRbc1bD;iaqJKnD3v=G%zV|CvWR6)XNM~4%ksY8@AqZB@B5EsbFsW= zE^)|mr=E+rkY%s@*=VO` zNB1F4cFXId{po5|RX86W)%W>lH2No!PI~c$#DP72c{E&}pPqmF?AgH)fBI=SUgr1p z5zd8GwOXC-kFGItfm7p5?MBzz)75xQ$5=f-hipm42Qf?)mNSbUKA`S$!ThF{A0 z_GmnIs%Z`Bp2_j*bbCFD@8(xm@xpyXI191pdOnZCwGO}g9`Mbv|BTMyfAd}9*$0X_ zeau*|VVHIN^#jGjdhrkcMnnK!<)?qDeFg9e;1$3tfPXxI{{s<2v1GOpfKC7a0Csdm zSaefwW^{L9a%BKTcyMoWbY)~9b#rNMXCQQFWgt*>dU|YSASNJ0a$#q0ZgU`1Wq5RT za%CV?Z*OcMD0g>vE@N+Gd3RxSbaO6aZ*4Dda&Ky7V{~&baCLfmY-KHBZe%TFa$#q0 jZgVYkWq5RTa%C-aZ*OcVZzz#700000NkvXXu0mjfhuTK> literal 0 HcmV?d00001 diff --git a/languages/zh.js b/languages/zh.js index ebd8d9e9..d130b3b6 100644 --- a/languages/zh.js +++ b/languages/zh.js @@ -98,7 +98,8 @@ obstruct_opponent_before_me: tp`排名比自身高的对手`, obstruct_opponent_designated_position: tp`第${'positions'}排位的对手`, increase_damage_cap: tp`${'targets'}的${'icon'}伤害上限提升到${'cap'}`, - board_jamming_state: tp`在${'position'}生成${'state'}${'size'}${'count'}${'time'}`, + board_jamming_state: tp`在${'position'}生成${'icon'}${'state'}${'size'}${'count'}${'time'}`, + board_size_change: tp`版面大小改变为${'icon'}${'size'}`, }, power: { unknown: tp`[ 未知能力提升: ${'type'} ]`, @@ -239,14 +240,14 @@ enhanced: tp`${'icon'}强化`, locked: tp`${'icon'}锁定`, nail: tp`${'icon'}钉子`, - variation: tp`${'icon'}变换珠(每${'time'}变换)`, _5color: tp`${'icon'}5色`, _6color: tp`${'_5color'}+${'orb_rcv'}`, all: tp`所有`, any: tp`任何${'cotent'}`, }, board: { - cloud: tp`${'icon'}云`, + clouds: tp`${'icon'}云`, + immobility: tp`${'icon'}封条`, roulette: tp`${'icon'}轮盘位`, roulette_time: tp`(每${'duration'}变换)`, }, diff --git a/script-json_data.js b/script-json_data.js index 0e785533..6db3ac94 100644 --- a/script-json_data.js +++ b/script-json_data.js @@ -114,7 +114,8 @@ let localTranslating = { obstruct_opponent_before_me: tp`The opponent ranked higher than me`, obstruct_opponent_designated_position: tp`No.${'positions'} ranked opponents`, increase_damage_cap: tp`The ${'icon'}damage cap of ${'targets'} is increased to ${'cap'}`, - board_jamming_state: tp`Creates ${'count'} ${'state'} ${'size'} at ${'position'}${'time'}`, + board_jamming_state: tp`Creates ${'count'} ${'icon'}${'state'} ${'size'} at ${'position'}${'time'}`, + board_size_change: tp`Board size changed to ${'icon'}${'size'}`, }, power: { unknown: tp`[ Unkonwn power up: ${'type'} ]`, @@ -261,7 +262,8 @@ let localTranslating = { any: tp`Any ${'cotent'}`, }, board: { - cloud: tp`${'icon'}Cloud`, + clouds: tp`${'icon'}Clouds`, + immobility: tp`${'icon'}Immobility`, roulette: tp`${'icon'}Roulette`, roulette_time: tp`(transforms every ${'duration'})`, }, @@ -2397,6 +2399,22 @@ const specialSearchFunctions = (function() { return `${sk[1]}个×${sk[0]}T`; } }, + {name:"Creates Cloud",otLangName:{chs:"生成封条",cht:"生成封条"}, + function:cards=>{ + const searchTypeArray = [239]; + return cards.filter(card=>{ + const skill = getCardActiveSkill(card, searchTypeArray); + return skill; + }).sort((a,b)=>sortByParams(a,b,searchTypeArray)); + }, + addition:card=>{ + const searchTypeArray = [239]; + const skill = getCardActiveSkill(card, searchTypeArray); + if (!skill) return; + const sk = skill.params; + return `${sk[1]}个×${sk[0]}T`; + } + }, ]}, {group:true,name:"-----Orbs States Change-----",otLangName:{chs:"-----改变宝珠状态类-----",cht:"-----改變寶珠狀態類-----"}, functions: [ {name:"Unlock",otLangName:{chs:"解锁",cht:"解鎖"}, diff --git a/script-skill-parser.js b/script-skill-parser.js index 4773a753..949577b7 100644 --- a/script-skill-parser.js +++ b/script-skill-parser.js @@ -248,6 +248,9 @@ class Board const orbsRow = this.orbsData[ri], blocksRow = this.blocksData[ri]; this.setOrbAndBlock(orbsRow[ci], blocksRow[ci], attr, state, blockState); + if (blockState == 'immobility') { //如果是封条,额外添加需要旋转的信息 + this.setOrbAndBlock(orbsRow[ci], blocksRow[ci], attr, state, 'rotate'); + } } } } @@ -457,7 +460,7 @@ const SkillKinds = { FixedTime: "fixed-time", Drum: "drum", AutoPath: "auto-path", - Board7x6: "7x6-board", + BoardSizeChange: "board-size-change", NoSkyfall: "no-skyfall", Henshin: "henshin", VoidPoison: "void-poison", @@ -995,7 +998,6 @@ function dropRefresh() { return { kind: SkillKinds.DropRefresh }; } function drum() { return { kind: SkillKinds.Drum }; } function autoPath() { return { kind: SkillKinds.AutoPath }; } function leaderChange(type = 0) { return { kind: SkillKinds.LeaderChange, type: type }; } -function board7x6() { return { kind: SkillKinds.Board7x6 }; } function noSkyfall() { return { kind: SkillKinds.NoSkyfall }; } function henshin(id, random = false) { return { @@ -1019,6 +1021,9 @@ function increaseDamageCap(cap, targets) { function boardJammingStates(state, posType, options) { return { kind: SkillKinds.BoardJammingStates, state: state, posType: posType, ...options}; } +function boardSizeChange(width=7, height=6) { + return { kind: SkillKinds.BoardSizeChange, width, height }; +} const parsers = { parser: (() => []), //这个用来解决代码提示的报错问题,不起实际作用 @@ -1291,7 +1296,7 @@ const parsers = { [159](attrs, min, base, bonus, max) { return powerUp(null, null, p.scaleMatchLength(flags(attrs), min, max, [base, 100], [bonus, 0])); }, [160](turns, combo) { return activeTurns(turns, addCombo(combo)); }, [161](percent) { return gravity(v.xMaxHP(percent)); }, - [162]() { return board7x6(); }, + [162]() { return boardSizeChange(); }, [163](attrs, types, hp, atk, rcv, rAttrs, rPercent) { return [ noSkyfall(), @@ -1386,7 +1391,7 @@ const parsers = { }, [186](attrs, types, hp, atk, rcv) { return [ - board7x6(), + boardSizeChange(), (hp || atk ||rcv) && powerUp(flags(attrs), flags(types), p.mul({ hp: hp || 100, atk: atk || 100, rcv: rcv || 100 })) || null, ].filter(Boolean); }, @@ -1545,7 +1550,13 @@ const parsers = { }, [238](turns, width, height, pos1, pos2) { //产云 return activeTurns(turns, - boardJammingStates('cloud', (pos1 && pos2) ? 'fixed' : 'random', { size: [width, height], positions: [pos1, pos2] }) + boardJammingStates('clouds', (pos1 && pos2) ? 'fixed' : 'random', { size: [width, height], positions: [pos1, pos2] }) + ); + }, + [239](turns, colum, row) { //产封条 + //const colums = flags(colum), rows = flags(row); + return activeTurns(turns, + boardJammingStates('immobility', 'fixed', { positions: {colums: flags(colum), rows: flags(row)} }) ); }, [241](turns, cap, target = 1) { //改变伤害上限 @@ -1555,6 +1566,21 @@ const parsers = { increaseDamageCap(cap * 1e8, typeArr) ); }, + [244](turns, type) { //改变版面大小 + let width, height; + switch (type) { + case 1: { + width = 7; + height = 6; + break; + } + default: { + width = 6; + height = 5; + } + } + return activeTurns(turns, boardSizeChange()); + }, [1000](type, pos, ...ids) { const posType = (type=>{ switch (type) { @@ -1692,9 +1718,16 @@ function renderSkillEntry(skills) board.setShape(positions, null, null, 'roulette'); }); } - if (state == 'cloud') { //云 + if (state == 'clouds') { //云 boardsBar.boards.forEach(board=>{ - board.generateBlockStates('cloud', count, size, positions); + board.generateBlockStates('clouds', count, size, positions); + }); + } + if (state == 'immobility') { //封条 + const {colums, rows} = skill.positions; + boardsBar.boards.forEach(board=>{ + board.setColumns(colums, null, null, 'immobility'); + board.setRows(rows, null, null, 'immobility'); }); } break; @@ -1718,6 +1751,16 @@ function renderSkillEntry(skills) return ul; } +//行列拆分成顺序和逆序的正常数字 +function posSplit(pos, axis = 'row') +{ + const max = axis == 'row' ? 5 : 6; + return [ + pos.filter(n=>n<=2).map(n=>n+1), + pos.filter(n=>n>=3).reverse().map(n=>max-n), + ]; + //return {sequence: pos.filter(n=>n<=2).map(n=>n+1), reverse: pos.filter(n=>n>=3).reverse().map(n=>max-n)}; +} function renderSkill(skill, option = {}) { const frg = document.createDocumentFragment(); @@ -1730,7 +1773,7 @@ function renderSkill(skill, option = {}) idoc.setAttribute("data-icon-type", iconType); return idoc; } - + if (Array.isArray(skill)) { frg.ap(skill.map(_skill=>renderSkill(_skill))); @@ -2091,13 +2134,6 @@ function renderSkill(skill, option = {}) frg.ap(tsp.skill.auto_path()); break; } - case SkillKinds.Board7x6: { //76版 - let dict = { - icon: createIcon(skill.kind), - }; - frg.ap(tsp.skill.board7x6(dict)); - break; - } case SkillKinds.Vampire: { //吸血 let attr = skill.attr, damage = skill.damage, heal = skill.heal; let _dict = { @@ -2140,10 +2176,10 @@ function renderSkill(skill, option = {}) break; } case SkillKinds.GenerateOrbs: { //产生珠子 - let orbs = skill.orbs, exclude = skill.exclude, count = skill.count, time = skill.time; + let orbs = skill.orbs, exclude = skill.exclude, count = skill.count; dict = { exclude: exclude?.length ? tsp.word.affix_exclude({cotent: renderOrbs(exclude)}) : void 0, - orbs: renderOrbs(orbs, {time}), + orbs: renderOrbs(orbs), value: count, }; frg.ap(tsp.skill.generate_orbs(dict)); @@ -2163,15 +2199,12 @@ function renderSkill(skill, option = {}) let slight_pause = tsp.word.slight_pause().textContent; let subDocument = []; const boardsBar = merge_skill ? null : new BoardSet(new Board(), new Board(null,7,6), new Board(null,5,4)); - function posSplit(pos, max) - { - return {sequence: pos.filter(n=>n<=2).map(n=>n+1), reverse: pos.filter(n=>n>=3).reverse().map(n=>max-n)}; - } + for (const generate of generates) { - let orb = generate.orbs?.[0], time = generate.time; + let orb = generate.orbs?.[0]; dict = { - orbs: renderOrbs(orb, {time}), + orbs: renderOrbs(orb), }; if (generate.type == 'shape') { @@ -2183,15 +2216,15 @@ function renderSkill(skill, option = {}) if (generate.positions.length == 0) continue; if (generate.type == 'row') { - const pos = posSplit(generate.positions, 5); - if (pos.sequence.length) posFrgs.push(tsp.position.top({pos: pos.sequence.join(slight_pause)})); - if (pos.reverse.length) posFrgs.push(tsp.position.bottom({pos: pos.reverse.join(slight_pause)})); + const [sequence, reverse] = posSplit(generate.positions, 'row'); + if (sequence.length) posFrgs.push(tsp.position.top({pos: sequence.join(slight_pause)})); + if (reverse.length) posFrgs.push(tsp.position.bottom({pos: reverse.join(slight_pause)})); boardsBar?.boards?.forEach(board=>board.setRows(generate.positions, orb)); }else { - const pos = posSplit(generate.positions, 6); - if (pos.sequence.length) posFrgs.push(tsp.position.left({pos: pos.sequence.join(slight_pause)})); - if (pos.reverse.length) posFrgs.push(tsp.position.right({pos: pos.reverse.join(slight_pause)})); + const [sequence, reverse] = posSplit(generate.positions, 'colum'); + if (sequence.length) posFrgs.push(tsp.position.left({pos: sequence.join(slight_pause)})); + if (reverse.length) posFrgs.push(tsp.position.right({pos: reverse.join(slight_pause)})); boardsBar?.boards?.forEach(board=>board.setColumns(generate.positions, orb)); } dict.position = posFrgs.nodeJoin(tsp.word.slight_pause()); @@ -2458,10 +2491,12 @@ function renderSkill(skill, option = {}) break; } case SkillKinds.BoardJammingStates: { //版面产生干扰状态 - const { state, posType, size, positions, count, time } = skill; + const { state, posType, positions, count, time } = skill; const boardsBar = merge_skill ? null : new BoardSet(new Board(), new Board(null,7,6), new Board(null,5,4)); + const slight_pause = tsp.word.slight_pause().textContent; dict = { + icon: createIcon('board-' + state), state: tsp.board[state](), position: posType == 'random' ? tsp.position.random() : tsp.position.shape(), }; @@ -2475,12 +2510,31 @@ function renderSkill(skill, option = {}) board.setShape(positions, null, null, 'roulette'); }); } - if (state == 'cloud') { //云 - const [width, height] = size; + if (state == 'clouds') { //云 + const [width, height] = skill.size; dict.size = tsp.value.size({ width, height}); boardsBar?.boards?.forEach(board=>{ - board.generateBlockStates('cloud', count, size, positions); + board.generateBlockStates('clouds', count, size, positions); + }); + } + if (state == 'immobility') { //封条 + const {colums, rows} = skill.positions; + + let posFrgs = []; + const [sequenceCols, reverseCols] = posSplit(colums, 'colum'); + if (sequenceCols.length) posFrgs.push(tsp.position.left({pos: sequenceCols.join(slight_pause)})); + if (reverseCols.length) posFrgs.push(tsp.position.right({pos: reverseCols.join(slight_pause)})); + + const [sequenceRows, reverseRows] = posSplit(rows, 'row'); + if (sequenceRows.length) posFrgs.push(tsp.position.top({pos: sequenceRows.join(slight_pause)})); + if (reverseRows.length) posFrgs.push(tsp.position.bottom({pos: reverseRows.join(slight_pause)})); + + boardsBar?.boards?.forEach(board=>{ + board.setColumns(colums, null, null, 'immobility'); + board.setRows(rows, null, null, 'immobility'); }); + + dict.position = posFrgs.nodeJoin(tsp.word.slight_pause()); } frg.ap(tsp.skill.board_jamming_state(dict)); @@ -2490,6 +2544,16 @@ function renderSkill(skill, option = {}) } break; } + case SkillKinds.BoardSizeChange: { //改变版面大小 + const { width, height } = skill; + + dict = { + icon: createIcon(skill.kind), + size: tsp.value.size({ width, height}), + }; + frg.ap(tsp.skill.board_size_change(dict)); + break; + } default: { console.log("未处理的技能类型",skill.kind, skill); @@ -2571,14 +2635,10 @@ function renderOrbs(attrs, option = {}) { const icon = document.createElement("icon"); icon.className = "orb"; if (option.className) icon.className += " " + option.className; - if (attr == 'variation') - icon.classList.add('variation'); - else - icon.setAttribute("data-orb-icon",attr); + icon.setAttribute("data-orb-icon",attr); let dict = { icon: icon, } - if (attr == 'variation') dict.time = renderValue(v.constant(option.time), {unit: tsp.unit.seconds}) ; return tsp.orbs?.[attr](dict); }) .nodeJoin(tsp.word.slight_pause()); diff --git a/style.css b/style.css index d900d13f..34a0784b 100644 --- a/style.css +++ b/style.css @@ -2771,13 +2771,26 @@ icon.inflicts::after transform: scale(1); } /*云,在宝珠前面*/ -.block.cloud::after +.block.clouds::after { content: ""; background-image: url(images/icon-cloud-1.png); background-size: contain; transform: scale(1.2); } +/*封条,在宝珠前面*/ +.block.immobility::after +{ + content: ""; + background-image: url(images/icon-immobility.png); + background-size: cover; +} +/*需要旋转的,比如封条*/ +.block.rotate::after, +.block.rotate::before +{ + transform: rotate(90deg); +} .orb-icon { width: 20px; @@ -2884,19 +2897,6 @@ table .orb-icon { content: "💣"; } -.board .board-row4, -.board .board-cell5 -{ - display: none; -} -.board-76 .board-row4 -{ - display: table-row; -} -.board-76 .board-cell5 -{ - display: table-cell; -} .team-flags .team-member-icon { display: inline-block; border-width: 1px; @@ -3732,7 +3732,7 @@ table .orb-icon .card-skill-list .no-skyfall, .card-skill-list .fixed-time, .card-skill-list .min-match-len, -.card-skill-list .\37x6-board +.row-mon-leader-skill .card-skill-list .board-size-change { color: #ff3600; } @@ -3928,7 +3928,7 @@ table .orb-icon left: 10px; top: 5px; } -.icon-skill[data-icon-type="7x6-board"] +.icon-skill[data-icon-type="board-size-change"] { background-position-y:calc(-36px * 21); } @@ -3985,6 +3985,22 @@ table .orb-icon { background-position-y:calc(-36px * 33); } +.icon-skill[data-icon-type="board-roulette"] +{ + background-position-y:calc(-36px * 34); +} +.icon-skill[data-icon-type="board-clouds"] +{ + background-position: center; + background-size: contain; + background-image: url(images/icon-cloud-1.png); +} +.icon-skill[data-icon-type="board-immobility"] +{ + background-position: center; + background-size: cover; + background-image: url(images/icon-immobility.png); +} .icon-skill[data-icon-type="orb-nail"] { background-position-y:calc(-36px * 35); @@ -3995,6 +4011,10 @@ table .orb-icon background-size: contain; } .icon-skill[data-icon-type="increase-damage-cap"] +{ + background-position-y:calc(-36px * 36); +} +.icon-skill[data-icon-type="increase-damage-cap"] { background-position-y:calc(-36px * 36); } \ No newline at end of file