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

31 lines
730 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// Effect 552: 若对手处于异常状态,则{0}%概率附加{1}点伤害
type Effect552 struct {
node.EffectNode
}
func (e *Effect552) DamageModify(t *info.DamageZone) bool {
if t.Type == info.DamageType.Red && e.Ctx().Opp.StatEffect_Exist_all() {
chance := e.Args()[0].IntPart()
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
extra := alpacadecimal.NewFromInt(e.Args()[1].IntPart())
t.Damage = t.Damage.Add(extra)
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 552, &Effect552{})
}