feat: 新增卡牌等级系统并调整英雄合成规则

- 在 HeroAttrsComp 中添加 card_lv 属性,用于独立记录卡牌等级
- 修改 Hero 加载逻辑,支持传入 card_lv 参数
- 更新 HInfoComp 的 UI 刷新逻辑,根据英雄等级和卡牌等级显示不同的边框和等级图标
- 调整 MissionHeroComp 的合成规则:所需合成数量从 2 改为 3,最高合成等级从 3 改为 2
- 在召唤队列和合成流程中传递并处理 card_lv 数据,确保卡牌等级在合成过程中得以保留
This commit is contained in:
panw
2026-04-02 16:40:23 +08:00
parent a14513dcdf
commit 781e88e2d7
6 changed files with 41 additions and 32 deletions

View File

@@ -50,7 +50,19 @@ export class HInfoComp extends CCComp {
refresh() {
if (!this.model) return;
this.updateLevelUI();
const isHighLevel = (this.model.lv ?? 0) > 1;
if (this.HF_node) this.HF_node.active = isHighLevel;
if (this.NF_node) this.NF_node.active = !isHighLevel;
const activeFrameNode = isHighLevel ? this.HF_node : this.NF_node;
if (activeFrameNode) {
const cardLvStr = `lv${this.model.card_lv ?? 1}`;
activeFrameNode.children.forEach(child => {
child.active = (child.name === cardLvStr);
});
}
const heroUuid = this.model.hero_uuid ?? 0;
if (heroUuid !== this.iconHeroUuid) {
this.iconHeroUuid = heroUuid;
@@ -87,16 +99,7 @@ export class HInfoComp extends CCComp {
return current.getComponent(Label) || current.getComponentInChildren(Label);
}
private updateLevelUI() {
if (!this.model) return;
const lvNode = this.node.getChildByName("lv");
if (!lvNode) return;
lvNode.active = true
const lv2 = lvNode.getChildByName("lv2");
if (lv2) lv2.active = this.model.lv >= 2;
const lv3 = lvNode.getChildByName("lv3");
if (lv3) lv3.active = this.model.lv >= 3;
}
private updateHeroAnimation(node: Node, uuid: number, token: number) {
if (!node) return;