refactor(skill): 统一驻场光环的命名展示逻辑
1. 为驻场光环技能添加带"光环"后缀的统一命名,便于玩家识别 2. 新增触发技能名称获取函数,支持高阶光环回退基础命名 3. 重构技能描述构建逻辑,使用英雄语境专属命名覆盖默认名称
This commit is contained in:
@@ -210,12 +210,13 @@ function buildEffectLine(head: string, skill: SkillConfig): ISkillLine {
|
||||
* 为 key 查标准动词,数值按 fmt(比例/整数/减免)从 value 实时渲染。
|
||||
*
|
||||
* @param showName 是否在行中包含「技能名」片段(英雄面板需要,装备商店不需要)
|
||||
* @param nameOverride 技能名覆盖(英雄语境传入 heroSet 语境专属命名,缺省用 FieldSkillSet 通用名)
|
||||
*/
|
||||
function buildFieldLine(head: string, uuid: number, showName: boolean = true): ISkillLine | null {
|
||||
function buildFieldLine(head: string, uuid: number, showName: boolean = true, nameOverride?: string): ISkillLine | null {
|
||||
const fs = FieldSkillSet[uuid];
|
||||
if (!fs) return null;
|
||||
const desc = FieldDescSet[fs.type];
|
||||
const nameSeg = showName ? `「${fs.name}」 ` : "";
|
||||
const nameSeg = showName ? `「${nameOverride ?? fs.name}」 ` : "";
|
||||
// 未入表类型回退基础备注 info,整行不高亮
|
||||
if (!desc) return { prefix: `${head}${nameSeg}${fs.info}`, value: "", suffix: "" };
|
||||
|
||||
@@ -569,12 +570,11 @@ export function buildSkillDescMoreRich(source: ISkillDescSource): string {
|
||||
}
|
||||
}
|
||||
|
||||
// 驻场光环(field)
|
||||
// 驻场光环(field):直接以技能名开头,技能名走 heroSet 语境专属命名(如「战歌祝福」)
|
||||
const fieldEntries = source[SkillTriggerType.Field] as LvFieldEntry[] | undefined;
|
||||
if (fieldEntries?.length) {
|
||||
const tpl = SkillTriggerName[SkillTriggerType.Field] ?? "光环";
|
||||
for (const uuid of resolveFieldByLv(fieldEntries, lv)) {
|
||||
const line = buildFieldLine(`${tpl}: `, uuid, true);
|
||||
const line = buildFieldLine("", uuid, true, getTriggerSkillName(SkillTriggerType.Field, uuid));
|
||||
if (line) lines.push(effectRich(line));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user