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
8d7152b1
Commit
8d7152b1
authored
May 19, 2023
by
chechunchi
Committed by
Chunchi Che
May 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update matStore
parent
125e7838
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
13 deletions
+7
-13
src/service/duel/chainSolved.ts
src/service/duel/chainSolved.ts
+2
-2
src/service/duel/chaining.ts
src/service/duel/chaining.ts
+1
-1
src/service/duel/reloadField.ts
src/service/duel/reloadField.ts
+0
-1
src/service/duel/start.ts
src/service/duel/start.ts
+0
-3
src/stores/matStore/store.ts
src/stores/matStore/store.ts
+2
-4
src/stores/matStore/types.ts
src/stores/matStore/types.ts
+2
-2
No files found.
src/service/duel/chainSolved.ts
View file @
8d7152b1
...
@@ -6,8 +6,8 @@ export default (chainSolved: ygopro.StocGameMessage.MsgChainSolved) => {
...
@@ -6,8 +6,8 @@ export default (chainSolved: ygopro.StocGameMessage.MsgChainSolved) => {
.
splice
(
chainSolved
.
solved_index
-
1
,
1
)
.
splice
(
chainSolved
.
solved_index
-
1
,
1
)
.
at
(
0
);
.
at
(
0
);
if
(
location
)
{
if
(
location
)
{
// 设置被连锁状态为
false
// 设置被连锁状态为
空
matStore
.
setChained
(
location
,
false
);
matStore
.
setChained
(
location
,
undefined
);
}
else
{
}
else
{
console
.
warn
(
"
pop from chains return null!
"
);
console
.
warn
(
"
pop from chains return null!
"
);
}
}
...
...
src/service/duel/chaining.ts
View file @
8d7152b1
...
@@ -19,5 +19,5 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
...
@@ -19,5 +19,5 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
// 将`location`添加到连锁栈
// 将`location`添加到连锁栈
matStore
.
chains
.
push
(
location
);
matStore
.
chains
.
push
(
location
);
// 设置被连锁状态
// 设置被连锁状态
matStore
.
setChained
(
location
,
true
);
matStore
.
setChained
(
location
,
matStore
.
chains
.
length
);
};
};
src/service/duel/reloadField.ts
View file @
8d7152b1
...
@@ -52,7 +52,6 @@ function reloadDuelField(
...
@@ -52,7 +52,6 @@ function reloadDuelField(
counters
:
{},
counters
:
{},
focus
:
false
,
focus
:
false
,
chaining
:
false
,
chaining
:
false
,
chained
:
false
,
// TODO: 这里是否能简单设置成false?
directAttack
:
false
,
directAttack
:
false
,
reload
:
true
,
reload
:
true
,
};
};
...
...
src/service/duel/start.ts
View file @
8d7152b1
...
@@ -41,7 +41,6 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
...
@@ -41,7 +41,6 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
},
},
focus
:
false
,
focus
:
false
,
chaining
:
false
,
chaining
:
false
,
chained
:
false
,
directAttack
:
false
,
directAttack
:
false
,
counters
:
{},
counters
:
{},
idleInteractivities
:
[],
idleInteractivities
:
[],
...
@@ -61,7 +60,6 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
...
@@ -61,7 +60,6 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
},
},
focus
:
false
,
focus
:
false
,
chaining
:
false
,
chaining
:
false
,
chained
:
false
,
directAttack
:
false
,
directAttack
:
false
,
counters
:
{},
counters
:
{},
idleInteractivities
:
[],
idleInteractivities
:
[],
...
@@ -82,7 +80,6 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
...
@@ -82,7 +80,6 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
},
},
focus
:
false
,
focus
:
false
,
chaining
:
false
,
chaining
:
false
,
chained
:
false
,
directAttack
:
false
,
directAttack
:
false
,
counters
:
{},
counters
:
{},
idleInteractivities
:
[],
idleInteractivities
:
[],
...
...
src/stores/matStore/store.ts
View file @
8d7152b1
...
@@ -43,7 +43,6 @@ class CardArray extends Array<CardState> implements ArrayCardState {
...
@@ -43,7 +43,6 @@ class CardArray extends Array<CardState> implements ArrayCardState {
},
},
focus
:
focus
??
false
,
focus
:
focus
??
false
,
chaining
:
false
,
chaining
:
false
,
chained
:
false
,
directAttack
:
false
,
directAttack
:
false
,
counters
:
{},
counters
:
{},
idleInteractivities
:
[],
idleInteractivities
:
[],
...
@@ -166,7 +165,6 @@ const genBlock = (zone: ygopro.CardZone, n: number) =>
...
@@ -166,7 +165,6 @@ const genBlock = (zone: ygopro.CardZone, n: number) =>
},
},
focus
:
false
,
focus
:
false
,
chaining
:
false
,
chaining
:
false
,
chained
:
false
,
directAttack
:
false
,
directAttack
:
false
,
idleInteractivities
:
[],
idleInteractivities
:
[],
counters
:
{},
counters
:
{},
...
@@ -283,12 +281,12 @@ export const matStore: MatState = proxy<MatState>({
...
@@ -283,12 +281,12 @@ export const matStore: MatState = proxy<MatState>({
}
}
}
}
},
},
setChained
(
location
,
isChained
)
{
setChained
(
location
,
chainIndex
)
{
const
target
=
this
.
in
(
location
.
location
)
const
target
=
this
.
in
(
location
.
location
)
.
of
(
location
.
controler
)
.
of
(
location
.
controler
)
.
at
(
location
.
sequence
);
.
at
(
location
.
sequence
);
if
(
target
)
{
if
(
target
)
{
target
.
chain
ed
=
isChained
;
target
.
chain
Index
=
chainIndex
;
}
}
},
},
});
});
...
...
src/stores/matStore/types.ts
View file @
8d7152b1
...
@@ -112,7 +112,7 @@ export interface MatState {
...
@@ -112,7 +112,7 @@ export interface MatState {
isChaining
:
boolean
isChaining
:
boolean
)
=>
void
;
)
=>
void
;
// 添加被连锁状态
// 添加被连锁状态
setChained
:
(
location
:
ygopro
.
CardLocation
,
isChained
:
boolean
)
=>
void
;
setChained
:
(
location
:
ygopro
.
CardLocation
,
chainIndex
?:
number
)
=>
void
;
}
}
export
interface
InitInfo
{
export
interface
InitInfo
{
...
@@ -136,7 +136,7 @@ export interface CardState {
...
@@ -136,7 +136,7 @@ export interface CardState {
};
// 位置信息,叫location的原因是为了和ygo对齐
};
// 位置信息,叫location的原因是为了和ygo对齐
focus
:
boolean
;
// 用于实现动画效果,当这个字段为true时,该张卡片会被放大并在屏幕中央展示
focus
:
boolean
;
// 用于实现动画效果,当这个字段为true时,该张卡片会被放大并在屏幕中央展示
chaining
:
boolean
;
// 是否在连锁中
chaining
:
boolean
;
// 是否在连锁中
chain
ed
:
boolean
;
// 是否被连锁,如果为true,这张卡片表面会加上枷
锁
chain
Index
?:
number
;
// 连锁的序号,如果为空表示不在连
锁
directAttack
:
boolean
;
// 是否正在直接攻击为玩家
directAttack
:
boolean
;
// 是否正在直接攻击为玩家
attackTarget
?:
CardState
&
{
sequence
:
number
;
opponent
:
boolean
};
// 攻击目标。(嵌套结构可行么?)
attackTarget
?:
CardState
&
{
sequence
:
number
;
opponent
:
boolean
};
// 攻击目标。(嵌套结构可行么?)
idleInteractivities
:
Interactivity
<
number
>
[];
// IDLE状态下的互动信息
idleInteractivities
:
Interactivity
<
number
>
[];
// IDLE状态下的互动信息
...
...
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