Files
bl/logic/service/fight/effect/effect_508.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

51 lines
803 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, 508, &Effect508{})
}
type Effect508 struct {
node.EffectNode
Can bool
}
func (e *Effect508) OnSkill() bool {
e.Can = true
return true
}
func (e *Effect508) DamageSubEx(t *info.DamageZone) bool {
if !e.Can {
return true
}
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 *Effect508) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
}