`` refactor(fight/effect): 重构效果系统,优化效果存储结构和叠层逻辑,移除EffectID结构``

This commit is contained in:
1
2025-10-31 11:21:24 +00:00
parent 7bc7776074
commit f1ff5a8dbc
9 changed files with 80 additions and 86 deletions

View File

@@ -10,9 +10,9 @@ import (
type EffectNode struct {
duration int // 默认为-1 持续回合/次0 = 即时生效,>0 = 回合数 ,负数是永久) \
Input *input.Input
stacks int // 当前层数
Input *input.Input
stacks int // 当前层数
id int
maxStack int // 最大叠加层数 ,正常都是不允许叠加的,除了衰弱特殊效果 ,异常和能力的叠层
SideEffectArgs []int // 附加效果参数
Owner bool //是否作用自身
@@ -56,6 +56,14 @@ func (this *EffectNode) Stack(t ...int) int {
return this.stacks
}
func (this *EffectNode) ID(t ...int) int {
if len(t) > 0 {
this.id = t[0]
}
return this.id
}
func (this *EffectNode) Hit(t ...bool) bool {
if len(t) > 0 {
@@ -86,6 +94,11 @@ func (this *EffectNode) SetArgs(t *input.Input, a ...int) {
this.Input = t
this.SideEffectArgs = a
}
func (this *EffectNode) GetArgs() []int {
return this.SideEffectArgs
}
func (this *EffectNode) AttackTime(*input.Input, *input.Input) bool {