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 { ygopro } from "@/api";
import { cardStore, matStore } from "@/stores"; import { cardStore, matStore, placeStore } from "@/stores";
export default (_chainEnd: ygopro.StocGameMessage.MsgChainEnd) => { export default (_chainEnd: ygopro.StocGameMessage.MsgChainEnd) => {
while (true) { while (true) {
...@@ -8,12 +8,12 @@ export default (_chainEnd: ygopro.StocGameMessage.MsgChainEnd) => { ...@@ -8,12 +8,12 @@ export default (_chainEnd: ygopro.StocGameMessage.MsgChainEnd) => {
break; break;
} }
// const target = cardStore.find(chain); const block = placeStore.of(chain);
// if (target) { if (block) {
// target.chainIndex = undefined; block.chainIndex.pop();
// } else { } else {
// console.warn(`<ChainEnd>target from ${chain} is null`); console.warn(`<ChainEnd>block from ${chain} is null`);
// } }
} }
// 目前selected字段只会涉及连锁过程某些卡成为效果对象, // 目前selected字段只会涉及连锁过程某些卡成为效果对象,
......
import { ygopro } from "@/api"; import { ygopro } from "@/api";
import { cardStore, matStore } from "@/stores"; import { matStore, placeStore } from "@/stores";
// FIXME: 处理连锁会存在三种结果: // FIXME: 处理连锁会存在三种结果:
// 1. Solved - 已处理; // 1. Solved - 已处理;
...@@ -15,11 +15,11 @@ export default async (chainSolved: ygopro.StocGameMessage.MsgChainSolved) => { ...@@ -15,11 +15,11 @@ export default async (chainSolved: ygopro.StocGameMessage.MsgChainSolved) => {
.at(0); .at(0);
if (location) { if (location) {
// 设置被连锁状态为空,解除连锁 // 设置被连锁状态为空,解除连锁
const target = cardStore.find(location); const block = placeStore.of(location);
if (target) { if (block) {
// target.chainIndex = undefined; block.chainIndex.pop();
} else { } else {
console.warn(`<ChainSolved>target from ${location} is null`); console.warn(`<ChainSolved>block from ${location} is null`);
} }
} else { } else {
console.warn( console.warn(
......
import { fetchCard, ygopro } from "@/api"; 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"; import { callCardFocus } from "@/ui/Duel/PlayMat/Card";
export default async (chaining: ygopro.StocGameMessage.MsgChaining) => { export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
...@@ -16,7 +16,12 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => { ...@@ -16,7 +16,12 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
const target = cardStore.find(location); const target = cardStore.find(location);
if (target) { 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); const meta = fetchCard(chaining.code);
// 这里不能设置`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