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
0d08c12d
Commit
0d08c12d
authored
Mar 20, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save
parent
180cdfd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
src/reducers/duel/commonSlice.ts
src/reducers/duel/commonSlice.ts
+11
-0
src/reducers/duel/generic.ts
src/reducers/duel/generic.ts
+23
-0
No files found.
src/reducers/duel/commonSlice.ts
View file @
0d08c12d
import
{
Reducer
}
from
"
react
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
clearIdleInteractivities
,
...
...
@@ -6,6 +7,7 @@ import {
updateCardData
,
}
from
"
./generic
"
;
import
{
judgeSelf
}
from
"
./util
"
;
import
MsgReloadField
=
ygopro
.
StocGameMessage
.
MsgReloadField
;
type
MsgUpdateData
=
ReturnType
<
typeof
ygopro
.
StocGameMessage
.
MsgUpdateData
.
prototype
.
toObject
>
;
...
...
@@ -124,3 +126,12 @@ export const updateFieldDataImpl: DuelReducer<MsgUpdateData> = (
}
}
};
export
const
reloadFieldImpl
:
DuelReducer
<
MsgReloadField
>
=
(
state
,
action
)
=>
{
const
_duel_rule
=
action
.
payload
.
duel_rule
;
for
(
const
reload
of
action
.
payload
.
actions
)
{
const
player
=
reload
.
player
;
// MZONE
}
};
src/reducers/duel/generic.ts
View file @
0d08c12d
...
...
@@ -8,6 +8,7 @@ import { CardMeta } from "../../api/cards";
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
fetchCard
}
from
"
../../api/cards
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
ReloadFieldAction
=
ygopro
.
StocGameMessage
.
MsgReloadField
.
ZoneAction
;
type
UpdateDataAction
=
ReturnType
<
typeof
ygopro
.
StocGameMessage
.
MsgUpdateData
.
Action
.
prototype
.
toObject
>
;
...
...
@@ -33,6 +34,7 @@ export interface CardState {
sequence
:
number
;
}
>
;
// 选择位置状态下的互动信息
overlay_materials
?:
CardMeta
[];
// 超量素材
reload
?:
boolean
;
// 这个字段会在收到MSG_RELOAD_FIELD的时候设置成true,在收到MSG_UPDATE_DATE的时候设置成false
}
export
enum
InteractType
{
...
...
@@ -328,3 +330,24 @@ export function updateCardData<T extends DuelFieldState>(
}
}
}
export
function
reloadFieldMeta
<
T
extends
DuelFieldState
>
(
state
:
T
,
actions
:
ReloadFieldAction
[],
controler
:
number
)
{
const
cards
=
actions
.
map
((
action
)
=>
{
// FIXME: OVERLAY
return
{
location
:
{
controler
,
location
:
action
.
zone
,
position
:
action
.
position
,
},
idleInteractivities
:
[],
reload
:
true
,
};
});
state
.
inner
=
cards
;
}
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