73 lines
1.9 KiB
Go
73 lines
1.9 KiB
Go
package node
|
||
|
||
import (
|
||
"blazing/logic/service/fight/info"
|
||
"context"
|
||
)
|
||
|
||
// 检查,激活,延后
|
||
// /基础节点
|
||
type EffectNode struct {
|
||
//Turn int // 当前回合数 ,回合数其实从战斗的上下文中获取
|
||
//本质上ctx还要传入战斗双方数据来判断是否是本精灵切换
|
||
ctx context.Context //节点上下文
|
||
duration int // 默认为1 持续回合/次(0 = 即时生效,>0 = 回合数 ,负数是永久)
|
||
stacks int // 当前层数
|
||
paramSize int
|
||
maxStack int // 最大叠加层数 ,正常都是不允许叠加的,除了衰弱特殊效果
|
||
SideEffectArgs []int // 附加效果参数
|
||
|
||
//LifeType EnumLifeType //回合效果 是否可持续 继承到下一直精灵 ,这个用重写事件来实现
|
||
|
||
// Parent string // 上下文来源(比如 "Skill"、"Buff"、"Passive")
|
||
// Trigger node.EnumEffectTrigger // 当前触发的节点
|
||
// Container *EffectContainer // 效果容器(通常挂在 Actor 身上)
|
||
// Effect *Effect // 当前正在执行的 Effect
|
||
// Available bool // 是否可用
|
||
// Success bool // 是否执行成功
|
||
// Done bool // 是否中止后续执行
|
||
}
|
||
|
||
func (this *EffectNode) ID() int {
|
||
|
||
return 0
|
||
|
||
}
|
||
func (this *EffectNode) Stack(t int) int {
|
||
if t != 0 {
|
||
this.stacks = t
|
||
}
|
||
|
||
return this.stacks
|
||
|
||
}
|
||
func (this *EffectNode) MaxStack() int {
|
||
|
||
return this.maxStack
|
||
|
||
}
|
||
func (this *EffectNode) Duration(t int) int {
|
||
|
||
return this.duration
|
||
|
||
}
|
||
func (this *EffectNode) SetArgs(args []int) {
|
||
|
||
this.SideEffectArgs = args
|
||
|
||
}
|
||
func (this *EffectNode) ParamSize(t int) int {
|
||
if t != 0 {
|
||
this.paramSize = t
|
||
}
|
||
|
||
return this.paramSize
|
||
|
||
}
|
||
func (this *EffectNode) GetSkill(t int) *info.BattleSkillEntity {
|
||
pet, _ := this.ctx.Value(info.BattleSkillEntityCtx).(*info.BattleSkillEntity)
|
||
|
||
return pet
|
||
|
||
}
|