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

42 lines
744 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// Effect 49: 可以抵挡{0}点伤害
type Effect49 struct {
node.EffectNode
}
func (e *Effect49) DamageSubEx(t *info.DamageZone) bool {
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if t.Type != info.DamageType.Red {
return true
}
if t.Damage.Cmp(e.Args()[0]) > -1 {
t.Damage = t.Damage.Sub(e.Args()[0])
} else {
t.Damage = alpacadecimal.Zero
}
return true
}
// ---- 注册所有效果 ----
func init() {
input.InitEffect(input.EffectType.Skill, 49, &Effect49{})
}