``` refactor(fight): 重构状态效果初始化逻辑,统一使用InitEffect方法并内置随机持续回合

This commit is contained in:
1
2025-12-11 19:12:54 +00:00
parent 8eb0a1324b
commit 5ca43fe21f
16 changed files with 42 additions and 72 deletions

View File

@@ -1,7 +1,6 @@
package effect
import (
"blazing/common/utils"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
@@ -26,8 +25,8 @@ type Effect8 struct {
// DamageFloor 伤害落实前触发,限制最大伤害
func (e *Effect8) DamageFloor(t *info.DamageZone) bool {
if t.Type == info.DamageType.Red {
t.Damage = alpacadecimal.NewFromInt(utils.Min(t.Damage.IntPart(),
int64(e.Ctx().Opp.CurrentPet.Info.Hp)-1))
t.Damage = alpacadecimal.Min(t.Damage, e.Ctx().Opp.CurrentPet.GetHP().Sub(alpacadecimal.NewFromInt(1)))
e.max = t.Damage
}