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
d1dc97f1
Commit
d1dc97f1
authored
May 28, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix updateData
parent
27941bf4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
src/service/duel/updateData.ts
src/service/duel/updateData.ts
+18
-17
No files found.
src/service/duel/updateData.ts
View file @
d1dc97f1
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
MsgUpdateData
=
ygopro
.
StocGameMessage
.
MsgUpdateData
;
import
MsgUpdateData
=
ygopro
.
StocGameMessage
.
MsgUpdateData
;
import
{
mat
Store
}
from
"
@/stores
"
;
import
{
card
Store
}
from
"
@/stores
"
;
export
default
(
updateData
:
MsgUpdateData
)
=>
{
export
default
(
updateData
:
MsgUpdateData
)
=>
{
const
{
player
:
controller
,
zone
,
actions
}
=
updateData
;
const
{
player
:
controller
,
zone
,
actions
}
=
updateData
;
if
(
controller
!==
undefined
&&
zone
!==
undefined
&&
actions
!==
undefined
)
{
if
(
controller
!==
undefined
&&
zone
!==
undefined
&&
actions
!==
undefined
)
{
const
field
=
matStore
.
in
(
zone
).
of
(
controller
);
const
field
=
cardStore
.
at
(
zone
,
controller
);
actions
.
forEach
((
action
)
=>
{
actions
.
forEach
((
action
)
=>
{
const
sequence
=
action
.
location
?.
sequence
;
const
sequence
=
action
.
location
?.
sequence
;
if
(
typeof
sequence
!==
"
undefined
"
)
{
if
(
typeof
sequence
!==
"
undefined
"
)
{
const
target
=
field
[
sequence
];
const
target
=
field
.
at
(
sequence
);
if
(
target
&&
(
target
.
occupant
||
target
.
reload
))
{
if
(
target
)
{
if
(
target
.
occupant
===
undefined
)
{
const
meta
=
target
.
meta
;
target
.
occupant
=
{
id
:
action
.
code
!
,
data
:
{},
text
:
{}
};
}
const
occupant
=
target
.
occupant
;
// 目前只更新以下字段
// 目前只更新以下字段
if
(
action
.
code
!==
undefined
&&
action
.
code
>=
0
)
{
if
(
action
.
code
!==
undefined
&&
action
.
code
>=
0
)
{
occupant
.
id
=
action
.
code
;
meta
.
id
=
action
.
code
;
occupant
.
text
.
id
=
action
.
code
;
meta
.
text
.
id
=
action
.
code
;
}
}
if
(
action
.
location
!==
undefined
)
{
if
(
action
.
location
!==
undefined
)
{
target
.
location
.
position
=
action
.
location
.
position
;
target
.
position
=
action
.
location
.
position
;
}
}
if
(
action
.
type_
!==
undefined
&&
action
.
type_
>=
0
)
{
if
(
action
.
type_
!==
undefined
&&
action
.
type_
>=
0
)
{
occupant
.
data
.
type
=
action
.
type_
;
meta
.
data
.
type
=
action
.
type_
;
}
}
if
(
action
.
level
!==
undefined
&&
action
.
level
>=
0
)
{
if
(
action
.
level
!==
undefined
&&
action
.
level
>=
0
)
{
occupant
.
data
.
level
=
action
.
level
;
meta
.
data
.
level
=
action
.
level
;
}
}
if
(
action
.
attribute
!==
undefined
&&
action
.
attribute
>=
0
)
{
if
(
action
.
attribute
!==
undefined
&&
action
.
attribute
>=
0
)
{
occupant
.
data
.
attribute
=
action
.
attribute
;
meta
.
data
.
attribute
=
action
.
attribute
;
}
}
if
(
action
.
race
!==
undefined
&&
action
.
race
>=
0
)
{
if
(
action
.
race
!==
undefined
&&
action
.
race
>=
0
)
{
occupant
.
data
.
race
=
action
.
race
;
meta
.
data
.
race
=
action
.
race
;
}
}
if
(
action
.
attack
!==
undefined
&&
action
.
attack
>=
0
)
{
if
(
action
.
attack
!==
undefined
&&
action
.
attack
>=
0
)
{
occupant
.
data
.
atk
=
action
.
attack
;
meta
.
data
.
atk
=
action
.
attack
;
}
}
if
(
action
.
defense
!==
undefined
&&
action
.
defense
>=
0
)
{
if
(
action
.
defense
!==
undefined
&&
action
.
defense
>=
0
)
{
occupant
.
data
.
def
=
action
.
defense
;
meta
.
data
.
def
=
action
.
defense
;
}
}
// TODO: counters
// TODO: counters
}
else
{
console
.
warn
(
`<UpdateData>target from zone=
${
zone
}
, controller=
${
controller
}
, sequence=
${
sequence
}
is null`
);
}
}
if
(
target
?.
reload
)
{
if
(
target
?.
reload
)
{
target
.
reload
=
false
;
target
.
reload
=
false
;
...
...
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