Files
bl/logic/service/fight/node/node.go
昔念 da9286d3d8 ```
feat(fight): 调整技能效果命中逻辑与回合开始处理

- 修改了技能效果命中的判定顺序,确保暴击计算在效果添加之前执行
- 修复了回合开始时敌我双方状态结算的上下文错误
- 优化了效果缓存初始化逻辑,避免重复添加相同效果
- 增加了效果去重判断,防止完全相同的效果被重复添加
- 调整了战斗循环中结束逻辑的位置,确保广播和通道关闭正确执行
- 更新了部分日志提示信息,使其更符合实际业务含义
- 移除了部分无用代码和注释,提高
2025-11-11 01:10:26 +08:00

106 lines
2.1 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/info"
"blazing/logic/service/fight/input"
"sync"
)
// 检查,激活,延后
// /基础节点
type EffectNode struct {
duration int // 默认为-1 持续回合/次0 = 即时生效,>0 = 回合数 ,负数是永久) \
Input *input.Input
stacks int // 当前层数
id int
maxStack int // 最大叠加层数 ,正常都是不允许叠加的,除了衰弱特殊效果 ,异常和能力的叠层
SideEffectArgs []int // 附加效果参数
owner bool //是否作用自身
Success bool // 是否执行成功 成功XXX失败XXX
arget bool // 传出作用对象,默认0是自身,1是作用于对面
Flag int //过滤掉的战斗类型 pvp pve boss战斗,野怪全部生效
alive bool // 是否失效 effect返回值是否被取消是否被删除
hit bool
trunl sync.Once
//增加owner target如果owner target都为自身就回合效果结束后再使用回合效果
}
func (e *EffectNode) Alive(t ...bool) bool {
if len(t) > 0 {
e.alive = t[0]
}
return e.alive
}
func (e *EffectNode) GetInput() *input.Input {
return e.Input
}
func (e *EffectNode) Stack(t ...int) int {
if len(t) > 0 {
e.stacks = t[0]
}
return e.stacks
}
func (e *EffectNode) ID(t ...int) int {
if len(t) > 0 {
e.id = t[0]
}
return e.id
}
func (e *EffectNode) Hit(t ...bool) bool {
if len(t) > 0 {
e.hit = t[0]
}
return e.hit
}
func (e *EffectNode) MaxStack(t ...int) int {
if len(t) > 0 {
e.maxStack = t[0]
}
return e.maxStack
}
func (e *EffectNode) Duration(t ...int) int {
if len(t) > 0 {
e.duration = t[0]
}
return e.duration
}
// 设置参数,加上设置输入源
func (e *EffectNode) SetArgs(t *input.Input, a ...int) {
e.Input = t
e.SideEffectArgs = a
}
func (e *EffectNode) GetArgs() []int {
return e.SideEffectArgs
}
func (e *EffectNode) AttackTime(*input.Input, *input.Input) bool {
return true
}
func (e *EffectNode) EFFect_Befer() {
}
func (e *EffectNode) Prop_Befer(in *input.Input, prop int8, level int8, ptype info.EnumAbilityOpType) bool {
return true
}