refactor(hero skill/editor): 调整技能配置并新增配置提示
1. 更新英雄普攻技能的overrides配置与描述文本 2. 为属性编辑器新增debuff和buff的语义提示弹窗 3. 优化编辑器提示框的样式适配
This commit is contained in:
@@ -546,7 +546,7 @@ export const HeroInfo: Record<number, heroInfo> = {
|
||||
skills: {
|
||||
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: {"timed_debuff_id":7007,"debuff_value":-10,"debuff_chance":100}, desc: "普通攻击造成 120% 攻击伤害" },
|
||||
{ lv: 2, s_lv: SkillLv.Lv2, overrides: {"ap":120}, desc: "普通攻击 造成 120% 伤害" },
|
||||
],
|
||||
},
|
||||
6301: { uuid: 6301, name: "魔法盾", lv: 1, cd: 8, ccd: 0, overrides: {"ap":30}, desc: "{target}获得生命最大值{ap}%的护盾",
|
||||
|
||||
@@ -31,11 +31,9 @@
|
||||
"lv": 2,
|
||||
"s_lv": 2,
|
||||
"overrides": {
|
||||
"timed_debuff_id": 7007,
|
||||
"debuff_value": -10,
|
||||
"debuff_chance": 100
|
||||
"ap": 120
|
||||
},
|
||||
"desc": "普通攻击造成 120% 攻击伤害"
|
||||
"desc": "普通攻击 造成 120% 伤害"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -75,11 +75,34 @@
|
||||
<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>
|
||||
<!-- 选中 debuff 后的取值语义提示:依 BuffList 配置(tick/modifier/易伤/控制)说明 debuff_value 的正负与生效方式 -->
|
||||
<el-alert
|
||||
v-if="debuffHint"
|
||||
type="warning"
|
||||
:closable="false"
|
||||
show-icon
|
||||
class="hint-alert"
|
||||
style="margin-bottom: 6px"
|
||||
:title="debuffHint.title"
|
||||
:description="debuffHint.desc"
|
||||
/>
|
||||
<!-- 选中 buff(增益)后的取值语义提示:缺省挂施法者自身;tick 类正=回血/负=自伤,modifier 类正=增强 -->
|
||||
<el-alert
|
||||
v-if="buffHint"
|
||||
type="success"
|
||||
:closable="false"
|
||||
show-icon
|
||||
class="hint-alert"
|
||||
style="margin-bottom: 6px"
|
||||
:title="buffHint.title"
|
||||
:description="buffHint.desc"
|
||||
/>
|
||||
<el-alert
|
||||
v-if="showEnemyBuffWarn"
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
class="hint-alert"
|
||||
style="margin-bottom: 6px"
|
||||
title="buff/debuff 配置提示"
|
||||
description="buff 为增益语义:缺省挂施法者自身(如吸血/攻击后强化),可用 buff_target 改为全体友方;debuff 为对敌减益语义:缺省挂被命中者(目标不可覆写),对敌技能请用 timed_debuff_id。proc_skill 用于命中后概率触发主动技能,不是挂 buff 的方式。"
|
||||
@@ -114,6 +137,71 @@ const isEnemyHost = computed(() => {
|
||||
// 对敌技能且注入了 timed_buff_id → 运行时断链不生效,警示引导改用 proc_skill / 底座表
|
||||
const showEnemyBuffWarn = computed(() => isEnemyHost.value && rows.value.some((r) => r.key === 'timed_buff_id'))
|
||||
|
||||
// 易伤 buff id(与游戏侧 BuffSet.VULNERABLE_BUFF_ID 对应),取值语义特殊需单独提示
|
||||
const VULNERABLE_ID = 7002
|
||||
|
||||
// 当前选中的 debuff 配置(timed_debuff_id 行)
|
||||
const selectedDebuff = computed(() => {
|
||||
const row = rows.value.find((r) => r.key === 'timed_debuff_id')
|
||||
const id = typeof row?.value === 'number' ? row.value : Number(row?.value)
|
||||
if (!id || isNaN(id)) return null
|
||||
return props.buffOptions.find((b) => b.id === id) ?? null
|
||||
})
|
||||
|
||||
// 依 BuffList 配置推导 debuff_value 取值语义提示(正负号 / 生效方式 / 叠层)
|
||||
const debuffHint = computed(() => {
|
||||
const buff = selectedDebuff.value
|
||||
if (!buff) return null
|
||||
const stackTxt = buff.max_stack === 0 ? '无限叠层' : buff.max_stack > 1 ? `可叠 ${buff.max_stack} 层` : '不可叠层'
|
||||
// 控制类:无数值语义
|
||||
if (buff.is_control) {
|
||||
return { title: `「${buff.name}」为控制类 debuff`, desc: `无需配置 debuff_value(不生效)。${stackTxt},持续 ${buff.duration}s。` }
|
||||
}
|
||||
// 易伤:正值,被打时按层累加附加伤害,可被易伤抗性减免
|
||||
if (buff.id === VULNERABLE_ID) {
|
||||
return { title: `「${buff.name}」debuff_value 用正值`, desc: `含义=每层被击中时附加的固定伤害。取值 10 → 目标每次被打多掉 10 血,${stackTxt}时按层累加(N 层=N×value),可被目标易伤抗性减免。负值无效(被拦截为 0)。结算在暴击后、护盾前,不吃暴击。` }
|
||||
}
|
||||
// tick 类(DoT/HoT):负=伤害 正=治疗,每 interval 结算,可按 ap 缩放
|
||||
if (buff.tick) {
|
||||
const scaleTxt = buff.tick.scale_by_ap_pct > 0 ? `,并按施法者 ap 缩放(每100 ap +${buff.tick.scale_by_ap_pct}%)` : ',不随 ap 缩放'
|
||||
return { title: `「${buff.name}」为周期伤害 debuff,debuff_value 用负值表伤害`, desc: `含义=每 ${buff.tick.interval}s 一次的基础伤害(负值=掉血,正值=回血)。取值 -10 → 每跳约 10 点伤害${scaleTxt}。${stackTxt},持续 ${buff.duration}s。` }
|
||||
}
|
||||
// modifier 类(属性修饰):正负表增减,直接改属性
|
||||
if (buff.modifiers?.length) {
|
||||
const mod = buff.modifiers[0]
|
||||
return { title: `「${buff.name}」为属性修饰 debuff`, desc: `debuff_value 覆写修饰数值(负=削减,正=增强),作用于属性 ${mod.attr}(${mod.op === 1 ? '百分比' : '固定值'})。${stackTxt},持续 ${buff.duration}s。` }
|
||||
}
|
||||
return { title: `「${buff.name}」`, desc: `${stackTxt},持续 ${buff.duration}s。` }
|
||||
})
|
||||
|
||||
// 当前选中的 buff 配置(timed_buff_id 行)
|
||||
const selectedBuff = computed(() => {
|
||||
const row = rows.value.find((r) => r.key === 'timed_buff_id')
|
||||
const id = typeof row?.value === 'number' ? row.value : Number(row?.value)
|
||||
if (!id || isNaN(id)) return null
|
||||
return props.buffOptions.find((b) => b.id === id) ?? null
|
||||
})
|
||||
|
||||
// buff(增益)取值语义提示:缺省挂施法者自身;tick 类正=回血/负=自伤,modifier 类正=增强
|
||||
const buffHint = computed(() => {
|
||||
const buff = selectedBuff.value
|
||||
if (!buff) return null
|
||||
const stackTxt = buff.max_stack === 0 ? '无限叠层' : buff.max_stack > 1 ? `可叠 ${buff.max_stack} 层` : '不可叠层'
|
||||
const targetTxt = '缺省挂施法者自身,可用 buff_target 改全体友方'
|
||||
if (buff.is_control) {
|
||||
return { title: `「${buff.name}」为控制类`, desc: `无需配置 buff_value(不生效)。${targetTxt}。${stackTxt},持续 ${buff.duration}s。` }
|
||||
}
|
||||
if (buff.tick) {
|
||||
const scaleTxt = buff.tick.scale_by_ap_pct > 0 ? `,并按自身 ap 缩放(每100 ap +${buff.tick.scale_by_ap_pct}%)` : ',不随 ap 缩放'
|
||||
return { title: `「${buff.name}」为周期效果 buff`, desc: `buff_value 正值=每 ${buff.tick.interval}s 回血,负值=自伤(如自残出血)。取值 10 → 每跳约回 10 血${scaleTxt}。${targetTxt}。${stackTxt},持续 ${buff.duration}s。` }
|
||||
}
|
||||
if (buff.modifiers?.length) {
|
||||
const mod = buff.modifiers[0]
|
||||
return { title: `「${buff.name}」为属性修饰 buff`, desc: `buff_value 覆写修饰数值(正=增强,负=削弱),作用于属性 ${mod.attr}(${mod.op === 1 ? '百分比' : '固定值'})。${targetTxt}。${stackTxt},持续 ${buff.duration}s。` }
|
||||
}
|
||||
return { title: `「${buff.name}」`, desc: `${targetTxt}。${stackTxt},持续 ${buff.duration}s。` }
|
||||
})
|
||||
|
||||
// 本地行数组,允许 key 为空
|
||||
const rows = ref(Object.entries(props.modelValue || {}).map(([key, value]) => ({ key, value })))
|
||||
|
||||
@@ -248,4 +336,9 @@ function remove(idx) {
|
||||
.proc-skill-editor { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; flex: 1; }
|
||||
.proc-skill-overrides { width: 100%; padding-left: 12px; border-left: 2px solid var(--el-border-color); }
|
||||
.proc-skill-label { font-size: 12px; color: var(--el-text-color-secondary); }
|
||||
/* debuff 取值提示:压缩内边距并用 12px 小字,与编辑器其他辅助文本一致 */
|
||||
.hint-alert { padding: 4px 8px; }
|
||||
.hint-alert :deep(.el-alert__title) { font-size: 12px; line-height: 1.4; }
|
||||
.hint-alert :deep(.el-alert__description) { font-size: 12px; line-height: 1.4; margin-top: 2px; }
|
||||
.hint-alert :deep(.el-alert__icon) { font-size: 14px; width: 14px; }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user