2025-08-26 19:46:29 +08:00
|
|
|
|
package node
|
|
|
|
|
|
|
2025-08-26 18:02:32 +00:00
|
|
|
|
import (
|
2025-09-14 01:35:16 +08:00
|
|
|
|
"blazing/logic/service/fight/input"
|
2025-08-26 18:02:32 +00:00
|
|
|
|
)
|
2025-08-26 19:46:29 +08:00
|
|
|
|
|
2025-08-26 18:02:32 +00:00
|
|
|
|
// 检查,激活,延后
|
|
|
|
|
|
// /基础节点
|
2025-08-26 22:26:21 +00:00
|
|
|
|
type EffectNode struct {
|
2025-08-26 19:46:29 +08:00
|
|
|
|
//Turn int // 当前回合数 ,回合数其实从战斗的上下文中获取
|
2025-09-03 00:37:05 +08:00
|
|
|
|
//本质上Ctx还要传入战斗双方数据来判断是否是本精灵切换
|
2025-09-15 00:40:19 +08:00
|
|
|
|
//Ctx context.Context //节点上下文
|
|
|
|
|
|
//次数相当于重写回合
|
|
|
|
|
|
duration int // 默认为-1 持续回合/次(0 = 即时生效,>0 = 回合数 ,负数是永久) \
|
2025-08-26 22:26:21 +00:00
|
|
|
|
|
2025-09-23 17:34:58 +00:00
|
|
|
|
Input *input.Input
|
|
|
|
|
|
stacks int // 当前层数
|
|
|
|
|
|
|
2025-09-16 22:51:22 +08:00
|
|
|
|
MaxStack int // 最大叠加层数 ,正常都是不允许叠加的,除了衰弱特殊效果 ,异常和能力的叠层
|
2025-08-27 14:41:06 +00:00
|
|
|
|
SideEffectArgs []int // 附加效果参数
|
2025-09-08 02:53:59 +00:00
|
|
|
|
Owner bool //是否作用自身
|
|
|
|
|
|
Success bool // 是否执行成功 成功XXX,失败XXX
|
|
|
|
|
|
arget bool // 传出作用对象,默认0是自身,1是作用于对面
|
|
|
|
|
|
Flag int //过滤掉的战斗类型 pvp pve boss战斗,野怪全部生效
|
2025-09-15 00:40:19 +08:00
|
|
|
|
NotAlive bool // 是否失效 effect返回值是否被取消,是否被删除
|
2025-09-05 00:07:04 +08:00
|
|
|
|
//增加owner target,如果owner target都为自身,就回合效果结束后再使用回合效果
|
2025-08-26 19:46:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-15 00:40:19 +08:00
|
|
|
|
func (this *EffectNode) Alive() bool {
|
|
|
|
|
|
|
|
|
|
|
|
return !this.NotAlive
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2025-08-26 22:26:21 +00:00
|
|
|
|
func (this *EffectNode) ID() int {
|
2025-08-26 19:46:29 +08:00
|
|
|
|
|
|
|
|
|
|
return 0
|
|
|
|
|
|
|
2025-09-15 22:45:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
func (this *EffectNode) NotALive() {
|
|
|
|
|
|
|
|
|
|
|
|
this.NotAlive = true
|
|
|
|
|
|
|
2025-09-04 02:11:55 +08:00
|
|
|
|
}
|
2025-09-08 23:17:42 +08:00
|
|
|
|
func (this *EffectNode) GetOwner() bool {
|
2025-09-04 02:11:55 +08:00
|
|
|
|
|
2025-09-08 23:17:42 +08:00
|
|
|
|
return this.Owner
|
2025-09-05 22:40:36 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
2025-09-08 23:17:42 +08:00
|
|
|
|
func (this *EffectNode) SetOwner(b bool) {
|
2025-09-05 22:40:36 +08:00
|
|
|
|
|
2025-09-08 23:17:42 +08:00
|
|
|
|
this.Owner = b
|
2025-09-04 02:11:55 +08:00
|
|
|
|
|
2025-08-26 19:46:29 +08:00
|
|
|
|
}
|
2025-09-23 17:34:58 +00: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
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2025-09-16 22:51:22 +08:00
|
|
|
|
func (this *EffectNode) GetMaxStack() int {
|
2025-08-26 19:46:29 +08:00
|
|
|
|
|
2025-09-16 22:51:22 +08:00
|
|
|
|
return this.MaxStack
|
2025-08-26 19:46:29 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
2025-09-23 17:34:58 +00: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
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2025-09-15 00:40:19 +08:00
|
|
|
|
|
|
|
|
|
|
// 设置参数,加上设置输入源
|
2025-08-26 22:26:21 +00:00
|
|
|
|
func (this *EffectNode) SetArgs(args []int) {
|
2025-08-26 20:01:20 +00:00
|
|
|
|
|
|
|
|
|
|
this.SideEffectArgs = args
|
|
|
|
|
|
|
2025-09-15 00:40:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
func (this *EffectNode) SetInput(args *input.Input) {
|
|
|
|
|
|
this.Input = args
|
|
|
|
|
|
|
2025-08-26 20:01:20 +00:00
|
|
|
|
}
|
2025-08-26 22:26:21 +00:00
|
|
|
|
|
2025-09-14 01:35:16 +08:00
|
|
|
|
func (this *EffectNode) AttackTime(*input.Input, *input.Input) bool {
|
2025-09-12 00:27:49 +08:00
|
|
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
|
|
|
|
}
|