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
love_飞影
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 {
...
@@ -20,28 +20,30 @@ import {
import
{
DuelState
}
from
"
./mod
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
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
,
DuelState
,
PayloadAction
<
number
>
PayloadAction
<
number
>
>
=
(
state
,
action
)
=>
{
>
=
(
state
,
action
)
=>
{
const
player
=
action
.
payload
;
const
player
=
action
.
payload
;
if
(
judgeSelf
(
player
,
state
))
{
if
(
judgeSelf
(
player
,
state
))
{
state
.
me
Exclusion
=
{
inner
:
[]
};
state
.
me
BanishedZone
=
{
inner
:
[]
};
}
else
{
}
else
{
state
.
op
Exclusion
=
{
inner
:
[]
};
state
.
op
BanishedZone
=
{
inner
:
[]
};
}
}
};
};
// 增加除外区
// 增加除外区
export
const
fetch
Exclusion
Meta
=
createAsyncMetaThunk
(
export
const
fetch
BanishedZone
Meta
=
createAsyncMetaThunk
(
"
duel/fetch
Exclusion
Meta
"
"
duel/fetch
BanishedZone
Meta
"
);
);
export
const
exclusionCase
=
(
builder
:
ActionReducerMapBuilder
<
DuelState
>
)
=>
{
export
const
banishedZoneCase
=
(
builder
.
addCase
(
fetchExclusionMeta
.
pending
,
(
state
,
action
)
=>
{
builder
:
ActionReducerMapBuilder
<
DuelState
>
)
=>
{
builder
.
addCase
(
fetchBanishedZoneMeta
.
pending
,
(
state
,
action
)
=>
{
// Meta结果没返回之前先更新`ID`
// Meta结果没返回之前先更新`ID`
const
controler
=
action
.
meta
.
arg
.
controler
;
const
controler
=
action
.
meta
.
arg
.
controler
;
const
sequence
=
action
.
meta
.
arg
.
sequence
;
const
sequence
=
action
.
meta
.
arg
.
sequence
;
...
@@ -58,51 +60,51 @@ export const exclusionCase = (builder: ActionReducerMapBuilder<DuelState>) => {
...
@@ -58,51 +60,51 @@ export const exclusionCase = (builder: ActionReducerMapBuilder<DuelState>) => {
counters
:
{},
counters
:
{},
};
};
if
(
judgeSelf
(
controler
,
state
))
{
if
(
judgeSelf
(
controler
,
state
))
{
extendState
(
state
.
me
Exclusion
,
newExclusion
);
extendState
(
state
.
me
BanishedZone
,
newExclusion
);
}
else
{
}
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
controler
=
action
.
payload
.
controler
;
const
sequence
=
action
.
payload
.
sequence
;
const
sequence
=
action
.
payload
.
sequence
;
const
meta
=
action
.
payload
.
meta
;
const
meta
=
action
.
payload
.
meta
;
if
(
judgeSelf
(
controler
,
state
))
{
if
(
judgeSelf
(
controler
,
state
))
{
extendMeta
(
state
.
me
Exclusion
,
meta
,
sequence
);
extendMeta
(
state
.
me
BanishedZone
,
meta
,
sequence
);
}
else
{
}
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
,
DuelState
,
PayloadAction
<
{
controler
:
number
;
sequence
:
number
}
>
PayloadAction
<
{
controler
:
number
;
sequence
:
number
}
>
>
=
(
state
,
action
)
=>
{
>
=
(
state
,
action
)
=>
{
const
exclusion
=
judgeSelf
(
action
.
payload
.
controler
,
state
)
const
banishedZone
=
judgeSelf
(
action
.
payload
.
controler
,
state
)
?
state
.
me
Exclusion
?
state
.
me
BanishedZone
:
state
.
op
Exclusion
;
:
state
.
op
BanishedZone
;
removeCard
(
exclusion
,
action
.
payload
.
sequence
);
removeCard
(
banishedZone
,
action
.
payload
.
sequence
);
};
};
export
const
add
Exclusion
IdleInteractivitiesImpl
:
DuelReducer
<
{
export
const
add
BanishedZone
IdleInteractivitiesImpl
:
DuelReducer
<
{
player
:
number
;
player
:
number
;
sequence
:
number
;
sequence
:
number
;
interactivity
:
Interactivity
<
number
>
;
interactivity
:
Interactivity
<
number
>
;
}
>
=
(
state
,
action
)
=>
{
}
>
=
(
state
,
action
)
=>
{
const
exclusion
=
judgeSelf
(
action
.
payload
.
player
,
state
)
const
banishedZone
=
judgeSelf
(
action
.
payload
.
player
,
state
)
?
state
.
me
Exclusion
?
state
.
me
BanishedZone
:
state
.
op
Exclusion
;
:
state
.
op
BanishedZone
;
extendIdleInteractivities
(
extendIdleInteractivities
(
exclusion
,
banishedZone
,
action
.
payload
.
sequence
,
action
.
payload
.
sequence
,
action
.
payload
.
interactivity
action
.
payload
.
interactivity
);
);
};
};
export
const
selectMe
Exclusion
=
(
state
:
RootState
)
=>
export
const
selectMe
BanishedZone
=
(
state
:
RootState
)
=>
state
.
duel
.
me
Exclusion
||
{
inner
:
[]
};
state
.
duel
.
me
BanishedZone
||
{
inner
:
[]
};
export
const
select
opExclusion
=
(
state
:
RootState
)
=>
export
const
select
OpBanishedZone
=
(
state
:
RootState
)
=>
state
.
duel
.
op
Exclusion
||
{
inner
:
[]
};
state
.
duel
.
op
BanishedZone
||
{
inner
:
[]
};
src/reducers/duel/cemeretySlice.ts
View file @
bbe1136b
...
@@ -20,32 +20,34 @@ import {
...
@@ -20,32 +20,34 @@ import {
import
{
DuelState
}
from
"
./mod
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
import
{
judgeSelf
}
from
"
./util
"
;
export
interface
Cemetery
State
extends
DuelFieldState
{}
export
interface
Graveyard
State
extends
DuelFieldState
{}
// 初始化墓地状态
// 初始化墓地状态
export
const
init
CemeteryImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
number
>>
=
(
export
const
init
GraveyardImpl
:
CaseReducer
<
s
tate
,
DuelS
tate
,
action
PayloadAction
<
number
>
)
=>
{
>
=
(
state
,
action
)
=>
{
const
player
=
action
.
payload
;
const
player
=
action
.
payload
;
if
(
judgeSelf
(
player
,
state
))
{
if
(
judgeSelf
(
player
,
state
))
{
state
.
me
Cemetery
=
{
inner
:
[]
};
state
.
me
Graveyard
=
{
inner
:
[]
};
}
else
{
}
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
>
)
=>
{
export
const
graveyard
Case
=
(
builder
:
ActionReducerMapBuilder
<
DuelState
>
)
=>
{
builder
.
addCase
(
fetch
Cemetery
Meta
.
pending
,
(
state
,
action
)
=>
{
builder
.
addCase
(
fetch
Graveyard
Meta
.
pending
,
(
state
,
action
)
=>
{
// Meta结果没返回之前先更新`ID`
// Meta结果没返回之前先更新`ID`
const
controler
=
action
.
meta
.
arg
.
controler
;
const
controler
=
action
.
meta
.
arg
.
controler
;
const
sequence
=
action
.
meta
.
arg
.
sequence
;
const
sequence
=
action
.
meta
.
arg
.
sequence
;
const
code
=
action
.
meta
.
arg
.
code
;
const
code
=
action
.
meta
.
arg
.
code
;
const
new
Cemetery
=
{
const
new
Graveyard
=
{
occupant
:
{
id
:
code
,
data
:
{},
text
:
{}
},
occupant
:
{
id
:
code
,
data
:
{},
text
:
{}
},
location
:
{
location
:
{
controler
,
controler
,
...
@@ -56,51 +58,51 @@ export const cemeteryCase = (builder: ActionReducerMapBuilder<DuelState>) => {
...
@@ -56,51 +58,51 @@ export const cemeteryCase = (builder: ActionReducerMapBuilder<DuelState>) => {
counters
:
{},
counters
:
{},
};
};
if
(
judgeSelf
(
controler
,
state
))
{
if
(
judgeSelf
(
controler
,
state
))
{
extendState
(
state
.
me
Cemetery
,
newCemetery
);
extendState
(
state
.
me
Graveyard
,
newGraveyard
);
}
else
{
}
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
controler
=
action
.
payload
.
controler
;
const
sequence
=
action
.
payload
.
sequence
;
const
sequence
=
action
.
payload
.
sequence
;
const
meta
=
action
.
payload
.
meta
;
const
meta
=
action
.
payload
.
meta
;
if
(
judgeSelf
(
controler
,
state
))
{
if
(
judgeSelf
(
controler
,
state
))
{
extendMeta
(
state
.
me
Cemetery
,
meta
,
sequence
);
extendMeta
(
state
.
me
Graveyard
,
meta
,
sequence
);
}
else
{
}
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
,
DuelState
,
PayloadAction
<
{
controler
:
number
;
sequence
:
number
}
>
PayloadAction
<
{
controler
:
number
;
sequence
:
number
}
>
>
=
(
state
,
action
)
=>
{
>
=
(
state
,
action
)
=>
{
const
cemetery
=
judgeSelf
(
action
.
payload
.
controler
,
state
)
const
graveyard
=
judgeSelf
(
action
.
payload
.
controler
,
state
)
?
state
.
me
Cemetery
?
state
.
me
Graveyard
:
state
.
op
Cemetery
;
:
state
.
op
Graveyard
;
removeCard
(
cemetery
,
action
.
payload
.
sequence
);
removeCard
(
graveyard
,
action
.
payload
.
sequence
);
};
};
export
const
add
Cemetery
IdleInteractivitiesImpl
:
DuelReducer
<
{
export
const
add
Graveyard
IdleInteractivitiesImpl
:
DuelReducer
<
{
player
:
number
;
player
:
number
;
sequence
:
number
;
sequence
:
number
;
interactivity
:
Interactivity
<
number
>
;
interactivity
:
Interactivity
<
number
>
;
}
>
=
(
state
,
action
)
=>
{
}
>
=
(
state
,
action
)
=>
{
const
cemetery
=
judgeSelf
(
action
.
payload
.
player
,
state
)
const
graveyard
=
judgeSelf
(
action
.
payload
.
player
,
state
)
?
state
.
me
Cemetery
?
state
.
me
Graveyard
:
state
.
op
Cemetery
;
:
state
.
op
Graveyard
;
extendIdleInteractivities
(
extendIdleInteractivities
(
cemetery
,
graveyard
,
action
.
payload
.
sequence
,
action
.
payload
.
sequence
,
action
.
payload
.
interactivity
action
.
payload
.
interactivity
);
);
};
};
export
const
selectMe
Cemetery
=
(
state
:
RootState
)
=>
export
const
selectMe
Graveyard
=
(
state
:
RootState
)
=>
state
.
duel
.
me
Cemetery
||
{
inner
:
[]
};
state
.
duel
.
me
Graveyard
||
{
inner
:
[]
};
export
const
selectOp
Cemetery
=
(
state
:
RootState
)
=>
export
const
selectOp
Graveyard
=
(
state
:
RootState
)
=>
state
.
duel
.
op
Cemetery
||
{
inner
:
[]
};
state
.
duel
.
op
Graveyard
||
{
inner
:
[]
};
src/reducers/duel/commonSlice.ts
View file @
bbe1136b
...
@@ -24,16 +24,16 @@ export const clearAllIdleInteractivitiesImpl: DuelReducer<number> = (
...
@@ -24,16 +24,16 @@ export const clearAllIdleInteractivitiesImpl: DuelReducer<number> = (
state
.
meHands
,
state
.
meHands
,
state
.
meMonsters
,
state
.
meMonsters
,
state
.
meMagics
,
state
.
meMagics
,
state
.
me
Cemetery
,
state
.
me
Graveyard
,
state
.
me
Exclusion
,
state
.
me
BanishedZone
,
state
.
meExtraDeck
,
state
.
meExtraDeck
,
]
]
:
[
:
[
state
.
opHands
,
state
.
opHands
,
state
.
opMonsters
,
state
.
opMonsters
,
state
.
opMagics
,
state
.
opMagics
,
state
.
op
Cemetery
,
state
.
op
Graveyard
,
state
.
op
Exclusion
,
state
.
op
BanishedZone
,
state
.
opExtraDeck
,
state
.
opExtraDeck
,
];
];
...
@@ -51,15 +51,15 @@ export const clearAllPlaceInteractivitiesImpl: DuelReducer<number> = (
...
@@ -51,15 +51,15 @@ export const clearAllPlaceInteractivitiesImpl: DuelReducer<number> = (
state
.
meHands
,
state
.
meHands
,
state
.
meMonsters
,
state
.
meMonsters
,
state
.
meMagics
,
state
.
meMagics
,
state
.
me
Cemetery
,
state
.
me
Graveyard
,
state
.
me
Exclusion
,
state
.
me
BanishedZone
,
]
]
:
[
:
[
state
.
opHands
,
state
.
opHands
,
state
.
opMonsters
,
state
.
opMonsters
,
state
.
opMagics
,
state
.
opMagics
,
state
.
op
Cemetery
,
state
.
op
Graveyard
,
state
.
op
Exclusion
,
state
.
op
BanishedZone
,
];
];
states
.
forEach
((
item
)
=>
clearPlaceInteractivities
(
item
));
states
.
forEach
((
item
)
=>
clearPlaceInteractivities
(
item
));
...
@@ -106,18 +106,18 @@ export const updateFieldDataImpl: DuelReducer<MsgUpdateData> = (
...
@@ -106,18 +106,18 @@ export const updateFieldDataImpl: DuelReducer<MsgUpdateData> = (
break
;
break
;
}
}
case
ygopro
.
CardZone
.
GRAVE
:
{
case
ygopro
.
CardZone
.
GRAVE
:
{
const
cemetery
=
judgeSelf
(
player
,
state
)
const
graveyard
=
judgeSelf
(
player
,
state
)
?
state
.
me
Cemetery
?
state
.
me
Graveyard
:
state
.
op
Cemetery
;
:
state
.
op
Graveyard
;
updateCardData
(
cemetery
,
actions
);
updateCardData
(
graveyard
,
actions
);
break
;
break
;
}
}
case
ygopro
.
CardZone
.
REMOVED
:
{
case
ygopro
.
CardZone
.
REMOVED
:
{
const
exclusion
=
judgeSelf
(
player
,
state
)
const
BanishedZone
=
judgeSelf
(
player
,
state
)
?
state
.
me
Exclusion
?
state
.
me
BanishedZone
:
state
.
op
Exclusion
;
:
state
.
op
BanishedZone
;
updateCardData
(
exclusion
,
actions
);
updateCardData
(
BanishedZone
,
actions
);
break
;
break
;
}
}
...
@@ -140,10 +140,10 @@ export const reloadFieldImpl: DuelReducer<MsgReloadField> = (state, action) => {
...
@@ -140,10 +140,10 @@ export const reloadFieldImpl: DuelReducer<MsgReloadField> = (state, action) => {
state
.
opMonsters
=
{
inner
:
[]
};
state
.
opMonsters
=
{
inner
:
[]
};
state
.
meMagics
=
{
inner
:
[]
};
state
.
meMagics
=
{
inner
:
[]
};
state
.
opMagics
=
{
inner
:
[]
};
state
.
opMagics
=
{
inner
:
[]
};
state
.
me
Cemetery
=
{
inner
:
[]
};
state
.
me
Graveyard
=
{
inner
:
[]
};
state
.
op
Cemetery
=
{
inner
:
[]
};
state
.
op
Graveyard
=
{
inner
:
[]
};
state
.
me
Exclusion
=
{
inner
:
[]
};
state
.
me
BanishedZone
=
{
inner
:
[]
};
state
.
op
Exclusion
=
{
inner
:
[]
};
state
.
op
BanishedZone
=
{
inner
:
[]
};
state
.
meHands
=
{
inner
:
[]
};
state
.
meHands
=
{
inner
:
[]
};
state
.
opHands
=
{
inner
:
[]
};
state
.
opHands
=
{
inner
:
[]
};
...
@@ -183,20 +183,20 @@ export const reloadFieldImpl: DuelReducer<MsgReloadField> = (state, action) => {
...
@@ -183,20 +183,20 @@ export const reloadFieldImpl: DuelReducer<MsgReloadField> = (state, action) => {
player
player
);
);
// GRAVE
// GRAVE
const
cemetery
=
judgeSelf
(
player
,
state
)
const
graveyard
=
judgeSelf
(
player
,
state
)
?
state
.
me
Cemetery
?
state
.
me
Graveyard
:
state
.
op
Cemetery
;
:
state
.
op
Graveyard
;
reloadFieldMeta
(
reloadFieldMeta
(
cemetery
,
graveyard
,
reload
.
zone_actions
.
filter
((
item
)
=>
item
.
zone
==
ygopro
.
CardZone
.
GRAVE
),
reload
.
zone_actions
.
filter
((
item
)
=>
item
.
zone
==
ygopro
.
CardZone
.
GRAVE
),
player
player
);
);
// REMOVED
// REMOVED
const
exclusion
=
judgeSelf
(
player
,
state
)
const
banishedZone
=
judgeSelf
(
player
,
state
)
?
state
.
me
Exclusion
?
state
.
me
BanishedZone
:
state
.
op
Exclusion
;
:
state
.
op
BanishedZone
;
reloadFieldMeta
(
reloadFieldMeta
(
exclusion
,
banishedZone
,
reload
.
zone_actions
.
filter
(
reload
.
zone_actions
.
filter
(
(
item
)
=>
item
.
zone
==
ygopro
.
CardZone
.
REMOVED
(
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";
...
@@ -9,11 +9,18 @@ import { ygopro } from "@/api/ocgcore/idl/ocgcore";
import
{
RootState
}
from
"
@/store
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
import
{
addCemeteryIdleInteractivitiesImpl
,
addBanishedZoneIdleInteractivitiesImpl
,
cemeteryCase
,
banishedZoneCase
,
CemeteryState
,
BanishedZoneState
,
initCemeteryImpl
,
initBanishedZoneImpl
,
removeCemeteryImpl
,
removeBanishedZoneImpl
,
}
from
"
./banishedZoneSlice
"
;
import
{
addGraveyardIdleInteractivitiesImpl
,
graveyardCase
,
GraveyardState
,
initGraveyardImpl
,
removeGraveyardImpl
,
}
from
"
./cemeretySlice
"
;
}
from
"
./cemeretySlice
"
;
import
{
import
{
clearAllIdleInteractivitiesImpl
,
clearAllIdleInteractivitiesImpl
,
...
@@ -22,13 +29,6 @@ import {
...
@@ -22,13 +29,6 @@ import {
updateFieldDataImpl
,
updateFieldDataImpl
,
}
from
"
./commonSlice
"
;
}
from
"
./commonSlice
"
;
import
{
DeckState
,
initDeckImpl
}
from
"
./deckSlice
"
;
import
{
DeckState
,
initDeckImpl
}
from
"
./deckSlice
"
;
import
{
addExclusionIdleInteractivitiesImpl
,
exclusionCase
,
ExclusionState
,
initExclusionImpl
,
removeExclusionImpl
,
}
from
"
./exclusionSlice
"
;
import
{
import
{
addExtraDeckIdleInteractivitiesImpl
,
addExtraDeckIdleInteractivitiesImpl
,
extraDeckCase
,
extraDeckCase
,
...
@@ -136,11 +136,11 @@ export interface DuelState {
...
@@ -136,11 +136,11 @@ export interface DuelState {
meMagics
?:
MagicState
;
// 自己的魔法陷阱区状态
meMagics
?:
MagicState
;
// 自己的魔法陷阱区状态
opMagics
?:
MagicState
;
// 对手的魔法陷阱区状态
opMagics
?:
MagicState
;
// 对手的魔法陷阱区状态
me
Cemetery
?:
Cemetery
State
;
// 自己的墓地状态
me
Graveyard
?:
Graveyard
State
;
// 自己的墓地状态
op
Cemetery
?:
Cemetery
State
;
// 对手的墓地状态
op
Graveyard
?:
Graveyard
State
;
// 对手的墓地状态
me
Exclusion
?:
Exclusion
State
;
// 自己的除外区状态
me
BanishedZone
?:
BanishedZone
State
;
// 自己的除外区状态
op
Exclusion
?:
Exclusion
State
;
// 对手的除外区状态
op
BanishedZone
?:
BanishedZone
State
;
// 对手的除外区状态
meDeck
?:
DeckState
;
// 自己的卡组状态
meDeck
?:
DeckState
;
// 自己的卡组状态
opDeck
?:
DeckState
;
// 对手的卡组状态
opDeck
?:
DeckState
;
// 对手的卡组状态
...
@@ -239,14 +239,14 @@ const duelSlice = createSlice({
...
@@ -239,14 +239,14 @@ const duelSlice = createSlice({
removeMagic
:
removeMagicImpl
,
removeMagic
:
removeMagicImpl
,
// 墓地相关`Reducer`
// 墓地相关`Reducer`
init
Cemetery
:
initCemetery
Impl
,
init
Graveyard
:
initGraveyard
Impl
,
remove
Cemetery
:
removeCemetery
Impl
,
remove
Graveyard
:
removeGraveyard
Impl
,
add
CemeteryIdleInteractivities
:
addCemetery
IdleInteractivitiesImpl
,
add
GraveyardIdleInteractivities
:
addGraveyard
IdleInteractivitiesImpl
,
// 除外区相关`Reducer`
// 除外区相关`Reducer`
init
Exclusion
:
initExclusion
Impl
,
init
BanishedZone
:
initBanishedZone
Impl
,
remove
Exclusion
:
removeExclusion
Impl
,
remove
BanishedZone
:
removeBanishedZone
Impl
,
add
ExclusionIdleInteractivities
:
addExclusion
IdleInteractivitiesImpl
,
add
BanishedZoneIdleInteractivities
:
addBanishedZone
IdleInteractivitiesImpl
,
// 卡组相关`Reducer`
// 卡组相关`Reducer`
initDeck
:
initDeckImpl
,
initDeck
:
initDeckImpl
,
...
@@ -326,8 +326,8 @@ const duelSlice = createSlice({
...
@@ -326,8 +326,8 @@ const duelSlice = createSlice({
hintCase
(
builder
);
hintCase
(
builder
);
monsterCase
(
builder
);
monsterCase
(
builder
);
magicCase
(
builder
);
magicCase
(
builder
);
cemetery
Case
(
builder
);
graveyard
Case
(
builder
);
exclusion
Case
(
builder
);
banishedZone
Case
(
builder
);
extraDeckCase
(
builder
);
extraDeckCase
(
builder
);
checkCardModalCase
(
builder
);
checkCardModalCase
(
builder
);
YesNoModalCase
(
builder
);
YesNoModalCase
(
builder
);
...
@@ -370,9 +370,9 @@ export const {
...
@@ -370,9 +370,9 @@ export const {
setMagicPosition
,
setMagicPosition
,
removeMagic
,
removeMagic
,
removeHand
,
removeHand
,
init
Cemetery
,
init
Graveyard
,
remove
Cemetery
,
remove
Graveyard
,
add
Cemetery
IdleInteractivities
,
add
Graveyard
IdleInteractivities
,
setCardListModalIsOpen
,
setCardListModalIsOpen
,
setCardListModalInfo
,
setCardListModalInfo
,
setCheckCardModalIsOpen
,
setCheckCardModalIsOpen
,
...
@@ -390,9 +390,9 @@ export const {
...
@@ -390,9 +390,9 @@ export const {
initDeck
,
initDeck
,
removeExtraDeck
,
removeExtraDeck
,
addExtraDeckIdleInteractivities
,
addExtraDeckIdleInteractivities
,
init
Exclusion
,
init
BanishedZone
,
remove
Exclusion
,
remove
BanishedZone
,
add
Exclusion
IdleInteractivities
,
add
BanishedZone
IdleInteractivities
,
setCheckCardModalV2IsOpen
,
setCheckCardModalV2IsOpen
,
setCheckCardModalV2MinMax
,
setCheckCardModalV2MinMax
,
setCheckCardModalV2CancelAble
,
setCheckCardModalV2CancelAble
,
...
...
src/reducers/duel/util.ts
View file @
bbe1136b
...
@@ -61,15 +61,15 @@ export function findCardByLocation(
...
@@ -61,15 +61,15 @@ export function findCardByLocation(
return
magics
?.
inner
.
find
(
finder
);
return
magics
?.
inner
.
find
(
finder
);
}
}
case
ygopro
.
CardZone
.
REMOVED
:
{
case
ygopro
.
CardZone
.
REMOVED
:
{
const
exclusion
s
=
judgeSelf
(
controler
,
state
)
const
banishedZone
s
=
judgeSelf
(
controler
,
state
)
?
state
.
me
Exclusion
?
state
.
me
BanishedZone
:
state
.
op
Exclusion
;
:
state
.
op
BanishedZone
;
return
exclusion
s
?.
inner
.
find
(
finder
);
return
banishedZone
s
?.
inner
.
find
(
finder
);
}
}
case
ygopro
.
CardZone
.
GRAVE
:
{
case
ygopro
.
CardZone
.
GRAVE
:
{
const
cemerety
=
judgeSelf
(
controler
,
state
)
const
cemerety
=
judgeSelf
(
controler
,
state
)
?
state
.
me
Cemetery
?
state
.
me
Graveyard
:
state
.
op
Cemetery
;
:
state
.
op
Graveyard
;
return
cemerety
?.
inner
.
find
(
finder
);
return
cemerety
?.
inner
.
find
(
finder
);
}
}
default
:
{
default
:
{
...
...
src/service/duel/move.ts
View file @
bbe1136b
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
MsgMove
=
ygopro
.
StocGameMessage
.
MsgMove
;
import
MsgMove
=
ygopro
.
StocGameMessage
.
MsgMove
;
import
{
fetch
CemeteryMeta
}
from
"
@/reducers/duel/cemerety
Slice
"
;
import
{
fetch
BanishedZoneMeta
}
from
"
@/reducers/duel/banishedZone
Slice
"
;
import
{
fetch
ExclusionMeta
}
from
"
@/reducers/duel/exclusion
Slice
"
;
import
{
fetch
GraveyardMeta
}
from
"
@/reducers/duel/cemerety
Slice
"
;
import
{
fetchExtraDeckMeta
}
from
"
@/reducers/duel/extraDeckSlice
"
;
import
{
fetchExtraDeckMeta
}
from
"
@/reducers/duel/extraDeckSlice
"
;
import
{
insertHandMeta
}
from
"
@/reducers/duel/handsSlice
"
;
import
{
insertHandMeta
}
from
"
@/reducers/duel/handsSlice
"
;
import
{
fetchMagicMeta
}
from
"
@/reducers/duel/magicSlice
"
;
import
{
fetchMagicMeta
}
from
"
@/reducers/duel/magicSlice
"
;
import
{
import
{
removeCemetery
,
removeBanishedZone
,
removeExclusion
,
removeExtraDeck
,
removeExtraDeck
,
removeGraveyard
,
removeHand
,
removeHand
,
removeMagic
,
removeMagic
,
removeMonster
,
removeMonster
,
...
@@ -52,14 +52,17 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
...
@@ -52,14 +52,17 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
}
}
case
ygopro
.
CardZone
.
GRAVE
:
{
case
ygopro
.
CardZone
.
GRAVE
:
{
dispatch
(
dispatch
(
remove
Cemetery
({
controler
:
from
.
controler
,
sequence
:
from
.
sequence
})
remove
Graveyard
({
controler
:
from
.
controler
,
sequence
:
from
.
sequence
})
);
);
break
;
break
;
}
}
case
ygopro
.
CardZone
.
REMOVED
:
{
case
ygopro
.
CardZone
.
REMOVED
:
{
dispatch
(
dispatch
(
removeExclusion
({
controler
:
from
.
controler
,
sequence
:
from
.
sequence
})
removeBanishedZone
({
controler
:
from
.
controler
,
sequence
:
from
.
sequence
,
})
);
);
break
;
break
;
...
@@ -128,7 +131,7 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
...
@@ -128,7 +131,7 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
}
}
case
ygopro
.
CardZone
.
GRAVE
:
{
case
ygopro
.
CardZone
.
GRAVE
:
{
dispatch
(
dispatch
(
fetch
Cemetery
Meta
({
fetch
Graveyard
Meta
({
controler
:
to
.
controler
,
controler
:
to
.
controler
,
sequence
:
to
.
sequence
,
sequence
:
to
.
sequence
,
code
,
code
,
...
@@ -146,7 +149,7 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
...
@@ -146,7 +149,7 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
}
}
case
ygopro
.
CardZone
.
REMOVED
:
{
case
ygopro
.
CardZone
.
REMOVED
:
{
dispatch
(
dispatch
(
fetch
Exclusion
Meta
({
fetch
BanishedZone
Meta
({
controler
:
to
.
controler
,
controler
:
to
.
controler
,
sequence
:
to
.
sequence
,
sequence
:
to
.
sequence
,
code
,
code
,
...
...
src/service/duel/selectIdleCmd.ts
View file @
bbe1136b
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
Interactivity
,
InteractType
}
from
"
@/reducers/duel/generic
"
;
import
{
Interactivity
,
InteractType
}
from
"
@/reducers/duel/generic
"
;
import
{
import
{
addCemeteryIdleInteractivities
,
addBanishedZoneIdleInteractivities
,
addExclusionIdleInteractivities
,
addExtraDeckIdleInteractivities
,
addExtraDeckIdleInteractivities
,
addGraveyardIdleInteractivities
,
addHandsIdleInteractivity
,
addHandsIdleInteractivity
,
addMagicIdleInteractivities
,
addMagicIdleInteractivities
,
addMonsterIdleInteractivities
,
addMonsterIdleInteractivities
,
...
@@ -83,12 +83,12 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
...
@@ -83,12 +83,12 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
break
;
break
;
}
}
case
ygopro
.
CardZone
.
GRAVE
:
{
case
ygopro
.
CardZone
.
GRAVE
:
{
dispatcher
(
data
,
interactType
,
add
Cemetery
IdleInteractivities
);
dispatcher
(
data
,
interactType
,
add
Graveyard
IdleInteractivities
);
break
;
break
;
}
}
case
ygopro
.
CardZone
.
REMOVED
:
{
case
ygopro
.
CardZone
.
REMOVED
:
{
dispatcher
(
data
,
interactType
,
add
Exclusion
IdleInteractivities
);
dispatcher
(
data
,
interactType
,
add
BanishedZone
IdleInteractivities
);
break
;
break
;
}
}
...
...
src/service/duel/start.ts
View file @
bbe1136b
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
import
{
infoInit
,
infoInit
,
init
Cemetery
,
init
BanishedZone
,
initDeck
,
initDeck
,
init
Exclusion
,
init
Graveyard
,
initHint
,
initHint
,
initMagics
,
initMagics
,
initMonsters
,
initMonsters
,
...
@@ -40,11 +40,11 @@ export default (
...
@@ -40,11 +40,11 @@ export default (
dispatch
(
initMonsters
(
1
));
dispatch
(
initMonsters
(
1
));
dispatch
(
initMagics
(
0
));
dispatch
(
initMagics
(
0
));
dispatch
(
initMagics
(
1
));
dispatch
(
initMagics
(
1
));
dispatch
(
init
Cemetery
(
0
));
dispatch
(
init
Graveyard
(
0
));
dispatch
(
init
Cemetery
(
1
));
dispatch
(
init
Graveyard
(
1
));
dispatch
(
initDeck
({
player
:
0
,
deskSize
:
start
.
deckSize1
}));
dispatch
(
initDeck
({
player
:
0
,
deskSize
:
start
.
deckSize1
}));
dispatch
(
initDeck
({
player
:
1
,
deskSize
:
start
.
deckSize2
}));
dispatch
(
initDeck
({
player
:
1
,
deskSize
:
start
.
deckSize2
}));
dispatch
(
init
Exclusion
(
0
));
dispatch
(
init
BanishedZone
(
0
));
dispatch
(
init
Exclusion
(
1
));
dispatch
(
init
BanishedZone
(
1
));
dispatch
(
initHint
());
dispatch
(
initHint
());
};
};
src/ui/Duel/PlayMat/BanishedZone.tsx
View file @
bbe1136b
...
@@ -3,37 +3,37 @@ import * as BABYLON from "@babylonjs/core";
...
@@ -3,37 +3,37 @@ import * as BABYLON from "@babylonjs/core";
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
import
{
selectMe
Exclusion
,
selectMe
BanishedZone
,
select
opExclusion
,
select
OpBanishedZone
,
}
from
"
@/reducers/duel/
exclusion
Slice
"
;
}
from
"
@/reducers/duel/
banishedZone
Slice
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
export
const
BanishedZone
=
()
=>
{
export
const
BanishedZone
=
()
=>
{
const
me
Exclusion
=
useAppSelector
(
selectMeExclusion
).
inner
;
const
me
BanishedZone
=
useAppSelector
(
selectMeBanishedZone
).
inner
;
const
op
Exclusion
=
useAppSelector
(
selectopExclusion
).
inner
;
const
op
BanishedZone
=
useAppSelector
(
selectOpBanishedZone
).
inner
;
return
(
return
(
<>
<>
<
SingleSlot
<
SingleSlot
state=
{
me
Exclusion
}
state=
{
me
BanishedZone
}
position=
{
banishedZonePosition
(
0
,
me
Exclusion
.
length
)
}
position=
{
banishedZonePosition
(
0
,
me
BanishedZone
.
length
)
}
rotation=
{
cardSlotRotation
(
false
)
}
rotation=
{
cardSlotRotation
(
false
)
}
/>
/>
<
SingleSlot
<
SingleSlot
state=
{
op
Exclusion
}
state=
{
op
BanishedZone
}
position=
{
banishedZonePosition
(
1
,
op
Exclusion
.
length
)
}
position=
{
banishedZonePosition
(
1
,
op
BanishedZone
.
length
)
}
rotation=
{
cardSlotRotation
(
true
)
}
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
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
;
const
z
=
player
==
0
?
-
0.7
:
0.7
;
return
new
BABYLON
.
Vector3
(
x
,
y
,
z
);
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";
...
@@ -3,8 +3,8 @@ import * as BABYLON from "@babylonjs/core";
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
import
{
selectMe
Cemetery
,
selectMe
Graveyard
,
selectOp
Cemetery
,
selectOp
Graveyard
,
}
from
"
@/reducers/duel/cemeretySlice
"
;
}
from
"
@/reducers/duel/cemeretySlice
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
...
@@ -12,28 +12,28 @@ import { Depth, SingleSlot } from "./SingleSlot";
...
@@ -12,28 +12,28 @@ import { Depth, SingleSlot } from "./SingleSlot";
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
export
const
Graveyard
=
()
=>
{
export
const
Graveyard
=
()
=>
{
const
me
Cemetery
=
useAppSelector
(
selectMeCemetery
).
inner
;
const
me
Graveyard
=
useAppSelector
(
selectMeGraveyard
).
inner
;
const
op
Cemetery
=
useAppSelector
(
selectOpCemetery
).
inner
;
const
op
Graveyard
=
useAppSelector
(
selectOpGraveyard
).
inner
;
return
(
return
(
<>
<>
<
SingleSlot
<
SingleSlot
state=
{
me
Cemetery
}
state=
{
me
Graveyard
}
position=
{
cemeteryPosition
(
0
,
meCemetery
.
length
)
}
position=
{
graveyardPosition
(
0
,
meGraveyard
.
length
)
}
rotation=
{
cardSlotRotation
(
false
)
}
rotation=
{
cardSlotRotation
(
false
)
}
/>
/>
<
SingleSlot
<
SingleSlot
state=
{
op
Cemetery
}
state=
{
op
Graveyard
}
position=
{
cemeteryPosition
(
1
,
opCemetery
.
length
)
}
position=
{
graveyardPosition
(
1
,
opGraveyard
.
length
)
}
rotation=
{
cardSlotRotation
(
true
)
}
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
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
;
const
z
=
player
==
0
?
-
2.0
:
2.0
;
return
new
BABYLON
.
Vector3
(
x
,
y
,
z
);
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