Files
bl/logic/service/fight/effect/effect_1.go

36 lines
587 B
Go
Raw Normal View History

package effect
import (
2025-09-29 02:40:35 +08:00
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
2025-09-29 02:40:35 +08:00
"github.com/alpacahq/alpacadecimal"
)
/**
* 给予对象损伤一半会回复自己的体力
*/
type Effect1 struct {
node.EffectNode
}
func init() {
ret := &Effect1{}
input.InitEffect(input.EffectType.Skill, 1, ret)
}
// 命中之后
func (e *Effect1) OnSkill() bool {
if !e.Hit() {
return true
}
2025-09-29 02:40:35 +08:00
e.Input.Heal(
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(alpacadecimal.NewFromInt(2)),
2025-09-29 02:40:35 +08:00
)
return true
}