From 0a66ef103540fe89d05161e71c61577873e39a66 Mon Sep 17 00:00:00 2001 From: walkpan Date: Sun, 22 Mar 2026 21:52:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8A=80=E8=83=BD=E6=96=BD=E6=94=BE):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8A=80=E8=83=BD=E5=8D=87=E7=BA=A7=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E8=AE=A1=E7=AE=97=E5=B9=B6=E6=94=AF=E6=8C=81=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E6=96=BD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 cNum 计算修正为 Math.min(2, Math.max(0, Math.floor(sUp.num ?? 0))),防止无效值 - 根据 cNum 增加技能施放循环,支持多次施放效果 - 为属性增益 buff 添加注释说明动画意图 --- assets/script/game/hero/SCastSystem.ts | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/assets/script/game/hero/SCastSystem.ts b/assets/script/game/hero/SCastSystem.ts index 3eaf008a..788f3854 100644 --- a/assets/script/game/hero/SCastSystem.ts +++ b/assets/script/game/hero/SCastSystem.ts @@ -110,8 +110,8 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate const s_uuid = castPlan.skillId; const skillLv = castPlan.skillLv; const config = SkillSet[s_uuid]; - const sUp=SkillUpList[s_uuid]??SkillUpList[1001] - const cNum=sUp.num + const sUp = SkillUpList[s_uuid] ?? SkillUpList[1001]; + const cNum = Math.min(2, Math.max(0, Math.floor(sUp.num ?? 0))); if (!config) return; //播放前摇技能动画 heroView.playReady(config.readyAnm); @@ -125,13 +125,17 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate heroView.scheduleOnce(() => { if (!heroView.node || !heroView.node.isValid || heroAttrs.is_dead) return; - if (castPlan.isFriendly) { - const friendlyTargets = this.resolveFriendlyTargets(castPlan.targetEids, heroAttrs.fac); - if (friendlyTargets.length === 0) return; - this.applyFriendlySkillEffects(s_uuid, skillLv, config, heroView, heroAttrs, friendlyTargets, null); - return; + const castTimes = 1 + cNum; + for (let i = 0; i < castTimes; i++) { + if (!heroView.node || !heroView.node.isValid || heroAttrs.is_dead) return; + if (castPlan.isFriendly) { + const friendlyTargets = this.resolveFriendlyTargets(castPlan.targetEids, heroAttrs.fac); + if (friendlyTargets.length === 0) return; + this.applyFriendlySkillEffects(s_uuid, skillLv, config, heroView, heroAttrs, friendlyTargets, null); + continue; + } + this.applyEnemySkillEffects(s_uuid, skillLv, config, heroView, heroAttrs, castPlan.targetPos); } - this.applyEnemySkillEffects(s_uuid, skillLv, config, heroView, heroAttrs, castPlan.targetPos); }, delay); heroAttrs.triggerSkillCD(s_uuid); } @@ -199,9 +203,11 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate switch (buffConf.buff){ case Attrs.ap: model.add_ap(sBuffAp) + //加工动画 break case Attrs.hp_max: model.add_hp_max(sBuffHp) + //加最大生命值动画 break } }