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

103 lines
2.1 KiB
Go
Raw Normal View History

2025-08-26 19:46:29 +08:00
package node
import (
2025-09-29 02:40:35 +08:00
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
)
2025-08-26 19:46:29 +08:00
// 检查,激活,延后
// /基础节点
type EffectNode struct {
feat(player): 新增玩家累计经验查询接口 新增 PlayerExp 控制器方法,用于返回玩家的累计经验值。同时调整了经验池字段类型为 uint32 并修复相关使用逻辑。 feat(pet): 实现宠物经验增加与升级逻辑 在 Player 结构体中新增 AddPetExp 方法,支持宠物经验增长、自动升级及进化判断。升级后会重新计算面板属性并推送更新包。 feat(fight): 重构战斗伤害计算与效果系统 引入 DamageZone 和 EnumDamageType 类型,统一红伤处理流程;移除旧有的 Pet/Skill/Prop 属性获取临时修改机制,改为直接访问真实属性。更新多个技能效果实现以适配新结构。 refactor(effect): 优化技能效果初始化和生命周期方法 统一技能效果初始化方式,明确各阶段回调函数职责,如 PreActionStart、PreAttacked 等。删除已废弃的属性修改钩子函数,并更新状态类效果实现。 refactor(input): 移除 deepcopy 依赖并替换为 go-deepcopy 将原先使用的 mohae/deepcopy 替换为 barkimedes/go-deepcopy,用于战斗节点中的 effect 拷贝逻辑,提升性能和安全性。 refactor(model): 调整玩家信息字段类型 将 PlayerInfo 中的 GoldBean 字段由 int32 改为 uint32,ExpPool 字段由 int64 改为 uint32,确保数据类型一致性与合理性。 feat(nono): 增加 Nono 跟随/收回协议结构定义 新增 NonoFollowOrHomeInInfo 和 NonoFollowOutInfo 结构体,用于处理 Nono 宠物的跟随与收回操作指令。 chore(deps): 添加 go-deepcopy 依赖 在 go.mod 中引入 github.com/barkimedes/go-deepcopy 依赖库,用于替代原有的 deepcopy 工具。
2025-09-26 13:33:55 +08:00
Effect
duration int // 默认为-1 持续回合/次0 = 即时生效,>0 = 回合数 ,负数是永久) \
Input *input.Input
stacks int // 当前层数
maxStack int // 最大叠加层数 ,正常都是不允许叠加的,除了衰弱特殊效果 ,异常和能力的叠层
2025-08-27 14:41:06 +00:00
SideEffectArgs []int // 附加效果参数
Owner bool //是否作用自身
Success bool // 是否执行成功 成功XXX失败XXX
arget bool // 传出作用对象,默认0是自身,1是作用于对面
Flag int //过滤掉的战斗类型 pvp pve boss战斗,野怪全部生效
notAlive bool // 是否失效 effect返回值是否被取消是否被删除
hit bool
//增加owner target如果owner target都为自身就回合效果结束后再使用回合效果
2025-08-26 19:46:29 +08:00
}
func (this *EffectNode) Alive() bool {
return !this.notAlive
}
2025-09-29 02:40:35 +08:00
func (e *EffectNode) GetInput() *input.Input {
2025-08-26 19:46:29 +08:00
2025-09-29 02:40:35 +08:00
return e.Input
2025-09-29 02:40:35 +08:00
}
func (e *EffectNode) NotALive() {
e.notAlive = true
}
2025-09-29 02:40:35 +08:00
func (e *EffectNode) GetOwner() bool {
2025-09-29 02:40:35 +08:00
return e.Owner
}
2025-09-29 02:40:35 +08:00
func (e *EffectNode) SetOwner(b bool) {
2025-09-29 02:40:35 +08:00
e.Owner = b
2025-08-26 19:46:29 +08:00
}
func (this *EffectNode) Stack(t ...int) int {
if len(t) > 0 {
this.stacks = t[0]
2025-08-26 19:46:29 +08:00
}
return this.stacks
}
func (this *EffectNode) Hit(t ...bool) bool {
if len(t) > 0 {
this.hit = t[0]
}
return this.hit
2025-08-26 19:46:29 +08:00
}
func (this *EffectNode) MaxStack(t ...int) int {
2025-08-26 19:46:29 +08:00
if len(t) > 0 {
this.maxStack = t[0]
}
return this.maxStack
2025-08-26 19:46:29 +08:00
}
func (this *EffectNode) Duration(t ...int) int {
if len(t) > 0 {
this.duration = t[0]
}
2025-08-26 19:46:29 +08:00
return this.duration
}
// 设置参数,加上设置输入源
func (this *EffectNode) SetArgs(t *input.Input, a ...int) {
this.Input = t
this.SideEffectArgs = a
}
func (this *EffectNode) AttackTime(*input.Input, *input.Input) bool {
return true
}
2025-09-29 02:40:35 +08:00
func (e *EffectNode) EFFect_Befer() {
}
func (e *EffectNode) Prop_Befer(in *input.Input, prop int8, level int8, ptype info.EnumAbilityOpType) bool {
return true
}