Files
bl/logic/service/fight/node/node.go
昔念 9f89f9f259 ```
fix(binary): 修复零值处理导致的结构体打包异常

在 binaryFallback 的 Sizeof 和 Pack 方法中增加对 IsZero 值的判断,
避免空值参与序列化计算引发错误。同时调整了 struc 包相关逻辑以正确
处理空值情况,并打印调试日志辅助排查。

feat(fight): 完善玩家 PVP 对战胜负统计逻辑

修正 PET_MELEE 与 PET_King 模式下胜利归属判定问题,确保只有实际胜出
者才累计胜利次数。此外优化了战斗邀请流程,移除冗余状态控制字段并增强
邀请有效性校验,提升 PvP 流程稳定性。

refactor(pack): 简化数据组包逻辑并提高兼容性

重构 TomeeHeader.Pack 方法,去除反射相关的复杂类型判断,统一使用 struc
进行编码,强化对 nil、interface{} 及多级指针的支持。另外更新了客户端发包
记录日志内容以便追踪调试。

style(code): 规范代码格式并清理无用注释和字段

删除多个文件中的无效或过时注释,如 PlayerID 字段标记废弃、无意义的日志输出等;
同步更新结构体字段命名一致性(如 NonoColor),并对部分函数参数及条件表达式做
可读性优化,整体提升代码整洁度和维护性。
```
2025-11-20 15:19:13 +08:00

119 lines
2.3 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
canStack bool // 最大叠加层数 ,正常都是不允许叠加的,除了衰弱特殊效果 ,异常和能力的叠层
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
ctx input.Ctx
//增加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) Ctx() *input.Ctx {
return &e.ctx
}
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) CanStack(t ...bool) bool {
if len(t) > 0 {
e.canStack = t[0]
}
return e.canStack
}
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) Args() []int {
return e.SideEffectArgs
}
func (e *EffectNode) AttackTime(*input.Input, *input.Input) bool {
return true
}
func (e *EffectNode) Prop_Befer(in *input.Input, prop int8, level int8, ptype info.EnumAbilityOpType) bool {
return true
}
func (e *EffectNode) BoolisFalse(t ...bool) bool {
if len(t) > 0 {
if t[0] == false {
return true
}
return false
}
return false
}