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
ef732166
Commit
ef732166
authored
Apr 20, 2024
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复“确认盖卡”不生效的问题
parent
4545182b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
6 deletions
+39
-6
src/service/duel/confirmCards.ts
src/service/duel/confirmCards.ts
+39
-6
No files found.
src/service/duel/confirmCards.ts
View file @
ef732166
import
{
fetchCard
,
ygopro
}
from
"
@/api
"
;
import
{
sleep
}
from
"
@/infra
"
;
import
{
cardStore
}
from
"
@/stores
"
;
import
{
callCardFocus
}
from
"
@/ui/Duel/PlayMat/Card
"
;
import
{
callCardFocus
,
callCardMove
}
from
"
@/ui/Duel/PlayMat/Card
"
;
const
{
MZONE
,
SZONE
}
=
ygopro
.
CardZone
;
const
{
FACEUP_ATTACK
,
FACEDOWN_ATTACK
,
FACEDOWN_DEFENSE
,
FACEDOWN
}
=
ygopro
.
CardPosition
;
const
WAIT_TIME
=
100
;
export
default
async
(
confirmCards
:
ygopro
.
StocGameMessage
.
MsgConfirmCards
)
=>
{
const
cards
=
confirmCards
.
cards
;
...
...
@@ -13,12 +20,38 @@ export default async (confirmCards: ygopro.StocGameMessage.MsgConfirmCards) => {
// 设置`occupant`
const
meta
=
fetchCard
(
card
.
code
);
target
.
meta
=
meta
;
const
zone
=
target
.
location
.
zone
;
const
position
=
target
.
location
.
position
;
// 动画
await
callCardFocus
(
target
.
uuid
);
if
(
target
.
code
===
0
)
{
// 如果是对方或者是在观战模式下双方展示手牌,target的code会是0,
// 这里应该清掉meta,UI上表现是回复到卡背状态
target
.
meta
=
{
id
:
0
,
data
:
{},
text
:
{}
};
if
(
(
zone
===
MZONE
||
zone
===
SZONE
)
&&
(
position
===
FACEDOWN_ATTACK
||
position
===
FACEDOWN_DEFENSE
||
position
===
FACEDOWN
)
)
{
/* 这个分支确认盖卡(包括魔限和怪兽卡)的场景。
/* 这里让盖卡向上翻开,再重新盖上
/* TODO: 这里比较合理的做法应该是新实现一种动画。
/* 这里暂时先使用这种简单的处理办法。*/
target
.
location
.
position
=
FACEUP_ATTACK
;
await
callCardMove
(
target
.
uuid
);
// 暂停一会再盖上
await
sleep
(
WAIT_TIME
);
// 恢复position
target
.
location
.
position
=
position
;
await
callCardMove
(
target
.
uuid
);
}
else
{
// 这个分支是确认手卡或者卡组或者额外卡组的场景(大概)
await
callCardFocus
(
target
.
uuid
);
if
(
target
.
code
===
0
)
{
// 如果是对方或者是在观战模式下双方展示手牌,target的code会是0,
// 这里应该清掉meta,UI上表现是回复到卡背状态
target
.
meta
=
{
id
:
0
,
data
:
{},
text
:
{}
};
}
}
}
else
{
console
.
warn
(
`card of
${
card
}
is null`
);
...
...
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