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
f788671c
Commit
f788671c
authored
Dec 06, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/idle_cmd' into 'main'
Fix/idle cmd See merge request
mycard/Neos!34
parents
de2c697f
1b2859f2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
12 deletions
+33
-12
src/reducers/duel/handsSlice.ts
src/reducers/duel/handsSlice.ts
+27
-6
src/reducers/duel/util.ts
src/reducers/duel/util.ts
+6
-6
No files found.
src/reducers/duel/handsSlice.ts
View file @
f788671c
...
@@ -38,12 +38,17 @@ export const fetchHandsMeta = createAsyncThunk(
...
@@ -38,12 +38,17 @@ export const fetchHandsMeta = createAsyncThunk(
);
);
export
const
handsCase
=
(
builder
:
ActionReducerMapBuilder
<
DuelState
>
)
=>
{
export
const
handsCase
=
(
builder
:
ActionReducerMapBuilder
<
DuelState
>
)
=>
{
builder
.
addCase
(
fetchHandsMeta
.
fulfilled
,
(
state
,
action
)
=>
{
builder
.
addCase
(
fetchHandsMeta
.
pending
,
(
state
,
action
)
=>
{
const
player
=
action
.
payload
[
0
];
// Meta结果没返回之前先更新手牌`ID`
const
hands
=
action
.
payload
[
1
];
const
player
=
action
.
meta
.
arg
[
0
];
const
ids
=
action
.
meta
.
arg
[
1
];
const
cards
=
hands
.
map
((
meta
)
=>
{
return
{
meta
,
transform
:
{},
interactivities
:
[]
};
const
cards
=
ids
.
map
((
id
)
=>
{
return
{
meta
:
{
id
,
data
:
{},
text
:
{}
},
transform
:
{},
interactivities
:
[],
};
});
});
if
(
judgeSelf
(
player
,
state
))
{
if
(
judgeSelf
(
player
,
state
))
{
if
(
state
.
meHands
)
{
if
(
state
.
meHands
)
{
...
@@ -60,6 +65,22 @@ export const handsCase = (builder: ActionReducerMapBuilder<DuelState>) => {
...
@@ -60,6 +65,22 @@ export const handsCase = (builder: ActionReducerMapBuilder<DuelState>) => {
}
}
}
}
});
});
builder
.
addCase
(
fetchHandsMeta
.
fulfilled
,
(
state
,
action
)
=>
{
// `Meta`结果回来后更新手牌的`Meta`结果
const
player
=
action
.
payload
[
0
];
const
metas
=
action
.
payload
[
1
];
const
hands
=
judgeSelf
(
player
,
state
)
?
state
.
meHands
:
state
.
opHands
;
if
(
hands
)
{
for
(
let
hand
of
hands
.
cards
)
{
for
(
let
meta
of
metas
)
{
if
(
hand
.
meta
.
id
===
meta
.
id
)
{
hand
.
meta
=
meta
;
}
}
}
}
});
};
};
// 更新手牌的位置和旋转信息
// 更新手牌的位置和旋转信息
...
...
src/reducers/duel/util.ts
View file @
f788671c
...
@@ -48,17 +48,17 @@ interface CardTransform {
...
@@ -48,17 +48,17 @@ interface CardTransform {
export
enum
InteractType
{
export
enum
InteractType
{
// 可普通召唤
// 可普通召唤
SUMMON
,
SUMMON
=
1
,
// 可特殊召唤
// 可特殊召唤
SP_SUMMON
,
SP_SUMMON
=
2
,
// 可改变表示形式
// 可改变表示形式
POS_CHANGE
,
POS_CHANGE
=
3
,
// 可前场放置
// 可前场放置
MSET
,
MSET
=
4
,
// 可后场放置
// 可后场放置
SSET
,
SSET
=
5
,
// 可发动效果
// 可发动效果
ACTIVATE
,
ACTIVATE
=
6
,
}
}
export
interface
Interactivity
{
export
interface
Interactivity
{
...
...
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