42 lines
866 B
Go
42 lines
866 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
// Effect 68: {0}回合内受到致死攻击时则余下1点体力
|
|
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.CurPet[0].GetHP().IntPart() <= 1 {
|
|
return true
|
|
}
|
|
if t.Damage.Cmp(e.Ctx().Our.CurPet[0].GetHP()) >= 0 {
|
|
t.Damage = e.Ctx().Our.CurPet[0].GetHP().Sub(alpacadecimal.NewFromInt(1))
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
// ---- 注册所有效果 ----
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 68, &Effect68{})
|
|
}
|