Files
bl/logic/service/fight/effect/412.go
xinian 875ad668aa
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 实现战斗效果逻辑和接口重构
2026-03-28 21:57:22 +08:00

28 lines
544 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.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{})
}