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
3a9d7b14
Commit
3a9d7b14
authored
Sep 17, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(尝试)修复偶现的无法结束阶段或进入战斗阶段的问题和修复攻击力展示不正确的问题
parent
9a562f46
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
57 deletions
+82
-57
src/service/duel/chaining.ts
src/service/duel/chaining.ts
+3
-1
src/ui/Duel/PlayMat/Menu/index.tsx
src/ui/Duel/PlayMat/Menu/index.tsx
+79
-56
No files found.
src/service/duel/chaining.ts
View file @
3a9d7b14
...
@@ -29,7 +29,9 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
...
@@ -29,7 +29,9 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
// target.code = meta.id;
// target.code = meta.id;
// 设置`Meta`信息,让对手发动效果的卡也能展示正面卡图
// 设置`Meta`信息,让对手发动效果的卡也能展示正面卡图
if
(
target
.
code
===
0
)
{
target
.
meta
=
meta
;
target
.
meta
=
meta
;
}
// 发动效果动画
// 发动效果动画
await
callCardFocus
(
target
.
uuid
);
await
callCardFocus
(
target
.
uuid
);
...
...
src/ui/Duel/PlayMat/Menu/index.tsx
View file @
3a9d7b14
...
@@ -15,7 +15,7 @@ import {
...
@@ -15,7 +15,7 @@ import {
theme
,
theme
,
Tooltip
,
Tooltip
,
}
from
"
antd
"
;
}
from
"
antd
"
;
import
{
cloneElement
}
from
"
react
"
;
import
{
cloneElement
,
useEffect
,
useState
}
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
import
{
...
@@ -32,67 +32,90 @@ import PhaseType = ygopro.StocGameMessage.MsgNewPhase.PhaseType;
...
@@ -32,67 +32,90 @@ import PhaseType = ygopro.StocGameMessage.MsgNewPhase.PhaseType;
const
{
phase
:
store
}
=
matStore
;
const
{
phase
:
store
}
=
matStore
;
const
{
useToken
}
=
theme
;
const
{
useToken
}
=
theme
;
export
const
Menu
=
()
=>
{
const
clearAllIdleInteractivities
=
()
=>
{
const
{
enableBp
,
enableM2
,
enableEp
,
currentPhase
}
=
useSnapshot
(
store
);
const
{
currentPlayer
,
chainSetting
}
=
useSnapshot
(
matStore
);
const
clearAllIdleInteractivities
=
()
=>
{
for
(
const
card
of
cardStore
.
inner
)
{
for
(
const
card
of
cardStore
.
inner
)
{
card
.
idleInteractivities
=
[];
card
.
idleInteractivities
=
[];
}
}
};
};
const
endResponse
=
[
PhaseType
.
BATTLE_START
,
PhaseType
.
BATTLE_STEP
,
PhaseType
.
DAMAGE
,
PhaseType
.
DAMAGE_GAL
,
PhaseType
.
BATTLE
,
].
includes
(
currentPhase
)
?
3
:
7
;
// PhaseType, 中文, response, 是否显示,是否禁用
// PhaseType, 中文, response, 是否显示,是否禁用
const
p
haseBind
:
[
const
initialP
haseBind
:
[
phase
:
PhaseType
,
phase
:
PhaseType
,
label
:
string
,
label
:
string
,
response
:
number
,
response
:
number
,
show
:
boolean
,
show
:
boolean
,
disabled
:
boolean
,
disabled
:
boolean
,
][]
=
[
][]
=
[
[
PhaseType
.
DRAW
,
"
抽卡阶段
"
,
-
1
,
true
,
true
],
[
PhaseType
.
DRAW
,
"
抽卡阶段
"
,
-
1
,
true
,
true
],
[
PhaseType
.
STANDBY
,
"
准备阶段
"
,
-
1
,
true
,
true
],
[
PhaseType
.
STANDBY
,
"
准备阶段
"
,
-
1
,
true
,
true
],
[
PhaseType
.
MAIN1
,
"
主要阶段 1
"
,
-
1
,
true
,
true
],
[
PhaseType
.
MAIN1
,
"
主要阶段 1
"
,
-
1
,
true
,
true
],
[
PhaseType
.
BATTLE
,
"
战斗阶段
"
,
6
,
true
,
!
enableBp
],
[
PhaseType
.
BATTLE
,
"
战斗阶段
"
,
6
,
true
,
true
],
[
PhaseType
.
BATTLE_START
,
"
战斗开始
"
,
3
,
false
,
true
],
[
PhaseType
.
BATTLE_START
,
"
战斗开始
"
,
3
,
false
,
true
],
[
PhaseType
.
BATTLE_STEP
,
"
战斗步骤
"
,
3
,
false
,
true
],
[
PhaseType
.
BATTLE_STEP
,
"
战斗步骤
"
,
3
,
false
,
true
],
[
PhaseType
.
DAMAGE
,
"
伤害步骤
"
,
3
,
false
,
true
],
[
PhaseType
.
DAMAGE
,
"
伤害步骤
"
,
3
,
false
,
true
],
[
PhaseType
.
DAMAGE_GAL
,
"
伤害步骤(伤害计算)
"
,
3
,
false
,
true
],
[
PhaseType
.
DAMAGE_GAL
,
"
伤害步骤(伤害计算)
"
,
3
,
false
,
true
],
[
PhaseType
.
MAIN2
,
"
主要阶段 2
"
,
2
,
true
,
!
enableM2
],
[
PhaseType
.
MAIN2
,
"
主要阶段 2
"
,
2
,
true
,
true
],
[
PhaseType
.
END
,
"
结束阶段
"
,
endResponse
,
true
,
!
enableEp
],
[
PhaseType
.
END
,
"
结束阶段
"
,
7
,
true
,
true
],
[
PhaseType
.
UNKNOWN
,
"
未知阶段
"
,
-
1
,
false
,
true
],
[
PhaseType
.
UNKNOWN
,
"
未知阶段
"
,
-
1
,
false
,
true
],
];
];
const
phaseSwitchItems
:
MenuProps
[
"
items
"
]
=
phaseBind
export
const
Menu
=
()
=>
{
const
{
enableBp
,
enableM2
,
enableEp
,
currentPhase
}
=
useSnapshot
(
store
);
const
{
currentPlayer
,
chainSetting
}
=
useSnapshot
(
matStore
);
const
[
phaseBind
,
setPhaseBind
]
=
useState
(
initialPhaseBind
);
const
[
phaseSwitchItems
,
setPhaseSwitchItems
]
=
useState
<
MenuProps
[
"
items
"
]
>
(
[],
);
useEffect
(()
=>
{
const
endResponse
=
[
PhaseType
.
BATTLE_START
,
PhaseType
.
BATTLE_STEP
,
PhaseType
.
DAMAGE
,
PhaseType
.
DAMAGE_GAL
,
PhaseType
.
BATTLE
,
].
includes
(
currentPhase
)
?
3
:
7
;
setPhaseBind
((
prev
)
=>
{
const
newItems
=
[...
prev
];
for
(
const
item
of
newItems
)
{
const
[
phase
,
,
,
,]
=
item
;
if
(
phase
===
PhaseType
.
BATTLE
)
{
item
[
4
]
=
!
enableBp
;
}
else
if
(
phase
===
PhaseType
.
MAIN2
)
{
item
[
4
]
=
!
enableM2
;
}
else
if
(
phase
===
PhaseType
.
END
)
{
item
[
4
]
=
!
enableEp
;
item
[
2
]
=
endResponse
;
}
}
return
newItems
;
});
},
[
enableBp
,
enableM2
,
enableEp
,
currentPhase
]);
useEffect
(()
=>
{
const
newPhaseSwitchItems
=
phaseBind
.
filter
(([,
,
,
show
])
=>
show
)
.
filter
(([,
,
,
show
])
=>
show
)
.
map
(([
phase
,
label
,
response
,
_
,
disabled
],
key
)
=>
({
.
map
(([
phase
,
label
,
response
,
_
,
disabled
],
key
)
=>
({
key
,
key
,
label
,
label
,
disabled
:
store
.
currentPhase
>=
phase
||
disabled
,
disabled
:
disabled
,
onClick
:
()
=>
{
onClick
:
()
=>
{
if
(
response
===
2
)
sendSelectIdleCmdResponse
(
response
);
if
(
response
===
2
)
sendSelectIdleCmdResponse
(
response
);
else
sendSelectBattleCmdResponse
(
response
);
else
sendSelectBattleCmdResponse
(
response
);
clearAllIdleInteractivities
();
clearAllIdleInteractivities
();
},
},
icon
:
icon
:
disabled
?
<
CheckOutlined
/>
:
<
ArrowRightOutlined
/>,
store
.
currentPhase
>=
phase
||
disabled
?
(
<
CheckOutlined
/>
)
:
(
<
ArrowRightOutlined
/>
),
danger
:
phase
===
PhaseType
.
END
,
danger
:
phase
===
PhaseType
.
END
,
}));
}));
setPhaseSwitchItems
(
newPhaseSwitchItems
);
},
[
phaseBind
]);
const
chainSettingTexts
=
[
const
chainSettingTexts
=
[
[
ChainSetting
.
CHAIN_ALL
,
"
全部连锁
"
],
[
ChainSetting
.
CHAIN_ALL
,
"
全部连锁
"
],
[
ChainSetting
.
CHAIN_IGNORE
,
"
忽略连锁
"
],
[
ChainSetting
.
CHAIN_IGNORE
,
"
忽略连锁
"
],
...
...
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