```
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

refactor(effect): 移除未使用的element导入并优化自然敌人判断逻辑

移除了NewSeIdx_14.go中未使用的element包导入,将自然敌人判断逻辑
提取到EffectNode基类中,通过ISNaturalEnemy方法统一处理。
```
This commit is contained in:
昔念
2026-03-08 22:43:51 +08:00
parent 0cff02158b
commit 90f653d3ee
14 changed files with 366 additions and 528 deletions

View File

@@ -200,6 +200,7 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
} else {
attacker, defender = f.Second, f.First
originalSkill = f.copySkill(secondAttack)
//取消后手历史效果
f.Second.ReactvieEffect()
}
@@ -214,28 +215,23 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
})
canUse := canUseSkill && action.CanUse(currentSkill) && attacker.CurrentPet.Info.Hp > 0
if i == 0 { //先手方被控,这时候应该算做未出手状态
if canUse {
f.TrueFirst = attacker
} else {
f.TrueFirst = defender
}
}
if !canUse {
attacker.RecoverEffect()
currentSkill = nil
if i == 0 {
//不能使用,所以这时候取消后手
defender.ReactvieEffect()
firstAttack, secondAttack = secondAttack, firstAttack //互换先手权
f.First, f.Second = f.Second, f.First
//反转先后手
originalSkill = f.copySkill(secondAttack)
f.Second.ReactvieEffect()
originalSkill = f.copySkill(firstAttack)
currentSkill = originalSkill
attacker, defender = defender, attacker
}
} else {
f.processSkillAttack(attacker, defender, currentSkill)
currentSkill = originalSkill //还原技能
@@ -301,10 +297,6 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
})
ff.GenInfo()
})
if f.TrueFirst != f.First {
f.First, f.Second = f.Second, f.First
}
attackValueResult := info.AttackValueS{
FAttack: *f.First.AttackValue,