2026-03-09 23:44:09 +08:00
|
|
|
|
package effect
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"blazing/logic/service/fight/input"
|
|
|
|
|
|
"blazing/logic/service/fight/node"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
2026-03-28 21:57:22 +08:00
|
|
|
|
// Effect 412: 若自身体力小于1/{0},则每次攻击不消耗PP值
|
2026-03-09 23:44:09 +08:00
|
|
|
|
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{})
|
|
|
|
|
|
|
|
|
|
|
|
}
|