Commit 7994199e authored by Chunchi Che's avatar Chunchi Che

update chains

parent 733c252f
Pipeline #23243 passed with stages
in 11 minutes and 53 seconds
import { ygopro } from "@/api";
import { cardStore, matStore } from "@/stores";
import { cardStore, matStore, placeStore } from "@/stores";
export default (_chainEnd: ygopro.StocGameMessage.MsgChainEnd) => {
while (true) {
......@@ -8,12 +8,12 @@ export default (_chainEnd: ygopro.StocGameMessage.MsgChainEnd) => {
break;
}
// const target = cardStore.find(chain);
// if (target) {
// target.chainIndex = undefined;
// } else {
// console.warn(`<ChainEnd>target from ${chain} is null`);
// }
const block = placeStore.of(chain);
if (block) {
block.chainIndex.pop();
} else {
console.warn(`<ChainEnd>block from ${chain} is null`);
}
}
// 目前selected字段只会涉及连锁过程某些卡成为效果对象,
......
import { ygopro } from "@/api";
import { cardStore, matStore } from "@/stores";
import { matStore, placeStore } from "@/stores";
// FIXME: 处理连锁会存在三种结果:
// 1. Solved - 已处理;
......@@ -15,11 +15,11 @@ export default async (chainSolved: ygopro.StocGameMessage.MsgChainSolved) => {
.at(0);
if (location) {
// 设置被连锁状态为空,解除连锁
const target = cardStore.find(location);
if (target) {
// target.chainIndex = undefined;
const block = placeStore.of(location);
if (block) {
block.chainIndex.pop();
} else {
console.warn(`<ChainSolved>target from ${location} is null`);
console.warn(`<ChainSolved>block from ${location} is null`);
}
} else {
console.warn(
......
import { fetchCard, ygopro } from "@/api";
import { cardStore, fetchEsHintMeta, matStore } from "@/stores";
import { cardStore, fetchEsHintMeta, matStore, placeStore } from "@/stores";
import { callCardFocus } from "@/ui/Duel/PlayMat/Card";
export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
......@@ -16,7 +16,12 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
const target = cardStore.find(location);
if (target) {
// 设置连锁序号
// target.chainIndex = matStore.chains.length;
const block = placeStore.of(location);
if (block) {
block.chainIndex.push(matStore.chains.length);
} else {
console.warn(`<Chaining>block from ${location} is null`);
}
const meta = fetchCard(chaining.code);
// 这里不能设置`code`,因为存在一个场景:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment