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

@@ -53,7 +53,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
heroView?: HeroViewComp,
triggerType?: string,
isCardSkill?: boolean,
card_lv?: number,
rarity?: number,
targetPos?: Vec3,
overrides?: any
}) {
@@ -61,7 +61,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
// 卡牌技能直接触发
if (args.isCardSkill) {
this.forceCastCardSkill(args.s_uuid, args.card_lv || 1, args.targetPos || new Vec3(FightSet.CSKILL_START_X, FightSet.CSKILL_START_Y, 0), args.overrides);
this.forceCastCardSkill(args.s_uuid, args.rarity || 1, args.targetPos || new Vec3(FightSet.CSKILL_START_X, FightSet.CSKILL_START_Y, 0), args.overrides);
return;
}
@@ -74,7 +74,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
* 强制执行卡牌技能
* 卡牌技能没有施法者主体,直接从指定坐标释放,或者对全体/随机友方生效
*/
public forceCastCardSkill(s_uuid: number, cardLv: number, spawnPos: Vec3, overrides?: SkillOverrides) {
public forceCastCardSkill(s_uuid: number, rarity: number, spawnPos: Vec3, overrides?: SkillOverrides) {
let config = SkillSet[s_uuid];
if (!config) return;
config = mergeSkillParams(config, overrides);
@@ -102,7 +102,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
// 动态计算卡牌的虚拟攻击力:
// 1. 根据卡牌等级给予基础成长(同英雄升级公式,基准设为 100)
let baseAp = 100 * Math.pow(FightSet.HERO_LV_MULTIPLIER, cardLv - 1);
let baseAp = 100 * Math.pow(FightSet.HERO_LV_MULTIPLIER, rarity - 1);
let highestAp = baseAp;
// 2. 获取场上最高攻击力的英雄,保证后期奶量/增益绝对够用
@@ -156,10 +156,10 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
const friendlyTargets = this.resolveFriendlyTargets(targetEids, FacSet.HERO);
mLogger.log(this.debugMode, "SCastSystem", "friendlyTargets count =", friendlyTargets.length);
if (friendlyTargets.length === 0) return;
this.applyFriendlySkillEffects(s_uuid, cardLv, config, null as any, mockAttrs, friendlyTargets, spawnPos);
this.applyFriendlySkillEffects(s_uuid, rarity, config, null as any, mockAttrs, friendlyTargets, spawnPos);
} else {
const enemyTargetPos = this.resolveRepeatCastTargetPos(targetPos, i);
this.createSkillEntityForCard(s_uuid, cardLv, mockAttrs, spawnPos, enemyTargetPos, i, overrides);
this.createSkillEntityForCard(s_uuid, rarity, mockAttrs, spawnPos, enemyTargetPos, i, overrides);
}
};
if (i === 0) {