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
f81ba477
Commit
f81ba477
authored
May 24, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize chain effect
parent
381e6fb9
Pipeline
#21808
passed with stages
in 14 minutes and 2 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
5 deletions
+28
-5
src/service/duel/chainSolved.ts
src/service/duel/chainSolved.ts
+13
-2
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+1
-1
src/service/duel/move.ts
src/service/duel/move.ts
+2
-2
src/stores/matStore/store.ts
src/stores/matStore/store.ts
+10
-0
src/stores/matStore/types.ts
src/stores/matStore/types.ts
+2
-0
No files found.
src/service/duel/chainSolved.ts
View file @
f81ba477
import
{
ygopro
}
from
"
@/api
"
;
import
{
sleep
}
from
"
@/infra
"
;
import
{
matStore
}
from
"
@/stores
"
;
// FIXME: 处理连锁会存在三种结果:
...
...
@@ -9,13 +10,23 @@ import { matStore } from "@/stores";
// 对于这三种情况`service`层的逻辑是一致的,但是UI展示应该有区别,
// 因为现在还没实现连锁处理的动画,因此暂时先都一致处理,
// 体现在 `penetrage.json`文件中三个一样的配置。
export
default
(
chainSolved
:
ygopro
.
StocGameMessage
.
MsgChainSolved
)
=>
{
export
default
async
(
chainSolved
:
ygopro
.
StocGameMessage
.
MsgChainSolved
)
=>
{
const
location
=
matStore
.
chains
.
splice
(
chainSolved
.
solved_index
-
1
,
1
)
.
at
(
0
);
if
(
location
)
{
// 设置被连锁状态为空
// 连锁处理时,先聚焦这张卡
matStore
.
setFocus
(
location
,
true
);
await
sleep
(
100
);
// TODO: 针对不同处理结果实现不同动画
// 设置被连锁状态为空,接触连锁
matStore
.
setChained
(
location
,
undefined
);
await
sleep
(
100
);
// 取消聚焦
matStore
.
setFocus
(
location
,
false
);
}
else
{
console
.
warn
(
`pop from chains return null! solved_index=
${
chainSolved
.
solved_index
}
, len of chains in store=
${
matStore
.
chains
.
length
}
`
...
...
src/service/duel/gameMsg.ts
View file @
f81ba477
...
...
@@ -231,7 +231,7 @@ export default async function handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
}
case
"
chain_solved
"
:
{
onMsgChainSolved
(
msg
.
chain_solved
);
await
onMsgChainSolved
(
msg
.
chain_solved
);
break
;
}
...
...
src/service/duel/move.ts
View file @
f81ba477
...
...
@@ -102,7 +102,7 @@ export default async (move: MsgMove) => {
chainIndex
;
await
sleep
(
NeosConfig
.
ui
.
moveDelay
);
matStore
.
in
(
to
.
location
).
of
(
to
.
controler
)[
to
.
sequence
].
focus
=
false
;
matStore
.
setFocus
(
to
,
false
)
;
break
;
}
case
ygopro
.
CardZone
.
REMOVED
:
...
...
@@ -132,7 +132,7 @@ export default async (move: MsgMove) => {
);
await
sleep
(
NeosConfig
.
ui
.
moveDelay
);
matStore
.
in
(
to
.
location
).
of
(
to
.
controler
)[
to
.
sequence
].
focus
=
false
;
matStore
.
setFocus
(
to
,
false
)
;
}
break
;
}
...
...
src/stores/matStore/store.ts
View file @
f81ba477
...
...
@@ -297,6 +297,16 @@ export const matStore: MatState = proxy<MatState>({
console
.
warn
(
`target is null in setChained, location=
${
location
}
`
);
}
},
setFocus
(
location
,
focus
)
{
const
target
=
this
.
in
(
location
.
location
)
.
of
(
location
.
controler
)
.
at
(
location
.
sequence
);
if
(
target
)
{
target
.
focus
=
focus
;
}
else
{
console
.
warn
(
`target is null in setFocus, location=
${
location
}
`
);
}
},
});
// @ts-ignore 挂到全局,便于调试
...
...
src/stores/matStore/types.ts
View file @
f81ba477
...
...
@@ -112,6 +112,8 @@ export interface MatState {
)
=>
Promise
<
void
>
;
// 添加被连锁状态
setChained
:
(
location
:
ygopro
.
CardLocation
,
chainIndex
?:
number
)
=>
void
;
// 设置聚焦状态
setFocus
:
(
location
:
ygopro
.
CardLocation
,
focus
:
boolean
)
=>
void
;
}
export
interface
InitInfo
{
...
...
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