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

33 lines
727 B
Go
Raw Normal View History

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 450 - 随机恢复m到n点体力
type Effect450 struct {
node.EffectNode
}
func (e *Effect450) OnSkill() bool {
minHeal := e.Args()[0].IntPart()
maxHeal := e.Args()[1].IntPart()
// 随机值在m到n之间
rangeVal := maxHeal - minHeal
randomVal := int64(e.Input.FightC.GetRand().Int31n(int32(rangeVal)) + int32(minHeal))
healAmount := alpacadecimal.NewFromInt(randomVal)
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 450, &Effect450{})
}