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

71 lines
1.7 KiB
Go
Raw Normal View History

2025-08-26 19:46:29 +08:00
package node
import (
"context"
)
2025-08-26 19:46:29 +08:00
// 检查,激活,延后
// /基础节点
type EffectNode struct {
2025-08-26 19:46:29 +08:00
//Turn int // 当前回合数 ,回合数其实从战斗的上下文中获取
//本质上Ctx还要传入战斗双方数据来判断是否是本精灵切换
Ctx context.Context //节点上下文
2025-08-27 14:41:06 +00:00
duration int // 默认为-1 持续回合/次0 = 即时生效,>0 = 回合数 ,负数是永久) 次数相当于重写回合
2025-08-27 15:29:34 +00:00
stacks int // 当前层数
ArgSize int
2025-08-27 14:41:06 +00:00
maxStack int // 最大叠加层数 ,正常都是不允许叠加的,除了衰弱特殊效果 ,异常和能力的叠层
SideEffectArgs []int // 附加效果参数
Owner bool //是否作用自身
Success bool // 是否执行成功 成功XXX失败XXX
arget bool // 传出作用对象,默认0是自身,1是作用于对面
Flag int //过滤掉的战斗类型 pvp pve boss战斗,野怪全部生效
//增加owner target如果owner target都为自身就回合效果结束后再使用回合效果
2025-08-26 19:46:29 +08:00
}
func (this *EffectNode) ID() int {
2025-08-26 19:46:29 +08:00
return 0
}
// 传出作用对象,默认0是自身,1是作用于对面
func (this *EffectNode) Target() bool {
return this.target
}
func (this *EffectNode) SetTarget(t bool) {
this.target = t
2025-08-26 19:46:29 +08:00
}
func (this *EffectNode) Stack(t int) int {
2025-08-26 19:46:29 +08:00
if t != 0 {
this.stacks = t
}
return this.stacks
}
func (this *EffectNode) MaxStack() int {
2025-08-26 19:46:29 +08:00
return this.maxStack
}
func (this *EffectNode) Duration(t int) int {
2025-08-26 19:46:29 +08:00
return this.duration
}
func (this *EffectNode) SetArgs(args []int) {
this.SideEffectArgs = args
}
func (this *EffectNode) GetArgSize() int {
return this.ArgSize
}