Files
bl/logic/service/fight/effect/effect_406.go
xinian 875ad668aa
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 实现战斗效果逻辑和接口重构
2026-03-28 21:57:22 +08:00

30 lines
644 B
Go

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"github.com/alpacahq/alpacadecimal"
)
// Effect 406: {0}回合内受到攻击{1}%概率回复{2}点体力
type Effect406 struct {
RoundEffectArg0Base
}
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 init() {
input.InitEffect(input.EffectType.Skill, 406, &Effect406{})
}