refactor(游戏配置): 调整英雄配置和游戏平衡参数

- 更新英雄配置文档,完善战士技能描述
- 修改英雄升级和合并相关参数
- 移除后退相关逻辑和配置
- 重构卡牌显示逻辑,优化UI组件管理
This commit is contained in:
walkpan
2026-04-21 21:05:05 +08:00
parent 183fe111ef
commit 9363f8f1d7
5 changed files with 2532 additions and 99 deletions

View File

@@ -665,33 +665,41 @@ export class CardComp extends CCComp {
this.node.setPosition(targetX, targetY, this.restPosition.z);
// ---- 卡牌种类标识(近战 / 远程 / 辅助等) ----
// if (this.Ckind_node) {
// const kindName = CKind[this.cardData.kind];
// this.Ckind_node.children.forEach(child => {
// child.active = (child.name === kindName);
// });
// }
const kindName = CKind[this.cardData.kind];
// ---- 背景底框(按卡池等级显示对应子节点) ----
const cardLvStr = `lv${this.cardData.pool_lv}`;
// ---- 背景底框与高级边框(现在按 Ckind 显示对应子节点) ----
if (this.BG_node) {
this.BG_node.children.forEach(child => {
child.active = (child.name === cardLvStr);
child.active = (child.name === kindName);
});
}
// ---- 品质边框(高级 vs 普通) ----
const card_lv_val = this.cardData.card_lv ?? 1;
const isHighLevel = (this.cardData.hero_lv ?? 0) > 1 || card_lv_val > 1;
if (this.HF_node) this.HF_node.active = isHighLevel;
if (this.NF_node) this.NF_node.active = !isHighLevel;
this.node.getChildByName("HB").active = isHighLevel;
const activeFrameNode = isHighLevel ? this.HF_node : this.NF_node;
if (activeFrameNode) {
activeFrameNode.children.forEach(child => {
child.active = (child.name === cardLvStr);
if (this.HF_node) {
this.HF_node.active = true;
this.HF_node.children.forEach(child => {
child.active = (child.name === kindName);
});
}
if (this.NF_node) {
this.NF_node.active = false;
}
const hbNodeUI = this.node.getChildByName("HB");
if (hbNodeUI) hbNodeUI.active = false;
// ---- 卡牌等级标识 ----
const cardLvStr = `lv${this.cardData.pool_lv}`;
if (this.lv_node) {
this.lv_node.children.forEach(child => {
if (child.name === "light") {
child.active = false;
} else if (child.name === "bg") {
child.active = true;
} else {
child.active = (child.name === cardLvStr);
}
});
if(isHighLevel){activeFrameNode.getChildByName("light").active=true}
}
// ---- 按卡牌类型渲染具体内容 ----
@@ -720,6 +728,23 @@ export class CardComp extends CCComp {
});
}
if (this.lv_node) {
const lvTrans = this.lv_node.getComponent(UITransform);
if (lvTrans) {
lvTrans.setContentSize(this.isEnlarged ? 230 : 170, this.isEnlarged ? 300 : 230);
const widget = this.lv_node.getComponent(Widget);
if (widget) widget.updateAlignment();
}
this.lv_node.children.forEach(child => {
const childTrans = child.getComponent(UITransform);
if (childTrans) {
childTrans.setContentSize(this.isEnlarged ? 230 : 170, this.isEnlarged ? 300 : 230);
const widget = child.getComponent(Widget);
if (widget) widget.updateAlignment();
}
});
}
if (this.HF_node) {
const hfTrans = this.HF_node.getComponent(UITransform);
if (hfTrans) {
@@ -830,7 +855,17 @@ export class CardComp extends CCComp {
}
// ---- 费用标签 ----
this.setLabel(this.cost_node, `${this.card_cost}`);
if (this.card_type === CardType.Hero) {
if (this.cost_node) this.cost_node.active = false;
} else {
if (this.cost_node) {
this.cost_node.active = true;
const numNode = this.cost_node.getChildByName("num");
if (numNode) {
this.setLabel(numNode, `${this.card_cost}`);
}
}
}
// ---- 名字节点位置调整 ----
if (this.name_node) {
@@ -945,6 +980,22 @@ export class CardComp extends CCComp {
}
});
}
if (this.lv_node) {
const lvTrans = this.lv_node.getComponent(UITransform);
if (lvTrans) {
lvTrans.setContentSize(170, 230);
const widget = this.lv_node.getComponent(Widget);
if (widget) widget.updateAlignment();
}
this.lv_node.children.forEach(child => {
const childTrans = child.getComponent(UITransform);
if (childTrans) {
childTrans.setContentSize(170, 230);
const widget = child.getComponent(Widget);
if (widget) widget.updateAlignment();
}
});
}
if (this.HF_node) {
const hfTrans = this.HF_node.getComponent(UITransform);
if (hfTrans) {
@@ -1002,7 +1053,12 @@ export class CardComp extends CCComp {
}
this.iconVisualToken += 1;
this.setLabel(this.name_node, "");
this.setLabel(this.cost_node, "");
if (this.cost_node) {
const numNode = this.cost_node.getChildByName("num");
if (numNode) {
this.setLabel(numNode, "");
}
}
if (this.info_node) this.info_node.active = false;
if (this.oinfo_node) this.oinfo_node.active = false;
// if (this.Ckind_node) {
@@ -1013,8 +1069,15 @@ export class CardComp extends CCComp {
if (this.BG_node) {
this.BG_node.children.forEach(child => child.active = false);
}
if (this.HF_node) this.HF_node.active = false;
if (this.HF_node) {
this.HF_node.active = false;
this.HF_node.children.forEach(child => child.active = false);
}
if (this.NF_node) this.NF_node.active = false;
if (this.lv_node) {
this.lv_node.children.forEach(child => child.active = false);
}
if (this.cost_node) this.cost_node.active = false;
this.clearIconAnimation(this.icon_node as Node);
const sprite = this.icon_node?.getComponent(Sprite) || this.icon_node?.getComponentInChildren(Sprite);
if (sprite) sprite.spriteFrame = null;