Files
bl/logic/service/fight/node/node.go

102 lines
2.1 KiB
Go
Raw Normal View History

2025-08-26 19:46:29 +08:00
package node
import (
2025-09-29 02:40:35 +08:00
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
)
2025-08-26 19:46:29 +08:00
// 检查,激活,延后
// /基础节点
type EffectNode struct {
duration int // 默认为-1 持续回合/次0 = 即时生效,>0 = 回合数 ,负数是永久) \
Input *input.Input
stacks int // 当前层数
maxStack int // 最大叠加层数 ,正常都是不允许叠加的,除了衰弱特殊效果 ,异常和能力的叠层
2025-08-27 14:41:06 +00:00
SideEffectArgs []int // 附加效果参数
Owner bool //是否作用自身
Success bool // 是否执行成功 成功XXX失败XXX
arget bool // 传出作用对象,默认0是自身,1是作用于对面
Flag int //过滤掉的战斗类型 pvp pve boss战斗,野怪全部生效
notAlive bool // 是否失效 effect返回值是否被取消是否被删除
hit bool
//增加owner target如果owner target都为自身就回合效果结束后再使用回合效果
2025-08-26 19:46:29 +08:00
}
func (this *EffectNode) Alive() bool {
return !this.notAlive
}
2025-09-29 02:40:35 +08:00
func (e *EffectNode) GetInput() *input.Input {
2025-08-26 19:46:29 +08:00
2025-09-29 02:40:35 +08:00
return e.Input
2025-09-29 02:40:35 +08:00
}
func (e *EffectNode) NotALive() {
e.notAlive = true
}
2025-09-29 02:40:35 +08:00
func (e *EffectNode) GetOwner() bool {
2025-09-29 02:40:35 +08:00
return e.Owner
}
2025-09-29 02:40:35 +08:00
func (e *EffectNode) SetOwner(b bool) {
2025-09-29 02:40:35 +08:00
e.Owner = b
2025-08-26 19:46:29 +08:00
}
func (this *EffectNode) Stack(t ...int) int {
if len(t) > 0 {
this.stacks = t[0]
2025-08-26 19:46:29 +08:00
}
return this.stacks
}
func (this *EffectNode) Hit(t ...bool) bool {
if len(t) > 0 {
this.hit = t[0]
}
return this.hit
2025-08-26 19:46:29 +08:00
}
func (this *EffectNode) MaxStack(t ...int) int {
2025-08-26 19:46:29 +08:00
if len(t) > 0 {
this.maxStack = t[0]
}
return this.maxStack
2025-08-26 19:46:29 +08:00
}
func (this *EffectNode) Duration(t ...int) int {
if len(t) > 0 {
this.duration = t[0]
}
2025-08-26 19:46:29 +08:00
return this.duration
}
// 设置参数,加上设置输入源
func (this *EffectNode) SetArgs(t *input.Input, a ...int) {
this.Input = t
this.SideEffectArgs = a
}
func (this *EffectNode) AttackTime(*input.Input, *input.Input) bool {
return true
}
2025-09-29 02:40:35 +08:00
func (e *EffectNode) EFFect_Befer() {
}
func (e *EffectNode) Prop_Befer(in *input.Input, prop int8, level int8, ptype info.EnumAbilityOpType) bool {
return true
}