feat(关卡): 添加英雄数量上限机制
- 在 MissionCardComp 中添加英雄数量显示与上限控制逻辑 - 当英雄数量达到上限时禁止使用英雄卡牌 - 英雄死亡时减少当前英雄计数并刷新显示 - 添加英雄数量变化的动画反馈效果 - 移除 SingletonModuleComp 中未使用的 unlockCoin 字段
This commit is contained in:
@@ -196,6 +196,16 @@ export class BattleEntityLifecycleSystem extends ecs.ComblockSystem
|
||||
const label = this.resolveLabel(heroAttrs);
|
||||
if (heroAttrs) {
|
||||
mLogger.log(heroAttrs.debugMode, 'BattleEntityLifecycle', `${label}离开世界: ${heroAttrs.hero_name}`);
|
||||
if (heroAttrs.fac === FacSet.HERO) {
|
||||
const missionData = smc.vmdata?.mission_data;
|
||||
if (missionData) {
|
||||
missionData.hero_num = Math.max(0, (missionData.hero_num ?? 0) - 1);
|
||||
}
|
||||
oops.message.dispatchEvent(GameEvent.HeroDead, {
|
||||
eid: e.eid,
|
||||
model: heroAttrs
|
||||
});
|
||||
}
|
||||
} else {
|
||||
mLogger.log(true, 'BattleEntityLifecycle', `${label}离开世界: 实体ID ${e.eid}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user