Files
bl/logic/service/fight/effect/effect_520.go
昔念 d367f9d1d4
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
41
2026-03-07 23:54:01 +08:00

30 lines
627 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 520 - 有n%的几率使自己害怕
type Effect520 struct {
node.EffectNode
}
func (e *Effect520) OnSkill() bool {
chance := e.Args()[0].IntPart()
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
fearEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Fear))
if fearEffect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, fearEffect)
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 520, &Effect520{})
}