Files
bl/logic/service/fight/effect/effect_450.go
xinian 3dd2d40c50
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 新增多个战斗技能效果实现
2026-03-08 10:34:23 +08:00

33 lines
727 B
Go

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{})
}