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

36 lines
581 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/shopspring/decimal"
)
/**
* 给予对象损伤一半会回复自己的体力
*/
type Effect1 struct {
node.EffectNode
}
func init() {
ret := &Effect1{}
input.InitEffect(input.EffectType.Skill, 1, ret)
}
// 命中之后
func (e *Effect1) OnSkill(ctx input.Ctx) bool {
if !e.Hit() {
return true
}
2025-09-29 02:40:35 +08:00
e.Input.Heal(
2025-10-03 20:20:17 +08:00
&action.SelectSkillAction{}, e.Input.DamageZone.Damage.Div(decimal.NewFromInt(2)),
2025-09-29 02:40:35 +08:00
)
return true
}