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) => {
...
@@ -73,7 +73,7 @@ export default (selectBattleCmd: MsgSelectBattleCmd, dispatch: AppDispatch) => {
const
interactType
=
battleTypeToInteracType
(
cmd
.
battle_type
);
const
interactType
=
battleTypeToInteracType
(
cmd
.
battle_type
);
cmd
.
battle_datas
.
forEach
((
data
)
=>
{
cmd
.
battle_datas
.
forEach
((
data
)
=>
{
const
cardInfo
=
data
.
card_info
;
const
{
location
,
sequence
}
=
data
.
card_info
;
// valtio
// valtio
if
(
interactType
)
{
if
(
interactType
)
{
...
@@ -84,22 +84,20 @@ export default (selectBattleCmd: MsgSelectBattleCmd, dispatch: AppDispatch) => {
...
@@ -84,22 +84,20 @@ export default (selectBattleCmd: MsgSelectBattleCmd, dispatch: AppDispatch) => {
[
InteractType
.
ATTACK
]:
{
directAttackAble
:
data
.
direct_attackable
},
[
InteractType
.
ATTACK
]:
{
directAttackAble
:
data
.
direct_attackable
},
};
};
const
tmp
=
map
[
interactType
];
const
tmp
=
map
[
interactType
];
if
(
tmp
)
{
matStore
matStore
.
in
(
location
)
.
in
(
cardInfo
.
location
)
.
of
(
player
)
.
of
(
player
)
.
addIdleInteractivity
(
sequence
,
{
.
addIdleInteractivity
(
cardInfo
.
sequence
,
{
...
tmp
,
...
tmp
,
interactType
,
interactType
,
response
:
data
.
response
,
response
:
data
.
response
,
});
});
}
else
{
}
else
{
console
.
warn
(
`Undefined InteractType`
);
console
.
warn
(
`Unhandled InteractType:`
,
interactType
);
}
}
}
// >>> 从这开始删除 >>>
// >>> 从这开始删除 >>>
switch
(
cardInfo
.
location
)
{
switch
(
location
)
{
case
ygopro
.
CardZone
.
HAND
:
{
case
ygopro
.
CardZone
.
HAND
:
{
dispatcher
(
data
,
interactType
,
addHandsIdleInteractivity
);
dispatcher
(
data
,
interactType
,
addHandsIdleInteractivity
);
...
...
src/service/duel/selectIdleCmd.ts
View file @
35991603
...
@@ -72,7 +72,7 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
...
@@ -72,7 +72,7 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
const
interactType
=
idleTypeToInteractType
(
cmd
.
idle_type
);
const
interactType
=
idleTypeToInteractType
(
cmd
.
idle_type
);
cmd
.
idle_datas
.
forEach
((
data
)
=>
{
cmd
.
idle_datas
.
forEach
((
data
)
=>
{
const
cardInfo
=
data
.
card_info
;
const
{
location
,
sequence
}
=
data
.
card_info
;
// valtio。代码从 ./selectBattleCmd.ts 复制过来的
// valtio。代码从 ./selectBattleCmd.ts 复制过来的
if
(
interactType
)
{
if
(
interactType
)
{
...
@@ -82,21 +82,19 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
...
@@ -82,21 +82,19 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
[
InteractType
.
ACTIVATE
]:
{
activateIndex
:
data
.
effect_description
},
[
InteractType
.
ACTIVATE
]:
{
activateIndex
:
data
.
effect_description
},
};
};
const
tmp
=
map
[
interactType
];
const
tmp
=
map
[
interactType
];
if
(
tmp
)
{
matStore
matStore
.
in
(
location
)
.
in
(
cardInfo
.
location
)
.
of
(
player
)
.
of
(
player
)
.
addIdleInteractivity
(
sequence
,
{
.
addIdleInteractivity
(
cardInfo
.
sequence
,
{
...
tmp
,
...
tmp
,
interactType
,
interactType
,
response
:
data
.
response
,
response
:
data
.
response
,
});
});
}
else
{
}
else
{
console
.
warn
(
`Undefined InteractType`
);
console
.
warn
(
`Unhandled InteractType:`
,
interactType
);
}
}
}
switch
(
cardInfo
.
location
)
{
switch
(
location
)
{
case
ygopro
.
CardZone
.
HAND
:
{
case
ygopro
.
CardZone
.
HAND
:
{
dispatcher
(
data
,
interactType
,
addHandsIdleInteractivity
);
dispatcher
(
data
,
interactType
,
addHandsIdleInteractivity
);
...
@@ -128,7 +126,7 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
...
@@ -128,7 +126,7 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
break
;
break
;
}
}
default
:
{
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 (
...
@@ -37,18 +37,18 @@ export default (
messageStore
.
checkCardModalV2
.
selectMin
=
min
;
messageStore
.
checkCardModalV2
.
selectMin
=
min
;
messageStore
.
checkCardModalV2
.
selectMax
=
max
;
messageStore
.
checkCardModalV2
.
selectMax
=
max
;
dispatch
(
//
dispatch(
fetchCheckCardMetasV2
({
//
fetchCheckCardMetasV2({
selected
:
false
,
//
selected: false,
options
:
selectableCards
.
map
((
card
)
=>
{
//
options: selectableCards.map((card) => {
return
{
//
return {
code
:
card
.
code
,
//
code: card.code,
location
:
card
.
location
,
//
location: card.location,
response
:
card
.
response
,
//
response: card.response,
};
//
};
}),
//
}),
})
//
})
);
//
);
FIXME_fetchCheckCardMetasV2
({
FIXME_fetchCheckCardMetasV2
({
selected
:
false
,
selected
:
false
,
...
@@ -61,18 +61,18 @@ export default (
...
@@ -61,18 +61,18 @@ export default (
}),
}),
});
});
dispatch
(
//
dispatch(
fetchCheckCardMetasV2
({
//
fetchCheckCardMetasV2({
selected
:
true
,
//
selected: true,
options
:
selectedCards
.
map
((
card
)
=>
{
//
options: selectedCards.map((card) => {
return
{
//
return {
code
:
card
.
code
,
//
code: card.code,
location
:
card
.
location
,
//
location: card.location,
response
:
card
.
response
,
//
response: card.response,
};
//
};
}),
//
}),
})
//
})
);
//
);
FIXME_fetchCheckCardMetasV2
({
FIXME_fetchCheckCardMetasV2
({
selected
:
true
,
selected
:
true
,
...
...
src/ui/Duel/PlayMat/Monsters.tsx
View file @
35991603
...
@@ -71,7 +71,7 @@ export const Monsters = () => {
...
@@ -71,7 +71,7 @@ export const Monsters = () => {
))
}
))
}
<
ExtraMonsters
<
ExtraMonsters
meMonsters=
{
meMonstersStore
}
meMonsters=
{
meMonstersStore
}
opMonsters=
{
me
MonstersStore
}
opMonsters=
{
op
MonstersStore
}
/>
/>
</>
</>
);
);
...
@@ -82,10 +82,10 @@ const ExtraMonsters = (props: {
...
@@ -82,10 +82,10 @@ const ExtraMonsters = (props: {
meMonsters
:
CardState
[];
meMonsters
:
CardState
[];
opMonsters
:
CardState
[];
opMonsters
:
CardState
[];
})
=>
{
})
=>
{
const
meLeft
=
props
.
meMonsters
.
find
((
_
,
sequence
)
=>
sequence
==
5
)
;
const
meLeft
=
props
.
meMonsters
[
5
]
;
const
meRight
=
props
.
meMonsters
.
find
((
_
,
sequence
)
=>
sequence
==
6
)
;
const
meRight
=
props
.
meMonsters
[
6
]
;
const
opLeft
=
props
.
opMonsters
.
find
((
_
,
sequence
)
=>
sequence
==
5
)
;
const
opLeft
=
props
.
opMonsters
[
5
]
;
const
opRight
=
props
.
opMonsters
.
find
((
_
,
sequence
)
=>
sequence
==
6
)
;
const
opRight
=
props
.
opMonsters
[
6
]
;
const
leftPosition
=
new
BABYLON
.
Vector3
(
-
1.1
,
transform
.
z
/
2
+
floating
,
0
);
const
leftPosition
=
new
BABYLON
.
Vector3
(
-
1.1
,
transform
.
z
/
2
+
floating
,
0
);
const
rightPosition
=
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: {
...
@@ -95,56 +95,40 @@ const ExtraMonsters = (props: {
return
(
return
(
<>
<>
{
meLeft
?
(
<
FixedSlot
<
FixedSlot
state=
{
meLeft
}
state=
{
meLeft
}
sequence=
{
5
}
sequence=
{
5
}
position=
{
leftPosition
}
position=
{
leftPosition
}
rotation=
{
meRotation
}
rotation=
{
meRotation
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
// clearPlaceInteractivitiesAction={clearMonsterPlaceInteractivities}
// clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
/>
/>
<
FixedSlot
)
:
(
state=
{
meRight
}
<></>
sequence=
{
6
}
)
}
position=
{
rightPosition
}
{
meRight
?
(
rotation=
{
meRotation
}
<
FixedSlot
deffenseRotation=
{
cardSlotDefenceRotation
()
}
state=
{
meRight
}
// clearPlaceInteractivitiesAction={clearMonsterPlaceInteractivities}
sequence=
{
6
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
position=
{
rightPosition
}
/>
rotation=
{
meRotation
}
<
FixedSlot
deffenseRotation=
{
cardSlotDefenceRotation
()
}
state=
{
opLeft
}
// clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
sequence=
{
5
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
position=
{
rightPosition
}
/>
rotation=
{
opRotation
}
)
:
(
deffenseRotation=
{
cardSlotDefenceRotation
()
}
<></>
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
)
}
/>
{
opLeft
?
(
<
FixedSlot
<
FixedSlot
state=
{
opRight
}
state=
{
opLeft
}
sequence=
{
6
}
sequence=
{
5
}
position=
{
leftPosition
}
position=
{
rightPosition
}
rotation=
{
opRotation
}
rotation=
{
opRotation
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
/>
/>
)
:
(
<></>
)
}
{
opRight
?
(
<
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 {
...
@@ -87,12 +87,24 @@ class CardArray extends Array<CardState> implements ArrayCardState {
sequence
:
number
,
sequence
:
number
,
interactivity
:
CardState
[
"
idleInteractivities
"
][
number
]
interactivity
:
CardState
[
"
idleInteractivities
"
][
number
]
)
{
)
{
console
.
warn
(
"
addIdleInteractivity
"
,
{
sequence
,
interactivity
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
this
[
sequence
].
idleInteractivities
.
push
(
interactivity
);
this
[
sequence
].
idleInteractivities
.
push
(
interactivity
);
}
}
clearIdleInteractivities
()
{
clearIdleInteractivities
()
{
this
.
forEach
((
card
)
=>
(
card
.
idleInteractivities
=
[]));
this
.
forEach
((
card
)
=>
(
card
.
idleInteractivities
=
[]));
}
}
setPlaceInteractivityType
(
sequence
:
number
,
interactType
:
InteractType
)
{
setPlaceInteractivityType
(
sequence
:
number
,
interactType
:
InteractType
)
{
console
.
warn
(
"
setPlaceInteractivityType
"
,
{
sequence
,
interactType
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
this
[
sequence
].
placeInteractivity
=
{
this
[
sequence
].
placeInteractivity
=
{
interactType
:
interactType
,
interactType
:
interactType
,
response
:
{
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