feat(editor): 完成英雄配置编辑器全功能开发
本提交新增完整的英雄配置可视化编辑器: 1. 初始化前后端项目结构,配置monorepo工作区 2. 实现后端API服务,支持读取游戏配置、导出hexport.ts文件 3. 开发前端Vue应用,包含完整的英雄增删改、属性配置、技能编辑功能 4. 实现多类型编辑器组件:基础属性、普攻/大招编辑、触发技能、光环、复活、属性加成等 5. 清理冗余的配置元数据文件
This commit is contained in:
117
put/web/src/constants.js
Normal file
117
put/web/src/constants.js
Normal file
@@ -0,0 +1,117 @@
|
||||
// 共享常量与工具
|
||||
export const HERO_ROLES = [
|
||||
{ key: 'Tank', label: '坦克', value: 0 },
|
||||
{ key: 'Warrior', label: '战士', value: 1 },
|
||||
{ key: 'Assassin', label: '刺客', value: 2 },
|
||||
{ key: 'Archer', label: '射手', value: 3 },
|
||||
{ key: 'Mage', label: '法师', value: 4 },
|
||||
{ key: 'Support', label: '辅助', value: 5 },
|
||||
]
|
||||
|
||||
export const GROW_TYPES = [
|
||||
{ key: 'Tank', label: '坦克', value: 0 },
|
||||
{ key: 'Warrior', label: '战士', value: 1 },
|
||||
{ key: 'Assassin', label: '刺客', value: 2 },
|
||||
{ key: 'Mage', label: '法师', value: 3 },
|
||||
{ key: 'Support', label: '辅助', value: 4 },
|
||||
{ key: 'Archer', label: '射手', value: 5 },
|
||||
]
|
||||
|
||||
export const H_TYPES = [
|
||||
{ key: 'Melee', label: '近战', value: 0 },
|
||||
{ key: 'Mid', label: '中程', value: 1 },
|
||||
{ key: 'Long', label: '远程', value: 2 },
|
||||
]
|
||||
|
||||
export const ATK_SPEEDS = [
|
||||
{ key: 'VeryFast', label: '极速(0.75s)', value: 1 },
|
||||
{ key: 'Fast', label: '快速(0.90s)', value: 2 },
|
||||
{ key: 'Normal', label: '中速(1.05s)', value: 3 },
|
||||
{ key: 'Slow', label: '慢速(1.20s)', value: 4 },
|
||||
{ key: 'VerySlow', label: '极慢(1.50s)', value: 5 },
|
||||
]
|
||||
|
||||
// 按职业映射普攻底座
|
||||
export const ROLE_ATK_SKILL = {
|
||||
Tank: [6004],
|
||||
Warrior: [6004],
|
||||
Assassin: [6001, 6002, 6003],
|
||||
Archer: [6006, 6007, 6008],
|
||||
Mage: [6009, 6010, 6011, 6012],
|
||||
Support: [6009, 6010, 6011, 6012],
|
||||
}
|
||||
|
||||
// 按职业映射大招底座
|
||||
export const ROLE_ULT_SKILL = {
|
||||
Tank: [6100, 6101, 6102, 6103, 6104],
|
||||
Warrior: [6100, 6101, 6102, 6103, 6104],
|
||||
Assassin: [6150, 6151],
|
||||
Archer: [6150, 6151],
|
||||
Mage: [6200, 6201, 6202, 6203, 6204],
|
||||
Support: [6200, 6201, 6202, 6203, 6204],
|
||||
}
|
||||
|
||||
// 辅助类技能(任意职业可用作大招)
|
||||
export const SUPPORT_ULT = [6301, 6302, 6412, 6501]
|
||||
|
||||
export function defaultHero() {
|
||||
return {
|
||||
uuid: 5001,
|
||||
name: '',
|
||||
comment: '',
|
||||
path: '',
|
||||
rarity: 4,
|
||||
roleKey: 'Mage',
|
||||
growKey: 'Mage',
|
||||
typeKey: 'Long',
|
||||
statBase: { hp: 0, ap: 0, def: 0 },
|
||||
dis: null,
|
||||
speed: null,
|
||||
skills: [], // [{uuid,name,cd,cdExpr,overrides,desc,lv_entries:[{lv,s_lv,overrides,desc}]}]
|
||||
atking: {}, // {uuid:[{lv,s_lv,name,t_num,overrides,desc}]}
|
||||
atked: {},
|
||||
fstart: {},
|
||||
dead: {},
|
||||
field: [], // [{lv,uuids:[{uuid,value,name}],desc}]
|
||||
revive: [], // [{lv,s_uuid,r_num,upr,name,desc}]
|
||||
ap_bonus: [],
|
||||
hp_bonus: [],
|
||||
def_bonus: [],
|
||||
info: '',
|
||||
}
|
||||
}
|
||||
|
||||
export function defaultSkill(uuid) {
|
||||
return {
|
||||
uuid,
|
||||
name: '',
|
||||
cd: 1.05,
|
||||
cdExpr: 'AtkSpeedSet[AtkSpeedLv.Normal].cd',
|
||||
overrides: {},
|
||||
desc: '',
|
||||
lv_entries: [],
|
||||
}
|
||||
}
|
||||
|
||||
export function defaultTriggerEntry(lv = 6) {
|
||||
return { lv, s_lv: 1, name: '', t_num: 3, overrides: {}, desc: '' }
|
||||
}
|
||||
|
||||
// overrides 可用键说明
|
||||
export const OVERRIDE_KEYS = [
|
||||
{ key: 'ap', label: 'ap 攻击百分比' },
|
||||
{ key: 'hit_count', label: 'hit_count 命中次数' },
|
||||
{ key: 'hitcd', label: 'hitcd 持续伤害间隔' },
|
||||
{ key: 'crt', label: 'crt 暴击率' },
|
||||
{ key: 'frz', label: 'frz 冰冻概率' },
|
||||
{ key: 'stun', label: 'stun 击晕概率' },
|
||||
{ key: 'para', label: 'para 麻痹概率' },
|
||||
{ key: 'bck', label: 'bck 击退' },
|
||||
{ key: 'bck_chance', label: 'bck_chance 击退概率' },
|
||||
{ key: 'timed_buff_id', label: 'timed_buff_id 计时buff' },
|
||||
{ key: 'buff_value', label: 'buff_value 修饰数值' },
|
||||
{ key: 'buff_duration', label: 'buff_duration 持续时间' },
|
||||
{ key: 'summon_count', label: 'summon_count 召唤数' },
|
||||
{ key: 'num', label: 'num 额外释放次数' },
|
||||
{ key: 'call_hero', label: 'call_hero 召唤英雄id' },
|
||||
]
|
||||
Reference in New Issue
Block a user