From 2855c3e77368429a728e9914771b010b476747df Mon Sep 17 00:00:00 2001 From: 1 <1@72wo.cn> Date: Tue, 23 Sep 2025 23:05:23 +0000 Subject: [PATCH] =?UTF-8?q?refactor(fight/effect):=20=E9=87=8D=E6=9E=84Set?= =?UTF-8?q?Args=E6=96=B9=E6=B3=95=E4=B8=BA=E5=8F=AF=E5=8F=98=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=BD=A2=E5=BC=8F=EF=BC=8C=E4=BC=98=E5=8C=96Effect62?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=AE=BE=E7=BD=AE=E9=80=BB=E8=BE=91=E5=B9=B6?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=9B=B4=E6=96=B0Effect=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/service/fight/effect/effect_62.go | 7 +++++++ logic/service/fight/input/nodemanger.go | 3 ++- logic/service/fight/node/node.go | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/logic/service/fight/effect/effect_62.go b/logic/service/fight/effect/effect_62.go index a3df92c9..504db555 100644 --- a/logic/service/fight/effect/effect_62.go +++ b/logic/service/fight/effect/effect_62.go @@ -53,6 +53,13 @@ func (e *Effect62) SkillUseEnd(opp *input.Input) { } +func (e *Effect62) SetArgs(args ...int) { + + e.EffectNode.SetArgs(args...) + e.EffectNode.Duration(args[0]) + +} + // 因为对方切精灵,这个效果也要无效掉 func (this *Effect62) OnSwitchIn() bool { if this.Hide { //如果还在隐藏,就直接返回 diff --git a/logic/service/fight/input/nodemanger.go b/logic/service/fight/input/nodemanger.go index 0d67c252..f9db7aaf 100644 --- a/logic/service/fight/input/nodemanger.go +++ b/logic/service/fight/input/nodemanger.go @@ -27,7 +27,7 @@ type Effect interface { SetInput(input *Input) AfterAttr() //在获取属性前,比如重写对方属性AfterAttr BeferAttr() //在获取属性后,比如视为对方属性 - SetArgs(param []int) + SetArgs(param ...int) IsCrit(opp *Input, skill *info.SkillEntity) //是否暴击 CalculateDamage(opp *Input, skill *info.SkillEntity) //击判定成功且伤害计算前触发 OnBeforeCalculateDamage(opp *Input, skill *info.SkillEntity) // 最终伤害计算前触发 @@ -193,6 +193,7 @@ func getTypeName(v interface{}) string { func (c *Input) AddEffect(e Effect) { //todo 免疫 + //TODO 先激活 e.SetInput(c) // 如果已有同 ID 的效果,尝试叠加 for _, eff := range c.Effects { diff --git a/logic/service/fight/node/node.go b/logic/service/fight/node/node.go index ac6444e9..bc01c894 100644 --- a/logic/service/fight/node/node.go +++ b/logic/service/fight/node/node.go @@ -73,7 +73,7 @@ func (this *EffectNode) Duration(t ...int) int { } // 设置参数,加上设置输入源 -func (this *EffectNode) SetArgs(args []int) { +func (this *EffectNode) SetArgs(args ...int) { this.SideEffectArgs = args