refactor: 将代码中的card_lv统一替换为rarity
本次提交完成了全项目范围内术语的统一替换,将原本指代卡牌品质/等级的card_lv字段全部重命名为rarity,对齐了设计文档中的命名规范,避免了术语混淆: 1. 更新了所有配置文件、组件类、数据结构中的字段定义 2. 同步修改了注释、文档说明中的相关表述 3. 修正了英雄、技能、装备卡牌的品质显示逻辑 4. 调整了背景颜色切换、属性计算等相关业务逻辑
This commit is contained in:
@@ -145,16 +145,16 @@ export class MissEquipComp extends CCComp {
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理使用装备卡事件:提取 uuid 和 card_lv 后调用 addEquip。
|
||||
* 处理使用装备卡事件:提取 uuid 和 rarity 后调用 addEquip。
|
||||
* @param event 事件名
|
||||
* @param args 卡牌数据(含 uuid、card_lv)
|
||||
* @param args 卡牌数据(含 uuid、rarity)
|
||||
*/
|
||||
private onUseEquipCard(event: string, args: any) {
|
||||
const payload = args ?? event;
|
||||
const uuid = Number(payload?.uuid ?? 0);
|
||||
const card_lv = Math.max(1, Math.floor(Number(payload?.card_lv ?? 1)));
|
||||
const rarity = Math.max(1, Math.floor(Number(payload?.rarity ?? 1)));
|
||||
if (!uuid) return;
|
||||
this.addSkill(uuid, card_lv);
|
||||
this.addSkill(uuid, rarity);
|
||||
}
|
||||
|
||||
start() {
|
||||
@@ -168,9 +168,9 @@ export class MissEquipComp extends CCComp {
|
||||
* 3. 获取或添加 EquipBoxComp 并初始化。
|
||||
*
|
||||
* @param uuid 装备 UUID
|
||||
* @param card_lv 装备卡等级
|
||||
* @param rarity 装备卡等级
|
||||
*/
|
||||
addSkill(uuid: number, card_lv: number) {
|
||||
addSkill(uuid: number, rarity: number) {
|
||||
if (!this.equip_box) {
|
||||
mLogger.error(this.debugMode, "MissEquipComp", "equip_box prefab not set");
|
||||
return;
|
||||
@@ -190,7 +190,7 @@ export class MissEquipComp extends CCComp {
|
||||
|
||||
// 使用 ECS 实体创建装备节点,挂载到对应 ebar 子节点下
|
||||
let ebox = ecs.getEntity<EBox>(EBox);
|
||||
let node = ebox.load(uuid, card_lv, Vec3.ZERO, this.equip_box, this.ebars_node.children[emptyIndex]);
|
||||
let node = ebox.load(uuid, rarity, Vec3.ZERO, this.equip_box, this.ebars_node.children[emptyIndex]);
|
||||
|
||||
this.slots[emptyIndex].used = true;
|
||||
this.slots[emptyIndex].node = node;
|
||||
|
||||
Reference in New Issue
Block a user