refactor: 将代码中的card_lv统一替换为rarity

本次提交完成了全项目范围内术语的统一替换,将原本指代卡牌品质/等级的card_lv字段全部重命名为rarity,对齐了设计文档中的命名规范,避免了术语混淆:
1.  更新了所有配置文件、组件类、数据结构中的字段定义
2.  同步修改了注释、文档说明中的相关表述
3.  修正了英雄、技能、装备卡牌的品质显示逻辑
4.  调整了背景颜色切换、属性计算等相关业务逻辑
This commit is contained in:
pan
2026-09-02 16:42:54 +08:00
parent 6620b67103
commit d9bccd7c93
36 changed files with 312 additions and 312 deletions

View File

@@ -82,7 +82,7 @@ export class EquipBoxComp extends CCComp {
/** 技能 UUID */
private s_uuid: number = 0;
/** 卡牌等级 */
private card_lv: number = 1;
private rarity: number = 1;
/** 是否为即时技能(true=使用后立即触发,false=战斗中定时触发) */
private is_instant: boolean = true;
/** 总触发次数 */
@@ -245,10 +245,10 @@ export class EquipBoxComp extends CCComp {
* 3. 按 trigger_type 注册对应事件监听并执行首次触发。
*
* @param uuid 卡牌 UUID
* @param card_lv 技能卡等级
* @param rarity 技能卡等级
*/
init(uuid: number, card_lv: number) {
this.card_lv = card_lv;
init(uuid: number, rarity: number) {
this.rarity = rarity;
// 装备卡配置已迁移至 EquipPoolList
const config = EquipPoolList.find(c => c.uuid === uuid);
@@ -381,9 +381,9 @@ export class EquipBoxComp extends CCComp {
/**
* 根据技能等级切换 bg_node 下的颜色子节点显示。
* 等级与颜色对应关系(技能卡 wave 档位):
* card_lv 1 (wave 1) → green
* card_lv 2 (wave 5) → blue
* card_lv 3 (wave 8) → purple
* rarity 1 (wave 1) → green
* rarity 2 (wave 5) → blue
* rarity 3 (wave 8) → purple
*/
private updateBgNode() {
if (!this.bg_node) return;
@@ -392,7 +392,7 @@ export class EquipBoxComp extends CCComp {
2: "blue",
3: "purple",
};
const targetColor = lvToColor[this.card_lv];
const targetColor = lvToColor[this.rarity];
this.bg_node.children.forEach(child => {
child.active = (child.name === targetColor);
});
@@ -625,7 +625,7 @@ export class EquipBoxComp extends CCComp {
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
s_uuid: this.s_uuid,
isCardSkill: true, // 标记为卡牌技能(区别于英雄自身技能)
card_lv: this.card_lv,
rarity: this.rarity,
targetPos: targetPos,
overrides: this.overrides
});