From 149fb6fb565b0ae7b6739f13b95676cb1e215c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <1@72wo.cn> Date: Wed, 31 Dec 2025 03:16:58 +0800 Subject: [PATCH] =?UTF-8?q?```=20feat(fight):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=88=98=E6=96=97=E4=B8=AD=E5=85=88=E6=89=8B=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在战斗回合开始时,当先手方被控制无法行动时, 正确设置真正的先手方为当前回合的先手, 确保战斗逻辑的准确性。 ``` --- logic/service/fight/fightc.go | 12 +++++++++--- logic/service/fight/input.go | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/logic/service/fight/fightc.go b/logic/service/fight/fightc.go index bfe010c67..a55902f40 100644 --- a/logic/service/fight/fightc.go +++ b/logic/service/fight/fightc.go @@ -202,11 +202,17 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) }) canUse := canUseSkill && action.CanUse(currentSkill) && attacker.CurrentPet.Info.Hp > 0 + if i == 0 { //先手方被控,这时候应该算做未出手状态 + if canUse { + f.TrueFirst = attacker - if !canUse { - if i == 0 { //增加我方放弃出手时变成后手放判断 - f.Second, f.First = f.First, f.Second + } else { + f.TrueFirst = defender } + + } + if !canUse { + attacker.RecoverEffect() currentSkill = nil } else { diff --git a/logic/service/fight/input.go b/logic/service/fight/input.go index da4d3f516..24731defb 100644 --- a/logic/service/fight/input.go +++ b/logic/service/fight/input.go @@ -45,6 +45,7 @@ type FightC struct { quit chan struct{} over chan struct{} First *input.Input + TrueFirst *input.Input Second *input.Input closefight bool overl sync.Once @@ -103,7 +104,7 @@ func (f *FightC) GetRand() *rand.Rand { // 获取随机数 func (f *FightC) IsFirst(play common.PlayerI) bool { - return f.First.Player == play + return f.TrueFirst.Player == play } func (f *FightC) Chat(c common.PlayerI, msg string) {