refactor(hero cast): add buff effect animation resolution logic
新增根据buff属性解析对应增益特效动画名的方法,并在施加永久和计时buff时播放对应特效
This commit is contained in:
@@ -517,6 +517,13 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
}
|
||||
}
|
||||
|
||||
/** 解析 buff 增益特效动画名:攻击提升→up_ap,攻速提升→up_cd,其余→up_blue */
|
||||
private resolveBuffEndAnm(attr?: Attrs): string {
|
||||
if (attr === Attrs.ap) return "up_ap";
|
||||
if (attr === Attrs.speed) return "up_cd";
|
||||
return "up_blue";
|
||||
}
|
||||
|
||||
private applyActualFriendlyEffect(target: HeroViewComp, kind: SkillKind, sAp: number, _cAttrsComp: HeroAttrsComp, config: SkillConfig, _skillLv: number = 1) {
|
||||
if (!target.ent) return;
|
||||
const model = target.ent.get(HeroAttrsComp);
|
||||
@@ -570,6 +577,8 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
_cAttrsComp.ap,
|
||||
Object.keys(buffOverrides).length > 0 ? buffOverrides : undefined
|
||||
);
|
||||
// 播放计时 buff 增益特效:按修饰属性区分(攻击提升/攻速提升/其他)
|
||||
target.playEnd(this.resolveBuffEndAnm(BuffList[config.timed_buff_id]?.modifiers?.[0]?.attr));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -577,6 +586,9 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
// buff 强化(buff_power,百分点):辅助专精天赋写入,按施法者放大永久 buff 数值
|
||||
const totalBuffValue = config.ap * (1 + _cAttrsComp.buff_power / 100);
|
||||
|
||||
// 播放永久 buff 增益特效:按 buff 属性区分(攻击提升/攻速提升/其他)
|
||||
target.playEnd(this.resolveBuffEndAnm(config.buff_type));
|
||||
|
||||
switch (config.buff_type) {
|
||||
case Attrs.ap: {
|
||||
// 攻击力按基础 ap 的百分比提升
|
||||
|
||||
Reference in New Issue
Block a user