Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baichixing
Neos
Commits
bbe1136b
Commit
bbe1136b
authored
Apr 15, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: rename to official names(gy & banished)
parent
2c33125b
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
167 additions
and
160 deletions
+167
-160
src/reducers/duel/banishedZoneSlice.ts
src/reducers/duel/banishedZoneSlice.ts
+29
-27
src/reducers/duel/cemeretySlice.ts
src/reducers/duel/cemeretySlice.ts
+32
-30
src/reducers/duel/commonSlice.ts
src/reducers/duel/commonSlice.ts
+28
-28
src/reducers/duel/mod.ts
src/reducers/duel/mod.ts
+30
-30
src/reducers/duel/util.ts
src/reducers/duel/util.ts
+6
-6
src/service/duel/move.ts
src/service/duel/move.ts
+11
-8
src/service/duel/selectIdleCmd.ts
src/service/duel/selectIdleCmd.ts
+4
-4
src/service/duel/start.ts
src/service/duel/start.ts
+6
-6
src/ui/Duel/PlayMat/BanishedZone.tsx
src/ui/Duel/PlayMat/BanishedZone.tsx
+11
-11
src/ui/Duel/PlayMat/Graveyard.tsx
src/ui/Duel/PlayMat/Graveyard.tsx
+10
-10
No files found.
src/reducers/duel/
exclusion
Slice.ts
→
src/reducers/duel/
banishedZone
Slice.ts
View file @
bbe1136b
...
...
@@ -20,28 +20,30 @@ import {
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
export
interface
Exclusion
State
extends
DuelFieldState
{}
export
interface
BanishedZone
State
extends
DuelFieldState
{}
// 初始化除外区状态
export
const
init
Exclusion
Impl
:
CaseReducer
<
export
const
init
BanishedZone
Impl
:
CaseReducer
<
DuelState
,
PayloadAction
<
number
>
>
=
(
state
,
action
)
=>
{
const
player
=
action
.
payload
;
if
(
judgeSelf
(
player
,
state
))
{
state
.
me
Exclusion
=
{
inner
:
[]
};
state
.
me
BanishedZone
=
{
inner
:
[]
};
}
else
{
state
.
op
Exclusion
=
{
inner
:
[]
};
state
.
op
BanishedZone
=
{
inner
:
[]
};
}
};
// 增加除外区
export
const
fetch
Exclusion
Meta
=
createAsyncMetaThunk
(
"
duel/fetch
Exclusion
Meta
"
export
const
fetch
BanishedZone
Meta
=
createAsyncMetaThunk
(
"
duel/fetch
BanishedZone
Meta
"
);
export
const
exclusionCase
=
(
builder
:
ActionReducerMapBuilder
<
DuelState
>
)
=>
{
builder
.
addCase
(
fetchExclusionMeta
.
pending
,
(
state
,
action
)
=>
{
export
const
banishedZoneCase
=
(
builder
:
ActionReducerMapBuilder
<
DuelState
>
)
=>
{
builder
.
addCase
(
fetchBanishedZoneMeta
.
pending
,
(
state
,
action
)
=>
{
// Meta结果没返回之前先更新`ID`
const
controler
=
action
.
meta
.
arg
.
controler
;
const
sequence
=
action
.
meta
.
arg
.
sequence
;
...
...
@@ -58,51 +60,51 @@ export const exclusionCase = (builder: ActionReducerMapBuilder<DuelState>) => {
counters
:
{},
};
if
(
judgeSelf
(
controler
,
state
))
{
extendState
(
state
.
me
Exclusion
,
newExclusion
);
extendState
(
state
.
me
BanishedZone
,
newExclusion
);
}
else
{
extendState
(
state
.
op
Exclusion
,
newExclusion
);
extendState
(
state
.
op
BanishedZone
,
newExclusion
);
}
});
builder
.
addCase
(
fetch
Exclusion
Meta
.
fulfilled
,
(
state
,
action
)
=>
{
builder
.
addCase
(
fetch
BanishedZone
Meta
.
fulfilled
,
(
state
,
action
)
=>
{
const
controler
=
action
.
payload
.
controler
;
const
sequence
=
action
.
payload
.
sequence
;
const
meta
=
action
.
payload
.
meta
;
if
(
judgeSelf
(
controler
,
state
))
{
extendMeta
(
state
.
me
Exclusion
,
meta
,
sequence
);
extendMeta
(
state
.
me
BanishedZone
,
meta
,
sequence
);
}
else
{
extendMeta
(
state
.
op
Exclusion
,
meta
,
sequence
);
extendMeta
(
state
.
op
BanishedZone
,
meta
,
sequence
);
}
});
};
// 删除除外区
export
const
remove
Exclusion
Impl
:
CaseReducer
<
export
const
remove
BanishedZone
Impl
:
CaseReducer
<
DuelState
,
PayloadAction
<
{
controler
:
number
;
sequence
:
number
}
>
>
=
(
state
,
action
)
=>
{
const
exclusion
=
judgeSelf
(
action
.
payload
.
controler
,
state
)
?
state
.
me
Exclusion
:
state
.
op
Exclusion
;
removeCard
(
exclusion
,
action
.
payload
.
sequence
);
const
banishedZone
=
judgeSelf
(
action
.
payload
.
controler
,
state
)
?
state
.
me
BanishedZone
:
state
.
op
BanishedZone
;
removeCard
(
banishedZone
,
action
.
payload
.
sequence
);
};
export
const
add
Exclusion
IdleInteractivitiesImpl
:
DuelReducer
<
{
export
const
add
BanishedZone
IdleInteractivitiesImpl
:
DuelReducer
<
{
player
:
number
;
sequence
:
number
;
interactivity
:
Interactivity
<
number
>
;
}
>
=
(
state
,
action
)
=>
{
const
exclusion
=
judgeSelf
(
action
.
payload
.
player
,
state
)
?
state
.
me
Exclusion
:
state
.
op
Exclusion
;
const
banishedZone
=
judgeSelf
(
action
.
payload
.
player
,
state
)
?
state
.
me
BanishedZone
:
state
.
op
BanishedZone
;
extendIdleInteractivities
(
exclusion
,
banishedZone
,
action
.
payload
.
sequence
,
action
.
payload
.
interactivity
);
};
export
const
selectMe
Exclusion
=
(
state
:
RootState
)
=>
state
.
duel
.
me
Exclusion
||
{
inner
:
[]
};
export
const
select
opExclusion
=
(
state
:
RootState
)
=>
state
.
duel
.
op
Exclusion
||
{
inner
:
[]
};
export
const
selectMe
BanishedZone
=
(
state
:
RootState
)
=>
state
.
duel
.
me
BanishedZone
||
{
inner
:
[]
};
export
const
select
OpBanishedZone
=
(
state
:
RootState
)
=>
state
.
duel
.
op
BanishedZone
||
{
inner
:
[]
};
src/reducers/duel/cemeretySlice.ts
View file @
bbe1136b
...
...
@@ -20,32 +20,34 @@ import {
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
export
interface
Cemetery
State
extends
DuelFieldState
{}
export
interface
Graveyard
State
extends
DuelFieldState
{}
// 初始化墓地状态
export
const
init
CemeteryImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
number
>>
=
(
s
tate
,
action
)
=>
{
export
const
init
GraveyardImpl
:
CaseReducer
<
DuelS
tate
,
PayloadAction
<
number
>
>
=
(
state
,
action
)
=>
{
const
player
=
action
.
payload
;
if
(
judgeSelf
(
player
,
state
))
{
state
.
me
Cemetery
=
{
inner
:
[]
};
state
.
me
Graveyard
=
{
inner
:
[]
};
}
else
{
state
.
op
Cemetery
=
{
inner
:
[]
};
state
.
op
Graveyard
=
{
inner
:
[]
};
}
};
// 增加墓地
export
const
fetchCemeteryMeta
=
createAsyncMetaThunk
(
"
duel/fetchCemeteryMeta
"
);
export
const
fetchGraveyardMeta
=
createAsyncMetaThunk
(
"
duel/fetchGraveyardMeta
"
);
export
const
cemetery
Case
=
(
builder
:
ActionReducerMapBuilder
<
DuelState
>
)
=>
{
builder
.
addCase
(
fetch
Cemetery
Meta
.
pending
,
(
state
,
action
)
=>
{
export
const
graveyard
Case
=
(
builder
:
ActionReducerMapBuilder
<
DuelState
>
)
=>
{
builder
.
addCase
(
fetch
Graveyard
Meta
.
pending
,
(
state
,
action
)
=>
{
// Meta结果没返回之前先更新`ID`
const
controler
=
action
.
meta
.
arg
.
controler
;
const
sequence
=
action
.
meta
.
arg
.
sequence
;
const
code
=
action
.
meta
.
arg
.
code
;
const
new
Cemetery
=
{
const
new
Graveyard
=
{
occupant
:
{
id
:
code
,
data
:
{},
text
:
{}
},
location
:
{
controler
,
...
...
@@ -56,51 +58,51 @@ export const cemeteryCase = (builder: ActionReducerMapBuilder<DuelState>) => {
counters
:
{},
};
if
(
judgeSelf
(
controler
,
state
))
{
extendState
(
state
.
me
Cemetery
,
newCemetery
);
extendState
(
state
.
me
Graveyard
,
newGraveyard
);
}
else
{
extendState
(
state
.
op
Cemetery
,
newCemetery
);
extendState
(
state
.
op
Graveyard
,
newGraveyard
);
}
});
builder
.
addCase
(
fetch
Cemetery
Meta
.
fulfilled
,
(
state
,
action
)
=>
{
builder
.
addCase
(
fetch
Graveyard
Meta
.
fulfilled
,
(
state
,
action
)
=>
{
const
controler
=
action
.
payload
.
controler
;
const
sequence
=
action
.
payload
.
sequence
;
const
meta
=
action
.
payload
.
meta
;
if
(
judgeSelf
(
controler
,
state
))
{
extendMeta
(
state
.
me
Cemetery
,
meta
,
sequence
);
extendMeta
(
state
.
me
Graveyard
,
meta
,
sequence
);
}
else
{
extendMeta
(
state
.
op
Cemetery
,
meta
,
sequence
);
extendMeta
(
state
.
op
Graveyard
,
meta
,
sequence
);
}
});
};
// 删除墓地
export
const
remove
Cemetery
Impl
:
CaseReducer
<
export
const
remove
Graveyard
Impl
:
CaseReducer
<
DuelState
,
PayloadAction
<
{
controler
:
number
;
sequence
:
number
}
>
>
=
(
state
,
action
)
=>
{
const
cemetery
=
judgeSelf
(
action
.
payload
.
controler
,
state
)
?
state
.
me
Cemetery
:
state
.
op
Cemetery
;
removeCard
(
cemetery
,
action
.
payload
.
sequence
);
const
graveyard
=
judgeSelf
(
action
.
payload
.
controler
,
state
)
?
state
.
me
Graveyard
:
state
.
op
Graveyard
;
removeCard
(
graveyard
,
action
.
payload
.
sequence
);
};
export
const
add
Cemetery
IdleInteractivitiesImpl
:
DuelReducer
<
{
export
const
add
Graveyard
IdleInteractivitiesImpl
:
DuelReducer
<
{
player
:
number
;
sequence
:
number
;
interactivity
:
Interactivity
<
number
>
;
}
>
=
(
state
,
action
)
=>
{
const
cemetery
=
judgeSelf
(
action
.
payload
.
player
,
state
)
?
state
.
me
Cemetery
:
state
.
op
Cemetery
;
const
graveyard
=
judgeSelf
(
action
.
payload
.
player
,
state
)
?
state
.
me
Graveyard
:
state
.
op
Graveyard
;
extendIdleInteractivities
(
cemetery
,
graveyard
,
action
.
payload
.
sequence
,
action
.
payload
.
interactivity
);
};
export
const
selectMe
Cemetery
=
(
state
:
RootState
)
=>
state
.
duel
.
me
Cemetery
||
{
inner
:
[]
};
export
const
selectOp
Cemetery
=
(
state
:
RootState
)
=>
state
.
duel
.
op
Cemetery
||
{
inner
:
[]
};
export
const
selectMe
Graveyard
=
(
state
:
RootState
)
=>
state
.
duel
.
me
Graveyard
||
{
inner
:
[]
};
export
const
selectOp
Graveyard
=
(
state
:
RootState
)
=>
state
.
duel
.
op
Graveyard
||
{
inner
:
[]
};
src/reducers/duel/commonSlice.ts
View file @
bbe1136b
...
...
@@ -24,16 +24,16 @@ export const clearAllIdleInteractivitiesImpl: DuelReducer<number> = (
state
.
meHands
,
state
.
meMonsters
,
state
.
meMagics
,
state
.
me
Cemetery
,
state
.
me
Exclusion
,
state
.
me
Graveyard
,
state
.
me
BanishedZone
,
state
.
meExtraDeck
,
]
:
[
state
.
opHands
,
state
.
opMonsters
,
state
.
opMagics
,
state
.
op
Cemetery
,
state
.
op
Exclusion
,
state
.
op
Graveyard
,
state
.
op
BanishedZone
,
state
.
opExtraDeck
,
];
...
...
@@ -51,15 +51,15 @@ export const clearAllPlaceInteractivitiesImpl: DuelReducer<number> = (
state
.
meHands
,
state
.
meMonsters
,
state
.
meMagics
,
state
.
me
Cemetery
,
state
.
me
Exclusion
,
state
.
me
Graveyard
,
state
.
me
BanishedZone
,
]
:
[
state
.
opHands
,
state
.
opMonsters
,
state
.
opMagics
,
state
.
op
Cemetery
,
state
.
op
Exclusion
,
state
.
op
Graveyard
,
state
.
op
BanishedZone
,
];
states
.
forEach
((
item
)
=>
clearPlaceInteractivities
(
item
));
...
...
@@ -106,18 +106,18 @@ export const updateFieldDataImpl: DuelReducer<MsgUpdateData> = (
break
;
}
case
ygopro
.
CardZone
.
GRAVE
:
{
const
cemetery
=
judgeSelf
(
player
,
state
)
?
state
.
me
Cemetery
:
state
.
op
Cemetery
;
updateCardData
(
cemetery
,
actions
);
const
graveyard
=
judgeSelf
(
player
,
state
)
?
state
.
me
Graveyard
:
state
.
op
Graveyard
;
updateCardData
(
graveyard
,
actions
);
break
;
}
case
ygopro
.
CardZone
.
REMOVED
:
{
const
exclusion
=
judgeSelf
(
player
,
state
)
?
state
.
me
Exclusion
:
state
.
op
Exclusion
;
updateCardData
(
exclusion
,
actions
);
const
BanishedZone
=
judgeSelf
(
player
,
state
)
?
state
.
me
BanishedZone
:
state
.
op
BanishedZone
;
updateCardData
(
BanishedZone
,
actions
);
break
;
}
...
...
@@ -140,10 +140,10 @@ export const reloadFieldImpl: DuelReducer<MsgReloadField> = (state, action) => {
state
.
opMonsters
=
{
inner
:
[]
};
state
.
meMagics
=
{
inner
:
[]
};
state
.
opMagics
=
{
inner
:
[]
};
state
.
me
Cemetery
=
{
inner
:
[]
};
state
.
op
Cemetery
=
{
inner
:
[]
};
state
.
me
Exclusion
=
{
inner
:
[]
};
state
.
op
Exclusion
=
{
inner
:
[]
};
state
.
me
Graveyard
=
{
inner
:
[]
};
state
.
op
Graveyard
=
{
inner
:
[]
};
state
.
me
BanishedZone
=
{
inner
:
[]
};
state
.
op
BanishedZone
=
{
inner
:
[]
};
state
.
meHands
=
{
inner
:
[]
};
state
.
opHands
=
{
inner
:
[]
};
...
...
@@ -183,20 +183,20 @@ export const reloadFieldImpl: DuelReducer<MsgReloadField> = (state, action) => {
player
);
// GRAVE
const
cemetery
=
judgeSelf
(
player
,
state
)
?
state
.
me
Cemetery
:
state
.
op
Cemetery
;
const
graveyard
=
judgeSelf
(
player
,
state
)
?
state
.
me
Graveyard
:
state
.
op
Graveyard
;
reloadFieldMeta
(
cemetery
,
graveyard
,
reload
.
zone_actions
.
filter
((
item
)
=>
item
.
zone
==
ygopro
.
CardZone
.
GRAVE
),
player
);
// REMOVED
const
exclusion
=
judgeSelf
(
player
,
state
)
?
state
.
me
Exclusion
:
state
.
op
Exclusion
;
const
banishedZone
=
judgeSelf
(
player
,
state
)
?
state
.
me
BanishedZone
:
state
.
op
BanishedZone
;
reloadFieldMeta
(
exclusion
,
banishedZone
,
reload
.
zone_actions
.
filter
(
(
item
)
=>
item
.
zone
==
ygopro
.
CardZone
.
REMOVED
),
...
...
src/reducers/duel/mod.ts
View file @
bbe1136b
...
...
@@ -9,11 +9,18 @@ import { ygopro } from "@/api/ocgcore/idl/ocgcore";
import
{
RootState
}
from
"
@/store
"
;
import
{
addCemeteryIdleInteractivitiesImpl
,
cemeteryCase
,
CemeteryState
,
initCemeteryImpl
,
removeCemeteryImpl
,
addBanishedZoneIdleInteractivitiesImpl
,
banishedZoneCase
,
BanishedZoneState
,
initBanishedZoneImpl
,
removeBanishedZoneImpl
,
}
from
"
./banishedZoneSlice
"
;
import
{
addGraveyardIdleInteractivitiesImpl
,
graveyardCase
,
GraveyardState
,
initGraveyardImpl
,
removeGraveyardImpl
,
}
from
"
./cemeretySlice
"
;
import
{
clearAllIdleInteractivitiesImpl
,
...
...
@@ -22,13 +29,6 @@ import {
updateFieldDataImpl
,
}
from
"
./commonSlice
"
;
import
{
DeckState
,
initDeckImpl
}
from
"
./deckSlice
"
;
import
{
addExclusionIdleInteractivitiesImpl
,
exclusionCase
,
ExclusionState
,
initExclusionImpl
,
removeExclusionImpl
,
}
from
"
./exclusionSlice
"
;
import
{
addExtraDeckIdleInteractivitiesImpl
,
extraDeckCase
,
...
...
@@ -136,11 +136,11 @@ export interface DuelState {
meMagics
?:
MagicState
;
// 自己的魔法陷阱区状态
opMagics
?:
MagicState
;
// 对手的魔法陷阱区状态
me
Cemetery
?:
Cemetery
State
;
// 自己的墓地状态
op
Cemetery
?:
Cemetery
State
;
// 对手的墓地状态
me
Graveyard
?:
Graveyard
State
;
// 自己的墓地状态
op
Graveyard
?:
Graveyard
State
;
// 对手的墓地状态
me
Exclusion
?:
Exclusion
State
;
// 自己的除外区状态
op
Exclusion
?:
Exclusion
State
;
// 对手的除外区状态
me
BanishedZone
?:
BanishedZone
State
;
// 自己的除外区状态
op
BanishedZone
?:
BanishedZone
State
;
// 对手的除外区状态
meDeck
?:
DeckState
;
// 自己的卡组状态
opDeck
?:
DeckState
;
// 对手的卡组状态
...
...
@@ -239,14 +239,14 @@ const duelSlice = createSlice({
removeMagic
:
removeMagicImpl
,
// 墓地相关`Reducer`
init
Cemetery
:
initCemetery
Impl
,
remove
Cemetery
:
removeCemetery
Impl
,
add
CemeteryIdleInteractivities
:
addCemetery
IdleInteractivitiesImpl
,
init
Graveyard
:
initGraveyard
Impl
,
remove
Graveyard
:
removeGraveyard
Impl
,
add
GraveyardIdleInteractivities
:
addGraveyard
IdleInteractivitiesImpl
,
// 除外区相关`Reducer`
init
Exclusion
:
initExclusion
Impl
,
remove
Exclusion
:
removeExclusion
Impl
,
add
ExclusionIdleInteractivities
:
addExclusion
IdleInteractivitiesImpl
,
init
BanishedZone
:
initBanishedZone
Impl
,
remove
BanishedZone
:
removeBanishedZone
Impl
,
add
BanishedZoneIdleInteractivities
:
addBanishedZone
IdleInteractivitiesImpl
,
// 卡组相关`Reducer`
initDeck
:
initDeckImpl
,
...
...
@@ -326,8 +326,8 @@ const duelSlice = createSlice({
hintCase
(
builder
);
monsterCase
(
builder
);
magicCase
(
builder
);
cemetery
Case
(
builder
);
exclusion
Case
(
builder
);
graveyard
Case
(
builder
);
banishedZone
Case
(
builder
);
extraDeckCase
(
builder
);
checkCardModalCase
(
builder
);
YesNoModalCase
(
builder
);
...
...
@@ -370,9 +370,9 @@ export const {
setMagicPosition
,
removeMagic
,
removeHand
,
init
Cemetery
,
remove
Cemetery
,
add
Cemetery
IdleInteractivities
,
init
Graveyard
,
remove
Graveyard
,
add
Graveyard
IdleInteractivities
,
setCardListModalIsOpen
,
setCardListModalInfo
,
setCheckCardModalIsOpen
,
...
...
@@ -390,9 +390,9 @@ export const {
initDeck
,
removeExtraDeck
,
addExtraDeckIdleInteractivities
,
init
Exclusion
,
remove
Exclusion
,
add
Exclusion
IdleInteractivities
,
init
BanishedZone
,
remove
BanishedZone
,
add
BanishedZone
IdleInteractivities
,
setCheckCardModalV2IsOpen
,
setCheckCardModalV2MinMax
,
setCheckCardModalV2CancelAble
,
...
...
src/reducers/duel/util.ts
View file @
bbe1136b
...
...
@@ -61,15 +61,15 @@ export function findCardByLocation(
return
magics
?.
inner
.
find
(
finder
);
}
case
ygopro
.
CardZone
.
REMOVED
:
{
const
exclusion
s
=
judgeSelf
(
controler
,
state
)
?
state
.
me
Exclusion
:
state
.
op
Exclusion
;
return
exclusion
s
?.
inner
.
find
(
finder
);
const
banishedZone
s
=
judgeSelf
(
controler
,
state
)
?
state
.
me
BanishedZone
:
state
.
op
BanishedZone
;
return
banishedZone
s
?.
inner
.
find
(
finder
);
}
case
ygopro
.
CardZone
.
GRAVE
:
{
const
cemerety
=
judgeSelf
(
controler
,
state
)
?
state
.
me
Cemetery
:
state
.
op
Cemetery
;
?
state
.
me
Graveyard
:
state
.
op
Graveyard
;
return
cemerety
?.
inner
.
find
(
finder
);
}
default
:
{
...
...
src/service/duel/move.ts
View file @
bbe1136b
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
MsgMove
=
ygopro
.
StocGameMessage
.
MsgMove
;
import
{
fetch
CemeteryMeta
}
from
"
@/reducers/duel/cemerety
Slice
"
;
import
{
fetch
ExclusionMeta
}
from
"
@/reducers/duel/exclusion
Slice
"
;
import
{
fetch
BanishedZoneMeta
}
from
"
@/reducers/duel/banishedZone
Slice
"
;
import
{
fetch
GraveyardMeta
}
from
"
@/reducers/duel/cemerety
Slice
"
;
import
{
fetchExtraDeckMeta
}
from
"
@/reducers/duel/extraDeckSlice
"
;
import
{
insertHandMeta
}
from
"
@/reducers/duel/handsSlice
"
;
import
{
fetchMagicMeta
}
from
"
@/reducers/duel/magicSlice
"
;
import
{
removeCemetery
,
removeExclusion
,
removeBanishedZone
,
removeExtraDeck
,
removeGraveyard
,
removeHand
,
removeMagic
,
removeMonster
,
...
...
@@ -52,14 +52,17 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
}
case
ygopro
.
CardZone
.
GRAVE
:
{
dispatch
(
remove
Cemetery
({
controler
:
from
.
controler
,
sequence
:
from
.
sequence
})
remove
Graveyard
({
controler
:
from
.
controler
,
sequence
:
from
.
sequence
})
);
break
;
}
case
ygopro
.
CardZone
.
REMOVED
:
{
dispatch
(
removeExclusion
({
controler
:
from
.
controler
,
sequence
:
from
.
sequence
})
removeBanishedZone
({
controler
:
from
.
controler
,
sequence
:
from
.
sequence
,
})
);
break
;
...
...
@@ -128,7 +131,7 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
}
case
ygopro
.
CardZone
.
GRAVE
:
{
dispatch
(
fetch
Cemetery
Meta
({
fetch
Graveyard
Meta
({
controler
:
to
.
controler
,
sequence
:
to
.
sequence
,
code
,
...
...
@@ -146,7 +149,7 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
}
case
ygopro
.
CardZone
.
REMOVED
:
{
dispatch
(
fetch
Exclusion
Meta
({
fetch
BanishedZone
Meta
({
controler
:
to
.
controler
,
sequence
:
to
.
sequence
,
code
,
...
...
src/service/duel/selectIdleCmd.ts
View file @
bbe1136b
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
Interactivity
,
InteractType
}
from
"
@/reducers/duel/generic
"
;
import
{
addCemeteryIdleInteractivities
,
addExclusionIdleInteractivities
,
addBanishedZoneIdleInteractivities
,
addExtraDeckIdleInteractivities
,
addGraveyardIdleInteractivities
,
addHandsIdleInteractivity
,
addMagicIdleInteractivities
,
addMonsterIdleInteractivities
,
...
...
@@ -83,12 +83,12 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
break
;
}
case
ygopro
.
CardZone
.
GRAVE
:
{
dispatcher
(
data
,
interactType
,
add
Cemetery
IdleInteractivities
);
dispatcher
(
data
,
interactType
,
add
Graveyard
IdleInteractivities
);
break
;
}
case
ygopro
.
CardZone
.
REMOVED
:
{
dispatcher
(
data
,
interactType
,
add
Exclusion
IdleInteractivities
);
dispatcher
(
data
,
interactType
,
add
BanishedZone
IdleInteractivities
);
break
;
}
...
...
src/service/duel/start.ts
View file @
bbe1136b
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
infoInit
,
init
Cemetery
,
init
BanishedZone
,
initDeck
,
init
Exclusion
,
init
Graveyard
,
initHint
,
initMagics
,
initMonsters
,
...
...
@@ -40,11 +40,11 @@ export default (
dispatch
(
initMonsters
(
1
));
dispatch
(
initMagics
(
0
));
dispatch
(
initMagics
(
1
));
dispatch
(
init
Cemetery
(
0
));
dispatch
(
init
Cemetery
(
1
));
dispatch
(
init
Graveyard
(
0
));
dispatch
(
init
Graveyard
(
1
));
dispatch
(
initDeck
({
player
:
0
,
deskSize
:
start
.
deckSize1
}));
dispatch
(
initDeck
({
player
:
1
,
deskSize
:
start
.
deckSize2
}));
dispatch
(
init
Exclusion
(
0
));
dispatch
(
init
Exclusion
(
1
));
dispatch
(
init
BanishedZone
(
0
));
dispatch
(
init
BanishedZone
(
1
));
dispatch
(
initHint
());
};
src/ui/Duel/PlayMat/BanishedZone.tsx
View file @
bbe1136b
...
...
@@ -3,37 +3,37 @@ import * as BABYLON from "@babylonjs/core";
import
{
useConfig
}
from
"
@/config
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectMe
Exclusion
,
select
opExclusion
,
}
from
"
@/reducers/duel/
exclusion
Slice
"
;
selectMe
BanishedZone
,
select
OpBanishedZone
,
}
from
"
@/reducers/duel/
banishedZone
Slice
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
const
NeosConfig
=
useConfig
();
export
const
BanishedZone
=
()
=>
{
const
me
Exclusion
=
useAppSelector
(
selectMeExclusion
).
inner
;
const
op
Exclusion
=
useAppSelector
(
selectopExclusion
).
inner
;
const
me
BanishedZone
=
useAppSelector
(
selectMeBanishedZone
).
inner
;
const
op
BanishedZone
=
useAppSelector
(
selectOpBanishedZone
).
inner
;
return
(
<>
<
SingleSlot
state=
{
me
Exclusion
}
position=
{
banishedZonePosition
(
0
,
me
Exclusion
.
length
)
}
state=
{
me
BanishedZone
}
position=
{
banishedZonePosition
(
0
,
me
BanishedZone
.
length
)
}
rotation=
{
cardSlotRotation
(
false
)
}
/>
<
SingleSlot
state=
{
op
Exclusion
}
position=
{
banishedZonePosition
(
1
,
op
Exclusion
.
length
)
}
state=
{
op
BanishedZone
}
position=
{
banishedZonePosition
(
1
,
op
BanishedZone
.
length
)
}
rotation=
{
cardSlotRotation
(
true
)
}
/>
</>
);
};
const
banishedZonePosition
=
(
player
:
number
,
exclusion
Length
:
number
)
=>
{
const
banishedZonePosition
=
(
player
:
number
,
banishedZone
Length
:
number
)
=>
{
const
x
=
player
==
0
?
3.2
:
-
3.2
;
const
y
=
(
Depth
*
exclusion
Length
)
/
2
+
NeosConfig
.
ui
.
card
.
floating
;
const
y
=
(
Depth
*
banishedZone
Length
)
/
2
+
NeosConfig
.
ui
.
card
.
floating
;
const
z
=
player
==
0
?
-
0.7
:
0.7
;
return
new
BABYLON
.
Vector3
(
x
,
y
,
z
);
...
...
src/ui/Duel/PlayMat/Graveyard.tsx
View file @
bbe1136b
...
...
@@ -3,8 +3,8 @@ import * as BABYLON from "@babylonjs/core";
import
{
useConfig
}
from
"
@/config
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectMe
Cemetery
,
selectOp
Cemetery
,
selectMe
Graveyard
,
selectOp
Graveyard
,
}
from
"
@/reducers/duel/cemeretySlice
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
...
...
@@ -12,28 +12,28 @@ import { Depth, SingleSlot } from "./SingleSlot";
const
NeosConfig
=
useConfig
();
export
const
Graveyard
=
()
=>
{
const
me
Cemetery
=
useAppSelector
(
selectMeCemetery
).
inner
;
const
op
Cemetery
=
useAppSelector
(
selectOpCemetery
).
inner
;
const
me
Graveyard
=
useAppSelector
(
selectMeGraveyard
).
inner
;
const
op
Graveyard
=
useAppSelector
(
selectOpGraveyard
).
inner
;
return
(
<>
<
SingleSlot
state=
{
me
Cemetery
}
position=
{
cemeteryPosition
(
0
,
meCemetery
.
length
)
}
state=
{
me
Graveyard
}
position=
{
graveyardPosition
(
0
,
meGraveyard
.
length
)
}
rotation=
{
cardSlotRotation
(
false
)
}
/>
<
SingleSlot
state=
{
op
Cemetery
}
position=
{
cemeteryPosition
(
1
,
opCemetery
.
length
)
}
state=
{
op
Graveyard
}
position=
{
graveyardPosition
(
1
,
opGraveyard
.
length
)
}
rotation=
{
cardSlotRotation
(
true
)
}
/>
</>
);
};
const
cemeteryPosition
=
(
player
:
number
,
cemetery
Length
:
number
)
=>
{
const
graveyardPosition
=
(
player
:
number
,
graveyard
Length
:
number
)
=>
{
const
x
=
player
==
0
?
3.2
:
-
3.2
;
const
y
=
(
Depth
*
cemetery
Length
)
/
2
+
NeosConfig
.
ui
.
card
.
floating
;
const
y
=
(
Depth
*
graveyard
Length
)
/
2
+
NeosConfig
.
ui
.
card
.
floating
;
const
z
=
player
==
0
?
-
2.0
:
2.0
;
return
new
BABYLON
.
Vector3
(
x
,
y
,
z
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment