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
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-06 15:11:42 +08:00
|
|
|
|
func (e *Effect68) DamageLock_ex(t *info.DamageZone) bool {
|
2025-11-14 04:23:50 +08:00
|
|
|
|
if !e.Hit() {
|
|
|
|
|
|
return true
|
|
|
|
|
|
}
|
|
|
|
|
|
if e.Ctx().SkillEntity == nil {
|
|
|
|
|
|
return true
|
|
|
|
|
|
}
|
|
|
|
|
|
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
|
|
|
|
return true
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//fmt.Println("Effect68_o", t.Damage)
|
|
|
|
|
|
//伤害溢出
|
2025-11-14 23:09:16 +08:00
|
|
|
|
if t.Type == info.DamageType.Red && t.Damage.Cmp(e.Ctx().Our.CurrentPet.GetHP()) == 1 {
|
|
|
|
|
|
//e.Ctx().Our.CurrentPet.Info.Hp = 1
|
2025-12-05 00:24:02 +08:00
|
|
|
|
t.Damage = e.Ctx().Our.CurrentPet.GetHP().Sub(alpacadecimal.NewFromInt(1))
|
2025-11-14 04:23:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
//fmt.Println("Effect68_n", t.Damage)
|
|
|
|
|
|
return true
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ---- 注册所有效果 ----
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
input.InitEffect(input.EffectType.Skill, 68, &Effect68{})
|
|
|
|
|
|
}
|