Files
bl/logic/service/fight/effect/effect_408_463.go
xinian de8ce9fc81
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
feat: 新增多个战斗效果并修复逻辑问题
2026-03-07 14:51:32 +08:00

39 lines
753 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
func init() {
input.InitEffect(input.EffectType.Skill, 408, &Effect408{})
input.InitEffect(input.EffectType.Skill, 463, &Effect408{})
}
type Effect408 struct {
node.EffectNode
}
func (e *Effect408) DamageSubEx(t *info.DamageZone) bool {
if t.Type != info.DamageType.Red {
return true
}
if t.Damage.Cmp(e.Args()[1]) > 0 {
t.Damage = t.Damage.Sub(e.Args()[1])
} else {
t.Damage = alpacadecimal.Zero
}
return true
}
func (e *Effect408) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
}