Files
bl/logic/service/fight/effect/effect_68.go
xinian 53cf3191c2
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
fix: 修正战斗伤害锁与结束判定逻辑
2026-03-08 18:43:56 +08:00

43 lines
881 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"
)
// 1回合内受到致死攻击时则余下1点体力
// ---- Effect68 ----
type Effect68 struct {
node.EffectNode
StatusID int
}
func (e *Effect68) DamageLockEx(t *info.DamageZone) bool {
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if t.Type != info.DamageType.Red {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().IntPart() <= 1 {
return true
}
if t.Damage.Cmp(e.Ctx().Our.CurrentPet.GetHP()) >= 0 {
t.Damage = e.Ctx().Our.CurrentPet.GetHP().Sub(alpacadecimal.NewFromInt(1))
}
return true
}
// ---- 注册所有效果 ----
func init() {
input.InitEffect(input.EffectType.Skill, 68, &Effect68{})
}