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

91 lines
2.0 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 node
import (
"blazing/logic/service/fight/input"
)
// 检查,激活,延后
// /基础节点
type EffectNode struct {
//Turn int // 当前回合数 ,回合数其实从战斗的上下文中获取
//本质上Ctx还要传入战斗双方数据来判断是否是本精灵切换
//Ctx context.Context //节点上下文
//次数相当于重写回合
duration int // 默认为-1 持续回合/次0 = 即时生效,>0 = 回合数 ,负数是永久) \
Input *input.Input
stacks int // 当前层数
MaxStack int // 最大叠加层数 ,正常都是不允许叠加的,除了衰弱特殊效果 ,异常和能力的叠层
SideEffectArgs []int // 附加效果参数
Owner bool //是否作用自身
Success bool // 是否执行成功 成功XXX失败XXX
arget bool // 传出作用对象,默认0是自身,1是作用于对面
Flag int //过滤掉的战斗类型 pvp pve boss战斗,野怪全部生效
notAlive bool // 是否失效 effect返回值是否被取消是否被删除
//增加owner target如果owner target都为自身就回合效果结束后再使用回合效果
}
func (this *EffectNode) Alive() bool {
return !this.notAlive
}
func (this *EffectNode) ID() int {
return 0
}
func (this *EffectNode) NotALive() {
this.notAlive = true
}
func (this *EffectNode) GetOwner() bool {
return this.Owner
}
func (this *EffectNode) SetOwner(b bool) {
this.Owner = b
}
func (this *EffectNode) Stack(t ...int) int {
if len(t) > 0 {
this.stacks = t[0]
}
return this.stacks
}
func (this *EffectNode) GetMaxStack() int {
return this.MaxStack
}
func (this *EffectNode) Duration(t ...int) int {
if len(t) > 0 {
this.duration = t[0]
}
return this.duration
}
// 设置参数,加上设置输入源
func (this *EffectNode) SetArgs(args []int) {
this.SideEffectArgs = args
}
func (this *EffectNode) SetInput(args *input.Input) {
this.Input = args
}
func (this *EffectNode) AttackTime(*input.Input, *input.Input) bool {
return true
}