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
667cb96c
Commit
667cb96c
authored
Jun 05, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove chaining props in CardType
parent
131e1918
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
32 deletions
+5
-32
src/service/duel/chaining.ts
src/service/duel/chaining.ts
+4
-5
src/service/duel/start.ts
src/service/duel/start.ts
+0
-1
src/stores/cardStore.ts
src/stores/cardStore.ts
+1
-26
No files found.
src/service/duel/chaining.ts
View file @
667cb96c
...
@@ -8,18 +8,17 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
...
@@ -8,18 +8,17 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
cardID
:
chaining
.
code
,
cardID
:
chaining
.
code
,
});
});
await
cardStore
.
setChaining
(
chaining
.
location
,
chaining
.
code
,
true
);
const
location
=
chaining
.
location
;
const
location
=
chaining
.
location
;
// 恢复成非`chaining`状态
await
cardStore
.
setChaining
(
location
,
chaining
.
code
,
false
);
// 将`location`添加到连锁栈
// 将`location`添加到连锁栈
matStore
.
chains
.
push
(
location
);
matStore
.
chains
.
push
(
location
);
// 设置被连锁状态
const
target
=
cardStore
.
find
(
location
);
const
target
=
cardStore
.
find
(
location
);
if
(
target
)
{
if
(
target
)
{
// 设置连锁序号
target
.
chainIndex
=
matStore
.
chains
.
length
;
target
.
chainIndex
=
matStore
.
chains
.
length
;
// 发动效果动画
await
eventbus
.
call
(
Task
.
Focus
,
target
.
uuid
);
await
eventbus
.
call
(
Task
.
Focus
,
target
.
uuid
);
console
.
color
(
"
blue
"
)(
`
${
target
.
meta
.
text
.
name
}
chaining`
);
console
.
color
(
"
blue
"
)(
`
${
target
.
meta
.
text
.
name
}
chaining`
);
}
else
{
}
else
{
...
...
src/service/duel/start.ts
View file @
667cb96c
...
@@ -63,7 +63,6 @@ export default async (start: ygopro.StocGameMessage.MsgStart) => {
...
@@ -63,7 +63,6 @@ export default async (start: ygopro.StocGameMessage.MsgStart) => {
text
:
{},
text
:
{},
},
},
isToken
:
!
((
i
+
1
)
%
3
),
isToken
:
!
((
i
+
1
)
%
3
),
chaining
:
false
,
})
})
)
)
)
)
...
...
src/stores/cardStore.ts
View file @
667cb96c
import
{
proxy
}
from
"
valtio
"
;
import
{
proxy
}
from
"
valtio
"
;
import
{
CardMeta
,
fetchCard
,
ygopro
}
from
"
@/api
"
;
import
{
CardMeta
,
ygopro
}
from
"
@/api
"
;
import
type
{
Interactivity
}
from
"
./matStore/types
"
;
import
type
{
Interactivity
}
from
"
./matStore/types
"
;
...
@@ -23,7 +23,6 @@ export interface CardType {
...
@@ -23,7 +23,6 @@ export interface CardType {
reload
?:
boolean
;
// 这个字段会在收到MSG_RELOAD_FIELD的时候设置成true,在收到MSG_UPDATE_DATE的时候设置成false
reload
?:
boolean
;
// 这个字段会在收到MSG_RELOAD_FIELD的时候设置成true,在收到MSG_UPDATE_DATE的时候设置成false
isToken
:
boolean
;
// 是否是token
isToken
:
boolean
;
// 是否是token
chaining
:
boolean
;
// 是否在连锁中
chainIndex
?:
number
/*连锁的序号,如果为空表示不在连锁
chainIndex
?:
number
/*连锁的序号,如果为空表示不在连锁
TODO: 目前是妥协的设计,因为其实一张卡是可以在同一个连锁链中被连锁多次的,这里为了避免太过复杂只保存最后的连锁序号*/
;
TODO: 目前是妥协的设计,因为其实一张卡是可以在同一个连锁链中被连锁多次的,这里为了避免太过复杂只保存最后的连锁序号*/
;
}
}
...
@@ -92,30 +91,6 @@ class CardStore {
...
@@ -92,30 +91,6 @@ class CardStore {
card
.
location
.
is_overlay
card
.
location
.
is_overlay
);
);
}
}
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
);
// 这里不能设置`code`,因为存在一个场景:
// 对方的`魔神仪-曼德拉护肤草`发动效果后,后端会发一次`MSG_SHUFFLE_HAND`,但传给前端的codes全是0,如果这里设置了`code`的话,在后面的`MSG_SHUFFLE_HAND`处理就会有问题。
// target.code = meta.id;
target
.
meta
=
meta
;
}
if
(
target
.
location
.
zone
==
ygopro
.
CardZone
.
HAND
)
{
target
.
location
.
position
=
isChaining
?
ygopro
.
CardPosition
.
FACEUP_ATTACK
:
ygopro
.
CardPosition
.
FACEDOWN_ATTACK
;
}
}
}
}
}
export
const
cardStore
=
proxy
(
new
CardStore
());
export
const
cardStore
=
proxy
(
new
CardStore
());
...
...
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