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
BBeretta
Neos
Commits
b04f80cf
Commit
b04f80cf
authored
May 13, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a77c4f12
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
17 deletions
+27
-17
neos.config.json
neos.config.json
+1
-0
neos.config.prod.json
neos.config.prod.json
+1
-0
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+3
-3
src/service/duel/move.ts
src/service/duel/move.ts
+4
-2
src/service/duel/timeLimit.ts
src/service/duel/timeLimit.ts
+5
-2
src/ui/Duel/PlayMat/Card.tsx
src/ui/Duel/PlayMat/Card.tsx
+4
-4
src/ui/Duel/PlayMat/Mat.tsx
src/ui/Duel/PlayMat/Mat.tsx
+9
-6
No files found.
neos.config.json
View file @
b04f80cf
...
@@ -72,6 +72,7 @@
...
@@ -72,6 +72,7 @@
"waitingDuration"
:
1.5
,
"waitingDuration"
:
1.5
,
"maxCount"
:
1
"maxCount"
:
1
},
},
"commonoDelay"
:
200
,
"moveDelay"
:
500
,
"moveDelay"
:
500
,
"chainingDelay"
:
800
"chainingDelay"
:
800
},
},
...
...
neos.config.prod.json
View file @
b04f80cf
...
@@ -72,6 +72,7 @@
...
@@ -72,6 +72,7 @@
"waitingDuration"
:
1.5
,
"waitingDuration"
:
1.5
,
"maxCount"
:
1
"maxCount"
:
1
},
},
"commonDelay"
:
200
,
"moveDelay"
:
500
,
"moveDelay"
:
500
,
"chainingDelay"
:
800
"chainingDelay"
:
800
},
},
...
...
src/service/duel/gameMsg.ts
View file @
b04f80cf
...
@@ -71,7 +71,7 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
...
@@ -71,7 +71,7 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
}
}
// 先重置`delay`
// 先重置`delay`
matStore
.
delay
=
0
;
matStore
.
delay
=
NeosConfig
.
ui
.
commonDelay
;
switch
(
msg
.
gameMsg
)
{
switch
(
msg
.
gameMsg
)
{
case
"
start
"
:
{
case
"
start
"
:
{
...
@@ -112,7 +112,7 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
...
@@ -112,7 +112,7 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
case
"
move
"
:
{
case
"
move
"
:
{
onMsgMove
(
msg
.
move
);
onMsgMove
(
msg
.
move
);
matStore
.
delay
=
NeosConfig
.
ui
.
moveDelay
;
matStore
.
delay
+
=
NeosConfig
.
ui
.
moveDelay
;
break
;
break
;
}
}
...
@@ -239,7 +239,7 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
...
@@ -239,7 +239,7 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
case
"
chaining
"
:
{
case
"
chaining
"
:
{
onMsgChaining
(
msg
.
chaining
);
onMsgChaining
(
msg
.
chaining
);
matStore
.
delay
=
NeosConfig
.
ui
.
chainingDelay
;
matStore
.
delay
+
=
NeosConfig
.
ui
.
chainingDelay
;
break
;
break
;
}
}
...
...
src/service/duel/move.ts
View file @
b04f80cf
...
@@ -3,10 +3,12 @@ import { v4 as v4uuid } from "uuid";
...
@@ -3,10 +3,12 @@ import { v4 as v4uuid } from "uuid";
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
fetchOverlayMeta
,
store
}
from
"
@/stores
"
;
import
{
fetchOverlayMeta
,
store
}
from
"
@/stores
"
;
type
MsgMove
=
ygopro
.
StocGameMessage
.
MsgMove
;
type
MsgMove
=
ygopro
.
StocGameMessage
.
MsgMove
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
REASON_MATERIAL
}
from
"
../../common
"
;
import
{
REASON_MATERIAL
}
from
"
../../common
"
;
const
{
matStore
}
=
store
;
const
{
matStore
}
=
store
;
const
NeosConfig
=
useConfig
();
const
OVERLAY_STACK
:
{
uuid
:
string
;
code
:
number
;
sequence
:
number
}[]
=
[];
const
OVERLAY_STACK
:
{
uuid
:
string
;
code
:
number
;
sequence
:
number
}[]
=
[];
...
@@ -81,7 +83,7 @@ export default (move: MsgMove) => {
...
@@ -81,7 +83,7 @@ export default (move: MsgMove) => {
()
=>
()
=>
(
matStore
.
in
(
to
.
location
).
of
(
to
.
controler
)[
to
.
sequence
].
focus
=
(
matStore
.
in
(
to
.
location
).
of
(
to
.
controler
)[
to
.
sequence
].
focus
=
false
),
false
),
500
// TODO: use config
NeosConfig
.
ui
.
moveDelay
);
);
break
;
break
;
}
}
...
@@ -114,7 +116,7 @@ export default (move: MsgMove) => {
...
@@ -114,7 +116,7 @@ export default (move: MsgMove) => {
for
(
const
hand
of
matStore
.
in
(
to
.
location
).
of
(
to
.
controler
))
{
for
(
const
hand
of
matStore
.
in
(
to
.
location
).
of
(
to
.
controler
))
{
hand
.
focus
=
false
;
hand
.
focus
=
false
;
}
}
},
500
);
},
NeosConfig
.
ui
.
moveDelay
);
}
}
break
;
break
;
}
}
...
...
src/service/duel/timeLimit.ts
View file @
b04f80cf
import
{
sendTimeConfirm
,
ygopro
}
from
"
@/api
"
;
import
{
sendTimeConfirm
,
ygopro
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
matStore
}
from
"
@/stores
"
;
import
{
matStore
}
from
"
@/stores
"
;
export
default
function
handleTimeLimit
(
timeLimit
:
ygopro
.
StocTimeLimit
)
{
export
default
function
handleTimeLimit
(
timeLimit
:
ygopro
.
StocTimeLimit
)
{
matStore
.
timeLimits
.
set
(
timeLimit
.
player
,
timeLimit
.
left_time
);
setTimeout
(()
=>
{
sendTimeConfirm
();
matStore
.
timeLimits
.
set
(
timeLimit
.
player
,
timeLimit
.
left_time
);
sendTimeConfirm
();
},
useConfig
().
ui
.
commonDelay
);
}
}
src/ui/Duel/PlayMat/Card.tsx
View file @
b04f80cf
...
@@ -26,7 +26,7 @@ export const Card: React.FC<{
...
@@ -26,7 +26,7 @@ export const Card: React.FC<{
vertical
?:
boolean
;
vertical
?:
boolean
;
highlight
?:
boolean
;
highlight
?:
boolean
;
focus
?:
boolean
;
focus
?:
boolean
;
chaining
?:
boolean
;
fly
?:
boolean
;
transTime
?:
number
;
transTime
?:
number
;
onClick
?:
MouseEventHandler
<
{}
>
;
onClick
?:
MouseEventHandler
<
{}
>
;
style
?:
CSSProperties
;
style
?:
CSSProperties
;
...
@@ -41,7 +41,7 @@ export const Card: React.FC<{
...
@@ -41,7 +41,7 @@ export const Card: React.FC<{
vertical
=
false
,
vertical
=
false
,
highlight
=
false
,
highlight
=
false
,
focus
=
false
,
focus
=
false
,
chaining
=
false
,
fly
=
false
,
transTime
=
0.3
,
transTime
=
0.3
,
onClick
,
onClick
,
style
=
{},
style
=
{},
...
@@ -49,7 +49,7 @@ export const Card: React.FC<{
...
@@ -49,7 +49,7 @@ export const Card: React.FC<{
<
div
<
div
className=
{
classnames
(
"
card
"
,
{
className=
{
classnames
(
"
card
"
,
{
"
card-defense
"
:
defense
,
"
card-defense
"
:
defense
,
fly
:
chaining
&&
!
focus
,
fly
:
fly
&&
!
focus
,
})
}
})
}
style=
{
style=
{
{
{
...
@@ -60,7 +60,7 @@ export const Card: React.FC<{
...
@@ -60,7 +60,7 @@ export const Card: React.FC<{
"
--opponent-deg
"
:
opponent
?
"
180deg
"
:
"
0deg
"
,
"
--opponent-deg
"
:
opponent
?
"
180deg
"
:
"
0deg
"
,
"
--vertical
"
:
vertical
?
1
:
0
,
"
--vertical
"
:
vertical
?
1
:
0
,
"
--trans-time
"
:
`${
"
--trans-time
"
:
`${
chaining
? NeosConfig.ui.chainingDelay / 1000 : transTime
fly
? NeosConfig.ui.chainingDelay / 1000 : transTime
}s`
,
}s`
,
"
--highlight-on
"
:
highlight
?
1
:
0
,
"
--highlight-on
"
:
highlight
?
1
:
0
,
"
--scale-focus
"
:
focus
?
FOCUS_SCALE
:
1
,
"
--scale-focus
"
:
focus
?
FOCUS_SCALE
:
1
,
...
...
src/ui/Duel/PlayMat/Mat.tsx
View file @
b04f80cf
...
@@ -103,8 +103,11 @@ export const Mat = () => {
...
@@ -103,8 +103,11 @@ export const Mat = () => {
facedown=
{
CardStateToFaceDown
(
card
)
}
facedown=
{
CardStateToFaceDown
(
card
)
}
vertical=
{
card
.
location
.
zone
==
YgoZone
.
HAND
||
card
.
focus
}
vertical=
{
card
.
location
.
zone
==
YgoZone
.
HAND
||
card
.
focus
}
highlight=
{
card
.
idleInteractivities
.
length
>
0
}
highlight=
{
card
.
idleInteractivities
.
length
>
0
}
focus=
{
card
.
focus
}
focus=
{
chaining=
{
card
.
chaining
}
card
.
focus
||
(
card
.
chaining
&&
card
.
location
.
zone
==
YgoZone
.
HAND
)
}
fly=
{
card
.
chaining
&&
card
.
location
.
zone
!=
YgoZone
.
HAND
}
opponent=
{
card
.
opponent
}
opponent=
{
card
.
opponent
}
onClick=
{
onClick=
{
card
.
location
.
zone
==
YgoZone
.
SZONE
||
card
.
location
.
zone
==
YgoZone
.
SZONE
||
...
@@ -131,7 +134,7 @@ function cardStateToRow(state: RenderCard): number {
...
@@ -131,7 +134,7 @@ function cardStateToRow(state: RenderCard): number {
case
YgoZone
.
DECK
:
case
YgoZone
.
DECK
:
return
0
;
return
0
;
case
YgoZone
.
HAND
:
case
YgoZone
.
HAND
:
return
-
1
;
return
state
.
chaining
?
2
:
-
1
;
case
YgoZone
.
SZONE
:
case
YgoZone
.
SZONE
:
return
state
.
sequence
>=
5
?
1
:
0
;
return
state
.
sequence
>=
5
?
1
:
0
;
case
YgoZone
.
GRAVE
:
case
YgoZone
.
GRAVE
:
...
@@ -149,7 +152,7 @@ function cardStateToRow(state: RenderCard): number {
...
@@ -149,7 +152,7 @@ function cardStateToRow(state: RenderCard): number {
case
YgoZone
.
DECK
:
case
YgoZone
.
DECK
:
return
4
;
return
4
;
case
YgoZone
.
HAND
:
case
YgoZone
.
HAND
:
return
5
;
return
state
.
chaining
?
2
:
5
;
case
YgoZone
.
SZONE
:
case
YgoZone
.
SZONE
:
return
state
.
sequence
>=
5
?
3
:
4
;
return
state
.
sequence
>=
5
?
3
:
4
;
case
YgoZone
.
GRAVE
:
case
YgoZone
.
GRAVE
:
...
@@ -171,7 +174,7 @@ function cardStateToCol(state: RenderCard): number {
...
@@ -171,7 +174,7 @@ function cardStateToCol(state: RenderCard): number {
case
YgoZone
.
EXTRA
:
case
YgoZone
.
EXTRA
:
return
5
;
return
5
;
case
YgoZone
.
HAND
:
case
YgoZone
.
HAND
:
return
4
-
state
.
sequence
;
return
state
.
chaining
?
2
:
4
-
state
.
sequence
;
case
YgoZone
.
SZONE
:
case
YgoZone
.
SZONE
:
return
state
.
sequence
>=
5
?
5
:
4
-
state
.
sequence
;
return
state
.
sequence
>=
5
?
5
:
4
-
state
.
sequence
;
case
YgoZone
.
DECK
:
case
YgoZone
.
DECK
:
...
@@ -192,7 +195,7 @@ function cardStateToCol(state: RenderCard): number {
...
@@ -192,7 +195,7 @@ function cardStateToCol(state: RenderCard): number {
case
YgoZone
.
EXTRA
:
case
YgoZone
.
EXTRA
:
return
-
1
;
return
-
1
;
case
YgoZone
.
HAND
:
case
YgoZone
.
HAND
:
return
state
.
sequence
;
return
state
.
chaining
?
2
:
state
.
sequence
;
case
YgoZone
.
SZONE
:
case
YgoZone
.
SZONE
:
return
state
.
sequence
>=
5
?
-
1
:
state
.
sequence
;
return
state
.
sequence
>=
5
?
-
1
:
state
.
sequence
;
case
YgoZone
.
DECK
:
case
YgoZone
.
DECK
:
...
...
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