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

45 lines
676 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"github.com/alpacahq/alpacadecimal"
)
func init() {
input.InitEffect(input.EffectType.Skill, 508, &Effect508{})
}
// Effect 508: 减少{0}点下回合所受的伤害
type Effect508 struct {
FixedDuration1Base
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()[0]) > 0 {
t.Damage = t.Damage.Sub(e.Args()[0])
} else {
t.Damage = alpacadecimal.Zero
}
return true
}