Commit 315b0b42 authored by Chunchi Che's avatar Chunchi Che

fix selectIdleCmd

parent 66abedf9
import { ygopro } from "@/api"; import { ygopro } from "@/api";
import { import {
cardStore, cardStore,
clearAllIdleInteractivities as clearAllIdleInteractivities,
type Interactivity, type Interactivity,
InteractType, InteractType,
matStore, matStore,
...@@ -14,7 +13,6 @@ export default (selectBattleCmd: MsgSelectBattleCmd) => { ...@@ -14,7 +13,6 @@ export default (selectBattleCmd: MsgSelectBattleCmd) => {
const cmds = selectBattleCmd.battle_cmds; const cmds = selectBattleCmd.battle_cmds;
// 先清掉之前的互动性 // 先清掉之前的互动性
clearAllIdleInteractivities(player);
cardStore.inner.forEach((card) => { cardStore.inner.forEach((card) => {
card.idleInteractivities = []; card.idleInteractivities = [];
}); });
...@@ -34,19 +32,18 @@ export default (selectBattleCmd: MsgSelectBattleCmd) => { ...@@ -34,19 +32,18 @@ export default (selectBattleCmd: MsgSelectBattleCmd) => {
[InteractType.ATTACK]: { directAttackAble: data.direct_attackable }, [InteractType.ATTACK]: { directAttackAble: data.direct_attackable },
}; };
const tmp = map[interactType]; // 添加额外信息 const tmp = map[interactType]; // 添加额外信息
matStore const target = cardStore.at(location, player, sequence);
.in(location) if (target) {
.of(player) target.idleInteractivities.push({
.addIdleInteractivity(sequence, {
...tmp, ...tmp,
interactType, interactType,
response: data.response, response: data.response,
}); });
cardStore.at(location, player, sequence).idleInteractivities.push({ } else {
...tmp, console.warn(
interactType, `<selectBattleCmd>target from zone=${location}, player=${player}, sequence=${sequence} is null`
response: data.response, );
}); }
} else { } else {
console.warn(`Undefined InteractType`); console.warn(`Undefined InteractType`);
} }
......
export const clearAllIdleInteractivities = (controller: number) => {
// TODO
};
import { ygopro } from "@/api";
/** 清空所有place互动性,也可以删除某一个zone的互动性。zone为空则为清除所有。 */
export const clearAllPlaceInteradtivities = (
controller: number,
zone?: ygopro.CardZone
) => {
// TODO
};
export * from "./clearAllIdleInteractivities";
export * from "./clearAllPlaceInteradtivities";
export * from "./clearSelectActions"; export * from "./clearSelectActions";
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