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

34 lines
732 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"github.com/alpacahq/alpacadecimal"
)
// Effect 522: {0}回合内若自身处于异常状态则受到伤害减少{1}点
type Effect522 struct {
RoundEffectArg0Base
}
func (e *Effect522) DamageSubEx(t *info.DamageZone) bool {
if e.Ctx().Our.StatEffect_Exist_all() { // 自身处于异常状态
// 减少受到的伤害m点
damageReduction := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart()))
if t.Damage.Cmp(e.Args()[1]) > 0 {
t.Damage = t.Damage.Sub(damageReduction)
} else {
t.Damage = alpacadecimal.Zero
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 522, &Effect522{})
}