Files
bl/logic/service/fight/boss/NewSeIdx_224.go
xinian 9c6f3988de
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 重构 CurrentPet 为 CurPet
2026-04-04 04:34:43 +08:00

45 lines
1.1 KiB
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"
"github.com/alpacahq/alpacadecimal"
"github.com/samber/lo"
)
// 224. 对方用这些技能时, 对自身的命中率为0 (最多8个 / 不要与必中技能一起配置);a1-a8: 有效技能ID
// TODO: 实现对方用这些技能时, 对自身的命中率为0 (最多8个 / 不要与必中技能一起配置);a1-a8: 有效技能ID的核心逻辑
type NewSel224 struct {
NewSel0
}
func (e *NewSel224) Skill_Use() bool {
if e.ID().GetCatchTime() != e.Ctx().Our.CurPet[0].Info.CatchTime {
return true
}
// 技能为空时不处理
skill := e.Ctx().SkillEntity
if skill == nil {
return true
}
_, ok := lo.Find(e.Args(), func(item alpacadecimal.Decimal) bool {
return skill.XML.ID == int(item.IntPart())
})
if !ok {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: e.Ctx().Opp.CurPet[0].GetHP().Div(alpacadecimal.NewFromInt(3)),
})
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 324, &NewSel224{})
}