35 lines
801 B
Go
35 lines
801 B
Go
|
|
package effect
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"blazing/logic/service/fight/input"
|
|||
|
|
"blazing/logic/service/fight/node"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// 169 - n回合内,每回合额外附加m%几率令对手XX
|
|||
|
|
type Effect169 struct {
|
|||
|
|
node.EffectNode
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func (e *Effect169) OnSkill() bool {
|
|||
|
|
|
|||
|
|
chance := e.Args()[1].IntPart()
|
|||
|
|
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
|||
|
|
if success {
|
|||
|
|
// 添加异常状态
|
|||
|
|
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[2].IntPart())) // 以麻痹为例
|
|||
|
|
if statusEffect != nil {
|
|||
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
return true
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func (e *Effect169) SetArgs(t *input.Input, a ...int) {
|
|||
|
|
e.EffectNode.SetArgs(t, a...)
|
|||
|
|
e.EffectNode.Duration(a[0]) // 持续n回合
|
|||
|
|
}
|
|||
|
|
func init() {
|
|||
|
|
input.InitEffect(input.EffectType.Skill, 169, &Effect169{})
|
|||
|
|
|
|||
|
|
}
|