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

28 lines
552 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/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.CarrierInput().CurPet[0].GetMaxHP()
currentHp := e.CarrierInput().CurPet[0].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{})
}