feat: 实现战斗准备阶段英雄复活与入场动画

在准备阶段开始时,通过 PhasePrepareStart 事件触发英雄状态重置:
- 死亡英雄复活并恢复满血,播放下落入场动画
- 英雄实体在死亡时移至墓地并禁用碰撞,避免战斗逻辑干扰
- 更新英雄数量UI以反映复活后的状态
This commit is contained in:
panw
2026-04-22 17:05:34 +08:00
parent e230feab14
commit a65a26b0bc
5 changed files with 81 additions and 24 deletions

View File

@@ -264,7 +264,8 @@ export class MissionCardComp extends CCComp {
this.on(GameEvent.MissionEnd, this.onMissionEnd, this);
this.on(GameEvent.NewWave, this.onNewWave, this);
this.on(GameEvent.FightStart, this.onFightStart, this);
/** 全局消息事件 */
this.on("PhasePrepareStart", this.onPhasePrepareStart, this);
oops.message.on(GameEvent.CoinAdd, this.onCoinAdd, this);
oops.message.on(GameEvent.MasterCalled, this.onMasterCalled, this);
oops.message.on(GameEvent.HeroDead, this.onHeroDead, this);
@@ -337,6 +338,10 @@ export class MissionCardComp extends CCComp {
this.updatePoolLvUI();
}
private onPhasePrepareStart() {
this.updateHeroNumUI(true, true);
}
/** 新一波:展开面板 → 刷新费用 UI → 重新抽卡分发 */
private onNewWave() {
this.isBattlePhase = false;