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
35991603
Commit
35991603
authored
Apr 26, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: the same extra field; few options
parent
d6508a0c
Pipeline
#21379
passed with stages
in 14 minutes and 33 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
100 additions
and
108 deletions
+100
-108
src/service/duel/selectBattleCmd.ts
src/service/duel/selectBattleCmd.ts
+12
-14
src/service/duel/selectIdleCmd.ts
src/service/duel/selectIdleCmd.ts
+13
-15
src/service/duel/selectUnselectCard.ts
src/service/duel/selectUnselectCard.ts
+24
-24
src/ui/Duel/PlayMat/Monsters.tsx
src/ui/Duel/PlayMat/Monsters.tsx
+39
-55
src/valtioStores/matStore/store.ts
src/valtioStores/matStore/store.ts
+12
-0
No files found.
src/service/duel/selectBattleCmd.ts
View file @
35991603
...
...
@@ -73,7 +73,7 @@ export default (selectBattleCmd: MsgSelectBattleCmd, dispatch: AppDispatch) => {
const
interactType
=
battleTypeToInteracType
(
cmd
.
battle_type
);
cmd
.
battle_datas
.
forEach
((
data
)
=>
{
const
cardInfo
=
data
.
card_info
;
const
{
location
,
sequence
}
=
data
.
card_info
;
// valtio
if
(
interactType
)
{
...
...
@@ -84,22 +84,20 @@ export default (selectBattleCmd: MsgSelectBattleCmd, dispatch: AppDispatch) => {
[
InteractType
.
ATTACK
]:
{
directAttackAble
:
data
.
direct_attackable
},
};
const
tmp
=
map
[
interactType
];
if
(
tmp
)
{
matStore
.
in
(
cardInfo
.
location
)
.
of
(
player
)
.
addIdleInteractivity
(
cardInfo
.
sequence
,
{
...
tmp
,
interactType
,
response
:
data
.
response
,
});
}
else
{
console
.
warn
(
`Unhandled InteractType:`
,
interactType
);
}
matStore
.
in
(
location
)
.
of
(
player
)
.
addIdleInteractivity
(
sequence
,
{
...
tmp
,
interactType
,
response
:
data
.
response
,
});
}
else
{
console
.
warn
(
`Undefined InteractType`
);
}
// >>> 从这开始删除 >>>
switch
(
cardInfo
.
location
)
{
switch
(
location
)
{
case
ygopro
.
CardZone
.
HAND
:
{
dispatcher
(
data
,
interactType
,
addHandsIdleInteractivity
);
...
...
src/service/duel/selectIdleCmd.ts
View file @
35991603
...
...
@@ -72,7 +72,7 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
const
interactType
=
idleTypeToInteractType
(
cmd
.
idle_type
);
cmd
.
idle_datas
.
forEach
((
data
)
=>
{
const
cardInfo
=
data
.
card_info
;
const
{
location
,
sequence
}
=
data
.
card_info
;
// valtio。代码从 ./selectBattleCmd.ts 复制过来的
if
(
interactType
)
{
...
...
@@ -82,21 +82,19 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
[
InteractType
.
ACTIVATE
]:
{
activateIndex
:
data
.
effect_description
},
};
const
tmp
=
map
[
interactType
];
if
(
tmp
)
{
matStore
.
in
(
cardInfo
.
location
)
.
of
(
player
)
.
addIdleInteractivity
(
cardInfo
.
sequence
,
{
...
tmp
,
interactType
,
response
:
data
.
response
,
});
}
else
{
console
.
warn
(
`Unhandled InteractType:`
,
interactType
);
}
matStore
.
in
(
location
)
.
of
(
player
)
.
addIdleInteractivity
(
sequence
,
{
...
tmp
,
interactType
,
response
:
data
.
response
,
});
}
else
{
console
.
warn
(
`Undefined InteractType`
);
}
switch
(
cardInfo
.
location
)
{
switch
(
location
)
{
case
ygopro
.
CardZone
.
HAND
:
{
dispatcher
(
data
,
interactType
,
addHandsIdleInteractivity
);
...
...
@@ -128,7 +126,7 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
break
;
}
default
:
{
console
.
log
(
`Unhandled zone type:
${
cardInfo
.
location
}
`
);
console
.
log
(
`Unhandled zone type:
${
location
}
`
);
}
}
});
...
...
src/service/duel/selectUnselectCard.ts
View file @
35991603
...
...
@@ -37,18 +37,18 @@ export default (
messageStore
.
checkCardModalV2
.
selectMin
=
min
;
messageStore
.
checkCardModalV2
.
selectMax
=
max
;
dispatch
(
fetchCheckCardMetasV2
({
selected
:
false
,
options
:
selectableCards
.
map
((
card
)
=>
{
return
{
code
:
card
.
code
,
location
:
card
.
location
,
response
:
card
.
response
,
};
}),
})
);
//
dispatch(
//
fetchCheckCardMetasV2({
//
selected: false,
//
options: selectableCards.map((card) => {
//
return {
//
code: card.code,
//
location: card.location,
//
response: card.response,
//
};
//
}),
//
})
//
);
FIXME_fetchCheckCardMetasV2
({
selected
:
false
,
...
...
@@ -61,18 +61,18 @@ export default (
}),
});
dispatch
(
fetchCheckCardMetasV2
({
selected
:
true
,
options
:
selectedCards
.
map
((
card
)
=>
{
return
{
code
:
card
.
code
,
location
:
card
.
location
,
response
:
card
.
response
,
};
}),
})
);
//
dispatch(
//
fetchCheckCardMetasV2({
//
selected: true,
//
options: selectedCards.map((card) => {
//
return {
//
code: card.code,
//
location: card.location,
//
response: card.response,
//
};
//
}),
//
})
//
);
FIXME_fetchCheckCardMetasV2
({
selected
:
true
,
...
...
src/ui/Duel/PlayMat/Monsters.tsx
View file @
35991603
...
...
@@ -71,7 +71,7 @@ export const Monsters = () => {
))
}
<
ExtraMonsters
meMonsters=
{
meMonstersStore
}
opMonsters=
{
me
MonstersStore
}
opMonsters=
{
op
MonstersStore
}
/>
</>
);
...
...
@@ -82,10 +82,10 @@ const ExtraMonsters = (props: {
meMonsters
:
CardState
[];
opMonsters
:
CardState
[];
})
=>
{
const
meLeft
=
props
.
meMonsters
.
find
((
_
,
sequence
)
=>
sequence
==
5
)
;
const
meRight
=
props
.
meMonsters
.
find
((
_
,
sequence
)
=>
sequence
==
6
)
;
const
opLeft
=
props
.
opMonsters
.
find
((
_
,
sequence
)
=>
sequence
==
5
)
;
const
opRight
=
props
.
opMonsters
.
find
((
_
,
sequence
)
=>
sequence
==
6
)
;
const
meLeft
=
props
.
meMonsters
[
5
]
;
const
meRight
=
props
.
meMonsters
[
6
]
;
const
opLeft
=
props
.
opMonsters
[
5
]
;
const
opRight
=
props
.
opMonsters
[
6
]
;
const
leftPosition
=
new
BABYLON
.
Vector3
(
-
1.1
,
transform
.
z
/
2
+
floating
,
0
);
const
rightPosition
=
new
BABYLON
.
Vector3
(
1.1
,
transform
.
z
/
2
+
floating
,
0
);
...
...
@@ -95,56 +95,40 @@ const ExtraMonsters = (props: {
return
(
<>
{
meLeft
?
(
<
FixedSlot
state=
{
meLeft
}
sequence=
{
5
}
position=
{
leftPosition
}
rotation=
{
meRotation
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
// clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
/>
)
:
(
<></>
)
}
{
meRight
?
(
<
FixedSlot
state=
{
meRight
}
sequence=
{
6
}
position=
{
rightPosition
}
rotation=
{
meRotation
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
// clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
/>
)
:
(
<></>
)
}
{
opLeft
?
(
<
FixedSlot
state=
{
opLeft
}
sequence=
{
5
}
position=
{
rightPosition
}
rotation=
{
opRotation
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
/>
)
:
(
<></>
)
}
{
opRight
?
(
<
FixedSlot
state=
{
opRight
}
sequence=
{
6
}
position=
{
leftPosition
}
rotation=
{
opRotation
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
/>
)
:
(
<></>
)
}
<
FixedSlot
state=
{
meLeft
}
sequence=
{
5
}
position=
{
leftPosition
}
rotation=
{
meRotation
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
// clearPlaceInteractivitiesAction={clearMonsterPlaceInteractivities}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
/>
<
FixedSlot
state=
{
meRight
}
sequence=
{
6
}
position=
{
rightPosition
}
rotation=
{
meRotation
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
// clearPlaceInteractivitiesAction={clearMonsterPlaceInteractivities}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
/>
<
FixedSlot
state=
{
opLeft
}
sequence=
{
5
}
position=
{
rightPosition
}
rotation=
{
opRotation
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
/>
<
FixedSlot
state=
{
opRight
}
sequence=
{
6
}
position=
{
leftPosition
}
rotation=
{
opRotation
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
/>
</>
);
};
...
...
src/valtioStores/matStore/store.ts
View file @
35991603
...
...
@@ -87,12 +87,24 @@ class CardArray extends Array<CardState> implements ArrayCardState {
sequence
:
number
,
interactivity
:
CardState
[
"
idleInteractivities
"
][
number
]
)
{
console
.
warn
(
"
addIdleInteractivity
"
,
{
sequence
,
interactivity
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
this
[
sequence
].
idleInteractivities
.
push
(
interactivity
);
}
clearIdleInteractivities
()
{
this
.
forEach
((
card
)
=>
(
card
.
idleInteractivities
=
[]));
}
setPlaceInteractivityType
(
sequence
:
number
,
interactType
:
InteractType
)
{
console
.
warn
(
"
setPlaceInteractivityType
"
,
{
sequence
,
interactType
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
this
[
sequence
].
placeInteractivity
=
{
interactType
:
interactType
,
response
:
{
...
...
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