Files
bl/logic/service/fight/effect/effect_117.go

54 lines
1.0 KiB
Go
Raw Normal View History

2025-11-08 18:37:11 +08:00
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
/**
* n回合若自己先手则m%几率让对手害怕1到3回合
*/
func init() {
t := &Effect117{
EffectNode: node.EffectNode{},
}
2025-11-21 05:47:51 +00:00
2025-11-08 18:37:11 +08:00
input.InitEffect(input.EffectType.Skill, 117, t)
}
type Effect117 struct {
node.EffectNode
}
// 默认添加回合
func (e *Effect117) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
}
2025-11-11 05:54:24 +00:00
func (e *Effect117) OnSkill() bool {
2025-11-08 18:37:11 +08:00
if e.Input.FightC.IsFirst(e.Input.Player) {
// 概率判定
ok, _, _ := e.Input.Player.Roll(e.EffectNode.SideEffectArgs[1], 100)
if !ok {
return true
}
// 获取状态效果
eff := input.Geteffect(input.EffectType.Status, int(info.PetStatus.Fear))
if eff == nil {
return true
}
2025-11-10 08:25:40 +00:00
duration := int(e.Input.FightC.GetRand().Int31n(3)) // 默认随机 1~3 回合
2025-11-08 18:37:11 +08:00
eff.Duration(duration)
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
2025-11-08 18:37:11 +08:00
}
return true
}