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

52 lines
1.0 KiB
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// Effect 46: 抵挡下{0}次对手的攻击
type Effect46 struct {
node.EffectNode
//StatusID int
conut int64
}
func (e *Effect46) Damage_Shield(t *info.DamageZone) bool {
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
//fmt.Println("Effect46_o", t.Damage)
if t.Type == info.DamageType.Red {
e.conut++
t.Damage = alpacadecimal.Zero
}
if e.Args()[0].IntPart() == e.conut {
e.Alive(false)
return true
}
//fmt.Println("Effect46_n", t.Damage)
return true
}
func (e *Effect46) SetArgs(t *input.Input, a ...int) {
//e.CanStack(-1)//后续的不会顶掉这个效果
e.EffectNode.SetArgs(t, a...)
e.Duration(-1) //次数类,无限回合
}
// ---- 注册所有效果 ----
func init() {
input.InitEffect(input.EffectType.Skill, 46, &Effect46{})
}