This commit is contained in:
@@ -133,7 +133,20 @@ func (f *FightC) getSkillParticipants(skillAction *action.SelectSkillAction) (*i
|
|||||||
if skillAction == nil {
|
if skillAction == nil {
|
||||||
return nil, 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 上下文。
|
// setEffectSkillContext 统一设置技能阶段 effect 上下文。
|
||||||
@@ -232,17 +245,7 @@ func (f *FightC) roundOpponentInput(attacker *input.Input) *input.Input {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func isSingleInputBattle(first, second *input.Input) bool {
|
func shouldSkipSecondAction(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 {
|
if first == nil || second == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -352,7 +355,7 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
|
|||||||
if currentAction == nil {
|
if currentAction == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if isSingleInputBattle(f.First, f.Second) && shouldSkipSecondActionInSingleInput(f.First, f.Second) {
|
if shouldSkipSecondAction(f.First, f.Second) {
|
||||||
secondAttack = nil
|
secondAttack = nil
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user