42 lines
744 B
Go
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{})
|
|
}
|