refactor: 调整卡牌等级逻辑,新增基础池等级字段
1. 新增base_pool_lv字段存储英雄初始池等级 2. 替换多处直接使用pool_lv的逻辑,优先使用base_pool_lv 3. 移除预制体中废弃的pool_lv_node节点
This commit is contained in:
@@ -548,7 +548,7 @@ export class CardComp extends CCComp {
|
||||
this.isLongPressed = true;
|
||||
const heroUuid = this.card_uuid;
|
||||
const heroLv = Math.max(1, this.cardData.hero_lv ?? 1);
|
||||
const poolLv = Math.max(1, this.cardData.pool_lv ?? 1);
|
||||
const poolLv = Math.max(1, this.cardData.base_pool_lv ?? this.cardData.pool_lv ?? 1);
|
||||
oops.gui.remove(UIID.HInfo);
|
||||
oops.gui.open(UIID.HInfo, { heroUuid, heroLv, poolLv });
|
||||
}
|
||||
@@ -607,10 +607,11 @@ export class CardComp extends CCComp {
|
||||
const kindName = CKind[this.cardData.kind];
|
||||
|
||||
if (this.BG_node) {
|
||||
const bgLv = this.cardData.base_pool_lv ?? this.cardData.pool_lv;
|
||||
this.BG_node.children.forEach(child => {
|
||||
child.active = (child.name === kindName);
|
||||
const bg = child.getComponent(CardBgComp);
|
||||
if (bg) child.active ? bg.apply(this.cardData.pool_lv) : bg.clear();
|
||||
if (bg) child.active ? bg.apply(bgLv) : bg.clear();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user