45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/input"
|
||
"blazing/logic/service/fight/node"
|
||
)
|
||
|
||
// Effect 149: 命中后,{0}%令对方{1},{2}%令对方{3}
|
||
type Effect149 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect149) OnSkill() bool {
|
||
|
||
// n%令对方xx
|
||
firstChance := e.Args()[0].IntPart()
|
||
success1, _, _ := e.Input.Player.Roll(int(firstChance), 100)
|
||
if success1 {
|
||
effectType1 := int(e.Args()[2].IntPart()) // 第一个异常状态类型
|
||
|
||
statusEffect1 := e.CarrierInput().InitEffect(input.EffectType.Status, effectType1)
|
||
if statusEffect1 != nil {
|
||
e.TargetInput().AddEffect(e.CarrierInput(), statusEffect1)
|
||
}
|
||
}
|
||
|
||
// m%令对方XX
|
||
secondChance := e.Args()[1].IntPart()
|
||
success2, _, _ := e.Input.Player.Roll(int(secondChance), 100)
|
||
if success2 {
|
||
effectType2 := int(e.Args()[3].IntPart()) // 第二个异常状态类型
|
||
|
||
statusEffect2 := e.CarrierInput().InitEffect(input.EffectType.Status, effectType2)
|
||
if statusEffect2 != nil {
|
||
e.TargetInput().AddEffect(e.CarrierInput(), statusEffect2)
|
||
}
|
||
}
|
||
|
||
return true
|
||
}
|
||
func init() {
|
||
input.InitEffect(input.EffectType.Skill, 149, &Effect149{})
|
||
|
||
}
|