32 lines
674 B
Go
32 lines
674 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
// Effect 173: 先出手时,{0}%概率令对方{1}
|
|
type Effect173 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect173) OnSkill() bool {
|
|
|
|
if e.IsFirst() { // 先出手
|
|
chance := e.Args()[0].IntPart()
|
|
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
|
if success {
|
|
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart())) // 以麻痹为例
|
|
if statusEffect != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
|
}
|
|
}
|
|
}
|
|
|
|
return true
|
|
}
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 173, &Effect173{})
|
|
|
|
}
|