feat(map,hero): 实现英雄技能整组合并展示功能

重构英雄技能展示逻辑,支持将同一触发槽位的多个技能/光环词条合并为一个技能展示:
1. 新增触发组整组分档渲染接口,合并同槽位多技能档位数据
2. 新增组名获取函数,统一使用槽位首个自定义名称作为展示名
3. 调整图鉴面板技能列表,每个触发槽位仅展示一个合并后的图标
4. 升级技能弹窗渲染逻辑,支持整组模式下的合并说明展示
5. 优化注释与代码结构,统一技能展示口径
This commit is contained in:
pan
2026-09-04 14:15:45 +08:00
parent 4e0ef5bccc
commit db26865e03
5 changed files with 319 additions and 107 deletions

View File

@@ -6,7 +6,7 @@ import { CardTriggerType } from "../common/config/CardSet";
import { SkillSet, FieldSkillSet } from "../common/config/SkillSet";
import {
FieldEntry, HeroInfo, TriggerGrouped, SkillTriggerType,
getGroupedTriggerName, getFieldSkillName,
getGroupedTriggerName, getFieldSkillName, getTriggerGroupName, getFieldGroupName,
} from "../common/config/heroSet";
import { UIID } from "../common/config/GameUIConfig";
import { smc } from "../common/SingletonModuleComp";
@@ -45,6 +45,9 @@ export class SSkillBoxComp extends CCComp {
/** 技能所属槽位(英雄图鉴模式):同一底座可同时为普攻与触发技能(如 5002 的 6004),
* 弹窗按槽位精确取档,避免自动定位命中错误分组 */
private hero_slot?: SkillTriggerType;
/** 整组模式(英雄图鉴):true 时该图标代表整个触发槽位(atking/dead/fstart/atked/call/field),
* 组内多技能/词条合并为一个名称与一套说明展示,弹窗按整组取档 */
private hero_group: boolean = false;
/** 卡牌等级 */
private rarity: number = 1;
/** 卡牌自定义图标ID(优先级最高,未定义则按 trigger_type 自动取) */
@@ -84,6 +87,8 @@ export class SSkillBoxComp extends CCComp {
hero_uuid: this.hero_uuid || undefined,
// 槽位:同一底座不同槽位视为不同技能(激活等级/档位各自独立)
hero_slot: this.hero_uuid ? this.hero_slot : undefined,
// 整组模式:弹窗按整个触发槽位合并渲染(组内多技能/词条统一说明)
hero_group: this.hero_uuid ? this.hero_group : undefined,
});
}
@@ -101,17 +106,21 @@ export class SSkillBoxComp extends CCComp {
/**
* 初始化英雄技能图标(英雄图鉴面板专用):
* 图标按 s_uuid 直接取 SkillSet / FieldSkillSet 配置,不走 EquipPoolList。
* @param s_uuid 技能 UUID(大招/触发技能指向 SkillSet,光环词条指向 FieldSkillSet)
* @param s_uuid 技能 UUID(大招/触发技能指向 SkillSet,光环词条指向 FieldSkillSet;
* 整组模式下取组内首个 s_uuid/词条,仅用于图标与兜底名)
* @param s_lv 当前英雄等级下生效的技能等级(显示在等级标签)
* @param locked 当前等级未激活时显示锁定遮罩
* @param isField true 时图标取 FieldSkillSet(驻场光环词条)
* @param heroUuid 所属英雄 UUID(点击弹窗按英雄技能分档描述渲染)
* @param slot 技能所属槽位(普攻/大招传 undefined;触发/光环传对应类型,复活已纳入 dead)
* @param isGroup 整组模式:该图标代表整个触发槽位,组名取组内首个自定义名,
* 弹窗按整组合并渲染(组内多技能/词条统一说明)
*/
initHeroSkill(s_uuid: number, s_lv: number, locked: boolean, isField: boolean = false, heroUuid: number = 0, slot?: SkillTriggerType) {
initHeroSkill(s_uuid: number, s_lv: number, locked: boolean, isField: boolean = false, heroUuid: number = 0, slot?: SkillTriggerType, isGroup: boolean = false) {
this.s_uuid = s_uuid;
this.hero_uuid = heroUuid;
this.hero_slot = slot;
this.hero_group = isGroup;
this.rarity = s_lv;
this.hero_icon_source = isField ? "field" : "skill";
this.updateUI();
@@ -163,6 +172,7 @@ export class SSkillBoxComp extends CCComp {
/**
* 英雄图鉴模式:按技能 uuid 在英雄配置中定位,取英雄语境展示名。
* 整组模式优先:整个触发槽位取统一组名(组内首个自定义名);
* 覆盖普攻/大招(skills)、5 类触发技能、驻场光环(field);复活已纳入 dead 触发组。
* 指定槽位时仅在对应槽位查找(同一底座可同时是普攻与触发技能,需精确区分);
* 未命中返回空串,由调用方回退底座名。
@@ -170,6 +180,12 @@ export class SSkillBoxComp extends CCComp {
private resolveHeroSkillName(): string {
const hero = HeroInfo[this.hero_uuid];
if (!hero) return "";
// 整组模式:整个触发槽位一个技能,取组名(组内首个自定义名)
if (this.hero_group && this.hero_slot !== undefined) {
return this.hero_slot === SkillTriggerType.Field
? getFieldGroupName(hero)
: getTriggerGroupName(hero, this.hero_slot);
}
// 槽位指定:光环/触发组各自取值,未命中直接回退(复活已纳入 dead)
if (this.hero_slot !== undefined) {
if (this.hero_slot === SkillTriggerType.Field) {