Commit 012d2682 authored by chechunchi's avatar chechunchi

update

parent a80f0ca9
......@@ -81,7 +81,7 @@ export default (move: MsgMove) => {
() =>
(matStore.in(to.location).of(to.controler)[to.sequence].focus =
false),
500
500 // use config
);
break;
}
......@@ -101,7 +101,7 @@ export default (move: MsgMove) => {
matStore
.in(to.location)
.of(to.controler)
.insert(uuid, code, to.sequence);
.insert(uuid, code, to.sequence, ygopro.CardPosition.FACEUP_ATTACK);
}
break;
}
......
import { sendTimeConfirm, ygopro } from "@/api";
import { matStore } from "@/stores";
const TIME_GAP = 800;
const TIME_GAP = 1500;
export default function handleTimeLimit(timeLimit: ygopro.StocTimeLimit) {
setTimeout(() => {
......
......@@ -29,7 +29,8 @@ class CardArray extends Array<CardState> implements ArrayCardState {
uuid: string,
controller: number,
id: number,
position?: ygopro.CardPosition
position?: ygopro.CardPosition,
focus?: boolean
) => ({
uuid,
occupant: await fetchCard(id, true),
......@@ -39,6 +40,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
position:
position == undefined ? ygopro.CardPosition.FACEUP_ATTACK : position,
},
focus,
counters: {},
idleInteractivities: [],
});
......@@ -50,18 +52,26 @@ class CardArray extends Array<CardState> implements ArrayCardState {
uuid: string,
id: number,
sequence: number,
position?: ygopro.CardPosition
position?: ygopro.CardPosition,
focus?: boolean
) {
const card = await this.genCard(uuid, this.getController(), id, position);
const card = await this.genCard(
uuid,
this.getController(),
id,
position,
focus
);
this.splice(sequence, 0, card);
}
async add(
data: { uuid: string; id: number }[],
position?: ygopro.CardPosition
position?: ygopro.CardPosition,
focus?: boolean
) {
const cards = await Promise.all(
data.map(async ({ uuid, id }) =>
this.genCard(uuid, this.getController(), id, position)
this.genCard(uuid, this.getController(), id, position, focus)
)
);
this.splice(this.length, 0, ...cards);
......
......@@ -20,12 +20,14 @@ export interface DuelFieldState extends Array<CardState> {
uuid: string,
id: number,
sequence: number,
position?: ygopro.CardPosition
position?: ygopro.CardPosition,
focus?: boolean
) => Promise<void>;
/** 在末尾添加卡片 */
add: (
data: { uuid: string; id: number }[],
position?: ygopro.CardPosition
position?: ygopro.CardPosition,
focus?: boolean
) => Promise<void>;
/** 设置占据这个位置的卡片信息 */
setOccupant: (
......
......@@ -95,14 +95,15 @@ export const Mat = () => {
col={cardStateToCol(card)}
hight={CardStateToHigh(card)}
defense={
card.location.position === YgoPosition.DEFENSE ||
card.location.position === YgoPosition.FACEDOWN_DEFENSE ||
card.location.position === YgoPosition.FACEUP_DEFENSE
!card.focus &&
(card.location.position === YgoPosition.DEFENSE ||
card.location.position === YgoPosition.FACEDOWN_DEFENSE ||
card.location.position === YgoPosition.FACEUP_DEFENSE)
}
facedown={CardStateToFaceDown(card)}
vertical={card.location.zone == YgoZone.HAND || card.focus}
highlight={card.idleInteractivities.length > 0}
focus={card.focus && card.occupant?.id !== 0}
focus={card.focus}
opponent={card.opponent}
onClick={
card.location.zone == YgoZone.SZONE ||
......
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