feat: 为召唤和死亡触发技能添加动画效果
- 在 Hero、Monster 和 HeroAtkSystem 中分发技能触发事件时,增加 triggerType 参数以区分召唤和死亡 - 修改 SCastSystem 的 forceCastTriggerSkill 方法,根据 triggerType 播放对应的准备动画(黄色表示召唤,死亡动画表示死亡) - 调整 hnode.prefab 中按钮的布局和样式,移除特定精灵帧以使用默认样式
This commit is contained in:
@@ -40,9 +40,9 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
oops.message.off(GameEvent.TriggerSkill, this.onTriggerSkill, this);
|
||||
}
|
||||
|
||||
private onTriggerSkill(event: string, args: { s_uuid: number, heroAttrs: HeroAttrsComp, heroView: HeroViewComp }) {
|
||||
private onTriggerSkill(event: string, args: { s_uuid: number, heroAttrs: HeroAttrsComp, heroView: HeroViewComp, triggerType?: string }) {
|
||||
if (!args || !args.s_uuid || !args.heroAttrs || !args.heroView) return;
|
||||
this.forceCastTriggerSkill(args.s_uuid, args.heroAttrs, args.heroView);
|
||||
this.forceCastTriggerSkill(args.s_uuid, args.heroAttrs, args.heroView, args.triggerType);
|
||||
}
|
||||
/** 空施法计划:用于“当前无可施法技能”时的统一返回 */
|
||||
private readonly emptyCastPlan = { skillId: 0, skillLv: 1, isFriendly: false, targetPos: null as Vec3 | null, targetEids: [] as number[] };
|
||||
@@ -95,7 +95,14 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
* 强制执行触发技能(召唤/死亡触发)
|
||||
* 忽略CD、状态、动画前摇,直接生效
|
||||
*/
|
||||
public forceCastTriggerSkill(s_uuid: number, heroAttrs: HeroAttrsComp, heroView: HeroViewComp) {
|
||||
public forceCastTriggerSkill(s_uuid: number, heroAttrs: HeroAttrsComp, heroView: HeroViewComp, triggerType?: string) {
|
||||
// 播放相应的触发动画
|
||||
if (triggerType === 'call') {
|
||||
heroView.playReady("yellow");
|
||||
} else if (triggerType === 'dead') {
|
||||
heroView.playReady("dead");
|
||||
}
|
||||
|
||||
// 如果是敌方攻击技能,必须在战斗中才能释放;友方增益/护盾则允许在非战斗中释放
|
||||
const config = SkillSet[s_uuid];
|
||||
if (!config) return;
|
||||
|
||||
Reference in New Issue
Block a user