feat: 新增预设库管理与一键创建英雄向导

1.  新增服务端模板持久化接口,支持触发/光环预设的读写
2.  前端新增预设库管理页面,支持增删改查触发/光环预设
3.  新增英雄创建向导,支持按职业快速生成英雄并套用预设
4.  调整本地开发端口与代理地址
5.  补充职业默认配置与攻速映射等常量定义
This commit is contained in:
panFD
2026-09-13 11:43:18 +08:00
parent d86f54e7a4
commit d3e7438bca
8 changed files with 973 additions and 9 deletions

View File

@@ -54,6 +54,34 @@ export const ROLE_ULT_SKILL = {
// 辅助类技能(任意职业可用作大招)
export const SUPPORT_ULT = [6301, 6302, 6407, 6412, 6413, 6414, 6415, 6416, 6501, 6514, 6515, 6516, 6517, 6518, 6519]
// 职业默认值(新建英雄向导用):形态/攻速/稀有度/三维偏移
// 数值取自现有英雄样本中位数,向导内可手动微调
export const ROLE_DEFAULTS = {
Tank: { typeKey: 'Melee', atkSpeed: 'Slow', rarity: 4, statBase: { hp: 20, ap: 0, def: 10 } },
Warrior: { typeKey: 'Melee', atkSpeed: 'Slow', rarity: 4, statBase: { hp: 5, ap: 20, def: 5 } },
Assassin: { typeKey: 'Mid', atkSpeed: 'Fast', rarity: 4, statBase: { hp: 0, ap: 30, def: 0 } },
Archer: { typeKey: 'Long', atkSpeed: 'Normal', rarity: 4, statBase: { hp: 0, ap: 30, def: 0 } },
Mage: { typeKey: 'Long', atkSpeed: 'Slow', rarity: 4, statBase: { hp: -5, ap: 10, def: 0 } },
Support: { typeKey: 'Long', atkSpeed: 'Normal', rarity: 4, statBase: { hp: 10, ap: 20, def: 0 } },
}
// 攻速档 → cd 数值 / cdExpr 表达式 映射(向导生成普攻用)
export const ATK_SPEED_MAP = {
VeryFast: { cd: 0.75, cdExpr: 'AtkSpeedSet[AtkSpeedLv.VeryFast].cd' },
Fast: { cd: 0.9, cdExpr: 'AtkSpeedSet[AtkSpeedLv.Fast].cd' },
Normal: { cd: 1.05, cdExpr: 'AtkSpeedSet[AtkSpeedLv.Normal].cd' },
Slow: { cd: 1.2, cdExpr: 'AtkSpeedSet[AtkSpeedLv.Slow].cd' },
VerySlow: { cd: 1.5, cdExpr: 'AtkSpeedSet[AtkSpeedLv.VerySlow].cd' },
}
// 触发组 key 列表(向导/模板管理共用)
export const TRIGGER_GROUPS = [
{ key: 'atking', label: 'atking 攻击后' },
{ key: 'atked', label: 'atked 受击后' },
{ key: 'fstart', label: 'fstart 战斗开始' },
{ key: 'dead', label: 'dead 死亡后' },
]
export function defaultHero() {
return {
uuid: 5001,
@@ -97,6 +125,29 @@ export function defaultTriggerEntry(lv = 4) {
return { lv, s_lv: 1, name: '', t_num: 3, overrides: {}, desc: '' }
}
// 触发预设工厂:预设是跨职业复用的触发组条目(group + 技能底座 uuid + 完整 entry)
export function defaultTriggerPreset(group = 'atking') {
return {
id: `tp-${group}-${Date.now()}`,
label: '',
group,
uuid: null,
tags: [],
entry: defaultTriggerEntry(4),
}
}
// 光环预设工厂:一个预设 = 解锁等级 + 多个光环词条
export function defaultFieldPreset() {
return {
id: `fp-${Date.now()}`,
label: '',
tags: [],
lv: 4,
uuids: [],
}
}
// overrides 可用键说明
export const OVERRIDE_KEYS = [
{ key: 'ap', label: 'ap 攻击百分比' },