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
429fe1e0
Commit
429fe1e0
authored
Jun 17, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
register animation in shuffleHand.ts
parent
e06ef308
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+1
-1
src/service/duel/shuffleHand.ts
src/service/duel/shuffleHand.ts
+7
-3
No files found.
src/service/duel/gameMsg.ts
View file @
429fe1e0
...
...
@@ -144,7 +144,7 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
}
case
"
shuffle_hand
"
:
{
onMsgShuffleHand
(
msg
.
shuffle_hand
);
await
onMsgShuffleHand
(
msg
.
shuffle_hand
);
break
;
}
...
...
src/service/duel/shuffleHand.ts
View file @
429fe1e0
import
{
ygopro
}
from
"
@/api
"
;
import
{
eventbus
,
Task
}
from
"
@/infra
"
;
import
{
cardStore
}
from
"
@/stores
"
;
type
MsgShuffleHand
=
ygopro
.
StocGameMessage
.
MsgShuffleHand
;
export
default
(
shuffleHand
:
MsgShuffleHand
)
=>
{
export
default
async
(
shuffleHand
:
MsgShuffleHand
)
=>
{
const
{
hands
:
codes
,
player
:
controller
}
=
shuffleHand
;
// 本质上是要将手卡的sequence变成和codes一样的顺序
...
...
@@ -13,13 +14,16 @@ export default (shuffleHand: MsgShuffleHand) => {
hash
.
get
(
code
)?.
push
(
sequence
);
});
hands
.
forEach
((
hand
)
=>
{
for
(
const
hand
of
hands
)
{
const
sequences
=
hash
.
get
(
hand
.
code
);
if
(
sequences
!==
undefined
)
{
const
sequence
=
sequences
.
pop
();
if
(
sequence
!==
undefined
)
{
hand
.
location
.
sequence
=
sequence
;
hash
.
set
(
hand
.
code
,
sequences
);
// 触发动画
await
eventbus
.
call
(
Task
.
Move
,
hand
.
uuid
);
}
else
{
console
.
warn
(
`<ShuffleHand>sequence poped is none, controller=
${
controller
}
, code=
${
hand
.
code
}
, sequence=
${
sequence
}
`
...
...
@@ -32,5 +36,5 @@ export default (shuffleHand: MsgShuffleHand) => {
)}
, codes=
${
codes
}
`
);
}
}
);
}
};
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