feat(fight): 重构战斗效果触发机制与ID管理
- 统一将 Skill_Hit_Pre 和 Skill_Hit_Pre_ex 方法重命名为 Action_start 和 Action_start_ex - 新增 Action_end 和 Action_end_ex 接口方法,完善行动周期控制 - 修改效果ID生成逻辑,使用 EffectIDCombiner 替代简单整数运算,提升扩展性 - 调整状态类效果判断方式,通过前缀匹配识别状态类型 - 增加随机持续时间和参数设置功能,增强部分效果的表现力 - 优化战斗流程中效果执行时机,确保行为前后逻辑完整闭环
This commit is contained in:
@@ -59,9 +59,11 @@ func (e *EffectConditionalAddDamage) OnSkill() bool {
|
||||
if !e.Hit() {
|
||||
return true
|
||||
}
|
||||
_, _, pr := input.EffectIDCombiner{}.Split(e.ID())
|
||||
ids, _ := input.NewEffectCombined(input.EffectType.Sub, 0, pr)
|
||||
|
||||
// 2. 获取当前效果ID对应的条件函数
|
||||
cond, ok := conditionMap[e.ID()-int(input.EffectType.Skill)]
|
||||
cond, ok := conditionMap[int(ids.GetSuffix())]
|
||||
if !ok {
|
||||
return true // 无对应条件函数,不触发
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user