2025-11-14 04:23:50 +08:00
|
|
|
|
package effect
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"blazing/logic/service/fight/info"
|
|
|
|
|
|
"blazing/logic/service/fight/input"
|
|
|
|
|
|
"blazing/logic/service/fight/node"
|
2025-11-14 23:09:16 +08:00
|
|
|
|
|
2025-12-05 00:24:02 +08:00
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
2025-11-14 04:23:50 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// 1回合内,受到致死攻击时则余下1点体力
|
|
|
|
|
|
// ---- Effect68 ----
|
|
|
|
|
|
type Effect68 struct {
|
|
|
|
|
|
node.EffectNode
|
|
|
|
|
|
StatusID int
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-06 01:34:26 +08:00
|
|
|
|
func (e *Effect68) DamageLockEx(t *info.DamageZone) bool {
|
2026-01-04 21:41:10 +08:00
|
|
|
|
|
2025-11-14 04:23:50 +08:00
|
|
|
|
if e.Ctx().SkillEntity == nil {
|
|
|
|
|
|
return true
|
|
|
|
|
|
}
|
|
|
|
|
|
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
|
|
|
|
return true
|
|
|
|
|
|
}
|
2026-03-07 11:44:16 +08:00
|
|
|
|
if t.Type != info.DamageType.Red {
|
|
|
|
|
|
return true
|
2025-11-14 04:23:50 +08:00
|
|
|
|
}
|
2026-03-08 18:43:56 +08:00
|
|
|
|
if e.Ctx().Our.CurrentPet.GetHP().IntPart() <= 1 {
|
2026-03-08 18:25:09 +08:00
|
|
|
|
return true
|
|
|
|
|
|
}
|
2026-03-08 18:43:56 +08:00
|
|
|
|
if t.Damage.Cmp(e.Ctx().Our.CurrentPet.GetHP()) >= 0 {
|
2026-03-08 18:25:09 +08:00
|
|
|
|
t.Damage = e.Ctx().Our.CurrentPet.GetHP().Sub(alpacadecimal.NewFromInt(1))
|
|
|
|
|
|
}
|
2026-03-07 11:44:16 +08:00
|
|
|
|
|
2025-11-14 04:23:50 +08:00
|
|
|
|
return true
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ---- 注册所有效果 ----
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
input.InitEffect(input.EffectType.Skill, 68, &Effect68{})
|
|
|
|
|
|
}
|