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
BBeretta
Neos
Commits
012d2682
Commit
012d2682
authored
May 09, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a80f0ca9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
14 deletions
+27
-14
src/service/duel/move.ts
src/service/duel/move.ts
+2
-2
src/service/duel/timeLimit.ts
src/service/duel/timeLimit.ts
+1
-1
src/stores/matStore/store.ts
src/stores/matStore/store.ts
+15
-5
src/stores/matStore/types.ts
src/stores/matStore/types.ts
+4
-2
src/ui/Duel/PlayMat/Mat.tsx
src/ui/Duel/PlayMat/Mat.tsx
+5
-4
No files found.
src/service/duel/move.ts
View file @
012d2682
...
...
@@ -81,7 +81,7 @@ export default (move: MsgMove) => {
()
=>
(
matStore
.
in
(
to
.
location
).
of
(
to
.
controler
)[
to
.
sequence
].
focus
=
false
),
500
500
// use config
);
break
;
}
...
...
@@ -101,7 +101,7 @@ export default (move: MsgMove) => {
matStore
.
in
(
to
.
location
)
.
of
(
to
.
controler
)
.
insert
(
uuid
,
code
,
to
.
sequence
);
.
insert
(
uuid
,
code
,
to
.
sequence
,
ygopro
.
CardPosition
.
FACEUP_ATTACK
);
}
break
;
}
...
...
src/service/duel/timeLimit.ts
View file @
012d2682
import
{
sendTimeConfirm
,
ygopro
}
from
"
@/api
"
;
import
{
matStore
}
from
"
@/stores
"
;
const
TIME_GAP
=
8
00
;
const
TIME_GAP
=
15
00
;
export
default
function
handleTimeLimit
(
timeLimit
:
ygopro
.
StocTimeLimit
)
{
setTimeout
(()
=>
{
...
...
src/stores/matStore/store.ts
View file @
012d2682
...
...
@@ -29,7 +29,8 @@ class CardArray extends Array<CardState> implements ArrayCardState {
uuid
:
string
,
controller
:
number
,
id
:
number
,
position
?:
ygopro
.
CardPosition
position
?:
ygopro
.
CardPosition
,
focus
?:
boolean
)
=>
({
uuid
,
occupant
:
await
fetchCard
(
id
,
true
),
...
...
@@ -39,6 +40,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
position
:
position
==
undefined
?
ygopro
.
CardPosition
.
FACEUP_ATTACK
:
position
,
},
focus
,
counters
:
{},
idleInteractivities
:
[],
});
...
...
@@ -50,18 +52,26 @@ class CardArray extends Array<CardState> implements ArrayCardState {
uuid
:
string
,
id
:
number
,
sequence
:
number
,
position
?:
ygopro
.
CardPosition
position
?:
ygopro
.
CardPosition
,
focus
?:
boolean
)
{
const
card
=
await
this
.
genCard
(
uuid
,
this
.
getController
(),
id
,
position
);
const
card
=
await
this
.
genCard
(
uuid
,
this
.
getController
(),
id
,
position
,
focus
);
this
.
splice
(
sequence
,
0
,
card
);
}
async
add
(
data
:
{
uuid
:
string
;
id
:
number
}[],
position
?:
ygopro
.
CardPosition
position
?:
ygopro
.
CardPosition
,
focus
?:
boolean
)
{
const
cards
=
await
Promise
.
all
(
data
.
map
(
async
({
uuid
,
id
})
=>
this
.
genCard
(
uuid
,
this
.
getController
(),
id
,
position
)
this
.
genCard
(
uuid
,
this
.
getController
(),
id
,
position
,
focus
)
)
);
this
.
splice
(
this
.
length
,
0
,
...
cards
);
...
...
src/stores/matStore/types.ts
View file @
012d2682
...
...
@@ -20,12 +20,14 @@ export interface DuelFieldState extends Array<CardState> {
uuid
:
string
,
id
:
number
,
sequence
:
number
,
position
?:
ygopro
.
CardPosition
position
?:
ygopro
.
CardPosition
,
focus
?:
boolean
)
=>
Promise
<
void
>
;
/** 在末尾添加卡片 */
add
:
(
data
:
{
uuid
:
string
;
id
:
number
}[],
position
?:
ygopro
.
CardPosition
position
?:
ygopro
.
CardPosition
,
focus
?:
boolean
)
=>
Promise
<
void
>
;
/** 设置占据这个位置的卡片信息 */
setOccupant
:
(
...
...
src/ui/Duel/PlayMat/Mat.tsx
View file @
012d2682
...
...
@@ -95,14 +95,15 @@ export const Mat = () => {
col=
{
cardStateToCol
(
card
)
}
hight=
{
CardStateToHigh
(
card
)
}
defense=
{
card
.
location
.
position
===
YgoPosition
.
DEFENSE
||
card
.
location
.
position
===
YgoPosition
.
FACEDOWN_DEFENSE
||
card
.
location
.
position
===
YgoPosition
.
FACEUP_DEFENSE
!
card
.
focus
&&
(
card
.
location
.
position
===
YgoPosition
.
DEFENSE
||
card
.
location
.
position
===
YgoPosition
.
FACEDOWN_DEFENSE
||
card
.
location
.
position
===
YgoPosition
.
FACEUP_DEFENSE
)
}
facedown=
{
CardStateToFaceDown
(
card
)
}
vertical=
{
card
.
location
.
zone
==
YgoZone
.
HAND
||
card
.
focus
}
highlight=
{
card
.
idleInteractivities
.
length
>
0
}
focus=
{
card
.
focus
&&
card
.
occupant
?.
id
!==
0
}
focus=
{
card
.
focus
}
opponent=
{
card
.
opponent
}
onClick=
{
card
.
location
.
zone
==
YgoZone
.
SZONE
||
...
...
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