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