feat(trigger-editor): 添加触发组概率与保底配置功能

1. 新增触发组条目字段t_chance(触发概率)和pity_add(保底叠加),仅攻击/受击组生效
2. 为TriggerGroupEditor传入分组标识,动态显示概率配置表单项
3. 新增条目创建时继承同组末档概率参数的逻辑
4. 更新常量定义与文档说明,补充概率参数使用规则
5. 在前端展示和服务端导出中添加概率相关信息展示
This commit is contained in:
pan
2026-09-21 16:01:41 +08:00
parent be6d941b90
commit cd9e7296a1
9 changed files with 93 additions and 28 deletions

View File

@@ -215,6 +215,9 @@ function renderSingleHero(h) {
if (e.s_lv) eparts.push(`s_lv: SkillLv.Lv${e.s_lv}`)
if (e.name) eparts.push(`name: ${JSON.stringify(e.name)}`)
eparts.push(`t_num: ${e.t_num}`)
// 概率参数:仅攻/受击触发消费;缺省(100/0)不输出,保持生成 TS 干净
if (e.t_chance != null && e.t_chance < 100) eparts.push(`t_chance: ${e.t_chance}`)
if (e.pity_add != null && e.pity_add > 0) eparts.push(`pity_add: ${e.pity_add}`)
if (e.overrides && Object.keys(e.overrides).length) eparts.push(`overrides: ${serializeOverrides(e.overrides)}`)
if (e.desc) eparts.push(`desc: ${JSON.stringify(e.desc)}`)
push(` { ${eparts.join(', ')} },`)
@@ -351,6 +354,8 @@ function csvTrigger(grp) {
const name = e.name || base?.name || ''
const ov = e.overrides || {}
const parts = [`t_num${e.t_num}`]
// 攻/受击组附带概率信息(缺省 100 不展示)
if (e.t_chance != null && e.t_chance < 100) parts.push(`概率${e.t_chance}%`)
if (ov.ap != null) parts.push(`ap${ov.ap}`)
const desc = e.desc || ''
return `${sid} ${name}(${parts.join(';')}):${desc}`