feat: 实现英雄局外成长系统

1. 新增GameEvent事件枚举HERO_GROWTH_UPDATE
2. 新增英雄局外升级所需碎片配置表
3. 新增英雄局外成长数据持久化与相关工具方法
4. 重构英雄卡片等级逻辑,统一使用局外成长等级
5. 更新英雄设计文档与相关注释
This commit is contained in:
pan
2026-08-17 10:01:42 +08:00
parent d34085aa04
commit 2eb4257dae
8 changed files with 98 additions and 19 deletions

View File

@@ -271,11 +271,14 @@ export class CHeroComp extends CCComp {
});
}
// 等级标签(★ 表示卡牌等级;升级卡显示英雄目标等级)
// 等级标签(★ 表示卡牌等级;升级卡显示英雄目标等级;普通英雄卡显示局外等级
if (this.level_label) {
if (isUpgradeCard) {
const heroLv = Math.max(1, this.cardData.hero_lv ?? 1);
this.level_label.string = heroLv > 1 ? `Lv.${heroLv - 1} -> Lv.${heroLv}` : `Lv.${heroLv}`;
} else if (this.cardData.type === CardType.Hero) {
const heroLv = smc.getHeroOuterLv(this.cardData.uuid);
this.level_label.string = heroLv > 1 ? `Lv.${heroLv}` : "";
} else {
const lv = this.cardData.card_lv ?? 1;
this.level_label.string = lv >= 2 ? "★".repeat(lv - 1) : "";
@@ -581,7 +584,7 @@ export class CHeroComp extends CCComp {
cancel: false,
reason: "",
uuid: this.cardData.uuid,
hero_lv: this.cardData.hero_lv ?? 1,
hero_lv: smc.getHeroOuterLv(this.cardData.uuid),
card_lv: this.cardData.base_card_lv ?? this.cardData.card_lv ?? 1
};
oops.message.dispatchEvent(GameEvent.UseHeroCard, guard);