Files
bl/logic/service/fight/effect/effect_101.go
2025-11-13 23:48:34 +08:00

35 lines
610 B
Go

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/shopspring/decimal"
)
/**
* 给对手造成伤害时,伤害数值的 n%恢复自身体力
*/
type Effect101 struct {
node.EffectNode
}
func init() {
input.InitEffect(input.EffectType.Skill, 101, &Effect101{})
}
// 命中之后
func (e *Effect101) OnSkill() bool {
if !e.Hit() {
return true
}
e.Input.Heal(
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.DamageZone.Damage.Div(decimal.NewFromInt(int64(e.Args()[0]))),
)
return true
}