refactor(fight/effect): 重构效果触发时机处理,统一命中前/后接口并移除冗余方法

This commit is contained in:
1
2025-09-24 20:01:12 +00:00
parent 3314c11b48
commit 5a8d84ed40
7 changed files with 22 additions and 42 deletions

View File

@@ -42,15 +42,17 @@ func init() {
}
func (e *Effect10) OnHit(opp *input.Input, skill *info.SkillEntity) {
t, _, _ := e.Input.Player.Roll(e.EffectNode.SideEffectArgs[0], 100)
if t {
if e.Hit() {
t, _, _ := e.Input.Player.Roll(e.EffectNode.SideEffectArgs[0], 100)
if t {
t1 := e.Input.FightC.GetRand().Int31n(3)
t1 := e.Input.FightC.GetRand().Int31n(3)
eff := input.Geteffect(input.EffectType.Status, int(e.Status))
eff.Effect.Duration(int(t1 + 1))
e.Input.AddEffect(eff)
eff := input.Geteffect(input.EffectType.Status, int(e.Status))
eff.Effect.Duration(int(t1 + 1))
e.Input.AddEffect(eff)
}
}
}