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
829c5bc4
Commit
829c5bc4
authored
Jan 07, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update CardMeta interface
parent
6be92491
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
5 deletions
+81
-5
src/api/cards.ts
src/api/cards.ts
+72
-0
src/reducers/duel/modalSlice.ts
src/reducers/duel/modalSlice.ts
+8
-2
src/service/duel/selectChain.ts
src/service/duel/selectChain.ts
+1
-3
No files found.
src/api/cards.ts
View file @
829c5bc4
...
@@ -16,6 +16,22 @@ export interface CardMeta {
...
@@ -16,6 +16,22 @@ export interface CardMeta {
name
?:
string
;
name
?:
string
;
types
?:
string
;
types
?:
string
;
desc
?:
string
;
desc
?:
string
;
str1
?:
string
;
str2
?:
string
;
str3
?:
string
;
str4
?:
string
;
str5
?:
string
;
str6
?:
string
;
str7
?:
string
;
str8
?:
string
;
str9
?:
string
;
str10
?:
string
;
str11
?:
string
;
str12
?:
string
;
str13
?:
string
;
str14
?:
string
;
str15
?:
string
;
str16
?:
string
;
};
};
}
}
...
@@ -31,3 +47,59 @@ export async function fetchCard(id: number): Promise<CardMeta> {
...
@@ -31,3 +47,59 @@ export async function fetchCard(id: number): Promise<CardMeta> {
return
res
.
data
;
return
res
.
data
;
}
}
export
function
getCardStr
(
meta
:
CardMeta
,
idx
:
number
):
string
|
undefined
{
switch
(
idx
)
{
case
0
:
{
return
meta
.
text
.
str1
;
}
case
1
:
{
return
meta
.
text
.
str2
;
}
case
2
:
{
return
meta
.
text
.
str3
;
}
case
3
:
{
return
meta
.
text
.
str4
;
}
case
4
:
{
return
meta
.
text
.
str5
;
}
case
5
:
{
return
meta
.
text
.
str6
;
}
case
6
:
{
return
meta
.
text
.
str7
;
}
case
7
:
{
return
meta
.
text
.
str8
;
}
case
8
:
{
return
meta
.
text
.
str9
;
}
case
9
:
{
return
meta
.
text
.
str10
;
}
case
10
:
{
return
meta
.
text
.
str11
;
}
case
11
:
{
return
meta
.
text
.
str12
;
}
case
12
:
{
return
meta
.
text
.
str13
;
}
case
13
:
{
return
meta
.
text
.
str14
;
}
case
14
:
{
return
meta
.
text
.
str15
;
}
case
15
:
{
return
meta
.
text
.
str16
;
}
default
:
{
return
undefined
;
}
}
}
src/reducers/duel/modalSlice.ts
View file @
829c5bc4
...
@@ -4,7 +4,7 @@ import {
...
@@ -4,7 +4,7 @@ import {
createAsyncThunk
,
createAsyncThunk
,
ActionReducerMapBuilder
,
ActionReducerMapBuilder
,
}
from
"
@reduxjs/toolkit
"
;
}
from
"
@reduxjs/toolkit
"
;
import
{
fetchCard
}
from
"
../../api/cards
"
;
import
{
fetchCard
,
getCardStr
}
from
"
../../api/cards
"
;
import
{
RootState
}
from
"
../../store
"
;
import
{
RootState
}
from
"
../../store
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
import
{
judgeSelf
}
from
"
./util
"
;
...
@@ -38,6 +38,7 @@ export interface ModalState {
...
@@ -38,6 +38,7 @@ export interface ModalState {
code
:
number
;
code
:
number
;
name
?:
string
;
name
?:
string
;
desc
?:
string
;
desc
?:
string
;
effectDesc
?:
string
;
response
:
number
;
response
:
number
;
}[];
}[];
}[];
}[];
...
@@ -121,9 +122,12 @@ export const fetchCheckCardMeta = createAsyncThunk(
...
@@ -121,9 +122,12 @@ export const fetchCheckCardMeta = createAsyncThunk(
async
(
param
:
{
async
(
param
:
{
controler
:
number
;
controler
:
number
;
tagName
:
string
;
tagName
:
string
;
option
:
{
code
:
number
;
response
:
number
};
option
:
{
code
:
number
;
response
:
number
;
effectDescCode
?:
number
};
})
=>
{
})
=>
{
const
meta
=
await
fetchCard
(
param
.
option
.
code
);
const
meta
=
await
fetchCard
(
param
.
option
.
code
);
const
effectDesc
=
param
.
option
.
effectDescCode
?
getCardStr
(
meta
,
param
.
option
.
effectDescCode
&
0xf
)
:
undefined
;
const
response
=
{
const
response
=
{
controler
:
param
.
controler
,
controler
:
param
.
controler
,
tagName
:
param
.
tagName
,
tagName
:
param
.
tagName
,
...
@@ -131,6 +135,7 @@ export const fetchCheckCardMeta = createAsyncThunk(
...
@@ -131,6 +135,7 @@ export const fetchCheckCardMeta = createAsyncThunk(
code
:
meta
.
id
,
code
:
meta
.
id
,
name
:
meta
.
text
.
name
,
name
:
meta
.
text
.
name
,
desc
:
meta
.
text
.
desc
,
desc
:
meta
.
text
.
desc
,
effectDesc
},
},
};
};
...
@@ -178,6 +183,7 @@ export const checkCardModalCase = (
...
@@ -178,6 +183,7 @@ export const checkCardModalCase = (
if
(
option
.
code
==
meta
.
code
)
{
if
(
option
.
code
==
meta
.
code
)
{
option
.
name
=
meta
.
name
;
option
.
name
=
meta
.
name
;
option
.
desc
=
meta
.
desc
;
option
.
desc
=
meta
.
desc
;
option
.
effectDesc
=
meta
.
effectDesc
;
}
}
}
}
}
}
...
...
src/service/duel/selectChain.ts
View file @
829c5bc4
...
@@ -2,6 +2,4 @@ import { ygopro } from "../../api/ocgcore/idl/ocgcore";
...
@@ -2,6 +2,4 @@ import { ygopro } from "../../api/ocgcore/idl/ocgcore";
import
{
AppDispatch
}
from
"
../../store
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
import
MsgSelectChain
=
ygopro
.
StocGameMessage
.
MsgSelectChain
;
import
MsgSelectChain
=
ygopro
.
StocGameMessage
.
MsgSelectChain
;
export
default
(
selectChain
:
MsgSelectChain
,
dispatch
:
AppDispatch
)
=>
{
export
default
(
selectChain
:
MsgSelectChain
,
dispatch
:
AppDispatch
)
=>
{};
console
.
log
(
selectChain
);
};
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