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
c60754fd
Commit
c60754fd
authored
May 13, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix chaining
parent
3184d713
Pipeline
#21649
passed with stages
in 17 minutes and 57 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
23 deletions
+20
-23
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+3
-10
src/stores/matStore/store.ts
src/stores/matStore/store.ts
+16
-12
src/stores/matStore/types.ts
src/stores/matStore/types.ts
+1
-1
No files found.
src/service/duel/gameMsg.ts
View file @
c60754fd
...
@@ -61,8 +61,8 @@ const NeosConfig = useConfig();
...
@@ -61,8 +61,8 @@ const NeosConfig = useConfig();
export
default
function
handleGameMsg
(
pb
:
ygopro
.
YgoStocMsg
)
{
export
default
function
handleGameMsg
(
pb
:
ygopro
.
YgoStocMsg
)
{
// 防止MSG更新太频繁,做下控频
// 防止MSG更新太频繁,做下控频
//
const
delay
=
matStore
.
delay
;
// TODO: 细化需要控频的MSG
setTimeout
(()
=>
{
setTimeout
(()
=>
{
const
msg
=
pb
.
stoc_game_msg
;
const
msg
=
pb
.
stoc_game_msg
;
...
@@ -70,9 +70,6 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
...
@@ -70,9 +70,6 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
matStore
.
waiting
=
false
;
matStore
.
waiting
=
false
;
}
}
// 先重置`delay`
matStore
.
delay
=
NeosConfig
.
ui
.
commonDelay
;
switch
(
msg
.
gameMsg
)
{
switch
(
msg
.
gameMsg
)
{
case
"
start
"
:
{
case
"
start
"
:
{
onMsgStart
(
msg
.
start
);
onMsgStart
(
msg
.
start
);
...
@@ -112,8 +109,6 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
...
@@ -112,8 +109,6 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
case
"
move
"
:
{
case
"
move
"
:
{
onMsgMove
(
msg
.
move
);
onMsgMove
(
msg
.
move
);
matStore
.
delay
=
NeosConfig
.
ui
.
moveDelay
+
500
;
break
;
break
;
}
}
case
"
select_card
"
:
{
case
"
select_card
"
:
{
...
@@ -239,8 +234,6 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
...
@@ -239,8 +234,6 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
case
"
chaining
"
:
{
case
"
chaining
"
:
{
onMsgChaining
(
msg
.
chaining
);
onMsgChaining
(
msg
.
chaining
);
matStore
.
delay
+=
NeosConfig
.
ui
.
chainingDelay
;
break
;
break
;
}
}
case
"
chain_solved
"
:
{
case
"
chain_solved
"
:
{
...
@@ -287,5 +280,5 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
...
@@ -287,5 +280,5 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
break
;
}
}
}
}
},
matStore
.
delay
);
},
delay
);
}
}
src/stores/matStore/store.ts
View file @
c60754fd
...
@@ -4,6 +4,7 @@ import { proxy } from "valtio";
...
@@ -4,6 +4,7 @@ import { proxy } from "valtio";
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
fetchCard
}
from
"
@/api/cards
"
;
import
{
fetchCard
}
from
"
@/api/cards
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
type
{
import
type
{
CardState
,
CardState
,
...
@@ -255,16 +256,18 @@ export const matStore: MatState = proxy<MatState>({
...
@@ -255,16 +256,18 @@ export const matStore: MatState = proxy<MatState>({
result
:
ygopro
.
StocGameMessage
.
MsgWin
.
ActionType
.
UNKNOWN
,
result
:
ygopro
.
StocGameMessage
.
MsgWin
.
ActionType
.
UNKNOWN
,
waiting
:
false
,
waiting
:
false
,
unimplemented
:
0
,
unimplemented
:
0
,
delay
:
0
,
delay
:
useConfig
().
ui
.
commonDelay
,
// methods
// methods
in
:
getZone
,
in
:
getZone
,
isMe
,
isMe
,
setChaining
(
location
,
code
,
isChaining
)
{
setChaining
(
location
,
code
,
isChaining
)
{
const
target
=
this
.
in
(
location
.
location
).
of
(
location
.
controler
)[
const
target
=
this
.
in
(
location
.
location
)
location
.
sequence
.
of
(
location
.
controler
)
];
.
at
(
location
.
sequence
);
if
(
target
)
{
target
.
chaining
=
isChaining
;
target
.
chaining
=
isChaining
;
if
(
target
.
occupant
)
{
if
(
target
.
occupant
&&
isChaining
)
{
// 目前需要判断`isChaining`为ture才设置id,因为有些手坑发效果后会move到墓地,运行到这里的时候已经和原来的位置对不上了,这时候不设置id
target
.
occupant
.
id
=
code
;
target
.
occupant
.
id
=
code
;
}
}
if
(
target
.
location
.
zone
==
ygopro
.
CardZone
.
HAND
)
{
if
(
target
.
location
.
zone
==
ygopro
.
CardZone
.
HAND
)
{
...
@@ -272,6 +275,7 @@ export const matStore: MatState = proxy<MatState>({
...
@@ -272,6 +275,7 @@ export const matStore: MatState = proxy<MatState>({
?
ygopro
.
CardPosition
.
FACEUP_ATTACK
?
ygopro
.
CardPosition
.
FACEUP_ATTACK
:
ygopro
.
CardPosition
.
FACEDOWN_ATTACK
;
:
ygopro
.
CardPosition
.
FACEDOWN_ATTACK
;
}
}
}
},
},
});
});
...
...
src/stores/matStore/types.ts
View file @
c60754fd
...
@@ -94,7 +94,7 @@ export interface MatState {
...
@@ -94,7 +94,7 @@ export interface MatState {
unimplemented
:
number
;
// 未处理的`Message`
unimplemented
:
number
;
// 未处理的`Message`
delay
:
number
;
// MSG处理的延迟时间,目的时为了让一些动画处理完后再开始处理下一个MSG
delay
:
number
;
// MSG处理的延迟时间,目的时为了让一些动画处理完后再开始处理下一个MSG
。TODO:正确处理与`timeLimit`的关系
// >>> methods >>>
// >>> methods >>>
/** 根据zone获取hands/masters/magics... */
/** 根据zone获取hands/masters/magics... */
...
...
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