44 lines
802 B
Go
44 lines
802 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
func init() {
|
|
t := &Effect127{
|
|
EffectNode: node.EffectNode{},
|
|
}
|
|
|
|
input.InitEffect(input.EffectType.Skill, 127, t)
|
|
|
|
}
|
|
|
|
type Effect127 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
// 默认添加回合
|
|
func (e *Effect127) SetArgs(t *input.Input, a ...int) {
|
|
|
|
e.EffectNode.SetArgs(t, a...)
|
|
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[1])
|
|
|
|
}
|
|
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
|
|
}
|