From 3d77e146e928f40978214da6fa4f131c25f26aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Thu, 16 Apr 2026 23:49:28 +0800 Subject: [PATCH] 1 --- logic/service/fight/fightc.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/logic/service/fight/fightc.go b/logic/service/fight/fightc.go index b866a4991..2a8ed03b1 100644 --- a/logic/service/fight/fightc.go +++ b/logic/service/fight/fightc.go @@ -232,6 +232,25 @@ func (f *FightC) roundOpponentInput(attacker *input.Input) *input.Input { return nil } +func isSingleInputBattle(first, second *input.Input) bool { + if first != nil { + return !first.IsMultiInputBattle() + } + if second != nil { + return !second.IsMultiInputBattle() + } + return false +} + +func shouldSkipSecondActionInSingleInput(first, second *input.Input) bool { + if first == nil || second == nil { + return false + } + firstPet := first.CurrentPet() + secondPet := second.CurrentPet() + return firstPet == nil || firstPet.Info.Hp <= 0 || secondPet == nil || secondPet.Info.Hp <= 0 +} + // enterturn 处理战斗回合逻辑 // 回合有先手方和后手方,同时有攻击方和被攻击方 func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) { @@ -333,6 +352,10 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) if currentAction == nil { continue } + if isSingleInputBattle(f.First, f.Second) && shouldSkipSecondActionInSingleInput(f.First, f.Second) { + secondAttack = nil + continue + } attacker, defender = f.getSkillParticipants(secondAttack) originalSkill = f.copySkill(secondAttack) //取消后手历史效果