``` refactor(fight): 重构状态效果初始化逻辑,统一使用InitEffect方法并内置随机持续回合
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user