30 lines
644 B
Go
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{})
|
|
|
|
}
|