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

35 lines
801 B
Go

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 406 - 2 n回合内受到攻击m%几率回复k点体力
type Effect406 struct {
node.EffectNode
}
func (e *Effect406) Skill_Use_ex() bool {
chance := e.Args()[1].IntPart()
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
healAmount := alpacadecimal.NewFromInt(int64(e.Args()[2].IntPart()))
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
}
return true
}
func (e *Effect406) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.Skill, 406, &Effect406{})
}