refactor(hero): 调整英雄描述展示为满级效果
修改英雄能力描述的数据源等级为5级,展示满级能力信息;移除技能名后的档位后缀,统一文案展示规则。
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -598,24 +598,18 @@ export function buildSkillDescMoreRich(source: ISkillDescSource): string {
|
|||||||
const curTrig = needCount
|
const curTrig = needCount
|
||||||
? `${trigName}${valueRich(cur.t_num)}次`
|
? `${trigName}${valueRich(cur.t_num)}次`
|
||||||
: trigName;
|
: trigName;
|
||||||
// 技能名 + 档位数字后缀(如 "不屈壁垒1"),与光环命名口径一致
|
// 技能名直接展示,不附加档位数字后缀(由 lv 字段控制生效档,玩家无需关注内部档号)
|
||||||
const curHead = `「${skillName}${curSLv}」: ${curTrig}, `;
|
const curHead = `「${skillName}」: ${curTrig}, `;
|
||||||
lines.push(effectRich(buildEffectLine(curHead, mergeSkillParams(base, cur.overrides))));
|
lines.push(effectRich(buildEffectLine(curHead, mergeSkillParams(base, cur.overrides))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 驻场光环(field):技能名带档位数字后缀(按 lv 档升序,1 起始),便于玩家识别成长
|
// 驻场光环(field):直接展示技能名,不附加档位数字后缀
|
||||||
const fieldEntries = source[SkillTriggerType.Field] as LvFieldEntry[] | undefined;
|
const fieldEntries = source[SkillTriggerType.Field] as LvFieldEntry[] | undefined;
|
||||||
if (fieldEntries?.length) {
|
if (fieldEntries?.length) {
|
||||||
// 按 lv 升序确定当前生效档的序号(1 起始),作为技能名后缀
|
|
||||||
const sorted = [...fieldEntries].sort((a, b) => a.lv - b.lv);
|
|
||||||
let tier = 1;
|
|
||||||
for (let i = 0; i < sorted.length; i++) {
|
|
||||||
if (sorted[i].lv <= lv) tier = i + 1;
|
|
||||||
}
|
|
||||||
for (const entry of resolveFieldByLv(fieldEntries, lv)) {
|
for (const entry of resolveFieldByLv(fieldEntries, lv)) {
|
||||||
const baseName = getTriggerSkillName(SkillTriggerType.Field, entry.uuid);
|
const baseName = getTriggerSkillName(SkillTriggerType.Field, entry.uuid);
|
||||||
const line = buildFieldLine("", entry, true, `${baseName}${tier}`);
|
const line = buildFieldLine("", entry, true, baseName);
|
||||||
if (line) lines.push(effectRich(line));
|
if (line) lines.push(effectRich(line));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ export class CHeroComp extends CCComp {
|
|||||||
// 背景:按 card_lv 激活对应颜色子节点(1→green 2→blue 3→purple 4→red 5→yellow)
|
// 背景:按 card_lv 激活对应颜色子节点(1→green 2→blue 3→purple 4→red 5→yellow)
|
||||||
this.updateBgNode();
|
this.updateBgNode();
|
||||||
|
|
||||||
// 描述富文本:不再单独手写 info,统一套用英雄 1 级能力介绍(buildSkillDescMoreRich)
|
// 描述富文本:统一套用英雄 5 级能力介绍(buildSkillDescMoreRich)
|
||||||
// 与英雄信息弹窗/升级确认框同一套文案规则,杜绝手写文案与数值漂移
|
// 与英雄信息弹窗/升级确认框同一套文案规则,杜绝手写文案与数值漂移
|
||||||
// outlineRich 为整段富文本包裹描边,提升深色面板可读性
|
// outlineRich 为整段富文本包裹描边,提升深色面板可读性
|
||||||
if (this.info_rich) {
|
if (this.info_rich) {
|
||||||
@@ -467,14 +467,14 @@ export class CHeroComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构造英雄 1 级能力描述数据源(ISkillDescSource)。
|
* 构造英雄 5 级能力描述数据源(ISkillDescSource)。
|
||||||
* lv 恒为 1,由各 resolver 取 1 级生效档,与英雄信息弹窗初始展示口径一致。
|
* lv 恒为 5,由各 resolver 取 5 级生效档,展示英雄满级能力信息。
|
||||||
* @param hero HeroInfo 静态配置项
|
* @param hero HeroInfo 静态配置项
|
||||||
* @returns 描述数据源
|
* @returns 描述数据源
|
||||||
*/
|
*/
|
||||||
private buildHeroDescSource(hero: typeof HeroInfo[number]): ISkillDescSource {
|
private buildHeroDescSource(hero: typeof HeroInfo[number]): ISkillDescSource {
|
||||||
return {
|
return {
|
||||||
lv: 1,
|
lv: 5,
|
||||||
call: hero.call,
|
call: hero.call,
|
||||||
dead: hero.dead,
|
dead: hero.dead,
|
||||||
fstart: hero.fstart,
|
fstart: hero.fstart,
|
||||||
|
|||||||
Reference in New Issue
Block a user