Files
bl/logic/service/fight/boss/NewSeIdx_1.go
昔念 9315fcfa17
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
```
refactor(fight): 移除能力操作类型枚举并简化属性设置方法

移除了 info.EnumAbilityOpType 枚举类型及其相关常量定义,
重构了 SetProp 方法调用,不再传递操作类型参数,
通过检查等级正负值来判断是增加还是减少属性,
减少了代码复杂度并统一了属性变更的处理逻辑。
```
2026-03-08 23:24:18 +08:00

61 lines
1.3 KiB
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/input"
"blazing/logic/service/fight/node"
)
// 基类特性
// 特性的ID=PET cacthtime+eid 这样保证不重复
type NewSel0 struct {
node.EffectNode
//Catchtime int //保存精灵的唯一指令,保证在上场时候正确注入
//Hide bool //是否隐藏 ,所属精灵下场后特性就应该消失
//如果2只精灵一个特性怎么办每次切精灵注入特性
}
// 重写回合结束效果,特性都是无线回合类的
// 次数类本质上也是这种
// 特性,无法被切精灵消除
func (e *NewSel0) SwitchOut(in *input.Input) bool {
return true
}
func (e *NewSel0) IsOwner() bool {
if e.Ctx().Our == nil {
return false
}
if e.Ctx().Our.CurrentPet == nil {
return false
}
return e.ID().GetCatchTime() == e.Ctx().Our.CurrentPet.Info.CatchTime
}
// 免疫"能力(battle_lv)下降"
type NewSel1 struct {
NewSel0
}
func (e *NewSel1) PropBefer(in *input.Input, prop int8, level int8) bool {
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
if !e.IsOwner() {
return true
}
if in == e.Ctx().Our {
return true
}
//能力下降类
if level < 0 {
return false
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 1, &NewSel1{})
}