33 lines
824 B
Go
33 lines
824 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
// Effect 572: 攻击对手时若对手处于{0}状态,则{1}%使对手{2}
|
|
type Effect572 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect572) OnSkill() bool {
|
|
triggerStatus := info.EnumPetStatus(e.Args()[0].IntPart())
|
|
if e.Ctx().Opp.StatEffect_Exist(triggerStatus) {
|
|
chance := e.Args()[1].IntPart()
|
|
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
|
if success {
|
|
targetStatus := int(e.Args()[2].IntPart())
|
|
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, targetStatus)
|
|
if statusEffect != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
|
}
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 572, &Effect572{})
|
|
}
|