refactor(hero): 重构额外属性加成系统,统一为bonus字段

1.  将原ap_bonus/hp_bonus/def_bonus三个字段合并为通用的bonus数组结构
2.  新增多属性同时配置能力,支持hp/ap/def百分比加成与crt/frz/stun/para固定百分点加成
3.  更新所有前端编辑器、服务端渲染与游戏运行时逻辑适配新配置格式
4.  添加数据兼容迁移逻辑,自动处理旧版英雄配置数据
This commit is contained in:
panFD
2026-09-07 23:05:30 +08:00
parent a1c8f46c50
commit ed738d2e30
10 changed files with 180 additions and 94 deletions

View File

@@ -76,9 +76,7 @@ export function defaultHero() {
dead: {},
field: [], // [{lv,uuids:[{uuid,value,name}],desc}]
// revive 已纳入 dead 触发组,通过 overrides.revive_hp / revive_count 配置
ap_bonus: [],
hp_bonus: [],
def_bonus: [],
bonus: [], // [{lv, attrs:{hp?,ap?,def?,crt?,frz?,stun?,para?}}] hp/ap/def 为百分比,概率类为固定百分点
info: '',
}
}
@@ -143,6 +141,17 @@ export const OVERRIDE_KEYS = [
{ key: 'icon', label: 'icon 英雄语境图标(覆写 SkillSet.icon)', type: 'string' },
]
// bonus attrs 可用键:hp/ap/def 按"基础+成长"快照百分比加成;crt/frz/stun/para 为固定百分点累加
export const BONUS_ATTR_KEYS = [
{ key: 'hp', label: 'hp 生命%' },
{ key: 'ap', label: 'ap 攻击%' },
{ key: 'def', label: 'def 防御%' },
{ key: 'crt', label: 'crt 暴击率(百分点)' },
{ key: 'frz', label: 'frz 冰冻(百分点)' },
{ key: 'stun', label: 'stun 击晕(百分点)' },
{ key: 'para', label: 'para 麻痹(百分点)' },
]
// icon 覆写常用候选(SkillSet 各底座图标 + 通用图标),可在输入框直接键入其他帧名
export const SKILL_ICON_OPTIONS = [
'Stat_Attack_01', 'Stat_RangedAttack', 'Stat_Tripleshot',