Files
bl/logic/service/fight/effect/169.go
xinian 73d7f7f062
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 新增战斗效果和修复登录逻辑
2026-03-08 11:22:00 +08:00

35 lines
801 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/input"
"blazing/logic/service/fight/node"
)
// 169 - n回合内每回合额外附加m%几率令对手XX
type Effect169 struct {
node.EffectNode
}
func (e *Effect169) OnSkill() bool {
chance := e.Args()[1].IntPart()
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
// 添加异常状态
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[2].IntPart())) // 以麻痹为例
if statusEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
}
return true
}
func (e *Effect169) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.Skill, 169, &Effect169{})
}