Files
bl/logic/service/fight/effect/576.go
xinian 875ad668aa
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 实现战斗效果逻辑和接口重构
2026-03-28 21:57:22 +08:00

31 lines
756 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"github.com/alpacahq/alpacadecimal"
)
// Effect 576: {0}回合内免疫低于{1}的攻击伤害
type Effect576 struct {
RoundEffectArg0Base
}
// DamageFloor 在计算伤害时触发减少低于阈值的伤害至0
func (d *Effect576) DamageFloor(zone *info.DamageZone) bool {
// 如果伤害类型是减少体力的类型并且伤害值低于阈值则将伤害设为0
if (zone.Type == info.DamageType.Red || zone.Type == info.DamageType.Percent) &&
zone.Damage.Cmp(d.Args()[1]) < 0 {
zone.Damage = alpacadecimal.Zero
}
return true
}
// SetArgs 设置参数
func init() {
input.InitEffect(input.EffectType.Skill, 576, &Effect576{})
}