Skip to content

Commit

Permalink
杀手bug
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzhaomax committed Mar 14, 2024
1 parent 61b0351 commit a0a6bf2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions client/src/pages/gaming/Gaming.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -581,20 +581,24 @@ function Gaming() {
setIsCastModalOpen(false)
// 后端判断 发动技能的条件是,取决于身份,drunk,白天黑夜,还有没有技能;前端随便发动,后端判断成不成功
let me = getMe(game)
if (!me.state.casted && !game.state.votingStep && game.state.stage !== 0 &&
if (!me.state.casted && !game.state.votingStep && game.state.stage !== 0 && game.state.night &&
(castToPlayersId.length === 1 &&
(me.character === "下毒者" ||
me.character === "管家" ||
me.character === "僧侣" ||
me.character === "小恶魔" ||
me.character === "守鸦人" ||
me.character === "杀手")
me.character === "守鸦人")
||
(castToPlayersId.length === 2 &&
me.character === "占卜师")
)) {
emitCast()
}
// 杀手可以在白天任何阶段开枪
if (!me.state.casted && game.state.stage !== 0 && castToPlayersId.length === 1
&& me.character === "杀手" && !game.state.night) {
emitCast()
}
}
const handleCastCancel = () => {
setIsCastModalOpen(false)
Expand Down

0 comments on commit a0a6bf2

Please sign in to comment.