Commit 3fdb3d4e authored by Chunchi Che's avatar Chunchi Che

add counters in CardState

parent f586fbb6
Pipeline #20925 passed with stages
in 16 minutes and 37 seconds
...@@ -51,6 +51,7 @@ export const cemeteryCase = (builder: ActionReducerMapBuilder<DuelState>) => { ...@@ -51,6 +51,7 @@ export const cemeteryCase = (builder: ActionReducerMapBuilder<DuelState>) => {
sequence, sequence,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}; };
if (judgeSelf(controler, state)) { if (judgeSelf(controler, state)) {
extendState(state.meCemetery, newCemetery); extendState(state.meCemetery, newCemetery);
......
...@@ -24,6 +24,7 @@ export const initDeckImpl: CaseReducer< ...@@ -24,6 +24,7 @@ export const initDeckImpl: CaseReducer<
location: ygopro.CardZone.DECK, location: ygopro.CardZone.DECK,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}); });
} }
......
...@@ -53,6 +53,7 @@ export const exclusionCase = (builder: ActionReducerMapBuilder<DuelState>) => { ...@@ -53,6 +53,7 @@ export const exclusionCase = (builder: ActionReducerMapBuilder<DuelState>) => {
sequence, sequence,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}; };
if (judgeSelf(controler, state)) { if (judgeSelf(controler, state)) {
extendState(state.meExclusion, newExclusion); extendState(state.meExclusion, newExclusion);
......
...@@ -40,6 +40,7 @@ export const extraDeckCase = (builder: ActionReducerMapBuilder<DuelState>) => { ...@@ -40,6 +40,7 @@ export const extraDeckCase = (builder: ActionReducerMapBuilder<DuelState>) => {
location: ygopro.CardZone.EXTRA, location: ygopro.CardZone.EXTRA,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}; };
}); });
state.meExtraDeck = { inner: cards }; state.meExtraDeck = { inner: cards };
...@@ -64,6 +65,7 @@ export const extraDeckCase = (builder: ActionReducerMapBuilder<DuelState>) => { ...@@ -64,6 +65,7 @@ export const extraDeckCase = (builder: ActionReducerMapBuilder<DuelState>) => {
sequence, sequence,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}; };
const extraDeck = judgeSelf(controler, state) const extraDeck = judgeSelf(controler, state)
? state.meExtraDeck ? state.meExtraDeck
......
...@@ -34,6 +34,7 @@ export interface CardState { ...@@ -34,6 +34,7 @@ export interface CardState {
sequence: number; sequence: number;
}>; // 选择位置状态下的互动信息 }>; // 选择位置状态下的互动信息
overlay_materials?: CardMeta[]; // 超量素材 overlay_materials?: CardMeta[]; // 超量素材
counters: { [type: number]: number }; // 指示器
reload?: boolean; // 这个字段会在收到MSG_RELOAD_FIELD的时候设置成true,在收到MSG_UPDATE_DATE的时候设置成false reload?: boolean; // 这个字段会在收到MSG_RELOAD_FIELD的时候设置成true,在收到MSG_UPDATE_DATE的时候设置成false
} }
...@@ -351,6 +352,7 @@ export function reloadFieldMeta<T extends DuelFieldState>( ...@@ -351,6 +352,7 @@ export function reloadFieldMeta<T extends DuelFieldState>(
position: action.position, position: action.position,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
reload: true, reload: true,
}; };
}); });
......
...@@ -93,6 +93,7 @@ export const handsCase = (builder: ActionReducerMapBuilder<DuelState>) => { ...@@ -93,6 +93,7 @@ export const handsCase = (builder: ActionReducerMapBuilder<DuelState>) => {
controler: player, controler: player,
location: ygopro.CardZone.HAND, location: ygopro.CardZone.HAND,
}, },
counters: {},
idleInteractivities: [], idleInteractivities: [],
}; };
}); });
...@@ -130,6 +131,7 @@ export const handsCase = (builder: ActionReducerMapBuilder<DuelState>) => { ...@@ -130,6 +131,7 @@ export const handsCase = (builder: ActionReducerMapBuilder<DuelState>) => {
occupant: { id: code, data: {}, text: {} }, occupant: { id: code, data: {}, text: {} },
location: { controler }, location: { controler },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}); });
}); });
builder.addCase(insertHandMeta.fulfilled, (state, action) => { builder.addCase(insertHandMeta.fulfilled, (state, action) => {
...@@ -154,6 +156,7 @@ export const handsCase = (builder: ActionReducerMapBuilder<DuelState>) => { ...@@ -154,6 +156,7 @@ export const handsCase = (builder: ActionReducerMapBuilder<DuelState>) => {
location: ygopro.CardZone.HAND, location: ygopro.CardZone.HAND,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}; };
}); });
......
...@@ -37,6 +37,7 @@ export const initMagicsImpl: CaseReducer<DuelState, PayloadAction<number>> = ( ...@@ -37,6 +37,7 @@ export const initMagicsImpl: CaseReducer<DuelState, PayloadAction<number>> = (
sequence: 0, sequence: 0,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}, },
{ {
location: { location: {
...@@ -45,6 +46,7 @@ export const initMagicsImpl: CaseReducer<DuelState, PayloadAction<number>> = ( ...@@ -45,6 +46,7 @@ export const initMagicsImpl: CaseReducer<DuelState, PayloadAction<number>> = (
sequence: 1, sequence: 1,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}, },
{ {
location: { location: {
...@@ -53,6 +55,7 @@ export const initMagicsImpl: CaseReducer<DuelState, PayloadAction<number>> = ( ...@@ -53,6 +55,7 @@ export const initMagicsImpl: CaseReducer<DuelState, PayloadAction<number>> = (
sequence: 2, sequence: 2,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}, },
{ {
location: { location: {
...@@ -61,6 +64,7 @@ export const initMagicsImpl: CaseReducer<DuelState, PayloadAction<number>> = ( ...@@ -61,6 +64,7 @@ export const initMagicsImpl: CaseReducer<DuelState, PayloadAction<number>> = (
sequence: 3, sequence: 3,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}, },
{ {
location: { location: {
...@@ -69,6 +73,7 @@ export const initMagicsImpl: CaseReducer<DuelState, PayloadAction<number>> = ( ...@@ -69,6 +73,7 @@ export const initMagicsImpl: CaseReducer<DuelState, PayloadAction<number>> = (
sequence: 4, sequence: 4,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}, },
{ {
// 场地区 // 场地区
...@@ -78,6 +83,7 @@ export const initMagicsImpl: CaseReducer<DuelState, PayloadAction<number>> = ( ...@@ -78,6 +83,7 @@ export const initMagicsImpl: CaseReducer<DuelState, PayloadAction<number>> = (
sequence: 5, sequence: 5,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}, },
], ],
}; };
......
...@@ -40,6 +40,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = ( ...@@ -40,6 +40,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = (
sequence: 0, sequence: 0,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}, },
{ {
location: { location: {
...@@ -48,6 +49,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = ( ...@@ -48,6 +49,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = (
sequence: 1, sequence: 1,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}, },
{ {
location: { location: {
...@@ -56,6 +58,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = ( ...@@ -56,6 +58,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = (
sequence: 2, sequence: 2,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}, },
{ {
location: { location: {
...@@ -64,6 +67,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = ( ...@@ -64,6 +67,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = (
sequence: 3, sequence: 3,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}, },
{ {
location: { location: {
...@@ -72,6 +76,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = ( ...@@ -72,6 +76,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = (
sequence: 4, sequence: 4,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}, },
{ {
location: { location: {
...@@ -80,6 +85,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = ( ...@@ -80,6 +85,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = (
sequence: 5, sequence: 5,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}, },
{ {
location: { location: {
...@@ -88,6 +94,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = ( ...@@ -88,6 +94,7 @@ export const initMonstersImpl: CaseReducer<DuelState, PayloadAction<number>> = (
sequence: 6, sequence: 6,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {},
}, },
], ],
}; };
......
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