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
287d4894
Commit
287d4894
authored
Feb 11, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update move service
parent
69b4f458
Pipeline
#20049
passed with stages
in 4 minutes and 24 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
src/reducers/duel/mod.ts
src/reducers/duel/mod.ts
+3
-0
src/reducers/duel/monstersSlice.ts
src/reducers/duel/monstersSlice.ts
+26
-0
src/service/duel/move.ts
src/service/duel/move.ts
+12
-0
No files found.
src/reducers/duel/mod.ts
View file @
287d4894
...
...
@@ -63,6 +63,7 @@ import {
clearMonsterIdleInteractivitiesImpl
,
removeMonsterImpl
,
setMonsterPositionImpl
,
removeOverlayImpl
,
monsterCase
,
}
from
"
./monstersSlice
"
;
import
{
...
...
@@ -185,6 +186,7 @@ const duelSlice = createSlice({
clearMonsterIdleInteractivities
:
clearMonsterIdleInteractivitiesImpl
,
setMonsterPosition
:
setMonsterPositionImpl
,
removeMonster
:
removeMonsterImpl
,
removeOverlay
:
removeOverlayImpl
,
// 魔法陷阱区相关`Reducer`
initMagics
:
initMagicsImpl
,
...
...
@@ -285,6 +287,7 @@ export const {
clearMonsterIdleInteractivities
,
setMonsterPosition
,
removeMonster
,
removeOverlay
,
initMagics
,
addMagicPlaceInteractivities
,
clearMagicPlaceInteractivities
,
...
...
src/reducers/duel/monstersSlice.ts
View file @
287d4894
...
...
@@ -267,6 +267,32 @@ export const removeMonsterImpl: CaseReducer<
removeOverlay
(
monsters
,
action
.
payload
.
sequence
);
};
// 删除超量素材
export
const
removeOverlayImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
{
controler
:
number
;
sequence
:
number
;
overlaySequence
:
number
;
}
>
>
=
(
state
,
action
)
=>
{
const
controler
=
action
.
payload
.
controler
;
const
sequence
=
action
.
payload
.
sequence
;
const
overlaySequence
=
action
.
payload
.
overlaySequence
;
const
monsters
=
judgeSelf
(
controler
,
state
)
?
state
.
meMonsters
:
state
.
opMonsters
;
if
(
monsters
)
{
const
target
=
monsters
.
inner
.
find
((
_
,
idx
)
=>
idx
==
sequence
);
if
(
target
&&
target
.
overlay_materials
)
{
target
.
overlay_materials
=
target
.
overlay_materials
.
filter
(
(
_
,
idx
)
=>
idx
!=
overlaySequence
);
}
}
};
// 改变怪兽表示形式
export
const
setMonsterPositionImpl
:
CaseReducer
<
DuelState
,
...
...
src/service/duel/move.ts
View file @
287d4894
...
...
@@ -12,6 +12,7 @@ import {
removeHand
,
removeMagic
,
removeMonster
,
removeOverlay
,
}
from
"
../../reducers/duel/mod
"
;
import
{
fetchMagicMeta
}
from
"
../../reducers/duel/magicSlice
"
;
import
{
fetchCemeteryMeta
}
from
"
../../reducers/duel/cemeretySlice
"
;
...
...
@@ -68,6 +69,17 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
break
;
}
case
ygopro
.
CardZone
.
OVERLAY
:
{
dispatch
(
removeOverlay
({
controler
:
from
.
controler
,
sequence
:
from
.
sequence
,
overlaySequence
:
from
.
overlay_sequence
,
})
);
break
;
}
default
:
{
console
.
log
(
`Unhandled zone type
${
from
.
location
}
`
);
break
;
...
...
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