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
deft
Neos
Commits
247ad7f3
Commit
247ad7f3
authored
May 14, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
impl attack in store
parent
848d06a7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
1 deletion
+33
-1
src/service/duel/attack.ts
src/service/duel/attack.ts
+25
-1
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
+2
-0
No files found.
src/service/duel/attack.ts
View file @
247ad7f3
import
{
ygopro
}
from
"
@/api
"
;
import
{
fetchEsHintMeta
}
from
"
@/stores
"
;
import
{
fetchEsHintMeta
,
matStore
}
from
"
@/stores
"
;
export
default
(
attack
:
ygopro
.
StocGameMessage
.
MsgAttack
)
=>
{
fetchEsHintMeta
({
originMsg
:
"
「[?]」攻击时
"
,
location
:
attack
.
attacker_location
,
});
const
attacker
=
matStore
.
in
(
attack
.
attacker_location
.
location
)
.
of
(
attack
.
attacker_location
.
controler
)
.
at
(
attack
.
attacker_location
.
sequence
);
if
(
attacker
)
{
if
(
attack
.
direct_attack
)
{
attacker
.
directAttack
=
true
;
setTimeout
(()
=>
(
attacker
.
directAttack
=
false
),
500
);
}
else
{
const
target
=
matStore
.
in
(
attack
.
target_location
.
location
)
.
of
(
attack
.
target_location
.
controler
)
.
at
(
attack
.
target_location
.
sequence
);
if
(
target
)
{
attacker
.
attackTarget
=
target
;
setTimeout
(()
=>
(
attacker
.
attackTarget
=
undefined
),
500
);
}
}
}
};
src/service/duel/reloadField.ts
View file @
247ad7f3
...
...
@@ -52,6 +52,7 @@ function reloadDuelField(
counters
:
{},
focus
:
false
,
chaining
:
false
,
directAttack
:
false
,
reload
:
true
,
};
});
...
...
src/service/duel/start.ts
View file @
247ad7f3
...
...
@@ -41,6 +41,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
},
focus
:
false
,
chaining
:
false
,
directAttack
:
false
,
counters
:
{},
idleInteractivities
:
[],
});
...
...
@@ -59,6 +60,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
},
focus
:
false
,
chaining
:
false
,
directAttack
:
false
,
counters
:
{},
idleInteractivities
:
[],
});
...
...
@@ -78,6 +80,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
},
focus
:
false
,
chaining
:
false
,
directAttack
:
false
,
counters
:
{},
idleInteractivities
:
[],
});
...
...
src/stores/matStore/store.ts
View file @
247ad7f3
...
...
@@ -43,6 +43,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
},
focus
:
focus
??
false
,
chaining
:
false
,
directAttack
:
false
,
counters
:
{},
idleInteractivities
:
[],
});
...
...
@@ -164,6 +165,7 @@ const genBlock = (zone: ygopro.CardZone, n: number) =>
},
focus
:
false
,
chaining
:
false
,
directAttack
:
false
,
idleInteractivities
:
[],
counters
:
{},
}));
...
...
src/stores/matStore/types.ts
View file @
247ad7f3
...
...
@@ -132,6 +132,8 @@ export interface CardState {
};
// 位置信息,叫location的原因是为了和ygo对齐
focus
:
boolean
;
// 用于实现动画效果,当这个字段为true时,该张卡片会被放大并在屏幕中央展示
chaining
:
boolean
;
// 是否在连锁中
directAttack
:
boolean
;
// 是否正在直接攻击为玩家
attackTarget
?:
CardState
;
// 攻击目标。(嵌套结构可行么?)
idleInteractivities
:
Interactivity
<
number
>
[];
// IDLE状态下的互动信息
placeInteractivity
?:
Interactivity
<
{
controler
:
number
;
...
...
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