diff --git a/assets/script/game/common/HeroSkillText.ts b/assets/script/game/common/HeroSkillText.ts index 8e5799ed..000db48b 100644 --- a/assets/script/game/common/HeroSkillText.ts +++ b/assets/script/game/common/HeroSkillText.ts @@ -216,7 +216,7 @@ export function buildHeroSkillDesc(heroUuid: number, showName: boolean = true, s const val = desc.fmt === FieldValueFmt.Percent ? `+${Math.round(entry.value * 100)}%` : desc.fmt === FieldValueFmt.IntMinus ? `-${entry.value}` : `+${entry.value}`; - lines.push(`${nameSeg(getFieldSkillName(entry.uuid))}${desc.verb}${valueRich(val)}`); + lines.push(`${nameSeg(getFieldSkillName(hero, entry.uuid))}${desc.verb}${valueRich(val)}`); } // ---- 复活(revive):次数复刻战斗公式 r_num + floor((lv-1)*upr) ---- @@ -224,7 +224,7 @@ export function buildHeroSkillDesc(heroUuid: number, showName: boolean = true, s if (revive) { const count = revive.r_num + Math.floor((lv - 1) * revive.upr); const hpPct = SkillSet[revive.s_uuid]?.ap ?? 0; - lines.push(`${nameSeg(getReviveSkillName())}每回合可复活${valueRich(count)}次, 死亡后以${valueRich(`${Math.round(hpPct)}%`)}生命原地重生`); + lines.push(`${nameSeg(getReviveSkillName(hero, revive.s_uuid))}每回合可复活${valueRich(count)}次, 死亡后以${valueRich(`${Math.round(hpPct)}%`)}生命原地重生`); } return lines.join("\n"); @@ -548,13 +548,13 @@ function resolveTriggerSkillName(hero: heroInfo, skillUuid: number): string { const grouped = hero[type] as TriggerGrouped | undefined; if (grouped?.[skillUuid]?.length) return getGroupedTriggerName(grouped, skillUuid); } - // 驻场光环:词条名取 FieldSkillSet + // 驻场光环:词条名取英雄语境(FieldEntry.name 优先,回退 FieldSkillSet 底座名) if (hero.field?.some(e => e.uuids.some(u => u.uuid === skillUuid))) { - return getFieldSkillName(skillUuid); + return getFieldSkillName(hero, skillUuid); } - // 复活技能:统一复活称谓 + // 复活技能:名称取英雄语境(LvReviveEntry.name 优先,回退固定称谓) if (hero.revive?.some(e => e.s_uuid === skillUuid)) { - return getReviveSkillName(); + return getReviveSkillName(hero, skillUuid); } return SkillSet[skillUuid]?.name ?? ""; } diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index 43b1d920..401b3e9e 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -1,4 +1,4 @@ -import { v3 } from "cc" +import { v3 } from "cc" import { BoxSet, FacSet, FightSet } from "./GameSet" import { SkillOverrides, TGroup, SkillSet, FieldSkillSet, SkillConfig, SkillKind, FieldSkillConfig, FieldSkillType, mergeSkillParams } from "./SkillSet" import { BuffList, BuffConfig, ModOp } from "./BuffSet" @@ -238,18 +238,29 @@ export function getGroupedTriggerName(grouped: TriggerGrouped | undefined, s_uui } /** - * 查询驻场光环词条的对外展示名(英雄语境,FieldSkillSet 底座名已自带"光环"后缀)。 + * 查询驻场光环词条的对外展示名(英雄语境,FieldEntry.name 优先,缺省回退 FieldSkillSet 底座名)。 + * Why: 名称收敛进 heroSet 英雄配置,同一光环词条(如 7002 攻击光环)在不同英雄下可有特色名。 + * @param hero 英雄配置(含 field 词条的 heroInfo) * @param uuid 光环 uuid(指向 FieldSkillSet 底座) */ -export function getFieldSkillName(uuid: number): string { +export function getFieldSkillName(hero: heroInfo | undefined, uuid: number): string { + for (const e of hero?.field ?? []) { + const entry = e.uuids.find(u => u.uuid === uuid); + if (entry?.name) return entry.name; + } return FieldSkillSet[uuid]?.name ?? ""; } /** - * 查询复活技能的对外展示名(英雄语境,固定"凤凰涅槃")。 - * 复活底座 6501 在英雄语境下统一为涅槃语义,不暴露 SkillSet 内部名。 + * 查询复活技能的对外展示名(英雄语境,LvReviveEntry.name 优先,缺省回退固定称谓"凤凰涅槃")。 + * Why: 名称收敛进 heroSet 英雄配置,复活底座 6501 在不同英雄下可有特色名(如"回光返照")。 + * @param hero 英雄配置(含 revive 档位的 heroInfo) + * @param sUuid 复活底座技能 uuid(指向 SkillSet 6501) */ -export function getReviveSkillName(): string { +export function getReviveSkillName(hero: heroInfo | undefined, sUuid: number): string { + for (const e of hero?.revive ?? []) { + if (e.s_uuid === sUuid && e.name) return e.name; + } return "凤凰涅槃"; } @@ -366,12 +377,14 @@ export interface LvTriggerEntry { export type TriggerGrouped = Record; /** - * 驻场光环词条:uuid 指向 FieldSkillSet 底座(类型/图标/名称元数据), + * 驻场光环词条:uuid 指向 FieldSkillSet 底座(类型/图标/元数据), * value 为该词条实际生效数值(由配置处按档位指定,不再随 uuid 分档)。 + * name 为该词条在英雄语境下的对外展示名(写在首次出现的档位),缺省回退 FieldSkillSet 底座名。 */ export interface FieldEntry { uuid: number; value: number; + name?: string; // 英雄语境对外展示名(写在该词条首次出现的档位) } /** @@ -386,12 +399,14 @@ export interface LvFieldEntry { /** * 复活技能按等级解锁:运行时取 ≤英雄等级 的最大 lv 档。 + * name 为该复活技能在英雄语境下的对外展示名(写在第 1 档),缺省回退固定称谓"凤凰涅槃"。 */ export interface LvReviveEntry { lv: number; s_uuid: number; r_num: number; upr: number; + name?: string; // 英雄语境对外展示名(写在第 1 档) /** 档位描述(可选,缺省由 HeroSkillText 自动生成) */ desc?: string; } @@ -439,7 +454,7 @@ export const HeroInfo: Record = { ], }, field: [ - { lv: 9, uuids: [{ uuid: 7002, value: 0.15 }] }, + { lv: 9, uuids: [{ uuid: 7002, value: 0.15, name: "深渊威压" }] }, ], info: "", }, @@ -465,7 +480,7 @@ export const HeroInfo: Record = { ], }, field: [ - { lv: 9, uuids: [{ uuid: 7004, value: 0.12 }, { uuid: 7005, value: 0.2 }] }, + { lv: 9, uuids: [{ uuid: 7004, value: 0.12, name: "剑刃风暴" }, { uuid: 7005, value: 0.2, name: "斩魂利刃" }] }, ], info: "", }, @@ -496,7 +511,7 @@ export const HeroInfo: Record = { ], }, field: [ - { lv: 9, uuids: [{ uuid: 7018, value: 1 }] }, + { lv: 9, uuids: [{ uuid: 7018, value: 1, name: "剑心通明" }] }, ], info: "", }, @@ -522,7 +537,7 @@ export const HeroInfo: Record = { ], }, field: [ - { lv: 9, uuids: [{ uuid: 7003, value: 0.1 }] }, + { lv: 9, uuids: [{ uuid: 7003, value: 0.1, name: "寒霜震慑" }] }, ], info: "", }, @@ -558,11 +573,11 @@ export const HeroInfo: Record = { ], }, field: [ - { lv: 9, uuids: [{ uuid: 7007, value: 0.15 }, { uuid: 7019, value: 1 }] }, + { lv: 9, uuids: [{ uuid: 7007, value: 0.15, name: "不灭之躯" }, { uuid: 7019, value: 1, name: "百战不殆" }] }, ], // 回光返照:濒死回血(6501.ap=50 即恢复50%生命,upr 为每级追加次数,非血量百分比) revive: [ - { lv: 7, s_uuid: 6501, r_num: 1, upr: 0 }, + { lv: 7, s_uuid: 6501, r_num: 1, upr: 0, name: "回光返照" }, ], info: "", }, @@ -593,7 +608,7 @@ export const HeroInfo: Record = { ], }, field: [ - { lv: 9, uuids: [{ uuid: 7007, value: 0.15 }] }, + { lv: 9, uuids: [{ uuid: 7007, value: 0.15, name: "圣光祝福" }] }, ], info: "", }, @@ -645,7 +660,7 @@ export const HeroInfo: Record = { ], }, field: [ - { lv: 9, uuids: [{ uuid: 7005, value: 0.25 }] }, + { lv: 9, uuids: [{ uuid: 7005, value: 0.25, name: "大圣神威" }] }, ], info: "", },