Files
bl/logic/service/fight/effect/570.go
xinian 322d5ea64d
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
feat: 新增战斗技能效果 524-580
2026-03-17 15:25:08 +08:00

36 lines
793 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"
)
// 570 - 免疫下{0}次受到的攻击
type Effect570 struct {
node.EffectNode
remaining int
}
func (e *Effect570) SetArgs(t *input.Input, a ...int) {
e.EffectNode.Duration(-1)
// 持续次数不是回合用Duration可能不合适但可以用次数。我们通过子效果计数
}
func (e *Effect570) DamageLockEx(t *info.DamageZone) bool {
if e.remaining > 0 && t.Type == info.DamageType.Red {
t.Damage = alpacadecimal.Zero
e.remaining--
if e.remaining <= 0 {
e.Alive(false) // 效果结束
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 570, &Effect570{})
}