refactor(fight/effect): 重构伤害计算逻辑,移除Effect0中的最大伤害限制并优化伤害传递机制,新增BeforeAttacked触发点

This commit is contained in:
1
2025-09-25 20:34:33 +00:00
parent a2aaf7fff8
commit 6a3a8ba20f
16 changed files with 289 additions and 126 deletions

View File

@@ -16,7 +16,7 @@ type EffectNode struct {
Input *input.Input
stacks int // 当前层数
MaxStack int // 最大叠加层数 ,正常都是不允许叠加的,除了衰弱特殊效果 ,异常和能力的叠层
maxStack int // 最大叠加层数 ,正常都是不允许叠加的,除了衰弱特殊效果 ,异常和能力的叠层
SideEffectArgs []int // 附加效果参数
Owner bool //是否作用自身
Success bool // 是否执行成功 成功XXX失败XXX
@@ -64,9 +64,12 @@ func (this *EffectNode) Hit(t ...bool) bool {
return this.hit
}
func (this *EffectNode) GetMaxStack() int {
func (this *EffectNode) MaxStack(t ...int) int {
return this.MaxStack
if len(t) > 0 {
this.maxStack = t[0]
}
return this.maxStack
}
func (this *EffectNode) Duration(t ...int) int {