feat(editor): 新增枚举型覆写编辑器与优化技能描述
1. 新增TGroup枚举覆写类型到常量配置,添加对应下拉编辑组件 2. 重构覆写解析逻辑,统一处理枚举与对象类型覆写 3. 批量更新全英雄技能的描述文本与覆写参数,修正技能效果描述 4. 优化技能详情展示逻辑,复用覆写解析函数减少重复代码
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
"overrides": {
|
||||
"ap": 120
|
||||
},
|
||||
"desc": ""
|
||||
"desc": "普通攻击造成 120% 攻击伤害"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -132,7 +132,7 @@
|
||||
"overrides": {
|
||||
"ap": 120
|
||||
},
|
||||
"desc": ""
|
||||
"desc": "普通攻击造成 120% 攻击伤害"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -227,7 +227,7 @@
|
||||
"overrides": {
|
||||
"stun": 10
|
||||
},
|
||||
"desc": "挥斧对{target}造成攻击力{ap}%伤害,{stun}%概率击晕"
|
||||
"desc": "普通攻击有{stun}%概率击晕敌人"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -319,7 +319,7 @@
|
||||
"overrides": {
|
||||
"crt": 10
|
||||
},
|
||||
"desc": "挥刀对{target}造成攻击力{ap}%伤害,{crt}%概率暴击"
|
||||
"desc": "普通攻击有{crt}%概率暴击"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -415,7 +415,7 @@
|
||||
"buff_value": 30,
|
||||
"buff_chance": 30
|
||||
},
|
||||
"desc": "挥刀对{target}造成攻击力{ap}%伤害,{buff_chance}%概率使目标出血(每0.5秒受到{buff_value}点伤害,持续{dur}秒)"
|
||||
"desc": "普通攻击有{buff_chance}%概率使目标出血(每0.5秒受到{buff_value}点伤害,持续{dur}秒)"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -506,9 +506,9 @@
|
||||
"lv": 2,
|
||||
"s_lv": 2,
|
||||
"overrides": {
|
||||
"bck": 10
|
||||
"frz": 10
|
||||
},
|
||||
"desc": "射出箭矢,对{target}造成攻击力{ap}%伤害,击退{bck}"
|
||||
"desc": "普通攻击有{frz}%概率 冰冻敌人"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -591,18 +591,17 @@
|
||||
"cd": 1.2,
|
||||
"cdExpr": "AtkSpeedSet[AtkSpeedLv.Slow].cd",
|
||||
"overrides": {
|
||||
"ap": 100,
|
||||
"bck": 30
|
||||
"ap": 100
|
||||
},
|
||||
"desc": "掷出紫魔球,对{target}造成攻击力{ap}%伤害,击退{bck}",
|
||||
"desc": "掷出紫魔球,对{target}造成攻击力{ap}%伤害",
|
||||
"lv_entries": [
|
||||
{
|
||||
"lv": 2,
|
||||
"s_lv": 2,
|
||||
"overrides": {
|
||||
"bck": 40
|
||||
"bck_chance": 20
|
||||
},
|
||||
"desc": ""
|
||||
"desc": "普通攻击有{bck_chance}%概率击退敌人"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -693,9 +692,9 @@
|
||||
"lv": 2,
|
||||
"s_lv": 2,
|
||||
"overrides": {
|
||||
"bck": 10
|
||||
"ap": 120
|
||||
},
|
||||
"desc": "挥杖对{target}造成攻击力{ap}%伤害,击退{bck}"
|
||||
"desc": "普通攻击造成 120% 攻击伤害"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -789,7 +788,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"desc": ""
|
||||
"desc": "普通攻击有 10% 的概率为自己释放回春"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -235,39 +235,36 @@ function skillLabel(sk) {
|
||||
if (!sk) return '-'
|
||||
return `${sk.uuid} ${sk.name || skillMap.value[sk.uuid]?.name || ''}`.trim()
|
||||
}
|
||||
// 技能数值摘要:关键 overrides 与成长档位上限(如 ap150 →lv16)
|
||||
function skillDetail(sk) {
|
||||
if (!sk) return ''
|
||||
const parts = []
|
||||
if (sk.overrides?.ap != null) parts.push(`ap${sk.overrides.ap}`)
|
||||
if (sk.overrides?.timed_buff_id != null) parts.push(`buff${sk.overrides.timed_buff_id}`)
|
||||
if (sk.overrides?.frz != null) parts.push(`frz${sk.overrides.frz}`)
|
||||
if (sk.overrides?.stun != null) parts.push(`stun${sk.overrides.stun}`)
|
||||
if (sk.overrides?.thorns_dmg != null) parts.push(`thorns${sk.overrides.thorns_dmg}`)
|
||||
if (sk.overrides?.thorns_rate != null) parts.push(`thorns${sk.overrides.thorns_rate}%`)
|
||||
if (sk.overrides?.summon_count != null) parts.push(`数${sk.overrides.summon_count}`)
|
||||
if (sk.lv_entries?.length) parts.push(`→lv${Math.max(...sk.lv_entries.map((e) => e.lv))}`)
|
||||
return parts.join(' ')
|
||||
// 覆写键 → 短标签映射,未列出的键直接用原始键名兜底,保证任何参数都能显示
|
||||
const OV_LABELS = {
|
||||
hit_count: 'hit',
|
||||
timed_buff_id: 'buff',
|
||||
buff_value: 'val',
|
||||
buff_chance: 'chance',
|
||||
summon_count: '数',
|
||||
thorns_dmg: 'thorns',
|
||||
thorns_rate: 'thorns',
|
||||
}
|
||||
|
||||
// 覆写对象转简写(如 ap100、crt10、stun20、summon2)
|
||||
// 覆写对象转简写(如 ap100、crt10、proc:6001×100%、bck_chance20)
|
||||
function overrideParts(ov) {
|
||||
if (!ov) return []
|
||||
const parts = []
|
||||
if (ov.ap != null) parts.push(`ap${ov.ap}`)
|
||||
if (ov.hit_count != null) parts.push(`hit${ov.hit_count}`)
|
||||
if (ov.crt != null) parts.push(`crt${ov.crt}`)
|
||||
if (ov.frz != null) parts.push(`frz${ov.frz}`)
|
||||
if (ov.stun != null) parts.push(`stun${ov.stun}`)
|
||||
if (ov.para != null) parts.push(`para${ov.para}`)
|
||||
if (ov.bck != null) parts.push(`bck${ov.bck}`)
|
||||
if (ov.thorns_dmg != null) parts.push(`thorns${ov.thorns_dmg}`)
|
||||
if (ov.thorns_rate != null) parts.push(`thorns${ov.thorns_rate}%`)
|
||||
if (ov.summon_count != null) parts.push(`数${ov.summon_count}`)
|
||||
if (ov.num != null) parts.push(`num${ov.num}`)
|
||||
if (ov.timed_buff_id != null) parts.push(`buff${ov.timed_buff_id}`)
|
||||
if (ov.buff_value != null) parts.push(`val${ov.buff_value}`)
|
||||
if (ov.buff_chance != null) parts.push(`chance${ov.buff_chance}`)
|
||||
for (const [k, v] of Object.entries(ov)) {
|
||||
// 跳过空值与编辑器内部标记键
|
||||
if (v == null || k === 'TGroup' || k === 'desc') continue
|
||||
if (k === 'proc_skill') {
|
||||
const sub = overrideParts(v.overrides).join(',')
|
||||
parts.push(`proc:${v.s_uuid}×${v.chance}%${sub ? `(${sub})` : ''}`)
|
||||
continue
|
||||
}
|
||||
if (typeof v === 'object') {
|
||||
parts.push(`${k}${JSON.stringify(v)}`)
|
||||
continue
|
||||
}
|
||||
const label = OV_LABELS[k] ?? k
|
||||
parts.push(k === 'thorns_rate' ? `${label}${v}%` : `${label}${v}`)
|
||||
}
|
||||
return parts
|
||||
}
|
||||
|
||||
@@ -305,17 +302,7 @@ function triggerSummary(h) {
|
||||
const name = entries[0]?.name || skillMap.value[sid]?.name || ''
|
||||
const e = entries[0]
|
||||
const ov = e?.overrides || {}
|
||||
const parts = [`t_num${e?.t_num}`]
|
||||
if (ov.ap != null) parts.push(`ap${ov.ap}`)
|
||||
if (ov.crt != null) parts.push(`crt${ov.crt}`)
|
||||
if (ov.stun != null) parts.push(`stun${ov.stun}`)
|
||||
if (ov.frz != null) parts.push(`frz${ov.frz}`)
|
||||
if (ov.para != null) parts.push(`para${ov.para}`)
|
||||
if (ov.bck != null) parts.push(`bck${ov.bck}`)
|
||||
if (ov.thorns_dmg != null) parts.push(`thorns${ov.thorns_dmg}`)
|
||||
if (ov.thorns_rate != null) parts.push(`thorns${ov.thorns_rate}%`)
|
||||
if (ov.timed_buff_id != null) parts.push(`buff${ov.timed_buff_id}`)
|
||||
if (ov.summon_count != null) parts.push(`数${ov.summon_count}`)
|
||||
const parts = [`t_num${e?.t_num}`, ...overrideParts(ov)]
|
||||
lines.push(`${tk}: ${sid} ${name} lv${minLv} ${parts.join(' ')}`)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,16 @@
|
||||
>
|
||||
<el-option v-for="opt in SKILL_ICON_OPTIONS" :key="opt" :label="opt" :value="opt" />
|
||||
</el-select>
|
||||
<!-- 枚举型覆写(buff_target/TGroup):下拉选枚举值 -->
|
||||
<el-select
|
||||
v-else-if="isEnumKey(item.key)"
|
||||
v-model="item.value"
|
||||
placeholder="枚举值"
|
||||
size="small"
|
||||
style="width: 220px"
|
||||
>
|
||||
<el-option v-for="opt in enumOptions(item.key)" :key="String(opt.value)" :label="opt.label" :value="opt.value" />
|
||||
</el-select>
|
||||
<!-- 对象型覆写(proc_skill):命中后概率触发额外技能,结构化编辑 s_uuid/chance/overrides -->
|
||||
<template v-else-if="isObjectKey(item.key)">
|
||||
<div class="proc-skill-editor">
|
||||
@@ -111,12 +121,25 @@ function isObjectKey(key) {
|
||||
return OVERRIDE_KEYS.find((k) => k.key === key)?.type === 'object'
|
||||
}
|
||||
|
||||
// 该覆写字段是否为枚举型(buff_target/TGroup 等)
|
||||
function isEnumKey(key) {
|
||||
return OVERRIDE_KEYS.find((k) => k.key === key)?.type === 'enum'
|
||||
}
|
||||
|
||||
// 枚举型覆写的候选值列表
|
||||
function enumOptions(key) {
|
||||
return OVERRIDE_KEYS.find((k) => k.key === key)?.options || []
|
||||
}
|
||||
|
||||
// 对象型覆写行选中时初始化默认结构,避免 v-model 绑定到 undefined 子字段
|
||||
function onKeyChange(item) {
|
||||
if (isObjectKey(item.key)) {
|
||||
item.value = { s_uuid: undefined, chance: 100, overrides: {} }
|
||||
} else if (isStringKey(item.key)) {
|
||||
item.value = ''
|
||||
} else if (isEnumKey(item.key)) {
|
||||
// 枚举默认取首个候选值
|
||||
item.value = enumOptions(item.key)[0]?.value
|
||||
} else {
|
||||
item.value = 0
|
||||
}
|
||||
|
||||
@@ -121,6 +121,14 @@ export const OVERRIDE_KEYS = [
|
||||
{ value: 2, label: '2 全体友方(Ally)' },
|
||||
{ value: 3, label: '3 全体敌方(Enemy)' },
|
||||
]},
|
||||
// 枚举型覆写:技能目标群体(JSON 存字符串,导出还原 TGroup.X;proc_skill.overrides 可借此改变被触发技能的释放对象)
|
||||
// 注:不提供 All —— SCastSystem 未对 TGroup.All 做友/敌分流(会落到敌方分支),避免误配
|
||||
{ key: 'TGroup', label: 'TGroup 目标群体', type: 'enum', options: [
|
||||
{ value: 'Self', label: 'Self 施法者自身' },
|
||||
{ value: 'Ally', label: 'Ally 全体友方(含自己)' },
|
||||
{ value: 'Team', label: 'Team 全体友方(不含自己)' },
|
||||
{ value: 'Enemy', label: 'Enemy 敌方(最近敌人)' },
|
||||
]},
|
||||
{ key: 'summon_count', label: 'summon_count 召唤数' },
|
||||
{ key: 'num', label: 'num 额外释放次数' },
|
||||
{ key: 'call_hero', label: 'call_hero 召唤英雄id' },
|
||||
|
||||
Reference in New Issue
Block a user