Files
bl/logic/service/fight/effect/412.go

28 lines
544 B
Go
Raw Normal View History

package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// Effect 412: 若自身体力小于1/{0}则每次攻击不消耗PP值
type Effect412 struct {
node.EffectNode
}
func (e *Effect412) HookPP(count *int) bool {
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
currentHp := e.Ctx().Our.CurrentPet.GetHP()
threshold := maxHp.Div(e.Args()[0]) // 1/n
if currentHp.Cmp(threshold) < 0 {
*count = 0
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 412, &Effect412{})
}