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
baichixing
Neos
Commits
cb6d7174
Commit
cb6d7174
authored
Mar 23, 2024
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/service/chain' into 'main'
修复连锁相关的service层实现 See merge request
mycard/Neos!350
parents
70c44a41
23daef2f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
23 deletions
+13
-23
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.json
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.json
+0
-18
src/service/duel/chainEnd.ts
src/service/duel/chainEnd.ts
+2
-0
src/service/duel/chainSolved.ts
src/service/duel/chainSolved.ts
+7
-4
src/service/duel/chaining.ts
src/service/duel/chaining.ts
+4
-1
No files found.
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.json
View file @
cb6d7174
...
...
@@ -139,24 +139,6 @@
"protoType"
:
"chain_end"
,
"fields"
:
[]
},
"75"
:
{
"protoType"
:
"chain_solved"
,
"fields"
:
[
{
"fieldName"
:
"solved_index"
,
"fieldType"
:
"uint8"
}
]
},
"76"
:
{
"protoType"
:
"chain_solved"
,
"fields"
:
[
{
"fieldName"
:
"solved_index"
,
"fieldType"
:
"uint8"
}
]
},
"94"
:
{
"protoType"
:
"lp_update"
,
"fields"
:
[
...
...
src/service/duel/chainEnd.ts
View file @
cb6d7174
...
...
@@ -2,6 +2,8 @@ import { ygopro } from "@/api";
import
{
cardStore
,
matStore
,
placeStore
}
from
"
@/stores
"
;
export
default
(
_chainEnd
:
ygopro
.
StocGameMessage
.
MsgChainEnd
)
=>
{
console
.
info
(
`<ChainEnd>chain has been end`
);
while
(
true
)
{
const
chain
=
matStore
.
chains
.
pop
();
if
(
chain
===
undefined
)
{
...
...
src/service/duel/chainSolved.ts
View file @
cb6d7174
...
...
@@ -6,10 +6,12 @@ import { matStore, placeStore } from "@/stores";
// 2. NEGATED - 被无效;
// 3. DISABLED - 被禁用。
//
//
对于这三种情况`service`层的逻辑是一致的,但是UI展示应该有区别
,
//
因为现在还没实现连锁处理的动画,因此暂时先都一致处理,
//
体现在 `penetrage.json`文件中三个一样的配置
。
//
第一种MSG后端会在每一个连锁点处理完(不管是无效还是禁用)发给前端
,
//
第二第三种只会在特定情况下发,用于UI展示。
//
这里暂时只处理第一种
。
export
default
async
(
chainSolved
:
ygopro
.
StocGameMessage
.
MsgChainSolved
)
=>
{
console
.
info
(
`<ChainSolved>solved_index =
${
chainSolved
.
solved_index
}
`
);
const
location
=
matStore
.
chains
.
splice
(
chainSolved
.
solved_index
-
1
,
1
)
.
at
(
0
);
...
...
@@ -23,7 +25,8 @@ export default async (chainSolved: ygopro.StocGameMessage.MsgChainSolved) => {
}
}
else
{
console
.
warn
(
`pop from chains return null! solved_index=
${
chainSolved
.
solved_index
}
, len of chains in store=
${
matStore
.
chains
.
length
}
`
,
`pop from chains return null! solved_index=
${
chainSolved
.
solved_index
}
,
len of chains in store=
${
matStore
.
chains
.
length
}
`
,
);
}
};
src/service/duel/chaining.ts
View file @
cb6d7174
...
...
@@ -25,7 +25,9 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
const
meta
=
fetchCard
(
chaining
.
code
);
// 这里不能设置`code`,因为存在一个场景:
// 对方的`魔神仪-曼德拉护肤草`发动效果后,后端会发一次`MSG_SHUFFLE_HAND`,但传给前端的codes全是0,如果这里设置了`code`的话,在后面的`MSG_SHUFFLE_HAND`处理就会有问题。
// 对方的`魔神仪-曼德拉护肤草`发动效果后,后端会发一次`MSG_SHUFFLE_HAND`,
// 但传给前端的codes全是0,如果这里设置了`code`的话,
// 在后面的`MSG_SHUFFLE_HAND`处理就会有问题。
// target.code = meta.id;
// 设置`Meta`信息,让对手发动效果的卡也能展示正面卡图
...
...
@@ -36,6 +38,7 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
// 发动效果动画
await
callCardFocus
(
target
.
uuid
);
console
.
color
(
"
blue
"
)(
`
${
target
.
meta
.
text
.
name
}
chaining`
);
console
.
info
(
`<Chaining>chain stack length =
${
matStore
.
chains
.
length
}
`
);
}
else
{
console
.
warn
(
`<Chaining>target from
${
location
}
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