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
love_飞影
Neos
Commits
51982f32
Commit
51982f32
authored
Apr 29, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Mat.tsx
parent
ad8414d7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
12 deletions
+53
-12
src/service/duel/draw.ts
src/service/duel/draw.ts
+2
-2
src/service/duel/move.ts
src/service/duel/move.ts
+10
-2
src/service/duel/start.ts
src/service/duel/start.ts
+34
-2
src/ui/Duel/PlayMat2/Mat.tsx
src/ui/Duel/PlayMat2/Mat.tsx
+7
-6
No files found.
src/service/duel/draw.ts
View file @
51982f32
...
@@ -9,11 +9,11 @@ export default (draw: ygopro.StocGameMessage.MsgDraw) => {
...
@@ -9,11 +9,11 @@ export default (draw: ygopro.StocGameMessage.MsgDraw) => {
const
drawLength
=
draw
.
cards
.
length
;
const
drawLength
=
draw
.
cards
.
length
;
const
popCards
=
matStore
.
decks
const
popCards
=
matStore
.
decks
.
of
(
draw
.
player
)
.
of
(
draw
.
player
)
.
slice
(
deckLength
-
drawLength
,
drawLength
);
.
s
p
lice
(
deckLength
-
drawLength
,
drawLength
);
const
data
=
zip
(
popCards
,
draw
.
cards
).
map
(([
pop
,
hand
])
=>
{
const
data
=
zip
(
popCards
,
draw
.
cards
).
map
(([
pop
,
hand
])
=>
{
return
{
uuid
:
pop
.
uuid
,
id
:
hand
};
return
{
uuid
:
pop
.
uuid
,
id
:
hand
};
});
});
matStore
.
hands
.
of
(
draw
.
player
).
add
(
data
);
matStore
.
hands
.
of
(
draw
.
player
).
add
(
data
,
ygopro
.
CardPosition
.
FACEUP_ATTACK
);
};
};
src/service/duel/move.ts
View file @
51982f32
...
@@ -72,8 +72,7 @@ export default (move: MsgMove) => {
...
@@ -72,8 +72,7 @@ export default (move: MsgMove) => {
}
}
case
ygopro
.
CardZone
.
REMOVED
:
case
ygopro
.
CardZone
.
REMOVED
:
case
ygopro
.
CardZone
.
GRAVE
:
case
ygopro
.
CardZone
.
GRAVE
:
case
ygopro
.
CardZone
.
EXTRA
:
case
ygopro
.
CardZone
.
EXTRA
:
{
case
ygopro
.
CardZone
.
HAND
:
{
if
(
uuid
)
{
if
(
uuid
)
{
matStore
matStore
.
in
(
to
.
location
)
.
in
(
to
.
location
)
...
@@ -82,6 +81,15 @@ export default (move: MsgMove) => {
...
@@ -82,6 +81,15 @@ export default (move: MsgMove) => {
}
}
break
;
break
;
}
}
case
ygopro
.
CardZone
.
HAND
:
{
if
(
uuid
)
{
matStore
.
in
(
to
.
location
)
.
of
(
to
.
controler
)
.
insert
(
uuid
,
code
,
to
.
sequence
);
}
break
;
}
case
ygopro
.
CardZone
.
OVERLAY
:
{
case
ygopro
.
CardZone
.
OVERLAY
:
{
if
(
reason
==
REASON_MATERIAL
&&
uuid
)
{
if
(
reason
==
REASON_MATERIAL
&&
uuid
)
{
// 超量素材在进行超量召唤时,若玩家未选择超量怪兽的位置,会“沉到决斗盘下面”,`reason`字段值是`REASON_MATERIAL`
// 超量素材在进行超量召唤时,若玩家未选择超量怪兽的位置,会“沉到决斗盘下面”,`reason`字段值是`REASON_MATERIAL`
...
...
src/service/duel/start.ts
View file @
51982f32
import
{
v4
as
v4uuid
}
from
"
uuid
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
store
}
from
"
@/stores
"
;
import
{
store
}
from
"
@/stores
"
;
...
@@ -22,6 +24,36 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
...
@@ -22,6 +24,36 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
matStore
.
magics
.
of
(
0
).
forEach
((
x
)
=>
(
x
.
location
.
controler
=
0
));
matStore
.
magics
.
of
(
0
).
forEach
((
x
)
=>
(
x
.
location
.
controler
=
0
));
matStore
.
magics
.
of
(
1
).
forEach
((
x
)
=>
(
x
.
location
.
controler
=
1
));
matStore
.
magics
.
of
(
1
).
forEach
((
x
)
=>
(
x
.
location
.
controler
=
1
));
matStore
.
decks
.
of
(
0
).
add
(
Array
(
start
.
deckSize1
).
fill
(
0
));
for
(
let
i
=
0
;
i
<
start
.
deckSize1
;
i
++
)
{
matStore
.
decks
.
of
(
1
).
add
(
Array
(
start
.
deckSize2
).
fill
(
0
));
matStore
.
decks
.
of
(
0
).
push
({
uuid
:
v4uuid
(),
occupant
:
{
id
:
0
,
data
:
{},
text
:
{},
},
location
:
{
controler
:
0
,
zone
:
ygopro
.
CardZone
.
DECK
,
},
counters
:
{},
idleInteractivities
:
[],
});
}
for
(
let
i
=
0
;
i
<
start
.
deckSize2
;
i
++
)
{
matStore
.
decks
.
of
(
1
).
push
({
uuid
:
v4uuid
(),
occupant
:
{
id
:
0
,
data
:
{},
text
:
{},
},
location
:
{
controler
:
0
,
zone
:
ygopro
.
CardZone
.
DECK
,
},
counters
:
{},
idleInteractivities
:
[],
});
}
};
};
src/ui/Duel/PlayMat2/Mat.tsx
View file @
51982f32
...
@@ -155,9 +155,9 @@ function cardStateToCol(state: RenderCard): number {
...
@@ -155,9 +155,9 @@ function cardStateToCol(state: RenderCard): number {
case
YgoZone
.
EXTRA
:
case
YgoZone
.
EXTRA
:
return
5
;
return
5
;
case
YgoZone
.
HAND
:
case
YgoZone
.
HAND
:
return
-
state
.
sequence
;
return
4
-
state
.
sequence
;
case
YgoZone
.
SZONE
:
case
YgoZone
.
SZONE
:
return
state
.
sequence
>=
5
?
5
:
-
state
.
sequence
;
return
state
.
sequence
>=
5
?
5
:
4
-
state
.
sequence
;
case
YgoZone
.
DECK
:
case
YgoZone
.
DECK
:
case
YgoZone
.
REMOVED
:
case
YgoZone
.
REMOVED
:
case
YgoZone
.
GRAVE
:
case
YgoZone
.
GRAVE
:
...
@@ -167,7 +167,7 @@ function cardStateToCol(state: RenderCard): number {
...
@@ -167,7 +167,7 @@ function cardStateToCol(state: RenderCard): number {
?
state
.
sequence
==
5
?
state
.
sequence
==
5
?
3
?
3
:
1
:
1
:
-
state
.
sequence
;
:
4
-
state
.
sequence
;
default
:
default
:
return
0
;
return
0
;
}
}
...
@@ -215,9 +215,10 @@ function CardStateToFaceDown(state: RenderCard): boolean {
...
@@ -215,9 +215,10 @@ function CardStateToFaceDown(state: RenderCard): boolean {
const
position
=
state
.
location
.
position
;
const
position
=
state
.
location
.
position
;
return
(
return
(
position
===
YgoPosition
.
FACEDOWN
||
((
position
===
YgoPosition
.
FACEDOWN
||
position
===
YgoPosition
.
FACEDOWN_ATTACK
||
position
===
YgoPosition
.
FACEDOWN_ATTACK
||
position
===
YgoPosition
.
FACEDOWN_DEFENSE
||
position
===
YgoPosition
.
FACEDOWN_DEFENSE
)
&&
state
.
location
.
zone
!=
YgoZone
.
HAND
)
||
state
.
occupant
!
.
id
==
0
state
.
occupant
!
.
id
==
0
);
);
}
}
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