Files
bl/logic/service/fight/effect/443.go
xinian aa2c8cfb42
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 重构战斗效果实现到独立文件
2026-03-08 15:41:16 +08:00

39 lines
954 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/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 443 - n回合内若受到的伤害超过m则对手疲惫x回合
type Effect443 struct {
node.EffectNode
}
func (e *Effect443) Skill_Use_ex() bool {
damageThreshold := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart()))
if e.Ctx().Our.SumDamage.Cmp(damageThreshold) > 0 {
// 对手疲惫x回合
tiredEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Tired))
if tiredEffect != nil {
tiredEffect.Duration(int(e.Args()[2].IntPart())) // x回合
e.Ctx().Opp.AddEffect(e.Ctx().Our, tiredEffect)
}
}
return true
}
func (e *Effect443) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.Skill, 443, &Effect443{})
}