Files
bl/logic/service/fight/effect/442.go
xinian 3dd2d40c50
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 新增多个战斗技能效果实现
2026-03-08 10:34:23 +08:00

32 lines
694 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"
)
// 442 - m%令对手XX每次造成的伤害值都将恢复自身体力
type Effect442 struct {
node.EffectNode
}
func (e *Effect442) OnSkill() bool {
chance := e.Args()[0].IntPart()
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart())) // 以麻痹为例
if statusEffect != nil {
statusEffect.SetArgs(e.Ctx().Our, 1)
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 442, &Effect442{})
}