Files
bl/logic/service/fight/effect/effect_117.go
xinian 6c76b050b3 refactor: 重构战斗方法调用方式
将战斗控制器的方法调用重构为直接在玩家接口上调用,
以简化代码结构并消除对 FightC 的直接依赖。
2026-04-29 03:39:21 +08:00

47 lines
878 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"github.com/gogf/gf/v2/util/grand"
)
/**
* n回合若自己先手则m%几率让对手害怕1到3回合
*/
func init() {
t := &Effect117{}
input.InitEffect(input.EffectType.Skill, 117, t)
}
// Effect 117: 5回合内如果先出手50%概率对手害怕1到3回合
type Effect117 struct {
RoundEffectSideArg0Base
}
// 默认添加回合
func (e *Effect117) OnSkill() bool {
if e.Input.Player.IsFirst() {
// 概率判定
ok, _, _ := e.Input.Player.Roll(e.EffectNode.SideEffectArgs[1], 100)
if !ok {
return true
}
// 获取状态效果
eff := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Fear))
if eff == nil {
return true
}
eff.Duration(grand.Intn(3))
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}