refactor(fight/effect): 重构效果命中处理逻辑,统一Hit接口并优化效果触发时机

This commit is contained in:
1
2025-09-24 19:47:01 +00:00
parent 29d485fde5
commit 3314c11b48
6 changed files with 49 additions and 42 deletions

View File

@@ -23,6 +23,7 @@ type EffectNode struct {
arget bool // 传出作用对象,默认0是自身,1是作用于对面
Flag int //过滤掉的战斗类型 pvp pve boss战斗,野怪全部生效
notAlive bool // 是否失效 effect返回值是否被取消是否被删除
hit bool
//增加owner target如果owner target都为自身就回合效果结束后再使用回合效果
}
@@ -54,6 +55,14 @@ func (this *EffectNode) Stack(t ...int) int {
return this.stacks
}
func (this *EffectNode) Hit(t ...bool) bool {
if len(t) > 0 {
this.hit = t[0]
}
return this.hit
}
func (this *EffectNode) GetMaxStack() int {