feat: 新增技能图标英雄语境覆写功能

1. 扩展SkillOverrides接口,新增icon字段支持自定义图标
2. 前端常量与编辑器适配:新增字符串型覆写类型与图标候选选择器
3. 新增getHeroSkillIcon工具函数,实现英雄专属图标优先级加载逻辑
4. 修复并优化技能图标展示逻辑,支持同底座技能不同英雄差异化图标
5. 重构部分英雄配置格式,统一代码风格
This commit is contained in:
pan
2026-09-04 16:25:57 +08:00
parent 2a2abf24b2
commit e97de40d2e
7 changed files with 178 additions and 59 deletions

View File

@@ -188,6 +188,9 @@ export interface SkillOverrides {
revive_hp?: number;
/** 复活次数上限,配合 revive_hp 使用(仅 dead 触发有效) */
revive_count?: number;
/** 英雄语境专属图标(图鉴面板/技能弹窗展示用):配置后覆盖 SkillSet.icon,
* 实现"同一底座、不同英雄/档位不同外观"(如 5002 普攻与冲刺斩同 6004 但图标不同) */
icon?: string;
}
/**

View File

@@ -324,6 +324,64 @@ export function getFieldGroupName(hero: heroInfo | undefined): string {
return firstUuid ? (FieldSkillSet[firstUuid]?.name ?? "") : "";
}
/**
* 解析技能的对外展示图标(英雄语境):英雄/触发引用侧通过 overrides.icon 覆写时优先,
* 缺省回退 SkillSet 底座 icon;驻场光环词条统一取 FieldSkillSet 底座 icon。
* Why: 图标是"对外展示"维度(与数值覆写同一套注入机制),实现同一底座不同英雄/档位不同外观。
* @param hero 英雄配置
* @param skillUuid 技能 uuid(skills key / 触发组 s_uuid / FieldSkillSet uuid)
* @param slot 技能所属槽位(可空):指定时仅在该槽位查找;缺省按 普攻/大招→触发组 顺序定位
* @param isGroup 整组模式:true 时取组内首个 s_uuid 的图标(slot 必填,光环取首个词条)
* @returns 图标ID;未找到返回 undefined
*/
export function getHeroSkillIcon(hero: heroInfo | undefined, skillUuid: number, slot?: SkillTriggerType, isGroup: boolean = false): string | undefined {
if (!hero) return undefined;
// 整组模式:组内首个 s_uuid/词条的图标
if (isGroup && slot !== undefined) {
if (slot === SkillTriggerType.Field) {
const firstEntry = hero.field?.[0]?.uuids?.[0];
return firstEntry ? FieldSkillSet[firstEntry.uuid]?.icon : undefined;
}
const grouped = hero[slot] as TriggerGrouped | undefined;
if (!grouped) return undefined;
for (const key in grouped) {
const icon = resolveTriggerSkillIcon(grouped[Number(key)]?.[0], Number(key));
if (icon) return icon;
}
return undefined;
}
// 普攻/大招(slot 缺省时优先定位):lv_entries 首档 icon > 基础 overrides.icon > 底座
const hSkill = hero.skills?.[skillUuid];
if (hSkill && slot === undefined) {
return hSkill.lv_entries?.[0]?.overrides?.icon
?? hSkill.overrides?.icon
?? SkillSet[skillUuid]?.icon;
}
// 指定触发槽位:该组首个 s_uuid 首档 icon
if (slot !== undefined && slot !== SkillTriggerType.Field) {
const grouped = hero[slot] as TriggerGrouped | undefined;
const entry = grouped?.[skillUuid]?.[0];
if (entry) return resolveTriggerSkillIcon(entry, skillUuid);
return undefined;
}
// 自动定位:再各触发组,最后光环
for (const type of [SkillTriggerType.Call, SkillTriggerType.Dead, SkillTriggerType.FStart, SkillTriggerType.Atking, SkillTriggerType.Atked]) {
const grouped = hero[type] as TriggerGrouped | undefined;
const entry = grouped?.[skillUuid]?.[0];
if (entry) return resolveTriggerSkillIcon(entry, skillUuid);
}
if (hero.field?.some(t => t.uuids.some(u => u.uuid === skillUuid))) {
return FieldSkillSet[skillUuid]?.icon;
}
return undefined;
}
/** 触发技能档位图标:档位 overrides.icon 优先,缺省回退该 s_uuid 的底座 icon */
function resolveTriggerSkillIcon(entry: LvTriggerEntry | undefined, skillUuid: number): string | undefined {
if (!entry) return undefined;
return entry.overrides?.icon ?? SkillSet[skillUuid]?.icon;
}
/**
* 复活已纳入 dead 触发组:通过 SkillOverrides.revive_hp / revive_count 配置,
* 不再需要独立的 revive 字段和解析函数。
@@ -490,12 +548,14 @@ export const HeroInfo: Record<number, heroInfo> = {
5001: {
uuid: 5001, name: "叠甲骑士", path: "hk1", fac: FacSet.HERO, rarity: 1, lv: 1, type: HType.Melee, grow_type: HGrowType.Tank, role: HRole.Tank, hp: HERO_ROLE_BASE[HRole.Tank].hp + 20, ap: HERO_ROLE_BASE[HRole.Tank].ap, def: HERO_ROLE_BASE[HRole.Tank].def + 10,
skills: {
6004: { uuid: 6004, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Slow].cd, ccd: 0, overrides: {"ap":100}, desc: "挥剑对{target}造成攻击力{ap}%伤害",
6004: {
uuid: 6004, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Slow].cd, ccd: 0, overrides: { "ap": 100 }, desc: "挥剑对{target}造成攻击力{ap}%伤害",
lv_entries: [
{ lv: 2, s_lv: SkillLv.Lv2, overrides: { "ap": 120 } },
],
},
6301: { uuid: 6301, name: "魔法盾", lv: 1, cd: 8, ccd: 0, overrides: {"ap":30}, desc: "{target}获得生命最大值{ap}%的护盾",
6301: {
uuid: 6301, name: "魔法盾", lv: 1, cd: 8, ccd: 0, overrides: { "ap": 30 }, desc: "{target}获得生命最大值{ap}%的护盾",
lv_entries: [
{ lv: 8, s_lv: SkillLv.Lv2, overrides: { "ap": 60 }, desc: "{target}获得生命最大值{ap}%的护盾" },
{ lv: 16, s_lv: SkillLv.Lv3, overrides: { "ap": 120 }, desc: "{target}获得生命最大值{ap}%的护盾" },
@@ -513,12 +573,14 @@ export const HeroInfo: Record<number, heroInfo> = {
5002: {
uuid: 5002, name: "易伤剑仙", path: "hk3", fac: FacSet.HERO, rarity: 1, lv: 1, type: HType.Melee, grow_type: HGrowType.Warrior, role: HRole.Warrior, hp: HERO_ROLE_BASE[HRole.Warrior].hp + 5, ap: HERO_ROLE_BASE[HRole.Warrior].ap + 20, def: HERO_ROLE_BASE[HRole.Warrior].def + 5,
skills: {
6004: { uuid: 6004, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Slow].cd, ccd: 0, overrides: {"ap":100}, desc: "对{target}造成攻击力{ap}%伤害",
6004: {
uuid: 6004, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Slow].cd, ccd: 0, overrides: { "ap": 100 }, desc: "对{target}造成攻击力{ap}%伤害",
lv_entries: [
{ lv: 2, s_lv: SkillLv.Lv2, overrides: { "ap": 120 } },
],
},
6101: { uuid: 6101, name: "气斩", lv: 1, cd: 8, ccd: 0, overrides: {"ap":150,"timed_buff_id":7002,"summon_count":1}, desc: "斩出气刃,对{target}造成攻击力{ap}%伤害,并使目标易伤(受到伤害加深,持续{dur}秒)",
6101: {
uuid: 6101, name: "气斩", lv: 1, cd: 8, ccd: 0, overrides: { "ap": 150, "timed_buff_id": 7002, "summon_count": 1 }, desc: "斩出气刃,对{target}造成攻击力{ap}%伤害,并使目标易伤(受到伤害加深,持续{dur}秒)",
lv_entries: [
{ lv: 8, s_lv: SkillLv.Lv2, overrides: { "buff_value": 20, "summon_count": 1 } },
{ lv: 16, s_lv: SkillLv.Lv3, overrides: { "ap": 180, "bck": 60, "buff_value": 40, "summon_count": 2 }, desc: "斩出气刃,对{target}造成攻击力{ap}%伤害,击退{bck},并使目标易伤(持续{dur}秒)" },
@@ -536,12 +598,14 @@ export const HeroInfo: Record<number, heroInfo> = {
5003: {
uuid: 5003, name: "眩晕暴击哥", path: "hk5", fac: FacSet.HERO, rarity: 1, lv: 1, type: HType.Melee, grow_type: HGrowType.Warrior, role: HRole.Warrior, hp: HERO_ROLE_BASE[HRole.Warrior].hp + 5, ap: HERO_ROLE_BASE[HRole.Warrior].ap + 20, def: HERO_ROLE_BASE[HRole.Warrior].def + 5,
skills: {
6004: { uuid: 6004, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Slow].cd, ccd: 0, overrides: {"ap":100}, desc: "挥斧对{target}造成攻击力{ap}%伤害",
6004: {
uuid: 6004, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Slow].cd, ccd: 0, overrides: { "ap": 100 }, desc: "挥斧对{target}造成攻击力{ap}%伤害",
lv_entries: [
{ lv: 2, s_lv: SkillLv.Lv2, overrides: { "stun": 10 }, desc: "挥斧对{target}造成攻击力{ap}%伤害,{stun}%概率击晕" },
],
},
6104: { uuid: 6104, name: "开山斧", lv: 1, cd: 8, ccd: 0, overrides: {"ap":300,"stun":100,"summon_count":1}, desc: "劈出开山斧,对{target}造成攻击力{ap}%伤害,必定击晕",
6104: {
uuid: 6104, name: "开山斧", lv: 1, cd: 8, ccd: 0, overrides: { "ap": 300, "stun": 100, "summon_count": 1 }, desc: "劈出开山斧,对{target}造成攻击力{ap}%伤害,必定击晕",
lv_entries: [
{ lv: 8, s_lv: SkillLv.Lv2, overrides: { "ap": 450, "stun": 100, "summon_count": 1 } },
{ lv: 16, s_lv: SkillLv.Lv3, overrides: { "ap": 450, "stun": 100, "summon_count": 2 } },
@@ -557,12 +621,14 @@ export const HeroInfo: Record<number, heroInfo> = {
5004: {
uuid: 5004, name: "刀刀暴击", path: "hc1", fac: FacSet.HERO, rarity: 1, lv: 1, type: HType.Mid, grow_type: HGrowType.Assassin, role: HRole.Assassin, hp: HERO_ROLE_BASE[HRole.Assassin].hp, ap: HERO_ROLE_BASE[HRole.Assassin].ap + 30, def: HERO_ROLE_BASE[HRole.Assassin].def,
skills: {
6002: { uuid: 6002, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Fast].cd, ccd: 0, overrides: {"ap":100}, desc: "挥刀对{target}造成攻击力{ap}%伤害",
6002: {
uuid: 6002, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Fast].cd, ccd: 0, overrides: { "ap": 100 }, desc: "挥刀对{target}造成攻击力{ap}%伤害",
lv_entries: [
{ lv: 2, s_lv: SkillLv.Lv2, overrides: { "crt": 10 }, desc: "挥刀对{target}造成攻击力{ap}%伤害,{crt}%概率暴击" },
],
},
6100: { uuid: 6100, name: "光闪", lv: 1, cd: 8, ccd: 0, overrides: {"ap":150,"summon_count":1}, desc: "斩出光闪,对{target}造成攻击力{ap}%伤害",
6100: {
uuid: 6100, name: "光闪", lv: 1, cd: 8, ccd: 0, overrides: { "ap": 150, "summon_count": 1 }, desc: "斩出光闪,对{target}造成攻击力{ap}%伤害",
lv_entries: [
{ lv: 8, s_lv: SkillLv.Lv2, overrides: { "ap": 250, "summon_count": 1 } },
{ lv: 16, s_lv: SkillLv.Lv3, overrides: { "ap": 350, "summon_count": 2 } },
@@ -578,12 +644,14 @@ export const HeroInfo: Record<number, heroInfo> = {
5005: {
uuid: 5005, name: "出血贼", path: "hc2", fac: FacSet.HERO, rarity: 1, lv: 1, type: HType.Mid, grow_type: HGrowType.Assassin, role: HRole.Assassin, hp: HERO_ROLE_BASE[HRole.Assassin].hp, ap: HERO_ROLE_BASE[HRole.Assassin].ap + 30, def: HERO_ROLE_BASE[HRole.Assassin].def,
skills: {
6002: { uuid: 6002, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Fast].cd, ccd: 0, overrides: {"ap":100}, desc: "挥刀对{target}造成攻击力{ap}%伤害",
6002: {
uuid: 6002, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Fast].cd, ccd: 0, overrides: { "ap": 100 }, desc: "挥刀对{target}造成攻击力{ap}%伤害",
lv_entries: [
{ lv: 2, s_lv: SkillLv.Lv2, overrides: { "timed_buff_id": 7007, "buff_value": 30, "buff_chance": 30 }, desc: "挥刀对{target}造成攻击力{ap}%伤害,{buff_chance}%概率使目标出血(每0.5秒受到{buff_value}点伤害,持续{dur}秒)" },
],
},
6103: { uuid: 6103, name: "闪电斩", lv: 1, cd: 8, ccd: 0, overrides: {"ap":150,"summon_count":1}, desc: "召唤落雷斩击{target},造成攻击力{ap}%伤害",
6103: {
uuid: 6103, name: "闪电斩", lv: 1, cd: 8, ccd: 0, overrides: { "ap": 150, "summon_count": 1 }, desc: "召唤落雷斩击{target},造成攻击力{ap}%伤害",
lv_entries: [
{ lv: 8, s_lv: SkillLv.Lv2, overrides: { "ap": 250, "timed_buff_id": 7007, "summon_count": 1 }, desc: "召唤落雷斩击{target},造成攻击力{ap}%伤害,并使目标出血(每0.5秒受到{buff_value}点伤害,持续{dur}秒)" },
{ lv: 16, s_lv: SkillLv.Lv3, overrides: { "ap": 350, "para": 50, "timed_buff_id": 7007, "buff_value": 60, "summon_count": 2 }, desc: "召唤落雷斩击{target},造成攻击力{ap}%伤害,{para}%概率麻痹,并使目标出血(每0.5秒受到{buff_value}点伤害,持续{dur}秒)" },
@@ -599,12 +667,14 @@ export const HeroInfo: Record<number, heroInfo> = {
5006: {
uuid: 5006, name: "冻箭哥", path: "ha1", fac: FacSet.HERO, rarity: 1, lv: 1, type: HType.Long, grow_type: HGrowType.Archer, role: HRole.Archer, hp: HERO_ROLE_BASE[HRole.Archer].hp, ap: HERO_ROLE_BASE[HRole.Archer].ap + 30, def: HERO_ROLE_BASE[HRole.Archer].def,
skills: {
6006: { uuid: 6006, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Normal].cd, ccd: 0, overrides: {"ap":100}, desc: "射出箭矢,对{target}造成攻击力{ap}%伤害",
6006: {
uuid: 6006, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Normal].cd, ccd: 0, overrides: { "ap": 100 }, desc: "射出箭矢,对{target}造成攻击力{ap}%伤害",
lv_entries: [
{ lv: 2, s_lv: SkillLv.Lv2, overrides: { "bck": 10 }, desc: "射出箭矢,对{target}造成攻击力{ap}%伤害,击退{bck}" },
],
},
6150: { uuid: 6150, name: "万箭齐发·冰", lv: 1, cd: 8, ccd: 0, overrides: {"ap":150,"frz":30,"summon_count":1}, desc: "万箭齐发,对{target}造成攻击力{ap}%伤害,{frz}%概率冰冻",
6150: {
uuid: 6150, name: "万箭齐发·冰", lv: 1, cd: 8, ccd: 0, overrides: { "ap": 150, "frz": 30, "summon_count": 1 }, desc: "万箭齐发,对{target}造成攻击力{ap}%伤害,{frz}%概率冰冻",
lv_entries: [
{ lv: 8, s_lv: SkillLv.Lv2, overrides: { "ap": 200, "frz": 50, "summon_count": 1 } },
{ lv: 16, s_lv: SkillLv.Lv3, overrides: { "ap": 250, "frz": 70, "summon_count": 2 } },
@@ -620,12 +690,14 @@ export const HeroInfo: Record<number, heroInfo> = {
5007: {
uuid: 5007, name: "击退火女", path: "hm1", fac: FacSet.HERO, rarity: 1, lv: 1, type: HType.Long, grow_type: HGrowType.Mage, role: HRole.Mage, hp: HERO_ROLE_BASE[HRole.Mage].hp - 5, ap: HERO_ROLE_BASE[HRole.Mage].ap + 10, def: HERO_ROLE_BASE[HRole.Mage].def,
skills: {
6010: { uuid: 6010, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Slow].cd, ccd: 0, overrides: {"ap":100,"bck":30}, desc: "掷出紫魔球,对{target}造成攻击力{ap}%伤害,击退{bck}",
6010: {
uuid: 6010, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Slow].cd, ccd: 0, overrides: { "ap": 100, "bck": 30 }, desc: "掷出紫魔球,对{target}造成攻击力{ap}%伤害,击退{bck}",
lv_entries: [
{ lv: 2, s_lv: SkillLv.Lv2, overrides: { "bck": 40 } },
],
},
6200: { uuid: 6200, name: "火焰喷射", lv: 1, cd: 8, ccd: 0, overrides: {"ap":250,"bck":100,"summon_count":1}, desc: "喷出烈焰风暴,对{target}造成攻击力{ap}%伤害,击退{bck}",
6200: {
uuid: 6200, name: "火焰喷射", lv: 1, cd: 8, ccd: 0, overrides: { "ap": 250, "bck": 100, "summon_count": 1 }, desc: "喷出烈焰风暴,对{target}造成攻击力{ap}%伤害,击退{bck}",
lv_entries: [
{ lv: 8, s_lv: SkillLv.Lv2, overrides: { "ap": 350, "bck": 100, "summon_count": 1 } },
{ lv: 16, s_lv: SkillLv.Lv3, overrides: { "ap": 450, "bck": 100, "summon_count": 2 } },
@@ -641,12 +713,14 @@ export const HeroInfo: Record<number, heroInfo> = {
5008: {
uuid: 5008, name: "团疗奶爸", path: "hh1", fac: FacSet.HERO, rarity: 1, lv: 1, type: HType.Long, grow_type: HGrowType.Support, role: HRole.Support, hp: HERO_ROLE_BASE[HRole.Support].hp + 10, ap: HERO_ROLE_BASE[HRole.Support].ap + 20, def: HERO_ROLE_BASE[HRole.Support].def,
skills: {
6011: { uuid: 6011, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Normal].cd, ccd: 0, overrides: {"ap":100}, desc: "挥杖对{target}造成攻击力{ap}%伤害",
6011: {
uuid: 6011, name: "强化普攻", lv: 1, cd: AtkSpeedSet[AtkSpeedLv.Normal].cd, ccd: 0, overrides: { "ap": 100 }, desc: "挥杖对{target}造成攻击力{ap}%伤害",
lv_entries: [
{ lv: 2, s_lv: SkillLv.Lv2, overrides: { "bck": 10 }, desc: "挥杖对{target}造成攻击力{ap}%伤害,击退{bck}" },
],
},
6302: { uuid: 6302, name: "治疗", lv: 1, cd: 8, ccd: 0, overrides: {"ap":300,"summon_count":1}, desc: "为{target}回复攻击力{ap}%生命",
6302: {
uuid: 6302, name: "治疗", lv: 1, cd: 8, ccd: 0, overrides: { "ap": 300, "summon_count": 1 }, desc: "为{target}回复攻击力{ap}%生命",
lv_entries: [
{ lv: 8, s_lv: SkillLv.Lv2, overrides: { "ap": 400, "summon_count": 1 } },
{ lv: 16, s_lv: SkillLv.Lv3, overrides: { "ap": 450, "summon_count": 2 } },

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, getTriggerGroupName, getFieldGroupName,
getGroupedTriggerName, getFieldSkillName, getTriggerGroupName, getFieldGroupName, getHeroSkillIcon,
} from "../common/config/heroSet";
import { UIID } from "../common/config/GameUIConfig";
import { smc } from "../common/SingletonModuleComp";
@@ -234,15 +234,19 @@ export class SSkillBoxComp extends CCComp {
// 优先使用卡牌自定义 icon;未定义则按图鉴模式 / 装备卡 trigger_type 自动取
let iconId: string | undefined = this.card_icon;
if (!iconId) {
if (this.hero_icon_source === "field") {
// 英雄图鉴:驻场光环词条图标取 FieldSkillSet
if (this.hero_uuid > 0) {
// 英雄图鉴:英雄语境图标优先(overrides.icon 覆写),底座 icon 兜底
iconId = getHeroSkillIcon(HeroInfo[this.hero_uuid], this.s_uuid, this.hero_slot, this.hero_group);
}
if (!iconId && this.hero_icon_source === "field") {
// 光环词条图标取 FieldSkillSet
iconId = this.s_uuid ? FieldSkillSet[this.s_uuid]?.icon : undefined;
} else if (this.hero_icon_source === "skill") {
// 英雄图鉴:大招/触发技能图标取 SkillSet
} else if (!iconId && this.hero_icon_source === "skill") {
// 大招/触发技能图标取 SkillSet
iconId = this.s_uuid ? SkillSet[this.s_uuid]?.icon : undefined;
} else if (this.trigger_type === CardTriggerType.Interval) {
} else if (!iconId && this.trigger_type === CardTriggerType.Interval) {
iconId = this.s_uuid ? SkillSet[this.s_uuid]?.icon : undefined;
} else if (this.trigger_type === CardTriggerType.Field) {
} else if (!iconId && this.trigger_type === CardTriggerType.Field) {
const fieldUuid = this.field?.[0]?.uuid;
iconId = fieldUuid ? FieldSkillSet[fieldUuid]?.icon : undefined;
}

View File

@@ -35,7 +35,7 @@ import { oops } from "db://oops-framework/core/Oops";
import { CardTriggerType, CardConfig } from "../common/config/CardSet";
import { SkillSet, FieldSkillSet } from "../common/config/SkillSet";
import { SkillCardList } from "../common/config/SCardSet";
import { FieldEntry, SkillTriggerType } from "../common/config/heroSet";
import { FieldEntry, SkillTriggerType, HeroInfo, getHeroSkillIcon } from "../common/config/heroSet";
import { buildCardDescRich } from "../common/config/CardSkillText";
import { buildHeroSkillTierLines, buildHeroGroupTierLines, HeroSkillTierLine } from "../common/HeroSkillText";
import { smc } from "../common/SingletonModuleComp";
@@ -372,6 +372,10 @@ export class SinfoComp extends CCComp {
/** 解析图标ID */
private resolveIconId(p: SInfoParams): string | undefined {
if (p.card_icon) return p.card_icon;
// 英雄图鉴模式:英雄语境图标优先(overrides.icon 覆写),底座 icon 兜底
if (p.hero_uuid) {
return getHeroSkillIcon(HeroInfo[p.hero_uuid], p.uuid, p.hero_slot, p.hero_group);
}
// 技能卡:从 SkillCardList 查 icon
const skillCard = SkillCardList.find(c => c.uuid === p.uuid || c.skill === p.uuid);
if (skillCard?.icon) return skillCard.icon;

View File

@@ -1,10 +1,23 @@
<template>
<div class="override-editor">
<div v-for="(item, idx) in rows" :key="idx" class="override-row">
<el-select v-model="item.key" placeholder="字段" size="small" style="width: 200px" filterable>
<el-select v-model="item.key" placeholder="字段" size="small" style="width: 220px" filterable>
<el-option v-for="k in availableKeys(idx)" :key="k.key" :label="k.label" :value="k.key" />
</el-select>
<el-input-number v-model="item.value" size="small" :controls="false" style="width: 120px" />
<!-- 字符串型覆写(icon):输入帧名,提供常用候选可筛选 -->
<el-select
v-if="isStringKey(item.key)"
v-model="item.value"
placeholder="图标帧名"
size="small"
style="width: 280px"
filterable
allow-create
default-first-option
>
<el-option v-for="opt in SKILL_ICON_OPTIONS" :key="opt" :label="opt" :value="opt" />
</el-select>
<el-input-number v-else v-model="item.value" size="small" :controls="false" style="width: 120px" />
<el-button type="danger" size="small" text @click="remove(idx)">删除</el-button>
</div>
<el-button size="small" @click="add">+ 添加覆盖</el-button>
@@ -13,7 +26,7 @@
<script setup>
import { ref, watch } from 'vue'
import { OVERRIDE_KEYS } from '../constants'
import { OVERRIDE_KEYS, SKILL_ICON_OPTIONS } from '../constants'
const props = defineProps({ modelValue: { type: Object, default: () => ({}) } })
const emit = defineEmits(['update:modelValue'])
@@ -43,6 +56,11 @@ function availableKeys(idx) {
return OVERRIDE_KEYS.filter((k) => !used.has(k.key))
}
// 该覆写字段是否为字符串型(icon 取帧名,非数值)
function isStringKey(key) {
return OVERRIDE_KEYS.find((k) => k.key === key)?.type === 'string'
}
function add() {
rows.value.push({ key: '', value: 0 })
}

View File

@@ -28,8 +28,8 @@
<OverrideEditor v-model="skill.overrides" />
</el-form-item>
<template v-if="isUlt">
<el-divider content-position="left">大招 lv_entries 分档</el-divider>
<template>
<el-divider content-position="left">{{ isUlt ? '大招' : '普攻' }} lv_entries 分档</el-divider>
<div v-for="(e, idx) in skill.lv_entries" :key="idx" class="skill-block">
<div class="head">
<span>档位 lv {{ e.lv }} (SkillLv.Lv{{ e.s_lv }})</span>
@@ -52,8 +52,10 @@
<el-input v-model="e.desc" type="textarea" :rows="2" />
</el-form-item>
</div>
<el-button size="small" @click="addEntry">+ 添加档位(lv9/lv16)</el-button>
<span class="muted" style="margin-left: 8px">建议按 lv9 / lv16 两档</span>
<el-button size="small" @click="addEntry">+ 添加档位(普攻 lv2/lv3,大招 lv9/lv16)</el-button>
<span class="muted" style="margin-left: 8px">
{{ isUlt ? '建议按 lv9 / lv16 两档' : '普攻 lv2 档将作为独立技能图标展示(名称/图标取 lv1)' }}
</span>
</template>
</div>
</template>

View File

@@ -117,4 +117,18 @@ export const OVERRIDE_KEYS = [
{ key: 'call_hero', label: 'call_hero 召唤英雄id' },
{ key: 'revive_hp', label: 'revive_hp 复活回血比例(%)' },
{ key: 'revive_count', label: 'revive_count 复活次数上限' },
// 字符串型覆写:value 为图标ID(uicons 图集帧名),非数值
{ key: 'icon', label: 'icon 英雄语境图标(覆写 SkillSet.icon)', type: 'string' },
]
// icon 覆写常用候选(SkillSet 各底座图标 + 通用图标),可在输入框直接键入其他帧名
export const SKILL_ICON_OPTIONS = [
'Stat_Attack_01', 'Stat_RangedAttack', 'Stat_Tripleshot',
'Sword-FA_WP_Main_Sword_003_PurpleSilver',
'Sword-FA_WP_Main_Sword_019_WoodSilver',
'Axe-FA_WP_Main_Axe_004_WoodGray',
'Sub_Item-FA_WP_Sub_MagicBall_001_Blue',
'Sub_Item-FA_WP_Sub_MagicBall_001_Purple',
'Sub_Item-FA_WP_Sub_Potion_001_Green',
'Sub_Item-FA_WP_Sub_Potion_001_Red',
]