Files
bl/logic/service/fight/effect/149.go
xinian 3dd2d40c50
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 新增多个战斗技能效果实现
2026-03-08 10:34:23 +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"
)
// 149 - 命中后n%令对方xxm%令对方XX
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{})
}