`` refactor(fight/effect): 重构效果系统,优化效果存储结构和叠层逻辑,移除EffectID结构``
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user