Commit 24998446 authored by timel's avatar timel

fix: ts error and fmt

parent 81703784
export * from "./cards";
export * from "./strings";
export * from "./deck";
export * from "./ocgcore/ocgHelper";
export * from "./ocgcore/idl/ocgcore";
export * from "./ocgcore/ocgHelper";
export * from "./strings";
......@@ -5,8 +5,8 @@ import {
PayloadAction,
} from "@reduxjs/toolkit";
import { CardMeta, fetchCard } from "@/api/cards";
import { ygopro } from "@/api";
import { CardMeta, fetchCard } from "@/api/cards";
import { DuelState } from "./mod";
import ReloadFieldAction = ygopro.StocGameMessage.MsgReloadField.ZoneAction;
......
import { ActionReducerMapBuilder, createAsyncThunk } from "@reduxjs/toolkit";
import { fetchCard } from "@/api/cards";
import { ygopro } from "@/api";
import { fetchCard } from "@/api/cards";
import { DESCRIPTION_LIMIT, fetchStrings, getStrings } from "@/api/strings";
import { RootState } from "@/store";
......
......@@ -5,8 +5,8 @@ import {
PayloadAction,
} from "@reduxjs/toolkit";
import { fetchCard, getCardStr } from "@/api/cards";
import { ygopro } from "@/api";
import { fetchCard, getCardStr } from "@/api/cards";
import { RootState } from "@/store";
import { DuelState } from "../mod";
......
......@@ -4,8 +4,8 @@ import {
createAsyncThunk,
} from "@reduxjs/toolkit";
import { fetchCard } from "@/api/cards";
import { ygopro } from "@/api";
import { fetchCard } from "@/api/cards";
import { RootState } from "@/store";
import { DuelReducer } from "../generic";
......
......@@ -4,8 +4,8 @@ import {
createAsyncThunk,
} from "@reduxjs/toolkit";
import { fetchCard } from "@/api/cards";
import { ygopro } from "@/api";
import { fetchCard } from "@/api/cards";
import { RootState } from "@/store";
import { DuelReducer } from "../generic";
......
import { CardMeta } from "@/api/cards";
import { ygopro } from "@/api";
import { CardMeta } from "@/api/cards";
type CardLocation = ReturnType<typeof ygopro.CardLocation.prototype.toObject>;
export interface ModalState {
......
......@@ -4,8 +4,8 @@ import {
createAsyncThunk,
} from "@reduxjs/toolkit";
import { fetchCard } from "@/api/cards";
import { ygopro } from "@/api";
import { fetchCard } from "@/api/cards";
import { RootState } from "@/store";
import { DuelReducer } from "../generic";
......
......@@ -5,8 +5,8 @@ import {
PayloadAction,
} from "@reduxjs/toolkit";
import { CardMeta, fetchCard } from "@/api/cards";
import { ygopro } from "@/api";
import { CardMeta, fetchCard } from "@/api/cards";
import { fetchStrings, getStrings } from "@/api/strings";
import { RootState } from "@/store";
......
......@@ -5,8 +5,8 @@ import {
PayloadAction,
} from "@reduxjs/toolkit";
import { fetchCard } from "@/api/cards";
import { ygopro } from "@/api";
import { fetchCard } from "@/api/cards";
import { RootState } from "@/store";
import {
......
import { ygopro } from "@/api";
import { fetchEsHintMeta } from "@/reducers/duel/hintSlice";
import { AppDispatch } from "@/store";
import { matStore } from "@/valtioStores";
import { fetchEsHintMeta as FIXME_fetchEsHintMeta } from "@/valtioStores";
export default (
attack: ygopro.StocGameMessage.MsgAttack,
......@@ -10,7 +10,7 @@ export default (
dispatch(
fetchEsHintMeta({ originMsg: "「[?]」攻击时", location: attack.location })
);
matStore.hint.fetchEsHintMeta({
FIXME_fetchEsHintMeta({
originMsg: "「[?]」攻击时",
location: attack.location,
});
......
import { ygopro } from "@/api";
import { fetchEsHintMeta } from "@/reducers/duel/hintSlice";
import { AppDispatch } from "@/store";
import { matStore } from "@/valtioStores";
import {
fetchEsHintMeta as FIXME_fetchEsHintMeta,
matStore,
} from "@/valtioStores";
export default (
_: ygopro.StocGameMessage.MsgAttackDisabled,
dispatch: AppDispatch
) => {
dispatch(fetchEsHintMeta({ originMsg: "攻击被无效时" }));
matStore.hint.fetchEsHintMeta({ originMsg: "攻击被无效时" });
FIXME_fetchEsHintMeta({ originMsg: "攻击被无效时" });
};
import { ygopro } from "@/api";
import { fetchEsHintMeta } from "@/reducers/duel/hintSlice";
import { AppDispatch } from "@/store";
import { matStore } from "@/valtioStores";
import {
fetchEsHintMeta as FIXME_fetchEsHintMeta,
matStore,
} from "@/valtioStores";
export default (
chaining: ygopro.StocGameMessage.MsgChaining,
dispatch: AppDispatch
......@@ -9,7 +12,7 @@ export default (
dispatch(
fetchEsHintMeta({ originMsg: "「[?]」被发动时", cardID: chaining.code })
);
matStore.hint.fetchEsHintMeta({
FIXME_fetchEsHintMeta({
originMsg: "「[?]」被发动时",
cardID: chaining.code,
});
......
......@@ -2,7 +2,10 @@ import { ygopro } from "@/api";
import { fetchHandsMeta } from "@/reducers/duel/handsSlice";
import { fetchEsHintMeta } from "@/reducers/duel/hintSlice";
import { AppDispatch } from "@/store";
import { matStore } from "@/valtioStores";
import {
fetchEsHintMeta as FIXME_fetchEsHintMeta,
matStore,
} from "@/valtioStores";
export default (
draw: ygopro.StocGameMessage.MsgDraw,
......@@ -11,6 +14,6 @@ export default (
dispatch(fetchEsHintMeta({ originMsg: "玩家抽卡时" }));
dispatch(fetchHandsMeta({ controler: draw.player, codes: draw.cards }));
matStore.hint.fetchEsHintMeta({ originMsg: "玩家抽卡时" });
FIXME_fetchEsHintMeta({ originMsg: "玩家抽卡时" });
matStore.hands.add(draw.player, draw.cards);
};
......@@ -5,7 +5,11 @@ import {
fetchSelectHintMeta,
} from "@/reducers/duel/hintSlice";
import { AppDispatch } from "@/store";
import { matStore } from "@/valtioStores";
import {
fetchCommonHintMeta as FIXME_fetchCommonHintMeta,
fetchEsHintMeta as FIXME_fetchEsHintMeta,
fetchSelectHintMeta as FIXME_fetchSelectHintMeta,
} from "@/valtioStores";
import MsgHint = ygopro.StocGameMessage.MsgHint;
......@@ -13,19 +17,19 @@ export default (hint: MsgHint, dispatch: AppDispatch) => {
switch (hint.hint_type) {
case MsgHint.HintType.HINT_EVENT: {
dispatch(fetchEsHintMeta({ originMsg: hint.hint_data }));
matStore.hint.fetchEsHintMeta({ originMsg: hint.hint_data });
FIXME_fetchEsHintMeta({ originMsg: hint.hint_data });
break;
}
case MsgHint.HintType.HINT_MESSAGE: {
dispatch(fetchCommonHintMeta(hint.hint_data));
matStore.hint.fetchCommonHintMeta(hint.hint_data);
FIXME_fetchCommonHintMeta(hint.hint_data);
break;
}
case MsgHint.HintType.HINT_SELECTMSG: {
dispatch(
fetchSelectHintMeta({ selectHintData: hint.hint_data, esHint: "" })
);
matStore.hint.fetchSelectHintMeta({
FIXME_fetchSelectHintMeta({
selectHintData: hint.hint_data,
esHint: "",
});
......
import { ygopro } from "@/api";
import { reloadField } from "@/reducers/duel/mod";
import { AppDispatch } from "@/store";
import { matStore, type DuelFieldState } from "@/valtioStores";
import { type DuelFieldState, matStore } from "@/valtioStores";
type MsgReloadField = ygopro.StocGameMessage.MsgReloadField;
......
......@@ -8,8 +8,8 @@ import { fetchCheckCardMeta } from "@/reducers/duel/modal/mod";
import { AppDispatch } from "@/store";
import MsgSelectCard = ygopro.StocGameMessage.MsgSelectCard;
import {
messageStore,
fetchCheckCardMeta as FIXME_fetchCheckCardMeta,
messageStore,
} from "@/valtioStores";
import { CardZoneToChinese } from "./util";
......
......@@ -10,15 +10,14 @@ import {
} from "@/reducers/duel/mod";
import { fetchCheckCardMeta } from "@/reducers/duel/modal/mod";
import { AppDispatch } from "@/store";
import { CardZoneToChinese } from "./util";
import {
messageStore,
fetchCheckCardMeta as FIXME_fetchCheckCardMeta,
fetchSelectHintMeta as FIXME_fetchSelectHintMeta,
messageStore,
} from "@/valtioStores";
import { CardZoneToChinese } from "./util";
type MsgSelectChain = ygopro.StocGameMessage.MsgSelectChain;
export default (selectChain: MsgSelectChain, dispatch: AppDispatch) => {
const player = selectChain.player;
......
import { ygopro } from "@/api";
import { setCheckCounter } from "@/reducers/duel/mod";
import { AppDispatch } from "@/store";
import { messageStore, getCardByLocation } from "@/valtioStores";
import { getCardByLocation, messageStore } from "@/valtioStores";
type MsgSelectCounter = ygopro.StocGameMessage.MsgSelectCounter;
export default (selectCounter: MsgSelectCounter, dispatch: AppDispatch) => {
......
import { CardMeta, fetchCard } from "@/api/cards";
import { ygopro } from "@/api";
import { CardMeta, fetchCard } from "@/api/cards";
import { fetchStrings } from "@/api/strings";
import { setYesNoModalIsOpen } from "@/reducers/duel/mod";
import { fetchYesNoMeta } from "@/reducers/duel/modal/mod";
import { AppDispatch } from "@/store";
import { getCardByLocation, messageStore } from "@/valtioStores";
import { CardZoneToChinese } from "./util";
import { messageStore, getCardByLocation } from "@/valtioStores";
import { fetchStrings } from "@/api/strings";
type MsgSelectEffectYn = ygopro.StocGameMessage.MsgSelectEffectYn;
// 这里改成了 async 不知道有没有影响
......
import { ygopro, fetchCard, getCardStr } from "@/api";
import { fetchCard, getCardStr, ygopro } from "@/api";
import { setOptionModalIsOpen } from "@/reducers/duel/mod";
import { fetchOptionMeta } from "@/reducers/duel/modal/mod";
import { AppDispatch } from "@/store";
......
......@@ -8,8 +8,8 @@ import {
import { fetchCheckCardMetasV3 } from "@/reducers/duel/modal/checkCardModalV3Slice";
import { AppDispatch } from "@/store";
import {
messageStore,
fetchCheckCardMetasV3 as FIXME_fetchCheckCardMetasV3,
messageStore,
} from "@/valtioStores";
type MsgSelectSum = ygopro.StocGameMessage.MsgSelectSum;
......
......@@ -7,10 +7,9 @@ import {
} from "@/reducers/duel/mod";
import { fetchCheckCardMetasV3 } from "@/reducers/duel/modal/checkCardModalV3Slice";
import { AppDispatch } from "@/store";
import {
messageStore,
fetchCheckCardMetasV3 as FIXME_fetchCheckCardMetasV3,
messageStore,
} from "@/valtioStores";
type MsgSelectTribute = ygopro.StocGameMessage.MsgSelectTribute;
......
......@@ -8,10 +8,9 @@ import {
} from "@/reducers/duel/mod";
import { fetchCheckCardMetasV2 } from "@/reducers/duel/modal/checkCardModalV2Slice";
import { AppDispatch } from "@/store";
import {
messageStore,
fetchCheckCardMetasV2 as FIXME_fetchCheckCardMetasV2,
messageStore,
} from "@/valtioStores";
type MsgSelectUnselectCard = ygopro.StocGameMessage.MsgSelectUnselectCard;
......
import { ygopro } from "@/api";
import { fetchEsHintMeta } from "@/reducers/duel/hintSlice";
import { AppDispatch } from "@/store";
import { fetchEsHintMeta as FIXME_fetchEsHintMeta } from "@/valtioStores";
export default (_set: ygopro.StocGameMessage.MsgSet, dispatch: AppDispatch) => {
......
import { ygopro } from "@/api";
import { fetchEsHintMeta } from "@/reducers/duel/hintSlice";
import { AppDispatch } from "@/store";
import { fetchEsHintMeta as FIXME_fetchEsHintMeta } from "@/valtioStores";
export default (
......
import { ygopro } from "@/api";
import { fetchEsHintMeta } from "@/reducers/duel/hintSlice";
import { AppDispatch } from "@/store";
import { fetchEsHintMeta as FIXME_fetchEsHintMeta } from "@/valtioStores";
export default (
spSummoning: ygopro.StocGameMessage.MsgSpSummoning,
......
import { ygopro } from "@/api";
import { fetchEsHintMeta } from "@/reducers/duel/hintSlice";
import { AppDispatch } from "@/store";
import { fetchEsHintMeta as FIXME_fetchEsHintMeta } from "@/valtioStores";
export default (
......
import { ygopro } from "@/api";
import { fetchEsHintMeta } from "@/reducers/duel/hintSlice";
import { AppDispatch } from "@/store";
import { fetchEsHintMeta as FIXME_fetchEsHintMeta } from "@/valtioStores";
export default (
......
import { ygopro } from "@/api";
import { fetchEsHintMeta } from "@/reducers/duel/hintSlice";
import { AppDispatch } from "@/store";
import { fetchEsHintMeta as FIXME_fetchEsHintMeta } from "@/valtioStores";
export default (
......
......@@ -2,7 +2,6 @@ import { ygopro } from "@/api";
import { sendTimeConfirm } from "@/api/ocgcore/ocgHelper";
import { updateTimeLimit } from "@/reducers/duel/mod";
import { store } from "@/store";
import { matStore } from "@/valtioStores";
export default function handleTimeLimit(timeLimit: ygopro.StocTimeLimit) {
......
......@@ -2,7 +2,6 @@ import { ygopro } from "@/api";
import { useConfig } from "@/config";
import { setUnimplemented } from "@/reducers/duel/mod";
import { AppDispatch } from "@/store";
import { matStore } from "@/valtioStores";
const NeosConfig = useConfig();
......
import { ygopro } from "@/api";
import { updateMonsterCounters } from "@/reducers/duel/mod";
import { AppDispatch } from "@/store";
import { getCardByLocation } from "@/valtioStores";
type MsgUpdateCounter = ygopro.StocGameMessage.MsgUpdateCounter;
......
import { ygopro } from "@/api";
import { clearAllIdleInteractivities, setWaiting } from "@/reducers/duel/mod";
import { AppDispatch } from "@/store";
import {
matStore,
clearAllIdleInteractivities as FIXME_clearAllIdleInteractivities,
matStore,
} from "@/valtioStores";
export default (
......
import { ygopro } from "@/api";
import { setResult } from "@/reducers/duel/mod";
import { AppDispatch } from "@/store";
import { matStore } from "@/valtioStores";
export default (win: ygopro.StocGameMessage.MsgWin, dispatch: AppDispatch) => {
......
export * from "./types";
export * from "./store";
export * from "./methods";
export * from "./store";
export * from "./types";
import { ygopro } from "@/api";
import { matStore, messageStore } from "@/valtioStores";
import { fetchCard, getCardStr } from "@/api/cards";
import { matStore, messageStore } from "@/valtioStores";
function CardZoneToChinese(zone: ygopro.CardZone): string {
switch (zone) {
......
import { matStore } from "@/valtioStores";
import type { ygopro } from "@/api";
import { fetchCard } from "@/api/cards";
import { DESCRIPTION_LIMIT, fetchStrings, getStrings } from "@/api/strings";
import type { ygopro } from "@/api";
import { matStore } from "@/valtioStores";
const { hint } = matStore;
......
import { matStore } from "@/valtioStores";
import type { ygopro } from "@/api";
import { matStore } from "@/valtioStores";
export const getCardByLocation = (location: ygopro.CardLocation) => {
return matStore.getZone(location.location).at(location.controler)[
......
import { proxy } from "valtio";
import { cloneDeep } from "lodash-es";
import { fetchCard } from "@/api/cards";
import { proxy } from "valtio";
import { ygopro } from "@/api";
import { fetchCard } from "@/api/cards";
import type {
BothSide,
......@@ -194,7 +195,7 @@ const getZone = (zone: ygopro.CardZone) => {
const { SZONE, MZONE, GRAVE, REMOVED, HAND, DECK, EXTRA } = ygopro.CardZone;
/**
* 💡 决斗盘状态仓库,本文件核心,
* 具体介绍可以点进`PlayMatState`去看
* 具体介绍可以点进`MatState`去看
*/
export const matStore: MatState = proxy<MatState>({
magics: wrap(genDuel(genBlock(SZONE, 6)), SZONE),
......
import type { CardMeta } from "@/api/cards";
import type { ygopro } from "@/api";
import type { CardMeta } from "@/api/cards";
// >>> play mat state >>>
......
export * from "./store";
export * from "./methods";
export * from "./store";
import { type ygopro, fetchCard } from "@/api";
import { fetchCard, type ygopro } from "@/api";
import { getCardByLocation, messageStore } from "@/valtioStores";
export const fetchCheckCardMetasV2 = async ({
......
import { type ygopro, fetchCard } from "@/api";
import { fetchCard, type ygopro } from "@/api";
import { getCardByLocation, messageStore } from "@/valtioStores";
export const fetchCheckCardMetasV3 = async ({
......
export * from "./clearAllIdleInteractivities";
export * from "./fetchCheckCardMetasV2";
export * from "./fetchCheckCardMetasV3";
export * from "./clearAllIdleInteractivities";
import { proxy } from "valtio";
import type { ModalState } from "./types";
export const messageStore = proxy<ModalState>({
......
import type { CardMeta, ygopro } from "@/api";
type CardLocation = ygopro.CardLocation;
type CardLocation = ReturnType<typeof ygopro.CardLocation.prototype.toObject>;
export interface ModalState {
// 卡牌弹窗
......
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