35 lines
636 B
Go
35 lines
636 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
func init() {
|
|
t := &Effect127{}
|
|
|
|
input.InitEffect(input.EffectType.Skill, 127, t)
|
|
|
|
}
|
|
|
|
// Effect 127: {0}%的概率,{1}回合内受到的伤害减半
|
|
type Effect127 struct {
|
|
RoundEffectSideArg1Base
|
|
}
|
|
|
|
func (e *Effect127) DamageDivEx(t *info.DamageZone) bool {
|
|
|
|
if t.Type != info.DamageType.Red {
|
|
return true
|
|
}
|
|
// 概率判定
|
|
ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
|
if !ok {
|
|
return true
|
|
}
|
|
t.Damage = t.Damage.Div(alpacadecimal.NewFromInt(2))
|
|
return true
|
|
}
|