fix(技能施放): 修复技能升级次数计算并支持多次施放

- 将 cNum 计算修正为 Math.min(2, Math.max(0, Math.floor(sUp.num ?? 0))),防止无效值
- 根据 cNum 增加技能施放循环,支持多次施放效果
- 为属性增益 buff 添加注释说明动画意图
This commit is contained in:
walkpan
2026-03-22 21:52:12 +08:00
parent ab11b2b2d3
commit 0a66ef1035

View File

@@ -110,8 +110,8 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
const s_uuid = castPlan.skillId; const s_uuid = castPlan.skillId;
const skillLv = castPlan.skillLv; const skillLv = castPlan.skillLv;
const config = SkillSet[s_uuid]; const config = SkillSet[s_uuid];
const sUp=SkillUpList[s_uuid]??SkillUpList[1001] const sUp = SkillUpList[s_uuid] ?? SkillUpList[1001];
const cNum=sUp.num const cNum = Math.min(2, Math.max(0, Math.floor(sUp.num ?? 0)));
if (!config) return; if (!config) return;
//播放前摇技能动画 //播放前摇技能动画
heroView.playReady(config.readyAnm); heroView.playReady(config.readyAnm);
@@ -125,13 +125,17 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
heroView.scheduleOnce(() => { heroView.scheduleOnce(() => {
if (!heroView.node || !heroView.node.isValid || heroAttrs.is_dead) return; if (!heroView.node || !heroView.node.isValid || heroAttrs.is_dead) return;
if (castPlan.isFriendly) { const castTimes = 1 + cNum;
const friendlyTargets = this.resolveFriendlyTargets(castPlan.targetEids, heroAttrs.fac); for (let i = 0; i < castTimes; i++) {
if (friendlyTargets.length === 0) return; if (!heroView.node || !heroView.node.isValid || heroAttrs.is_dead) return;
this.applyFriendlySkillEffects(s_uuid, skillLv, config, heroView, heroAttrs, friendlyTargets, null); if (castPlan.isFriendly) {
return; 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); }, delay);
heroAttrs.triggerSkillCD(s_uuid); heroAttrs.triggerSkillCD(s_uuid);
} }
@@ -199,9 +203,11 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
switch (buffConf.buff){ switch (buffConf.buff){
case Attrs.ap: case Attrs.ap:
model.add_ap(sBuffAp) model.add_ap(sBuffAp)
//加工动画
break break
case Attrs.hp_max: case Attrs.hp_max:
model.add_hp_max(sBuffHp) model.add_hp_max(sBuffHp)
//加最大生命值动画
break break
} }
} }