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
1c35aa92
Commit
1c35aa92
authored
Jun 03, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update move
parent
cd1f92c4
Pipeline
#22070
passed with stages
in 17 minutes and 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
30 deletions
+16
-30
src/api/ocgcore/ocgAdapter/bufferIO.ts
src/api/ocgcore/ocgAdapter/bufferIO.ts
+1
-1
src/service/duel/move.ts
src/service/duel/move.ts
+15
-29
No files found.
src/api/ocgcore/ocgAdapter/bufferIO.ts
View file @
1c35aa92
...
...
@@ -36,7 +36,7 @@ export class BufferReaderExt {
// 超量素材
return
new
ygopro
.
CardLocation
({
controler
,
zone
:
numberToCardZone
(
location
),
zone
:
numberToCardZone
(
location
&
~
LOCATION_OVERLAY
),
sequence
,
is_overlay
:
true
,
overlay_sequence
:
ss
,
...
...
src/service/duel/move.ts
View file @
1c35aa92
...
...
@@ -18,10 +18,12 @@ export default async (move: MsgMove) => {
const
fromCards
=
cardStore
.
at
(
from
.
zone
,
from
.
controler
);
const
toCards
=
cardStore
.
at
(
to
.
zone
,
to
.
controler
);
// TODO: 是否能有更solid的衍生物判断方式?
// TODO:
// 1. 是否能有更solid的衍生物判断方式?
// 2. 应该判断是否是`TZONE`应该收敛到`readCardLocation`里面
const
fromZone
=
move
.
from
.
toArray
().
at
(
1
)
===
undefined
?
ygopro
.
CardZone
.
TZONE
:
from
.
zone
;
cons
t
toZone
=
le
t
toZone
=
move
.
to
.
toArray
().
at
(
1
)
===
undefined
?
ygopro
.
CardZone
.
TZONE
:
to
.
zone
;
// log出来看看,后期删掉即可
...
...
@@ -74,10 +76,14 @@ export default async (move: MsgMove) => {
// 超量
if
(
to
.
is_overlay
)
{
// 准备超量召唤,超量素材入栈
if
(
reason
==
REASON_MATERIAL
)
overlayStack
.
push
(
to
);
}
if
(
toZone
===
MZONE
&&
overlayStack
.
length
)
{
if
(
reason
==
REASON_MATERIAL
)
{
toZone
=
MZONE
;
to
.
zone
=
MZONE
;
overlayStack
.
push
(
to
);
}
}
else
if
(
toZone
===
MZONE
&&
overlayStack
.
length
)
{
// 超量召唤
console
.
color
(
"
grey
"
)(
`超量召唤!overlayStack=
${
overlayStack
}
`
);
const
xyzLocations
=
overlayStack
.
splice
(
0
,
overlayStack
.
length
);
for
(
const
location
of
xyzLocations
)
{
const
overlayMaterial
=
cardStore
.
at
(
...
...
@@ -93,6 +99,10 @@ export default async (move: MsgMove) => {
overlayMaterial
.
location
.
sequence
=
to
.
sequence
;
await
eventbus
.
call
(
Task
.
Move
,
overlayMaterial
.
uuid
);
}
else
{
console
.
warn
(
`<Move>overlayMaterial from zone=
${
location
.
zone
}
, controller=
${
location
.
controler
}
, sequence=
${
location
.
sequence
}
, overlay_sequence=
${
location
.
overlay_sequence
}
`
);
}
}
}
...
...
@@ -136,30 +146,6 @@ export default async (move: MsgMove) => {
}
}
// TODO: 如果涉及了有超量素材的怪兽的移动,那么这个怪兽的移动应该也会带动超量素材的移动
// 注意,一个monster的overlayMaterials中的每一项都是一个cardType,
// 并且,overlayMaterials的idx就是超量素材的sequence。
// 如果一个card的zone是OVERLAY,那么它本身的sequence项是无意义的。
// 超量召唤:
// - 超量素材:toZone === OVERLAY, reason === REASON_MATERIAL
// - 超量怪兽:toZone === MZONE
// 解决方法是将超量素材放到一个list之中,等待超量怪兽的Move消息到来时从list中获取超量素材补充到超量怪兽的素材中
// 超量怪兽增加超量素材
// - 超量素材:toZone === OVERLAY, reason !== REASON_MATERIAL
// 这里要注意toZone和toSequence的不一致
// 超量素材(target)是cardStore.at(from.location, from.controler, from.sequence)
// 超量怪兽(xyzMonster)是cardStore.at(MZONE, to.controler, to.sequence)
// 超量怪兽失去超量素材
// - 超量素材:fromZone === OVERLAY
// 超量怪兽(xyzMonster)是cardStore.at(MZONE, from.controler, from.sequence)
// 超量素材(target)是xyzMonster.overlayMaterials[from.overlay_sequence]
// 在超量召唤/超量素材更改时候,target是超量素材,但同时也要维护超量怪兽的overlayMaterials
// token登场
// - token:fromZone === TZONE
...
...
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