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