`` 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

@@ -57,8 +57,8 @@ func (e *Effect10) OnSkill(ctx input.Ctx) bool {
t1 := e.Input.FightC.GetRand().Int31n(3)
eff := input.Geteffect(input.EffectType.Status, int(e.Status))
if eff.ID != 0 {
eff.Effect.Duration(int(t1))
if eff.ID() != 0 {
eff.Duration(int(t1))
ctx.AddEffect(eff)
}

View File

@@ -20,7 +20,7 @@ func NewEffectStat(b bool) input.Effect {
EffectNode: node.EffectNode{},
Etype: b,
}
ret.MaxStack(-1) //无限叠加
return ret
}

View File

@@ -21,11 +21,11 @@ type StatusNotSkill struct {
// 不能出手
func (e *StatusNotSkill) Skill_Hit_Pre(ctx input.Ctx) bool {
if e.EffectStatus.Status == info.PetStatus.Sleep {
// tt := &StatusSleep{}
// tt.SetArgs(e.Input, 0) //睡眠没参数
// tt.ID((- int(info.PetStatus.Sleep))) //添加ID
ctx.AddEffect(&input.EffectID{ //对对方添加出手解除效果
ID: -1,
Effect: &StatusSleep{},
})
// ctx.AddEffect(tt)
}
return false