做好封条显示、76版主动技

This commit is contained in:
枫谷剑仙 2022-10-12 19:46:27 +08:00
parent affcb463a7
commit f766e8574d
5 changed files with 158 additions and 59 deletions

BIN
images/icon-immobility.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -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'}变换)`,
},

View File

@ -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:"解鎖"},

View File

@ -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,13 +2510,32 @@ 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));
if (boardsBar) {
@ -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());

View File

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