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
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
Changes
6
Hide 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(
...
@@ -51,6 +51,7 @@ function reloadDuelField(
idleInteractivities
:
[],
idleInteractivities
:
[],
counters
:
{},
counters
:
{},
focus
:
false
,
focus
:
false
,
chaining
:
false
,
reload
:
true
,
reload
:
true
,
};
};
});
});
...
...
src/service/duel/start.ts
View file @
44bd0e29
...
@@ -40,6 +40,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
...
@@ -40,6 +40,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
zone
:
ygopro
.
CardZone
.
DECK
,
zone
:
ygopro
.
CardZone
.
DECK
,
},
},
focus
:
false
,
focus
:
false
,
chaining
:
false
,
counters
:
{},
counters
:
{},
idleInteractivities
:
[],
idleInteractivities
:
[],
});
});
...
@@ -57,6 +58,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
...
@@ -57,6 +58,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
zone
:
ygopro
.
CardZone
.
DECK
,
zone
:
ygopro
.
CardZone
.
DECK
,
},
},
focus
:
false
,
focus
:
false
,
chaining
:
false
,
counters
:
{},
counters
:
{},
idleInteractivities
:
[],
idleInteractivities
:
[],
});
});
...
@@ -75,6 +77,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
...
@@ -75,6 +77,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
zone
:
ygopro
.
CardZone
.
EXTRA
,
zone
:
ygopro
.
CardZone
.
EXTRA
,
},
},
focus
:
false
,
focus
:
false
,
chaining
:
false
,
counters
:
{},
counters
:
{},
idleInteractivities
:
[],
idleInteractivities
:
[],
});
});
...
...
src/stores/matStore/store.ts
View file @
44bd0e29
...
@@ -41,6 +41,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
...
@@ -41,6 +41,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
position
==
undefined
?
ygopro
.
CardPosition
.
FACEUP_ATTACK
:
position
,
position
==
undefined
?
ygopro
.
CardPosition
.
FACEUP_ATTACK
:
position
,
},
},
focus
:
focus
??
false
,
focus
:
focus
??
false
,
chaining
:
false
,
counters
:
{},
counters
:
{},
idleInteractivities
:
[],
idleInteractivities
:
[],
});
});
...
@@ -161,6 +162,7 @@ const genBlock = (zone: ygopro.CardZone, n: number) =>
...
@@ -161,6 +162,7 @@ const genBlock = (zone: ygopro.CardZone, n: number) =>
zone
,
zone
,
},
},
focus
:
false
,
focus
:
false
,
chaining
:
false
,
idleInteractivities
:
[],
idleInteractivities
:
[],
counters
:
{},
counters
:
{},
}));
}));
...
...
src/stores/matStore/types.ts
View file @
44bd0e29
...
@@ -121,6 +121,7 @@ export interface CardState {
...
@@ -121,6 +121,7 @@ export interface CardState {
position
?:
ygopro
.
CardPosition
;
// 卡片的姿势:攻击还是守备
position
?:
ygopro
.
CardPosition
;
// 卡片的姿势:攻击还是守备
};
// 位置信息,叫location的原因是为了和ygo对齐
};
// 位置信息,叫location的原因是为了和ygo对齐
focus
:
boolean
;
// 用于实现动画效果,当这个字段为true时,该张卡片会被放大并在屏幕中央展示
focus
:
boolean
;
// 用于实现动画效果,当这个字段为true时,该张卡片会被放大并在屏幕中央展示
chaining
:
boolean
;
// 是否在连锁中
idleInteractivities
:
Interactivity
<
number
>
[];
// IDLE状态下的互动信息
idleInteractivities
:
Interactivity
<
number
>
[];
// IDLE状态下的互动信息
placeInteractivity
?:
Interactivity
<
{
placeInteractivity
?:
Interactivity
<
{
controler
:
number
;
controler
:
number
;
...
...
src/ui/Duel/PlayMat/Card.tsx
View file @
44bd0e29
...
@@ -13,6 +13,7 @@ const ASSETS_BASE =
...
@@ -13,6 +13,7 @@ const ASSETS_BASE =
:
import
.
meta
.
env
.
BASE_URL
+
NeosConfig
.
assetsPath
;
:
import
.
meta
.
env
.
BASE_URL
+
NeosConfig
.
assetsPath
;
const
FOCUS_SCALE
=
2.5
;
const
FOCUS_SCALE
=
2.5
;
const
CHAINING_SCALE
=
1.5
;
const
FOCUS_HIGHT
=
100
;
const
FOCUS_HIGHT
=
100
;
export
const
Card
:
React
.
FC
<
{
export
const
Card
:
React
.
FC
<
{
...
@@ -25,8 +26,8 @@ export const Card: React.FC<{
...
@@ -25,8 +26,8 @@ export const Card: React.FC<{
facedown
?:
boolean
;
facedown
?:
boolean
;
vertical
?:
boolean
;
vertical
?:
boolean
;
highlight
?:
boolean
;
highlight
?:
boolean
;
fly
?:
boolean
;
focus
?:
boolean
;
focus
?:
boolean
;
chaining
?:
boolean
;
transTime
?:
number
;
transTime
?:
number
;
onClick
?:
MouseEventHandler
<
{}
>
;
onClick
?:
MouseEventHandler
<
{}
>
;
style
?:
CSSProperties
;
style
?:
CSSProperties
;
...
@@ -40,8 +41,8 @@ export const Card: React.FC<{
...
@@ -40,8 +41,8 @@ export const Card: React.FC<{
opponent
=
false
,
opponent
=
false
,
vertical
=
false
,
vertical
=
false
,
highlight
=
false
,
highlight
=
false
,
fly
=
false
,
focus
=
false
,
focus
=
false
,
chaining
=
false
,
transTime
=
0.3
,
transTime
=
0.3
,
onClick
,
onClick
,
style
=
{},
style
=
{},
...
@@ -49,7 +50,7 @@ export const Card: React.FC<{
...
@@ -49,7 +50,7 @@ export const Card: React.FC<{
<
div
<
div
className=
{
classnames
(
"
card
"
,
{
className=
{
classnames
(
"
card
"
,
{
"
card-defense
"
:
defense
,
"
card-defense
"
:
defense
,
fly
,
fly
:
chaining
,
})
}
})
}
style=
{
style=
{
{
{
...
@@ -61,7 +62,7 @@ export const Card: React.FC<{
...
@@ -61,7 +62,7 @@ export const Card: React.FC<{
"
--vertical
"
:
vertical
?
1
:
0
,
"
--vertical
"
:
vertical
?
1
:
0
,
"
--trans-time
"
:
`${transTime}s`
,
"
--trans-time
"
:
`${transTime}s`
,
"
--highlight-on
"
:
highlight
?
1
:
0
,
"
--highlight-on
"
:
highlight
?
1
:
0
,
"
--scale-focus
"
:
focus
?
FOCUS_SCALE
:
1
,
"
--scale-focus
"
:
focus
?
FOCUS_SCALE
:
chaining
?
CHAINING_SCALE
:
1
,
"
--card-img
"
:
facedown
"
--card-img
"
:
facedown
?
`url(${ASSETS_BASE + "/card_back.jpg"})`
?
`url(${ASSETS_BASE + "/card_back.jpg"})`
:
`url(${NeosConfig.cardImgUrl + "/" + code + ".jpg"})`
,
:
`url(${NeosConfig.cardImgUrl + "/" + code + ".jpg"})`
,
...
...
src/ui/Duel/PlayMat/Mat.tsx
View file @
44bd0e29
...
@@ -104,6 +104,7 @@ export const Mat = () => {
...
@@ -104,6 +104,7 @@ export const Mat = () => {
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=
{
card
.
focus
}
chaining=
{
card
.
chaining
}
opponent=
{
card
.
opponent
}
opponent=
{
card
.
opponent
}
onClick=
{
onClick=
{
card
.
location
.
zone
==
YgoZone
.
SZONE
||
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