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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
MyCard
Neos
Commits
4d7d9493
Commit
4d7d9493
authored
May 09, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'optimize/move/hand/effct' into 'main'
optimize hand effect See merge request
!186
parents
a2e3a130
30e67fb9
Pipeline
#21573
passed with stages
in 20 minutes and 16 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
11 deletions
+32
-11
src/service/duel/draw.ts
src/service/duel/draw.ts
+9
-1
src/service/duel/move.ts
src/service/duel/move.ts
+15
-2
src/service/duel/shuffleHand.ts
src/service/duel/shuffleHand.ts
+7
-7
src/stores/matStore/types.ts
src/stores/matStore/types.ts
+1
-1
No files found.
src/service/duel/draw.ts
View file @
4d7d9493
...
...
@@ -15,5 +15,13 @@ export default (draw: ygopro.StocGameMessage.MsgDraw) => {
return
{
uuid
:
pop
.
uuid
,
id
:
hand
};
});
matStore
.
hands
.
of
(
draw
.
player
).
add
(
data
,
ygopro
.
CardPosition
.
FACEUP_ATTACK
);
matStore
.
hands
.
of
(
draw
.
player
)
.
add
(
data
,
ygopro
.
CardPosition
.
FACEUP_ATTACK
,
true
);
setTimeout
(()
=>
{
for
(
const
hand
of
matStore
.
hands
.
of
(
draw
.
player
))
{
hand
.
focus
=
false
;
}
},
500
);
};
src/service/duel/move.ts
View file @
4d7d9493
...
...
@@ -81,7 +81,7 @@ export default (move: MsgMove) => {
()
=>
(
matStore
.
in
(
to
.
location
).
of
(
to
.
controler
)[
to
.
sequence
].
focus
=
false
),
500
// use config
500
//
TODO:
use config
);
break
;
}
...
...
@@ -101,7 +101,20 @@ export default (move: MsgMove) => {
matStore
.
in
(
to
.
location
)
.
of
(
to
.
controler
)
.
insert
(
uuid
,
code
,
to
.
sequence
,
ygopro
.
CardPosition
.
FACEUP_ATTACK
);
.
insert
(
uuid
,
code
,
to
.
sequence
,
ygopro
.
CardPosition
.
FACEUP_ATTACK
,
true
);
setTimeout
(
()
=>
(
matStore
.
in
(
to
.
location
).
of
(
to
.
controler
)[
to
.
sequence
].
focus
=
false
),
200
);
}
break
;
}
...
...
src/service/duel/shuffleHand.ts
View file @
4d7d9493
import
{
ygopro
}
from
"
@/api
"
;
import
{
matStore
}
from
"
@/stores
"
;
import
{
zip
}
from
"
@/ui/Duel/utils
"
;
type
MsgShuffleHand
=
ygopro
.
StocGameMessage
.
MsgShuffleHand
;
export
default
(
shuffleHand
:
MsgShuffleHand
)
=>
{
const
{
hands
:
codes
,
player
:
controller
}
=
shuffleHand
;
const
uuids
=
matStore
.
hands
.
of
(
controller
).
map
((
hand
)
=>
hand
.
uuid
);
const
data
=
zip
(
uuids
,
codes
).
map
(([
uuid
,
id
])
=>
{
return
{
uuid
,
id
};
});
const
indexMap
=
new
Map
(
codes
.
map
((
code
,
idx
)
=>
[
code
,
idx
]));
matStore
.
hands
.
of
(
controller
).
sort
((
a
,
b
)
=>
{
const
indexA
=
indexMap
.
get
(
a
.
occupant
?.
id
??
0
)
??
0
;
const
indexB
=
indexMap
.
get
(
b
.
occupant
?.
id
??
0
)
??
0
;
matStore
.
hands
.
of
(
controller
).
length
=
0
;
matStore
.
hands
.
of
(
controller
).
add
(
data
);
return
indexA
-
indexB
;
}
);
};
src/stores/matStore/types.ts
View file @
4d7d9493
...
...
@@ -120,7 +120,7 @@ export interface CardState {
zone
:
ygopro
.
CardZone
;
// 怪兽区/魔法陷阱区/手牌/卡组/墓地/除外区
position
?:
ygopro
.
CardPosition
;
// 卡片的姿势:攻击还是守备
};
// 位置信息,叫location的原因是为了和ygo对齐
focus
?:
boolean
;
focus
?:
boolean
;
// 用于实现动画效果,当这个字段为true时,该张卡片会被放大并在屏幕中央展示
idleInteractivities
:
Interactivity
<
number
>
[];
// IDLE状态下的互动信息
placeInteractivity
?:
Interactivity
<
{
controler
:
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