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

@@ -4,7 +4,7 @@
*
* 职责:
* 1. 根据英雄 UUID 渲染 **图标**(idle 动画首帧静态展示,零运行时动画开销)。
* 2. 根据 HeroInfo.card_lv 切换 **背景底框颜色**(BG_node 下的 green/blue/purple/yellow/red 子节点)。
* 2. 根据 HeroInfo.rarity 切换 **背景底框颜色**(BG_node 下的 green/blue/purple/yellow/red 子节点)。
*
* 说明:
* - 仅处理英雄展示,数据源为 heroSet 的 HeroInfo,不依赖 CardSet。
@@ -16,7 +16,7 @@ import { _decorator, AnimationClip, Node, Sprite, resources, SpriteFrame } from
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { HeroInfo } from "../common/config/heroSet";
import { CARD_LV_BG_COLORS } from "../common/config/GameSet";
import { RARITY_BG_COLORS } from "../common/config/GameSet";
const { ccclass, property } = _decorator;
@@ -55,9 +55,9 @@ export class ChipComp extends CCComp {
this.node.active = true;
this.iconVisualToken += 1;
// 背景:按 card_lv 切换颜色底框(green/blue/purple/yellow/red)
// 背景:按 rarity 切换颜色底框(green/blue/purple/yellow/red)
if (this.BG_node) {
const color = CARD_LV_BG_COLORS[Math.min(Math.max(hero.card_lv ?? 1, 1), 5) - 1];
const color = RARITY_BG_COLORS[Math.min(Math.max(hero.rarity ?? 1, 1), 5) - 1];
this.BG_node.children.forEach(child => child.active = (child.name === color));
}