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
9eea2046
Commit
9eea2046
authored
May 13, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add chaining effect
parent
44bd0e29
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
4 deletions
+32
-4
src/service/duel/chaining.ts
src/service/duel/chaining.ts
+8
-1
src/stores/matStore/store.ts
src/stores/matStore/store.ts
+14
-0
src/stores/matStore/types.ts
src/stores/matStore/types.ts
+8
-0
src/ui/Duel/PlayMat/Card.tsx
src/ui/Duel/PlayMat/Card.tsx
+2
-3
No files found.
src/service/duel/chaining.ts
View file @
9eea2046
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
fetchEsHintMeta
}
from
"
@/stores
"
;
import
{
fetchEsHintMeta
,
matStore
}
from
"
@/stores
"
;
export
default
(
chaining
:
ygopro
.
StocGameMessage
.
MsgChaining
)
=>
{
export
default
(
chaining
:
ygopro
.
StocGameMessage
.
MsgChaining
)
=>
{
fetchEsHintMeta
({
fetchEsHintMeta
({
originMsg
:
"
「[?]」被发动时
"
,
originMsg
:
"
「[?]」被发动时
"
,
cardID
:
chaining
.
code
,
cardID
:
chaining
.
code
,
});
});
matStore
.
setChaining
(
chaining
.
location
,
chaining
.
code
,
true
);
setTimeout
(()
=>
{
matStore
.
setChaining
(
chaining
.
location
,
chaining
.
code
,
false
);
// TODO: set chained
},
500
);
};
};
src/stores/matStore/store.ts
View file @
9eea2046
...
@@ -258,6 +258,20 @@ export const matStore: MatState = proxy<MatState>({
...
@@ -258,6 +258,20 @@ export const matStore: MatState = proxy<MatState>({
// methods
// methods
in
:
getZone
,
in
:
getZone
,
isMe
,
isMe
,
setChaining
(
location
,
code
,
isChaining
)
{
const
target
=
this
.
in
(
location
.
location
).
of
(
location
.
controler
)[
location
.
sequence
];
target
.
chaining
=
isChaining
;
if
(
target
.
occupant
)
{
target
.
occupant
.
id
=
code
;
}
if
(
target
.
location
.
zone
==
ygopro
.
CardZone
.
HAND
)
{
target
.
location
.
position
=
isChaining
?
ygopro
.
CardPosition
.
FACEUP_ATTACK
:
ygopro
.
CardPosition
.
FACEDOWN_ATTACK
;
}
},
});
});
// @ts-ignore 挂到全局,便于调试
// @ts-ignore 挂到全局,便于调试
...
...
src/stores/matStore/types.ts
View file @
9eea2046
...
@@ -99,6 +99,14 @@ export interface MatState {
...
@@ -99,6 +99,14 @@ export interface MatState {
in
:
(
zone
:
ygopro
.
CardZone
)
=>
BothSide
<
DuelFieldState
>
;
in
:
(
zone
:
ygopro
.
CardZone
)
=>
BothSide
<
DuelFieldState
>
;
/** 根据自己的先后手判断是否是自己 */
/** 根据自己的先后手判断是否是自己 */
isMe
:
(
player
:
number
)
=>
boolean
;
isMe
:
(
player
:
number
)
=>
boolean
;
// 添加连锁中状态
// - 当是手牌以外的卡时,修改code并设置chaining字段;
// - 当是手牌中的卡时,修改code,设置chaining字段,并修改position,参数`isChaining`为true时修改成`FaceUpAttack`,为false时修改成`FaceDownAttack`
setChaining
:
(
location
:
ygopro
.
CardLocation
,
code
:
number
,
isChaining
:
boolean
)
=>
void
;
}
}
export
interface
InitInfo
{
export
interface
InitInfo
{
...
...
src/ui/Duel/PlayMat/Card.tsx
View file @
9eea2046
...
@@ -13,7 +13,6 @@ const ASSETS_BASE =
...
@@ -13,7 +13,6 @@ 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
<
{
...
@@ -50,7 +49,7 @@ export const Card: React.FC<{
...
@@ -50,7 +49,7 @@ export const Card: React.FC<{
<
div
<
div
className=
{
classnames
(
"
card
"
,
{
className=
{
classnames
(
"
card
"
,
{
"
card-defense
"
:
defense
,
"
card-defense
"
:
defense
,
fly
:
chaining
,
fly
:
chaining
&&
!
focus
,
})
}
})
}
style=
{
style=
{
{
{
...
@@ -62,7 +61,7 @@ export const Card: React.FC<{
...
@@ -62,7 +61,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
:
chaining
?
CHAINING_SCALE
:
1
,
"
--scale-focus
"
:
focus
?
FOCUS_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"})`
,
...
...
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