Files
bl/logic/service/fight/effect/442.go
xinian 78a68148ce
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
chore: update fight logic and effect implementations
2026-04-05 02:25:44 +08:00

32 lines
722 B
Go

package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// Effect 442: {0}%另对手{1},每次造成的伤害值都将恢复自身体力
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.CarrierInput().InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart())) // 以麻痹为例
if statusEffect != nil {
statusEffect.SetArgs(e.CarrierInput(), 1)
e.TargetInput().AddEffect(e.CarrierInput(), statusEffect)
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 442, &Effect442{})
}