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
593de382
Commit
593de382
authored
May 28, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix chaining
parent
f89dedac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
5 deletions
+30
-5
src/service/duel/chainEnd.ts
src/service/duel/chainEnd.ts
+1
-1
src/service/duel/chaining.ts
src/service/duel/chaining.ts
+9
-4
src/stores/cardStore.ts
src/stores/cardStore.ts
+19
-0
src/stores/matStore/store.ts
src/stores/matStore/store.ts
+1
-0
No files found.
src/service/duel/chainEnd.ts
View file @
593de382
...
@@ -12,7 +12,7 @@ export default (_chainEnd: ygopro.StocGameMessage.MsgChainEnd) => {
...
@@ -12,7 +12,7 @@ export default (_chainEnd: ygopro.StocGameMessage.MsgChainEnd) => {
if
(
target
)
{
if
(
target
)
{
target
.
chainIndex
=
undefined
;
target
.
chainIndex
=
undefined
;
}
else
{
}
else
{
console
.
warn
(
`<ChainEnd>target is null`
);
console
.
warn
(
`<ChainEnd>target
from
${
chain
}
is null`
);
}
}
}
}
};
};
src/service/duel/chaining.ts
View file @
593de382
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
sleep
}
from
"
@/infra
"
;
import
{
sleep
}
from
"
@/infra
"
;
import
{
fetchEsHintMeta
,
matStore
}
from
"
@/stores
"
;
import
{
cardStore
,
fetchEsHintMeta
,
matStore
}
from
"
@/stores
"
;
export
default
async
(
chaining
:
ygopro
.
StocGameMessage
.
MsgChaining
)
=>
{
export
default
async
(
chaining
:
ygopro
.
StocGameMessage
.
MsgChaining
)
=>
{
fetchEsHintMeta
({
fetchEsHintMeta
({
...
@@ -9,15 +9,20 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
...
@@ -9,15 +9,20 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
cardID
:
chaining
.
code
,
cardID
:
chaining
.
code
,
});
});
await
mat
Store
.
setChaining
(
chaining
.
location
,
chaining
.
code
,
true
);
await
card
Store
.
setChaining
(
chaining
.
location
,
chaining
.
code
,
true
);
await
sleep
(
useConfig
().
ui
.
chainingDelay
);
await
sleep
(
useConfig
().
ui
.
chainingDelay
);
const
location
=
chaining
.
location
;
const
location
=
chaining
.
location
;
// 恢复成非`chaining`状态
// 恢复成非`chaining`状态
await
mat
Store
.
setChaining
(
location
,
chaining
.
code
,
false
);
await
card
Store
.
setChaining
(
location
,
chaining
.
code
,
false
);
// 将`location`添加到连锁栈
// 将`location`添加到连锁栈
matStore
.
chains
.
push
(
location
);
matStore
.
chains
.
push
(
location
);
// 设置被连锁状态
// 设置被连锁状态
matStore
.
setChained
(
location
,
matStore
.
chains
.
length
);
const
target
=
cardStore
.
find
(
location
);
if
(
target
)
{
target
.
chainIndex
=
matStore
.
chains
.
length
;
}
else
{
console
.
warn
(
`<chaining>target from
${
location
}
is null`
);
}
};
};
src/stores/cardStore.ts
View file @
593de382
...
@@ -65,6 +65,25 @@ class CardStore {
...
@@ -65,6 +65,25 @@ class CardStore {
find
(
location
:
ygopro
.
CardLocation
):
CardType
|
undefined
{
find
(
location
:
ygopro
.
CardLocation
):
CardType
|
undefined
{
return
this
.
at
(
location
.
location
,
location
.
controler
,
location
.
sequence
);
return
this
.
at
(
location
.
location
,
location
.
controler
,
location
.
sequence
);
}
}
async
setChaining
(
location
:
ygopro
.
CardLocation
,
code
:
number
,
isChaining
:
boolean
):
Promise
<
void
>
{
const
target
=
this
.
find
(
location
);
if
(
target
)
{
target
.
chaining
=
isChaining
;
if
(
isChaining
)
{
// 目前需要判断`isChaining`为ture才设置meta,因为有些手坑发效果后会move到墓地,
// 运行到这里的时候已经和原来的位置对不上了,这时候不设置meta
const
meta
=
await
fetchCard
(
code
);
target
.
code
=
meta
.
id
;
target
.
data
=
meta
.
data
;
target
.
text
=
meta
.
text
;
}
if
(
target
.
zone
==
ygopro
.
CardZone
.
HAND
)
{
target
.
position
=
isChaining
?
ygopro
.
CardPosition
.
FACEUP_ATTACK
:
ygopro
.
CardPosition
.
FACEDOWN_ATTACK
;
}
}
}
}
}
export
const
cardStore
=
proxy
(
new
CardStore
());
export
const
cardStore
=
proxy
(
new
CardStore
());
...
...
src/stores/matStore/store.ts
View file @
593de382
...
@@ -62,6 +62,7 @@ const hint: MatState["hint"] = proxy({
...
@@ -62,6 +62,7 @@ const hint: MatState["hint"] = proxy({
*/
*/
export
const
matStore
:
MatState
=
proxy
<
MatState
>
({
export
const
matStore
:
MatState
=
proxy
<
MatState
>
({
chains
:
[],
chains
:
[],
blocks
:
[],
timeLimits
:
{
timeLimits
:
{
// 时间限制
// 时间限制
...
...
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