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
deft
Neos
Commits
30e67fb9
Commit
30e67fb9
authored
May 09, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize hand effect
parent
a2e3a130
Changes
4
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 @
30e67fb9
...
...
@@ -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 @
30e67fb9
...
...
@@ -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 @
30e67fb9
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 @
30e67fb9
...
...
@@ -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