Files
bl/logic/service/fight/effect/effect_130.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

40 lines
985 B
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 effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/shopspring/decimal"
)
type Effect130 struct {
node.EffectNode // 仅继承基础效果节点,不嵌入条件函数
}
// -----------------------------------------------------------
// 核心共性逻辑:命中且满足条件时,附加固定伤害
// -----------------------------------------------------------
func (e *Effect130) OnSkill() bool {
// 1. 命中判定失败,不触发
if !e.Hit() {
return true
}
if e.Ctx().Opp.CurrentPet.PetInfo.Gender != e.Args()[0] {
return true
}
// 4. 附加固定伤害从SideEffectArgs[0]获取伤害值)
damageValue := decimal.NewFromInt(int64(e.SideEffectArgs[1]))
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: damageValue,
})
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 130, &Effect130{})
}