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
70713eae
Commit
70713eae
authored
May 27, 2023
by
timel
Committed by
Chunchi Che
May 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: optimize log
parent
7365a6b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
29 deletions
+21
-29
src/service/duel/move.ts
src/service/duel/move.ts
+3
-8
src/ui/Duel/NewPlayMat/Card/index.tsx
src/ui/Duel/NewPlayMat/Card/index.tsx
+9
-3
src/ui/Duel/NewPlayMat/Card/springs/toGround.ts
src/ui/Duel/NewPlayMat/Card/springs/toGround.ts
+9
-18
No files found.
src/service/duel/move.ts
View file @
70713eae
...
...
@@ -175,15 +175,9 @@ export default async (move: MsgMove) => {
(
async
()
=>
{
const
{
text
}
=
await
fetchCard
(
code
);
console
.
warn
(
"
move
"
,
text
.
name
,
ygopro
.
CardZone
[
fromZone
],
from
.
sequence
,
"
->
"
,
ygopro
.
CardZone
[
toZone
],
to
.
sequence
`
${
text
.
name
}
${
ygopro
.
CardZone
[
fromZone
]}
:
${
from
.
sequence
}
→
${
ygopro
.
CardZone
[
toZone
]}
:
${
to
.
sequence
}
`
);
console
.
warn
(
"
overlay
"
,
from
.
overlay_sequence
,
to
.
overlay_sequence
);
//
console.warn("overlay", from.overlay_sequence, to.overlay_sequence);
})();
let
target
:
CardType
;
...
...
@@ -238,6 +232,7 @@ export default async (move: MsgMove) => {
if
(
card
.
uuid
!==
target
.
uuid
)
eventBus
.
emit
(
Report
.
Move
,
card
.
uuid
);
});
}
// TODO: 如果涉及了有超量素材的怪兽的移动,那么这个怪兽的移动应该也会带动超量素材的移动
// 注意,一个monster的overlayMaterials中的每一项都是一个cardType,
// 并且,overlayMaterials的idx就是超量素材的sequence。
...
...
src/ui/Duel/NewPlayMat/Card/index.tsx
View file @
70713eae
...
...
@@ -90,8 +90,14 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => {
>
<
div
className=
"card-shadow"
/>
<
div
className=
"card-img-wrap"
>
<
img
className=
"card-cover"
src=
{
getCardImgUrl
(
snap
.
code
)
}
alt=
""
/>
<
img
className=
"card-back"
src=
{
getCardImgUrl
(
0
,
true
)
}
alt=
""
/>
<
img
className=
"card-cover"
onError=
{
()
=>
{
console
.
log
(
""
);
}
}
src=
{
getCardImgUrl
(
snap
.
code
)
}
/>
<
img
className=
"card-back"
src=
{
getCardImgUrl
(
0
,
true
)
}
/>
</
div
>
</
animated
.
div
>
);
...
...
@@ -102,7 +108,7 @@ function getCardImgUrl(code: number, back = false) {
import
.
meta
.
env
.
BASE_URL
==
"
/
"
?
NeosConfig
.
assetsPath
:
import
.
meta
.
env
.
BASE_URL
+
NeosConfig
.
assetsPath
;
if
(
back
)
{
if
(
code
===
0
||
back
)
{
return
ASSETS_BASE
+
"
/card_back.jpg
"
;
}
return
NeosConfig
.
cardImgUrl
+
"
/
"
+
code
+
"
.jpg
"
;
...
...
src/ui/Duel/NewPlayMat/Card/springs/toGround.ts
View file @
70713eae
...
...
@@ -29,9 +29,13 @@ export const moveToGround = async (props: {
api
:
SpringApi
;
})
=>
{
const
{
card
,
api
}
=
props
;
// report
// 如果是超量素材,那么,应该看超量素材所属的xyzMonster
const
targetCard
=
card
.
zone
===
OVERLAY
?
(
card
.
xyzMonster
?
card
.
xyzMonster
:
card
)
:
card
;
const
{
zone
,
sequence
,
controller
,
xyzMonster
,
position
,
overlayMaterials
}
=
c
ard
;
targetC
ard
;
// 根据zone计算卡片的宽度
const
cardWidth
=
...
...
@@ -61,6 +65,7 @@ export const moveToGround = async (props: {
}
break
;
}
case
OVERLAY
:
case
MZONE
:
{
if
(
sequence
>
4
)
{
// 额外怪兽区
...
...
@@ -72,20 +77,6 @@ export const moveToGround = async (props: {
}
break
;
}
case
OVERLAY
:
{
if
(
xyzMonster
)
{
const
{
sequence
}
=
xyzMonster
;
if
(
sequence
>
4
)
{
// 额外怪兽区
x
=
(
sequence
>
5
?
1
:
-
1
)
*
(
BLOCK_WIDTH
.
value
+
COL_GAP
.
value
);
y
=
0
;
}
else
{
x
=
(
sequence
-
2
)
*
(
BLOCK_WIDTH
.
value
+
COL_GAP
.
value
);
y
=
BLOCK_HEIGHT_M
.
value
+
ROW_GAP
.
value
;
}
}
break
;
}
}
if
(
!
isMe
(
controller
))
{
...
...
@@ -119,14 +110,14 @@ export const moveToGround = async (props: {
rz
,
config
:
{
// mass: 0.5,
easing
:
easings
.
easeInSine
,
easing
:
easings
.
easeIn
Out
Sine
,
},
});
await
asyncStart
(
api
)({
z
:
0
,
zIndex
:
overlayMaterials
.
length
?
3
:
1
,
config
:
{
easing
:
easings
.
ease
OutSine
,
easing
:
easings
.
ease
InOutQuad
,
mass
:
5
,
tension
:
300
,
// 170
friction
:
12
,
// 26
...
...
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