This commit is contained in:
@@ -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)
|
||||
//取消后手历史效果
|
||||
|
||||
Reference in New Issue
Block a user