This commit is contained in:
29
logic/service/fight/effect/effect_520.go
Normal file
29
logic/service/fight/effect/effect_520.go
Normal file
@@ -0,0 +1,29 @@
|
||||
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{})
|
||||
}
|
||||
Reference in New Issue
Block a user