From 4d39164c86e6416bae01cdab893c0910eefebaef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Tue, 31 Mar 2026 10:03:07 +0800 Subject: [PATCH] =?UTF-8?q?```=20feat(fight):=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=88=98=E6=96=97=E6=95=88=E6=9E=9C714-718=E7=9A=84=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=AA=8C=E8=AF=81=E5=92=8C=E5=8A=9F=E8=83=BD=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为Effect714添加armed状态重置逻辑,并增加参数长度验证 - 修复Effect716的子效果创建逻辑,改为通过InitEffect方法创建 - 为Effect717和Effect718添加参数长度验证,防止索引越界 - 重构Effect718的技能命中处理逻辑,统一效果 --- logic/service/fight/effect/714_718.go | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/logic/service/fight/effect/714_718.go b/logic/service/fight/effect/714_718.go index 92c8a216a..223670395 100644 --- a/logic/service/fight/effect/714_718.go +++ b/logic/service/fight/effect/714_718.go @@ -17,7 +17,8 @@ type Effect714 struct { } func (e *Effect714) ComparePre(fattack, sattack *action.SelectSkillAction) bool { - if !e.Ctx().Opp.HasPropADD() { + e.armed = false + if len(e.Args()) == 0 || !e.Ctx().Opp.HasPropADD() { return true } @@ -35,6 +36,7 @@ func (e *Effect714) OnSkill() bool { if !e.armed { return true } + e.armed = false for i, v := range e.Ctx().Opp.Prop[:] { if v > 0 { e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) @@ -95,7 +97,14 @@ type Effect716 struct { } func (e *Effect716) OnSkill() bool { - addSubEffect(e.Ctx().Our, e.Ctx().Opp, &e.EffectNode, &Effect716Sub{}, -1) + if len(e.Args()) < 2 { + return true + } + + effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 716, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart())) + if effect != nil { + e.Ctx().Opp.AddEffect(e.Ctx().Our, effect) + } return true } @@ -119,7 +128,7 @@ type Effect717 struct { } func (e *Effect717) Skill_Use() bool { - if e.Ctx().SkillEntity == nil { + if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil { return true } drain := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1]) @@ -149,11 +158,18 @@ type Effect718 struct { } func (e *Effect718) SkillHit_ex() bool { + if len(e.Args()) < 2 { + return true + } skill := e.Ctx().SkillEntity if skill == nil || skill.Category() != info.Category.STATUS { return true } - addSubEffect(e.Ctx().Our, e.Ctx().Our, &e.EffectNode, &Effect718Sub{}, -1) + + effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 718, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart())) + if effect != nil { + e.Ctx().Our.AddEffect(e.Ctx().Our, effect) + } return true } @@ -177,6 +193,8 @@ func init() { input.InitEffect(input.EffectType.Skill, 715, &Effect715{}) input.InitEffect(input.EffectType.Sub, 715, &Effect715Sub{}) input.InitEffect(input.EffectType.Skill, 716, &Effect716{}) + input.InitEffect(input.EffectType.Sub, 716, &Effect716Sub{}) input.InitEffect(input.EffectType.Skill, 717, &Effect717{}) input.InitEffect(input.EffectType.Skill, 718, &Effect718{}) + input.InitEffect(input.EffectType.Sub, 718, &Effect718Sub{}) }