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
c72ba4ee
Commit
c72ba4ee
authored
May 28, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update attackTarget
parent
a4236002
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
13 deletions
+4
-13
src/service/duel/attack.ts
src/service/duel/attack.ts
+0
-11
src/stores/cardStore.ts
src/stores/cardStore.ts
+4
-2
No files found.
src/service/duel/attack.ts
View file @
c72ba4ee
...
...
@@ -8,11 +8,6 @@ export default async (attack: ygopro.StocGameMessage.MsgAttack) => {
location
:
attack
.
attacker_location
,
});
// const attacker = matStore
// .in(attack.attacker_location.location)
// .of(attack.attacker_location.controler)
// .at(attack.attacker_location.sequence);
const
attacker
=
cardStore
.
at
(
attack
.
attacker_location
.
location
,
attack
.
attacker_location
.
controler
,
...
...
@@ -26,11 +21,6 @@ export default async (attack: ygopro.StocGameMessage.MsgAttack) => {
await
sleep
(
500
);
attacker
.
directAttack
=
false
;
}
else
{
// const target = matStore
// .in(attack.target_location.location)
// .of(attack.target_location.controler)
// .at(attack.target_location.sequence);
const
target
=
cardStore
.
at
(
attack
.
target_location
.
location
,
attack
.
target_location
.
controler
,
...
...
@@ -39,7 +29,6 @@ export default async (attack: ygopro.StocGameMessage.MsgAttack) => {
if
(
target
)
{
attacker
.
attackTarget
=
{
sequence
:
attack
.
target_location
.
sequence
,
// FIXME: 确实会覆盖,代码这样没错吗
opponent
:
!
matStore
.
isMe
(
attack
.
target_location
.
controler
),
...
target
,
};
...
...
src/stores/cardStore.ts
View file @
c72ba4ee
import
{
CardData
,
CardText
,
fetchCard
,
ygopro
}
from
"
@/api
"
;
import
{
proxy
}
from
"
valtio
"
;
import
{
CardData
,
CardText
,
fetchCard
,
ygopro
}
from
"
@/api
"
;
import
type
{
Interactivity
}
from
"
./matStore/types
"
;
/**
...
...
@@ -33,7 +35,7 @@ export interface CardType {
chainIndex
?:
number
/*连锁的序号,如果为空表示不在连锁
TODO: 目前是妥协的设计,因为其实一张卡是可以在同一个连锁链中被连锁多次的,这里为了避免太过复杂只保存最后的连锁序号*/
;
directAttack
:
boolean
;
// 是否正在直接攻击为玩家
attackTarget
?:
CardType
&
{
sequence
:
number
;
opponent
:
boolean
};
// 攻击目标。(嵌套结构可行么?)
attackTarget
?:
CardType
&
{
opponent
:
boolean
};
// 攻击目标。(嵌套结构可行么?)
}
class
CardStore
{
...
...
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