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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
MyCard
Neos
Commits
aae088cd
Commit
aae088cd
authored
Jan 15, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
f8b621eb
Pipeline
#19538
passed with stages
in 5 minutes and 55 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
src/reducers/duel/fieldSlice.ts
src/reducers/duel/fieldSlice.ts
+20
-1
src/reducers/duel/mod.ts
src/reducers/duel/mod.ts
+3
-0
src/service/duel/selectPlace.ts
src/service/duel/selectPlace.ts
+6
-0
No files found.
src/reducers/duel/fieldSlice.ts
View file @
aae088cd
...
...
@@ -3,7 +3,7 @@ import { DuelState } from "./mod";
import
{
RootState
}
from
"
../../store
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
CardState
}
from
"
./generic
"
;
import
{
CardState
,
InteractType
}
from
"
./generic
"
;
export
interface
FieldState
{
inner
?:
CardState
;
...
...
@@ -38,6 +38,25 @@ export const initFieldImpl: CaseReducer<DuelState, PayloadAction<number>> = (
}
};
export
const
addFieldPlaceInteractivitiesImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
number
>
>
=
(
state
,
action
)
=>
{
const
controler
=
action
.
payload
;
const
field
=
judgeSelf
(
controler
,
state
)
?
state
.
meField
:
state
.
opField
;
if
(
field
&&
field
.
inner
)
{
field
.
inner
.
placeInteractivities
=
{
interactType
:
InteractType
.
PLACE_SELECTABLE
,
response
:
{
controler
,
zone
:
ygopro
.
CardZone
.
ONFIELD
,
sequence
:
0
,
},
};
}
};
export
const
clearFieldPlaceInteractivitiesImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
number
>
...
...
src/reducers/duel/mod.ts
View file @
aae088cd
...
...
@@ -68,6 +68,7 @@ import {
FieldState
,
initFieldImpl
,
clearFieldPlaceInteractivitiesImpl
,
addFieldPlaceInteractivitiesImpl
,
}
from
"
./fieldSlice
"
;
export
interface
DuelState
{
...
...
@@ -161,6 +162,7 @@ const duelSlice = createSlice({
// 场地区相关`Reducer`
initField
:
initFieldImpl
,
clearFieldPlaceInteractivities
:
clearFieldPlaceInteractivitiesImpl
,
addFieldPlaceInteractivities
:
addFieldPlaceInteractivitiesImpl
,
// UI相关`Reducer`
setCardModalIsOpen
:
setCardModalIsOpenImpl
,
...
...
@@ -235,6 +237,7 @@ export const {
initExclusion
,
initField
,
clearFieldPlaceInteractivities
,
addFieldPlaceInteractivities
,
}
=
duelSlice
.
actions
;
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
meInitInfo
!=
null
;
...
...
src/service/duel/selectPlace.ts
View file @
aae088cd
...
...
@@ -4,6 +4,7 @@ import MsgSelectPlace = ygopro.StocGameMessage.MsgSelectPlace;
import
{
addMonsterPlaceInteractivities
,
addMagicPlaceInteractivities
,
addFieldPlaceInteractivities
,
}
from
"
../../reducers/duel/mod
"
;
export
default
(
selectPlace
:
MsgSelectPlace
,
dispatch
:
AppDispatch
)
=>
{
...
...
@@ -29,6 +30,11 @@ export default (selectPlace: MsgSelectPlace, dispatch: AppDispatch) => {
break
;
}
case
ygopro
.
CardZone
.
ONFIELD
:
{
dispatch
(
addFieldPlaceInteractivities
(
place
.
controler
));
break
;
}
default
:
{
console
.
warn
(
`Unhandled zoneType:
${
place
.
zone
}
`
);
}
...
...
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