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
e1585af1
Commit
e1585af1
authored
Jan 22, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix select_card service bug
parent
296eaf09
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
12 deletions
+35
-12
src/reducers/duel/modal/checkCardModalSlice.ts
src/reducers/duel/modal/checkCardModalSlice.ts
+29
-11
src/service/duel/selectCard.ts
src/service/duel/selectCard.ts
+6
-1
No files found.
src/reducers/duel/modal/checkCardModalSlice.ts
View file @
e1585af1
...
...
@@ -6,8 +6,9 @@ import {
}
from
"
@reduxjs/toolkit
"
;
import
{
RootState
}
from
"
../../../store
"
;
import
{
DuelState
}
from
"
../mod
"
;
import
{
judgeSelf
}
from
"
../util
"
;
import
{
findCardByLocation
,
judgeSelf
}
from
"
../util
"
;
import
{
fetchCard
,
getCardStr
}
from
"
../../../api/cards
"
;
import
{
ygopro
}
from
"
../../../api/ocgcore/idl/ocgcore
"
;
// 更新卡牌选择弹窗打开状态
export
const
setCheckCardModalIsOpenImpl
:
CaseReducer
<
...
...
@@ -56,7 +57,13 @@ export const fetchCheckCardMeta = createAsyncThunk(
async
(
param
:
{
controler
:
number
;
tagName
:
string
;
option
:
{
code
:
number
;
response
:
number
;
effectDescCode
?:
number
};
option
:
{
code
:
number
;
zone
?:
ygopro
.
CardZone
;
sequence
?:
number
;
response
:
number
;
effectDescCode
?:
number
;
};
})
=>
{
const
meta
=
await
fetchCard
(
param
.
option
.
code
,
true
);
const
effectDesc
=
param
.
option
.
effectDescCode
...
...
@@ -84,23 +91,34 @@ export const checkCardModalCase = (
const
controler
=
action
.
meta
.
arg
.
controler
;
const
tagName
=
action
.
meta
.
arg
.
tagName
;
const
code
=
action
.
meta
.
arg
.
option
.
code
;
const
zone
=
action
.
meta
.
arg
.
option
.
zone
;
const
sequence
=
action
.
meta
.
arg
.
option
.
sequence
;
const
response
=
action
.
meta
.
arg
.
option
.
response
;
const
combinedTagName
=
judgeSelf
(
controler
,
state
)
?
`我方的
${
tagName
}
`
:
`对方的
${
tagName
}
`
;
for
(
const
tag
of
state
.
modalState
.
checkCardModal
.
tags
)
{
if
(
tag
.
tagName
===
combinedTagName
)
{
tag
.
options
.
push
({
code
,
response
});
return
;
const
newID
=
code
!=
0
?
code
:
zone
&&
sequence
?
findCardByLocation
(
state
,
controler
,
zone
,
sequence
)?.
occupant
?.
id
:
undefined
;
if
(
newID
)
{
for
(
const
tag
of
state
.
modalState
.
checkCardModal
.
tags
)
{
if
(
tag
.
tagName
===
combinedTagName
)
{
tag
.
options
.
push
({
code
:
newID
,
response
});
return
;
}
}
}
state
.
modalState
.
checkCardModal
.
tags
.
push
({
tagName
:
combinedTagName
,
options
:
[{
code
,
response
}],
});
state
.
modalState
.
checkCardModal
.
tags
.
push
({
tagName
:
combinedTagName
,
options
:
[{
code
:
newID
,
response
}],
});
}
});
builder
.
addCase
(
fetchCheckCardMeta
.
fulfilled
,
(
state
,
action
)
=>
{
const
controler
=
action
.
payload
.
controler
;
...
...
src/service/duel/selectCard.ts
View file @
e1585af1
...
...
@@ -25,7 +25,12 @@ export default (selectCard: MsgSelectCard, dispatch: AppDispatch) => {
fetchCheckCardMeta
({
controler
:
card
.
location
.
controler
,
tagName
,
option
:
{
code
:
card
.
code
,
response
:
card
.
response
},
option
:
{
code
:
card
.
code
,
zone
:
card
.
location
.
location
,
sequence
:
card
.
location
.
sequence
,
response
:
card
.
response
,
},
})
);
}
...
...
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