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
44bd0e29
Commit
44bd0e29
authored
May 13, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add chaining in Cardstate
parent
76ae995f
Pipeline
#21627
passed with stages
in 11 minutes and 33 seconds
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
4 deletions
+13
-4
src/service/duel/reloadField.ts
src/service/duel/reloadField.ts
+1
-0
src/service/duel/start.ts
src/service/duel/start.ts
+3
-0
src/stores/matStore/store.ts
src/stores/matStore/store.ts
+2
-0
src/stores/matStore/types.ts
src/stores/matStore/types.ts
+1
-0
src/ui/Duel/PlayMat/Card.tsx
src/ui/Duel/PlayMat/Card.tsx
+5
-4
src/ui/Duel/PlayMat/Mat.tsx
src/ui/Duel/PlayMat/Mat.tsx
+1
-0
No files found.
src/service/duel/reloadField.ts
View file @
44bd0e29
...
...
@@ -51,6 +51,7 @@ function reloadDuelField(
idleInteractivities
:
[],
counters
:
{},
focus
:
false
,
chaining
:
false
,
reload
:
true
,
};
});
...
...
src/service/duel/start.ts
View file @
44bd0e29
...
...
@@ -40,6 +40,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
zone
:
ygopro
.
CardZone
.
DECK
,
},
focus
:
false
,
chaining
:
false
,
counters
:
{},
idleInteractivities
:
[],
});
...
...
@@ -57,6 +58,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
zone
:
ygopro
.
CardZone
.
DECK
,
},
focus
:
false
,
chaining
:
false
,
counters
:
{},
idleInteractivities
:
[],
});
...
...
@@ -75,6 +77,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
zone
:
ygopro
.
CardZone
.
EXTRA
,
},
focus
:
false
,
chaining
:
false
,
counters
:
{},
idleInteractivities
:
[],
});
...
...
src/stores/matStore/store.ts
View file @
44bd0e29
...
...
@@ -41,6 +41,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
position
==
undefined
?
ygopro
.
CardPosition
.
FACEUP_ATTACK
:
position
,
},
focus
:
focus
??
false
,
chaining
:
false
,
counters
:
{},
idleInteractivities
:
[],
});
...
...
@@ -161,6 +162,7 @@ const genBlock = (zone: ygopro.CardZone, n: number) =>
zone
,
},
focus
:
false
,
chaining
:
false
,
idleInteractivities
:
[],
counters
:
{},
}));
...
...
src/stores/matStore/types.ts
View file @
44bd0e29
...
...
@@ -121,6 +121,7 @@ export interface CardState {
position
?:
ygopro
.
CardPosition
;
// 卡片的姿势:攻击还是守备
};
// 位置信息,叫location的原因是为了和ygo对齐
focus
:
boolean
;
// 用于实现动画效果,当这个字段为true时,该张卡片会被放大并在屏幕中央展示
chaining
:
boolean
;
// 是否在连锁中
idleInteractivities
:
Interactivity
<
number
>
[];
// IDLE状态下的互动信息
placeInteractivity
?:
Interactivity
<
{
controler
:
number
;
...
...
src/ui/Duel/PlayMat/Card.tsx
View file @
44bd0e29
...
...
@@ -13,6 +13,7 @@ const ASSETS_BASE =
:
import
.
meta
.
env
.
BASE_URL
+
NeosConfig
.
assetsPath
;
const
FOCUS_SCALE
=
2.5
;
const
CHAINING_SCALE
=
1.5
;
const
FOCUS_HIGHT
=
100
;
export
const
Card
:
React
.
FC
<
{
...
...
@@ -25,8 +26,8 @@ export const Card: React.FC<{
facedown
?:
boolean
;
vertical
?:
boolean
;
highlight
?:
boolean
;
fly
?:
boolean
;
focus
?:
boolean
;
chaining
?:
boolean
;
transTime
?:
number
;
onClick
?:
MouseEventHandler
<
{}
>
;
style
?:
CSSProperties
;
...
...
@@ -40,8 +41,8 @@ export const Card: React.FC<{
opponent
=
false
,
vertical
=
false
,
highlight
=
false
,
fly
=
false
,
focus
=
false
,
chaining
=
false
,
transTime
=
0.3
,
onClick
,
style
=
{},
...
...
@@ -49,7 +50,7 @@ export const Card: React.FC<{
<
div
className=
{
classnames
(
"
card
"
,
{
"
card-defense
"
:
defense
,
fly
,
fly
:
chaining
,
})
}
style=
{
{
...
...
@@ -61,7 +62,7 @@ export const Card: React.FC<{
"
--vertical
"
:
vertical
?
1
:
0
,
"
--trans-time
"
:
`${transTime}s`
,
"
--highlight-on
"
:
highlight
?
1
:
0
,
"
--scale-focus
"
:
focus
?
FOCUS_SCALE
:
1
,
"
--scale-focus
"
:
focus
?
FOCUS_SCALE
:
chaining
?
CHAINING_SCALE
:
1
,
"
--card-img
"
:
facedown
?
`url(${ASSETS_BASE + "/card_back.jpg"})`
:
`url(${NeosConfig.cardImgUrl + "/" + code + ".jpg"})`
,
...
...
src/ui/Duel/PlayMat/Mat.tsx
View file @
44bd0e29
...
...
@@ -104,6 +104,7 @@ export const Mat = () => {
vertical=
{
card
.
location
.
zone
==
YgoZone
.
HAND
||
card
.
focus
}
highlight=
{
card
.
idleInteractivities
.
length
>
0
}
focus=
{
card
.
focus
}
chaining=
{
card
.
chaining
}
opponent=
{
card
.
opponent
}
onClick=
{
card
.
location
.
zone
==
YgoZone
.
SZONE
||
...
...
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