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
cab7edda
Commit
cab7edda
authored
Dec 25, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add interface Monster
parent
03b929ca
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
src/reducers/duel/handsSlice.ts
src/reducers/duel/handsSlice.ts
+1
-1
src/reducers/duel/monstersSlice.ts
src/reducers/duel/monstersSlice.ts
+1
-0
src/reducers/duel/util.ts
src/reducers/duel/util.ts
+16
-3
No files found.
src/reducers/duel/handsSlice.ts
View file @
cab7edda
...
@@ -126,7 +126,7 @@ export const addHandsInteractivityImpl: CaseReducer<
...
@@ -126,7 +126,7 @@ export const addHandsInteractivityImpl: CaseReducer<
PayloadAction
<
{
PayloadAction
<
{
player
:
number
;
player
:
number
;
index
:
number
;
index
:
number
;
interactivity
:
Interactivity
;
interactivity
:
Interactivity
<
number
>
;
}
>
}
>
>
=
(
state
,
action
)
=>
{
>
=
(
state
,
action
)
=>
{
const
player
=
action
.
payload
.
player
;
const
player
=
action
.
payload
.
player
;
...
...
src/reducers/duel/monstersSlice.ts
0 → 100644
View file @
cab7edda
export
interface
MonsterState
{}
src/reducers/duel/util.ts
View file @
cab7edda
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
import
{
CardMeta
}
from
"
../../api/cards
"
;
import
{
CardMeta
}
from
"
../../api/cards
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
Draft
}
from
"
@reduxjs/toolkit
"
;
import
{
Draft
}
from
"
@reduxjs/toolkit
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
/*
/*
* 通过`player`和`selfType`判断是应该处理自己还是对手
* 通过`player`和`selfType`判断是应该处理自己还是对手
...
@@ -30,7 +31,7 @@ export function judgeSelf(player: number, state: Draft<DuelState>): boolean {
...
@@ -30,7 +31,7 @@ export function judgeSelf(player: number, state: Draft<DuelState>): boolean {
export
interface
Card
{
export
interface
Card
{
meta
:
CardMeta
;
meta
:
CardMeta
;
transform
:
CardTransform
;
transform
:
CardTransform
;
interactivities
:
Interactivity
[];
interactivities
:
Interactivity
<
number
>
[];
}
}
interface
CardTransform
{
interface
CardTransform
{
...
@@ -59,12 +60,24 @@ export enum InteractType {
...
@@ -59,12 +60,24 @@ export enum InteractType {
SSET
=
5
,
SSET
=
5
,
// 可发动效果
// 可发动效果
ACTIVATE
=
6
,
ACTIVATE
=
6
,
// 可作为位置选择
PLACE_SELECTABLE
=
7
,
}
}
export
interface
Interactivity
{
export
interface
Interactivity
<
T
>
{
interactType
:
InteractType
;
interactType
:
InteractType
;
// 如果`interactType`是`ACTIVATE`,这个字段是对应的效果编号
// 如果`interactType`是`ACTIVATE`,这个字段是对应的效果编号
activateIndex
?:
number
;
activateIndex
?:
number
;
// 用户点击后,需要回传给服务端的`response`
// 用户点击后,需要回传给服务端的`response`
response
:
number
;
response
:
T
;
}
export
interface
Monster
{
sequence
:
number
;
occupant
?:
CardMeta
;
selectInfo
?:
Interactivity
<
{
controler
:
number
;
zone
:
ygopro
.
CardZone
;
sequence
:
number
;
}
>
;
}
}
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