diff --git a/logic/service/fight/fightc.go b/logic/service/fight/fightc.go index 2a8ed03b1..0e4db9446 100644 --- a/logic/service/fight/fightc.go +++ b/logic/service/fight/fightc.go @@ -133,7 +133,20 @@ func (f *FightC) getSkillParticipants(skillAction *action.SelectSkillAction) (*i if skillAction == nil { return nil, nil } - return f.GetInputByAction(skillAction, false), f.GetInputByAction(skillAction, true) + attacker := f.GetInputByAction(skillAction, false) + defender := f.GetInputByAction(skillAction, true) + if attacker != nil && defender == attacker && shouldResolveOpponentAsTarget(skillAction.SkillEntity) { + if opponent, _ := attacker.OpponentSlotAtOrNextLiving(0); opponent != nil { + defender = opponent + } else if opponent := f.roundOpponentInput(attacker); opponent != nil { + defender = opponent + } + } + return attacker, defender +} + +func shouldResolveOpponentAsTarget(skill *info.SkillEntity) bool { + return skill != nil && skill.XML.AtkType == 3 } // setEffectSkillContext 统一设置技能阶段 effect 上下文。 @@ -232,17 +245,7 @@ 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 { +func shouldSkipSecondAction(first, second *input.Input) bool { if first == nil || second == nil { return false } @@ -352,7 +355,7 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) if currentAction == nil { continue } - if isSingleInputBattle(f.First, f.Second) && shouldSkipSecondActionInSingleInput(f.First, f.Second) { + if shouldSkipSecondAction(f.First, f.Second) { secondAttack = nil continue }