2025-11-14 03:21:00 +08:00
|
|
|
package effect
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"blazing/logic/service/fight/info"
|
|
|
|
|
"blazing/logic/service/fight/input"
|
|
|
|
|
"blazing/logic/service/fight/node"
|
2026-01-25 03:40:29 +08:00
|
|
|
|
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
2025-11-14 03:21:00 +08:00
|
|
|
)
|
|
|
|
|
|
2025-11-14 23:09:16 +08:00
|
|
|
// 可以抵挡n点伤害
|
2025-11-14 03:21:00 +08:00
|
|
|
// ---- Effect49 ----
|
|
|
|
|
type Effect49 struct {
|
|
|
|
|
node.EffectNode
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-04 22:10:34 +08:00
|
|
|
func (e *Effect49) DamageSubEx(t *info.DamageZone) bool {
|
2026-01-04 21:41:10 +08:00
|
|
|
|
2025-11-14 03:21:00 +08:00
|
|
|
if e.Ctx().SkillEntity == nil {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
|
|
|
return true
|
|
|
|
|
}
|
2026-01-25 03:40:29 +08:00
|
|
|
if t.Type != info.DamageType.Red {
|
|
|
|
|
return true
|
2025-11-14 03:21:00 +08:00
|
|
|
|
2026-01-25 03:40:29 +08:00
|
|
|
}
|
2025-11-14 03:21:00 +08:00
|
|
|
|
2026-01-25 03:40:29 +08:00
|
|
|
if t.Damage.Cmp(e.Args()[0]) > -1 {
|
|
|
|
|
t.Damage = t.Damage.Sub(e.Args()[0])
|
|
|
|
|
} else {
|
|
|
|
|
t.Damage = alpacadecimal.Zero
|
2025-11-14 03:21:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ---- 注册所有效果 ----
|
|
|
|
|
func init() {
|
|
|
|
|
input.InitEffect(input.EffectType.Skill, 49, &Effect49{})
|
|
|
|
|
}
|