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

fix selectIdleCmd

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