Files
bl/logic/service/fight/effect/149.go
xinian 875ad668aa
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 实现战斗效果逻辑和接口重构
2026-03-28 21:57:22 +08:00

45 lines
1.1 KiB
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"
)
// Effect 149: 命中后,{0}%令对方{1}{2}%令对方{3}
type Effect149 struct {
node.EffectNode
}
func (e *Effect149) OnSkill() bool {
// n%令对方xx
firstChance := e.Args()[0].IntPart()
success1, _, _ := e.Input.Player.Roll(int(firstChance), 100)
if success1 {
effectType1 := int(e.Args()[2].IntPart()) // 第一个异常状态类型
statusEffect1 := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType1)
if statusEffect1 != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect1)
}
}
// m%令对方XX
secondChance := e.Args()[1].IntPart()
success2, _, _ := e.Input.Player.Roll(int(secondChance), 100)
if success2 {
effectType2 := int(e.Args()[3].IntPart()) // 第二个异常状态类型
statusEffect2 := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType2)
if statusEffect2 != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect2)
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 149, &Effect149{})
}