Files
bl/logic/service/fight/boss/NewSeIdx_14.go
昔念 90f653d3ee
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
```
refactor(effect): 移除未使用的element导入并优化自然敌人判断逻辑

移除了NewSeIdx_14.go中未使用的element包导入,将自然敌人判断逻辑
提取到EffectNode基类中,通过ISNaturalEnemy方法统一处理。
```
2026-03-08 22:43:51 +08:00

32 lines
1018 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
)
// 14. 若遇到天敌, 则战斗开始时连续害怕 n 回合;a1: n
// TODO: 实现若遇到天敌, 则战斗开始时连续害怕 n 回合;a1: n的核心逻辑
type NewSel14 struct {
NewSel0
conut int
}
func (e *NewSel14) TurnStart(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) {
// TODO: 实现若遇到天敌, 则战斗开始时连续害怕 n 回合;a1: n的核心逻辑
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime || !e.ISNaturalEnemy() {
return
}
// 5. 获取状态效果实例并设置参数
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Fear))
// 6. 给对手添加状态
//然后这里是被动添加,所以对方不能消除
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
func init() {
input.InitEffect(input.EffectType.NewSel, 14, &NewSel14{})
}