fix: 修复战斗逻辑中的技能结算顺序问题
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -219,7 +219,9 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
|
||||
f.TrueFirst = attacker
|
||||
|
||||
} else {
|
||||
|
||||
f.TrueFirst = defender
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -227,6 +229,13 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
|
||||
|
||||
attacker.RecoverEffect()
|
||||
currentSkill = nil
|
||||
if i == 0 {
|
||||
//反转先后手
|
||||
originalSkill = f.copySkill(secondAttack)
|
||||
f.Second.ReactvieEffect()
|
||||
currentSkill = originalSkill
|
||||
attacker, defender = defender, attacker
|
||||
}
|
||||
} else {
|
||||
f.processSkillAttack(attacker, defender, currentSkill)
|
||||
currentSkill = originalSkill //还原技能
|
||||
@@ -276,11 +285,18 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
|
||||
})
|
||||
}
|
||||
|
||||
if defender.CurrentPet.Info.Hp == 0 {
|
||||
if defender.CurrentPet.Info.Hp <= 0 {
|
||||
|
||||
f.TURNOVER(defender)
|
||||
|
||||
break
|
||||
} else {
|
||||
//技能使用后
|
||||
defender.Exec(func(effect input.Effect) bool { //技能使用后的我方效果
|
||||
effect.Ctx().SkillEntity = currentSkill
|
||||
effect.Action_end_ex()
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ type Effect interface {
|
||||
SkillUseed() bool //技能PP减少节点
|
||||
ActionEndEx() bool
|
||||
Action_end() bool
|
||||
Action_end_ex() bool
|
||||
//OnDefeat(opp *Input) bool // 精灵被击败时触发
|
||||
|
||||
// 首发其实就是切换的精灵为nil
|
||||
|
||||
@@ -19,6 +19,10 @@ func (e *EffectNode) SkillHit() bool {
|
||||
func (e *EffectNode) SkillHit_ex() bool {
|
||||
return true
|
||||
}
|
||||
func (e *EffectNode) Action_end_ex() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *EffectNode) CalculatePre() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user